unplugin-isolated-decl 0.4.2 → 0.4.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/core/options.d.cts +1 -1
- package/dist/core/options.d.ts +1 -1
- package/dist/esbuild.cjs +1 -1
- package/dist/esbuild.js +1 -1
- package/dist/index.cjs +1 -1
- 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-jgSmcGXY.cjs → src_index-5Xl2iCUQ.cjs} +16 -14
- package/dist/{src_index-lTUNmGu_.js → src_index-QT5bMpQf.js} +16 -14
- package/dist/vite.cjs +1 -1
- package/dist/vite.js +1 -1
- package/package.json +13 -13
package/dist/core/options.d.cts
CHANGED
package/dist/core/options.d.ts
CHANGED
package/dist/esbuild.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_transformer = require('./transformer-oh0-JTHH.cjs');
|
|
3
|
-
const require_src_index = require('./src_index-
|
|
3
|
+
const require_src_index = require('./src_index-5Xl2iCUQ.cjs');
|
|
4
4
|
|
|
5
5
|
//#region src/esbuild.ts
|
|
6
6
|
var esbuild_default = require_src_index.IsolatedDecl.esbuild;
|
package/dist/esbuild.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_transformer = require('./transformer-oh0-JTHH.cjs');
|
|
3
|
-
const require_src_index = require('./src_index-
|
|
3
|
+
const require_src_index = require('./src_index-5Xl2iCUQ.cjs');
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, 'IsolatedDecl', {
|
|
6
6
|
enumerable: true,
|
package/dist/index.js
CHANGED
package/dist/rolldown.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_transformer = require('./transformer-oh0-JTHH.cjs');
|
|
3
|
-
const require_src_index = require('./src_index-
|
|
3
|
+
const require_src_index = require('./src_index-5Xl2iCUQ.cjs');
|
|
4
4
|
|
|
5
5
|
//#region src/rolldown.ts
|
|
6
6
|
var rolldown_default = require_src_index.IsolatedDecl.rolldown;
|
package/dist/rolldown.js
CHANGED
package/dist/rollup.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_transformer = require('./transformer-oh0-JTHH.cjs');
|
|
3
|
-
const require_src_index = require('./src_index-
|
|
3
|
+
const require_src_index = require('./src_index-5Xl2iCUQ.cjs');
|
|
4
4
|
|
|
5
5
|
//#region src/rollup.ts
|
|
6
6
|
var rollup_default = require_src_index.IsolatedDecl.rollup;
|
package/dist/rollup.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_transformer = require('./transformer-oh0-JTHH.cjs');
|
|
3
|
-
const { default: path } = __toESM(require("node:path"));
|
|
4
3
|
const { mkdir, writeFile } = __toESM(require("node:fs/promises"));
|
|
5
|
-
const {
|
|
4
|
+
const { default: path } = __toESM(require("node:path"));
|
|
6
5
|
const { createFilter } = __toESM(require("@rollup/pluginutils"));
|
|
6
|
+
const { createUnplugin } = __toESM(require("unplugin"));
|
|
7
7
|
|
|
8
8
|
//#region src/core/options.ts
|
|
9
9
|
function resolveOptions(options) {
|
|
@@ -18,7 +18,7 @@ function resolveOptions(options) {
|
|
|
18
18
|
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region src/index.ts
|
|
21
|
-
const IsolatedDecl = createUnplugin((rawOptions = {}
|
|
21
|
+
const IsolatedDecl = createUnplugin((rawOptions = {}) => {
|
|
22
22
|
const options = resolveOptions(rawOptions);
|
|
23
23
|
const filter = createFilter(options.include, options.exclude);
|
|
24
24
|
const outputFiles = {};
|
|
@@ -90,21 +90,23 @@ const IsolatedDecl = createUnplugin((rawOptions = {}, meta) => {
|
|
|
90
90
|
outExt = "ts";
|
|
91
91
|
break;
|
|
92
92
|
}
|
|
93
|
-
|
|
93
|
+
const write = build.initialOptions.write ?? true;
|
|
94
|
+
if (write) {
|
|
94
95
|
if (!build.initialOptions.outdir) throw new Error("outdir is required when write is true");
|
|
95
|
-
for (const [filename, source] of Object.entries(outputFiles)) {
|
|
96
|
-
const outFile = `${path.relative(outBase, filename)}.d.${outExt}`;
|
|
97
|
-
const filePath = path.resolve(build.initialOptions.outdir, outFile);
|
|
98
|
-
await mkdir(path.dirname(filePath), { recursive: true });
|
|
99
|
-
await writeFile(filePath, source);
|
|
100
|
-
}
|
|
101
96
|
} else {
|
|
102
97
|
result.outputFiles ||= [];
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
98
|
+
}
|
|
99
|
+
const textEncoder = new TextEncoder();
|
|
100
|
+
for (const [filename, source] of Object.entries(outputFiles)) {
|
|
101
|
+
const outDir = build.initialOptions.outdir;
|
|
102
|
+
const outFile = `${path.relative(outBase, filename)}.d.${outExt}`;
|
|
103
|
+
const filePath = outDir ? path.resolve(outDir, outFile) : outFile;
|
|
104
|
+
if (write) {
|
|
105
|
+
await mkdir(path.dirname(filePath), { recursive: true });
|
|
106
|
+
await writeFile(filePath, source);
|
|
107
|
+
} else {
|
|
106
108
|
result.outputFiles.push({
|
|
107
|
-
path:
|
|
109
|
+
path: filePath,
|
|
108
110
|
contents: textEncoder.encode(source),
|
|
109
111
|
hash: "",
|
|
110
112
|
text: source
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { oxcTransform, swcTransform, tsTransform } from "./transformer-ScZEjI0h.js";
|
|
2
|
-
import { default as path } from "node:path";
|
|
3
2
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
4
|
-
import {
|
|
3
|
+
import { default as path } from "node:path";
|
|
5
4
|
import { createFilter } from "@rollup/pluginutils";
|
|
5
|
+
import { createUnplugin } from "unplugin";
|
|
6
6
|
|
|
7
7
|
//#region src/core/options.ts
|
|
8
8
|
function resolveOptions(options) {
|
|
@@ -17,7 +17,7 @@ function resolveOptions(options) {
|
|
|
17
17
|
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region src/index.ts
|
|
20
|
-
const IsolatedDecl = createUnplugin((rawOptions = {}
|
|
20
|
+
const IsolatedDecl = createUnplugin((rawOptions = {}) => {
|
|
21
21
|
const options = resolveOptions(rawOptions);
|
|
22
22
|
const filter = createFilter(options.include, options.exclude);
|
|
23
23
|
const outputFiles = {};
|
|
@@ -89,21 +89,23 @@ const IsolatedDecl = createUnplugin((rawOptions = {}, meta) => {
|
|
|
89
89
|
outExt = "ts";
|
|
90
90
|
break;
|
|
91
91
|
}
|
|
92
|
-
|
|
92
|
+
const write = build.initialOptions.write ?? true;
|
|
93
|
+
if (write) {
|
|
93
94
|
if (!build.initialOptions.outdir) throw new Error("outdir is required when write is true");
|
|
94
|
-
for (const [filename, source] of Object.entries(outputFiles)) {
|
|
95
|
-
const outFile = `${path.relative(outBase, filename)}.d.${outExt}`;
|
|
96
|
-
const filePath = path.resolve(build.initialOptions.outdir, outFile);
|
|
97
|
-
await mkdir(path.dirname(filePath), { recursive: true });
|
|
98
|
-
await writeFile(filePath, source);
|
|
99
|
-
}
|
|
100
95
|
} else {
|
|
101
96
|
result.outputFiles ||= [];
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
97
|
+
}
|
|
98
|
+
const textEncoder = new TextEncoder();
|
|
99
|
+
for (const [filename, source] of Object.entries(outputFiles)) {
|
|
100
|
+
const outDir = build.initialOptions.outdir;
|
|
101
|
+
const outFile = `${path.relative(outBase, filename)}.d.${outExt}`;
|
|
102
|
+
const filePath = outDir ? path.resolve(outDir, outFile) : outFile;
|
|
103
|
+
if (write) {
|
|
104
|
+
await mkdir(path.dirname(filePath), { recursive: true });
|
|
105
|
+
await writeFile(filePath, source);
|
|
106
|
+
} else {
|
|
105
107
|
result.outputFiles.push({
|
|
106
|
-
path:
|
|
108
|
+
path: filePath,
|
|
107
109
|
contents: textEncoder.encode(source),
|
|
108
110
|
hash: "",
|
|
109
111
|
text: source
|
package/dist/vite.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_transformer = require('./transformer-oh0-JTHH.cjs');
|
|
3
|
-
const require_src_index = require('./src_index-
|
|
3
|
+
const require_src_index = require('./src_index-5Xl2iCUQ.cjs');
|
|
4
4
|
|
|
5
5
|
//#region src/vite.ts
|
|
6
6
|
var vite_default = require_src_index.IsolatedDecl.vite;
|
package/dist/vite.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unplugin-isolated-decl",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "A blazing-fast tool for generating isolated declarations, powered by Oxc.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -81,25 +81,25 @@
|
|
|
81
81
|
},
|
|
82
82
|
"dependencies": {
|
|
83
83
|
"@rollup/pluginutils": "^5.1.0",
|
|
84
|
-
"oxc-transform": "^0.
|
|
85
|
-
"unplugin": "^1.
|
|
84
|
+
"oxc-transform": "^0.23.0",
|
|
85
|
+
"unplugin": "^1.12.1"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
|
-
"@swc/core": "^1.7.
|
|
89
|
-
"@sxzz/eslint-config": "^3.
|
|
88
|
+
"@swc/core": "^1.7.6",
|
|
89
|
+
"@sxzz/eslint-config": "^3.17.0",
|
|
90
90
|
"@sxzz/prettier-config": "^2.0.2",
|
|
91
|
-
"@types/node": "^20.14.
|
|
92
|
-
"bumpp": "^9.4.
|
|
91
|
+
"@types/node": "^20.14.14",
|
|
92
|
+
"bumpp": "^9.4.2",
|
|
93
93
|
"esbuild": "^0.23.0",
|
|
94
|
-
"eslint": "^9.
|
|
94
|
+
"eslint": "^9.8.0",
|
|
95
95
|
"fast-glob": "^3.3.2",
|
|
96
96
|
"prettier": "^3.3.3",
|
|
97
|
-
"rollup": "^4.
|
|
97
|
+
"rollup": "^4.20.0",
|
|
98
98
|
"tsdown": "^0.2.3",
|
|
99
|
-
"tsx": "^4.16.
|
|
100
|
-
"typescript": "^5.5.
|
|
101
|
-
"vite": "^5.
|
|
102
|
-
"vitest": "^2.0.
|
|
99
|
+
"tsx": "^4.16.5",
|
|
100
|
+
"typescript": "^5.5.4",
|
|
101
|
+
"vite": "^5.4.0",
|
|
102
|
+
"vitest": "^2.0.5"
|
|
103
103
|
},
|
|
104
104
|
"engines": {
|
|
105
105
|
"node": ">=18.12.0"
|