@atlaspack/core 2.12.1-canary.3535 → 2.12.1-canary.3537

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/lib/Atlaspack.js CHANGED
@@ -563,6 +563,7 @@ class Atlaspack {
563
563
  */
564
564
  async unstable_buildAssetGraph(writeToCache = true) {
565
565
  await this._init();
566
+ const origin = '@atlaspack/core';
566
567
  const input = {
567
568
  optionsRef: this.#optionsRef,
568
569
  name: 'Main',
@@ -572,19 +573,24 @@ class Atlaspack {
572
573
  lazyExcludes: [],
573
574
  requestedAssetIds: this.#requestedAssetIds
574
575
  };
576
+ const start = Date.now();
575
577
  const result = await this.#requestTracker.runRequest(this.rustAtlaspack != null ? (0, _AssetGraphRequestRust.createAssetGraphRequestRust)(this.rustAtlaspack)(input) : (0, _AssetGraphRequest.default)(input), {
576
578
  force: true
577
579
  });
580
+ const duration = Date.now() - start;
578
581
  _logger().default.info({
579
- message: 'Done building asset graph!'
582
+ message: `Done building asset graph in ${duration / 1000}s!`,
583
+ origin
580
584
  });
581
585
  if (writeToCache) {
582
586
  _logger().default.info({
583
- message: 'Write request tracker to cache'
587
+ message: 'Write request tracker to cache',
588
+ origin
584
589
  });
585
590
  await this.writeRequestTrackerToCache();
586
591
  _logger().default.info({
587
- message: 'Done writing request tracker to cache'
592
+ message: 'Done writing request tracker to cache',
593
+ origin
588
594
  });
589
595
  }
590
596
  return result;
@@ -48,6 +48,7 @@ function createAssetGraphRequestRust(rustAtlaspack) {
48
48
  let serializedAssetGraph;
49
49
  try {
50
50
  serializedAssetGraph = await rustAtlaspack.buildAssetGraph();
51
+ serializedAssetGraph.nodes = serializedAssetGraph.nodes.flatMap(node => JSON.parse(node));
51
52
  } catch (err) {
52
53
  throw new (_diagnostic().default)({
53
54
  diagnostic: err
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/core",
3
- "version": "2.12.1-canary.3535+66c8cd01b",
3
+ "version": "2.12.1-canary.3537+d265b5522",
4
4
  "license": "(MIT OR Apache-2.0)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -20,21 +20,21 @@
20
20
  "check-ts": "tsc --noEmit index.d.ts"
21
21
  },
22
22
  "dependencies": {
23
- "@atlaspack/build-cache": "2.12.1-canary.3535+66c8cd01b",
24
- "@atlaspack/cache": "2.12.1-canary.3535+66c8cd01b",
25
- "@atlaspack/diagnostic": "2.12.1-canary.3535+66c8cd01b",
26
- "@atlaspack/events": "2.12.1-canary.3535+66c8cd01b",
27
- "@atlaspack/feature-flags": "2.12.1-canary.3535+66c8cd01b",
28
- "@atlaspack/fs": "2.12.1-canary.3535+66c8cd01b",
29
- "@atlaspack/graph": "3.2.1-canary.3535+66c8cd01b",
30
- "@atlaspack/logger": "2.12.1-canary.3535+66c8cd01b",
31
- "@atlaspack/package-manager": "2.12.1-canary.3535+66c8cd01b",
32
- "@atlaspack/plugin": "2.12.1-canary.3535+66c8cd01b",
33
- "@atlaspack/profiler": "2.12.1-canary.3535+66c8cd01b",
34
- "@atlaspack/rust": "2.12.1-canary.3535+66c8cd01b",
35
- "@atlaspack/types": "2.12.1-canary.3535+66c8cd01b",
36
- "@atlaspack/utils": "2.12.1-canary.3535+66c8cd01b",
37
- "@atlaspack/workers": "2.12.1-canary.3535+66c8cd01b",
23
+ "@atlaspack/build-cache": "2.12.1-canary.3537+d265b5522",
24
+ "@atlaspack/cache": "2.12.1-canary.3537+d265b5522",
25
+ "@atlaspack/diagnostic": "2.12.1-canary.3537+d265b5522",
26
+ "@atlaspack/events": "2.12.1-canary.3537+d265b5522",
27
+ "@atlaspack/feature-flags": "2.12.1-canary.3537+d265b5522",
28
+ "@atlaspack/fs": "2.12.1-canary.3537+d265b5522",
29
+ "@atlaspack/graph": "3.2.1-canary.3537+d265b5522",
30
+ "@atlaspack/logger": "2.12.1-canary.3537+d265b5522",
31
+ "@atlaspack/package-manager": "2.12.1-canary.3537+d265b5522",
32
+ "@atlaspack/plugin": "2.12.1-canary.3537+d265b5522",
33
+ "@atlaspack/profiler": "2.12.1-canary.3537+d265b5522",
34
+ "@atlaspack/rust": "2.12.1-canary.3537+d265b5522",
35
+ "@atlaspack/types": "2.12.1-canary.3537+d265b5522",
36
+ "@atlaspack/utils": "2.12.1-canary.3537+d265b5522",
37
+ "@atlaspack/workers": "2.12.1-canary.3537+d265b5522",
38
38
  "@mischnic/json-sourcemap": "^0.1.0",
39
39
  "@parcel/source-map": "^2.1.1",
40
40
  "base-x": "^3.0.8",
@@ -66,5 +66,5 @@
66
66
  "browser": {
67
67
  "./src/serializerCore.js": "./src/serializerCore.browser.js"
68
68
  },
69
- "gitHead": "66c8cd01ba7f6e6d22b84933083865b826b605cd"
69
+ "gitHead": "d265b5522769255e2f2a6d5a9eb01418de4a1647"
70
70
  }
package/src/Atlaspack.js CHANGED
@@ -585,6 +585,8 @@ export default class Atlaspack {
585
585
  writeToCache: boolean = true,
586
586
  ): Promise<AssetGraphRequestResult> {
587
587
  await this._init();
588
+
589
+ const origin = '@atlaspack/core';
588
590
  const input = {
589
591
  optionsRef: this.#optionsRef,
590
592
  name: 'Main',
@@ -594,6 +596,8 @@ export default class Atlaspack {
594
596
  lazyExcludes: [],
595
597
  requestedAssetIds: this.#requestedAssetIds,
596
598
  };
599
+
600
+ const start = Date.now();
597
601
  const result = await this.#requestTracker.runRequest(
598
602
  this.rustAtlaspack != null
599
603
  ? createAssetGraphRequestRust(this.rustAtlaspack)(input)
@@ -601,12 +605,17 @@ export default class Atlaspack {
601
605
  {force: true},
602
606
  );
603
607
 
604
- logger.info({message: 'Done building asset graph!'});
608
+ const duration = Date.now() - start;
609
+
610
+ logger.info({
611
+ message: `Done building asset graph in ${duration / 1000}s!`,
612
+ origin,
613
+ });
605
614
 
606
615
  if (writeToCache) {
607
- logger.info({message: 'Write request tracker to cache'});
616
+ logger.info({message: 'Write request tracker to cache', origin});
608
617
  await this.writeRequestTrackerToCache();
609
- logger.info({message: 'Done writing request tracker to cache'});
618
+ logger.info({message: 'Done writing request tracker to cache', origin});
610
619
  }
611
620
 
612
621
  return result;
@@ -42,6 +42,9 @@ export function createAssetGraphRequestRust(
42
42
  let serializedAssetGraph;
43
43
  try {
44
44
  serializedAssetGraph = await rustAtlaspack.buildAssetGraph();
45
+ serializedAssetGraph.nodes = serializedAssetGraph.nodes.flatMap(
46
+ (node) => JSON.parse(node),
47
+ );
45
48
  } catch (err) {
46
49
  throw new ThrowableDiagnostic({
47
50
  diagnostic: err,