-
Notifications
You must be signed in to change notification settings - Fork 768
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
feat(ci): remove need to compile scripts #5370
Conversation
PR built and packed!Download the tarball here: https://github.com/ionic-team/stencil/actions/runs/9270562098/artifacts/1544405233 If your browser saves files to
|
5587815
to
163dc0c
Compare
This is due to the fact that we are running the workflow from |
@tanner-reits @alicewriteswrongs this is ready for review now. |
@@ -122,6 +119,7 @@ | |||
"rollup-plugin-sourcemaps": "^0.6.3", | |||
"semver": "^7.3.7", | |||
"terser": "5.31.0", | |||
"tsx": "^4.10.3", |
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.
Any reasoning on choosing tsx
over ts-node
? Just curious.
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.
tsx
is much better maintained as ts-node
. I am switching in all my projects to tsx now.
716e5ad
to
c693220
Compare
Definitely a nicer DX here! It's a bit less mysterious why we're doing what we doing for the build here I think. One thing I'm wondering about is type checking for the Anywhooo - just wondering if this is the direction we want to go, since it does open up the possibility of some type errors slipping through in for instance the release scripts and then only showing up as runtime error (or wrong behavior!) when we run on CI. The |
@alicewriteswrongs good catch 👌 I didn't know that! I pushed a change to include type checks as recommend by the tsx docs. |
package.json
Outdated
"tsc.prod": "tsc", | ||
"tsc.scripts": "tsc --build --force scripts/tsconfig.json", | ||
"tsc.watch": "tsc --incremental --watch" | ||
"ts": "tsc --noEmit --project scripts/tsconfig.json && tsx", |
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 is a nice way to do this 👍
package.json
Outdated
"rollup.prod.ci": "rollup --config --config-prod --config-ci", | ||
"rollup.watch": "rollup --watch --config", |
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.
oops guess those snuck through in #5698 😅
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.
😉
82d95e6
to
34e4989
Compare
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.
CI error, but otherwise looks good
This is due to the fact that we are running the workflow from main which still uses the compiled script. Therefore I suggest to suggest merging by bypassing the protection. |
What is the current behavior?
Currently a developer working on Stencil needs to compile the entire scripts folder first before running the files in them. This seems cumbersome and there is an opportunity to improve the DX here.
What is the new behavior?
By adding
tsx
we can get rid of the intermediate build step by running TS files on demand. This simplifies a lot of internal scripts and confusion when it comes to resolving paths.Documentation
Does this introduce a breaking change?
Testing
Checkout the branch and run
npm run build
.Other information
n/a