clefbase 2.0.0 → 2.0.1

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.
@@ -81,7 +81,6 @@ function writeEnvExample(cfg, cwd = process.cwd()) {
81
81
  `CLEFBASE_SERVER_URL=${cfg.serverUrl}`,
82
82
  `CLEFBASE_PROJECT_ID=${cfg.projectId}`,
83
83
  "CLEFBASE_API_KEY=your_api_key_here",
84
- "CLEFBASE_ADMIN_SECRET=your_admin_secret_here",
85
84
  ];
86
85
  fs_1.default.writeFileSync(p, lines.join("\n") + "\n");
87
86
  }
@@ -27,16 +27,49 @@ program
27
27
  fatal(err);
28
28
  }
29
29
  });
30
- // ─── deploy ───────────────────────────────────────────────────────────────────
30
+ // ─── deploy (combined: hosting + functions) ───────────────────────────────────
31
31
  program
32
32
  .command("deploy")
33
+ .description("Deploy hosting and/or functions. Deploys both by default if both are enabled.")
34
+ .option("-d, --dir <path>", "Build output directory (overrides clefbase.json)")
35
+ .option("-s, --site <siteId>", "Site ID to deploy to (overrides clefbase.json)")
36
+ .option("-m, --message <text>", "Deploy message / release note")
37
+ .option("--only <target>", "Deploy only one target: hosting | functions")
38
+ .action(async (opts) => {
39
+ const only = opts.only;
40
+ if (only && only !== "hosting" && only !== "functions") {
41
+ console.error(chalk_1.default.red(`\n --only must be "hosting" or "functions" (got: "${only}")\n`));
42
+ process.exit(1);
43
+ }
44
+ try {
45
+ await (0, deploy_1.runDeploy)({ ...opts, only: only });
46
+ }
47
+ catch (err) {
48
+ fatal(err);
49
+ }
50
+ });
51
+ // ─── deploy:hosting ───────────────────────────────────────────────────────────
52
+ program
53
+ .command("deploy:hosting")
33
54
  .description("Deploy your built site to Clefbase Hosting")
34
55
  .option("-d, --dir <path>", "Build output directory (overrides clefbase.json)")
35
56
  .option("-s, --site <siteId>", "Site ID to deploy to (overrides clefbase.json)")
36
57
  .option("-m, --message <text>", "Deploy message / release note")
37
58
  .action(async (opts) => {
38
59
  try {
39
- await (0, deploy_1.runDeploy)(opts);
60
+ await (0, deploy_1.runHostingDeploy)(opts);
61
+ }
62
+ catch (err) {
63
+ fatal(err);
64
+ }
65
+ });
66
+ // ─── deploy:functions ─────────────────────────────────────────────────────────
67
+ program
68
+ .command("deploy:functions")
69
+ .description("Deploy all functions via functions/deploy.mjs")
70
+ .action(async () => {
71
+ try {
72
+ await (0, deploy_1.runFunctionsDeploy)();
40
73
  }
41
74
  catch (err) {
42
75
  fatal(err);
@@ -119,11 +152,11 @@ program
119
152
  fatal(err);
120
153
  }
121
154
  });
122
- // ─── functions:deploy ─────────────────────────────────────────────────────────
155
+ // ─── functions:deploy (single function) ──────────────────────────────────────
123
156
  program
124
157
  .command("functions:deploy")
125
158
  .alias("fn:deploy")
126
- .description("Deploy (or redeploy) a function from a source file or interactively")
159
+ .description("Deploy (or redeploy) a single function from a source file or interactively")
127
160
  .option("-n, --name <name>", "Function name")
128
161
  .option("-f, --file <path>", "Path to source file (.js, .ts, .py)")
129
162
  .option("-r, --runtime <runtime>", "Runtime: node | python (auto-detected from file ext)")
@@ -202,9 +235,15 @@ ${chalk_1.default.bold("Examples:")}
202
235
  ${chalk_1.default.cyan("clefbase init")} Set up a new project
203
236
  ${chalk_1.default.cyan("clefbase info")} Show config & connection status
204
237
 
238
+ ${chalk_1.default.bold("Deploy:")}
239
+ ${chalk_1.default.cyan("clefbase deploy")} Deploy functions + hosting (both if enabled)
240
+ ${chalk_1.default.cyan("clefbase deploy --only hosting")} Deploy hosting only
241
+ ${chalk_1.default.cyan("clefbase deploy --only functions")} Deploy all functions only
242
+ ${chalk_1.default.cyan("clefbase deploy -d ./dist -m \"v2\"")} Deploy hosting from a dir with a note
243
+ ${chalk_1.default.cyan("clefbase deploy:hosting")} Deploy hosting (alias)
244
+ ${chalk_1.default.cyan("clefbase deploy:functions")} Deploy all functions via deploy.mjs (alias)
245
+
205
246
  ${chalk_1.default.bold("Hosting:")}
206
- ${chalk_1.default.cyan("clefbase deploy")} Deploy your built site
207
- ${chalk_1.default.cyan("clefbase deploy -d ./dist -m \"v2\"")} Deploy from a dir with a note
208
247
  ${chalk_1.default.cyan("clefbase hosting:init")} Link or create a hosted site
209
248
  ${chalk_1.default.cyan("clefbase hosting:status")} Show current live deploy
210
249
  ${chalk_1.default.cyan("clefbase hosting:sites")} List all sites
@@ -213,9 +252,9 @@ ${chalk_1.default.bold("Examples:")}
213
252
 
214
253
  ${chalk_1.default.bold("Functions:")}
215
254
  ${chalk_1.default.cyan("clefbase functions:list")} List all deployed functions
216
- ${chalk_1.default.cyan("clefbase functions:deploy")} Interactive deploy wizard
217
- ${chalk_1.default.cyan("clefbase functions:deploy -f ./fn.ts")} Deploy from a file (auto-detects runtime)
218
- ${chalk_1.default.cyan("clefbase functions:deploy -n greet -f fn.ts --trigger http")}
255
+ ${chalk_1.default.cyan("clefbase functions:deploy")} Interactive deploy wizard (single function)
256
+ ${chalk_1.default.cyan("clefbase functions:deploy -f functions/src/hello.ts --name hello --trigger http")}
257
+ ${chalk_1.default.cyan("clefbase functions:deploy -f functions/src/scheduled.ts --name daily --trigger schedule --cron \"0 0 * * *\"")}
219
258
  ${chalk_1.default.cyan("clefbase functions:call greetUser")} Call an HTTP function
220
259
  ${chalk_1.default.cyan("clefbase functions:call greetUser -d '{\"name\":\"Alice\"}'}")}
221
260
  ${chalk_1.default.cyan("clefbase functions:logs greetUser")} View execution history