rolldown-plugin-dts 0.26.0 → 0.27.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.
@@ -1,6 +1,5 @@
1
1
  import { ChunkFileNamesFunction, PreRenderedChunk } from "rolldown";
2
2
  import { readTsconfig } from "get-tsconfig";
3
-
4
3
  //#region src/filename.d.ts
5
4
  declare const RE_JS: RegExp;
6
5
  declare const RE_TS: RegExp;
@@ -8,7 +8,7 @@ import path from "node:path";
8
8
  const ts = __cjs_require("typescript");
9
9
  import { pathToFileURL } from "node:url";
10
10
  //#region \0rolldown/runtime.js
11
- var __require = /* @__PURE__ */ createRequire(import.meta.url);
11
+ var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
12
12
  //#endregion
13
13
  //#region src/tsc/system.ts
14
14
  const debug$4 = createDebug("rolldown-plugin-dts:tsc-system");
@@ -67,9 +67,16 @@ const formatHost = {
67
67
  getCanonicalFileName: ts.sys.useCaseSensitiveFileNames ? (f) => f : (f) => f.toLowerCase()
68
68
  };
69
69
  const stripPrivateFields = (ctx) => {
70
+ const recurseCtx = {
71
+ ...ctx,
72
+ startLexicalEnvironment: () => {},
73
+ suspendLexicalEnvironment: () => {},
74
+ resumeLexicalEnvironment: () => {},
75
+ endLexicalEnvironment: () => void 0
76
+ };
70
77
  const visitor = (node) => {
71
78
  if (ts.isPropertySignature(node) && ts.isPrivateIdentifier(node.name)) return ctx.factory.updatePropertySignature(node, node.modifiers, ctx.factory.createStringLiteral(node.name.text), node.questionToken, node.type);
72
- return ts.visitEachChild(node, visitor, ctx);
79
+ return ts.visitEachChild(node, visitor, recurseCtx);
73
80
  };
74
81
  return (sourceFile) => ts.visitNode(sourceFile, visitor, ts.isSourceFile) ?? sourceFile;
75
82
  };
@@ -154,13 +161,14 @@ function buildProjects(fsSystem, tsconfig, force, sourcemap) {
154
161
  const projects = collectProjectGraph(tsconfig, fsSystem, force, sourcemap);
155
162
  debug$3("collected %d projects: %j", projects.length, projects.map((project) => project.tsconfigPath));
156
163
  const host = ts.createSolutionBuilderHost(fsSystem, createProgramWithPatchedCompilerOptions);
157
- debug$3(`built solution for ${tsconfig} with exit status ${ts.createSolutionBuilder(host, [tsconfig], {
164
+ const exitStatus = ts.createSolutionBuilder(host, [tsconfig], {
158
165
  force,
159
166
  verbose: true
160
167
  }).build(void 0, void 0, void 0, (project) => {
161
168
  debug$3(`transforming project ${project}`);
162
169
  return customTransformers;
163
- })}`);
170
+ });
171
+ debug$3(`built solution for ${tsconfig} with exit status ${exitStatus}`);
164
172
  const sourceFileToProjectMap = /* @__PURE__ */ new Map();
165
173
  for (const project of projects) for (const fileName of project.parsedConfig.fileNames) sourceFileToProjectMap.set(fsSystem.resolvePath(fileName), project);
166
174
  return sourceFileToProjectMap;
@@ -1,2 +1,2 @@
1
- import { a as globalContext, i as createContext, n as SourceFileToProjectMap, o as invalidateContextFile, r as TscContext, t as ParsedProject } from "./context-_3g_7Eca.mjs";
1
+ import { a as globalContext, i as createContext, n as SourceFileToProjectMap, o as invalidateContextFile, r as TscContext, t as ParsedProject } from "./context-CcXGRVeM.mjs";
2
2
  export { ParsedProject, SourceFileToProjectMap, TscContext, createContext, globalContext, invalidateContextFile };
@@ -1,9 +1,13 @@
1
- import { t as tscEmit } from "./index-DFO9SbW-.mjs";
2
-
1
+ import { i as TscResult, r as TscOptions } from "./index-Pfhuikcq.mjs";
3
2
  //#region src/tsc/worker.d.ts
4
- declare const functions: {
5
- tscEmit: typeof tscEmit;
6
- };
7
- type TscFunctions = typeof functions;
3
+ interface WorkerRequest {
4
+ id: number;
5
+ options: TscOptions;
6
+ }
7
+ interface WorkerResponse {
8
+ id: number;
9
+ result?: TscResult;
10
+ error?: unknown;
11
+ }
8
12
  //#endregion
