pagezero 0.2.0 → 0.4.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.
Files changed (2) hide show
  1. package/bin/pagezero.ts +4 -59
  2. package/package.json +9 -7
package/bin/pagezero.ts CHANGED
@@ -1,10 +1,8 @@
1
1
  #!/usr/bin/env bun
2
2
 
3
- import { input } from "@inquirer/prompts"
4
- import { $, file, write } from "bun"
5
- import chalk from "chalk"
6
3
  import { program } from "commander"
7
- import ora from "ora"
4
+ import { init } from "../src/commands/init"
5
+ import { upgrade } from "../src/commands/upgrade"
8
6
 
9
7
  program
10
8
  .description("PageZERO CLI")
@@ -12,59 +10,6 @@ program
12
10
 
13
11
  program.command("init").description("initialize a new project").action(init)
14
12
 
15
- program.parse()
16
-
17
- async function init() {
18
- // Welcome
19
- console.log(chalk.green("👋 Welcome to PageZERO CLI"))
20
- console.log(chalk.green("🚀 Let's get you started with your project!"))
21
-
22
- // Bootstrap the project
23
- const projectName = await input({
24
- message: "What is the name of your project?",
25
- })
26
- const creatingProjectSpinner = ora(
27
- `Running: bun create pagezero-dev/pagezero --no-install ${projectName}`,
28
- ).start()
29
- await $`bun create pagezero-dev/pagezero --no-install ${projectName}`.quiet()
30
- creatingProjectSpinner.succeed()
31
-
32
- // Install dependencies
33
- const installingDependenciesSpinner = ora(`Running: bun install`).start()
34
- await $`bun install`.quiet().cwd(projectName)
35
- installingDependenciesSpinner.succeed()
13
+ program.command("upgrade").description("upgrade pagezero stack").action(upgrade)
36
14
 
37
- // Run setup script
38
- const runningSetupScriptSpinner = ora(`Running: bun run setup`).start()
39
- await $`bun run setup`.quiet().cwd(projectName)
40
- runningSetupScriptSpinner.succeed()
41
-
42
- // Update wrangler.json
43
- const updatingWranglerJsonSpinner = ora(`Updating wrangler.json`).start()
44
- try {
45
- const wranglerJson = await file(`${projectName}/wrangler.json`).json()
46
- wranglerJson.name = projectName
47
- wranglerJson.d1_databases[0].database_name = `${projectName}-development`
48
- wranglerJson.env.production.d1_databases[0].database_name = `${projectName}-production`
49
- wranglerJson.env.preview.d1_databases[0].database_name = `${projectName}-preview`
50
- wranglerJson.env.test.d1_databases[0].database_name = `${projectName}-test`
51
- wranglerJson.env.production.d1_databases[0].database_id = "<DATABASE_ID>"
52
- wranglerJson.env.preview.d1_databases[0].database_id = "<DATABASE_ID>"
53
- await write(
54
- `${projectName}/wrangler.json`,
55
- JSON.stringify(wranglerJson, null, 2),
56
- )
57
- updatingWranglerJsonSpinner.succeed()
58
- } catch (error) {
59
- updatingWranglerJsonSpinner.warn()
60
- console.error(chalk.yellow("Issue with updating wrangler.json"))
61
- if (error instanceof Error) {
62
- console.error(chalk.yellow(error.message))
63
- }
64
- }
65
-
66
- // Done
67
- console.log(chalk.green("🎉 Done! Your project is ready to go."))
68
- console.log(chalk.green.bold(`cd ${projectName}`))
69
- console.log(chalk.green.bold("bun run dev"))
70
- }
15
+ program.parse()
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "bin/"
10
10
  ],
11
11
  "engines": {
12
- "bun": ">=1.2.20"
12
+ "bun": ">=1.3.1"
13
13
  },
14
14
  "keywords": [
15
15
  "cli",
@@ -32,17 +32,19 @@
32
32
  "check:types": "tsc"
33
33
  },
34
34
  "devDependencies": {
35
- "@biomejs/biome": "2.2.4",
36
- "@types/bun": "1.2.20"
35
+ "@biomejs/biome": "2.3.3",
36
+ "@types/bun": "1.3.1"
37
37
  },
38
38
  "peerDependencies": {
39
- "typescript": "^5"
39
+ "typescript": "^5.9.3"
40
40
  },
41
41
  "dependencies": {
42
- "@inquirer/prompts": "7.8.6",
42
+ "@inquirer/prompts": "7.9.0",
43
+ "boxen": "8.0.1",
43
44
  "chalk": "5.6.2",
44
- "commander": "14.0.1",
45
+ "commander": "14.0.2",
46
+ "log-symbols": "7.0.1",
45
47
  "ora": "9.0.0"
46
48
  },
47
- "version": "0.2.0"
49
+ "version": "0.4.0"
48
50
  }