-
Notifications
You must be signed in to change notification settings - Fork 26
Conversation
To make transition to npm-workspaces and especially ts project references easier. Signed-off-by: Tim_Tech_Dev <Tim_Tech_Dev@protonmail.com>
- Remove lerna - Add npm-workspaces - New buildprocess using typescript project references - Remove webpack ts-loder - Add update-paths.mjs - Fix some ts errors should fix #263 Signed-off-by: Tim_Tech_Dev <Tim_Tech_Dev@protonmail.com>
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.
Just did a brief overview of this PR. Thank you very much for your hard work in advance!
Here's what I found so far:
- we need to update nodecg-io-cli to add the service directory to the nodecg configuration when creating a development install. Running the
bootstrap
script is also not needed anymore and needs to be removed. (can also be after the PR is merged but it would be nice to be able to push an update once we merge this) - providing the
path
object insidecompilerOptions
is to my understanding not necessary. Because we are inside a workspace the typescript compiler can use the normal node module resolution algorithm to figure out imports - monaco-editor in the core and debug dashboard cannot be loaded because they are not inside the
node_modules
directory of the corresponding dashboard anymore. Insteadmonaco-editor
is now also put in thenode_modules
directory inside the repository root. To fix this I would propose to mount the rootnode_modules
using a nodecg mount and then importing it from there - I personally would not check in the
samples/tsconfig.json
,services/tsconfig.json
andutils/tsconfig.json
because they are generated at build time. Then we also wouldn't need to run prettier on each build which saves some time. I don't see any real advantage that we would have, if we would commit them .scripts/create-service.py
needs to be update to create services in the newservices
directory and to update the package name in thetsconfig.json
of the generated sample. The "create a service"-guide also needs updating but may be replaced with a guide explaining how the service creation script is used
Thanks for your response. I will create two pull request accompanying this one (docs and CLI), but they are not ready yet, and I'm quite busy atm. So the stuff on the To-do list:
|
Well, I can build and use the dashboard in the current branch, so I can't find this problem. May you explain the issue more clearly? Thank you. |
- Remove type mapping - Update create_service.py - Update update-paths.mjs - Remove build scripts from nodecg-io-serial Signed-off-by: Tim_Tech_Dev <Tim_Tech_Dev@protonmail.com>
Why does the lint fail? |
Hmmm, for me it fails because
Previously running |
I could reproduce the error now. |
- Use `nodecg.mount` - Remove tsconfig files wich are generated at build time - Fix lint CI - Format CI Signed-off-by: Tim_Tech_Dev <Tim_Tech_Dev@protonmail.com>
Left some code from testing :|
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.
Can you please update the directories inside the repository field of all service packages like you documented in https://github.com/codeoverflow-org/nodecg-io-docs/pull/75/files#diff-dbc6349c40b8736d2697bba02f2acc769d89b3c6636d0b268ad6b1028cb29eaeL34?
After that this PR should be finally ready to be merged 🎉
- Thanks daniel0611 Signed-off-by: Tim_Tech_Dev <Tim_Tech_Dev@protonmail.com>
Signed-off-by: Tim_Tech_Dev <Tim_Tech_Dev@protonmail.com>
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.
Thank you very much for you PR. I've found two more things, but will merge this anyways. You can create a follow-up PR for those.
Sorry I've taken so long to review this.
"watch": "lerna run --parallel watch", | ||
"prewatch": "npm run update", | ||
"watch": "tsc -b -w", | ||
"postwatch": "npm run watch --workspaces --if-present", |
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.
postwatch
sadly won't work as intented because watch
never finishes. Therefore postwatch
will never be executed. Also running watch
in each directory also has its problems because they are executed one after another and don't terminate, so only the first one would be executed.
To be honest I think it is fine if only the code added to the root tsconfig.json
is watched, but having it watch everything would obiously be nice.
"build": "lerna run --stream build", | ||
"clean": "tsc -b --clean", | ||
"update": "node .scripts/update-paths.mjs", | ||
"postupdate": "prettier -w --loglevel silent \"./**/*.json\"", |
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.
I assume you've added this to ensure that the generated tsconfig.json
s have proper formatting. Can this be removed as we're not commiting the generated tsconfig.json
s anymore? Would be nice to be able to shave off another ~2 seconds off from the build time.
Should fix #263
Contents
lerna
npm-workspaces
ts-loder
Time savings
Before
After