-
Notifications
You must be signed in to change notification settings - Fork 351
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
Update node scripts consume @swc-node/register via shebang #610
Conversation
🦋 Changeset detectedLatest commit: 28e5e63 The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
GeraldRequired Reviewers
Don't want to be involved in this pull request? Comment |
Size Change: 0 B Total Size: 823 kB ℹ️ View Unchanged
|
npm Snapshot: Published🎉 Good news!! We've packaged up the latest commit from this PR (138ea1f) and published it to npm. You Example: yarn add @khanacademy/perseus@PR610 |
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.
Good stuff!
@@ -126,16 +126,16 @@ | |||
"gen:parsers": "yarn --cwd packages/kas gen:parsers", | |||
"build": "yarn gen:parsers && rollup -c config/build/rollup.config.js", | |||
"build:types": "yarn tsc --build tsconfig-build.json", | |||
"build:flowtypes": "SWCRC=true node -r @swc-node/register config/build/gen-flow-types.ts", | |||
"build:flowtypes": "config/build/gen-flow-types.ts", |
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.
Cool. I like that these are simpler. That'll mean they'll work correctly if just executed from the shell too!
Summary:
We're going to be using this
#!/usr/bin/env -S node -r @swc-node/register
in webpack/services/static/ after migrating that codebase to TypeScript. The benefit of it is that we can run the scripts directly and don't need to a complicated command in package.json.It resads out tsconfig.json and uses the same aliases that are defined in it which is nice. This caused a minor issue in the extract-strings script which imports
@khanacademy/wonder-stuff-i18n
. As a result, I've updated the aliases in the tsconfig to be more conservative.Issue: None
Test plan:
yarn build:types
(output is required by 'build:flowtypes')yarn build:flowtypes
yarn extract-strings
./utils/pre-publish-ci.ts