@atlaspack/core 2.12.1-canary.3449 → 2.12.1-canary.3450

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 (49) hide show
  1. package/package.json +16 -16
  2. package/src/AssetGraph.js +10 -10
  3. package/src/Atlaspack.js +2 -2
  4. package/src/AtlaspackConfig.js +11 -9
  5. package/src/AtlaspackConfig.schema.js +1 -1
  6. package/src/BundleGraph.js +83 -79
  7. package/src/CommittedAsset.js +1 -1
  8. package/src/PackagerRunner.js +4 -4
  9. package/src/ReporterRunner.js +4 -4
  10. package/src/RequestTracker.js +18 -18
  11. package/src/SymbolPropagation.js +26 -22
  12. package/src/Transformation.js +12 -12
  13. package/src/UncommittedAsset.js +2 -2
  14. package/src/Validation.js +5 -5
  15. package/src/applyRuntimes.js +2 -2
  16. package/src/atlaspack-v3/AtlaspackV3.js +1 -1
  17. package/src/atlaspack-v3/worker/compat/bitflags.js +3 -3
  18. package/src/dumpGraphToGraphViz.js +1 -1
  19. package/src/loadDotEnv.js +1 -1
  20. package/src/public/Asset.js +1 -1
  21. package/src/public/Bundle.js +3 -3
  22. package/src/public/BundleGraph.js +20 -20
  23. package/src/public/Config.js +1 -1
  24. package/src/public/MutableBundleGraph.js +8 -8
  25. package/src/requests/AssetGraphRequest.js +10 -10
  26. package/src/requests/AssetGraphRequestRust.js +3 -3
  27. package/src/requests/AssetRequest.js +3 -3
  28. package/src/requests/AtlaspackConfigRequest.js +5 -3
  29. package/src/requests/BundleGraphRequest.js +6 -6
  30. package/src/requests/ConfigRequest.js +4 -4
  31. package/src/requests/DevDepRequest.js +7 -7
  32. package/src/requests/EntryRequest.js +2 -2
  33. package/src/requests/TargetRequest.js +9 -8
  34. package/src/requests/ValidationRequest.js +2 -2
  35. package/src/requests/WriteBundleRequest.js +4 -4
  36. package/src/requests/WriteBundlesRequest.js +6 -6
  37. package/src/requests/asset-graph-diff.js +4 -4
  38. package/src/resolveOptions.js +3 -3
  39. package/src/serializer.js +2 -2
  40. package/src/serializerCore.browser.js +3 -2
  41. package/src/serializerCore.js +2 -2
  42. package/src/utils.js +2 -2
  43. package/test/AtlaspackConfigRequest.test.js +1 -1
  44. package/test/BundleGraph.test.js +3 -3
  45. package/test/PublicMutableBundleGraph.test.js +2 -2
  46. package/test/RequestTracker.test.js +6 -5
  47. package/test/SymbolPropagation.test.js +9 -9
  48. package/test/requests/ConfigRequest.test.js +1 -1
  49. package/test/utils.test.js +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/core",
3
- "version": "2.12.1-canary.3449+741f0a6ef",
3
+ "version": "2.12.1-canary.3450+d9092cb8e",
4
4
  "license": "(MIT OR Apache-2.0)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -20,20 +20,20 @@
20
20
  "check-ts": "tsc --noEmit index.d.ts"
21
21
  },
22
22
  "dependencies": {
23
- "@atlaspack/cache": "2.12.1-canary.3449+741f0a6ef",
24
- "@atlaspack/diagnostic": "2.12.1-canary.3449+741f0a6ef",
25
- "@atlaspack/events": "2.12.1-canary.3449+741f0a6ef",
26
- "@atlaspack/feature-flags": "2.12.1-canary.3449+741f0a6ef",
27
- "@atlaspack/fs": "2.12.1-canary.3449+741f0a6ef",
28
- "@atlaspack/graph": "3.2.1-canary.3449+741f0a6ef",
29
- "@atlaspack/logger": "2.12.1-canary.3449+741f0a6ef",
30
- "@atlaspack/package-manager": "2.12.1-canary.3449+741f0a6ef",
31
- "@atlaspack/plugin": "2.12.1-canary.3449+741f0a6ef",
32
- "@atlaspack/profiler": "2.12.1-canary.3449+741f0a6ef",
33
- "@atlaspack/rust": "2.12.1-canary.3449+741f0a6ef",
34
- "@atlaspack/types": "2.12.1-canary.3449+741f0a6ef",
35
- "@atlaspack/utils": "2.12.1-canary.3449+741f0a6ef",
36
- "@atlaspack/workers": "2.12.1-canary.3449+741f0a6ef",
23
+ "@atlaspack/cache": "2.12.1-canary.3450+d9092cb8e",
24
+ "@atlaspack/diagnostic": "2.12.1-canary.3450+d9092cb8e",
25
+ "@atlaspack/events": "2.12.1-canary.3450+d9092cb8e",
26
+ "@atlaspack/feature-flags": "2.12.1-canary.3450+d9092cb8e",
27
+ "@atlaspack/fs": "2.12.1-canary.3450+d9092cb8e",
28
+ "@atlaspack/graph": "3.2.1-canary.3450+d9092cb8e",
29
+ "@atlaspack/logger": "2.12.1-canary.3450+d9092cb8e",
30
+ "@atlaspack/package-manager": "2.12.1-canary.3450+d9092cb8e",
31
+ "@atlaspack/plugin": "2.12.1-canary.3450+d9092cb8e",
32
+ "@atlaspack/profiler": "2.12.1-canary.3450+d9092cb8e",
33
+ "@atlaspack/rust": "2.12.1-canary.3450+d9092cb8e",
34
+ "@atlaspack/types": "2.12.1-canary.3450+d9092cb8e",
35
+ "@atlaspack/utils": "2.12.1-canary.3450+d9092cb8e",
36
+ "@atlaspack/workers": "2.12.1-canary.3450+d9092cb8e",
37
37
  "@mischnic/json-sourcemap": "^0.1.0",
38
38
  "@parcel/source-map": "^2.1.1",
39
39
  "base-x": "^3.0.8",
@@ -57,5 +57,5 @@
57
57
  "browser": {
58
58
  "./src/serializerCore.js": "./src/serializerCore.browser.js"
59
59
  },
60
- "gitHead": "741f0a6efd61aa7af5d5ca419b360c2b7127b387"
60
+ "gitHead": "d9092cb8efbaed752761ddba4d11603533e2e063"
61
61
  }
package/src/AssetGraph.js CHANGED
@@ -176,7 +176,7 @@ export default class AssetGraph extends ContentGraph<AssetGraphNode> {
176
176
  }
177
177
  this.replaceNodeIdsConnectedTo(
178
178
  nullthrows(this.rootNodeId),
179
- nodes.map(node => this.addNode(node)),
179
+ nodes.map((node) => this.addNode(node)),
180
180
  );
181
181
  }
182
182
 
@@ -215,7 +215,7 @@ export default class AssetGraph extends ContentGraph<AssetGraphNode> {
215
215
 
216
216
  this.replaceNodeIdsConnectedTo(
217
217
  entrySpecifierNodeId,
218
- resolved.map(file => this.addNode(nodeFromEntryFile(file))),
218
+ resolved.map((file) => this.addNode(nodeFromEntryFile(file))),
219
219
  );
220
220
  }
221
221
 
