fix(create-mud): include .gitignore
files in created projects
#1945
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This Pull Request resolves #1865, where projects created by
create-mud
are missing.gitignore
files, specifically in versions2.0.0-next.13
and2.0.0-next.14
.The cause is an update in
npm-packlist
, used during the npm package publishing process to list target package files. The MUD's release commandchangeset publish
relies onnpm-packlist
throughpnpm publish
.The previous version of
npm-packlist
included.gitignore
files by respecting the.npmignore
file, but the latest version doesn't. This change is not documented in its changelog, but based on this issue's comment, it seems better not to expect.gitignore
files to be included.This PR addresses this issue by utilizing
create-create-app
's feature for handling.gitignore
. During the build process ofcreate-mud
,.gitignore
files are renamed togitignore
, ensuring their inclusion in the package. When thecreate-mud
cli is executed,create-create-app
automatically renames thosegitignore
files back to.gitignore
for project creation.To test the fix, you can run
pnpm build && dist/cli.js test-project
.Reference: #336
Testing the
npm-packlist
behavior:To observe the behavior change in
npm-packlist
, we can usepnpm pack
ornpm pack
without the changes from this PR.