uniweb 0.5.2 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -5
- package/src/index.js +23 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uniweb",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"description": "Create structured Vite + React sites with content/code separation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
"js-yaml": "^4.1.0",
|
|
38
38
|
"prompts": "^2.4.2",
|
|
39
39
|
"tar": "^7.0.0",
|
|
40
|
-
"@uniweb/
|
|
41
|
-
"@uniweb/
|
|
42
|
-
"@uniweb/
|
|
43
|
-
"@uniweb/
|
|
40
|
+
"@uniweb/core": "0.3.4",
|
|
41
|
+
"@uniweb/runtime": "0.5.4",
|
|
42
|
+
"@uniweb/build": "0.4.3",
|
|
43
|
+
"@uniweb/kit": "0.4.4"
|
|
44
44
|
}
|
|
45
45
|
}
|
package/src/index.js
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { existsSync, mkdirSync, writeFileSync, readFileSync, readdirSync } from 'node:fs'
|
|
16
|
+
import { execSync } from 'node:child_process'
|
|
16
17
|
import { resolve, join, dirname } from 'node:path'
|
|
17
18
|
import { fileURLToPath } from 'node:url'
|
|
18
19
|
import prompts from 'prompts'
|
|
@@ -208,6 +209,9 @@ async function main() {
|
|
|
208
209
|
displayName = args[nameIndex + 1]
|
|
209
210
|
}
|
|
210
211
|
|
|
212
|
+
// Check for --no-git flag
|
|
213
|
+
const noGit = args.includes('--no-git')
|
|
214
|
+
|
|
211
215
|
// Interactive prompts
|
|
212
216
|
const response = await prompts([
|
|
213
217
|
{
|
|
@@ -307,6 +311,24 @@ async function main() {
|
|
|
307
311
|
}
|
|
308
312
|
}
|
|
309
313
|
|
|
314
|
+
// Initialize git repository
|
|
315
|
+
if (!noGit) {
|
|
316
|
+
try {
|
|
317
|
+
execSync('git --version', { stdio: 'ignore' })
|
|
318
|
+
try {
|
|
319
|
+
execSync('git init', { cwd: projectDir, stdio: 'ignore' })
|
|
320
|
+
execSync('git add -A', { cwd: projectDir, stdio: 'ignore' })
|
|
321
|
+
execSync('git commit -m "Initial commit from uniweb"', { cwd: projectDir, stdio: 'ignore' })
|
|
322
|
+
success('Git repository initialized')
|
|
323
|
+
} catch {
|
|
324
|
+
log(` ${colors.yellow}Warning: Git repository initialized but initial commit failed${colors.reset}`)
|
|
325
|
+
log(` ${colors.dim}Run 'git commit -m "Initial commit"' after configuring git${colors.reset}`)
|
|
326
|
+
}
|
|
327
|
+
} catch {
|
|
328
|
+
// git not available — skip silently
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
310
332
|
// Success message
|
|
311
333
|
title('Project created successfully!')
|
|
312
334
|
|
|
@@ -335,6 +357,7 @@ ${colors.bright}Create Options:${colors.reset}
|
|
|
335
357
|
--template <type> Project template
|
|
336
358
|
--variant <name> Template variant (e.g., tailwind3 for legacy)
|
|
337
359
|
--name <name> Project display name
|
|
360
|
+
--no-git Skip git repository initialization
|
|
338
361
|
|
|
339
362
|
${colors.bright}Build Options:${colors.reset}
|
|
340
363
|
--target <type> Build target (foundation, site) - auto-detected if not specified
|