ship-em 0.2.4 → 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 +26 -22
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2154,24 +2154,19 @@ async function deployCommand(options) {
|
|
|
2154
2154
|
console.log("");
|
|
2155
2155
|
}
|
|
2156
2156
|
if (isAnonymous) {
|
|
2157
|
-
console.log(` ${chalk4.
|
|
2157
|
+
console.log(` ${chalk4.bold("Deploy your app in seconds")} \u2014 no Cloudflare account needed. \u{1F411}`);
|
|
2158
2158
|
console.log("");
|
|
2159
|
-
console.log(`
|
|
2160
|
-
console.log(`
|
|
2161
|
-
console.log(` ${chalk4.dim("export CLOUDFLARE_ACCOUNT_ID=your_account_id")}`);
|
|
2162
|
-
console.log(` ${chalk4.dim("Get these from: https://dash.cloudflare.com/profile/api-tokens")}`);
|
|
2163
|
-
console.log("");
|
|
2164
|
-
console.log(` ${chalk4.cyan("Option 2:")} Log in to Shipem`);
|
|
2165
|
-
console.log(` ${chalk4.dim("npx ship-em login")}`);
|
|
2159
|
+
console.log(` Log in with GitHub to get started. It's free.`);
|
|
2160
|
+
console.log(` ${chalk4.dim("\u2192 https://shipem.dev")}`);
|
|
2166
2161
|
console.log("");
|
|
2167
2162
|
const { action } = await inquirer.prompt([
|
|
2168
2163
|
{
|
|
2169
2164
|
type: "list",
|
|
2170
2165
|
name: "action",
|
|
2171
|
-
message: "
|
|
2166
|
+
message: "Ready to ship?",
|
|
2172
2167
|
choices: [
|
|
2173
|
-
{ name: "Log in with GitHub (
|
|
2174
|
-
{ name: "
|
|
2168
|
+
{ name: "Log in with GitHub (free, takes 10 seconds)", value: "login" },
|
|
2169
|
+
{ name: "Cancel", value: "quit" }
|
|
2175
2170
|
]
|
|
2176
2171
|
}
|
|
2177
2172
|
]);
|
|
@@ -3323,8 +3318,9 @@ async function statusCommand() {
|
|
|
3323
3318
|
const config = readProjectConfig(cwd);
|
|
3324
3319
|
if (!config.deployment) {
|
|
3325
3320
|
ui.warn("No deployment found in this directory.");
|
|
3326
|
-
ui.dim("
|
|
3327
|
-
|
|
3321
|
+
ui.dim("Deploy your app first:");
|
|
3322
|
+
ui.dim(" npx ship-em");
|
|
3323
|
+
process.exit(1);
|
|
3328
3324
|
}
|
|
3329
3325
|
const { deployment } = config;
|
|
3330
3326
|
const project = config.project;
|
|
@@ -3400,13 +3396,13 @@ async function logsCommand(options) {
|
|
|
3400
3396
|
const config = readProjectConfig(cwd);
|
|
3401
3397
|
if (!config.deployment) {
|
|
3402
3398
|
ui.warn("No deployment found in this directory.");
|
|
3403
|
-
ui.dim("Run `shipem` to deploy your app.");
|
|
3404
|
-
process.exit(
|
|
3399
|
+
ui.dim("Run `shipem` to deploy your app first.");
|
|
3400
|
+
process.exit(1);
|
|
3405
3401
|
}
|
|
3406
3402
|
const { deployment } = config;
|
|
3407
3403
|
if (deployment.deployTarget !== "cloudflare-pages" && deployment.deployTarget !== "cloudflare-workers") {
|
|
3408
3404
|
ui.warn("Log streaming is only available for Cloudflare Pages deployments.");
|
|
3409
|
-
process.exit(
|
|
3405
|
+
process.exit(1);
|
|
3410
3406
|
}
|
|
3411
3407
|
if (!deployment.cloudflareProjectName) {
|
|
3412
3408
|
throw new ConfigError("Missing Cloudflare project name in deployment config.");
|
|
@@ -3445,7 +3441,7 @@ async function logsCommand(options) {
|
|
|
3445
3441
|
}
|
|
3446
3442
|
} catch (err) {
|
|
3447
3443
|
spinner.fail("Failed to fetch logs");
|
|
3448
|
-
|
|
3444
|
+
throw err;
|
|
3449
3445
|
}
|
|
3450
3446
|
ui.br();
|
|
3451
3447
|
}
|
|
@@ -3459,7 +3455,7 @@ async function downCommand(options) {
|
|
|
3459
3455
|
if (!config.deployment) {
|
|
3460
3456
|
ui.warn("No deployment found in this directory.");
|
|
3461
3457
|
ui.dim("Run `shipem` to deploy your app first.");
|
|
3462
|
-
process.exit(
|
|
3458
|
+
process.exit(1);
|
|
3463
3459
|
}
|
|
3464
3460
|
const { deployment } = config;
|
|
3465
3461
|
ui.section("Taking down deployment");
|
|
@@ -3598,7 +3594,9 @@ async function watchCommand() {
|
|
|
3598
3594
|
console.log(` ${brand.dim(`[${timestamp()}]`)} File changed: ${chalk10.cyan(relPath)}`);
|
|
3599
3595
|
if (debounceTimer) clearTimeout(debounceTimer);
|
|
3600
3596
|
debounceTimer = setTimeout(() => {
|
|
3601
|
-
|
|
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
|
+
});
|
|
3602
3600
|
}, DEBOUNCE_MS);
|
|
3603
3601
|
};
|
|
3604
3602
|
const dirs = collectDirs(cwd);
|
|
@@ -3626,7 +3624,9 @@ async function watchCommand() {
|
|
|
3626
3624
|
if (key === "d" || key === "D") {
|
|
3627
3625
|
if (debounceTimer) clearTimeout(debounceTimer);
|
|
3628
3626
|
console.log(` ${brand.dim(`[${timestamp()}]`)} Force deploy triggered`);
|
|
3629
|
-
|
|
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
|
+
});
|
|
3630
3630
|
}
|
|
3631
3631
|
});
|
|
3632
3632
|
}
|
|
@@ -3891,7 +3891,11 @@ async function monitorCommand(options = {}) {
|
|
|
3891
3891
|
}
|
|
3892
3892
|
};
|
|
3893
3893
|
await runCheck();
|
|
3894
|
-
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);
|
|
3895
3899
|
if (!options.daemon && process.stdin.isTTY) {
|
|
3896
3900
|
process.stdin.setRawMode(true);
|
|
3897
3901
|
process.stdin.resume();
|
|
@@ -4194,7 +4198,7 @@ program.command("fix").description("Auto-fix common build errors (missing deps,
|
|
|
4194
4198
|
handleError(err, "Fix command failed.");
|
|
4195
4199
|
}
|
|
4196
4200
|
});
|
|
4197
|
-
program.command("env").description("Scan
|
|
4201
|
+
program.command("env").description("Scan project for environment variables and check which are set").action(async () => {
|
|
4198
4202
|
try {
|
|
4199
4203
|
await envCommand();
|
|
4200
4204
|
} catch (err) {
|