- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 81
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
🚀 Feature: Infer --base from existing package.json scripts during migration #933
Comments
I'd like to take this, but I'm not quite understanding the potential solution. Could you give me an example please? |
Absolutely - thanks for asking! Suppose {
"scripts": {
"build": "tsup",
"format": "prettier \"**/*\" --ignore-unknown",
"initialize": "tsx ./src/bin/index.js --mode initialize",
"lint": "eslint . .*js --max-warnings 0",
"lint:knip": "knip",
"lint:md": "markdownlint \"**/*.md\" \".github/**/*.md\" --rules sentences-per-line",
"lint:package-json": "npmPkgJsonLint .",
"lint:packages": "pnpm dedupe --check",
"lint:spelling": "cspell \"**\" \".github/**/*\"",
"prepare": "husky install",
"should-semantic-release": "should-semantic-release --verbose",
"test": "vitest",
"tsc": "tsc"
}
} The migration script could infer that the repo is probably using the create-typescript-app/src/shared/options/augmentOptionsWithExcludes.ts Lines 135 to 140 in a51c624
Does that answer what you're looking for? |
Ah yeah, that makes sense! Thanks for the explainer :) |
<!-- 👋 Hi, thanks for sending a PR to create-typescript-app! 💖. Please fill out all fields below and make sure each item is true and [x] checked. Otherwise we may not be able to review your PR. --> ## PR Checklist - [x] Addresses an existing open issue: fixes #933 - [x] That issue was marked as [`status: accepting prs`](https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22) - [x] Steps in [CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/create-typescript-app/blob/main/.github/CONTRIBUTING.md) were taken ## Overview Add a naive solution for checking the existing `package.json` during migration to infer the base. 🐸 --------- Co-authored-by: Josh Goldberg <[email protected]>
🎉 This is included in version v1.42.0 🎉 The release is available on: Cheers! 📦🚀 |
Bug Report Checklist
main
branch of the repository.Overview
Right now, if you run
npx create-typescript-app
in an existing repository made from the template, you always get the standard mode selection:But as a convenience, we could set a default value for this based on
package.json
'sscripts
. Let's say:everything
common
Additional Info
No response
The text was updated successfully, but these errors were encountered: