clefbase 1.3.6 → 1.3.7
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/dist/cli-src/cli/commands/deploy.js +4 -23
- package/dist/cli.js +4 -20
- package/package.json +1 -1
|
@@ -177,29 +177,10 @@ async function runDeploy(opts) {
|
|
|
177
177
|
finSpinner.fail(`Finalize failed: ${err.message}`);
|
|
178
178
|
process.exit(1);
|
|
179
179
|
}
|
|
180
|
-
// ── Result
|
|
181
|
-
// The previewUrl from the config may be stale (e.g. if the site was renamed)
|
|
182
|
-
// and a custom domain may have been added since init. Always fetch the live
|
|
183
|
-
// site record to get the correct canonical URL.
|
|
184
|
-
let canonicalUrl = previewUrl;
|
|
185
|
-
try {
|
|
186
|
-
// Fetch the current site record to get the canonical URL — it may differ
|
|
187
|
-
// from the config if the site was renamed or a custom domain was added.
|
|
188
|
-
const sites = await (0, api_1.listSites)(cfg);
|
|
189
|
-
const liveSite = sites.find(s => s.id === siteId);
|
|
190
|
-
if (liveSite) {
|
|
191
|
-
canonicalUrl = siteUrl(liveSite);
|
|
192
|
-
// Keep the config preview URL in sync for future deploys.
|
|
193
|
-
if (cfg.hosting && liveSite.previewUrl && cfg.hosting.previewUrl !== liveSite.previewUrl) {
|
|
194
|
-
cfg.hosting.previewUrl = liveSite.previewUrl;
|
|
195
|
-
(0, config_1.saveConfig)(cfg, cwd);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
catch { /* best-effort — fall back to stored previewUrl */ }
|
|
180
|
+
// ── Result ────────────────────────────────────────────────────────────────
|
|
200
181
|
console.log();
|
|
201
|
-
if (
|
|
202
|
-
console.log(chalk_1.default.green.bold(` ✓ ${
|
|
182
|
+
if (previewUrl) {
|
|
183
|
+
console.log(chalk_1.default.green.bold(` ✓ ${previewUrl}`));
|
|
203
184
|
}
|
|
204
185
|
console.log();
|
|
205
186
|
}
|
|
@@ -389,7 +370,7 @@ async function createSiteInteractive(cfg) {
|
|
|
389
370
|
while (true) {
|
|
390
371
|
const { name } = await inquirer_1.default.prompt([{
|
|
391
372
|
type: "input", name: "name",
|
|
392
|
-
message: "New site name (used as subdomain, e.g. my-app → my-app.
|
|
373
|
+
message: "New site name (used as subdomain, e.g. my-app → my-app.cleforyx.com)",
|
|
393
374
|
validate: (v) => v.trim().length >= 2 || "Must be at least 2 characters",
|
|
394
375
|
}]);
|
|
395
376
|
const s = (0, ora_1.default)(`Creating "${name.trim()}"…`).start();
|
package/dist/cli.js
CHANGED
|
@@ -34151,9 +34151,6 @@ function fmtBytes(n) {
|
|
|
34151
34151
|
if (n < 1024 * 1024) return `${(n / 1024).toFixed(1)} KB`;
|
|
34152
34152
|
return `${(n / (1024 * 1024)).toFixed(2)} MB`;
|
|
34153
34153
|
}
|
|
34154
|
-
function siteUrl(site) {
|
|
34155
|
-
return site.customDomain ? `https://${site.customDomain}` : site.previewUrl;
|
|
34156
|
-
}
|
|
34157
34154
|
async function runDeploy(opts) {
|
|
34158
34155
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
34159
34156
|
const cwd = opts.cwd ?? process.cwd();
|
|
@@ -34252,22 +34249,9 @@ async function runDeploy(opts) {
|
|
|
34252
34249
|
finSpinner.fail(`Finalize failed: ${err.message}`);
|
|
34253
34250
|
process.exit(1);
|
|
34254
34251
|
}
|
|
34255
|
-
let canonicalUrl = previewUrl;
|
|
34256
|
-
try {
|
|
34257
|
-
const sites = await listSites(cfg);
|
|
34258
|
-
const liveSite = sites.find((s) => s.id === siteId);
|
|
34259
|
-
if (liveSite) {
|
|
34260
|
-
canonicalUrl = siteUrl(liveSite);
|
|
34261
|
-
if (cfg.hosting && liveSite.previewUrl && cfg.hosting.previewUrl !== liveSite.previewUrl) {
|
|
34262
|
-
cfg.hosting.previewUrl = liveSite.previewUrl;
|
|
34263
|
-
saveConfig(cfg, cwd);
|
|
34264
|
-
}
|
|
34265
|
-
}
|
|
34266
|
-
} catch {
|
|
34267
|
-
}
|
|
34268
34252
|
console.log();
|
|
34269
|
-
if (
|
|
34270
|
-
console.log(source_default.green.bold(` \u2713 ${
|
|
34253
|
+
if (previewUrl) {
|
|
34254
|
+
console.log(source_default.green.bold(` \u2713 ${previewUrl}`));
|
|
34271
34255
|
}
|
|
34272
34256
|
console.log();
|
|
34273
34257
|
}
|
|
@@ -34442,7 +34426,7 @@ async function createSiteInteractive(cfg) {
|
|
|
34442
34426
|
const { name } = await lib_default.prompt([{
|
|
34443
34427
|
type: "input",
|
|
34444
34428
|
name: "name",
|
|
34445
|
-
message: "New site name (used as subdomain, e.g. my-app \u2192 my-app.
|
|
34429
|
+
message: "New site name (used as subdomain, e.g. my-app \u2192 my-app.cleforyx.com)",
|
|
34446
34430
|
validate: (v) => v.trim().length >= 2 || "Must be at least 2 characters"
|
|
34447
34431
|
}]);
|
|
34448
34432
|
const s = ora2(`Creating "${name.trim()}"\u2026`).start();
|
|
@@ -34539,7 +34523,7 @@ async function runSitesList(cwd = process.cwd()) {
|
|
|
34539
34523
|
}
|
|
34540
34524
|
|
|
34541
34525
|
// package.json
|
|
34542
|
-
var version = "1.3.
|
|
34526
|
+
var version = "1.3.7";
|
|
34543
34527
|
|
|
34544
34528
|
// src/cli/index.ts
|
|
34545
34529
|
var program2 = new Command();
|