@atlaspack/core 2.16.2-canary.186 → 2.16.2-canary.187

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.
@@ -269,6 +269,13 @@ class AtlaspackWorker {
269
269
  }
270
270
  (0, _assert().default)(result.length === 1, '[V3] Unimplemented: Multiple asset return from Node transformer');
271
271
  (0, _assert().default)(result[0] === mutableAsset, '[V3] Unimplemented: New asset returned from Node transformer');
272
+ let assetBuffer = await mutableAsset.getBuffer();
273
+
274
+ // If the asset has no code, we set the buffer to null, which we can
275
+ // detect in Rust, to avoid passing back an empty buffer, which we can't.
276
+ if (assetBuffer.length === 0) {
277
+ assetBuffer = null;
278
+ }
272
279
  return [{
273
280
  id: mutableAsset.id,
274
281
  bundleBehavior: _compat.bundleBehaviorMap.intoNullable(mutableAsset.bundleBehavior),
@@ -284,7 +291,7 @@ class AtlaspackWorker {
284
291
  symbols: mutableAsset.symbols.intoNapi(),
285
292
  type: mutableAsset.type,
286
293
  uniqueKey: mutableAsset.uniqueKey
287
- }, await mutableAsset.getBuffer(),
294
+ }, assetBuffer,
288
295
  // Only send back the map if it has changed
289
296
  mutableAsset.isMapDirty ?
290
297
  // @ts-expect-error TS2533
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/core",
3
- "version": "2.16.2-canary.186+f6532d7a4",
3
+ "version": "2.16.2-canary.187+5a0363f10",
4
4
  "license": "(MIT OR Apache-2.0)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -23,21 +23,21 @@
23
23
  "build:lib": "gulp build --gulpfile ../../../gulpfile.js --cwd ."
24
24
  },
25
25
  "dependencies": {
26
- "@atlaspack/build-cache": "2.13.3-canary.254+f6532d7a4",
27
- "@atlaspack/cache": "3.1.1-canary.186+f6532d7a4",
28
- "@atlaspack/diagnostic": "2.14.1-canary.254+f6532d7a4",
29
- "@atlaspack/events": "2.14.1-canary.254+f6532d7a4",
30
- "@atlaspack/feature-flags": "2.14.1-canary.254+f6532d7a4",
31
- "@atlaspack/fs": "2.14.5-canary.186+f6532d7a4",
32
- "@atlaspack/graph": "3.4.1-canary.254+f6532d7a4",
33
- "@atlaspack/logger": "2.14.5-canary.186+f6532d7a4",
34
- "@atlaspack/package-manager": "2.14.5-canary.186+f6532d7a4",
35
- "@atlaspack/plugin": "2.14.5-canary.186+f6532d7a4",
36
- "@atlaspack/profiler": "2.14.1-canary.254+f6532d7a4",
37
- "@atlaspack/rust": "3.2.1-canary.186+f6532d7a4",
38
- "@atlaspack/types": "2.14.5-canary.186+f6532d7a4",
39
- "@atlaspack/utils": "2.14.5-canary.186+f6532d7a4",
40
- "@atlaspack/workers": "2.14.5-canary.186+f6532d7a4",
26
+ "@atlaspack/build-cache": "2.13.3-canary.255+5a0363f10",
27
+ "@atlaspack/cache": "3.1.1-canary.187+5a0363f10",
28
+ "@atlaspack/diagnostic": "2.14.1-canary.255+5a0363f10",
29
+ "@atlaspack/events": "2.14.1-canary.255+5a0363f10",
30
+ "@atlaspack/feature-flags": "2.14.1-canary.255+5a0363f10",
31
+ "@atlaspack/fs": "2.14.5-canary.187+5a0363f10",
32
+ "@atlaspack/graph": "3.4.1-canary.255+5a0363f10",
33
+ "@atlaspack/logger": "2.14.5-canary.187+5a0363f10",
34
+ "@atlaspack/package-manager": "2.14.5-canary.187+5a0363f10",
35
+ "@atlaspack/plugin": "2.14.5-canary.187+5a0363f10",
36
+ "@atlaspack/profiler": "2.14.1-canary.255+5a0363f10",
37
+ "@atlaspack/rust": "3.2.1-canary.187+5a0363f10",
38
+ "@atlaspack/types": "2.14.5-canary.187+5a0363f10",
39
+ "@atlaspack/utils": "2.14.5-canary.187+5a0363f10",
40
+ "@atlaspack/workers": "2.14.5-canary.187+5a0363f10",
41
41
  "@mischnic/json-sourcemap": "^0.1.0",
42
42
  "@parcel/source-map": "^2.1.1",
43
43
  "base-x": "^3.0.8",
@@ -62,5 +62,5 @@
62
62
  "./src/serializerCore.js": "./src/serializerCore.browser.js"
63
63
  },
64
64
  "type": "commonjs",
65
- "gitHead": "f6532d7a4f7f007bd4e5e36af04dd466f0b9f572"
65
+ "gitHead": "5a0363f1086e81068959b87e92064bed5a11a9b4"
66
66
  }
@@ -282,6 +282,14 @@ export class AtlaspackWorker {
282
282
  '[V3] Unimplemented: New asset returned from Node transformer',
283
283
  );
284
284
 
285
+ let assetBuffer: Buffer | null = await mutableAsset.getBuffer();
286
+
287
+ // If the asset has no code, we set the buffer to null, which we can
288
+ // detect in Rust, to avoid passing back an empty buffer, which we can't.
289
+ if (assetBuffer.length === 0) {
290
+ assetBuffer = null;
291
+ }
292
+
285
293
  return [
286
294
  {
287
295
  id: mutableAsset.id,
@@ -301,7 +309,7 @@ export class AtlaspackWorker {
301
309
  type: mutableAsset.type,
302
310
  uniqueKey: mutableAsset.uniqueKey,
303
311
  },
304
- await mutableAsset.getBuffer(),
312
+ assetBuffer,
305
313
  // Only send back the map if it has changed
306
314
  mutableAsset.isMapDirty
307
315
  ? // @ts-expect-error TS2533