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

Add a default export to @swc-node/register #764

Closed
wants to merge 1 commit into from

Conversation

codermarcos
Copy link

@codermarcos codermarcos commented Mar 27, 2024

📝 Description

First of all is my first contribution here so sorry if I'm opening this issue in a wrong place!

I would like to question / suggest a little change that is add an export default to this file packages/register/register.ts to be more specific to this function.

// packages/register/register.ts
export function register(options: Partial<ts.CompilerOptions> = {}, hookOpts = {}) { ... }

It will be something like that:

export function register(options: Partial<ts.CompilerOptions> = {}, hookOpts = {}) { ... }
+ export default register;

✨ Motivation

This is strongly related with these issues:

It is because the previous version @swc/register which now is deprecated used to export it as unamed export so now after upgrade to new version we have to use desconstructing. This is more than expected; it wasn't just a breaking change, the package even changed its name, haha.

// Before
const register = require('@swc/register')
// After
const { register } = require('@swc-node/register')

It should help to fix this issues:

- [gulpjs/interpret - #98](gulpjs/interpret#98)
- [webpack/webpack-cli - #4129](webpack/webpack-cli#4129)

And help in a smoother transition from the old to the new.
Copy link

changeset-bot bot commented Mar 27, 2024

⚠️ No Changeset found

Latest commit: 20d7a4c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@CLAassistant
Copy link

CLAassistant commented Mar 27, 2024

CLA assistant check
All committers have signed the CLA.

@codermarcos codermarcos deleted the patch-1 branch March 28, 2024 02:19
@codermarcos codermarcos restored the patch-1 branch March 28, 2024 02:19
@codermarcos codermarcos deleted the patch-1 branch March 28, 2024 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants