@penvhq/cli 0.10.0 → 0.12.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/bin.cjs +250 -55
- package/dist/bin.cjs.map +1 -1
- package/dist/chunk-NHTDIZZ2.js +504 -0
- package/dist/chunk-NHTDIZZ2.js.map +1 -0
- package/dist/index.cjs +239 -51
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -47
- package/dist/index.d.ts +1 -47
- package/dist/index.js +228 -517
- package/dist/index.js.map +1 -1
- package/dist/install.cjs +537 -0
- package/dist/install.cjs.map +1 -0
- package/dist/install.d.cts +126 -0
- package/dist/install.d.ts +126 -0
- package/dist/install.js +27 -0
- package/dist/install.js.map +1 -0
- package/package.json +18 -7
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as citty from 'citty';
|
|
2
2
|
import { ProjectionProvider, Provider, PenvConfig, DotenvEntry, ParameterRef, Scope, DotenvDiagnostic, Resolution, AnyProvider, RotationMechanism, RotationState } from '@penvhq/core';
|
|
3
|
+
import { InstallPlan, InstallRuntime } from './install.cjs';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -413,53 +414,6 @@ interface DraftField extends SchemaField {
|
|
|
413
414
|
readonly required: boolean;
|
|
414
415
|
}
|
|
415
416
|
|
|
416
|
-
/**
|
|
417
|
-
* The runtime dependencies an adopted project takes, and how they get there.
|
|
418
|
-
*
|
|
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
|
|
430
|
-
* that is shown before it happens rather than reported after.
|
|
431
|
-
*
|
|
432
|
-
* The install itself is a seam. It shells out to a package manager, which the
|
|
433
|
-
* tests must never do — and a fake here is not a weaker test, because what init
|
|
434
|
-
* has to get right is the plan, the consent, and the refusal when the install
|
|
435
|
-
* does not happen.
|
|
436
|
-
*/
|
|
437
|
-
|
|
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
|
-
}
|
|
448
|
-
interface InstallPlan {
|
|
449
|
-
readonly root: string;
|
|
450
|
-
readonly manager: PackageManager;
|
|
451
|
-
/** Everything an adopted project needs, in the order the diff shows them. */
|
|
452
|
-
readonly packages: readonly InstallPackage[];
|
|
453
|
-
/** The command, argv-shaped — what runs, and what a refusal tells the user to run. */
|
|
454
|
-
readonly command: readonly string[];
|
|
455
|
-
/** The lockfile the manager will rewrite, when the project has one. */
|
|
456
|
-
readonly lockfile?: string;
|
|
457
|
-
/** True when every package is already there — nothing to install. */
|
|
458
|
-
readonly satisfied: boolean;
|
|
459
|
-
}
|
|
460
|
-
/** Runs an install plan, or throws. Replaced in tests; never spawns there. */
|
|
461
|
-
type InstallRuntime = (plan: InstallPlan) => Promise<void>;
|
|
462
|
-
|
|
463
417
|
/** What init touched, so a caller can report it and a test can assert it. */
|
|
464
418
|
type InitTarget = "penv-dir" | "schema" | "env" | "config" | "tsconfig" | "gitignore" | "seam";
|
|
465
419
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as citty from 'citty';
|
|
2
2
|
import { ProjectionProvider, Provider, PenvConfig, DotenvEntry, ParameterRef, Scope, DotenvDiagnostic, Resolution, AnyProvider, RotationMechanism, RotationState } from '@penvhq/core';
|
|
3
|
+
import { InstallPlan, InstallRuntime } from './install.js';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -413,53 +414,6 @@ interface DraftField extends SchemaField {
|
|
|
413
414
|
readonly required: boolean;
|
|
414
415
|
}
|
|
415
416
|
|
|
416
|
-
/**
|
|
417
|
-
* The runtime dependencies an adopted project takes, and how they get there.
|
|
418
|
-
*
|
|
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
|
|
430
|
-
* that is shown before it happens rather than reported after.
|
|
431
|
-
*
|
|
432
|
-
* The install itself is a seam. It shells out to a package manager, which the
|
|
433
|
-
* tests must never do — and a fake here is not a weaker test, because what init
|
|
434
|
-
* has to get right is the plan, the consent, and the refusal when the install
|
|
435
|
-
* does not happen.
|
|
436
|
-
*/
|
|
437
|
-
|
|
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
|
-
}
|
|
448
|
-
interface InstallPlan {
|
|
449
|
-
readonly root: string;
|
|
450
|
-
readonly manager: PackageManager;
|
|
451
|
-
/** Everything an adopted project needs, in the order the diff shows them. */
|
|
452
|
-
readonly packages: readonly InstallPackage[];
|
|
453
|
-
/** The command, argv-shaped — what runs, and what a refusal tells the user to run. */
|
|
454
|
-
readonly command: readonly string[];
|
|
455
|
-
/** The lockfile the manager will rewrite, when the project has one. */
|
|
456
|
-
readonly lockfile?: string;
|
|
457
|
-
/** True when every package is already there — nothing to install. */
|
|
458
|
-
readonly satisfied: boolean;
|
|
459
|
-
}
|
|
460
|
-
/** Runs an install plan, or throws. Replaced in tests; never spawns there. */
|
|
461
|
-
type InstallRuntime = (plan: InstallPlan) => Promise<void>;
|
|
462
|
-
|
|
463
417
|
/** What init touched, so a caller can report it and a test can assert it. */
|
|
464
418
|
type InitTarget = "penv-dir" | "schema" | "env" | "config" | "tsconfig" | "gitignore" | "seam";
|
|
465
419
|
/**
|