@@ -224,7 +224,7 @@ export default class AssetGraph extends ContentGraph<AssetGraphNode> {
224
224
  targets: Array<Target>,
225
225
  correspondingRequest: string,
226
226
  ) {
227
- let depNodes = targets.map(target => {
227
+ let depNodes = targets.map((target) => {
228
228
  let node = nodeFromDep(
229
229
  // The passed project path is ignored in this case, because there is no `loc`
230
230
  createDependency('', {
@@ -256,7 +256,7 @@ export default class AssetGraph extends ContentGraph<AssetGraphNode> {
256
256
 
257
257
  this.replaceNodeIdsConnectedTo(
258
258
  entryNodeId,
259
- depNodes.map(node => this.addNode(node)),
259
+ depNodes.map((node) => this.addNode(node)),
260
260
  );
261
261
  }
262
262
 
@@ -342,7 +342,7 @@ export default class AssetGraph extends ContentGraph<AssetGraphNode> {
342
342
  let traversedNode = nullthrows(this.getNode(traversedNodeId));
343
343
  if (traversedNode.type === 'asset') {
344
344
  let hasDeferred = this.getNodeIdsConnectedFrom(traversedNodeId).some(
345
- childNodeId => {
345
+ (childNodeId) => {
346
346
  let childNode = nullthrows(this.getNode(childNodeId));
347
347
  return childNode.hasDeferred == null
348
348
  ? false
@@ -419,7 +419,7 @@ export default class AssetGraph extends ContentGraph<AssetGraphNode> {
419
419
 
420
420
  let deps = this.getIncomingDependencies(resolvedAsset);
421
421
 
422
- return deps.every(d => {
422
+ return deps.every((d) => {
423
423
  // If this dependency has already been through this process, and we
424
424
  // know it's not deferrable, then there's no need to re-check
425
425
  if (this.undeferredDependencies.has(d)) {
@@ -430,7 +430,7 @@ export default class AssetGraph extends ContentGraph<AssetGraphNode> {
430
430
  d.symbols &&
431
431
  !(d.env.isLibrary && d.isEntry) &&
432
432
  !d.symbols.has('*') &&
433
- ![...d.symbols.keys()].some(symbol => {
433
+ ![...d.symbols.keys()].some((symbol) => {
434
434
  let assetSymbol = resolvedAsset.symbols?.get(symbol)?.local;
435
435
  return assetSymbol != null && symbols.has(assetSymbol);
436
436
  });
@@ -534,7 +534,7 @@ export default class AssetGraph extends ContentGraph<AssetGraphNode> {
534
534
  };
535
535
  }
536
536
  let dependentAsset = dependentAssets.find(
537
- a => a.uniqueKey === dep.specifier,
537
+ (a) => a.uniqueKey === dep.specifier,
538
538
  );
539
539
  if (dependentAsset) {
540
540
  depNode.complete = true;
@@ -595,7 +595,7 @@ export default class AssetGraph extends ContentGraph<AssetGraphNode> {
595
595
  startNodeId: ?NodeId,
596
596
  ): ?TContext {
597
597
  return this.filteredTraverse(
598
- nodeId => {
598
+ (nodeId) => {
599
599
  let node = nullthrows(this.getNode(nodeId));
600
600
  return node.type === 'asset' ? node.value : null;
601
601
  },
@@ -633,7 +633,7 @@ export default class AssetGraph extends ContentGraph<AssetGraphNode> {
633
633
 
634
634
  let hash = new Hash();
635
635
  // TODO: sort??
636
- this.traverse(nodeId => {
636
+ this.traverse((nodeId) => {
637
637
  let node = nullthrows(this.getNode(nodeId));
638
638
  if (node.type === 'asset') {
639
639
  hash.writeString(nullthrows(node.value.outputHash));
package/src/Atlaspack.js CHANGED
@@ -401,7 +401,7 @@ export default class Atlaspack {
401
401
  options,
402
402
  ),
403
403
  buildTime: Date.now() - startTime,
404
- requestBundle: async bundle => {
404
+ requestBundle: async (bundle) => {
405
405
  let bundleNode = bundleGraph._graph.getNodeByContentKey(bundle.id);
406
406
  invariant(bundleNode?.type === 'bundle', 'Bundle does not exist');
407
407
 
@@ -580,7 +580,7 @@ export default class Atlaspack {
580
580
  let res = await this.#requestTracker.runRequest(request, {
581
581
  force: true,
582
582
  });
583
- return res.map(asset =>
583
+ return res.map((asset) =>
584
584
  assetFromValue(asset, nullthrows(this.#resolvedOptions)),
585
585
  );
586
586
  }
@@ -154,7 +154,7 @@ export default class AtlaspackConfig {
154
154
  loadPlugins<T>(
155
155
  plugins: PureAtlaspackConfigPipeline,
156
156
  ): Promise<Array<LoadedPlugin<T>>> {
157
- return Promise.all(plugins.map(p => this.loadPlugin<T>(p)));
157
+ return Promise.all(plugins.map((p) => this.loadPlugin<T>(p)));
158
158
  }
159
159
 
160
160
  async getResolvers(): Promise<Array<LoadedPlugin<Resolver<mixed>>>> {
@@ -181,7 +181,7 @@ export default class AtlaspackConfig {
181
181
  getValidatorNames(filePath: ProjectPath): Array<string> {
182
182
  let validators: PureAtlaspackConfigPipeline =
183
183
  this._getValidatorNodes(filePath);
184
- return validators.map(v => v.packageName);
184
+ return validators.map((v) => v.packageName);
185
185
  }
186
186
 
187
187
  getValidators(
@@ -193,8 +193,8 @@ export default class AtlaspackConfig {
193
193
 
194
194
  getNamedPipelines(): $ReadOnlyArray<string> {
195
195
  return Object.keys(this.transformers)
196
- .filter(glob => glob.includes(':'))
197
- .map(glob => glob.split(':')[0]);
196
+ .filter((glob) => glob.includes(':'))
197
+ .map((glob) => glob.split(':')[0]);
198
198
  }
199
199
 
200
200
  async getTransformers(
@@ -278,7 +278,9 @@ export default class AtlaspackConfig {
278
278
  // Pipelines for bundles come from their entry assets, so the pipeline likely exists in transformers.
279
279
  if (pipeline) {
280
280
  let prefix = pipeline + ':';
281
- if (!Object.keys(this.optimizers).some(glob => glob.startsWith(prefix))) {
281
+ if (
282
+ !Object.keys(this.optimizers).some((glob) => glob.startsWith(prefix))
283
+ ) {
282
284
  pipeline = null;
283
285
  }
284
286
  }
@@ -294,7 +296,7 @@ export default class AtlaspackConfig {
294
296
 
295
297
  getOptimizerNames(filePath: FilePath, pipeline: ?string): Array<string> {
296
298
  let optimizers = this._getOptimizerNodes(filePath, pipeline);
297
- return optimizers.map(o => o.packageName);
299
+ return optimizers.map((o) => o.packageName);
298
300
  }
299
301
 
300
302
  getOptimizers(
@@ -435,7 +437,7 @@ export default class AtlaspackConfig {
435
437
  configsWithPlugin = new Set(getConfigPaths(this.options, plugins));
436
438
  } else {
437
439
  configsWithPlugin = new Set(
438
- Object.keys(plugins).flatMap(k =>
440
+ Object.keys(plugins).flatMap((k) =>
439
441
  Array.isArray(plugins[k])
440
442
  ? getConfigPaths(this.options, plugins[k])
441
443
  : [getConfigPath(this.options, plugins[k])],
@@ -451,7 +453,7 @@ export default class AtlaspackConfig {
451
453
 
452
454
  let seenKey = false;
453
455
  let codeFrames = await Promise.all(
454
- [...configsWithPlugin].map(async filePath => {
456
+ [...configsWithPlugin].map(async (filePath) => {
455
457
  let configContents = await this.options.inputFS.readFile(
456
458
  filePath,
457
459
  'utf8',
@@ -481,7 +483,7 @@ export default class AtlaspackConfig {
481
483
 
482
484
  function getConfigPaths(options, nodes) {
483
485
  return nodes
484
- .map(node => (node !== '...' ? getConfigPath(options, node) : null))
486
+ .map((node) => (node !== '...' ? getConfigPath(options, node) : null))
485
487
  .filter(Boolean);
486
488
  }
487
489
 
@@ -96,7 +96,7 @@ export default {
96
96
  },
97
97
  bundler: {
98
98
  type: 'string',
99
- __validate: (validatePluginName('bundler', 'bundler'): string => void),
99
+ __validate: (validatePluginName('bundler', 'bundler'): (string) => void),
100
100
  },
101
101
  resolvers: (pipelineSchema('resolver', 'resolvers'): SchemaEntity),
102
102
  transformers: (mapPipelineSchema(