@somewhere-cloud/cli 0.38.110 → 0.38.111
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 +6 -0
- package/dist/commands/ai.js +3 -2
- package/dist/commands/ai.js.map +1 -1
- package/dist/commands/api.js +2 -1
- package/dist/commands/api.js.map +1 -1
- package/dist/commands/auth.js +16 -15
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/browser.js +4 -3
- package/dist/commands/browser.js.map +1 -1
- package/dist/commands/call.js +6 -5
- package/dist/commands/call.js.map +1 -1
- package/dist/commands/catalog.js +2 -1
- package/dist/commands/catalog.js.map +1 -1
- package/dist/commands/check.js +10 -9
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/claim.js +5 -4
- package/dist/commands/claim.js.map +1 -1
- package/dist/commands/cron.js +10 -9
- package/dist/commands/cron.js.map +1 -1
- package/dist/commands/db.js +5 -4
- package/dist/commands/db.js.map +1 -1
- package/dist/commands/deploy.d.ts +1 -2
- package/dist/commands/deploy.js +134 -140
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/dev.js +38 -37
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/docs.js +28 -27
- package/dist/commands/docs.js.map +1 -1
- package/dist/commands/email.js +3 -2
- package/dist/commands/email.js.map +1 -1
- package/dist/commands/env.js +3 -2
- package/dist/commands/env.js.map +1 -1
- package/dist/commands/errors.js +2 -1
- package/dist/commands/errors.js.map +1 -1
- package/dist/commands/feedback.js +2 -1
- package/dist/commands/feedback.js.map +1 -1
- package/dist/commands/fs.js +2 -1
- package/dist/commands/fs.js.map +1 -1
- package/dist/commands/git.js +3 -2
- package/dist/commands/git.js.map +1 -1
- package/dist/commands/hooks.js +2 -1
- package/dist/commands/hooks.js.map +1 -1
- package/dist/commands/init.js +20 -19
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/mcp.js +15 -14
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/postgres.js +13 -12
- package/dist/commands/postgres.js.map +1 -1
- package/dist/commands/project.js +5 -4
- package/dist/commands/project.js.map +1 -1
- package/dist/commands/promote.js +10 -9
- package/dist/commands/promote.js.map +1 -1
- package/dist/commands/pull.js +5 -4
- package/dist/commands/pull.js.map +1 -1
- package/dist/commands/restore.js +5 -4
- package/dist/commands/restore.js.map +1 -1
- package/dist/commands/rollback.js +7 -3
- package/dist/commands/rollback.js.map +1 -1
- package/dist/commands/run.js +3 -2
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/skills.js +3 -2
- package/dist/commands/skills.js.map +1 -1
- package/dist/commands/support.js +2 -1
- package/dist/commands/support.js.map +1 -1
- package/dist/commands/tasks.js +4 -3
- package/dist/commands/tasks.js.map +1 -1
- package/dist/commands/typecheck.d.ts +1 -1
- package/dist/commands/typecheck.js +6 -5
- package/dist/commands/typecheck.js.map +1 -1
- package/dist/commands/update.js +3 -2
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/upgrade.js +4 -3
- package/dist/commands/upgrade.js.map +1 -1
- package/dist/commands/verify.js +13 -12
- package/dist/commands/verify.js.map +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/lib/advisor-runs.js +3 -2
- package/dist/lib/advisor-runs.js.map +1 -1
- package/dist/lib/agent-hooks.js +4 -3
- package/dist/lib/agent-hooks.js.map +1 -1
- package/dist/lib/browser-run.js +3 -2
- package/dist/lib/browser-run.js.map +1 -1
- package/dist/lib/claim-handoff.js +3 -2
- package/dist/lib/claim-handoff.js.map +1 -1
- package/dist/lib/cli-invocation.d.ts +2 -0
- package/dist/lib/cli-invocation.js +5 -0
- package/dist/lib/cli-invocation.js.map +1 -0
- package/dist/lib/client.js +6 -5
- package/dist/lib/client.js.map +1 -1
- package/dist/lib/config.js +4 -3
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/device-login.js +4 -3
- package/dist/lib/device-login.js.map +1 -1
- package/dist/lib/files.js +4 -3
- package/dist/lib/files.js.map +1 -1
- package/dist/lib/frontend-dev.js +3 -2
- package/dist/lib/frontend-dev.js.map +1 -1
- package/dist/lib/init-features.js +9 -8
- package/dist/lib/init-features.js.map +1 -1
- package/dist/lib/link-hint.js +3 -2
- package/dist/lib/link-hint.js.map +1 -1
- package/dist/lib/next-actions.js +9 -19
- package/dist/lib/next-actions.js.map +1 -1
- package/dist/lib/notify/index.d.ts +3 -0
- package/dist/lib/notify/index.js +9 -0
- package/dist/lib/notify/index.js.map +1 -1
- package/dist/lib/notify/providers/update.d.ts +1 -1
- package/dist/lib/notify/providers/update.js +4 -3
- package/dist/lib/notify/providers/update.js.map +1 -1
- package/dist/lib/operational-files.js +2 -1
- package/dist/lib/operational-files.js.map +1 -1
- package/dist/lib/output.js +2 -1
- package/dist/lib/output.js.map +1 -1
- package/dist/lib/post-live-render.d.ts +1 -1
- package/dist/lib/post-live-render.js +2 -1
- package/dist/lib/post-live-render.js.map +1 -1
- package/dist/lib/preview-jobs.js +3 -2
- package/dist/lib/preview-jobs.js.map +1 -1
- package/dist/lib/project-pin.js +2 -1
- package/dist/lib/project-pin.js.map +1 -1
- package/dist/lib/promote-handoff.js +2 -1
- package/dist/lib/promote-handoff.js.map +1 -1
- package/dist/lib/publish-surface.js +2 -1
- package/dist/lib/publish-surface.js.map +1 -1
- package/dist/lib/skills-pack.js +4 -3
- package/dist/lib/skills-pack.js.map +1 -1
- package/dist/lib/surface-counts.js +2 -24
- package/dist/lib/surface-counts.js.map +1 -1
- package/dist/lib/typecheck.js +3 -2
- package/dist/lib/typecheck.js.map +1 -1
- package/dist/lib/update-security.js +2 -1
- package/dist/lib/update-security.js.map +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/commands/deploy.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { roleMethodHints } from '../lib/role-method-hints.js';
|
|
2
|
-
import {
|
|
2
|
+
import { cliInvocation } from '../lib/cli-invocation.js';
|
|
3
|
+
import { suppressExitNotices } from '../lib/notify/index.js';
|
|
3
4
|
import { existsSync } from 'node:fs';
|
|
4
5
|
import { join } from 'node:path';
|
|
5
6
|
import { missingProjectDependencies, runTypecheck } from '../lib/typecheck.js';
|
|
@@ -26,7 +27,7 @@ import { showProjectNotices } from '../lib/project-notices.js';
|
|
|
26
27
|
import { prepareRunner } from '../lib/test-run.js';
|
|
27
28
|
import { formatDeployTestsLine, prepareDeployTests, runDeployTests } from '../lib/deploy-tests.js';
|
|
28
29
|
import { mark as timelineMark, markProcessStart } from '../lib/test-timeline.js';
|
|
29
|
-
import { formatNextActions, nextActions } from '../lib/next-actions.js';
|
|
30
|
+
import { formatNextActions, nextActions, shellQuote } from '../lib/next-actions.js';
|
|
30
31
|
import { countFromResponse, countFunctionRoutes, formatPublishSurface, formatUploadInventory, uploadInventory } from '../lib/surface-counts.js';
|
|
31
32
|
import { formatVerifyOutput, loadVerifyFlow, runVerification, } from './verify.js';
|
|
32
33
|
// Resolve the deploy target directory. `resolve` (not `join`) so an absolute
|
|
@@ -74,7 +75,7 @@ const NEXT_DEPENDENCY_SECTIONS = [
|
|
|
74
75
|
'optionalDependencies',
|
|
75
76
|
];
|
|
76
77
|
const NEXT_APP_WARNING = "Next.js apps do not run here. Somewhere supports HTML responses from ordinary server functions. " +
|
|
77
|
-
|
|
78
|
+
`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.`;
|
|
78
79
|
const DEPLOY_HEARTBEAT_MS = 30_000;
|
|
79
80
|
const DEPLOY_MAX_ATTEMPTS = 2;
|
|
80
81
|
// The CLI's OWN verdicts — transport failures it detected itself, where no
|
|
@@ -85,8 +86,8 @@ const RETRYABLE_DEPLOY_CODES = new Set(['TIMEOUT', 'SERVER_SLOW', 'NETWORK_ERROR
|
|
|
85
86
|
// one retry. A wait the platform asks for is worth honouring; an unbounded one
|
|
86
87
|
// is a hang, and `somewhere deploy` must stay a command that finishes.
|
|
87
88
|
const DEPLOY_RETRY_MAX_WAIT_MS = 10_000;
|
|
88
|
-
export const POST_DEPLOY_HINT =
|
|
89
|
-
|
|
89
|
+
export const POST_DEPLOY_HINT = `Next: keep building with \`${cliInvocation()} dev\`; run \`${cliInvocation()} deploy\` to update this live app. ` +
|
|
90
|
+
`Once it has real users or data, use \`${cliInvocation()} preview\` before changing what they see.`;
|
|
90
91
|
export function isNextAppShapeSignal(signal) {
|
|
91
92
|
return signal.startsWith(`${NEXT_APP_SIGNAL_PREFIX} (`);
|
|
92
93
|
}
|
|
@@ -168,23 +169,21 @@ export function formatTtlHours(ttlSeconds) {
|
|
|
168
169
|
return 3;
|
|
169
170
|
return Math.round(ttlSeconds / 3600) || 3;
|
|
170
171
|
}
|
|
171
|
-
export function formatRemainingTempTime(expiresAt, nowMs = Date.now()) {
|
|
172
|
-
const expiresMs = new Date(expiresAt).getTime();
|
|
173
|
-
if (!Number.isFinite(expiresMs))
|
|
174
|
-
return null;
|
|
175
|
-
const totalMinutes = Math.max(0, Math.ceil((expiresMs - nowMs) / 60_000));
|
|
176
|
-
const hours = Math.floor(totalMinutes / 60);
|
|
177
|
-
const minutes = totalMinutes % 60;
|
|
178
|
-
return hours > 0 ? `${hours}h ${minutes}m` : `${minutes}m`;
|
|
179
|
-
}
|
|
180
172
|
export function formatTempExpiry(expiresAt, ttlSeconds, nowMs = Date.now()) {
|
|
181
|
-
const
|
|
182
|
-
//
|
|
183
|
-
//
|
|
184
|
-
|
|
185
|
-
&& (
|
|
186
|
-
|
|
187
|
-
|
|
173
|
+
const remainingMs = expiresAt ? Date.parse(expiresAt) - nowMs : NaN;
|
|
174
|
+
// If this terminal's clock disagrees with the server, describe the lifetime
|
|
175
|
+
// from creation rather than making a promise about how much is left.
|
|
176
|
+
if (!Number.isFinite(remainingMs) || (ttlSeconds !== undefined && Number.isFinite(ttlSeconds)
|
|
177
|
+
&& (remainingMs > ttlSeconds * 1000 + 60_000 || remainingMs < -60_000))) {
|
|
178
|
+
return `Temporary app. Expires about ${plural(formatTtlHours(ttlSeconds), 'hour')} after it was created.`;
|
|
179
|
+
}
|
|
180
|
+
if (remainingMs <= 0)
|
|
181
|
+
return 'Temporary app. It has expired.';
|
|
182
|
+
const minutes = Math.ceil(remainingMs / 60_000);
|
|
183
|
+
const remaining = minutes >= 60
|
|
184
|
+
? plural(Math.round(minutes / 60), 'hour')
|
|
185
|
+
: plural(minutes < 5 ? minutes : Math.min(55, Math.round(minutes / 5) * 5), 'minute');
|
|
186
|
+
return `Temporary app. Expires in about ${remaining}.`;
|
|
188
187
|
}
|
|
189
188
|
function plural(count, singular, pluralWord = `${singular}s`) {
|
|
190
189
|
return `${count} ${count === 1 ? singular : pluralWord}`;
|
|
@@ -261,8 +260,8 @@ export function formatStaleBaseExplanation(details, nowMs = Date.now()) {
|
|
|
261
260
|
versionSummary,
|
|
262
261
|
'',
|
|
263
262
|
'Next steps:',
|
|
264
|
-
|
|
265
|
-
|
|
263
|
+
` Run \`${cliInvocation()} pull\` to bring the latest deployed source into this directory, review it, then deploy again.`,
|
|
264
|
+
` Run \`${cliInvocation()} deploy --force\` to overwrite those remote changes intentionally.`,
|
|
266
265
|
].filter((line) => line !== null).join('\n');
|
|
267
266
|
}
|
|
268
267
|
// The release-native staleness guard: another production update landed after
|
|
@@ -323,8 +322,8 @@ export function formatStaleReleaseBaseExplanation(details = {}, historyUnavailab
|
|
|
323
322
|
: d.history_unavailable ? 'The earlier version is no longer available to compare, so the differing files cannot be listed.' : null,
|
|
324
323
|
'',
|
|
325
324
|
own
|
|
326
|
-
? `Next step: run
|
|
327
|
-
:
|
|
325
|
+
? `Next step: run \`${cliInvocation()} pull\` to bring this folder to live (local-only files are kept), or \`${cliInvocation()} restore ${d.base_version ?? '<version>'}\` to make ${folder} live again.`
|
|
326
|
+
: `Next step: run \`${cliInvocation()} pull\`. It brings the published files up to live, keeps local-only files and your local edits, and stops on a file changed both here and live. Then deploy again.`,
|
|
328
327
|
].filter((line) => line !== null).join('\n');
|
|
329
328
|
}
|
|
330
329
|
/**
|
|
@@ -340,8 +339,8 @@ export function formatAmbiguousRetryStaleExplanation(transportFailure) {
|
|
|
340
339
|
`The first deploy attempt ${what} before the platform answered, so it may already have gone live. The automatic retry was refused because the live release is now newer than the version this folder came from; that refusal changed nothing.`,
|
|
341
340
|
'',
|
|
342
341
|
'Next steps:',
|
|
343
|
-
|
|
344
|
-
|
|
342
|
+
` Check the live release before deploying again: run \`${cliInvocation()} pull\` into a separate folder (or open the dashboard) and compare it with your changes.`,
|
|
343
|
+
` If your changes are live, you are done. If they are not, deploy again from the pulled source, or run \`${cliInvocation()} deploy --force\` to replace the live release intentionally.`,
|
|
345
344
|
].join('\n');
|
|
346
345
|
}
|
|
347
346
|
/** Signed in, nothing linked: deploy never creates or links a project in the
|
|
@@ -351,8 +350,8 @@ export function formatSignedInUnlinkedExplanation() {
|
|
|
351
350
|
'No project is linked to this folder. You are signed in, so deploy will not create or pick a project in your account on its own.',
|
|
352
351
|
'',
|
|
353
352
|
'Next steps:',
|
|
354
|
-
|
|
355
|
-
|
|
353
|
+
` New project: run \`${cliInvocation()} init --bare --name <name>\` (creates it in your account and links this folder; adds .somewhere.json, AGENTS.md/CLAUDE.md and agent skills, no app source), then \`${cliInvocation()} deploy\`.`,
|
|
354
|
+
` Existing project: run \`${cliInvocation()} init --link --project <name-or-id>\` (list yours with \`${cliInvocation()} projects\`), or deploy once with \`${cliInvocation()} deploy --project <name-or-id>\`.`,
|
|
356
355
|
].join('\n');
|
|
357
356
|
}
|
|
358
357
|
/** The folder's link names a project this sign-in cannot open (
|
|
@@ -363,14 +362,14 @@ export function formatSignedInUnlinkedExplanation() {
|
|
|
363
362
|
export function linkedProjectNotFoundSteps(signedIn) {
|
|
364
363
|
return signedIn
|
|
365
364
|
? [
|
|
366
|
-
|
|
367
|
-
|
|
365
|
+
`See your projects: \`${cliInvocation()} projects\`.`,
|
|
366
|
+
`Deploy this folder to one of them: \`${cliInvocation()} init --link --project <name-or-id>\`, then \`${cliInvocation()} deploy\`.`,
|
|
368
367
|
// init refuses a linked folder without a terminal, so the stale link goes first.
|
|
369
|
-
|
|
368
|
+
`Or create a new project for it: delete this folder\'s .somewhere.json (your other files are kept), run \`${cliInvocation()} init --bare --name <name>\`, then \`${cliInvocation()} deploy\`.`,
|
|
370
369
|
]
|
|
371
370
|
: [
|
|
372
|
-
|
|
373
|
-
|
|
371
|
+
`If the project is in your account, sign in with \`${cliInvocation()} login\` and deploy again.`,
|
|
372
|
+
`Start a new temporary project: delete this folder\'s .somewhere.json, then run \`${cliInvocation()} deploy\` again.`,
|
|
374
373
|
];
|
|
375
374
|
}
|
|
376
375
|
export function formatLinkedProjectNotFoundExplanation(linkedProjectId, signedIn) {
|
|
@@ -388,12 +387,12 @@ export function formatSignedOutExistingTargetExplanation(projectId, fromLink) {
|
|
|
388
387
|
'',
|
|
389
388
|
'Next steps:',
|
|
390
389
|
...(fromLink
|
|
391
|
-
? [
|
|
390
|
+
? [` If you deployed this folder signed out earlier, its temporary credential is in ~/.somewhere/config.json of the terminal you used then: run \`${cliInvocation()} deploy\` there. An agent\'s sandboxed shell or another user account does not see it.`]
|
|
392
391
|
: []),
|
|
393
|
-
|
|
392
|
+
` If the project is in your account, run \`${cliInvocation()} login\` (it prints a code; approve it in any browser), then deploy again. Without a person to approve: \`printf %s "$SOMEWHERE_TOKEN" | ${cliInvocation()} auth set\` saves an smt_ key; the SOMEWHERE_TOKEN variable on its own does not sign commands in.`,
|
|
394
393
|
fromLink
|
|
395
|
-
?
|
|
396
|
-
:
|
|
394
|
+
? ` Start a new temporary project instead: delete this folder\'s .somewhere.json, then run \`${cliInvocation()} deploy\` again.`
|
|
395
|
+
: ` Start a new temporary project instead: run \`${cliInvocation()} deploy\` without --project in a folder that is not linked.`,
|
|
397
396
|
].join('\n');
|
|
398
397
|
}
|
|
399
398
|
/** The stored temporary session expired before this deploy (
|
|
@@ -404,9 +403,9 @@ export function formatExpiredTemporaryProjectExplanation(expiredAt) {
|
|
|
404
403
|
`The temporary workspace on this machine expired at ${expiredAt}, and this machine has no record of a claim. Its projects can no longer be deployed to, and a new temporary workspace cannot deploy to this folder's linked project. Nothing was deployed.`,
|
|
405
404
|
'',
|
|
406
405
|
'Next steps:',
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
406
|
+
` If you claimed this workspace in the browser, sign in with \`${cliInvocation()} login\` and deploy again; your projects are in your account.`,
|
|
407
|
+
` Start a new temporary project: delete this folder\'s .somewhere.json, then run \`${cliInvocation()} deploy\` again.`,
|
|
408
|
+
` Keep your work in an account: sign in (\`${cliInvocation()} login\`, or \`${cliInvocation()} signup\`), then run \`${cliInvocation()} init --bare --name <name>\` and \`${cliInvocation()} deploy\`.`,
|
|
410
409
|
].join('\n');
|
|
411
410
|
}
|
|
412
411
|
// No record of which published version this folder's source came from (a
|
|
@@ -422,8 +421,8 @@ export function formatBaseRequiredExplanation() {
|
|
|
422
421
|
'This folder has no record of which published version its files came from, so the deploy was NOT applied.',
|
|
423
422
|
'',
|
|
424
423
|
'Next steps:',
|
|
425
|
-
|
|
426
|
-
|
|
424
|
+
` Run \`${cliInvocation()} pull\` to start from the current version, re-apply your changes, then deploy again.`,
|
|
425
|
+
` Run \`${cliInvocation()} deploy --force\` to replace the current version with this folder intentionally.`,
|
|
427
426
|
].join('\n');
|
|
428
427
|
}
|
|
429
428
|
/** `--project <ref>` named a project that is not the one this folder is linked
|
|
@@ -434,9 +433,9 @@ export function formatLinkedProjectMismatchExplanation(linkedProjectId, ref, res
|
|
|
434
433
|
`This folder is linked to project ${linkedProjectId} (in .somewhere.json), but --project ${ref} names a different project (${resolvedProjectId}). Your deploy was NOT applied.`,
|
|
435
434
|
'',
|
|
436
435
|
'Next steps:',
|
|
437
|
-
|
|
438
|
-
` Move this folder to ${ref} deliberately: delete this folder's .somewhere.json, then run
|
|
439
|
-
` Deploy a copy elsewhere: copy the files into an unlinked folder and run
|
|
436
|
+
` Deploy this folder to its linked project: run \`${cliInvocation()} deploy\` (no --project).`,
|
|
437
|
+
` Move this folder to ${ref} deliberately: delete this folder's .somewhere.json, then run \`${cliInvocation()} init --link --project ${ref}\`, \`${cliInvocation()} pull\`, re-apply your changes, and \`${cliInvocation()} deploy\`.`,
|
|
438
|
+
` Deploy a copy elsewhere: copy the files into an unlinked folder and run \`${cliInvocation()} deploy --project ${ref}\` there.`,
|
|
440
439
|
].join('\n');
|
|
441
440
|
}
|
|
442
441
|
/** BASE_REQUIRED for an explicit --project target whose live release could not
|
|
@@ -447,8 +446,8 @@ export function formatExplicitProjectBaseRequiredExplanation(ref) {
|
|
|
447
446
|
`The live version of project ${ref} could not be read before deploying, and this folder has no record of which published version its files came from, so the deploy was NOT applied.`,
|
|
448
447
|
'',
|
|
449
448
|
'Next steps:',
|
|
450
|
-
` Link and pull first:
|
|
451
|
-
` Or replace the live release deliberately:
|
|
449
|
+
` Link and pull first: \`${cliInvocation()} init --link --project ${ref}\`, then \`${cliInvocation()} pull\`, re-apply your changes, then \`${cliInvocation()} deploy\`.`,
|
|
450
|
+
` Or replace the live release deliberately: \`${cliInvocation()} deploy --project ${ref} --force --yes\`.`,
|
|
452
451
|
].join('\n');
|
|
453
452
|
}
|
|
454
453
|
/** Bound on the prestart request; it answers at once, so this only caps a stalled connection. */
|
|
@@ -552,14 +551,14 @@ export function registerDeploy(program) {
|
|
|
552
551
|
program
|
|
553
552
|
.command('deploy [dir]')
|
|
554
553
|
.description('Deploy the current directory (anonymous automatically when logged out)')
|
|
555
|
-
.addHelpText('after',
|
|
554
|
+
.addHelpText('after', `\nFunctions missing from the directory: a full \`${cliInvocation()} deploy\` REMOVES deployed functions that\n`
|
|
556
555
|
+ 'are not in this directory (each one is named in the output). `--scope functions` keeps them unless\n'
|
|
557
|
-
+
|
|
556
|
+
+ `--replace-functions. \`${cliInvocation()} promote\` is the opposite: it keeps them unless --prune.\n`
|
|
558
557
|
+ '\nNo project yet? Signed in, deploy never creates one on its own:\n'
|
|
559
|
-
+
|
|
560
|
-
+
|
|
561
|
-
+
|
|
562
|
-
.option('--project <ref>',
|
|
558
|
+
+ ` ${cliInvocation()} init --bare --name <name> create a project in your account and link this folder\n`
|
|
559
|
+
+ ` ${cliInvocation()} deploy then deploy it\n`
|
|
560
|
+
+ `Existing project: \`${cliInvocation()} init --link --project <ref>\` (see \`${cliInvocation()} projects\`), or \`--project <ref>\` here.\n`)
|
|
561
|
+
.option('--project <ref>', `Existing project to deploy to — accepts the project UUID, slug, or subdomain (all three resolve server-side). To create one, run \`${cliInvocation()} init --bare --name <name>\``)
|
|
563
562
|
.option('--scope <scope>', "Partial deploy: 'functions' (backend only, leaves the site untouched) or 'static' (site only, leaves functions untouched). Default deploys both.")
|
|
564
563
|
.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.')
|
|
565
564
|
.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.')
|
|
@@ -582,7 +581,7 @@ export function registerDeploy(program) {
|
|
|
582
581
|
.option('--json', 'Print the raw deploy response as JSON on stdout; files left out locally are listed on stderr by path and reason')
|
|
583
582
|
.option('--list-unpublished', 'List the local files this deploy keeps on your machine, and how to publish one on purpose')
|
|
584
583
|
.option('--allow-type-errors', 'Upload even when the local TypeScript check fails')
|
|
585
|
-
.option('--timing', 'Print
|
|
584
|
+
.option('--timing', 'Print deploy details and timings')
|
|
586
585
|
.action(async (dir, opts) => {
|
|
587
586
|
// performance.now() counts from process start, so this is the real
|
|
588
587
|
// start-up cost (runtime boot + module load) before the command ran.
|
|
@@ -644,7 +643,7 @@ export function registerDeploy(program) {
|
|
|
644
643
|
&& Object.keys(binaryFiles).length === 0
|
|
645
644
|
&& Object.keys(functions).length === 0) {
|
|
646
645
|
const message = 'No deployable source found. Create an index.html or add raw app source files, ' +
|
|
647
|
-
|
|
646
|
+
`or add serverless handlers under functions/, then run \`${cliInvocation()} deploy\` again.`;
|
|
648
647
|
if (opts.json)
|
|
649
648
|
printJsonError('NO_DEPLOYABLE_SOURCE', message);
|
|
650
649
|
else
|
|
@@ -1001,7 +1000,7 @@ export function registerDeploy(program) {
|
|
|
1001
1000
|
if (opts.force && !opts.yes) {
|
|
1002
1001
|
await settleNotices();
|
|
1003
1002
|
if (!process.stdin.isTTY) {
|
|
1004
|
-
const message =
|
|
1003
|
+
const message = `Refusing to force deploy without confirmation in a non-interactive shell. Run \`${cliInvocation()} deploy --force --yes\` to overwrite remote changes intentionally.`;
|
|
1005
1004
|
if (opts.json) {
|
|
1006
1005
|
printJsonError('CONFIRMATION_REQUIRED', message);
|
|
1007
1006
|
}
|
|
@@ -1031,7 +1030,7 @@ export function registerDeploy(program) {
|
|
|
1031
1030
|
// folder it was built in. Name every held-back file — a silent exclusion
|
|
1032
1031
|
// is how a private note gets published, and how a needed file goes
|
|
1033
1032
|
// missing without anyone noticing.
|
|
1034
|
-
if (excluded.length && !opts.json) {
|
|
1033
|
+
if (excluded.length && !opts.json && (!tempSession || tempSession.reused || opts.listUnpublished || opts.timing)) {
|
|
1035
1034
|
spinner?.stop();
|
|
1036
1035
|
// A dry run leaves .somewhere.json as it found it.
|
|
1037
1036
|
printExcludedFiles(excluded, targetDir, { list: Boolean(opts.listUnpublished) });
|
|
@@ -1079,7 +1078,7 @@ export function registerDeploy(program) {
|
|
|
1079
1078
|
warn('server source will be publicly readable at its file path.');
|
|
1080
1079
|
warn('The platform shape: static files at the root + API handlers under functions/');
|
|
1081
1080
|
warn('(each default-exports async (req, sw) and becomes a route).');
|
|
1082
|
-
warn(
|
|
1081
|
+
warn(`Full quickstart: ${cliInvocation()} docs start`);
|
|
1083
1082
|
}
|
|
1084
1083
|
if (process.stderr.isTTY)
|
|
1085
1084
|
spinner?.start();
|
|
@@ -1218,7 +1217,7 @@ export function registerDeploy(program) {
|
|
|
1218
1217
|
if (!opts.allowTypeErrors) {
|
|
1219
1218
|
stopPrestart();
|
|
1220
1219
|
spinner?.stop();
|
|
1221
|
-
error(
|
|
1220
|
+
error(`Deploy stopped before upload. To proceed anyway: ${cliInvocation()} deploy --allow-type-errors`);
|
|
1222
1221
|
process.exitCode = 1;
|
|
1223
1222
|
return;
|
|
1224
1223
|
}
|
|
@@ -1284,7 +1283,7 @@ export function registerDeploy(program) {
|
|
|
1284
1283
|
// one that deployed it (never a throwaway beside a real login: the
|
|
1285
1284
|
// folder's .somewhere.json is the developer's own link).
|
|
1286
1285
|
if (!besideRealLogin && recordPinIfMissing(deployStateEntry?.dir ?? targetDir, CLI_VERSION) && !opts.json) {
|
|
1287
|
-
info(`Recorded somewhere CLI ${CLI_VERSION} in .somewhere.json (cli_version).
|
|
1286
|
+
info(`Recorded somewhere CLI ${CLI_VERSION} in .somewhere.json (cli_version). \`${cliInvocation()} upgrade\` moves it.`);
|
|
1288
1287
|
}
|
|
1289
1288
|
if (!tempSession && deployStateEntry && result.project_id === deployStateEntry.config.project_id) {
|
|
1290
1289
|
saveProjectAppUrl(deployStateEntry.dir, deployStateEntry.config.project_id, httpsOrigin(result.url));
|
|
@@ -1332,10 +1331,10 @@ export function registerDeploy(program) {
|
|
|
1332
1331
|
};
|
|
1333
1332
|
const verificationNextSteps = besideRealLogin ? [
|
|
1334
1333
|
'Inspect the live URL; keep this project and its claim URL.',
|
|
1335
|
-
|
|
1334
|
+
`After claiming and connecting this project, run: ${cliInvocation()} verify --project <PROJECT>`,
|
|
1336
1335
|
] : [
|
|
1337
|
-
|
|
1338
|
-
|
|
1336
|
+
`Read the live release: ${cliInvocation()} status --project <PROJECT>`,
|
|
1337
|
+
`Run verification without deploying: ${cliInvocation()} verify --project <PROJECT>`,
|
|
1339
1338
|
];
|
|
1340
1339
|
if (opts.json) {
|
|
1341
1340
|
// A temporary session adds the claim fields to the server's result;
|
|
@@ -1374,10 +1373,14 @@ export function registerDeploy(program) {
|
|
|
1374
1373
|
// static-only deploy or counts static files on a backend-only deploy
|
|
1375
1374
|
// (audit #3: the old output printed "Functions deployed" + a static
|
|
1376
1375
|
// count + "the other layer was left untouched" all at once).
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
if (
|
|
1380
|
-
|
|
1376
|
+
const firstTemporaryRelease = Boolean(tempSession && result.version === 1);
|
|
1377
|
+
const cwdDeploysToProject = loadProjectConfig()?.project_id === (result.project_id ?? projectId);
|
|
1378
|
+
if (!firstTemporaryRelease || opts.timing) {
|
|
1379
|
+
success(formatted.headline);
|
|
1380
|
+
info(dim(formatUploadInventory(inventory)));
|
|
1381
|
+
if (formatted.projectRef)
|
|
1382
|
+
info(`Project: ${teal(formatted.projectRef)}`);
|
|
1383
|
+
}
|
|
1381
1384
|
// Build log: entry chunk, chunks + sizes, functions + sizes (returned
|
|
1382
1385
|
// by the worker since ). Surface it instead of a bare
|
|
1383
1386
|
// "deployed." so the dev can see what the compiler actually produced.
|
|
@@ -1396,7 +1399,7 @@ export function registerDeploy(program) {
|
|
|
1396
1399
|
// directory — named, so a rename never leaves a silent leftover.
|
|
1397
1400
|
if (result.removed_functions && result.removed_functions.length > 0) {
|
|
1398
1401
|
warn(`Removed ${result.removed_functions.length} function(s) no longer in this directory: ${result.removed_functions.join(', ')}. `
|
|
1399
|
-
+
|
|
1402
|
+
+ `A full deploy publishes exactly this directory (unlike \`${cliInvocation()} promote\`, which keeps them unless --prune).`);
|
|
1400
1403
|
}
|
|
1401
1404
|
// Warnings + function errors must be loud — never let a "success"
|
|
1402
1405
|
// line hide a partial failure (fail-loudly principle).
|
|
@@ -1410,14 +1413,27 @@ export function registerDeploy(program) {
|
|
|
1410
1413
|
if (result.warnings && result.warnings.length > 0) {
|
|
1411
1414
|
const buildWarnings = warningsInBuildLog(result.build_log);
|
|
1412
1415
|
for (const w of result.warnings) {
|
|
1416
|
+
// The first release normally creates tables and indexes. Keep the
|
|
1417
|
+
// receipt in --json and --timing, and still print actual warnings.
|
|
1418
|
+
const schemaCreated = /^Database schema: (?:table |index on ).+ is created(?:[ .(]|$)/.test(w);
|
|
1419
|
+
if (firstTemporaryRelease && !opts.timing && schemaCreated)
|
|
1420
|
+
continue;
|
|
1413
1421
|
if (!buildWarnings.has(normalizeWarning(w)))
|
|
1414
1422
|
warn(w);
|
|
1415
1423
|
}
|
|
1416
1424
|
}
|
|
1417
|
-
if (result.previous)
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
console.log(result.
|
|
1425
|
+
if (result.previous) {
|
|
1426
|
+
const target = cwdDeploysToProject ? '' : ` --project ${shellQuote(result.project_id ?? projectId ?? '<project>')}`;
|
|
1427
|
+
const confirmation = process.stdin.isTTY ? '' : ' --yes';
|
|
1428
|
+
console.log(result.previous.rollback_available
|
|
1429
|
+
? `Version ${result.previous.version} is kept; ${cliInvocation()} rollback${target}${confirmation} returns to it.`
|
|
1430
|
+
: result.previous.message);
|
|
1431
|
+
}
|
|
1432
|
+
if (Array.isArray(result.privacy_lines) && (!firstTemporaryRelease || opts.timing)) {
|
|
1433
|
+
const lines = result.privacy_lines.filter(line => typeof line === 'string' && (opts.timing || !/^warning:/i.test(line)));
|
|
1434
|
+
if (lines.length)
|
|
1435
|
+
console.log(lines.join('\n'));
|
|
1436
|
+
}
|
|
1421
1437
|
if (result.runtime_fixes && result.runtime_fixes.length > 0) {
|
|
1422
1438
|
for (const fix of result.runtime_fixes)
|
|
1423
1439
|
success(fix.message);
|
|
@@ -1427,58 +1443,19 @@ export function registerDeploy(program) {
|
|
|
1427
1443
|
const unpromotable = Array.isArray(listed) ? listed.filter((id) => typeof id === 'string') : [];
|
|
1428
1444
|
if (unpromotable.length > 0) {
|
|
1429
1445
|
warn(`${unpromotable.length} open preview${unpromotable.length === 1 ? ' was' : 's were'} opened from the previous production version and can no longer be promoted: ${unpromotable.join(', ')}.`);
|
|
1430
|
-
info(
|
|
1446
|
+
info(`To ship a change from one: run \`${cliInvocation()} preview\` here (it opens a fresh preview from this release), and close the old ones with \`${cliInvocation()} preview close <preview_session_id>\` (\`${cliInvocation()} preview list\` shows them).`);
|
|
1431
1447
|
}
|
|
1432
|
-
if (tempSession) {
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
success(`Live URL: ${teal(formatted.liveUrl)}`);
|
|
1448
|
+
if (tempSession && !firstTemporaryRelease && !hasFunctionErrors && !verificationFailed) {
|
|
1449
|
+
if (!besideRealLogin) {
|
|
1450
|
+
const hint = formatReferenceCheckHint(result, cwdDeploysToProject);
|
|
1451
|
+
if (hint)
|
|
1452
|
+
info(hint);
|
|
1438
1453
|
}
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
}
|
|
1442
|
-
if (renderLine)
|
|
1443
|
-
warn(renderLine);
|
|
1444
|
-
info(`Claim URL: ${teal(tempSession.claimUrl)}`);
|
|
1445
|
-
if (tempSession.expiresAt) {
|
|
1446
|
-
info(formatTempExpiry(tempSession.expiresAt, tempSession.ttlSeconds));
|
|
1447
|
-
}
|
|
1448
|
-
else {
|
|
1449
|
-
const hours = formatTtlHours(tempSession.ttlSeconds);
|
|
1450
|
-
info(`Expires: about ${hours} hour${hours === 1 ? '' : 's'} after the temporary session was created`);
|
|
1451
|
-
}
|
|
1452
|
-
// Same discoverability the account path gets — this is a main
|
|
1453
|
-
// fresh-agent route, not a side door. Addressed by URL on purpose:
|
|
1454
|
-
// beside a real login the throwaway project is deliberately NOT in
|
|
1455
|
-
// `.somewhere.json`, so a bare `somewhere browser` would open the
|
|
1456
|
-
// developer's own app. Temporary credentials carry the `browser`
|
|
1457
|
-
// scope, so the URL form works on both temporary paths.
|
|
1458
|
-
if (!hasFunctionErrors && !verificationFailed) {
|
|
1459
|
-
for (const line of formatNextActions(nextActions({
|
|
1460
|
-
stage: 'deploy',
|
|
1461
|
-
projectLinked: false,
|
|
1462
|
-
liveUrl: formatted.liveUrl ?? null,
|
|
1463
|
-
temporary: true,
|
|
1464
|
-
}), { command: teal, why: dim })) {
|
|
1465
|
-
console.log(line);
|
|
1466
|
-
}
|
|
1454
|
+
for (const line of formatNextActions(nextActions({ stage: 'deploy', projectLinked: false, liveUrl: formatted.liveUrl, temporary: true }), { command: teal, why: dim })) {
|
|
1455
|
+
console.log(line);
|
|
1467
1456
|
}
|
|
1468
|
-
info(besideRealLogin
|
|
1469
|
-
? 'Next: open the claim URL above. Tests that need the email inbox work after you claim the app.'
|
|
1470
|
-
: 'Next: run `somewhere claim` and open its link. Tests that need the email inbox work after you claim the app.');
|
|
1471
|
-
// Beside a real login the CLI's own credentials cannot read the throwaway project.
|
|
1472
|
-
const tempCheckHint = besideRealLogin ? null : formatReferenceCheckHint(result, loadProjectConfig()?.project_id === projectId);
|
|
1473
|
-
if (tempCheckHint)
|
|
1474
|
-
info(tempCheckHint);
|
|
1475
|
-
info(besideRealLogin
|
|
1476
|
-
? `Your permanent login is untouched. After claiming, keep this project and run ${teal(`somewhere init --link --project ${projectId}`)} only if this directory has no link. Do not unlink, create a replacement, or redeploy to recover it.`
|
|
1477
|
-
: tempSession.handoffReady
|
|
1478
|
-
? 'Tell the owner to choose "Save project and connect agent" on the claim page. This CLI then signs in on its next command, to this project only unless they choose all projects. If they save without connecting, they can connect it later from the same link, or run `somewhere login` here.'
|
|
1479
|
-
: `After claiming, run ${teal('somewhere login')} in this directory, then deploy as usual. Keep the existing project link, so deploys keep going to the claimed project.`);
|
|
1480
1457
|
}
|
|
1481
|
-
|
|
1458
|
+
if (!tempSession) {
|
|
1482
1459
|
if (formatted.liveUrl) {
|
|
1483
1460
|
success(`Live at ${teal(formatted.liveUrl)}`);
|
|
1484
1461
|
}
|
|
@@ -1526,19 +1503,40 @@ export function registerDeploy(program) {
|
|
|
1526
1503
|
else
|
|
1527
1504
|
error(formatDeployTestsLine(tests));
|
|
1528
1505
|
}
|
|
1529
|
-
// Exit non-zero if any function failed to deploy — a CI step that
|
|
1530
|
-
// shells out to `somewhere deploy` should fail, not pass green.
|
|
1531
|
-
if (hasFunctionErrors) {
|
|
1532
|
-
process.exit(1);
|
|
1533
|
-
}
|
|
1534
1506
|
if (verificationFailed) {
|
|
1535
1507
|
warn(verificationError
|
|
1536
1508
|
? `The deploy is live, but verification could not finish: ${verificationError.message} [${verificationError.code}]`
|
|
1537
1509
|
: 'The deploy is live, but verification did not pass.');
|
|
1538
1510
|
for (const step of verificationNextSteps)
|
|
1539
1511
|
info(step);
|
|
1512
|
+
}
|
|
1513
|
+
if (tempSession) {
|
|
1514
|
+
suppressExitNotices();
|
|
1515
|
+
if (renderLine)
|
|
1516
|
+
warn(renderLine);
|
|
1517
|
+
if (formatted.liveUrl)
|
|
1518
|
+
success(`Live URL: ${teal(formatted.liveUrl)}`);
|
|
1519
|
+
else
|
|
1520
|
+
info(`Live URL not reported by the platform; \`${cliInvocation()} project view ${formatted.projectRef ?? '<project>'}\` shows it.`);
|
|
1521
|
+
info(formatTempExpiry(tempSession.expiresAt, tempSession.ttlSeconds));
|
|
1522
|
+
const link = teal(tempSession.claimUrl);
|
|
1523
|
+
if (tempSession.handoffReady) {
|
|
1524
|
+
info(`Open ${link} and select "Save project and connect agent" to save the project to your account and connect this terminal automatically.`);
|
|
1525
|
+
}
|
|
1526
|
+
else if (besideRealLogin) {
|
|
1527
|
+
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.`);
|
|
1528
|
+
}
|
|
1529
|
+
else {
|
|
1530
|
+
info(`Open ${link} to save the project to your account, then run \`${cliInvocation()} login\` to connect this terminal.`);
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
// Exit non-zero if any function failed to deploy — a CI step that
|
|
1534
|
+
// shells out to `somewhere deploy` should fail, not pass green.
|
|
1535
|
+
if (hasFunctionErrors) {
|
|
1540
1536
|
process.exit(1);
|
|
1541
1537
|
}
|
|
1538
|
+
if (verificationFailed)
|
|
1539
|
+
process.exit(1);
|
|
1542
1540
|
if (tests && tests.status !== 'passed')
|
|
1543
1541
|
process.exit(1);
|
|
1544
1542
|
}
|
|
@@ -1613,7 +1611,7 @@ export function registerDeploy(program) {
|
|
|
1613
1611
|
if (liveUrl)
|
|
1614
1612
|
info(`Live at ${teal(liveUrl)}`);
|
|
1615
1613
|
if (projectId)
|
|
1616
|
-
info(`This folder now starts from ${version !== null ? `v${version}` : 'this version'}, so the next
|
|
1614
|
+
info(`This folder now starts from ${version !== null ? `v${version}` : 'this version'}, so the next \`${cliInvocation()} deploy\` here replaces it without --force.`);
|
|
1617
1615
|
const reference = formatErrorReference(err.meta);
|
|
1618
1616
|
if (reference)
|
|
1619
1617
|
info(dim(reference));
|
|
@@ -1691,7 +1689,7 @@ export function formatReferenceCheckHint(result, linkedHere) {
|
|
|
1691
1689
|
const args = linkedHere
|
|
1692
1690
|
? { version: result.version }
|
|
1693
1691
|
: { project_id: result.project_id, version: result.version };
|
|
1694
|
-
return `A reference check is running in the background; read its result with:
|
|
1692
|
+
return `A reference check is running in the background; read its result with: ${cliInvocation()} call project_deploy_log '${JSON.stringify(args)}'`;
|
|
1695
1693
|
}
|
|
1696
1694
|
export function formatDeployTiming(input) {
|
|
1697
1695
|
const stage = input.stageTimingMs ?? {};
|
|
@@ -1792,7 +1790,7 @@ export function formatDeploySuccess(result, options) {
|
|
|
1792
1790
|
// Only an older platform omits the URL; name the command that shows it.
|
|
1793
1791
|
liveMessage: liveUrl
|
|
1794
1792
|
? `Live at ${liveUrl}`
|
|
1795
|
-
: `Deployed. The platform did not report the live URL;
|
|
1793
|
+
: `Deployed. The platform did not report the live URL; \`${cliInvocation()} project view ${typeof result.project_id === 'string' && result.project_id.trim() ? result.project_id.trim() : '<project>'}\` shows it.`,
|
|
1796
1794
|
};
|
|
1797
1795
|
}
|
|
1798
1796
|
function normalizeWarning(value) {
|
|
@@ -1884,7 +1882,7 @@ export function formatUnknownDeployOutcomeExplanation(err, projectId, startedAt)
|
|
|
1884
1882
|
`The deploy request ${what} after it may have reached the platform. Its outcome is unknown: it may have gone live, may have been refused, or may still be running. It was not sent again, and this CLI cannot confirm what happened to it.`,
|
|
1885
1883
|
'',
|
|
1886
1884
|
'What you can do:',
|
|
1887
|
-
` Look, for investigation only:
|
|
1885
|
+
` Look, for investigation only: ${cliInvocation()} call project_deploys '${JSON.stringify({ project_id: projectId })}' lists the project's recent deploys. No entry there is tied to this request, and deploys by anyone else can appear in it, so a later entry does not show what happened to this one.`,
|
|
1888
1886
|
` Ask for help with this reference so the platform can find this exact request: project ${projectId}, sent at ${startedAt} (this machine's clock)${ids.length ? `, ${ids.join(', ')}` : ''}.`,
|
|
1889
1887
|
' Deploying again is your call; nothing here says this request has finished, and a deploy sent while it may still be running can race it.',
|
|
1890
1888
|
].join('\n');
|
|
@@ -1978,20 +1976,16 @@ function formatDeployElapsed(ms) {
|
|
|
1978
1976
|
const INTERNAL_PREFIXES = ['_compiled/', '_internal/', '_source/'];
|
|
1979
1977
|
const isInternalPath = (p) => INTERNAL_PREFIXES.some((prefix) => p.startsWith(prefix));
|
|
1980
1978
|
// ── Publish-surface notice ────────────────────────────────
|
|
1981
|
-
//
|
|
1982
|
-
// about how the rule is implemented, no ticket ids. The "how" line prints once
|
|
1983
|
-
// per linked project — stored in the project's own .somewhere.json, never as a
|
|
1984
|
-
// new stray file in the customer's repo. An unlinked (anonymous) deploy has
|
|
1985
|
-
// nowhere to remember it, so it prints every time, which is the safe direction.
|
|
1979
|
+
// Routine exclusions are summarized on deploy and listed by --list-unpublished or --json.
|
|
1986
1980
|
export function printExcludedFiles(excluded, _targetDir, { list = false } = {}) {
|
|
1987
1981
|
// One plain sentence and the count; the list, and how to publish one on purpose, behind --list-unpublished.
|
|
1988
1982
|
if (!list) {
|
|
1989
|
-
info(`Not published: ${excluded.length} local file${excluded.length === 1 ? '' : 's'} (notes, tests, tooling) stay on your machine. See them: ${
|
|
1983
|
+
info(`Not published: ${excluded.length} local file${excluded.length === 1 ? '' : 's'} (notes, tests, tooling) stay on your machine. See them: ${cliInvocation()} deploy --list-unpublished`);
|
|
1990
1984
|
return;
|
|
1991
1985
|
}
|
|
1992
1986
|
info(`Not published (${excluded.length}): ${excluded.map((e) => e.path).join(', ')}`);
|
|
1993
1987
|
info(dim('Notes and scratch files nothing in your app uses, tests, and tooling folders stay local; everything else is uploaded. '
|
|
1994
|
-
+ `To publish one of these on purpose: ${
|
|
1988
|
+
+ `To publish one of these on purpose: ${cliInvocation()} deploy --include <file>, or add a "!<file>" line to .somewhereignore.`));
|
|
1995
1989
|
}
|
|
1996
1990
|
/** The --json form of the omission notices: one stderr line per file, stdout
|
|
1997
1991
|
* untouched, paths and reasons only (never contents), in a fixed order. */
|
|
@@ -2013,7 +2007,7 @@ export function printLocalOmissionsToStderr(omitted) {
|
|
|
2013
2007
|
* Neither --include nor a "!" line publishes them. */
|
|
2014
2008
|
export function printSensitiveFiles(sensitive) {
|
|
2015
2009
|
info(`Never uploaded (${sensitive.length}): ${sensitive.map((e) => e.path).join(', ')}`);
|
|
2016
|
-
info(dim(
|
|
2010
|
+
info(dim(`Files blocked by the sensitive-path policy stay on your machine; --include and "!" lines do not publish them. The policy matches file names only: a secret under any other name uploads like any other file. Store a secret your code needs with \`${cliInvocation()} env set\` and read it with sw.env in a function.`));
|
|
2017
2011
|
}
|
|
2018
2012
|
/** Why a dry run stops before reaching the platform. */
|
|
2019
2013
|
export function formatDryRunNeedsProjectExplanation() {
|
|
@@ -2022,8 +2016,8 @@ export function formatDryRunNeedsProjectExplanation() {
|
|
|
2022
2016
|
'this folder is not linked to a project, or you are not signed in.',
|
|
2023
2017
|
'Nothing was created, no temporary workspace was started, and no project or login files were changed.',
|
|
2024
2018
|
'',
|
|
2025
|
-
|
|
2026
|
-
|
|
2019
|
+
`To check your code without contacting Somewhere: \`${cliInvocation()} typecheck\` and \`${cliInvocation()} lint\`.`,
|
|
2020
|
+
`To deploy for real (signed out, this starts a temporary workspace): \`${cliInvocation()} deploy\`.`,
|
|
2027
2021
|
].join('\n');
|
|
2028
2022
|
}
|
|
2029
2023
|
function printDryRun(plan, scope) {
|