unplugin-isolated-decl 0.10.3 → 0.10.5

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-CrkAX05M.cjs');
1
+ const require_transformer = require('./transformer-DzpBM_tn.cjs');
2
2
 
3
3
  exports.oxcTransform = require_transformer.oxcTransform
4
4
  exports.swcTransform = require_transformer.swcTransform
package/dist/esbuild.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- require('./transformer-CrkAX05M.cjs');
3
- const require_src = require('./src-DtumN0wK.cjs');
2
+ require('./transformer-DzpBM_tn.cjs');
3
+ const require_src = require('./src-CiuRRYoo.cjs');
4
4
 
5
5
  //#region src/esbuild.ts
6
6
  var esbuild_default = require_src.IsolatedDecl.esbuild;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @module
5
5
  */
6
- import { IsolatedDecl } from './index/index.cjs';
6
+ import { IsolatedDecl } from './index.cjs';
7
7
  /**
8
8
  * Esbuild plugin
9
9
  *
package/dist/esbuild.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @module
5
5
  */
6
- import { IsolatedDecl } from './index/index.js';
6
+ import { IsolatedDecl } from './index.js';
7
7
  /**
8
8
  * Esbuild plugin
9
9
  *
package/dist/esbuild.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./transformer-CBYRFUWY.js";
2
- import { IsolatedDecl } from "./src-B4J-UQpz.js";
2
+ import { IsolatedDecl } from "./src-DJODA3hJ.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-CrkAX05M.cjs');
3
- const require_src = require('./src-DtumN0wK.cjs');
2
+ require('./transformer-DzpBM_tn.cjs');
3
+ const require_src = require('./src-CiuRRYoo.cjs');
4
4
 
5
5
  //#region src/farm.ts
6
6
  var farm_default = require_src.IsolatedDecl.farm;
package/dist/farm.d.cts CHANGED
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @module
5
5
  */
6
- import { IsolatedDecl } from './index/index.cjs';
6
+ import { IsolatedDecl } from './index.cjs';
7
7
  /**
8
8
  * Farm plugin
9
9
  *
package/dist/farm.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @module
5
5
  */
6
- import { IsolatedDecl } from './index/index.js';
6
+ import { IsolatedDecl } from './index.js';
7
7
  /**
8
8
  * Farm plugin
9
9
  *
package/dist/farm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./transformer-CBYRFUWY.js";
2
- import { IsolatedDecl } from "./src-B4J-UQpz.js";
2
+ import { IsolatedDecl } from "./src-DJODA3hJ.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-CrkAX05M.cjs');
2
- const require_src = require('./src-DtumN0wK.cjs');
1
+ require('./transformer-DzpBM_tn.cjs');
2
+ const require_src = require('./src-CiuRRYoo.cjs');
3
3
 
4
4
  exports.IsolatedDecl = require_src.IsolatedDecl
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import "./transformer-CBYRFUWY.js";
2
- import { IsolatedDecl } from "./src-B4J-UQpz.js";
2
+ import { IsolatedDecl } from "./src-DJODA3hJ.js";
3
3
 
4
4
  export { IsolatedDecl };
package/dist/rolldown.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- require('./transformer-CrkAX05M.cjs');
3
- const require_src = require('./src-DtumN0wK.cjs');
2
+ require('./transformer-DzpBM_tn.cjs');
3
+ const require_src = require('./src-CiuRRYoo.cjs');
4
4
 
5
5
  //#region src/rolldown.ts
6
6
  var rolldown_default = require_src.IsolatedDecl.rolldown;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @module
5
5
  */
6
- import { IsolatedDecl } from './index/index.cjs';
6
+ import { IsolatedDecl } from './index.cjs';
7
7
  /**
8
8
  * Rolldown plugin
9
9
  *
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @module
5
5
  */
6
- import { IsolatedDecl } from './index/index.js';
6
+ import { IsolatedDecl } from './index.js';
7
7
  /**
8
8
  * Rolldown plugin
9
9
  *
package/dist/rolldown.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./transformer-CBYRFUWY.js";
2
- import { IsolatedDecl } from "./src-B4J-UQpz.js";
2
+ import { IsolatedDecl } from "./src-DJODA3hJ.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-CrkAX05M.cjs');
3
- const require_src = require('./src-DtumN0wK.cjs');
2
+ require('./transformer-DzpBM_tn.cjs');
3
+ const require_src = require('./src-CiuRRYoo.cjs');
4
4
 
5
5
  //#region src/rollup.ts
6
6
  var rollup_default = require_src.IsolatedDecl.rollup;
package/dist/rollup.d.cts CHANGED
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @module
5
5
  */
6
- import { IsolatedDecl } from './index/index.cjs';
6
+ import { IsolatedDecl } from './index.cjs';
7
7
  /**
8
8
  * Rollup plugin
9
9
  *
package/dist/rollup.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @module
5
5
  */
6
- import { IsolatedDecl } from './index/index.js';
6
+ import { IsolatedDecl } from './index.js';
7
7
  /**
8
8
  * Rollup plugin
9
9
  *
package/dist/rollup.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./transformer-CBYRFUWY.js";
2
- import { IsolatedDecl } from "./src-B4J-UQpz.js";
2
+ import { IsolatedDecl } from "./src-DJODA3hJ.js";
3
3
 
4
4
  //#region src/rollup.ts
5
5
  var rollup_default = IsolatedDecl.rollup;
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const require_transformer = require('./transformer-CrkAX05M.cjs');
2
+ const require_transformer = require('./transformer-DzpBM_tn.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"));
@@ -42,7 +42,7 @@ function resolveEntry(input, userInputBase) {
42
42
  };
43
43
  }
44
44
  function endsWithIndex(s) {
45
- return /(?:^|[/\\])index\..+$/.test(s);
45
+ return /(?:^|[/\\])index(?:\..+)?$/.test(s);
46
46
  }
47
47
  function shouldAddIndex(id, resolved) {
48
48
  return !endsWithIndex(id) && endsWithIndex(resolved);
@@ -1,5 +1,5 @@
1
1
  import { appendMapUrl, generateDtsMap, oxcTransform, swcTransform, tsTransform } from "./transformer-CBYRFUWY.js";
2
- import path, { default as path$1, default as path$2 } from "node:path";
2
+ import path from "node:path";
3
3
  import { mkdir, readFile, writeFile } from "node:fs/promises";
4
4
  import { createFilter } from "@rollup/pluginutils";
5
5
  import MagicString from "magic-string";
@@ -11,7 +11,7 @@ import Debug from "debug";
11
11
  const debug = Debug("unplugin-isolated-decl");
12
12
  function lowestCommonAncestor(...filepaths) {
13
13
  if (filepaths.length === 0) return "";
14
- if (filepaths.length === 1) return path$2.dirname(filepaths[0]);
14
+ if (filepaths.length === 1) return path.dirname(filepaths[0]);
15
15
  filepaths = filepaths.map((p) => p.replaceAll("\\", "/"));
16
16
  const [first, ...rest] = filepaths;
17
17
  let ancestor = first.split("/");
@@ -32,7 +32,7 @@ function stripExt(filename) {
32
32
  }
33
33
  function resolveEntry(input, userInputBase) {
34
34
  if (typeof input === "string") input = [input];
35
- const entryMap = !Array.isArray(input) ? Object.fromEntries(Object.entries(input).map(([k, v]) => [path$2.resolve(stripExt(v)), k])) : undefined;
35
+ const entryMap = !Array.isArray(input) ? Object.fromEntries(Object.entries(input).map(([k, v]) => [path.resolve(stripExt(v)), k])) : undefined;
36
36
  const arr = Array.isArray(input) && input ? input : Object.values(input);
37
37
  const inputBase = userInputBase || lowestCommonAncestor(...arr);
38
38
  return {
@@ -41,7 +41,7 @@ function resolveEntry(input, userInputBase) {
41
41
  };
42
42
  }
43
43
  function endsWithIndex(s) {
44
- return /(?:^|[/\\])index\..+$/.test(s);
44
+ return /(?:^|[/\\])index(?:\..+)?$/.test(s);
45
45
  }
46
46
  function shouldAddIndex(id, resolved) {
47
47
  return !endsWithIndex(id) && endsWithIndex(resolved);
@@ -53,30 +53,30 @@ function filterImports(program) {
53
53
  return program.body.filter((node) => (node.type === "ImportDeclaration" || node.type === "ExportAllDeclaration" || node.type === "ExportNamedDeclaration") && !!node.source);
54
54
  }
55
55
  function rewriteImports(s, imports, entryMap, inputBase, entryFileNames, srcFilename) {
56
- const srcRel = path$1.relative(inputBase, srcFilename);
57
- const srcDir = path$1.dirname(srcFilename);
58
- const srcDirRel = path$1.relative(inputBase, srcDir);
56
+ const srcRel = path.relative(inputBase, srcFilename);
57
+ const srcDir = path.dirname(srcFilename);
58
+ const srcDirRel = path.relative(inputBase, srcDir);
59
59
  let entryAlias = entryMap?.[srcFilename];
60
- if (entryAlias && path$1.normalize(entryAlias) === srcRel) entryAlias = undefined;
60
+ if (entryAlias && path.normalize(entryAlias) === srcRel) entryAlias = undefined;
61
61
  const entry = entryAlias || srcRel;
62
62
  const resolvedEntry = entryFileNames.replaceAll("[name]", entry);
63
- const emitDir = path$1.dirname(resolvedEntry);
63
+ const emitDir = path.dirname(resolvedEntry);
64
64
  const emitDtsName = resolvedEntry.replace(/\.(.)?[jt]sx?$/, (_, s$1) => `.d.${s$1 || ""}ts`);
65
- const offset = path$1.relative(emitDir, srcDirRel);
65
+ const offset = path.relative(emitDir, srcDirRel);
66
66
  for (const i of imports) {
67
67
  const { source } = i;
68
68
  let srcIdRel = source.value;
69
69
  if (srcIdRel[0] !== ".") continue;
70
70
  if (i.shouldAddIndex) srcIdRel += "/index";
71
- const srcId = path$1.resolve(srcDir, srcIdRel);
71
+ const srcId = path.resolve(srcDir, srcIdRel);
72
72
  const importAlias = entryMap?.[stripExt(srcId)];
73
73
  let id;
74
74
  if (importAlias) {
75
75
  const resolved = entryFileNames.replaceAll("[name]", stripExt(importAlias));
76
76
  id = pathRelative(srcDirRel, resolved);
77
77
  } else id = entryFileNames.replaceAll("[name]", stripExt(srcIdRel));
78
- let final = path$1.normalize(path$1.join(offset, id));
79
- if (final !== path$1.normalize(source.value)) {
78
+ let final = path.normalize(path.join(offset, id));
79
+ if (final !== path.normalize(source.value)) {
80
80
  debug("Patch import in", srcRel, ":", srcIdRel, "->", final);
81
81
  final = final.replaceAll("\\", "/");
82
82
  if (final.startsWith("/")) final = `.${final}`;
@@ -87,7 +87,7 @@ function rewriteImports(s, imports, entryMap, inputBase, entryFileNames, srcFile
87
87
  return emitDtsName;
88
88
  }
89
89
  function pathRelative(from, to) {
90
- return path$1.join(path$1.relative(from, path$1.dirname(to)), path$1.basename(to));
90
+ return path.join(path.relative(from, path.dirname(to)), path.basename(to));
91
91
  }
92
92
 
93
93
  //#endregion
@@ -129,27 +129,32 @@ Object.defineProperty(exports, '__toESM', {
129
129
  get: function () {
130
130
  return __toESM;
131
131
  }
132
- });Object.defineProperty(exports, 'appendMapUrl', {
132
+ });
133
+ Object.defineProperty(exports, 'appendMapUrl', {
133
134
  enumerable: true,
134
135
  get: function () {
135
136
  return appendMapUrl;
136
137
  }
137
- });Object.defineProperty(exports, 'generateDtsMap', {
138
+ });
139
+ Object.defineProperty(exports, 'generateDtsMap', {
138
140
  enumerable: true,
139
141
  get: function () {
140
142
  return generateDtsMap;
141
143
  }
142
- });Object.defineProperty(exports, 'oxcTransform', {
144
+ });
145
+ Object.defineProperty(exports, 'oxcTransform', {
143
146
  enumerable: true,
144
147
  get: function () {
145
148
  return oxcTransform;
146
149
  }
147
- });Object.defineProperty(exports, 'swcTransform', {
150
+ });
151
+ Object.defineProperty(exports, 'swcTransform', {
148
152
  enumerable: true,
149
153
  get: function () {
150
154
  return swcTransform;
151
155
  }
152
- });Object.defineProperty(exports, 'tsTransform', {
156
+ });
157
+ Object.defineProperty(exports, 'tsTransform', {
153
158
  enumerable: true,
154
159
  get: function () {
155
160
  return tsTransform;
package/dist/vite.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- require('./transformer-CrkAX05M.cjs');
3
- const require_src = require('./src-DtumN0wK.cjs');
2
+ require('./transformer-DzpBM_tn.cjs');
3
+ const require_src = require('./src-CiuRRYoo.cjs');
4
4
 
5
5
  //#region src/vite.ts
6
6
  var vite_default = require_src.IsolatedDecl.vite;
package/dist/vite.d.cts CHANGED
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @module
5
5
  */