9
- export { TscFunctions };
13
+ export { WorkerRequest, WorkerResponse };
@@ -1,10 +1,20 @@
1
- import { t as tscEmit } from "./tsc-DBLgyoBn.mjs";
1
+ import { t as tscEmit } from "./tsc-CgJ-ct_1.mjs";
2
2
  import process from "node:process";
3
- import { createBirpc } from "birpc";
4
3
  //#region src/tsc/worker.ts
5
- createBirpc({ tscEmit }, {
6
- post: (data) => process.send(data),
7
- on: (fn) => process.on("message", fn)
4
+ process.on("message", (request) => {
5
+ let response;
6
+ try {
7
+ response = {
8
+ id: request.id,
9
+ result: tscEmit(request.options)
10
+ };
11
+ } catch (error) {
12
+ response = {
13
+ id: request.id,
14
+ error
15
+ };
16
+ }
17
+ process.send(response);
8
18
  });
9
19
  //#endregion
10
20
  export {};
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-DFO9SbW-.mjs";
1
+ import { i as TscResult, n as TscModule, r as TscOptions, t as tscEmit } from "./index-Pfhuikcq.mjs";
2
2
  export { type TscModule, type TscOptions, type TscResult, tscEmit };
package/dist/tsc.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { t as tscEmit } from "./tsc-DBLgyoBn.mjs";
1
+ import { t as tscEmit } from "./tsc-CgJ-ct_1.mjs";
2
2
  export { tscEmit };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rolldown-plugin-dts",
3
3
  "type": "module",
4
- "version": "0.26.0",
4
+ "version": "0.27.0",
5
5
  "description": "A Rolldown plugin to generate and bundle dts files.",
6
6
  "author": "Kevin Deng <sxzz@sxzz.moe>",
7
7
  "license": "MIT",
@@ -62,39 +62,36 @@
62
62
  }
63
63
  },
64
64
  "dependencies": {
65
- "@babel/generator": "^8.0.0",
66
- "@babel/helper-validator-identifier": "^8.0.0",
67
- "@babel/parser": "^8.0.0",
68
- "ast-kit": "^3.0.0",
69
- "birpc": "^4.0.0",
70
65
  "dts-resolver": "^3.0.0",
71
66
  "get-tsconfig": "5.0.0-beta.5",
72
- "obug": "^2.1.3"
67
+ "obug": "^2.1.3",
68
+ "yuku-ast": "^0.1.5",
69
+ "yuku-codegen": "^0.5.43",
70
+ "yuku-parser": "^0.5.43"
73
71
  },
74
72
  "devDependencies": {
75
- "@babel/types": "^8.0.0",
76
73
  "@jridgewell/source-map": "^0.3.11",
77
- "@sxzz/eslint-config": "^8.2.0",
74
+ "@sxzz/eslint-config": "^8.2.1",
78
75
  "@sxzz/prettier-config": "^2.3.1",
79
76
  "@sxzz/test-utils": "^0.5.18",
80
- "@types/node": "^25.9.3",
81
- "@typescript/native-preview": "7.0.0-dev.20260616.1",
77
+ "@types/node": "^26.1.0",
78
+ "@typescript/native-preview": "7.0.0-dev.20260705.1",
82
79
  "@volar/typescript": "^2.4.28",
83
- "@vue/language-core": "^3.3.5",
84
- "arktype": "^2.2.0",
80
+ "@vue/language-core": "^3.3.6",
81
+ "arktype": "^2.2.2",
85
82
  "bumpp": "^11.1.0",
86
83
  "diff": "^9.0.0",
87
- "eslint": "^10.5.0",
88
- "prettier": "^3.8.4",
89
- "rolldown": "^1.1.1",
84
+ "eslint": "^10.6.0",
85
+ "prettier": "^3.9.4",
86
+ "rolldown": "^1.1.4",
90
87
  "rolldown-plugin-require-cjs": "^0.4.1",
91
88
  "rollup-plugin-dts": "^6.4.1",
92
- "tsdown": "^0.22.2",
93
- "tsnapi": "^0.3.3",
89
+ "tsdown": "^0.22.3",
90
+ "tsnapi": "^1.0.0",
94
91
  "typescript": "^6.0.3",
95
92
  "vitest": "^4.1.9",
96
- "vue": "^3.5.38",
97
- "vue-tsc": "^3.3.5",
93
+ "vue": "^3.5.39",
94
+ "vue-tsc": "^3.3.6",
98
95
  "zod": "^4.4.3"
99
96
  },
100
97
  "prettier": "@sxzz/prettier-config",