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(nx-spawn): Improve dependency execution #60

Merged
merged 4 commits into from
Jul 29, 2022
Merged

Conversation

luxaritas
Copy link
Member

I wound up rewriting most of nx-spawn to pull from Nx's task runner code. We're now properly running dependencies only once and waiting for build outputs to be present before continuing with other tasks that rely on it.

To make build-watch/serve work properly with this, I've also had to prevent vite from removing the dist directory when it rebuilds - see the comments in the core vite config. I've also made it automatically watch when running in development mode for convinience.

Bonus: I realized that the reason why the package-lock kept getting corrupted from under me was because the npm i in the distify build process was touching it, and incorrectly changing some metadata. I've updated it to use --save=false to avoid this.

Resolves #13
Resolves #23

@luxaritas luxaritas requested a review from tkaragianes July 29, 2022 00:44
Copy link
Contributor

@tkaragianes tkaragianes left a comment

Choose a reason for hiding this comment

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

I'm starting to get a little worried about the amount of plumbing we're introducing. We've got nx and vite, but they're very heavily customized. For me, more documentation about the motivations behind our departures from the norm would be helpful. The code is well commented, but I feel like I'm lacking the why behind some of the choices.

packages/nx-spawn/README.md Outdated Show resolved Hide resolved
packages/nx-spawn/src/index.ts Show resolved Hide resolved
@luxaritas luxaritas merged commit 64cb75c into main Jul 29, 2022
@luxaritas luxaritas deleted the feat/spawn-nx-runner branch July 29, 2022 23:22
@luxaritas luxaritas modified the milestone: 2.0 Jul 30, 2022
@github-actions github-actions bot mentioned this pull request Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants