-
Notifications
You must be signed in to change notification settings - Fork 203
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
Conversation
🦋 Changeset detectedLatest commit: 78e9ed1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 29 packages
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 |
packages/create-mud/src/bin/cli.ts
Outdated
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); | ||
} |
There was a problem hiding this comment.
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 })
d8fc82c
to
d252fd6
Compare
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
to
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](https://private-user-images.githubusercontent.com/508855/405284176-64512807-1e80-4805-a0cb-bfcafb98bb37.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMTAzMzQsIm5iZiI6MTczOTAxMDAzNCwicGF0aCI6Ii81MDg4NTUvNDA1Mjg0MTc2LTY0NTEyODA3LTFlODAtNDgwNS1hMGNiLWJmY2FmYjk4YmIzNy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwOFQxMDIwMzRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0yZWNiMmYyYzQzZDY5OWYxODRhZWMxNWZlYzlhYWVhOWUwMDViM2JkMDkxNGI4NDBiMDZiYTUyZTY1Mzk2ZjgwJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.MV_hw1aD5EmefTFAWiKKS-56RU8J9lpLjjYsFf-zXOg)