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

fix(js): move swc/helpers to dependencies instead of devDependencies #10275

Merged
merged 1 commit into from May 12, 2022

Conversation

nartc
Copy link
Contributor

@nartc nartc commented May 12, 2022

ISSUES CLOSED: #10270

Current Behavior

@swc/helpers is added to lib's devDependencies causing runtime error for the library if the library uses swc/helpers utilities and it's not included in the generatedPackageJson.

Expected Behavior

@swc/helpers should be in dependencies

Related Issue(s)

Fixes #10270

@nx-cloud
Copy link

nx-cloud bot commented May 12, 2022

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 38097d9. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 12 targets

Sent with 💌 from NxCloud.

@vercel
Copy link

vercel bot commented May 12, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
nx-dev ⬜️ Ignored (Inspect) May 12, 2022 at 6:57PM (UTC)

@AgentEnder AgentEnder enabled auto-merge (squash) May 12, 2022 19:00
@yharaskrik
Copy link
Contributor

While this does solve part of the problem, I feel like the @nrwl/node:webpack executor should be able to find the @swc/helpers library and included it in the generated package json, with this change we still need to import '@swc/helpers' in the apps main.ts. Should the webpack executor be able to find that dep itself? Or leave it up to the developers to add the import?

@AgentEnder AgentEnder merged commit 692418d into master May 12, 2022
@nartc
Copy link
Contributor Author

nartc commented May 12, 2022

@yharaskrik the same thing happens for tslib. If you just build a Nest app, the built artifact does use tslib (decorators) but tslib isn't part of the generated package.json. So not sure if it's a limitation to nrwl/js IMHO. That said, I have this example where I run the built app in docker and I run npm install tslib explicitly as a separate step in the docker (https://github.com/nartc/nx-microservice-docker/blob/main/apps/order-api/dockerfile)

@AgentEnder
Copy link
Member

@nartc is this still the case? We have merged #9350 which I thought fixed the tslib error. Maybe a similar approach could be used for @swc/helpers?

@nartc
Copy link
Contributor Author

nartc commented May 12, 2022

@AgentEnder nest app uses node:webpack. But yeah, similar approach could be used for swc/helpers

@AgentEnder
Copy link
Member

Interesting, we should look at porting that logic for tslib over to the node:webpack executor as well as introducing similar for swc.

@FrozenPandaz FrozenPandaz deleted the swcrc-helpers-dependencies branch June 7, 2022 23:30
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@swc/helpers not included in package.json for nest apps with incr compiled libs
3 participants