-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
pr05 Typescript #2: automatically resolve imports of ts files & migrate instance of client/utils file #3540
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
Merged
raclim
merged 7 commits into
processing:develop
from
clairep94:pr05/migrate_client_utils_instance
Jul 28, 2025
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8b6d4df
migrate generateRandomName to TS
clairep94 3ff98ed
attempt to update eslint to allow auto importing ts js files
clairep94 79d9a4b
removed unused util
clairep94 4e606e5
add jsdocs for generateRandomName instead of tests
clairep94 6d842b5
resolve ts import issue by mocking function implementation
clairep94 e1c7be8
resolve properly by updating mock
clairep94 5b1fd1e
Merge branch 'develop' into pr05/migrate_client_utils_instance
clairep94 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need this, if we're not using the types yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this may be a misunderstanding but i thought we'd only need it if we did something like import {aType} from '@types/sdfdsf' to use aType later on?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yess that's a good point!! I did some searching to double-check on this bc we also have
"skipLibCheck": true
(https://github.com/processing/p5.js-web-editor/blob/develop/tsconfig.base.json#L7), which should allow us to not have to have declaration files within packages in node_modules, but I think it works the following way:If a file is now in typescript and we import another package from node_modules explicitly (eg.
import friendlyWords from 'friendly-words'
https://github.com/processing/p5.js-web-editor/pull/3540/files#diff-f9bdb3c3bbc05033b909e04fcb4a39d7cb8b59f78ae786ab477b20a4a765ec53R1, then we need to install the@types
package forfriendly-words
If
friendly-words
has a peer dependencyother-package-A
that got installed along with it, or if it usesother-package-A
internally, we do not need to install@types
forother-package-A
if we have"skipLibCheck": true
in the TS config settingsSo I think this is expected, and as we go we will likely have to continue installing
@types
packages for any third-party packages we are using in a file that is being migrated (eg.react-router-dom
,jest-react
etc)https://stackoverflow.com/questions/59906323/typescript-skiplibcheck-still-checking-node-modules-libs