unplugin-isolated-decl 0.4.6 → 0.4.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/dist/esbuild.cjs +1 -1
- package/dist/esbuild.js +1 -1
- package/dist/index.cjs +7 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -2
- 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-CysF8PH2.js → src_index-IB8kj2gH.js} +5 -4
- package/dist/{src_index-yIG2muej.cjs → src_index-t9_prpkU.cjs} +9 -3
- package/dist/vite.cjs +1 -1
- package/dist/vite.js +1 -1
- package/package.json +1 -1
package/dist/esbuild.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
require('./transformer-wFl7-Qrk.cjs');
|
|
3
|
-
const require_src_index = require('./src_index-
|
|
3
|
+
const require_src_index = require('./src_index-t9_prpkU.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,10 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
require('./transformer-wFl7-Qrk.cjs');
|
|
3
|
-
const require_src_index = require('./src_index-
|
|
3
|
+
const require_src_index = require('./src_index-t9_prpkU.cjs');
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, 'IsolatedDecl', {
|
|
6
6
|
enumerable: true,
|
|
7
7
|
get: function () {
|
|
8
8
|
return require_src_index.IsolatedDecl;
|
|
9
9
|
}
|
|
10
|
+
});
|
|
11
|
+
Object.defineProperty(exports, 'lowestCommonAncestor', {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () {
|
|
14
|
+
return require_src_index.lowestCommonAncestor;
|
|
15
|
+
}
|
|
10
16
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -2,3 +2,4 @@ import { type UnpluginInstance } from "unplugin";
|
|
|
2
2
|
import { type Options } from "./core/options";
|
|
3
3
|
export type { Options };
|
|
4
4
|
export declare const IsolatedDecl: UnpluginInstance<Options | undefined, false>;
|
|
5
|
+
export declare function lowestCommonAncestor(...filepaths: string[]): string;
|
package/dist/index.d.ts
CHANGED
|
@@ -2,3 +2,4 @@ import { type UnpluginInstance } from "unplugin";
|
|
|
2
2
|
import { type Options } from "./core/options";
|
|
3
3
|
export type { Options };
|
|
4
4
|
export declare const IsolatedDecl: UnpluginInstance<Options | undefined, false>;
|
|
5
|
+
export declare function lowestCommonAncestor(...filepaths: string[]): string;
|
package/dist/index.js
CHANGED
package/dist/rolldown.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
require('./transformer-wFl7-Qrk.cjs');
|
|
3
|
-
const require_src_index = require('./src_index-
|
|
3
|
+
const require_src_index = require('./src_index-t9_prpkU.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
|
require('./transformer-wFl7-Qrk.cjs');
|
|
3
|
-
const require_src_index = require('./src_index-
|
|
3
|
+
const require_src_index = require('./src_index-t9_prpkU.cjs');
|
|
4
4
|
|
|
5
5
|
//#region src/rollup.ts
|
|
6
6
|
var rollup_default = require_src_index.IsolatedDecl.rollup;
|
package/dist/rollup.js
CHANGED
|
@@ -166,10 +166,11 @@ const IsolatedDecl = createUnplugin((rawOptions = {}, meta) => {
|
|
|
166
166
|
function lowestCommonAncestor(...filepaths) {
|
|
167
167
|
if (filepaths.length === 0) return "";
|
|
168
168
|
if (filepaths.length === 1) return path.dirname(filepaths[0]);
|
|
169
|
+
filepaths = filepaths.map((p) => p.replaceAll("\\", "/"));
|
|
169
170
|
const [first, ...rest] = filepaths;
|
|
170
|
-
let ancestor = first.split(
|
|
171
|
+
let ancestor = first.split("/");
|
|
171
172
|
for (const filepath of rest) {
|
|
172
|
-
const directories = filepath.split(
|
|
173
|
+
const directories = filepath.split("/", ancestor.length);
|
|
173
174
|
let index = 0;
|
|
174
175
|
for (const directory of directories) {
|
|
175
176
|
if (directory === ancestor[index]) {
|
|
@@ -181,8 +182,8 @@ function lowestCommonAncestor(...filepaths) {
|
|
|
181
182
|
}
|
|
182
183
|
ancestor = ancestor.slice(0, index);
|
|
183
184
|
}
|
|
184
|
-
return ancestor.length <= 1 && ancestor[0] === "" ?
|
|
185
|
+
return ancestor.length <= 1 && ancestor[0] === "" ? `/${ancestor[0]}` : ancestor.join("/");
|
|
185
186
|
}
|
|
186
187
|
|
|
187
188
|
//#endregion
|
|
188
|
-
export { IsolatedDecl };
|
|
189
|
+
export { IsolatedDecl, lowestCommonAncestor };
|
|
@@ -167,10 +167,11 @@ const IsolatedDecl = createUnplugin((rawOptions = {}, meta) => {
|
|
|
167
167
|
function lowestCommonAncestor(...filepaths) {
|
|
168
168
|
if (filepaths.length === 0) return "";
|
|
169
169
|
if (filepaths.length === 1) return path.dirname(filepaths[0]);
|
|
170
|
+
filepaths = filepaths.map((p) => p.replaceAll("\\", "/"));
|
|
170
171
|
const [first, ...rest] = filepaths;
|
|
171
|
-
let ancestor = first.split(
|
|
172
|
+
let ancestor = first.split("/");
|
|
172
173
|
for (const filepath of rest) {
|
|
173
|
-
const directories = filepath.split(
|
|
174
|
+
const directories = filepath.split("/", ancestor.length);
|
|
174
175
|
let index = 0;
|
|
175
176
|
for (const directory of directories) {
|
|
176
177
|
if (directory === ancestor[index]) {
|
|
@@ -182,7 +183,7 @@ function lowestCommonAncestor(...filepaths) {
|
|
|
182
183
|
}
|
|
183
184
|
ancestor = ancestor.slice(0, index);
|
|
184
185
|
}
|
|
185
|
-
return ancestor.length <= 1 && ancestor[0] === "" ?
|
|
186
|
+
return ancestor.length <= 1 && ancestor[0] === "" ? `/${ancestor[0]}` : ancestor.join("/");
|
|
186
187
|
}
|
|
187
188
|
|
|
188
189
|
//#endregion
|
|
@@ -191,4 +192,9 @@ Object.defineProperty(exports, 'IsolatedDecl', {
|
|
|
191
192
|
get: function () {
|
|
192
193
|
return IsolatedDecl;
|
|
193
194
|
}
|
|
195
|
+
});Object.defineProperty(exports, 'lowestCommonAncestor', {
|
|
196
|
+
enumerable: true,
|
|
197
|
+
get: function () {
|
|
198
|
+
return lowestCommonAncestor;
|
|
199
|
+
}
|
|
194
200
|
});
|
package/dist/vite.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
require('./transformer-wFl7-Qrk.cjs');
|
|
3
|
-
const require_src_index = require('./src_index-
|
|
3
|
+
const require_src_index = require('./src_index-t9_prpkU.cjs');
|
|
4
4
|
|
|
5
5
|
//#region src/vite.ts
|
|
6
6
|
var vite_default = require_src_index.IsolatedDecl.vite;
|
package/dist/vite.js
CHANGED