@penvhq/cli 0.9.3 → 0.9.4

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
@@ -414,13 +414,19 @@ interface DraftField extends SchemaField {
414
414
  }
415
415
 
416
416
  /**
417
- * The one runtime dependency an adopted project takes, and how it gets there.
417
+ * The runtime dependencies an adopted project takes, and how they get there.
418
418
  *
419
- * PRD §3: an adopted project depends on exactly `@penvhq/penv` at the engine's
420
- * own version — the typed `@env` surface, not a CLI distribution. `penv init`
421
- * installs it with the package manager the project already uses, and only after
422
- * showing the exact `package.json` and lockfile change: an install is the one
423
- * step of adoption that reaches outside the repository, so it is the one step
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
- readonly package: string;
437
- readonly version: string;
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
- /** What `package.json` already says about the package, when it says anything. */
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
@@ -414,13 +414,19 @@ interface DraftField extends SchemaField {
414
414
  }
415
415
 
416
416
  /**
417
- * The one runtime dependency an adopted project takes, and how it gets there.
417
+ * The runtime dependencies an adopted project takes, and how they get there.
418
418
  *
419
- * PRD §3: an adopted project depends on exactly `@penvhq/penv` at the engine's
420
- * own version — the typed `@env` surface, not a CLI distribution. `penv init`
421
- * installs it with the package manager the project already uses, and only after
422
- * showing the exact `package.json` and lockfile change: an install is the one
423
- * step of adoption that reaches outside the repository, so it is the one step
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
- readonly package: string;
437
- readonly version: string;
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
- /** What `package.json` already says about the package, when it says anything. */
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 {