@atlaspack/query 2.12.1-dev.3443 → 2.12.1-dev.3460

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/cli.js CHANGED
@@ -60,7 +60,7 @@ function _table() {
60
60
  };
61
61
  return data;
62
62
  }
63
- var _index = require("./index.js");
63
+ var _index = require("./index");
64
64
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
65
65
  /* eslint-disable no-console, monorepo/no-internal-import */
66
66
  // $FlowFixMe
@@ -70,7 +70,7 @@ const {
70
70
  },
71
71
  Priority,
72
72
  fromProjectPathRelative
73
- } = require('./deep-imports.js');
73
+ } = require('./deep-imports');
74
74
  async function run(input) {
75
75
  let args = input;
76
76
  let cacheDir = _path().default.join(process.cwd(), '.parcel-cache');
@@ -4,16 +4,16 @@
4
4
  const v = {
5
5
  // Split up require specifier to outsmart packages/dev/babel-register/babel-plugin-module-translate.js
6
6
  // $FlowFixMe(unsupported-syntax)
7
- AssetGraph: require('@atlaspack/core' + '/lib/AssetGraph.js').default,
7
+ AssetGraph: require('@atlaspack/core' + '/lib/AssetGraph').default,
8
8
  // $FlowFixMe(unsupported-syntax)
9
- BundleGraph: require('@atlaspack/core' + '/lib/BundleGraph.js'),
9
+ BundleGraph: require('@atlaspack/core' + '/lib/BundleGraph'),
10
10
  // $FlowFixMe(unsupported-syntax)
11
- RequestTracker: require('@atlaspack/core' + '/lib/RequestTracker.js'),
11
+ RequestTracker: require('@atlaspack/core' + '/lib/RequestTracker'),
12
12
  // $FlowFixMe(unsupported-syntax)
13
- LMDBCache: require('@atlaspack/cache' + '/lib/LMDBCache.js').LMDBCache,
13
+ LMDBCache: require('@atlaspack/cache' + '/lib/LMDBCache').LMDBCache,
14
14
  // $FlowFixMe(unsupported-syntax)
15
- Priority: require('@atlaspack/core' + '/lib/types.js').Priority,
15
+ Priority: require('@atlaspack/core' + '/lib/types').Priority,
16
16
  // $FlowFixMe(unsupported-syntax)
17
- fromProjectPathRelative: require('@atlaspack/core' + '/lib/projectPath.js').fromProjectPathRelative
17
+ fromProjectPathRelative: require('@atlaspack/core' + '/lib/projectPath').fromProjectPathRelative
18
18
  };
19
19
  module.exports = v;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/query",
3
- "version": "2.12.1-dev.3443+d1170cfc7",
3
+ "version": "2.12.1-dev.3460+340817991",
4
4
  "license": "(MIT OR Apache-2.0)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -18,9 +18,9 @@
18
18
  },
19
19
  "main": "src/index.js",
20
20
  "dependencies": {
21
- "@atlaspack/cache": "2.12.1-dev.3443+d1170cfc7",
22
- "@atlaspack/core": "2.12.1-dev.3443+d1170cfc7",
23
- "@atlaspack/graph": "3.2.1-dev.3443+d1170cfc7",
21
+ "@atlaspack/cache": "2.12.1-dev.3460+340817991",
22
+ "@atlaspack/core": "2.12.1-dev.3460+340817991",
23
+ "@atlaspack/graph": "3.2.1-dev.3460+340817991",
24
24
  "nullthrows": "^1.1.1",
25
25
  "table": "^6.8.1",
26
26
  "v8-compile-cache": "^2.0.0"
@@ -30,5 +30,5 @@
30
30
  "@babel/core": "^7.22.11",
31
31
  "rimraf": "^5.0.5"
32
32
  },
33
- "gitHead": "d1170cfc79beb290b2a066f472f68f71f7d7cb23"
33
+ "gitHead": "3408179911d6c67e2bdad99e545dd7a0a9a6782c"
34
34
  }
