@yolo-labs/yolo-cli 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +2 -1
- package/dist/tileapp-personal.js +29 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -92,7 +92,8 @@ function printHelp() {
|
|
|
92
92
|
' bundle. Runtime (manifest has `runtime`): builds the image in-pod',
|
|
93
93
|
' + mediated-push to your registry namespace. Worker (`runtime.kind:',
|
|
94
94
|
" 'worker'`): uploads the bundle incl. its _worker/ backend, no build.",
|
|
95
|
-
' [--live]
|
|
95
|
+
' [--live] An in-progress edit, owner only: a worker app\'s backend runs on Dynamic Workers;',
|
|
96
|
+
' an interface-only app is shown only on your own tile (customers keep the published version).',
|
|
96
97
|
' [--bundle-dir <dir>] Pure-UI: override the static-bundle directory to upload.',
|
|
97
98
|
' [--include <path>] Upload a README*/*.md file that is skipped by default (repeatable).',
|
|
98
99
|
' [--context <dir>] [--dockerfile <f>] Runtime: build context + Dockerfile (default: the manifest dir).',
|
package/dist/tileapp-personal.js
CHANGED
|
@@ -532,8 +532,10 @@ export async function runTileAppPublishPersonal(opts) {
|
|
|
532
532
|
return { ok: false, kind: 'validation', message: `manifest "id" must be a lowercase kebab-case slug, 2-32 chars (got '${localId}')` };
|
|
533
533
|
}
|
|
534
534
|
const isWorker = isWorkerRuntimeManifest(read.manifest);
|
|
535
|
-
|
|
536
|
-
|
|
535
|
+
// --live on an image/container runtime app has nothing to run live; on a pure-UI app it is a
|
|
536
|
+
// static live edit (an owner-only preview), on a worker app its backend runs on Dynamic Workers.
|
|
537
|
+
if (opts.live && isRuntimeManifest(read.manifest)) {
|
|
538
|
+
return { ok: false, kind: 'usage', message: "--live applies to an interface-only or runtime.kind 'worker' app; publish without --live" };
|
|
537
539
|
}
|
|
538
540
|
// Runtime app (has `runtime`/`image`): build the image in-pod + mediated push.
|
|
539
541
|
// A worker app is NOT one (isRuntimeManifest excludes it): it falls through to
|
|
@@ -623,6 +625,9 @@ export async function runTileAppPublishPersonal(opts) {
|
|
|
623
625
|
const missingRoute = res.status === 404 && json.code !== 'feature-disabled';
|
|
624
626
|
if (!missingRoute) {
|
|
625
627
|
if (!res.ok) {
|
|
628
|
+
if (res.status === 409 && text.includes(STATIC_LIVE_DISABLED)) {
|
|
629
|
+
return { ok: false, kind: 'http', message: STATIC_LIVE_DISABLED_MESSAGE };
|
|
630
|
+
}
|
|
626
631
|
if (res.status === 409 && text.includes(DYNAMIC_WORKERS_DISABLED)) {
|
|
627
632
|
return { ok: false, kind: 'http', message: DYNAMIC_WORKERS_DISABLED_MESSAGE };
|
|
628
633
|
}
|
|
@@ -674,6 +679,9 @@ export async function runTileAppPublishPersonal(opts) {
|
|
|
674
679
|
return staged;
|
|
675
680
|
if (!res.ok) {
|
|
676
681
|
const body = await safeText(res);
|
|
682
|
+
if (res.status === 409 && body.includes(STATIC_LIVE_DISABLED)) {
|
|
683
|
+
return { ok: false, kind: 'http', message: STATIC_LIVE_DISABLED_MESSAGE };
|
|
684
|
+
}
|
|
677
685
|
if (res.status === 409 && body.includes(DYNAMIC_WORKERS_DISABLED)) {
|
|
678
686
|
return { ok: false, kind: 'http', message: DYNAMIC_WORKERS_DISABLED_MESSAGE };
|
|
679
687
|
}
|
|
@@ -691,6 +699,22 @@ export async function runTileAppPublishPersonal(opts) {
|
|
|
691
699
|
const summary = `Published ${appId} (${collected.files.length} file${collected.files.length === 1 ? '' : 's'}, ${collected.totalBytes} bytes)`
|
|
692
700
|
+ (collected.skipped.length > 0 ? `\n skipped (docs are not uploaded; --include <path> to upload one): ${collected.skipped.join(', ')}` : '');
|
|
693
701
|
const next = installNextLines(appId, workspaceId, installReport);
|
|
702
|
+
if (!isWorker && opts.live) {
|
|
703
|
+
// A static live edit: stored beside the published bundle, shown only on the owner's tile.
|
|
704
|
+
if (uploadJson.live !== true) {
|
|
705
|
+
return { ok: false, kind: 'http', message: `${appId}: the server did not store a live version; publish without --live, or check the deployment has live edits on` };
|
|
706
|
+
}
|
|
707
|
+
return {
|
|
708
|
+
ok: true,
|
|
709
|
+
output: [
|
|
710
|
+
summary,
|
|
711
|
+
' live: true (owner-only preview)',
|
|
712
|
+
" Only your own tile shows this version (relaunch or reload the tile). Customers' portals and the published",
|
|
713
|
+
' version are unchanged; publish without --live to ship it.',
|
|
714
|
+
...next,
|
|
715
|
+
].join('\n'),
|
|
716
|
+
};
|
|
717
|
+
}
|
|
694
718
|
if (!isWorker)
|
|
695
719
|
return { ok: true, output: [summary, ...next].join('\n') };
|
|
696
720
|
// A worker app's bundle is stored either way; `publish` says whether its
|
|
@@ -720,6 +744,9 @@ export async function runTileAppPublishPersonal(opts) {
|
|
|
720
744
|
/** The refusal code (HTTP 409) for a live worker tile when Dynamic Workers is off on the deployment. */
|
|
721
745
|
const DYNAMIC_WORKERS_DISABLED = 'dynamic-workers-disabled';
|
|
722
746
|
export const DYNAMIC_WORKERS_DISABLED_MESSAGE = 'live worker tiles are not enabled on this deployment; publish without --live';
|
|
747
|
+
/** The refusal code (HTTP 409) for a live edit of an interface-only app where it is off. */
|
|
748
|
+
const STATIC_LIVE_DISABLED = 'static-live-disabled';
|
|
749
|
+
export const STATIC_LIVE_DISABLED_MESSAGE = 'live edits of interface-only apps are not enabled on this deployment; publish without --live';
|
|
723
750
|
/**
|
|
724
751
|
* This pod's workspace id (`WORKSPACE_ID`, set in every session pod), or
|
|
725
752
|
* undefined. Only when the API is the one the pod belongs to (production, or the
|