-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
pr05 Typescript Migration #10: Setup Server TS Dependencies & migrate instance of server file #3636
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 17 commits into
processing:develop
from
clairep94:pr05/setup_server_ts_deps
Sep 16, 2025
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
1b03597
tsconfig: add tsconfig for server
clairep94 97c4487
add typecheck:server command and add server-check to main typecheck
clairep94 359c58c
server/utils/generateFileSystemSafeName.js: migrate to ts, no-verify
clairep94 85b9472
server/utils/generateFileSystemSafeName: add types to params
clairep94 4a98bbb
index.js: update babel/register to resolve both js and ts files
clairep94 cf33500
nodemon.json: update to hot-reload on ts file changes
clairep94 e12ad57
utils/generateFileSystemSafeName: update to named export
clairep94 5210f5c
webpack: update examples and server config files to auto-resolve ts e…
clairep94 6b5ab98
webpack: update client-dev and client-prod config to auto-resolve ser…
clairep94 9fb10e5
server/views/previewIndex: update to ts
clairep94 1757455
server/views/previewIndex: update to named export
clairep94 0663d24
server/views/index: update to ts, no-verify
clairep94 38409a6
views/index: update to named export and add types
clairep94 c69579d
update jest config to resolve ts files in server with babel
clairep94 914963a
generateFileSystemSafeName: update variable name for string
clairep94 a6adfec
tsconfig: address comma dangle
clairep94 b6a1f95
Merge branch 'develop' into pr05/setup_server_ts_deps
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,6 @@ | |
"lib": ["DOM", "ESNext"], | ||
"jsx": "react", | ||
}, | ||
"include": ["./**/*"], | ||
"exclude": ["../node_modules", "../server"] | ||
} |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,5 +12,5 @@ | |
"env": { | ||
"NODE_ENV": "development" | ||
}, | ||
"ext": "js json" | ||
"ext": "js ts json" | ||
} |
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 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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"extends": "../tsconfig.base.json", | ||
"compilerOptions": { | ||
"target": "ES2022", | ||
"module": "commonjs", | ||
"lib": ["ES2022"], | ||
"types": ["node", "jest"] | ||
}, | ||
"include": ["./**/*"], | ||
"exclude": ["../node_modules", "../client"] | ||
} |
13 changes: 7 additions & 6 deletions
13
server/utils/generateFileSystemSafeName.js → server/utils/generateFileSystemSafeName.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
/** | ||
* generate file system safe string for a given string | ||
* generate file system safe string for a given name | ||
* that can be used as a valid file name | ||
* in all operating systems | ||
* @param {String} string | ||
* @param {String} originalName | ||
* @param {String} replacer (optional) character to replace invalid characters | ||
*/ | ||
function generateFileSystemSafeName(string, replacer) { | ||
export function generateFileSystemSafeName( | ||
originalName: string, | ||
replacer: string | ||
) { | ||
// from here https://serverfault.com/a/242134 | ||
const INVALID_CHARS_REGEX = /[*/?:\\<>|"\u0000-\u001F]/g; // eslint-disable-line | ||
const slug = string.replace(INVALID_CHARS_REGEX, replacer || ''); | ||
const slug = originalName.replace(INVALID_CHARS_REGEX, replacer || ''); | ||
|
||
return slug; | ||
} | ||
|
||
export default generateFileSystemSafeName; |
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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"files": [], | ||
"references": [ | ||
{ "path": "client" }, | ||
// { "path": "server" } | ||
{ "path": "./client" }, | ||
{ "path": "./server" } | ||
], | ||
} |
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 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 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 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
Oops, something went wrong.
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.
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.
no big deal either way but would you want to use the helper utils you wrote for this case & the ones below?
p5.js-web-editor/client/utils/parseStringToType.ts
Line 33 in 2336986
the only thing is you'd have to move the utility file into common/