Skip to content

Feat: make tailwind prompt optional #98

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/cta-engine/src/create-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,8 @@ ${environment.getErrors().join('\n')}`

outro(`Your ${appName} app is ready in '${basename(targetDir)}'.

${options.tailwind ? 'Tailwind CSS has been installed' : ''}

Use the following commands to start your app:
% cd ${options.projectName}
% ${startCommand}
Expand Down
37 changes: 22 additions & 15 deletions packages/cta-engine/src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,21 +248,6 @@ export async function promptForOptions(
}
}

// Tailwind selection
if (!cliOptions.tailwind && options.framework === 'react') {
const tailwind = await confirm({
message: 'Would you like to use Tailwind CSS?',
initialValue: true,
})
if (isCancel(tailwind)) {
cancel('Operation cancelled.')
process.exit(0)
}
options.tailwind = tailwind
} else {
options.tailwind = options.framework === 'solid' || !!cliOptions.tailwind
}

// Package manager selection
if (cliOptions.packageManager === undefined) {
const detectedPackageManager = getPackageManager()
Expand Down Expand Up @@ -384,6 +369,28 @@ export async function promptForOptions(
)
}

// Tailwind selection
if (
!cliOptions.tailwind &&
!options.tailwind &&
options.framework === 'react'
) {
const tailwind = await confirm({
message: 'Would you like to use Tailwind CSS?',
initialValue: true,
})
if (isCancel(tailwind)) {
cancel('Operation cancelled.')
process.exit(0)
}
options.tailwind = tailwind
} else {
options.tailwind =
options.framework === 'solid' ||
!!cliOptions.tailwind ||
!!options.tailwind
}

// Collect variables
const variables: Array<Variable> = []
for (const addOn of options.chosenAddOns) {
Expand Down