@rollup/wasm-node 5.0.0-0 → 5.0.0-2

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.
Files changed (50) hide show
  1. package/LICENSE.md +0 -17
  2. package/dist/bin/rollup +119 -108
  3. package/dist/es/getLogFilter.js +2 -2
  4. package/dist/es/parseAst.js +2 -2
  5. package/dist/es/rollup.js +2 -2
  6. package/dist/es/shared/node-entry.js +1637 -1092
  7. package/dist/es/shared/parseAst.js +123 -31
  8. package/dist/es/shared/watch.js +3204 -1008
  9. package/dist/getLogFilter.js +2 -2
  10. package/dist/loadConfigFile.js +2 -2
  11. package/dist/native.js +19 -3
  12. package/dist/parseAst.js +2 -2
  13. package/dist/rollup.android-arm-eabi.node +0 -0
  14. package/dist/rollup.android-arm64.node +0 -0
  15. package/dist/rollup.android-x64.node +0 -0
  16. package/dist/rollup.d.ts +23 -9
  17. package/dist/rollup.darwin-arm64.node +0 -0
  18. package/dist/rollup.darwin-x64.node +0 -0
  19. package/dist/rollup.freebsd-arm64.node +0 -0
  20. package/dist/rollup.freebsd-x64.node +0 -0
  21. package/dist/rollup.js +2 -2
  22. package/dist/rollup.linux-arm-gnueabihf.node +0 -0
  23. package/dist/rollup.linux-arm-musleabihf.node +0 -0
  24. package/dist/rollup.linux-arm64-gnu.node +0 -0
  25. package/dist/rollup.linux-arm64-musl.node +0 -0
  26. package/dist/rollup.linux-loong64-gnu.node +0 -0
  27. package/dist/rollup.linux-loong64-musl.node +0 -0
  28. package/dist/rollup.linux-ppc64-gnu.node +0 -0
  29. package/dist/rollup.linux-ppc64-musl.node +0 -0
  30. package/dist/rollup.linux-riscv64-gnu.node +0 -0
  31. package/dist/rollup.linux-riscv64-musl.node +0 -0
  32. package/dist/rollup.linux-s390x-gnu.node +0 -0
  33. package/dist/rollup.linux-x64-gnu.node +0 -0
  34. package/dist/rollup.linux-x64-musl.node +0 -0
  35. package/dist/rollup.openbsd-x64.node +0 -0
  36. package/dist/rollup.openharmony-arm64.node +0 -0
  37. package/dist/rollup.win32-arm64-msvc.node +0 -0
  38. package/dist/rollup.win32-ia32-msvc.node +0 -0
  39. package/dist/rollup.win32-x64-gnu.node +0 -0
  40. package/dist/rollup.win32-x64-msvc.node +0 -0
  41. package/dist/shared/index.js +3198 -1002
  42. package/dist/shared/loadConfigFile.js +2 -2
  43. package/dist/shared/node-entry.js +2 -2
  44. package/dist/shared/parseAst.js +129 -37
  45. package/dist/shared/rollup.js +1594 -1049
  46. package/dist/shared/watch-cli.js +2 -2
  47. package/dist/shared/watch.js +2 -2
  48. package/dist/wasm-node/bindings_wasm.js +2 -18
  49. package/dist/wasm-node/bindings_wasm_bg.wasm +0 -0
  50. package/package.json +26 -26
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v5.0.0-0
4
- Tue, 06 Oct 2026 08:24:44 GMT - commit d78bf6bee48e411672e05d8977473f76e6758c35
3
+ Rollup.js v5.0.0-2
4
+ Sun, 01 Nov 2026 08:56:25 GMT - commit 4009894760dbcbff5ba6cefa494787cc54ffaa62
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v5.0.0-0
4
- Tue, 06 Oct 2026 08:24:44 GMT - commit d78bf6bee48e411672e05d8977473f76e6758c35
3
+ Rollup.js v5.0.0-2
4
+ Sun, 01 Nov 2026 08:56:25 GMT - commit 4009894760dbcbff5ba6cefa494787cc54ffaa62
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v5.0.0-0
4
- Tue, 06 Oct 2026 08:24:44 GMT - commit d78bf6bee48e411672e05d8977473f76e6758c35
3
+ Rollup.js v5.0.0-2
4
+ Sun, 01 Nov 2026 08:56:25 GMT - commit 4009894760dbcbff5ba6cefa494787cc54ffaa62
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -153,10 +153,10 @@ function getCodeFrame(source, line, column) {
153
153
  .join('\n');
154
154
  }
