rolldown-plugin-dts 0.27.12 → 0.27.13

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.
@@ -1,4 +1,4 @@
1
- import { t as VolarContext } from "./volar-ynbQeQZt.mjs";
1
+ import { t as VolarContext } from "./volar-Cxz5qLKE.mjs";
2
2
  import { r as TscContext } from "./context-CxNQgl9o.mjs";
3
3
  import { SourceMapInput } from "rolldown";
4
4
  import { TsconfigJson } from "get-tsconfig";
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as VolarPlugin, t as VolarContext } from "./volar-ynbQeQZt.mjs";
1
+ import { n as VolarPlugin, t as VolarContext } from "./volar-Cxz5qLKE.mjs";
2
2
  import { Plugin } from "rolldown";
3
3
  import { IsolatedDeclarationsOptions } from "rolldown/experimental";
4
4
  import { TsconfigJson } from "get-tsconfig";
package/dist/index.mjs CHANGED
@@ -1240,15 +1240,18 @@ var VolarContext = class {
1240
1240
  }
1241
1241
  getExtraFileExtensions() {
1242
1242
  if (!this.plugins.length) return;
1243
- return this.plugins.flatMap((plugin) => plugin.tsFileExtensionInfos);
1243
+ return this.plugins.flatMap((plugin) => plugin.tsFileExtensionInfos || []);
1244
1244
  }
1245
1245
  getCreateProgram(ts) {
1246
1246
  if (!this.plugins.length) return ts.createProgram;
1247
- const { proxyCreateProgram } = this.plugins[0].volarTypeScript;
1247
+ const volarTypeScript = this.plugins.find((plugin) => plugin.volarTypeScript)?.volarTypeScript;
1248
+ if (!volarTypeScript) return ts.createProgram;
1249
+ const { proxyCreateProgram } = volarTypeScript;
1248
1250
  return proxyCreateProgram(ts, ts.createProgram, (ts, options) => {
1249
1251
  const setups = [];
1250
1252
  const plugins = [];
1251
1253
  for (const plugin of this.plugins) {
1254
+ if (!plugin.create) continue;
1252
1255
  const result = plugin.create(ts, options);
1253
1256
  if (Array.isArray(result)) plugins.push(...result);
1254
1257
  else {
@@ -1,4 +1,4 @@
1
- import { t as VolarContext } from "./volar-ynbQeQZt.mjs";
1
+ import { t as VolarContext } from "./volar-Cxz5qLKE.mjs";
2
2
  import { ChunkFileNamesFunction, PreRenderedChunk } from "rolldown";
3
3
  import { readTsconfig } from "get-tsconfig";
4
4
  //#region src/filename.d.ts
@@ -1,4 +1,4 @@
1
- import { i as TscResult, r as TscOptions } from "./index-DVUThtUr.mjs";
1
+ import { i as TscResult, r as TscOptions } from "./index-D4idJQx0.mjs";
2
2
  //#region src/tsc/worker.d.ts
3
3
  interface WorkerRequest {
4
4
  id: number;
package/dist/tsc.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { i as TscResult, n as TscModule, r as TscOptions, t as tscEmit } from "./index-DVUThtUr.mjs";
1
+ import { i as TscResult, n as TscModule, r as TscOptions, t as tscEmit } from "./index-D4idJQx0.mjs";
2
2
  export { type TscModule, type TscOptions, type TscResult, tscEmit };
@@ -2,9 +2,9 @@ import { FileExtensionInfo } from "typescript";
2
2
  //#region src/volar.d.ts
3
3
  interface VolarPlugin {
4
4
  extensionPatterns: RegExp[];
5
- tsFileExtensionInfos: FileExtensionInfo[];
6
- volarTypeScript: typeof import("@volar/typescript");
7
- create: Parameters<(typeof import("@volar/typescript"))["proxyCreateProgram"]>[2];
5
+ tsFileExtensionInfos?: FileExtensionInfo[];
6
+ volarTypeScript?: typeof import("@volar/typescript");
7
+ create?: Parameters<(typeof import("@volar/typescript"))["proxyCreateProgram"]>[2];
8
8
  toTsFilename?: (id: string) => string;
9
9
  }
10
10
  declare class VolarContext {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rolldown-plugin-dts",
3
3
  "type": "module",
4
- "version": "0.27.12",
4
+ "version": "0.27.13",
5
5
  "description": "A Rolldown plugin to generate and bundle dts files.",
6
6
  "author": "Kevin Deng <sxzz@sxzz.moe>",
7
7
  "license": "MIT",