ship-em 0.2.5 → 0.2.6
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/index.js +20 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3318,8 +3318,9 @@ async function statusCommand() {
|
|
|
3318
3318
|
const config = readProjectConfig(cwd);
|
|
3319
3319
|
if (!config.deployment) {
|
|
3320
3320
|
ui.warn("No deployment found in this directory.");
|
|
3321
|
-
ui.dim("
|
|
3322
|
-
|
|
3321
|
+
ui.dim("Deploy your app first:");
|
|
3322
|
+
ui.dim(" npx ship-em");
|
|
3323
|
+
process.exit(1);
|
|
3323
3324
|
}
|
|
3324
3325
|
const { deployment } = config;
|
|
3325
3326
|
const project = config.project;
|
|
@@ -3395,13 +3396,13 @@ async function logsCommand(options) {
|
|
|
3395
3396
|
const config = readProjectConfig(cwd);
|
|
3396
3397
|
if (!config.deployment) {
|
|
3397
3398
|
ui.warn("No deployment found in this directory.");
|
|
3398
|
-
ui.dim("Run `shipem` to deploy your app.");
|
|
3399
|
-
process.exit(
|
|
3399
|
+
ui.dim("Run `shipem` to deploy your app first.");
|
|
3400
|
+
process.exit(1);
|
|
3400
3401
|
}
|
|
3401
3402
|
const { deployment } = config;
|
|
3402
3403
|
if (deployment.deployTarget !== "cloudflare-pages" && deployment.deployTarget !== "cloudflare-workers") {
|
|
3403
3404
|
ui.warn("Log streaming is only available for Cloudflare Pages deployments.");
|
|
3404
|
-
process.exit(
|
|
3405
|
+
process.exit(1);
|
|
3405
3406
|
}
|
|
3406
3407
|
if (!deployment.cloudflareProjectName) {
|
|
3407
3408
|
throw new ConfigError("Missing Cloudflare project name in deployment config.");
|
|
@@ -3440,7 +3441,7 @@ async function logsCommand(options) {
|
|
|
3440
3441
|
}
|
|
3441
3442
|
} catch (err) {
|
|
3442
3443
|
spinner.fail("Failed to fetch logs");
|
|
3443
|
-
|
|
3444
|
+
throw err;
|
|
3444
3445
|
}
|
|
3445
3446
|
ui.br();
|
|
3446
3447
|
}
|
|
@@ -3454,7 +3455,7 @@ async function downCommand(options) {
|
|
|
3454
3455
|
if (!config.deployment) {
|
|
3455
3456
|
ui.warn("No deployment found in this directory.");
|
|
3456
3457
|
ui.dim("Run `shipem` to deploy your app first.");
|
|
3457
|
-
process.exit(
|
|
3458
|
+
process.exit(1);
|
|
3458
3459
|
}
|
|
3459
3460
|
const { deployment } = config;
|
|
3460
3461
|
ui.section("Taking down deployment");
|
|
@@ -3593,7 +3594,9 @@ async function watchCommand() {
|
|
|
3593
3594
|
console.log(` ${brand.dim(`[${timestamp()}]`)} File changed: ${chalk10.cyan(relPath)}`);
|
|
3594
3595
|
if (debounceTimer) clearTimeout(debounceTimer);
|
|
3595
3596
|
debounceTimer = setTimeout(() => {
|
|
3596
|
-
|
|
3597
|
+
triggerDeploy(lastChangedFile).catch((err) => {
|
|
3598
|
+
console.log(` ${brand.dim(`[${timestamp()}]`)} ${brand.red("\u2717")} Unexpected deploy error: ${err instanceof Error ? err.message : String(err)}`);
|
|
3599
|
+
});
|
|
3597
3600
|
}, DEBOUNCE_MS);
|
|
3598
3601
|
};
|
|
3599
3602
|
const dirs = collectDirs(cwd);
|
|
@@ -3621,7 +3624,9 @@ async function watchCommand() {
|
|
|
3621
3624
|
if (key === "d" || key === "D") {
|
|
3622
3625
|
if (debounceTimer) clearTimeout(debounceTimer);
|
|
3623
3626
|
console.log(` ${brand.dim(`[${timestamp()}]`)} Force deploy triggered`);
|
|
3624
|
-
|
|
3627
|
+
triggerDeploy("manual").catch((err) => {
|
|
3628
|
+
console.log(` ${brand.dim(`[${timestamp()}]`)} ${brand.red("\u2717")} Unexpected deploy error: ${err instanceof Error ? err.message : String(err)}`);
|
|
3629
|
+
});
|
|
3625
3630
|
}
|
|
3626
3631
|
});
|
|
3627
3632
|
}
|
|
@@ -3886,7 +3891,11 @@ async function monitorCommand(options = {}) {
|
|
|
3886
3891
|
}
|
|
3887
3892
|
};
|
|
3888
3893
|
await runCheck();
|
|
3889
|
-
const timer = setInterval(() =>
|
|
3894
|
+
const timer = setInterval(() => {
|
|
3895
|
+
runCheck().catch((err) => {
|
|
3896
|
+
console.error(`Monitor check failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
3897
|
+
});
|
|
3898
|
+
}, intervalMs);
|
|
3890
3899
|
if (!options.daemon && process.stdin.isTTY) {
|
|
3891
3900
|
process.stdin.setRawMode(true);
|
|
3892
3901
|
process.stdin.resume();
|
|
@@ -4189,7 +4198,7 @@ program.command("fix").description("Auto-fix common build errors (missing deps,
|
|
|
4189
4198
|
handleError(err, "Fix command failed.");
|
|
4190
4199
|
}
|
|
4191
4200
|
});
|
|
4192
|
-
program.command("env").description("Scan
|
|
4201
|
+
program.command("env").description("Scan project for environment variables and check which are set").action(async () => {
|
|
4193
4202
|
try {
|
|
4194
4203
|
await envCommand();
|
|
4195
4204
|
} catch (err) {
|