@venizia/ardor 0.4.6 → 0.4.7-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 +18 -0
- package/dist/ardor.d.ts +3 -0
- package/dist/ardor.d.ts.map +1 -0
- package/dist/ardor.js +11 -0
- package/dist/ardor.js.map +1 -0
- package/dist/codemod/bin.d.ts +3 -0
- package/dist/codemod/bin.d.ts.map +1 -0
- package/dist/codemod/bin.js +24 -0
- package/dist/codemod/bin.js.map +1 -0
- package/dist/codemod/cli.d.ts +13 -0
- package/dist/codemod/cli.d.ts.map +1 -0
- package/dist/codemod/cli.js +155 -0
- package/dist/codemod/cli.js.map +1 -0
- package/dist/codemod/files.d.ts +25 -0
- package/dist/codemod/files.d.ts.map +1 -0
- package/dist/codemod/files.js +97 -0
- package/dist/codemod/files.js.map +1 -0
- package/dist/codemod/logger.d.ts +42 -0
- package/dist/codemod/logger.d.ts.map +1 -0
- package/dist/codemod/logger.js +382 -0
- package/dist/codemod/logger.js.map +1 -0
- package/dist/codemod/migrate.d.ts +23 -0
- package/dist/codemod/migrate.d.ts.map +1 -0
- package/dist/codemod/migrate.js +22 -0
- package/dist/codemod/migrate.js.map +1 -0
- package/dist/codemod/renames.d.ts +60 -0
- package/dist/codemod/renames.d.ts.map +1 -0
- package/dist/codemod/renames.js +114 -0
- package/dist/codemod/renames.js.map +1 -0
- package/dist/codemod/transform.d.ts +51 -0
- package/dist/codemod/transform.d.ts.map +1 -0
- package/dist/codemod/transform.js +384 -0
- package/dist/codemod/transform.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/presets/app/files/src/application.test.ts +4 -2
- package/dist/presets/app/files/src/configurations/admin.configuration.ts +2 -2
- package/dist/presets/app/preset.json +14 -14
- package/dist/presets/lib/preset.json +9 -9
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +14 -7
- package/dist/testing.js.map +1 -1
- package/dist/vite/plugin.d.ts.map +1 -1
- package/dist/vite/plugin.js +5 -4
- package/dist/vite/plugin.js.map +1 -1
- package/dist/vite/sources.d.ts.map +1 -1
- package/dist/vite/sources.js +2 -3
- package/dist/vite/sources.js.map +1 -1
- package/package.json +25 -18
- package/dist/vite/quiet-logger.d.ts +0 -3
- package/dist/vite/quiet-logger.d.ts.map +0 -1
- package/dist/vite/quiet-logger.js +0 -36
- package/dist/vite/quiet-logger.js.map +0 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type * as TS from 'typescript';
|
|
2
|
+
export type TTypeScript = typeof TS;
|
|
3
|
+
/** Something the codemod found and did not change, with the place to look. */
|
|
4
|
+
export interface IFinding {
|
|
5
|
+
line: number;
|
|
6
|
+
name: string;
|
|
7
|
+
reason: string;
|
|
8
|
+
/** `note`: something changed on purpose that the owner should know; it does not count as left. */
|
|
9
|
+
kind?: 'note';
|
|
10
|
+
}
|
|
11
|
+
export interface INamespaceResult {
|
|
12
|
+
text: string;
|
|
13
|
+
/** Identifiers rewritten to `Owner.member`. */
|
|
14
|
+
renamed: number;
|
|
15
|
+
findings: IFinding[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Rewrites the deprecated bare names of `@venizia/ardor` to their class members, in source text:
|
|
19
|
+
* `isDefined(x)` becomes `ValueUtility.isDefined(x)` and the import follows. With `hooks`, a hook
|
|
20
|
+
* imported from `@venizia/ardor` itself becomes `Ardor.useX` (never one imported from the react or
|
|
21
|
+
* admin package, which cannot import `Ardor`).
|
|
22
|
+
*
|
|
23
|
+
* It reads syntax only (no type information), so it is conservative: a name the file also declares
|
|
24
|
+
* itself, an owner name already taken, an `export { name }` and a type-only import are listed in
|
|
25
|
+
* `findings` and left alone.
|
|
26
|
+
*/
|
|
27
|
+
export declare class NamespaceTransform {
|
|
28
|
+
static run(opts: {
|
|
29
|
+
ts: TTypeScript;
|
|
30
|
+
fileName: string;
|
|
31
|
+
text: string;
|
|
32
|
+
hooks: boolean;
|
|
33
|
+
}): INamespaceResult;
|
|
34
|
+
/** Every named import from an ARDOR package that has a class-member replacement. */
|
|
35
|
+
private static collectRenames;
|
|
36
|
+
private static collectBindings;
|
|
37
|
+
/** The renames that are safe: nothing in the file competes for the old name or for the class name. */
|
|
38
|
+
private static accept;
|
|
39
|
+
/** Walks the file once and records each use of an accepted import. */
|
|
40
|
+
private static collectReferences;
|
|
41
|
+
private static classify;
|
|
42
|
+
/** `App.DEFAULT_LOCALE` and the two removed `HeaderConstants`: listed, there is nothing to write instead. */
|
|
43
|
+
private static findRemovedMembers;
|
|
44
|
+
/** The import lines, with the old names out and the class names in (once per class). */
|
|
45
|
+
private static importEdits;
|
|
46
|
+
/** `{ a, b }` on one line when the import was on one line, one name per line when it was not. */
|
|
47
|
+
private static formatNames;
|
|
48
|
+
private static removeImport;
|
|
49
|
+
private static apply;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=transform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../src/codemod/transform.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAWtC,MAAM,MAAM,WAAW,GAAG,OAAO,EAAE,CAAC;AAEpC,8EAA8E;AAC9E,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,kGAAkG;IAClG,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,QAAQ,EAAE,CAAC;CACtB;AAyBD;;;;;;;;;GASG;AACH,qBAAa,kBAAkB;IAC7B,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE;QACf,EAAE,EAAE,WAAW,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,OAAO,CAAC;KAChB,GAAG,gBAAgB;IA8CpB,oFAAoF;IACpF,OAAO,CAAC,MAAM,CAAC,cAAc;IA6E7B,OAAO,CAAC,MAAM,CAAC,eAAe;IAiE9B,sGAAsG;IACtG,OAAO,CAAC,MAAM,CAAC,MAAM;IAwDrB,sEAAsE;IACtE,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAyBhC,OAAO,CAAC,MAAM,CAAC,QAAQ;IA4EvB,6GAA6G;IAC7G,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAsDjC,wFAAwF;IACxF,OAAO,CAAC,MAAM,CAAC,WAAW;IAyD1B,iGAAiG;IACjG,OAAO,CAAC,MAAM,CAAC,WAAW;IA2B1B,OAAO,CAAC,MAAM,CAAC,YAAY;IA+B3B,OAAO,CAAC,MAAM,CAAC,KAAK;CAUrB"}
|
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
import { FunctionRenames, HookRenames, NamespaceModules, RemovedNames, TypeRenames, } from './renames.js';
|
|
2
|
+
/**
|
|
3
|
+
* Rewrites the deprecated bare names of `@venizia/ardor` to their class members, in source text:
|
|
4
|
+
* `isDefined(x)` becomes `ValueUtility.isDefined(x)` and the import follows. With `hooks`, a hook
|
|
5
|
+
* imported from `@venizia/ardor` itself becomes `Ardor.useX` (never one imported from the react or
|
|
6
|
+
* admin package, which cannot import `Ardor`).
|
|
7
|
+
*
|
|
8
|
+
* It reads syntax only (no type information), so it is conservative: a name the file also declares
|
|
9
|
+
* itself, an owner name already taken, an `export { name }` and a type-only import are listed in
|
|
10
|
+
* `findings` and left alone.
|
|
11
|
+
*/
|
|
12
|
+
export class NamespaceTransform {
|
|
13
|
+
static run(opts) {
|
|
14
|
+
const { ts, fileName, text, hooks } = opts;
|
|
15
|
+
if (!text.includes('@venizia/ardor')) {
|
|
16
|
+
return { text, renamed: 0, findings: [] };
|
|
17
|
+
}
|
|
18
|
+
const sourceFile = ts.createSourceFile(fileName, text, ts.ScriptTarget.Latest, true, fileName.endsWith('.tsx') ? ts.ScriptKind.TSX : ts.ScriptKind.TS);
|
|
19
|
+
const findings = [];
|
|
20
|
+
const renames = NamespaceTransform.collectRenames({ ts, sourceFile, hooks, findings });
|
|
21
|
+
NamespaceTransform.findRemovedMembers({ ts, sourceFile, findings });
|
|
22
|
+
if (renames.length === 0) {
|
|
23
|
+
return { text, renamed: 0, findings };
|
|
24
|
+
}
|
|
25
|
+
const bindings = NamespaceTransform.collectBindings({ ts, sourceFile });
|
|
26
|
+
const accepted = NamespaceTransform.accept({ renames, bindings, sourceFile, findings });
|
|
27
|
+
const byLocal = new Map(accepted.map((rename) => [rename.local, rename]));
|
|
28
|
+
NamespaceTransform.collectReferences({ ts, sourceFile, byLocal, findings });
|
|
29
|
+
const used = accepted.filter((rename) => rename.references.length > 0);
|
|
30
|
+
const edits = used.flatMap((rename) => rename.references.map((reference) => ({
|
|
31
|
+
start: reference.start,
|
|
32
|
+
end: reference.end,
|
|
33
|
+
text: reference.text,
|
|
34
|
+
})));
|
|
35
|
+
edits.push(...NamespaceTransform.importEdits({ ts, sourceFile, used, bindings }));
|
|
36
|
+
return {
|
|
37
|
+
text: NamespaceTransform.apply({ text, edits }),
|
|
38
|
+
renamed: used.reduce((sum, rename) => sum + rename.references.length, 0),
|
|
39
|
+
findings,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/** Every named import from an ARDOR package that has a class-member replacement. */
|
|
43
|
+
static collectRenames(opts) {
|
|
44
|
+
const { ts, sourceFile, hooks, findings } = opts;
|
|
45
|
+
const renames = [];
|
|
46
|
+
for (const statement of sourceFile.statements) {
|
|
47
|
+
if (!ts.isImportDeclaration(statement) || !ts.isStringLiteral(statement.moduleSpecifier)) {
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
const module = statement.moduleSpecifier.text;
|
|
51
|
+
const clause = statement.importClause;
|
|
52
|
+
if (!NamespaceModules.isValid(module) || !clause) {
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
if (!clause.namedBindings || !ts.isNamedImports(clause.namedBindings)) {
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
for (const specifier of clause.namedBindings.elements) {
|
|
59
|
+
const imported = (specifier.propertyName ?? specifier.name).text;
|
|
60
|
+
const removed = RemovedNames.findExport({ name: imported });
|
|
61
|
+
if (removed) {
|
|
62
|
+
findings.push({
|
|
63
|
+
line: sourceFile.getLineAndCharacterOfPosition(specifier.getStart(sourceFile)).line + 1,
|
|
64
|
+
name: specifier.name.text,
|
|
65
|
+
reason: `removed: ${removed}`,
|
|
66
|
+
});
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
const typeText = TypeRenames.find({ name: imported });
|
|
70
|
+
if (typeText) {
|
|
71
|
+
renames.push({
|
|
72
|
+
specifier,
|
|
73
|
+
declaration: statement,
|
|
74
|
+
local: specifier.name.text,
|
|
75
|
+
typeText,
|
|
76
|
+
references: [],
|
|
77
|
+
});
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
// A function or a hook is a value: an import that is type-only cannot carry it.
|
|
81
|
+
if (clause.isTypeOnly || specifier.isTypeOnly) {
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
let target = FunctionRenames.find({ name: imported });
|
|
85
|
+
if (!target && hooks && module === NamespaceModules.UMBRELLA) {
|
|
86
|
+
target = HookRenames.find({ name: imported });
|
|
87
|
+
}
|
|
88
|
+
if (target) {
|
|
89
|
+
renames.push({
|
|
90
|
+
specifier,
|
|
91
|
+
declaration: statement,
|
|
92
|
+
local: specifier.name.text,
|
|
93
|
+
target,
|
|
94
|
+
references: [],
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return renames;
|
|
100
|
+
}
|
|
101
|
+
static collectBindings(opts) {
|
|
102
|
+
const { ts, sourceFile } = opts;
|
|
103
|
+
const declared = new Set();
|
|
104
|
+
const imported = new Map();
|
|
105
|
+
const declareName = (name) => {
|
|
106
|
+
if (ts.isIdentifier(name)) {
|
|
107
|
+
declared.add(name.text);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
for (const element of name.elements) {
|
|
111
|
+
if (ts.isBindingElement(element)) {
|
|
112
|
+
declareName(element.name);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
const visit = (node) => {
|
|
117
|
+
if (ts.isImportDeclaration(node) && ts.isStringLiteral(node.moduleSpecifier)) {
|
|
118
|
+
const clause = node.importClause;
|
|
119
|
+
const module = node.moduleSpecifier.text;
|
|
120
|
+
const typeOnly = clause?.isTypeOnly ?? false;
|
|
121
|
+
if (clause?.name) {
|
|
122
|
+
imported.set(clause.name.text, { module, typeOnly });
|
|
123
|
+
}
|
|
124
|
+
const bindings = clause?.namedBindings;
|
|
125
|
+
if (bindings && ts.isNamespaceImport(bindings)) {
|
|
126
|
+
imported.set(bindings.name.text, { module, typeOnly });
|
|
127
|
+
}
|
|
128
|
+
else if (bindings) {
|
|
129
|
+
for (const element of bindings.elements) {
|
|
130
|
+
imported.set(element.name.text, { module, typeOnly: typeOnly || element.isTypeOnly });
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
if ((ts.isVariableDeclaration(node) || ts.isParameter(node) || ts.isBindingElement(node)) &&
|
|
136
|
+
node.name) {
|
|
137
|
+
declareName(node.name);
|
|
138
|
+
}
|
|
139
|
+
else if ((ts.isFunctionDeclaration(node) ||
|
|
140
|
+
ts.isClassDeclaration(node) ||
|
|
141
|
+
ts.isFunctionExpression(node) ||
|
|
142
|
+
ts.isClassExpression(node)) &&
|
|
143
|
+
node.name) {
|
|
144
|
+
declared.add(node.name.text);
|
|
145
|
+
}
|
|
146
|
+
ts.forEachChild(node, visit);
|
|
147
|
+
};
|
|
148
|
+
visit(sourceFile);
|
|
149
|
+
return { declared, imported };
|
|
150
|
+
}
|
|
151
|
+
/** The renames that are safe: nothing in the file competes for the old name or for the class name. */
|
|
152
|
+
static accept(opts) {
|
|
153
|
+
const { renames, bindings, sourceFile, findings } = opts;
|
|
154
|
+
return renames.filter((rename) => {
|
|
155
|
+
const line = sourceFile.getLineAndCharacterOfPosition(rename.specifier.getStart(sourceFile)).line + 1;
|
|
156
|
+
const owner = rename.target?.owner;
|
|
157
|
+
if (bindings.declared.has(rename.local)) {
|
|
158
|
+
findings.push({
|
|
159
|
+
line,
|
|
160
|
+
name: rename.local,
|
|
161
|
+
reason: `the file also declares "${rename.local}" itself, so a use of the import cannot be told apart without types`,
|
|
162
|
+
});
|
|
163
|
+
return false;
|
|
164
|
+
}
|
|
165
|
+
if (!owner || !rename.target) {
|
|
166
|
+
return true;
|
|
167
|
+
}
|
|
168
|
+
const existing = bindings.imported.get(owner);
|
|
169
|
+
if (bindings.declared.has(owner) ||
|
|
170
|
+
(existing && !NamespaceModules.isValid(existing.module))) {
|
|
171
|
+
findings.push({
|
|
172
|
+
line,
|
|
173
|
+
name: rename.local,
|
|
174
|
+
reason: `"${owner}" is already taken in this file; import it under another name and use ${owner}.${rename.target.member}`,
|
|
175
|
+
});
|
|
176
|
+
return false;
|
|
177
|
+
}
|
|
178
|
+
if (existing?.typeOnly) {
|
|
179
|
+
findings.push({
|
|
180
|
+
line,
|
|
181
|
+
name: rename.local,
|
|
182
|
+
reason: `"${owner}" is imported as a type only; import it as a value to use ${owner}.${rename.target.member}`,
|
|
183
|
+
});
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
return true;
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
/** Walks the file once and records each use of an accepted import. */
|
|
190
|
+
static collectReferences(opts) {
|
|
191
|
+
const { ts, sourceFile, byLocal, findings } = opts;
|
|
192
|
+
const visit = (node) => {
|
|
193
|
+
if (ts.isImportDeclaration(node)) {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
const rename = ts.isIdentifier(node) ? byLocal.get(node.text) : undefined;
|
|
197
|
+
if (rename && ts.isIdentifier(node)) {
|
|
198
|
+
NamespaceTransform.classify({ ts, sourceFile, node, rename, findings });
|
|
199
|
+
}
|
|
200
|
+
ts.forEachChild(node, visit);
|
|
201
|
+
};
|
|
202
|
+
visit(sourceFile);
|
|
203
|
+
}
|
|
204
|
+
static classify(opts) {
|
|
205
|
+
const { ts, sourceFile, node, rename, findings } = opts;
|
|
206
|
+
const { parent } = node;
|
|
207
|
+
const replacement = rename.target
|
|
208
|
+
? `${rename.target.owner}.${rename.target.member}`
|
|
209
|
+
: (rename.typeText ?? rename.local);
|
|
210
|
+
const start = node.getStart(sourceFile);
|
|
211
|
+
const end = node.getEnd();
|
|
212
|
+
// A name, not a use: a property, a member, a key, a label.
|
|
213
|
+
const isName = (ts.isPropertyAccessExpression(parent) && parent.name === node) ||
|
|
214
|
+
(ts.isQualifiedName(parent) && parent.right === node) ||
|
|
215
|
+
(ts.isBindingElement(parent) && parent.propertyName === node) ||
|
|
216
|
+
((ts.isPropertyAssignment(parent) ||
|
|
217
|
+
ts.isPropertyDeclaration(parent) ||
|
|
218
|
+
ts.isPropertySignature(parent) ||
|
|
219
|
+
ts.isMethodDeclaration(parent) ||
|
|
220
|
+
ts.isMethodSignature(parent) ||
|
|
221
|
+
ts.isGetAccessorDeclaration(parent) ||
|
|
222
|
+
ts.isSetAccessorDeclaration(parent) ||
|
|
223
|
+
ts.isEnumMember(parent) ||
|
|
224
|
+
ts.isJsxAttribute(parent)) &&
|
|
225
|
+
parent.name === node);
|
|
226
|
+
if (isName) {
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
if (ts.isExportSpecifier(parent)) {
|
|
230
|
+
// `export { x as isDefined }` names a new export; `export { isDefined }` re-exports the import.
|
|
231
|
+
if (parent.propertyName && parent.name === node) {
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
findings.push({
|
|
235
|
+
line: sourceFile.getLineAndCharacterOfPosition(start).line + 1,
|
|
236
|
+
name: rename.local,
|
|
237
|
+
reason: `re-exported by name; export ${replacement} under a name of your own`,
|
|
238
|
+
});
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
if (rename.typeText !== undefined) {
|
|
242
|
+
// A type is a name in a type position only: `NullableType[]` needs parentheses once replaced.
|
|
243
|
+
if (ts.isTypeReferenceNode(parent) && parent.typeName === node) {
|
|
244
|
+
const grand = parent.parent;
|
|
245
|
+
const wrap = rename.typeText.includes('|') &&
|
|
246
|
+
(ts.isArrayTypeNode(grand) ||
|
|
247
|
+
ts.isIntersectionTypeNode(grand) ||
|
|
248
|
+
ts.isTypeOperatorNode(grand) ||
|
|
249
|
+
ts.isIndexedAccessTypeNode(grand));
|
|
250
|
+
rename.references.push({ start, end, text: wrap ? `(${replacement})` : replacement });
|
|
251
|
+
}
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
if (ts.isShorthandPropertyAssignment(parent) && parent.name === node) {
|
|
255
|
+
rename.references.push({ start, end, text: `${rename.local}: ${replacement}` });
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
rename.references.push({ start, end, text: replacement });
|
|
259
|
+
}
|
|
260
|
+
/** `App.DEFAULT_LOCALE` and the two removed `HeaderConstants`: listed, there is nothing to write instead. */
|
|
261
|
+
static findRemovedMembers(opts) {
|
|
262
|
+
const { ts, sourceFile, findings } = opts;
|
|
263
|
+
const owners = new Map();
|
|
264
|
+
for (const statement of sourceFile.statements) {
|
|
265
|
+
if (!ts.isImportDeclaration(statement) || !ts.isStringLiteral(statement.moduleSpecifier)) {
|
|
266
|
+
continue;
|
|
267
|
+
}
|
|
268
|
+
const named = statement.importClause?.namedBindings;
|
|
269
|
+
if (!NamespaceModules.isValid(statement.moduleSpecifier.text) ||
|
|
270
|
+
!named ||
|
|
271
|
+
!ts.isNamedImports(named)) {
|
|
272
|
+
continue;
|
|
273
|
+
}
|
|
274
|
+
for (const specifier of named.elements) {
|
|
275
|
+
owners.set(specifier.name.text, (specifier.propertyName ?? specifier.name).text);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
if (owners.size === 0) {
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
const visit = (node) => {
|
|
282
|
+
if (ts.isPropertyAccessExpression(node) && ts.isIdentifier(node.expression)) {
|
|
283
|
+
const owner = owners.get(node.expression.text);
|
|
284
|
+
const reason = owner
|
|
285
|
+
? RemovedNames.findMember({ owner, member: node.name.text })
|
|
286
|
+
: undefined;
|
|
287
|
+
if (reason) {
|
|
288
|
+
findings.push({
|
|
289
|
+
line: sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line + 1,
|
|
290
|
+
name: `${node.expression.text}.${node.name.text}`,
|
|
291
|
+
reason: `removed: ${reason}`,
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
ts.forEachChild(node, visit);
|
|
296
|
+
};
|
|
297
|
+
visit(sourceFile);
|
|
298
|
+
}
|
|
299
|
+
/** The import lines, with the old names out and the class names in (once per class). */
|
|
300
|
+
static importEdits(opts) {
|
|
301
|
+
const { ts, sourceFile, used, bindings } = opts;
|
|
302
|
+
const edits = [];
|
|
303
|
+
const added = new Set();
|
|
304
|
+
const declarations = new Set(used.map((rename) => rename.declaration));
|
|
305
|
+
for (const declaration of declarations) {
|
|
306
|
+
const clause = declaration.importClause;
|
|
307
|
+
const named = clause?.namedBindings;
|
|
308
|
+
if (!clause || !named || !ts.isNamedImports(named)) {
|
|
309
|
+
continue;
|
|
310
|
+
}
|
|
311
|
+
const renamed = new Set(used
|
|
312
|
+
.filter((rename) => rename.declaration === declaration)
|
|
313
|
+
.map((rename) => rename.specifier));
|
|
314
|
+
const kept = named.elements
|
|
315
|
+
.filter((element) => !renamed.has(element))
|
|
316
|
+
.map((element) => element.getText(sourceFile));
|
|
317
|
+
const owners = [
|
|
318
|
+
...new Set(used
|
|
319
|
+
.filter((rename) => rename.declaration === declaration)
|
|
320
|
+
.map((rename) => rename.target?.owner)
|
|
321
|
+
.filter((owner) => owner !== undefined)),
|
|
322
|
+
].filter((owner) => !bindings.imported.has(owner) && !added.has(owner));
|
|
323
|
+
for (const owner of owners) {
|
|
324
|
+
added.add(owner);
|
|
325
|
+
}
|
|
326
|
+
const names = [...kept, ...owners];
|
|
327
|
+
if (names.length === 0) {
|
|
328
|
+
edits.push(NamespaceTransform.removeImport({ sourceFile, declaration, clause, named, ts }));
|
|
329
|
+
continue;
|
|
330
|
+
}
|
|
331
|
+
edits.push({
|
|
332
|
+
start: named.getStart(sourceFile),
|
|
333
|
+
end: named.getEnd(),
|
|
334
|
+
text: NamespaceTransform.formatNames({ sourceFile, declaration, named, names }),
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
return edits;
|
|
338
|
+
}
|
|
339
|
+
/** `{ a, b }` on one line when the import was on one line, one name per line when it was not. */
|
|
340
|
+
static formatNames(opts) {
|
|
341
|
+
const { sourceFile, declaration, named, names } = opts;
|
|
342
|
+
const original = named.getText(sourceFile);
|
|
343
|
+
if (!original.includes('\n')) {
|
|
344
|
+
return `{ ${names.join(', ')} }`;
|
|
345
|
+
}
|
|
346
|
+
const lineStart = (position) => {
|
|
347
|
+
const before = sourceFile.text.slice(0, position);
|
|
348
|
+
return before.slice(before.lastIndexOf('\n') + 1);
|
|
349
|
+
};
|
|
350
|
+
const closing = /^\s*/.exec(lineStart(declaration.getStart(sourceFile)))?.[0] ?? '';
|
|
351
|
+
const first = named.elements[0];
|
|
352
|
+
const indent = first
|
|
353
|
+
? (/^\s*/.exec(lineStart(first.getStart(sourceFile)))?.[0] ?? ' ')
|
|
354
|
+
: `${closing} `;
|
|
355
|
+
return `{\n${names.map((name) => `${indent}${name},`).join('\n')}\n${closing}}`;
|
|
356
|
+
}
|
|
357
|
+
static removeImport(opts) {
|
|
358
|
+
const { sourceFile, declaration, clause, named } = opts;
|
|
359
|
+
// `import Default, { a } from 'x'`: drop the braces and the comma, keep the default.
|
|
360
|
+
if (clause.name) {
|
|
361
|
+
return { start: clause.name.getEnd(), end: named.getEnd(), text: '' };
|
|
362
|
+
}
|
|
363
|
+
const start = declaration.getStart(sourceFile);
|
|
364
|
+
let end = declaration.getEnd();
|
|
365
|
+
if (sourceFile.text[end] === '\n') {
|
|
366
|
+
end += 1;
|
|
367
|
+
}
|
|
368
|
+
// The blank line that separated this import from the code goes with it, not a second one.
|
|
369
|
+
const alone = start === 0 || sourceFile.text.slice(start - 2, start) === '\n\n';
|
|
370
|
+
if (alone && sourceFile.text[end] === '\n') {
|
|
371
|
+
end += 1;
|
|
372
|
+
}
|
|
373
|
+
return { start, end, text: '' };
|
|
374
|
+
}
|
|
375
|
+
static apply(opts) {
|
|
376
|
+
const ordered = [...opts.edits].sort((a, b) => b.start - a.start);
|
|
377
|
+
let result = opts.text;
|
|
378
|
+
for (const edit of ordered) {
|
|
379
|
+
result = result.slice(0, edit.start) + edit.text + result.slice(edit.end);
|
|
380
|
+
}
|
|
381
|
+
return result;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
//# sourceMappingURL=transform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform.js","sourceRoot":"","sources":["../../src/codemod/transform.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,eAAe,EACf,WAAW,EAEX,gBAAgB,EAChB,YAAY,EACZ,WAAW,GACZ,MAAM,WAAW,CAAC;AA2CnB;;;;;;;;;GASG;AACH,MAAM,OAAO,kBAAkB;IAC7B,MAAM,CAAC,GAAG,CAAC,IAKV;QACC,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;QAC3C,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC;YACrC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,E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O,EAAE,CAAC;YAC3B,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC5E,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// ARDOR - one entry point over the framework packages.
|
|
2
2
|
// An application imports from `@venizia/ardor`; a consumer that needs only one layer installs that
|
|
3
3
|
// package directly.
|
|
4
|
+
export * as Ardor from './ardor.js';
|
|
4
5
|
export * from '@venizia/ardor-kernel';
|
|
5
6
|
export * from '@venizia/ardor-react';
|
|
6
7
|
export * from '@venizia/ardor-admin';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,mGAAmG;AACnG,oBAAoB;AACpB,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,mGAAmG;AACnG,oBAAoB;AACpB,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC"}
|
|
@@ -39,12 +39,14 @@ describe('AdminConfiguration', () => {
|
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
test('binds the REST data provider options under their key', async () => {
|
|
42
|
-
|
|
42
|
+
const result = await restUrlOf();
|
|
43
|
+
expect(result).toBe('/api');
|
|
43
44
|
});
|
|
44
45
|
|
|
45
46
|
test('the API url is the one config.js wrote when the container started', async () => {
|
|
46
47
|
Reflect.set(globalThis, RUNTIME_CONFIG_GLOBAL, { VITE_API_URL: 'https://api.example.com' });
|
|
47
48
|
|
|
48
|
-
|
|
49
|
+
const result = await restUrlOf();
|
|
50
|
+
expect(result).toBe('https://api.example.com');
|
|
49
51
|
});
|
|
50
52
|
});
|
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
DefaultI18nProvider,
|
|
6
6
|
DefaultRestDataProvider,
|
|
7
7
|
englishMessages,
|
|
8
|
-
getRuntimeConfig,
|
|
9
8
|
inject,
|
|
10
9
|
provide,
|
|
10
|
+
RuntimeConfig,
|
|
11
11
|
} from '@venizia/ardor';
|
|
12
12
|
|
|
13
13
|
// The two providers an application without sign-in needs. start() binds each @provide method under its
|
|
@@ -24,7 +24,7 @@ export class AdminConfiguration {
|
|
|
24
24
|
// No sign-in: no request carries an Authorization header. The API is `/api` (the image's nginx
|
|
25
25
|
// forwards it to API_UPSTREAM) unless VITE_API_URL says otherwise: set in .env in dev, or written to
|
|
26
26
|
// config.js when the container starts, so one built image serves every environment.
|
|
27
|
-
const url =
|
|
27
|
+
const url = RuntimeConfig.get({
|
|
28
28
|
key: 'VITE_API_URL',
|
|
29
29
|
buildTimeEnv: import.meta.env,
|
|
30
30
|
defaultValue: '/api',
|
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@reduxjs/toolkit": "^2.13.0",
|
|
15
15
|
"@tanstack/react-query": "^5.104.5",
|
|
16
|
-
"@venizia/ardor": "0.4.
|
|
17
|
-
"@venizia/ignis-connectors": "0.4.
|
|
18
|
-
"@venizia/ignis-filter": "0.4.
|
|
19
|
-
"@venizia/ignis-helpers": "0.4.
|
|
20
|
-
"@venizia/ignis-inversion": "0.4.
|
|
21
|
-
"@venizia/ignis-kernel": "0.4.
|
|
16
|
+
"@venizia/ardor": "0.4.7-0",
|
|
17
|
+
"@venizia/ignis-connectors": "0.4.7-2",
|
|
18
|
+
"@venizia/ignis-filter": "0.4.6-1",
|
|
19
|
+
"@venizia/ignis-helpers": "0.4.7-2",
|
|
20
|
+
"@venizia/ignis-inversion": "0.4.6-1",
|
|
21
|
+
"@venizia/ignis-kernel": "0.4.7-2",
|
|
22
22
|
"class-variance-authority": "^0.7.1",
|
|
23
23
|
"clsx": "^2.1.1",
|
|
24
24
|
"ra-core": "^5.15.5",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"@types/bun": "^1.4.3",
|
|
36
36
|
"@types/react": "^19",
|
|
37
37
|
"@types/react-dom": "^19",
|
|
38
|
-
"@venizia/dev-configs": "0.4.
|
|
39
|
-
"@venizia/ignis-boot": "0.4.
|
|
38
|
+
"@venizia/dev-configs": "0.4.7-2",
|
|
39
|
+
"@venizia/ignis-boot": "0.4.7-2",
|
|
40
40
|
"@vitejs/plugin-react": "^6.1.2",
|
|
41
41
|
"eslint": "^10.13.0",
|
|
42
42
|
"oxlint": "1.89.0",
|
|
@@ -46,12 +46,12 @@
|
|
|
46
46
|
"vite": "^8.3.5"
|
|
47
47
|
},
|
|
48
48
|
"peers": {
|
|
49
|
-
"@venizia/dev-configs": "^0.4.0",
|
|
50
|
-
"@venizia/ignis-connectors": "^0.4.
|
|
51
|
-
"@venizia/ignis-filter": "^0.4.1",
|
|
52
|
-
"@venizia/ignis-helpers": "^0.4.
|
|
53
|
-
"@venizia/ignis-inversion": "^0.4.
|
|
54
|
-
"@venizia/ignis-kernel": "^0.4.
|
|
49
|
+
"@venizia/dev-configs": "^0.4.0 || 0.4.7-2",
|
|
50
|
+
"@venizia/ignis-connectors": "^0.4.7-2",
|
|
51
|
+
"@venizia/ignis-filter": "^0.4.6-1",
|
|
52
|
+
"@venizia/ignis-helpers": "^0.4.7-2",
|
|
53
|
+
"@venizia/ignis-inversion": "^0.4.6-1",
|
|
54
|
+
"@venizia/ignis-kernel": "^0.4.7-2"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"server:dev": "vite --config .configs/builders/vite.config.mts",
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@types/bun": "^1.4.3",
|
|
7
7
|
"@types/react": "^19",
|
|
8
|
-
"@venizia/ardor": "^0.4.
|
|
9
|
-
"@venizia/dev-configs": "0.4.
|
|
10
|
-
"@venizia/ignis-boot": "0.4.
|
|
11
|
-
"@venizia/ignis-connectors": "0.4.
|
|
12
|
-
"@venizia/ignis-filter": "0.4.
|
|
13
|
-
"@venizia/ignis-helpers": "0.4.
|
|
14
|
-
"@venizia/ignis-inversion": "0.4.
|
|
15
|
-
"@venizia/ignis-kernel": "0.4.
|
|
8
|
+
"@venizia/ardor": "^0.4.7-0",
|
|
9
|
+
"@venizia/dev-configs": "0.4.7-2",
|
|
10
|
+
"@venizia/ignis-boot": "0.4.7-2",
|
|
11
|
+
"@venizia/ignis-connectors": "0.4.7-2",
|
|
12
|
+
"@venizia/ignis-filter": "0.4.6-1",
|
|
13
|
+
"@venizia/ignis-helpers": "0.4.7-2",
|
|
14
|
+
"@venizia/ignis-inversion": "0.4.6-1",
|
|
15
|
+
"@venizia/ignis-kernel": "0.4.7-2",
|
|
16
16
|
"eslint": "^10.13.0",
|
|
17
17
|
"oxlint": "1.89.0",
|
|
18
18
|
"oxlint-tsgolint": "7.0.2004",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"typescript": "^6.0.3"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@venizia/ardor": "^0.4.
|
|
26
|
+
"@venizia/ardor": "^0.4.7-0",
|
|
27
27
|
"react": "^19.3.1",
|
|
28
28
|
"react-dom": "^19.3.1",
|
|
29
29
|
"react-router-dom": "^7.18.4",
|
package/dist/testing.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,0BAA0B,CAAC;AAGtD,OAAO,EAAgB,KAAK,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAEhF,kGAAkG;AAClG,MAAM,MAAM,SAAS,GAAG,SAAS,CAAC,YAAY,CAAC;AAE/C,MAAM,WAAW,mCAAmC;IAClD;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAEhC,qFAAqF;IACrF,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAmBD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,2BAA2B,GAAU,WAAW,SAAS,oBAAoB,EACxF,aAAa,WAAW,GAAG,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,EACrE,UAAS,mCAAwC,KAChD,OAAO,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,0BAA0B,CAAC;AAGtD,OAAO,EAAgB,KAAK,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAEhF,kGAAkG;AAClG,MAAM,MAAM,SAAS,GAAG,SAAS,CAAC,YAAY,CAAC;AAE/C,MAAM,WAAW,mCAAmC;IAClD;;;;;;;;OAQ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