@nielspeter/eess 0.5.0 → 0.6.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/cli-config.d.ts +50 -3
- package/dist/cli-config.d.ts.map +1 -1
- package/dist/cli-config.js +147 -0
- package/dist/cli-config.js.map +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +1 -1
- package/dist/internal.js.map +1 -1
- package/dist/path-universe.d.ts +53 -1
- package/dist/path-universe.d.ts.map +1 -1
- package/dist/path-universe.js +40 -3
- package/dist/path-universe.js.map +1 -1
- package/package.json +1 -1
package/dist/cli-config.d.ts
CHANGED
|
@@ -10,9 +10,21 @@ import type { OutputFormat } from './check-options.js';
|
|
|
10
10
|
* actually importing the file, stays in each dialect because it needs `jiti`,
|
|
11
11
|
* which the kernel cannot depend on.
|
|
12
12
|
*
|
|
13
|
-
* That
|
|
14
|
-
* {@link isModuleFormatRefusal} — so it
|
|
15
|
-
*
|
|
13
|
+
* That left one genuinely shared subtlety in the impure half —
|
|
14
|
+
* {@link isModuleFormatRefusal} — so it lived here too: pure, and the part that
|
|
15
|
+
* is easy to get dangerously wrong.
|
|
16
|
+
*
|
|
17
|
+
* **That description is no longer complete, and saying so is the point.** Bug
|
|
18
|
+
* 0223 added two more members of the same family, and one of them —
|
|
19
|
+
* {@link enableTypeScriptSpecifierResolution} — is NOT pure: it registers a
|
|
20
|
+
* resolve hook on the host process, permanently. The substitution it performs is
|
|
21
|
+
* a fact about the language rule files are WRITTEN in, which is TypeScript for
|
|
22
|
+
* every dialect, so the kernel is the right owner. But "the impure half stays in
|
|
23
|
+
* each dialect" is now true of importing and false of resolving, and an
|
|
24
|
+
* architecture review called the three of them module-loading policy sitting in
|
|
25
|
+
* a config-discovery file. Splitting them into their own kernel module is the
|
|
26
|
+
* open half of that finding; the header no longer claims otherwise in the
|
|
27
|
+
* meantime.
|
|
16
28
|
*/
|
|
17
29
|
/** Config fields every dialect CLI understands. A dialect may add its own. */
|
|
18
30
|
export interface SharedCliConfig {
|
|
@@ -45,6 +57,41 @@ export declare function extractSharedConfig(mod: unknown): SharedCliConfig;
|
|
|
45
57
|
* uses ESM syntax.
|
|
46
58
|
*/
|
|
47
59
|
export declare function isModuleFormatRefusal(error: unknown): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Did Node fail to resolve a specifier that TypeScript requires be written that
|
|
62
|
+
* way — a `./sibling.js` whose file on disk is `./sibling.ts`?
|
|
63
|
+
*
|
|
64
|
+
* Narrow for the same reason {@link isModuleFormatRefusal} is, and narrower
|
|
65
|
+
* still: it answers yes only when the TypeScript source is ACTUALLY on disk. A
|
|
66
|
+
* genuinely missing module is still a genuinely missing module, reported the way
|
|
67
|
+
* it always was, and nothing is retried on its behalf.
|
|
68
|
+
*
|
|
69
|
+
* This is bug 0223, reported by a consuming project. `"type": "module"` plus the
|
|
70
|
+
* `.js` specifier is not an exotic combination — it is the one TypeScript
|
|
71
|
+
* mandates for ESM, so every project that splits its rules across files reaches
|
|
72
|
+
* it on the first attempt. The failure is `ERR_MODULE_NOT_FOUND` rather than a
|
|
73
|
+
* `SyntaxError`, which is why the format-refusal predicate above cannot see it.
|
|
74
|
+
*/
|
|
75
|
+
export declare function isTypeScriptSpecifierMiss(error: unknown): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Teach this process's loader the substitution, so `./sibling.js` resolves to
|
|
78
|
+
* `./sibling.ts` when that is the file that exists.
|
|
79
|
+
*
|
|
80
|
+
* **`registerHooks`, deliberately, and not a transpiling loader.** The hook is
|
|
81
|
+
* synchronous and in-thread, so a rule file still loads into THIS module
|
|
82
|
+
* registry. That is the invariant plan 0165 and bug 0029 paid for and the reason
|
|
83
|
+
* the alternative fix was rejected: a second registry makes
|
|
84
|
+
* `instanceof ArchRuleError` false and sets `callerAggregatesReports` on one
|
|
85
|
+
* copy while it is read on the other, printing every configuration finding
|
|
86
|
+
* twice. Resolution is the only thing being changed here; execution is
|
|
87
|
+
* untouched.
|
|
88
|
+
*
|
|
89
|
+
* The hook rewrites nothing unless the emitted path is absent AND the
|
|
90
|
+
* TypeScript source is present, so a real `.js` file beside a `.ts` of the same
|
|
91
|
+
* name always wins, and a specifier naming neither is left alone to fail as it
|
|
92
|
+
* would have.
|
|
93
|
+
*/
|
|
94
|
+
export declare function enableTypeScriptSpecifierResolution(): void;
|
|
48
95
|
/**
|
|
49
96
|
* Refuse a run that named no rule files, saying where to name them.
|
|
50
97
|
*
|
package/dist/cli-config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-config.d.ts","sourceRoot":"","sources":["../src/cli-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli-config.d.ts","sourceRoot":"","sources":["../src/cli-config.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAGtD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,8EAA8E;AAC9E,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,MAAM,CAAC,EAAE,YAAY,GAAG,MAAM,CAAA;IAC9B,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;CACrB;AAID,qEAAqE;AACrE,wBAAgB,cAAc,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAO/E;AAOD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,eAAe,CAiBjE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAM7D;AAiDD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAKjE;AAYD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,mCAAmC,IAAI,IAAI,CA6C1D;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAO1F"}
|
package/dist/cli-config.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import fs from 'node:fs';
|
|
3
|
+
import { registerHooks } from 'node:module';
|
|
3
4
|
import { isRecord } from './type-guards.js';
|
|
4
5
|
const FORMATS = new Set(['terminal', 'json', 'github', 'auto']);
|
|
5
6
|
/** The first of `filenames` that exists in the working directory. */
|
|
@@ -64,6 +65,152 @@ export function isModuleFormatRefusal(error) {
|
|
|
64
65
|
return (error.message.includes('Cannot use import statement outside a module') ||
|
|
65
66
|
error.message.includes("Unexpected token 'export'"));
|
|
66
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* The extension substitutions TypeScript performs and Node does not.
|
|
70
|
+
*
|
|
71
|
+
* Under `nodenext`, TypeScript REQUIRES a relative import to name the emitted
|
|
72
|
+
* `.js` file even when the file on disk is `.ts`. Node performs no such
|
|
73
|
+
* substitution, so the specifier that `tsc` demands is the one Node cannot
|
|
74
|
+
* resolve.
|
|
75
|
+
*/
|
|
76
|
+
const TS_SPECIFIER_SUBSTITUTIONS = new Map([
|
|
77
|
+
['.js', ['.ts', '.tsx']],
|
|
78
|
+
['.jsx', ['.tsx']],
|
|
79
|
+
['.mjs', ['.mts']],
|
|
80
|
+
['.cjs', ['.cts']],
|
|
81
|
+
]);
|
|
82
|
+
/**
|
|
83
|
+
* Is this URL a TypeScript source file — the only kind that writes `.js` for `.ts`?
|
|
84
|
+
*
|
|
85
|
+
* Reads the PATH, not the href. Watch mode cache-busts by appending `?t=<now>`
|
|
86
|
+
* to the entry url, so an href check answers no for exactly the rule file being
|
|
87
|
+
* re-run — measured, and it disabled the substitution in watch mode entirely
|
|
88
|
+
* while every non-watch test stayed green.
|
|
89
|
+
*/
|
|
90
|
+
function isTypeScriptSource(url) {
|
|
91
|
+
let pathname;
|
|
92
|
+
try {
|
|
93
|
+
pathname = new URL(url).pathname;
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
void error;
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
return ['.ts', '.tsx', '.mts', '.cts'].some((ext) => pathname.endsWith(ext));
|
|
100
|
+
}
|
|
101
|
+
/** The TypeScript file a JS-family URL stands for, if one is on disk. */
|
|
102
|
+
function typeScriptSourceFor(url) {
|
|
103
|
+
for (const [emitted, sources] of TS_SPECIFIER_SUBSTITUTIONS) {
|
|
104
|
+
if (!url.endsWith(emitted))
|
|
105
|
+
continue;
|
|
106
|
+
const stem = url.slice(0, -emitted.length);
|
|
107
|
+
for (const source of sources) {
|
|
108
|
+
const candidate = `${stem}${source}`;
|
|
109
|
+
if (fs.existsSync(new URL(candidate)))
|
|
110
|
+
return candidate;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return undefined;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Did Node fail to resolve a specifier that TypeScript requires be written that
|
|
117
|
+
* way — a `./sibling.js` whose file on disk is `./sibling.ts`?
|
|
118
|
+
*
|
|
119
|
+
* Narrow for the same reason {@link isModuleFormatRefusal} is, and narrower
|
|
120
|
+
* still: it answers yes only when the TypeScript source is ACTUALLY on disk. A
|
|
121
|
+
* genuinely missing module is still a genuinely missing module, reported the way
|
|
122
|
+
* it always was, and nothing is retried on its behalf.
|
|
123
|
+
*
|
|
124
|
+
* This is bug 0223, reported by a consuming project. `"type": "module"` plus the
|
|
125
|
+
* `.js` specifier is not an exotic combination — it is the one TypeScript
|
|
126
|
+
* mandates for ESM, so every project that splits its rules across files reaches
|
|
127
|
+
* it on the first attempt. The failure is `ERR_MODULE_NOT_FOUND` rather than a
|
|
128
|
+
* `SyntaxError`, which is why the format-refusal predicate above cannot see it.
|
|
129
|
+
*/
|
|
130
|
+
export function isTypeScriptSpecifierMiss(error) {
|
|
131
|
+
if (!isRecord(error))
|
|
132
|
+
return false;
|
|
133
|
+
if (error['code'] !== 'ERR_MODULE_NOT_FOUND')
|
|
134
|
+
return false;
|
|
135
|
+
const url = error['url'];
|
|
136
|
+
return typeof url === 'string' && typeScriptSourceFor(url) !== undefined;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Registered at most once per MODULE REGISTRY, which is usually per process.
|
|
140
|
+
*
|
|
141
|
+
* This is module state, so a second registry — the very hazard the loaders that
|
|
142
|
+
* call this exist to avoid — would hold a second flag and register a second
|
|
143
|
+
* hook. Harmless, since the hook is idempotent in effect, but the distinction is
|
|
144
|
+
* worth stating in the one file whose surrounding prose is about registries.
|
|
145
|
+
*/
|
|
146
|
+
let specifierResolutionEnabled = false;
|
|
147
|
+
/**
|
|
148
|
+
* Teach this process's loader the substitution, so `./sibling.js` resolves to
|
|
149
|
+
* `./sibling.ts` when that is the file that exists.
|
|
150
|
+
*
|
|
151
|
+
* **`registerHooks`, deliberately, and not a transpiling loader.** The hook is
|
|
152
|
+
* synchronous and in-thread, so a rule file still loads into THIS module
|
|
153
|
+
* registry. That is the invariant plan 0165 and bug 0029 paid for and the reason
|
|
154
|
+
* the alternative fix was rejected: a second registry makes
|
|
155
|
+
* `instanceof ArchRuleError` false and sets `callerAggregatesReports` on one
|
|
156
|
+
* copy while it is read on the other, printing every configuration finding
|
|
157
|
+
* twice. Resolution is the only thing being changed here; execution is
|
|
158
|
+
* untouched.
|
|
159
|
+
*
|
|
160
|
+
* The hook rewrites nothing unless the emitted path is absent AND the
|
|
161
|
+
* TypeScript source is present, so a real `.js` file beside a `.ts` of the same
|
|
162
|
+
* name always wins, and a specifier naming neither is left alone to fail as it
|
|
163
|
+
* would have.
|
|
164
|
+
*/
|
|
165
|
+
export function enableTypeScriptSpecifierResolution() {
|
|
166
|
+
if (specifierResolutionEnabled)
|
|
167
|
+
return;
|
|
168
|
+
specifierResolutionEnabled = true;
|
|
169
|
+
registerHooks({
|
|
170
|
+
resolve(specifier, context, nextResolve) {
|
|
171
|
+
if (!specifier.startsWith('./') && !specifier.startsWith('../')) {
|
|
172
|
+
return nextResolve(specifier, context);
|
|
173
|
+
}
|
|
174
|
+
const parentURL = context.parentURL;
|
|
175
|
+
// Only a TypeScript file writes the specifier TypeScript mandates. Without
|
|
176
|
+
// this the hook rewrites for every relative specifier in the process,
|
|
177
|
+
// including from inside `node_modules` — so a dependency shipping source
|
|
178
|
+
// beside a stale build directory would get its `.ts` loaded through
|
|
179
|
+
// strip-only mode instead of the resolution error it expects.
|
|
180
|
+
if (parentURL === undefined || !isTypeScriptSource(parentURL)) {
|
|
181
|
+
return nextResolve(specifier, context);
|
|
182
|
+
}
|
|
183
|
+
// A non-hierarchical parent (`data:`, `node:`) makes this throw
|
|
184
|
+
// ERR_INVALID_URL, which inside a resolve hook would convert Node's own
|
|
185
|
+
// diagnostic into a TypeError attributed to us.
|
|
186
|
+
let emitted;
|
|
187
|
+
try {
|
|
188
|
+
emitted = new URL(specifier, parentURL);
|
|
189
|
+
}
|
|
190
|
+
catch (error) {
|
|
191
|
+
void error;
|
|
192
|
+
return nextResolve(specifier, context);
|
|
193
|
+
}
|
|
194
|
+
if (emitted.protocol !== 'file:' || fs.existsSync(emitted)) {
|
|
195
|
+
return nextResolve(specifier, context);
|
|
196
|
+
}
|
|
197
|
+
const source = typeScriptSourceFor(emitted.href);
|
|
198
|
+
if (source === undefined)
|
|
199
|
+
return nextResolve(specifier, context);
|
|
200
|
+
// Carry the parent's query onto the rewrite. Watch mode busts Node's
|
|
201
|
+
// module cache by appending `?t=<now>` to the ENTRY url only; a statically
|
|
202
|
+
// imported sibling keys on its own url, which carries no query, so it is
|
|
203
|
+
// evaluated once and reused for the life of the session. Measured: edit a
|
|
204
|
+
// shared glob in the sibling and the re-run reports green computed from
|
|
205
|
+
// the code you just replaced, with no signal. Propagating the query makes
|
|
206
|
+
// the whole graph fresh, and is a no-op outside watch because there is no
|
|
207
|
+
// query to carry.
|
|
208
|
+
const rewritten = new URL(source);
|
|
209
|
+
rewritten.search = new URL(parentURL).search;
|
|
210
|
+
return nextResolve(rewritten.href, context);
|
|
211
|
+
},
|
|
212
|
+
});
|
|
213
|
+
}
|
|
67
214
|
/**
|
|
68
215
|
* Refuse a run that named no rule files, saying where to name them.
|
|
69
216
|
*
|
package/dist/cli-config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-config.js","sourceRoot":"","sources":["../src/cli-config.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"cli-config.js","sourceRoot":"","sources":["../src/cli-config.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE3C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAqC3C,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAA;AAE/D,qEAAqE;AACrE,MAAM,UAAU,cAAc,CAAC,SAA4B;IACzD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAA;IACzB,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;QAC7B,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;QACtC,IAAI,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC;YAAE,OAAO,SAAS,CAAA;IAChD,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,wEAAwE;AACxE,SAAS,SAAS,CAAC,KAAc;IAC/B,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAA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;AACd,CAAC"}
|
package/dist/internal.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ export { violationsEmittedCount } from './report.js';
|
|
|
42
42
|
export { writeStderr } from './stderr.js';
|
|
43
43
|
export { RunScheduler, watchAndRerun } from './watch.js';
|
|
44
44
|
export type { WatchOptions } from './watch.js';
|
|
45
|
-
export { findConfigFile, extractSharedConfig, isModuleFormatRefusal, requireRuleFiles, } from './cli-config.js';
|
|
45
|
+
export { findConfigFile, extractSharedConfig, isModuleFormatRefusal, isTypeScriptSpecifierMiss, enableTypeScriptSpecifierResolution, requireRuleFiles, } from './cli-config.js';
|
|
46
46
|
export type { SharedCliConfig } from './cli-config.js';
|
|
47
47
|
export { walkFiles, toPosix } from './file-walk.js';
|
|
48
48
|
export { declaredGlobsOf } from './rule-builder.js';
|
package/dist/internal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAeA,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACpD,YAAY,EAAE,IAAI,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAC9D,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,IA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claims, and classifying Node's module-format
|
|
66
66
|
// refusal. Family plumbing (ADR-011): a consumer writing rules never calls
|
|
67
67
|
// these; every dialect's CLI does, and did so from its own copy until now.
|
|
68
|
-
export { findConfigFile, extractSharedConfig, isModuleFormatRefusal, requireRuleFiles, } from './cli-config.js';
|
|
68
|
+
export { findConfigFile, extractSharedConfig, isModuleFormatRefusal, isTypeScriptSpecifierMiss, enableTypeScriptSpecifierResolution, requireRuleFiles, } from './cli-config.js';
|
|
69
69
|
// Recursive file discovery for the dialects that read a directory tree rather
|
|
70
70
|
// than a TypeScript project (`eess-md`, `eess-crossvalidate`). Each carried its
|
|
71
71
|
// own copy at 99% similarity.
|
package/dist/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,EAAE;AACF,4EAA4E;AAC5E,iFAAiF;AACjF,yEAAyE;AACzE,EAAE;AACF,+EAA+E;AAC/E,6EAA6E;AAC7E,iFAAiF;AACjF,+EAA+E;AAC/E,wBAAwB;AACxB,EAAE;AACF,gFAAgF;AAChF,sDAAsD;AAMtD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAC9D,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAC9D,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAC/E,O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;AACxE,gCAAgC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAEhD,gFAAgF;AAChF,qEAAqE;AACrE,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAEzE,wEAAwE;AACxE,oEAAoE;AACpE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA"}
|
package/dist/path-universe.d.ts
CHANGED
|
@@ -26,6 +26,25 @@ export interface PathUniverse {
|
|
|
26
26
|
readonly tsconfigRelativeFilePaths: readonly string[];
|
|
27
27
|
/** `parentDirs` relative to the tsconfig directory, for message wording. */
|
|
28
28
|
readonly tsconfigRelativeParentDirs: readonly string[];
|
|
29
|
+
/**
|
|
30
|
+
* `filePaths` named from the **identity root** — the `.git`/workspace root
|
|
31
|
+
* above the tsconfig, as `discoverIdentityRoot` finds it.
|
|
32
|
+
*
|
|
33
|
+
* A third view, because the first two cannot express how a monorepo addresses
|
|
34
|
+
* its own packages. `'**\/apps/api/src/**'` names segments BETWEEN the
|
|
35
|
+
* repository root and the tsconfig directory: the absolute view carries the
|
|
36
|
+
* checkout's own path (and a dot-segment in it stops `**` dead), while the
|
|
37
|
+
* tsconfig-relative view has `apps/api/` stripped off the front — the very
|
|
38
|
+
* thing the glob names. [Bug 0348](../../../work/bugs/fixed/0348-a-glob-naming-segments-above-the-tsconfig-root-still-dies-under-a-dot-directory.md).
|
|
39
|
+
*
|
|
40
|
+
* Required rather than optional deliberately. An optional view is one a
|
|
41
|
+
* materializer can omit and still typecheck, and a missing view here makes a
|
|
42
|
+
* live glob look unsatisfiable — a dead-selector finding against a rule that
|
|
43
|
+
* works, which is ADR-009 rule 2's confidently-wrong cause.
|
|
44
|
+
*/
|
|
45
|
+
readonly repoRelativeFilePaths: readonly string[];
|
|
46
|
+
/** `parentDirs` named from the identity root. See `repoRelativeFilePaths`. */
|
|
47
|
+
readonly repoRelativeParentDirs: readonly string[];
|
|
29
48
|
}
|
|
30
49
|
/**
|
|
31
50
|
* The views a glob of this kind is matched against.
|
|
@@ -39,6 +58,39 @@ export interface PathUniverse {
|
|
|
39
58
|
*
|
|
40
59
|
* `import-target`, `specifier` and `literal` are not path kinds and have no
|
|
41
60
|
* views, so they can never be found unsatisfiable here.
|
|
61
|
+
*
|
|
62
|
+
* ## Why the identity view is asked for and the others are not
|
|
63
|
+
*
|
|
64
|
+
* `readsRepoRelative` is the caller's answer to "does the MATCHER give this
|
|
65
|
+
* glob the identity-root view?" — the dialect owns that rule (ADR-013: the
|
|
66
|
+
* kernel takes the fact, not the policy), and it is required rather than
|
|
67
|
+
* defaulted because a caller that forgets would get the generous union.
|
|
68
|
+
*
|
|
69
|
+
* Generosity is safe for the tsconfig view and is not for this one, which is the
|
|
70
|
+
* whole reason for the asymmetry. The tsconfig view differs from the absolute
|
|
71
|
+
* path only by a prefix the matcher usually strips too. The identity view adds
|
|
72
|
+
* the segments BETWEEN the repository root and the package — so in a monorepo
|
|
73
|
+
* `'apps/identity/**'`, a project-relative glob that selects nothing because the
|
|
74
|
+
* project root is `apps/api`, matches `apps/identity/src/…` in this view and
|
|
75
|
+
* stops being reported dead. Measured while fixing bug 0348, before this
|
|
76
|
+
* parameter existed, with that glob selecting 0 subjects:
|
|
77
|
+
*
|
|
78
|
+
* | the rule | with this gate | without it |
|
|
79
|
+
* | --------------------------------- | -------------- | ---------- |
|
|
80
|
+
* | `…notImportFrom(x)` | the dead-selector finding, which names the cause | ADR-010's floor, which does not |
|
|
81
|
+
* | `…notImportFrom(x).expectEmpty()` | the dead-selector finding | **nothing — green** |
|
|
82
|
+
*
|
|
83
|
+
* The second row is why this is a required parameter and not a default. A
|
|
84
|
+
* declaration is an assertion that EXPIRES, and expiry needs `examined > 0`
|
|
85
|
+
* (`terminal-execution.ts`); when a checkout path empties the selector rather than
|
|
86
|
+
* the code, expiry can never engage and the declaration silently outlives what it
|
|
87
|
+
* was declared about.
|
|
88
|
+
*
|
|
89
|
+
* The tsconfig view needs no such gate, and that was MEASURED rather than
|
|
90
|
+
* assumed: the two globs the matcher withholds it from — `'*\/x/**'` and
|
|
91
|
+
* anything carrying a `'./'` segment — are caught by `syntacticFault` before
|
|
92
|
+
* any view is consulted, so each still reports as dead. A draft of this
|
|
93
|
+
* comment cited a bug for that case; there is none.
|
|
42
94
|
*/
|
|
43
|
-
export declare function viewsFor(universe: PathUniverse, kind: 'file-path' | 'parent-dir' | 'import-target' | 'specifier' | 'literal'): readonly (readonly string[])[];
|
|
95
|
+
export declare function viewsFor(universe: PathUniverse, kind: 'file-path' | 'parent-dir' | 'import-target' | 'specifier' | 'literal', readsRepoRelative: boolean): readonly (readonly string[])[];
|
|
44
96
|
//# sourceMappingURL=path-universe.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path-universe.d.ts","sourceRoot":"","sources":["../src/path-universe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,WAAW,YAAY;IAC3B,mDAAmD;IACnD,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;IACrC;;;;;;;;;OASG;IACH,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAA;IACtC,2EAA2E;IAC3E,QAAQ,CAAC,yBAAyB,EAAE,SAAS,MAAM,EAAE,CAAA;IACrD,4EAA4E;IAC5E,QAAQ,CAAC,0BAA0B,EAAE,SAAS,MAAM,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"path-universe.d.ts","sourceRoot":"","sources":["../src/path-universe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,WAAW,YAAY;IAC3B,mDAAmD;IACnD,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;IACrC;;;;;;;;;OASG;IACH,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAA;IACtC,2EAA2E;IAC3E,QAAQ,CAAC,yBAAyB,EAAE,SAAS,MAAM,EAAE,CAAA;IACrD,4EAA4E;IAC5E,QAAQ,CAAC,0BAA0B,EAAE,SAAS,MAAM,EAAE,CAAA;IACtD;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,qBAAqB,EAAE,SAAS,MAAM,EAAE,CAAA;IACjD,8EAA8E;IAC9E,QAAQ,CAAC,sBAAsB,EAAE,SAAS,MAAM,EAAE,CAAA;CACnD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAgB,QAAQ,CACtB,QAAQ,EAAE,YAAY,EACtB,IAAI,EAAE,WAAW,GAAG,YAAY,GAAG,eAAe,GAAG,WAAW,GAAG,SAAS,EAC5E,iBAAiB,EAAE,OAAO,GACzB,SAAS,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAUhC"}
|
package/dist/path-universe.js
CHANGED
|
@@ -10,12 +10,49 @@
|
|
|
10
10
|
*
|
|
11
11
|
* `import-target`, `specifier` and `literal` are not path kinds and have no
|
|
12
12
|
* views, so they can never be found unsatisfiable here.
|
|
13
|
+
*
|
|
14
|
+
* ## Why the identity view is asked for and the others are not
|
|
15
|
+
*
|
|
16
|
+
* `readsRepoRelative` is the caller's answer to "does the MATCHER give this
|
|
17
|
+
* glob the identity-root view?" — the dialect owns that rule (ADR-013: the
|
|
18
|
+
* kernel takes the fact, not the policy), and it is required rather than
|
|
19
|
+
* defaulted because a caller that forgets would get the generous union.
|
|
20
|
+
*
|
|
21
|
+
* Generosity is safe for the tsconfig view and is not for this one, which is the
|
|
22
|
+
* whole reason for the asymmetry. The tsconfig view differs from the absolute
|
|
23
|
+
* path only by a prefix the matcher usually strips too. The identity view adds
|
|
24
|
+
* the segments BETWEEN the repository root and the package — so in a monorepo
|
|
25
|
+
* `'apps/identity/**'`, a project-relative glob that selects nothing because the
|
|
26
|
+
* project root is `apps/api`, matches `apps/identity/src/…` in this view and
|
|
27
|
+
* stops being reported dead. Measured while fixing bug 0348, before this
|
|
28
|
+
* parameter existed, with that glob selecting 0 subjects:
|
|
29
|
+
*
|
|
30
|
+
* | the rule | with this gate | without it |
|
|
31
|
+
* | --------------------------------- | -------------- | ---------- |
|
|
32
|
+
* | `…notImportFrom(x)` | the dead-selector finding, which names the cause | ADR-010's floor, which does not |
|
|
33
|
+
* | `…notImportFrom(x).expectEmpty()` | the dead-selector finding | **nothing — green** |
|
|
34
|
+
*
|
|
35
|
+
* The second row is why this is a required parameter and not a default. A
|
|
36
|
+
* declaration is an assertion that EXPIRES, and expiry needs `examined > 0`
|
|
37
|
+
* (`terminal-execution.ts`); when a checkout path empties the selector rather than
|
|
38
|
+
* the code, expiry can never engage and the declaration silently outlives what it
|
|
39
|
+
* was declared about.
|
|
40
|
+
*
|
|
41
|
+
* The tsconfig view needs no such gate, and that was MEASURED rather than
|
|
42
|
+
* assumed: the two globs the matcher withholds it from — `'*\/x/**'` and
|
|
43
|
+
* anything carrying a `'./'` segment — are caught by `syntacticFault` before
|
|
44
|
+
* any view is consulted, so each still reports as dead. A draft of this
|
|
45
|
+
* comment cited a bug for that case; there is none.
|
|
13
46
|
*/
|
|
14
|
-
export function viewsFor(universe, kind) {
|
|
47
|
+
export function viewsFor(universe, kind, readsRepoRelative) {
|
|
15
48
|
if (kind === 'file-path')
|
|
16
|
-
return
|
|
49
|
+
return readsRepoRelative
|
|
50
|
+
? [universe.filePaths, universe.tsconfigRelativeFilePaths, universe.repoRelativeFilePaths]
|
|
51
|
+
: [universe.filePaths, universe.tsconfigRelativeFilePaths];
|
|
17
52
|
if (kind === 'parent-dir')
|
|
18
|
-
return
|
|
53
|
+
return readsRepoRelative
|
|
54
|
+
? [universe.parentDirs, universe.tsconfigRelativeParentDirs, universe.repoRelativeParentDirs]
|
|
55
|
+
: [universe.parentDirs, universe.tsconfigRelativeParentDirs];
|
|
19
56
|
return [];
|
|
20
57
|
}
|
|
21
58
|
//# sourceMappingURL=path-universe.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path-universe.js","sourceRoot":"","sources":["../src/path-universe.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"path-universe.js","sourceRoot":"","sources":["../src/path-universe.ts"],"names":[],"mappings":"AAiDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,MAAM,UAAU,QAAQ,CACtB,QAAsB,EACtB,IAA4E,EAC5E,iBAA0B;IAE1B,IAAI,IAAI,KAAK,WAAW;QACtB,OAAO,iBAAiB;YACtB,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,yBAAyB,EAAE,QAAQ,CAAC,qBAAqB,CAAC;YAC1F,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,yBAAyB,CAAC,CAAA;IAC9D,IAAI,IAAI,KAAK,YAAY;QACvB,OAAO,iBAAiB;YACtB,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,0BAA0B,EAAE,QAAQ,CAAC,sBAAsB,CAAC;YAC7F,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,0BAA0B,CAAC,CAAA;IAChE,OAAO,EAAE,CAAA;AACX,CAAC"}
|
package/package.json
CHANGED