package/src/cli.js CHANGED
@@ -14,13 +14,13 @@ import {serialize} from 'v8';
14
14
  // $FlowFixMe
15
15
  import {table} from 'table';
16
16
 
17
- import {loadGraphs} from './index.js';
17
+ import {loadGraphs} from './index';
18
18
 
19
19
  const {
20
20
  BundleGraph: {bundleGraphEdgeTypes: bundleGraphEdgeTypes},
21
21
  Priority,
22
22
  fromProjectPathRelative,
23
- } = require('./deep-imports.js');
23
+ } = require('./deep-imports');
24
24
 
25
25
  export async function run(input: string[]) {
26
26
  let args = input;
@@ -316,7 +316,7 @@ export async function run(input: string[]) {
316
316
  this.children.push(next);
317
317
  return next;
318
318
  }
319
- print(format: T => string, prefix = '') {
319
+ print(format: (T) => string, prefix = '') {
320
320
  console.log(
321
321
  `${prefix}${this.label} ${format(this.value)} ${this.suffix}`,
322
322
  );
@@ -368,7 +368,7 @@ export async function run(input: string[]) {
368
368
  }
369
369
  walk(graph.getNodeIdByContentKey(asset), {paths, lazyOutgoing: false});
370
370
 
371
- paths.print(id => {
371
+ paths.print((id) => {
372
372
  let node = nullthrows(graph.getNode(id));
373
373
  invariant(node.type === 'asset');
374
374
  return fromProjectPathRelative(node.value.filePath);
@@ -549,7 +549,7 @@ export async function run(input: string[]) {
549
549
  'Node is not a bundle, but a ' + node.type,
550
550
  );
551
551
 
552
- bundleGraph.traverseAssets(node.value, asset => {
552
+ bundleGraph.traverseAssets(node.value, (asset) => {
553
553
  console.log(asset.id, asset.filePath);
554
554
  });
555
555
  }
@@ -568,7 +568,7 @@ export async function run(input: string[]) {
568
568
  'Node is not a bundle, but a ' + node.type,
569
569
  );
570
570
 
571
- bundleGraph.traverseBundle(node.value, node => {
571
+ bundleGraph.traverseBundle(node.value, (node) => {
572
572
  if (node.type === 'asset') {
573
573
  console.log(node.id, node.value.filePath);
574
574
  } else {
@@ -667,7 +667,7 @@ export async function run(input: string[]) {
667
667
  assetNodeId,
668
668
  )) {
669
669
  if (
670
- referencingBundles.some(ref =>
670
+ referencingBundles.some((ref) =>
671
671
  bundleGraph._graph.hasEdge(
672
672
  bundleGraph._graph.getNodeIdByContentKey(ref.id),
673
673
  incoming,
@@ -688,8 +688,8 @@ export async function run(input: string[]) {
688
688
  const bundleGraphNodeId = bundleGraph._graph.getNodeIdByContentKey(node.id);
689
689
  return bundleGraph._graph
690
690
  .getNodeIdsConnectedTo(bundleGraphNodeId, -1)
691
- .map(id => nullthrows(bundleGraph._graph.getNode(id)))
692
- .find(node => node.type == type);
691
+ .map((id) => nullthrows(bundleGraph._graph.getNode(id)))
692
+ .find((node) => node.type == type);
693
693
  }
694
694
 
695
695
  // We find the priority of a Bundle or BundleGroup by looking at its incoming dependencies.
@@ -723,9 +723,9 @@ export async function run(input: string[]) {
723
723
  const bundleGraphNodeId = bundleGraph._graph.getNodeIdByContentKey(node.id);
724
724
  const entryBundleGroup = bundleGraph._graph
725
725
  .getNodeIdsConnectedTo(bundleGraphNodeId, -1)
726
- .map(id => nullthrows(bundleGraph._graph.getNode(id)))
726
+ .map((id) => nullthrows(bundleGraph._graph.getNode(id)))
727
727
  .find(
728
- node =>
728
+ (node) =>
729
729
  node.type === 'bundle_group' &&
730
730
  bundleGraph.isEntryBundleGroup(node.value),
731
731
  );
@@ -763,7 +763,7 @@ export async function run(input: string[]) {
763
763
  return '';
764
764
  }
765
765
  const initialValue = 0;
766
- let column = t.map(r => r[col]);
766
+ let column = t.map((r) => r[col]);
767
767
  column.shift();
768
768
  invariant(column != null);
769
769
  return column.reduce(
@@ -1060,7 +1060,7 @@ export async function run(input: string[]) {
1060
1060
  'findBundleReason',
1061
1061
  {
1062
1062
  help: 'args: <bundle> <asset>. Why is the asset in the bundle',
1063
- action: v => findBundleReason(...v.split(' ')),
1063
+ action: (v) => findBundleReason(...v.split(' ')),
1064
1064
  },
1065
1065
  ],
1066
1066
  [
@@ -1112,7 +1112,7 @@ export async function run(input: string[]) {
1112
1112
  server.defineCommand(name, {
1113
1113
  // $FlowFixMe
1114
1114
  help: '📦 ' + cmd.help,
1115
- action: v => {
1115
+ action: (v) => {
1116
1116
  // $FlowFixMe
1117
1117
  server.clearBufferedCommand();
1118
1118
  // $FlowFixMe
@@ -1,43 +1,43 @@
1
1
  // @flow
2
2
  /* eslint-disable monorepo/no-internal-import */
3
- import typeof AssetGraph from '@atlaspack/core/src/AssetGraph.js';
3
+ import typeof AssetGraph from '@atlaspack/core/src/AssetGraph';
4
4
  import typeof BundleGraph, {
5
5
  bundleGraphEdgeTypes,
6
- } from '@atlaspack/core/src/BundleGraph.js';
6
+ } from '@atlaspack/core/src/BundleGraph';
7
7
  import typeof RequestTracker, {
8
8
  RequestGraph,
9
9
  readAndDeserializeRequestGraph,
10
- } from '@atlaspack/core/src/RequestTracker.js';
11
- import typeof {requestGraphEdgeTypes} from '@atlaspack/core/src/RequestTracker.js';
12
- import typeof {LMDBCache} from '@atlaspack/cache/src/LMDBCache.js';
13
- import typeof {Priority} from '@atlaspack/core/src/types.js';
14
- import typeof {fromProjectPathRelative} from '@atlaspack/core/src/projectPath.js';
10
+ } from '@atlaspack/core/src/RequestTracker';
11
+ import typeof {requestGraphEdgeTypes} from '@atlaspack/core/src/RequestTracker';
12
+ import typeof {LMDBCache} from '@atlaspack/cache/src/LMDBCache';
13
+ import typeof {Priority} from '@atlaspack/core/src/types';
14
+ import typeof {fromProjectPathRelative} from '@atlaspack/core/src/projectPath';
15
15
 
16
16
  const v =
17
17
  process.env.ATLASPACK_BUILD_ENV === 'production'
18
18
  ? {
19
19
  // Split up require specifier to outsmart packages/dev/babel-register/babel-plugin-module-translate.js
20
20
  // $FlowFixMe(unsupported-syntax)
21
- AssetGraph: require('@atlaspack/core' + '/lib/AssetGraph.js').default,
21
+ AssetGraph: require('@atlaspack/core' + '/lib/AssetGraph').default,
22
22
  // $FlowFixMe(unsupported-syntax)
23
- BundleGraph: require('@atlaspack/core' + '/lib/BundleGraph.js'),
23
+ BundleGraph: require('@atlaspack/core' + '/lib/BundleGraph'),
24
24
  // $FlowFixMe(unsupported-syntax)
25
- RequestTracker: require('@atlaspack/core' + '/lib/RequestTracker.js'),
25
+ RequestTracker: require('@atlaspack/core' + '/lib/RequestTracker'),
26
26
  // $FlowFixMe(unsupported-syntax)
27
- LMDBCache: require('@atlaspack/cache' + '/lib/LMDBCache.js').LMDBCache,
27
+ LMDBCache: require('@atlaspack/cache' + '/lib/LMDBCache').LMDBCache,
28
28
  // $FlowFixMe(unsupported-syntax)
29
- Priority: require('@atlaspack/core' + '/lib/types.js').Priority,
29
+ Priority: require('@atlaspack/core' + '/lib/types').Priority,
30
30
  // $FlowFixMe(unsupported-syntax)
31
- fromProjectPathRelative: require('@atlaspack/core' +
32
- '/lib/projectPath.js').fromProjectPathRelative,
31
+ fromProjectPathRelative: require('@atlaspack/core' + '/lib/projectPath')
32
+ .fromProjectPathRelative,
33
33
  }
34
34
  : {
35
- AssetGraph: require('@atlaspack/core/src/AssetGraph.js').default,
36
- BundleGraph: require('@atlaspack/core/src/BundleGraph.js'),
37
- RequestTracker: require('@atlaspack/core/src/RequestTracker.js'),
38
- LMDBCache: require('@atlaspack/cache/src/LMDBCache.js').LMDBCache,
39
- Priority: require('@atlaspack/core/src/types.js').Priority,
40
- fromProjectPathRelative: require('@atlaspack/core/src/projectPath.js')
35
+ AssetGraph: require('@atlaspack/core/src/AssetGraph').default,
36
+ BundleGraph: require('@atlaspack/core/src/BundleGraph'),
37
+ RequestTracker: require('@atlaspack/core/src/RequestTracker'),
38
+ LMDBCache: require('@atlaspack/cache/src/LMDBCache').LMDBCache,
39
+ Priority: require('@atlaspack/core/src/types').Priority,
40
+ fromProjectPathRelative: require('@atlaspack/core/src/projectPath')
41
41
  .fromProjectPathRelative,
42
42
  };
43
43
 
package/src/index.js CHANGED
@@ -39,17 +39,17 @@ export async function loadGraphs(cacheDir: string): Promise<{|
39
39
  |}> = [
40
40
  {
41
41
  name: 'requestGraphBlob',
42
- check: basename =>
42
+ check: (basename) =>
43
43
  basename.startsWith('requestGraph-') &&
44
44
  !basename.startsWith('requestGraph-nodes'),
45
45
  },
46
46
  {
47
47
  name: 'bundleGraphBlob',
48
- check: basename => basename.endsWith('BundleGraph-0'),
48
+ check: (basename) => basename.endsWith('BundleGraph-0'),
49
49
  },
50
50
  {
51
51
  name: 'assetGraphBlob',
52
- check: basename => basename.endsWith('AssetGraph-0'),
52
+ check: (basename) => basename.endsWith('AssetGraph-0'),
53
53
  },
54
54
  ];
55
55
 
@@ -148,7 +148,7 @@ export async function loadGraphs(cacheDir: string): Promise<{|
148
148
  function getSubRequests(id: NodeId) {
149
149
  return requestTracker.graph
150
150
  .getNodeIdsConnectedFrom(id, requestGraphEdgeTypes.subrequest)
151
- .map(n => nullthrows(requestTracker.graph.getNode(n)));
151
+ .map((n) => nullthrows(requestTracker.graph.getNode(n)));
152
152
  }
153
153
 
154
154
  // Load graphs by finding the main subrequests and loading their results
@@ -167,7 +167,7 @@ export async function loadGraphs(cacheDir: string): Promise<{|
167
167
  let buildRequestSubRequests = getSubRequests(buildRequestId);
168
168
 
169
169
  let writeBundlesRequest = buildRequestSubRequests.find(
170
- n => n.type === 1 && n.requestType === 11,
170
+ (n) => n.type === 1 && n.requestType === 11,
171
171
  );
172
172
  if (writeBundlesRequest != null) {
173
173
  invariant(writeBundlesRequest.type === 1);