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

feat(node): consolidate js and node plugins #9086

Merged
merged 2 commits into from Feb 23, 2022
Merged

Conversation

jaysoo
Copy link
Member

@jaysoo jaysoo commented Feb 22, 2022

This PR consolidates the executors and generators in the @nrwl/js and @nrwl/node plugins.

Why?

We want to move any Node concerns back to the @nrwl/node plugin, same way that we have @nrwl/web handle everything that's specific to the web platform.

The@nrwl/js plugin is trimmed to just handle to generic TypeScript project development--no assumptions on runtime platform. You can still wire up a Node app using only @nrwl/js, just as you could make a web app the using it.

The @nrwl/node plugin provides additional features like static linking (i.e. bundling) that may be desirable when shipping Node apps as microservices.

Note, most of the changes are in the first commit. The other changes are updating docs.

Changes

  • Remove @nrwl/js:app generator since it is no longer a use-case for the JS plugin

  • Remove @nrwl/js:node executor + migration to use @nrwl/node:node and install @nrwl/node if necessary

  • Remove @nrwl/node:package executor since users should use JS plugin to build packages + migration to use @nrwl/js:tsc

  • Rename @nrwl/node:build executor to @nrwl/node:webpack + migration

  • Rename @nrwl/node:execute executor to @nrwl/node:node + migration

  • Update @nrwl/nx-plugin:plugin to use @nrwl/js:library when generating new plugin (instead of @nrwl/node:library)

  • Re-enables SWC e2e tests, now that CI is on Node 16

@nx-cloud
Copy link

nx-cloud bot commented Feb 22, 2022

☁️ Nx Cloud Report

CI ran the following commands for commit 1d65804. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 7 targets

Sent with 💌 from NxCloud.

@vercel
Copy link

vercel bot commented Feb 22, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nrwl/nx-dev/4JKqA4f7st6M89yr4RdxEwVLEycN
✅ Preview: https://nx-dev-git-fork-jaysoo-js-webpack-app-nrwl.vercel.app

[Deployment for 1d65804 canceled]

@jaysoo jaysoo changed the title Js webpack app feat(node): consolidate js and node plugins Feb 22, 2022
@@ -9,13 +9,6 @@
"x-type": "library",
"description": "Create a library"
},
"application": {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still referenced in the docs 🙃
https://nx.dev/getting-started/nx-and-typescript#create-a-typescript-based-application

Tripped me up why this wasn't working.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Propogated this message internally to see what we could do there. Thank you

meeroslav pushed a commit to meeroslav/nx that referenced this pull request Mar 4, 2022
* chore(node): update docs after consolidating js and node plugins

* feat(node): consolidate js and node plugins
@fbartho
Copy link

fbartho commented Mar 8, 2022

FYI: We didn't get any automatic migrations when we tried to go from 13.8.3 to 13.8.5 -- also, shouldn't this have been a major version update?

@nartc
Copy link
Contributor

nartc commented Mar 9, 2022

@fbartho since we provided the migration, the changes didn't make it to a major version update. I wasn't able to reproduce this. I ran the following commands to try to reproduce:

npx create-nx-workspace@13.8.3 my-workspace --preset=ts --nx-cloud=false
cd my-workspace
npm i -DE @nrwl/express@13.8.3
npx nx g @nrwl/express:app api

At this point, my api serve target has nrwl/node:execute as the executor.

npx nx migrate @nrwl/workspace # migrate to 13.8.5
npm i # run install after update
npx nx migrate --run-migrations # run migrations

Now my api serve target has nrwl/node:node as the executor which proves that the migration was run successfully.

If you still run into issues, please open a new issue with reproduce steps so we can track it better. Thanks.

@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.

None yet

4 participants