unplugin-isolated-decl 0.15.5 → 0.15.7

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.
@@ -1 +1 @@
1
- export { oxcTransform, swcTransform, tsTransform } from "./core/transformer.js";
1
+ export { oxcTransform, swcTransform, tsTransform } from "./core/transformer.mjs";
package/dist/api.mjs ADDED
@@ -0,0 +1,3 @@
1
+ import { a as tsTransform, i as swcTransform, r as oxcTransform } from "./transformer-CDjTlq6t.mjs";
2
+
3
+ export { oxcTransform, swcTransform, tsTransform };
@@ -1,6 +1,6 @@
1
1
  import type { IsolatedDeclarationsOptions } from "oxc-transform";
2
2
  import type { TranspileOptions } from "typescript";
3
- import type { FilterPattern } from "unplugin-utils";
3
+ import type { FilterPattern } from "unplugin";
4
4
  /**
5
5
  * Represents the options for the plugin.
6
6
  */
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @module
5
5
  */
6
- import { IsolatedDecl } from "./index.js";
6
+ import { IsolatedDecl } from "./index.mjs";
7
7
  /**
8
8
  * Esbuild plugin
9
9
  *
@@ -1,5 +1,4 @@
1
- import "./transformer-DIxtVpUn.js";
2
- import { t as IsolatedDecl } from "./src-B1bL5Pcm.js";
1
+ import { t as IsolatedDecl } from "./src-BYD-yWlY.mjs";
3
2
 
4
3
  //#region src/esbuild.ts
5
4
  /**
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @module
5
5
  */
6
- import { IsolatedDecl } from "./index.js";
6
+ import { IsolatedDecl } from "./index.mjs";
7
7
  /**
8
8
  * Farm plugin
9
9
  *
@@ -1,5 +1,4 @@
1
- import "./transformer-DIxtVpUn.js";
2
- import { t as IsolatedDecl } from "./src-B1bL5Pcm.js";
1
+ import { t as IsolatedDecl } from "./src-BYD-yWlY.mjs";
3
2
 
4
3
  //#region src/farm.ts
5
4
  /**
@@ -1,5 +1,5 @@
1
1
  import { type UnpluginInstance } from "unplugin";
2
- import { type Options } from "./core/options.js";
2
+ import { type Options } from "./core/options.mjs";
3
3
  export type { Options };
4
4
  /**
5
5
  * The main unplugin instance.
package/dist/index.mjs ADDED
@@ -0,0 +1,3 @@
1
+ import { t as IsolatedDecl } from "./src-BYD-yWlY.mjs";
2
+
3
+ export { IsolatedDecl };
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @module
5
5
  */
6
- import { IsolatedDecl } from "./index.js";
6
+ import { IsolatedDecl } from "./index.mjs";
7
7
  /**
8
8
  * Rolldown plugin
9
9
  *
@@ -1,5 +1,4 @@
1
- import "./transformer-DIxtVpUn.js";
2
- import { t as IsolatedDecl } from "./src-B1bL5Pcm.js";
1
+ import { t as IsolatedDecl } from "./src-BYD-yWlY.mjs";
3
2
 
4
3
  //#region src/rolldown.ts
5
4
  /**
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @module
5
5
  */
