rolldown-plugin-dts 0.16.11 → 0.16.12

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
@@ -364,18 +364,17 @@ function createFakeJsPlugin({ sourcemap, cjsDefault }) {
364
364
  bindings.push(binding);
365
365
  decl.id = binding;
366
366
  }
367
+ const params = "typeParameters" in decl && decl.typeParameters?.type === "TSTypeParameterDeclaration" ? decl.typeParameters.params : [];
367
368
  const deps = collectDependencies(decl, namespaceStmts);
368
- const elements = [
369
- t.numericLiteral(0),
370
- ...deps.map((dep) => t.arrowFunctionExpression([], dep)),
371
- ...sideEffect ? [t.callExpression(t.identifier("sideEffect"), [bindings[0]])] : []
372
- ];
369
+ const elements = [t.numericLiteral(0), t.arrowFunctionExpression(params.map((param) => t.identifier(param.name)), t.arrayExpression(deps))];
370
+ if (sideEffect) elements.push(t.callExpression(t.identifier("sideEffect"), [bindings[0]]));
373
371
  const runtime = t.arrayExpression(elements);
374
372
  if (decl !== stmt) decl.leadingComments = stmt.leadingComments;
375
373
  const symbolId = registerSymbol({
376
374
  decl,
377
375
  deps,
378
- bindings
376
+ bindings,
377
+ params
379
378
  });
380
379
  elements[0] = t.numericLiteral(symbolId);
