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

Allow specifying options with sucrase/register and related tools #813

Merged
merged 1 commit into from Jul 19, 2023

Conversation

alangpierce
Copy link
Owner

Fixes #792

This PR adds a new environment variable SUCRASE_OPTIONS that works with the require hook and other tools that are based on the require hook (sucrase-node and programmatically registering a hook). Its format is simply a JSON string that is parsed and merged with the usual options. Hopefully this will be rare, especially after a semver-major change to better defaults, but it's important for some cases.

Fixes #792

This PR adds a new environment variable SUCRASE_OPTIONS that works with the
require hook and other tools that are based on the require hook (`sucrase-node`
and programmatically registering a hook). Its format is simply a JSON string
that is parsed and merged with the usual options. Hopefully this will be rare,
especially after a semver-major change to better defaults, but it's important
for some cases.
@codecov
Copy link

codecov bot commented Jul 18, 2023

Codecov Report

Merging #813 (1553ce5) into main (d617368) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #813   +/-   ##
=======================================
  Coverage   88.70%   88.70%           
=======================================
  Files          56       56           
  Lines        6082     6082           
  Branches     1446     1446           
=======================================
  Hits         5395     5395           
  Misses        421      421           
  Partials      266      266           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@github-actions
Copy link

Benchmark results

Before this PR: 402.9 thousand lines per second
After this PR: 401.7 thousand lines per second

Measured change: 0.31% slower (0.43% slower to 1.85% faster)
Summary: Likely no significant difference

@alangpierce alangpierce merged commit 4bd800b into main Jul 19, 2023
8 checks passed
@alangpierce alangpierce deleted the add-register-options branch July 19, 2023 18:01
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.

Allow arbitrary Sucrase configuration in sucrase/register and the CLI
1 participant