unplugin-isolated-decl 0.10.7 → 0.11.2
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/api.d.ts +1 -1
- package/dist/core/ast.d.ts +4 -4
- package/dist/core/options.d.ts +40 -37
- package/dist/core/transformer.d.ts +10 -10
- package/dist/core/utils.d.ts +3 -3
- package/dist/esbuild.d.ts +19 -18
- package/dist/esbuild.js +16 -3
- package/dist/farm.d.ts +20 -19
- package/dist/farm.js +17 -3
- package/dist/index.d.ts +5 -9
- package/dist/index.js +1 -1
- package/dist/rolldown.d.ts +20 -19
- package/dist/rolldown.js +17 -3
- package/dist/rollup.d.ts +20 -19
- package/dist/rollup.js +17 -3
- package/dist/{src-BKZ7wewR.js → src-eMzdAZrI.js} +37 -35
- package/dist/vite.d.ts +20 -19
- package/dist/vite.js +17 -3
- package/package.json +30 -50
- package/dist/api.cjs +0 -5
- package/dist/api.d.cts +0 -1
- package/dist/core/ast.d.cts +0 -8
- package/dist/core/options.d.cts +0 -44
- package/dist/core/transformer.d.cts +0 -20
- package/dist/core/utils.d.cts +0 -9
- package/dist/esbuild.cjs +0 -9
- package/dist/esbuild.d.cts +0 -20
- package/dist/farm.cjs +0 -9
- package/dist/farm.d.cts +0 -21
- package/dist/index.cjs +0 -4
- package/dist/index.d.cts +0 -11
- package/dist/rolldown.cjs +0 -9
- package/dist/rolldown.d.cts +0 -21
- package/dist/rollup.cjs +0 -9
- package/dist/rollup.d.cts +0 -21
- package/dist/src-CimtWZd6.cjs +0 -382
- package/dist/transformer-DzpBM_tn.cjs +0 -162
- package/dist/vite.cjs +0 -9
- package/dist/vite.d.cts +0 -21
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unplugin-isolated-decl",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.2",
|
|
4
4
|
"description": "A blazing-fast tool for generating isolated declarations.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"type": "git",
|
|
20
20
|
"url": "git+https://github.com/unplugin/unplugin-isolated-decl.git"
|
|
21
21
|
},
|
|
22
|
-
"author": "三咲智子 <sxzz@sxzz.moe>",
|
|
22
|
+
"author": "三咲智子 Kevin Deng <sxzz@sxzz.moe>",
|
|
23
23
|
"files": [
|
|
24
24
|
"dist"
|
|
25
25
|
],
|
|
@@ -27,38 +27,14 @@
|
|
|
27
27
|
"module": "./dist/index.js",
|
|
28
28
|
"types": "./dist/index.d.ts",
|
|
29
29
|
"exports": {
|
|
30
|
-
".":
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"./
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"./rollup": {
|
|
39
|
-
"require": "./dist/rollup.cjs",
|
|
40
|
-
"import": "./dist/rollup.js"
|
|
41
|
-
},
|
|
42
|
-
"./rolldown": {
|
|
43
|
-
"require": "./dist/rolldown.cjs",
|
|
44
|
-
"import": "./dist/rolldown.js"
|
|
45
|
-
},
|
|
46
|
-
"./esbuild": {
|
|
47
|
-
"require": "./dist/esbuild.cjs",
|
|
48
|
-
"import": "./dist/esbuild.js"
|
|
49
|
-
},
|
|
50
|
-
"./farm": {
|
|
51
|
-
"require": "./dist/farm.cjs",
|
|
52
|
-
"import": "./dist/farm.js"
|
|
53
|
-
},
|
|
54
|
-
"./api": {
|
|
55
|
-
"require": "./dist/api.cjs",
|
|
56
|
-
"import": "./dist/api.js"
|
|
57
|
-
},
|
|
58
|
-
"./*": [
|
|
59
|
-
"./*",
|
|
60
|
-
"./*.d.ts"
|
|
61
|
-
]
|
|
30
|
+
".": "./dist/index.js",
|
|
31
|
+
"./vite": "./dist/vite.js",
|
|
32
|
+
"./rollup": "./dist/rollup.js",
|
|
33
|
+
"./rolldown": "./dist/rolldown.js",
|
|
34
|
+
"./esbuild": "./dist/esbuild.js",
|
|
35
|
+
"./farm": "./dist/farm.js",
|
|
36
|
+
"./api": "./dist/api.js",
|
|
37
|
+
"./*": "./*"
|
|
62
38
|
},
|
|
63
39
|
"typesVersions": {
|
|
64
40
|
"*": {
|
|
@@ -90,33 +66,33 @@
|
|
|
90
66
|
"dependencies": {
|
|
91
67
|
"debug": "^4.4.0",
|
|
92
68
|
"magic-string": "^0.30.17",
|
|
93
|
-
"oxc-parser": "^0.
|
|
94
|
-
"unplugin": "^2.
|
|
95
|
-
"unplugin-utils": "^0.2.
|
|
69
|
+
"oxc-parser": "^0.51.0",
|
|
70
|
+
"unplugin": "^2.2.0",
|
|
71
|
+
"unplugin-utils": "^0.2.4"
|
|
96
72
|
},
|
|
97
73
|
"devDependencies": {
|
|
98
74
|
"@farmfe/core": "^1.6.6",
|
|
99
|
-
"@oxc-project/types": "^0.
|
|
75
|
+
"@oxc-project/types": "^0.51.0",
|
|
100
76
|
"@rollup/plugin-alias": "^5.1.1",
|
|
101
|
-
"@swc/core": "^1.10.
|
|
102
|
-
"@sxzz/eslint-config": "^5.
|
|
103
|
-
"@sxzz/prettier-config": "^2.
|
|
77
|
+
"@swc/core": "^1.10.16",
|
|
78
|
+
"@sxzz/eslint-config": "^5.1.1",
|
|
79
|
+
"@sxzz/prettier-config": "^2.2.0",
|
|
104
80
|
"@sxzz/test-utils": "^0.5.1",
|
|
105
81
|
"@types/debug": "^4.1.12",
|
|
106
|
-
"@types/node": "^22.13.
|
|
107
|
-
"bumpp": "^10.0.
|
|
108
|
-
"esbuild": "^0.
|
|
109
|
-
"eslint": "^9.
|
|
82
|
+
"@types/node": "^22.13.4",
|
|
83
|
+
"bumpp": "^10.0.3",
|
|
84
|
+
"esbuild": "^0.25.0",
|
|
85
|
+
"eslint": "^9.20.1",
|
|
110
86
|
"fast-glob": "^3.3.3",
|
|
111
|
-
"oxc-transform": "^0.
|
|
112
|
-
"prettier": "^3.
|
|
87
|
+
"oxc-transform": "^0.51.0",
|
|
88
|
+
"prettier": "^3.5.1",
|
|
113
89
|
"rolldown": "^1.0.0-beta.3",
|
|
114
|
-
"rollup": "^4.34.
|
|
115
|
-
"rollup-plugin-esbuild": "^6.1.1",
|
|
90
|
+
"rollup": "^4.34.8",
|
|
116
91
|
"tinyglobby": "^0.2.10",
|
|
117
|
-
"tsdown": "^0.5.
|
|
92
|
+
"tsdown": "^0.5.9",
|
|
118
93
|
"tsx": "^4.19.2",
|
|
119
94
|
"typescript": "^5.7.3",
|
|
95
|
+
"unplugin-oxc": "^0.2.4",
|
|
120
96
|
"vite": "^6.1.0",
|
|
121
97
|
"vitest": "^3.0.5"
|
|
122
98
|
},
|
|
@@ -124,6 +100,10 @@
|
|
|
124
100
|
"node": ">=18.12.0"
|
|
125
101
|
},
|
|
126
102
|
"prettier": "@sxzz/prettier-config",
|
|
103
|
+
"resolutions": {
|
|
104
|
+
"@changesets/cli": "-",
|
|
105
|
+
"unplugin-isolated-decl": "-"
|
|
106
|
+
},
|
|
127
107
|
"scripts": {
|
|
128
108
|
"lint": "eslint --cache .",
|
|
129
109
|
"lint:fix": "pnpm run lint --fix",
|
package/dist/api.cjs
DELETED
package/dist/api.d.cts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { oxcTransform, swcTransform, tsTransform } from './core/transformer.cjs';
|
package/dist/core/ast.d.cts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type * as OxcTypes from '@oxc-project/types';
|
|
2
|
-
import type MagicString from 'magic-string';
|
|
3
|
-
export type OxcImport = (OxcTypes.ImportDeclaration | OxcTypes.ExportAllDeclaration | OxcTypes.ExportNamedDeclaration) & {
|
|
4
|
-
source: OxcTypes.StringLiteral;
|
|
5
|
-
shouldAddIndex?: boolean;
|
|
6
|
-
};
|
|
7
|
-
export declare function filterImports(program: OxcTypes.Program): OxcImport[];
|
|
8
|
-
export declare function rewriteImports(s: MagicString, imports: OxcImport[], entryMap: Record<string, string> | undefined, inputBase: string, entryFileNames: string, srcFilename: string): string;
|
package/dist/core/options.d.cts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { TranspileOptions } from 'typescript';
|
|
2
|
-
import type { FilterPattern } from 'unplugin-utils';
|
|
3
|
-
/**
|
|
4
|
-
* Represents the options for the plugin.
|
|
5
|
-
*/
|
|
6
|
-
export type Options = {
|
|
7
|
-
include?: FilterPattern;
|
|
8
|
-
exclude?: FilterPattern;
|
|
9
|
-
enforce?: 'pre' | 'post' | undefined;
|
|
10
|
-
/**
|
|
11
|
-
* Whether to generate declaration source maps.
|
|
12
|
-
*
|
|
13
|
-
* Supported by `typescript` and `oxc` transformer only.
|
|
14
|
-
*
|
|
15
|
-
* @link https://www.typescriptlang.org/tsconfig/#declarationMap
|
|
16
|
-
*/
|
|
17
|
-
sourceMap?: boolean;
|
|
18
|
-
ignoreErrors?: boolean;
|
|
19
|
-
/** An extra directory layer for output files. */
|
|
20
|
-
extraOutdir?: string;
|
|
21
|
-
/** Patch `export default` in `.d.cts` to `export = ` */
|
|
22
|
-
patchCjsDefaultExport?: boolean;
|
|
23
|
-
/** Base directory for input files. */
|
|
24
|
-
inputBase?: string;
|
|
25
|
-
rewriteImports?: (id: string, importer: string) => string | void | null | undefined;
|
|
26
|
-
} & ({
|
|
27
|
-
/**
|
|
28
|
-
* `oxc-transform` or `@swc/core` should be installed yourself
|
|
29
|
-
* if you want to use `oxc` or `swc` transformer.
|
|
30
|
-
*/
|
|
31
|
-
transformer?: 'oxc' | 'swc';
|
|
32
|
-
} | {
|
|
33
|
-
/**
|
|
34
|
-
* `typescript` should be installed yourself.
|
|
35
|
-
* @default 'typescript'
|
|
36
|
-
*/
|
|
37
|
-
transformer?: 'typescript';
|
|
38
|
-
/** Only for typescript transformer */
|
|
39
|
-
transformOptions?: TranspileOptions;
|
|
40
|
-
});
|
|
41
|
-
type Overwrite<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;
|
|
42
|
-
export type OptionsResolved = Overwrite<Required<Options>, Pick<Options, 'enforce' | 'extraOutdir' | 'rewriteImports' | 'inputBase'>>;
|
|
43
|
-
export declare function resolveOptions(options: Options): OptionsResolved;
|
|
44
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { TranspileOptions } from 'typescript';
|
|
2
|
-
export interface TransformResult {
|
|
3
|
-
code: string;
|
|
4
|
-
errors: Array<string>;
|
|
5
|
-
map?: string;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Transform isolated declarations with `oxc-transform`.
|
|
9
|
-
*/
|
|
10
|
-
export declare function oxcTransform(id: string, code: string, sourceMap?: boolean): Promise<TransformResult>;
|
|
11
|
-
/**
|
|
12
|
-
* Transform isolated declarations with `@swc/core`.
|
|
13
|
-
*/
|
|
14
|
-
export declare function swcTransform(id: string, code: string): Promise<TransformResult>;
|
|
15
|
-
/**
|
|
16
|
-
* Transform isolated declarations with `typescript`.
|
|
17
|
-
*/
|
|
18
|
-
export declare function tsTransform(id: string, code: string, transformOptions?: TranspileOptions, sourceMap?: boolean): Promise<TransformResult>;
|
|
19
|
-
export declare function appendMapUrl(map: string, filename: string): string;
|
|
20
|
-
export declare function generateDtsMap(mappings: string, src: string, dts: string): string;
|
package/dist/core/utils.d.cts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import Debug from 'debug';
|
|
2
|
-
export declare const debug: Debug.Debugger;
|
|
3
|
-
export declare function lowestCommonAncestor(...filepaths: string[]): string;
|
|
4
|
-
export declare function stripExt(filename: string): string;
|
|
5
|
-
export declare function resolveEntry(input: string | string[] | Record<string, string>, userInputBase?: string): {
|
|
6
|
-
entryMap: Record<string, string> | undefined;
|
|
7
|
-
inputBase: string;
|
|
8
|
-
};
|
|
9
|
-
export declare function shouldAddIndex(id: string, resolved: string): boolean;
|
package/dist/esbuild.cjs
DELETED
package/dist/esbuild.d.cts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This entry file is for esbuild plugin.
|
|
3
|
-
*
|
|
4
|
-
* @module
|
|
5
|
-
*/
|
|
6
|
-
import { IsolatedDecl } from './index.cjs';
|
|
7
|
-
/**
|
|
8
|
-
* Esbuild plugin
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```ts
|
|
12
|
-
* import { build } from 'esbuild'
|
|
13
|
-
*
|
|
14
|
-
* build({
|
|
15
|
-
* plugins: [require('unplugin-isolated-decl/esbuild')()],
|
|
16
|
-
* })
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
declare const _default: typeof IsolatedDecl.esbuild;
|
|
20
|
-
export = _default;
|
package/dist/farm.cjs
DELETED
package/dist/farm.d.cts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This entry file is for Farm plugin.
|
|
3
|
-
*
|
|
4
|
-
* @module
|
|
5
|
-
*/
|
|
6
|
-
import { IsolatedDecl } from './index.cjs';
|
|
7
|
-
/**
|
|
8
|
-
* Farm plugin
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```ts
|
|
12
|
-
* // farm.config.js
|
|
13
|
-
* import IsolatedDecl from 'unplugin-isolated-decl/farm'
|
|
14
|
-
*
|
|
15
|
-
* export default {
|
|
16
|
-
* plugins: [IsolatedDecl()],
|
|
17
|
-
* }
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
declare const _default: typeof IsolatedDecl.farm;
|
|
21
|
-
export = _default;
|
package/dist/index.cjs
DELETED
package/dist/index.d.cts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This entry file is for main unplugin.
|
|
3
|
-
* @module
|
|
4
|
-
*/
|
|
5
|
-
import { type UnpluginInstance } from 'unplugin';
|
|
6
|
-
import { type Options } from './core/options.cjs';
|
|
7
|
-
export type { Options };
|
|
8
|
-
/**
|
|
9
|
-
* The main unplugin instance.
|
|
10
|
-
*/
|
|
11
|
-
export declare const IsolatedDecl: UnpluginInstance<Options | undefined, false>;
|
package/dist/rolldown.cjs
DELETED
package/dist/rolldown.d.cts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This entry file is for Rolldown plugin.
|
|
3
|
-
*
|
|
4
|
-
* @module
|
|
5
|
-
*/
|
|
6
|
-
import { IsolatedDecl } from './index.cjs';
|
|
7
|
-
/**
|
|
8
|
-
* Rolldown plugin
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```ts
|
|
12
|
-
* // rolldown.config.js
|
|
13
|
-
* import IsolatedDecl from 'unplugin-isolated-decl/rolldown'
|
|
14
|
-
*
|
|
15
|
-
* export default {
|
|
16
|
-
* plugins: [IsolatedDecl()],
|
|
17
|
-
* }
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
declare const _default: typeof IsolatedDecl.rolldown;
|
|
21
|
-
export = _default;
|
package/dist/rollup.cjs
DELETED
package/dist/rollup.d.cts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This entry file is for Rollup plugin.
|
|
3
|
-
*
|
|
4
|
-
* @module
|
|
5
|
-
*/
|
|
6
|
-
import { IsolatedDecl } from './index.cjs';
|
|
7
|
-
/**
|
|
8
|
-
* Rollup plugin
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```ts
|
|
12
|
-
* // rollup.config.js
|
|
13
|
-
* import IsolatedDecl from 'unplugin-isolated-decl/rollup'
|
|
14
|
-
*
|
|
15
|
-
* export default {
|
|
16
|
-
* plugins: [IsolatedDecl()],
|
|
17
|
-
* }
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
declare const _default: typeof IsolatedDecl.rollup;
|
|
21
|
-
export = _default;
|