6
- import { IsolatedDecl } from './index/index.cjs';
6
+ import { IsolatedDecl } from './index.cjs';
7
7
  /**
8
8
  * Vite plugin
9
9
  *
package/dist/vite.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @module
5
5
  */
6
- import { IsolatedDecl } from './index/index.js';
6
+ import { IsolatedDecl } from './index.js';
7
7
  /**
8
8
  * Vite plugin
9
9
  *
package/dist/vite.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./transformer-CBYRFUWY.js";
2
- import { IsolatedDecl } from "./src-B4J-UQpz.js";
2
+ import { IsolatedDecl } from "./src-DJODA3hJ.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.3",
3
+ "version": "0.10.5",
4
4
  "description": "A blazing-fast tool for generating isolated declarations.",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -91,33 +91,33 @@
91
91
  "@rollup/pluginutils": "^5.1.4",
92
92
  "debug": "^4.4.0",
93
93
  "magic-string": "^0.30.17",
94
- "oxc-parser": "^0.43.0",
95
- "unplugin": "^2.1.0"
94
+ "oxc-parser": "^0.45.0",
95
+ "unplugin": "^2.1.2"
96
96
  },
97
97
  "devDependencies": {
98
- "@farmfe/core": "^1.6.0",
99
- "@oxc-project/types": "^0.43.0",
98
+ "@farmfe/core": "^1.6.4",
99
+ "@oxc-project/types": "^0.45.0",
100
100
  "@rollup/plugin-alias": "^5.1.1",
101
- "@swc/core": "^1.10.1",
102
- "@sxzz/eslint-config": "^4.5.1",
101
+ "@swc/core": "^1.10.7",
102
+ "@sxzz/eslint-config": "^4.6.0",
103
103
  "@sxzz/prettier-config": "^2.0.2",
104
104
  "@sxzz/test-utils": "^0.3.11",
105
105
  "@types/debug": "^4.1.12",
106
- "@types/node": "^22.10.2",
107
- "bumpp": "^9.9.2",
106
+ "@types/node": "^22.10.5",
107
+ "bumpp": "^9.10.0",
108
108
  "esbuild": "^0.24.2",
109
- "eslint": "^9.17.0",
110
- "fast-glob": "^3.3.2",
111
- "oxc-transform": "^0.43.0",
109
+ "eslint": "^9.18.0",
110
+ "fast-glob": "^3.3.3",
111
+ "oxc-transform": "^0.45.0",
112
112
  "prettier": "^3.4.2",
113
- "rolldown": "nightly",
114
- "rollup": "^4.29.1",
113
+ "rolldown": "^1.0.0-beta.1",
114
+ "rollup": "^4.30.1",
115
115
  "rollup-plugin-esbuild": "^6.1.1",
116
116
  "tinyglobby": "^0.2.10",
117
- "tsdown": "^0.5.2",
117
+ "tsdown": "^0.5.3",
118
118
  "tsx": "^4.19.2",
119
- "typescript": "^5.7.2",
120
- "vite": "^6.0.5",
119
+ "typescript": "^5.7.3",
120
+ "vite": "^6.0.7",
121
121
  "vitest": "^2.1.8"
122
122
  },
123
123
  "engines": {