Skip to content
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

Merged
merged 2 commits into from
Jul 17, 2023

Conversation

kevinbarabash
Copy link
Contributor

@kevinbarabash kevinbarabash commented Jul 12, 2023

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

@kevinbarabash kevinbarabash self-assigned this Jul 12, 2023
@changeset-bot
Copy link

changeset-bot bot commented Jul 12, 2023

🦋 Changeset detected

Latest commit: 28e5e63

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When 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

@khan-actions-bot
Copy link
Contributor

khan-actions-bot commented Jul 12, 2023

Gerald

Required Reviewers
  • @Khan/perseus for changes to package.json, tsconfig.json, yarn.lock, .changeset/afraid-dancers-sleep.md, utils/extract-strings.ts, utils/pre-publish-check-ci.ts, config/build/gen-flow-types.ts

Don't want to be involved in this pull request? Comment #removeme and we won't notify you of further changes.

@khan-actions-bot khan-actions-bot requested a review from a team July 12, 2023 23:16
@github-actions
Copy link
Contributor

github-actions bot commented Jul 12, 2023

Size Change: 0 B

Total Size: 823 kB

ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 38 kB
packages/kmath/dist/es/index.js 4.13 kB
packages/math-input/dist/es/index.js 78 kB
packages/perseus-core/dist/es/index.js 55 B
packages/perseus-editor/dist/es/index.js 268 kB
packages/perseus-error/dist/es/index.js 705 B
packages/perseus-linter/dist/es/index.js 21.2 kB
packages/perseus/dist/es/index.js 397 kB
packages/pure-markdown/dist/es/index.js 3.65 kB
packages/simple-markdown/dist/es/index.js 12.6 kB

compressed-size-action

@github-actions
Copy link
Contributor

github-actions bot commented Jul 12, 2023

npm Snapshot: Published

🎉 Good news!! We've packaged up the latest commit from this PR (138ea1f) and published it to npm. You
can install it using the tag PR610.

Example:

yarn add @khanacademy/perseus@PR610

@coveralls
Copy link
Collaborator

Coverage Status

coverage: 69.02% (+23.5%) from 45.569% when pulling 28e5e63 on swc-node-shebang into 9916bce on main.

@coveralls
Copy link
Collaborator

coveralls commented Jul 12, 2023

Coverage Status

coverage: 69.017% (+23.4%) from 45.569% when pulling 28e5e63 on swc-node-shebang into 9916bce on main.

Copy link
Collaborator

@jeremywiebe jeremywiebe left a 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",
Copy link
Collaborator

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!

@kevinbarabash kevinbarabash merged commit 650093c into main Jul 17, 2023
27 checks passed
@kevinbarabash kevinbarabash deleted the swc-node-shebang branch July 17, 2023 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants