wuchale 0.23.1 → 0.23.3
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.
|
@@ -86,6 +86,7 @@ export declare class Transformer {
|
|
|
86
86
|
visitTryStatement: (node: Estree.TryStatement) => Message[];
|
|
87
87
|
visitTSAsExpression: (node: Estree.TSAsExpression) => Message[];
|
|
88
88
|
visitTSTypeAssertion: (node: Estree.TSTypeAssertion) => Message[];
|
|
89
|
+
visitTSSatisfiesExpression: (node: Estree.TSSatisfiesExpression) => Message[];
|
|
89
90
|
visitProgram: (node: Estree.Program) => Message[];
|
|
90
91
|
visitWithCommentDirectives: (node: Estree.AnyNode, func: () => Message[]) => Message[];
|
|
91
92
|
visitEmptyStatement: () => Message[];
|
|
@@ -678,6 +678,7 @@ export class Transformer {
|
|
|
678
678
|
};
|
|
679
679
|
visitTSAsExpression = (node) => this.visit(node.expression);
|
|
680
680
|
visitTSTypeAssertion = (node) => this.visit(node.expression);
|
|
681
|
+
visitTSSatisfiesExpression = (node) => this.visit(node.expression);
|
|
681
682
|
visitProgram = (node) => {
|
|
682
683
|
this.heuristciDetails.insideProgram = true;
|
|
683
684
|
const msgs = this.visitStatementsNSaveRealBodyStart(node.body);
|
package/dist/config.js
CHANGED
|
@@ -12,6 +12,9 @@ export const defaultConfig = {
|
|
|
12
12
|
function deepFill(target, defaults) {
|
|
13
13
|
for (const [key, def] of Object.entries(defaults)) {
|
|
14
14
|
const value = target[key];
|
|
15
|
+
if (Array.isArray(value)) {
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
15
18
|
if (!def || Array.isArray(def) || typeof def !== 'object') {
|
|
16
19
|
if (value === undefined) {
|
|
17
20
|
target[key] = def;
|
|
@@ -19,7 +22,7 @@ function deepFill(target, defaults) {
|
|
|
19
22
|
continue;
|
|
20
23
|
}
|
|
21
24
|
// def is an object. force prepare an object on the destination
|
|
22
|
-
if (!value ||
|
|
25
|
+
if (!value || typeof value !== 'object') {
|
|
23
26
|
target[key] = {};
|
|
24
27
|
}
|
|
25
28
|
deepFill(target[key], def);
|
package/dist/hub.js
CHANGED
|
@@ -59,6 +59,7 @@ export class Hub {
|
|
|
59
59
|
#formatTransformErr = e => e;
|
|
60
60
|
#hmrVersion = -1;
|
|
61
61
|
#lastSourceTriggeredCatalogWrite = 0;
|
|
62
|
+
#lastAdapterForFile = new Map();
|
|
62
63
|
constructor(opts) {
|
|
63
64
|
this.#opts = opts;
|
|
64
65
|
this.#handlers = opts.handlers;
|
|
@@ -197,24 +198,26 @@ export class Hub {
|
|
|
197
198
|
}
|
|
198
199
|
const filename = normalizeSep(relative(this.#opts.root, filePath));
|
|
199
200
|
let output = null;
|
|
200
|
-
let lastAdapterKey = null;
|
|
201
201
|
for (const adapter of this.#handlers.values()) {
|
|
202
|
-
if (adapter.fileMatches(filename)) {
|
|
203
|
-
|
|
204
|
-
throw new Error(`${logPrefix} ${filename} matches both adapters ${lastAdapterKey} and ${adapter.key}`);
|
|
205
|
-
}
|
|
206
|
-
try {
|
|
207
|
-
output = await adapter.transform(code, filename, this.#hmrVersion, forServer);
|
|
208
|
-
}
|
|
209
|
-
catch (e) {
|
|
210
|
-
throw this.#formatTransformErr(e, adapter.key, filename);
|
|
211
|
-
}
|
|
212
|
-
lastAdapterKey = adapter.key;
|
|
202
|
+
if (!adapter.fileMatches(filename)) {
|
|
203
|
+
continue;
|
|
213
204
|
}
|
|
205
|
+
try {
|
|
206
|
+
output = await adapter.transform(code, filename, this.#hmrVersion, forServer);
|
|
207
|
+
}
|
|
208
|
+
catch (e) {
|
|
209
|
+
throw this.#formatTransformErr(e, adapter.key, filename);
|
|
210
|
+
}
|
|
211
|
+
break;
|
|
214
212
|
}
|
|
215
213
|
return output ?? [{}, false];
|
|
216
214
|
};
|
|
217
215
|
#visitFileHandl = async (filename, handler) => {
|
|
216
|
+
const lastAdapterKey = this.#lastAdapterForFile.get(filename);
|
|
217
|
+
if (lastAdapterKey && lastAdapterKey !== handler.key) {
|
|
218
|
+
this.#opts.log.warn(`${filename} matches both adapters '${lastAdapterKey}' and '${handler.key}'`);
|
|
219
|
+
}
|
|
220
|
+
this.#lastAdapterForFile.set(filename, handler.key);
|
|
218
221
|
this.#opts.log.info(`${logPrefixHandler(handler.key)} Extract from ${color.cyan(filename)}`);
|
|
219
222
|
const contents = await this.#opts.fs.read(resolve(this.#opts.root, filename));
|
|
220
223
|
const [, updated] = await handler.transform(contents, filename);
|