@xanots/sdk 0.0.9 → 0.0.10
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 +17 -0
- package/README.md +28 -21
- package/dist/.build-fingerprint +1 -1
- package/dist/{agent-file-refresh-4W37DGXS.js → agent-file-refresh-QNKN5RYD.js} +3 -3
- package/dist/bin.js +8 -7
- package/dist/{branch-commands-PBQ36L4A.js → branch-commands-2BLOC2GR.js} +13 -11
- package/dist/{capture-7PO6SGB4.js → capture-4WVJY4DQ.js} +2 -2
- package/dist/{chunk-ZOYMZZ3S.js → chunk-3INK4Y4E.js} +1 -1
- package/dist/{chunk-NDZFBZHC.js → chunk-3UABJA4X.js} +1 -1
- package/dist/{chunk-7OXFMCTX.js → chunk-5R73LFWK.js} +3 -3
- package/dist/{chunk-OW2QZEWL.js → chunk-5YCQ2QHH.js} +2 -2
- package/dist/{chunk-5YQOIFT4.js → chunk-75Z74TA7.js} +2 -2
- package/dist/{chunk-QTNO2WD6.js → chunk-7ZYW652H.js} +1 -1
- package/dist/{chunk-K3YSQDXJ.js → chunk-ACCBOMCB.js} +91 -74
- package/dist/{chunk-4PTSTDIG.js → chunk-AIZKXUNP.js} +2 -2
- package/dist/{chunk-P5C2YKAM.js → chunk-ANUDXFEX.js} +18 -27
- package/dist/chunk-CTD5ZCV6.js +28 -0
- package/dist/{chunk-5HCDZ2XN.js → chunk-DBFU47BJ.js} +2 -2
- package/dist/{chunk-OKNSR7MT.js → chunk-DIA7CT7J.js} +129 -150
- package/dist/{chunk-JQLR64UC.js → chunk-F6CYJ7TN.js} +21 -6
- package/dist/{chunk-BKDJN76G.js → chunk-FE5I6S6N.js} +1 -1
- package/dist/{chunk-L6TPHWAU.js → chunk-I7DQDJAM.js} +30 -48
- package/dist/{chunk-QIWBCS7N.js → chunk-JGCWTCA7.js} +2 -2
- package/dist/{chunk-MDXR5E5Q.js → chunk-K5IOND4K.js} +2 -2
- package/dist/{chunk-4PE4ZAB7.js → chunk-KA6G2L7U.js} +5 -5
- package/dist/{chunk-QONOJO45.js → chunk-LBYWGMOA.js} +1 -1
- package/dist/{chunk-ZZLPTHT5.js → chunk-P6TAVLOX.js} +2 -2
- package/dist/{chunk-3QW5NFZJ.js → chunk-QKM4U5UK.js} +3 -3
- package/dist/{chunk-T4XPCJRF.js → chunk-TCFIPDB3.js} +1 -1
- package/dist/{chunk-UDL46O35.js → chunk-VKSOTZK3.js} +2 -2
- package/dist/{chunk-6DHBYBTO.js → chunk-VNQM3V2C.js} +1 -2
- package/dist/{chunk-KSV7VOEX.js → chunk-W24FJHPD.js} +3 -3
- package/dist/chunk-WGPXT2G2.js +22 -0
- package/dist/{chunk-6AAT2AYQ.js → chunk-WP4OZZV4.js} +2 -2
- package/dist/{chunk-MU3O43L2.js → chunk-YBC3IKMF.js} +2 -2
- package/dist/{chunk-6Z5CNWFC.js → chunk-YYFXVYPX.js} +37 -6
- package/dist/chunk-ZQ2PKR6R.js +40 -0
- package/dist/cli.d.ts +57 -31
- package/dist/cli.js +6 -5
- package/dist/codegen-command-GB3H2KQ7.js +46 -0
- package/dist/{completion-A6BZ3XGU.js → completion-WF46272M.js} +2 -2
- package/dist/{config-NL33PN4D.js → config-476F3PT5.js} +1 -1
- package/dist/{deploy-command-5TTI4TUP.js → deploy-command-QTIVA22A.js} +67 -99
- package/dist/{ephemeral-command-7TK52YQM.js → ephemeral-command-U4AQ3TXX.js} +25 -28
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -5
- package/dist/{init-command-OVFFW4QS.js → init-command-MAXULNAD.js} +13 -10
- package/dist/{onboard-command-EHOHKQQU.js → init-web-3JNFG6GI.js} +10 -10
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +27 -36
- package/dist/{live-diff-QK4KC2FJ.js → live-diff-IXKBVG4K.js} +3 -3
- package/dist/{lock-commands-ET7NIOLH.js → lock-commands-DQ7CUMIV.js} +20 -19
- package/dist/{login-command-DFCURZLC.js → login-command-Z6CHTA57.js} +7 -7
- package/dist/{logout-command-WXVZQCAV.js → logout-command-ER6IKAYJ.js} +2 -2
- package/dist/{loop-7SAIGRCZ.js → loop-D5NPL4VH.js} +3 -3
- package/dist/{marketplace-command-BCOAAN2I.js → marketplace-command-P4IPLJ6J.js} +6 -6
- package/dist/{meta-client-57ZWVHST.js → meta-client-K2J4XH64.js} +6 -6
- package/dist/node.d.ts +2 -2
- package/dist/node.js +9 -8
- package/dist/{validate-command-SK5FPCV7.js → preflight-command-GZ2GE5RN.js} +17 -16
- package/dist/{profile-command-QJAAUZIV.js → profile-command-LJSBDV2L.js} +5 -5
- package/dist/{release-command-4EXVLYV2.js → release-command-YUBTNHVX.js} +36 -33
- package/dist/{routes-manifest-SP3ZXLMR.js → routes-manifest-PWZHDOI5.js} +2 -2
- package/dist/scaffold.js +2 -2
- package/dist/{static-host-D6KS7X45.js → static-host-3WMV7IZO.js} +1 -1
- package/dist/status-command-AL47VG7H.js +162 -0
- package/dist/{store-CUCBSYLj.d.ts → store-BG1UPZ3Z.d.ts} +5 -5
- package/dist/{test-command-2F5LKMI6.js → test-command-YAZLKLGQ.js} +45 -28
- package/dist/{upgrade-command-QL523I62.js → upgrade-command-FB5QJ363.js} +13 -12
- package/dist/{workspace-K72NP7SX.js → workspace-2COHDBM3.js} +1 -1
- package/dist/{workspace-command-HYA6JEKK.js → workspace-command-43P42FBP.js} +31 -32
- package/dist/{workspace-export-AJMGN3CQ.js → workspace-export-DURY5WYL.js} +2 -2
- package/guides/README.md +2 -2
- package/guides/cli.md +17 -19
- package/guides/codegen.md +21 -5
- package/guides/coverage.md +1 -1
- package/guides/deploying.md +31 -34
- package/guides/environment.md +4 -4
- package/guides/object-kinds.md +3 -3
- package/guides/project-structure.md +1 -1
- package/guides/scaffold.md +25 -2
- package/guides/typed-frontend.md +1 -1
- package/llms/kinds-agent-mcp.md +1 -1
- package/llms/kinds-core.md +1 -1
- package/llms/kinds-realtime.md +1 -1
- package/llms/lock.md +5 -5
- package/llms/tests.md +1 -1
- package/llms-full.txt +25 -34
- package/llms.txt +16 -25
- package/manifest.json +95 -426
- package/package.json +1 -1
- package/dist/chunk-3EYUR3TX.js +0 -100
- package/dist/chunk-JQJPFUZI.js +0 -118
- package/dist/chunk-YNZFIY4J.js +0 -78
- package/dist/codegen-command-YSCSCVT5.js +0 -43
- package/dist/env-target-4T7AT347.js +0 -16
- package/dist/sandbox-details-command-EDO56IY3.js +0 -18
- package/dist/sandbox-export-command-MO6DEZ7Z.js +0 -24
package/dist/cli.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ interface NonPublicSeedValue {
|
|
|
27
27
|
interface ParsedArgs {
|
|
28
28
|
command: string | undefined;
|
|
29
29
|
/**
|
|
30
|
-
* The verb of a noun-verb command (`
|
|
30
|
+
* The verb of a noun-verb command (`workspace export`, `profile me`): here
|
|
31
31
|
* `command` is the noun and `subcommand` is the verb.
|
|
32
32
|
* Undefined for the single-token verbs (`compile`/`export`/`lock`/…).
|
|
33
33
|
*/
|
|
@@ -73,14 +73,17 @@ interface ParsedArgs {
|
|
|
73
73
|
/** `--reset`: accepted but redundant — every deploy is a full replace now. */
|
|
74
74
|
reset: boolean;
|
|
75
75
|
/**
|
|
76
|
-
*
|
|
76
|
+
* `test --env <target>`: which environment to read — `workspace`,
|
|
77
|
+
* `ephemeral`, or `ephemeral:<name>`. Kept as the raw string and resolved by
|
|
78
|
+
* `env-selector.ts`, the one module that knows the grammar, so `init --from`
|
|
79
|
+
* and this cannot drift on how an environment is spelled.
|
|
77
80
|
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
81
|
+
* `deploy` and `release` each reach exactly one environment and declare no
|
|
82
|
+
* flag for it; they refuse this at dispatch with the reason rather than a
|
|
83
|
+
* "bad value" here, since a full-replace import into a real workspace is a
|
|
84
|
+
* product boundary rather than a typo.
|
|
82
85
|
*/
|
|
83
|
-
|
|
86
|
+
env: string | undefined;
|
|
84
87
|
/** `test --kind unit|workflow`: narrow to one test family (default: both). */
|
|
85
88
|
kind: "unit" | "workflow" | undefined;
|
|
86
89
|
/** `test run-all --concurrency <n>`: how many tests to run at once (default 1). */
|
|
@@ -95,7 +98,7 @@ interface ParsedArgs {
|
|
|
95
98
|
* frontend gets the typed path/verb contract without the SDK runtime.
|
|
96
99
|
*/
|
|
97
100
|
emit: string | undefined;
|
|
98
|
-
/** `deploy --static <dir>`: archive this directory and deploy it to the
|
|
101
|
+
/** `deploy --static <dir>`: archive this directory and deploy it to the environment's static host. */
|
|
99
102
|
static: string | undefined;
|
|
100
103
|
/**
|
|
101
104
|
* `deploy --static-env KEY=VALUE` (repeatable): public config baked into EVERY
|
|
@@ -152,22 +155,22 @@ interface ParsedArgs {
|
|
|
152
155
|
paste: boolean;
|
|
153
156
|
/** `login --scope "<space list>"`: OAuth scopes to request (default: the built-in xano-cli set). */
|
|
154
157
|
scope: string | undefined;
|
|
155
|
-
/** `
|
|
158
|
+
/** `preflight --runtime`: after import + round-trip, run each deployed function and report. */
|
|
156
159
|
runtime: boolean;
|
|
157
|
-
/** `
|
|
160
|
+
/** `preflight --capture`: write each round-tripped function's fetched JSON (candidate fixtures). */
|
|
158
161
|
capture: boolean;
|
|
159
|
-
/** `
|
|
162
|
+
/** `preflight --verbose`: print full diffs / raw engine detail instead of a projected summary. */
|
|
160
163
|
verbose: boolean;
|
|
161
|
-
/** `
|
|
164
|
+
/** `preflight --instance <url>`: override XANO_VALIDATE_INSTANCE for this run. */
|
|
162
165
|
instance: string | undefined;
|
|
163
|
-
/** `
|
|
166
|
+
/** `ephemeral export --format <json|multidoc>`: which artifact to emit (validated at parse time). */
|
|
164
167
|
format: "json" | "multidoc" | undefined;
|
|
165
|
-
/**
|
|
168
|
+
/** `<env> export --path <p>`: output location (`-` for stdout; a dir or a full file path). */
|
|
166
169
|
path: string | undefined;
|
|
167
|
-
/**
|
|
170
|
+
/** `<env> export --name <n>`: output basename override. Also the `init` app name (default: target dir basename). */
|
|
168
171
|
name: string | undefined;
|
|
169
172
|
/**
|
|
170
|
-
* `init
|
|
173
|
+
* `init` `--ai <preset>` (repeatable, comma-separated): AI-assistant instruction
|
|
171
174
|
* files to scaffold (`claude`/`codex`/`cursor`/`none`). Empty = prompt in a TTY,
|
|
172
175
|
* else write none. Validated in the init command, not at parse time.
|
|
173
176
|
*/
|
|
@@ -182,45 +185,68 @@ interface ParsedArgs {
|
|
|
182
185
|
*/
|
|
183
186
|
marketplace: string[];
|
|
184
187
|
/**
|
|
185
|
-
* `init
|
|
188
|
+
* `init --from <source>`: where `xano/` comes from — `workspace`,
|
|
189
|
+
* `ephemeral:<name>`, or a path to a bundle JSON already on disk. Undefined
|
|
190
|
+
* writes the empty-but-valid starter backend instead.
|
|
191
|
+
*
|
|
192
|
+
* Kept as the raw string here and resolved in `init-command.ts`, so the one
|
|
193
|
+
* place that knows the spellings is the one that reports a bad one.
|
|
194
|
+
*/
|
|
195
|
+
from: string | undefined;
|
|
196
|
+
/**
|
|
197
|
+
* `init` `--framework <id>`: which frontend to scaffold
|
|
186
198
|
* (`react`/`svelte`). Undefined = prompt in a TTY, else the default.
|
|
187
199
|
* Validated in `frontend-presets.ts`, not at parse time.
|
|
188
200
|
*/
|
|
189
201
|
framework: string | undefined;
|
|
190
202
|
/**
|
|
191
|
-
* `init
|
|
203
|
+
* `init` `--theme <id>`: the shadcn/ui palette to render into the
|
|
192
204
|
* scaffold's stylesheet — a `<base>` or `<base>-<accent>` pair, a registry
|
|
193
205
|
* theme URL, or a path to a registry item JSON file. Undefined = plain
|
|
194
206
|
* shadcn. Validated in `theme-presets.ts`, not at parse time.
|
|
195
207
|
*/
|
|
196
208
|
theme: string | undefined;
|
|
197
|
-
/** `init
|
|
209
|
+
/** `init` `--radius <len>`: corner radius override, bare number = rem. */
|
|
198
210
|
radius: string | undefined;
|
|
199
211
|
/**
|
|
200
|
-
* `init
|
|
212
|
+
* `init` `--dark <mode>`: what switches the scaffold into its dark
|
|
201
213
|
* palette — `system` (default), `toggle`, or `off`.
|
|
202
214
|
*/
|
|
203
215
|
dark: string | undefined;
|
|
204
|
-
/** `init
|
|
216
|
+
/** `init` `--font <id>`: the body typeface (Tailwind's `--font-sans`). */
|
|
205
217
|
font: string | undefined;
|
|
206
|
-
/** `init
|
|
218
|
+
/** `init` `--font-mono <id>`: the code typeface. */
|
|
207
219
|
fontMono: string | undefined;
|
|
208
|
-
/** `init
|
|
220
|
+
/** `init` `--font-heading <id>`: the heading typeface; absent inherits the body face. */
|
|
209
221
|
fontHeading: string | undefined;
|
|
210
|
-
/** `init
|
|
222
|
+
/** `init` `--icons <id>`: the icon set (`lucide` default, `tabler`, `phosphor`). */
|
|
211
223
|
icons: string | undefined;
|
|
212
|
-
/** `init
|
|
224
|
+
/** `init` `--force`: scaffold into a non-empty target directory (overwrite our own files). */
|
|
213
225
|
force: boolean;
|
|
214
|
-
/** `init
|
|
226
|
+
/** `init` `--no-install`: skip the post-scaffold `npm install`. Under `--from` this also means the round trip cannot be verified, since loading the tree needs its dependencies. */
|
|
215
227
|
noInstall: boolean;
|
|
216
228
|
/**
|
|
217
|
-
* `deploy --
|
|
218
|
-
* still deployed; XanoTS just doesn't wait to confirm it came up — neither
|
|
229
|
+
* `deploy --skip-liveness`: skip the post-deploy liveness checks. Everything
|
|
230
|
+
* is still deployed; XanoTS just doesn't wait to confirm it came up — neither
|
|
219
231
|
* that the edge is serving *this* static build (via `X-Xano-Canonical`) nor
|
|
220
232
|
* that the workspace's microservices reached a ready state. Useful for fast
|
|
221
233
|
* iterative deploys or when the deployed URL isn't reachable from the CLI host.
|
|
222
234
|
*/
|
|
223
|
-
|
|
235
|
+
skipLiveness: boolean;
|
|
236
|
+
/**
|
|
237
|
+
* `init --from … --skip-roundtrip`: skip the offline check that the tree just
|
|
238
|
+
* written re-exports as the bundle it was decoded from. Entirely local — no
|
|
239
|
+
* network, no deploy, no workspace mutation — which is why it is not the same
|
|
240
|
+
* flag as {@link skipLiveness} despite both once being spelled `--no-verify`.
|
|
241
|
+
*/
|
|
242
|
+
skipRoundtrip: boolean;
|
|
243
|
+
/**
|
|
244
|
+
* `lock prune --identity-only`: drop the named entries without loading the
|
|
245
|
+
* entry file. The third thing `--no-verify` used to mean, and the least
|
|
246
|
+
* related to the other two: nothing is verified either way, the question is
|
|
247
|
+
* whether the workspace is evaluated at all.
|
|
248
|
+
*/
|
|
249
|
+
identityOnly: boolean;
|
|
224
250
|
/**
|
|
225
251
|
* `deploy --require-microservices`: fail the deploy when a microservice has
|
|
226
252
|
* not reported ready by the end of the wait, not just when the engine says it
|
|
@@ -230,7 +256,7 @@ interface ParsedArgs {
|
|
|
230
256
|
*/
|
|
231
257
|
requireMicroservices: boolean;
|
|
232
258
|
/**
|
|
233
|
-
* `
|
|
259
|
+
* `init --from … --report <grouped|full|json>`: how the findings are rendered.
|
|
234
260
|
*
|
|
235
261
|
* `grouped` (the default) prints one line per distinct root cause with a count
|
|
236
262
|
* and a collapsed object list; `full` prints every site; `json` prints the
|
|
@@ -383,7 +409,7 @@ interface CompiledBundle {
|
|
|
383
409
|
}
|
|
384
410
|
/**
|
|
385
411
|
* Thin wrapper over {@link compileBundle} for the many callers that only need the
|
|
386
|
-
* bundle text (export,
|
|
412
|
+
* bundle text (export, preflight). Seed content is not built here.
|
|
387
413
|
*/
|
|
388
414
|
declare function exportBundleJson(args: ParsedArgs): Promise<string>;
|
|
389
415
|
/**
|
package/dist/cli.js
CHANGED
|
@@ -8,14 +8,15 @@ import {
|
|
|
8
8
|
resolveHelpRequest,
|
|
9
9
|
resolveLockPath,
|
|
10
10
|
run
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-ACCBOMCB.js";
|
|
12
|
+
import "./chunk-CTD5ZCV6.js";
|
|
13
13
|
import "./chunk-OYMR5AMJ.js";
|
|
14
|
+
import "./chunk-F6CYJ7TN.js";
|
|
14
15
|
import "./chunk-GNPVYOPB.js";
|
|
15
16
|
import "./chunk-EZG76F7R.js";
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-VKSOTZK3.js";
|
|
18
|
+
import "./chunk-DIA7CT7J.js";
|
|
19
|
+
import "./chunk-LBYWGMOA.js";
|
|
19
20
|
import "./chunk-WHOJWOSV.js";
|
|
20
21
|
import "./chunk-5XZ744TS.js";
|
|
21
22
|
import "./chunk-7JDT4PBU.js";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
blameGeneratedFile,
|
|
3
|
+
fetchWorkspaceBundle,
|
|
4
|
+
isMissingDependencyError,
|
|
5
|
+
runInitFromCommand,
|
|
6
|
+
verifyCrashEntry
|
|
7
|
+
} from "./chunk-I7DQDJAM.js";
|
|
8
|
+
import "./chunk-3INK4Y4E.js";
|
|
9
|
+
import "./chunk-ZQ2PKR6R.js";
|
|
10
|
+
import "./chunk-K5IOND4K.js";
|
|
11
|
+
import "./chunk-QKM4U5UK.js";
|
|
12
|
+
import "./chunk-FE5I6S6N.js";
|
|
13
|
+
import "./chunk-7ZYW652H.js";
|
|
14
|
+
import "./chunk-ZUTSMMAG.js";
|
|
15
|
+
import "./chunk-X4DVXBFY.js";
|
|
16
|
+
import "./chunk-3IGNIP6R.js";
|
|
17
|
+
import "./chunk-YYFXVYPX.js";
|
|
18
|
+
import "./chunk-KA6G2L7U.js";
|
|
19
|
+
import "./chunk-ZSYZTGJH.js";
|
|
20
|
+
import "./chunk-75Z74TA7.js";
|
|
21
|
+
import "./chunk-LU7TRWMC.js";
|
|
22
|
+
import "./chunk-YBC3IKMF.js";
|
|
23
|
+
import "./chunk-ANUDXFEX.js";
|
|
24
|
+
import "./chunk-Q77KNEUL.js";
|
|
25
|
+
import "./chunk-4BXJGVZ3.js";
|
|
26
|
+
import "./chunk-P6TAVLOX.js";
|
|
27
|
+
import "./chunk-ACCBOMCB.js";
|
|
28
|
+
import "./chunk-CTD5ZCV6.js";
|
|
29
|
+
import "./chunk-OYMR5AMJ.js";
|
|
30
|
+
import "./chunk-F6CYJ7TN.js";
|
|
31
|
+
import "./chunk-GNPVYOPB.js";
|
|
32
|
+
import "./chunk-EZG76F7R.js";
|
|
33
|
+
import "./chunk-VKSOTZK3.js";
|
|
34
|
+
import "./chunk-DIA7CT7J.js";
|
|
35
|
+
import "./chunk-LBYWGMOA.js";
|
|
36
|
+
import "./chunk-WHOJWOSV.js";
|
|
37
|
+
import "./chunk-5XZ744TS.js";
|
|
38
|
+
import "./chunk-7JDT4PBU.js";
|
|
39
|
+
export {
|
|
40
|
+
blameGeneratedFile,
|
|
41
|
+
fetchWorkspaceBundle,
|
|
42
|
+
isMissingDependencyError,
|
|
43
|
+
runInitFromCommand,
|
|
44
|
+
verifyCrashEntry
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=codegen-command-GB3H2KQ7.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
liveCommandNames,
|
|
7
7
|
liveSubcommandNames,
|
|
8
8
|
visibleFlags
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-DIA7CT7J.js";
|
|
10
10
|
|
|
11
11
|
// src/emit/completion.ts
|
|
12
12
|
var COMPLETION_SHELLS = ["bash", "zsh", "fish"];
|
|
@@ -296,4 +296,4 @@ export {
|
|
|
296
296
|
renderCompletion,
|
|
297
297
|
runCompletionCommand
|
|
298
298
|
};
|
|
299
|
-
//# sourceMappingURL=completion-
|
|
299
|
+
//# sourceMappingURL=completion-WF46272M.js.map
|
|
@@ -1,52 +1,49 @@
|
|
|
1
1
|
import {
|
|
2
2
|
importWorkspaceArchive
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WP4OZZV4.js";
|
|
4
4
|
import {
|
|
5
5
|
assertBundleInput,
|
|
6
6
|
loadBundleText
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-W24FJHPD.js";
|
|
8
|
+
import {
|
|
9
|
+
microserviceLine,
|
|
10
|
+
readyRatio,
|
|
11
|
+
waitForMicroservices
|
|
12
|
+
} from "./chunk-3UABJA4X.js";
|
|
8
13
|
import {
|
|
9
14
|
createEphemeral,
|
|
10
15
|
getEphemeral,
|
|
11
16
|
isEphemeralDisabled,
|
|
12
17
|
isExpired,
|
|
13
|
-
tenantBaseUrl,
|
|
14
18
|
waitUntilReady
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import {
|
|
17
|
-
getEnvironment,
|
|
18
|
-
readEphemeralState,
|
|
19
|
-
setEnvironment
|
|
20
|
-
} from "./chunk-MDXR5E5Q.js";
|
|
19
|
+
} from "./chunk-VNQM3V2C.js";
|
|
21
20
|
import {
|
|
22
21
|
openBrowser
|
|
23
22
|
} from "./chunk-W5NOKYEG.js";
|
|
24
23
|
import {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
isMachineOutput,
|
|
25
|
+
writeJson
|
|
26
|
+
} from "./chunk-NUQCEOKA.js";
|
|
27
|
+
import {
|
|
28
|
+
getEnvironment,
|
|
29
|
+
readEphemeralState,
|
|
30
|
+
setEnvironment
|
|
31
|
+
} from "./chunk-K5IOND4K.js";
|
|
29
32
|
import {
|
|
30
33
|
getAccessToken
|
|
31
|
-
} from "./chunk-
|
|
32
|
-
import "./chunk-
|
|
34
|
+
} from "./chunk-QKM4U5UK.js";
|
|
35
|
+
import "./chunk-FE5I6S6N.js";
|
|
33
36
|
import {
|
|
34
37
|
encodeWorkspaceArchive
|
|
35
38
|
} from "./chunk-ZUTSMMAG.js";
|
|
36
39
|
import "./chunk-X4DVXBFY.js";
|
|
37
|
-
import
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
} from "./chunk-NUQCEOKA.js";
|
|
41
|
-
import {
|
|
42
|
-
fetchOrExplain,
|
|
43
|
-
httpFailure
|
|
44
|
-
} from "./chunk-3IGNIP6R.js";
|
|
45
|
-
import "./chunk-K3YSQDXJ.js";
|
|
46
|
-
import {
|
|
47
|
-
assertWritableDest
|
|
48
|
-
} from "./chunk-JQLR64UC.js";
|
|
40
|
+
import "./chunk-3IGNIP6R.js";
|
|
41
|
+
import "./chunk-ACCBOMCB.js";
|
|
42
|
+
import "./chunk-CTD5ZCV6.js";
|
|
49
43
|
import "./chunk-OYMR5AMJ.js";
|
|
44
|
+
import {
|
|
45
|
+
assertNoEnv
|
|
46
|
+
} from "./chunk-F6CYJ7TN.js";
|
|
50
47
|
import "./chunk-GNPVYOPB.js";
|
|
51
48
|
import {
|
|
52
49
|
blank,
|
|
@@ -62,9 +59,9 @@ import {
|
|
|
62
59
|
warn,
|
|
63
60
|
withSpinner
|
|
64
61
|
} from "./chunk-EZG76F7R.js";
|
|
65
|
-
import "./chunk-
|
|
66
|
-
import "./chunk-
|
|
67
|
-
import "./chunk-
|
|
62
|
+
import "./chunk-VKSOTZK3.js";
|
|
63
|
+
import "./chunk-DIA7CT7J.js";
|
|
64
|
+
import "./chunk-LBYWGMOA.js";
|
|
68
65
|
import "./chunk-WHOJWOSV.js";
|
|
69
66
|
import "./chunk-5XZ744TS.js";
|
|
70
67
|
import "./chunk-7JDT4PBU.js";
|
|
@@ -74,9 +71,8 @@ import { basename } from "path";
|
|
|
74
71
|
var EXIT_STATIC_FAILED = 3;
|
|
75
72
|
var EXIT_MICROSERVICE_NOT_READY = 4;
|
|
76
73
|
var EXIT_TESTS_UNREACHABLE = 6;
|
|
77
|
-
var SANDBOX_TIMEOUT_MS = 3e4;
|
|
78
74
|
function microserviceCheck(args) {
|
|
79
|
-
return {
|
|
75
|
+
return { skip: args.skipLiveness, requireReady: args.requireMicroservices };
|
|
80
76
|
}
|
|
81
77
|
function buildStaticEnv(baseUrl, staticEnv) {
|
|
82
78
|
const env = {};
|
|
@@ -94,28 +90,6 @@ function deriveDisplay(bundleText, cwd) {
|
|
|
94
90
|
}
|
|
95
91
|
return basename(cwd) || "xanots-app";
|
|
96
92
|
}
|
|
97
|
-
async function resolveSandboxBaseUrl(auth) {
|
|
98
|
-
const url = new URL("/api:meta/sandbox/me", auth.instance);
|
|
99
|
-
const res = await fetchOrExplain(
|
|
100
|
-
url.href,
|
|
101
|
-
{
|
|
102
|
-
headers: { accept: "application/json", Authorization: `Bearer ${auth.access_token}` },
|
|
103
|
-
signal: AbortSignal.timeout(SANDBOX_TIMEOUT_MS)
|
|
104
|
-
},
|
|
105
|
-
"resolve sandbox",
|
|
106
|
-
SANDBOX_TIMEOUT_MS
|
|
107
|
-
);
|
|
108
|
-
const text = await res.text();
|
|
109
|
-
if (!res.ok) throw new Error(httpFailure("resolve sandbox", res, text));
|
|
110
|
-
let tenant = {};
|
|
111
|
-
try {
|
|
112
|
-
tenant = JSON.parse(text);
|
|
113
|
-
} catch {
|
|
114
|
-
throw new Error(`resolve sandbox: could not parse the ${url.pathname} response as JSON:
|
|
115
|
-
${text}`);
|
|
116
|
-
}
|
|
117
|
-
return tenantBaseUrl(tenant, auth.instance);
|
|
118
|
-
}
|
|
119
93
|
async function assertNoSeedLeaks(dir, values, allow) {
|
|
120
94
|
if (values.length === 0) return;
|
|
121
95
|
const unscannable = [
|
|
@@ -127,7 +101,7 @@ async function assertNoSeedLeaks(dir, values, allow) {
|
|
|
127
101
|
);
|
|
128
102
|
for (const column of unscannable) detail(column);
|
|
129
103
|
}
|
|
130
|
-
const { findSeedLeaks } = await import("./static-host-
|
|
104
|
+
const { findSeedLeaks } = await import("./static-host-3WMV7IZO.js");
|
|
131
105
|
const leaks = findSeedLeaks(dir, values);
|
|
132
106
|
if (leaks.length === 0) return;
|
|
133
107
|
const lines = leaks.map((l) => ` ${l.file} \u2014 ${l.table}.${l.column}`);
|
|
@@ -147,9 +121,9 @@ If the data is deliberately public demo content, pass --allow-seed-in-static.`
|
|
|
147
121
|
function deployTarget(auth) {
|
|
148
122
|
detail(`on ${hostLabel(auth.instance)} \xB7 workspace ${auth.workspaceId}`);
|
|
149
123
|
}
|
|
150
|
-
async function runDeployedTests(auth,
|
|
124
|
+
async function runDeployedTests(auth, summary, args) {
|
|
151
125
|
try {
|
|
152
|
-
return await runTestsOrThrow(auth,
|
|
126
|
+
return await runTestsOrThrow(auth, summary, args);
|
|
153
127
|
} catch (err) {
|
|
154
128
|
warn("The deploy stands, but its tests could not be run:");
|
|
155
129
|
detail(err instanceof Error ? err.message : String(err));
|
|
@@ -157,20 +131,19 @@ async function runDeployedTests(auth, dest, summary, args) {
|
|
|
157
131
|
return void 0;
|
|
158
132
|
}
|
|
159
133
|
}
|
|
160
|
-
async function runTestsOrThrow(auth,
|
|
161
|
-
const { runSuite, EXIT_TESTS_FAILED } = await import("./test-command-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
warn("Skipped --test: the ephemeral reported no base URL to run against.");
|
|
166
|
-
return void 0;
|
|
167
|
-
}
|
|
168
|
-
const name = summary.ephemeral?.name;
|
|
169
|
-
target = { base: summary.url, workspaceId: 1, label: name ? `ephemeral ${name}` : "the ephemeral", env: name };
|
|
170
|
-
} else {
|
|
171
|
-
const { resolveMetaTarget } = await import("./env-target-4T7AT347.js");
|
|
172
|
-
target = await resolveMetaTarget(auth, { dest: "sandbox" });
|
|
134
|
+
async function runTestsOrThrow(auth, summary, args) {
|
|
135
|
+
const { runSuite, EXIT_TESTS_FAILED } = await import("./test-command-YAZLKLGQ.js");
|
|
136
|
+
if (summary.url === void 0) {
|
|
137
|
+
warn("Skipped --test: the ephemeral reported no base URL to run against.");
|
|
138
|
+
return void 0;
|
|
173
139
|
}
|
|
140
|
+
const name = summary.ephemeral?.name;
|
|
141
|
+
const target = {
|
|
142
|
+
base: summary.url,
|
|
143
|
+
workspaceId: 1,
|
|
144
|
+
label: name ? `ephemeral ${name}` : "the ephemeral",
|
|
145
|
+
env: name
|
|
146
|
+
};
|
|
174
147
|
const outcomes = await runSuite(auth, target, {
|
|
175
148
|
kind: args.kind,
|
|
176
149
|
concurrency: args.concurrency,
|
|
@@ -199,8 +172,7 @@ async function runTestsOrThrow(auth, dest, summary, args) {
|
|
|
199
172
|
};
|
|
200
173
|
}
|
|
201
174
|
async function runDeployCommand(args) {
|
|
202
|
-
|
|
203
|
-
const dest = args.dest ?? "ephemeral";
|
|
175
|
+
assertNoEnv(args.env, "deploy");
|
|
204
176
|
const startedAt = Date.now();
|
|
205
177
|
if (args.reset) info("`--reset` is redundant \u2014 deploy is always a full replace.");
|
|
206
178
|
assertBundleInput(args, { command: "deploy" });
|
|
@@ -224,8 +196,8 @@ async function runDeployCommand(args) {
|
|
|
224
196
|
const staticEnv = buildStaticEnv(env.baseUrl, args.staticEnv);
|
|
225
197
|
const explicit = Object.keys(args.staticEnv).length > 0;
|
|
226
198
|
try {
|
|
227
|
-
const target =
|
|
228
|
-
staticSummary = await deployStaticTo(staticDir, auth, target, staticEnv, explicit, args.staticHost, args.
|
|
199
|
+
const target = { baseUrl: env.baseUrl, workspaceId: 1, label: env.label };
|
|
200
|
+
staticSummary = await deployStaticTo(staticDir, auth, target, staticEnv, explicit, args.staticHost, args.skipLiveness, args.staticRouting);
|
|
229
201
|
} catch (err) {
|
|
230
202
|
warn("The static-host upload failed \u2014 the backend deploy stands:");
|
|
231
203
|
detail(err instanceof Error ? err.message : String(err));
|
|
@@ -235,12 +207,19 @@ async function runDeployCommand(args) {
|
|
|
235
207
|
process.exitCode = EXIT_STATIC_FAILED;
|
|
236
208
|
}
|
|
237
209
|
};
|
|
238
|
-
const summary =
|
|
210
|
+
const summary = await deployEphemeral(auth, {
|
|
211
|
+
archive,
|
|
212
|
+
bundle,
|
|
213
|
+
source,
|
|
214
|
+
args,
|
|
215
|
+
startedAt,
|
|
216
|
+
publishStatic
|
|
217
|
+
});
|
|
239
218
|
if (staticSummary !== void 0) summary.static = staticSummary;
|
|
240
|
-
if (
|
|
219
|
+
if (summary.created === false && staticSummary?.url !== void 0) {
|
|
241
220
|
detail("This static URL is new \u2014 a re-deploy replaces the environment's hosting, so the previous one no longer serves.");
|
|
242
221
|
}
|
|
243
|
-
if (args.test) summary.testRun = await runDeployedTests(auth,
|
|
222
|
+
if (args.test) summary.testRun = await runDeployedTests(auth, summary, args);
|
|
244
223
|
if (args.open) openDeployed(summary);
|
|
245
224
|
if (isMachineOutput(args)) writeJson(summary);
|
|
246
225
|
}
|
|
@@ -253,17 +232,6 @@ function openDeployed(summary) {
|
|
|
253
232
|
detail(`Opening ${url}`);
|
|
254
233
|
openBrowser(url);
|
|
255
234
|
}
|
|
256
|
-
async function deploySandbox(auth, archive, source, check, startedAt, publishStatic) {
|
|
257
|
-
step(`Deploying ${source} \u2192 sandbox (full replace)`);
|
|
258
|
-
deployTarget(auth);
|
|
259
|
-
const baseUrl = await resolveSandboxBaseUrl(auth);
|
|
260
|
-
await publishStatic?.({ baseUrl, label: void 0 });
|
|
261
|
-
await withSpinner(IMPORTING_LABEL, () => importWorkspaceArchive(auth, { baseUrl, archive }));
|
|
262
|
-
success(`Backend deployed to sandbox${elapsedSuffix(startedAt)}`);
|
|
263
|
-
link(baseUrl);
|
|
264
|
-
const microservices = await verifyMicroservices(auth, baseUrl, check);
|
|
265
|
-
return { dest: "sandbox", url: baseUrl, ...microservices ? { microservices } : {} };
|
|
266
|
-
}
|
|
267
235
|
var WAITING_LABEL = "Waiting for microservices\u2026";
|
|
268
236
|
var IMPORTING_LABEL = "Uploading and importing the workspace\u2026";
|
|
269
237
|
function waitingLabel(microservices) {
|
|
@@ -271,7 +239,7 @@ function waitingLabel(microservices) {
|
|
|
271
239
|
return startable === 0 ? WAITING_LABEL : `${WAITING_LABEL} (${ready}/${startable} ready)`;
|
|
272
240
|
}
|
|
273
241
|
async function verifyMicroservices(auth, baseUrl, opts, waitOpts = {}) {
|
|
274
|
-
if (opts.
|
|
242
|
+
if (opts.skip) return void 0;
|
|
275
243
|
const spin = spinner(WAITING_LABEL);
|
|
276
244
|
let result;
|
|
277
245
|
try {
|
|
@@ -305,7 +273,7 @@ async function verifyMicroservices(auth, baseUrl, opts, waitOpts = {}) {
|
|
|
305
273
|
}
|
|
306
274
|
for (const m of microservices) detail(microserviceLine(m));
|
|
307
275
|
if (timedOut && !hadFailure) {
|
|
308
|
-
detail("Re-check with `xanots ephemeral get <env>`, or skip this wait next time with --
|
|
276
|
+
detail("Re-check with `xanots ephemeral get <env>`, or skip this wait next time with --skip-liveness.");
|
|
309
277
|
if (!opts.requireReady) {
|
|
310
278
|
detail("Fail the deploy on this instead of warning: --require-microservices.");
|
|
311
279
|
}
|
|
@@ -317,9 +285,9 @@ function failDeploy() {
|
|
|
317
285
|
}
|
|
318
286
|
function ephemeralDisabledError(source) {
|
|
319
287
|
return new Error(
|
|
320
|
-
`Ephemeral environments are not enabled on this instance, so
|
|
321
|
-
|
|
322
|
-
|
|
288
|
+
`Ephemeral environments are not enabled on this instance, so there is nothing for \`xanots deploy ${source}\` to create \u2014 they are the only environment it writes to.
|
|
289
|
+
Ask whoever administers the instance to enable them.
|
|
290
|
+
Until then \`xanots export\` still writes the bundle, and \`xanots preflight\` still checks the round-trip, without needing one.`
|
|
323
291
|
);
|
|
324
292
|
}
|
|
325
293
|
async function deployEphemeral(auth, ctx) {
|
|
@@ -392,7 +360,7 @@ async function deployEphemeral(auth, ctx) {
|
|
|
392
360
|
await publishStatic?.({ baseUrl, label: `ephemeral ${target.name}` });
|
|
393
361
|
if (publishStatic !== void 0) {
|
|
394
362
|
detail(
|
|
395
|
-
"The frontend URL changes on every
|
|
363
|
+
"The frontend URL changes on every deploy (the import clears static hosting) and the replace re-seeds the environment \u2014 bookmarks and shared links from the previous run stop serving."
|
|
396
364
|
);
|
|
397
365
|
}
|
|
398
366
|
const microservices = await verifyMicroservices(auth, baseUrl, microserviceCheck(args));
|
|
@@ -404,8 +372,8 @@ async function deployEphemeral(auth, ctx) {
|
|
|
404
372
|
...microservices ? { microservices } : {}
|
|
405
373
|
};
|
|
406
374
|
}
|
|
407
|
-
async function deployStaticTo(dir, auth, target, env, explicit, host,
|
|
408
|
-
const { deployStaticHost } = await import("./static-host-
|
|
375
|
+
async function deployStaticTo(dir, auth, target, env, explicit, host, skipLiveness, routing) {
|
|
376
|
+
const { deployStaticHost } = await import("./static-host-3WMV7IZO.js");
|
|
409
377
|
const where = target.label && target.label !== "" ? target.label : `workspace #${target.workspaceId}`;
|
|
410
378
|
step(`Deploying static frontend ${dir} \u2192 ${where}${host ? ` (host: ${host})` : ""}`);
|
|
411
379
|
const sh = await deployStaticHost({ host, dir, workspaceId: target.workspaceId, baseUrl: target.baseUrl, accessToken: auth.access_token, env, routing });
|
|
@@ -424,7 +392,7 @@ async function deployStaticTo(dir, auth, target, env, explicit, host, noVerify,
|
|
|
424
392
|
}
|
|
425
393
|
success("Static host deployed");
|
|
426
394
|
if (sh.url) link(sh.url);
|
|
427
|
-
if (
|
|
395
|
+
if (skipLiveness || sh.url === void 0 || sh.canonical === void 0) {
|
|
428
396
|
return { url: sh.url };
|
|
429
397
|
}
|
|
430
398
|
const { verifyRollout } = await import("./verify-rollout-FAVQ6EJY.js");
|
|
@@ -434,7 +402,7 @@ async function deployStaticTo(dir, auth, target, env, explicit, host, noVerify,
|
|
|
434
402
|
success("Frontend is live");
|
|
435
403
|
} else {
|
|
436
404
|
warn("Could not confirm the frontend is live within the wait window \u2014 the build uploaded and should come online shortly.");
|
|
437
|
-
detail(`Re-check by opening ${sh.url}, or skip this wait next time with --
|
|
405
|
+
detail(`Re-check by opening ${sh.url}, or skip this wait next time with --skip-liveness.`);
|
|
438
406
|
}
|
|
439
407
|
return { url: sh.url, verified: live };
|
|
440
408
|
}
|
|
@@ -448,4 +416,4 @@ export {
|
|
|
448
416
|
runDeployedTests,
|
|
449
417
|
verifyMicroservices
|
|
450
418
|
};
|
|
451
|
-
//# sourceMappingURL=deploy-command-
|
|
419
|
+
//# sourceMappingURL=deploy-command-QTIVA22A.js.map
|