@visulima/rollup-plugin-dts 0.0.1 → 1.0.0-alpha.10

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/CHANGELOG.md ADDED
@@ -0,0 +1,59 @@
1
+ ## @visulima/rollup-plugin-dts [1.0.0-alpha.10](https://github.com/visulima/packem/compare/@visulima/rollup-plugin-dts@1.0.0-alpha.9...@visulima/rollup-plugin-dts@1.0.0-alpha.10) (2026-04-16)
2
+
3
+ ### Miscellaneous Chores
4
+
5
+ * bump node engines to ^22.14.0 || >=24.10.0 ([32f705a](https://github.com/visulima/packem/commit/32f705aa866f9daea6a094df74ef66aa8088e2c6))
6
+
7
+ ## @visulima/rollup-plugin-dts [1.0.0-alpha.9](https://github.com/visulima/packem/compare/@visulima/rollup-plugin-dts@1.0.0-alpha.8...@visulima/rollup-plugin-dts@1.0.0-alpha.9) (2026-03-28)
8
+
9
+ ## @visulima/rollup-plugin-dts [1.0.0-alpha.8](https://github.com/visulima/packem/compare/@visulima/rollup-plugin-dts@1.0.0-alpha.7...@visulima/rollup-plugin-dts@1.0.0-alpha.8) (2026-03-24)
10
+
11
+ ## @visulima/rollup-plugin-dts [1.0.0-alpha.7](https://github.com/visulima/packem/compare/@visulima/rollup-plugin-dts@1.0.0-alpha.6...@visulima/rollup-plugin-dts@1.0.0-alpha.7) (2026-03-24)
12
+
13
+ ### Miscellaneous Chores
14
+
15
+ * allow typescript 5 and 6 in peerDependencies and examples ([de6362d](https://github.com/visulima/packem/commit/de6362d402f593c11a9eedd04d756d69bade4ac5))
16
+
17
+ ## @visulima/rollup-plugin-dts [1.0.0-alpha.6](https://github.com/visulima/packem/compare/@visulima/rollup-plugin-dts@1.0.0-alpha.5...@visulima/rollup-plugin-dts@1.0.0-alpha.6) (2026-03-24)
18
+
19
+ ### Bug Fixes
20
+
21
+ * **rollup-plugin-dts:** only add export {} for declare module augmentations, not declare global ([c53e3db](https://github.com/visulima/packem/commit/c53e3dbce725ac2579eaa0fdca30e52fc8b43b89))
22
+ * **rollup-plugin-dts:** preserve export {} in module augmentation files ([43c7975](https://github.com/visulima/packem/commit/43c7975cdf1300fbd0e0c949f6b5c3851e5a937c))
23
+ * **rollup-plugin-dts:** preserve JSDoc comment positioning in type aliases ([436f8dc](https://github.com/visulima/packem/commit/436f8dcb4a6ce025a2eb7b537ee7f868f4bbed01))
24
+
25
+ ### Tests
26
+
27
+ * **rollup-plugin-dts:** add triple-slash directive preservation test ([eacac81](https://github.com/visulima/packem/commit/eacac81d49d7ef5917cd7aaf10762dfdac040a0d))
28
+
29
+ ## @visulima/rollup-plugin-dts [1.0.0-alpha.5](https://github.com/visulima/packem/compare/@visulima/rollup-plugin-dts@1.0.0-alpha.4...@visulima/rollup-plugin-dts@1.0.0-alpha.5) (2026-03-24)
30
+
31
+ ### Features
32
+
33
+ * **rollup-plugin-dts:** add include/exclude filter support ([5d76867](https://github.com/visulima/packem/commit/5d76867939d95c1d75469f85a59b9504f3c3f1e4))
34
+
35
+ ### Bug Fixes
36
+
37
+ * **rollup-plugin-dts:** externalize scss/sass/less/styl/stylus imports ([183ff0b](https://github.com/visulima/packem/commit/183ff0b0e58c11d7ee0d11b6ab69b493f01f3b75))
38
+ * **rollup-plugin-dts:** handle function overloads in .d.ts bundling ([afe77ab](https://github.com/visulima/packem/commit/afe77ab941fc51d024c49fea58086d7a6b81073f))
39
+ * **rollup-plugin-dts:** support decorator auto-accessors in .d.ts parsing ([154795a](https://github.com/visulima/packem/commit/154795aa6f5d0f9b39c8ea39c18356bf285c15d4))
40
+ * updated deps ([a50675d](https://github.com/visulima/packem/commit/a50675d7f9a98236edd89bc39bc35b8cb4db1565))
41
+
42
+ ### Miscellaneous Chores
43
+
44
+ * **rollup-plugin-dts:** add explicit return type to loadVueLanguageTools ([cf47a3c](https://github.com/visulima/packem/commit/cf47a3c60fe2c7931d23dedc4162789ce3a8b5c0))
45
+
46
+ ### Tests
47
+
48
+ * **rollup-plugin-dts:** add regression tests for type modifier preservation through export * ([ca9fe87](https://github.com/visulima/packem/commit/ca9fe87b05f37afe6b80263d94b855ef69143ee3)), closes [#225](https://github.com/visulima/packem/issues/225)
49
+ * **rollup-plugin-dts:** add tests for overloads, scss, decorators, infer renaming ([36e0987](https://github.com/visulima/packem/commit/36e09874d3aba9b8f5361dd8899d56865d00bf0b))
50
+
51
+ ## @visulima/rollup-plugin-dts [1.0.0-alpha.4](https://github.com/visulima/packem/compare/@visulima/rollup-plugin-dts@1.0.0-alpha.3...@visulima/rollup-plugin-dts@1.0.0-alpha.4) (2026-03-16)
52
+
53
+ ## @visulima/rollup-plugin-dts [1.0.0-alpha.3](https://github.com/visulima/packem/compare/@visulima/rollup-plugin-dts@1.0.0-alpha.2...@visulima/rollup-plugin-dts@1.0.0-alpha.3) (2026-03-14)
54
+
55
+ ## @visulima/rollup-plugin-dts [1.0.0-alpha.2](https://github.com/visulima/packem/compare/@visulima/rollup-plugin-dts@1.0.0-alpha.1...@visulima/rollup-plugin-dts@1.0.0-alpha.2) (2026-03-06)
56
+
57
+ ### Bug Fixes
58
+
59
+ * fixed broken publishing ([002f29a](https://github.com/visulima/packem/commit/002f29a6a3edf695d98abae0f18c6b0c328ef832))
package/LICENSE.md ADDED
@@ -0,0 +1,45 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 visulima
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ ---
24
+
25
+ The MIT License (MIT)
26
+
27
+ Copyright © 2025-PRESENT Kevin Deng (https://github.com/sxzz)
28
+
29
+ Permission is hereby granted, free of charge, to any person obtaining a copy
30
+ of this software and associated documentation files (the "Software"), to deal
31
+ in the Software without restriction, including without limitation the rights
32
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
33
+ copies of the Software, and to permit persons to whom the Software is
34
+ furnished to do so, subject to the following conditions:
35
+
36
+ The above copyright notice and this permission notice shall be included in all
37
+ copies or substantial portions of the Software.
38
+
39
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
40
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
41
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
42
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
43
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
44
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
45
+ SOFTWARE.
package/README.md CHANGED
@@ -1,45 +1,248 @@
1
1
  # @visulima/rollup-plugin-dts
2
2
 
3
- ## ⚠️ IMPORTANT NOTICE ⚠️
3
+ [![npm version][npm-version-src]][npm-version-href]
4
+ [![npm downloads][npm-downloads-src]][npm-downloads-href]
5
+ [![License][license-src]][license-href]
4
6
 
5
- **This package is created solely for the purpose of setting up OIDC (OpenID Connect) trusted publishing with npm.**
7
+ A Rollup plugin to generate and bundle TypeScript declaration (`.d.ts`) files.
6
8
 
7
- This is **NOT** a functional package and contains **NO** code or functionality beyond the OIDC setup configuration.
9
+ ## Install
8
10
 
9
- ## Purpose
11
+ Requires **`rollup@4.0.0`** or later.
10
12
 
11
- This package exists to:
12
- 1. Configure OIDC trusted publishing for the package name `@visulima/rollup-plugin-dts`
13
- 2. Enable secure, token-less publishing from CI/CD workflows
14
- 3. Establish provenance for packages published under this name
13
+ ```bash
14
+ npm i -D @visulima/rollup-plugin-dts
15
15
 
16
- ## What is OIDC Trusted Publishing?
16
+ npm i -D typescript # install TypeScript if isolatedDeclarations is not enabled
17
+ npm i -D @typescript/native-preview # install TypeScript Go if tsgo is enabled
18
+ ```
17
19
 
18
- OIDC trusted publishing allows package maintainers to publish packages directly from their CI/CD workflows without needing to manage npm access tokens. Instead, it uses OpenID Connect to establish trust between the CI/CD provider (like GitHub Actions) and npm.
20
+ ## Usage
19
21
 
20
- ## Setup Instructions
22
+ Add the plugin to your `rollup.config.js`:
21
23
 
22
- To properly configure OIDC trusted publishing for this package:
24
+ ```js
25
+ // rollup.config.js
26
+ import { dts } from "@visulima/rollup-plugin-dts";
23
27
 
24
- 1. Go to [npmjs.com](https://www.npmjs.com/) and navigate to your package settings
25
- 2. Configure the trusted publisher (e.g., GitHub Actions)
26
- 3. Specify the repository and workflow that should be allowed to publish
27
- 4. Use the configured workflow to publish your actual package
28
+ export default {
29
+ input: "./src/index.ts",
30
+ plugins: [dts()],
31
+ output: [{ dir: "dist", format: "es" }],
32
+ };
33
+ ```
28
34
 
29
- ## DO NOT USE THIS PACKAGE
35
+ ## Options
30
36
 
31
- This package is a placeholder for OIDC configuration only. It:
32
- - Contains no executable code
33
- - Provides no functionality
34
- - Should not be installed as a dependency
35
- - Exists only for administrative purposes
37
+ Configuration options for the plugin.
36
38
 
37
- ## More Information
39
+ ### General Options
38
40
 
39
- For more details about npm's trusted publishing feature, see:
40
- - [npm Trusted Publishing Documentation](https://docs.npmjs.com/generating-provenance-statements)
41
- - [GitHub Actions OIDC Documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect)
41
+ #### `cwd`
42
42
 
43
- ---
43
+ The directory in which the plugin will search for the `tsconfig.json` file.
44
44
 
45
- **Maintained for OIDC setup purposes only**
45
+ #### `dtsInput`
46
+
47
+ Set to `true` if your entry files are `.d.ts` files instead of `.ts` files.
48
+
49
+ When enabled, the plugin will skip generating a `.d.ts` file for the entry point.
50
+
51
+ #### `emitDtsOnly`
52
+
53
+ If `true`, the plugin will emit only `.d.ts` files and remove all other output chunks.
54
+
55
+ This is especially useful when generating `.d.ts` files for the CommonJS format as part of a separate build step.
56
+
57
+ #### `tsconfig`
58
+
59
+ The path to the `tsconfig.json` file.
60
+
61
+ - If set to `false`, the plugin will ignore any `tsconfig.json` file.
62
+ - You can still specify `compilerOptions` directly in the options.
63
+
64
+ **Default:** `'tsconfig.json'`
65
+
66
+ #### `tsconfigRaw`
67
+
68
+ Pass a raw `tsconfig.json` object directly to the plugin.
69
+
70
+ See: [TypeScript tsconfig documentation](https://www.typescriptlang.org/tsconfig)
71
+
72
+ #### `compilerOptions`
73
+
74
+ Override the `compilerOptions` specified in `tsconfig.json`.
75
+
76
+ See: [TypeScript compilerOptions documentation](https://www.typescriptlang.org/tsconfig/#compilerOptions)
77
+
78
+ #### `sourcemap`
79
+
80
+ If `true`, the plugin will generate declaration maps (`.d.ts.map`) for `.d.ts` files.
81
+
82
+ #### `resolve`
83
+
84
+ Controls whether type definitions from `node_modules` are bundled into your final `.d.ts` file or kept as external `import` statements.
85
+
86
+ By default, dependencies are external, resulting in `import { Type } from 'some-package'`. When bundled, this `import` is removed, and the type definitions from `some-package` are copied directly into your file.
87
+
88
+ - `true`: Bundles all dependencies.
89
+ - `false`: (Default) Keeps all dependencies external.
90
+ - `(string | RegExp)[]`: Bundles only dependencies matching the provided strings or regular expressions (e.g. `['pkg-a', /^@scope\//]`).
91
+
92
+ #### `resolver`
93
+
94
+ Specifies a resolver to resolve type definitions, especially for `node_modules`.
95
+
96
+ - `'oxc'`: (Default) Uses Oxc's module resolution, which is faster and more efficient.
97
+ - `'tsc'`: Uses TypeScript's native module resolution, which may be more compatible with complex setups, but slower.
98
+
99
+ **Default:** `'oxc'`
100
+
101
+ #### `cjsDefault`
102
+
103
+ Determines how the default export is emitted.
104
+
105
+ If set to `true`, and you are only exporting a single item using `export default ...`,
106
+ the output will use `export = ...` instead of the standard ES module syntax.
107
+ This is useful for compatibility with CommonJS.
108
+
109
+ #### `sideEffects`
110
+
111
+ Indicates whether the generated `.d.ts` files have side effects.
112
+
113
+ - If `true`, Rollup will treat the `.d.ts` files as having side effects during tree-shaking.
114
+ - If `false`, Rollup may consider the `.d.ts` files as side-effect-free, potentially removing them if they are not imported.
115
+
116
+ **Default:** `false`
117
+
118
+ ### `tsc` Options
119
+
120
+ > [!NOTE]
121
+ > These options are only applicable when `oxc` and `tsgo` are not enabled.
122
+
123
+ #### `banner`
124
+
125
+ Content to be added at the top of each generated `.d.ts` file.
126
+
127
+ #### `footer`
128
+
129
+ Content to be added at the bottom of each generated `.d.ts` file.
130
+
131
+ #### `build`
132
+
133
+ Build mode for the TypeScript compiler:
134
+
135
+ - If `true`, the plugin will use [`tsc -b`](https://www.typescriptlang.org/docs/handbook/project-references.html#build-mode-for-typescript) to build the project and all referenced projects before emitting `.d.ts` files.
136
+ - If `false`, the plugin will use [`tsc`](https://www.typescriptlang.org/docs/handbook/compiler-options.html) to emit `.d.ts` files without building referenced projects.
137
+
138
+ **Default:** `false`
139
+
140
+ #### `incremental`
141
+
142
+ Controls how project references and incremental builds are handled:
143
+
144
+ - If `incremental` is `true`, all built files (including [`.tsbuildinfo`](https://www.typescriptlang.org/tsconfig/#tsBuildInfoFile)) will be written to disk, similar to running `tsc -b` in your project.
145
+ - If `incremental` is `false`, built files are kept in memory, minimizing disk usage.
146
+
147
+ Enabling this option can speed up builds by caching previous results, which is helpful for large projects with multiple references.
148
+
149
+ **Default:** `true` if your `tsconfig` has [`incremental`](https://www.typescriptlang.org/tsconfig/#incremental) or [`tsBuildInfoFile`](https://www.typescriptlang.org/tsconfig/#tsBuildInfoFile) enabled.
150
+
151
+ #### `vue`
152
+
153
+ If `true`, the plugin will generate `.d.ts` files using `vue-tsc`.
154
+
155
+ #### `tsMacro`
156
+
157
+ If `true`, the plugin will generate `.d.ts` files using `@ts-macro/tsc`.
158
+
159
+ #### `parallel`
160
+
161
+ If `true`, the plugin will launch a separate process for `tsc` or `vue-tsc`, enabling parallel processing of multiple projects.
162
+
163
+ #### `eager`
164
+
165
+ If `true`, the plugin will prepare all files listed in `tsconfig.json` for `tsc` or `vue-tsc`.
166
+
167
+ This is especially useful when you have a single `tsconfig.json` for multiple projects in a monorepo.
168
+
169
+ #### `newContext`
170
+
171
+ If `true`, the plugin will create a new isolated context for each build,
172
+ ensuring that previously generated `.d.ts` code and caches are not reused.
173
+
174
+ By default, the plugin may reuse internal caches or incremental build artifacts
175
+ to speed up repeated builds. Enabling this option forces a clean context,
176
+ guaranteeing that all type definitions are generated from scratch.
177
+
178
+ The `invalidateContextFile` API can be used to clear invalidated files from the context:
179
+
180
+ ```ts
181
+ import { globalContext, invalidateContextFile } from "@visulima/rollup-plugin-dts/tsc";
182
+ invalidateContextFile(globalContext, "src/foo.ts");
183
+ ```
184
+
185
+ #### `emitJs`
186
+
187
+ If `true`, the plugin will emit `.d.ts` files for `.js` files as well.
188
+ This is useful when you want to generate type definitions for JavaScript files with JSDoc comments.
189
+
190
+ Enabled by default when `allowJs` in compilerOptions is `true`.
191
+
192
+ ### Oxc
193
+
194
+ #### `oxc`
195
+
196
+ If `true`, the plugin will generate `.d.ts` files using [Oxc](https://oxc.rs/docs/guide/usage/transformer.html), which is significantly faster than the TypeScript compiler.
197
+
198
+ This option is automatically enabled when `isolatedDeclarations` in `compilerOptions` is set to `true`.
199
+
200
+ ### TypeScript Go
201
+
202
+ > [!WARNING]
203
+ > This feature is experimental and not yet recommended for production environments.
204
+
205
+ #### `tsgo`
206
+
207
+ **[Experimental]** Enables DTS generation using [`tsgo`](https://github.com/microsoft/typescript-go).
208
+
209
+ To use this option, ensure that `@typescript/native-preview` is installed as a dependency.
210
+
211
+ `tsconfigRaw` and `compilerOptions` options will be ignored when this option is enabled.
212
+
213
+ ## Differences from `rollup-plugin-dts`
214
+
215
+ ### Isolated Declarations
216
+
217
+ The plugin leverages Oxc's `isolatedDeclarations` to generate `.d.ts` files when `isolatedDeclarations` is enabled,
218
+ offering significantly faster performance compared to the `typescript` compiler.
219
+
220
+ ### Single Build for ESM
221
+
222
+ `@visulima/rollup-plugin-dts` generates separate chunks for `.d.ts` files, enabling both source code (`.js`)
223
+ and type definition files (`.d.ts`) to be produced in a single build process.
224
+
225
+ However, this functionality is limited to ESM output format. Consequently,
226
+ **two** distinct build processes are required for CommonJS source code (`.cjs`)
227
+ and its corresponding type definition files (`.d.cts`).
228
+ In such cases, the `emitDtsOnly` option can be particularly helpful.
229
+
230
+ ## Credits
231
+
232
+ This project is a Rollup adaptation of [rolldown-plugin-dts](https://github.com/sxzz/rolldown-plugin-dts)
233
+ and is inspired by [rollup-plugin-dts](https://github.com/Swatinem/rollup-plugin-dts).
234
+ We extend our gratitude to the original creators for their contributions.
235
+ The test suite is authorized by them and distributed under the MIT license.
236
+
237
+ ## License
238
+
239
+ [MIT](./LICENSE) License © 2025-present [Daniel Bannert](https://github.com/prisis)
240
+
241
+ <!-- Badges -->
242
+
243
+ [npm-version-src]: https://img.shields.io/npm/v/@visulima/rollup-plugin-dts.svg?style=flat-square
244
+ [npm-version-href]: https://npmjs.com/package/@visulima/rollup-plugin-dts
245
+ [npm-downloads-src]: https://img.shields.io/npm/dm/@visulima/rollup-plugin-dts.svg?style=flat-square
246
+ [npm-downloads-href]: https://www.npmcharts.com/compare/@visulima/rollup-plugin-dts?interval=30
247
+ [license-src]: https://img.shields.io/npm/l/@visulima/rollup-plugin-dts.svg?style=flat-square
248
+ [license-href]: https://npmjs.com/package/@visulima/rollup-plugin-dts
@@ -0,0 +1,17 @@
1
+ import { PreRenderedChunk } from 'rollup';
2
+
3
+ declare const RE_JS: RegExp;
4
+ declare const RE_TS: RegExp;
5
+ declare const RE_DTS: RegExp;
6
+ declare const RE_DTS_MAP: RegExp;
7
+ declare const RE_NODE_MODULES: RegExp;
8
+ declare const RE_CSS: RegExp;
9
+ declare const RE_VUE: RegExp;
10
+ declare const RE_JSON: RegExp;
11
+ declare const filename_js_to_dts: (id: string) => string;
12
+ declare const filename_to_dts: (id: string) => string;
13
+ declare const filename_dts_to: (id: string, extension: "js" | "ts") => string;
14
+ declare const resolveTemplateFn: (function_: ((chunk: PreRenderedChunk) => string) | string, chunk: PreRenderedChunk) => string;
15
+ declare const replaceTemplateName: (template: string, name: string) => string;
16
+
17
+ export { RE_CSS, RE_DTS, RE_DTS_MAP, RE_JS, RE_JSON, RE_NODE_MODULES, RE_TS, RE_VUE, filename_dts_to, filename_js_to_dts, filename_to_dts, replaceTemplateName, resolveTemplateFn };
@@ -0,0 +1 @@
1
+ var _=Object.defineProperty;var a=(e,s)=>_(e,"name",{value:s,configurable:!0});var m=Object.defineProperty,t=a((e,s)=>m(e,"name",{value:s,configurable:!0}),"s");const l=/\.([cm]?)jsx?$/,c=/\.([cm]?)tsx?$/,r=/\.d\.([cm]?)ts$/,d=/\.d\.([cm]?)ts\.map$/,$=/[\\/]node_modules[\\/]/,E=/\.(?:css|scss|sass|less|styl|stylus)$/,n=/\.vue$/,o=/\.json$/,f=t(e=>e.replace(l,".d.$1ts"),"filename_js_to_dts"),i=t(e=>e.replace(n,".vue.ts").replace(c,".d.$1ts").replace(l,".d.$1ts").replace(o,".json.d.ts"),"filename_to_dts"),u=t((e,s)=>e.replace(r,`.$1${s}`),"filename_dts_to"),R=t((e,s)=>typeof e=="function"?e(s):e,"resolveTemplateFn"),S=t((e,s)=>e.replaceAll("[name]",s),"replaceTemplateName");export{E as RE_CSS,r as RE_DTS,d as RE_DTS_MAP,l as RE_JS,o as RE_JSON,$ as RE_NODE_MODULES,c as RE_TS,n as RE_VUE,u as filename_dts_to,f as filename_js_to_dts,i as filename_to_dts,S as replaceTemplateName,R as resolveTemplateFn};
@@ -0,0 +1,61 @@
1
+ import { AddonFunction, Plugin } from 'rollup';
2
+ import { TsConfigJson } from '@visulima/tsconfig';
3
+ import { IsolatedDeclarationsOptions } from 'oxc-transform';
4
+ export { RE_CSS, RE_DTS, RE_DTS_MAP, RE_JS, RE_JSON, RE_NODE_MODULES, RE_TS, RE_VUE } from './filename.js';
5
+
6
+ type FilterPattern = ReadonlyArray<string | RegExp> | string | RegExp | null;
7
+ interface GeneralOptions {
8
+ cjsDefault?: boolean;
9
+ exclude?: FilterPattern;
10
+ compilerOptions?: TsConfigJson.CompilerOptions;
11
+ cwd?: string;
12
+ dtsInput?: boolean;
13
+ emitDtsOnly?: boolean;
14
+ include?: FilterPattern;
15
+ resolve?: boolean | (string | RegExp)[];
16
+ resolver?: "oxc" | "tsc";
17
+ sideEffects?: boolean;
18
+ sourcemap?: boolean;
19
+ tsconfig?: string | boolean;
20
+ tsconfigRaw?: Omit<TsConfigJson, "compilerOptions">;
21
+ }
22
+ interface TscOptions {
23
+ banner?: string | Promise<string> | AddonFunction;
24
+ build?: boolean;
25
+ eager?: boolean;
26
+ emitJs?: boolean;
27
+ footer?: string | Promise<string> | AddonFunction;
28
+ incremental?: boolean;
29
+ newContext?: boolean;
30
+ parallel?: boolean;
31
+ tsMacro?: boolean;
32
+ vue?: boolean;
33
+ }
34
+ interface Options extends GeneralOptions, TscOptions {
35
+ oxc?: boolean | Omit<IsolatedDeclarationsOptions, "sourcemap">;
36
+ tsgo?: boolean | {
37
+ path?: string;
38
+ };
39
+ }
40
+ type Overwrite<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;
41
+ type MarkPartial<T, K extends keyof T> = Omit<Required<T>, K> & Partial<Pick<T, K>>;
42
+ type OptionsResolved = Overwrite<MarkPartial<Omit<Options, "compilerOptions">, "banner" | "footer">, {
43
+ exclude: FilterPattern;
44
+ include: FilterPattern;
45
+ oxc: IsolatedDeclarationsOptions | false;
46
+ tsconfig?: string;
47
+ tsconfigRaw: TsConfigJson;
48
+ tsgo: {
49
+ path?: string;
50
+ } | false;
51
+ }>;
52
+ declare const resolveOptions: ({ banner, build, cjsDefault, compilerOptions, cwd, dtsInput, eager, emitDtsOnly, emitJs, exclude, footer, include, incremental, newContext, oxc, parallel, resolve, resolver, sideEffects, sourcemap, tsconfig, tsconfigRaw: overriddenTsconfigRaw, tsgo: tsgoOption, tsMacro, vue, }: Options) => OptionsResolved;
53
+
54
+ declare const createFakeJsPlugin: ({ cjsDefault, sideEffects, sourcemap }: Pick<OptionsResolved, "sourcemap" | "cjsDefault" | "sideEffects">) => Plugin;
55
+
56
+ declare const createGeneratePlugin: ({ build, cwd, eager, emitDtsOnly, emitJs, exclude, include, incremental, newContext, oxc, parallel, sourcemap, tsconfig, tsconfigRaw, tsgo, tsMacro, vue, }: Pick<OptionsResolved, "cwd" | "tsconfig" | "tsconfigRaw" | "build" | "incremental" | "oxc" | "emitDtsOnly" | "vue" | "tsMacro" | "parallel" | "eager" | "tsgo" | "newContext" | "emitJs" | "sourcemap" | "include" | "exclude">) => Plugin;
57
+
58
+ declare const dts: (options?: Options) => Plugin[];
59
+
60
+ export { createFakeJsPlugin, createGeneratePlugin, dts, resolveOptions };
61
+ export type { FilterPattern, Options };
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ var R=Object.defineProperty;var c=(t,e)=>R(t,"name",{value:e,configurable:!0});import{createDebug as w}from"obug";import O from"magic-string";import{RE_DTS as p,resolveTemplateFn as F,replaceTemplateName as h,RE_TS as $,RE_VUE as D,RE_JSON as N,RE_CSS as k,RE_NODE_MODULES as j,filename_to_dts as x}from"./filename.js";import{RE_DTS_MAP as ie,RE_JS as ae}from"./filename.js";import T from"./packem_shared/createFakeJsPlugin-C_mwUsJT.js";import{c as C}from"./packem_shared/generate-BnWcSpbk.js";import{resolveOptions as I}from"./packem_shared/resolveOptions-MWViYRPS.js";import S from"node:path";import{ResolverFactory as J}from"oxc-resolver";var M=Object.defineProperty,A=c((t,e)=>M(t,"name",{value:e,configurable:!0}),"o$2");const U=A(({banner:t,footer:e})=>({name:"rollup-plugin-dts:banner",async renderChunk(r,a){if(!p.test(a.fileName))return;const o=new O(r);if(t){const l=await(typeof t=="function"?t(a):t);l&&o.prepend(`${l}
2
+ `)}if(e){const l=await(typeof e=="function"?e(a):e);l&&o.append(`
3
+ ${l}`)}return{code:o.toString(),get map(){return o.generateMap({hires:"boundary",includeContent:!0,source:a.fileName})}}}}),"createBannerPlugin");var W=Object.defineProperty,q=c((t,e)=>W(t,"name",{value:e,configurable:!0}),"m");const z=q(({sideEffects:t})=>({name:"rollup-plugin-dts:dts-input",options:t===!1?e=>({treeshake:e.treeshake===!1?!1:{...typeof e.treeshake=="object"&&e.treeshake!==null?e.treeshake:{},moduleSideEffects:!1},...e}):void 0,outputOptions(e){return{...e,entryFileNames(r){const{entryFileNames:a}=e;if(a){const o=F(a,r),l=h(o,r.name);if(p.test(l))return o;const d=h(o,`${r.name}.d`);if(p.test(d))return d}return p.test(r.name)?r.name:r.name.endsWith(".d")?"[name].ts":"[name].d.ts"}}}}),"createDtsInputPlugin");var B=Object.defineProperty,v=c((t,e)=>B(t,"name",{value:e,configurable:!0}),"o$1");const g=v(t=>$.test(t)||D.test(t)||N.test(t),"isSourceFile"),G=v(({cwd:t,resolve:e,resolver:r,sideEffects:a,tsconfig:o,tsconfigRaw:l})=>{const d=new J({conditionNames:["types","typings","import","require"],mainFields:["types","typings","module","main"],tsconfig:o?{configFile:o,references:"auto"}:void 0}),y=a?!0:null;return{name:"rollup-plugin-dts:resolver",resolveId:{async handler(s,i,u){if(!i||!p.test(i))return;const n={external:!0,id:s,moduleSideEffects:a};if(k.test(s))return n;const m=await this.resolve(s,i,u);if(m?.external)return n;const f=await P(s,i,m);return f?j.test(f)&&!_(s)?n:p.test(f)?{id:f,moduleSideEffects:y}:g(f)?(await this.load({id:f}),{id:x(f),moduleSideEffects:y}):null:E(s)?null:n},order:"pre"}};function _(s){return typeof e=="boolean"?e:e.some(i=>typeof i=="string"?s===i:i.test(s))}async function P(s,i,u){let n;if(r==="tsc"){const{default:m}=await import("./packem_chunks/resolver.js");n=m(s,i,t,o,l)}else n=d.resolveDtsSync(i,s).path;return n&&(n=S.normalize(n)),!n||!g(n)?u&&E(u.id)&&g(u.id)&&!u.external?u.id:null:n}},"createDtsResolvePlugin"),E=v(t=>t.startsWith(".")||S.isAbsolute(t),"isFilePath");var L=Object.defineProperty,V=c((t,e)=>L(t,"name",{value:e,configurable:!0}),"o");const b=w("rollup-plugin-dts:options"),ne=V((t={})=>{b("resolving dts options");const e=I(t);b("resolved dts options %o",e);const r=[];return t.dtsInput?r.push(z(e)):r.push(C(e)),r.push(G(e),T(e)),(t.banner||t.footer)&&r.push(U(e)),r},"dts");export{k as RE_CSS,p as RE_DTS,ie as RE_DTS_MAP,ae as RE_JS,N as RE_JSON,j as RE_NODE_MODULES,$ as RE_TS,D as RE_VUE,T as createFakeJsPlugin,C as createGeneratePlugin,ne as dts,I as resolveOptions};
@@ -0,0 +1 @@
1
+ var q=Object.defineProperty;var h=(e,t)=>q(e,"name",{value:t,configurable:!0});import{createDebug as P}from"obug";import u from"typescript";import{g as F,X as N}from"../packem_shared/generate-BnWcSpbk.js";import{posix as w}from"node:path";import{pathToFileURL as j}from"node:url";var T=Object.defineProperty,S=h((e,t)=>T(e,"name",{value:t,configurable:!0}),"i");const U=P("rollup-plugin-dts:tsc-system"),x=S(e=>({...u.sys,deleteFile(t,...r){e.delete(t),u.sys.deleteFile?.(t,...r)},directoryExists(t){return[...e.keys()].some(r=>r.startsWith(t))?!0:u.sys.directoryExists(t)},fileExists(t){return e.has(t)?!0:u.sys.fileExists(t)},readFile(t,...r){return e.has(t)?e.get(t):u.sys.readFile(t,...r)},resolvePath(t){return e.has(t)?t:u.sys.resolvePath(t)},write(t){U(t)},writeFile(t,r,...o){e.set(t,r),u.sys.writeFile(t,r,...o)}}),"createFsSystem"),B=S(e=>({...x(e),deleteFile(t){e.delete(t)},writeFile(t,r){e.set(t,r)}}),"createMemorySystem");var J=Object.defineProperty,$=h((e,t)=>J(e,"name",{value:t,configurable:!0}),"s$1");const W=$(e=>{const t=$(r=>u.isPropertySignature(r)&&u.isPrivateIdentifier(r.name)?e.factory.updatePropertySignature(r,r.modifiers,e.factory.createStringLiteral(r.name.text),r.questionToken,r.type):u.visitEachChild(r,t,e),"visitor");return r=>u.visitNode(r,t,u.isSourceFile)??r},"stripPrivateFields"),M={getCanonicalFileName:u.sys.useCaseSensitiveFileNames?e=>e:e=>e.toLowerCase(),getCurrentDirectory:$(()=>u.sys.getCurrentDirectory(),"getCurrentDirectory"),getNewLine:$(()=>u.sys.newLine,"getNewLine")},O={afterDeclarations:[W]},R=$((e,t,r)=>{if(!e||e.sourceRoot)return;const o=w.dirname(j(t).pathname),s=w.dirname(j(r).pathname);o!==s&&(e.sourceRoot=w.relative(s,o))},"setSourceMapRoot");var z=Object.defineProperty,m=h((e,t)=>z(e,"name",{value:t,configurable:!0}),"f$1");const g=P("rollup-plugin-dts:tsc-build"),H=m((e,t,r,o,s)=>{let i=e.projects.get(r);return i?(g(`skip building projects for ${r}`),i):(i=G(t,r,o,s),e.projects.set(r,i),i)},"getOrBuildProjects"),G=m((e,t,r,o)=>{g(`start building projects for ${t}`);const s=V(t,e,r,o);g("collected %d projects: %j",s.length,s.map(n=>n.tsconfigPath));const i=u.createSolutionBuilderHost(e,I),l=u.createSolutionBuilder(i,[t],{force:r,verbose:!0}).build(void 0,void 0,void 0,n=>(g(`transforming project ${n}`),O));g(`built solution for ${t} with exit status ${l}`);const a=new Map;for(const n of s)for(const c of n.parsedConfig.fileNames)a.set(e.resolvePath(c),n);return a},"buildProjects"),V=m((e,t,r,o)=>{const s=new Set,i=[],l=[t.resolvePath(e)];for(;;){const a=l.pop();if(!a)break;if(s.has(a))continue;s.add(a);const n=A(a,t);if(n){n.options=D(n.options,{force:r,sourcemap:o,tsconfigPath:a}),i.push({parsedConfig:n,tsconfigPath:a});for(const c of n.projectReferences??[])l.push(u.resolveProjectReferencePath(c))}}return i},"collectProjectGraph"),A=m((e,t)=>{const r=[],o=u.getParsedCommandLineOfConfigFile(e,void 0,{...t,onUnRecoverableConfigFileDiagnostic:m(s=>{r.push(s)},"onUnRecoverableConfigFileDiagnostic")});if(r.length>0)throw new Error(`[rollup-plugin-dts] Unable to read ${e}: ${u.formatDiagnostics(r,M)}`);return o},"parseTsconfig"),D=m((e,t)=>{const r=e.noEmit??!1,o=e.declaration??!!e.composite,s=e.declarationMap??!1,i=t?.tsconfigPath&&!t.force;return r===!0&&(e={...e,noEmit:!1},i&&console.warn(`[rollup-plugin-dts] ${t.tsconfigPath} has "noEmit" set to true. Please set it to false to generate declaration files.`)),o===!1&&(e={...e,declaration:!0},i&&console.warn(`[rollup-plugin-dts] ${t.tsconfigPath} has "declaration" set to false. Please set it to true to generate declaration files.`)),s===!1&&t?.sourcemap&&(e={...e,declarationMap:!0},i&&console.warn(`[rollup-plugin-dts] ${t.tsconfigPath} has "declarationMap" set to false. Please set it to true if you want to generate source maps for declaration files.`)),e},"patchCompilerOptions"),I=m((e,t,...r)=>u.createEmitAndSemanticDiagnosticsBuilderProgram(e,D(t??{},null),...r),"createProgramWithPatchedCompilerOptions"),L=m(e=>{const{context:t=F,id:r,incremental:o,sourcemap:s,tsconfig:i}=e;if(g(`running tscEmitBuild id: ${r}, tsconfig: ${i}, incremental: ${o}`),!i)return{error:"[rollup-plugin-dts] build mode requires a tsconfig path"};const l=(o?x:B)(t.files),a=l.resolvePath(r);a!==r&&g(`resolved id from ${r} to ${a}`);const n=H(t,l,i,!o,s).get(a);if(!n)return g(`unable to locate a project containing ${a}`),{error:`Unable to locate ${r} from the given tsconfig file ${i}`};g(`loaded project ${n.tsconfigPath} for ${r}`);const c=!l.useCaseSensitiveFileNames,f=u.getOutputFileNames(n.parsedConfig,a,c);let v,y;for(const d of f){if(d.endsWith(".d.ts")){if(!l.fileExists(d)){console.warn(`[rollup-plugin-dts] Unable to read file ${d}`);continue}v=l.readFile(d);continue}if(d.endsWith(".d.ts.map")){if(!l.fileExists(d))continue;const E=l.readFile(d);if(!E){console.warn(`[rollup-plugin-dts] Unexpected sourcemap ${d}`);continue}y=JSON.parse(E),R(y,d,a)}}return v?{code:v,map:y}:o?(g("incremental build failed"),L({...e,incremental:!1})):(g(`unable to build .d.ts file for ${r}`),n.parsedConfig.options.declaration!==!0?{error:`Unable to build .d.ts file for ${r}; Make sure the "declaration" option is set to true in ${n.tsconfigPath}`}:{error:`Unable to build .d.ts file for ${r}; This seems like a bug of rollup-plugin-dts. Please report this issue to https://github.com/sxzz/rollup-plugin-dts/issues`})},"tscEmitBuild");var K=Object.defineProperty,b=h((e,t)=>K(e,"name",{value:t,configurable:!0}),"g");const X=b(()=>{const e=P("rollup-plugin-dts:vue");e("loading vue language tools");try{const t=require.resolve("vue-tsc"),{proxyCreateProgram:r}=require(require.resolve("@volar/typescript",{paths:[t]})),o=require(require.resolve("@vue/language-core",{paths:[t]}));return{getLanguagePlugin:b((s,i)=>{const l=i.options.$rootDir,a=i.options.$configRaw,n=new o.CompilerOptionsResolver(s,s.sys.readFile);n.addConfig(a?.vueCompilerOptions??{},l);const c=n.build();return o.createVueLanguagePlugin(s,i.options,c,f=>f)},"getLanguagePlugin"),proxyCreateProgram:r}}catch(t){throw e("vue language tools not found",t),new Error("Failed to load vue language tools. Please manually install vue-tsc.")}},"loadVueLanguageTools"),Y=b(()=>{const e=P("rollup-plugin-dts:ts-macro");e("loading ts-macro language tools");try{const t=require.resolve("@ts-macro/tsc"),{proxyCreateProgram:r}=require(require.resolve("@volar/typescript",{paths:[t]})),o=require(require.resolve("@ts-macro/language-plugin",{paths:[t]})),{getOptions:s}=require(require.resolve("@ts-macro/language-plugin/options",{paths:[t]}));return{getLanguagePlugin:b((i,l)=>{const a=l.options.$rootDir;return o.getLanguagePlugins(i,l.options,s(i,a))[0]},"getLanguagePlugin"),proxyCreateProgram:r}}catch(t){throw e("ts-macro language tools not found",t),new Error("Failed to load ts-macro language tools. Please manually install @ts-macro/tsc.")}},"loadTsMacro"),Q=b((e,t)=>{const r=t.vue?X():void 0,o=t.tsMacro?Y():void 0,s=r?.proxyCreateProgram||o?.proxyCreateProgram;return s?s(e,e.createProgram,(i,l)=>{const a=[];return r&&a.push(r.getLanguagePlugin(i,l)),o&&a.push(o.getLanguagePlugin(i,l)),{languagePlugins:a}}):e.createProgram},"createProgramFactory");var Z=Object.defineProperty,C=h((e,t)=>Z(e,"name",{value:t,configurable:!0}),"m");const p=P("rollup-plugin-dts:tsc-compiler"),_={checkJs:!1,declaration:!0,declarationMap:!1,emitDeclarationOnly:!0,moduleResolution:u.ModuleResolutionKind.Bundler,noEmit:!1,noEmitOnError:!0,resolveJsonModule:!0,skipLibCheck:!0,target:99},ee=C(e=>{const{context:t=F,entries:r,id:o}=e,s=t.programs.find(l=>{const a=l.getRootFileNames();return r?r.every(n=>a.includes(n)):a.includes(o)});if(s){const l=s.getSourceFile(o);if(l)return{file:l,program:s}}p(`create program for module: ${o}`);const i=te(e);return p(`created program for module: ${o}`),t.programs.push(i.program),i},"createOrGetTsModule"),te=C(({context:e=F,cwd:t,entries:r,id:o,tsconfig:s,tsconfigRaw:i,tsMacro:l,vue:a})=>{const n=x(e.files),c=s?N(s):t,f=u.parseJsonConfigFileContent(i,n,c);return p(`Creating program for root project: ${c}`),re({baseDir:c,entries:r,fsSystem:n,id:o,parsedConfig:f,tsMacro:l,vue:a})},"createTsProgram"),re=C(({baseDir:e,entries:t,fsSystem:r,id:o,parsedConfig:s,tsMacro:i,vue:l})=>{const a={..._,...s.options,$configRaw:s.raw,$rootDir:e},n=[...new Set([o,...t||s.fileNames].map(y=>r.resolvePath(y)))],c=u.createCompilerHost(a,!0),f=Q(u,{tsMacro:i,vue:l})({host:c,options:a,projectReferences:s.projectReferences,rootNames:n}),v=f.getSourceFile(o);if(!v)throw p(`source file not found in program: ${o}`),s.projectReferences?.length?new Error(`[rollup-plugin-dts] Unable to load ${o}; You have "references" in your tsconfig file. Perhaps you want to add \`dts: { build: true }\` in your config?`):r.fileExists(o)?(p(`File ${o} exists on disk.`),new Error(`Unable to load file ${o} from the program. This seems like a bug of rollup-plugin-dts. Please report this issue to https://github.com/sxzz/rollup-plugin-dts/issues`)):(p(`File ${o} does not exist on disk.`),new Error(`Source file not found: ${o}`));return{file:v,program:f}},"createTsProgramFromParsedConfig"),oe=C(e=>{p(`running tscEmitCompiler ${e.id}`);const t=ee(e),{file:r,program:o}=t;p(`got source file: ${r.fileName}`);let s,i;const{diagnostics:l,emitSkipped:a}=o.emit(r,(n,c)=>{n.endsWith(".map")?(p(`emit dts sourcemap: ${n}`),i=JSON.parse(c),R(i,n,e.id)):(p(`emit dts: ${n}`),s=c)},void 0,!0,O,!0);return a&&l.length>0?{error:u.formatDiagnostics(l,M)}:(!s&&r.isDeclarationFile&&(p("nothing was emitted. fallback to sourceFile text."),s=r.getFullText()),{code:s,map:i})},"tscEmitCompiler");var se=Object.defineProperty,ie=h((e,t)=>se(e,"name",{value:t,configurable:!0}),"r");const k=P("rollup-plugin-dts:tsc");k(`loaded typescript: ${u.version}`);const pe=ie(e=>(k(`running tscEmit ${e.id}`),e.build?L(e):oe(e)),"tscEmit");export{pe as tscEmit};
@@ -0,0 +1 @@
1
+ var m=Object.defineProperty;var l=(e,o)=>m(e,"name",{value:o,configurable:!0});import p from"node:path";import{createDebug as v}from"obug";import r from"typescript";var c=Object.defineProperty,f=l((e,o)=>c(e,"name",{value:o,configurable:!0}),"t");const g=v("rollup-plugin-dts:tsc-resolver"),F=f((e,o,n,s,i,a)=>{const d=s?p.dirname(s):n,u=r.parseJsonConfigFileContent(i,r.sys,d),t=r.bundlerModuleNameResolver(e,o,u.options,r.sys,void 0,a);return g('tsc resolving id "%s" from "%s" -> %O',e,o,t.resolvedModule),t.resolvedModule?.resolvedFileName},"tscResolve");export{F as default};
@@ -0,0 +1 @@
1
+ var Se=Object.defineProperty;var _=(e,i)=>Se(e,"name",{value:i,configurable:!0});import ie from"node:path";import{generate as ae}from"@babel/generator";import{isIdentifierName as Ee}from"@babel/helper-validator-identifier";import{parse as oe}from"@babel/parser";import f from"@babel/types";import{isTypeOf as K,isDeclarationType as De,walkAST as V,resolveString as H,isIdentifierOf as Z}from"ast-kit";import{RE_DTS as P,resolveTemplateFn as be,filename_js_to_dts as se,replaceTemplateName as le,filename_dts_to as ce,RE_DTS_MAP as Te,filename_to_dts as ve}from"../filename.js";var Ie=Object.defineProperty,E=_((e,i)=>Ie(e,"name",{value:i,configurable:!0}),"c");const z="__rollup_dts_resolve__:",Qe=E(({cjsDefault:e,sideEffects:i,sourcemap:S})=>{let t=0;const M=new Map,O=new Map,B=new Map;return{generateBundle(p,o){const u=new Map;for(const n of Object.values(o))if(n.type==="chunk")for(const y of n.moduleIds)u.set(y,n.fileName);const d=new RegExp(`"${z}(.+?)"`,"g");for(const n of Object.values(o))n.type!=="chunk"||!P.test(n.fileName)||n.code.includes(z)&&(n.code=n.code.replaceAll(d,(y,C)=>{const x=u.get(C);if(!x)return y;let v=ie.posix.relative(ie.posix.dirname(n.fileName),x);return v.startsWith(".")||(v=`./${v}`),v=ce(v,"js"),JSON.stringify(v)}));for(const n of Object.values(o))if(Te.test(n.fileName))if(S){if(n.type==="chunk"||typeof n.source!="string")continue;const y=JSON.parse(n.source);y.sourcesContent=void 0,n.source=JSON.stringify(y)}else delete o[n.fileName]},name:"rollup-plugin-dts:fake-js",outputOptions(p){const{chunkFileNames:o,entryFileNames:u}=p;return(p.format==="cjs"||p.format==="commonjs")&&(p={...p,format:"es"}),{...p,chunkFileNames(d){const n=be(d.isEntry?u||"[name].js":o||"[name]-[hash].js",d);if(d.name.endsWith(".d")){const y=se(le(n,d.name.slice(0,-2)));if(P.test(y))return y;const C=se(le(n,d.name));if(P.test(C))return C}return n},sourcemap:p.sourcemap||S}},renderChunk:k,async transform(p,o){if(P.test(o))return $.call(this,p,o)}};async function $(p,o){const u=Object.create(null),d=oe(p,{createParenthesizedExpressions:!0,errorRecovery:!0,plugins:[["typescript",{dts:!0}],"decoratorAutoAccessors"],sourceType:"module"}),{comments:n,program:y}=d,C=[];if(n){const D=fe(n);O.set(o,D)}const x=[],v=new Map,a=new Map,r=new Set;for(const[D,s]of y.body.entries()){const j=E(c=>y.body[D]=c,"setStmt");if(ke(s,j,C))continue;const w=s.type==="TSModuleDeclaration"&&s.kind!=="namespace";let h;if(w&&s.id.type==="StringLiteral"){const c=await this.resolve(s.id.value,o);c&&!c.external?h=P.test(c.id)?c.id:ve(c.id):s.id.value[0]==="."&&this.warn(`\`declare module ${JSON.stringify(s.id.value)}\` will be kept as-is in the output. Relative module declaration may cause unexpected issues. Found in ${o}.`)}if(w&&o.endsWith(".vue.d.ts")&&p.slice(s.start,s.end).includes("__VLS_"))continue;const U=s.type==="ExportDefaultDeclaration",W=K(s,["ExportNamedDeclaration","ExportDefaultDeclaration"])&&s.declaration,b=W?s.declaration:s,J=W?c=>s.declaration=c:j;if(b.type!=="TSDeclareFunction"&&!De(b))continue;K(b,["TSEnumDeclaration","ClassDeclaration","FunctionDeclaration","TSDeclareFunction","TSModuleDeclaration","VariableDeclaration"])&&(b.declare=!0);const I=[];if(b.type==="VariableDeclaration")I.push(...b.declarations.map(c=>c.id));else if("id"in b&&b.id){let c=b.id;c.type==="TSQualifiedName"&&(c=X(c)),c=w?f.identifier(`_${L(u,"")}`):c,I.push(c)}else{const c=f.identifier("export_default");I.push(c),b.id=c}const A=me(b),l=new Set,g=xe(b,v,l,u),m=[...l].filter(c=>I.every(N=>c!==N));if(b!==s&&(b.leadingComments=s.leadingComments),b.type==="TSDeclareFunction"&&I.length===1&&a.has(I[0].name)){const c=a.get(I[0].name),N=Y(c);N.overloads||(N.overloads=[],N.primaryDepsCount=N.deps.length,N.primaryParamsCount=N.params.length,N.primaryChildrenCount=N.children.length),N.overloads.push({children:m,childrenOffset:N.children.length,decl:b,deps:g,depsOffset:N.deps.length,params:A,paramsOffset:N.params.length}),N.deps.push(...g),N.params.push(...A),N.children.push(...m),r.add(D);continue}const T=q({bindings:I,children:m,decl:b,deps:g,params:A,resolvedModuleId:h});b.type==="TSDeclareFunction"&&I.length===1&&a.set(I[0].name,T);const Q=f.numericLiteral(T),ee=f.arrowFunctionExpression(A.map(({name:c})=>f.identifier(c)),f.arrayExpression(g)),te=f.arrayExpression(m.map(c=>({end:c.end,loc:c.loc,start:c.start,type:"StringLiteral",value:""}))),re=w&&f.callExpression(f.identifier("sideEffect"),[I[0]]),ge=Me(re?[Q,ee,te,re]:[Q,ee,te]),ne={declarations:[{id:{...I[0],typeAnnotation:null},init:ge,type:"VariableDeclarator"},...I.slice(1).map(c=>({id:{...c,typeAnnotation:null},type:"VariableDeclarator"}))],kind:"var",type:"VariableDeclaration"};U?(x.push(f.exportNamedDeclaration(null,[f.exportSpecifier(I[0],f.identifier("default"))])),j(ne)):J(ne)}return i&&x.push(f.expressionStatement(f.callExpression(f.identifier("sideEffect"),[]))),y.body=[...Array.from(v.values(),({stmt:D})=>D),...y.body.filter((D,s)=>!r.has(s)),...x],B.set(o,C),ae(d,{comments:!1,sourceFileName:o,sourceMaps:S})}function k(p,o){if(!P.test(o.fileName))return;const u=[];for(const a of o.moduleIds){const r=B.get(a);r&&u.push(...r)}const d=oe(p,{sourceType:"module"}),{program:n}=d;if(n.body=Ae(n.body),n.body=Pe(n.body),n.body=n.body.flatMap(a=>{if(je(a))return[];if(a.type==="ExpressionStatement")return[];const r=we(a,u,e);if(r===!1)return[];if(r)return[r];if(a.type!=="VariableDeclaration")return[a];if(!Ce(a))return[];const[D,s,j]=a.declarations[0].init.elements,w=D.value,h=Y(w);V(h.decl,{enter(l){l.type!=="CommentBlock"&&(l.leadingComments?.length||delete l.loc)}});for(const[l,g]of a.declarations.entries()){const m={...g.id,typeAnnotation:h.bindings[l].typeAnnotation};R(h.bindings[l],m)}const U=h.primaryChildrenCount??h.children.length,W=h.primaryParamsCount??h.params.length,b=h.primaryDepsCount??h.deps.length;for(let l=0;l<U;l++){const g=j.elements[l];Object.assign(h.children[l],{loc:g.loc})}const J=s.params;for(let l=0;l<W;l++){const g=J[l].name;for(const m of h.params[l].typeParams)m.name=g}const I=s.body.elements;for(let l=0;l<b;l++){const g=h.deps[l];let m=I[l];m&&m.type==="UnaryExpression"&&m.operator==="void"?m={...f.identifier("undefined"),end:m.end,loc:m.loc,start:m.start}:G(m)&&(m.name="__Infer"),g.replace?g.replace(m):Object.assign(g,m)}h.decl.type==="TSModuleDeclaration"&&h.resolvedModuleId&&(h.decl.id.value=z+h.resolvedModuleId);const A=[];if(h.overloads)for(const l of h.overloads){V(l.decl,{enter(g){g.type!=="CommentBlock"&&delete g.loc}}),"id"in l.decl&&l.decl.id&&R(l.decl.id,{...h.bindings[0]});for(const[g,m]of l.children.entries()){const T=j.elements[l.childrenOffset+g];T&&Object.assign(m,{loc:T.loc})}for(const[g,m]of l.params.entries()){const T=J[l.paramsOffset+g];if(T)for(const Q of m.typeParams)Q.name=T.name}for(const[g,m]of l.deps.entries()){let T=I[l.depsOffset+g];T&&(T.type==="UnaryExpression"&&T.operator==="void"?T={...f.identifier("undefined"),end:T.end,loc:T.loc,start:T.start}:G(T)&&(T.name="__Infer"),m.replace?m.replace(T):Object.assign(m,T))}A.push(l.decl)}return[Re(a,h.decl),...A]}).filter(a=>!!a),n.body.length===0)return"export { };";const y=n.body.some(a=>a.type==="ExportNamedDeclaration"||a.type==="ExportDefaultDeclaration"||a.type==="ExportAllDeclaration"),C=n.body.some(a=>a.type==="TSModuleDeclaration"&&a.id.type==="StringLiteral");!y&&C&&n.body.push({declaration:null,source:null,specifiers:[],type:"ExportNamedDeclaration"});const x=new Set,v=new Set;for(const a of o.moduleIds){const r=O.get(a);r&&(r.forEach(D=>{const s=D.type+D.value;v.has(s)||(v.add(s),x.add(D))}),O.delete(a))}return x.size>0&&(n.body[0].leadingComments||=[],n.body[0].leadingComments.unshift(...x)),ae(d,{comments:!0,sourceFileName:o.fileName,sourceMaps:S})}function L(p,o){return o in p?p[o]++:p[o]=0}function q(p){const o=t++;return M.set(o,p),o}function Y(p){return M.get(p)}function me(p){const o=[];V(p,{leave(d){"typeParameters"in d&&d.typeParameters?.type==="TSTypeParameterDeclaration"&&o.push(...d.typeParameters.params)}});const u=new Map;for(const d of o){const{name:n}=d,y=u.get(n);y?y.push(d):u.set(n,[d])}return Array.from(u.entries(),([d,n])=>({name:d,typeParams:n}))}function ye(p){const o=[];return V(p,{enter(u){u.type==="TSInferType"&&u.typeParameter&&o.push(u.typeParameter.name)}}),o}function xe(p,o,u,d){const n=new Set,y=new Set,C=[];let x=new Set;function v(r){return r.type==="Identifier"&&x.has(r.name)}return _(v,"N"),E(v,"isInferred"),V(p,{enter(r){if(r.type==="TSConditionalType"){const D=ye(r.extendsType);C.push(D)}},leave(r,D){if(r.type==="TSConditionalType")C.pop();else if(D?.type==="TSConditionalType"){const s=D.trueType===r;x=new Set((s?C:C.slice(0,-1)).flat())}else x=new Set;if(r.type==="ExportNamedDeclaration")for(const s of r.specifiers)s.type==="ExportSpecifier"&&a(s.local);else if(r.type==="TSInterfaceDeclaration"&&r.extends)for(const s of r.extends||[])a(F(s.expression));else if(r.type==="ClassDeclaration"){if(r.superClass&&a(r.superClass),r.implements)for(const s of r.implements)s.type!=="ClassImplements"&&a(F(s.expression))}else if(K(r,["ObjectMethod","ObjectProperty","ClassProperty","TSPropertySignature","TSDeclareMethod"]))r.computed&&pe(r.key)&&a(r.key),"value"in r&&pe(r.value)&&a(r.value);else switch(r.type){case"TSImportType":{y.add(r);const s=r.argument,j=r.qualifier,w=he(r,j,s,o,d);a(w);break}case"TSTypeQuery":{if(y.has(r.exprName))return;if(r.exprName.type==="TSImportType")break;a(F(r.exprName));break}case"TSTypeReference":{a(F(r.typeName));break}}D&&!n.has(r)&&de(r,D)&&u.add(r)}}),[...n];function a(r){ue(r)||v(r)||n.add(r)}_(a,"R")}function he(p,o,u,d,n){const y=u.value.replaceAll(/\W/g,"_"),C=Ee(u.value)?u.value:`${y}${L(n,y)}`;let x=f.identifier(C);if(d.has(u.value)?x=d.get(u.value).local:d.set(u.value,{local:x,stmt:f.importDeclaration([f.importNamespaceSpecifier(x)],u)}),o){const a=X(o);R(a,f.tsQualifiedName(x,{...a})),x=o}let v=p;return p.typeParameters?(R(p,f.tsTypeReference(x,p.typeParameters)),v=x):R(p,x),{...F(x),replace(a){R(v,a)}}}},"createFakeJsPlugin");function de(e,i){return!!(e.type==="Identifier"||K(i,["TSPropertySignature","TSMethodSignature"])&&i.key===e)}_(de,"Ie");E(de,"isChildSymbol");const Ne=/\/\s*<reference\s+(?:path|types)=/,fe=E((e,i=!1)=>e.filter(S=>Ne.test(S.value)!==i),"collectReferenceDirectives"),Ce=E(e=>f.isVariableDeclaration(e)&&e.declarations.length>0&&f.isVariableDeclarator(e.declarations[0])&&_e(e.declarations[0].init),"isRuntimeBindingVariableDeclaration"),_e=E(e=>f.isArrayExpression(e)&&Oe(e.elements),"isRuntimeBindingArrayExpression"),Me=E(e=>f.arrayExpression(e),"runtimeBindingArrayExpression"),Oe=E(e=>{const[i,S,t,M]=e;return i?.type==="NumericLiteral"&&S?.type==="ArrowFunctionExpression"&&t?.type==="ArrayExpression"&&(!M||M.type==="CallExpression")},"isRuntimeBindingArrayElements"),G=E(e=>Z(e,"infer"),"isInfer"),ue=E(e=>Z(e,"this")||e.type==="ThisExpression"||e.type==="MemberExpression"&&ue(e.object),"isThisExpression"),F=E(e=>{if(e.type==="Identifier")return e;const i=F(e.left);return Object.assign(e,f.memberExpression(i,e.right))},"TSEntityNameToRuntime"),X=E(e=>e.type==="Identifier"?e:X(e.left),"getIdFromTSEntityName"),pe=E(e=>K(e,["Identifier","MemberExpression"]),"isReferenceId"),je=E(e=>e.type==="ImportDeclaration"&&e.specifiers.length===1&&e.specifiers.every(i=>i.type==="ImportSpecifier"&&i.imported.type==="Identifier"&&["__export","__reExport"].includes(i.local.name)),"isHelperImport"),we=E((e,i,S)=>{if(e.type==="ExportNamedDeclaration"&&!e.declaration&&!e.source&&e.specifiers.length===0&&!e.attributes?.length)return!1;if(e.type==="ImportDeclaration"&&e.specifiers.length)for(const t of e.specifiers)G(t.local)&&(t.local.name="__Infer");if(K(e,["ImportDeclaration","ExportAllDeclaration","ExportNamedDeclaration"])){if(e.type==="ExportNamedDeclaration"&&i.length>0)for(const t of e.specifiers){const M=H(t.exported);i.includes(M)&&(t.type==="ExportSpecifier"?t.exportKind="type":e.exportKind="type")}if(e.source?.value&&P.test(e.source.value))return e.source.value=ce(e.source.value,"js"),e;if(S&&e.type==="ExportNamedDeclaration"&&!e.source&&e.specifiers.length===1&&e.specifiers[0].type==="ExportSpecifier"&&H(e.specifiers[0].exported)==="default")return{expression:e.specifiers[0].local,type:"TSExportAssignment"}}},"patchImportExport"),Ae=E(e=>{const i=new Set;for(const[t,M]of e.entries()){const O=S(M);if(!O)continue;const[B,$]=O;$.properties.length!==0&&(e[t]={body:{body:[{declaration:null,source:null,specifiers:$.properties.filter(k=>k.type==="ObjectProperty").map(k=>{const L=k.value.body,q=k.key;return f.exportSpecifier(L,q)}),type:"ExportNamedDeclaration"}],type:"TSModuleBlock"},declare:!0,id:B,kind:"namespace",type:"TSModuleDeclaration"})}return e.filter(t=>!i.has(t));function S(t){if(t.type!=="VariableDeclaration"||t.declarations.length!==1||t.declarations[0].id.type!=="Identifier"||t.declarations[0].init?.type!=="CallExpression"||t.declarations[0].init.callee.type!=="Identifier"||t.declarations[0].init.callee.name!=="__export"||t.declarations[0].init.arguments.length!==1||t.declarations[0].init.arguments[0].type!=="ObjectExpression")return!1;const M=t.declarations[0].id,O=t.declarations[0].init.arguments[0];return[M,O]}},"patchTsNamespace"),Pe=E(e=>{const i=new Map;for(const[S,t]of e.entries())if(t.type==="ImportDeclaration"&&t.specifiers.length===1&&t.specifiers[0].type==="ImportSpecifier"&&t.specifiers[0].local.type==="Identifier"&&t.specifiers[0].local.name.endsWith("_exports"))i.set(t.specifiers[0].local.name,t.specifiers[0].local.name);else if(t.type==="ExpressionStatement"&&t.expression.type==="CallExpression"&&Z(t.expression.callee,"__reExport")){const M=t.expression.arguments;i.set(M[0].name,M[1].name)}else t.type==="VariableDeclaration"&&t.declarations.length===1&&t.declarations[0].init?.type==="MemberExpression"&&t.declarations[0].init.object.type==="Identifier"&&i.has(t.declarations[0].init.object.name)?e[S]={id:{name:t.declarations[0].id.name,type:"Identifier"},type:"TSTypeAliasDeclaration",typeAnnotation:{type:"TSTypeReference",typeName:{left:{name:i.get(t.declarations[0].init.object.name),type:"Identifier"},right:{name:t.declarations[0].init.property.name,type:"Identifier"},type:"TSQualifiedName"}}}:t.type==="ExportNamedDeclaration"&&t.specifiers.length===1&&t.specifiers[0].type==="ExportSpecifier"&&t.specifiers[0].local.type==="Identifier"&&i.has(t.specifiers[0].local.name)&&(t.specifiers[0].local.name=i.get(t.specifiers[0].local.name));return e},"patchReExport"),ke=E((e,i,S)=>{if(e.type==="ImportDeclaration"||e.type==="ExportNamedDeclaration"&&!e.declaration){for(const t of e.specifiers)("exportKind"in t&&t.exportKind==="type"||"exportKind"in e&&e.exportKind==="type")&&S.push(H(t.exported)),t.type==="ImportSpecifier"?t.importKind="value":t.type==="ExportSpecifier"&&(t.exportKind="value");return e.type==="ImportDeclaration"?e.importKind="value":e.type==="ExportNamedDeclaration"&&(e.exportKind="value"),!0}return e.type==="ExportAllDeclaration"?(e.exportKind="value",!0):e.type==="TSImportEqualsDeclaration"?(e.moduleReference.type==="TSExternalModuleReference"&&i({source:e.moduleReference.expression,specifiers:[{local:e.id,type:"ImportDefaultSpecifier"}],type:"ImportDeclaration"}),!0):e.type==="TSExportAssignment"&&e.expression.type==="Identifier"?(i({specifiers:[{exported:{name:"default",type:"Identifier"},local:e.expression,type:"ExportSpecifier"}],type:"ExportNamedDeclaration"}),!0):e.type==="ExportDefaultDeclaration"&&e.declaration.type==="Identifier"?(i({specifiers:[{exported:f.identifier("default"),local:e.declaration,type:"ExportSpecifier"}],type:"ExportNamedDeclaration"}),!0):!1},"rewriteImportExport"),R=E((e,i)=>{for(const S of Object.keys(e))delete e[S];return Object.assign(e,i),e},"overwriteNode"),Re=E((e,i)=>{i.leadingComments||=[];const S=e.leadingComments?.filter(t=>t.value.startsWith("#"));return S&&i.leadingComments.unshift(...S),i.leadingComments=fe(i.leadingComments,!0),i},"inheritNodeComments");export{Qe as default};
@@ -0,0 +1 @@
1
+ import"node:child_process";import"node:fs";import"node:fs/promises";import"node:path";import"@babel/parser";import"obug";import"oxc-transform";import"@rollup/pluginutils";import"../filename.js";import{c as g}from"./generate-BnWcSpbk.js";export{g as createGeneratePlugin};
@@ -0,0 +1,9 @@
1
+ var ur=Object.defineProperty;var ne=(s,i)=>ur(s,"name",{value:i,configurable:!0});import{spawn as pr,fork as fr}from"node:child_process";import{existsSync as Ee,readFileSync as dr}from"node:fs";import{mkdtemp as gr,readFile as Ze,rm as mr}from"node:fs/promises";import z from"node:path";import{parse as Qe}from"@babel/parser";import{createDebug as Ae}from"obug";import{transformSync as hr,isolatedDeclarationSync as xr}from"oxc-transform";import{createFilter as yr}from"@rollup/pluginutils";import{RE_DTS as R,RE_NODE_MODULES as ge,RE_JS as oe,filename_to_dts as Ue,RE_JSON as qe,RE_TS as Ge,RE_VUE as Me,resolveTemplateFn as $r,replaceTemplateName as ke,RE_DTS_MAP as Ve}from"../filename.js";import{createRequire as wr}from"node:module";import{tmpdir as vr}from"node:os";var br=Object.defineProperty,a=ne((s,i)=>br(s,"name",{value:i,configurable:!0}),"s");let Ke=a(()=>{var s=(()=>{var i=Object.defineProperty,l=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyNames,f=Object.prototype.hasOwnProperty,w=a((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})},"ne"),k=a((e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of c(t))!f.call(e,n)&&n!==r&&i(e,n,{get:a(()=>t[n],"get"),enumerable:!(o=l(t,n))||o.enumerable});return e},"ae"),j=a(e=>k(i({},"__esModule",{value:!0}),e),"oe"),C={};w(C,{zeptomatch:a(()=>Le,"zeptomatch")});var U=a(e=>{const t=new Set,r=[e];for(let o=0;o<r.length;o++){const n=r[o];if(t.has(n))continue;t.add(n);const{children:u}=n;if(u?.length)for(let g=0,y=u.length;g<y;g++)r.push(u[g])}return Array.from(t)},"M"),le=a(e=>{let t="";const r=U(e);for(let o=0,n=r.length;o<n;o++){const u=r[o];if(!u.regex)continue;const g=u.regex.flags;if(t||(t=g),t!==g)throw new Error(`Inconsistent RegExp flags used: "${t}" and "${g}"`)}return t},"se"),q=a((e,t,r)=>{const o=r.get(e);if(o!==void 0)return o;const n=e.partial??t;let u="";if(e.regex&&(u+=n?"(?:$|":"",u+=e.regex.source),e.children?.length){const g=he(e.children.map(y=>q(y,t,r)).filter(Boolean));if(g?.length){const y=e.children.some(te=>!te.regex||!(te.partial??t)),b=g.length>1||n&&(!u.length||y);u+=b?n?"(?:$|":"(?:":"",u+=g.join("|"),u+=b?")":""}}return e.regex&&(u+=n?")":""),r.set(e,u),u},"O"),G=a((e,t)=>{const r=new Map,o=U(e);for(let n=o.length-1;n>=0;n--){const u=q(o[n],t,r);if(!(n>0))return u}return""},"ie"),he=a(e=>Array.from(new Set(e)),"ue"),N=a((e,t,r)=>N.compile(e,r).test(t),"R");N.compile=(e,t)=>{const r=t?.partial??!1,o=G(e,r),n=le(e);return new RegExp(`^(?:${o})$`,n)};var xe=N,ye=a((e,t)=>{const r=xe.compile(e,t),o=`${r.source.slice(0,-1)}[\\\\/]?$`,n=r.flags;return new RegExp(o,n)},"le"),ce=ye,_=a(e=>{const t=e.map(o=>o.source).join("|")||"$^",r=e[0]?.flags;return new RegExp(t,r)},"ve"),ue=_,W=a(e=>Array.isArray(e),"j"),P=a(e=>typeof e=="function","_"),X=a(e=>e.length===0,"he"),V=(()=>{const{toString:e}=Function.prototype,t=/(?:^\(\s*(?:[^,.()]|\.(?!\.\.))*\s*\)\s*=>|^\s*[a-zA-Z$_][a-zA-Z0-9$_]*\s*=>)/;return r=>(r.length===0||r.length===1)&&t.test(e.call(r))})(),B=a(e=>typeof e=="number","de"),pe=a(e=>typeof e=="object"&&e!==null,"xe"),x=a(e=>e instanceof RegExp,"me"),m=(()=>{const e=/\\\(|\((?!\?(?::|=|!|<=|<!))/;return t=>e.test(t.source)})(),h=(()=>{const e=/^[a-zA-Z0-9_-]+$/;return t=>e.test(t.source)&&!t.flags.includes("i")})(),d=a(e=>typeof e=="string","A"),$=a(e=>e===void 0,"f"),E=a(e=>{const t=new Map;return r=>{const o=t.get(r);if(o!==void 0)return o;const n=e(r);return t.set(r,n),n}},"ye"),M=a((e,t,r={})=>{const o={cache:{},input:e,index:0,indexBacktrackMax:0,options:r,output:[]},n=D(t)(o),u=Math.max(o.index,o.indexBacktrackMax);if(n&&o.index===e.length)return o.output;throw new Error(`Failed to parse at index ${u}`)},"I"),p=a((e,t)=>W(e)?O(e,t):d(e)?Y(e,t):J(e,t),"i"),O=a((e,t)=>{const r={};for(const o of e){if(o.length!==1)throw new Error(`Invalid character: "${o}"`);const n=o.charCodeAt(0);r[n]=!0}return o=>{const n=o.input;let u=o.index,g=u;for(;g<n.length&&n.charCodeAt(g)in r;)g+=1;if(g>u){if(!$(t)&&!o.options.silent){const y=n.slice(u,g),b=P(t)?t(y,n,`${u}`):t;$(b)||o.output.push(b)}o.index=g}return!0}},"we"),J=a((e,t)=>{if(h(e))return Y(e.source,t);{const r=e.source,o=e.flags.replace(/y|$/,"y"),n=new RegExp(r,o);return m(e)&&P(t)&&!V(t)?T(n,t):fe(n,t)}},"$e"),T=a((e,t)=>r=>{const o=r.index,n=r.input;e.lastIndex=o;const u=e.exec(n);if(u){const g=e.lastIndex;if(!r.options.silent){const y=t(...u,n,`${o}`);$(y)||r.output.push(y)}return r.index=g,!0}else return!1},"Ee"),fe=a((e,t)=>r=>{const o=r.index,n=r.input;if(e.lastIndex=o,e.test(n)){const u=e.lastIndex;if(!$(t)&&!r.options.silent){const g=P(t)?t(n.slice(o,u),n,`${o}`):t;$(g)||r.output.push(g)}return r.index=u,!0}else return!1},"Ce"),Y=a((e,t)=>r=>{const o=r.index,n=r.input;if(n.startsWith(e,o)){if(!$(t)&&!r.options.silent){const u=P(t)?t(e,n,`${o}`):t;$(u)||r.output.push(u)}return r.index+=e.length,!0}else return!1},"F"),$e=a((e,t,r,o)=>{const n=D(e),u=t>1;return ve(we(Re(g=>{let y=0;for(;y<r;){const b=g.index;if(!n(g)||(y+=1,g.index===b))break}return y>=t},u),o))},"k"),Oe=a((e,t)=>$e(e,0,1,t),"L"),de=a((e,t)=>$e(e,0,1/0,t),"$"),nt=a((e,t)=>$e(e,1,1/0,t),"Re"),K=a((e,t)=>{const r=e.map(D);return ve(we(Re(o=>{for(let n=0,u=r.length;n<u;n++)if(!r[n](o))return!1;return!0}),t))},"x"),A=a((e,t)=>{const r=e.map(D);return ve(we(o=>{for(let n=0,u=r.length;n<u;n++)if(r[n](o))return!0;return!1},t))},"p"),Re=a((e,t=!0,r=!1)=>{const o=D(e);return t?n=>{const u=n.index,g=n.output.length,y=o(n);return!y&&!r&&(n.indexBacktrackMax=Math.max(n.indexBacktrackMax,n.index)),(!y||r)&&(n.index=u,n.output.length!==g&&(n.output.length=g)),y}:o},"q"),we=a((e,t)=>{const r=D(e);return t?o=>{if(o.options.silent)return r(o);const n=o.output.length;if(r(o)){const u=o.output.splice(n,1/0),g=t(u);return $(g)||o.output.push(g),!0}else return!1}:r},"B"),ve=(()=>{let e=0;return t=>{const r=D(t),o=e+=1;return n=>{var u;if(n.options.memoization===!1)return r(n);const g=n.index,y=(u=n.cache)[o]||(u[o]={indexMax:-1,queue:[]}),b=y.queue;if(g<=y.indexMax){const re=y.store||(y.store=new Map);if(b.length){for(let Q=0,ar=b.length;Q<ar;Q+=2){const lr=b[Q*2],cr=b[Q*2+1];re.set(lr,cr)}b.length=0}const S=re.get(g);if(S===!1)return!1;if(B(S))return n.index=S,!0;if(S)return n.index=S.index,S.output?.length&&n.output.push(...S.output),!0}const te=n.output.length,ir=r(n);if(y.indexMax=Math.max(y.indexMax,g),ir){const re=n.index,S=n.output.length;if(S>te){const Q=n.output.slice(te,S);b.push(g,{index:re,output:Q})}else b.push(g,re);return!0}else return b.push(g,!1),!1}}})(),Ie=a(e=>{let t;return r=>(t||(t=D(e())),t(r))},"G"),D=E(e=>{if(P(e))return X(e)?Ie(e):e;if(d(e)||x(e))return p(e);if(W(e))return K(e);if(pe(e))return A(Object.values(e));throw new Error("Invalid rule")}),L=a(e=>e,"d"),ot=a(e=>typeof e=="string","ke"),st=a(e=>{const t=new WeakMap,r=new WeakMap;return(o,n)=>{const u=n?.partial?r:t,g=u.get(o);if(g!==void 0)return g;const y=e(o,n);return u.set(o,y),y}},"Be"),it=a(e=>{const t={},r={};return(o,n)=>{const u=n?.partial?r:t;return u[o]??(u[o]=e(o,n))}},"Pe"),at=p(/\\./,L),lt=p(/./,L),ct=p(/\*\*\*+/,"*"),ut=p(/([^/{[(!])\*\*/,(e,t)=>`${t}*`),pt=p(/(^|.)\*\*(?=[^*/)\]}])/,(e,t)=>`${t}*`),ft=de(A([at,ct,ut,pt,lt])),dt=ft,gt=a(e=>M(e,dt,{memoization:!1}).join(""),"Ie"),mt=gt,ze="abcdefghijklmnopqrstuvwxyz",ht=a(e=>{let t="";for(;e>0;){const r=(e-1)%26;t=ze[r]+t,e=Math.floor((e-1)/26)}return t},"Le"),Ce=a(e=>{let t=0;for(let r=0,o=e.length;r<o;r++)t=t*26+ze.indexOf(e[r])+1;return t},"V"),be=a((e,t)=>{if(t<e)return be(t,e);const r=[];for(;e<=t;)r.push(e++);return r},"b"),xt=a((e,t,r)=>be(e,t).map(o=>String(o).padStart(r,"0")),"qe"),Pe=a((e,t)=>be(Ce(e),Ce(t)).map(ht),"W"),v=a(e=>({partial:!1,regex:new RegExp(e,"s"),children:[]}),"c"),ee=a(e=>({children:e}),"y"),H=(()=>{const e=a((t,r,o)=>{if(o.has(t))return;o.add(t);const{children:n}=t;if(!n.length)n.push(r);else for(let u=0,g=n.length;u<g;u++)e(n[u],r,o)},"e");return t=>{if(!t.length)return ee([]);for(let r=t.length-1;r>=1;r--){const o=new Set,n=t[r-1],u=t[r];e(n,u,o)}return t[0]}})(),F=a(()=>({regex:new RegExp("[\\\\/]","s"),children:[]}),"g"),yt=p(/\\./,v),$t=p(/[$.*+?^(){}[\]\|]/,e=>v(`\\${e}`)),wt=p(/[\\\/]/,F),vt=p(/[^$.*+?^(){}[\]\|\\\/]+/,v),bt=p(/^(?:!!)*!(.*)$/,(e,t)=>v(`(?!^${Le.compile(t).source}$).*?`)),jt=p(/^(!!)+/),Et=A([bt,jt]),Mt=p(/\/(\*\*\/)+/,()=>ee([H([F(),v(".+?"),F()]),F()])),kt=p(/^(\*\*\/)+/,()=>ee([v("^"),H([v(".*?"),F()])])),_t=p(/\/(\*\*)$/,()=>ee([H([F(),v(".*?")]),v("$")])),At=p(/\*\*/,()=>v(".*?")),De=A([Mt,kt,_t,At]),St=p(/\*\/(?!\*\*\/|\*$)/,()=>H([v("[^\\\\/]*?"),F()])),Ot=p(/\*/,()=>v("[^\\\\/]*")),Fe=A([St,Ot]),Ne=p("?",()=>v("[^\\\\/]")),Rt=p("[",L),It=p("]",L),zt=p(/[!^]/,"^\\\\/"),Ct=p(/[a-z]-[a-z]|[0-9]-[0-9]/i,L),Pt=p(/\\./,L),Dt=p(/[$.*+?^(){}[\|]/,e=>`\\${e}`),Ft=p(/[\\\/]/,"\\\\/"),Nt=p(/[^$.*+?^(){}[\]\|\\\/]+/,L),Wt=A([Pt,Dt,Ft,Ct,Nt]),We=K([Rt,Oe(zt),de(Wt),It],e=>v(e.join(""))),Bt=p("{","(?:"),Jt=p("}",")"),Tt=p(/(\d+)\.\.(\d+)/,(e,t,r)=>xt(+t,+r,Math.min(t.length,r.length)).join("|")),Lt=p(/([a-z]+)\.\.([a-z]+)/,(e,t,r)=>Pe(t,r).join("|")),Zt=p(/([A-Z]+)\.\.([A-Z]+)/,(e,t,r)=>Pe(t.toLowerCase(),r.toLowerCase()).join("|").toUpperCase()),Ut=A([Tt,Lt,Zt]),Be=K([Bt,Ut,Jt],e=>v(e.join(""))),qt=p("{"),Gt=p("}"),Vt=p(","),Kt=p(/\\./,v),Ht=p(/[$.*+?^(){[\]\|]/,e=>v(`\\${e}`)),Qt=p(/[\\\/]/,F),Xt=p(/[^$.*+?^(){}[\]\|\\\/,]+/,v),Yt=Ie(()=>Te),er=p("",()=>v("(?:)")),tr=nt(A([De,Fe,Ne,We,Be,Yt,Kt,Ht,Qt,Xt]),H),Je=A([tr,er]),Te=K([qt,Oe(K([Je,de(K([Vt,Je]))])),Gt],ee),rr=de(A([Et,De,Fe,Ne,We,Be,Te,yt,$t,wt,vt]),H),nr=rr,or=a(e=>M(e,nr,{memoization:!1})[0],"kr"),sr=or,je=a((e,t,r)=>je.compile(e,r).test(t),"N");je.compile=(()=>{const e=it((r,o)=>ce(sr(mt(r)),o)),t=st((r,o)=>ue(r.map(n=>e(n,o))));return(r,o)=>ot(r)?e(r,o):t(r,o)})();var Le=je;return j(C)})();return s.default||s},"_lazyMatch"),_e;const jr=a((s,i)=>(_e||(_e=Ke(),Ke=null),_e(s,i)),"zeptomatch"),Er=/^[A-Z]:\//i,Z=a((s="")=>s&&s.replaceAll("\\","/").replace(Er,i=>i.toUpperCase()),"normalizeWindowsPath"),Mr=/^[/\\]{2}/,kr=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,Xe=/^[A-Z]:$/i,He=/^\/([A-Z]:)?$/i,_r=/.(\.[^./]+)$/,Ar=/^[/\\]|^[a-z]:[/\\]/i,Sr=a(()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/","cwd"),Ye=a((s,i)=>{let l="",c=0,f=-1,w=0,k;for(let j=0;j<=s.length;++j){if(j<s.length)k=s[j];else{if(k==="/")break;k="/"}if(k==="/"){if(!(f===j-1||w===1))if(w===2){if(l.length<2||c!==2||!l.endsWith(".")||l.at(-2)!=="."){if(l.length>2){const C=l.lastIndexOf("/");C===-1?(l="",c=0):(l=l.slice(0,C),c=l.length-1-l.lastIndexOf("/")),f=j,w=0;continue}else if(l.length>0){l="",c=0,f=j,w=0;continue}}i&&(l+=l.length>0?"/..":"..",c=2)}else l.length>0?l+=`/${s.slice(f+1,j)}`:l=s.slice(f+1,j),c=j-f-1;f=j,w=0}else k==="."&&w!==-1?++w:w=-1}return l},"normalizeString"),ae=a(s=>kr.test(s),"isAbsolute"),et=a(function(s){if(s.length===0)return".";s=Z(s);const i=Mr.exec(s),l=ae(s),c=s.at(-1)==="/";return s=Ye(s,!l),s.length===0?l?"/":c?"./":".":(c&&(s+="/"),Xe.test(s)&&(s+="/"),i?l?`//${s}`:`//./${s}`:l&&!ae(s)?`/${s}`:s)},"normalize");a((...s)=>{let i="";for(const l of s)if(l)if(i.length>0){const c=i[i.length-1]==="/",f=l[0]==="/";c&&f?i+=l.slice(1):i+=c||f?l:`/${l}`}else i+=l;return et(i)},"join");const me=a(function(...s){s=s.map(c=>Z(c));let i="",l=!1;for(let c=s.length-1;c>=-1&&!l;c--){const f=c>=0?s[c]:Sr();!f||f.length===0||(i=`${f}/${i}`,l=ae(f))}return i=Ye(i,!l),l&&!ae(i)?`/${i}`:i.length>0?i:"."},"resolve");a(function(s){return Z(s)},"toNamespacedPath");const Or=a(function(s){return _r.exec(Z(s))?.[1]??""},"extname");a(function(s,i){const l=me(s).replace(He,"$1").split("/"),c=me(i).replace(He,"$1").split("/");if(c[0][1]===":"&&l[0][1]===":"&&l[0]!==c[0])return c.join("/");const f=[...l];for(const w of f){if(c[0]!==w)break;l.shift(),c.shift()}return[...l.map(()=>".."),...c].join("/")},"relative");const Rr=a(s=>{const i=Z(s).replace(/\/$/,"").split("/").slice(0,-1);return i.length===1&&Xe.test(i[0])&&(i[0]+="/"),i.join("/")||(ae(s)?"/":".")},"dirname");a(function(s){const i=[s.root,s.dir,s.base??s.name+s.ext].filter(Boolean);return Z(s.root?me(...i):i.join("/"))},"format");const Ir=a((s,i)=>{const l=Z(s).split("/").pop();return i&&l.endsWith(i)?l.slice(0,-i.length):l},"basename");a(function(s){const i=Ar.exec(s)?.[0]?.replaceAll("\\","/")??"",l=Ir(s),c=Or(l);return{base:l,dir:Rr(s),ext:c,name:l.slice(0,l.length-c.length),root:i}},"parse");a((s,i)=>jr(i,et(s)),"matchesGlob");var zr=Object.defineProperty,tt=ne((s,i)=>zr(s,"name",{value:i,configurable:!0}),"r");const Cr=Ae("rollup-plugin-dts:tsc-context"),rt=tt(()=>({files:new Map,programs:[],projects:new Map}),"createContext"),Pr=tt((s,i)=>{i=me(i).replaceAll("\\","/"),Cr(`invalidating context file: ${i}`),s.files.delete(i),s.programs=s.programs.filter(l=>!l.getSourceFiles().some(c=>c.fileName===i)),s.projects.clear()},"invalidateContextFile"),Dr=rt();var Fr=Object.defineProperty,Se=ne((s,i)=>Fr(s,"name",{value:i,configurable:!0}),"i");const se=Ae("rollup-plugin-dts:tsgo"),Nr=Se((...s)=>new Promise((i,l)=>{const c=pr(...s);c.on("close",()=>i()),c.on("error",f=>l(f))}),"spawnAsync"),Wr=Se(()=>{const s=wr(import.meta.url),i=s.resolve("@typescript/native-preview/package.json"),l=z.dirname(i),c=s(z.join(l,"lib","getExePath.js"));return(typeof c=="function"?c:c.default)()},"getTsgoPathFromNodeModules"),Br=Se(async(s,i,l,c)=>{se("[tsgo] rootDir",s);let f;c?(f=c,se("[tsgo] using custom path",f)):(f=Wr(),se("[tsgo] using tsgo from node_modules",f));const w=await gr(z.join(vr(),"rollup-plugin-dts-"));se("[tsgo] tsgoDist",w);const k=["--noEmit","false","--declaration","--emitDeclarationOnly",...i?["-p",i]:[],"--outDir",w,"--rootDir",s,"--noCheck",...l?["--declarationMap"]:[]];return se("[tsgo] args %o",k),await Nr(f,k,{stdio:"inherit"}),w},"runTsgo");var Jr=Object.defineProperty,ie=ne((s,i)=>Jr(s,"name",{value:i,configurable:!0}),"y");const I=Ae("rollup-plugin-dts:generate"),Tr=import.meta.WORKER_URL??"./tsc/worker.js",nn=ie(({build:s,cwd:i,eager:l,emitDtsOnly:c,emitJs:f,exclude:w,include:k,incremental:j,newContext:C,oxc:U,parallel:le,sourcemap:q,tsconfig:G,tsconfigRaw:he,tsgo:N,tsMacro:xe,vue:ye})=>{const ce=k||w?yr(k,w):null,_=new Map,ue=new Map;let W,P,X,V,B;const pe=G?z.dirname(G):i;return{async buildEnd(){W?.kill(),!I.enabled&&B&&await mr(B,{force:!0,recursive:!0}).catch(()=>{}),B=void 0,C&&(V=void 0)},async buildStart(x){if(N?B=await Br(pe,G,q,N.path):U||(le?(W=fr(new URL(Tr,import.meta.url),{stdio:"inherit"}),P=(await import("birpc")).createBirpc({},{on:ie(m=>W.on("message",m),"on"),post:ie(m=>W.send(m),"post")})):(X=await import("../packem_chunks/index.js"),C&&(V=rt()))),!Array.isArray(x.input))for(const[m,h]of Object.entries(x.input)){I("resolving input alias %s -> %s",m,h);let d=await this.resolve(h);h.startsWith("./")||(d||=await this.resolve(`./${h}`));const $=d?.id||h;I("resolved input alias %s -> %s",h,$),ue.set($,m)}},generateBundle(x,m){for(const h of Object.keys(m)){const d=m[h];if(d){if(d.type==="asset"&&Ve.test(h)&&typeof d.source=="string"){const $=JSON.parse(d.source);$.names=[],delete $.sourcesContent,d.source=JSON.stringify($)}c&&d.type==="chunk"&&!R.test(h)&&!Ve.test(h)&&delete m[h]}}},load:{filter:{id:{exclude:[ge],include:[R]}},async handler(x){if(!_.has(x))return;const{code:m,id:h}=_.get(x);let d,$;if(I("generate dts %s from %s",x,h),N){if(Me.test(h))throw new Error("tsgo does not support Vue files.");const E=z.resolve(B,z.relative(pe,Ue(h)));if(Ee(E)){if(d=await Ze(E,"utf8"),q){const M=`${E}.map`;Ee(M)&&($=JSON.parse(await Ze(M,"utf8")))}}else throw I("[tsgo]",E,"is missing"),new Error(`tsgo did not generate dts file for ${h}, please check your tsconfig.`)}else if(U&&!Me.test(h)){const E=xr(h,m,U);if(E.errors.length>0){const[M]=E.errors;return this.error({frame:M?.codeframe||void 0,message:M?.codeframe?`${M.message}
2
+ ${M.codeframe}`:M?.message??"Unknown error"})}d=E.code,E.map&&($=E.map,$.sourcesContent=void 0,$.names=[])}else{const E=l?void 0:[..._.values()].filter(O=>O.isEntry).map(O=>O.id),M={build:s,context:V,cwd:i,entries:E,id:h,incremental:j,sourcemap:q,tsconfig:G,tsconfigRaw:he,tsMacro:xe,vue:ye};let p;if(p=le?await P.tscEmit(M):X.tscEmit(M),p.error)return this.error(p.error);if(d=p.code,$=p.map,d&&qe.test(h))if(d.includes("declare const _exports")){if(d.includes("declare const _exports: {")&&!d.includes(`
3
+ }[];`)){const O=Zr(d);let J=0;d+=O.map(T=>{const fe=`_${T.replaceAll(/[^\w$]/g,"_")}${J++}`,Y=JSON.stringify(T);return`declare let ${fe}: typeof _exports[${Y}]
4
+ export { ${fe} as ${Y} }`}).join(`
5
+ `)}}else{const O=Lr(d);d+=`
6
+ declare namespace __json_default_export {
7
+ export { ${Array.from(O.entries(),([J,T])=>J===T?J:`${T} as ${J}`).join(", ")} }
8
+ }
9
+ export { __json_default_export as default }`}}return{code:d||"",map:$}}},name:"rollup-plugin-dts:generate",outputOptions(x){return{...x,entryFileNames(m){const{entryFileNames:h}=x,d=$r(h||"[name].js",m);if(m.name.endsWith(".d")){if(R.test(d))return ke(d,m.name.slice(0,-2));if(oe.test(d))return d.replace(oe,".$1ts")}else if(c){if(m.facadeModuleId&&R.test(m.facadeModuleId)){if(R.test(d))return ke(d,m.name);if(oe.test(d))return d.replace(oe,".$1ts")}return ke("[name].js",m.name)}return d}}},async resolveId(x,m){if(_.has(x))return I("resolve dts id %s",x),{id:x};if(!m&&R.test(x)&&!ge.test(x)){const h=z.isAbsolute(x)?x:z.resolve(i,x),d=h.replace(R,".$1ts");if(!_.has(h)&&Ee(d)){const $=dr(d,"utf8");_.set(h,{code:$,id:d,isEntry:!0}),I("populated dtsMap from source for cached re-resolution: %s",h)}return _.has(h)?(I("resolve dts id %s (from cache re-resolution)",h),{id:h}):null}if(m&&Ge.test(m)&&(x.startsWith("./")||x.startsWith("../"))&&!z.extname(x))for(const h of[".ts",".tsx",".mts",".cts"]){const d=await this.resolve(x+h,m,{skipSelf:!0});if(d)return d}return null},shouldTransformCachedModule({id:x}){return R.test(x)&&!ge.test(x)},transform:{handler(x,m){if(!(R.test(m)||ge.test(m)||ce&&!ce(m))){if(!oe.test(m)||f){const h=!!this.getModuleInfo(m)?.isEntry,d=Ue(m);if(_.set(d,{code:x,id:m,isEntry:h}),I("register dts source: %s",m),h){const $=ue.get(m);this.emitFile({id:d,name:$?`${$}.d`:void 0,type:"chunk"})}}return c?qe.test(m)?"{}":"export { }":Ge.test(m)||Me.test(m)?hr(m,x,{}).code:null}},order:"pre"},watchChange(x){X&&Pr(V||Dr,x)}}},"createGeneratePlugin"),Lr=ie(s=>{const i=new Map,{program:l}=Qe(s,{errorRecovery:!0,plugins:[["typescript",{dts:!0}]],sourceType:"module"});for(const c of l.body)if(c.type==="ExportNamedDeclaration"){if(c.declaration)if(c.declaration.type==="VariableDeclaration")for(const f of c.declaration.declarations)f.id.type==="Identifier"&&i.set(f.id.name,f.id.name);else c.declaration.type==="TSModuleDeclaration"&&c.declaration.id.type==="Identifier"&&i.set(c.declaration.id.name,c.declaration.id.name);else if(c.specifiers.length>0)for(const f of c.specifiers)f.type==="ExportSpecifier"&&f.exported.type==="Identifier"&&i.set(f.exported.name,f.local.type==="Identifier"?f.local.name:f.exported.name)}return i},"collectJsonExportMap"),Zr=ie(s=>{const i=[],{program:l}=Qe(s,{plugins:[["typescript",{dts:!0}]],sourceType:"module"}),c=l.body[0].declarations[0].id.typeAnnotation.typeAnnotation.members;for(const f of c)f.key.type==="Identifier"?i.push(f.key.name):f.key.type==="StringLiteral"&&i.push(f.key.value);return i},"collectJsonExports");export{Rr as X,nn as c,Dr as g};
@@ -0,0 +1 @@
1
+ var R=Object.defineProperty;var h=(l,i)=>R(l,"name",{value:i,configurable:!0});import k from"node:path";import w from"node:process";import{findTsConfigSync as B,readTsConfig as F}from"@visulima/tsconfig";var S=Object.defineProperty,q=h((l,i)=>S(l,"name",{value:i,configurable:!0}),"h");let g=!1;const K=q(({banner:l,build:i=!1,cjsDefault:v=!1,compilerOptions:e={},cwd:c=w.cwd(),dtsInput:b=!1,eager:x=!1,emitDtsOnly:O=!1,emitJs:u,exclude:T=null,footer:y,include:E=null,incremental:m=!1,newContext:M=!1,oxc:o,parallel:D=!1,resolve:I=!1,resolver:P="oxc",sideEffects:C=!1,sourcemap:p,tsconfig:t,tsconfigRaw:J={},tsgo:f=!1,tsMacro:n=!1,vue:r=!1})=>{let a;if(t===!0||t==null)try{const d=B(c);t=d.path,a=d.config}catch{t=void 0}else typeof t=="string"?(t=k.resolve(c||w.cwd(),t),a=F(t)):t=void 0;e={...a?.compilerOptions,...e},m||=e.incremental||!!e.tsBuildInfoFile,p??=!!e.declarationMap,e.declarationMap=p;const j={...a,...J,compilerOptions:e};let s=!1;if(f&&(s=f===!0?{}:f),o??=!!(e?.isolatedDeclarations&&!r&&!s&&!n),o===!0&&(o={}),o&&(o.stripInternal??=!!e?.stripInternal,o.sourcemap=!!e.declarationMap),u??=!!(e.checkJs||e.allowJs),s){if(r)throw new Error("[@visulima/rollup-plugin-dts] The `tsgo` option is not compatible with the `vue` option. Please disable one of them.");if(n)throw new Error("[@visulima/rollup-plugin-dts] The `tsgo` option is not compatible with the `tsMacro` option. Please disable one of them.");if(o)throw new Error("[@visulima/rollup-plugin-dts] The `tsgo` option is not compatible with the `oxc` option. Please disable one of them.")}if(o&&r)throw new Error("[@visulima/rollup-plugin-dts] The `oxc` option is not compatible with the `vue` option. Please disable one of them.");if(o&&n)throw new Error("[@visulima/rollup-plugin-dts] The `oxc` option is not compatible with the `tsMacro` option. Please disable one of them.");return s&&!g&&(console.warn("The `tsgo` option is experimental and may change in the future."),g=!0),{banner:l,build:i,cjsDefault:v,cwd:c,dtsInput:b,eager:x,emitDtsOnly:O,emitJs:u,exclude:T,footer:y,include:E,incremental:m,newContext:M,oxc:o,parallel:D,resolve:I,resolver:P,sideEffects:C,sourcemap:p,tsconfig:t,tsconfigRaw:j,tsgo:s,tsMacro:n,vue:r}},"resolveOptions");export{K as resolveOptions};
package/package.json CHANGED
@@ -1,10 +1,96 @@
1
1
  {
2
2
  "name": "@visulima/rollup-plugin-dts",
3
- "version": "0.0.1",
4
- "description": "OIDC trusted publishing setup package for @visulima/rollup-plugin-dts",
5
- "keywords": [
6
- "oidc",
7
- "trusted-publishing",
8
- "setup"
9
- ]
10
- }
3
+ "version": "1.0.0-alpha.10",
4
+ "description": "A Rollup plugin to bundle dts files",
5
+ "homepage": "https://github.com/visulima/packem/tree/main/packages/rollup-plugin-dts",
6
+ "bugs": {
7
+ "url": "https://github.com/visulima/packem/issues"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/visulima/packem.git",
12
+ "directory": "packages/rollup-plugin-dts"
13
+ },
14
+ "funding": [
15
+ {
16
+ "type": "github",
17
+ "url": "https://github.com/sponsors/sxzz"
18
+ },
19
+ {
20
+ "type": "github",
21
+ "url": "https://github.com/sponsors/prisis"
22
+ },
23
+ {
24
+ "type": "consulting",
25
+ "url": "https://anolilab.com/support"
26
+ }
27
+ ],
28
+ "license": "MIT",
29
+ "author": "三咲智子 Kevin Deng <sxzz@sxzz.moe>",
30
+ "contributors": [
31
+ {
32
+ "name": "Daniel Bannert",
33
+ "email": "d.bannert@anolilab.de"
34
+ }
35
+ ],
36
+ "sideEffects": false,
37
+ "type": "module",
38
+ "exports": {
39
+ ".": {
40
+ "types": "./dist/index.ts",
41
+ "default": "./dist/index.js"
42
+ },
43
+ "./filename": {
44
+ "types": "./dist/filename.js",
45
+ "default": "./dist/filename.js"
46
+ },
47
+ "./package.json": "./package.json"
48
+ },
49
+ "files": [
50
+ "CHANGELOG.md",
51
+ "README.md",
52
+ "dist"
53
+ ],
54
+ "dependencies": {
55
+ "@babel/generator": "7.29.1",
56
+ "@babel/helper-validator-identifier": "7.28.5",
57
+ "@babel/parser": "7.29.2",
58
+ "@babel/types": "7.29.0",
59
+ "@rollup/pluginutils": "5.3.0",
60
+ "@visulima/tsconfig": "2.1.3",
61
+ "ast-kit": "^2.2.0",
62
+ "birpc": "^4.0.0",
63
+ "magic-string": "0.30.21",
64
+ "obug": "2.1.1",
65
+ "oxc-resolver": "11.19.1",
66
+ "oxc-transform": "0.126.0"
67
+ },
68
+ "peerDependencies": {
69
+ "@ts-macro/tsc": "0.3.7",
70
+ "@typescript/native-preview": ">=7.0.0-dev.20250601.1",
71
+ "rollup": ">=4.0.0",
72
+ "typescript": "^5.0.0 || ^6.0.0",
73
+ "vue-tsc": "3.2.6"
74
+ },
75
+ "peerDependenciesMeta": {
76
+ "@typescript/native-preview": {
77
+ "optional": true
78
+ },
79
+ "rollup": {
80
+ "optional": true
81
+ },
82
+ "typescript": {
83
+ "optional": true
84
+ },
85
+ "vue-tsc": {
86
+ "optional": true
87
+ }
88
+ },
89
+ "engines": {
90
+ "node": "^22.14.0 || >= 24.10.0"
91
+ },
92
+ "publishConfig": {
93
+ "access": "public",
94
+ "provenance": true
95
+ }
96
+ }