@ploaness/cli 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/checks/assets.d.ts +12 -0
- package/dist/checks/assets.d.ts.map +1 -1
- package/dist/checks/assets.js +27 -4
- package/dist/checks/assets.js.map +1 -1
- package/dist/checks/blocklist.d.ts +8 -0
- package/dist/checks/blocklist.d.ts.map +1 -0
- package/dist/checks/blocklist.js +106 -0
- package/dist/checks/blocklist.js.map +1 -0
- package/dist/checks/containers.d.ts +1 -1
- package/dist/checks/containers.d.ts.map +1 -1
- package/dist/checks/containers.js +31 -27
- package/dist/checks/containers.js.map +1 -1
- package/dist/checks/conventions.d.ts +2 -1
- package/dist/checks/conventions.d.ts.map +1 -1
- package/dist/checks/conventions.js +9 -7
- package/dist/checks/conventions.js.map +1 -1
- package/dist/checks/dependencies.d.ts.map +1 -1
- package/dist/checks/dependencies.js +83 -42
- package/dist/checks/dependencies.js.map +1 -1
- package/dist/checks/editorconfig.d.ts +1 -1
- package/dist/checks/editorconfig.d.ts.map +1 -1
- package/dist/checks/editorconfig.js +12 -10
- package/dist/checks/editorconfig.js.map +1 -1
- package/dist/checks/environment.d.ts +13 -0
- package/dist/checks/environment.d.ts.map +1 -0
- package/dist/checks/environment.js +50 -0
- package/dist/checks/environment.js.map +1 -0
- package/dist/checks/install.d.ts +2 -0
- package/dist/checks/install.d.ts.map +1 -1
- package/dist/checks/install.js +10 -1
- package/dist/checks/install.js.map +1 -1
- package/dist/checks/integrity.d.ts +1 -1
- package/dist/checks/integrity.d.ts.map +1 -1
- package/dist/checks/integrity.js +4 -4
- package/dist/checks/integrity.js.map +1 -1
- package/dist/checks/oxlint.d.ts +5 -0
- package/dist/checks/oxlint.d.ts.map +1 -0
- package/dist/checks/oxlint.js +85 -0
- package/dist/checks/oxlint.js.map +1 -0
- package/dist/checks/payload.d.ts +22 -1
- package/dist/checks/payload.d.ts.map +1 -1
- package/dist/checks/payload.js +194 -28
- package/dist/checks/payload.js.map +1 -1
- package/dist/checks/references.d.ts.map +1 -1
- package/dist/checks/references.js +3 -3
- package/dist/checks/references.js.map +1 -1
- package/dist/checks/suppressions.d.ts +2 -2
- package/dist/checks/suppressions.d.ts.map +1 -1
- package/dist/checks/suppressions.js +32 -12
- package/dist/checks/suppressions.js.map +1 -1
- package/dist/checks/tailwind.d.ts.map +1 -1
- package/dist/checks/tailwind.js +3 -3
- package/dist/checks/tailwind.js.map +1 -1
- package/dist/checks/tests.d.ts.map +1 -1
- package/dist/checks/tests.js +13 -5
- package/dist/checks/tests.js.map +1 -1
- package/dist/checks/tree.d.ts +9 -2
- package/dist/checks/tree.d.ts.map +1 -1
- package/dist/checks/tree.js +17 -29
- package/dist/checks/tree.js.map +1 -1
- package/dist/checks/wiring.d.ts +10 -0
- package/dist/checks/wiring.d.ts.map +1 -1
- package/dist/checks/wiring.js +50 -5
- package/dist/checks/wiring.js.map +1 -1
- package/dist/commands/format.d.ts +4 -1
- package/dist/commands/format.d.ts.map +1 -1
- package/dist/commands/format.js +17 -3
- package/dist/commands/format.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +1 -3
- package/dist/commands/init.js.map +1 -1
- package/dist/context.d.ts +1 -2
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +25 -24
- package/dist/context.js.map +1 -1
- package/dist/gates.d.ts.map +1 -1
- package/dist/gates.js +56 -12
- package/dist/gates.js.map +1 -1
- package/dist/probes/payload-defaults.probe.d.ts +2 -0
- package/dist/probes/payload-defaults.probe.d.ts.map +1 -0
- package/dist/probes/payload-defaults.probe.js +116 -0
- package/dist/probes/payload-defaults.probe.js.map +1 -0
- package/dist/secret-mirror.d.ts +3 -0
- package/dist/secret-mirror.d.ts.map +1 -0
- package/dist/secret-mirror.js +51 -0
- package/dist/secret-mirror.js.map +1 -0
- package/dist/source-comments.d.ts +9 -0
- package/dist/source-comments.d.ts.map +1 -0
- package/dist/source-comments.js +54 -0
- package/dist/source-comments.js.map +1 -0
- package/dist/working-tree.d.ts +5 -0
- package/dist/working-tree.d.ts.map +1 -0
- package/dist/working-tree.js +36 -0
- package/dist/working-tree.js.map +1 -0
- package/package.json +8 -7
- package/dist/commands/hooks.d.ts +0 -9
- package/dist/commands/hooks.d.ts.map +0 -1
- package/dist/commands/hooks.js +0 -57
- package/dist/commands/hooks.js.map +0 -1
package/dist/checks/tailwind.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// The token-bound gate. The rule is pure and lives in @ploaness/governance; this file supplies the
|
|
2
|
-
// I/O: which
|
|
2
|
+
// I/O: which files carry Tailwind classes, and what a finding reads like.
|
|
3
3
|
import { readFileSync } from 'node:fs';
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
import { findArbitraryValues, hasExtension, matchesRole, } from '@ploaness/governance';
|
|
6
|
-
import {
|
|
6
|
+
import { workingTreeFiles } from '../context.js';
|
|
7
7
|
import { failed, passed } from '../exec.js';
|
|
8
8
|
// Scoped by role rather than by a list of folders. A Tailwind class is written in JSX, so `.tsx` is
|
|
9
9
|
// where the rule can find one - and it is also the scope that keeps the rule from misreading a regex
|
|
@@ -16,7 +16,7 @@ const isScanned = (context, file) => hasExtension(file, MARKUP_EXTENSIONS) &&
|
|
|
16
16
|
!matchesRole(file, context.settings.typographyExclusions);
|
|
17
17
|
/** Verify every visual value comes from the Tailwind theme rather than an arbitrary literal. */
|
|
18
18
|
export const tailwindTokens = (context) => {
|
|
19
|
-
const scanned =
|
|
19
|
+
const scanned = workingTreeFiles(context.root).filter((file) => isScanned(context, file));
|
|
20
20
|
const findings = scanned.flatMap((file) => {
|
|
21
21
|
const content = readFileSync(path.join(context.root, file), 'utf8');
|
|
22
22
|
return findArbitraryValues(content).map((violation) => `${file}:${String(violation.line)}:${String(violation.column)} ` +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tailwind.js","sourceRoot":"","sources":["../../src/checks/tailwind.ts"],"names":[],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,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAA;QAC3E,OAAO,mBAAmB,CAAC,OAAO,CAAC,CAAC,GAAG,CACrC,CAAC,SAAkC,EAAU,EAAE,CAC7C,GAAG,IAAI,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG;YAChE,8BAA8B,SAAS,CAAC,KAAK,iDAAiD,CACjG,CAAA;IACH,CAAC,CAAC,CAAA;IACF,OAAO,QAAQ,CAAC,MAAM,GAAG,CAAC;QACxB,CAAC,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,8BAA8B,EAAE,QAAQ,CAAC;QAC5E,CAAC,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,yDAAyD,CAAC,CAAA;AAChG,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tests.d.ts","sourceRoot":"","sources":["../../src/checks/tests.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tests.d.ts","sourceRoot":"","sources":["../../src/checks/tests.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,KAAK,OAAO,EAEZ,KAAK,MAAM,EAGZ,MAAM,eAAe,CAAA;AACtB,OAAO,EAIL,KAAK,UAAU,EAIhB,MAAM,YAAY,CAAA;AA8DnB,eAAO,MAAM,KAAK,GAAI,SAAS,MAAM,KAAG,UAoBpC,CAAA;AAEJ,2CAA2C;AAC3C,eAAO,MAAM,QAAQ,GAAI,SAAS,OAAO,KAAG,UAwC3C,CAAA;AAED,yEAAyE;AACzE,eAAO,MAAM,KAAK,GAAI,SAAS,OAAO,KAAG,UAgCxC,CAAA"}
|
package/dist/checks/tests.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
// module registry and fail to match its own matchers.
|
|
4
4
|
import { existsSync } from 'node:fs';
|
|
5
5
|
import path from 'node:path';
|
|
6
|
-
import { CODE_EXTENSIONS, carriesSourceCode, hasExtension } from '@ploaness/governance';
|
|
7
|
-
import { hasOwnRuntime, resolveProjectTool,
|
|
6
|
+
import { CODE_EXTENSIONS, carriesSourceCode, diagnoseBuildFailure, hasExtension, } from '@ploaness/governance';
|
|
7
|
+
import { hasOwnRuntime, resolveProjectTool, workingTreeFiles, } from '../context.js';
|
|
8
8
|
import { asFindings, failed, fromRun, passed, run, } from '../exec.js';
|
|
9
9
|
// A Payload suite needs a database before it can boot, and how the project obtains one is a fact ploaness
|
|
10
10
|
// cannot know. The project declares it; the thresholds and the gate itself stay ploaness's.
|
|
@@ -47,7 +47,7 @@ const resolveProjectToolOrUndefined = (context, tool, binary) => {
|
|
|
47
47
|
// A member that holds no first-party source has no suite to run, and a runner started there fails on an
|
|
48
48
|
// empty include - reporting a package with nothing to test as one that failed to test it. A member
|
|
49
49
|
// holding code and no suite is untouched by this and still fails.
|
|
50
|
-
const hasSourceToTest = (context) => carriesSourceCode(
|
|
50
|
+
const hasSourceToTest = (context) => carriesSourceCode(workingTreeFiles(context.root), context.settings.sourceRoots, (filePath) => hasExtension(filePath, CODE_EXTENSIONS));
|
|
51
51
|
export const tests = (context) => withPretest(context, () => {
|
|
52
52
|
if (!hasSourceToTest(context)) {
|
|
53
53
|
return passed('no first-party source in this package, so there is no suite to run');
|
|
@@ -111,13 +111,21 @@ export const build = (context) => {
|
|
|
111
111
|
]);
|
|
112
112
|
}
|
|
113
113
|
const invocation = wrapped(context, [next, 'build']);
|
|
114
|
-
|
|
114
|
+
const result = run(invocation.command, invocation.commandArguments, {
|
|
115
115
|
cwd: context.root,
|
|
116
116
|
env: {
|
|
117
117
|
NEXT_TELEMETRY_DISABLED: '1',
|
|
118
118
|
NODE_OPTIONS: '--no-deprecation --max-old-space-size=8000',
|
|
119
119
|
},
|
|
120
|
-
})
|
|
120
|
+
});
|
|
121
|
+
const outcome = fromRun(result, 'the production build succeeds', 'the production build failed');
|
|
122
|
+
// Appended rather than substituted. The build's own output is what a reader needs first; the
|
|
123
|
+
// diagnosis explains a message that names the wrong layer, and says nothing about output it does
|
|
124
|
+
// not recognise.
|
|
125
|
+
const diagnosis = outcome.ok ? [] : diagnoseBuildFailure(result.output);
|
|
126
|
+
return diagnosis.length === 0
|
|
127
|
+
? outcome
|
|
128
|
+
: { ...outcome, findings: [...outcome.findings, ...diagnosis] };
|
|
121
129
|
});
|
|
122
130
|
};
|
|
123
131
|
//# sourceMappingURL=tests.js.map
|
package/dist/checks/tests.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tests.js","sourceRoot":"","sources":["../../src/checks/tests.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,qGAAqG;AACrG,sDAAsD;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,
|
|
1
|
+
{"version":3,"file":"tests.js","sourceRoot":"","sources":["../../src/checks/tests.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,qGAAqG;AACrG,sDAAsD;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,YAAY,GACb,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAEL,aAAa,EAEb,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,eAAe,CAAA;AACtB,OAAO,EACL,UAAU,EACV,MAAM,EACN,OAAO,EAEP,MAAM,EAEN,GAAG,GACJ,MAAM,YAAY,CAAA;AAEnB,0GAA0G;AAC1G,4FAA4F;AAC5F,MAAM,UAAU,GAAG,CAAC,OAAgB,EAAyB,EAAE;IAC7D,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,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AAC;IACD,OAAO,WAAW,CAAC,OAAO,EAAE,GAAe,EAAE;QAC3C,MAAM,IAAI,GAAuB,6BAA6B,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;QAC/E,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,OAAO,MAAM,CAAC,6CAA6C,EAAE;gBAC3D,2EAA2E;aAC5E,CAAC,CAAA;QACJ,CAAC;QACD,MAAM,UAAU,GAAe,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAA;QAChE,MAAM,MAAM,GAAc,GAAG,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,gBAAgB,EAAE;YAC7E,GAAG,EAAE,OAAO,CAAC,IAAI;YACjB,GAAG,EAAE;gBACH,uBAAuB,EAAE,GAAG;gBAC5B,YAAY,EAAE,4CAA4C;aAC3D;SACF,CAAC,CAAA;QACF,MAAM,OAAO,GAAe,OAAO,CACjC,MAAM,EACN,+BAA+B,EAC/B,6BAA6B,CAC9B,CAAA;QACD,6FAA6F;QAC7F,iGAAiG;QACjG,iBAAiB;QACjB,MAAM,SAAS,GAAsB,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,oBAAoB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;QAC1F,OAAO,SAAS,CAAC,MAAM,KAAK,CAAC;YAC3B,CAAC,CAAC,OAAO;YACT,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,QAAQ,EAAE,CAAC,GAAG,OAAO,CAAC,QAAQ,EAAE,GAAG,SAAS,CAAC,EAAE,CAAA;IACnE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
package/dist/checks/tree.d.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Context } from '../context.js';
|
|
2
2
|
import { type GateResult } from '../exec.js';
|
|
3
3
|
export declare const treeSnapshot: (context: Context) => GateResult;
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Verify the working tree is byte-for-byte what it was when the snapshot was taken.
|
|
6
|
+
*
|
|
7
|
+
* It compares two fingerprints, so it establishes THAT the tree changed and never WHO changed it. A gate
|
|
8
|
+
* rewriting a file is the reason the gate exists, but an editor saving a file while verification runs
|
|
9
|
+
* produces the same digest mismatch, and naming the first as the cause would be asserting something two
|
|
10
|
+
* hashes cannot show. The report offers both readings and leaves the choice to the reader.
|
|
11
|
+
*/
|
|
5
12
|
export declare const treeVerify: (context: Context) => GateResult;
|
|
6
13
|
//# sourceMappingURL=tree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../src/checks/tree.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../src/checks/tree.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAU,KAAK,UAAU,EAAU,MAAM,YAAY,CAAA;AAY5D,eAAO,MAAM,YAAY,GAAI,SAAS,OAAO,KAAG,UAK/C,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,GAAI,SAAS,OAAO,KAAG,UAe7C,CAAA"}
|
package/dist/checks/tree.js
CHANGED
|
@@ -1,27 +1,5 @@
|
|
|
1
|
-
// Working-tree integrity: a fingerprint taken before the gates, and checked again after. Verification must
|
|
2
|
-
// judge the tree the project committed, not one a gate quietly rewrote as a side effect. A formatter or
|
|
3
|
-
// a code generator that edits during `verify` would otherwise let a build pass on content that is not in
|
|
4
|
-
// the repository, and the next clean checkout would fail.
|
|
5
|
-
import { createHash } from 'node:crypto';
|
|
6
|
-
import { readFileSync, statSync } from 'node:fs';
|
|
7
|
-
import path from 'node:path';
|
|
8
|
-
import { trackedFiles } from '../context.js';
|
|
9
1
|
import { failed, passed } from '../exec.js';
|
|
10
|
-
|
|
11
|
-
const hash = createHash('sha256');
|
|
12
|
-
for (const file of trackedFiles(context.root)) {
|
|
13
|
-
const full = path.join(context.root, file);
|
|
14
|
-
hash.update(file);
|
|
15
|
-
try {
|
|
16
|
-
hash.update(statSync(full).isFile() ? readFileSync(full) : Buffer.alloc(0));
|
|
17
|
-
}
|
|
18
|
-
catch {
|
|
19
|
-
// A tracked-but-deleted path contributes its name only, so deleting one still changes the digest.
|
|
20
|
-
hash.update('<absent>');
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return hash.digest('hex');
|
|
24
|
-
};
|
|
2
|
+
import { workingTreeFingerprint } from '../working-tree.js';
|
|
25
3
|
// The fingerprint is taken by one gate and compared by another, so it must outlive both calls, and
|
|
26
4
|
// there is no channel between gates to carry it as a value.
|
|
27
5
|
// eslint-disable-next-line functional/no-let -- must outlive two separate gate invocations
|
|
@@ -32,19 +10,29 @@ const FINGERPRINT_PREVIEW = 12;
|
|
|
32
10
|
export const treeSnapshot = (context) => {
|
|
33
11
|
// Recording state the later tree-verify gate reads is this gate's whole purpose.
|
|
34
12
|
// eslint-disable-next-line unicorn/no-top-level-assignment-in-function -- see the binding above
|
|
35
|
-
snapshot =
|
|
13
|
+
snapshot = workingTreeFingerprint(context.root);
|
|
36
14
|
return passed(`tree fingerprint recorded (${snapshot.slice(0, FINGERPRINT_PREVIEW)})`);
|
|
37
15
|
};
|
|
38
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Verify the working tree is byte-for-byte what it was when the snapshot was taken.
|
|
18
|
+
*
|
|
19
|
+
* It compares two fingerprints, so it establishes THAT the tree changed and never WHO changed it. A gate
|
|
20
|
+
* rewriting a file is the reason the gate exists, but an editor saving a file while verification runs
|
|
21
|
+
* produces the same digest mismatch, and naming the first as the cause would be asserting something two
|
|
22
|
+
* hashes cannot show. The report offers both readings and leaves the choice to the reader.
|
|
23
|
+
*/
|
|
39
24
|
export const treeVerify = (context) => {
|
|
40
25
|
if (snapshot === undefined) {
|
|
41
|
-
return
|
|
26
|
+
return failed('no tree snapshot was taken', [
|
|
27
|
+
'run complete verification to establish tree integrity',
|
|
28
|
+
]);
|
|
42
29
|
}
|
|
43
|
-
const current =
|
|
30
|
+
const current = workingTreeFingerprint(context.root);
|
|
44
31
|
return current === snapshot
|
|
45
32
|
? passed('the working tree is unchanged since verification began')
|
|
46
|
-
: failed('
|
|
47
|
-
'run `ploaness format`, review the result, and commit it
|
|
33
|
+
: failed('the working tree changed during verification', [
|
|
34
|
+
'a gate may have rewritten a file: run `ploaness format`, review the result, and commit it',
|
|
35
|
+
'or a file was edited while verification was running, in which case re-run against a settled tree',
|
|
48
36
|
`expected ${snapshot.slice(0, FINGERPRINT_PREVIEW)} but found ${current.slice(0, FINGERPRINT_PREVIEW)}`,
|
|
49
37
|
'git status will show which files changed',
|
|
50
38
|
]);
|
package/dist/checks/tree.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.js","sourceRoot":"","sources":["../../src/checks/tree.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tree.js","sourceRoot":"","sources":["../../src/checks/tree.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAmB,MAAM,EAAE,MAAM,YAAY,CAAA;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAE3D,mGAAmG;AACnG,4DAA4D;AAC5D,2FAA2F;AAC3F,IAAI,QAA4B,CAAA;AAEhC,uEAAuE;AACvE,oGAAoG;AACpG,MAAM,mBAAmB,GAAW,EAAE,CAAA;AAEtC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAgB,EAAc,EAAE;IAC3D,iFAAiF;IACjF,gGAAgG;IAChG,QAAQ,GAAG,sBAAsB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IAC/C,OAAO,MAAM,CAAC,8BAA8B,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,mBAAmB,CAAC,GAAG,CAAC,CAAA;AACxF,CAAC,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,OAAgB,EAAc,EAAE;IACzD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO,MAAM,CAAC,4BAA4B,EAAE;YAC1C,uDAAuD;SACxD,CAAC,CAAA;IACJ,CAAC;IACD,MAAM,OAAO,GAAW,sBAAsB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5D,OAAO,OAAO,KAAK,QAAQ;QACzB,CAAC,CAAC,MAAM,CAAC,wDAAwD,CAAC;QAClE,CAAC,CAAC,MAAM,CAAC,8CAA8C,EAAE;YACrD,2FAA2F;YAC3F,kGAAkG;YAClG,YAAY,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,mBAAmB,CAAC,cAAc,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,mBAAmB,CAAC,EAAE;YACvG,0CAA0C;SAC3C,CAAC,CAAA;AACR,CAAC,CAAA"}
|
package/dist/checks/wiring.d.ts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { type Repository } from '../context.js';
|
|
2
2
|
import { type GateResult } from '../exec.js';
|
|
3
|
+
/**
|
|
4
|
+
* Every version ploaness decides for a project that declares the name: the analyzers read from the
|
|
5
|
+
* harness's own manifests, the framework pins from `pins.json`, and the runtime package at the release.
|
|
6
|
+
*
|
|
7
|
+
* Exported because the `deps` gate sorts its report by whose repair a finding is, and "a version the
|
|
8
|
+
* project declares but may not change" is precisely this map's key set. Read here rather than rebuilt
|
|
9
|
+
* there, so the report and the wiring gate cannot disagree about whose version a name is.
|
|
10
|
+
* @returns the pinned names, each mapped to the exact version the project must declare.
|
|
11
|
+
*/
|
|
12
|
+
export declare const harnessDecidedVersions: () => Readonly<Record<string, string>>;
|
|
3
13
|
/** Verify the repository and each of its members have installed ploaness exactly as ploaness dictates. */
|
|
4
14
|
export declare const wiring: (repository: Repository) => GateResult;
|
|
5
15
|
//# sourceMappingURL=wiring.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wiring.d.ts","sourceRoot":"","sources":["../../src/checks/wiring.ts"],"names":[],"mappings":"AAuBA,OAAO,EAEL,KAAK,UAAU,EAKhB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAU,KAAK,UAAU,EAAU,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"wiring.d.ts","sourceRoot":"","sources":["../../src/checks/wiring.ts"],"names":[],"mappings":"AAuBA,OAAO,EAEL,KAAK,UAAU,EAKhB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAU,KAAK,UAAU,EAAU,MAAM,YAAY,CAAA;AAgH5D;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,QAAO,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAiBxE,CAAA;AA6GD,0GAA0G;AAC1G,eAAO,MAAM,MAAM,GAAI,YAAY,UAAU,KAAG,UAyB/C,CAAA"}
|
package/dist/checks/wiring.js
CHANGED
|
@@ -56,6 +56,17 @@ const ownedVersions = () => Object.assign({}, ...pinGroups().map((group) => grou
|
|
|
56
56
|
// one would leave the other name in TEST_LIBRARY_NAMES pinning nothing at all, silently.
|
|
57
57
|
const asStringArray = (value) => isArray(value) ? value.filter((entry) => typeof entry === 'string') : [];
|
|
58
58
|
const VERSION_SOURCES = ['@ploaness/config', '@ploaness/cli'];
|
|
59
|
+
// The release version, read from the running harness rather than written down again. `@ploaness/runtime`
|
|
60
|
+
// is a sibling of this CLI and the six are published together at one version, which
|
|
61
|
+
// `scripts/lib/check-release-version.ts` is what makes true - so the CLI's own `version` IS the version
|
|
62
|
+
// a project must declare the runtime package at, and a bump moves it with no edit here. It cannot be
|
|
63
|
+
// read from the meta package's dependencies, the way a pinned analyzer is: `ploaness` depends on this
|
|
64
|
+
// package rather than the reverse, so under pnpm's strict layout the CLI cannot resolve it.
|
|
65
|
+
const harnessRuntimeVersion = () => {
|
|
66
|
+
const manifest = readJson(shippedFile('@ploaness/cli', 'package.json'));
|
|
67
|
+
const version = asOptionalText(readKey(manifest, 'version'));
|
|
68
|
+
return version === undefined ? {} : { [HARNESS_RUNTIME]: version };
|
|
69
|
+
};
|
|
59
70
|
const declaredBy = (packageName) => {
|
|
60
71
|
const manifest = readJson(shippedFile(packageName, 'package.json'));
|
|
61
72
|
return asRecord(readKey(manifest, 'dependencies'));
|
|
@@ -74,13 +85,46 @@ const declaredBy = (packageName) => {
|
|
|
74
85
|
const requiredPackages = (kind) => new Set(pinGroups()
|
|
75
86
|
.filter((group) => group.requiredFor.includes(kind))
|
|
76
87
|
.flatMap((group) => Object.keys(group.versions)));
|
|
77
|
-
|
|
88
|
+
/**
|
|
89
|
+
* Every version ploaness decides for a project that declares the name: the analyzers read from the
|
|
90
|
+
* harness's own manifests, the framework pins from `pins.json`, and the runtime package at the release.
|
|
91
|
+
*
|
|
92
|
+
* Exported because the `deps` gate sorts its report by whose repair a finding is, and "a version the
|
|
93
|
+
* project declares but may not change" is precisely this map's key set. Read here rather than rebuilt
|
|
94
|
+
* there, so the report and the wiring gate cannot disagree about whose version a name is.
|
|
95
|
+
* @returns the pinned names, each mapped to the exact version the project must declare.
|
|
96
|
+
*/
|
|
97
|
+
export const harnessDecidedVersions = () => {
|
|
78
98
|
// Built from one flat list of entries rather than by folding an object into itself: a later source
|
|
79
99
|
// still wins, because `fromEntries` keeps the last entry for a repeated key.
|
|
80
100
|
const declared = Object.fromEntries(VERSION_SOURCES.flatMap((source) => Object.entries(declaredBy(source))));
|
|
81
|
-
const fromDependencies = asStringRecord(Object.fromEntries(TEST_LIBRARY_NAMES.map((name) => [
|
|
82
|
-
|
|
101
|
+
const fromDependencies = asStringRecord(Object.fromEntries([...TEST_LIBRARY_NAMES, 'oxlint'].map((name) => [
|
|
102
|
+
name,
|
|
103
|
+
declared[name],
|
|
104
|
+
])));
|
|
105
|
+
return { ...fromDependencies, ...ownedVersions(), ...harnessRuntimeVersion() };
|
|
83
106
|
};
|
|
107
|
+
/**
|
|
108
|
+
* The runtime helpers a governed application calls, which every application therefore declares.
|
|
109
|
+
*
|
|
110
|
+
* Required rather than merely pinned, on the same reasoning that makes the browser packages required:
|
|
111
|
+
* ploaness ships something that is not optional, so resolving what it names is not optional either.
|
|
112
|
+
* There the artefact is the managed accessibility sweep; here it is the Layer 6 rule that a URL from a
|
|
113
|
+
* CMS field passes through `safeHref` before it reaches an `href` - a rule the guide states binds with
|
|
114
|
+
* the same force as one a gate enforces, and one no gate CAN enforce.
|
|
115
|
+
*
|
|
116
|
+
* The alternative was to leave it optional and have the guide say "add this dependency first". That
|
|
117
|
+
* puts an install step between a developer and an XSS fix, at the one moment friction is most
|
|
118
|
+
* expensive, in service of a rule nothing verifies. An unused declaration costs a governed project a
|
|
119
|
+
* line in a manifest and a few hundred bytes in a production install: the package is pure and declares
|
|
120
|
+
* no dependencies of its own.
|
|
121
|
+
*
|
|
122
|
+
* The usual objection does not apply. Forcing a declaration normally manufactures a dependency the
|
|
123
|
+
* dead-code gate reports as unused - which is why `pins.json` forces nothing - but the shipped
|
|
124
|
+
* `knip.json` already ignores `@ploaness/.+`, because ploaness packages are reached through configs
|
|
125
|
+
* knip cannot trace. So this creates no finding anywhere.
|
|
126
|
+
*/
|
|
127
|
+
const HARNESS_RUNTIME = '@ploaness/runtime';
|
|
84
128
|
// A member's own required set. Only a member that serves an application needs the browser packages: a
|
|
85
129
|
// library has no page to sweep, and requiring them would manufacture dependencies the dead-code gate
|
|
86
130
|
// then rightly reports as unused.
|
|
@@ -88,6 +132,7 @@ const BROWSER_LIBRARIES = new Set([
|
|
|
88
132
|
'@playwright/test',
|
|
89
133
|
'@axe-core/playwright',
|
|
90
134
|
'tsx',
|
|
135
|
+
HARNESS_RUNTIME,
|
|
91
136
|
]);
|
|
92
137
|
// The specs of every governed package import these, so pnpm's strict layout means every package must
|
|
93
138
|
// declare them. The browser three are added only where there is an application to drive.
|
|
@@ -115,7 +160,7 @@ const memberViolations = (member) => {
|
|
|
115
160
|
declaredExclusions: member.settings.declaredExclusions,
|
|
116
161
|
biomeConfig: readText(path.join(member.root, 'biome.json')),
|
|
117
162
|
tsconfig: readText(path.join(member.root, 'tsconfig.json')),
|
|
118
|
-
expectedTestLibraries:
|
|
163
|
+
expectedTestLibraries: harnessDecidedVersions(),
|
|
119
164
|
requiredTestLibraries: requiredFor(kind),
|
|
120
165
|
payloadVersion: ownedVersions()['payload'],
|
|
121
166
|
});
|
|
@@ -148,7 +193,7 @@ export const wiring = (repository) => {
|
|
|
148
193
|
packageJson: repository.packageJson,
|
|
149
194
|
workspaceFile: repository.workspaceFile,
|
|
150
195
|
declaredExclusions: repository.settings.declaredExclusions,
|
|
151
|
-
expectedTestLibraries:
|
|
196
|
+
expectedTestLibraries: harnessDecidedVersions(),
|
|
152
197
|
requiredPackageManager: asOptionalText(readPins()['packageManager']),
|
|
153
198
|
requiredEngines: asStringRecord(readPins()['engines']),
|
|
154
199
|
declaredAcrossMembers: declaredEverywhere(repository),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wiring.js","sourceRoot":"","sources":["../../src/checks/wiring.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,oGAAoG;AACpG,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EACL,cAAc,EACd,QAAQ,EACR,cAAc,EACd,oBAAoB,EACpB,2BAA2B,EAC3B,8BAA8B,EAC9B,uBAAuB,EACvB,sBAAsB,EACtB,UAAU,EACV,OAAO,EACP,QAAQ,EAGR,YAAY,EACZ,gBAAgB,EAChB,OAAO,EACP,kBAAkB,GAEnB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAGL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,gBAAgB,GACjB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,MAAM,EAAmB,MAAM,EAAE,MAAM,YAAY,CAAA;AAE5D,sGAAsG;AACtG,qGAAqG;AACrG,sFAAsF;AACtF,qGA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AsB,EAAE;YAC/C,sBAAsB,EAAE,cAAc,CAAC,QAAQ,EAAE,CAAC,gBAAgB,CAAC,CAAC;YACpE,eAAe,EAAE,cAAc,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,CAAC;YACtD,qBAAqB,EAAE,kBAAkB,CAAC,UAAU,CAAC;YACrD,kBAAkB,EAAE,aAAa,CAAC,UAAU,CAAC;SAC9C,CAAC,CAAC,GAAG,CAAC,CAAC,SAA0B,EAAU,EAAE,CAAC,GAAG,SAAS,CAAC,QAAQ,KAAK,SAAS,CAAC,MAAM,EAAE,CAAC;QAC5F,GAAG,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAc,EAAqB,EAAE,CAClE,gBAAgB,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,SAA0B,EAAU,EAAE,CAClE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,CAClC,CACF;KACF,CAAA;IACD,OAAO,QAAQ,CAAC,MAAM,GAAG,CAAC;QACxB,CAAC,CAAC,MAAM,CACJ,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,sEAAsE,EAChG,QAAQ,CACT;QACH,CAAC,CAAC,MAAM,CAAC,gDAAgD,CAAC,CAAA;AAC9D,CAAC,CAAA"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { Repository } from '../context.js';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Apply Biome's formatting and safe fixes, then ESLint's fixable rules, then Biome once more, in
|
|
4
|
+
* every member. The closing pass is what makes the command leave a tree the `biome` gate accepts.
|
|
5
|
+
*/
|
|
3
6
|
export declare const format: (repository: Repository) => number;
|
|
4
7
|
//# sourceMappingURL=format.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/commands/format.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAU,UAAU,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/commands/format.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAU,UAAU,EAAE,MAAM,eAAe,CAAA;AAsCvD;;;GAGG;AACH,eAAO,MAAM,MAAM,GAAI,YAAY,UAAU,KAAG,MAO/C,CAAA"}
|
package/dist/commands/format.js
CHANGED
|
@@ -21,11 +21,25 @@ const formatMember = (member, isSolo) => {
|
|
|
21
21
|
if (eslint.output.length > 0) {
|
|
22
22
|
console.info(eslint.output);
|
|
23
23
|
}
|
|
24
|
+
// Biome runs again because ESLint's fixers wrote last and Biome is the formatter. A fixer emits
|
|
25
|
+
// whatever its rule considers correct, not whatever the formatter would have printed, so the pass
|
|
26
|
+
// above can leave text that the `biome` gate then fails on - and it did:
|
|
27
|
+
// `unicorn/prefer-negative-index` rewrote `values.slice(0, values.length - 1)` to
|
|
28
|
+
// `values.slice(0, - 1)`, which is a formatting defect the gate reports on a change format itself
|
|
29
|
+
// made. Running format twice repaired it, which is the tell: the command was one pass short of a
|
|
30
|
+
// fixed point rather than wrong about any single fix. Biome's writer is deterministic and converges,
|
|
31
|
+
// so this pass costs one process and changes nothing when there was nothing to settle.
|
|
32
|
+
const settled = biomeWrite(member);
|
|
33
|
+
console.info(settled.output);
|
|
24
34
|
// ESLint exits non-zero for findings it cannot fix. Those are for `ploaness verify` to report, so
|
|
25
|
-
// formatting succeeds as long as Biome could write
|
|
26
|
-
|
|
35
|
+
// formatting succeeds as long as Biome could write - and the second run is the one that describes
|
|
36
|
+
// the tree the caller is actually left with.
|
|
37
|
+
return biome.code === 0 && settled.code === 0 ? 0 : 1;
|
|
27
38
|
};
|
|
28
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* Apply Biome's formatting and safe fixes, then ESLint's fixable rules, then Biome once more, in
|
|
41
|
+
* every member. The closing pass is what makes the command leave a tree the `biome` gate accepts.
|
|
42
|
+
*/
|
|
29
43
|
export const format = (repository) => {
|
|
30
44
|
const isSolo = repository.members.length <= 1;
|
|
31
45
|
const codes = repository.members.map((member) => formatMember(member, isSolo));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/commands/format.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,sGAAsG;AACtG,cAAc;AACd,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAIhE,qGAAqG;AACrG,sGAAsG;AACtG,6FAA6F;AAC7F,MAAM,YAAY,GAAG,CAAC,MAAc,EAAE,MAAe,EAAU,EAAE;IAC/D,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC,IAAI,EAAE,CAAC,CAAA;IAClC,CAAC;IACD,qGAAqG;IACrG,sGAAsG;IACtG,mGAAmG;IACnG,kGAAkG;IAClG,gGAAgG;IAChG,mFAAmF;IACnF,MAAM,KAAK,GAAc,UAAU,CAAC,MAAM,CAAC,CAAA;IAC3C,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IAC1B,MAAM,MAAM,GAAc,WAAW,CAAC,MAAM,CAAC,CAAA;IAC7C,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7B,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAC7B,CAAC;IACD,kGAAkG;IAClG,
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/commands/format.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,sGAAsG;AACtG,cAAc;AACd,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAIhE,qGAAqG;AACrG,sGAAsG;AACtG,6FAA6F;AAC7F,MAAM,YAAY,GAAG,CAAC,MAAc,EAAE,MAAe,EAAU,EAAE;IAC/D,IAAI,CAAC,MAAM,EAAE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EAAkE,CAAC,CAAA;IAChF,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,IAAY,EAAW,EAAE,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAClE,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAU,UAAU,EAAE,MAAM,eAAe,CAAA;AAiGvD,2EAA2E;AAC3E,eAAO,MAAM,IAAI,GAAI,YAAY,UAAU,KAAG,MAqB7C,CAAA"}
|
package/dist/commands/init.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
//
|
|
2
|
-
// than a page of copied configuration. Nothing here is magic: every file it writes is one the wiring
|
|
3
|
-
// gate will afterwards require, and it never overwrites a file that already exists.
|
|
1
|
+
// Scaffold missing member configurations, update root scripts, and synchronize managed content.
|
|
4
2
|
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
5
3
|
import path from 'node:path';
|
|
6
4
|
import { asRecord, memberKindOf, parseJsonc, REQUIRED_SCRIPTS, ROOT_MEMBER_PATH, requiredBiomeFiles, tsconfigPathsFor, wiringTargetsFor, } from '@ploaness/governance';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACjE,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EACL,QAAQ,EAGR,YA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sB;QAC/B,GAAG,gBAAgB,CAAC,UAAU,CAAC;QAC/B,GAAG,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAc,EAAqB,EAAE,CAClE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAC5B;KACF,CAAA;IACD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAA;IAC3B,CAAC;IACD,yFAAyF;IACzF,MAAM,QAAQ,GAAW,IAAI,CAAC,UAAU,CAAC,CAAA;IACzC,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;QACnB,OAAO,QAAQ,CAAA;IACjB,CAAC;IACD,OAAO,CAAC,IAAI,CACV,8FAA8F;QAC5F,qFAAqF,CACxF,CAAA;IACD,OAAO,CAAC,CAAA;AACV,CAAC,CAAA"}
|
package/dist/context.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ProjectManifest, type Settings } from '@ploaness/governance';
|
|
2
|
+
export { workingTreeFiles } from './working-tree.js';
|
|
2
3
|
/** The resolved environment of one ploaness run. */
|
|
3
4
|
export interface Context {
|
|
4
5
|
/** The consuming project's repository root. */
|
|
@@ -104,8 +105,6 @@ export declare const manifestPathFrom: (packageName: string, fromManifest: strin
|
|
|
104
105
|
export declare const shippedDirectory: (packageName: string) => string;
|
|
105
106
|
/** Locate this module's own package directory, used to report the running harness version. */
|
|
106
107
|
export declare const cliDirectory: () => string;
|
|
107
|
-
/** List the repository's tracked files, NUL-delimited so paths with spaces survive intact. */
|
|
108
|
-
export declare const trackedFiles: (root: string) => readonly string[];
|
|
109
108
|
/** Run a git command in the project and return its trimmed stdout. */
|
|
110
109
|
export declare const git: (context: Context, commandArguments: readonly string[]) => string;
|
|
111
110
|
/**
|
package/dist/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src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6 +6,8 @@ import path from 'node:path';
|
|
|
6
6
|
import { fileURLToPath } from 'node:url';
|
|
7
7
|
import { parseEnv } from 'node:util';
|
|
8
8
|
import { asRecord, asStringRecord, findGovernedMembers, findRepositoryRoot, hasRuntime, isPayloadProject, memberKindOf, parseJsonc, ploanessBlock, ROOT_MEMBER_PATH, readKey, readMemberSettings, readSettings, readWorkspacePackages, rebaseExclusion, runEnvironmentFiles, runEnvironmentOverrides, selectProjects, } from '@ploaness/governance';
|
|
9
|
+
import { workingTreeFiles } from './working-tree.js';
|
|
10
|
+
export { workingTreeFiles } from './working-tree.js';
|
|
9
11
|
const nodeRequire = createRequire(import.meta.url);
|
|
10
12
|
const BYTES_PER_KIB = 1024;
|
|
11
13
|
const KIB_PER_MIB = 1024;
|
|
@@ -138,16 +140,6 @@ export const manifestPathFrom = (packageName, fromManifest) => {
|
|
|
138
140
|
export const shippedDirectory = (packageName) => packageDirectory(packageName, nodeRequire);
|
|
139
141
|
/** Locate this module's own package directory, used to report the running harness version. */
|
|
140
142
|
export const cliDirectory = () => path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
141
|
-
/** List the repository's tracked files, NUL-delimited so paths with spaces survive intact. */
|
|
142
|
-
export const trackedFiles = (root) => execFileSync('git', ['ls-files', '-z'], {
|
|
143
|
-
cwd: root,
|
|
144
|
-
encoding: 'utf8',
|
|
145
|
-
maxBuffer: MAX_OUTPUT_BYTES,
|
|
146
|
-
// A directory that is not a repository is a case the caller handles, not a diagnosis to print.
|
|
147
|
-
stdio: ['ignore', 'pipe', 'ignore'],
|
|
148
|
-
})
|
|
149
|
-
.split('\0')
|
|
150
|
-
.filter((file) => file !== '');
|
|
151
143
|
/** Run a git command in the project and return its trimmed stdout. */
|
|
152
144
|
export const git = (context, commandArguments) => execFileSync('git', [...commandArguments], {
|
|
153
145
|
cwd: context.root,
|
|
@@ -177,17 +169,22 @@ const ancestorsOf = (directory) => {
|
|
|
177
169
|
return parent === directory ? [directory] : [directory, ...ancestorsOf(parent)];
|
|
178
170
|
};
|
|
179
171
|
const hasEntry = (directory, entry) => existsSync(path.join(directory, entry));
|
|
180
|
-
// Candidate project directories come from the
|
|
181
|
-
// directory git
|
|
182
|
-
//
|
|
183
|
-
//
|
|
184
|
-
//
|
|
185
|
-
//
|
|
186
|
-
//
|
|
187
|
-
//
|
|
172
|
+
// Candidate project directories come from the working tree rather than from a filesystem walk, so a
|
|
173
|
+
// directory git IGNORES - a build output, a scratch copy, an uninstalled example - can never become a
|
|
174
|
+
// governed member, while one that merely has not been staged yet does.
|
|
175
|
+
//
|
|
176
|
+
// That second half used to be false, and it was the most expensive half of reading the index instead of
|
|
177
|
+
// the tree. A check reading the index scans one file too few; discovery reading the index loses a whole
|
|
178
|
+
// PACKAGE - it is absent from the run plan, so its gates are not skipped, they are never planned, and
|
|
179
|
+
// the report says nothing at all about it. A member that appears only once somebody remembers to stage
|
|
180
|
+
// it is not governance.
|
|
181
|
+
//
|
|
182
|
+
// A directory that is not a repository at all has exactly one project, itself: the integration fixtures
|
|
183
|
+
// install into such a directory before any commit exists, and asking git there fails rather than
|
|
184
|
+
// answering.
|
|
188
185
|
const manifestDirectories = (root) => {
|
|
189
186
|
try {
|
|
190
|
-
return
|
|
187
|
+
return workingTreeManifestDirectories(root);
|
|
191
188
|
}
|
|
192
189
|
catch {
|
|
193
190
|
// Not a repository yet. `ploaness init` is run on exactly such a tree - a fresh checkout, or a
|
|
@@ -212,7 +209,7 @@ const walkManifestDirectories = (root, relative = ROOT_MEMBER_PATH, depth = 0) =
|
|
|
212
209
|
.flatMap((entry) => walkManifestDirectories(root, relative === ROOT_MEMBER_PATH ? entry.name : path.join(relative, entry.name), depth + 1));
|
|
213
210
|
return [...here, ...children];
|
|
214
211
|
};
|
|
215
|
-
const
|
|
212
|
+
const workingTreeManifestDirectories = (root) => workingTreeFiles(root)
|
|
216
213
|
.filter((file) => path.basename(file) === MANIFEST)
|
|
217
214
|
.map((file) => {
|
|
218
215
|
const directory = path.dirname(file);
|
|
@@ -239,7 +236,9 @@ const createMember = ({ root, projectPath, isEnforced, repositoryBlock = {}, sib
|
|
|
239
236
|
return {
|
|
240
237
|
root: projectPath === ROOT_MEMBER_PATH ? root : path.join(root, projectPath),
|
|
241
238
|
packageJson,
|
|
242
|
-
settings:
|
|
239
|
+
settings: projectPath === ROOT_MEMBER_PATH
|
|
240
|
+
? readSettings(packageJson)
|
|
241
|
+
: readMemberSettings(repositoryBlock, ploanessBlock(packageJson)),
|
|
243
242
|
isEnforced,
|
|
244
243
|
path: projectPath,
|
|
245
244
|
isPayload: isPayloadProject(packageJson),
|
|
@@ -278,14 +277,16 @@ export const createRepository = (cwd, isEnforced) => {
|
|
|
278
277
|
members,
|
|
279
278
|
};
|
|
280
279
|
};
|
|
281
|
-
// The gates that walk the
|
|
280
|
+
// The gates that walk the working tree run once, at the root, while a member declares its exclusions
|
|
282
281
|
// relative to itself. Without this a generated directory a member correctly excused starts failing
|
|
283
282
|
// them, because the pattern it wrote is anchored one directory above where the gate is looking.
|
|
284
283
|
const withMemberExclusions = (base, members) => {
|
|
285
284
|
const rebased = members.flatMap((member) => member.settings.declaredExclusions.map((entry) => rebaseExclusion(member.path, entry)));
|
|
286
285
|
const patternsFor = (setting) => rebased
|
|
287
|
-
.filter((entry) => entry.setting === setting)
|
|
288
|
-
.map((entry) => entry.
|
|
286
|
+
.filter((entry) => entry.setting === setting && entry.reason.length > 0 && entry.pattern.length > 0)
|
|
287
|
+
.map((entry) => entry.memberPath === undefined
|
|
288
|
+
? entry.pattern
|
|
289
|
+
: { memberPath: entry.memberPath, pattern: entry.pattern });
|
|
289
290
|
return {
|
|
290
291
|
...base,
|
|
291
292
|
typographyExclusions: [...base.typographyExclusions, ...patternsFor('typographyExclusions')],
|