@jskit-ai/jskit-cli 0.2.145 → 0.2.146

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/jskit-cli",
3
- "version": "0.2.145",
3
+ "version": "0.2.146",
4
4
  "description": "Bundle and package orchestration CLI for JSKIT apps.",
5
5
  "type": "module",
6
6
  "files": [
@@ -21,9 +21,9 @@
21
21
  "test": "node --test"
22
22
  },
23
23
  "dependencies": {
24
- "@jskit-ai/jskit-catalog": "0.1.139",
25
- "@jskit-ai/kernel": "0.1.125",
26
- "@jskit-ai/shell-web": "0.1.126",
24
+ "@jskit-ai/jskit-catalog": "0.1.140",
25
+ "@jskit-ai/kernel": "0.1.126",
26
+ "@jskit-ai/shell-web": "0.1.127",
27
27
  "@vue/compiler-sfc": "^3.5.29",
28
28
  "ts-morph": "^28.0.0",
29
29
  "yaml": "^2.8.3"
@@ -1,4 +1,5 @@
1
1
  import path from "node:path";
2
+ import process from "node:process";
2
3
  import {
3
4
  ensureArray,
4
5
  ensureObject
@@ -154,13 +155,15 @@ async function resolveSensitiveOptionEnvFallbacks({
154
155
  packageEntry = {},
155
156
  appRoot = "",
156
157
  optionInput = {},
157
- readFileBufferIfExists
158
+ readFileBufferIfExists,
159
+ environment = process.env
158
160
  } = {}) {
159
161
  if (!appRoot || typeof readFileBufferIfExists !== "function") {
160
162
  return {};
161
163
  }
162
164
 
163
165
  const fallbacks = {};
166
+ const runtimeEnvironment = ensureObject(environment);
164
167
  const runtimeOptions = ensureObject(optionInput);
165
168
  const optionSchemas = ensureObject(packageEntry?.descriptor?.options);
166
169
  const textMutations = ensureArray(ensureObject(packageEntry?.descriptor?.mutations).text);
@@ -204,13 +207,21 @@ async function resolveSensitiveOptionEnvFallbacks({
204
207
  continue;
205
208
  }
206
209
 
210
+ const optionSchema = ensureObject(optionSchemas[optionName]);
211
+ const environmentValue = Object.prototype.hasOwnProperty.call(runtimeEnvironment, resolvedKey)
212
+ ? String(runtimeEnvironment[resolvedKey] ?? "")
213
+ : null;
214
+ if (environmentValue !== null && (environmentValue || optionSchema.allowEmpty === true)) {
215
+ fallbacks[optionName] = environmentValue;
216
+ continue;
217
+ }
218
+
207
219
  const existing = await readFileBufferIfExists(path.join(appRoot, relativeFile));
208
220
  if (!existing.exists) {
209
221
  continue;
210
222
  }
211
223
 
212
224
  const envValue = readEnvValue(existing.buffer.toString("utf8"), resolvedKey);
213
- const optionSchema = ensureObject(optionSchemas[optionName]);
214
225
  if (envValue !== null && (envValue || optionSchema.allowEmpty === true)) {
215
226
  fallbacks[optionName] = envValue;
216
227
  }
@@ -538,7 +538,7 @@ const COMMAND_DESCRIPTORS = Object.freeze({
538
538
  defaults: Object.freeze([
539
539
  "No npm install runs unless --run-npm-install is passed.",
540
540
  "Existing non-secret lock options are reused unless overridden inline.",
541
- "Secret options are read from current .env values or explicit inline options; they are not stored in the lock.",
541
+ "Secret options are read from the process environment, current .env values, or explicit inline options; they are not stored in the lock.",
542
542
  "update reuses add package flow with forced reapply."
543
543
  ]),
544
544
  fullUse: "jskit update package <packageId> [--<option> <value>...] [--dry-run] [--run-npm-install] [--json]",