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(create-mud): rip out create-create-app #3479

Merged
merged 10 commits into from
Jan 21, 2025
Merged

feat(create-mud): rip out create-create-app #3479

merged 10 commits into from
Jan 21, 2025

Conversation

holic
Copy link
Member

@holic holic commented Jan 21, 2025

I ripped out create-create-app because it's getting in the way of new templates and we were only using it to 1) recursively copy files and 2) inject the MUD version.

I am using yargs-interactive here for now because that's what create-create-mud used, but we can swap this out later for something else that gives us more power or flexibility or better types.

Due to limitations of yargs-interactive, this changes the CLI slightly from

pnpm create mud <name>

to

pnpm create mud

where the latter prompts first for the project name, which is arguably a better experience. You can still provide both the name and template as CLI args.
image

@holic holic requested a review from alvrs as a code owner January 21, 2025 15:29
Copy link

changeset-bot bot commented Jan 21, 2025

🦋 Changeset detected

Latest commit: 78e9ed1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 29 packages
Name Type
create-mud Patch
@latticexyz/abi-ts Patch
@latticexyz/block-logs-stream Patch
@latticexyz/cli Patch
@latticexyz/common Patch
@latticexyz/config Patch
@latticexyz/dev-tools Patch
@latticexyz/entrykit Patch
@latticexyz/explorer Patch
@latticexyz/faucet Patch
@latticexyz/gas-report Patch
@latticexyz/paymaster Patch
@latticexyz/protocol-parser Patch
@latticexyz/react Patch
@latticexyz/recs Patch
@latticexyz/schema-type Patch
solhint-config-mud Patch
solhint-plugin-mud Patch
@latticexyz/stash Patch
@latticexyz/store-consumer Patch
@latticexyz/store-indexer Patch
@latticexyz/store-sync Patch
@latticexyz/store Patch
@latticexyz/utils Patch
vite-plugin-mud Patch
@latticexyz/world-module-erc20 Patch
@latticexyz/world-module-metadata Patch
@latticexyz/world-modules Patch
@latticexyz/world Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel vercel bot temporarily deployed to Preview – explorer January 21, 2025 15:41 Inactive
Comment on lines 50 to 55
if (/package\.json$/.test(sourceFile)) {
const source = await fs.readFile(sourceFile, "utf-8");
await fs.writeFile(targetFile, source.replaceAll(/{{mud-version}}/g, args.mudVersion), "utf-8");
} else {
await fs.copyFile(sourceFile, targetFile);
}
Copy link
Member Author

@holic holic Jan 21, 2025

Choose a reason for hiding this comment

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

If we didn't have to do a string replace on specific files, this could be simplified to

fs.cp(sourceDir, targetDir, { recursive: true })

alvrs
alvrs previously approved these changes Jan 21, 2025
@vercel vercel bot temporarily deployed to Preview – explorer January 21, 2025 15:52 Inactive
@vercel vercel bot temporarily deployed to Preview – explorer January 21, 2025 15:53 Inactive
@holic holic force-pushed the holic/template-cli branch from d8fc82c to d252fd6 Compare January 21, 2025 16:05
@vercel vercel bot temporarily deployed to Preview – explorer January 21, 2025 16:05 Inactive
@holic holic requested a review from ludns as a code owner January 21, 2025 16:32
@holic holic merged commit e45e375 into main Jan 21, 2025
18 of 27 checks passed
@holic holic deleted the holic/template-cli branch January 21, 2025 16:47
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.

2 participants