@ploaness/governance 1.0.0 → 1.2.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/a11y-hit-target.d.ts +35 -0
- package/dist/a11y-hit-target.d.ts.map +1 -0
- package/dist/a11y-hit-target.js +82 -0
- package/dist/a11y-hit-target.js.map +1 -0
- package/dist/a11y-incomplete.d.ts +18 -0
- package/dist/a11y-incomplete.d.ts.map +1 -0
- package/dist/a11y-incomplete.js +65 -0
- package/dist/a11y-incomplete.js.map +1 -0
- package/dist/access-boundary.d.ts +62 -6
- package/dist/access-boundary.d.ts.map +1 -1
- package/dist/access-boundary.js +201 -6
- package/dist/access-boundary.js.map +1 -1
- package/dist/admin-view-coverage.d.ts +25 -0
- package/dist/admin-view-coverage.d.ts.map +1 -0
- package/dist/admin-view-coverage.js +74 -0
- package/dist/admin-view-coverage.js.map +1 -0
- package/dist/asset-policy.d.ts.map +1 -1
- package/dist/asset-policy.js +1 -23
- package/dist/asset-policy.js.map +1 -1
- package/dist/axe-coverage.d.ts +40 -0
- package/dist/axe-coverage.d.ts.map +1 -0
- package/dist/axe-coverage.js +62 -0
- package/dist/axe-coverage.js.map +1 -0
- package/dist/banned-typography.d.ts.map +1 -1
- package/dist/banned-typography.js +26 -0
- package/dist/banned-typography.js.map +1 -1
- package/dist/blocklist-entries.d.ts +36 -0
- package/dist/blocklist-entries.d.ts.map +1 -0
- package/dist/blocklist-entries.js +338 -0
- package/dist/blocklist-entries.js.map +1 -0
- package/dist/blocklist.d.ts +91 -0
- package/dist/blocklist.d.ts.map +1 -0
- package/dist/blocklist.js +187 -0
- package/dist/blocklist.js.map +1 -0
- package/dist/build-diagnosis.d.ts +10 -0
- package/dist/build-diagnosis.d.ts.map +1 -0
- package/dist/build-diagnosis.js +38 -0
- package/dist/build-diagnosis.js.map +1 -0
- package/dist/container-failure.d.ts.map +1 -1
- package/dist/container-failure.js +1 -18
- package/dist/container-failure.js.map +1 -1
- package/dist/container-files.d.ts +16 -0
- package/dist/container-files.d.ts.map +1 -1
- package/dist/container-files.js +23 -8
- package/dist/container-files.js.map +1 -1
- package/dist/container-images.d.ts +43 -0
- package/dist/container-images.d.ts.map +1 -0
- package/dist/container-images.js +157 -0
- package/dist/container-images.js.map +1 -0
- package/dist/dependency-freshness.d.ts +8 -0
- package/dist/dependency-freshness.d.ts.map +1 -1
- package/dist/dependency-freshness.js +2 -18
- package/dist/dependency-freshness.js.map +1 -1
- package/dist/doc-blocks.d.ts.map +1 -1
- package/dist/doc-blocks.js +1 -13
- package/dist/doc-blocks.js.map +1 -1
- package/dist/document-references.d.ts.map +1 -1
- package/dist/document-references.js +7 -1
- package/dist/document-references.js.map +1 -1
- package/dist/editorconfig-policy.d.ts +7 -0
- package/dist/editorconfig-policy.d.ts.map +1 -1
- package/dist/editorconfig-policy.js +19 -12
- package/dist/editorconfig-policy.js.map +1 -1
- package/dist/environment-coherence.d.ts +87 -0
- package/dist/environment-coherence.d.ts.map +1 -0
- package/dist/environment-coherence.js +128 -0
- package/dist/environment-coherence.js.map +1 -0
- package/dist/environment-files.d.ts.map +1 -1
- package/dist/environment-files.js +1 -19
- package/dist/environment-files.js.map +1 -1
- package/dist/file-roles.d.ts +7 -2
- package/dist/file-roles.d.ts.map +1 -1
- package/dist/file-roles.js +10 -9
- package/dist/file-roles.js.map +1 -1
- package/dist/freshness-repair.d.ts +82 -0
- package/dist/freshness-repair.d.ts.map +1 -0
- package/dist/freshness-repair.js +91 -0
- package/dist/freshness-repair.js.map +1 -0
- package/dist/generated-denial.d.ts.map +1 -1
- package/dist/generated-denial.js +1 -9
- package/dist/generated-denial.js.map +1 -1
- package/dist/generated-drift.d.ts +18 -0
- package/dist/generated-drift.d.ts.map +1 -0
- package/dist/generated-drift.js +24 -0
- package/dist/generated-drift.js.map +1 -0
- package/dist/harness-package.d.ts +13 -0
- package/dist/harness-package.d.ts.map +1 -0
- package/dist/harness-package.js +20 -0
- package/dist/harness-package.js.map +1 -0
- package/dist/history-policy.d.ts.map +1 -1
- package/dist/history-policy.js +1 -7
- package/dist/history-policy.js.map +1 -1
- package/dist/image-assets.d.ts.map +1 -1
- package/dist/image-assets.js +1 -10
- package/dist/image-assets.js.map +1 -1
- package/dist/index.d.ts +22 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -1
- package/dist/index.js.map +1 -1
- package/dist/install-policy.d.ts +21 -0
- package/dist/install-policy.d.ts.map +1 -1
- package/dist/install-policy.js +53 -1
- package/dist/install-policy.js.map +1 -1
- package/dist/jsx-accessibility-scope.d.ts +17 -0
- package/dist/jsx-accessibility-scope.d.ts.map +1 -0
- package/dist/jsx-accessibility-scope.js +36 -0
- package/dist/jsx-accessibility-scope.js.map +1 -0
- package/dist/jsx-accessibility.d.ts +13 -0
- package/dist/jsx-accessibility.d.ts.map +1 -0
- package/dist/jsx-accessibility.js +188 -0
- package/dist/jsx-accessibility.js.map +1 -0
- package/dist/network-policy.d.ts.map +1 -1
- package/dist/network-policy.js +1 -12
- package/dist/network-policy.js.map +1 -1
- package/dist/oxlint-policy.d.ts +16 -0
- package/dist/oxlint-policy.d.ts.map +1 -0
- package/dist/oxlint-policy.js +28 -0
- package/dist/oxlint-policy.js.map +1 -0
- package/dist/oxlint-report.d.ts +29 -0
- package/dist/oxlint-report.d.ts.map +1 -0
- package/dist/oxlint-report.js +84 -0
- package/dist/oxlint-report.js.map +1 -0
- package/dist/oxlint-scope.d.ts +13 -0
- package/dist/oxlint-scope.d.ts.map +1 -0
- package/dist/oxlint-scope.js +46 -0
- package/dist/oxlint-scope.js.map +1 -0
- package/dist/oxlint-suppressions.d.ts +17 -0
- package/dist/oxlint-suppressions.d.ts.map +1 -0
- package/dist/oxlint-suppressions.js +72 -0
- package/dist/oxlint-suppressions.js.map +1 -0
- package/dist/paired-assets.d.ts.map +1 -1
- package/dist/paired-assets.js.map +1 -1
- package/dist/payload-access.d.ts +6 -0
- package/dist/payload-access.d.ts.map +1 -1
- package/dist/payload-access.js +188 -57
- package/dist/payload-access.js.map +1 -1
- package/dist/payload-configs.d.ts +23 -0
- package/dist/payload-configs.d.ts.map +1 -0
- package/dist/payload-configs.js +96 -0
- package/dist/payload-configs.js.map +1 -0
- package/dist/payload-defaults.d.ts +128 -0
- package/dist/payload-defaults.d.ts.map +1 -0
- package/dist/payload-defaults.js +295 -0
- package/dist/payload-defaults.js.map +1 -0
- package/dist/payload-field-access.d.ts +4 -0
- package/dist/payload-field-access.d.ts.map +1 -0
- package/dist/payload-field-access.js +51 -0
- package/dist/payload-field-access.js.map +1 -0
- package/dist/payload-policy.d.ts +13 -0
- package/dist/payload-policy.d.ts.map +1 -1
- package/dist/payload-policy.js +171 -32
- package/dist/payload-policy.js.map +1 -1
- package/dist/payload-source.js +2 -2
- package/dist/payload-source.js.map +1 -1
- package/dist/relationship-cleanup.d.ts +18 -0
- package/dist/relationship-cleanup.d.ts.map +1 -0
- package/dist/relationship-cleanup.js +96 -0
- package/dist/relationship-cleanup.js.map +1 -0
- package/dist/release-age.d.ts.map +1 -1
- package/dist/release-age.js +1 -16
- package/dist/release-age.js.map +1 -1
- package/dist/request-limits.d.ts.map +1 -1
- package/dist/request-limits.js +1 -11
- package/dist/request-limits.js.map +1 -1
- package/dist/route-coverage.d.ts +27 -0
- package/dist/route-coverage.d.ts.map +1 -0
- package/dist/route-coverage.js +57 -0
- package/dist/route-coverage.js.map +1 -0
- package/dist/route-map.d.ts +65 -0
- package/dist/route-map.d.ts.map +1 -0
- package/dist/route-map.js +168 -0
- package/dist/route-map.js.map +1 -0
- package/dist/run-plan.d.ts.map +1 -1
- package/dist/run-plan.js +1 -19
- package/dist/run-plan.js.map +1 -1
- package/dist/secret-policy.d.ts.map +1 -1
- package/dist/secret-policy.js +5 -15
- package/dist/secret-policy.js.map +1 -1
- package/dist/settings-layering.d.ts +8 -30
- package/dist/settings-layering.d.ts.map +1 -1
- package/dist/settings-layering.js +19 -48
- package/dist/settings-layering.js.map +1 -1
- package/dist/settings.d.ts +19 -2
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +5 -1
- package/dist/settings.js.map +1 -1
- package/dist/source-security.d.ts +4 -0
- package/dist/source-security.d.ts.map +1 -0
- package/dist/source-security.js +56 -0
- package/dist/source-security.js.map +1 -0
- package/dist/source-text.d.ts +16 -0
- package/dist/source-text.d.ts.map +1 -1
- package/dist/source-text.js +46 -16
- package/dist/source-text.js.map +1 -1
- package/dist/toolchain-pins.d.ts.map +1 -1
- package/dist/toolchain-pins.js +2 -19
- package/dist/toolchain-pins.js.map +1 -1
- package/dist/version-policy.d.ts +7 -8
- package/dist/version-policy.d.ts.map +1 -1
- package/dist/version-policy.js +46 -26
- package/dist/version-policy.js.map +1 -1
- package/dist/vulnerability-policy.d.ts.map +1 -1
- package/dist/vulnerability-policy.js +1 -11
- package/dist/vulnerability-policy.js.map +1 -1
- package/dist/wiring-policy.d.ts.map +1 -1
- package/dist/wiring-policy.js +4 -1
- package/dist/wiring-policy.js.map +1 -1
- package/dist/wiring-violation.d.ts.map +1 -1
- package/dist/wiring-violation.js +1 -6
- package/dist/wiring-violation.js.map +1 -1
- package/dist/workspace-policy.d.ts.map +1 -1
- package/dist/workspace-policy.js +3 -9
- package/dist/workspace-policy.js.map +1 -1
- package/dist/yaml-blocks.d.ts +10 -0
- package/dist/yaml-blocks.d.ts.map +1 -1
- package/dist/yaml-blocks.js +20 -0
- package/dist/yaml-blocks.js.map +1 -1
- package/package.json +2 -2
- package/dist/url-safety.d.ts +0 -12
- package/dist/url-safety.d.ts.map +0 -1
- package/dist/url-safety.js +0 -58
- package/dist/url-safety.js.map +0 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Explain a build failure whose own message names the wrong cause.
|
|
3
|
+
*
|
|
4
|
+
* Returns nothing for output it does not recognise, which is the common case: this adds a paragraph to
|
|
5
|
+
* a failure that already stands on its own, and says nothing rather than guessing.
|
|
6
|
+
* @param output the build's combined stdout and stderr.
|
|
7
|
+
* @returns hint lines to append to the gate's findings, in the order they were matched.
|
|
8
|
+
*/
|
|
9
|
+
export declare const diagnoseBuildFailure: (output: string) => readonly string[];
|
|
10
|
+
//# sourceMappingURL=build-diagnosis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-diagnosis.d.ts","sourceRoot":"","sources":["../src/build-diagnosis.ts"],"names":[],"mappings":"AAsCA;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,GAAI,QAAQ,MAAM,KAAG,SAAS,MAAM,EAGlE,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Naming a build failure whose message points at the wrong layer.
|
|
2
|
+
//
|
|
3
|
+
// The `build` gate runs the project's own build script, which routes through the test-database wrapper
|
|
4
|
+
// so a build cannot read, or write, the database a developer is using. That isolation is worth having
|
|
5
|
+
// and it is also what surfaces a latent Next issue as an unreadable Postgres error: a page that reads
|
|
6
|
+
// the Payload Local API and uses no request-time API is PRERENDERED at build time, so it runs against
|
|
7
|
+
// the freshly created, schema-less database and dies with `relation "..." does not exist`.
|
|
8
|
+
//
|
|
9
|
+
// Nothing about that message says the page is the problem. A plain `next build` does not fail this way,
|
|
10
|
+
// because it reaches the development database, which has a schema from dev push-mode - so the natural
|
|
11
|
+
// reading is that the wrapper is broken. This module says what actually happened, and it is a
|
|
12
|
+
// DIAGNOSIS appended to a failure rather than a rule: the gate already failed, and would fail without
|
|
13
|
+
// it. That is why the pattern being wrong can cost a confusing extra line and nothing else.
|
|
14
|
+
// Matched on the shape Postgres itself prints, unquoted or quoted, rather than on any table name: the
|
|
15
|
+
// name is the project's and the message is the driver's.
|
|
16
|
+
const MISSING_RELATION = /relation "?[\w.$]+"? does not exist/i;
|
|
17
|
+
const PRERENDER_HINT = [
|
|
18
|
+
'a page that reads the Payload Local API was prerendered against the empty build database',
|
|
19
|
+
'the build runs through the test-database wrapper, which creates a database with no schema, so a ' +
|
|
20
|
+
'page rendered at build time finds no tables; a plain `next build` hides this by reaching the ' +
|
|
21
|
+
'development database instead',
|
|
22
|
+
'await `connection()` from `next/server` in the function that reads Payload, which makes the page ' +
|
|
23
|
+
'render per request rather than at build time',
|
|
24
|
+
"`export const dynamic = 'force-dynamic'` still works, but it has moved to the \"Caching " +
|
|
25
|
+
'(Previous Model)" guide and is removed under Cache Components, so `connection()` is the current ' +
|
|
26
|
+
'spelling',
|
|
27
|
+
];
|
|
28
|
+
const DIAGNOSES = [{ pattern: MISSING_RELATION, hint: PRERENDER_HINT }];
|
|
29
|
+
/**
|
|
30
|
+
* Explain a build failure whose own message names the wrong cause.
|
|
31
|
+
*
|
|
32
|
+
* Returns nothing for output it does not recognise, which is the common case: this adds a paragraph to
|
|
33
|
+
* a failure that already stands on its own, and says nothing rather than guessing.
|
|
34
|
+
* @param output the build's combined stdout and stderr.
|
|
35
|
+
* @returns hint lines to append to the gate's findings, in the order they were matched.
|
|
36
|
+
*/
|
|
37
|
+
export const diagnoseBuildFailure = (output) => DIAGNOSES.flatMap((diagnosis) => diagnosis.pattern.test(output) ? diagnosis.hint : []);
|
|
38
|
+
//# sourceMappingURL=build-diagnosis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-diagnosis.js","sourceRoot":"","sources":["../src/build-diagnosis.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,EAAE;AACF,uGAAuG;AACvG,sGAAsG;AACtG,sGAAsG;AACtG,sGAAsG;AACtG,2FAA2F;AAC3F,EAAE;AACF,wGAAwG;AACxG,sGAAsG;AACtG,8FAA8F;AAC9F,sGAAsG;AACtG,4FAA4F;AAQ5F,sGAAsG;AACtG,yDAAyD;AACzD,MAAM,gBAAgB,GAAW,sCAAsC,CAAA;AAEvE,MAAM,cAAc,GAAsB;IACxC,0FAA0F;IAC1F,kGAAkG;QAChG,+FAA+F;QAC/F,8BAA8B;IAChC,mGAAmG;QACjG,8CAA8C;IAChD,0FAA0F;QACxF,kGAAkG;QAClG,UAAU;CACb,CAAA;AAED,MAAM,SAAS,GAAyB,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAA;AAE7F;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,MAAc,EAAqB,EAAE,CACxE,SAAS,CAAC,OAAO,CAAC,CAAC,SAAoB,EAAqB,EAAE,CAC5D,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CACrD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container-failure.d.ts","sourceRoot":"","sources":["../src/container-failure.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"container-failure.d.ts","sourceRoot":"","sources":["../src/container-failure.ts"],"names":[],"mappings":"AAEA,mEAAmE;AACnE,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED,2DAA2D;AAC3D,MAAM,MAAM,iBAAiB,GACzB,QAAQ,GACR,YAAY,GACZ,aAAa,GACb,aAAa,GACb,iBAAiB,GACjB,aAAa,CAAA;AAEjB,mEAAmE;AACnE,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAA;IAChC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;CACrC;AAED,kEAAkE;AAClE,eAAO,MAAM,iBAAiB,EAAE,MAAY,CAAA;AAyG5C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oBAAoB,GAC/B,MAAM,MAAM,EACZ,YAAY,YAAY,KACvB,aAAa,GAAG,SAalB,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB,GAChC,MAAM,MAAM,EACZ,YAAY,YAAY,KACvB,aAAa,GAAG,SAOlB,CAAA"}
|
|
@@ -1,21 +1,4 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
// `docker run` passes the container's own exit code through, so a gate that reads every non-zero exit as
|
|
4
|
-
// the tool's verdict reads a failure of Docker as a finding. The consequence was not cosmetic: a Docker
|
|
5
|
-
// Hub pull-rate limit - 100 anonymous pulls per six hours per IP, which several teams behind one CI
|
|
6
|
-
// egress reach - made the secret scan announce that it had found a secret in the git history. That is the
|
|
7
|
-
// one verdict a project cannot dismiss on its own judgement, and the worst thing this harness can say. A
|
|
8
|
-
// registry outage, an unreachable network, and a digest the registry no longer serves all landed the same
|
|
9
|
-
// way.
|
|
10
|
-
//
|
|
11
|
-
// Two classifiers rather than one, and the split is the actual repair. `classifyImageFailure` reads
|
|
12
|
-
// markers out of the output because it judges `docker image inspect` and `docker pull`, whose every byte
|
|
13
|
-
// docker wrote. `classifyContainerExit` judges a run of the analyzer, whose output carries content the
|
|
14
|
-
// PROJECT authored - a commit message, a Dockerfile, a workflow - so it reads the exit code and nothing
|
|
15
|
-
// else. Matching `no such host` against a commit message would invert the same bug rather than fix it.
|
|
16
|
-
//
|
|
17
|
-
// The rules are pure so they are exercised against captured `docker` output rather than against a live
|
|
18
|
-
// daemon: every branch below describes a failure that is expensive or impossible to stage on demand.
|
|
1
|
+
// Distinguish unavailable container infrastructure from analyzer findings so each failure names the right repair.
|
|
19
2
|
/** The exit code a shell reports for a command it cannot find. */
|
|
20
3
|
export const COMMAND_NOT_FOUND = 127;
|
|
21
4
|
// `docker run` reserves these for a failure of docker itself, distinct from whatever the container exits
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container-failure.js","sourceRoot":"","sources":["../src/container-failure.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"container-failure.js","sourceRoot":"","sources":["../src/container-failure.ts"],"names":[],"mappings":"AAAA,kHAAkH;AAwBlH,kEAAkE;A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;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,IAAY,EACZ,UAAwB,EACG,EAAE;IAC7B,IAAI,UAAU,CAAC,IAAI,KAAK,iBAAiB,EAAE,CAAC;QAC1C,OAAO,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;IACnC,CAAC;IACD,OAAO,UAAU,CAAC,IAAI,KAAK,oBAAoB,IAAI,UAAU,CAAC,IAAI,KAAK,0BAA0B;QAC/F,CAAC,CAAC,UAAU,CAAC,aAAa,EAAE,IAAI,CAAC;QACjC,CAAC,CAAC,SAAS,CAAA;AACf,CAAC,CAAA"}
|
|
@@ -17,6 +17,22 @@ export declare const isDockerfile: (file: string) => boolean;
|
|
|
17
17
|
* @returns true when the file identifies a compose project.
|
|
18
18
|
*/
|
|
19
19
|
export declare const isComposeFile: (file: string) => boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Whether a tracked path is a GitHub Actions workflow.
|
|
22
|
+
* @param file the repo-relative path.
|
|
23
|
+
* @returns true for a YAML file directly under `.github/workflows`.
|
|
24
|
+
*/
|
|
25
|
+
export declare const isWorkflowFile: (file: string) => boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Every workflow the repository tracks.
|
|
28
|
+
*
|
|
29
|
+
* Discovered from the working tree rather than listed, for the reason `scripts/verify.sh` records about
|
|
30
|
+
* its own shell scripts: an enumeration is correct only at the moment it is written, and a workflow
|
|
31
|
+
* added later would be a workflow nothing reads.
|
|
32
|
+
* @param tracked the repo-relative paths of the tracked files.
|
|
33
|
+
* @returns the workflows, ordered so a report reads the same on every machine.
|
|
34
|
+
*/
|
|
35
|
+
export declare const workflowsIn: (tracked: readonly string[]) => readonly string[];
|
|
20
36
|
/**
|
|
21
37
|
* Every Dockerfile the repository tracks.
|
|
22
38
|
* @param tracked the repo-relative paths of the tracked files.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container-files.d.ts","sourceRoot":"","sources":["../src/container-files.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"container-files.d.ts","sourceRoot":"","sources":["../src/container-files.ts"],"names":[],"mappings":"AAEA,qFAAqF;AACrF,MAAM,WAAW,cAAc;IAC7B,iFAAiF;IACjF,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,yDAAyD;IACzD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB;AAqBD;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,KAAG,OAG3C,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,KAAG,OAAuD,CAAA;AASpG;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,KAAG,OAG8B,CAAA;AAE5E;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,GAAI,SAAS,SAAS,MAAM,EAAE,KAAG,SAAS,MAAM,EAGS,CAAA;AAEjF;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,SAAS,SAAS,MAAM,EAAE,KAAG,SAAS,MAAM,EAGO,CAAA;AAEjF;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,GAAI,SAAS,SAAS,MAAM,EAAE,KAAG,SAAS,cAAc,EAcrF,CAAA"}
|
package/dist/container-files.js
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
// Discovery is stated here for both kinds at once, because stating it for only one is how the two halves
|
|
4
|
-
// drifted. The Dockerfile half already walked the tracked tree - a project may keep a Dockerfile in any
|
|
5
|
-
// directory, and a hard-coded path would silently skip the ones it did not anticipate - while the compose
|
|
6
|
-
// half looked at the repository root and nowhere else. A Payload project that keeps its application in a
|
|
7
|
-
// member directory keeps its compose file beside it, so the gate linted that member's Dockerfile and
|
|
8
|
-
// reported a pass having validated no compose project at all.
|
|
1
|
+
// Identify container definitions and compose projects from the working-tree inventory.
|
|
9
2
|
// Sliced rather than split, so neither helper carries a case that cannot happen. `lastIndexOf`
|
|
10
3
|
// returns -1 for a bare basename, which makes these the whole string and the empty string - the two
|
|
11
4
|
// answers a repository-root file wants - without a fallback no input could reach.
|
|
@@ -40,6 +33,28 @@ export const isComposeFile = (file) => COMPOSE_BASENAMES.includes(basenameOf(fil
|
|
|
40
33
|
// Where a name sits in compose's own precedence. Only ever asked of a file `isComposeFile` accepted,
|
|
41
34
|
// so the -1 `indexOf` returns for anything else is unreachable rather than meaningful.
|
|
42
35
|
const precedenceOf = (file) => COMPOSE_BASENAMES.indexOf(basenameOf(file));
|
|
36
|
+
const WORKFLOW_DIRECTORY = '.github/workflows/';
|
|
37
|
+
const WORKFLOW_SUFFIXES = ['.yml', '.yaml'];
|
|
38
|
+
/**
|
|
39
|
+
* Whether a tracked path is a GitHub Actions workflow.
|
|
40
|
+
* @param file the repo-relative path.
|
|
41
|
+
* @returns true for a YAML file directly under `.github/workflows`.
|
|
42
|
+
*/
|
|
43
|
+
export const isWorkflowFile = (file) => file.startsWith(WORKFLOW_DIRECTORY) &&
|
|
44
|
+
!file.slice(WORKFLOW_DIRECTORY.length).includes('/') &&
|
|
45
|
+
WORKFLOW_SUFFIXES.some((suffix) => file.endsWith(suffix));
|
|
46
|
+
/**
|
|
47
|
+
* Every workflow the repository tracks.
|
|
48
|
+
*
|
|
49
|
+
* Discovered from the working tree rather than listed, for the reason `scripts/verify.sh` records about
|
|
50
|
+
* its own shell scripts: an enumeration is correct only at the moment it is written, and a workflow
|
|
51
|
+
* added later would be a workflow nothing reads.
|
|
52
|
+
* @param tracked the repo-relative paths of the tracked files.
|
|
53
|
+
* @returns the workflows, ordered so a report reads the same on every machine.
|
|
54
|
+
*/
|
|
55
|
+
export const workflowsIn = (tracked) => tracked
|
|
56
|
+
.filter((file) => isWorkflowFile(file))
|
|
57
|
+
.toSorted((left, right) => left.localeCompare(right));
|
|
43
58
|
/**
|
|
44
59
|
* Every Dockerfile the repository tracks.
|
|
45
60
|
* @param tracked the repo-relative paths of the tracked files.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container-files.js","sourceRoot":"","sources":["../src/container-files.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"container-files.js","sourceRoot":"","sources":["../src/container-files.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAUvF,+FAA+F;AAC/F,oGAAoG;AACpG,kFAAkF;AAClF,MAAM,UAAU,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;AAElF,MAAM,WAAW,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AAE/F,4EAA4E;AAC5E,EAAE;AACF,yGAAyG;AACzG,0GAA0G;AAC1G,2FAA2F;AAC3F,MAAM,iBAAiB,GAAsB;IAC3C,cAAc;IACd,aAAa;IACb,qBAAqB;IACrB,oBAAoB;CACrB,CAAA;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAY,EAAW,EAAE;IACpD,MAAM,IAAI,GAAW,UAAU,CAAC,IAAI,CAAC,CAAA;IACrC,OAAO,IAAI,KAAK,YAAY,IAAI,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,CAAA;AAChG,CAAC,CAAA;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAAY,EAAW,EAAE,CAAC,iBAAiB,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAA;AAEpG,qGAAqG;AACrG,uFAAuF;AACvF,MAAM,YAAY,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,iBAAiB,C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AAC,CAAC,CAAA;IAC/F,OAAO,CAAC,GAAG,IAAI,GAAG,CAAS,KAAK,CAAC,GAAG,CAAC,CAAC,IAAY,EAAU,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SAChF,QAAQ,CAAC,CAAC,IAAY,EAAE,KAAa,EAAU,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;SAC5E,OAAO,CAAC,CAAC,SAAiB,EAA6B,EAAE;IACxD,gGAAgG;IAChG,kGAAkG;IAClG,2FAA2F;IAC3F,KAAK;SACF,MAAM,CAAC,CAAC,IAAY,EAAW,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC;SAClE,QAAQ,CAAC,CAAC,IAAY,EAAE,KAAa,EAAU,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;SAC3F,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;SACX,GAAG,CAAC,CAAC,IAAY,EAAkB,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAChE,CAAA;AACL,CAAC,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Join backslash-continued lines, so a `RUN` split across lines reads as the one command it is.
|
|
3
|
+
* @param text the file body.
|
|
4
|
+
* @returns one entry per logical line.
|
|
5
|
+
*/
|
|
6
|
+
export declare const logicalLines: (text: string) => readonly string[];
|
|
7
|
+
/**
|
|
8
|
+
* The images a Dockerfile pulls: every `FROM` that names a registry image rather than an earlier stage.
|
|
9
|
+
* @param text the Dockerfile body.
|
|
10
|
+
* @returns the references in file order, with `ARG` defaults substituted.
|
|
11
|
+
*/
|
|
12
|
+
export declare const imageReferencesInDockerfile: (text: string) => readonly string[];
|
|
13
|
+
/**
|
|
14
|
+
* The system packages a Dockerfile installs through the base image's package manager.
|
|
15
|
+
* @param text the Dockerfile body.
|
|
16
|
+
* @returns every package name after an install verb, in file order.
|
|
17
|
+
*/
|
|
18
|
+
export declare const systemPackagesInDockerfile: (text: string) => readonly string[];
|
|
19
|
+
/**
|
|
20
|
+
* The images a GitHub Actions workflow pulls: service containers, job containers, and Docker actions.
|
|
21
|
+
* @param text the workflow body.
|
|
22
|
+
* @returns the references in file order.
|
|
23
|
+
*/
|
|
24
|
+
export declare const imageReferencesInWorkflow: (text: string) => readonly string[];
|
|
25
|
+
/** One service of a compose model and the image it pulls. */
|
|
26
|
+
export interface ComposeImage {
|
|
27
|
+
readonly service: string;
|
|
28
|
+
readonly image: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The images a rendered compose model pulls. A service with a `build` is judged through its Dockerfile,
|
|
32
|
+
* and its `image` is only the name the build is tagged with.
|
|
33
|
+
* @param json the output of `docker compose config --format json`.
|
|
34
|
+
* @returns the pulled images by service name, or undefined when the text is not a compose model.
|
|
35
|
+
*/
|
|
36
|
+
export declare const imageReferencesInComposeModel: (json: string) => readonly ComposeImage[] | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Whether a reference still carries a variable nothing substituted, so no rule can say what it pulls.
|
|
39
|
+
* @param reference the reference as read.
|
|
40
|
+
* @returns true when a `$` remains in it.
|
|
41
|
+
*/
|
|
42
|
+
export declare const hasUnresolvedVariable: (reference: string) => boolean;
|
|
43
|
+
//# sourceMappingURL=container-images.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container-images.d.ts","sourceRoot":"","sources":["../src/container-images.ts"],"names":[],"mappings":"AAuCA;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,KAAG,SAAS,MAAM,EACX,CAAA;AAmEhD;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,GAAI,MAAM,MAAM,KAAG,SAAS,MAAM,EAK5D,CAAA;AAed;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,GAAI,MAAM,MAAM,KAAG,SAAS,MAAM,EAQrE,CAAA;AASJ;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,GAAI,MAAM,MAAM,KAAG,SAAS,MAAM,EAOlE,CAAA;AAEN,6DAA6D;AAC7D,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB;AAED;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,GACxC,MAAM,MAAM,KACX,SAAS,YAAY,EAAE,GAAG,SAc5B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAAI,WAAW,MAAM,KAAG,OAAkC,CAAA"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
// Where a repository names the container images it pulls, read into plain references.
|
|
2
|
+
//
|
|
3
|
+
// Three files name an image: a Dockerfile in its `FROM` lines, a workflow in the `image:` of a service
|
|
4
|
+
// or job container and in a `docker://` action, and a compose file in `services.*.image`. The compose
|
|
5
|
+
// half is read from the model `docker compose config --format json` renders rather than from the YAML,
|
|
6
|
+
// because compose interpolates `${VARIABLE}` from the `.env` beside the file and resolves the override
|
|
7
|
+
// files it merges, and a reader of the source text would judge a reference the daemon never pulls.
|
|
8
|
+
//
|
|
9
|
+
// The Dockerfile and workflow readers are line readers over a known syntax, in the spirit of
|
|
10
|
+
// `yaml-blocks.ts`: what has to be recognised is one keyword and the token after it.
|
|
11
|
+
import { asRecord, asText, isArray, isRecord, parseJsonc } from './json-shapes.js';
|
|
12
|
+
import { withoutQuotes } from './yaml-blocks.js';
|
|
13
|
+
const CONTINUATION = /\\\r?\n/g;
|
|
14
|
+
// A keyword, horizontal space, then a value that starts with a non-space: the value pattern cannot
|
|
15
|
+
// exchange characters with the space run before it, which is what keeps the match linear.
|
|
16
|
+
const FROM_LINE = /^[ \t]*FROM[ \t]+(?<rest>\S.*)$/i;
|
|
17
|
+
const ARG_LINE = /^[ \t]*ARG[ \t]+(?<name>[A-Z_]\w*)=(?<value>\S+)/i;
|
|
18
|
+
const RUN_LINE = /^[ \t]*RUN[ \t]+(?<rest>\S.*)$/i;
|
|
19
|
+
const COMMENT_LINE = /^[ \t]*#/;
|
|
20
|
+
// A base image every multi-stage build may start from that no registry serves.
|
|
21
|
+
const SCRATCH = 'scratch';
|
|
22
|
+
const STAGE_KEYWORD = 'as';
|
|
23
|
+
const PLATFORM_OPTION = '--';
|
|
24
|
+
// The install verbs of the package managers a base image ships. `apt-get install`, `apk add`, and the
|
|
25
|
+
// Red Hat family; pip and npm are language installs and judged elsewhere.
|
|
26
|
+
const INSTALL_VERB = /\b(?:apt-get|apt|apk|dnf|microdnf|yum|zypper)[ \t]+(?:install|add)\b/;
|
|
27
|
+
const COMMAND_SEPARATOR = /&&|\|\||;|\|/;
|
|
28
|
+
// What ends a package name in an install token: apt's `=version` and `/suite`, apk's `=version` and
|
|
29
|
+
// `~version`. dnf's `-version` is indistinguishable from a hyphenated name and is left alone.
|
|
30
|
+
const PACKAGE_NAME_END = /[=/~]/;
|
|
31
|
+
const OPTION_PREFIX = '-';
|
|
32
|
+
const WORKFLOW_IMAGE = /^[ \t]*(?:-[ \t]*)?image:[ \t]*(?<value>[^\s#][^#]*)/;
|
|
33
|
+
const WORKFLOW_CONTAINER = /^[ \t]*container:[ \t]*(?<value>[^\s#{]+)/;
|
|
34
|
+
const WORKFLOW_DOCKER_ACTION = /uses:[ \t]*['"]?docker:\/\/(?<value>[^\s'"]+)/;
|
|
35
|
+
/**
|
|
36
|
+
* Join backslash-continued lines, so a `RUN` split across lines reads as the one command it is.
|
|
37
|
+
* @param text the file body.
|
|
38
|
+
* @returns one entry per logical line.
|
|
39
|
+
*/
|
|
40
|
+
export const logicalLines = (text) => text.replaceAll(CONTINUATION, ' ').split('\n');
|
|
41
|
+
const contentLines = (text) => logicalLines(text).filter((line) => !COMMENT_LINE.test(line));
|
|
42
|
+
const readFrom = (rest) => {
|
|
43
|
+
const tokens = (rest ?? '')
|
|
44
|
+
.trim()
|
|
45
|
+
.split(/[ \t]+/)
|
|
46
|
+
.filter((token) => !token.startsWith(PLATFORM_OPTION));
|
|
47
|
+
const [first, keyword, stage] = tokens;
|
|
48
|
+
const reference = first ?? '';
|
|
49
|
+
if (reference.length === 0) {
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
return { reference, stage: keyword?.toLowerCase() === STAGE_KEYWORD ? stage : undefined };
|
|
53
|
+
};
|
|
54
|
+
// `FROM node:${NODE_VERSION}` is the common way to state a version once, and the ARG that gives it a
|
|
55
|
+
// default is the only place the value lives. Both spellings of a reference are substituted; an ARG with
|
|
56
|
+
// no default leaves the variable in place, and the rule reports it as a reference it cannot judge.
|
|
57
|
+
const substituteArguments = (reference, defaults) => [...defaults].reduce((resolved, [name, value]) => resolved
|
|
58
|
+
.replaceAll(`\${${name}}`, () => value)
|
|
59
|
+
.replaceAll(`$${name}`, () => value), reference);
|
|
60
|
+
const recordArgument = (walk, line) => {
|
|
61
|
+
const found = ARG_LINE.exec(line);
|
|
62
|
+
if (found?.groups === undefined) {
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
const defaults = new Map([
|
|
66
|
+
...walk.defaults,
|
|
67
|
+
[found.groups['name'] ?? '', withoutQuotes(found.groups['value'] ?? '')],
|
|
68
|
+
]);
|
|
69
|
+
return { ...walk, defaults };
|
|
70
|
+
};
|
|
71
|
+
const recordFrom = (walk, line) => {
|
|
72
|
+
const from = readFrom(FROM_LINE.exec(line)?.groups?.['rest']);
|
|
73
|
+
if (from === undefined) {
|
|
74
|
+
return walk;
|
|
75
|
+
}
|
|
76
|
+
const reference = substituteArguments(from.reference, walk.defaults);
|
|
77
|
+
const isRegistryImage = reference !== SCRATCH && !walk.stages.has(reference);
|
|
78
|
+
return {
|
|
79
|
+
defaults: walk.defaults,
|
|
80
|
+
stages: from.stage === undefined ? walk.stages : new Set([...walk.stages, from.stage]),
|
|
81
|
+
references: isRegistryImage ? [...walk.references, reference] : walk.references,
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* The images a Dockerfile pulls: every `FROM` that names a registry image rather than an earlier stage.
|
|
86
|
+
* @param text the Dockerfile body.
|
|
87
|
+
* @returns the references in file order, with `ARG` defaults substituted.
|
|
88
|
+
*/
|
|
89
|
+
export const imageReferencesInDockerfile = (text) => contentLines(text).reduce((walk, line) => recordArgument(walk, line) ?? recordFrom(walk, line), { defaults: new Map(), stages: new Set(), references: [] }).references;
|
|
90
|
+
const packagesInCommand = (command) => {
|
|
91
|
+
const verb = INSTALL_VERB.exec(command);
|
|
92
|
+
if (verb === null) {
|
|
93
|
+
return [];
|
|
94
|
+
}
|
|
95
|
+
return command
|
|
96
|
+
.slice(verb.index + verb[0].length)
|
|
97
|
+
.trim()
|
|
98
|
+
.split(/[ \t]+/)
|
|
99
|
+
.filter((token) => token.length > 0 && !token.startsWith(OPTION_PREFIX))
|
|
100
|
+
.map((token) => token.split(PACKAGE_NAME_END)[0] ?? '');
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* The system packages a Dockerfile installs through the base image's package manager.
|
|
104
|
+
* @param text the Dockerfile body.
|
|
105
|
+
* @returns every package name after an install verb, in file order.
|
|
106
|
+
*/
|
|
107
|
+
export const systemPackagesInDockerfile = (text) => contentLines(text).flatMap((line) => {
|
|
108
|
+
const rest = RUN_LINE.exec(line)?.groups?.['rest'];
|
|
109
|
+
return rest === undefined
|
|
110
|
+
? []
|
|
111
|
+
: rest
|
|
112
|
+
.split(COMMAND_SEPARATOR)
|
|
113
|
+
.flatMap((command) => packagesInCommand(command));
|
|
114
|
+
});
|
|
115
|
+
const workflowReferenceIn = (line) => {
|
|
116
|
+
const found = WORKFLOW_DOCKER_ACTION.exec(line) ?? WORKFLOW_IMAGE.exec(line) ?? WORKFLOW_CONTAINER.exec(line);
|
|
117
|
+
const value = found?.groups?.['value'];
|
|
118
|
+
return value === undefined ? undefined : withoutQuotes(value.trim());
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* The images a GitHub Actions workflow pulls: service containers, job containers, and Docker actions.
|
|
122
|
+
* @param text the workflow body.
|
|
123
|
+
* @returns the references in file order.
|
|
124
|
+
*/
|
|
125
|
+
export const imageReferencesInWorkflow = (text) => text
|
|
126
|
+
.split('\n')
|
|
127
|
+
.filter((line) => !COMMENT_LINE.test(line))
|
|
128
|
+
.flatMap((line) => {
|
|
129
|
+
const reference = workflowReferenceIn(line);
|
|
130
|
+
return reference === undefined || reference.length === 0 ? [] : [reference];
|
|
131
|
+
});
|
|
132
|
+
/**
|
|
133
|
+
* The images a rendered compose model pulls. A service with a `build` is judged through its Dockerfile,
|
|
134
|
+
* and its `image` is only the name the build is tagged with.
|
|
135
|
+
* @param json the output of `docker compose config --format json`.
|
|
136
|
+
* @returns the pulled images by service name, or undefined when the text is not a compose model.
|
|
137
|
+
*/
|
|
138
|
+
export const imageReferencesInComposeModel = (json) => {
|
|
139
|
+
const model = parseJsonc(json).value;
|
|
140
|
+
if (!isRecord(model) || isArray(model) || !isRecord(model['services'])) {
|
|
141
|
+
return undefined;
|
|
142
|
+
}
|
|
143
|
+
return Object.entries(model['services'])
|
|
144
|
+
.flatMap(([service, definition]) => {
|
|
145
|
+
const image = asText(asRecord(definition)['image']);
|
|
146
|
+
const isBuilt = asRecord(definition)['build'] !== undefined;
|
|
147
|
+
return isBuilt || image.length === 0 ? [] : [{ service, image }];
|
|
148
|
+
})
|
|
149
|
+
.toSorted((one, other) => one.service.localeCompare(other.service));
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* Whether a reference still carries a variable nothing substituted, so no rule can say what it pulls.
|
|
153
|
+
* @param reference the reference as read.
|
|
154
|
+
* @returns true when a `$` remains in it.
|
|
155
|
+
*/
|
|
156
|
+
export const hasUnresolvedVariable = (reference) => reference.includes('$');
|
|
157
|
+
//# sourceMappingURL=container-images.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container-images.js","sour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A;AAQN;;;;;GAKG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAC3C,IAAY,EACyB,EAAE;IACvC,MAAM,KAAK,GAAY,UAAU,CAAC,IAAI,CAAC,CAAC,KAAK,CAAA;IAC7C,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC;QACvE,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;SACrC,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE,UAAU,CAA6B,EAA2B,EAAE;QACtF,MAAM,KAAK,GAAW,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,CAAA;QAC3D,MAAM,OAAO,GAAY,QAAQ,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,KAAK,SAAS,CAAA;QACpE,OAAO,OAAO,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAA;IAClE,CAAC,CAAC;SACD,QAAQ,CAAC,CAAC,GAAiB,EAAE,KAAmB,EAAU,EAAE,CAC3D,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CACzC,CAAA;AACL,CAAC,CAAA;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,SAAiB,EAAW,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA"}
|
|
@@ -53,6 +53,14 @@ export interface DeclaredCoordinate {
|
|
|
53
53
|
export interface DependencyStatus extends DeclaredCoordinate {
|
|
54
54
|
/** The latest version published to the registry. */
|
|
55
55
|
readonly latest: string;
|
|
56
|
+
/**
|
|
57
|
+
* The licence the registry records for that latest version, when it records one.
|
|
58
|
+
*
|
|
59
|
+
* Carried so the blocklist can keep the bound from demanding an upgrade into a release the licence
|
|
60
|
+
* gate would refuse: a package that changed licence at its newest major is still measured, but never
|
|
61
|
+
* past the last release a project may install.
|
|
62
|
+
*/
|
|
63
|
+
readonly latestLicense?: string;
|
|
56
64
|
}
|
|
57
65
|
/** One parsed manifest, with the path a finding will name. */
|
|
58
66
|
export interface ManifestSource {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependency-freshness.d.ts","sourceRoot":"","sources":["../src/dependency-freshness.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dependency-freshness.d.ts","sourceRoot":"","sources":["../src/dependency-freshness.ts"],"names":[],"mappings":"AAKA,kFAAkF;AAClF,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAA;AAEvD,qGAAqG;AACrG,eAAO,MAAM,oBAAoB,EAAE,MAAU,CAAA;AAE7C,iFAAiF;AACjF,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAC5B;AAQD;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,KAAG,aAAa,GAAG,SAW1D,CAAA;AA0BD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,GAAI,SAAS,MAAM,EAAE,QAAQ,MAAM,KAAG,gBAUnE,CAAA;AAED,wFAAwF;AACxF,MAAM,WAAW,kBAAkB;IACjC,gEAAgE;IAChE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,qFAAqF;IACrF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,gDAAgD;IAChD,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,CAAC,QAAQ,EAAE,SAAS,gBAAgB,EAAE,CAAA;CAC/C;AAYD;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,GAAI,UAAU,SAAS,gBAAgB,EAAE,KAAG,eAiB/E,CAAA"}
|
|
@@ -1,22 +1,6 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
3
|
-
// packages/cli/src/checks/dependencies.ts reads the manifests and asks the registry.
|
|
4
|
-
//
|
|
5
|
-
// Policy: a declared dependency (transitive deps never count) whose current major version is
|
|
6
|
-
// MAJOR_FAIL_THRESHOLD or more behind the latest published major FAILS the build; any lesser lag (a
|
|
7
|
-
// single major behind, or a minor/patch behind) appears in the non-failing update report. The Biome config `$schema`
|
|
8
|
-
// URL version is fed through the same classifier as a pseudo-dependency. There is no exemption list:
|
|
9
|
-
// every declared dependency is MEASURED against the same bar, so a deliberately old pin that falls two
|
|
10
|
-
// majors behind must be bumped or the pin dropped.
|
|
11
|
-
//
|
|
12
|
-
// One thing the bar does not decide is who the build stops. A coordinate an INHERITED manifest declares
|
|
13
|
-
// is measured identically and reported at its real verdict, and it never fails the build: the version
|
|
14
|
-
// belongs to ploaness, the project has no file in which to change it, and a gate that stopped every
|
|
15
|
-
// consumer at once over a pin none of them can edit would be reporting ploaness's defect as theirs.
|
|
16
|
-
// That is a statement about whose repair it is rather than an exemption from the measurement, which is
|
|
17
|
-
// why the verdict survives into the report instead of being softened into an ordinary update.
|
|
1
|
+
// Compare declared coordinates with stable releases and apply the fixed major-version freshness bound.
|
|
2
|
+
import { isHarnessPackage } from './harness-package.js';
|
|
18
3
|
import { declaredDependencies } from './json-shapes.js';
|
|
19
|
-
import { isHarnessPackage } from './version-policy.js';
|
|
20
4
|
/** Major-version gap (`latest.major - current.major`) at or above which the gate FAILS the build. */
|
|
21
5
|
export const MAJOR_FAIL_THRESHOLD = 2;
|
|
22
6
|
// A leading range operator (`^ ~ >= <= = v`) or whitespace is tolerated, then the numeric core is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependency-freshness.js","sourceRoot":"","sources":["../src/dependency-freshness.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"dependency-freshness.js","sourceRoot":"","sources":["../src/dependency-freshness.ts"],"names":[],"mappings":"AAAA,uGAAuG;AAEvG,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAKvD,qGAAqG;AACrG,MAAM,CAAC,MAAM,oBAAoB,GAAW,CAAC,CAAA;AAU7C,kGAAkG;AAClG,kGAAkG;AAClG,qGAAqG;AACrG,oEAAoE;AACpE,MAAM,eAAe,GAAW,0DAA0D,CAAA;AAE1F;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,GAAW,EAA6B,EAAE;IACrE,MAAM,KAAK,GAA2B,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAC/D,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC;QAC9B,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC;QAC9B,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC;QAC9B,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE;KAC3B,CAAA;AACH,CAAC,CAAA;AAED,qGAAqG;AACrG,wDAAwD;AACxD,MAAM,WAAW,GAAG,CAAC,IAAmB,EAAE,KAAoB,EAAU,EAAE;IACxE,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAA;IACjC,CAAC;IACD,IAAI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AAC,CAAC;KAChG,CAAA;AACH,CAAC,CAAA"}
|
package/dist/doc-blocks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doc-blocks.d.ts","sourceRoot":"","sources":["../src/doc-blocks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"doc-blocks.d.ts","sourceRoot":"","sources":["../src/doc-blocks.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,qBAAqB,EAAE,SAAS,MAAM,EAQlD,CAAA;AAWD,8EAA8E;AAC9E,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AAkDD;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAAI,MAAM,MAAM,KAAG,SAAS,QAAQ,EAKrE,CAAA"}
|
package/dist/doc-blocks.js
CHANGED
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
//
|
|
2
|
-
// block, so the first documents nothing and the symbol it was written for carries no doc at all.
|
|
3
|
-
//
|
|
4
|
-
// This cannot be an eslint-plugin-jsdoc rule, and the reason is structural rather than a gap in that
|
|
5
|
-
// plugin. Every rule it ships visits the block ATTACHED to a syntax node, and an orphan is attached to
|
|
6
|
-
// nothing: the parser hands a declaration only the LAST block comment before it and discards the
|
|
7
|
-
// earlier ones as leading trivia. The defect is invisible to the one analyzer that exists for
|
|
8
|
-
// documenting comments, which is why it is a text rule here - the text is the only place it is still
|
|
9
|
-
// visible.
|
|
10
|
-
//
|
|
11
|
-
// It is a real class rather than a hypothetical. Four instances were found in this repository the
|
|
12
|
-
// first time anything looked, each one a doc that had been moved above the wrong symbol and left
|
|
13
|
-
// there, and each one carried the description of a symbol that was then undocumented.
|
|
1
|
+
// Report documenting blocks detached from a declaration by another documenting block.
|
|
14
2
|
// Extensions whose comment syntax this rule understands. A stylesheet shares the delimiters but has
|
|
15
3
|
// no JSDoc, so two adjacent blocks there are two comments rather than one orphan - which is why this
|
|
16
4
|
// list is narrower than CODE_EXTENSIONS.
|
package/dist/doc-blocks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doc-blocks.js","sourceRoot":"","sources":["../src/doc-blocks.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"doc-blocks.js","sourceRoot":"","sources":["../src/doc-blocks.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,oGAAoG;AACpG,qGAAqG;AACrG,yCAAyC;AACzC,MAAM,CAAC,MAAM,qBAAqB,GAAsB;IACtD,KAAK;IACL,MAAM;IACN,MAAM;IACN,MAAM;IACN,KAAK;IACL,MAAM;IACN,MAAM;CACP,CAAA;AAED,MAAM,QAAQ,GAAW,KAAK,CAAA;AAC9B,MAAM,WAAW,GAAW,IAAI,CAAA;AAEhC,qGAAqG;AACrG,MAAM,aAAa,GAAW,CAAC,CAAC,CAAA;AAEhC,uEAAuE;AACvE,MAAM,UAAU,GAAW,CAAC,CAAA;AAa5B,MAAM,UAAU,GAAc,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,EAAE,CAAA;AAEjE,iGAAiG;AACjG,kGAAkG;AAClG,MAAM,iBAAiB,GAAG,CAAC,OAAe,EAAW,EAAE,CACrD,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAA;AAEtD,MAAM,aAAa,GAAG,CAAC,KAAgB,EAAE,OAAe,EAAE,IAAY,EAAa,EAAE;IACnF,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAClC,OAAO,KAAK,CAAA;IACd,CAAC;IACD,OAAO,iBAAiB,CAAC,OAAO,CAAC;QAC/B,CAAC,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,O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CAAC,CAAC,CAAA;IAC1D,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;AACtD,CAAC,CAAA;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,IAAY,EAAuB,EAAE;IACzE,MAAM,KAAK,GAAsB,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAC1E,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,KAAe,EAAW,EAAE,CAC1D,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CACxC,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-references.d.ts","sourceRoot":"","sources":["../src/document-references.ts"],"names":[],"mappings":"AAYA,kFAAkF;AAClF,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAA;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED,iHAAiH;AACjH,UAAU,uBAAuB;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IACzC,QAAQ,CAAC,cAAc,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAA;IAC1D;;;;OAIG;IACH,QAAQ,CAAC,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC3C;;;OAGG;IACH,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAC3C;
|
|
1
|
+
{"version":3,"file":"document-references.d.ts","sourceRoot":"","sources":["../src/document-references.ts"],"names":[],"mappings":"AAYA,kFAAkF;AAClF,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAA;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED,iHAAiH;AACjH,UAAU,uBAAuB;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IACzC,QAAQ,CAAC,cAAc,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAA;IAC1D;;;;OAIG;IACH,QAAQ,CAAC,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC3C;;;OAGG;IACH,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAC3C;AA2DD;;;GAGG;AACH,eAAO,MAAM,+BAA+B,GAC1C,QAAQ,uBAAuB,KAC9B,SAAS,iBAAiB,EA4B5B,CAAA;AAgBD,iEAAiE;AACjE,MAAM,WAAW,gBAAgB;IAC/B,sCAAsC;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,8FAA8F;IAC9F,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC3B;AAKD;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAC7B,aAAa,SAAS,MAAM,EAAE,EAC9B,gBAAgB,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,KAChD,SAAS,gBAAgB,EAOuD,CAAA"}
|
|
@@ -11,7 +11,13 @@
|
|
|
11
11
|
import { ROOT_MEMBER_PATH } from './workspace-policy.js';
|
|
12
12
|
const BACKTICK_TOKEN = /`[^`\n]+`/g;
|
|
13
13
|
const PNPM_RUN = /pnpm run [a-z][a-z0-9:_-]*/g;
|
|
14
|
-
|
|
14
|
+
// The FAMILIES a backticked token has to belong to before it is read as a script reference. This named
|
|
15
|
+
// `ensure:db` and `with:test-db` as literals, so the whitelist recognised two particular scripts rather
|
|
16
|
+
// than the shape of one: a project that renamed `ensure:db` to `ensure:services` had every backticked
|
|
17
|
+
// mention of the new name quietly stop being checked, and the gate then passed having dropped the
|
|
18
|
+
// reference rather than resolved it. A family is what a whitelist here is for; a specific script name
|
|
19
|
+
// is what it must never be.
|
|
20
|
+
const SCRIPT_TOKEN = /^(?:verify(?::full)?|format|knip|(?:lint|test|generate|ensure|with|seed):[a-z][a-z:-]*)$/;
|
|
15
21
|
const PATH_EXTENSION = /\.(?:tsx?|mts|cts|mjs|cjs|js|jsonc?|ya?ml|md|css|scss|grit)$/;
|
|
16
22
|
const PNPM_RUN_PREFIX = 'pnpm run ';
|
|
17
23
|
const backtickTokens = (markdown) => (markdown.match(BACKTICK_TOKEN) ?? []).map((raw) => raw.slice(1, -1).trim());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-references.js","sourceRoot":"","sources":["../src/document-references.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,qGAAqG;AACrG,EAAE;AACF,4FAA4F;AAC5F,wGAAwG;AACxG,sFAAsF;AACtF,uGAAuG;AACvG,uGAAuG;AACvG,+FAA+F;AAC/F,oGAAoG;AACpG,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AA2BxD,MAAM,cAAc,GAAW,YAAY,CAAA;AAC3C,MAAM,QAAQ,GAAW,6BAA6B,CAAA;AACtD,MAAM,YAAY,GAChB,
|
|
1
|
+
{"version":3,"file":"document-references.js","sourceRoot":"","sources":["../src/document-references.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,qGAAqG;AACrG,EAAE;AACF,4FAA4F;AAC5F,wGAAwG;AACxG,sFAAsF;AACtF,uGAAuG;AACvG,uGAAuG;AACvG,+FAA+F;AAC/F,oGAAoG;AACpG,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AA2BxD,MAAM,cAAc,GAAW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,kBAAkB,GAAG,CAChC,WAA8B,EAC9B,cAAiD,EACpB,EAAE,CAC/B,CAAC,gBAAgB,EAAE,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,IAAY,EAAW,EAAE,CAAC,IAAI,KAAK,gBAAgB,CAAC,CAAC;KAC5F,OAAO,CAAC,CAAC,SAAiB,EAA+B,EAAE,CAC1D,cAAc,CAAC,GAAG,CAChB,CAAC,IAAY,EAAoB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC,CACrF,CACF;KACA,MAAM,CAAC,CAAC,QAA0B,EAAW,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAA"}
|
|
@@ -13,6 +13,13 @@ export interface EditorconfigViolation {
|
|
|
13
13
|
readonly reason: string;
|
|
14
14
|
}
|
|
15
15
|
export declare const parseEditorconfig: (text: string) => EditorconfigRules;
|
|
16
|
+
/**
|
|
17
|
+
* Decide whether the standard's line cap binds for one file.
|
|
18
|
+
* @param filePath the repo-relative path.
|
|
19
|
+
* @param generatedArtefacts the globs the project declares generated.
|
|
20
|
+
* @returns true for an authored code file; false for prose and for generated output.
|
|
21
|
+
*/
|
|
22
|
+
export declare const isLineCapEnforced: (filePath: string, generatedArtefacts: readonly string[]) => boolean;
|
|
16
23
|
/**
|
|
17
24
|
* Check one file against the committed configuration.
|
|
18
25
|
* @param content the file's decoded content.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editorconfig-policy.d.ts","sourceRoot":"","sources":["../src/editorconfig-policy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"editorconfig-policy.d.ts","sourceRoot":"","sources":["../src/editorconfig-policy.ts"],"names":[],"mappings":"AAIA,wEAAwE;AACxE,eAAO,MAAM,eAAe,EAAE,MAAY,CAAA;AAE1C,gEAAgE;AAChE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;IACtC,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAA;IACpC,QAAQ,CAAC,sBAAsB,EAAE,OAAO,CAAA;IACxC,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;CACzC;AAED,iEAAiE;AACjE,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AA8BD,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,KAAG,iBAqBhD,CAAA;AA2CD;;;;;GAKG;AAUH,eAAO,MAAM,iBAAiB,GAC5B,UAAU,MAAM,EAChB,oBAAoB,SAAS,MAAM,EAAE,KACpC,OAEqF,CAAA;AAExF;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,GACrC,SAAS,MAAM,EACf,OAAO,iBAAiB,EACxB,sBAAsB,OAAO,KAC5B,SAAS,qBAAqB,EAgBhC,CAAA"}
|