8000 feat: builder flag · vueform/create-vueform@f5b2412 · GitHub
[go: up one dir, main page]

Skip to content

Commit f5b2412

Browse files
committed
feat: builder flag
1 parent 294983a commit f5b2412

File tree

4 files changed

+27
-17
lines changed

4 files changed

+27
-17
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## v1.0.3
2+
3+
> `2024-04-18`
4+
5+
### 🎉 Feature
6+
- Added `--builder` flag.
7+
18
## v1.0.2
29

310
> `2024-04-17`

README.md

Lines changed: 1 addition & 0 deletions
< 10000 /tr>
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,5 @@ Available flags:
6868
| --- | --- |
6969
| `--start` | Automatically starts the development server at the end of installation. |
7070
| `--force` | Force overrides existing project directory. |
71+
| `--builder` | Installs Vueform Builder. |
7172
| `--publicKey` | Sets Public Key when installing Vueform + Builder. |

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-vueform",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"type": "module",
55
"license": "MIT",
66
"author": "Adam Berecz",

src/index.js

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ async function main() {
113113

114114
const response = await prompts([
115115
{
116-
type: 'select',
116+
type: !!argv.builder ? null : 'select',
117117
name: 'builder',
118118
message: 'Which libraries do you want to install?',
119119
choices: [
@@ -128,7 +128,7 @@ async function main() {
128128
]
129129
},
130130
{
131-
type: prev => prev === 'builder' ? 'text' : null,
131+
type: prev => !!argv.builder || prev === 'builder' ? 'text' : null,
132132
name: 'publicKey',
133133
initial: argv.publicKey || 'obtain a FREE one at https://app.vueform.com',
134134
message: 'Your Public Key: ',
@@ -157,7 +157,7 @@ async function main() {
157157
inactive: 'no',
158158
},
159159
{
160-
type: (prev, { builder }) => builder === 'builder' ? null : 'select',
160+
type: (prev, { builder }) => !!argv.builder || builder === 'builder' ? null : 'select',
161161
name: 'theme',
162162
message: 'Select a theme for your project:',
163163
choices: themes
@@ -169,9 +169,22 @@ async function main() {
169169
},
170170
})
171171

172-
const { framework, ts, builder, publicKey } = response
172+
const { framework, ts, publicKey } = response
173+
174+
console.log(projectName)
173175

174-
const theme = builder === 'builder' ? 'tailwind' : response.theme
176+
/**
177+
* Variables
178+
*/
179+
const isBuilder = !!argv.builder || response.builder === 'builder'
180+
const theme = isBuilder ? 'tailwind' : response.theme
181+
const isAstro = framework === 'astro'
182+
const isTs = await isTypescript(process.cwd(), framework, ts)
183+
const isTailwind = ['tailwind', 'tailwind-material'].indexOf(theme) !== -1 || isBuilder
184+
const isBootstrap = ['bootstrap'].indexOf(theme) !== -1
185+
const isLaravel = framework === 'laravel'
186+
const sourcePath = path.join(__dirname, '../', 'templates', isBuilder ? 'builder' : 'vueform', framework, theme, isTs ? 'ts' : 'js')
187+
const targetPath = path.join(process.cwd(), projectName)
175188

176189
if (projectName && framework) {
177190
const fw = getFramework(framework)
@@ -217,17 +230,6 @@ async function main() {
217230
status('\nInstalling dependencies...')
218231
await runCommand('npm', ['install'], 'install dependencies')
219232

220-
/**
221-
* Variables
222-
*/
223-
const isAstro = framework === 'astro'
224-
const isTs = await isTypescript(process.cwd(), framework, ts)
225-
const isBuilder = builder === 'builder'
226-
const isTailwind = ['tailwind', 'tailwind-material'].indexOf(theme) !== -1 || isBuilder
227-
const isBootstrap = ['bootstrap'].indexOf(theme) !== -1
228-
const isLaravel = framework === 'laravel'
229-
const sourcePath = path.join(__dirname, '../', 'templates', builder, framework, theme, isTs ? 'ts' : 'js')
230-
const targetPath = process.cwd()
231233

232234
/**
233235
* Install Tailwind

0 commit comments

Comments
 (0)
0