@cplieger/deadset-ts 8.0.0-dev.5 → 8.0.0-dev.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/mapper-connection.js +2 -1
- package/dist/bin/node-host.js +3 -2
- package/dist/src/analysis.js +28 -46
- package/dist/src/automatic-types.js +10 -29
- package/dist/src/build-scripts.js +17 -29
- package/dist/src/component-layer.js +4 -2
- package/dist/src/components.js +2 -3
- package/dist/src/config.js +3 -2
- package/dist/src/configuration-files.js +27 -168
- package/dist/src/conformance-record.js +1 -1
- package/dist/src/contract/contract.generated.js +1084 -0
- package/dist/src/contract/report.generated.js +796 -0
- package/dist/src/conventions.js +20 -60
- package/dist/src/dependencies.js +25 -43
- package/dist/src/discover.js +13 -39
- package/dist/src/edges.js +7 -15
- package/dist/src/element-access.js +4 -6
- package/dist/src/entry-point-gaps.js +2 -8
- package/dist/src/entry-points.js +3 -10
- package/dist/src/enum-group.js +3 -10
- package/dist/src/erased-stores.js +4 -6
- package/dist/src/exempt-classes.js +3 -63
- package/dist/src/exempt.js +13 -40
- package/dist/src/file-facts.js +2 -25
- package/dist/src/findings/completion.js +11 -20
- package/dist/src/findings/dependencies-and-module-machinery.js +4 -5
- package/dist/src/findings/emitters.js +4 -4
- package/dist/src/findings/interfaces.js +4 -5
- package/dist/src/findings/intra-function.js +8 -7
- package/dist/src/findings/non-code-artifacts.js +5 -6
- package/dist/src/findings/reads-and-writes.js +11 -9
- package/dist/src/findings/self-check.js +10 -12
- package/dist/src/findings/unused-declarations.js +28 -27
- package/dist/src/findings/visibility-narrowing.js +9 -11
- package/dist/src/findings-pass.js +7 -14
- package/dist/src/fs/manifest.js +43 -0
- package/dist/src/fs/tree.js +88 -0
- package/dist/src/git-ignore.js +34 -25
- package/dist/src/html-entries.js +6 -33
- package/dist/src/in-operands.js +2 -1
- package/dist/src/index.js +1 -1
- package/dist/src/intra-function-parts.js +18 -26
- package/dist/src/inventory.js +2 -21
- package/dist/src/json-document.js +4 -0
- package/dist/src/keyof-comparisons.js +4 -6
- package/dist/src/kinds.js +4 -360
- package/dist/src/manifest.js +5 -43
- package/dist/src/mdx-entries.js +3 -26
- package/dist/src/partial.js +2 -1
- package/dist/src/paths.js +26 -15
- package/dist/src/position.js +2 -1
- package/dist/src/print.js +3 -2
- package/dist/src/product.js +13 -0
- package/dist/src/references.js +14 -27
- package/dist/src/report-schema.js +272 -0
- package/dist/src/report.js +39 -42
- package/dist/src/reporters/sarif.js +4 -2
- package/dist/src/reporters/template.js +4 -19
- package/dist/src/resolve.js +12 -26
- package/dist/src/roots.js +7 -17
- package/dist/src/run.js +10 -8
- package/dist/src/schema.js +4 -3
- package/dist/src/scope.js +4 -5
- package/dist/src/serialization-contract.js +4 -8
- package/dist/src/session.js +2 -1
- package/dist/src/setup-failure.js +2 -6
- package/dist/src/suppress-file.js +12 -13
- package/dist/src/suppress-inline.js +3 -2
- package/dist/src/suppress.js +29 -48
- package/dist/src/symbol-keys.js +3 -5
- package/dist/src/template-field.js +5 -15
- package/dist/src/test-globals.js +6 -28
- package/dist/src/test-joins.js +6 -6
- package/dist/src/text/compare.js +26 -0
- package/dist/src/text/glob.js +194 -0
- package/dist/src/text/shell.js +159 -0
- package/dist/src/{yaml-document.js → text/yaml.js} +38 -0
- package/dist/src/type-errors.js +14 -38
- package/dist/src/unseen-loads.js +2 -9
- package/dist/src/unwrap.js +23 -0
- package/dist/src/verbs/analyze.js +22 -15
- package/dist/src/verbs/describe.js +7 -7
- package/dist/src/verbs/explain.js +7 -4
- package/dist/src/verbs/print-config.js +2 -1
- package/dist/src/verbs/print-projects.js +4 -2
- package/dist/src/verbs/print-retained.js +4 -2
- package/dist/src/verbs/print-roots.js +4 -2
- package/dist/src/verbs/verb.js +1 -5
- package/dist/src/verbs/version.js +4 -3
- package/dist/src/workflow-steps.js +9 -46
- package/dist/src/workspace-manifests.js +2 -2
- package/dist/src/workspace-programs.js +5 -3
- package/dist/src/workspace-resolution.js +13 -17
- package/dist/src/workspace.js +28 -116
- package/jsr.json +1 -1
- package/package.json +2 -1
- package/src/analysis.ts +29 -54
- package/src/automatic-types.ts +11 -29
- package/src/build-scripts.ts +17 -38
- package/src/component-layer.ts +4 -2
- package/src/components.ts +2 -4
- package/src/config.ts +11 -15
- package/src/configuration-files.ts +27 -170
- package/src/conformance-record.ts +1 -1
- package/src/contract/contract.generated.ts +1148 -0
- package/src/contract/report.generated.ts +1157 -0
- package/src/conventions.ts +26 -74
- package/src/dependencies.ts +32 -50
- package/src/discover.ts +14 -39
- package/src/edges.ts +7 -21
- package/src/element-access.ts +4 -7
- package/src/entry-point-gaps.ts +3 -9
- package/src/entry-points.ts +2 -13
- package/src/enum-group.ts +2 -11
- package/src/erased-stores.ts +3 -7
- package/src/exempt-classes.ts +5 -74
- package/src/exempt.ts +17 -47
- package/src/file-facts.ts +6 -24
- package/src/finding.ts +9 -9
- package/src/findings/completion.ts +22 -23
- package/src/findings/dependencies-and-module-machinery.ts +4 -7
- package/src/findings/emitter.ts +6 -7
- package/src/findings/emitters.ts +6 -6
- package/src/findings/interfaces.ts +4 -6
- package/src/findings/intra-function.ts +8 -8
- package/src/findings/non-code-artifacts.ts +5 -7
- package/src/findings/reads-and-writes.ts +15 -12
- package/src/findings/self-check.ts +11 -17
- package/src/findings/unused-declarations.ts +28 -27
- package/src/findings/visibility-narrowing.ts +9 -12
- package/src/findings-pass.ts +7 -16
- package/src/fs/manifest.ts +52 -0
- package/src/fs/tree.ts +110 -0
- package/src/git-ignore.ts +38 -25
- package/src/html-entries.ts +6 -33
- package/src/in-operands.ts +2 -1
- package/src/index.ts +1 -1
- package/src/intra-function-parts.ts +18 -28
- package/src/inventory.ts +2 -20
- package/src/json-document.ts +5 -0
- package/src/keyof-comparisons.ts +3 -7
- package/src/kinds.ts +6 -406
- package/src/manifest.ts +5 -46
- package/src/mdx-entries.ts +3 -26
- package/src/partial.ts +2 -1
- package/src/paths.ts +27 -15
- package/src/position.ts +2 -1
- package/src/print.ts +3 -2
- package/src/product.ts +18 -0
- package/src/references.ts +14 -29
- package/src/report-schema.ts +364 -0
- package/src/report.ts +66 -229
- package/src/reporters/annotations.ts +2 -2
- package/src/reporters/json.ts +1 -1
- package/src/reporters/reporter.ts +2 -2
- package/src/reporters/reporters.ts +1 -1
- package/src/reporters/sarif.ts +17 -12
- package/src/reporters/template.ts +4 -20
- package/src/reporters/text.ts +3 -3
- package/src/resolve.ts +31 -38
- package/src/roots.ts +7 -20
- package/src/run.ts +10 -14
- package/src/schema.ts +4 -3
- package/src/scope.ts +4 -10
- package/src/serialization-contract.ts +4 -9
- package/src/session.ts +2 -1
- package/src/setup-failure.ts +5 -7
- package/src/suppress-file.ts +11 -15
- package/src/suppress-inline.ts +2 -2
- package/src/suppress.ts +39 -55
- package/src/symbol-keys.ts +2 -5
- package/src/template-field.ts +5 -18
- package/src/test-globals.ts +9 -27
- package/src/test-joins.ts +6 -8
- package/src/text/compare.ts +27 -0
- package/src/text/glob.ts +210 -0
- package/src/text/shell.ts +161 -0
- package/src/{yaml-document.ts → text/yaml.ts} +46 -0
- package/src/type-errors.ts +25 -36
- package/src/unseen-loads.ts +1 -12
- package/src/unwrap.ts +34 -0
- package/src/verbs/analyze.ts +38 -25
- package/src/verbs/describe.ts +13 -7
- package/src/verbs/explain.ts +7 -4
- package/src/verbs/print-config.ts +2 -1
- package/src/verbs/print-projects.ts +4 -2
- package/src/verbs/print-retained.ts +4 -2
- package/src/verbs/print-roots.ts +4 -2
- package/src/verbs/verb.ts +0 -6
- package/src/verbs/version.ts +4 -3
- package/src/workflow-steps.ts +9 -44
- package/src/workspace-manifests.ts +2 -2
- package/src/workspace-programs.ts +5 -3
- package/src/workspace-resolution.ts +21 -17
- package/src/workspace.ts +35 -121
- package/dist/src/glob.js +0 -65
- package/dist/src/pnpm-workspace.js +0 -120
- package/dist/src/version.js +0 -7
- package/src/glob.ts +0 -67
- package/src/pnpm-workspace.ts +0 -135
- package/src/version.ts +0 -7
|
@@ -7,8 +7,12 @@
|
|
|
7
7
|
* uses it and each relative one that names a source file of the program roots the file.
|
|
8
8
|
*/
|
|
9
9
|
import { isCallExpression, isExportDeclaration, isIdentifier, isImportDeclaration, isNoSubstitutionTemplateLiteral, isStringLiteral, SyntaxKind, } from "@typescript/native/ast";
|
|
10
|
-
import { dirnamePath, joinPath, relativePath, resolvePath } from "./paths.js";
|
|
11
|
-
|
|
10
|
+
import { ancestors, dirnamePath, joinPath, relativePath, resolvePath } from "./paths.js";
|
|
11
|
+
import { bytewise } from "./text/compare.js";
|
|
12
|
+
import { isRecord } from "./json-document.js";
|
|
13
|
+
import { filesIn } from "./fs/tree.js";
|
|
14
|
+
import { holdsManifest, inInstalledPackages, manifestAt, readJSON } from "./fs/manifest.js";
|
|
15
|
+
import { shellWords } from "./text/shell.js";
|
|
12
16
|
/** A configuration module's name, each form with the spelling a root reports it by. */
|
|
13
17
|
const MODULE_FORMS = [
|
|
14
18
|
{ name: /^[\w-]+\.config\.(?:js|mjs|cjs|ts|mts|cts)$/u, form: "<stem>.config.<ext>" },
|
|
@@ -50,18 +54,14 @@ export const RESOLVED_EXTENSIONS = [
|
|
|
50
54
|
".mjs",
|
|
51
55
|
".cjs",
|
|
52
56
|
];
|
|
53
|
-
/** The directory a package manager installs packages into, whose files are no project's own. */
|
|
54
|
-
const MODULES_DIR = "node_modules";
|
|
55
57
|
/** The file's name, the last segment of its path. */
|
|
56
58
|
function basename(path) {
|
|
57
59
|
return path.slice(path.lastIndexOf("/") + 1);
|
|
58
60
|
}
|
|
59
61
|
/** Whether one path is the project's own: below the target root and in no `node_modules`. */
|
|
60
62
|
function isProjectPath(root, path) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
function isRecord(value) {
|
|
64
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
63
|
+
const below = relativePath(root, path);
|
|
64
|
+
return below !== undefined && !inInstalledPackages(below);
|
|
65
65
|
}
|
|
66
66
|
/** The form one file name is as a configuration module, or undefined where it is none. */
|
|
67
67
|
export function configurationModuleForm(name) {
|
|
@@ -75,122 +75,13 @@ export function isConfigurationDocumentName(name) {
|
|
|
75
75
|
const CONFIG_FLAGS = new Set(["--config", "-c"]);
|
|
76
76
|
/** The extensions of a module a configuration flag may name. */
|
|
77
77
|
const MODULE_EXTENSIONS = [".js", ".mjs", ".cjs", ".ts", ".mts", ".cts"];
|
|
78
|
-
/** The characters that end a word outside quotes and separate nothing: blanks. */
|
|
79
|
-
// Stryker disable next-line Regex: its \v to \V mutant is no valid escape under the u flag, so the whole module fails to parse
|
|
80
|
-
const BLANK = /[ \t\r\f\v]/u;
|
|
81
|
-
/** The characters that end a word outside quotes and begin an operator: newline included. */
|
|
82
|
-
const OPERATOR = /[\n;&|()<>]/u;
|
|
83
|
-
/** The characters a backslash escapes inside double quotes; before any other it stands for itself. */
|
|
84
|
-
const DOUBLE_QUOTE_ESCAPES = new Set(["$", "`", '"', "\\"]);
|
|
85
|
-
/**
|
|
86
|
-
* The words of one command line, as POSIX token recognition reads quotes, backslashes,
|
|
87
|
-
* line continuations, comments and operators. A word an expansion may change (an unquoted
|
|
88
|
-
* `$`, backquote, glob character or leading `~`, or a `$` or backquote in double quotes)
|
|
89
|
-
* is computed, and so is the rest of a line whose quote is never closed. A computed word
|
|
90
|
-
* and each operator are undefined, so a flag's file is never read across them.
|
|
91
|
-
*/
|
|
92
|
-
function shellWords(command) {
|
|
93
|
-
const words = [];
|
|
94
|
-
let word;
|
|
95
|
-
let computed = false;
|
|
96
|
-
const end = () => {
|
|
97
|
-
if (word !== undefined) {
|
|
98
|
-
words.push(computed ? undefined : word);
|
|
99
|
-
}
|
|
100
|
-
word = undefined;
|
|
101
|
-
computed = false;
|
|
102
|
-
};
|
|
103
|
-
for (let at = 0; at < command.length; at += 1) {
|
|
104
|
-
const char = command.charAt(at);
|
|
105
|
-
if (char === "\\" && command.charAt(at + 1) === "\n") {
|
|
106
|
-
at += 1;
|
|
107
|
-
}
|
|
108
|
-
else if (BLANK.test(char)) {
|
|
109
|
-
end();
|
|
110
|
-
}
|
|
111
|
-
else if (OPERATOR.test(char)) {
|
|
112
|
-
end();
|
|
113
|
-
words.push(undefined);
|
|
114
|
-
}
|
|
115
|
-
else if (char === "#" && word === undefined) {
|
|
116
|
-
const newline = command.indexOf("\n", at);
|
|
117
|
-
at = newline < 0 ? command.length : newline - 1;
|
|
118
|
-
}
|
|
119
|
-
else if (char === "\\") {
|
|
120
|
-
at += 1;
|
|
121
|
-
word = (word ?? "") + command.charAt(at);
|
|
122
|
-
}
|
|
123
|
-
else if (char === "'" || char === '"') {
|
|
124
|
-
const close = closingQuote(command, at);
|
|
125
|
-
if (close < 0) {
|
|
126
|
-
word ??= "";
|
|
127
|
-
computed = true;
|
|
128
|
-
break;
|
|
129
|
-
}
|
|
130
|
-
const quoted = char === "'"
|
|
131
|
-
? { text: command.slice(at + 1, close), computed: false }
|
|
132
|
-
: doubleQuoted(command.slice(at + 1, close));
|
|
133
|
-
word = (word ?? "") + quoted.text;
|
|
134
|
-
computed ||= quoted.computed;
|
|
135
|
-
at = close;
|
|
136
|
-
}
|
|
137
|
-
else {
|
|
138
|
-
computed ||= /[$`*?[]/u.test(char) || (char === "~" && word === undefined);
|
|
139
|
-
word = (word ?? "") + char;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
end();
|
|
143
|
-
return words;
|
|
144
|
-
}
|
|
145
|
-
/** The text between one pair of double quotes, unescaped, and whether an expansion may change it. */
|
|
146
|
-
function doubleQuoted(inner) {
|
|
147
|
-
let text = "";
|
|
148
|
-
let computed = false;
|
|
149
|
-
for (let at = 0; at < inner.length; at += 1) {
|
|
150
|
-
const char = inner.charAt(at);
|
|
151
|
-
const next = inner.charAt(at + 1);
|
|
152
|
-
if (char === "\\" && next === "\n") {
|
|
153
|
-
at += 1;
|
|
154
|
-
}
|
|
155
|
-
else if (char === "\\" && DOUBLE_QUOTE_ESCAPES.has(next)) {
|
|
156
|
-
text += next;
|
|
157
|
-
at += 1;
|
|
158
|
-
}
|
|
159
|
-
else {
|
|
160
|
-
computed ||= char === "$" || char === "`";
|
|
161
|
-
text += char;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
return { text, computed };
|
|
165
|
-
}
|
|
166
|
-
/** The index of the quote that closes the one at `open`, or -1 where none does. */
|
|
167
|
-
function closingQuote(command, open) {
|
|
168
|
-
const quote = command.charAt(open);
|
|
169
|
-
for (let at = open + 1; at < command.length; at += 1) {
|
|
170
|
-
const char = command.charAt(at);
|
|
171
|
-
if (char === quote) {
|
|
172
|
-
return at;
|
|
173
|
-
}
|
|
174
|
-
if (quote === '"' && char === "\\") {
|
|
175
|
-
at += 1;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
return -1;
|
|
179
|
-
}
|
|
180
78
|
/**
|
|
181
79
|
* The files the scripts of the manifest in one directory name after a configuration flag,
|
|
182
80
|
* `--config <file>`, `-c <file>` or `--config=<file>`, each a JSON file or a module below
|
|
183
81
|
* the target root and in no `node_modules`.
|
|
184
82
|
*/
|
|
185
83
|
function scriptConfigurations(host, root, dir) {
|
|
186
|
-
|
|
187
|
-
try {
|
|
188
|
-
const manifest = JSON.parse(host.readFile(joinPath(dir, MANIFEST)));
|
|
189
|
-
scripts = isRecord(manifest) ? manifest["scripts"] : undefined;
|
|
190
|
-
}
|
|
191
|
-
catch {
|
|
192
|
-
return [];
|
|
193
|
-
}
|
|
84
|
+
const scripts = manifestAt(host, dir)?.["scripts"];
|
|
194
85
|
if (!isRecord(scripts)) {
|
|
195
86
|
return [];
|
|
196
87
|
}
|
|
@@ -217,15 +108,6 @@ function scriptConfigurations(host, root, dir) {
|
|
|
217
108
|
}
|
|
218
109
|
return found;
|
|
219
110
|
}
|
|
220
|
-
/** The decoded value of one JSON file, or undefined where it cannot be read or parsed. */
|
|
221
|
-
function readDocument(host, path) {
|
|
222
|
-
try {
|
|
223
|
-
return JSON.parse(host.readFile(path));
|
|
224
|
-
}
|
|
225
|
-
catch {
|
|
226
|
-
return undefined;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
111
|
/** Every string value one decoded JSON value holds at any depth. */
|
|
230
112
|
export function documentStrings(value) {
|
|
231
113
|
if (typeof value === "string") {
|
|
@@ -258,10 +140,10 @@ export function moduleStrings(file) {
|
|
|
258
140
|
export function configurationFiles(host, targetRoot, files, parse) {
|
|
259
141
|
const root = resolvePath(host.workingDirectory(), targetRoot);
|
|
260
142
|
const manifests = new Map();
|
|
261
|
-
const
|
|
143
|
+
const manifestHeld = (dir) => {
|
|
262
144
|
let held = manifests.get(dir);
|
|
263
145
|
if (held === undefined) {
|
|
264
|
-
held = host
|
|
146
|
+
held = holdsManifest(host, dir);
|
|
265
147
|
manifests.set(dir, held);
|
|
266
148
|
}
|
|
267
149
|
return held;
|
|
@@ -271,30 +153,23 @@ export function configurationFiles(host, targetRoot, files, parse) {
|
|
|
271
153
|
for (const file of files.byPath.values()) {
|
|
272
154
|
const form = configurationModuleForm(basename(file.fileName));
|
|
273
155
|
const fileDir = dirnamePath(file.fileName);
|
|
274
|
-
if (form !== undefined &&
|
|
156
|
+
if (form !== undefined && manifestHeld(fileDir)) {
|
|
275
157
|
modules.push({ file, form, manifestDir: fileDir });
|
|
276
158
|
}
|
|
277
|
-
for (
|
|
159
|
+
for (const dir of ancestors(dirnamePath(file.fileName), root)) {
|
|
160
|
+
if (dirs.has(dir)) {
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
278
163
|
dirs.add(dir);
|
|
279
164
|
}
|
|
280
165
|
}
|
|
281
166
|
const pending = [];
|
|
282
167
|
const named = [];
|
|
283
|
-
for (const dir of [...dirs].sort()) {
|
|
284
|
-
if (!
|
|
168
|
+
for (const dir of [...dirs].sort(bytewise)) {
|
|
169
|
+
if (!manifestHeld(dir)) {
|
|
285
170
|
continue;
|
|
286
171
|
}
|
|
287
|
-
|
|
288
|
-
try {
|
|
289
|
-
names = host
|
|
290
|
-
.readDirectory(dir)
|
|
291
|
-
.filter((entry) => !entry.directory && isConfigurationDocumentName(entry.name))
|
|
292
|
-
.map((entry) => entry.name)
|
|
293
|
-
.sort();
|
|
294
|
-
}
|
|
295
|
-
catch {
|
|
296
|
-
names = [];
|
|
297
|
-
}
|
|
172
|
+
const names = filesIn(host, dir, isConfigurationDocumentName);
|
|
298
173
|
pending.push(...names.map((name) => ({ path: joinPath(dir, name), manifestDir: dir })));
|
|
299
174
|
for (const path of scriptConfigurations(host, root, dir)) {
|
|
300
175
|
const held = files.byName.get(path);
|
|
@@ -318,7 +193,7 @@ export function configurationFiles(host, targetRoot, files, parse) {
|
|
|
318
193
|
continue;
|
|
319
194
|
}
|
|
320
195
|
if (document === undefined) {
|
|
321
|
-
const value =
|
|
196
|
+
const value = readJSON(host, next.path);
|
|
322
197
|
if (value === undefined) {
|
|
323
198
|
unreadable.add(next.path);
|
|
324
199
|
continue;
|
|
@@ -343,7 +218,7 @@ export function configurationFiles(host, targetRoot, files, parse) {
|
|
|
343
218
|
documents: [...documents.values()],
|
|
344
219
|
outside: parse === undefined
|
|
345
220
|
? []
|
|
346
|
-
: outsideModules(host, root, [...dirs], files,
|
|
221
|
+
: outsideModules(host, root, [...dirs], files, manifestHeld, parse, named),
|
|
347
222
|
};
|
|
348
223
|
}
|
|
349
224
|
/** The literal module specifier one `require(...)` or `import(...)` call names, if any. */
|
|
@@ -429,23 +304,13 @@ export function resolveRelativeSpecifier(host, dir, specifier) {
|
|
|
429
304
|
* does not hold, and the project files below `root` they import by a relative specifier,
|
|
430
305
|
* until no further file joins. A file that cannot be read is skipped.
|
|
431
306
|
*/
|
|
432
|
-
function outsideModules(host, root, dirs, files,
|
|
307
|
+
function outsideModules(host, root, dirs, files, manifestHeld, parse, named) {
|
|
433
308
|
const pending = [...named];
|
|
434
|
-
for (const dir of [...dirs].sort()) {
|
|
435
|
-
if (!
|
|
436
|
-
continue;
|
|
437
|
-
}
|
|
438
|
-
let names;
|
|
439
|
-
try {
|
|
440
|
-
names = host
|
|
441
|
-
.readDirectory(dir)
|
|
442
|
-
.filter((entry) => !entry.directory && configurationModuleForm(entry.name) !== undefined)
|
|
443
|
-
.map((entry) => entry.name)
|
|
444
|
-
.sort();
|
|
445
|
-
}
|
|
446
|
-
catch {
|
|
309
|
+
for (const dir of [...dirs].sort(bytewise)) {
|
|
310
|
+
if (!manifestHeld(dir)) {
|
|
447
311
|
continue;
|
|
448
312
|
}
|
|
313
|
+
const names = filesIn(host, dir, (name) => configurationModuleForm(name) !== undefined);
|
|
449
314
|
pending.push(...names.map((name) => ({ path: joinPath(dir, name), manifestDir: dir })));
|
|
450
315
|
}
|
|
451
316
|
const found = new Map();
|
|
@@ -481,14 +346,8 @@ function outsideModules(host, root, dirs, files, holdsManifest, parse, named) {
|
|
|
481
346
|
}
|
|
482
347
|
/** Every dependency the manifest in one directory declares, or none where it holds none to read. */
|
|
483
348
|
export function declaredIn(host, dir) {
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
value = JSON.parse(host.readFile(joinPath(dir, MANIFEST)));
|
|
487
|
-
}
|
|
488
|
-
catch {
|
|
489
|
-
return [];
|
|
490
|
-
}
|
|
491
|
-
if (!isRecord(value)) {
|
|
349
|
+
const value = manifestAt(host, dir);
|
|
350
|
+
if (value === undefined) {
|
|
492
351
|
return [];
|
|
493
352
|
}
|
|
494
353
|
const names = new Set();
|
|
@@ -4,7 +4,7 @@ export const RECORD = {
|
|
|
4
4
|
conformance: {
|
|
5
5
|
corpusVersion: "6.0.0",
|
|
6
6
|
result: "pass",
|
|
7
|
-
digest: "sha256:
|
|
7
|
+
digest: "sha256:34a8ab2311bbd063b1f341d0e01e35c7fdd059ca3bcd288a60df4491dc177734",
|
|
8
8
|
},
|
|
9
9
|
gaps: [],
|
|
10
10
|
};
|