@penvhq/cli 0.9.3 → 0.9.5
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/bin.cjs +515 -186
- package/dist/bin.cjs.map +1 -1
- package/dist/index.cjs +436 -179
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +39 -12
- package/dist/index.d.ts +39 -12
- package/dist/index.js +425 -150
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.d.cts
CHANGED
|
@@ -57,7 +57,7 @@ declare function renderArtifactBuild(result: ArtifactBuildResult, cwd: string):
|
|
|
57
57
|
* second kind.
|
|
58
58
|
*/
|
|
59
59
|
type DoctorSeverity = "pass" | "warning" | "failure" | "unknown";
|
|
60
|
-
type DoctorCheck = "schema" | "missing" | "declared" | "weak" | "unused" | "unscoped-fallback" | "plaintext-secret" | "public-secret" | "encryption" | "rotation-overdue" | "rotation-stuck" | "provider-value-drift" | "provider" | "projection-unreachable" | "projection-name-drift" | "projection-manual-edit" | "projection-value-drift" | "environment-flag-shadow" | "artifact-in-tree";
|
|
60
|
+
type DoctorCheck = "schema" | "missing" | "declared" | "weak" | "unused" | "unscoped-fallback" | "secrecy-undeclared" | "plaintext-secret" | "public-secret" | "encryption" | "rotation-overdue" | "rotation-stuck" | "provider-value-drift" | "provider" | "projection-unreachable" | "projection-name-drift" | "projection-manual-edit" | "projection-value-drift" | "environment-flag-shadow" | "local-extension" | "artifact-in-tree";
|
|
61
61
|
interface DoctorFinding {
|
|
62
62
|
readonly check: DoctorCheck;
|
|
63
63
|
readonly severity: DoctorSeverity;
|
|
@@ -414,13 +414,19 @@ interface DraftField extends SchemaField {
|
|
|
414
414
|
}
|
|
415
415
|
|
|
416
416
|
/**
|
|
417
|
-
* The
|
|
417
|
+
* The runtime dependencies an adopted project takes, and how they get there.
|
|
418
418
|
*
|
|
419
|
-
* PRD §3: an adopted project depends on
|
|
420
|
-
*
|
|
421
|
-
*
|
|
422
|
-
*
|
|
423
|
-
*
|
|
419
|
+
* PRD §3: an adopted project depends on `@penvhq/penv` at the engine's own
|
|
420
|
+
* version — the typed `@env` surface, not a CLI distribution. It also depends on
|
|
421
|
+
* zod, because the `penv.schema.ts` init scaffolds imports it: zod is a *peer* of
|
|
422
|
+
* `@penvhq/penv`, and a peer is a package the project supplies. Under pnpm's
|
|
423
|
+
* strict layout nothing hoists it to the project root, so an install that named
|
|
424
|
+
* only `@penvhq/penv` left the very schema init had just written unable to
|
|
425
|
+
* resolve `zod` — and adoption could never finish.
|
|
426
|
+
*
|
|
427
|
+
* Both are installed with the package manager the project already uses, and only
|
|
428
|
+
* after showing the exact `package.json` and lockfile change: an install is the
|
|
429
|
+
* one step of adoption that reaches outside the repository, so it is the one step
|
|
424
430
|
* that is shown before it happens rather than reported after.
|
|
425
431
|
*
|
|
426
432
|
* The install itself is a seam. It shells out to a package manager, which the
|
|
@@ -430,18 +436,25 @@ interface DraftField extends SchemaField {
|
|
|
430
436
|
*/
|
|
431
437
|
|
|
432
438
|
type PackageManager = "pnpm" | "npm" | "yarn" | "bun";
|
|
439
|
+
/** One package the adopted project needs, and what its `package.json` says today. */
|
|
440
|
+
interface InstallPackage {
|
|
441
|
+
readonly name: string;
|
|
442
|
+
readonly version: string;
|
|
443
|
+
/** What `package.json` already says about it, when it says anything. */
|
|
444
|
+
readonly declared?: string;
|
|
445
|
+
/** True when this project already has it — nothing to install for this one. */
|
|
446
|
+
readonly satisfied: boolean;
|
|
447
|
+
}
|
|
433
448
|
interface InstallPlan {
|
|
434
449
|
readonly root: string;
|
|
435
450
|
readonly manager: PackageManager;
|
|
436
|
-
|
|
437
|
-
readonly
|
|
451
|
+
/** Everything an adopted project needs, in the order the diff shows them. */
|
|
452
|
+
readonly packages: readonly InstallPackage[];
|
|
438
453
|
/** The command, argv-shaped — what runs, and what a refusal tells the user to run. */
|
|
439
454
|
readonly command: readonly string[];
|
|
440
455
|
/** The lockfile the manager will rewrite, when the project has one. */
|
|
441
456
|
readonly lockfile?: string;
|
|
442
|
-
/**
|
|
443
|
-
readonly declared?: string;
|
|
444
|
-
/** True when `package.json` already pins this exact version — nothing to install. */
|
|
457
|
+
/** True when every package is already there — nothing to install. */
|
|
445
458
|
readonly satisfied: boolean;
|
|
446
459
|
}
|
|
447
460
|
/** Runs an install plan, or throws. Replaced in tests; never spawns there. */
|
|
@@ -628,6 +641,13 @@ interface CutoverOptions {
|
|
|
628
641
|
* files aside. The order is the guarantee: every step before the move leaves a
|
|
629
642
|
* project whose `.env` files are exactly where they were, so a refusal at any
|
|
630
643
|
* of them costs a re-run and nothing else.
|
|
644
|
+
*
|
|
645
|
+
* The scaffold is snapshotted first, and rolled back when anything after it
|
|
646
|
+
* refuses. Without that, "a refusal costs a re-run" was only true of the dotenv
|
|
647
|
+
* files: a failed run still left a config, a draft schema, an edited tsconfig
|
|
648
|
+
* and an imported records tree behind, and the next run kept every one of them
|
|
649
|
+
* rather than starting clean. The install is not rolled back — it is the one
|
|
650
|
+
* step the developer consented to by itself, and a re-run finds it satisfied.
|
|
631
651
|
*/
|
|
632
652
|
declare function applyCutover(plan: CutoverPlan, options?: CutoverOptions): Promise<CutoverResult>;
|
|
633
653
|
declare function runInit(options: InitOptions): InitResult;
|
|
@@ -1112,6 +1132,13 @@ interface ChildInvocation {
|
|
|
1112
1132
|
readonly command: readonly string[];
|
|
1113
1133
|
readonly env: Record<string, string>;
|
|
1114
1134
|
readonly cwd: string;
|
|
1135
|
+
/**
|
|
1136
|
+
* What penv is starting this on its own behalf to do — `init`'s dependency
|
|
1137
|
+
* install. Absent means the command is the user's, from after `--`, and the
|
|
1138
|
+
* two failures have opposite remedies: one is about what they typed, the other
|
|
1139
|
+
* about a program penv chose to run.
|
|
1140
|
+
*/
|
|
1141
|
+
readonly purpose?: string;
|
|
1115
1142
|
}
|
|
1116
1143
|
/** A started child: how it ends, and the one thing a wrapper may do to it. */
|
|
1117
1144
|
interface ChildHandle {
|
package/dist/index.d.ts
CHANGED
|
@@ -57,7 +57,7 @@ declare function renderArtifactBuild(result: ArtifactBuildResult, cwd: string):
|
|
|
57
57
|
* second kind.
|
|
58
58
|
*/
|
|
59
59
|
type DoctorSeverity = "pass" | "warning" | "failure" | "unknown";
|
|
60
|
-
type DoctorCheck = "schema" | "missing" | "declared" | "weak" | "unused" | "unscoped-fallback" | "plaintext-secret" | "public-secret" | "encryption" | "rotation-overdue" | "rotation-stuck" | "provider-value-drift" | "provider" | "projection-unreachable" | "projection-name-drift" | "projection-manual-edit" | "projection-value-drift" | "environment-flag-shadow" | "artifact-in-tree";
|
|
60
|
+
type DoctorCheck = "schema" | "missing" | "declared" | "weak" | "unused" | "unscoped-fallback" | "secrecy-undeclared" | "plaintext-secret" | "public-secret" | "encryption" | "rotation-overdue" | "rotation-stuck" | "provider-value-drift" | "provider" | "projection-unreachable" | "projection-name-drift" | "projection-manual-edit" | "projection-value-drift" | "environment-flag-shadow" | "local-extension" | "artifact-in-tree";
|
|
61
61
|
interface DoctorFinding {
|
|
62
62
|
readonly check: DoctorCheck;
|
|
63
63
|
readonly severity: DoctorSeverity;
|
|
@@ -414,13 +414,19 @@ interface DraftField extends SchemaField {
|
|
|
414
414
|
}
|
|
415
415
|
|
|
416
416
|
/**
|
|
417
|
-
* The
|
|
417
|
+
* The runtime dependencies an adopted project takes, and how they get there.
|
|
418
418
|
*
|
|
419
|
-
* PRD §3: an adopted project depends on
|
|
420
|
-
*
|
|
421
|
-
*
|
|
422
|
-
*
|
|
423
|
-
*
|
|
419
|
+
* PRD §3: an adopted project depends on `@penvhq/penv` at the engine's own
|
|
420
|
+
* version — the typed `@env` surface, not a CLI distribution. It also depends on
|
|
421
|
+
* zod, because the `penv.schema.ts` init scaffolds imports it: zod is a *peer* of
|
|
422
|
+
* `@penvhq/penv`, and a peer is a package the project supplies. Under pnpm's
|
|
423
|
+
* strict layout nothing hoists it to the project root, so an install that named
|
|
424
|
+
* only `@penvhq/penv` left the very schema init had just written unable to
|
|
425
|
+
* resolve `zod` — and adoption could never finish.
|
|
426
|
+
*
|
|
427
|
+
* Both are installed with the package manager the project already uses, and only
|
|
428
|
+
* after showing the exact `package.json` and lockfile change: an install is the
|
|
429
|
+
* one step of adoption that reaches outside the repository, so it is the one step
|
|
424
430
|
* that is shown before it happens rather than reported after.
|
|
425
431
|
*
|
|
426
432
|
* The install itself is a seam. It shells out to a package manager, which the
|
|
@@ -430,18 +436,25 @@ interface DraftField extends SchemaField {
|
|
|
430
436
|
*/
|
|
431
437
|
|
|
432
438
|
type PackageManager = "pnpm" | "npm" | "yarn" | "bun";
|
|
439
|
+
/** One package the adopted project needs, and what its `package.json` says today. */
|
|
440
|
+
interface InstallPackage {
|
|
441
|
+
readonly name: string;
|
|
442
|
+
readonly version: string;
|
|
443
|
+
/** What `package.json` already says about it, when it says anything. */
|
|
444
|
+
readonly declared?: string;
|
|
445
|
+
/** True when this project already has it — nothing to install for this one. */
|
|
446
|
+
readonly satisfied: boolean;
|
|
447
|
+
}
|
|
433
448
|
interface InstallPlan {
|
|
434
449
|
readonly root: string;
|
|
435
450
|
readonly manager: PackageManager;
|
|
436
|
-
|
|
437
|
-
readonly
|
|
451
|
+
/** Everything an adopted project needs, in the order the diff shows them. */
|
|
452
|
+
readonly packages: readonly InstallPackage[];
|
|
438
453
|
/** The command, argv-shaped — what runs, and what a refusal tells the user to run. */
|
|
439
454
|
readonly command: readonly string[];
|
|
440
455
|
/** The lockfile the manager will rewrite, when the project has one. */
|
|
441
456
|
readonly lockfile?: string;
|
|
442
|
-
/**
|
|
443
|
-
readonly declared?: string;
|
|
444
|
-
/** True when `package.json` already pins this exact version — nothing to install. */
|
|
457
|
+
/** True when every package is already there — nothing to install. */
|
|
445
458
|
readonly satisfied: boolean;
|
|
446
459
|
}
|
|
447
460
|
/** Runs an install plan, or throws. Replaced in tests; never spawns there. */
|
|
@@ -628,6 +641,13 @@ interface CutoverOptions {
|
|
|
628
641
|
* files aside. The order is the guarantee: every step before the move leaves a
|
|
629
642
|
* project whose `.env` files are exactly where they were, so a refusal at any
|
|
630
643
|
* of them costs a re-run and nothing else.
|
|
644
|
+
*
|
|
645
|
+
* The scaffold is snapshotted first, and rolled back when anything after it
|
|
646
|
+
* refuses. Without that, "a refusal costs a re-run" was only true of the dotenv
|
|
647
|
+
* files: a failed run still left a config, a draft schema, an edited tsconfig
|
|
648
|
+
* and an imported records tree behind, and the next run kept every one of them
|
|
649
|
+
* rather than starting clean. The install is not rolled back — it is the one
|
|
650
|
+
* step the developer consented to by itself, and a re-run finds it satisfied.
|
|
631
651
|
*/
|
|
632
652
|
declare function applyCutover(plan: CutoverPlan, options?: CutoverOptions): Promise<CutoverResult>;
|
|
633
653
|
declare function runInit(options: InitOptions): InitResult;
|
|
@@ -1112,6 +1132,13 @@ interface ChildInvocation {
|
|
|
1112
1132
|
readonly command: readonly string[];
|
|
1113
1133
|
readonly env: Record<string, string>;
|
|
1114
1134
|
readonly cwd: string;
|
|
1135
|
+
/**
|
|
1136
|
+
* What penv is starting this on its own behalf to do — `init`'s dependency
|
|
1137
|
+
* install. Absent means the command is the user's, from after `--`, and the
|
|
1138
|
+
* two failures have opposite remedies: one is about what they typed, the other
|
|
1139
|
+
* about a program penv chose to run.
|
|
1140
|
+
*/
|
|
1141
|
+
readonly purpose?: string;
|
|
1115
1142
|
}
|
|
1116
1143
|
/** A started child: how it ends, and the one thing a wrapper may do to it. */
|
|
1117
1144
|
interface ChildHandle {
|