rolldown-plugin-dts 0.13.0 → 0.13.1

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/index.js CHANGED
@@ -658,7 +658,7 @@ function createGeneratePlugin({ tsconfigRaw, tsconfigDir, isolatedDeclarations,
658
658
  return {
659
659
  name: "rolldown-plugin-dts:generate",
660
660
  async buildStart(options) {
661
- if (!parallel && (!isolatedDeclarations || vue)) ({tscEmit} = await import("./tsc-CeRgkVKp.js"));
661
+ if (!parallel && (!isolatedDeclarations || vue)) ({tscEmit} = await import("./tsc-JgclC8th.js"));
662
662
  if (!Array.isArray(options.input)) for (const [name, id] of Object.entries(options.input)) {
663
663
  debug$1("resolving input alias %s -> %s", name, id);
664
664
  let resolved = await this.resolve(id);
@@ -718,7 +718,7 @@ function createGeneratePlugin({ tsconfigRaw, tsconfigDir, isolatedDeclarations,
718
718
  } },
719
719
  async handler(dtsId) {
720
720
  if (!dtsMap.has(dtsId)) return;
721
- const { code, id, isEntry } = dtsMap.get(dtsId);
721
+ const { code, id } = dtsMap.get(dtsId);
722
722
  let dtsCode;
723
723
  let map;
724
724
  debug$1("generate dts %s from %s", dtsId, id);
@@ -743,7 +743,6 @@ function createGeneratePlugin({ tsconfigRaw, tsconfigDir, isolatedDeclarations,
743
743
  tsconfigDir,
744
744
  entries,
745
745
  id,
746
- isEntry,
747
746
  vue
748
747
  };
749
748
  let result;
@@ -0,0 +1,3 @@
1
+ import { tscEmit } from "./tsc-oL0S5coZ.js";
2
+
3
+ export { tscEmit };
@@ -55,10 +55,11 @@ const defaultCompilerOptions = {
55
55
  moduleResolution: ts.ModuleResolutionKind.Bundler
56
56
  };
57
57
  function createOrGetTsModule(options) {
58
- const { id, isEntry } = options;
58
+ const { id, entries } = options;
59
59
  const program = programs.find((program$1) => {
60
- if (isEntry) return program$1.getRootFileNames().includes(id);
61
- return program$1.getSourceFile(id);
60
+ const roots = program$1.getRootFileNames();
61
+ if (entries) return entries.every((entry) => roots.includes(entry));
62
+ return roots.includes(id);
62
63
  });
63
64
  if (program) {
64
65
  const sourceFile = program.getSourceFile(id);
@@ -79,7 +80,7 @@ function createTsProgram({ entries, id, tsconfigRaw, tsconfigDir, vue }) {
79
80
  ...defaultCompilerOptions,
80
81
  ...parsedCmd.options
81
82
  };
82
- const rootNames = entries ? [...new Set([id, ...entries])] : parsedCmd.fileNames;
83
+ const rootNames = [...new Set([id, ...entries || parsedCmd.fileNames])];
83
84
  const host = ts.createCompilerHost(compilerOptions, true);
84
85
  const createProgram = vue ? createVueProgramFactory(ts) : ts.createProgram;
85
86
  const program = createProgram({
@@ -8,7 +8,6 @@ interface TscOptions {
8
8
  tsconfigDir: string;
9
9
  entries?: string[];
10
10
  id: string;
11
- isEntry: boolean;
12
11
  vue?: boolean;
13
12
  }
14
13
  interface TscResult {
@@ -1,4 +1,4 @@
1
- import { tscEmit } from "../tsc-H_wSbW_C.js";
1
+ import { tscEmit } from "../tsc-oL0S5coZ.js";
2
2
  import process from "node:process";
3
3
  import { createBirpc } from "birpc";
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rolldown-plugin-dts",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
4
4
  "description": "A Rolldown plugin to bundle dts files",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,3 +0,0 @@
1
- import { tscEmit } from "./tsc-H_wSbW_C.js";
2
-
3
- export { tscEmit };