@cplieger/deadset-ts 7.2.0-dev.4 → 8.0.0-dev.10
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/README.md +1 -1
- package/dist/bin/mapper-connection.js +2 -1
- package/dist/bin/node-host.js +24 -5
- package/dist/src/analysis.js +245 -309
- package/dist/src/augmentations.js +124 -18
- package/dist/src/automatic-types.js +170 -0
- package/dist/src/build-scripts.js +425 -0
- package/dist/src/component-layer.js +4 -2
- package/dist/src/components.js +9 -9
- package/dist/src/config.js +6 -81
- package/dist/src/configuration-files.js +78 -188
- package/dist/src/configured-declarations.js +15 -20
- package/dist/src/conformance-record.js +2 -2
- package/dist/src/consumers.js +3 -30
- package/dist/src/contextual-uses.js +56 -9
- package/dist/src/contract/config.generated.js +558 -0
- package/dist/src/contract/contract.generated.js +1244 -0
- package/dist/src/contract/report.generated.js +862 -0
- package/dist/src/convention-rows.js +146 -1
- package/dist/src/conventions.js +136 -70
- package/dist/src/decorator.js +21 -18
- package/dist/src/dependencies.js +280 -62
- package/dist/src/edges.js +38 -122
- package/dist/src/element-access.js +4 -6
- package/dist/src/entry-point-gaps.js +9 -18
- package/dist/src/entry-points.js +106 -21
- package/dist/src/enum-group.js +3 -10
- package/dist/src/erased-stores.js +4 -6
- package/dist/src/exempt-classes.js +1 -63
- package/dist/src/exempt.js +21 -40
- package/dist/src/failure.js +36 -0
- package/dist/src/file-facts.js +2 -25
- package/dist/src/findings/completion.js +225 -63
- package/dist/src/findings/dependencies-and-module-machinery.js +72 -27
- package/dist/src/findings/emitters.js +6 -6
- package/dist/src/findings/interfaces.js +4 -5
- package/dist/src/findings/intra-function.js +53 -19
- package/dist/src/findings/non-code-artifacts.js +71 -39
- package/dist/src/findings/reads-and-writes.js +16 -13
- package/dist/src/findings/self-check.js +10 -12
- package/dist/src/findings/unused-declarations.js +57 -28
- package/dist/src/findings/visibility-narrowing.js +40 -18
- package/dist/src/findings-pass.js +8 -15
- package/dist/src/framework-lifecycle.js +7 -7
- package/dist/src/fs/document.js +52 -0
- package/dist/src/fs/manifest.js +72 -0
- package/dist/src/fs/tree.js +88 -0
- package/dist/src/generated-file.js +18 -4
- package/dist/src/git-ignore.js +99 -0
- package/dist/src/graph.js +9 -4
- package/dist/src/html-entries.js +6 -33
- package/dist/src/import-bindings.js +97 -0
- package/dist/src/in-operands.js +2 -1
- package/dist/src/index.js +1 -1
- package/dist/src/indexed-access.js +130 -28
- package/dist/src/injection-container.js +1 -1
- package/dist/src/interface-satisfaction.js +30 -12
- package/dist/src/intra-function-parts.js +341 -69
- package/dist/src/inventory.js +54 -29
- package/dist/src/javascript-file.js +33 -0
- package/dist/src/json-document.js +198 -67
- package/dist/src/keyof-comparisons.js +4 -6
- package/dist/src/kinds.js +3 -366
- package/dist/src/load/classify.js +270 -0
- package/dist/src/load/diagnostics.js +80 -0
- package/dist/src/load/discover.js +277 -0
- package/dist/src/{emit-map.js → load/emit-map.js} +1 -1
- package/dist/src/load/expected-module.js +136 -0
- package/dist/src/load/load.js +27 -0
- package/dist/src/load/module-lookup.js +37 -0
- package/dist/src/load/plan.js +313 -0
- package/dist/src/load/specifiers.js +115 -0
- package/dist/src/load/synthesize.js +140 -0
- package/dist/src/load/test-globals.js +207 -0
- package/dist/src/load/test-joins.js +82 -0
- package/dist/src/{workspace-manifests.js → load/workspace-manifests.js} +4 -4
- package/dist/src/{workspace-programs.js → load/workspace-programs.js} +88 -61
- package/dist/src/{workspace-resolution.js → load/workspace-resolution.js} +60 -59
- package/dist/src/{workspace-run.js → load/workspace-run.js} +7 -7
- package/dist/src/{workspace.js → load/workspace.js} +62 -124
- package/dist/src/manifest.js +49 -54
- package/dist/src/matrix.js +94 -13
- package/dist/src/mdx-entries.js +174 -0
- package/dist/src/module-declarations.js +9 -13
- package/dist/src/outside-tests.js +1 -1
- package/dist/src/overrides.js +41 -10
- 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 +11 -78
- package/dist/src/product.js +13 -0
- package/dist/src/query.js +1 -0
- package/dist/src/ref.js +11 -0
- package/dist/src/references.js +52 -31
- package/dist/src/report-schema.js +51 -0
- package/dist/src/report.js +59 -41
- package/dist/src/reporters/annotations.js +15 -8
- package/dist/src/reporters/sarif.js +16 -10
- package/dist/src/reporters/template.js +4 -19
- package/dist/src/resolve.js +245 -727
- package/dist/src/roots.js +374 -116
- package/dist/src/run.js +66 -77
- package/dist/src/schema.js +320 -342
- package/dist/src/scope.js +38 -115
- package/dist/src/serialization-contract.js +649 -29
- package/dist/src/session.js +41 -29
- package/dist/src/source-files.js +40 -15
- package/dist/src/suppress-file.js +34 -29
- package/dist/src/suppress-inline.js +21 -4
- package/dist/src/suppress.js +40 -56
- package/dist/src/sweep.js +32 -17
- package/dist/src/symbol-keys.js +105 -6
- package/dist/src/template-field.js +9 -19
- package/dist/src/test-support.js +119 -18
- package/dist/src/text/compare.js +26 -0
- package/dist/src/text/glob.js +194 -0
- package/dist/src/text/named-files.js +54 -0
- package/dist/src/text/shell.js +159 -0
- package/dist/src/text/yaml.js +393 -0
- package/dist/src/type-errors.js +27 -221
- package/dist/src/type-parameter-reads.js +172 -0
- package/dist/src/unseen-loads.js +100 -0
- package/dist/src/unwrap.js +23 -0
- package/dist/src/usage.js +10 -0
- package/dist/src/verbs/analyze.js +181 -125
- package/dist/src/verbs/describe.js +9 -16
- package/dist/src/verbs/explain.js +14 -9
- package/dist/src/verbs/print-config.js +2 -1
- package/dist/src/verbs/print-projects.js +6 -4
- 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 +14 -3
- package/dist/src/workflow-steps.js +128 -33
- package/jsr.json +1 -1
- package/package.json +5 -4
- package/src/analysis.ts +333 -457
- package/src/augmentations.ts +152 -23
- package/src/automatic-types.ts +228 -0
- package/src/build-scripts.ts +543 -0
- package/src/component-layer.ts +4 -2
- package/src/components.ts +9 -10
- package/src/config.ts +31 -299
- package/src/configuration-files.ts +100 -191
- package/src/configured-declarations.ts +18 -23
- package/src/conformance-record.ts +2 -2
- package/src/consumers.ts +6 -57
- package/src/contextual-uses.ts +64 -12
- package/src/contract/config.generated.ts +818 -0
- package/src/contract/contract.generated.ts +1308 -0
- package/src/contract/report.generated.ts +1237 -0
- package/src/convention-rows.ts +186 -1
- package/src/conventions.ts +166 -90
- package/src/decorator.ts +28 -18
- package/src/dependencies.ts +356 -78
- package/src/edges.ts +41 -140
- package/src/element-access.ts +4 -7
- package/src/entry-point-gaps.ts +11 -20
- package/src/entry-points.ts +124 -28
- package/src/enum-group.ts +2 -11
- package/src/erased-stores.ts +3 -7
- package/src/exempt-classes.ts +1 -75
- package/src/exempt.ts +36 -50
- package/src/failure.ts +63 -0
- package/src/file-facts.ts +9 -24
- package/src/finding.ts +24 -9
- package/src/findings/boundary.ts +2 -0
- package/src/findings/completion.ts +297 -77
- package/src/findings/dependencies-and-module-machinery.ts +90 -31
- package/src/findings/emitter.ts +8 -9
- package/src/findings/emitters.ts +8 -8
- package/src/findings/interfaces.ts +4 -6
- package/src/findings/intra-function.ts +64 -20
- package/src/findings/non-code-artifacts.ts +88 -50
- package/src/findings/reads-and-writes.ts +20 -16
- package/src/findings/self-check.ts +11 -17
- package/src/findings/unused-declarations.ts +65 -28
- package/src/findings/visibility-narrowing.ts +51 -19
- package/src/findings-pass.ts +10 -19
- package/src/framework-lifecycle.ts +7 -7
- package/src/fs/document.ts +70 -0
- package/src/fs/manifest.ts +92 -0
- package/src/fs/tree.ts +110 -0
- package/src/generated-file.ts +23 -4
- package/src/git-ignore.ts +122 -0
- package/src/graph.ts +11 -3
- package/src/host.ts +17 -14
- package/src/html-entries.ts +6 -33
- package/src/import-bindings.ts +128 -0
- package/src/in-operands.ts +2 -1
- package/src/index.ts +1 -1
- package/src/indexed-access.ts +152 -30
- package/src/injection-container.ts +1 -1
- package/src/interface-satisfaction.ts +33 -13
- package/src/intra-function-parts.ts +449 -85
- package/src/inventory.ts +73 -27
- package/src/javascript-file.ts +37 -0
- package/src/json-document.ts +241 -76
- package/src/keyof-comparisons.ts +3 -7
- package/src/kinds.ts +5 -413
- package/src/load/classify.ts +397 -0
- package/src/load/diagnostics.ts +144 -0
- package/src/load/discover.ts +455 -0
- package/src/{emit-map.ts → load/emit-map.ts} +1 -1
- package/src/load/expected-module.ts +188 -0
- package/src/load/load.ts +73 -0
- package/src/load/module-lookup.ts +50 -0
- package/src/load/plan.ts +504 -0
- package/src/load/specifiers.ts +168 -0
- package/src/load/synthesize.ts +211 -0
- package/src/load/test-globals.ts +251 -0
- package/src/load/test-joins.ts +98 -0
- package/src/{workspace-manifests.ts → load/workspace-manifests.ts} +5 -5
- package/src/{workspace-programs.ts → load/workspace-programs.ts} +127 -80
- package/src/{workspace-resolution.ts → load/workspace-resolution.ts} +73 -64
- package/src/{workspace-run.ts → load/workspace-run.ts} +18 -16
- package/src/{workspace.ts → load/workspace.ts} +90 -134
- package/src/manifest.ts +81 -75
- package/src/matrix.ts +154 -18
- package/src/mdx-entries.ts +218 -0
- package/src/module-declarations.ts +11 -13
- package/src/outside-tests.ts +1 -1
- package/src/overrides.ts +51 -12
- package/src/partial.ts +3 -2
- package/src/paths.ts +27 -15
- package/src/position.ts +2 -1
- package/src/print.ts +12 -91
- package/src/product.ts +18 -0
- package/src/query.ts +11 -0
- package/src/ref.ts +13 -0
- package/src/references.ts +62 -32
- package/src/report-schema.ts +68 -0
- package/src/report.ts +105 -215
- package/src/reporters/annotations.ts +22 -11
- package/src/reporters/json.ts +1 -1
- package/src/reporters/reporter.ts +2 -4
- package/src/reporters/reporters.ts +1 -1
- package/src/reporters/sarif.ts +29 -16
- package/src/reporters/template.ts +4 -20
- package/src/reporters/text.ts +3 -3
- package/src/resolve.ts +283 -1111
- package/src/roots.ts +490 -137
- package/src/run.ts +75 -91
- package/src/schema.ts +391 -387
- package/src/scope.ts +46 -138
- package/src/serialization-contract.ts +818 -26
- package/src/session.ts +77 -54
- package/src/source-files.ts +67 -17
- package/src/suppress-file.ts +36 -34
- package/src/suppress-inline.ts +20 -3
- package/src/suppress.ts +52 -63
- package/src/sweep.ts +53 -18
- package/src/symbol-keys.ts +131 -7
- package/src/template-field.ts +15 -25
- package/src/test-support.ts +155 -18
- package/src/text/compare.ts +27 -0
- package/src/text/glob.ts +210 -0
- package/src/text/named-files.inputs.json +1522 -0
- package/src/text/named-files.ts +68 -0
- package/src/text/shell.ts +161 -0
- package/src/text/yaml.ts +423 -0
- package/src/type-errors.ts +35 -273
- package/src/type-parameter-reads.ts +227 -0
- package/src/unseen-loads.ts +134 -0
- package/src/unwrap.ts +34 -0
- package/src/usage.ts +10 -0
- package/src/verbs/analyze.ts +245 -161
- package/src/verbs/describe.ts +14 -15
- package/src/verbs/explain.ts +15 -13
- package/src/verbs/print-config.ts +2 -1
- package/src/verbs/print-projects.ts +6 -4
- package/src/verbs/print-retained.ts +4 -2
- package/src/verbs/print-roots.ts +4 -2
- package/src/verbs/verb.ts +2 -8
- package/src/verbs/version.ts +15 -3
- package/src/workflow-steps.ts +149 -34
- package/dist/src/discover.js +0 -347
- package/dist/src/glob.js +0 -65
- package/dist/src/pnpm-workspace.js +0 -120
- package/dist/src/setup-failure.js +0 -23
- package/dist/src/test-joins.js +0 -101
- package/dist/src/version.js +0 -7
- package/src/discover.ts +0 -510
- package/src/glob.ts +0 -67
- package/src/pnpm-workspace.ts +0 -135
- package/src/setup-failure.ts +0 -39
- package/src/test-joins.ts +0 -120
- package/src/version.ts +0 -7
|
@@ -10,6 +10,8 @@ const SCRIPT = "{js,jsx,ts,tsx}";
|
|
|
10
10
|
const MODULE = "{js,mjs,ts,mts}";
|
|
11
11
|
const ANY_MODULE = "{js,mjs,cjs,ts,mts,cts}";
|
|
12
12
|
const VITE_CONFIG = `vite.config.${ANY_MODULE}`;
|
|
13
|
+
/** The legacy configuration files of ESLint: JSON, YAML or a CommonJS module. */
|
|
14
|
+
const ESLINTRC = [".eslintrc", ".eslintrc.json", ".eslintrc.{yml,yaml}", ".eslintrc.{js,cjs}"];
|
|
13
15
|
const SVELTEKIT_ROUTE_FILES = "+{page,layout,server,page.server,layout.server,error}";
|
|
14
16
|
/** SvelteKit's entries other than its parameter matchers. */
|
|
15
17
|
const SVELTEKIT_ENTRIES = [
|
|
@@ -59,6 +61,50 @@ const ANGULAR_PACKAGE_KEYS = [
|
|
|
59
61
|
"styles",
|
|
60
62
|
"scripts",
|
|
61
63
|
].map((key) => ({ key, files: ["angular.json"] }));
|
|
64
|
+
/**
|
|
65
|
+
* The row of a code generator that writes its output below one directory its
|
|
66
|
+
* configuration's `property` sets, `fallback` where no configuration file sets it, so
|
|
67
|
+
* every file there is a generated file.
|
|
68
|
+
*/
|
|
69
|
+
function outputDirectoryRow(row) {
|
|
70
|
+
return {
|
|
71
|
+
name: row.name,
|
|
72
|
+
package: row.package,
|
|
73
|
+
range: row.range,
|
|
74
|
+
entries: [],
|
|
75
|
+
generated: ["<output>"],
|
|
76
|
+
moves: [
|
|
77
|
+
{
|
|
78
|
+
id: "output",
|
|
79
|
+
defaults: [row.fallback],
|
|
80
|
+
readings: [{ property: row.property, files: row.files }],
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The test runners and the assertion, mock and runner libraries whose import is test
|
|
87
|
+
* evidence beside each runner a row reads test files for. Each applies whether or not a
|
|
88
|
+
* manifest declares it, so none is a row.
|
|
89
|
+
*/
|
|
90
|
+
export const TEST_LIBRARIES = [
|
|
91
|
+
"@jest/globals",
|
|
92
|
+
"@playwright/test",
|
|
93
|
+
"ava",
|
|
94
|
+
"chai",
|
|
95
|
+
"expect",
|
|
96
|
+
"jasmine",
|
|
97
|
+
"jest",
|
|
98
|
+
"mocha",
|
|
99
|
+
"msw",
|
|
100
|
+
"nock",
|
|
101
|
+
"node:test",
|
|
102
|
+
"sinon",
|
|
103
|
+
"tap",
|
|
104
|
+
"uvu",
|
|
105
|
+
];
|
|
106
|
+
/** The scopes every package of which is a test library. */
|
|
107
|
+
export const TEST_LIBRARY_SCOPES = ["@testing-library/"];
|
|
62
108
|
/** Every row, ordered by name and then by range. */
|
|
63
109
|
export const CONVENTION_ROWS = [
|
|
64
110
|
{
|
|
@@ -79,6 +125,7 @@ export const CONVENTION_ROWS = [
|
|
|
79
125
|
},
|
|
80
126
|
{
|
|
81
127
|
name: "astro",
|
|
128
|
+
bundles: true,
|
|
82
129
|
package: "astro",
|
|
83
130
|
range: ">=5.0.0 <8.0.0",
|
|
84
131
|
entries: [
|
|
@@ -111,6 +158,26 @@ export const CONVENTION_ROWS = [
|
|
|
111
158
|
package: "@babel/runtime",
|
|
112
159
|
})),
|
|
113
160
|
},
|
|
161
|
+
{
|
|
162
|
+
name: "docusaurus",
|
|
163
|
+
package: "@docusaurus/core",
|
|
164
|
+
range: ">=2.0.0 <4.0.0",
|
|
165
|
+
entries: [`src/pages/**/*.${SCRIPT}`, `src/theme/**/*.${SCRIPT}`],
|
|
166
|
+
moves: [],
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: "eslint",
|
|
170
|
+
package: "eslint",
|
|
171
|
+
range: ">=4.0.0 <10.0.0",
|
|
172
|
+
entries: [],
|
|
173
|
+
moves: [],
|
|
174
|
+
packageKeys: [{ key: "parser", files: ESLINTRC }],
|
|
175
|
+
prefixedNames: [
|
|
176
|
+
{ property: "plugins", files: ESLINTRC, prefix: "eslint-plugin" },
|
|
177
|
+
{ property: "extends", files: ESLINTRC, prefix: "eslint-plugin", marker: "plugin:" },
|
|
178
|
+
{ property: "extends", files: ESLINTRC, prefix: "eslint-config" },
|
|
179
|
+
],
|
|
180
|
+
},
|
|
114
181
|
{
|
|
115
182
|
name: "eslint",
|
|
116
183
|
package: "eslint",
|
|
@@ -118,15 +185,23 @@ export const CONVENTION_ROWS = [
|
|
|
118
185
|
entries: [`**/eslint.config.${ANY_MODULE}`],
|
|
119
186
|
moves: [],
|
|
120
187
|
},
|
|
188
|
+
{
|
|
189
|
+
name: "expo",
|
|
190
|
+
package: "expo",
|
|
191
|
+
range: ">=44.0.0 <60.0.0",
|
|
192
|
+
entries: [`{index,App}.${SCRIPT}`],
|
|
193
|
+
moves: [],
|
|
194
|
+
},
|
|
121
195
|
{
|
|
122
196
|
name: "expo-router",
|
|
123
197
|
package: "expo-router",
|
|
124
|
-
range: ">=3.0.0 <
|
|
198
|
+
range: ">=3.0.0 <59.0.0",
|
|
125
199
|
entries: [`{,src/}app/**/*.${SCRIPT}`],
|
|
126
200
|
moves: [],
|
|
127
201
|
},
|
|
128
202
|
{
|
|
129
203
|
name: "next",
|
|
204
|
+
bundles: true,
|
|
130
205
|
package: "next",
|
|
131
206
|
range: ">=13.4.0 <17.0.0",
|
|
132
207
|
generated: [".next"],
|
|
@@ -144,6 +219,7 @@ export const CONVENTION_ROWS = [
|
|
|
144
219
|
},
|
|
145
220
|
{
|
|
146
221
|
name: "nuxt",
|
|
222
|
+
bundles: true,
|
|
147
223
|
package: "nuxt",
|
|
148
224
|
range: ">=3.0.0 <5.0.0",
|
|
149
225
|
generated: [".nuxt"],
|
|
@@ -202,6 +278,37 @@ export const CONVENTION_ROWS = [
|
|
|
202
278
|
},
|
|
203
279
|
],
|
|
204
280
|
},
|
|
281
|
+
{
|
|
282
|
+
name: "oclif",
|
|
283
|
+
package: "@oclif/core",
|
|
284
|
+
range: ">=1.0.0 <5.0.0",
|
|
285
|
+
entries: [`src/{commands,hooks}/**/*.${SCRIPT}`],
|
|
286
|
+
moves: [],
|
|
287
|
+
manifestEntries: [
|
|
288
|
+
{ key: "oclif.commands", directory: true },
|
|
289
|
+
{ key: "oclif.hooks", directory: false },
|
|
290
|
+
],
|
|
291
|
+
},
|
|
292
|
+
outputDirectoryRow({
|
|
293
|
+
name: "panda",
|
|
294
|
+
package: "@pandacss/dev",
|
|
295
|
+
range: ">=0.1.0 <2.0.0",
|
|
296
|
+
files: [`panda.config.${ANY_MODULE}`],
|
|
297
|
+
property: "outdir",
|
|
298
|
+
fallback: "styled-system",
|
|
299
|
+
}),
|
|
300
|
+
{
|
|
301
|
+
name: "parcel",
|
|
302
|
+
bundles: true,
|
|
303
|
+
package: "parcel",
|
|
304
|
+
range: ">=2.0.0 <3.0.0",
|
|
305
|
+
entries: [],
|
|
306
|
+
moves: [],
|
|
307
|
+
manifestEntries: [
|
|
308
|
+
{ key: "source", directory: false },
|
|
309
|
+
{ key: "targets.*.source", directory: false },
|
|
310
|
+
],
|
|
311
|
+
},
|
|
205
312
|
{
|
|
206
313
|
name: "prettier",
|
|
207
314
|
package: "prettier",
|
|
@@ -258,6 +365,13 @@ export const CONVENTION_ROWS = [
|
|
|
258
365
|
},
|
|
259
366
|
],
|
|
260
367
|
},
|
|
368
|
+
{
|
|
369
|
+
name: "react-scripts",
|
|
370
|
+
package: "react-scripts",
|
|
371
|
+
range: ">=1.0.0 <6.0.0",
|
|
372
|
+
entries: [`src/index.${SCRIPT}`, "src/setupProxy.js", `src/setupTests.${SCRIPT}`],
|
|
373
|
+
moves: [],
|
|
374
|
+
},
|
|
261
375
|
{
|
|
262
376
|
name: "remix",
|
|
263
377
|
package: "@remix-run/dev",
|
|
@@ -285,6 +399,7 @@ export const CONVENTION_ROWS = [
|
|
|
285
399
|
},
|
|
286
400
|
{
|
|
287
401
|
name: "rolldown",
|
|
402
|
+
bundles: true,
|
|
288
403
|
package: "rolldown",
|
|
289
404
|
range: ">=1.0.0 <2.0.0",
|
|
290
405
|
entries: [],
|
|
@@ -330,6 +445,7 @@ export const CONVENTION_ROWS = [
|
|
|
330
445
|
},
|
|
331
446
|
{
|
|
332
447
|
name: "storybook",
|
|
448
|
+
bundles: true,
|
|
333
449
|
package: "storybook",
|
|
334
450
|
range: ">=7.0.0 <11.0.0",
|
|
335
451
|
entries: [
|
|
@@ -363,6 +479,7 @@ export const CONVENTION_ROWS = [
|
|
|
363
479
|
},
|
|
364
480
|
{
|
|
365
481
|
name: "sveltekit",
|
|
482
|
+
bundles: true,
|
|
366
483
|
package: "@sveltejs/kit",
|
|
367
484
|
range: ">=2.0.0 <3.0.0",
|
|
368
485
|
entries: [...SVELTEKIT_ENTRIES, "<params>/*.{js,ts}"],
|
|
@@ -428,6 +545,7 @@ export const CONVENTION_ROWS = [
|
|
|
428
545
|
},
|
|
429
546
|
{
|
|
430
547
|
name: "sveltekit",
|
|
548
|
+
bundles: true,
|
|
431
549
|
package: "@sveltejs/kit",
|
|
432
550
|
range: ">=3.0.0 <4.0.0",
|
|
433
551
|
entries: [...SVELTEKIT_ENTRIES, "<params>.{js,ts}"],
|
|
@@ -493,8 +611,34 @@ export const CONVENTION_ROWS = [
|
|
|
493
611
|
},
|
|
494
612
|
],
|
|
495
613
|
},
|
|
614
|
+
{
|
|
615
|
+
name: "tanstack-router",
|
|
616
|
+
package: "@tanstack/router-plugin",
|
|
617
|
+
range: ">=1.0.0 <2.0.0",
|
|
618
|
+
entries: [`<routes>/**/*.${SCRIPT}`],
|
|
619
|
+
moves: [
|
|
620
|
+
{
|
|
621
|
+
id: "routes",
|
|
622
|
+
defaults: ["src/routes"],
|
|
623
|
+
readings: [
|
|
624
|
+
{ property: "routesDirectory", files: ["tsr.config.json"] },
|
|
625
|
+
{
|
|
626
|
+
property: "routesDirectory",
|
|
627
|
+
files: [VITE_CONFIG],
|
|
628
|
+
call: { module: "@tanstack/router-plugin/vite", export: "tanstackRouter" },
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
property: "routesDirectory",
|
|
632
|
+
files: [VITE_CONFIG],
|
|
633
|
+
call: { module: "@tanstack/router-plugin/vite", export: "TanStackRouterVite" },
|
|
634
|
+
},
|
|
635
|
+
],
|
|
636
|
+
},
|
|
637
|
+
],
|
|
638
|
+
},
|
|
496
639
|
{
|
|
497
640
|
name: "vite",
|
|
641
|
+
bundles: true,
|
|
498
642
|
package: "vite",
|
|
499
643
|
range: ">=8.0.0 <9.0.0",
|
|
500
644
|
entries: [],
|
|
@@ -510,6 +654,7 @@ export const CONVENTION_ROWS = [
|
|
|
510
654
|
},
|
|
511
655
|
{
|
|
512
656
|
name: "vitepress",
|
|
657
|
+
bundles: true,
|
|
513
658
|
package: "vitepress",
|
|
514
659
|
range: ">=1.0.0 <2.0.0-0 || >=2.0.0-alpha.0 <3.0.0",
|
|
515
660
|
entries: [
|
package/dist/src/conventions.js
CHANGED
|
@@ -5,34 +5,30 @@
|
|
|
5
5
|
* directory a configuration property moves read from the property's literal value.
|
|
6
6
|
* No configuration file is run.
|
|
7
7
|
*/
|
|
8
|
-
import { isArrayLiteralExpression,
|
|
8
|
+
import { isArrayLiteralExpression, isBinaryExpression, isCallExpression, isClassDeclaration, isComputedPropertyName, isExportAssignment, isExportDeclaration, isExpressionStatement, isFunctionDeclaration, isIdentifier, isImportDeclaration, isNamedExports, isNamespaceImport, isNoSubstitutionTemplateLiteral, isNumericLiteral, isObjectBindingPattern, isObjectLiteralExpression, isPropertyAccessExpression, isPropertyAssignment, isShorthandPropertyAssignment, isSpreadAssignment, isStringLiteral, isVariableStatement, SyntaxKind, } from "@typescript/native/ast";
|
|
9
9
|
import { lineOf } from "./component-files.js";
|
|
10
10
|
import { CONVENTION_ROWS, } from "./convention-rows.js";
|
|
11
11
|
import { documentStrings } from "./configuration-files.js";
|
|
12
|
-
import {
|
|
13
|
-
import { dirnamePath, joinPath, normalizePath, relativePath, resolvePath } from "./paths.js";
|
|
12
|
+
import { ancestors, dirnamePath, joinPath, normalizePath, relativePath, resolvePath, } from "./paths.js";
|
|
14
13
|
import { satisfies } from "./version-range.js";
|
|
14
|
+
import { bytewise } from "./text/compare.js";
|
|
15
|
+
import { isRecord } from "./json-document.js";
|
|
16
|
+
import { unwrapped } from "./unwrap.js";
|
|
17
|
+
import { filesIn } from "./fs/tree.js";
|
|
18
|
+
import { DEPENDENCY_SECTIONS, INSTALLED_PACKAGES, MANIFEST, readJSON } from "./fs/manifest.js";
|
|
19
|
+
import { globExpression } from "./text/glob.js";
|
|
20
|
+
import { yamlDocument } from "./text/yaml.js";
|
|
15
21
|
const JSON_EXTENSION = ".json";
|
|
22
|
+
/**
|
|
23
|
+
* A configuration file its tool reads as a YAML document, read as the JSON document it
|
|
24
|
+
* denotes. Its nodes' offsets are that JSON text's, so no move may read one: a failure's
|
|
25
|
+
* line would name the wrong line.
|
|
26
|
+
*/
|
|
27
|
+
const YAML_NAME = /\.ya?ml$/u;
|
|
16
28
|
/** A configuration file with no extension that its tool reads as a JSON document. */
|
|
17
29
|
const JSON_RC = /^\.[\w-]+rc$/u;
|
|
18
30
|
/** The sections an installed package is required by, so its absence fails the run. */
|
|
19
31
|
const REQUIRED_SECTIONS = ["dependencies", "devDependencies"];
|
|
20
|
-
const DEPENDENCY_SECTIONS = [
|
|
21
|
-
...REQUIRED_SECTIONS,
|
|
22
|
-
"peerDependencies",
|
|
23
|
-
"optionalDependencies",
|
|
24
|
-
];
|
|
25
|
-
function isRecord(value) {
|
|
26
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
27
|
-
}
|
|
28
|
-
function readJSON(host, path) {
|
|
29
|
-
try {
|
|
30
|
-
return JSON.parse(host.readFile(path));
|
|
31
|
-
}
|
|
32
|
-
catch {
|
|
33
|
-
return undefined;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
32
|
function declares(manifest, name, sections = DEPENDENCY_SECTIONS) {
|
|
37
33
|
if (!isRecord(manifest)) {
|
|
38
34
|
return false;
|
|
@@ -48,32 +44,15 @@ function declares(manifest, name, sections = DEPENDENCY_SECTIONS) {
|
|
|
48
44
|
* none, or `undefined` where no `node_modules` holds it.
|
|
49
45
|
*/
|
|
50
46
|
function installedVersion(host, dir, name) {
|
|
51
|
-
for (
|
|
52
|
-
const path = joinPath(at,
|
|
47
|
+
for (const at of ancestors(dir)) {
|
|
48
|
+
const path = joinPath(at, INSTALLED_PACKAGES, name, MANIFEST);
|
|
53
49
|
if (host.kindOf(path) === "file") {
|
|
54
50
|
const manifest = readJSON(host, path);
|
|
55
51
|
const version = isRecord(manifest) ? manifest["version"] : undefined;
|
|
56
52
|
return typeof version === "string" ? version : "";
|
|
57
53
|
}
|
|
58
|
-
if (dirnamePath(at) === at) {
|
|
59
|
-
return undefined;
|
|
60
|
-
}
|
|
61
54
|
}
|
|
62
|
-
|
|
63
|
-
/** Whether one node wraps an expression without changing its value. */
|
|
64
|
-
function isWrapper(node) {
|
|
65
|
-
return (isParenthesizedExpression(node) ||
|
|
66
|
-
isAsExpression(node) ||
|
|
67
|
-
isSatisfiesExpression(node) ||
|
|
68
|
-
isNonNullExpression(node));
|
|
69
|
-
}
|
|
70
|
-
/** The expression a wrapper that changes no value holds. */
|
|
71
|
-
function unwrapped(node) {
|
|
72
|
-
let at = node;
|
|
73
|
-
while (isWrapper(at)) {
|
|
74
|
-
at = at.expression;
|
|
75
|
-
}
|
|
76
|
-
return at;
|
|
55
|
+
return undefined;
|
|
77
56
|
}
|
|
78
57
|
/** The key one property is written with, where it is written as a name or as literal text. */
|
|
79
58
|
function keyOf(property) {
|
|
@@ -471,6 +450,40 @@ function manifestKeyUses(manifest, keys) {
|
|
|
471
450
|
const strings = keys.flatMap((key) => documentStrings(manifest[key]));
|
|
472
451
|
return declared.filter((name) => strings.some((text) => text === name || text.startsWith(`${name}/`)));
|
|
473
452
|
}
|
|
453
|
+
/** The extensions an entry a manifest entry key names without one may carry. */
|
|
454
|
+
const ENTRY_EXTENSIONS = "{js,jsx,mjs,cjs,ts,tsx,mts,cts}";
|
|
455
|
+
/** The characters that make a manifest string a pattern rather than a directory's name. */
|
|
456
|
+
const PATTERN = /[*?{}[\]]/u;
|
|
457
|
+
/**
|
|
458
|
+
* The entry globs one applied row's manifest entry keys write, below the manifest's
|
|
459
|
+
* directory: a directory's every module, or a file with or without an extension. A string
|
|
460
|
+
* that leaves the directory names nothing.
|
|
461
|
+
*/
|
|
462
|
+
function manifestEntryGlobs(manifest, keys) {
|
|
463
|
+
const at = (value, path) => {
|
|
464
|
+
const [key, ...rest] = path;
|
|
465
|
+
if (key === undefined) {
|
|
466
|
+
return [value];
|
|
467
|
+
}
|
|
468
|
+
if (!isRecord(value)) {
|
|
469
|
+
return [];
|
|
470
|
+
}
|
|
471
|
+
const next = key === "*" ? Object.values(value) : Object.hasOwn(value, key) ? [value[key]] : [];
|
|
472
|
+
return next.flatMap((one) => at(one, rest));
|
|
473
|
+
};
|
|
474
|
+
return keys.flatMap(({ key, directory }) => at(manifest, key.split(".")).flatMap((value) => documentStrings(value).flatMap((text) => {
|
|
475
|
+
const path = normalizePath(text)
|
|
476
|
+
.replace(/^(?:\.\/)+/u, "")
|
|
477
|
+
.replace(/\/+$/u, "");
|
|
478
|
+
if (path === "" || path === ".." || path.startsWith("../") || path.startsWith("/")) {
|
|
479
|
+
return [];
|
|
480
|
+
}
|
|
481
|
+
if (!directory) {
|
|
482
|
+
return [path, `${path}.${ENTRY_EXTENSIONS}`];
|
|
483
|
+
}
|
|
484
|
+
return PATTERN.test(path) ? [] : [`${path}/**/*.${ENTRY_EXTENSIONS}`];
|
|
485
|
+
})));
|
|
486
|
+
}
|
|
474
487
|
/**
|
|
475
488
|
* Every value one file writes at one property's path inside the object it is read from:
|
|
476
489
|
* the options argument of every call `call` names, or the file's default export. A string
|
|
@@ -528,17 +541,7 @@ function expand(template, resolved) {
|
|
|
528
541
|
/** The configuration files in one directory that one glob names, by name. */
|
|
529
542
|
function configurationFiles(host, dir, glob) {
|
|
530
543
|
const expression = globExpression(glob);
|
|
531
|
-
|
|
532
|
-
try {
|
|
533
|
-
entries = host.readDirectory(dir);
|
|
534
|
-
}
|
|
535
|
-
catch {
|
|
536
|
-
return [];
|
|
537
|
-
}
|
|
538
|
-
return entries
|
|
539
|
-
.filter((entry) => !entry.directory && expression.test(entry.name))
|
|
540
|
-
.map((entry) => entry.name)
|
|
541
|
-
.sort();
|
|
544
|
+
return filesIn(host, dir, (name) => expression.test(name));
|
|
542
545
|
}
|
|
543
546
|
function resolveMove(host, parse, dir, row, move, resolved) {
|
|
544
547
|
const set = [];
|
|
@@ -580,6 +583,14 @@ function readingFiles(host, parse, dir, files) {
|
|
|
580
583
|
catch {
|
|
581
584
|
continue;
|
|
582
585
|
}
|
|
586
|
+
if (YAML_NAME.test(name)) {
|
|
587
|
+
const value = yamlDocument(text);
|
|
588
|
+
if (value !== undefined) {
|
|
589
|
+
const json = JSON.stringify(value);
|
|
590
|
+
found.push({ name, text: json, file: parse(`${path}${JSON_EXTENSION}`, json) });
|
|
591
|
+
}
|
|
592
|
+
continue;
|
|
593
|
+
}
|
|
583
594
|
found.push({
|
|
584
595
|
name,
|
|
585
596
|
text,
|
|
@@ -618,7 +629,58 @@ function shortNameUses(host, parse, dir, manifest, readings) {
|
|
|
618
629
|
}
|
|
619
630
|
}
|
|
620
631
|
}
|
|
621
|
-
return [...used].filter((name) => declared.has(name)).sort(
|
|
632
|
+
return [...used].filter((name) => declared.has(name)).sort(bytewise);
|
|
633
|
+
}
|
|
634
|
+
/**
|
|
635
|
+
* The package one value of a prefixed-name reading names, or none: ESLint's own naming,
|
|
636
|
+
* https://github.com/eslint/eslintrc/blob/main/lib/shared/naming.js
|
|
637
|
+
*/
|
|
638
|
+
function prefixedPackage(value, reading) {
|
|
639
|
+
const { prefix, marker } = reading;
|
|
640
|
+
let name;
|
|
641
|
+
if (marker === undefined) {
|
|
642
|
+
if (value.includes(":") || value.startsWith(".") || value.startsWith("/")) {
|
|
643
|
+
return undefined;
|
|
644
|
+
}
|
|
645
|
+
const parts = value.split("/");
|
|
646
|
+
name = (value.startsWith("@") ? parts.slice(0, 2) : parts.slice(0, 1)).join("/");
|
|
647
|
+
}
|
|
648
|
+
else {
|
|
649
|
+
if (!value.startsWith(marker) || !value.includes("/", marker.length)) {
|
|
650
|
+
return undefined;
|
|
651
|
+
}
|
|
652
|
+
name = value.slice(marker.length, value.lastIndexOf("/"));
|
|
653
|
+
}
|
|
654
|
+
if (name === "") {
|
|
655
|
+
return undefined;
|
|
656
|
+
}
|
|
657
|
+
if (!name.startsWith("@")) {
|
|
658
|
+
return name.startsWith(`${prefix}-`) ? name : `${prefix}-${name}`;
|
|
659
|
+
}
|
|
660
|
+
const [scope, rest] = name.split("/");
|
|
661
|
+
if (rest === undefined || rest === "" || rest === prefix) {
|
|
662
|
+
return `${scope ?? name}/${prefix}`;
|
|
663
|
+
}
|
|
664
|
+
return rest.startsWith(`${prefix}-`) ? name : `${scope ?? name}/${prefix}-${rest}`;
|
|
665
|
+
}
|
|
666
|
+
/** The declared dependencies an applied row's prefixed names use. */
|
|
667
|
+
function prefixedNameUses(host, parse, dir, manifest, readings) {
|
|
668
|
+
const declared = new Set(DEPENDENCY_SECTIONS.flatMap((section) => {
|
|
669
|
+
const held = isRecord(manifest) ? manifest[section] : undefined;
|
|
670
|
+
return isRecord(held) ? Object.keys(held) : [];
|
|
671
|
+
}));
|
|
672
|
+
const used = new Set();
|
|
673
|
+
for (const reading of readings) {
|
|
674
|
+
for (const { file } of readingFiles(host, parse, dir, reading.files)) {
|
|
675
|
+
for (const value of readProperty(file, reading.property, reading.call, true).values) {
|
|
676
|
+
const named = prefixedPackage(value, reading);
|
|
677
|
+
if (named !== undefined && declared.has(named)) {
|
|
678
|
+
used.add(named);
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
return [...used].sort(bytewise);
|
|
622
684
|
}
|
|
623
685
|
/** The declared dependencies an applied row's helper settings use. */
|
|
624
686
|
function helperUses(host, parse, dir, manifest, readings) {
|
|
@@ -675,13 +737,6 @@ function packageKeyUses(host, parse, dir, manifest, keys) {
|
|
|
675
737
|
text.startsWith(`${name}/`) ||
|
|
676
738
|
(text.startsWith(`${name}:`) && text.length > name.length + 1)));
|
|
677
739
|
}
|
|
678
|
-
/** Two strings ordered bytewise. */
|
|
679
|
-
function compare(a, b) {
|
|
680
|
-
if (a === b) {
|
|
681
|
-
return 0;
|
|
682
|
-
}
|
|
683
|
-
return a < b ? -1 : 1;
|
|
684
|
-
}
|
|
685
740
|
/**
|
|
686
741
|
* What the rows decide over the manifests the analysis reads. A row `disabled` names
|
|
687
742
|
* is skipped before anything is read for it.
|
|
@@ -695,7 +750,7 @@ export function readConventions(host, parse, manifests, disabled, rows = CONVENT
|
|
|
695
750
|
const selected = new Map();
|
|
696
751
|
const testFiles = new Set();
|
|
697
752
|
for (const manifest of manifests) {
|
|
698
|
-
const declared = readJSON(host, joinPath(manifest.dir,
|
|
753
|
+
const declared = readJSON(host, joinPath(manifest.dir, MANIFEST));
|
|
699
754
|
const versions = new Map();
|
|
700
755
|
const missing = new Set();
|
|
701
756
|
for (const row of rows) {
|
|
@@ -716,7 +771,7 @@ export function readConventions(host, parse, manifests, disabled, rows = CONVENT
|
|
|
716
771
|
failures.push({
|
|
717
772
|
dir: manifest.dir,
|
|
718
773
|
failure: {
|
|
719
|
-
|
|
774
|
+
failureClass: "missing-module",
|
|
720
775
|
detail: `${manifest.path} declares ${row.package}, which no node_modules at or ` +
|
|
721
776
|
`above its directory holds: run the package manager's install`,
|
|
722
777
|
},
|
|
@@ -741,7 +796,7 @@ export function readConventions(host, parse, manifests, disabled, rows = CONVENT
|
|
|
741
796
|
failures.push({
|
|
742
797
|
dir: manifest.dir,
|
|
743
798
|
failure: {
|
|
744
|
-
|
|
799
|
+
failureClass: "convention-not-literal",
|
|
745
800
|
detail: where === "." ? failed : `${where}/${failed}`,
|
|
746
801
|
},
|
|
747
802
|
});
|
|
@@ -756,6 +811,10 @@ export function readConventions(host, parse, manifests, disabled, rows = CONVENT
|
|
|
756
811
|
for (const name of shortNameUses(host, parse, manifest.dir, declared, row.shortNames ?? [])) {
|
|
757
812
|
uses.add(name);
|
|
758
813
|
}
|
|
814
|
+
const prefixed = row.prefixedNames ?? [];
|
|
815
|
+
for (const name of prefixedNameUses(host, parse, manifest.dir, declared, prefixed)) {
|
|
816
|
+
uses.add(name);
|
|
817
|
+
}
|
|
759
818
|
const keys = row.packageKeys ?? [];
|
|
760
819
|
for (const name of packageKeyUses(host, parse, manifest.dir, declared, keys)) {
|
|
761
820
|
uses.add(name);
|
|
@@ -774,7 +833,11 @@ export function readConventions(host, parse, manifests, disabled, rows = CONVENT
|
|
|
774
833
|
for (const below of new Set((row.generated ?? []).flatMap((one) => expand(one, resolved)))) {
|
|
775
834
|
generated.push({ dir: manifest.dir, row: row.name, below });
|
|
776
835
|
}
|
|
777
|
-
|
|
836
|
+
const written = [
|
|
837
|
+
...row.entries.flatMap((entry) => expand(entry, resolved)),
|
|
838
|
+
...manifestEntryGlobs(declared, row.manifestEntries ?? []),
|
|
839
|
+
];
|
|
840
|
+
for (const glob of new Set(written)) {
|
|
778
841
|
globs.push({
|
|
779
842
|
dir: manifest.dir,
|
|
780
843
|
row: row.name,
|
|
@@ -785,15 +848,15 @@ export function readConventions(host, parse, manifests, disabled, rows = CONVENT
|
|
|
785
848
|
}
|
|
786
849
|
}
|
|
787
850
|
const unique = [...new Map(applied.map((one) => [JSON.stringify(one), one])).values()];
|
|
788
|
-
unique.sort((a, b) =>
|
|
789
|
-
|
|
790
|
-
|
|
851
|
+
unique.sort((a, b) => bytewise(a.name, b.name) ||
|
|
852
|
+
bytewise(a.manifest, b.manifest) ||
|
|
853
|
+
bytewise(JSON.stringify(a), JSON.stringify(b)));
|
|
791
854
|
return {
|
|
792
855
|
applied: unique,
|
|
793
856
|
globs,
|
|
794
857
|
generated,
|
|
795
858
|
failures,
|
|
796
|
-
uses: [...uses].sort(
|
|
859
|
+
uses: [...uses].sort(bytewise),
|
|
797
860
|
selected,
|
|
798
861
|
testFiles,
|
|
799
862
|
};
|
|
@@ -819,10 +882,13 @@ export function conventionEntries(conventions, files) {
|
|
|
819
882
|
const found = new Map();
|
|
820
883
|
for (const glob of conventions.globs) {
|
|
821
884
|
for (const file of files.byName.values()) {
|
|
822
|
-
const
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
885
|
+
const matched = [file.fileName, ...files.writtenAs(file)].some((name) => {
|
|
886
|
+
const path = relativePath(glob.dir, name);
|
|
887
|
+
return (path !== undefined &&
|
|
888
|
+
glob.expression.test(path) &&
|
|
889
|
+
!glob.excludes.some((one) => one.test(path)));
|
|
890
|
+
});
|
|
891
|
+
if (matched) {
|
|
826
892
|
found.set(`${file.fileName}\u0000${glob.row}`, { file, row: glob.row });
|
|
827
893
|
}
|
|
828
894
|
}
|
package/dist/src/decorator.js
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The decorator class: a member a decorator expression is attached to, and every
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* the
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* The use the decorator itself makes of what it decorates is the reference pass's,
|
|
9
|
-
* which records it as a `decorator` reference; this class records only that the
|
|
10
|
-
* declaration is held back, and the member set of a decorated class is every member
|
|
11
|
-
* the inventory holds for the class, static members included.
|
|
2
|
+
* The decorator class: a member a decorator expression is attached to, and every member
|
|
3
|
+
* of a class one is attached to but the member a parameter property declares, is held
|
|
4
|
+
* back, because the decorator may reach the member by its name. The rule is read from
|
|
5
|
+
* the tree alone. The decorator's own use of what it decorates is the reference pass's
|
|
6
|
+
* `decorator` reference; this class records only that the declaration is held back,
|
|
7
|
+
* static members of a decorated class included.
|
|
12
8
|
*/
|
|
13
9
|
import { decoratorsOf, spelledDecorator } from "./calls.js";
|
|
14
10
|
import { isParameterProperty, nodeKey, } from "./inventory.js";
|
|
@@ -34,25 +30,32 @@ export function decorator(input) {
|
|
|
34
30
|
}
|
|
35
31
|
}
|
|
36
32
|
}
|
|
37
|
-
const
|
|
33
|
+
const decorated = [];
|
|
34
|
+
// A decorated class's container passes each constructor argument, which keeps the
|
|
35
|
+
// parameter, not the member a parameter property stores it in.
|
|
36
|
+
const parameterMembers = new Set();
|
|
38
37
|
for (const file of project.ownSourceFiles()) {
|
|
39
38
|
const visit = (node) => {
|
|
40
39
|
const id = held.declarations.get(nodeKey(file, node));
|
|
41
40
|
const symbol = id === undefined ? undefined : byId.get(id);
|
|
41
|
+
if (id !== undefined && isParameterProperty(node)) {
|
|
42
|
+
parameterMembers.add(id);
|
|
43
|
+
}
|
|
42
44
|
// A parameter property's decorator is attached to its parameter, and to no member.
|
|
43
45
|
if (symbol !== undefined && DECORATED.has(symbol.kind) && !isParameterProperty(node)) {
|
|
44
46
|
for (const attached of decoratorsOf(node)) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
47
|
+
decorated.push({
|
|
48
|
+
symbol,
|
|
49
|
+
detail: `decorated by ${spelledDecorator(attached)}`,
|
|
50
|
+
site: renderPosition(file, targetRoot, attached.getStart()),
|
|
51
|
+
});
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
54
|
node.forEachChild(visit);
|
|
54
55
|
};
|
|
55
56
|
file.forEachChild(visit);
|
|
56
57
|
}
|
|
57
|
-
return
|
|
58
|
+
return decorated.flatMap(({ symbol, detail, site }) => (symbol.kind === "class"
|
|
59
|
+
? (membersOf.get(symbol.id) ?? []).filter((member) => !parameterMembers.has(member.id))
|
|
60
|
+
: [symbol]).map((member) => ({ id: member.id, detail, site })));
|
|
58
61
|
}
|