155
155
 
156
- const ABSOLUTE_PATH_REGEX = /^(?:\/|(?:[A-Za-z]:)?[/\\|])/;
156
+ const ABSOLUTE_PATH_REGEX$1 = /^(?:\/|(?:[A-Za-z]:)?[/\\|])/;
157
157
  const RELATIVE_PATH_REGEX = /^\.?\.(\/|$)/;
158
- function isAbsolute(path) {
159
- return ABSOLUTE_PATH_REGEX.test(path);
158
+ function isAbsolute$1(path) {
159
+ return ABSOLUTE_PATH_REGEX$1.test(path);
160
160
  }
161
161
  function isRelative(path) {
162
162
  return RELATIVE_PATH_REGEX.test(path);
@@ -180,22 +180,40 @@ function printQuotedStringList(list, verbs) {
180
180
 
181
181
  // Replaces node:path in the browser build. Keep the behavior consistent with
182
182
  // the Node build so that both builds handle paths the same way.
183
+ const ABSOLUTE_PATH_REGEX = /^(?:\/|(?:[A-Za-z]:)?[/\\|])/;
183
184
  const ANY_SLASH_REGEX = /[/\\]/;
185
+ const DRIVE_REGEX = /^[A-Za-z]:$/;
186
+ function isAbsolute(path) {
187
+ return ABSOLUTE_PATH_REGEX.test(path);
188
+ }
189
+ function normalizePathSegments(parts, absolute) {
190
+ const normalized = [];
191
+ // A drive like "C:" is the root of the path, so ".." cannot climb above it
192
+ const root = DRIVE_REGEX.test(parts[0]) ? 1 : 0;
193
+ for (const part of parts) {
194
+ if (part === '..') {
195
+ if (normalized.length > root && normalized[normalized.length - 1] !== '..') {
196
+ normalized.pop();
197
+ }
198
+ else if (!absolute && root === 0) {
199
+ normalized.push('..');
200
+ }
201
+ }
202
+ else if (part !== '.' && part !== '') {
203
+ normalized.push(part);
204
+ }
205
+ }
206
+ return normalized;
207
+ }
184
208
  function relative(from, to) {
185
- const fromParts = from.split(ANY_SLASH_REGEX).filter(Boolean);
186
- const toParts = to.split(ANY_SLASH_REGEX).filter(Boolean);
187
- if (fromParts[0] === '.')
188
- fromParts.shift();
189
- if (toParts[0] === '.')
190
- toParts.shift();
209
+ // "." and ".." segments are collapsed on both sides first, as node:path
210
+ // does, so that "/a/./b" and "/a/b" describe the same location.
211
+ const fromParts = normalizePathSegments(from.split(ANY_SLASH_REGEX), isAbsolute(from));
212
+ const toParts = normalizePathSegments(to.split(ANY_SLASH_REGEX), isAbsolute(to));
191
213
  while (fromParts[0] && toParts[0] && fromParts[0] === toParts[0]) {
192
214
  fromParts.shift();
193
215
  toParts.shift();
194
216
  }
195
- while (toParts[0] === '..' && fromParts.length > 0) {
196
- toParts.shift();
197
- fromParts.pop();
198
- }
199
217
  while (fromParts.pop()) {
200
218
  toParts.unshift('..');
201
219
  }
@@ -207,13 +225,13 @@ function getAliasName(id) {
207
225
  return base.slice(0, Math.max(0, base.length - sp.extname(id).length));
208
226
  }
209
227
  function relativeId(id) {
210
- if (!isAbsolute(id))
228
+ if (!isAbsolute$1(id))
211
229
  return id;
212
230
  return relative(sp.resolve(), id);
213
231
  }
214
232
  function isPathFragment(name) {
215
233
  // starting with "/", "./", "../", "C:/"
216
- return (name[0] === '/' || (name[0] === '.' && (name[1] === '/' || name[1] === '.')) || isAbsolute(name));
234
+ return (name[0] === '/' || (name[0] === '.' && (name[1] === '/' || name[1] === '.')) || isAbsolute$1(name));
217
235
  }
218
236
  const UPPER_DIR_REGEX = /^(\.\.\/)*\.\.$/;
219
237
  function getImportPath(importerId, targetPath, stripJsExtension, ensureFileName) {
@@ -267,7 +285,6 @@ const URL_OUTPUT_AMD_BASEPATH = 'configuration-options/#output-amd-basepath';
267
285
  const URL_OUTPUT_DIR = 'configuration-options/#output-dir';
268
286
  const URL_OUTPUT_EXPORTS = 'configuration-options/#output-exports';
269
287
  const URL_OUTPUT_EXTEND = 'configuration-options/#output-extend';
270
- const URL_OUTPUT_EXTERNALIMPORTATTRIBUTES = 'configuration-options/#output-externalimportattributes';
271
288
  const URL_OUTPUT_FORMAT = 'configuration-options/#output-format';
272
289
  const URL_OUTPUT_GENERATEDCODE = 'configuration-options/#output-generatedcode';
273
290
  const URL_OUTPUT_GLOBALS = 'configuration-options/#output-globals';
@@ -306,6 +323,15 @@ function getRollupError(base) {
306
323
  });
307
324
  return errorInstance;
308
325
  }
326
+ function logErrorInHook(originalError, hookError, hookName) {
327
+ augmentLogMessage(originalError);
328
+ augmentLogMessage(hookError);
329
+ const phase = hookName === 'buildEnd' ? 'the build' : 'rendering';
330
+ return {
331
+ ...originalError,
332
+ message: `There was an error during ${phase}:\n ${originalError.message}\nAdditionally, handling the error in the '${hookName}' hook caused the following error:\n ${hookError.message}`
333
+ };
334
+ }
309
335
  function augmentCodeLocation(properties, pos, source, id) {
310
336
  if (typeof pos === 'object') {
311
337
  const { line, column } = pos;
@@ -2517,7 +2543,7 @@ const nodeConverters$1 = [
2517
2543
  return result;
2518
2544
  },
2519
2545
  get value() {
2520
- const result = new DataView(buffer.buffer).getFloat64((position + 3) << 2, true);
2546
+ const result = buffer.convertFloat64(position + 3);
2521
2547
  Object.defineProperty(node, 'value', { value: result });
2522
2548
  return result;
2523
2549
  }
@@ -3116,13 +3142,61 @@ function convertNodeList$1(position, buffer) {
3116
3142
  return list;
3117
3143
  }
3118
3144
 
3145
+ // Buffers hold 32-bit words in host byte order. For words that represent
3146
+ // strings, the four string bytes are packed LSB-first into the word, which on
3147
+ // little-endian hosts leaves the raw encoded string bytes in memory while
3148
+ // big-endian hosts need the byte order of each word reversed.
3149
+ const isBigEndianHost = new Uint8Array(new Uint32Array([1]).buffer)[0] === 0;
3150
+ const scratchFloat64 = new DataView(new ArrayBuffer(8));
3151
+ let scratchStringBytes = new Uint8Array(0);
3152
+ const writeFloat64 = function (value, wordPosition) {
3153
+ scratchFloat64.setFloat64(0, value, true);
3154
+ this[wordPosition] = scratchFloat64.getUint32(0, true);
3155
+ this[wordPosition + 1] = scratchFloat64.getUint32(4, true);
3156
+ };
3157
+ function writeStringWordsBigEndian(buffer, byteBuffer, bytePosition, byteLength) {
3158
+ const firstWordPosition = bytePosition >> 2;
3159
+ const wordCount = (byteLength + 3) >> 2;
3160
+ for (let index = 0; index < wordCount; index++) {
3161
+ const offset = bytePosition + (index << 2);
3162
+ buffer[firstWordPosition + index] =
3163
+ byteBuffer[offset] |
3164
+ (byteBuffer[offset + 1] << 8) |
3165
+ (byteBuffer[offset + 2] << 16) |
3166
+ (byteBuffer[offset + 3] << 24);
3167
+ }
3168
+ }
3169
+ const expandPackedString = (array, position, length) => {
3170
+ const paddedByteLength = ((length + 3) >> 2) << 2;
3171
+ if (scratchStringBytes.length < paddedByteLength) {
3172
+ scratchStringBytes = new Uint8Array(paddedByteLength);
3173
+ }
3174
+ const firstStringWord = position + 1;
3175
+ for (let index = 0; index < paddedByteLength >> 2; index++) {
3176
+ const word = array[firstStringWord + index];
3177
+ scratchStringBytes[index << 2] = word & 0xff;
3178
+ scratchStringBytes[(index << 2) + 1] = (word >>> 8) & 0xff;
3179
+ scratchStringBytes[(index << 2) + 2] = (word >>> 16) & 0xff;
3180
+ scratchStringBytes[(index << 2) + 3] = (word >>> 24) & 0xff;
3181
+ }
3182
+ return scratchStringBytes.subarray(0, length);
3183
+ };
3184
+ const decodePackedString = (array, position, length) => {
3185
+ const bytes = expandPackedString(array, position, length);
3186
+ return typeof Buffer !== 'undefined'
3187
+ ? Buffer.from(bytes.buffer, bytes.byteOffset, bytes.length).toString('utf8')
3188
+ : new TextDecoder().decode(bytes);
3189
+ };
3119
3190
  function getAstBuffer(byteBuffer) {
3120
3191
  // Create an aligned copy for misaligned views, e.g. buffers restored by
3121
3192
  // v8.deserialize, as the Uint32Array below requires a 4-byte aligned offset
3122
3193
  const alignedByteBuffer = byteBuffer.byteOffset & 3 ? new Uint8Array(byteBuffer) : byteBuffer;
3123
3194
  const array = new Uint32Array(alignedByteBuffer.buffer, alignedByteBuffer.byteOffset, alignedByteBuffer.byteLength >> 2);
3124
3195
  let convertString;
3125
- if (typeof Buffer !== 'undefined' && byteBuffer instanceof Buffer) {
3196
+ if (isBigEndianHost) {
3197
+ convertString = position => decodePackedString(array, position, array[position]);
3198
+ }
3199
+ else if (typeof Buffer !== 'undefined' && byteBuffer instanceof Buffer) {
3126
3200
  convertString = position => {
3127
3201
  const length = array[position];
3128
3202
  const bytePosition = (position + 1) << 2;
@@ -3137,11 +3211,19 @@ function getAstBuffer(byteBuffer) {
3137
3211
  return textDecoder.decode(byteBuffer.subarray(bytePosition, bytePosition + length));
3138
3212
  };
3139
3213
  }
3140
- return Object.assign(array, { convertString });
3214
+ return Object.assign(array, {
3215
+ convertFloat64(position) {
3216
+ scratchFloat64.setUint32(0, this[position], true);
3217
+ scratchFloat64.setUint32(4, this[position + 1], true);
3218
+ return scratchFloat64.getFloat64(0, true);
3219
+ },
3220
+ convertString
3221
+ });
3141
3222
  }
3142
3223
  function createAstBufferUint8(uInt32Size) {
3143
3224
  const buffer = new Uint32Array(uInt32Size);
3144
3225
  const encoder = new TextEncoder();
3226
+ const byteBuffer = new Uint8Array(buffer.buffer);
3145
3227
  return Object.assign(buffer, {
3146
3228
  addStringToBuffer(text, referencePosition) {
3147
3229
  const insertPosition = buffer.position;
@@ -3152,10 +3234,14 @@ function createAstBufferUint8(uInt32Size) {
3152
3234
  const reservedSize = 1 + ((encodedByteLength + 3) >> 2);
3153
3235
  const extendedBuffer = buffer.reserve(reservedSize);
3154
3236
  extendedBuffer[insertPosition] = encodedByteLength;
3155
- extendedBuffer.byteBuffer.set(encoded, (insertPosition + 1) << 2);
3237
+ const stringBytePosition = (insertPosition + 1) << 2;
3238
+ extendedBuffer.byteBuffer.set(encoded, stringBytePosition);
3239
+ if (isBigEndianHost) {
3240
+ writeStringWordsBigEndian(extendedBuffer, extendedBuffer.byteBuffer, stringBytePosition, encodedByteLength);
3241
+ }
3156
3242
  return extendedBuffer;
3157
3243
  },
3158
- byteBuffer: new Uint8Array(buffer.buffer),
3244
+ byteBuffer,
3159
3245
  position: 0,
3160
3246
  reserve(size) {
3161
3247
  const newPosition = buffer.position + size;
@@ -3170,12 +3256,14 @@ function createAstBufferUint8(uInt32Size) {
3170
3256
  },
3171
3257
  toOutput() {
3172
3258
  const byteSize = buffer.position << 2;
3173
- return buffer.byteBuffer.slice(0, byteSize);
3174
- }
3259
+ return byteBuffer.slice(0, byteSize);
3260
+ },
3261
+ writeFloat64
3175
3262
  });
3176
3263
  }
3177
3264
  function createAstBufferNode(uInt32Size) {
3178
3265
  const buffer = new Uint32Array(uInt32Size);
3266
+ const byteBuffer = Buffer.from(buffer.buffer);
3179
3267
  return Object.assign(buffer, {
3180
3268
  addStringToBuffer(text, referencePosition) {
3181
3269
  let extendedBuffer = buffer;
@@ -3183,19 +3271,22 @@ function createAstBufferNode(uInt32Size) {
3183
3271
  if (requiredSize > buffer.length) {
3184
3272
  // Reserve more space if needed
3185
3273
  extendedBuffer = createAstBufferNode(requiredSize * 2);
3186
- buffer.byteBuffer.copy(extendedBuffer.byteBuffer, 0, 0, buffer.position << 2);
3274
+ byteBuffer.copy(extendedBuffer.byteBuffer, 0, 0, buffer.position << 2);
3187
3275
  extendedBuffer.position = buffer.position;
3188
3276
  }
3189
3277
  const insertPosition = extendedBuffer.position;
3190
3278
  extendedBuffer[referencePosition] = insertPosition;
3191
- const textBytePosition = (insertPosition + 1) << 2;
3192
- const encodedLength = extendedBuffer.byteBuffer.write(text, textBytePosition);
3279
+ const stringBytePosition = (insertPosition + 1) << 2;
3280
+ const encodedLength = extendedBuffer.byteBuffer.write(text, stringBytePosition);
3193
3281
  extendedBuffer[insertPosition] = encodedLength;
3282
+ if (isBigEndianHost) {
3283
+ writeStringWordsBigEndian(extendedBuffer, extendedBuffer.byteBuffer, stringBytePosition, encodedLength);
3284
+ }
3194
3285
  // Round up to the next 4-byte boundary
3195
- extendedBuffer.position = (textBytePosition + encodedLength + 3) >> 2;
3286
+ extendedBuffer.position = (stringBytePosition + encodedLength + 3) >> 2;
3196
3287
  return extendedBuffer;
3197
3288
  },
3198
- byteBuffer: Buffer.from(buffer.buffer),
3289
+ byteBuffer,
3199
3290
  position: 0,
3200
3291
  reserve(size) {
3201
3292
  const newPosition = buffer.position + size;
@@ -3204,7 +3295,7 @@ function createAstBufferNode(uInt32Size) {
3204
3295
  return buffer;
3205
3296
  }
3206
3297
  const newBuffer = createAstBufferNode(newPosition * 2);
3207
- buffer.byteBuffer.copy(newBuffer.byteBuffer, 0, 0, buffer.position << 2);
3298
+ byteBuffer.copy(newBuffer.byteBuffer, 0, 0, buffer.position << 2);
3208
3299
  newBuffer.position = newPosition;
3209
3300
  return newBuffer;
3210
3301
  },
@@ -3213,9 +3304,10 @@ function createAstBufferNode(uInt32Size) {
3213
3304
  // The "slow" version will allocate exactly the needed size and is preferable
3214
3305
  // for long-term memory usage.
3215
3306
  const truncatedBuffer = Buffer.allocUnsafeSlow(byteSize);
3216
- buffer.byteBuffer.copy(truncatedBuffer, 0, 0, byteSize);
3307
+ byteBuffer.copy(truncatedBuffer, 0, 0, byteSize);
3217
3308
  return truncatedBuffer;
3218
- }
3309
+ },
3310
+ writeFloat64
3219
3311
  });
3220
3312
  }
3221
3313
 
@@ -3943,7 +4035,7 @@ const nodeConverters = [
3943
4035
  start: buffer[position],
3944
4036
  end: buffer[position + 1],
3945
4037
  raw: rawPosition === 0 ? undefined : buffer.convertString(rawPosition),
3946
- value: new DataView(buffer.buffer).getFloat64((position + 3) << 2, true)
4038
+ value: buffer.convertFloat64(position + 3)
3947
4039
  };
3948
4040
  },
3949
4041
  function literalRegExp(position, buffer) {
@@ -5367,7 +5459,7 @@ const serializeLiteralNumber = (node, buffer) => {
5367
5459
  if (node.raw != null) {
5368
5460
  buffer = buffer.addStringToBuffer(node.raw, nodePosition + 3);
5369
5461
  }
5370
- new DataView(buffer.buffer).setFloat64((nodePosition + 4) << 2, node.value, true);
5462
+ buffer.writeFloat64(node.value, nodePosition + 4);
5371
5463
  return buffer;
5372
5464
  };
5373
5465
  const serializeLiteralRegExp = (node, buffer) => {
@@ -5490,7 +5582,6 @@ exports.URL_OUTPUT_AMD_BASEPATH = URL_OUTPUT_AMD_BASEPATH;
5490
5582
  exports.URL_OUTPUT_AMD_ID = URL_OUTPUT_AMD_ID;
5491
5583
  exports.URL_OUTPUT_DIR = URL_OUTPUT_DIR;
5492
5584
  exports.URL_OUTPUT_EXPORTS = URL_OUTPUT_EXPORTS;
5493
- exports.URL_OUTPUT_EXTERNALIMPORTATTRIBUTES = URL_OUTPUT_EXTERNALIMPORTATTRIBUTES;
5494
5585
  exports.URL_OUTPUT_FORMAT = URL_OUTPUT_FORMAT;
5495
5586
  exports.URL_OUTPUT_GENERATEDCODE = URL_OUTPUT_GENERATEDCODE;
5496
5587
  exports.URL_OUTPUT_GLOBALS = URL_OUTPUT_GLOBALS;
@@ -5523,7 +5614,7 @@ exports.getAstBuffer = getAstBuffer;
5523
5614
  exports.getImportPath = getImportPath;
5524
5615
  exports.getRollupError = getRollupError;
5525
5616
  exports.getRollupUrl = getRollupUrl;
5526
- exports.isAbsolute = isAbsolute;
5617
+ exports.isAbsolute = isAbsolute$1;
5527
5618
  exports.isPathFragment = isPathFragment;
5528
5619
  exports.isRelative = isRelative;
5529
5620
  exports.isValidUrl = isValidUrl;
@@ -5558,6 +5649,7 @@ exports.logDuplicatePluginName = logDuplicatePluginName;
5558
5649
  exports.logEmptyChunk = logEmptyChunk;
5559
5650
  exports.logEmptyManualChunk = logEmptyManualChunk;
5560
5651
  exports.logEntryCannotBeExternal = logEntryCannotBeExternal;
5652
+ exports.logErrorInHook = logErrorInHook;
5561
5653
  exports.logEval = logEval;
5562
5654
  exports.logExternalModulesCannotBeIncludedInManualChunks = logExternalModulesCannotBeIncludedInManualChunks;
5563
5655
  exports.logExternalModulesCannotBeTransformedToModules = logExternalModulesCannotBeTransformedToModules;