@maverickcer/env-cap 0.6.0 → 0.7.1
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/ADOPTION.md +144 -0
- package/AGENTS.md +146 -0
- package/CHANGELOG.md +449 -0
- package/CODE_OF_CONDUCT.md +124 -0
- package/CODE_REVIEW.md +200 -0
- package/CONTRIBUTING.md +131 -0
- package/GUIDE.md +1214 -0
- package/PROMPT.md +89 -0
- package/README.md +92 -200
- package/RELEASING.md +160 -0
- package/SECURITY.md +270 -0
- package/SUPPORT.md +76 -0
- package/VERSIONING.md +118 -0
- package/benchmarks/READING-BENCHMARKS.md +197 -0
- package/benchmarks/README.md +126 -0
- package/benchmarks/WRITING-BENCHMARKS.md +252 -0
- package/benchmarks/performance-buildtime/BENCHMARKS.md +889 -0
- package/benchmarks/performance-runtime/BENCHMARKS.md +1988 -0
- package/dist/.dts/_ipc/build-fs.d.ts +53 -0
- package/dist/.dts/_ipc/build-fs.d.ts.map +1 -0
- package/dist/.dts/_ipc/compiler-api.d.ts +17 -0
- package/dist/.dts/_ipc/compiler-api.d.ts.map +1 -0
- package/dist/.dts/_ipc/display-path.d.ts +27 -0
- package/dist/.dts/_ipc/display-path.d.ts.map +1 -0
- package/dist/.dts/_ipc/generated-banner.d.ts +58 -0
- package/dist/.dts/_ipc/generated-banner.d.ts.map +1 -0
- package/dist/.dts/_ipc/glob.d.ts +22 -0
- package/dist/.dts/_ipc/glob.d.ts.map +1 -0
- package/dist/.dts/_ipc/no-node-fs.d.ts +35 -0
- package/dist/.dts/_ipc/no-node-fs.d.ts.map +1 -0
- package/dist/.dts/_ipc/resolve-tsconfig-paths.d.ts +134 -0
- package/dist/.dts/_ipc/resolve-tsconfig-paths.d.ts.map +1 -0
- package/dist/.dts/_ipc/typescript.d.ts +20 -0
- package/dist/.dts/_ipc/typescript.d.ts.map +1 -0
- package/dist/.dts/build/compatibility.d.ts.map +1 -1
- package/dist/.dts/build/compiler-api.d.ts +3 -6
- package/dist/.dts/build/compiler-api.d.ts.map +1 -1
- package/dist/.dts/build/display-path.d.ts +3 -21
- package/dist/.dts/build/display-path.d.ts.map +1 -1
- package/dist/.dts/build/generated-banner.d.ts +21 -42
- package/dist/.dts/build/generated-banner.d.ts.map +1 -1
- package/dist/.dts/build/glob.d.ts +3 -15
- package/dist/.dts/build/glob.d.ts.map +1 -1
- package/dist/.dts/build/index.d.ts +3 -3
- package/dist/.dts/build/link.d.ts.map +1 -1
- package/dist/.dts/build/merge-documentation.d.ts +35 -0
- package/dist/.dts/build/merge-documentation.d.ts.map +1 -0
- package/dist/.dts/build/resolution/resolve-tsconfig-paths.d.ts +11 -112
- package/dist/.dts/build/resolution/resolve-tsconfig-paths.d.ts.map +1 -1
- package/dist/.dts/build/types.d.ts +4 -53
- package/dist/.dts/build/types.d.ts.map +1 -1
- package/dist/.dts/build/typescript.d.ts +3 -17
- package/dist/.dts/build/typescript.d.ts.map +1 -1
- package/dist/.dts/eslint-plugin/glob.d.ts +4 -15
- package/dist/.dts/eslint-plugin/glob.d.ts.map +1 -1
- package/dist/.dts/eslint-plugin/index.d.ts +1 -1
- package/dist/.dts/eslint-plugin/no-node-fs.d.ts +8 -18
- package/dist/.dts/eslint-plugin/no-node-fs.d.ts.map +1 -1
- package/dist/.dts/eslint-plugin/no-raw-process-env.d.ts.map +1 -1
- package/dist/{build-H4KFV44Z.js → build-F3RQS7VE.js} +218 -63
- package/dist/build-F3RQS7VE.js.map +1 -0
- package/dist/build.cjs +257 -102
- package/dist/build.cjs.map +1 -1
- package/dist/build.js +256 -101
- package/dist/build.js.map +1 -1
- package/dist/{chunk-7GVPOHDU.js → chunk-QKIQ3LZP.js} +2 -2
- package/dist/cli/index.js +36 -29
- package/dist/cli/index.js.map +1 -1
- package/dist/eslint-plugin/index.cjs +95 -54
- package/dist/eslint-plugin/index.cjs.map +1 -1
- package/dist/eslint-plugin/index.js +94 -53
- package/dist/eslint-plugin/index.js.map +1 -1
- package/examples/README.md +95 -0
- package/package.json +53 -19
- package/skills/env-cap/SKILL.md +91 -0
- package/skills/env-cap/references/api.md +220 -0
- package/specs/architecture.md +634 -0
- package/specs/decisions/0001-runtime-documentation-separation.md +197 -0
- package/specs/decisions/0002-static-analysis-never-execution.md +233 -0
- package/specs/decisions/0003-no-global-env-object.md +172 -0
- package/specs/decisions/0004-no-client-server-package-split.md +116 -0
- package/specs/decisions/0005-warn-not-throw-by-default.md +93 -0
- package/specs/decisions/0006-self-redacting-contracts.md +124 -0
- package/specs/decisions/0007-processor-not-transformer.md +109 -0
- package/specs/decisions/0008-gzip-size-budget.md +173 -0
- package/specs/decisions/0009-exclusive-groups-are-always-errors.md +139 -0
- package/specs/decisions/0010-dependency-ownership-engine-scope-boundary.md +100 -0
- package/specs/decisions/0011-shared-discovery-compute-atomic-write-non-atomic.md +104 -0
- package/specs/decisions/0012-live-expiration-overrides-not-ast-functions.md +145 -0
- package/specs/decisions/0013-json-output-is-a-versioned-mirror.md +136 -0
- package/specs/decisions/0014-cross-package-schema-discovery.md +206 -0
- package/specs/decisions/0015-security-backport-window.md +60 -0
- package/specs/decisions/0016-check-mode-compute-before-compare-never-partial-write.md +113 -0
- package/specs/decisions/0017-eslint-plugin-entry-point.md +113 -0
- package/specs/decisions/0018-rotation-alert-issue-on-non-pr-runs.md +104 -0
- package/specs/decisions/0019-published-json-schema-generated-from-types.md +100 -0
- package/specs/decisions/0020-declaration-maps-via-separate-tsc-pass.md +101 -0
- package/specs/decisions/0021-manifest-change-report-persisted-snapshot.md +177 -0
- package/specs/decisions/0022-validation-contexts.md +267 -0
- package/specs/decisions/0023-tsconfig-path-alias-resolution.md +182 -0
- package/specs/decisions/0024-fact-model-architecture.md +144 -0
- package/specs/decisions/0025-contract-model-json-projection.md +105 -0
- package/specs/decisions/0026-finding-model-unifies-four-families.md +109 -0
- package/specs/decisions/0027-dependency-model-fact-shape-not-engine-access.md +98 -0
- package/specs/decisions/0028-ownership-model-shared-effective-owner.md +85 -0
- package/specs/decisions/0029-lifecycle-model-deprecation-rename-fields.md +98 -0
- package/specs/decisions/0030-change-model-wraps-manifest-change-report.md +97 -0
- package/specs/decisions/0031-evidence-entry-point.md +85 -0
- package/specs/decisions/0032-evidence-projection-provenance-mechanism.md +120 -0
- package/specs/decisions/0033-reference-projections-live-in-examples.md +81 -0
- package/specs/decisions/0034-three-tier-examples-restructuring.md +85 -0
- package/specs/decisions/0035-documentenv-metadata-generalization-and-compliance-fields.md +85 -0
- package/specs/decisions/0036-exact-source-position-evidence.md +122 -0
- package/specs/decisions/0037-developer-declared-dynamic-access-citations.md +114 -0
- package/specs/decisions/0038-always-computed-evidence-model-backs-generate-check-docs.md +244 -0
- package/specs/decisions/0039-scanner-local-dataflow-boundary.md +160 -0
- package/specs/decisions/0040-library-surfaces-do-not-acquire-node-fs.md +156 -0
- package/specs/decisions/0041-dual-package-hazard-checked-documented.md +75 -0
- package/specs/decisions/0042-init-cli-subcommand-scaffolds-only.md +95 -0
- package/specs/decisions/0043-env-cap-resolver-relocated-and-duplicated.md +71 -0
- package/specs/decisions/0044-strict-escalates-every-warning-family.md +88 -0
- package/specs/decisions/0045-promote-experimental-surfaces-to-stable.md +103 -0
- package/specs/decisions/0046-cli-restricted-to-runtime-and-evidence-output.md +177 -0
- package/specs/decisions/0047-supported-toolchain-node-22-and-typescript-5-6.md +30 -0
- package/specs/decisions/0048-eslint-plugin-does-not-vendor-typescript-eslint.md +25 -0
- package/specs/decisions/0049-typescript-7-scanner-uses-a-bundled-typescript-6.md +87 -0
- package/specs/decisions/0050-a-variable-declared-twice-is-documented-once.md +55 -0
- package/specs/generated-artifacts.md +104 -0
- package/specs/migrations/README.md +30 -0
- package/specs/migrations/from-centralized-schema.md +503 -0
- package/specs/migrations/from-dotenv.md +352 -0
- package/specs/migrations/from-envalid.md +482 -0
- package/specs/migrations/from-process-env.md +398 -0
- package/specs/migrations/from-t3-env.md +416 -0
- package/specs/migrations/from-zod.md +303 -0
- package/dist/build-H4KFV44Z.js.map +0 -1
- /package/dist/{chunk-7GVPOHDU.js.map → chunk-QKIQ3LZP.js.map} +0 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The filesystem capability a package's `./build` entry requires from its caller.
|
|
3
|
+
*
|
|
4
|
+
* `./build` is a **library surface**: it must not acquire filesystem access
|
|
5
|
+
* implicitly (no `node:fs` import outside the package's CLI). Every public options object carries a required
|
|
6
|
+
* `fs` field of this type, and the caller supplies a concrete adapter: the CLI builds one over
|
|
7
|
+
* `node:fs/promises`; a test builds either that same adapter or an in-memory fake.
|
|
8
|
+
*
|
|
9
|
+
* "Ambient-fs-free" means specifically: `./build` never reaches for
|
|
10
|
+
* `node:fs` itself. It still performs real filesystem operations -- the
|
|
11
|
+
* capability is always handed in.
|
|
12
|
+
*
|
|
13
|
+
* The shape is modeled on `node:fs/promises`'s own signatures so a thin
|
|
14
|
+
* adapter is a drop-in value, but uses minimal structural types
|
|
15
|
+
* ({@link BuildDirent}/{@link BuildStats}) rather than Node's `Dirent`/
|
|
16
|
+
* `Stats` -- the capability boundary shouldn't leak Node's type surface just
|
|
17
|
+
* because the concrete adapter happens to be Node-backed. Only the
|
|
18
|
+
* operations the build code actually calls are here.
|
|
19
|
+
*/
|
|
20
|
+
export interface BuildFileSystem {
|
|
21
|
+
/** Read a UTF-8 text file. Rejects if the path doesn't exist or isn't readable. */
|
|
22
|
+
readonly readFile: (path: string, encoding: "utf8") => Promise<string>;
|
|
23
|
+
/** Write a UTF-8 text file, creating or truncating it. The parent directory must already exist. */
|
|
24
|
+
readonly writeFile: (path: string, data: string, encoding: "utf8") => Promise<void>;
|
|
25
|
+
/** Create a directory and every missing parent. A no-op if it already exists. */
|
|
26
|
+
readonly mkdir: (path: string, options: {
|
|
27
|
+
readonly recursive: true;
|
|
28
|
+
}) => Promise<void>;
|
|
29
|
+
/** List a directory's entries with their file-type info. */
|
|
30
|
+
readonly readdir: (path: string, options: {
|
|
31
|
+
readonly withFileTypes: true;
|
|
32
|
+
}) => Promise<readonly BuildDirent[]>;
|
|
33
|
+
/** Stat a path (following symlinks). Rejects if the path doesn't exist. */
|
|
34
|
+
readonly stat: (path: string) => Promise<BuildStats>;
|
|
35
|
+
/** Resolve a path to its canonical, symlink-free absolute form. */
|
|
36
|
+
readonly realpath: (path: string) => Promise<string>;
|
|
37
|
+
}
|
|
38
|
+
/** One directory entry from {@link BuildFileSystem.readdir} -- the subset of Node's `Dirent` the build code reads. */
|
|
39
|
+
export interface BuildDirent {
|
|
40
|
+
readonly name: string;
|
|
41
|
+
/** Same contract as Node's `Dirent.isDirectory()`. */
|
|
42
|
+
readonly isDirectory: () => boolean;
|
|
43
|
+
/** Same contract as Node's `Dirent.isFile()`. */
|
|
44
|
+
readonly isFile: () => boolean;
|
|
45
|
+
}
|
|
46
|
+
/** A path's stat info from {@link BuildFileSystem.stat} -- the subset of Node's `Stats` the build code reads. */
|
|
47
|
+
export interface BuildStats {
|
|
48
|
+
/** Same contract as Node's `Stats.isFile()`. */
|
|
49
|
+
readonly isFile: () => boolean;
|
|
50
|
+
/** Size in bytes -- read by the package-schema resolver to enforce a size ceiling. */
|
|
51
|
+
readonly size: number;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=build-fs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-fs.d.ts","sourceRoot":"","sources":["../../../src/_ipc/build-fs.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,eAAe;IAC9B,mFAAmF;IACnF,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IACtE,mGAAmG;IACnG,QAAQ,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACnF,iFAAiF;IACjF,QAAQ,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACtF,4DAA4D;IAC5D,QAAQ,CAAC,OAAO,EAAE,CAChB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;QAAE,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAA;KAAE,KACtC,OAAO,CAAC,SAAS,WAAW,EAAE,CAAC,CAAA;IACpC,2EAA2E;IAC3E,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAAA;IACpD,mEAAmE;IACnE,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;CACrD;AAED,sHAAsH;AACtH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,sDAAsD;IACtD,QAAQ,CAAC,WAAW,EAAE,MAAM,OAAO,CAAA;IACnC,iDAAiD;IACjD,QAAQ,CAAC,MAAM,EAAE,MAAM,OAAO,CAAA;CAC/B;AAED,iHAAiH;AACjH,MAAM,WAAW,UAAU;IACzB,gDAAgD;IAChD,QAAQ,CAAC,MAAM,EAAE,MAAM,OAAO,CAAA;IAC9B,sFAAsF;IACtF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fails with a readable message when neither the installed `typescript` nor the bundled
|
|
3
|
+
* `@typescript/typescript6` exposes the classic compiler API (`createSourceFile`) the build-time scanner is
|
|
4
|
+
* written against. TypeScript 7 ships no programmatic API, so a package normally falls back to the bundled
|
|
5
|
+
* TypeScript 6 (see `typescript.ts`); this only fires when that dependency was stripped from the install, where
|
|
6
|
+
* a raw call would die with "ts.createSourceFile is not a function".
|
|
7
|
+
*
|
|
8
|
+
* This file is the canonical source; a package carries a managed copy (see `sync`) and binds its own name.
|
|
9
|
+
* @param product - The package's name, as users install it, for the message.
|
|
10
|
+
* @param compiler - The resolved compiler module (a parameter so a test can hand in a stand-in).
|
|
11
|
+
* @throws Error naming the installed version and how to restore the bundled compiler.
|
|
12
|
+
*/
|
|
13
|
+
export declare function assertCompilerApi(product: string, compiler: {
|
|
14
|
+
readonly createSourceFile?: unknown;
|
|
15
|
+
readonly version?: string;
|
|
16
|
+
}): void;
|
|
17
|
+
//# sourceMappingURL=compiler-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compiler-api.d.ts","sourceRoot":"","sources":["../../../src/_ipc/compiler-api.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE;IAAE,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAC3E,IAAI,CAWN"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renders `filePath` relative to `root`, POSIX-separated whatever the platform.
|
|
3
|
+
*
|
|
4
|
+
* Two deliberate non-conversions:
|
|
5
|
+
*
|
|
6
|
+
* - An already-relative `filePath` is returned as given (POSIX-normalized). That makes the function
|
|
7
|
+
* idempotent, which matters because a model's `file` is relativized once and then passed through render
|
|
8
|
+
* helpers that call this again. Resolving a relative path against `process.cwd()` first, which is what
|
|
9
|
+
* `path.relative` does on its own, silently gives a wrong answer whenever the working directory is not `root`.
|
|
10
|
+
* - An absolute path that would need to climb outside `root` is returned unchanged, never rewritten into a
|
|
11
|
+
* `../` escape: a file discovered in another package legitimately lives outside `root`, and its absolute path
|
|
12
|
+
* is the only unambiguous thing to say about it.
|
|
13
|
+
* @param root - The directory paths are published relative to.
|
|
14
|
+
* @param filePath - An absolute path, or one already relative to `root`.
|
|
15
|
+
* @returns The path to publish.
|
|
16
|
+
*/
|
|
17
|
+
export declare function displayPath(root: string, filePath: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* The inverse of {@link displayPath}: turns a published `file` back into a real, absolute path for filesystem
|
|
20
|
+
* or import work. `path.resolve` rather than `path.join`, because `displayPath` leaves an out-of-root absolute
|
|
21
|
+
* path unchanged and `resolve` returns such a path untouched, where `join` would produce `root + absolute`.
|
|
22
|
+
* @param root - The directory paths are published relative to.
|
|
23
|
+
* @param filePath - A published path.
|
|
24
|
+
* @returns The absolute path.
|
|
25
|
+
*/
|
|
26
|
+
export declare function absolutePathFrom(root: string, filePath: string): string;
|
|
27
|
+
//# sourceMappingURL=display-path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"display-path.d.ts","sourceRoot":"","sources":["../../../src/_ipc/display-path.ts"],"names":[],"mappings":"AAiBA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAOlE;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEvE"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The marker every generated file starts with, and the two standing notices every governance-adjacent
|
|
3
|
+
* artifact carries, written once for every MaverickCER package that generates files.
|
|
4
|
+
*
|
|
5
|
+
* This file is the canonical source. A package that uses it holds a managed copy (see `sync`), so it
|
|
6
|
+
* needs no dependency on this repository at runtime. It is deliberately self-contained: no imports, no
|
|
7
|
+
* Node APIs, no environment access, so it is safe in any bundle.
|
|
8
|
+
*
|
|
9
|
+
* One marker means one place decides what "generated" looks like: the code that writes the marker and the
|
|
10
|
+
* code that reads it (to refuse to overwrite a hand-written file, or to ignore a file that only imports a
|
|
11
|
+
* generated one) can never drift apart.
|
|
12
|
+
*/
|
|
13
|
+
/** What differs between packages; everything else is shared. */
|
|
14
|
+
export interface GeneratedBannerOptions {
|
|
15
|
+
/** The package's short name, as its documentation names it, for example `env-cap`. */
|
|
16
|
+
readonly product: string;
|
|
17
|
+
/** The page that describes the package's Evidence Model. */
|
|
18
|
+
readonly guideUrl: string;
|
|
19
|
+
/** The command that regenerates what the CLI writes, for example `npx env-cap`. */
|
|
20
|
+
readonly cliCommand: string;
|
|
21
|
+
/** How to regenerate a report the CLI does not write (it is produced by the project's own script). */
|
|
22
|
+
readonly reportRegenerateHint: string;
|
|
23
|
+
}
|
|
24
|
+
/** The functions a package's generated-file code uses. */
|
|
25
|
+
export interface GeneratedBanner {
|
|
26
|
+
/** @returns how to regenerate a report the CLI does not write. */
|
|
27
|
+
readonly reportRegenerateHint: () => string;
|
|
28
|
+
/**
|
|
29
|
+
* Renders the "do not edit by hand" marker in the given comment syntax.
|
|
30
|
+
* @param format - Comment syntax to render in.
|
|
31
|
+
* @param regenerate - How to regenerate; defaults to the CLI, which writes the manifest.
|
|
32
|
+
* @returns The comment line.
|
|
33
|
+
*/
|
|
34
|
+
readonly generatedBanner: (format?: "ts" | "markdown", regenerate?: string) => string;
|
|
35
|
+
/**
|
|
36
|
+
* Whether `content` carries a marker, as the opening of a `//` or `<!--` comment, within its first 20 non-empty lines.
|
|
37
|
+
* @param content - A file's text.
|
|
38
|
+
* @returns `true` when the file is generated.
|
|
39
|
+
*/
|
|
40
|
+
readonly isGeneratedFile: (content: string) => boolean;
|
|
41
|
+
/** @returns the short disclaimer stamped into every artifact that renders sensitivity, ownership or expiry claims. */
|
|
42
|
+
readonly evidenceDisclaimer: () => string;
|
|
43
|
+
/**
|
|
44
|
+
* States that an artifact is a projection of the Evidence Model, by concept, and by path when one is known.
|
|
45
|
+
* @param evidencePath - The path the evidence was also written to, when this run wrote it.
|
|
46
|
+
* @returns The note.
|
|
47
|
+
*/
|
|
48
|
+
readonly evidenceProjectionNote: (evidencePath?: string) => string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* @param describe - Returns what differs for this package. A function, not an object, for the same reason
|
|
52
|
+
* as the marker: an object literal written at module level is evaluated once at load, so mutation
|
|
53
|
+
* testing cannot attribute its values to the tests that pin them; a function's literals are evaluated
|
|
54
|
+
* per call.
|
|
55
|
+
* @returns the package's generated-file functions.
|
|
56
|
+
*/
|
|
57
|
+
export declare function createGeneratedBanner(describe: () => GeneratedBannerOptions): GeneratedBanner;
|
|
58
|
+
//# sourceMappingURL=generated-banner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-banner.d.ts","sourceRoot":"","sources":["../../../src/_ipc/generated-banner.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AAEH,gEAAgE;AAChE,MAAM,WAAW,sBAAsB;IACrC,sFAAsF;IACtF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,4DAA4D;IAC5D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,mFAAmF;IACnF,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,sGAAsG;IACtG,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAA;CACtC;AAED,0DAA0D;AAC1D,MAAM,WAAW,eAAe;IAC9B,kEAAkE;IAClE,QAAQ,CAAC,oBAAoB,EAAE,MAAM,MAAM,CAAA;IAC3C;;;;;OAKG;IACH,QAAQ,CAAC,eAAe,EAAE,CAAC,MAAM,CAAC,EAAE,IAAI,GAAG,UAAU,EAAE,UAAU,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;IACrF;;;;OAIG;IACH,QAAQ,CAAC,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAA;IACtD,sHAAsH;IACtH,QAAQ,CAAC,kBAAkB,EAAE,MAAM,MAAM,CAAA;IACzC;;;;OAIG;IACH,QAAQ,CAAC,sBAAsB,EAAE,CAAC,YAAY,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;CACnE;AAWD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,sBAAsB,GAAG,eAAe,CA8C7F"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts one glob pattern to a `RegExp`. Handles `**` as "any number of path segments, including zero", so
|
|
3
|
+
* `**\/node_modules/**` matches a root-level `node_modules` and `**\/x.ts` matches a root-level file, not
|
|
4
|
+
* just nested ones; a plain `**` to `.*` substitution gets both wrong.
|
|
5
|
+
*
|
|
6
|
+
* One implementation for every package: build-time discovery and ESLint options need exactly the same matching,
|
|
7
|
+
* and four hand-kept copies (two designs) had already accumulated. This file is the canonical source; a
|
|
8
|
+
* package carries a managed copy (see `sync`).
|
|
9
|
+
*/
|
|
10
|
+
export declare function globToRegExp(pattern: string): RegExp;
|
|
11
|
+
/**
|
|
12
|
+
* Whether a lint rule's `allow` list covers a file. ESLint gives a rule the file's absolute path, while a config
|
|
13
|
+
* writes its patterns relative to the working directory (`src/cli/**`), so each pattern is tested against the path
|
|
14
|
+
* as given and, when the file is inside `cwd`, against the path from there, written with `/` on every platform.
|
|
15
|
+
* (`split`/`join`, not `replaceAll`: a package that carries this copy may compile for ES2020.)
|
|
16
|
+
* @param patterns - the rule's `allow` globs.
|
|
17
|
+
* @param filename - the file as ESLint names it (`context.filename`).
|
|
18
|
+
* @param cwd - ESLint's working directory (`context.cwd`).
|
|
19
|
+
* @returns true when any pattern matches either name.
|
|
20
|
+
*/
|
|
21
|
+
export declare function matchesAllowList(patterns: readonly string[], filename: string, cwd: string): boolean;
|
|
22
|
+
//# sourceMappingURL=glob.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../../../src/_ipc/glob.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CA4BpD;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,GACV,OAAO,CAeT"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** What differs between the packages that carry the rule: where its documentation lives and what to read. */
|
|
2
|
+
export interface NoNodeFsWording {
|
|
3
|
+
/** @returns the documentation URL for a rule of this plugin. */
|
|
4
|
+
readonly docsUrl: (ruleName: string) => string;
|
|
5
|
+
/** What the message cites for the reasoning, for example `ADR 0040`. */
|
|
6
|
+
readonly adr: string;
|
|
7
|
+
/** Where the message says the allow-list escape hatch is described, for example `the README's ESLint section`. */
|
|
8
|
+
readonly guide: string;
|
|
9
|
+
}
|
|
10
|
+
export interface RuleOptions {
|
|
11
|
+
/** Glob-array of files this rule doesn't apply to -- a project's own
|
|
12
|
+
* executable entry points (a CLI, a script) that legitimately construct
|
|
13
|
+
* the concrete filesystem adapter. Empty by default -- populate it
|
|
14
|
+
* explicitly; the rule never guesses at what counts as an executable
|
|
15
|
+
* capability boundary. */
|
|
16
|
+
allow?: string[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Flags any `import`, re-export (`export ... from`, `export * from`), `require`, `process.getBuiltinModule`,
|
|
20
|
+
* TypeScript `import x = require()` or dynamic `import()` of `node:fs` (a string or a `${}`-free template) in
|
|
21
|
+
* library code, so a library surface acquires its filesystem capability from the
|
|
22
|
+
* caller instead of reaching for `node:fs` itself (the same discipline
|
|
23
|
+
* `repo-contract`'s ADR-0011 established for `child_process`/`process.env`).
|
|
24
|
+
* The wording passed in names the package's own documentation and decision record.
|
|
25
|
+
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* Nothing is exempt by default. A package's own config allows its CLI folder, for example `src/cli/**`
|
|
28
|
+
* (the executable capability boundary that builds the `node:fs/promises`
|
|
29
|
+
* adapter); a consuming project sets its own `allow` for its own entry
|
|
30
|
+
* points.
|
|
31
|
+
*/
|
|
32
|
+
export declare function createNoNodeFs(wording: NoNodeFsWording): import("@typescript-eslint/utils/ts-eslint").RuleModule<"noNodeFs", [RuleOptions], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
33
|
+
name: string;
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=no-node-fs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-node-fs.d.ts","sourceRoot":"","sources":["../../../src/_ipc/no-node-fs.ts"],"names":[],"mappings":"AAQA,6GAA6G;AAC7G,MAAM,WAAW,eAAe;IAC9B,gEAAgE;IAChE,QAAQ,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAA;IAC9C,wEAAwE;IACxE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,kHAAkH;IAClH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,WAAW;IAC1B;;;;+BAI2B;IAC3B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;CACjB;AAsCD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,eAAe;;EAqEtD"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import type TS from "typescript";
|
|
2
|
+
import type { BuildFileSystem } from "./build-fs.js";
|
|
3
|
+
/**
|
|
4
|
+
* TypeScript path-alias resolution.
|
|
5
|
+
*
|
|
6
|
+
* Resolves a bare import specifier (`"@/lib/env.schema.js"`) against a project's own
|
|
7
|
+
* `tsconfig.json` `compilerOptions.paths`/`baseUrl`, so a schema or consumer reached only
|
|
8
|
+
* through an alias isn't misreported by `link.ts`/`dependency-graph.ts` as unresolved or
|
|
9
|
+
* abandoned. Unlike a package-schema resolver, this never crosses a
|
|
10
|
+
* trust/versioning boundary -- every resolved file is already local, already-trusted
|
|
11
|
+
* project source -- so it is on by default (auto-detecting `root/tsconfig.json`) rather
|
|
12
|
+
* than requiring an explicit allowlist.
|
|
13
|
+
*
|
|
14
|
+
* The actual `paths`/`baseUrl` matching algorithm (longest-prefix matching, `*` wildcard
|
|
15
|
+
* substitution, multiple fallback targets, `extends`-chain merging, JSONC parsing) is
|
|
16
|
+
* delegated entirely to the TypeScript compiler via `ts.resolveModuleName()` and
|
|
17
|
+
* `ts.parseJsonConfigFileContent()` -- the same functions `tsc`/`tsserver` themselves use --
|
|
18
|
+
* rather than reimplemented here. This module's own logic is limited to loading the config,
|
|
19
|
+
* caching resolutions, and enforcing the `node_modules` safety boundary below.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* The `paths`/`baseUrl` view of parsed compiler options.
|
|
23
|
+
*
|
|
24
|
+
* TypeScript 6 marks `baseUrl` deprecated in its own typings. A project's tsconfig can still set it and
|
|
25
|
+
* TypeScript still honours it, so path resolution has to keep reading it to resolve the way the project's own
|
|
26
|
+
* compiler does. Reading it through this view, which does not carry that deprecation, states that on purpose.
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export interface PathMappingOptions {
|
|
30
|
+
readonly paths?: TS.MapLike<string[]>;
|
|
31
|
+
readonly baseUrl?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @param options - Parsed compiler options.
|
|
35
|
+
* @returns The same options, typed as the `paths`/`baseUrl` view.
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
export declare function pathMappingOptions(options: TS.CompilerOptions): PathMappingOptions;
|
|
39
|
+
/** Parsed `tsconfig.json` `paths`/`baseUrl` configuration, immutable for the life of one generate*() run. See {@link loadTsconfigPaths}. */
|
|
40
|
+
export interface TsconfigPathsResolution {
|
|
41
|
+
/** The subset of `compilerOptions` `ts.resolveModuleName()` needs -- at minimum `paths` and/or `baseUrl`. */
|
|
42
|
+
readonly compilerOptions: TS.CompilerOptions;
|
|
43
|
+
/** Absolute path of the tsconfig.json this was loaded from, for diagnostics. */
|
|
44
|
+
readonly configFile: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Opaque memoization for {@link resolveAliasImport}, created once per generate*() run via
|
|
48
|
+
* {@link createAliasResolutionCache} and threaded through `ImportResolutionContext`. Kept
|
|
49
|
+
* distinct from `TsconfigPathsResolution` (immutable config) so the cache's internal
|
|
50
|
+
* representation stays free to change without touching that type's shape.
|
|
51
|
+
*/
|
|
52
|
+
export interface AliasResolutionCache {
|
|
53
|
+
/**
|
|
54
|
+
* Keyed by `` `${importingFile}\0${specifier}` ``, not by `specifier` alone. With one
|
|
55
|
+
* fixed `compilerOptions` object and no project-reference support, `paths`-pattern
|
|
56
|
+
* substitution itself doesn't depend on the importing file -- but `ts.resolveModuleName()`'s
|
|
57
|
+
* fallback behavior when `paths` doesn't match a real file (classic-mode ancestor search,
|
|
58
|
+
* extension-preference edge cases) legitimately can. A `Map`, not a network call, so
|
|
59
|
+
* keying defensively by both costs nothing.
|
|
60
|
+
*/
|
|
61
|
+
readonly resolutions: Map<string, string | undefined>;
|
|
62
|
+
}
|
|
63
|
+
/** Creates a fresh, empty {@link AliasResolutionCache} for one generate*()/computeArtifacts() run. */
|
|
64
|
+
export declare function createAliasResolutionCache(): AliasResolutionCache;
|
|
65
|
+
/** A problem with the tsconfig that is reported rather than thrown. Structurally the same as each package's own warning type. */
|
|
66
|
+
export interface TsconfigWarning {
|
|
67
|
+
/** Absolute path of the tsconfig the warning applies to. */
|
|
68
|
+
readonly file: string;
|
|
69
|
+
/** Human-readable explanation of what was skipped and why. */
|
|
70
|
+
readonly message: string;
|
|
71
|
+
}
|
|
72
|
+
export interface LoadTsconfigPathsResult {
|
|
73
|
+
readonly resolution: TsconfigPathsResolution | undefined;
|
|
74
|
+
readonly warning: TsconfigWarning | undefined;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The compiler's own functions take a path written with `/` and assert it when they report a problem in the file, so
|
|
78
|
+
* a path with the platform's separator (a backslash on Windows) is written with `/` for them.
|
|
79
|
+
* @param file - an absolute path as the platform writes it.
|
|
80
|
+
* @param separator - the platform's path separator.
|
|
81
|
+
* @returns the same path written with `/`.
|
|
82
|
+
*/
|
|
83
|
+
export declare function typescriptPath(file: string, separator: string): string;
|
|
84
|
+
/**
|
|
85
|
+
* Loads and parses a `tsconfig.json` for alias resolution. Called exactly once per
|
|
86
|
+
* `generate*()`/`computeArtifacts()` invocation, at the same point
|
|
87
|
+
* `resolveAllowlistedPackages()` is already called once -- so at most one tsconfig-related
|
|
88
|
+
* warning is ever produced per run, never once per file scanned.
|
|
89
|
+
*
|
|
90
|
+
* @param product - The consuming package's name, used in the message when no usable compiler resolved.
|
|
91
|
+
* @remarks
|
|
92
|
+
* `tsconfigOption === false` disables alias resolution entirely.
|
|
93
|
+
* `tsconfigOption === undefined` (the default) looks for `root/tsconfig.json` exactly --
|
|
94
|
+
* deliberately not `ts.findConfigFile()`'s upward directory walk, since every other
|
|
95
|
+
* root-relative mechanism in this codebase (schema discovery, `packages` resolution)
|
|
96
|
+
* treats `root` as a hard boundary. A missing default tsconfig is silent (most projects
|
|
97
|
+
* don't use aliases); a missing *explicit* `tsconfigOption` is a real misconfiguration and
|
|
98
|
+
* warns. `jsconfig.json` is intentionally not auto-detected -- pass `tsconfig:
|
|
99
|
+
* "jsconfig.json"` explicitly if needed; this loader only cares about the file's JSON
|
|
100
|
+
* shape, not its name.
|
|
101
|
+
*
|
|
102
|
+
* The gate for building a resolution is "`paths` non-empty OR `baseUrl` set", not `paths`
|
|
103
|
+
* alone -- a `baseUrl`-only tsconfig (no `paths` at all) still makes TypeScript resolve
|
|
104
|
+
* bare specifiers relative to `baseUrl`, and `ts.resolveModuleName()` already handles that
|
|
105
|
+
* once `compilerOptions.baseUrl` is passed through.
|
|
106
|
+
*/
|
|
107
|
+
export declare function loadTsconfigPaths(product: string, root: string, tsconfigOption: string | false | undefined, fs: BuildFileSystem): Promise<LoadTsconfigPathsResult>;
|
|
108
|
+
/**
|
|
109
|
+
* Resolves one bare import specifier against a project's `tsconfig.json` `paths`/`baseUrl`,
|
|
110
|
+
* or returns `undefined` if it doesn't resolve through this mechanism.
|
|
111
|
+
*
|
|
112
|
+
* @remarks
|
|
113
|
+
* Necessarily synchronous -- `ts.resolveModuleName()` has no async form, matching how
|
|
114
|
+
* `tsc`/`tsserver` themselves always call it. `ts.sys` is used directly as the resolution
|
|
115
|
+
* host (an existing Node-backed singleton the `typescript` package exports; nothing to
|
|
116
|
+
* construct).
|
|
117
|
+
*
|
|
118
|
+
* Two safety/scope filters apply to any candidate `ts.resolveModuleName()` returns,
|
|
119
|
+
* independent of its own internal fallback behavior:
|
|
120
|
+
* - **Never resolves into `node_modules`.** `ts.resolveModuleName()` can, in principle,
|
|
121
|
+
* fall through to classic Node resolution and land inside `node_modules`; any resolved
|
|
122
|
+
* path containing a `node_modules` path segment (checked after `path.normalize()`, so
|
|
123
|
+
* mixed separators can't slip past it on Windows) is discarded here. Bare package
|
|
124
|
+
* specifiers continue to be handled exclusively by `resolvePackageImport()`
|
|
125
|
+
* -- this mechanism never overlaps with that trust boundary.
|
|
126
|
+
* - **`.ts`/`.tsx` only.** Matches `resolveRelativeImport()`'s own existing candidate set
|
|
127
|
+
* and `resolve-package-schema.ts`'s `SCHEMA_FILE_EXTENSIONS` -- this codebase's static-
|
|
128
|
+
* analysis pipeline is `.ts`/`.tsx` only today. A resolved non-`.ts`/`.tsx` file is a
|
|
129
|
+
* real risk, not just a gap: feeding it straight into `ts.createSourceFile()` wouldn't
|
|
130
|
+
* error, it would silently parse garbage -- exactly the "guess" this codebase's
|
|
131
|
+
* warn-don't-guess philosophy exists to avoid.
|
|
132
|
+
*/
|
|
133
|
+
export declare function resolveAliasImport(specifier: string, importingFile: string, resolution: TsconfigPathsResolution, cache: AliasResolutionCache): string | undefined;
|
|
134
|
+
//# sourceMappingURL=resolve-tsconfig-paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-tsconfig-paths.d.ts","sourceRoot":"","sources":["../../../src/_ipc/resolve-tsconfig-paths.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAA;AAEhC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAEpD;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;IACrC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,EAAE,CAAC,eAAe,GAAG,kBAAkB,CAElF;AAED,4IAA4I;AAC5I,MAAM,WAAW,uBAAuB;IACtC,6GAA6G;IAC7G,QAAQ,CAAC,eAAe,EAAE,EAAE,CAAC,eAAe,CAAA;IAC5C,gFAAgF;IAChF,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAC5B;AAED;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;;;OAOG;IACH,QAAQ,CAAC,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;CACtD;AAED,sGAAsG;AACtG,wBAAgB,0BAA0B,IAAI,oBAAoB,CAEjE;AAYD,iIAAiI;AACjI,MAAM,WAAW,eAAe;IAC9B,4DAA4D;IAC5D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,8DAA8D;IAC9D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,UAAU,EAAE,uBAAuB,GAAG,SAAS,CAAA;IACxD,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,SAAS,CAAA;CAC9C;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,EAC1C,EAAE,EAAE,eAAe,GAClB,OAAO,CAAC,uBAAuB,CAAC,CAuElC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,uBAAuB,EACnC,KAAK,EAAE,oBAAoB,GAC1B,MAAM,GAAG,SAAS,CAiBpB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type TS from "typescript";
|
|
2
|
+
/** The compiler namespace the build-time scanner is written against. */
|
|
3
|
+
export type TypeScript = typeof TS;
|
|
4
|
+
/**
|
|
5
|
+
* Picks the compiler the scanner parses with: the consumer's `typescript` when it exposes the
|
|
6
|
+
* classic compiler API (TypeScript 5 and 6), otherwise the bundled `@typescript/typescript6` --
|
|
7
|
+
* Microsoft's side-by-side TypeScript 6 package, a dependency of the package so the scanner keeps working
|
|
8
|
+
* for a consumer whose own `typescript` is 7+, which ships no programmatic API. Chosen by capability, never by version,
|
|
9
|
+
* so a future `typescript` that regains the API is used as-is.
|
|
10
|
+
*
|
|
11
|
+
* When neither has the API (the bundled dependency was stripped from an install), it returns the
|
|
12
|
+
* consumer's module anyway so `assertCompilerApi` -- called at every scanner entry point -- fails
|
|
13
|
+
* with its readable message instead of a bare "is not a function".
|
|
14
|
+
* @param load - How a module id is resolved (a parameter so a test can hand in stand-ins).
|
|
15
|
+
* @throws Whatever `load` throws for a reason other than the module not being installed.
|
|
16
|
+
*/
|
|
17
|
+
export declare function pickCompiler(load: (id: string) => unknown): TypeScript;
|
|
18
|
+
/** The compiler every scanner module parses with. Resolved once, synchronously, at import. */
|
|
19
|
+
export declare const ts: TypeScript;
|
|
20
|
+
//# sourceMappingURL=typescript.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../../src/_ipc/typescript.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAA;AAEhC,wEAAwE;AACxE,MAAM,MAAM,UAAU,GAAG,OAAO,EAAE,CAAA;AAqClC;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,GAAG,UAAU,CAMtE;AAED,8FAA8F;AAC9F,eAAO,MAAM,EAAE,EAAE,UAAyD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compatibility.d.ts","sourceRoot":"","sources":["../../../src/build/compatibility.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAsB,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"compatibility.d.ts","sourceRoot":"","sources":["../../../src/build/compatibility.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAsB,MAAM,WAAW,CAAA;AAGvE;;;;;;GAMG;AACH,MAAM,MAAM,sBAAsB,GAC9B,gCAAgC,GAChC,2BAA2B,GAC3B,2BAA2B,GAC3B,kCAAkC,GAClC,2CAA2C,CAAA;AAE/C,8HAA8H;AAC9H,MAAM,WAAW,kBAAkB;IACjC,uKAAuK;IACvK,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAA;IAC/C,iHAAiH;IACjH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB;;;;;;;OAOG;IACH,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;IACjC,kDAAkD;IAClD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,sBAAsB,CAAA;CACvC;AAkCD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,SAAS,kBAAkB,EAAE,GACvC,kBAAkB,EAAE,CAqGtB;AA+CD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,6BAA6B,CAC3C,SAAS,EAAE,SAAS,kBAAkB,EAAE,GACvC,kBAAkB,EAAE,CAqDtB"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Fails with a readable message when
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* back to the bundled TypeScript 6 (`src/build/typescript.ts`); this only fires when that
|
|
6
|
-
* dependency was stripped from the install, where a raw call would die with
|
|
7
|
-
* "ts.createSourceFile is not a function".
|
|
2
|
+
* Fails with a readable message when the resolved compiler lacks the classic API the scanner needs. The wording
|
|
3
|
+
* lives in `../_ipc/compiler-api.ts`, a managed copy of internal-package-contract's `runtime/compiler-api.ts`;
|
|
4
|
+
* this binds it to env-cap.
|
|
8
5
|
* @param compiler - The resolved compiler module (a parameter so a test can hand in a stand-in).
|
|
9
6
|
* @throws Error naming the installed version and how to restore the bundled compiler.
|
|
10
7
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compiler-api.d.ts","sourceRoot":"","sources":["../../../src/build/compiler-api.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"compiler-api.d.ts","sourceRoot":"","sources":["../../../src/build/compiler-api.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE;IAC1C,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;IACnC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAC1B,GAAG,IAAI,CAEP"}
|
|
@@ -1,24 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* root-relative when possible. The one place this conversion lives -- every
|
|
5
|
-
* model builder and renderer that needs "the path as a reader should see it"
|
|
6
|
-
* goes through this, so two of them can never disagree about the form of the
|
|
7
|
-
* same file's path (which would silently break every `${file}#${exportName}`
|
|
8
|
-
* lookup that crosses between them).
|
|
9
|
-
*
|
|
10
|
-
* A `DiscoveredContract.file` keeps its own absolute path untouched -- that's
|
|
11
|
-
* the correct, unambiguous fact, and what stays sane when discovery spans
|
|
12
|
-
* multiple roots (a `packages`-discovered file living outside `root`
|
|
13
|
-
* entirely, ADR 0014).
|
|
2
|
+
* Root-relative paths for published artifacts, bound to env-cap. The behavior lives in
|
|
3
|
+
* `../_ipc/display-path.ts`, a managed copy of internal-package-contract's `runtime/display-path.ts`.
|
|
14
4
|
*/
|
|
15
|
-
|
|
16
|
-
* Renders `absolutePath` relative to `root`, POSIX-separated regardless of
|
|
17
|
-
* platform (matching every other rendered path in this package's Markdown and
|
|
18
|
-
* JSON output). Falls back to `absolutePath` itself, unchanged, whenever the
|
|
19
|
-
* result would need to climb outside `root` (a `packages`-discovered file, or
|
|
20
|
-
* any other path not under root) -- never manufactures a `../` escape, which
|
|
21
|
-
* reads as a real relative path to a consumer and resolves to nothing useful.
|
|
22
|
-
*/
|
|
23
|
-
export declare function displayPath(root: string, absolutePath: string): string;
|
|
5
|
+
export { displayPath } from "../_ipc/display-path.js";
|
|
24
6
|
//# sourceMappingURL=display-path.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display-path.d.ts","sourceRoot":"","sources":["../../../src/build/display-path.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"display-path.d.ts","sourceRoot":"","sources":["../../../src/build/display-path.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA"}
|
|
@@ -1,23 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* would otherwise make it look permanently "used"). Not configurable, not
|
|
7
|
-
* public.
|
|
8
|
-
*
|
|
9
|
-
* Also home to the two standing notices every governance-adjacent artifact
|
|
10
|
-
* stamps near the top -- `evidenceDisclaimer()` and
|
|
11
|
-
* `evidenceProjectionNote()`. They live here, next to the banner, because
|
|
12
|
-
* they answer the same question the banner does ("what is this file, and how
|
|
13
|
-
* much should I trust it?") and because a renderer that emits one must never
|
|
14
|
-
* be able to emit the others from a stale, separately-maintained copy.
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* Regeneration instruction for a report the CLI does not write (ADR 0046) -- a function, not a
|
|
18
|
-
* `const`, for the same per-call-evaluation reason as `generatedFileMarker()`: it is produced by the
|
|
19
|
-
* project's own script calling the `./build` generators, so naming `npx env-cap` there would send a
|
|
20
|
-
* reader to a command that cannot regenerate it.
|
|
2
|
+
* Regeneration instruction for a report the CLI does not write (ADR 0046) -- it is produced by the project's own
|
|
3
|
+
* script calling the `@maverickcer/env-cap/build` generators, so naming `npx env-cap` there would send a reader to a command that
|
|
4
|
+
* cannot regenerate it.
|
|
5
|
+
* @returns The instruction, as a sentence.
|
|
21
6
|
*/
|
|
22
7
|
export declare function reportRegenerateHint(): string;
|
|
23
8
|
/**
|
|
@@ -28,37 +13,31 @@ export declare function reportRegenerateHint(): string;
|
|
|
28
13
|
*/
|
|
29
14
|
export declare function generatedBanner(format?: "ts" | "markdown", regenerate?: string): string;
|
|
30
15
|
/**
|
|
31
|
-
* Whether `content` carries a {@link generatedBanner}-produced marker, in
|
|
32
|
-
* either format.
|
|
16
|
+
* Whether `content` carries a {@link generatedBanner}-produced marker, in either format.
|
|
33
17
|
*
|
|
34
18
|
* @remarks
|
|
35
|
-
* Deliberately not a bare `content.startsWith(generatedBanner(...))`: a
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
19
|
+
* Deliberately not a bare `content.startsWith(generatedBanner(...))`: a shebang, a `"use strict"` pragma, or a
|
|
20
|
+
* license header pushes a real banner off line one, and a stricter check would then read a genuinely
|
|
21
|
+
* generated file as hand-written, which the dependency scan would take as "a real consumer imports this" and
|
|
22
|
+
* so permanently mask an abandoned one. The marker is looked for across the first 20 non-empty lines instead,
|
|
23
|
+
* which clears every realistic preamble without scanning a whole file.
|
|
24
|
+
* @param content - A file's text.
|
|
25
|
+
* @returns `true` when the file is generated.
|
|
42
26
|
*/
|
|
43
27
|
export declare function isGeneratedFile(content: string): boolean;
|
|
44
28
|
/**
|
|
45
|
-
* Short disclaimer stamped into every artifact that renders sensitivity
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* code fact or an author's own declaration -- env-cap never executes a schema
|
|
51
|
-
* file and never validates a declaration against reality.
|
|
29
|
+
* Short disclaimer stamped into every artifact that renders sensitivity, ownership or expiry claims. Never omit
|
|
30
|
+
* it from an artifact that renders such metadata: it is what keeps "documented" from being misread as
|
|
31
|
+
* "verified" or "compliant". Every fact in those artifacts is either a statically-provable code fact or an
|
|
32
|
+
* author's own declaration; env-cap never validates a declaration against reality.
|
|
33
|
+
* @returns The disclaimer.
|
|
52
34
|
*/
|
|
53
35
|
export declare function evidenceDisclaimer(): string;
|
|
54
36
|
/**
|
|
55
|
-
* States, by concept, that
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* a note pointing at a file that doesn't exist. `evidencePath`, when this
|
|
60
|
-
* same run's own options did include `--evidence <path>`, names that
|
|
61
|
-
* concrete path in addition to the concept.
|
|
37
|
+
* States, by concept, that an artifact is a projection of env-cap's Evidence Model, and by path when one is known.
|
|
38
|
+
* It never hardcodes a path, because the evidence file only exists on a run that passed `--evidence`.
|
|
39
|
+
* @param evidencePath - The path the evidence was also written to, when this run wrote it.
|
|
40
|
+
* @returns The note.
|
|
62
41
|
*/
|
|
63
42
|
export declare function evidenceProjectionNote(evidencePath?: string): string;
|
|
64
43
|
//# sourceMappingURL=generated-banner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generated-banner.d.ts","sourceRoot":"","sources":["../../../src/build/generated-banner.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generated-banner.d.ts","sourceRoot":"","sources":["../../../src/build/generated-banner.ts"],"names":[],"mappings":"AAwBA;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,CAAC,EAAE,IAAI,GAAG,UAAU,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAEvF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAEpE"}
|
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* `node_modules`, and `**\/env.schema.ts` matches a root-level file, not just
|
|
5
|
-
* nested ones) -- a plain `**` -> `.*` substitution gets both of those wrong.
|
|
6
|
-
*
|
|
7
|
-
* Used by discover.ts's `include`/`exclude` schema-discovery walk.
|
|
8
|
-
*
|
|
9
|
-
* Deliberately duplicated (not shared) with
|
|
10
|
-
* src/eslint-plugin/glob.ts, which needs the exact same matching behavior
|
|
11
|
-
* for its own `allow` option -- keeps this build-only module free of any
|
|
12
|
-
* import reaching outside src/build, so `src/build` stays independently
|
|
13
|
-
* splittable into its own package with zero source-level cross-folder
|
|
14
|
-
* dependency. Not re-exported from `./index.js` -- Private tier per
|
|
15
|
-
* VERSIONING.md.
|
|
2
|
+
* Glob-to-RegExp conversion for discovery. The behavior lives in `../_ipc/glob.ts`, a managed copy of
|
|
3
|
+
* internal-package-contract's `runtime/glob.ts`. Not re-exported from `./index.js`: Private tier per VERSIONING.md.
|
|
16
4
|
*/
|
|
17
|
-
export
|
|
5
|
+
export { globToRegExp } from "../_ipc/glob.js";
|
|
18
6
|
//# sourceMappingURL=glob.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../../../src/build/glob.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../../../src/build/glob.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA"}
|