Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ambient import #45

Merged
merged 2 commits into from
May 13, 2024
Merged

Fix ambient import #45

merged 2 commits into from
May 13, 2024

Conversation

schnz
Copy link
Member

@schnz schnz commented May 13, 2024

I just tried to upgrade my extension to the latest versions of @girs/* packages and noticed that two errors from tsc. I would release a new version after approval by one of the other contributors :).

> tsc --noEmit

node_modules/@girs/gnome-shell/dist/ui/workspace.d.ts:4:31 - error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './windowPreview.js'?

4 import { WindowPreview } from './windowPreview';
                                ~~~~~~~~~~~~~~~~~

node_modules/@girs/gnome-shell/dist/ui/workspacesView.d.ts:1:27 - error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './workspace.js'?

1 import { Workspace } from './workspace';
                            ~~~~~~~~~~~~~


Found 2 errors in 2 files.

Errors  Files
     1  node_modules/@girs/gnome-shell/dist/ui/workspace.d.ts:4
     1  node_modules/@girs/gnome-shell/dist/ui/workspacesView.d.ts:1

schnz added 2 commits May 13, 2024 20:21
Fixes a tsc error that is currently reported for projects that use
moduleResolution "node16" or "nodenext":
@Totto16
Copy link
Collaborator

Totto16 commented May 13, 2024

It seems to me, that we need more example files, or use more things in the example, so that we catch such bugs, I never used those ambient modules, so I never checked them, I suppose the same applies to the others, who use those types 🤷🏼‍♂️

@schnz
Copy link
Member Author

schnz commented May 13, 2024

Well, you did a good job, considering that you haven't tested the ambient modules. After all, there were just those 2 minor errors. It took much less time to fix them than to fix the type errors in my extension after upgrading from @girs/gnome-shell from 45.0.0-beta9 to 46.0.0-beta8 which obviously contained quite a bit of changes.

Thanks for the quick approval!

@schnz schnz merged commit 3b6635d into main May 13, 2024
2 checks passed
@schnz schnz deleted the fix-ambient-import branch May 13, 2024 19:37
@Totto16
Copy link
Collaborator

Totto16 commented May 13, 2024

It wasn't just me also @swsnr contributed a lot, and we aren't 100 % sure if those types are all correct, but since this version we mark the manually checked things, so if a runtime error occurs, it likely was not checked by us explicitly (and even if there are changelogs on https://gjs.guide/, they didn't mention everything 😓

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants