unplugin-isolated-decl 0.6.6 → 0.6.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.
- package/README.md +12 -7
- package/dist/api.cjs +3 -18
- package/dist/esbuild.cjs +1 -1
- package/dist/esbuild.js +1 -1
- package/dist/index.cjs +3 -13
- package/dist/index.js +1 -1
- package/dist/rolldown.cjs +1 -1
- package/dist/rolldown.js +1 -1
- package/dist/rollup.cjs +1 -1
- package/dist/rollup.js +1 -1
- package/dist/{src_index-WXdz1uEu.js → src_index-jESannmB.js} +7 -1
- package/dist/{src_index-4YckyJ-4.cjs → src_index-tVPRzUWA.cjs} +7 -1
- package/dist/vite.cjs +1 -1
- package/dist/vite.js +1 -1
- package/package.json +16 -16
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://github.com/unplugin/unplugin-isolated-decl/actions/workflows/unit-test.yml)
|
|
4
4
|
|
|
5
|
-
⚡️ A blazing-fast tool for generating isolated declarations
|
|
5
|
+
⚡️ A blazing-fast tool for generating isolated declarations.
|
|
6
6
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
@@ -83,8 +83,8 @@ export interface Options {
|
|
|
83
83
|
exclude?: FilterPattern
|
|
84
84
|
enforce?: 'pre' | 'post' | undefined
|
|
85
85
|
/**
|
|
86
|
-
*
|
|
87
|
-
* @default
|
|
86
|
+
* You need to install one of the supported transformers yourself.
|
|
87
|
+
* @default typescript
|
|
88
88
|
*/
|
|
89
89
|
transformer?: 'oxc' | 'swc' | 'typescript'
|
|
90
90
|
/** Only for typescript transformer */
|
|
@@ -114,6 +114,15 @@ With `autoAddExts`, it will be transformed to:
|
|
|
114
114
|
import {} from './foo.js'
|
|
115
115
|
```
|
|
116
116
|
|
|
117
|
+
### `patchCjsDefaultExport`
|
|
118
|
+
|
|
119
|
+
Patch `export default` in `.d.cts` to `export =`
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
> [!NOTE]
|
|
124
|
+
> For the exhaustive set of options check [options](src/core/options.ts)
|
|
125
|
+
|
|
117
126
|
## Sponsors
|
|
118
127
|
|
|
119
128
|
<p align="center">
|
|
@@ -125,7 +134,3 @@ import {} from './foo.js'
|
|
|
125
134
|
## License
|
|
126
135
|
|
|
127
136
|
[MIT](./LICENSE) License © 2024-PRESENT [三咲智子](https://github.com/sxzz)
|
|
128
|
-
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
```
|
package/dist/api.cjs
CHANGED
|
@@ -1,21 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_transformer = require('./transformer-9aaNC01N.cjs');
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return require_transformer.oxcTransform;
|
|
8
|
-
}
|
|
9
|
-
});
|
|
10
|
-
Object.defineProperty(exports, 'swcTransform', {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return require_transformer.swcTransform;
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
Object.defineProperty(exports, 'tsTransform', {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
get: function () {
|
|
19
|
-
return require_transformer.tsTransform;
|
|
20
|
-
}
|
|
21
|
-
});
|
|
4
|
+
exports.oxcTransform = require_transformer.oxcTransform
|
|
5
|
+
exports.swcTransform = require_transformer.swcTransform
|
|
6
|
+
exports.tsTransform = require_transformer.tsTransform
|
package/dist/esbuild.cjs
CHANGED
package/dist/esbuild.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const require_src_index = require('./src_index-
|
|
2
|
+
const require_src_index = require('./src_index-tVPRzUWA.cjs');
|
|
3
3
|
require('./transformer-9aaNC01N.cjs');
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
get: function () {
|
|
8
|
-
return require_src_index.IsolatedDecl;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(exports, 'lowestCommonAncestor', {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: function () {
|
|
14
|
-
return require_src_index.lowestCommonAncestor;
|
|
15
|
-
}
|
|
16
|
-
});
|
|
5
|
+
exports.IsolatedDecl = require_src_index.IsolatedDecl
|
|
6
|
+
exports.lowestCommonAncestor = require_src_index.lowestCommonAncestor
|
package/dist/index.js
CHANGED
package/dist/rolldown.cjs
CHANGED
package/dist/rolldown.js
CHANGED
package/dist/rollup.cjs
CHANGED
package/dist/rollup.js
CHANGED
|
@@ -86,7 +86,13 @@ const IsolatedDecl = createUnplugin((rawOptions = {}) => {
|
|
|
86
86
|
const resolved = await resolve(context, i.source.value, id);
|
|
87
87
|
if (!resolved || resolved.external) continue;
|
|
88
88
|
if (resolved.id.endsWith(".ts") || resolved.id.endsWith(".tsx")) {
|
|
89
|
-
s.overwrite(
|
|
89
|
+
s.overwrite(
|
|
90
|
+
// @ts-expect-error
|
|
91
|
+
i.source.start,
|
|
92
|
+
// @ts-expect-error
|
|
93
|
+
i.source.end,
|
|
94
|
+
JSON.stringify(`${i.source.value}.js`)
|
|
95
|
+
);
|
|
90
96
|
}
|
|
91
97
|
}
|
|
92
98
|
code = s.toString();
|
|
@@ -110,7 +110,13 @@ const IsolatedDecl = createUnplugin((rawOptions = {}) => {
|
|
|
110
110
|
const resolved = await resolve(context, i.source.value, id);
|
|
111
111
|
if (!resolved || resolved.external) continue;
|
|
112
112
|
if (resolved.id.endsWith(".ts") || resolved.id.endsWith(".tsx")) {
|
|
113
|
-
s.overwrite(
|
|
113
|
+
s.overwrite(
|
|
114
|
+
// @ts-expect-error
|
|
115
|
+
i.source.start,
|
|
116
|
+
// @ts-expect-error
|
|
117
|
+
i.source.end,
|
|
118
|
+
JSON.stringify(`${i.source.value}.js`)
|
|
119
|
+
);
|
|
114
120
|
}
|
|
115
121
|
}
|
|
116
122
|
code = s.toString();
|
package/dist/vite.cjs
CHANGED
package/dist/vite.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unplugin-isolated-decl",
|
|
3
|
-
"version": "0.6.
|
|
4
|
-
"description": "A blazing-fast tool for generating isolated declarations
|
|
3
|
+
"version": "0.6.7",
|
|
4
|
+
"description": "A blazing-fast tool for generating isolated declarations.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"unplugin",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"@swc/core": "^1.6.6",
|
|
72
|
-
"oxc-transform": "
|
|
72
|
+
"oxc-transform": ">=0.28.0",
|
|
73
73
|
"typescript": "^5.5.2"
|
|
74
74
|
},
|
|
75
75
|
"peerDependenciesMeta": {
|
|
@@ -85,30 +85,30 @@
|
|
|
85
85
|
},
|
|
86
86
|
"dependencies": {
|
|
87
87
|
"@rollup/pluginutils": "^5.1.2",
|
|
88
|
-
"magic-string": "^0.30.
|
|
89
|
-
"oxc-parser": "^0.
|
|
88
|
+
"magic-string": "^0.30.12",
|
|
89
|
+
"oxc-parser": "^0.31.0",
|
|
90
90
|
"unplugin": "^1.14.1"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
|
-
"@swc/core": "^1.7.
|
|
94
|
-
"@sxzz/eslint-config": "^4.
|
|
93
|
+
"@swc/core": "^1.7.35",
|
|
94
|
+
"@sxzz/eslint-config": "^4.4.0",
|
|
95
95
|
"@sxzz/prettier-config": "^2.0.2",
|
|
96
|
-
"@types/node": "^22.7.
|
|
97
|
-
"@typescript-eslint/typescript-estree": "^8.
|
|
98
|
-
"bumpp": "^9.
|
|
96
|
+
"@types/node": "^22.7.5",
|
|
97
|
+
"@typescript-eslint/typescript-estree": "^8.8.1",
|
|
98
|
+
"bumpp": "^9.7.1",
|
|
99
99
|
"esbuild": "^0.24.0",
|
|
100
|
-
"eslint": "^9.
|
|
100
|
+
"eslint": "^9.12.0",
|
|
101
101
|
"fast-glob": "^3.3.2",
|
|
102
|
-
"oxc-transform": "^0.
|
|
102
|
+
"oxc-transform": "^0.31.0",
|
|
103
103
|
"prettier": "^3.3.3",
|
|
104
104
|
"rolldown": "nightly",
|
|
105
|
-
"rollup": "^4.
|
|
105
|
+
"rollup": "^4.24.0",
|
|
106
106
|
"rollup-plugin-esbuild": "^6.1.1",
|
|
107
107
|
"tsdown": "^0.2.17",
|
|
108
108
|
"tsx": "^4.19.1",
|
|
109
|
-
"typescript": "^5.6.
|
|
110
|
-
"vite": "^5.4.
|
|
111
|
-
"vitest": "^2.1.
|
|
109
|
+
"typescript": "^5.6.3",
|
|
110
|
+
"vite": "^5.4.9",
|
|
111
|
+
"vitest": "^2.1.3"
|
|
112
112
|
},
|
|
113
113
|
"engines": {
|
|
114
114
|
"node": ">=18.12.0"
|