Skip to content

Commit ddfa972

Browse files
authored
feat: add --no-toolchain option to skip toolchain selection (#294)
Allow users to explicitly opt out of toolchain selection via CLI by passing --no-toolchain, which skips the interactive prompt and creates the project without any toolchain (ESLint/Biome).
1 parent 067b266 commit ddfa972

File tree

3 files changed

+22
-16
lines changed

3 files changed

+22
-16
lines changed

packages/cta-cli/src/cli.ts

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -338,20 +338,22 @@ Remove your node_modules directory and package lock file and re-install.`,
338338
}
339339

340340
if (toolchains.size > 0) {
341-
program.option<string>(
342-
`--toolchain <${Array.from(toolchains).join('|')}>`,
343-
`Explicitly tell the CLI to use this toolchain`,
344-
(value) => {
345-
if (!toolchains.has(value)) {
346-
throw new InvalidArgumentError(
347-
`Invalid toolchain: ${value}. The following are allowed: ${Array.from(
348-
toolchains,
349-
).join(', ')}`,
350-
)
351-
}
352-
return value
353-
},
354-
)
341+
program
342+
.option<string>(
343+
`--toolchain <${Array.from(toolchains).join('|')}>`,
344+
`Explicitly tell the CLI to use this toolchain`,
345+
(value) => {
346+
if (!toolchains.has(value)) {
347+
throw new InvalidArgumentError(
348+
`Invalid toolchain: ${value}. The following are allowed: ${Array.from(
349+
toolchains,
350+
).join(', ')}`,
351+
)
352+
}
353+
return value
354+
},
355+
)
356+
.option('--no-toolchain', 'skip toolchain selection')
355357
}
356358

357359
program

packages/cta-cli/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export interface CliOptions {
77
framework?: string
88
tailwind?: boolean
99
packageManager?: PackageManager
10-
toolchain?: string
10+
toolchain?: string | false
1111
deployment?: string
1212
projectName?: string
1313
git?: boolean

packages/cta-cli/src/ui-prompts.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,12 @@ export async function selectGit(): Promise<boolean> {
197197

198198
export async function selectToolchain(
199199
framework: Framework,
200-
toolchain?: string,
200+
toolchain?: string | false,
201201
): Promise<string | undefined> {
202+
if (toolchain === false) {
203+
return undefined
204+
}
205+
202206
const toolchains = new Set<AddOn>()
203207
for (const addOn of framework.getAddOns()) {
204208
if (addOn.type === 'toolchain') {

0 commit comments

Comments
 (0)