381
380
  const runtimeAssignment = {
@@ -431,7 +430,7 @@ function createFakeJsPlugin({ sourcemap, cjsDefault }) {
431
430
  if (node.type !== "VariableDeclaration") return node;
432
431
  const [decl] = node.declarations;
433
432
  if (decl.init?.type !== "ArrayExpression" || !decl.init.elements[0]) return null;
434
- const [symbolIdNode, ...depsFns] = decl.init.elements;
433
+ const [symbolIdNode, depsFn] = decl.init.elements;
435
434
  if (symbolIdNode?.type !== "NumericLiteral") return null;
436
435
  const symbolId = symbolIdNode.value;
437
436
  const original = getSymbol(symbolId);
@@ -442,8 +441,13 @@ function createFakeJsPlugin({ sourcemap, cjsDefault }) {
442
441
  };
443
442
  overwriteNode(original.bindings[i], transformedBinding);
444
443
  }
445
- const transformedDeps = depsFns.filter((node$1) => node$1?.type === "ArrowFunctionExpression").map((node$1) => node$1.body);
446
- if (original.deps.length) for (let i = 0; i < original.deps.length; i++) {
444
+ const transformedParams = depsFn.params;
445
+ for (let i = 0; i < original.params.length; i++) {
446
+ const originalParam = original.params[i];
447
+ originalParam.name = transformedParams[i].name;
448
+ }
449
+ const transformedDeps = depsFn.body.elements;
450
+ for (let i = 0; i < original.deps.length; i++) {
447
451
  const originalDep = original.deps[i];
448
452
  if (originalDep.replace) originalDep.replace(transformedDeps[i]);
449
453
  else Object.assign(originalDep, transformedDeps[i]);
@@ -519,8 +523,7 @@ function createFakeJsPlugin({ sourcemap, cjsDefault }) {
519
523
  seen.add(node$1);
520
524
  const source = node$1.argument;
521
525
  const imported = node$1.qualifier;
522
- const dep = importNamespace(node$1, imported, source, namespaceStmts);
523
- addDependency(dep);
526
+ addDependency(importNamespace(node$1, imported, source, namespaceStmts));
524
527
  break;
525
528
  }
526
529
  }
@@ -631,9 +634,7 @@ function patchTsNamespace(nodes) {
631
634
  return nodes.filter((node) => !removed.has(node));
632
635
  function handleExport(node) {
633
636
  if (node.type !== "VariableDeclaration" || node.declarations.length !== 1 || node.declarations[0].id.type !== "Identifier" || node.declarations[0].init?.type !== "CallExpression" || node.declarations[0].init.callee.type !== "Identifier" || node.declarations[0].init.callee.name !== "__export" || node.declarations[0].init.arguments.length !== 1 || node.declarations[0].init.arguments[0].type !== "ObjectExpression") return false;
634
- const source = node.declarations[0].id;
635
- const exports = node.declarations[0].init.arguments[0];
636
- return [source, exports];
637
+ return [node.declarations[0].id, node.declarations[0].init.arguments[0]];
637
638
  }
638
639
  /**
639
640
  * @deprecated remove me in future
@@ -856,14 +857,13 @@ function createGeneratePlugin({ tsconfig, tsconfigRaw, build, incremental, cwd,
856
857
  map.sourcesContent = void 0;
857
858
  }
858
859
  } else {
859
- const entries = eager ? void 0 : Array.from(dtsMap.values()).filter((v) => v.isEntry).map((v) => v.id);
860
860
  const options = {
861
861
  tsconfig,
862
862
  tsconfigRaw,
863
863
  build,
864
864
  incremental,
865
865
  cwd,
866
- entries,
866
+ entries: eager ? void 0 : Array.from(dtsMap.values()).filter((v) => v.isEntry).map((v) => v.id),
867
867
  id,
868
868
  sourcemap,
869
869
  vue,
@@ -160,14 +160,13 @@ function buildProjects(fsSystem, tsconfig, force, sourcemap) {
160
160
  const projects = collectProjectGraph(tsconfig, fsSystem, force, sourcemap);
161
161
  debug$2("collected %d projects: %j", projects.length, projects.map((project) => project.tsconfigPath));
162
162
  const host = ts.createSolutionBuilderHost(fsSystem, createProgramWithPatchedCompilerOptions);
163
- const exitStatus = ts.createSolutionBuilder(host, [tsconfig], {
163
+ debug$2(`built solution for ${tsconfig} with exit status ${ts.createSolutionBuilder(host, [tsconfig], {
164
164
  force,
165
165
  verbose: true
166
166
  }).build(void 0, void 0, void 0, (project) => {
167
167
  debug$2(`transforming project ${project}`);
168
168
  return customTransformers;
169
- });
170
- debug$2(`built solution for ${tsconfig} with exit status ${exitStatus}`);
169
+ })}`);
171
170
  const sourceFileToProjectMap = /* @__PURE__ */ new Map();
172
171
  for (const project of projects) for (const fileName of project.parsedConfig.fileNames) sourceFileToProjectMap.set(fsSystem.resolvePath(fileName), project);
173
172
  return sourceFileToProjectMap;
@@ -1,4 +1,4 @@
1
- import { tscEmit } from "./tsc-BsZXDoCU.js";
1
+ import { tscEmit } from "./tsc-BtxK_zMt.js";
2
2
  import "./context-BGY_fVH1.js";
3
3
  const process = globalThis.process;
4
4
  import { createBirpc } from "birpc";
package/dist/tsc.js CHANGED
@@ -1,4 +1,4 @@
1
- import { tscEmit } from "./tsc-BsZXDoCU.js";
1
+ import { tscEmit } from "./tsc-BtxK_zMt.js";
2
2
  import "./context-BGY_fVH1.js";
3
3
 
4
4
  export { tscEmit };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rolldown-plugin-dts",
3
- "version": "0.16.11",
3
+ "version": "0.16.12",
4
4
  "description": "A Rolldown plugin to generate and bundle dts files.",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -64,38 +64,38 @@
64
64
  "@babel/generator": "^7.28.3",
65
65
  "@babel/parser": "^7.28.4",
66
66
  "@babel/types": "^7.28.4",
67
- "ast-kit": "^2.1.2",
67
+ "ast-kit": "^2.1.3",
68
68
  "birpc": "^2.6.1",
69
69
  "debug": "^4.4.3",
70
70
  "dts-resolver": "^2.1.2",
71
- "get-tsconfig": "^4.10.1",
71
+ "get-tsconfig": "^4.12.0",
72
72
  "magic-string": "^0.30.19"
73
73
  },
74
74
  "devDependencies": {
75
- "@sxzz/eslint-config": "^7.2.6",
75
+ "@sxzz/eslint-config": "^7.2.7",
76
76
  "@sxzz/prettier-config": "^2.2.4",
77
77
  "@sxzz/test-utils": "^0.5.11",
78
78
  "@types/babel__generator": "^7.27.0",
79
79
  "@types/debug": "^4.1.12",
80
- "@types/node": "^24.6.0",
81
- "@typescript/native-preview": "7.0.0-dev.20250929.1",
80
+ "@types/node": "^24.8.1",
81
+ "@typescript/native-preview": "7.0.0-dev.20251017.1",
82
82
  "@volar/typescript": "^2.4.23",
83
- "@vue/language-core": "^3.1.0",
84
- "arktype": "^2.1.22",
85
- "bumpp": "^10.2.3",
83
+ "@vue/language-core": "^3.1.1",
84
+ "arktype": "^2.1.23",
85
+ "bumpp": "^10.3.1",
86
86
  "diff": "^8.0.2",
87
- "eslint": "^9.36.0",
87
+ "eslint": "^9.37.0",
88
88
  "estree-walker": "^3.0.3",
89
89
  "prettier": "^3.6.2",
90
- "rolldown": "^1.0.0-beta.41",
91
- "rolldown-plugin-require-cjs": "^0.3.0",
90
+ "rolldown": "^1.0.0-beta.43",
91
+ "rolldown-plugin-require-cjs": "^0.3.1",
92
92
  "rollup-plugin-dts": "^6.2.3",
93
93
  "tinyglobby": "^0.2.15",
94
- "tsdown": "^0.15.5",
95
- "typescript": "^5.9.2",
94
+ "tsdown": "^0.15.7",
95
+ "typescript": "^5.9.3",
96
96
  "vitest": "^3.2.4",
97
97
  "vue": "^3.5.22",
98
- "vue-tsc": "^3.1.0"
98
+ "vue-tsc": "^3.1.1"
99
99
  },
100
100
  "engines": {
101
101
  "node": ">=20.18.0"