unplugin-isolated-decl 0.10.2 → 0.10.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.
package/dist/api.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const require_transformer = require('./transformer-ApyMa6QO.cjs');
1
+ const require_transformer = require('./transformer-CrkAX05M.cjs');
2
2
 
3
3
  exports.oxcTransform = require_transformer.oxcTransform
4
4
  exports.swcTransform = require_transformer.swcTransform
package/dist/api.js CHANGED
@@ -1,3 +1,3 @@
1
- import { oxcTransform, swcTransform, tsTransform } from "./transformer-CHqAqBjB.js";
1
+ import { oxcTransform, swcTransform, tsTransform } from "./transformer-CBYRFUWY.js";
2
2
 
3
3
  export { oxcTransform, swcTransform, tsTransform };
@@ -1,4 +1,3 @@
1
- import type { OptionsResolved } from './options.cjs';
2
1
  import type * as OxcTypes from '@oxc-project/types';
3
2
  import type MagicString from 'magic-string';
4
3
  export type OxcImport = (OxcTypes.ImportDeclaration | OxcTypes.ExportAllDeclaration | OxcTypes.ExportNamedDeclaration) & {
@@ -6,4 +5,4 @@ export type OxcImport = (OxcTypes.ImportDeclaration | OxcTypes.ExportAllDeclarat
6
5
  shouldAddIndex?: boolean;
7
6
  };
8
7
  export declare function filterImports(program: OxcTypes.Program): OxcImport[];
9
- export declare function rewriteImports(s: MagicString, options: OptionsResolved, imports: OxcImport[], entryMap: Record<string, string> | undefined, inputBase: string, entryFileNames: string, srcFilename: string): string;
8
+ export declare function rewriteImports(s: MagicString, imports: OxcImport[], entryMap: Record<string, string> | undefined, inputBase: string, entryFileNames: string, srcFilename: string): string;
@@ -1,4 +1,3 @@
1
- import type { OptionsResolved } from './options.js';
2
1
  import type * as OxcTypes from '@oxc-project/types';
3
2
  import type MagicString from 'magic-string';
4
3
  export type OxcImport = (OxcTypes.ImportDeclaration | OxcTypes.ExportAllDeclaration | OxcTypes.ExportNamedDeclaration) & {
@@ -6,4 +5,4 @@ export type OxcImport = (OxcTypes.ImportDeclaration | OxcTypes.ExportAllDeclarat
6
5
  shouldAddIndex?: boolean;
7
6
  };
8
7
  export declare function filterImports(program: OxcTypes.Program): OxcImport[];
9
- export declare function rewriteImports(s: MagicString, options: OptionsResolved, imports: OxcImport[], entryMap: Record<string, string> | undefined, inputBase: string, entryFileNames: string, srcFilename: string): string;
8
+ export declare function rewriteImports(s: MagicString, imports: OxcImport[], entryMap: Record<string, string> | undefined, inputBase: string, entryFileNames: string, srcFilename: string): string;
package/dist/esbuild.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- require('./transformer-ApyMa6QO.cjs');
3
- const require_src = require('./src-h7U2Vqcv.cjs');
2
+ require('./transformer-CrkAX05M.cjs');
3
+ const require_src = require('./src-DtumN0wK.cjs');
4
4
 
5
5
  //#region src/esbuild.ts
6
6
  var esbuild_default = require_src.IsolatedDecl.esbuild;
package/dist/esbuild.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./transformer-CHqAqBjB.js";
2
- import { IsolatedDecl } from "./src-Yy6QF_tM.js";
1
+ import "./transformer-CBYRFUWY.js";
2
+ import { IsolatedDecl } from "./src-B4J-UQpz.js";
3
3
 
4
4
  //#region src/esbuild.ts
5
5
  var esbuild_default = IsolatedDecl.esbuild;
package/dist/farm.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- require('./transformer-ApyMa6QO.cjs');
3
- const require_src = require('./src-h7U2Vqcv.cjs');
2
+ require('./transformer-CrkAX05M.cjs');
3
+ const require_src = require('./src-DtumN0wK.cjs');
4
4
 
5
5
  //#region src/farm.ts
6
6
  var farm_default = require_src.IsolatedDecl.farm;
package/dist/farm.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./transformer-CHqAqBjB.js";
2
- import { IsolatedDecl } from "./src-Yy6QF_tM.js";
1
+ import "./transformer-CBYRFUWY.js";
2
+ import { IsolatedDecl } from "./src-B4J-UQpz.js";
3
3
 
4
4
  //#region src/farm.ts
5
5
  var farm_default = IsolatedDecl.farm;
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- require('./transformer-ApyMa6QO.cjs');
2
- const require_src = require('./src-h7U2Vqcv.cjs');
1
+ require('./transformer-CrkAX05M.cjs');
2
+ const require_src = require('./src-DtumN0wK.cjs');
3
3
 
4
4
  exports.IsolatedDecl = require_src.IsolatedDecl
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import "./transformer-CHqAqBjB.js";
2
- import { IsolatedDecl } from "./src-Yy6QF_tM.js";
1
+ import "./transformer-CBYRFUWY.js";
2
+ import { IsolatedDecl } from "./src-B4J-UQpz.js";
3
3
 
4
4
  export { IsolatedDecl };
package/dist/rolldown.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- require('./transformer-ApyMa6QO.cjs');
3
- const require_src = require('./src-h7U2Vqcv.cjs');
2
+ require('./transformer-CrkAX05M.cjs');
3
+ const require_src = require('./src-DtumN0wK.cjs');
4
4
 
5
5
  //#region src/rolldown.ts
6
6
  var rolldown_default = require_src.IsolatedDecl.rolldown;
package/dist/rolldown.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./transformer-CHqAqBjB.js";
2
- import { IsolatedDecl } from "./src-Yy6QF_tM.js";
1
+ import "./transformer-CBYRFUWY.js";
2
+ import { IsolatedDecl } from "./src-B4J-UQpz.js";
3
3
 
4
4
  //#region src/rolldown.ts
5
5
  var rolldown_default = IsolatedDecl.rolldown;
package/dist/rollup.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- require('./transformer-ApyMa6QO.cjs');
3
- const require_src = require('./src-h7U2Vqcv.cjs');
2
+ require('./transformer-CrkAX05M.cjs');
3
+ const require_src = require('./src-DtumN0wK.cjs');
4
4
 
5
5
  //#region src/rollup.ts
6
6
  var rollup_default = require_src.IsolatedDecl.rollup;
package/dist/rollup.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./transformer-CHqAqBjB.js";
2
- import { IsolatedDecl } from "./src-Yy6QF_tM.js";
1
+ import "./transformer-CBYRFUWY.js";
2
+ import { IsolatedDecl } from "./src-B4J-UQpz.js";
3
3
 
4
4
  //#region src/rollup.ts
5
5
  var rollup_default = IsolatedDecl.rollup;
@@ -1,4 +1,4 @@
1
- import { appendMapUrl, generateDtsMap, oxcTransform, swcTransform, tsTransform } from "./transformer-CHqAqBjB.js";
1
+ import { appendMapUrl, generateDtsMap, oxcTransform, swcTransform, tsTransform } from "./transformer-CBYRFUWY.js";
2
2
  import path, { default as path$1, default as path$2 } from "node:path";
3
3
  import { mkdir, readFile, writeFile } from "node:fs/promises";
4
4
  import { createFilter } from "@rollup/pluginutils";
@@ -52,7 +52,7 @@ function shouldAddIndex(id, resolved) {
52
52
  function filterImports(program) {
53
53
  return program.body.filter((node) => (node.type === "ImportDeclaration" || node.type === "ExportAllDeclaration" || node.type === "ExportNamedDeclaration") && !!node.source);
54
54
  }
55
- function rewriteImports(s, options, imports, entryMap, inputBase, entryFileNames, srcFilename) {
55
+ function rewriteImports(s, imports, entryMap, inputBase, entryFileNames, srcFilename) {
56
56
  const srcRel = path$1.relative(inputBase, srcFilename);
57
57
  const srcDir = path$1.dirname(srcFilename);
58
58
  const srcDirRel = path$1.relative(inputBase, srcDir);
@@ -219,7 +219,7 @@ else {
219
219
  const { entryFileNames = "[name].js", dir: outDir } = outputOptions;
220
220
  if (typeof entryFileNames !== "string") return this.error("entryFileNames must be a string");
221
221
  for (const [srcFilename, { s, imports, map, ext }] of Object.entries(outputFiles)) {
222
- let emitName = rewriteImports(s, options, imports, entryMap, inputBase, entryFileNames, srcFilename);
222
+ let emitName = rewriteImports(s, imports, entryMap, inputBase, entryFileNames, srcFilename);
223
223
  let source = s.toString();
224
224
  if (options.patchCjsDefaultExport && emitName.endsWith(".d.cts")) source = patchCjsDefaultExport(source);
225
225
  if (options.extraOutdir) emitName = path.join(options.extraOutdir || "", emitName);
@@ -256,7 +256,7 @@ else {
256
256
  output.entryFilename = output.entryFilename.replace("[ext]", extFormatMap.get(output.format || "esm") || "js");
257
257
  const entryFileNames = output.entryFilename;
258
258
  for (const [srcFilename, { s, imports, map, ext }] of Object.entries(outputFiles)) {
259
- let emitName = rewriteImports(s, options, imports, entryMap, inputBase, entryFileNames, srcFilename);
259
+ let emitName = rewriteImports(s, imports, entryMap, inputBase, entryFileNames, srcFilename);
260
260
  let source = s.toString();
261
261
  if (options.patchCjsDefaultExport && emitName.endsWith(".d.cts")) source = patchCjsDefaultExport(source);
262
262
  if (options.extraOutdir) emitName = path.join(options.extraOutdir || "", emitName);
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const require_transformer = require('./transformer-ApyMa6QO.cjs');
2
+ const require_transformer = require('./transformer-CrkAX05M.cjs');
3
3
  const node_path = require_transformer.__toESM(require("node:path"));
4
4
  const node_fs_promises = require_transformer.__toESM(require("node:fs/promises"));
5
5
  const __rollup_pluginutils = require_transformer.__toESM(require("@rollup/pluginutils"));
@@ -53,7 +53,7 @@ function shouldAddIndex(id, resolved) {
53
53
  function filterImports(program) {
54
54
  return program.body.filter((node) => (node.type === "ImportDeclaration" || node.type === "ExportAllDeclaration" || node.type === "ExportNamedDeclaration") && !!node.source);
55
55
  }
56
- function rewriteImports(s, options, imports, entryMap, inputBase, entryFileNames, srcFilename) {
56
+ function rewriteImports(s, imports, entryMap, inputBase, entryFileNames, srcFilename) {
57
57
  const srcRel = node_path.default.relative(inputBase, srcFilename);
58
58
  const srcDir = node_path.default.dirname(srcFilename);
59
59
  const srcDirRel = node_path.default.relative(inputBase, srcDir);
@@ -220,7 +220,7 @@ else {
220
220
  const { entryFileNames = "[name].js", dir: outDir } = outputOptions;
221
221
  if (typeof entryFileNames !== "string") return this.error("entryFileNames must be a string");
222
222
  for (const [srcFilename, { s, imports, map, ext }] of Object.entries(outputFiles)) {
223
- let emitName = rewriteImports(s, options, imports, entryMap, inputBase, entryFileNames, srcFilename);
223
+ let emitName = rewriteImports(s, imports, entryMap, inputBase, entryFileNames, srcFilename);
224
224
  let source = s.toString();
225
225
  if (options.patchCjsDefaultExport && emitName.endsWith(".d.cts")) source = patchCjsDefaultExport(source);
226
226
  if (options.extraOutdir) emitName = node_path.default.join(options.extraOutdir || "", emitName);
@@ -257,7 +257,7 @@ else {
257
257
  output.entryFilename = output.entryFilename.replace("[ext]", extFormatMap.get(output.format || "esm") || "js");
258
258
  const entryFileNames = output.entryFilename;
259
259
  for (const [srcFilename, { s, imports, map, ext }] of Object.entries(outputFiles)) {
260
- let emitName = rewriteImports(s, options, imports, entryMap, inputBase, entryFileNames, srcFilename);
260
+ let emitName = rewriteImports(s, imports, entryMap, inputBase, entryFileNames, srcFilename);
261
261
  let source = s.toString();
262
262
  if (options.patchCjsDefaultExport && emitName.endsWith(".d.cts")) source = patchCjsDefaultExport(source);
263
263
  if (options.extraOutdir) emitName = node_path.default.join(options.extraOutdir || "", emitName);
@@ -13,7 +13,8 @@ async function oxcTransform(id, code, sourceMap) {
13
13
  const result = oxc.isolatedDeclaration(id, code, { sourcemap: sourceMap });
14
14
  return {
15
15
  ...result,
16
- map: result.map?.mappings
16
+ map: result.map?.mappings,
17
+ errors: result.errors.map((error) => error.message)
17
18
  };
18
19
  }
19
20
  async function swcTransform(id, code) {
@@ -37,7 +37,8 @@ async function oxcTransform(id, code, sourceMap) {
37
37
  const result = oxc.isolatedDeclaration(id, code, { sourcemap: sourceMap });
38
38
  return {
39
39
  ...result,
40
- map: result.map?.mappings
40
+ map: result.map?.mappings,
41
+ errors: result.errors.map((error) => error.message)
41
42
  };
42
43
  }
43
44
  async function swcTransform(id, code) {
package/dist/vite.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- require('./transformer-ApyMa6QO.cjs');
3
- const require_src = require('./src-h7U2Vqcv.cjs');
2
+ require('./transformer-CrkAX05M.cjs');
3
+ const require_src = require('./src-DtumN0wK.cjs');
4
4
 
5
5
  //#region src/vite.ts
6
6
  var vite_default = require_src.IsolatedDecl.vite;
package/dist/vite.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./transformer-CHqAqBjB.js";
2
- import { IsolatedDecl } from "./src-Yy6QF_tM.js";
1
+ import "./transformer-CBYRFUWY.js";
2
+ import { IsolatedDecl } from "./src-B4J-UQpz.js";
3
3
 
4
4
  //#region src/vite.ts
5
5
  var vite_default = IsolatedDecl.vite;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unplugin-isolated-decl",
3
- "version": "0.10.2",
3
+ "version": "0.10.3",
4
4
  "description": "A blazing-fast tool for generating isolated declarations.",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -73,7 +73,7 @@
73
73
  },
74
74
  "peerDependencies": {
75
75
  "@swc/core": "^1.6.6",
76
- "oxc-transform": ">=0.28.0",
76
+ "oxc-transform": ">=0.42.0",
77
77
  "typescript": "^5.5.2"
78
78
  },
79
79
  "peerDependenciesMeta": {
@@ -88,36 +88,36 @@
88
88
  }
89
89
  },
90
90
  "dependencies": {
91
- "@rollup/pluginutils": "^5.1.3",
91
+ "@rollup/pluginutils": "^5.1.4",
92
92
  "debug": "^4.4.0",
93
- "magic-string": "^0.30.14",
94
- "oxc-parser": "^0.39.0",
95
- "unplugin": "^2.0.0"
93
+ "magic-string": "^0.30.17",
94
+ "oxc-parser": "^0.43.0",
95
+ "unplugin": "^2.1.0"
96
96
  },
97
97
  "devDependencies": {
98
- "@farmfe/core": "^1.4.7",
99
- "@oxc-project/types": "^0.39.0",
98
+ "@farmfe/core": "^1.6.0",
99
+ "@oxc-project/types": "^0.43.0",
100
100
  "@rollup/plugin-alias": "^5.1.1",
101
- "@swc/core": "^1.10.0",
101
+ "@swc/core": "^1.10.1",
102
102
  "@sxzz/eslint-config": "^4.5.1",
103
103
  "@sxzz/prettier-config": "^2.0.2",
104
- "@sxzz/test-utils": "^0.3.10",
104
+ "@sxzz/test-utils": "^0.3.11",
105
105
  "@types/debug": "^4.1.12",
106
- "@types/node": "^22.10.1",
107
- "bumpp": "^9.9.0",
108
- "esbuild": "^0.24.0",
109
- "eslint": "^9.16.0",
106
+ "@types/node": "^22.10.2",
107
+ "bumpp": "^9.9.2",
108
+ "esbuild": "^0.24.2",
109
+ "eslint": "^9.17.0",
110
110
  "fast-glob": "^3.3.2",
111
- "oxc-transform": "^0.39.0",
111
+ "oxc-transform": "^0.43.0",
112
112
  "prettier": "^3.4.2",
113
113
  "rolldown": "nightly",
114
- "rollup": "^4.28.1",
114
+ "rollup": "^4.29.1",
115
115
  "rollup-plugin-esbuild": "^6.1.1",
116
116
  "tinyglobby": "^0.2.10",
117
- "tsdown": "^0.4.4",
117
+ "tsdown": "^0.5.2",
118
118
  "tsx": "^4.19.2",
119
119
  "typescript": "^5.7.2",
120
- "vite": "^6.0.3",
120
+ "vite": "^6.0.5",
121
121
  "vitest": "^2.1.8"
122
122
  },
123
123
  "engines": {