Skip to content

Commit 49c4050

Browse files
committed
feat: add --minimal flag to that selects 'gill-next-tailwind-minimal'
1 parent e6aa841 commit 49c4050

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

.changeset/puny-experts-stand.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'create-solana-dapp': minor
3+
---
4+
5+
add `--minimal` flag to that selects 'gill-next-tailwind-minimal'

src/utils/get-args.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import { runVersionCheck } from './run-version-check'
1515
import { Template } from './template'
1616
import { PackageManager } from './vendor/package-manager'
1717

18+
const minimalTemplateName = 'gill-next-tailwind-minimal'
19+
1820
export async function getArgs(argv: string[], app: AppInfo, pm: PackageManager = 'npm'): Promise<GetArgsResult> {
1921
// Get the result from the command line
2022
const input = program
@@ -30,6 +32,7 @@ export async function getArgs(argv: string[], app: AppInfo, pm: PackageManager =
3032
.option('--list-template-ids', help('List available template ids as JSON array'))
3133
.option('--list-templates', help('List available templates'))
3234
.option('--list-versions', help('Verify your versions of Anchor, AVM, Rust, and Solana'))
35+
.option('--minimal', help(`Select the minimal template (${minimalTemplateName})`), false)
3336
.option('--skip-git', help('Skip git initialization'))
3437
.option('--skip-init', help('Skip running the init script'))
3538
.option('--skip-install', help('Skip installing dependencies'))
@@ -102,6 +105,14 @@ Examples:
102105

103106
let template: Template | undefined
104107

108+
if (result.template && result.minimal) {
109+
throw new Error(`The --minimal flag can't be used in combination with --template. Please specify only one.`)
110+
}
111+
112+
if (result.minimal) {
113+
result.template = minimalTemplateName
114+
}
115+
105116
if (result.template) {
106117
template = findTemplate({ name: result.template, templates, verbose })
107118
}

0 commit comments

Comments
 (0)