6
- import { IsolatedDecl } from "./index.js";
6
+ import { IsolatedDecl } from "./index.mjs";
7
7
  /**
8
8
  * Rollup plugin
9
9
  *
@@ -1,5 +1,4 @@
1
- import "./transformer-DIxtVpUn.js";
2
- import { t as IsolatedDecl } from "./src-B1bL5Pcm.js";
1
+ import { t as IsolatedDecl } from "./src-BYD-yWlY.mjs";
3
2
 
4
3
  //#region src/rollup.ts
5
4
  /**
@@ -1,8 +1,8 @@
1
- import { a as tsTransform, i as swcTransform, n as generateDtsMap, r as oxcTransform, t as appendMapUrl } from "./transformer-DIxtVpUn.js";
1
+ import { a as tsTransform, i as swcTransform, n as generateDtsMap, r as oxcTransform, t as appendMapUrl } from "./transformer-CDjTlq6t.mjs";
2
2
  import path from "node:path";
3
3
  import { mkdir, readFile, writeFile } from "node:fs/promises";
4
4
  import MagicString from "magic-string";
5
- import { parseAsync } from "oxc-parser";
5
+ import { parse } from "oxc-parser";
6
6
  import { createUnplugin } from "unplugin";
7
7
  import { createFilter } from "unplugin-utils";
8
8
  import { createDebug } from "obug";
@@ -136,9 +136,14 @@ const IsolatedDecl = createUnplugin((rawOptions = {}) => {
136
136
  farmPluginContext = this;
137
137
  outputFiles = Object.create(null);
138
138
  },
139
- transformInclude: (id) => filter(id),
140
- transform(code, id) {
141
- return transform(this, code, id);
139
+ transform: {
140
+ filter: { id: {
141
+ include: options.include,
142
+ exclude: options.exclude
143
+ } },
144
+ handler(code, id) {
145
+ return transform(this, code, id);
146
+ }
142
147
  },
143
148
  esbuild: { setup: esbuildSetup },
144
149
  rollup,
@@ -175,7 +180,7 @@ const IsolatedDecl = createUnplugin((rawOptions = {}) => {
175
180
  context.error(errors[0]);
176
181
  return;
177
182
  }
178
- const { program } = await parseAsync(id, dts);
183
+ const { program } = await parse(id, dts);
179
184
  const imports = filterImports(program);
180
185
  const s = new MagicString(dts);
181
186
  for (const i of imports) {
@@ -13,7 +13,7 @@ async function oxcTransform(id, code, transformOptions) {
13
13
  code: "",
14
14
  errors: ["oxc-transform is required for transforming TypeScript, please install `oxc-transform`."]
15
15
  };
16
- const result = oxc.isolatedDeclaration(id, code, transformOptions);
16
+ const result = await oxc.isolatedDeclaration(id, code, transformOptions);
17
17
  return {
18
18
  ...result,
19
19
  map: result.map?.mappings,
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @module
5
5
  */
