@penvhq/cli 0.3.2 → 0.4.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/index.d.cts CHANGED
@@ -97,6 +97,12 @@ declare function runDecrypt(options: ResealOptions): Promise<ResealResult>;
97
97
  * A value is never invented: a blank answer skips the parameter, because the
98
98
  * silent value reaching runtime is the failure penv exists to delete, and a
99
99
  * placeholder written here is exactly that value by a friendlier route.
100
+ *
101
+ * Optional parameters — `.optional()`, `.default()` — are asked too, after the
102
+ * required gaps, tagged so the reader knows an answer is an override and Enter
103
+ * keeps what the schema declared. Skipping them silently was the old behavior,
104
+ * and it hid a real choice: a schema default reaching runtime is legal, but the
105
+ * user who never heard the question never chose it.
100
106
  */
101
107
  /** One question `fill` puts to the user: which parameter, in which environment. */
102
108
  interface FillPrompt {
@@ -108,6 +114,14 @@ interface FillPrompt {
108
114
  * v1 does not, and the drift carries no meta, so this is `false` today.
109
115
  */
110
116
  readonly secret: boolean;
117
+ /**
118
+ * Whether the schema excuses absence — `.optional()`, `.default()`. An answer
119
+ * writes an override; a blank one leaves the schema's own behavior in place,
120
+ * which is a kept default rather than a lingering gap.
121
+ */
122
+ readonly optional: boolean;
123
+ /** What the schema falls back to, rendered for display, when it declares one penv can read. */
124
+ readonly defaultValue?: string;
111
125
  readonly description?: string;
112
126
  }
113
127
  interface FillOptions {
@@ -131,6 +145,12 @@ interface FillResult {
131
145
  }>;
132
146
  /** The parameters a blank answer left for later — never written as an empty value. */
133
147
  readonly skipped: readonly string[];
148
+ /**
149
+ * The optional parameters a blank answer left to the schema. Not `skipped`:
150
+ * a skipped parameter is still a gap, and one of these is a decision — the
151
+ * schema's default (or declared absence) is the value, on purpose.
152
+ */
153
+ readonly kept: readonly string[];
134
154
  /**
135
155
  * The declared keys no filename reaches (`apiURL`, a reserved token). `fill`
136
156
  * cannot ask for a value it could never write, so it carries the rename remedy
@@ -335,14 +355,34 @@ interface UndeclaredDrift {
335
355
  /** The generated variable, which is the name the application would have read. */
336
356
  readonly variable: string;
337
357
  }
358
+ /**
359
+ * A parameter the schema declares but does not require — `.optional()`,
360
+ * `.default()`, and their kin — that the tree has no value for. Not drift in the
361
+ * verdict sense: absence here is a state the schema itself blessed, so `doctor`
362
+ * and `watch` say nothing about it. It is measured for `fill`, whose reader is
363
+ * deciding what to write, and for whom "the schema would take an override here"
364
+ * is exactly the kind of fact a silent skip would hide.
365
+ */
366
+ interface OptionalDrift {
367
+ /** The parameter id, or the dotted schema path when no filename could reach it. */
368
+ readonly subject: string;
369
+ /** Absent when no filename reaches this key — an override `penv set` cannot write. */
370
+ readonly ref?: ParameterRef;
371
+ /** What the schema falls back to, rendered for display, when it declares one this module can read. */
372
+ readonly defaultValue?: string;
373
+ /** The rename that must precede any override, for the key no filename reaches. */
374
+ readonly remedy: string;
375
+ }
338
376
  /**
339
377
  * The distance between `.penv/env.ts` and the tree, in both directions. Named
340
378
  * `declared`/`undeclared` for the side that has it, not for a verdict: neither
341
- * direction is by itself an error, and only `validate` decides that.
379
+ * direction is by itself an error, and only `validate` decides that. `optional`
380
+ * is the deliberately verdict-free third list — see {@link OptionalDrift}.
342
381
  */
343
382
  interface DriftReport {
344
383
  readonly declared: readonly DeclaredDrift[];
345
384
  readonly undeclared: readonly UndeclaredDrift[];
385
+ readonly optional: readonly OptionalDrift[];
346
386
  }
347
387
 
348
388
  type ValidateIssueKind = "config" | "reserved" | "collision" | "schema" | "undecryptable";
package/dist/index.d.ts CHANGED
@@ -97,6 +97,12 @@ declare function runDecrypt(options: ResealOptions): Promise<ResealResult>;
97
97
  * A value is never invented: a blank answer skips the parameter, because the
98
98
  * silent value reaching runtime is the failure penv exists to delete, and a
99
99
  * placeholder written here is exactly that value by a friendlier route.
100
+ *
101
+ * Optional parameters — `.optional()`, `.default()` — are asked too, after the
102
+ * required gaps, tagged so the reader knows an answer is an override and Enter
103
+ * keeps what the schema declared. Skipping them silently was the old behavior,
104
+ * and it hid a real choice: a schema default reaching runtime is legal, but the
105
+ * user who never heard the question never chose it.
100
106
  */
101
107
  /** One question `fill` puts to the user: which parameter, in which environment. */
102
108
  interface FillPrompt {
@@ -108,6 +114,14 @@ interface FillPrompt {
108
114
  * v1 does not, and the drift carries no meta, so this is `false` today.
109
115
  */
110
116
  readonly secret: boolean;
117
+ /**
118
+ * Whether the schema excuses absence — `.optional()`, `.default()`. An answer
119
+ * writes an override; a blank one leaves the schema's own behavior in place,
120
+ * which is a kept default rather than a lingering gap.
121
+ */
122
+ readonly optional: boolean;
123
+ /** What the schema falls back to, rendered for display, when it declares one penv can read. */
124
+ readonly defaultValue?: string;
111
125
  readonly description?: string;
112
126
  }
113
127
  interface FillOptions {
@@ -131,6 +145,12 @@ interface FillResult {
131
145
  }>;
132
146
  /** The parameters a blank answer left for later — never written as an empty value. */
133
147
  readonly skipped: readonly string[];
148
+ /**
149
+ * The optional parameters a blank answer left to the schema. Not `skipped`:
150
+ * a skipped parameter is still a gap, and one of these is a decision — the
151
+ * schema's default (or declared absence) is the value, on purpose.
152
+ */
153
+ readonly kept: readonly string[];
134
154
  /**
135
155
  * The declared keys no filename reaches (`apiURL`, a reserved token). `fill`
136
156
  * cannot ask for a value it could never write, so it carries the rename remedy
@@ -335,14 +355,34 @@ interface UndeclaredDrift {
335
355
  /** The generated variable, which is the name the application would have read. */
336
356
  readonly variable: string;
337
357
  }
358
+ /**
359
+ * A parameter the schema declares but does not require — `.optional()`,
360
+ * `.default()`, and their kin — that the tree has no value for. Not drift in the
361
+ * verdict sense: absence here is a state the schema itself blessed, so `doctor`
362
+ * and `watch` say nothing about it. It is measured for `fill`, whose reader is
363
+ * deciding what to write, and for whom "the schema would take an override here"
364
+ * is exactly the kind of fact a silent skip would hide.
365
+ */
366
+ interface OptionalDrift {
367
+ /** The parameter id, or the dotted schema path when no filename could reach it. */
368
+ readonly subject: string;
369
+ /** Absent when no filename reaches this key — an override `penv set` cannot write. */
370
+ readonly ref?: ParameterRef;
371
+ /** What the schema falls back to, rendered for display, when it declares one this module can read. */
372
+ readonly defaultValue?: string;
373
+ /** The rename that must precede any override, for the key no filename reaches. */
374
+ readonly remedy: string;
375
+ }
338
376
  /**
339
377
  * The distance between `.penv/env.ts` and the tree, in both directions. Named
340
378
  * `declared`/`undeclared` for the side that has it, not for a verdict: neither
341
- * direction is by itself an error, and only `validate` decides that.
379
+ * direction is by itself an error, and only `validate` decides that. `optional`
380
+ * is the deliberately verdict-free third list — see {@link OptionalDrift}.
342
381
  */
343
382
  interface DriftReport {
344
383
  readonly declared: readonly DeclaredDrift[];
345
384
  readonly undeclared: readonly UndeclaredDrift[];
385
+ readonly optional: readonly OptionalDrift[];
346
386
  }
347
387
 
348
388
  type ValidateIssueKind = "config" | "reserved" | "collision" | "schema" | "undecryptable";