Skip to content

Commit aa3eaad

Browse files
refactor: simplify package manager flags
1 parent a2b2971 commit aa3eaad

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

.changeset/rotten-shirts-guess.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"create-better-t-stack": minor
3+
---
4+
5+
refactor: simplify package manager flags

apps/cli/src/index.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,12 @@ async function main() {
248248
.option("--docker", "Include Docker setup")
249249
.option("--github-actions", "Include GitHub Actions")
250250
.option("--seo", "Include SEO setup")
251+
.option("--git", "Include git setup")
251252
.option("--no-git", "Skip git initialization")
252-
.option(
253-
"--package-manager <type>",
254-
"Package manager to use (npm, yarn, pnpm, or bun)",
255-
)
253+
.option("--npm", "Use npm package manager")
254+
.option("--pnpm", "Use pnpm package manager")
255+
.option("--yarn", "Use yarn package manager")
256+
.option("--bun", "Use bun package manager")
256257
.parse();
257258

258259
const options = program.opts();
@@ -262,7 +263,15 @@ async function main() {
262263
projectName: projectDirectory || undefined,
263264
database: options.database as ProjectDatabase | undefined,
264265
auth: "auth" in options ? options.auth : undefined,
265-
packageManager: options.packageManager as PackageManager | undefined,
266+
packageManager: options.npm
267+
? "npm"
268+
: options.pnpm
269+
? "pnpm"
270+
: options.yarn
271+
? "yarn"
272+
: options.bun
273+
? "bun"
274+
: undefined,
266275
git: "git" in options ? options.git : undefined,
267276
features:
268277
options.docker || options.githubActions || options.seo

apps/cli/src/utils/generate-reproducible-command.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ export function generateReproducibleCommand(config: ProjectConfig): string {
2727
flags.push(chalk.red("--no-git"));
2828
}
2929

30+
// Updated package manager flag handling
3031
if (
3132
config.packageManager &&
3233
config.packageManager !== DEFAULT_CONFIG.packageManager
3334
) {
34-
flags.push(chalk.magenta(`--package-manager ${config.packageManager}`));
35+
flags.push(chalk.magenta(`--${config.packageManager}`));
3536
}
3637

3738
for (const feature of config.features) {

0 commit comments

Comments
 (0)