pagezero 0.4.1 → 0.6.0
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 -6
- package/src/commands/init.ts +16 -9
package/package.json
CHANGED
|
@@ -30,14 +30,13 @@
|
|
|
30
30
|
"scripts": {
|
|
31
31
|
"check": "biome check",
|
|
32
32
|
"check:fix": "biome check --write",
|
|
33
|
-
"check:types": "tsc"
|
|
33
|
+
"check:types": "tsc",
|
|
34
|
+
"git:clean": "git branch -l | grep -v 'main' | xargs git branch -D"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
37
|
"@biomejs/biome": "2.3.3",
|
|
37
|
-
"@types/bun": "1.3.1"
|
|
38
|
-
|
|
39
|
-
"peerDependencies": {
|
|
40
|
-
"typescript": "^5.9.3"
|
|
38
|
+
"@types/bun": "1.3.1",
|
|
39
|
+
"typescript": "5.9.3"
|
|
41
40
|
},
|
|
42
41
|
"dependencies": {
|
|
43
42
|
"@inquirer/prompts": "7.9.0",
|
|
@@ -47,5 +46,5 @@
|
|
|
47
46
|
"log-symbols": "7.0.1",
|
|
48
47
|
"ora": "9.0.0"
|
|
49
48
|
},
|
|
50
|
-
"version": "0.
|
|
49
|
+
"version": "0.6.0"
|
|
51
50
|
}
|
package/src/commands/init.ts
CHANGED
|
@@ -12,24 +12,22 @@ export async function init() {
|
|
|
12
12
|
const projectName = await input({
|
|
13
13
|
message: "What is the name of your project?",
|
|
14
14
|
})
|
|
15
|
-
await spinner(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
$`bun create pagezero-dev/pagezero --no-install ${projectName}`.quiet(),
|
|
19
|
-
)
|
|
15
|
+
await spinner("downloading pagezero", async () => {
|
|
16
|
+
await $`git clone --depth 1 https://github.com/pagezero-dev/pagezero.git ${projectName}`.quiet()
|
|
17
|
+
})
|
|
20
18
|
|
|
21
19
|
// Install dependencies
|
|
22
|
-
await spinner(`
|
|
20
|
+
await spinner(`running: bun install`, () =>
|
|
23
21
|
$`bun install`.quiet().cwd(projectName),
|
|
24
22
|
)
|
|
25
23
|
|
|
26
24
|
// Run setup script
|
|
27
|
-
await spinner(`
|
|
25
|
+
await spinner(`running: bun run setup`, () =>
|
|
28
26
|
$`bun run setup`.quiet().cwd(projectName),
|
|
29
27
|
)
|
|
30
28
|
|
|
31
29
|
// Update wrangler.json
|
|
32
|
-
await spinner(`
|
|
30
|
+
await spinner(`updating wrangler.json`, async () => {
|
|
33
31
|
const wranglerJson = await file(`${projectName}/wrangler.json`).json()
|
|
34
32
|
wranglerJson.name = projectName
|
|
35
33
|
wranglerJson.d1_databases[0].database_name = `${projectName}-development`
|
|
@@ -44,8 +42,17 @@ export async function init() {
|
|
|
44
42
|
)
|
|
45
43
|
})
|
|
46
44
|
|
|
45
|
+
// Initialize git repository
|
|
46
|
+
await spinner("initializing fresh git repository", async () => {
|
|
47
|
+
await $`rm -rf .git`.quiet().cwd(projectName)
|
|
48
|
+
await $`git init`.quiet().cwd(projectName)
|
|
49
|
+
await $`git add .`.quiet().cwd(projectName)
|
|
50
|
+
await $`git commit -m "Initial commit"`.quiet().cwd(projectName)
|
|
51
|
+
await $`git branch -m master main`.quiet().cwd(projectName)
|
|
52
|
+
})
|
|
53
|
+
|
|
47
54
|
// Done
|
|
48
55
|
console.log(chalk.green("🎉 Done! Your project is ready to go."))
|
|
49
56
|
console.log(chalk.green.bold(`cd ${projectName}`))
|
|
50
|
-
console.log(chalk.green.bold("bun
|
|
57
|
+
console.log(chalk.green.bold("bun dev"))
|
|
51
58
|
}
|