@lumerahq/cli 0.30.9 → 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.
@@ -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.34.0,<0.35.0";
9
- var FUNCTIONS_SDK_REQUIREMENT = `lumera[functions]${FUNCTIONS_SDK_VERSION_RANGE}`;
10
- var RELEASE_SDK_REQUIREMENT = `lumera[release]${FUNCTIONS_SDK_VERSION_RANGE}`;
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"]);
@@ -4,7 +4,7 @@ import {
4
4
  findFunctionsProjectRoot,
5
5
  functions,
6
6
  runFunctionRunner
7
- } from "./chunk-LDDGLPAZ.js";
7
+ } from "./chunk-ROARJJVX.js";
8
8
  import "./chunk-PNKVD2UK.js";
9
9
  export {
10
10
  buildFunctionRunnerArgs,
package/dist/index.js CHANGED
@@ -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-NE5PVRQU.js").then(
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-M4PV6OBO.js").then(
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-LDDGLPAZ.js";
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, upload an inactive resource, and deploy it to the project's runtime.
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: process.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.raw);
136
+ writeOutput(releaseCommandOutput(releaseCommand, releaseArgs, result));
101
137
  if (result.code !== 0) process.exitCode = result.code;
102
138
  } catch (error) {
103
139
  writeOutput(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumerahq/cli",
3
- "version": "0.30.9",
3
+ "version": "0.30.10",
4
4
  "description": "CLI for building and deploying Lumera apps",
5
5
  "type": "module",
6
6
  "engines": {
@@ -4,7 +4,7 @@ version = "0.1.0"
4
4
  description = "{{projectTitle}} - Lumera custom app"
5
5
  requires-python = ">=3.11"
6
6
  dependencies = [
7
- "lumera[functions]>=0.34.0,<0.35.0",
7
+ "lumera[functions]>=0.36.2,<0.37.0",
8
8
  ]
9
9
 
10
10
  [project.optional-dependencies]