6
- import { IsolatedDecl } from "./index.js";
6
+ import { IsolatedDecl } from "./index.mjs";
7
7
  /**
8
8
  * Vite plugin
9
9
  *
@@ -1,5 +1,4 @@
1
- import "./transformer-DIxtVpUn.js";
2
- import { t as IsolatedDecl } from "./src-B1bL5Pcm.js";
1
+ import { t as IsolatedDecl } from "./src-BYD-yWlY.mjs";
3
2
 
4
3
  //#region src/vite.ts
5
4
  /**
package/package.json CHANGED
@@ -1,53 +1,56 @@
1
1
  {
2
2
  "name": "unplugin-isolated-decl",
3
- "version": "0.15.5",
4
- "description": "A blazing-fast tool for generating isolated declarations.",
5
3
  "type": "module",
6
- "keywords": [
7
- "unplugin",
8
- "rollup",
9
- "vite",
10
- "esbuild",
11
- "webpack"
12
- ],
4
+ "version": "0.15.7",
5
+ "description": "A blazing-fast tool for generating isolated declarations.",
6
+ "author": "Kevin Deng <sxzz@sxzz.moe>",
13
7
  "license": "MIT",
8
+ "funding": "https://github.com/sponsors/sxzz",
14
9
  "homepage": "https://github.com/unplugin/unplugin-isolated-decl#readme",
15
- "bugs": {
16
- "url": "https://github.com/unplugin/unplugin-isolated-decl/issues"
17
- },
18
10
  "repository": {
19
11
  "type": "git",
20
12
  "url": "git+https://github.com/unplugin/unplugin-isolated-decl.git"
21
13
  },
22
- "author": "Kevin Deng <sxzz@sxzz.moe>",
23
- "funding": "https://github.com/sponsors/sxzz",
24
- "files": [
25
- "dist"
14
+ "bugs": {
15
+ "url": "https://github.com/unplugin/unplugin-isolated-decl/issues"
16
+ },
17
+ "keywords": [
18
+ "unplugin",
19
+ "rollup",
20
+ "vite",
21
+ "esbuild",
22
+ "webpack"
26
23
  ],
27
- "main": "./dist/index.js",
28
- "module": "./dist/index.js",
29
- "types": "./dist/index.d.ts",
30
24
  "exports": {
31
- ".": "./dist/index.js",
32
- "./vite": "./dist/vite.js",
33
- "./rollup": "./dist/rollup.js",
34
- "./rolldown": "./dist/rolldown.js",
35
- "./esbuild": "./dist/esbuild.js",
36
- "./farm": "./dist/farm.js",
37
- "./api": "./dist/api.js",
38
- "./*": "./*"
25
+ ".": "./dist/index.mjs",
26
+ "./api": "./dist/api.mjs",
27
+ "./esbuild": "./dist/esbuild.mjs",
28
+ "./farm": "./dist/farm.mjs",
29
+ "./rolldown": "./dist/rolldown.mjs",
30
+ "./rollup": "./dist/rollup.mjs",
31
+ "./vite": "./dist/vite.mjs",
32
+ "./package.json": "./package.json"
39
33
  },
34
+ "main": "./dist/index.mjs",
35
+ "module": "./dist/index.mjs",
36
+ "types": "./dist/index.d.mts",
40
37
  "typesVersions": {
41
38
  "*": {
42
39
  "*": [
43
- "./dist/*",
40
+ "./dist/*.d.mts",
44
41
  "./*"
45
42
  ]
46
43
  }
47
44
  },
45
+ "files": [
46
+ "dist"
47
+ ],
48
48
  "publishConfig": {
49
49
  "access": "public"
50
50
  },
51
+ "engines": {
52
+ "node": ">=20.19.0"
53
+ },
51
54
  "peerDependencies": {
52
55
  "@swc/core": "^1.6.6",
53
56
  "typescript": "^5.5.2"
@@ -62,39 +65,36 @@
62
65
  },
63
66
  "dependencies": {
64
67
  "magic-string": "^0.30.21",
65
- "obug": "^2.0.0-beta.1",
66
- "oxc-parser": ">=0.97.0",
67
- "oxc-transform": ">=0.97.0",
68
- "unplugin": "^2.3.10",
68
+ "obug": "^2.1.1",
69
+ "oxc-parser": ">=0.103.0",
70
+ "oxc-transform": ">=0.103.0",
71
+ "unplugin": "^2.3.11",
69
72
  "unplugin-utils": "^0.3.1"
70
73
  },
71
74
  "devDependencies": {
72
75
  "@farmfe/core": "^1.7.11",
73
- "@oxc-project/types": "^0.97.0",
76
+ "@oxc-project/types": "^0.103.0",
74
77
  "@rollup/plugin-alias": "^6.0.0",
75
- "@swc/core": "^1.15.2",
76
- "@sxzz/eslint-config": "^7.2.10",
77
- "@sxzz/prettier-config": "^2.2.4",
78
- "@sxzz/test-utils": "^0.5.12",
79
- "@types/node": "^24.10.1",
80
- "bumpp": "^10.3.1",
81
- "esbuild": "^0.27.0",
82
- "eslint": "^9.39.1",
78
+ "@swc/core": "^1.15.5",
79
+ "@sxzz/eslint-config": "^7.4.3",
80
+ "@sxzz/prettier-config": "^2.2.6",
81
+ "@sxzz/test-utils": "^0.5.14",
82
+ "@types/node": "^25.0.2",
83
+ "@typescript/native-preview": "7.0.0-dev.20251215.1",
84
+ "bumpp": "^10.3.2",
85
+ "esbuild": "^0.27.1",
86
+ "eslint": "^9.39.2",
83
87
  "fast-glob": "^3.3.3",
84
- "prettier": "^3.6.2",
85
- "publint": "^0.3.15",
86
- "rolldown": "^1.0.0-beta.50",
87
- "rollup": "^4.53.2",
88
+ "prettier": "^3.7.4",
89
+ "publint": "^0.3.16",
90
+ "rolldown": "^1.0.0-beta.54",
91
+ "rollup": "^4.53.4",
88
92
  "tinyglobby": "^0.2.15",
89
- "tsdown": "^0.16.4",
90
- "tsx": "^4.20.6",
93
+ "tsdown": "^0.18.0",
91
94
  "typescript": "^5.9.3",
92
- "unplugin-oxc": "^0.5.4",
93
- "vite": "^7.2.2",
94
- "vitest": "^4.0.9"
95
- },
96
- "engines": {
97
- "node": ">=20.18.0"
95
+ "unplugin-oxc": "^0.5.6",
96
+ "vite": "^7.3.0",
97
+ "vitest": "^4.0.15"
98
98
  },
99
99
  "resolutions": {
100
100
  "@changesets/cli": "-",
@@ -107,7 +107,7 @@
107
107
  "build": "tsdown",
108
108
  "dev": "tsdown --watch",
109
109
  "test": "vitest",
110
- "typecheck": "tsc --noEmit",
110
+ "typecheck": "tsgo --noEmit",
111
111
  "release": "bumpp"
112
112
  }
113
113
  }
package/dist/api.js DELETED
@@ -1,3 +0,0 @@
1
- import { a as tsTransform, i as swcTransform, r as oxcTransform } from "./transformer-DIxtVpUn.js";
2
-
3
- export { oxcTransform, swcTransform, tsTransform };
package/dist/index.js DELETED
@@ -1,4 +0,0 @@
1
- import "./transformer-DIxtVpUn.js";
2
- import { t as IsolatedDecl } from "./src-B1bL5Pcm.js";
3
-
4
- export { IsolatedDecl };
File without changes
File without changes