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

chore: use packlist to write node_module ignores #5363

Merged
merged 1 commit into from Oct 5, 2022
Merged

Conversation

lukekarrys
Copy link
Member

@lukekarrys lukekarrys commented Aug 24, 2022

The gitignore file inside node_modules/ is now an allow list built
from the output of npm-packlist. This means that the only dependencies
that get checked in to source control are those that will end up in the
packed tarball, with the exception of some files that we always ignore.

This also moves the dependencies required to build the docs workspace
from devDependencies to dependencies so they are available for making
the docs after pruning. Ignoring these from source control was the
reason that the change to how we build the gitignore file was necessary.

@fritzy fritzy force-pushed the latest branch 2 times, most recently from 3037d35 to f3b0c43 Compare September 14, 2022 23:09
@lukekarrys lukekarrys force-pushed the lk/bundle-deps branch 2 times, most recently from 5027bb9 to 6cd2133 Compare September 21, 2022 21:03
@lukekarrys lukekarrys changed the title fix: correctly report children of linked bundled deps as bundled chore: use packlist to write node_module ignores Oct 4, 2022
@lukekarrys lukekarrys force-pushed the lk/bundle-deps branch 6 times, most recently from 6225cdc to bb436a8 Compare October 4, 2022 23:19
@lukekarrys lukekarrys marked this pull request as ready for review October 4, 2022 23:31
@lukekarrys lukekarrys requested a review from a team as a code owner October 4, 2022 23:31
@lukekarrys
Copy link
Member Author

lukekarrys commented Oct 5, 2022

I started work on this originally using npm query so the results were all paths to directories which I then parsed into the gitignore format.

I just realized that now that this is using packlist, we could put the output of packlist directly into gitignore (filtered down to only paths that start with node_modules/), since packlist returns a list of individual files. The tradeoff would be a bigger gitignore file, but most of the complexity of the bundle-and-gitignore file would go away.

This is incorrect. In order to build an allow style list of nested paths in a gitignore file, you have to allow each previously ignored directory, so we'd still need most of what this file is doing.

The gitignore file inside `node_modules/` is now an allow list built
from the output of `npm-packlist`. This means that the only dependencies
that get checked in to source control are those that will end up in the
packed tarball, with the exception of some files that we always ignore.

This also moves the dependencies required to build the docs workspace
from devDependencies to dependencies so they are available for making
the docs after pruning. Ignoring these from source control was the
reason that the change to how we build the gitignore file was necessary.
@wraithgar wraithgar merged commit 92e94e3 into latest Oct 5, 2022
@wraithgar wraithgar deleted the lk/bundle-deps branch October 5, 2022 18:27
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.

None yet

2 participants