rolldown-plugin-dts 0.27.4 → 0.27.6

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.mjs CHANGED
@@ -177,13 +177,10 @@ function createFakeJsPlugin({ sourcemap, cjsDefault, sideEffects }) {
177
177
  childrenNode,
178
178
  ...sideEffectNode ? [sideEffectNode] : []
179
179
  ]);
180
- const runtimeAssignment = b.variableDeclaration("var", [b.variableDeclarator({
181
- ...bindings[0],
182
- typeAnnotation: null
183
- }, runtimeArrayNode), ...bindings.slice(1).map((binding) => b.variableDeclarator({
180
+ const runtimeAssignment = b.variableDeclaration("var", [b.variableDeclarator(b.arrayPattern(bindings.map((binding) => ({
184
181
  ...binding,
185
182
  typeAnnotation: null
186
- }))]);
183
+ }))), runtimeArrayNode)]);
187
184
  if (isDefaultExport) {
188
185
  appendStmts.push(b.exportNamedDeclaration(null, [b.exportSpecifier(bindings[0], b.identifier("default"))]));
189
186
  setStmt(runtimeAssignment);
@@ -230,16 +227,17 @@ function createFakeJsPlugin({ sourcemap, cjsDefault, sideEffects }) {
230
227
  if (newNode || newNode === false) return newNode;
231
228
  if (node.type !== "VariableDeclaration") return node;
232
229
  if (!isRuntimeBindingVariableDeclaration(node)) return null;
233
- const [declarationIdNode, depsFn, children] = node.declarations[0].init.elements;
230
+ const decl = node.declarations[0];
231
+ const [declarationIdNode, depsFn, children] = decl.init.elements;
234
232
  const declarationId = declarationIdNode.value;
235
233
  const declaration = getDeclaration(declarationId);
236
234
  if (sourcemap) walk(declaration.decl, { enter(node) {
237
235
  node.start = void 0;
238
236
  node.end = void 0;
239
237
  } });
240
- for (const [i, decl] of node.declarations.entries()) {
238
+ for (const [i, id] of decl.id.elements.entries()) {
241
239
  const transformedBinding = {
242
- ...decl.id,
240
+ ...id,
243
241
  typeAnnotation: declaration.bindings[i].typeAnnotation
244
242
  };
245
243
  overwriteNode(declaration.bindings[i], transformedBinding);
@@ -605,7 +603,7 @@ function isCjsDtsInputSyntax(node) {
605
603
  * Check if the given node is a {@link RuntimeBindingVariableDeclration}
606
604
  */
607
605
  function isRuntimeBindingVariableDeclaration(node) {
608
- return node?.type === "VariableDeclaration" && node.declarations.length > 0 && node.declarations[0].type === "VariableDeclarator" && isRuntimeBindingArrayExpression(node.declarations[0].init);
606
+ return node?.type === "VariableDeclaration" && node.declarations.length === 1 && node.declarations[0].type === "VariableDeclarator" && node.declarations[0].id.type === "ArrayPattern" && isRuntimeBindingArrayExpression(node.declarations[0].init);
609
607
  }
610
608
  /**
611
609
  * Check if the given node is a {@link RuntimeBindingArrayExpression}
@@ -365,7 +365,8 @@ function createTsProgramFromParsedConfig({ parsedConfig, fsSystem, baseDir, id,
365
365
  ...defaultCompilerOptions,
366
366
  ...parsedConfig.options,
367
367
  $configRaw: parsedConfig.raw,
368
- $rootDir: baseDir
368
+ $rootDir: baseDir,
369
+ ...vue || tsMacro ? { allowNonTsExtensions: true } : void 0
369
370
  };
370
371
  const rootNames = [...new Set([id, ...entries || parsedConfig.fileNames].map((f) => fsSystem.resolvePath(f)))];
371
372
  const host = ts.createCompilerHost(compilerOptions, true);
@@ -1,4 +1,4 @@
1
- import { t as tscEmit } from "./tsc-CgJ-ct_1.mjs";
1
+ import { t as tscEmit } from "./tsc-C-tN4xGx.mjs";
2
2
  import process from "node:process";
3
3
  //#region src/tsc/worker.ts
4
4
  process.on("message", (request) => {
package/dist/tsc.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { t as tscEmit } from "./tsc-CgJ-ct_1.mjs";
1
+ import { t as tscEmit } from "./tsc-C-tN4xGx.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.27.4",
4
+ "version": "0.27.6",
5
5
  "description": "A Rolldown plugin to generate and bundle dts files.",
6
6
  "author": "Kevin Deng <sxzz@sxzz.moe>",
7
7
  "license": "MIT",
@@ -66,32 +66,32 @@
66
66
  "get-tsconfig": "5.0.0-beta.5",
67
67
  "obug": "^2.1.3",
68
68
  "yuku-ast": "^0.1.7",
69
- "yuku-codegen": "^0.5.44",
70
- "yuku-parser": "^0.5.44"
69
+ "yuku-codegen": "^0.5.46",
70
+ "yuku-parser": "^0.5.46"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@jridgewell/source-map": "^0.3.11",
74
74
  "@sxzz/eslint-config": "^8.2.1",
75
75
  "@sxzz/prettier-config": "^2.3.1",
76
76
  "@sxzz/test-utils": "^0.5.18",
77
- "@types/node": "^26.1.0",
78
- "@typescript/native-preview": "7.0.0-dev.20260706.1",
77
+ "@types/node": "^26.1.1",
78
+ "@typescript/native-preview": "7.0.0-dev.20260707.2",
79
79
  "@volar/typescript": "^2.4.28",
80
- "@vue/language-core": "^3.3.6",
81
- "arktype": "^2.2.2",
80
+ "@vue/language-core": "^3.3.7",
81
+ "arktype": "^2.2.3",
82
82
  "bumpp": "^11.1.0",
83
83
  "diff": "^9.0.0",
84
84
  "eslint": "^10.6.0",
85
- "prettier": "^3.9.4",
86
- "rolldown": "^1.1.4",
85
+ "prettier": "^3.9.5",
86
+ "rolldown": "^1.1.5",
87
87
  "rolldown-plugin-require-cjs": "^0.4.1",
88
88
  "rollup-plugin-dts": "^6.4.1",
89
- "tsdown": "^0.22.3",
89
+ "tsdown": "^0.22.4",
90
90
  "tsnapi": "^1.0.0",
91
91
  "typescript": "^6.0.3",
92
92
  "vitest": "^4.1.10",
93
93
  "vue": "^3.5.39",
94
- "vue-tsc": "^3.3.6",
94
+ "vue-tsc": "^3.3.7",
95
95
  "zod": "^4.4.3"
96
96
  },
97
97
  "prettier": "@sxzz/prettier-config",