@lumerahq/cli 0.30.9-dev.0 → 0.30.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/dist/{chunk-LDDGLPAZ.js → chunk-ROARJJVX.js} +5 -3
- package/dist/{functions-NE5PVRQU.js → functions-G37WQWTG.js} +1 -1
- package/dist/index.js +9 -9
- package/dist/{project-M4PV6OBO.js → project-GAVODH6S.js} +42 -6
- package/dist/{resources-QEJY42RO.js → resources-TZD6KV4M.js} +2 -67
- package/package.json +1 -1
- package/templates/default/package.json +1 -1
- package/templates/default/pnpm-lock.yaml +5 -5
- package/templates/default/pyproject.toml +1 -1
|
@@ -5,9 +5,11 @@ import { join, resolve } from "path";
|
|
|
5
5
|
import pc from "picocolors";
|
|
6
6
|
|
|
7
7
|
// src/lib/functions-sdk.ts
|
|
8
|
-
var FUNCTIONS_SDK_VERSION_RANGE = ">=0.
|
|
9
|
-
var
|
|
10
|
-
var
|
|
8
|
+
var FUNCTIONS_SDK_VERSION_RANGE = ">=0.36.2,<0.37.0";
|
|
9
|
+
var FUNCTIONS_SDK_COMPATIBILITY_RANGE = ">=0.34.0,<0.37.0";
|
|
10
|
+
var FUNCTIONS_SDK_REQUIREMENT = `lumera[functions]${FUNCTIONS_SDK_COMPATIBILITY_RANGE}`;
|
|
11
|
+
var DEFAULT_FUNCTIONS_SDK_REQUIREMENT = `lumera[functions]${FUNCTIONS_SDK_VERSION_RANGE}`;
|
|
12
|
+
var RELEASE_SDK_REQUIREMENT = `lumera[release]${FUNCTIONS_SDK_COMPATIBILITY_RANGE}`;
|
|
11
13
|
|
|
12
14
|
// src/commands/functions.ts
|
|
13
15
|
var SUPPORTED_SUBCOMMANDS = /* @__PURE__ */ new Set(["list", "inspect", "invoke", "test"]);
|
package/dist/index.js
CHANGED
|
@@ -240,25 +240,25 @@ async function main() {
|
|
|
240
240
|
switch (command) {
|
|
241
241
|
// Resource commands
|
|
242
242
|
case "plan":
|
|
243
|
-
await import("./resources-
|
|
243
|
+
await import("./resources-TZD6KV4M.js").then((m) => m.plan(args.slice(1)));
|
|
244
244
|
break;
|
|
245
245
|
case "apply":
|
|
246
|
-
await import("./resources-
|
|
246
|
+
await import("./resources-TZD6KV4M.js").then((m) => m.apply(args.slice(1)));
|
|
247
247
|
break;
|
|
248
248
|
case "pull":
|
|
249
|
-
await import("./resources-
|
|
249
|
+
await import("./resources-TZD6KV4M.js").then((m) => m.pull(args.slice(1)));
|
|
250
250
|
break;
|
|
251
251
|
case "destroy":
|
|
252
|
-
await import("./resources-
|
|
252
|
+
await import("./resources-TZD6KV4M.js").then((m) => m.destroy(args.slice(1)));
|
|
253
253
|
break;
|
|
254
254
|
case "list":
|
|
255
|
-
await import("./resources-
|
|
255
|
+
await import("./resources-TZD6KV4M.js").then((m) => m.list(args.slice(1)));
|
|
256
256
|
break;
|
|
257
257
|
case "show":
|
|
258
|
-
await import("./resources-
|
|
258
|
+
await import("./resources-TZD6KV4M.js").then((m) => m.show(args.slice(1)));
|
|
259
259
|
break;
|
|
260
260
|
case "diff":
|
|
261
|
-
await import("./resources-
|
|
261
|
+
await import("./resources-TZD6KV4M.js").then((m) => m.diff(args.slice(1)));
|
|
262
262
|
break;
|
|
263
263
|
// Development
|
|
264
264
|
case "dev":
|
|
@@ -268,12 +268,12 @@ async function main() {
|
|
|
268
268
|
await import("./run-EBTA3FKD.js").then((m) => m.run(args.slice(1)));
|
|
269
269
|
break;
|
|
270
270
|
case "functions":
|
|
271
|
-
await import("./functions-
|
|
271
|
+
await import("./functions-G37WQWTG.js").then(
|
|
272
272
|
(m) => m.functions(subcommand, args.slice(2))
|
|
273
273
|
);
|
|
274
274
|
break;
|
|
275
275
|
case "project":
|
|
276
|
-
await import("./project-
|
|
276
|
+
await import("./project-GAVODH6S.js").then(
|
|
277
277
|
(m) => m.project(subcommand, args.slice(2))
|
|
278
278
|
);
|
|
279
279
|
break;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RELEASE_SDK_REQUIREMENT,
|
|
3
3
|
findFunctionsProjectRoot
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ROARJJVX.js";
|
|
5
5
|
import "./chunk-PNKVD2UK.js";
|
|
6
6
|
|
|
7
7
|
// src/commands/project.ts
|
|
8
8
|
import { spawn } from "child_process";
|
|
9
|
+
import { mkdirSync } from "fs";
|
|
10
|
+
import { join } from "path";
|
|
9
11
|
import pc from "picocolors";
|
|
10
12
|
var RELEASE_PROTOCOL_VERSION = 1;
|
|
11
13
|
var RELEASE_COMMANDS = /* @__PURE__ */ new Set([
|
|
@@ -15,6 +17,32 @@ var RELEASE_COMMANDS = /* @__PURE__ */ new Set([
|
|
|
15
17
|
"deploy",
|
|
16
18
|
"deploy-runtime"
|
|
17
19
|
]);
|
|
20
|
+
function releaseCommandOutput(command, args, result) {
|
|
21
|
+
if (command !== "deploy" || !result.envelope.ok || result.envelope.activation_required === true) {
|
|
22
|
+
return result.raw;
|
|
23
|
+
}
|
|
24
|
+
const deployment = result.envelope.deployment;
|
|
25
|
+
const release = typeof deployment === "object" && deployment !== null ? deployment.release : void 0;
|
|
26
|
+
const releaseId = typeof release === "object" && release !== null ? String(release.id ?? "") : "";
|
|
27
|
+
const projectIndex = args.indexOf("--project");
|
|
28
|
+
const projectRef = projectIndex >= 0 ? String(args[projectIndex + 1] ?? "") : "";
|
|
29
|
+
if (!releaseId || !projectRef) return result.raw;
|
|
30
|
+
return `${JSON.stringify({
|
|
31
|
+
...result.envelope,
|
|
32
|
+
activation_required: true,
|
|
33
|
+
message: "Release uploaded but inactive; deploy it before invoking Functions.",
|
|
34
|
+
next_command: [
|
|
35
|
+
"lumera",
|
|
36
|
+
"project",
|
|
37
|
+
"release",
|
|
38
|
+
"deploy-runtime",
|
|
39
|
+
releaseId,
|
|
40
|
+
"--project",
|
|
41
|
+
projectRef
|
|
42
|
+
]
|
|
43
|
+
})}
|
|
44
|
+
`;
|
|
45
|
+
}
|
|
18
46
|
function showHelp() {
|
|
19
47
|
console.log(`
|
|
20
48
|
${pc.dim("Usage:")}
|
|
@@ -26,7 +54,8 @@ ${pc.dim("Usage:")}
|
|
|
26
54
|
|
|
27
55
|
${pc.dim("Description:")}
|
|
28
56
|
Build, verify, and contract-test immutable Python 3.13/Linux/ARM64 project
|
|
29
|
-
releases
|
|
57
|
+
releases. The deploy command uploads an inactive resource and reports the
|
|
58
|
+
required deploy-runtime command that activates it.
|
|
30
59
|
`);
|
|
31
60
|
}
|
|
32
61
|
function buildReleaseRunnerArgs(command, args, projectRoot) {
|
|
@@ -47,11 +76,17 @@ function buildReleaseRunnerArgs(command, args, projectRoot) {
|
|
|
47
76
|
...args
|
|
48
77
|
];
|
|
49
78
|
}
|
|
50
|
-
async function runReleaseRunner(runnerArgs, projectRoot, spawnRunner = (command, args, options) => spawn(command, args, options)) {
|
|
79
|
+
async function runReleaseRunner(runnerArgs, projectRoot, releaseCommand, spawnRunner = (command, args, options) => spawn(command, args, options)) {
|
|
80
|
+
let runnerEnvironment = process.env;
|
|
81
|
+
if (releaseCommand === "build") {
|
|
82
|
+
const releaseTempRoot = join(projectRoot, ".lumera", "tmp");
|
|
83
|
+
mkdirSync(releaseTempRoot, { recursive: true, mode: 448 });
|
|
84
|
+
runnerEnvironment = { ...process.env, TMPDIR: releaseTempRoot };
|
|
85
|
+
}
|
|
51
86
|
return await new Promise((resolvePromise, reject) => {
|
|
52
87
|
const child = spawnRunner("uv", runnerArgs, {
|
|
53
88
|
cwd: projectRoot,
|
|
54
|
-
env:
|
|
89
|
+
env: runnerEnvironment,
|
|
55
90
|
shell: false,
|
|
56
91
|
stdio: ["inherit", "pipe", "inherit"]
|
|
57
92
|
});
|
|
@@ -95,9 +130,10 @@ async function project(subcommand, args, dependencies = {}) {
|
|
|
95
130
|
const projectRoot = findProjectRoot();
|
|
96
131
|
const result = await runRunner(
|
|
97
132
|
buildReleaseRunnerArgs(releaseCommand, releaseArgs, projectRoot),
|
|
98
|
-
projectRoot
|
|
133
|
+
projectRoot,
|
|
134
|
+
releaseCommand
|
|
99
135
|
);
|
|
100
|
-
writeOutput(result
|
|
136
|
+
writeOutput(releaseCommandOutput(releaseCommand, releaseArgs, result));
|
|
101
137
|
if (result.code !== 0) process.exitCode = result.code;
|
|
102
138
|
} catch (error) {
|
|
103
139
|
writeOutput(
|
|
@@ -284,20 +284,6 @@ var automationMainGuardRule = {
|
|
|
284
284
|
function isRecord3(value) {
|
|
285
285
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
286
286
|
}
|
|
287
|
-
var fileFieldTypes = /* @__PURE__ */ new Set(["file", "lumera_file"]);
|
|
288
|
-
var fileFieldKeys = /* @__PURE__ */ new Set([
|
|
289
|
-
"name",
|
|
290
|
-
"type",
|
|
291
|
-
"required",
|
|
292
|
-
"default",
|
|
293
|
-
"maxSelect",
|
|
294
|
-
"maxSize",
|
|
295
|
-
"mimeTypes",
|
|
296
|
-
"protected",
|
|
297
|
-
// Recognized below only to return a specific migration error.
|
|
298
|
-
"multiple",
|
|
299
|
-
"options"
|
|
300
|
-
]);
|
|
301
287
|
function error(target, message, snippet) {
|
|
302
288
|
return {
|
|
303
289
|
ruleId: "collection-schema",
|
|
@@ -366,32 +352,6 @@ var collectionSchemaRule = {
|
|
|
366
352
|
if (typeof field.type !== "string" || field.type.trim() === "") {
|
|
367
353
|
issues.push(error(target, `Field ${typeof field.name === "string" ? `"${field.name}"` : `at index ${i}`} is missing required string field "type".`));
|
|
368
354
|
}
|
|
369
|
-
const fieldLabel = typeof field.name === "string" ? `"${field.name}"` : `at index ${i}`;
|
|
370
|
-
if (field.options !== void 0) {
|
|
371
|
-
issues.push(error(target, `Field ${fieldLabel} must use flat option keys; nested "options" is only valid in pb.ensure_collection().`));
|
|
372
|
-
}
|
|
373
|
-
if (fileFieldTypes.has(field.type)) {
|
|
374
|
-
for (const key of Object.keys(field)) {
|
|
375
|
-
if (!fileFieldKeys.has(key)) {
|
|
376
|
-
issues.push(error(target, `Unknown file field option "${key}" on field ${fieldLabel}.`));
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
if (field.multiple !== void 0) {
|
|
380
|
-
issues.push(error(target, `File field ${fieldLabel} must use "maxSelect" instead of "multiple".`));
|
|
381
|
-
}
|
|
382
|
-
if (field.maxSelect !== void 0 && (typeof field.maxSelect !== "number" || !Number.isInteger(field.maxSelect) || field.maxSelect < 1)) {
|
|
383
|
-
issues.push(error(target, `File field ${fieldLabel} option "maxSelect" must be an integer greater than or equal to 1.`));
|
|
384
|
-
}
|
|
385
|
-
if (field.maxSize !== void 0 && (typeof field.maxSize !== "number" || !Number.isInteger(field.maxSize) || field.maxSize < 0)) {
|
|
386
|
-
issues.push(error(target, `File field ${fieldLabel} option "maxSize" must be an integer greater than or equal to 0.`));
|
|
387
|
-
}
|
|
388
|
-
if (field.mimeTypes !== void 0 && (!Array.isArray(field.mimeTypes) || !field.mimeTypes.every((mimeType) => typeof mimeType === "string" && mimeType.trim() !== ""))) {
|
|
389
|
-
issues.push(error(target, `File field ${fieldLabel} option "mimeTypes" must be an array of non-empty strings.`));
|
|
390
|
-
}
|
|
391
|
-
if (field.protected !== void 0 && typeof field.protected !== "boolean") {
|
|
392
|
-
issues.push(error(target, `File field ${fieldLabel} option "protected" must be a boolean.`));
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
355
|
}
|
|
396
356
|
}
|
|
397
357
|
if (audit !== void 0 && typeof audit !== "boolean") {
|
|
@@ -1864,12 +1824,6 @@ function convertCollectionToApiFormat(local, appName) {
|
|
|
1864
1824
|
options.decimalPrecision = field.decimalPrecision;
|
|
1865
1825
|
}
|
|
1866
1826
|
}
|
|
1867
|
-
if (field.type === "file" || field.type === "lumera_file") {
|
|
1868
|
-
if (field.maxSelect !== void 0) options.maxSelect = field.maxSelect;
|
|
1869
|
-
if (field.maxSize !== void 0) options.maxSize = field.maxSize;
|
|
1870
|
-
if (field.mimeTypes !== void 0) options.mimeTypes = field.mimeTypes;
|
|
1871
|
-
if (field.protected !== void 0) options.protected = field.protected;
|
|
1872
|
-
}
|
|
1873
1827
|
if (field.max !== void 0) options.max = field.max;
|
|
1874
1828
|
if (field.min !== void 0) options.min = field.min;
|
|
1875
1829
|
if (Object.keys(options).length > 0) {
|
|
@@ -1942,14 +1896,6 @@ function fieldsDiffer(local, remote) {
|
|
|
1942
1896
|
const remoteDecimalPrecision = opts.decimalPrecision !== void 0 ? opts.decimalPrecision : 2;
|
|
1943
1897
|
if (localDecimalPrecision !== remoteDecimalPrecision) return true;
|
|
1944
1898
|
}
|
|
1945
|
-
if (local.type === "file" || local.type === "lumera_file") {
|
|
1946
|
-
if ((local.maxSelect ?? 1) !== (opts.maxSelect ?? 1)) return true;
|
|
1947
|
-
if ((local.maxSize ?? 0) !== (opts.maxSize ?? 0)) return true;
|
|
1948
|
-
const localMimeTypes = [...local.mimeTypes ?? []].sort();
|
|
1949
|
-
const remoteMimeTypes = [...opts.mimeTypes ?? []].sort();
|
|
1950
|
-
if (JSON.stringify(localMimeTypes) !== JSON.stringify(remoteMimeTypes)) return true;
|
|
1951
|
-
if ((local.protected ?? false) !== (opts.protected ?? false)) return true;
|
|
1952
|
-
}
|
|
1953
1899
|
const localMin = normalizeConstraintValue(local.type, local.min);
|
|
1954
1900
|
const remoteMin = normalizeConstraintValue(local.type, opts.min);
|
|
1955
1901
|
if (localMin !== remoteMin) return true;
|
|
@@ -2578,24 +2524,13 @@ async function pullCollections(api, platformDir, filterName, projectId) {
|
|
|
2578
2524
|
fields: collection.schema.map((field) => {
|
|
2579
2525
|
const localField = {
|
|
2580
2526
|
name: field.name,
|
|
2581
|
-
type: field.type
|
|
2527
|
+
type: field.type,
|
|
2582
2528
|
required: field.required
|
|
2583
2529
|
};
|
|
2584
2530
|
if (field.options) {
|
|
2585
2531
|
if (field.options.values) localField.values = field.options.values;
|
|
2586
2532
|
if (field.options.collectionId) localField.collection = field.options.collectionId;
|
|
2587
|
-
if (
|
|
2588
|
-
localField.multiple = true;
|
|
2589
|
-
}
|
|
2590
|
-
if (field.type === "lumera_file") {
|
|
2591
|
-
const maxSelect = field.options.maxSelect ?? 1;
|
|
2592
|
-
const maxSize = field.options.maxSize ?? 0;
|
|
2593
|
-
const mimeTypes = field.options.mimeTypes ?? [];
|
|
2594
|
-
if (maxSelect !== 1) localField.maxSelect = maxSelect;
|
|
2595
|
-
if (maxSize !== 0) localField.maxSize = maxSize;
|
|
2596
|
-
if (mimeTypes.length > 0) localField.mimeTypes = mimeTypes;
|
|
2597
|
-
if (field.options.protected === true) localField.protected = true;
|
|
2598
|
-
}
|
|
2533
|
+
if (field.options.maxSelect && field.options.maxSelect > 1) localField.multiple = true;
|
|
2599
2534
|
if (field.options.defaultCurrency) {
|
|
2600
2535
|
localField.defaultCurrency = field.options.defaultCurrency;
|
|
2601
2536
|
}
|
package/package.json
CHANGED
|
@@ -12,8 +12,8 @@ importers:
|
|
|
12
12
|
.:
|
|
13
13
|
dependencies:
|
|
14
14
|
'@lumerahq/ui':
|
|
15
|
-
specifier: ^0.
|
|
16
|
-
version: 0.
|
|
15
|
+
specifier: ^0.19.1
|
|
16
|
+
version: 0.19.1(@types/react@19.2.16)(react-dom@19.2.7(react@19.2.7))(react@19.2.7)
|
|
17
17
|
'@tanstack/react-query':
|
|
18
18
|
specifier: ^5.90.11
|
|
19
19
|
version: 5.101.0(react@19.2.7)
|
|
@@ -457,8 +457,8 @@ packages:
|
|
|
457
457
|
'@jridgewell/trace-mapping@0.3.31':
|
|
458
458
|
resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==}
|
|
459
459
|
|
|
460
|
-
'@lumerahq/ui@0.
|
|
461
|
-
resolution: {integrity: sha512-
|
|
460
|
+
'@lumerahq/ui@0.19.1':
|
|
461
|
+
resolution: {integrity: sha512-2JwZJIzTrYnSTYPnfvlY1I+Up99gcCM5H/uWYtIB98WX1Sh4KNaZhS43Ex9iDlJJzoZCrMFweKq3vDjwFMx8tA==}
|
|
462
462
|
peerDependencies:
|
|
463
463
|
react: ^18.0.0 || ^19.0.0
|
|
464
464
|
react-dom: ^18.0.0 || ^19.0.0
|
|
@@ -2311,7 +2311,7 @@ snapshots:
|
|
|
2311
2311
|
'@jridgewell/resolve-uri': 3.1.2
|
|
2312
2312
|
'@jridgewell/sourcemap-codec': 1.5.5
|
|
2313
2313
|
|
|
2314
|
-
'@lumerahq/ui@0.
|
|
2314
|
+
'@lumerahq/ui@0.19.1(@types/react@19.2.16)(react-dom@19.2.7(react@19.2.7))(react@19.2.7)':
|
|
2315
2315
|
dependencies:
|
|
2316
2316
|
'@base-ui/react': 1.5.0(@types/react@19.2.16)(react-dom@19.2.7(react@19.2.7))(react@19.2.7)
|
|
2317
2317
|
'@tanstack/react-query': 5.101.0(react@19.2.7)
|