@cplieger/deadset-ts 4.0.1 → 5.1.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/README.md +4 -4
- package/dist/bin/component-mapper.js +5 -0
- package/dist/bin/mapper-connection.js +101 -0
- package/dist/bin/node-host.js +24 -2
- package/dist/src/analysis.js +301 -41
- package/dist/src/component-files.js +612 -0
- package/dist/src/component-layer.js +132 -0
- package/dist/src/config.js +9 -2
- package/dist/src/configuration-files.js +290 -0
- package/dist/src/conformance-record.js +3 -9
- package/dist/src/contextual-uses.js +240 -0
- package/dist/src/convention-rows.js +389 -0
- package/dist/src/conventions.js +565 -0
- package/dist/src/dependencies.js +36 -3
- package/dist/src/destructuring.js +6 -6
- package/dist/src/discover.js +10 -3
- package/dist/src/emit-map.js +72 -0
- package/dist/src/entry-point-gaps.js +81 -35
- package/dist/src/entry-points.js +50 -32
- package/dist/src/exempt-classes.js +6 -1
- package/dist/src/exempt.js +32 -20
- package/dist/src/findings/completion.js +46 -32
- package/dist/src/findings/emitters.js +22 -1
- package/dist/src/findings/interfaces.js +6 -2
- package/dist/src/findings/reads-and-writes.js +53 -9
- package/dist/src/findings/unused-declarations.js +47 -3
- package/dist/src/generated-file.js +24 -0
- package/dist/src/graph.js +13 -5
- package/dist/src/interface-satisfaction.js +2 -68
- package/dist/src/inventory.js +8 -3
- package/dist/src/kinds.js +6 -5
- package/dist/src/manifest.js +37 -11
- package/dist/src/matrix.js +21 -13
- package/dist/src/partial.js +3 -1
- package/dist/src/pnpm-workspace.js +120 -0
- package/dist/src/position.js +17 -2
- package/dist/src/print.js +2 -0
- package/dist/src/query.js +15 -0
- package/dist/src/references.js +404 -36
- package/dist/src/report.js +26 -6
- package/dist/src/reporters/annotations.js +10 -3
- package/dist/src/reporters/template.js +3 -0
- package/dist/src/resolve.js +37 -11
- package/dist/src/roots.js +37 -8
- package/dist/src/run.js +13 -3
- package/dist/src/schema.js +2 -0
- package/dist/src/session.js +141 -34
- package/dist/src/setup-failure.js +23 -0
- package/dist/src/source-files.js +4 -61
- package/dist/src/stores.js +3 -0
- package/dist/src/sweep.js +4 -2
- package/dist/src/template-field.js +38 -6
- package/dist/src/test-support.js +59 -0
- package/dist/src/type-errors.js +252 -0
- package/dist/src/type-query-alias.js +92 -0
- package/dist/src/value-flow.js +74 -0
- package/dist/src/verbs/analyze.js +24 -4
- package/dist/src/verbs/explain.js +4 -1
- package/dist/src/verbs/print-projects.js +17 -56
- package/dist/src/verbs/print-retained.js +7 -2
- package/dist/src/verbs/print-roots.js +7 -2
- package/dist/src/version-range.js +255 -0
- package/dist/src/version.js +1 -1
- package/dist/src/workspace-manifests.js +68 -0
- package/dist/src/workspace-programs.js +342 -0
- package/dist/src/workspace-resolution.js +307 -0
- package/dist/src/workspace-run.js +75 -0
- package/dist/src/workspace.js +358 -0
- package/jsr.json +1 -1
- package/package.json +3 -2
- package/src/analysis.ts +475 -72
- package/src/component-files.ts +718 -0
- package/src/component-layer.ts +160 -0
- package/src/config.ts +11 -2
- package/src/configuration-files.ts +370 -0
- package/src/conformance-record.ts +3 -10
- package/src/contextual-uses.ts +354 -0
- package/src/convention-rows.ts +448 -0
- package/src/conventions.ts +788 -0
- package/src/dependencies.ts +49 -2
- package/src/destructuring.ts +16 -6
- package/src/discover.ts +10 -6
- package/src/emit-map.ts +93 -0
- package/src/entry-point-gaps.ts +92 -38
- package/src/entry-points.ts +79 -36
- package/src/exempt-classes.ts +6 -1
- package/src/exempt.ts +69 -20
- package/src/file-facts.ts +2 -0
- package/src/findings/completion.ts +55 -36
- package/src/findings/emitters.ts +32 -1
- package/src/findings/interfaces.ts +9 -2
- package/src/findings/reads-and-writes.ts +70 -9
- package/src/findings/unused-declarations.ts +60 -3
- package/src/generated-file.ts +27 -0
- package/src/graph.ts +15 -4
- package/src/host.ts +23 -0
- package/src/index.ts +1 -1
- package/src/interface-satisfaction.ts +1 -92
- package/src/inventory.ts +17 -3
- package/src/kinds.ts +7 -5
- package/src/manifest.ts +47 -14
- package/src/matrix.ts +43 -15
- package/src/partial.ts +6 -1
- package/src/pnpm-workspace.ts +135 -0
- package/src/position.ts +23 -2
- package/src/print.ts +2 -0
- package/src/query.ts +26 -0
- package/src/references.ts +472 -40
- package/src/report.ts +56 -6
- package/src/reporters/annotations.ts +12 -3
- package/src/reporters/template.ts +3 -0
- package/src/resolve.ts +65 -11
- package/src/roots.ts +70 -9
- package/src/run.ts +15 -5
- package/src/schema.ts +2 -0
- package/src/session.ts +218 -37
- package/src/setup-failure.ts +39 -0
- package/src/source-files.ts +4 -66
- package/src/stores.ts +9 -0
- package/src/sweep.ts +9 -2
- package/src/template-field.ts +42 -7
- package/src/test-support.ts +77 -0
- package/src/type-errors.ts +340 -0
- package/src/type-query-alias.ts +133 -0
- package/src/value-flow.ts +104 -0
- package/src/verbs/analyze.ts +38 -4
- package/src/verbs/explain.ts +4 -1
- package/src/verbs/print-projects.ts +17 -69
- package/src/verbs/print-retained.ts +7 -2
- package/src/verbs/print-roots.ts +7 -2
- package/src/verbs/verb.ts +6 -3
- package/src/version-range.ts +309 -0
- package/src/version.ts +1 -1
- package/src/workspace-manifests.ts +100 -0
- package/src/workspace-programs.ts +486 -0
- package/src/workspace-resolution.ts +393 -0
- package/src/workspace-run.ts +148 -0
- package/src/workspace.ts +463 -0
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The uses contextual types make of the target's members, which no name node resolves to.
|
|
3
|
+
* An object-literal property writes the member of its name on each constituent of the
|
|
4
|
+
* literal's contextual type that declares one. A value reaching a position typed by another
|
|
5
|
+
* object type reads each of its members that type declares, through array elements and
|
|
6
|
+
* function parameters and results too; a class instance there is the
|
|
7
|
+
* interface-satisfaction class's evidence instead.
|
|
8
|
+
*/
|
|
9
|
+
import { isComputedPropertyName, isGetAccessorDeclaration, isIdentifier, isMethodDeclaration, isNoSubstitutionTemplateLiteral, isNumericLiteral, isObjectLiteralExpression, isPropertyAssignment, isSetAccessorDeclaration, isShorthandPropertyAssignment, isStringLiteral, } from "@typescript/native/unstable/ast";
|
|
10
|
+
import { SignatureKind } from "@typescript/native/unstable/sync";
|
|
11
|
+
import { isAnswered } from "./query.js";
|
|
12
|
+
/** The member kinds a contextual type writes and reads: data members and the members of object types. */
|
|
13
|
+
const MEMBER_KINDS = new Set(["type-member", "class-member"]);
|
|
14
|
+
/** The name one literal property is written under, where the name is literal text. */
|
|
15
|
+
function propertyName(property) {
|
|
16
|
+
if (!isPropertyAssignment(property) &&
|
|
17
|
+
!isShorthandPropertyAssignment(property) &&
|
|
18
|
+
!isMethodDeclaration(property) &&
|
|
19
|
+
!isGetAccessorDeclaration(property) &&
|
|
20
|
+
!isSetAccessorDeclaration(property)) {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
const name = property.name;
|
|
24
|
+
if (isIdentifier(name) || isStringLiteral(name) || isNumericLiteral(name)) {
|
|
25
|
+
return { node: name, text: name.text };
|
|
26
|
+
}
|
|
27
|
+
if (isComputedPropertyName(name)) {
|
|
28
|
+
const key = name.expression;
|
|
29
|
+
if (isStringLiteral(key) || isNumericLiteral(key) || isNoSubstitutionTemplateLiteral(key)) {
|
|
30
|
+
return { node: name, text: key.text };
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
/** How many element and signature steps the structural walk takes below a value's own type. */
|
|
36
|
+
const MAX_DEPTH = 3;
|
|
37
|
+
/**
|
|
38
|
+
* The contextual uses of one project's literals and values, asked in batches: one
|
|
39
|
+
* contextual type per literal and per value whose type carries a member of the target,
|
|
40
|
+
* one type per value, and each distinct type's properties once.
|
|
41
|
+
*/
|
|
42
|
+
export function contextualUses(project, held, chains, literals, flows, cap, properties) {
|
|
43
|
+
const queries = project.queries;
|
|
44
|
+
const kinds = new Map(held.symbols.map((symbol) => [symbol.id, symbol.kind]));
|
|
45
|
+
let batches = 0;
|
|
46
|
+
let lookups = 0;
|
|
47
|
+
const batchesOf = (count) => Math.ceil(count / cap);
|
|
48
|
+
const parts = new Map();
|
|
49
|
+
/** The object types one type is: itself, or its constituents at any depth. */
|
|
50
|
+
const partsOf = (type) => {
|
|
51
|
+
const known = parts.get(type.id);
|
|
52
|
+
if (known !== undefined) {
|
|
53
|
+
return known;
|
|
54
|
+
}
|
|
55
|
+
let found = [];
|
|
56
|
+
if (type.isUnionType() || type.isIntersectionType()) {
|
|
57
|
+
lookups += 1;
|
|
58
|
+
const constituents = queries.constituents(type);
|
|
59
|
+
found = isAnswered(constituents) ? constituents.flatMap(partsOf) : [];
|
|
60
|
+
}
|
|
61
|
+
else if (type.isObjectType()) {
|
|
62
|
+
found = [type];
|
|
63
|
+
}
|
|
64
|
+
parts.set(type.id, found);
|
|
65
|
+
return found;
|
|
66
|
+
};
|
|
67
|
+
const tables = new Map();
|
|
68
|
+
/** The members one object type has, by name. */
|
|
69
|
+
const membersOf = (type) => {
|
|
70
|
+
const known = tables.get(type.id);
|
|
71
|
+
if (known !== undefined) {
|
|
72
|
+
return known;
|
|
73
|
+
}
|
|
74
|
+
const table = new Map();
|
|
75
|
+
const read = properties.of(type);
|
|
76
|
+
lookups += read.asked ? 1 : 0;
|
|
77
|
+
for (const property of isAnswered(read.properties) ? read.properties : []) {
|
|
78
|
+
table.set(property.name, {
|
|
79
|
+
ids: chains
|
|
80
|
+
.declarationsOf(property)
|
|
81
|
+
.filter((id) => MEMBER_KINDS.has(kinds.get(id) ?? "file")),
|
|
82
|
+
handles: new Set(property.declarations.map((handle) => `${handle.path}#${String(handle.index)}`)),
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
tables.set(type.id, table);
|
|
86
|
+
return table;
|
|
87
|
+
};
|
|
88
|
+
const writes = [];
|
|
89
|
+
batches += batchesOf(literals.length);
|
|
90
|
+
const contexts = queries.contextualTypes(literals.map((one) => one.literal), cap);
|
|
91
|
+
literals.forEach(({ literal, from }, index) => {
|
|
92
|
+
const context = contexts[index];
|
|
93
|
+
if (context === undefined || !isAnswered(context)) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const tablesOf = partsOf(context).map(membersOf);
|
|
97
|
+
for (const property of literal.properties) {
|
|
98
|
+
const name = propertyName(property);
|
|
99
|
+
if (name === undefined) {
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
const ids = [...new Set(tablesOf.flatMap((table) => table.get(name.text)?.ids ?? []))];
|
|
103
|
+
if (ids.length > 0) {
|
|
104
|
+
writes.push({ at: name.node, from, ids });
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
const carried = flows.filter((flow) => !isObjectLiteralExpression(flow.value));
|
|
109
|
+
batches += batchesOf(carried.length);
|
|
110
|
+
const types = queries.typesAt(carried.map((flow) => flow.value), cap);
|
|
111
|
+
/** The members a position may read structurally: those of object types, not of classes. */
|
|
112
|
+
const readable = (member) => member.ids.filter((id) => kinds.get(id) === "type-member");
|
|
113
|
+
const carries = (part) => [...membersOf(part).values()].some((member) => readable(member).length > 0);
|
|
114
|
+
const elements = new Map();
|
|
115
|
+
/** The element type of an array type, read once per type. */
|
|
116
|
+
const elementOf = (type) => {
|
|
117
|
+
if (elements.has(type.id)) {
|
|
118
|
+
return elements.get(type.id);
|
|
119
|
+
}
|
|
120
|
+
lookups += 1;
|
|
121
|
+
const isArray = queries.isArray(type);
|
|
122
|
+
let element;
|
|
123
|
+
if (isAnswered(isArray) && isArray) {
|
|
124
|
+
lookups += 1;
|
|
125
|
+
const held = queries.typeArguments(type);
|
|
126
|
+
element = isAnswered(held) ? held[0] : undefined;
|
|
127
|
+
}
|
|
128
|
+
elements.set(type.id, element);
|
|
129
|
+
return element;
|
|
130
|
+
};
|
|
131
|
+
const calls = new Map();
|
|
132
|
+
/** The parameter and return types of a type's one call signature, read once per type. */
|
|
133
|
+
const callOf = (type) => {
|
|
134
|
+
if (calls.has(type.id)) {
|
|
135
|
+
return calls.get(type.id);
|
|
136
|
+
}
|
|
137
|
+
lookups += 1;
|
|
138
|
+
const signatures = queries.signaturesOf(type, SignatureKind.Call);
|
|
139
|
+
let called;
|
|
140
|
+
const [signature, ...more] = isAnswered(signatures) ? signatures : [];
|
|
141
|
+
if (signature !== undefined && more.length === 0) {
|
|
142
|
+
const parameters = signature.parameters.map((_parameter, index) => queries.parameterType(signature, index));
|
|
143
|
+
const result = queries.returnTypeOf(signature);
|
|
144
|
+
lookups += parameters.length + 1;
|
|
145
|
+
called = {
|
|
146
|
+
parameters: parameters.map((one) => (isAnswered(one) ? one : undefined)),
|
|
147
|
+
result: isAnswered(result) ? result : undefined,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
calls.set(type.id, called);
|
|
151
|
+
return called;
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* Each object type a value of `source` is checked as against the object types of
|
|
155
|
+
* `target`: the value's own, and through array elements and through a function's
|
|
156
|
+
* parameters, checked the other way, and its result. A source that is one of the
|
|
157
|
+
* target's own object types matches it as it stands.
|
|
158
|
+
*/
|
|
159
|
+
const compared = (source, target, depth, into, seen) => {
|
|
160
|
+
const key = `${String(source?.id)}>${String(target?.id)}`;
|
|
161
|
+
if (source === undefined || target === undefined || source.id === target.id) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
if (depth > MAX_DEPTH || seen.has(key)) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
seen.add(key);
|
|
168
|
+
const targets = partsOf(target);
|
|
169
|
+
const sources = partsOf(source).filter((one) => !targets.some((part) => part.id === one.id));
|
|
170
|
+
for (const one of sources) {
|
|
171
|
+
if (carries(one)) {
|
|
172
|
+
into.push({ source: one, targets });
|
|
173
|
+
}
|
|
174
|
+
const element = elementOf(one);
|
|
175
|
+
const called = element === undefined ? callOf(one) : undefined;
|
|
176
|
+
for (const part of targets) {
|
|
177
|
+
if (element !== undefined) {
|
|
178
|
+
compared(element, elementOf(part), depth + 1, into, seen);
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
const other = called === undefined ? undefined : callOf(part);
|
|
182
|
+
if (called === undefined || other === undefined) {
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
other.parameters.forEach((parameter, index) => {
|
|
186
|
+
compared(parameter, called.parameters[index], depth + 1, into, seen);
|
|
187
|
+
});
|
|
188
|
+
compared(called.result, other.result, depth + 1, into, seen);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
/** Whether a value of one type may carry a member a position reads, at any depth the walk takes. */
|
|
193
|
+
const mayCarry = (type, depth) => depth <= MAX_DEPTH &&
|
|
194
|
+
partsOf(type).some((part) => {
|
|
195
|
+
if (carries(part)) {
|
|
196
|
+
return true;
|
|
197
|
+
}
|
|
198
|
+
const element = elementOf(part);
|
|
199
|
+
if (element !== undefined) {
|
|
200
|
+
return mayCarry(element, depth + 1);
|
|
201
|
+
}
|
|
202
|
+
return callOf(part) !== undefined;
|
|
203
|
+
});
|
|
204
|
+
const sourced = carried.flatMap((flow, index) => {
|
|
205
|
+
const type = types[index];
|
|
206
|
+
return type === undefined || !isAnswered(type) || !mayCarry(type, 0) ? [] : [{ flow, type }];
|
|
207
|
+
});
|
|
208
|
+
batches += batchesOf(sourced.length);
|
|
209
|
+
const positions = queries.contextualTypes(sourced.map((one) => one.flow.value), cap);
|
|
210
|
+
const reads = [];
|
|
211
|
+
sourced.forEach(({ flow, type }, index) => {
|
|
212
|
+
const position = positions[index];
|
|
213
|
+
if (position === undefined || !isAnswered(position)) {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
const checked = [];
|
|
217
|
+
compared(type, position, 0, checked, new Set());
|
|
218
|
+
const ids = new Set();
|
|
219
|
+
for (const { source, targets } of checked) {
|
|
220
|
+
const tables = targets.map(membersOf);
|
|
221
|
+
for (const [name, member] of membersOf(source)) {
|
|
222
|
+
const read = tables.some((table) => {
|
|
223
|
+
const declared = table.get(name);
|
|
224
|
+
return (declared !== undefined &&
|
|
225
|
+
declared.handles.size > 0 &&
|
|
226
|
+
![...declared.handles].some((handle) => member.handles.has(handle)));
|
|
227
|
+
});
|
|
228
|
+
if (read) {
|
|
229
|
+
for (const id of readable(member)) {
|
|
230
|
+
ids.add(id);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
if (ids.size > 0) {
|
|
236
|
+
reads.push({ at: flow.value, from: flow.from, ids: [...ids] });
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
return { writes, reads, batches, lookups };
|
|
240
|
+
}
|
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The convention rows this analyzer carries: the file-system conventions of one
|
|
3
|
+
* framework or tool each, as data. Nothing outside the table names a framework.
|
|
4
|
+
*
|
|
5
|
+
* A row's globs are matched against the directory of the manifest that declares its
|
|
6
|
+
* enabling package. A glob may hold `<id>` placeholders, each standing for the
|
|
7
|
+
* directory one of the row's moves resolves to.
|
|
8
|
+
*/
|
|
9
|
+
const SCRIPT = "{js,jsx,ts,tsx}";
|
|
10
|
+
const MODULE = "{js,mjs,ts,mts}";
|
|
11
|
+
const ANY_MODULE = "{js,mjs,cjs,ts,mts,cts}";
|
|
12
|
+
const VITE_CONFIG = `vite.config.${ANY_MODULE}`;
|
|
13
|
+
const SVELTEKIT_ROUTE_FILES = "+{page,layout,server,page.server,layout.server,error}";
|
|
14
|
+
/** SvelteKit's entries other than its parameter matchers. */
|
|
15
|
+
const SVELTEKIT_ENTRIES = [
|
|
16
|
+
`<routes>/**/${SVELTEKIT_ROUTE_FILES}.{js,ts,svelte}`,
|
|
17
|
+
`<routes>/**/${SVELTEKIT_ROUTE_FILES}@*.{js,ts,svelte}`,
|
|
18
|
+
"<hooksClient>{,/index}.{js,ts}",
|
|
19
|
+
"<hooksServer>{,/index}.{js,ts}",
|
|
20
|
+
"<hooksUniversal>{,/index}.{js,ts}",
|
|
21
|
+
"<serviceWorker>{,/index}.{js,ts}",
|
|
22
|
+
"<src>/instrumentation.server.{js,ts}",
|
|
23
|
+
];
|
|
24
|
+
const SVELTEKIT_PLUGIN = { module: "@sveltejs/kit/vite", export: "sveltekit" };
|
|
25
|
+
/** The entries React Router's framework mode and Remix share below their app directory. */
|
|
26
|
+
const APP_DIRECTORY_ENTRIES = [
|
|
27
|
+
`<app>/root.${SCRIPT}`,
|
|
28
|
+
`<app>/routes.${MODULE}`,
|
|
29
|
+
`<app>/entry.{client,server}.${SCRIPT}`,
|
|
30
|
+
`<app>/routes/**/*.${SCRIPT}`,
|
|
31
|
+
];
|
|
32
|
+
const SOLIDSTART_PLUGIN = { module: "@solidjs/start/config", export: "solidStart" };
|
|
33
|
+
const NUXT_CONFIG = [`nuxt.config.${ANY_MODULE}`];
|
|
34
|
+
/** Every row, ordered by name and then by range. */
|
|
35
|
+
export const CONVENTION_ROWS = [
|
|
36
|
+
{
|
|
37
|
+
name: "astro",
|
|
38
|
+
package: "astro",
|
|
39
|
+
range: ">=5.0.0 <8.0.0",
|
|
40
|
+
entries: [
|
|
41
|
+
"<src>/pages/**/*.{astro,js,ts}",
|
|
42
|
+
"<src>/middleware{,/index}.{js,ts}",
|
|
43
|
+
"<src>/actions/index.{js,ts}",
|
|
44
|
+
`<src>/{content,live}.config.${MODULE}`,
|
|
45
|
+
`<src>/content/config.${MODULE}`,
|
|
46
|
+
],
|
|
47
|
+
excludes: ["<src>/pages/**/_*", "<src>/pages/**/_*/**"],
|
|
48
|
+
generated: [".astro"],
|
|
49
|
+
moves: [
|
|
50
|
+
{
|
|
51
|
+
id: "src",
|
|
52
|
+
defaults: ["src"],
|
|
53
|
+
readings: [{ property: "srcDir", files: [`astro.config.${ANY_MODULE}`] }],
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: "eslint",
|
|
59
|
+
package: "eslint",
|
|
60
|
+
range: ">=10.0.0 <11.0.0",
|
|
61
|
+
entries: [`**/eslint.config.${ANY_MODULE}`],
|
|
62
|
+
moves: [],
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: "expo-router",
|
|
66
|
+
package: "expo-router",
|
|
67
|
+
range: ">=3.0.0 <58.0.0",
|
|
68
|
+
entries: [`{,src/}app/**/*.${SCRIPT}`],
|
|
69
|
+
moves: [],
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: "next",
|
|
73
|
+
package: "next",
|
|
74
|
+
range: ">=13.4.0 <17.0.0",
|
|
75
|
+
generated: [".next"],
|
|
76
|
+
entries: [
|
|
77
|
+
`{,src/}app/**/{layout,page,loading,not-found,error,route,template,default,forbidden,unauthorized}.${SCRIPT}`,
|
|
78
|
+
`{,src/}app/global-{error,not-found}.${SCRIPT}`,
|
|
79
|
+
`{,src/}app/**/{icon,apple-icon,opengraph-image,twitter-image}.${SCRIPT}`,
|
|
80
|
+
"{,src/}app/**/sitemap.{js,ts}",
|
|
81
|
+
"{,src/}app/{robots,manifest}.{js,ts}",
|
|
82
|
+
"{,src/}app/(*)/{robots,manifest}.{js,ts}",
|
|
83
|
+
`{,src/}pages/**/*.${SCRIPT}`,
|
|
84
|
+
`{,src/}{proxy,middleware,instrumentation,instrumentation-client,mdx-components}.${SCRIPT}`,
|
|
85
|
+
],
|
|
86
|
+
moves: [],
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: "nuxt",
|
|
90
|
+
package: "nuxt",
|
|
91
|
+
range: ">=3.0.0 <5.0.0",
|
|
92
|
+
generated: [".nuxt"],
|
|
93
|
+
entries: [
|
|
94
|
+
"<srcDir>/{app,error}.{vue,jsx,tsx}",
|
|
95
|
+
`<srcDir>/app.config.${MODULE}`,
|
|
96
|
+
"<srcDir>/router.options.{js,ts}",
|
|
97
|
+
"<pages>/**/*.{vue,js,jsx,ts,tsx}",
|
|
98
|
+
"<layouts>/**/*.{vue,jsx,tsx}",
|
|
99
|
+
"<middleware>/**/*.{js,ts}",
|
|
100
|
+
"<plugins>/**/*.{js,ts}",
|
|
101
|
+
"<modules>/*.{js,ts}",
|
|
102
|
+
"<modules>/*/index.{js,ts}",
|
|
103
|
+
`<serverDir>/{api,routes,middleware,plugins,tasks}/**/*.${MODULE}`,
|
|
104
|
+
`layers/*/nuxt.config.${MODULE}`,
|
|
105
|
+
],
|
|
106
|
+
moves: [
|
|
107
|
+
{
|
|
108
|
+
id: "srcDir",
|
|
109
|
+
defaults: ["app", "."],
|
|
110
|
+
readings: [{ property: "srcDir", files: NUXT_CONFIG }],
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
id: "pages",
|
|
114
|
+
base: "<srcDir>",
|
|
115
|
+
defaults: ["pages"],
|
|
116
|
+
readings: [{ property: "dir.pages", files: NUXT_CONFIG }],
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
id: "layouts",
|
|
120
|
+
base: "<srcDir>",
|
|
121
|
+
defaults: ["layouts"],
|
|
122
|
+
readings: [{ property: "dir.layouts", files: NUXT_CONFIG }],
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
id: "middleware",
|
|
126
|
+
base: "<srcDir>",
|
|
127
|
+
defaults: ["middleware"],
|
|
128
|
+
readings: [{ property: "dir.middleware", files: NUXT_CONFIG }],
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
id: "plugins",
|
|
132
|
+
base: "<srcDir>",
|
|
133
|
+
defaults: ["plugins"],
|
|
134
|
+
readings: [{ property: "dir.plugins", files: NUXT_CONFIG }],
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
id: "modules",
|
|
138
|
+
defaults: ["modules"],
|
|
139
|
+
readings: [{ property: "dir.modules", files: NUXT_CONFIG }],
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
id: "serverDir",
|
|
143
|
+
defaults: ["server"],
|
|
144
|
+
readings: [{ property: "serverDir", files: NUXT_CONFIG }],
|
|
145
|
+
},
|
|
146
|
+
],
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: "qwik-city",
|
|
150
|
+
package: "@builder.io/qwik-city",
|
|
151
|
+
range: ">=1.0.0 <2.0.0",
|
|
152
|
+
entries: [
|
|
153
|
+
"<srcDir>/root.{jsx,tsx}",
|
|
154
|
+
`<srcDir>/entry.*.${SCRIPT}`,
|
|
155
|
+
`<routesDir>/**/*.${SCRIPT}`,
|
|
156
|
+
],
|
|
157
|
+
moves: [
|
|
158
|
+
{
|
|
159
|
+
id: "srcDir",
|
|
160
|
+
defaults: ["src"],
|
|
161
|
+
readings: [
|
|
162
|
+
{
|
|
163
|
+
property: "srcDir",
|
|
164
|
+
files: [VITE_CONFIG],
|
|
165
|
+
call: { module: "@builder.io/qwik/optimizer", export: "qwikVite" },
|
|
166
|
+
},
|
|
167
|
+
],
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
id: "routesDir",
|
|
171
|
+
defaults: ["<srcDir>/routes"],
|
|
172
|
+
readings: [
|
|
173
|
+
{
|
|
174
|
+
property: "routesDir",
|
|
175
|
+
files: [VITE_CONFIG],
|
|
176
|
+
call: { module: "@builder.io/qwik-city/vite", export: "qwikCity" },
|
|
177
|
+
},
|
|
178
|
+
],
|
|
179
|
+
},
|
|
180
|
+
],
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
name: "react-router",
|
|
184
|
+
package: "@react-router/dev",
|
|
185
|
+
range: ">=7.0.0 <9.0.0",
|
|
186
|
+
entries: APP_DIRECTORY_ENTRIES,
|
|
187
|
+
generated: [".react-router"],
|
|
188
|
+
moves: [
|
|
189
|
+
{
|
|
190
|
+
id: "app",
|
|
191
|
+
defaults: ["app"],
|
|
192
|
+
readings: [{ property: "appDirectory", files: [`react-router.config.${MODULE}`] }],
|
|
193
|
+
},
|
|
194
|
+
],
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
name: "remix",
|
|
198
|
+
package: "@remix-run/dev",
|
|
199
|
+
range: ">=2.0.0 <3.0.0",
|
|
200
|
+
entries: APP_DIRECTORY_ENTRIES,
|
|
201
|
+
moves: [
|
|
202
|
+
{
|
|
203
|
+
id: "app",
|
|
204
|
+
defaults: ["app"],
|
|
205
|
+
readings: [
|
|
206
|
+
{ property: "appDirectory", files: ["remix.config.{js,cjs,mjs}"] },
|
|
207
|
+
{
|
|
208
|
+
property: "appDirectory",
|
|
209
|
+
files: [VITE_CONFIG],
|
|
210
|
+
call: { module: "@remix-run/dev", export: "vitePlugin" },
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
property: "appDirectory",
|
|
214
|
+
files: [VITE_CONFIG],
|
|
215
|
+
call: { module: "@remix-run/dev", export: "unstable_vitePlugin" },
|
|
216
|
+
},
|
|
217
|
+
],
|
|
218
|
+
},
|
|
219
|
+
],
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
name: "solidstart",
|
|
223
|
+
package: "@solidjs/start",
|
|
224
|
+
range: ">=1.0.0 <3.0.0",
|
|
225
|
+
entries: [
|
|
226
|
+
`<appRoot>/app.${SCRIPT}`,
|
|
227
|
+
`<appRoot>/entry-{client,server}.${SCRIPT}`,
|
|
228
|
+
"<appRoot>/middleware{,/index}.{js,ts}",
|
|
229
|
+
`<routeDir>/**/*.${SCRIPT}`,
|
|
230
|
+
],
|
|
231
|
+
moves: [
|
|
232
|
+
{
|
|
233
|
+
id: "appRoot",
|
|
234
|
+
defaults: ["src"],
|
|
235
|
+
readings: [
|
|
236
|
+
{ property: "appRoot", files: [`app.config.${MODULE}`] },
|
|
237
|
+
{ property: "appRoot", files: [VITE_CONFIG], call: SOLIDSTART_PLUGIN },
|
|
238
|
+
],
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
id: "routeDir",
|
|
242
|
+
base: "<appRoot>",
|
|
243
|
+
defaults: ["routes"],
|
|
244
|
+
readings: [
|
|
245
|
+
{ property: "routeDir", files: [`app.config.${MODULE}`] },
|
|
246
|
+
{ property: "routeDir", files: [VITE_CONFIG], call: SOLIDSTART_PLUGIN },
|
|
247
|
+
],
|
|
248
|
+
},
|
|
249
|
+
],
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
name: "storybook",
|
|
253
|
+
package: "storybook",
|
|
254
|
+
range: ">=7.0.0 <11.0.0",
|
|
255
|
+
entries: [
|
|
256
|
+
`.storybook/{main,preview,manager,test-runner,vitest.setup}.{js,jsx,mjs,cjs,ts,tsx,mts,cts}`,
|
|
257
|
+
"**/*.stories.{js,jsx,mjs,ts,tsx,mts,svelte,vue}",
|
|
258
|
+
],
|
|
259
|
+
moves: [],
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
name: "sveltekit",
|
|
263
|
+
package: "@sveltejs/kit",
|
|
264
|
+
range: ">=2.0.0 <3.0.0",
|
|
265
|
+
entries: [...SVELTEKIT_ENTRIES, "<params>/*.{js,ts}"],
|
|
266
|
+
generated: [".svelte-kit"],
|
|
267
|
+
moves: [
|
|
268
|
+
{
|
|
269
|
+
id: "src",
|
|
270
|
+
defaults: ["src"],
|
|
271
|
+
readings: [
|
|
272
|
+
{ property: "kit.files.src", files: ["svelte.config.{js,mjs,ts}"] },
|
|
273
|
+
{ property: "files.src", files: [VITE_CONFIG], call: SVELTEKIT_PLUGIN },
|
|
274
|
+
],
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
id: "routes",
|
|
278
|
+
defaults: ["<src>/routes"],
|
|
279
|
+
readings: [
|
|
280
|
+
{ property: "kit.files.routes", files: ["svelte.config.{js,mjs,ts}"] },
|
|
281
|
+
{ property: "files.routes", files: [VITE_CONFIG], call: SVELTEKIT_PLUGIN },
|
|
282
|
+
],
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
id: "params",
|
|
286
|
+
defaults: ["<src>/params"],
|
|
287
|
+
readings: [
|
|
288
|
+
{ property: "kit.files.params", files: ["svelte.config.{js,mjs,ts}"] },
|
|
289
|
+
{ property: "files.params", files: [VITE_CONFIG], call: SVELTEKIT_PLUGIN },
|
|
290
|
+
],
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
id: "hooksClient",
|
|
294
|
+
defaults: ["<src>/hooks.client"],
|
|
295
|
+
readings: [
|
|
296
|
+
{ property: "kit.files.hooks.client", files: ["svelte.config.{js,mjs,ts}"] },
|
|
297
|
+
{ property: "files.hooks.client", files: [VITE_CONFIG], call: SVELTEKIT_PLUGIN },
|
|
298
|
+
],
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
id: "hooksServer",
|
|
302
|
+
defaults: ["<src>/hooks.server"],
|
|
303
|
+
readings: [
|
|
304
|
+
{ property: "kit.files.hooks.server", files: ["svelte.config.{js,mjs,ts}"] },
|
|
305
|
+
{ property: "files.hooks.server", files: [VITE_CONFIG], call: SVELTEKIT_PLUGIN },
|
|
306
|
+
],
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
id: "hooksUniversal",
|
|
310
|
+
defaults: ["<src>/hooks"],
|
|
311
|
+
readings: [
|
|
312
|
+
{ property: "kit.files.hooks.universal", files: ["svelte.config.{js,mjs,ts}"] },
|
|
313
|
+
{ property: "files.hooks.universal", files: [VITE_CONFIG], call: SVELTEKIT_PLUGIN },
|
|
314
|
+
],
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
id: "serviceWorker",
|
|
318
|
+
defaults: ["<src>/service-worker"],
|
|
319
|
+
readings: [
|
|
320
|
+
{ property: "kit.files.serviceWorker", files: ["svelte.config.{js,mjs,ts}"] },
|
|
321
|
+
{ property: "files.serviceWorker", files: [VITE_CONFIG], call: SVELTEKIT_PLUGIN },
|
|
322
|
+
],
|
|
323
|
+
},
|
|
324
|
+
],
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
name: "sveltekit",
|
|
328
|
+
package: "@sveltejs/kit",
|
|
329
|
+
range: ">=3.0.0 <4.0.0",
|
|
330
|
+
entries: [...SVELTEKIT_ENTRIES, "<params>.{js,ts}"],
|
|
331
|
+
generated: [".svelte-kit"],
|
|
332
|
+
moves: [
|
|
333
|
+
{
|
|
334
|
+
id: "src",
|
|
335
|
+
defaults: ["src"],
|
|
336
|
+
readings: [{ property: "files.src", files: [VITE_CONFIG], call: SVELTEKIT_PLUGIN }],
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
id: "routes",
|
|
340
|
+
defaults: ["<src>/routes"],
|
|
341
|
+
readings: [{ property: "files.routes", files: [VITE_CONFIG], call: SVELTEKIT_PLUGIN }],
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
id: "params",
|
|
345
|
+
defaults: ["<src>/params"],
|
|
346
|
+
readings: [{ property: "files.params", files: [VITE_CONFIG], call: SVELTEKIT_PLUGIN }],
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
id: "hooksClient",
|
|
350
|
+
defaults: ["<src>/hooks.client"],
|
|
351
|
+
readings: [
|
|
352
|
+
{ property: "files.hooks.client", files: [VITE_CONFIG], call: SVELTEKIT_PLUGIN },
|
|
353
|
+
],
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
id: "hooksServer",
|
|
357
|
+
defaults: ["<src>/hooks.server"],
|
|
358
|
+
readings: [
|
|
359
|
+
{ property: "files.hooks.server", files: [VITE_CONFIG], call: SVELTEKIT_PLUGIN },
|
|
360
|
+
],
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
id: "hooksUniversal",
|
|
364
|
+
defaults: ["<src>/hooks"],
|
|
365
|
+
readings: [
|
|
366
|
+
{ property: "files.hooks.universal", files: [VITE_CONFIG], call: SVELTEKIT_PLUGIN },
|
|
367
|
+
],
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
id: "serviceWorker",
|
|
371
|
+
defaults: ["<src>/service-worker"],
|
|
372
|
+
readings: [
|
|
373
|
+
{ property: "files.serviceWorker", files: [VITE_CONFIG], call: SVELTEKIT_PLUGIN },
|
|
374
|
+
],
|
|
375
|
+
},
|
|
376
|
+
],
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
name: "vitest",
|
|
380
|
+
package: "vitest",
|
|
381
|
+
range: ">=3.2.0 <6.0.0",
|
|
382
|
+
entries: [
|
|
383
|
+
`**/{vitest,vite}.config.${ANY_MODULE}`,
|
|
384
|
+
`**/{vitest,vite}.config.*.${ANY_MODULE}`,
|
|
385
|
+
`**/{vitest,vite}.*.config.${ANY_MODULE}`,
|
|
386
|
+
],
|
|
387
|
+
moves: [],
|
|
388
|
+
},
|
|
389
|
+
];
|