@somewhere-cloud/cli 0.38.124 → 0.38.126
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/CHANGELOG.md +12 -0
- package/README.md +8 -5
- package/dist/lib/bundle.js +126 -83
- package/dist/lib/bundle.js.map +2 -2
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -2
package/dist/lib/bundle.js
CHANGED
|
@@ -37629,7 +37629,7 @@ import { spawn as spawn2 } from "node:child_process";
|
|
|
37629
37629
|
function initInstallSpawnSpec(platform2) {
|
|
37630
37630
|
return {
|
|
37631
37631
|
command: platform2 === "win32" ? "npm.cmd" : "npm",
|
|
37632
|
-
args: ["install", "--no-audit", "--no-fund"
|
|
37632
|
+
args: ["install", "--no-audit", "--no-fund"],
|
|
37633
37633
|
shell: platform2 === "win32"
|
|
37634
37634
|
};
|
|
37635
37635
|
}
|
|
@@ -38281,7 +38281,7 @@ not enough. So tickets lists create: ['staff']; without it every staff reply is
|
|
|
38281
38281
|
Publish pages in an owner-checked endpoint. Share with caller-scoped
|
|
38282
38282
|
sw.db.insert('note_shares', { grantee_id, note_id }); it checks row ownership.
|
|
38283
38283
|
Browser calls THROW, not { error }; catch below.
|
|
38284
|
-
Browser list:
|
|
38284
|
+
Browser list: paginate with after. Sort locally or in an endpoint.
|
|
38285
38285
|
|
|
38286
38286
|
\`\`\`ts
|
|
38287
38287
|
import { data } from 'somewhere:data';
|
|
@@ -38372,7 +38372,7 @@ Keep each run short:
|
|
|
38372
38372
|
text). Checks after a failure only wait out their timeouts. app.check() does both.
|
|
38373
38373
|
- After a fix, rerun the scripts that failed, each one whole: npx @somewhere-cloud/cli test --failed.
|
|
38374
38374
|
The CLI supplies its test helpers when it runs your tests. For the first browser test, install Playwright with npm install -D --save-exact @playwright/test@1.65.0.
|
|
38375
|
-
For a local Vite server, install the frontend tools with npm install
|
|
38375
|
+
For a local Vite server, install the frontend tools with npm install -D --save-exact vite@7.2.2.
|
|
38376
38376
|
The test helper, @somewhere-cloud/cli/script (import or require); these are all the calls a test needs:
|
|
38377
38377
|
const app = await openAppTest(); // the live origin, release and data contract
|
|
38378
38378
|
const ana = await app.signUp(page); // through your form: { id, email, password, verified }
|
|
@@ -38606,9 +38606,7 @@ var init_init_green_template = __esm({
|
|
|
38606
38606
|
"typecheck": "npx -y @somewhere-cloud/cli typecheck"
|
|
38607
38607
|
},
|
|
38608
38608
|
"dependencies": {
|
|
38609
|
-
"@somewhere-cloud/sdk": "0.14.2"
|
|
38610
|
-
},
|
|
38611
|
-
"optionalDependencies": {
|
|
38609
|
+
"@somewhere-cloud/sdk": "0.14.2",
|
|
38612
38610
|
"react": "19.2.7",
|
|
38613
38611
|
"react-dom": "19.2.7"
|
|
38614
38612
|
},
|
|
@@ -40942,13 +40940,30 @@ function pinnedNpx(version2) {
|
|
|
40942
40940
|
const entry = [besideNpm, besideNode].find((path3) => existsSync7(path3));
|
|
40943
40941
|
return entry ? { command: process.execPath, args: [entry, ...args] } : null;
|
|
40944
40942
|
}
|
|
40943
|
+
function repairStarterReact(json2, from) {
|
|
40944
|
+
if (from !== "0.38.123" && from !== "0.38.124")
|
|
40945
|
+
return false;
|
|
40946
|
+
const deps = json2.dependencies;
|
|
40947
|
+
const optional2 = json2.optionalDependencies;
|
|
40948
|
+
if (deps?.["@somewhere-cloud/sdk"] !== "0.14.2" || deps.react !== void 0 || deps["react-dom"] !== void 0 || optional2?.react !== "19.2.7" || optional2["react-dom"] !== "19.2.7")
|
|
40949
|
+
return false;
|
|
40950
|
+
deps.react = optional2.react;
|
|
40951
|
+
deps["react-dom"] = optional2["react-dom"];
|
|
40952
|
+
delete optional2.react;
|
|
40953
|
+
delete optional2["react-dom"];
|
|
40954
|
+
if (Object.keys(optional2).length === 0)
|
|
40955
|
+
delete json2.optionalDependencies;
|
|
40956
|
+
return true;
|
|
40957
|
+
}
|
|
40945
40958
|
function writeProjectPins(dir, pins, version2) {
|
|
40946
|
-
const
|
|
40959
|
+
const updated = [];
|
|
40960
|
+
let repairedStarter = false;
|
|
40947
40961
|
for (const pin of pins) {
|
|
40948
40962
|
const path3 = join7(dir, pin.source);
|
|
40949
40963
|
const raw = readFileSync9(path3, "utf8");
|
|
40950
40964
|
const json2 = JSON.parse(raw);
|
|
40951
40965
|
if (pin.versionOnly) {
|
|
40966
|
+
repairedStarter = repairStarterReact(json2, pin.spec);
|
|
40952
40967
|
json2.somewhere[PIN_FILE_KEY] = version2;
|
|
40953
40968
|
} else if (pin.source === "package.json") {
|
|
40954
40969
|
for (const section of ["devDependencies", "dependencies"]) {
|
|
@@ -40961,10 +40976,10 @@ function writeProjectPins(dir, pins, version2) {
|
|
|
40961
40976
|
}
|
|
40962
40977
|
const indent = /^\{\s*\n(\s+)/.exec(raw)?.[1] ?? " ";
|
|
40963
40978
|
writeFileSync7(path3, JSON.stringify(json2, null, indent) + "\n");
|
|
40964
|
-
if (!
|
|
40965
|
-
|
|
40979
|
+
if (!updated.includes(pin.source))
|
|
40980
|
+
updated.push(pin.source);
|
|
40966
40981
|
}
|
|
40967
|
-
return
|
|
40982
|
+
return { updated, repairedStarter };
|
|
40968
40983
|
}
|
|
40969
40984
|
function recordPinIfMissing(dir, version2) {
|
|
40970
40985
|
if (!import_semver.default.valid(version2) || readProjectPins(dir).length)
|
|
@@ -41015,6 +41030,7 @@ var init_project_pin = __esm({
|
|
|
41015
41030
|
PINNED_CHILD_ENV = "SOMEWHERE_PINNED_CLI";
|
|
41016
41031
|
__name(decidePin, "decidePin");
|
|
41017
41032
|
__name(pinnedNpx, "pinnedNpx");
|
|
41033
|
+
__name(repairStarterReact, "repairStarterReact");
|
|
41018
41034
|
__name(writeProjectPins, "writeProjectPins");
|
|
41019
41035
|
__name(recordPinIfMissing, "recordPinIfMissing");
|
|
41020
41036
|
__name(readBundledChangelog, "readBundledChangelog");
|
|
@@ -42979,9 +42995,7 @@ var init_init_feature_template = __esm({
|
|
|
42979
42995
|
"typecheck": "npx -y @somewhere-cloud/cli typecheck"
|
|
42980
42996
|
},
|
|
42981
42997
|
"dependencies": {
|
|
42982
|
-
"@somewhere-cloud/sdk": "0.14.2"
|
|
42983
|
-
},
|
|
42984
|
-
"optionalDependencies": {
|
|
42998
|
+
"@somewhere-cloud/sdk": "0.14.2",
|
|
42985
42999
|
"react": "19.2.7",
|
|
42986
43000
|
"react-dom": "19.2.7"
|
|
42987
43001
|
},
|
|
@@ -46055,7 +46069,7 @@ replaceable views in src/ui/ and styles in src/styles/, plus an AGENTS.md workfl
|
|
|
46055
46069
|
(deploy, then test). Sign-in and invitation links (sw.auth.invite) open
|
|
46056
46070
|
/auth/magic, which the starter routes before the sign-in gate.
|
|
46057
46071
|
\`--template minimal\` includes the SDK and auth route without sign-in screens.
|
|
46058
|
-
Init installs the SDK and editor types. The platform builds
|
|
46072
|
+
Init installs React, the SDK and editor types. The platform builds your source when you deploy.
|
|
46059
46073
|
TypeScript is fetched when first needed. Vite and Playwright are installed only if you choose to use them.
|
|
46060
46074
|
New starters and --bare also install ${skillNames(BUNDLED_SKILLS_PACK).length} agent skills in .agents/skills, pinned by skills-lock.json.
|
|
46061
46075
|
|
|
@@ -76321,13 +76335,20 @@ function solvePow(nonce, difficulty) {
|
|
|
76321
76335
|
}
|
|
76322
76336
|
}
|
|
76323
76337
|
}
|
|
76324
|
-
async function mintTempAccount(client = new ApiClient(null)) {
|
|
76325
|
-
|
|
76326
|
-
|
|
76327
|
-
|
|
76338
|
+
async function mintTempAccount(client = new ApiClient(null), onChallenge) {
|
|
76339
|
+
let data2;
|
|
76340
|
+
try {
|
|
76341
|
+
data2 = await client.call("POST", "/auth/temp-create", {}, void 0, { refresh: false });
|
|
76342
|
+
} catch (error3) {
|
|
76343
|
+
if (!(error3 instanceof CliApiError) || error3.code !== "POW_REQUIRED")
|
|
76344
|
+
throw error3;
|
|
76345
|
+
const challenge = error3.data?.challenge;
|
|
76346
|
+
if (typeof challenge?.nonce !== "string" || !challenge.nonce || typeof challenge.difficulty !== "number" || !Number.isInteger(challenge.difficulty) || challenge.difficulty < 0 || challenge.difficulty > 32)
|
|
76347
|
+
throw error3;
|
|
76348
|
+
onChallenge?.();
|
|
76349
|
+
const { suffix } = solvePow(challenge.nonce, challenge.difficulty);
|
|
76350
|
+
data2 = await client.call("POST", "/auth/temp-create", { nonce: challenge.nonce, suffix }, void 0, { refresh: false });
|
|
76328
76351
|
}
|
|
76329
|
-
const { suffix } = solvePow(challenge.nonce, challenge.difficulty);
|
|
76330
|
-
const data2 = await client.call("POST", "/auth/temp-create", { nonce: challenge.nonce, suffix }, void 0, { refresh: false });
|
|
76331
76352
|
const key = data2?.key ?? data2?.access_token;
|
|
76332
76353
|
if (!key) {
|
|
76333
76354
|
throw new CliApiError("INVALID_RESPONSE", "The temporary account response had neither `key` nor `access_token`.", 200);
|
|
@@ -76365,7 +76386,6 @@ function decodeCredentials(state, response) {
|
|
|
76365
76386
|
if (!state.handoff_id || response.project_id !== state.project_id) {
|
|
76366
76387
|
throw new Error("Claim continuation returned a different project. No credential was installed.");
|
|
76367
76388
|
}
|
|
76368
|
-
const account = response.approved_scope === "account";
|
|
76369
76389
|
const key = createHash5("sha256").update(`claim-cli-handoff:v1:${state.verifier}`, "utf8").digest();
|
|
76370
76390
|
const combined = Buffer.from(response.ciphertext, "base64");
|
|
76371
76391
|
if (combined.length <= 16)
|
|
@@ -76373,11 +76393,11 @@ function decodeCredentials(state, response) {
|
|
|
76373
76393
|
const encrypted = combined.subarray(0, -16);
|
|
76374
76394
|
const tag = combined.subarray(-16);
|
|
76375
76395
|
const decipher = createDecipheriv("aes-256-gcm", key, Buffer.from(response.iv, "base64"));
|
|
76376
|
-
decipher.setAAD(Buffer.from(`${state.handoff_id}:${state.project_id}
|
|
76396
|
+
decipher.setAAD(Buffer.from(`${state.handoff_id}:${state.project_id}`, "utf8"));
|
|
76377
76397
|
decipher.setAuthTag(tag);
|
|
76378
76398
|
const plaintext = Buffer.concat([decipher.update(encrypted), decipher.final()]).toString("utf8");
|
|
76379
76399
|
const parsed = JSON.parse(plaintext);
|
|
76380
|
-
if (typeof parsed.token !== "string" || typeof parsed.refresh_token !== "string" || typeof parsed.expires_at !== "string" || typeof parsed.email !== "string" || parsed.project_id !== state.project_id ||
|
|
76400
|
+
if (typeof parsed.token !== "string" || typeof parsed.refresh_token !== "string" || typeof parsed.expires_at !== "string" || typeof parsed.email !== "string" || parsed.project_id !== state.project_id || parsed.approved_scope !== void 0 && parsed.approved_scope !== "project" || parsed.scope?.projects?.length !== 1 || parsed.scope.projects[0] !== state.project_id) {
|
|
76381
76401
|
throw new Error("Claim continuation credential did not match the approved project. Nothing was installed.");
|
|
76382
76402
|
}
|
|
76383
76403
|
return parsed;
|
|
@@ -76410,8 +76430,7 @@ async function ensureClaimHandoff(projectId) {
|
|
|
76410
76430
|
project_id: projectId,
|
|
76411
76431
|
verifier_hash: verifierHash(state.verifier),
|
|
76412
76432
|
device_name: getDeviceKeyName(),
|
|
76413
|
-
client: describeThisDevice()
|
|
76414
|
-
capabilities: CAPABILITIES
|
|
76433
|
+
client: describeThisDevice()
|
|
76415
76434
|
}, config2.token);
|
|
76416
76435
|
if (!response.ok || !envelope.ok || !envelope.data) {
|
|
76417
76436
|
throw new Error(envelope.message || envelope.error || `CLI continuation registration failed (HTTP ${response.status}).`);
|
|
@@ -76476,6 +76495,12 @@ async function recoverClaimHandoff() {
|
|
|
76476
76495
|
} catch {
|
|
76477
76496
|
return { kind: "none" };
|
|
76478
76497
|
}
|
|
76498
|
+
if (envelope.error === "CLAIM_CLI_ACCOUNT_SCOPE_FORBIDDEN" || envelope.data?.approved_scope !== void 0 && envelope.data.approved_scope !== "project") {
|
|
76499
|
+
return {
|
|
76500
|
+
kind: "manual",
|
|
76501
|
+
message: `A claim link connects this CLI only to the claimed project. Run \`${cliInvocation()} login\` for account access.`
|
|
76502
|
+
};
|
|
76503
|
+
}
|
|
76479
76504
|
if (!response.ok || !envelope.ok || !envelope.data) {
|
|
76480
76505
|
if (["CLAIM_CLI_HANDOFF_PENDING", "CLAIM_CLI_HANDOFF_IN_PROGRESS"].includes(envelope.error || "")) {
|
|
76481
76506
|
return { kind: "none" };
|
|
@@ -76513,10 +76538,9 @@ async function recoverClaimHandoff() {
|
|
|
76513
76538
|
}
|
|
76514
76539
|
return {
|
|
76515
76540
|
kind: "recovered",
|
|
76516
|
-
message:
|
|
76541
|
+
message: `Connected to ${delivered.email} for this project only. The existing project link was kept. Run \`${cliInvocation()} login\` for account access.`
|
|
76517
76542
|
};
|
|
76518
76543
|
}
|
|
76519
|
-
var CAPABILITIES;
|
|
76520
76544
|
var init_claim_handoff = __esm({
|
|
76521
76545
|
"dist/lib/claim-handoff.js"() {
|
|
76522
76546
|
"use strict";
|
|
@@ -76526,7 +76550,6 @@ var init_claim_handoff = __esm({
|
|
|
76526
76550
|
init_device_login();
|
|
76527
76551
|
init_client();
|
|
76528
76552
|
init_http();
|
|
76529
|
-
CAPABILITIES = ["account_scope"];
|
|
76530
76553
|
__name(verifierHash, "verifierHash");
|
|
76531
76554
|
__name(newVerifier, "newVerifier");
|
|
76532
76555
|
__name(decodeCredentials, "decodeCredentials");
|
|
@@ -79994,7 +80017,7 @@ async function closeKept(client, entry) {
|
|
|
79994
80017
|
const removed = await client.call("DELETE", "/auth/test-users", { project_id: entry.project_id, ids });
|
|
79995
80018
|
return { browsers, identities: { status: "deleted", ...typeof removed?.deleted === "number" ? { deleted: removed.deleted } : {} } };
|
|
79996
80019
|
} catch (cause) {
|
|
79997
|
-
return { browsers, identities: { status: `unconfirmed (${cause instanceof CliApiError ? cause.code : "delete failed"});
|
|
80020
|
+
return { browsers, identities: { status: `unconfirmed (${cause instanceof CliApiError ? cause.code : "delete failed"}); the platform removes them when they expire` } };
|
|
79998
80021
|
}
|
|
79999
80022
|
}
|
|
80000
80023
|
function keepStartNote(entry, otherFlowsKept) {
|
|
@@ -80210,7 +80233,7 @@ function assertSessionSeedSize(flow) {
|
|
|
80210
80233
|
headers: flow.headers ?? {}
|
|
80211
80234
|
}));
|
|
80212
80235
|
if (bytes > 8 * 1024)
|
|
80213
|
-
throw new Error(
|
|
80236
|
+
throw new Error("The verification session data is too large. Remove unused local storage entries, cookies, or headers and run again.");
|
|
80214
80237
|
}
|
|
80215
80238
|
function normalizeViewports(raw) {
|
|
80216
80239
|
if (raw === void 0)
|
|
@@ -80874,7 +80897,7 @@ function createVerifyJourneyRun(target, journey, client, opts = {}) {
|
|
|
80874
80897
|
}, "createTestUsers");
|
|
80875
80898
|
const removeTestUsers = /* @__PURE__ */ __name(async () => {
|
|
80876
80899
|
if (opts.keepTestUsers)
|
|
80877
|
-
return { status: "kept", reason: "kept on request
|
|
80900
|
+
return { status: "kept", reason: "kept on request until they expire" };
|
|
80878
80901
|
if (keep && keptForReuse.size > 0 && testActors.every((name) => keptForReuse.has(name)))
|
|
80879
80902
|
return { status: "kept", reason: "kept with their browsers for the next --keep-actors run; remove them with --close-actors" };
|
|
80880
80903
|
try {
|
|
@@ -80882,7 +80905,7 @@ function createVerifyJourneyRun(target, journey, client, opts = {}) {
|
|
|
80882
80905
|
return { status: "deleted", deleted: typeof removed?.deleted === "number" ? removed.deleted : void 0 };
|
|
80883
80906
|
} catch (cause) {
|
|
80884
80907
|
const code = cause instanceof CliApiError ? cause.code : cause instanceof Error ? cause.message : String(cause);
|
|
80885
|
-
return { status: "unconfirmed", reason: `delete failed (${code}); the platform removes test users
|
|
80908
|
+
return { status: "unconfirmed", reason: `delete failed (${code}); the platform removes test users when they expire` };
|
|
80886
80909
|
}
|
|
80887
80910
|
}, "removeTestUsers");
|
|
80888
80911
|
const stop = /* @__PURE__ */ __name((code, message3) => {
|
|
@@ -81109,7 +81132,7 @@ function createVerifyJourneyRun(target, journey, client, opts = {}) {
|
|
|
81109
81132
|
continue;
|
|
81110
81133
|
}
|
|
81111
81134
|
if (!first && report2.session_note) {
|
|
81112
|
-
const message3 = `${segment.as}'s browser ended between segments (${report2.session_note}), so ${segment.as} is no longer the same signed-in user.
|
|
81135
|
+
const message3 = `${segment.as}'s browser ended between segments (${report2.session_note}), so ${segment.as} is no longer the same signed-in user. Shorten the gaps between that actor's segments and run the journey again.`;
|
|
81113
81136
|
itemStop ??= stopAt("error", "VERIFY_ACTOR_SESSION_ENDED", message3);
|
|
81114
81137
|
segments.push({ ...base, ...timing, ran: true, final_url: report2.final_url === void 0 ? void 0 : reportUrl(report2.final_url), error: { code: "VERIFY_ACTOR_SESSION_ENDED", message: message3 } });
|
|
81115
81138
|
continue;
|
|
@@ -81469,7 +81492,7 @@ function registerVerify(program2) {
|
|
|
81469
81492
|
cliCookies.push({ name: value.slice(0, at2), value: value.slice(at2 + 1) });
|
|
81470
81493
|
return value;
|
|
81471
81494
|
}, "collectCookie");
|
|
81472
|
-
program2.command("verify [target]").description("Run one browser flow at desktop and phone size, report every step and health signal, and capture both screenshots.").option("--project <ref>", "Project to verify. With --url, use this when the directory is unlinked or points to another project.").option("--url <url>", "Live or local URL to verify.").option("--path <path>", "Path relative to the linked or selected project app, e.g. /settings. Cannot be combined with --url.").option("--flow <file.json>", "Flow JSON with actions, session seeds, expect_requests, visible_only, and viewports. Omit for the default health check.").option("--session <session-id>", "Existing app session value to seed as localStorage sw_auth in every viewport.").option("--cookie <name=value>", "Existing app cookie to seed in every viewport. Repeatable.", collectCookie).option("--json", "Print the structured verification report as JSON.").option("--out <file>", "Write the full report to a new private file; print a bounded summary (JSON with --json).").option("--keep-actors", "Multi-user flows: after a fully passed run, keep each actor's signed-in browser and test user, and reconnect to them on the next run of the same flow file in this project folder. Each run
|
|
81495
|
+
program2.command("verify [target]").description("Run one browser flow at desktop and phone size, report every step and health signal, and capture both screenshots.").option("--project <ref>", "Project to verify. With --url, use this when the directory is unlinked or points to another project.").option("--url <url>", "Live or local URL to verify.").option("--path <path>", "Path relative to the linked or selected project app, e.g. /settings. Cannot be combined with --url.").option("--flow <file.json>", "Flow JSON with actions, session seeds, expect_requests, visible_only, and viewports. Omit for the default health check.").option("--session <session-id>", "Existing app session value to seed as localStorage sw_auth in every viewport.").option("--cookie <name=value>", "Existing app cookie to seed in every viewport. Repeatable.", collectCookie).option("--json", "Print the structured verification report as JSON.").option("--out <file>", "Write the full report to a new private file; print a bounded summary (JSON with --json).").option("--keep-actors", "Multi-user flows: after a fully passed run, keep each actor's signed-in browser and test user, and reconnect to them on the next run of the same flow file in this project folder. Each run starts at the same paths and runs the same checks. Cookies, storage and app data carry over. One run per kept flow at a time. Use --close-actors to close the kept browsers, or let them expire.").option("--resume-page", "With --keep-actors: an explicit stateful warm continuation. An actor whose first segment starts at exactly the page path the last passed run left it on keeps that page as it was last observed (no reload, like reusing a Playwright page); if the app moved it afterwards, the run continues from there. A different actor, flow, project or start path, or a page told apart only by its query or fragment, reloads normally. The kept page may run code from before the latest deploy, so a resumed run is not fresh-release evidence; the report lists resumed actors.").option("--close-actors", "Close every browser and delete every test user that --keep-actors kept for this project in this folder, then exit.").option("--keep-test-users", 'Multi-user flows: keep the users created for "test_user" actors until they expire.').option("--schema", "Print the JSON Schema for --flow files (one user, or several users) and exit.").addHelpText("after", `
|
|
81473
81496
|
Minimal --flow JSON:
|
|
81474
81497
|
{
|
|
81475
81498
|
"actions": [
|
|
@@ -81511,15 +81534,12 @@ Several users in one run (--project required; each actor is its own browser):
|
|
|
81511
81534
|
}
|
|
81512
81535
|
Segments run in order; a later segment for the same actor continues in that
|
|
81513
81536
|
actor's browser (path becomes a goto). For realtime checks, an item
|
|
81514
|
-
{ "parallel": [segment, segment] } runs
|
|
81515
|
-
same time (alice waits for a message while bob sends it).
|
|
81516
|
-
|
|
81517
|
-
|
|
81518
|
-
|
|
81519
|
-
|
|
81520
|
-
Several users need a claimed account and a CLI login approved for all your
|
|
81521
|
-
projects: a login approved for "Only these projects" cannot open named browsers
|
|
81522
|
-
(SESSION_SCOPE_FORBIDDEN). Print the full flow schema with: ${cliInvocation()} verify --schema
|
|
81537
|
+
{ "parallel": [segment, segment] } runs segments by different actors at the
|
|
81538
|
+
same time (alice waits for a message while bob sends it). When the run ends or is
|
|
81539
|
+
interrupted, verification closes each actor's browser and reports any close it
|
|
81540
|
+
could not confirm. The platform closes idle browsers when they expire.
|
|
81541
|
+
For named browsers in a multi-user run, claim the project and use ${cliInvocation()} login
|
|
81542
|
+
with account access. Print the full flow schema with ${cliInvocation()} verify --schema.
|
|
81523
81543
|
`).action(async (target, opts) => {
|
|
81524
81544
|
if (opts.schema) {
|
|
81525
81545
|
console.log(JSON.stringify(verifyFlowSchema(), null, 2));
|
|
@@ -81832,7 +81852,7 @@ var init_verify = __esm({
|
|
|
81832
81852
|
__name(isVerifyJourneyInput, "isVerifyJourneyInput");
|
|
81833
81853
|
__name(normalizeVerifyJourney, "normalizeVerifyJourney");
|
|
81834
81854
|
__name(loadVerifyInput, "loadVerifyInput");
|
|
81835
|
-
UNCONFIRMED_BACKSTOP = "the platform closes
|
|
81855
|
+
UNCONFIRMED_BACKSTOP = "the platform closes idle browsers when they expire";
|
|
81836
81856
|
RECLOSE_AFTER_ABANDONED_MS = 5e3;
|
|
81837
81857
|
__name(settleWithin, "settleWithin");
|
|
81838
81858
|
__name(createVerifyJourneyRun, "createVerifyJourneyRun");
|
|
@@ -82180,7 +82200,7 @@ No project yet? Signed in, deploy never creates one on its own:
|
|
|
82180
82200
|
${cliInvocation()} init --bare --name <name> create a project in your account and link this folder
|
|
82181
82201
|
${cliInvocation()} deploy then deploy it
|
|
82182
82202
|
Existing project: \`${cliInvocation()} init --link --project <ref>\` (see \`${cliInvocation()} projects\`), or \`--project <ref>\` here.
|
|
82183
|
-
`).option("--project <ref>", `Existing project to deploy to \u2014 accepts the project UUID, slug, or subdomain (all three resolve server-side). To create one, run \`${cliInvocation()} init --bare --name <name>\``).option("--scope <scope>", "Partial deploy: 'functions' (backend only, leaves the site untouched) or 'static' (site only, leaves functions untouched). Default deploys both.").option("--dry-run", "Show what would change (added / modified / removed files) in an already deployed project, without deploying. The files a deploy would publish are sent to Somewhere to compute the change; nothing is published. Never creates a project or a temporary workspace.").option("--replace-functions", "Delete deployed functions that are not in this directory. A full deploy already does; use it with --scope functions, which otherwise keeps them.").option("--prebuilt", "Deploy pre-built / bundled output (e.g. a dist/ folder) instead of raw source. Raw source is the default and recommended path: the platform compiles your TSX/JSX/TS on deploy, which keeps the app editable end-to-end. Choosing --prebuilt trades that away \u2014 pull/export round-trips, find/replace patches, and visual (source-map) editing are disabled for the bundled files. Use it only when you need full control of your own build.").option("--allow-bundled", "Alias for --prebuilt.").option("--new", "Publish to a new project and replace this folder\u2019s .somewhere.json link").option("--temporary", "Deploy to a temporary workspace and show when it expires (automatic when logged out)").option("--force", "Overwrite remote changes even when this machine last deployed an older version").option("--include <paths>", 'Publish a file or folder the deploy would otherwise hold back, e.g. --include NOTES.md or --include tests (comma-separate several, or repeat the flag). A "!NOTES.md" or "!tests/" line in .somewhereignore does the same thing permanently.', (value, previous = []) => previous.concat(value.split(",").map((v2) => v2.trim()).filter(Boolean))).option("--yes", "Skip confirmation prompts (for --force)").option("--verify [flow.json]", "After the deploy is live, run one browser verification flow at desktop and phone size. Omit the file for the default health check.").addOption(new Option("--test", "After a successful deploy, run somewhere test once against the new release").hideHelp()).option("-m, --message <text>", "
|
|
82203
|
+
`).option("--project <ref>", `Existing project to deploy to \u2014 accepts the project UUID, slug, or subdomain (all three resolve server-side). To create one, run \`${cliInvocation()} init --bare --name <name>\``).option("--scope <scope>", "Partial deploy: 'functions' (backend only, leaves the site untouched) or 'static' (site only, leaves functions untouched). Default deploys both.").option("--dry-run", "Show what would change (added / modified / removed files) in an already deployed project, without deploying. The files a deploy would publish are sent to Somewhere to compute the change; nothing is published. Never creates a project or a temporary workspace.").option("--replace-functions", "Delete deployed functions that are not in this directory. A full deploy already does; use it with --scope functions, which otherwise keeps them.").option("--prebuilt", "Deploy pre-built / bundled output (e.g. a dist/ folder) instead of raw source. Raw source is the default and recommended path: the platform compiles your TSX/JSX/TS on deploy, which keeps the app editable end-to-end. Choosing --prebuilt trades that away \u2014 pull/export round-trips, find/replace patches, and visual (source-map) editing are disabled for the bundled files. Use it only when you need full control of your own build.").option("--allow-bundled", "Alias for --prebuilt.").option("--new", "Publish to a new project and replace this folder\u2019s .somewhere.json link").option("--temporary", "Deploy to a temporary workspace and show when it expires (automatic when logged out)").option("--force", "Overwrite remote changes even when this machine last deployed an older version").option("--include <paths>", 'Publish a file or folder the deploy would otherwise hold back, e.g. --include NOTES.md or --include tests (comma-separate several, or repeat the flag). A "!NOTES.md" or "!tests/" line in .somewhereignore does the same thing permanently.', (value, previous = []) => previous.concat(value.split(",").map((v2) => v2.trim()).filter(Boolean))).option("--yes", "Skip confirmation prompts (for --force)").option("--verify [flow.json]", "After the deploy is live, run one browser verification flow at desktop and phone size. Omit the file for the default health check.").addOption(new Option("--test", "After a successful deploy, run somewhere test once against the new release").hideHelp()).option("-m, --message <text>", "Add a note for this version").option("--json", "Print the deploy result and its uploaded file list as JSON on stdout. Stderr lists files left out locally by path and reason.").option("--list-unpublished", "List the local files deploy would keep on your machine, then exit").option("--allow-type-errors", "Upload even when the local TypeScript check fails").option("--timing", "Print deploy details and timings").action(async (dir, opts) => {
|
|
82184
82204
|
const startupMs = performance.now();
|
|
82185
82205
|
const targetDir = resolveTargetDir(dir);
|
|
82186
82206
|
if (opts.new && (opts.project || opts.dryRun || opts.temporary)) {
|
|
@@ -82216,10 +82236,16 @@ Existing project: \`${cliInvocation()} init --link --project <ref>\` (see \`${cl
|
|
|
82216
82236
|
const typecheckStartedAt = performance.now();
|
|
82217
82237
|
const hasTsconfig = existsSync28(join33(targetDir, "tsconfig.json"));
|
|
82218
82238
|
const missingDependencies = hasTsconfig && missingProjectDependencies(targetDir).length > 0;
|
|
82219
|
-
|
|
82239
|
+
const checkingTypes = hasTsconfig && !missingDependencies;
|
|
82240
|
+
if (checkingTypes && typecheckCompilerSource(targetDir) === "npx") {
|
|
82220
82241
|
announceNpxTypeScriptFetch(TYPECHECK_TYPESCRIPT_VERSION);
|
|
82221
82242
|
}
|
|
82222
|
-
const
|
|
82243
|
+
const typecheckHeartbeat = checkingTypes && !opts.json ? setInterval(() => {
|
|
82244
|
+
process.stderr.write(`Still checking types before upload after ${formatDeployElapsed(performance.now() - typecheckStartedAt)}...
|
|
82245
|
+
`);
|
|
82246
|
+
}, deployHeartbeatMs()).unref() : void 0;
|
|
82247
|
+
const typecheck = checkingTypes ? runTypecheck(targetDir).then((value) => ({ value }), (error3) => ({ error: error3 })).finally(() => {
|
|
82248
|
+
clearInterval(typecheckHeartbeat);
|
|
82223
82249
|
typecheckMs = performance.now() - typecheckStartedAt;
|
|
82224
82250
|
}) : Promise.resolve(null);
|
|
82225
82251
|
const verifyFlow = opts.verify && !opts.dryRun ? loadVerifyFlow(typeof opts.verify === "string" ? opts.verify : void 0, targetDir) : void 0;
|
|
@@ -82248,7 +82274,7 @@ Existing project: \`${cliInvocation()} init --link --project <ref>\` (see \`${cl
|
|
|
82248
82274
|
process.exit(1);
|
|
82249
82275
|
}
|
|
82250
82276
|
if (Object.keys(files).length === 0 && Object.keys(binaryFiles).length === 0 && Object.keys(functions).length === 0) {
|
|
82251
|
-
const message3 = `No deployable source found. Create an index.html or add raw app source files, or add
|
|
82277
|
+
const message3 = `No deployable source found. Create an index.html or add raw app source files, or add API handlers under api/, then run \`${cliInvocation()} deploy\` again.`;
|
|
82252
82278
|
if (opts.json)
|
|
82253
82279
|
printJsonError("NO_DEPLOYABLE_SOURCE", message3);
|
|
82254
82280
|
else
|
|
@@ -82319,10 +82345,13 @@ Existing project: \`${cliInvocation()} init --link --project <ref>\` (see \`${cl
|
|
|
82319
82345
|
else
|
|
82320
82346
|
info(note);
|
|
82321
82347
|
}
|
|
82322
|
-
const
|
|
82348
|
+
const signupSpinner = opts.json ? null : ora("Starting a temporary session\u2026").start();
|
|
82323
82349
|
try {
|
|
82324
|
-
const account = await mintTempAccount()
|
|
82325
|
-
|
|
82350
|
+
const account = await mintTempAccount(void 0, () => {
|
|
82351
|
+
if (signupSpinner)
|
|
82352
|
+
signupSpinner.text = "Completing the temporary session check\u2026";
|
|
82353
|
+
});
|
|
82354
|
+
signupSpinner?.stop();
|
|
82326
82355
|
if (besideRealLogin) {
|
|
82327
82356
|
const minted = {
|
|
82328
82357
|
token: account.key,
|
|
@@ -82352,9 +82381,20 @@ Existing project: \`${cliInvocation()} init --link --project <ref>\` (see \`${cl
|
|
|
82352
82381
|
};
|
|
82353
82382
|
}
|
|
82354
82383
|
} catch (err) {
|
|
82355
|
-
|
|
82384
|
+
signupSpinner?.fail("Could not create a temporary session");
|
|
82356
82385
|
const status = err instanceof CliApiError ? ` ${dim(err.statusCode ? `[${err.code}, HTTP ${err.statusCode}]` : `[${err.code}]`)}` : "";
|
|
82357
|
-
|
|
82386
|
+
const envelope = platformErrorEnvelope(err);
|
|
82387
|
+
if (envelope?.code === "INVALID_POW" || envelope?.code === "POW_REQUIRED") {
|
|
82388
|
+
const message3 = `The temporary session check failed. Run \`${cliInvocation()} deploy\` to try again.`;
|
|
82389
|
+
if (opts.json) {
|
|
82390
|
+
noteFailure(err);
|
|
82391
|
+
printJsonError(envelope.code, message3, envelope.extra);
|
|
82392
|
+
} else {
|
|
82393
|
+
error(`${message3}${status}`, err);
|
|
82394
|
+
}
|
|
82395
|
+
} else {
|
|
82396
|
+
error(`${err instanceof Error ? err.message : String(err)}${status}`, err);
|
|
82397
|
+
}
|
|
82358
82398
|
process.exit(1);
|
|
82359
82399
|
}
|
|
82360
82400
|
}
|
|
@@ -82528,7 +82568,7 @@ Existing project: \`${cliInvocation()} init --link --project <ref>\` (see \`${cl
|
|
|
82528
82568
|
warn(`This looks like a Node server app (${serverSignal}) \u2014 somewhere.cloud does not run server processes.`);
|
|
82529
82569
|
warn("It will deploy as static files only: your routes will NOT run, and the");
|
|
82530
82570
|
warn("server source will be publicly readable at its file path.");
|
|
82531
|
-
warn("The platform
|
|
82571
|
+
warn("The platform accepts static files at the root and API handlers under api/.");
|
|
82532
82572
|
warn("(each default-exports async (req, sw) and becomes a route).");
|
|
82533
82573
|
warn(`Full quickstart: ${cliInvocation()} docs start`);
|
|
82534
82574
|
}
|
|
@@ -82536,18 +82576,15 @@ Existing project: \`${cliInvocation()} init --link --project <ref>\` (see \`${cl
|
|
|
82536
82576
|
spinner?.start();
|
|
82537
82577
|
}
|
|
82538
82578
|
const totalFiles = Object.keys(files).length + Object.keys(binaryFiles).length + Object.keys(functions).length;
|
|
82539
|
-
const textBytes = Object.values(files).concat(Object.values(functions)).reduce((sum, c) => sum + c.length, 0);
|
|
82540
|
-
const binaryBytes = Object.values(binaryFiles).reduce((sum, b64) => sum + Math.floor(b64.length * 3 / 4), 0);
|
|
82541
|
-
const totalBytes = textBytes + binaryBytes;
|
|
82542
82579
|
const inventory = uploadInventory(files, binaryFiles, functions, scope);
|
|
82543
82580
|
if (opts.dryRun && !opts.json) {
|
|
82544
82581
|
spinner?.stop();
|
|
82545
|
-
info(dim(`Dry run: sending ${totalFiles} files
|
|
82582
|
+
info(dim(`Dry run: sending ${totalFiles} files to Somewhere to check what would change. Nothing is published.`));
|
|
82546
82583
|
if (process.stderr.isTTY)
|
|
82547
82584
|
spinner?.start();
|
|
82548
82585
|
}
|
|
82549
82586
|
if (spinner) {
|
|
82550
|
-
spinner.text = opts.dryRun ? `Checking ${totalFiles} files
|
|
82587
|
+
spinner.text = opts.dryRun ? `Checking ${totalFiles} files...` : `Deploying ${totalFiles} files...`;
|
|
82551
82588
|
}
|
|
82552
82589
|
let deployAnswered = false;
|
|
82553
82590
|
let deployRequestStartedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -82694,7 +82731,6 @@ Existing project: \`${cliInvocation()} init --link --project <ref>\` (see \`${cl
|
|
|
82694
82731
|
scope,
|
|
82695
82732
|
functionCount: countFunctionRoutes(functions),
|
|
82696
82733
|
staticFileCount: inventory.static_files.length,
|
|
82697
|
-
totalBytes,
|
|
82698
82734
|
linkedProject: await linkedProjectWithSubdomain(client, result, targetProjectConfig)
|
|
82699
82735
|
});
|
|
82700
82736
|
if (opts.timing && !opts.json) {
|
|
@@ -82888,7 +82924,7 @@ ${dim("Build")}`);
|
|
|
82888
82924
|
info(formatTempExpiry(tempSession.expiresAt, tempSession.ttlSeconds));
|
|
82889
82925
|
const link = teal(tempSession.claimUrl);
|
|
82890
82926
|
if (tempSession.handoffReady) {
|
|
82891
|
-
info(`Open ${link} and select "Save
|
|
82927
|
+
info(`Open ${link} and select "Save and connect agent" to save the project and connect this terminal to it only. Run \`${cliInvocation()} login\` for account access.`);
|
|
82892
82928
|
} else if (besideRealLogin) {
|
|
82893
82929
|
info(`Open ${link} to save the project to your account, then run \`${cliInvocation()} init --link --project ${projectId}\` in an unlinked folder to work on it.`);
|
|
82894
82930
|
} else {
|
|
@@ -83066,13 +83102,13 @@ function formatDeploySuccess(result, options2) {
|
|
|
83066
83102
|
if (options2.scope === "functions") {
|
|
83067
83103
|
headline = `${formatPublishSurface({ staticFiles: null, functions: options2.functionCount })} deployed \u2014 site left untouched`;
|
|
83068
83104
|
} else if (options2.scope === "static") {
|
|
83069
|
-
headline = `${staticLabel} uploaded
|
|
83105
|
+
headline = `${staticLabel} uploaded \u2014 functions left untouched`;
|
|
83070
83106
|
} else {
|
|
83071
83107
|
const both = formatPublishSurface({
|
|
83072
83108
|
staticFiles: staticFileCount,
|
|
83073
83109
|
functions: options2.functionCount
|
|
83074
83110
|
});
|
|
83075
|
-
headline = `${staticFileCount === null && options2.functionCount === 0 ? staticLabel : both} uploaded
|
|
83111
|
+
headline = `${staticFileCount === null && options2.functionCount === 0 ? staticLabel : both} uploaded`;
|
|
83076
83112
|
}
|
|
83077
83113
|
const responseUrl = typeof result.url === "string" && result.url.trim() ? result.url.trim() : null;
|
|
83078
83114
|
const linkedSubdomain = typeof options2.linkedProject?.subdomain === "string" ? options2.linkedProject.subdomain.trim() : "";
|
|
@@ -83352,7 +83388,7 @@ var init_deploy = __esm({
|
|
|
83352
83388
|
"optionalDependencies"
|
|
83353
83389
|
];
|
|
83354
83390
|
NEXT_APP_WARNING = `Next.js apps do not run here. Somewhere supports HTML responses from ordinary server functions. Port API routes to api/ handlers and HTML pages to root routes such as [...path].ts, or start from a Vite React app. Read ${cliInvocation()} docs functions; deploy raw JSX/TSX.`;
|
|
83355
|
-
DEPLOY_HEARTBEAT_MS =
|
|
83391
|
+
DEPLOY_HEARTBEAT_MS = 1e4;
|
|
83356
83392
|
DEPLOY_MAX_ATTEMPTS = 2;
|
|
83357
83393
|
RETRYABLE_DEPLOY_CODES = /* @__PURE__ */ new Set(["TIMEOUT", "SERVER_SLOW", "NETWORK_ERROR"]);
|
|
83358
83394
|
DEPLOY_RETRY_MAX_WAIT_MS = 1e4;
|
|
@@ -86773,7 +86809,7 @@ function registerEnv(program2) {
|
|
|
86773
86809
|
}
|
|
86774
86810
|
success(`Wrote ${keys.length} key${keys.length === 1 ? "" : "s"} to ${teal(opts.out)} (values blank \u2014 fill them in for local runs)`);
|
|
86775
86811
|
});
|
|
86776
|
-
env.command("set <key> [value]").description("Set an environment value; use --stdin to keep it out of shell history").option("--project <id>", "Project ID").option("--stdin", "Read the value from stdin (removes one final line ending)").option("--public", "Explicitly allow browser exposure for a VITE_/REACT_APP_ name").option("--private", "Keep this value server-only").option("--scope <scope>", "Environment: all, dev, or prod (default: all)").option("--provider <name>", "Optional provider label
|
|
86812
|
+
env.command("set <key> [value]").description("Set an environment value; use --stdin to keep it out of shell history").option("--project <id>", "Project ID").option("--stdin", "Read the value from stdin (removes one final line ending)").option("--public", "Explicitly allow browser exposure for a VITE_/REACT_APP_ name").option("--private", "Keep this value server-only").option("--scope <scope>", "Environment: all, dev, or prod (default: all)").option("--provider <name>", "Optional provider label").option("--purpose <text>", "Optional purpose description").option("--json", "Print the raw env response as JSON").action(async (key, positionalValue, opts) => {
|
|
86777
86813
|
if (opts.public && opts.private) {
|
|
86778
86814
|
error("--public and --private cannot be used together.");
|
|
86779
86815
|
process.exit(1);
|
|
@@ -87312,7 +87348,7 @@ function registerClaim(program2) {
|
|
|
87312
87348
|
program2.command("claim").description("Print the claim URL that keeps this computer's temporary (signed-out) projects").option("--json", "Print { claim_url, expires_at } as JSON").action((opts) => {
|
|
87313
87349
|
const config2 = loadConfig();
|
|
87314
87350
|
if (!config2?.temporary || !config2.claim_url) {
|
|
87315
|
-
const message3 = config2?.token ? `This
|
|
87351
|
+
const message3 = config2?.token ? `This terminal has no temporary workspace to claim. Run \`${cliInvocation()} projects\` to see the projects it can access.` : `This terminal has no temporary workspace. If you deployed signed out from another terminal, run \`${cliInvocation()} claim\` there. Run \`${cliInvocation()} deploy\` here to start one.`;
|
|
87316
87352
|
if (opts.json)
|
|
87317
87353
|
printJson({ ok: false, error: config2?.token ? "NOT_TEMPORARY" : "NO_TEMPORARY_WORKSPACE", message: message3 });
|
|
87318
87354
|
else
|
|
@@ -87333,7 +87369,11 @@ function registerClaim(program2) {
|
|
|
87333
87369
|
info(`Claim URL: ${teal(config2.claim_url)}`);
|
|
87334
87370
|
if (config2.temp_expires_at)
|
|
87335
87371
|
info(`Expires at: ${config2.temp_expires_at} (UTC)`);
|
|
87336
|
-
info(
|
|
87372
|
+
info("Open it in a browser and sign in or create an account to keep these projects.");
|
|
87373
|
+
if (config2.claim_handoff?.handoff_id) {
|
|
87374
|
+
info('Choose "Save and connect agent" to connect this terminal to the claimed project only.');
|
|
87375
|
+
}
|
|
87376
|
+
info(`Run \`${cliInvocation()} login\` for account access.`);
|
|
87337
87377
|
});
|
|
87338
87378
|
}
|
|
87339
87379
|
var init_claim = __esm({
|
|
@@ -87451,7 +87491,7 @@ async function startFrontendDev(cwd, target, port = 8787, open3 = false) {
|
|
|
87451
87491
|
vitePath = createRequire7(join37(cwd, "package.json")).resolve("vite");
|
|
87452
87492
|
} catch {
|
|
87453
87493
|
if (readProjectPin(cwd)?.versionOnly) {
|
|
87454
|
-
throw new Error("Install the local frontend tools: npm install
|
|
87494
|
+
throw new Error("Install the local frontend tools: npm install -D --save-exact vite@7.2.2");
|
|
87455
87495
|
}
|
|
87456
87496
|
throw new Error(`Install this frontend\u2019s Vite dependencies before running ${cliInvocation()} dev. Backend changes run through ${cliInvocation()} deploy or ${cliInvocation()} preview.`);
|
|
87457
87497
|
}
|
|
@@ -87769,7 +87809,7 @@ function registerPreview(program2) {
|
|
|
87769
87809
|
row.promotable ? "yes" : "no: production changed",
|
|
87770
87810
|
row.this_folder ? "this folder" : ""
|
|
87771
87811
|
]));
|
|
87772
|
-
console.log(dim("Each open preview holds a copy of production data until it is promoted, closed, or
|
|
87812
|
+
console.log(dim("Each open preview holds a copy of production data until it is promoted, closed, or expires."));
|
|
87773
87813
|
console.log(dim(`Close one: ${cliInvocation()} preview close <preview_session_id>. Promote one: ${cliInvocation()} promote <preview_session_id> <preview_id>.`));
|
|
87774
87814
|
} catch (err) {
|
|
87775
87815
|
if (opts.json)
|
|
@@ -87847,9 +87887,9 @@ function registerPreview(program2) {
|
|
|
87847
87887
|
previewToolFailed(err, opts.json, "PREVIEW_USER_REMOVE_FAILED", target);
|
|
87848
87888
|
}
|
|
87849
87889
|
});
|
|
87850
|
-
preview.command("run-job <handler-path>").description("Run one handler path once in this folder's open preview, as one signed job delivery, and wait for its result (a scheduled task is a handler path plus a payload)").option("--payload <json>", "JSON payload the handler receives (default: none)").option("--no-wait", "Return as soon as the run is queued instead of waiting for its result").option("--timeout <seconds>", "How long to wait for the result (default 300
|
|
87890
|
+
preview.command("run-job <handler-path>").description("Run one handler path once in this folder's open preview, as one signed job delivery, and wait for its result (a scheduled task is a handler path plus a payload)").option("--payload <json>", "JSON payload the handler receives (default: none)").option("--no-wait", "Return as soon as the run is queued instead of waiting for its result").option("--timeout <seconds>", "How long to wait for the result (default 300)").option("--project <id>", "Override project ID").option("--preview-session <id>", "Which preview (its preview_session_id); default: this folder's").option("--json", "Print the run (and its result) as JSON").addHelpText("after", `
|
|
87851
87891
|
The run uses the preview's own code, data, files, users and mail; it has no signed-in user (like a scheduled
|
|
87852
|
-
run in production)
|
|
87892
|
+
run in production). It runs once. Nothing in your live app runs or changes.
|
|
87853
87893
|
To run a production schedule's handler and payload this way: ${cliInvocation()} cron run <name> --preview
|
|
87854
87894
|
`).action(async (handlerPath, _opts, cmd) => {
|
|
87855
87895
|
const opts = cmd.optsWithGlobals();
|
|
@@ -129478,9 +129518,9 @@ function upgradeProject(dir, running, changelog = readBundledChangelog) {
|
|
|
129478
129518
|
throw new Error(`This CLI (${running}) is older than the project's pin (${current}). Run the newer CLI's upgrade: \`npx -y ${CLI_PACKAGE_NAME}@latest upgrade\`.`);
|
|
129479
129519
|
}
|
|
129480
129520
|
const alreadyExact = pins.every((pin) => pin.spec === running);
|
|
129481
|
-
const updated = alreadyExact ? [] : writeProjectPins(dir, pins, running);
|
|
129482
|
-
const next = pins.some((pin) => pin.source === "package.json" && !pin.versionOnly && pin.spec !== running) ? ["npm install"] : [];
|
|
129483
|
-
return { from, to: running, updated, changes: changelogBetween(changelog(), from, running), next };
|
|
129521
|
+
const { updated, repairedStarter } = alreadyExact ? { updated: [], repairedStarter: false } : writeProjectPins(dir, pins, running);
|
|
129522
|
+
const next = repairedStarter || pins.some((pin) => pin.source === "package.json" && !pin.versionOnly && pin.spec !== running) ? ["npm install"] : [];
|
|
129523
|
+
return { from, to: running, updated, changes: changelogBetween(changelog(), from, running), next, ...repairedStarter ? { repairedStarter } : {} };
|
|
129484
129524
|
}
|
|
129485
129525
|
function registerUpgrade(program2) {
|
|
129486
129526
|
program2.command("upgrade").description("Move this project to the CLI you are running: rewrite its recorded CLI version and print the changes in between").option("--json", "Print the result as JSON").addHelpText("after", `
|
|
@@ -129520,7 +129560,9 @@ Agent skills are not changed; \`${cliInvocation()} skills update\` refreshes the
|
|
|
129520
129560
|
console.log("");
|
|
129521
129561
|
}
|
|
129522
129562
|
}
|
|
129523
|
-
if (result.
|
|
129563
|
+
if (result.repairedStarter)
|
|
129564
|
+
info(`Made React a required dependency for this starter. Run ${teal("npm install")} to refresh the lockfile before deploying.`);
|
|
129565
|
+
else if (result.next.includes("npm install"))
|
|
129524
129566
|
info(`Run ${teal("npm install")} to install ${result.to} in node_modules and update the lockfile.`);
|
|
129525
129567
|
info(`Agent skills were not changed; \`${cliInvocation()} skills status\` compares them with the latest pack.`);
|
|
129526
129568
|
});
|
|
@@ -129814,7 +129856,7 @@ Shared organization board (requires access): ${cliInvocation()} tasks list -p de
|
|
|
129814
129856
|
}
|
|
129815
129857
|
await runTaskTool("tasks_update", args, opts.json, printTaskMutation);
|
|
129816
129858
|
});
|
|
129817
|
-
tasks.command("delete <task-ids...>").description("Delete a task that should never have existed
|
|
129859
|
+
tasks.command("delete <task-ids...>").description("Delete a task that should never have existed (board owner only)").option("-p, --project <project>", "Project slug or ID; defaults to the linked project").requiredOption("--reason <text>", "Why this task should never have existed").option("--json", "Print the complete response as JSON").action(async (taskIds, opts) => {
|
|
129818
129860
|
if (taskIds.length > 200)
|
|
129819
129861
|
throw new Error("At most 200 task IDs may be deleted per call.");
|
|
129820
129862
|
await runTaskTool("tasks_delete", compactRecord([
|
|
@@ -129827,9 +129869,10 @@ Shared organization board (requires access): ${cliInvocation()} tasks list -p de
|
|
|
129827
129869
|
printJson(value);
|
|
129828
129870
|
return;
|
|
129829
129871
|
}
|
|
129830
|
-
const purgeAt = typeof data2.purge_at === "number" ? new Date(data2.purge_at).toISOString() : "in 30 days";
|
|
129831
129872
|
console.log(`${teal(data2.id)} ${data2.already_deleted ? "was already deleted" : "deleted"}`);
|
|
129832
|
-
|
|
129873
|
+
const restore = `\`${cliInvocation()} tasks restore ${data2.id}\``;
|
|
129874
|
+
const deadline = typeof data2.purge_at === "number" ? ` until ${new Date(data2.purge_at).toISOString()}` : "";
|
|
129875
|
+
console.log(dim(`Restore${deadline} with ${restore}.`));
|
|
129833
129876
|
});
|
|
129834
129877
|
});
|
|
129835
129878
|
tasks.command("restore <task-id>").description("Restore a deleted task with its comments and links (board owner only)").option("-p, --project <project>", "Project slug or ID; defaults to the linked project").option("--reason <text>", "Why it is being restored").option("--json", "Print the complete response as JSON").action(async (taskId, opts) => {
|
|
@@ -130112,7 +130155,7 @@ async function waitForChoices(client, repoName, quiet) {
|
|
|
130112
130155
|
}
|
|
130113
130156
|
await sleep2(2e3);
|
|
130114
130157
|
}
|
|
130115
|
-
throw new Error(`
|
|
130158
|
+
throw new Error(`The wait for GitHub authorization ended. Run \`${cliInvocation()} git connect\` again.`);
|
|
130116
130159
|
}
|
|
130117
130160
|
async function chooseRepo(client, requestedRepo, quiet) {
|
|
130118
130161
|
const app = await listInstallations(client);
|
|
@@ -130161,7 +130204,7 @@ async function waitForDeploy(client, projectId, commitSha) {
|
|
|
130161
130204
|
}
|
|
130162
130205
|
await sleep2(DEPLOY_POLL_MS);
|
|
130163
130206
|
}
|
|
130164
|
-
throw new Error(`
|
|
130207
|
+
throw new Error(`The wait ended before deploy of ${commitSha.slice(0, 7)} finished. Check the project logs.`);
|
|
130165
130208
|
}
|
|
130166
130209
|
function urls(projectId, servingUrl) {
|
|
130167
130210
|
return {
|
|
@@ -130783,7 +130826,7 @@ zone each trigger is stored in, and \`cron update --schedule\` keeps that zone u
|
|
|
130783
130826
|
printTypedCronError(code, message3, opts.json, extra);
|
|
130784
130827
|
}
|
|
130785
130828
|
});
|
|
130786
|
-
cron.command("runs <cron-id-or-name>").description("Show recent runs of a scheduled task, scheduled and manual, with its next run").option("-p, --project <project>", "Project slug or ID used to resolve a task name; defaults to the linked project").option("--limit <n>", "How many recent runs to show, 1-100 (default 20)").option("--wait-next", "Observe a natural scheduled occurrence after command start and wait for that job to finish").option("--timeout <seconds>", `With --wait-next, total observation time (default ${DEFAULT_WAIT_TIMEOUT_SECONDS}s)`).option("--json", "Print the trigger and its runs as JSON").addHelpText("after", '\nTRIGGER is "scheduled" for a run the schedule started (SCHEDULED FOR is the occurrence it\nserved) and "manual" for `cron run`. Times are UTC. A scheduled run is recorded shortly after\nits scheduled time, not exactly on it; until the schedule advances, the next run shows as\noverdue, and this command says whether a run for that occurrence appears in the recent\nhistory shown.\n\n--wait-next is read-only: it ignores manual runs and older scheduled slots, pins one job,\nand waits within --timeout. Changes to schedule settings or a disabled schedule stop the wait.\nThe observation uses at most --limit recent rows per read (default 100 while waiting).\nA timeout reports what was not observed; it does not mean the timer never fired.\
|
|
130829
|
+
cron.command("runs <cron-id-or-name>").description("Show recent runs of a scheduled task, scheduled and manual, with its next run").option("-p, --project <project>", "Project slug or ID used to resolve a task name; defaults to the linked project").option("--limit <n>", "How many recent runs to show, 1-100 (default 20)").option("--wait-next", "Observe a natural scheduled occurrence after command start and wait for that job to finish").option("--timeout <seconds>", `With --wait-next, total observation time (default ${DEFAULT_WAIT_TIMEOUT_SECONDS}s)`).option("--json", "Print the trigger and its runs as JSON").addHelpText("after", '\nTRIGGER is "scheduled" for a run the schedule started (SCHEDULED FOR is the occurrence it\nserved) and "manual" for `cron run`. Times are UTC. A scheduled run is recorded shortly after\nits scheduled time, not exactly on it; until the schedule advances, the next run shows as\noverdue, and this command says whether a run for that occurrence appears in the recent\nhistory shown.\n\n--wait-next is read-only: it ignores manual runs and older scheduled slots, pins one job,\nand waits within --timeout. Changes to schedule settings or a disabled schedule stop the wait.\nThe observation uses at most --limit recent rows per read (default 100 while waiting).\nA timeout reports what was not observed; it does not mean the timer never fired.\nIf a login renewal is already underway, it can finish after the observation deadline.\n').action(async (target, opts) => {
|
|
130787
130830
|
try {
|
|
130788
130831
|
const limit = parseRunsLimit(opts.limit);
|
|
130789
130832
|
if (opts.timeout !== void 0 && !opts.waitNext)
|
|
@@ -131502,7 +131545,7 @@ function registerTestUsers(program2) {
|
|
|
131502
131545
|
info(RETAINED_NOTE);
|
|
131503
131546
|
if (failure) {
|
|
131504
131547
|
fail2(opts, failure);
|
|
131505
|
-
warn(`Prepared ${manifest.actors.length} of ${specs.length} actors; the ones created are recorded in ${TEST_STATE_DIR}/${MANIFEST_FILE}. Run \`somewhere test-users cleanup\` to remove them.
|
|
131548
|
+
warn(`Prepared ${manifest.actors.length} of ${specs.length} actors; the ones created are recorded in ${TEST_STATE_DIR}/${MANIFEST_FILE}. Run \`somewhere test-users cleanup\` to remove them. The platform removes any remaining test users when they expire.`);
|
|
131506
131549
|
} else {
|
|
131507
131550
|
success(`Prepared ${manifest.actors.length} signed-in test user${manifest.actors.length === 1 ? "" : "s"} for ${target.origin}.`);
|
|
131508
131551
|
}
|
|
@@ -132684,7 +132727,7 @@ async function freshCodes(run, address, mark2, what) {
|
|
|
132684
132727
|
if (codes.length)
|
|
132685
132728
|
return codes;
|
|
132686
132729
|
if (Date.now() > deadline)
|
|
132687
|
-
throw new Error(`${what}: no code reached the project's test inbox for ${address}
|
|
132730
|
+
throw new Error(`${what}: no code reached the project's test inbox for ${address}. Check whether the app sent the message, then try again.`);
|
|
132688
132731
|
}
|
|
132689
132732
|
}
|
|
132690
132733
|
async function registerMailedCodes(run, address, submitted) {
|