unplugin-isolated-decl 0.11.0 → 0.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esbuild.js +1 -1
- package/dist/farm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/rolldown.js +1 -1
- package/dist/rollup.js +1 -1
- package/dist/{src-BKZ7wewR.js → src-eMzdAZrI.js} +37 -35
- package/dist/vite.js +1 -1
- package/package.json +21 -17
package/dist/esbuild.js
CHANGED
package/dist/farm.js
CHANGED
package/dist/index.js
CHANGED
package/dist/rolldown.js
CHANGED
package/dist/rollup.js
CHANGED
|
@@ -281,7 +281,7 @@ const IsolatedDecl = createUnplugin((rawOptions = {}) => {
|
|
|
281
281
|
build.onEnd(async (result) => {
|
|
282
282
|
const esbuildOptions = build.initialOptions;
|
|
283
283
|
const entries = esbuildOptions.entryPoints;
|
|
284
|
-
if (!
|
|
284
|
+
if (!entries || !Array.isArray(entries) || !entries.every((entry) => typeof entry === "string")) throw new Error("unsupported entryPoints, must be an string[]");
|
|
285
285
|
const inputBase = options.inputBase || lowestCommonAncestor(...entries);
|
|
286
286
|
debug("[esbuild] input base:", inputBase);
|
|
287
287
|
const jsExt = esbuildOptions.outExtension?.[".js"];
|
|
@@ -332,41 +332,43 @@ const IsolatedDecl = createUnplugin((rawOptions = {}) => {
|
|
|
332
332
|
});
|
|
333
333
|
async function resolve(context, id, importer) {
|
|
334
334
|
const nativeContext = context.getNativeBuildContext?.();
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
335
|
+
try {
|
|
336
|
+
switch (nativeContext?.framework) {
|
|
337
|
+
case "esbuild": {
|
|
338
|
+
const resolved = await nativeContext?.build.resolve(id, {
|
|
339
|
+
importer,
|
|
340
|
+
resolveDir: path.dirname(importer),
|
|
341
|
+
kind: "import-statement"
|
|
342
|
+
});
|
|
343
|
+
return {
|
|
344
|
+
id: resolved?.path,
|
|
345
|
+
external: resolved?.external
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
case "farm": {
|
|
349
|
+
const resolved = await nativeContext?.context.resolve({
|
|
350
|
+
source: id,
|
|
351
|
+
importer,
|
|
352
|
+
kind: "import"
|
|
353
|
+
}, {
|
|
354
|
+
meta: {},
|
|
355
|
+
caller: "unplugin-isolated-decl"
|
|
356
|
+
});
|
|
357
|
+
return {
|
|
358
|
+
id: resolved.resolvedPath,
|
|
359
|
+
external: !!resolved.external
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
default: {
|
|
363
|
+
const resolved = await context.resolve(id, importer);
|
|
364
|
+
if (!resolved) return;
|
|
365
|
+
return {
|
|
366
|
+
id: resolved.id,
|
|
367
|
+
external: !!resolved.external
|
|
368
|
+
};
|
|
369
|
+
}
|
|
368
370
|
}
|
|
369
|
-
}
|
|
371
|
+
} catch {}
|
|
370
372
|
}
|
|
371
373
|
function patchCjsDefaultExport(source) {
|
|
372
374
|
return source.replace(/(?<=(?:[;}]|^)\s*export\s*)(?:\{\s*([\w$]+)\s*as\s+default\s*\}|default\s+([\w$]+))/, (_, s1, s2) => `= ${s1 || s2}`);
|
package/dist/vite.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unplugin-isolated-decl",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.2",
|
|
4
4
|
"description": "A blazing-fast tool for generating isolated declarations.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -66,33 +66,33 @@
|
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"debug": "^4.4.0",
|
|
68
68
|
"magic-string": "^0.30.17",
|
|
69
|
-
"oxc-parser": "^0.
|
|
70
|
-
"unplugin": "^2.
|
|
71
|
-
"unplugin-utils": "^0.2.
|
|
69
|
+
"oxc-parser": "^0.51.0",
|
|
70
|
+
"unplugin": "^2.2.0",
|
|
71
|
+
"unplugin-utils": "^0.2.4"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@farmfe/core": "^1.6.6",
|
|
75
|
-
"@oxc-project/types": "^0.
|
|
75
|
+
"@oxc-project/types": "^0.51.0",
|
|
76
76
|
"@rollup/plugin-alias": "^5.1.1",
|
|
77
|
-
"@swc/core": "^1.10.
|
|
78
|
-
"@sxzz/eslint-config": "^5.
|
|
79
|
-
"@sxzz/prettier-config": "^2.
|
|
77
|
+
"@swc/core": "^1.10.16",
|
|
78
|
+
"@sxzz/eslint-config": "^5.1.1",
|
|
79
|
+
"@sxzz/prettier-config": "^2.2.0",
|
|
80
80
|
"@sxzz/test-utils": "^0.5.1",
|
|
81
81
|
"@types/debug": "^4.1.12",
|
|
82
|
-
"@types/node": "^22.13.
|
|
83
|
-
"bumpp": "^10.0.
|
|
84
|
-
"esbuild": "^0.
|
|
85
|
-
"eslint": "^9.
|
|
82
|
+
"@types/node": "^22.13.4",
|
|
83
|
+
"bumpp": "^10.0.3",
|
|
84
|
+
"esbuild": "^0.25.0",
|
|
85
|
+
"eslint": "^9.20.1",
|
|
86
86
|
"fast-glob": "^3.3.3",
|
|
87
|
-
"oxc-transform": "^0.
|
|
88
|
-
"prettier": "^3.
|
|
87
|
+
"oxc-transform": "^0.51.0",
|
|
88
|
+
"prettier": "^3.5.1",
|
|
89
89
|
"rolldown": "^1.0.0-beta.3",
|
|
90
|
-
"rollup": "^4.34.
|
|
91
|
-
"rollup-plugin-esbuild": "^6.2.0",
|
|
90
|
+
"rollup": "^4.34.8",
|
|
92
91
|
"tinyglobby": "^0.2.10",
|
|
93
|
-
"tsdown": "^0.5.
|
|
92
|
+
"tsdown": "^0.5.9",
|
|
94
93
|
"tsx": "^4.19.2",
|
|
95
94
|
"typescript": "^5.7.3",
|
|
95
|
+
"unplugin-oxc": "^0.2.4",
|
|
96
96
|
"vite": "^6.1.0",
|
|
97
97
|
"vitest": "^3.0.5"
|
|
98
98
|
},
|
|
@@ -100,6 +100,10 @@
|
|
|
100
100
|
"node": ">=18.12.0"
|
|
101
101
|
},
|
|
102
102
|
"prettier": "@sxzz/prettier-config",
|
|
103
|
+
"resolutions": {
|
|
104
|
+
"@changesets/cli": "-",
|
|
105
|
+
"unplugin-isolated-decl": "-"
|
|
106
|
+
},
|
|
103
107
|
"scripts": {
|
|
104
108
|
"lint": "eslint --cache .",
|
|
105
109
|
"lint:fix": "pnpm run lint --fix",
|