unplugin-isolated-decl 0.6.3 → 0.6.4

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.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const require_src_index = require('./src_index-G1xVigYS.cjs');
2
+ const require_src_index = require('./src_index-aktHg0-4.cjs');
3
3
  require('./transformer-9aaNC01N.cjs');
4
4
 
5
5
  //#region src/esbuild.ts
package/dist/esbuild.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./transformer-GSFmnEOV.js";
2
- import { IsolatedDecl } from "./src_index-KJ4J0Bno.js";
2
+ import { IsolatedDecl } from "./src_index--re26uDb.js";
3
3
 
4
4
  //#region src/esbuild.ts
5
5
  var esbuild_default = IsolatedDecl.esbuild;
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const require_src_index = require('./src_index-G1xVigYS.cjs');
2
+ const require_src_index = require('./src_index-aktHg0-4.cjs');
3
3
  require('./transformer-9aaNC01N.cjs');
4
4
 
5
5
  Object.defineProperty(exports, 'IsolatedDecl', {
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import "./transformer-GSFmnEOV.js";
2
- import { IsolatedDecl, lowestCommonAncestor } from "./src_index-KJ4J0Bno.js";
2
+ import { IsolatedDecl, lowestCommonAncestor } from "./src_index--re26uDb.js";
3
3
 
4
4
  export { IsolatedDecl, lowestCommonAncestor };
package/dist/rolldown.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const require_src_index = require('./src_index-G1xVigYS.cjs');
2
+ const require_src_index = require('./src_index-aktHg0-4.cjs');
3
3
  require('./transformer-9aaNC01N.cjs');
4
4
 
5
5
  //#region src/rolldown.ts
package/dist/rolldown.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./transformer-GSFmnEOV.js";
2
- import { IsolatedDecl } from "./src_index-KJ4J0Bno.js";
2
+ import { IsolatedDecl } from "./src_index--re26uDb.js";
3
3
 
4
4
  //#region src/rolldown.ts
5
5
  var rolldown_default = IsolatedDecl.rolldown;
package/dist/rollup.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const require_src_index = require('./src_index-G1xVigYS.cjs');
2
+ const require_src_index = require('./src_index-aktHg0-4.cjs');
3
3
  require('./transformer-9aaNC01N.cjs');
4
4
 
5
5
  //#region src/rollup.ts
package/dist/rollup.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./transformer-GSFmnEOV.js";
2
- import { IsolatedDecl } from "./src_index-KJ4J0Bno.js";
2
+ import { IsolatedDecl } from "./src_index--re26uDb.js";
3
3
 
4
4
  //#region src/rollup.ts
5
5
  var rollup_default = IsolatedDecl.rollup;
@@ -9,7 +9,7 @@ import { createUnplugin } from "unplugin";
9
9
  //#region src/core/options.ts
10
10
  function resolveOptions(options) {
11
11
  return {
12
- include: options.include || [/\.[cm]?ts$/],
12
+ include: options.include || [/\.[cm]?tsx?$/],
13
13
  exclude: options.exclude || [/node_modules/],
14
14
  enforce: "enforce" in options ? options.enforce : "pre",
15
15
  transformer: options.transformer || "typescript",
@@ -39,7 +39,7 @@ const IsolatedDecl = createUnplugin((rawOptions = {}) => {
39
39
  if (typeof outputOptions.entryFileNames !== "string") {
40
40
  return this.error("entryFileNames must be a string");
41
41
  }
42
- let entryFileNames = outputOptions.entryFileNames.replace(/\.(.)?[jt]s$/, (_, s) => `.d.${s || ""}ts`);
42
+ let entryFileNames = outputOptions.entryFileNames.replace(/\.(.)?[jt]sx?$/, (_, s) => `.d.${s || ""}ts`);
43
43
  if (options.extraOutdir) {
44
44
  entryFileNames = path.join(options.extraOutdir, entryFileNames);
45
45
  }
@@ -86,7 +86,7 @@ const IsolatedDecl = createUnplugin((rawOptions = {}) => {
86
86
  }
87
87
  const resolved = await resolve(context, i.source.value, id);
88
88
  if (!resolved || resolved.external) continue;
89
- if (resolved.id.endsWith(".ts")) {
89
+ if (resolved.id.endsWith(".ts") || resolved.id.endsWith(".tsx")) {
90
90
  s.overwrite(i.source.start, i.source.end, JSON.stringify(`${i.source.value}.js`));
91
91
  }
92
92
  }
@@ -210,7 +210,7 @@ async function resolve(context, id, importer) {
210
210
  };
211
211
  }
212
212
  function stripExt(filename) {
213
- return filename.replace(/\.(.?)[jt]s$/, "");
213
+ return filename.replace(/\.(.?)[jt]sx?$/, "");
214
214
  }
215
215
  function patchCjsDefaultExport(source) {
216
216
  return source.replace(/(?<=(?:[;}]|^)\s*export\s*)(?:\{\s*([\w$]+)\s*as\s+default\s*\}|default\s+([\w$]+))/, (_, s1, s2) => `= ${s1 || s2}`);
@@ -33,7 +33,7 @@ const { createUnplugin } = __toESM(require("unplugin"));
33
33
  //#region src/core/options.ts
34
34
  function resolveOptions(options) {
35
35
  return {
36
- include: options.include || [/\.[cm]?ts$/],
36
+ include: options.include || [/\.[cm]?tsx?$/],
37
37
  exclude: options.exclude || [/node_modules/],
38
38
  enforce: "enforce" in options ? options.enforce : "pre",
39
39
  transformer: options.transformer || "typescript",
@@ -63,7 +63,7 @@ const IsolatedDecl = createUnplugin((rawOptions = {}) => {
63
63
  if (typeof outputOptions.entryFileNames !== "string") {
64
64
  return this.error("entryFileNames must be a string");
65
65
  }
66
- let entryFileNames = outputOptions.entryFileNames.replace(/\.(.)?[jt]s$/, (_, s) => `.d.${s || ""}ts`);
66
+ let entryFileNames = outputOptions.entryFileNames.replace(/\.(.)?[jt]sx?$/, (_, s) => `.d.${s || ""}ts`);
67
67
  if (options.extraOutdir) {
68
68
  entryFileNames = path.join(options.extraOutdir, entryFileNames);
69
69
  }
@@ -110,7 +110,7 @@ const IsolatedDecl = createUnplugin((rawOptions = {}) => {
110
110
  }
111
111
  const resolved = await resolve(context, i.source.value, id);
112
112
  if (!resolved || resolved.external) continue;
113
- if (resolved.id.endsWith(".ts")) {
113
+ if (resolved.id.endsWith(".ts") || resolved.id.endsWith(".tsx")) {
114
114
  s.overwrite(i.source.start, i.source.end, JSON.stringify(`${i.source.value}.js`));
115
115
  }
116
116
  }
@@ -234,7 +234,7 @@ async function resolve(context, id, importer) {
234
234
  };
235
235
  }
236
236
  function stripExt(filename) {
237
- return filename.replace(/\.(.?)[jt]s$/, "");
237
+ return filename.replace(/\.(.?)[jt]sx?$/, "");
238
238
  }
239
239
  function patchCjsDefaultExport(source) {
240
240
  return source.replace(/(?<=(?:[;}]|^)\s*export\s*)(?:\{\s*([\w$]+)\s*as\s+default\s*\}|default\s+([\w$]+))/, (_, s1, s2) => `= ${s1 || s2}`);
package/dist/vite.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const require_src_index = require('./src_index-G1xVigYS.cjs');
2
+ const require_src_index = require('./src_index-aktHg0-4.cjs');
3
3
  require('./transformer-9aaNC01N.cjs');
4
4
 
5
5
  //#region src/vite.ts
package/dist/vite.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./transformer-GSFmnEOV.js";
2
- import { IsolatedDecl } from "./src_index-KJ4J0Bno.js";
2
+ import { IsolatedDecl } from "./src_index--re26uDb.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.6.3",
3
+ "version": "0.6.4",
4
4
  "description": "A blazing-fast tool for generating isolated declarations, powered by Oxc.",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -94,7 +94,7 @@
94
94
  "@sxzz/eslint-config": "^4.2.0",
95
95
  "@sxzz/prettier-config": "^2.0.2",
96
96
  "@types/node": "^22.5.5",
97
- "@typescript-eslint/typescript-estree": "^8.5.0",
97
+ "@typescript-eslint/typescript-estree": "^8.6.0",
98
98
  "bumpp": "^9.5.2",
99
99
  "esbuild": "^0.23.1",
100
100
  "eslint": "^9.10.0",
@@ -107,7 +107,7 @@
107
107
  "tsdown": "^0.2.16",
108
108
  "tsx": "^4.19.1",
109
109
  "typescript": "^5.6.2",
110
- "vite": "^5.4.5",
110
+ "vite": "^5.4.6",
111
111
  "vitest": "^2.1.1"
112
112
  },
113
113
  "engines": {