unplugin-isolated-decl 0.10.7 → 0.11.0
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 +15 -2
- package/dist/farm.d.ts +20 -19
- package/dist/farm.js +16 -2
- package/dist/index.d.ts +5 -9
- package/dist/rolldown.d.ts +20 -19
- package/dist/rolldown.js +16 -2
- package/dist/rollup.d.ts +20 -19
- package/dist/rollup.js +16 -2
- package/dist/vite.d.ts +20 -19
- package/dist/vite.js +16 -2
- package/package.json +14 -38
- 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/dist/api.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { oxcTransform, swcTransform, tsTransform } from
|
|
1
|
+
export { oxcTransform, swcTransform, tsTransform } from "./core/transformer.js";
|
package/dist/core/ast.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type * as OxcTypes from
|
|
2
|
-
import type MagicString from
|
|
1
|
+
import type * as OxcTypes from "@oxc-project/types";
|
|
2
|
+
import type MagicString from "magic-string";
|
|
3
3
|
export type OxcImport = (OxcTypes.ImportDeclaration | OxcTypes.ExportAllDeclaration | OxcTypes.ExportNamedDeclaration) & {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
source: OxcTypes.StringLiteral
|
|
5
|
+
shouldAddIndex?: boolean
|
|
6
6
|
};
|
|
7
7
|
export declare function filterImports(program: OxcTypes.Program): OxcImport[];
|
|
8
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.ts
CHANGED
|
@@ -1,44 +1,47 @@
|
|
|
1
|
-
import type { TranspileOptions } from
|
|
2
|
-
import type { FilterPattern } from
|
|
1
|
+
import type { TranspileOptions } from "typescript";
|
|
2
|
+
import type { FilterPattern } from "unplugin-utils";
|
|
3
3
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
* Represents the options for the plugin.
|
|
5
|
+
*/
|
|
6
6
|
export type Options = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
26
|
} & ({
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
32
|
} | {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
/**
|
|
34
|
+
* `typescript` should be installed yourself.
|
|
35
|
+
* @default 'typescript'
|
|
36
|
+
*/
|
|
37
|
+
transformer?: "typescript"
|
|
38
|
+
/** Only for typescript transformer */
|
|
39
|
+
transformOptions?: TranspileOptions
|
|
40
40
|
});
|
|
41
|
-
type Overwrite<
|
|
42
|
-
|
|
41
|
+
type Overwrite<
|
|
42
|
+
T,
|
|
43
|
+
U
|
|
44
|
+
> = Pick<T, Exclude<keyof T, keyof U>> & U;
|
|
45
|
+
export type OptionsResolved = Overwrite<Required<Options>, Pick<Options, "enforce" | "extraOutdir" | "rewriteImports" | "inputBase">>;
|
|
43
46
|
export declare function resolveOptions(options: Options): OptionsResolved;
|
|
44
47
|
export {};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import type { TranspileOptions } from
|
|
1
|
+
import type { TranspileOptions } from "typescript";
|
|
2
2
|
export interface TransformResult {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
code: string;
|
|
4
|
+
errors: Array<string>;
|
|
5
|
+
map?: string;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
* Transform isolated declarations with `oxc-transform`.
|
|
9
|
+
*/
|
|
10
10
|
export declare function oxcTransform(id: string, code: string, sourceMap?: boolean): Promise<TransformResult>;
|
|
11
11
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
* Transform isolated declarations with `@swc/core`.
|
|
13
|
+
*/
|
|
14
14
|
export declare function swcTransform(id: string, code: string): Promise<TransformResult>;
|
|
15
15
|
/**
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
* Transform isolated declarations with `typescript`.
|
|
17
|
+
*/
|
|
18
18
|
export declare function tsTransform(id: string, code: string, transformOptions?: TranspileOptions, sourceMap?: boolean): Promise<TransformResult>;
|
|
19
19
|
export declare function appendMapUrl(map: string, filename: string): string;
|
|
20
20
|
export declare function generateDtsMap(mappings: string, src: string, dts: string): string;
|
package/dist/core/utils.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import Debug from
|
|
1
|
+
import Debug from "debug";
|
|
2
2
|
export declare const debug: Debug.Debugger;
|
|
3
3
|
export declare function lowestCommonAncestor(...filepaths: string[]): string;
|
|
4
4
|
export declare function stripExt(filename: string): string;
|
|
5
5
|
export declare function resolveEntry(input: string | string[] | Record<string, string>, userInputBase?: string): {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
entryMap: Record<string, string> | undefined
|
|
7
|
+
inputBase: string
|
|
8
8
|
};
|
|
9
9
|
export declare function shouldAddIndex(id: string, resolved: string): boolean;
|
package/dist/esbuild.d.ts
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { IsolatedDecl } from
|
|
2
|
+
* This entry file is for esbuild plugin.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { IsolatedDecl } from "./index.js";
|
|
7
7
|
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
declare const
|
|
20
|
-
export default
|
|
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 esbuild: typeof IsolatedDecl.esbuild;
|
|
20
|
+
export default esbuild;
|
|
21
|
+
export { esbuild as "module.exports" };
|
package/dist/esbuild.js
CHANGED
|
@@ -2,7 +2,20 @@ import "./transformer-CBYRFUWY.js";
|
|
|
2
2
|
import { IsolatedDecl } from "./src-BKZ7wewR.js";
|
|
3
3
|
|
|
4
4
|
//#region src/esbuild.ts
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Esbuild plugin
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { build } from 'esbuild'
|
|
11
|
+
*
|
|
12
|
+
* build({
|
|
13
|
+
* plugins: [require('unplugin-isolated-decl/esbuild')()],
|
|
14
|
+
* })
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
const esbuild = IsolatedDecl.esbuild;
|
|
18
|
+
var esbuild_default = esbuild;
|
|
6
19
|
|
|
7
20
|
//#endregion
|
|
8
|
-
export { esbuild_default as default };
|
|
21
|
+
export { esbuild_default as default, esbuild as 'module.exports' };
|
package/dist/farm.d.ts
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { IsolatedDecl } from
|
|
2
|
+
* This entry file is for Farm plugin.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { IsolatedDecl } from "./index.js";
|
|
7
7
|
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
declare const
|
|
21
|
-
export default
|
|
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 farm: typeof IsolatedDecl.farm;
|
|
21
|
+
export default farm;
|
|
22
|
+
export { farm as "module.exports" };
|
package/dist/farm.js
CHANGED
|
@@ -2,7 +2,21 @@ import "./transformer-CBYRFUWY.js";
|
|
|
2
2
|
import { IsolatedDecl } from "./src-BKZ7wewR.js";
|
|
3
3
|
|
|
4
4
|
//#region src/farm.ts
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Farm plugin
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* // farm.config.js
|
|
11
|
+
* import IsolatedDecl from 'unplugin-isolated-decl/farm'
|
|
12
|
+
*
|
|
13
|
+
* export default {
|
|
14
|
+
* plugins: [IsolatedDecl()],
|
|
15
|
+
* }
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
const farm = IsolatedDecl.farm;
|
|
19
|
+
var farm_default = farm;
|
|
6
20
|
|
|
7
21
|
//#endregion
|
|
8
|
-
export { farm_default as default };
|
|
22
|
+
export { farm_default as default, farm as 'module.exports' };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
+
import { type UnpluginInstance } from "unplugin";
|
|
2
|
+
import { type Options } from "./core/options.js";
|
|
3
|
+
export type { Options };
|
|
1
4
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*/
|
|
5
|
-
import { type UnpluginInstance } from 'unplugin';
|
|
6
|
-
import { type Options } from './core/options.js';
|
|
7
|
-
export type { Options };
|
|
8
|
-
/**
|
|
9
|
-
* The main unplugin instance.
|
|
10
|
-
*/
|
|
5
|
+
* The main unplugin instance.
|
|
6
|
+
*/
|
|
11
7
|
export declare const IsolatedDecl: UnpluginInstance<Options | undefined, false>;
|
package/dist/rolldown.d.ts
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { IsolatedDecl } from
|
|
2
|
+
* This entry file is for Rolldown plugin.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { IsolatedDecl } from "./index.js";
|
|
7
7
|
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
declare const
|
|
21
|
-
export default
|
|
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 rolldown: typeof IsolatedDecl.rolldown;
|
|
21
|
+
export default rolldown;
|
|
22
|
+
export { rolldown as "module.exports" };
|
package/dist/rolldown.js
CHANGED
|
@@ -2,7 +2,21 @@ import "./transformer-CBYRFUWY.js";
|
|
|
2
2
|
import { IsolatedDecl } from "./src-BKZ7wewR.js";
|
|
3
3
|
|
|
4
4
|
//#region src/rolldown.ts
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Rolldown plugin
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* // rolldown.config.js
|
|
11
|
+
* import IsolatedDecl from 'unplugin-isolated-decl/rolldown'
|
|
12
|
+
*
|
|
13
|
+
* export default {
|
|
14
|
+
* plugins: [IsolatedDecl()],
|
|
15
|
+
* }
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
const rolldown = IsolatedDecl.rolldown;
|
|
19
|
+
var rolldown_default = rolldown;
|
|
6
20
|
|
|
7
21
|
//#endregion
|
|
8
|
-
export { rolldown_default as default };
|
|
22
|
+
export { rolldown_default as default, rolldown as 'module.exports' };
|
package/dist/rollup.d.ts
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { IsolatedDecl } from
|
|
2
|
+
* This entry file is for Rollup plugin.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { IsolatedDecl } from "./index.js";
|
|
7
7
|
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
declare const
|
|
21
|
-
export default
|
|
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 rollup: typeof IsolatedDecl.rollup;
|
|
21
|
+
export default rollup;
|
|
22
|
+
export { rollup as "module.exports" };
|
package/dist/rollup.js
CHANGED
|
@@ -2,7 +2,21 @@ import "./transformer-CBYRFUWY.js";
|
|
|
2
2
|
import { IsolatedDecl } from "./src-BKZ7wewR.js";
|
|
3
3
|
|
|
4
4
|
//#region src/rollup.ts
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Rollup plugin
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* // rollup.config.js
|
|
11
|
+
* import IsolatedDecl from 'unplugin-isolated-decl/rollup'
|
|
12
|
+
*
|
|
13
|
+
* export default {
|
|
14
|
+
* plugins: [IsolatedDecl()],
|
|
15
|
+
* }
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
const rollup = IsolatedDecl.rollup;
|
|
19
|
+
var rollup_default = rollup;
|
|
6
20
|
|
|
7
21
|
//#endregion
|
|
8
|
-
export { rollup_default as default };
|
|
22
|
+
export { rollup_default as default, rollup as 'module.exports' };
|
package/dist/vite.d.ts
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { IsolatedDecl } from
|
|
2
|
+
* This entry file is for Vite plugin.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { IsolatedDecl } from "./index.js";
|
|
7
7
|
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
declare const
|
|
21
|
-
export default
|
|
8
|
+
* Vite plugin
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* // vite.config.ts
|
|
13
|
+
* import IsolatedDecl from 'unplugin-isolated-decl/vite'
|
|
14
|
+
*
|
|
15
|
+
* export default defineConfig({
|
|
16
|
+
* plugins: [IsolatedDecl()],
|
|
17
|
+
* })
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
declare const vite: typeof IsolatedDecl.vite;
|
|
21
|
+
export default vite;
|
|
22
|
+
export { vite as "module.exports" };
|
package/dist/vite.js
CHANGED
|
@@ -2,7 +2,21 @@ import "./transformer-CBYRFUWY.js";
|
|
|
2
2
|
import { IsolatedDecl } from "./src-BKZ7wewR.js";
|
|
3
3
|
|
|
4
4
|
//#region src/vite.ts
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Vite plugin
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* // vite.config.ts
|
|
11
|
+
* import IsolatedDecl from 'unplugin-isolated-decl/vite'
|
|
12
|
+
*
|
|
13
|
+
* export default defineConfig({
|
|
14
|
+
* plugins: [IsolatedDecl()],
|
|
15
|
+
* })
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
const vite = IsolatedDecl.vite;
|
|
19
|
+
var vite_default = vite;
|
|
6
20
|
|
|
7
21
|
//#endregion
|
|
8
|
-
export { vite_default as default };
|
|
22
|
+
export { vite_default as default, vite as 'module.exports' };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unplugin-isolated-decl",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
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
|
"*": {
|
|
@@ -92,7 +68,7 @@
|
|
|
92
68
|
"magic-string": "^0.30.17",
|
|
93
69
|
"oxc-parser": "^0.48.2",
|
|
94
70
|
"unplugin": "^2.1.2",
|
|
95
|
-
"unplugin-utils": "^0.2.
|
|
71
|
+
"unplugin-utils": "^0.2.3"
|
|
96
72
|
},
|
|
97
73
|
"devDependencies": {
|
|
98
74
|
"@farmfe/core": "^1.6.6",
|
|
@@ -100,7 +76,7 @@
|
|
|
100
76
|
"@rollup/plugin-alias": "^5.1.1",
|
|
101
77
|
"@swc/core": "^1.10.14",
|
|
102
78
|
"@sxzz/eslint-config": "^5.0.1",
|
|
103
|
-
"@sxzz/prettier-config": "^2.1.
|
|
79
|
+
"@sxzz/prettier-config": "^2.1.2",
|
|
104
80
|
"@sxzz/test-utils": "^0.5.1",
|
|
105
81
|
"@types/debug": "^4.1.12",
|
|
106
82
|
"@types/node": "^22.13.1",
|
|
@@ -112,9 +88,9 @@
|
|
|
112
88
|
"prettier": "^3.4.2",
|
|
113
89
|
"rolldown": "^1.0.0-beta.3",
|
|
114
90
|
"rollup": "^4.34.4",
|
|
115
|
-
"rollup-plugin-esbuild": "^6.
|
|
91
|
+
"rollup-plugin-esbuild": "^6.2.0",
|
|
116
92
|
"tinyglobby": "^0.2.10",
|
|
117
|
-
"tsdown": "^0.5.
|
|
93
|
+
"tsdown": "^0.5.8",
|
|
118
94
|
"tsx": "^4.19.2",
|
|
119
95
|
"typescript": "^5.7.3",
|
|
120
96
|
"vite": "^6.1.0",
|
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 {};
|