@atlaspack/query 2.14.22-typescript-5b4d3ad41.0 → 2.14.22
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/CHANGELOG.md +9 -0
- package/lib/cli.js +26 -36
- package/lib/deep-imports.js +7 -2
- package/lib/index.js +6 -12
- package/package.json +7 -7
- package/src/{cli.ts → cli.js} +41 -65
- package/src/{deep-imports.ts → deep-imports.js} +31 -28
- package/src/{index.ts → index.js} +23 -30
- package/LICENSE +0 -201
- package/tsconfig.json +0 -4
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# @atlaspack/query
|
2
2
|
|
3
|
+
## 2.14.22
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- Updated dependencies [[`069de47`](https://github.com/atlassian-labs/atlaspack/commit/069de478e64fb5889f6f2ce023eb510782767fbd)]:
|
8
|
+
- @atlaspack/core@2.20.0
|
9
|
+
- @atlaspack/cache@3.2.16
|
10
|
+
- @atlaspack/graph@3.5.10
|
11
|
+
|
3
12
|
## 2.14.21
|
4
13
|
|
5
14
|
### Patch Changes
|
package/lib/cli.js
CHANGED
@@ -63,7 +63,7 @@ function _table() {
|
|
63
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
|
67
67
|
const {
|
68
68
|
BundleGraph: {
|
69
69
|
bundleGraphEdgeTypes: bundleGraphEdgeTypes
|
@@ -488,8 +488,6 @@ async function run(input) {
|
|
488
488
|
let bundleId = (0, _nullthrows().default)(parseBundleLocator(v), 'Bundle not found');
|
489
489
|
let node = (0, _nullthrows().default)(bundleGraph._graph.getNodeByContentKey(bundleId), 'Bundle not found');
|
490
490
|
(0, _assert().default)(node.type === 'bundle', 'Node is not a bundle, but a ' + node.type);
|
491
|
-
|
492
|
-
// @ts-expect-error TS7006
|
493
491
|
bundleGraph.traverseAssets(node.value, asset => {
|
494
492
|
console.log(asset.id, asset.filePath);
|
495
493
|
});
|
@@ -502,8 +500,6 @@ async function run(input) {
|
|
502
500
|
let bundleId = (0, _nullthrows().default)(parseBundleLocator(v), 'Bundle not found');
|
503
501
|
let node = (0, _nullthrows().default)(bundleGraph._graph.getNodeByContentKey(bundleId), 'Bundle not found');
|
504
502
|
(0, _assert().default)(node.type === 'bundle', 'Node is not a bundle, but a ' + node.type);
|
505
|
-
|
506
|
-
// @ts-expect-error TS7006
|
507
503
|
bundleGraph.traverseBundle(node.value, node => {
|
508
504
|
if (node.type === 'asset') {
|
509
505
|
console.log(node.id, node.value.filePath);
|
@@ -550,34 +546,23 @@ async function run(input) {
|
|
550
546
|
console.log('# Incoming dependencies contained in referencing bundles (using this bundle as a shared bundle)');
|
551
547
|
let referencingBundles = bundleGraph.getReferencingBundles(bundleNode.value);
|
552
548
|
for (let incoming of bundleGraph._graph.getNodeIdsConnectedTo(assetNodeId)) {
|
553
|
-
if (
|
554
|
-
// @ts-expect-error TS7006
|
555
|
-
referencingBundles.some(ref => bundleGraph._graph.hasEdge(bundleGraph._graph.getNodeIdByContentKey(ref.id), incoming, bundleGraphEdgeTypes.contains))) {
|
549
|
+
if (referencingBundles.some(ref => bundleGraph._graph.hasEdge(bundleGraph._graph.getNodeIdByContentKey(ref.id), incoming, bundleGraphEdgeTypes.contains))) {
|
556
550
|
console.log(bundleGraph._graph.getNode(incoming));
|
557
551
|
}
|
558
552
|
}
|
559
553
|
}
|
560
|
-
function _getIncomingNodeOfType(
|
561
|
-
// @ts-expect-error TS2304
|
562
|
-
bundleGraph,
|
563
|
-
// @ts-expect-error TS7006
|
564
|
-
node, type) {
|
554
|
+
function _getIncomingNodeOfType(bundleGraph, node, type) {
|
565
555
|
if (!hasBundleGraph()) {
|
566
556
|
return;
|
567
557
|
}
|
568
558
|
(0, _assert().default)(bundleGraph != null);
|
569
559
|
const bundleGraphNodeId = bundleGraph._graph.getNodeIdByContentKey(node.id);
|
570
|
-
return bundleGraph._graph.getNodeIdsConnectedTo(bundleGraphNodeId, -1)
|
571
|
-
// @ts-expect-error TS7006
|
572
|
-
.map(id => (0, _nullthrows().default)(bundleGraph._graph.getNode(id)))
|
573
|
-
// @ts-expect-error TS7006
|
574
|
-
.find(node => node.type == type);
|
560
|
+
return bundleGraph._graph.getNodeIdsConnectedTo(bundleGraphNodeId, -1).map(id => (0, _nullthrows().default)(bundleGraph._graph.getNode(id))).find(node => node.type == type);
|
575
561
|
}
|
576
562
|
|
577
563
|
// We find the priority of a Bundle or BundleGroup by looking at its incoming dependencies.
|
578
564
|
// If a Bundle does not have an incoming dependency, we look for an incoming BundleGroup and its dependency
|
579
565
|
// e.g. Dep(priority = 1) -> BundleGroup -> Bundle means that the Bundle has priority 1.
|
580
|
-
// @ts-expect-error TS2304
|
581
566
|
function _getBundlePriority(bundleGraph, bundle) {
|
582
567
|
if (!hasBundleGraph()) {
|
583
568
|
return;
|
@@ -593,19 +578,13 @@ async function run(input) {
|
|
593
578
|
(0, _assert().default)(node.type === 'dependency', 'Not a dependency');
|
594
579
|
return node.value.priority;
|
595
580
|
}
|
596
|
-
|
597
|
-
// @ts-expect-error TS2304
|
598
581
|
function _findEntryBundle(bundleGraph, node) {
|
599
582
|
if (!hasBundleGraph()) {
|
600
583
|
return;
|
601
584
|
}
|
602
585
|
(0, _assert().default)(bundleGraph != null);
|
603
586
|
const bundleGraphNodeId = bundleGraph._graph.getNodeIdByContentKey(node.id);
|
604
|
-
const entryBundleGroup = bundleGraph._graph.getNodeIdsConnectedTo(bundleGraphNodeId, -1)
|
605
|
-
// @ts-expect-error TS7006
|
606
|
-
.map(id => (0, _nullthrows().default)(bundleGraph._graph.getNode(id))).find(
|
607
|
-
// @ts-expect-error TS7006
|
608
|
-
node => node.type === 'bundle_group' && bundleGraph.isEntryBundleGroup(node.value));
|
587
|
+
const entryBundleGroup = bundleGraph._graph.getNodeIdsConnectedTo(bundleGraphNodeId, -1).map(id => (0, _nullthrows().default)(bundleGraph._graph.getNode(id))).find(node => node.type === 'bundle_group' && bundleGraph.isEntryBundleGroup(node.value));
|
609
588
|
return entryBundleGroup;
|
610
589
|
}
|
611
590
|
// eslint-disable-next-line no-unused-vars
|
@@ -633,16 +612,12 @@ async function run(input) {
|
|
633
612
|
let column = t.map(r => r[col]);
|
634
613
|
column.shift();
|
635
614
|
(0, _assert().default)(column != null);
|
636
|
-
return column.reduce(
|
637
|
-
// @ts-expect-error TS2365
|
638
|
-
(accumulator, currentValue) => accumulator + currentValue, initialValue);
|
615
|
+
return column.reduce((accumulator, currentValue) => accumulator + currentValue, initialValue);
|
639
616
|
}
|
640
617
|
table.push(['Totals', getColumnSum(table, 1), getColumnSum(table, 2), getColumnSum(table, 3)]);
|
641
618
|
_printStatsTable('Cache Info', table);
|
642
619
|
}
|
643
|
-
function timeSerialize(
|
644
|
-
// @ts-expect-error TS2304
|
645
|
-
graph) {
|
620
|
+
function timeSerialize(graph) {
|
646
621
|
let date = Date.now();
|
647
622
|
(0, _v().serialize)(graph);
|
648
623
|
date = Date.now() - date;
|
@@ -672,7 +647,7 @@ async function run(input) {
|
|
672
647
|
(0, _assert().default)(assetGraph != null);
|
673
648
|
for (let n of assetGraph.nodes) {
|
674
649
|
if (n && n.type in ag) {
|
675
|
-
//
|
650
|
+
// $FlowFixMe
|
676
651
|
ag[n.type]++;
|
677
652
|
}
|
678
653
|
}
|
@@ -703,7 +678,11 @@ async function run(input) {
|
|
703
678
|
bg.bundle_group++;
|
704
679
|
} else if ((n === null || n === void 0 ? void 0 : n.type) === 'bundle') {
|
705
680
|
bg.bundle++;
|
681
|
+
|
682
|
+
// $FlowFixMe
|
706
683
|
b_ext[n.value.type] = (b_ext[n.value.type] || 0) + 1;
|
684
|
+
|
685
|
+
// $FlowFixMe
|
707
686
|
const entry_group = _findEntryBundle(bundleGraph, n);
|
708
687
|
if (entry_group != null && !entries.has(entry_group.id)) {
|
709
688
|
b_type.entry++;
|
@@ -722,7 +701,9 @@ async function run(input) {
|
|
722
701
|
}
|
723
702
|
}
|
724
703
|
} else if ((n === null || n === void 0 ? void 0 : n.type) === 'asset') {
|
725
|
-
if (
|
704
|
+
if (
|
705
|
+
// $FlowFixMe
|
706
|
+
fromProjectPathRelative(n.value.filePath).includes('node_modules')) {
|
726
707
|
bg.asset_node_modules++;
|
727
708
|
} else {
|
728
709
|
bg.asset_source++;
|
@@ -743,7 +724,6 @@ async function run(input) {
|
|
743
724
|
}
|
744
725
|
let sum_b_type = 0;
|
745
726
|
for (let k in b_type) {
|
746
|
-
// @ts-expect-error TS7053
|
747
727
|
sum_b_type += b_type[k];
|
748
728
|
}
|
749
729
|
(0, _assert().default)(bg.bundle == sum_b_type, `Bundles by type ${sum_b_type} does not equal total ${bg.bundle}`);
|
@@ -767,10 +747,16 @@ async function run(input) {
|
|
767
747
|
useColors: true,
|
768
748
|
useGlobal: true
|
769
749
|
});
|
750
|
+
// $FlowFixMe[prop-missing]
|
770
751
|
server.setupHistory(_path().default.join(_os().default.homedir(), '.parcel_query_history'), () => {});
|
752
|
+
|
753
|
+
// $FlowFixMe[prop-missing]
|
771
754
|
server.context.bundleGraph = bundleGraph;
|
755
|
+
// $FlowFixMe[prop-missing]
|
772
756
|
server.context.assetGraph = assetGraph;
|
757
|
+
// $FlowFixMe[prop-missing]
|
773
758
|
server.context.requestTracker = requestTracker;
|
759
|
+
// $FlowFixMe[prop-missing]
|
774
760
|
server.context.cacheInfo = cacheInfo;
|
775
761
|
for (let [name, cmd] of new Map([['getAsset', {
|
776
762
|
help: 'args: <id | public id | filepath>',
|
@@ -822,7 +808,6 @@ async function run(input) {
|
|
822
808
|
action: getBundle
|
823
809
|
}], ['findBundleReason', {
|
824
810
|
help: 'args: <bundle> <asset>. Why is the asset in the bundle',
|
825
|
-
// @ts-expect-error TS2556
|
826
811
|
action: v => findBundleReason(...v.split(' '))
|
827
812
|
}], ['getBundles', {
|
828
813
|
help: 'List all bundles',
|
@@ -843,11 +828,16 @@ async function run(input) {
|
|
843
828
|
help: 'args: <local>. Get the asset that defines the symbol with the given local name',
|
844
829
|
action: findAssetWithSymbol
|
845
830
|
}]])) {
|
831
|
+
// $FlowFixMe
|
846
832
|
server.context[name] = cmd.action;
|
833
|
+
// $FlowFixMe
|
847
834
|
server.defineCommand(name, {
|
835
|
+
// $FlowFixMe
|
848
836
|
help: '📦 ' + cmd.help,
|
849
837
|
action: v => {
|
838
|
+
// $FlowFixMe
|
850
839
|
server.clearBufferedCommand();
|
840
|
+
// $FlowFixMe
|
851
841
|
try {
|
852
842
|
cmd.action(v);
|
853
843
|
} finally {
|
package/lib/deep-imports.js
CHANGED
@@ -1,14 +1,19 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
/* eslint-disable monorepo/no-internal-import */
|
4
|
-
|
5
|
-
const v = process.env.ATLASPACK_BUILD_ENV === 'production' || process.env.ATLASPACK_REGISTER_USE_SRC !== 'true' ? {
|
4
|
+
const v = process.env.ATLASPACK_BUILD_ENV === 'production' ? {
|
6
5
|
// Split up require specifier to outsmart packages/dev/babel-register/babel-plugin-module-translate.js
|
6
|
+
// $FlowFixMe(unsupported-syntax)
|
7
7
|
AssetGraph: require('@atlaspack/core' + '/lib/AssetGraph').default,
|
8
|
+
// $FlowFixMe(unsupported-syntax)
|
8
9
|
BundleGraph: require('@atlaspack/core' + '/lib/BundleGraph'),
|
10
|
+
// $FlowFixMe(unsupported-syntax)
|
9
11
|
RequestTracker: require('@atlaspack/core' + '/lib/RequestTracker'),
|
12
|
+
// $FlowFixMe(unsupported-syntax)
|
10
13
|
LMDBLiteCache: require('@atlaspack/cache' + '/lib/LMDBLiteCache').LMDBLiteCache,
|
14
|
+
// $FlowFixMe(unsupported-syntax)
|
11
15
|
Priority: require('@atlaspack/core' + '/lib/types').Priority,
|
16
|
+
// $FlowFixMe(unsupported-syntax)
|
12
17
|
fromProjectPathRelative: require('@atlaspack/core' + '/lib/projectPath').fromProjectPathRelative
|
13
18
|
} : {
|
14
19
|
AssetGraph: require('@atlaspack/core/src/AssetGraph').default,
|
package/lib/index.js
CHANGED
@@ -27,7 +27,6 @@ function _assert() {
|
|
27
27
|
}
|
28
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
29
29
|
/* eslint-disable no-console, monorepo/no-internal-import */
|
30
|
-
|
31
30
|
const {
|
32
31
|
AssetGraph,
|
33
32
|
BundleGraph: {
|
@@ -39,7 +38,7 @@ const {
|
|
39
38
|
requestGraphEdgeTypes
|
40
39
|
},
|
41
40
|
LMDBLiteCache
|
42
|
-
} =
|
41
|
+
} = require('./deep-imports.js');
|
43
42
|
async function loadGraphs(cacheDir) {
|
44
43
|
let cacheInfo = new Map();
|
45
44
|
const cache = new LMDBLiteCache(cacheDir);
|
@@ -71,7 +70,6 @@ async function loadGraphs(cacheDir) {
|
|
71
70
|
});
|
72
71
|
|
73
72
|
// Get requestTracker
|
74
|
-
// @ts-expect-error TS7034
|
75
73
|
let requestTracker;
|
76
74
|
if (requestGraphBlob != null && requestGraphKey != null) {
|
77
75
|
try {
|
@@ -86,7 +84,9 @@ async function loadGraphs(cacheDir) {
|
|
86
84
|
} = await readAndDeserializeRequestGraph(cache, requestGraphBlob, requestGraphKey);
|
87
85
|
requestTracker = new RequestTracker({
|
88
86
|
graph: requestGraph,
|
87
|
+
// $FlowFixMe
|
89
88
|
farm: null,
|
89
|
+
// $FlowFixMe
|
90
90
|
options: null
|
91
91
|
});
|
92
92
|
let timeToDeserialize = Date.now() - date;
|
@@ -134,12 +134,7 @@ async function loadGraphs(cacheDir) {
|
|
134
134
|
}
|
135
135
|
}
|
136
136
|
function getSubRequests(id) {
|
137
|
-
return (
|
138
|
-
// @ts-expect-error TS7005
|
139
|
-
requestTracker.graph.getNodeIdsConnectedFrom(id, requestGraphEdgeTypes.subrequest)
|
140
|
-
// @ts-expect-error TS7006
|
141
|
-
.map(n => (0, _nullthrows().default)(requestTracker.graph.getNode(n)))
|
142
|
-
);
|
137
|
+
return requestTracker.graph.getNodeIdsConnectedFrom(id, requestGraphEdgeTypes.subrequest).map(n => (0, _nullthrows().default)(requestTracker.graph.getNode(n)));
|
143
138
|
}
|
144
139
|
|
145
140
|
// Load graphs by finding the main subrequests and loading their results
|
@@ -150,11 +145,10 @@ async function loadGraphs(cacheDir) {
|
|
150
145
|
let buildRequestNode = (0, _nullthrows().default)(requestTracker.graph.getNode(buildRequestId));
|
151
146
|
(0, _assert().default)(buildRequestNode.type === 1 && buildRequestNode.requestType === 1);
|
152
147
|
let buildRequestSubRequests = getSubRequests(buildRequestId);
|
153
|
-
let writeBundlesRequest = buildRequestSubRequests.find(
|
154
|
-
// @ts-expect-error TS7006
|
155
|
-
n => n.type === 1 && n.requestType === 11);
|
148
|
+
let writeBundlesRequest = buildRequestSubRequests.find(n => n.type === 1 && n.requestType === 11);
|
156
149
|
if (writeBundlesRequest != null) {
|
157
150
|
(0, _assert().default)(writeBundlesRequest.type === 1);
|
151
|
+
// $FlowFixMe[incompatible-cast]
|
158
152
|
bundleInfo = (0, _nullthrows().default)(writeBundlesRequest.result);
|
159
153
|
}
|
160
154
|
} catch (e) {
|
package/package.json
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@atlaspack/query",
|
3
|
-
"version": "2.14.22
|
3
|
+
"version": "2.14.22",
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
5
5
|
"publishConfig": {
|
6
6
|
"access": "public"
|
7
7
|
},
|
8
8
|
"scripts": {
|
9
|
+
"prepack": "./ensure-no-dev-lib.sh",
|
9
10
|
"dev:prepare": "rimraf ./lib/ && mkdir -p lib && cp ./bin/dev-bin.js ./lib/bin.js"
|
10
11
|
},
|
11
12
|
"repository": {
|
@@ -17,18 +18,17 @@
|
|
17
18
|
},
|
18
19
|
"main": "src/index.js",
|
19
20
|
"dependencies": {
|
20
|
-
"@atlaspack/cache": "3.2.16
|
21
|
-
"@atlaspack/core": "2.
|
22
|
-
"@atlaspack/graph": "3.5.10
|
21
|
+
"@atlaspack/cache": "3.2.16",
|
22
|
+
"@atlaspack/core": "2.20.0",
|
23
|
+
"@atlaspack/graph": "3.5.10",
|
23
24
|
"nullthrows": "^1.1.1",
|
24
25
|
"table": "^6.8.1",
|
25
26
|
"v8-compile-cache": "^2.0.0"
|
26
27
|
},
|
27
28
|
"devDependencies": {
|
28
|
-
"@atlaspack/babel-register": "2.14.2-typescript-5b4d3ad41.0",
|
29
29
|
"@babel/core": "^7.22.11",
|
30
|
+
"@atlaspack/babel-register": "2.14.1",
|
30
31
|
"rimraf": "^5.0.5"
|
31
32
|
},
|
32
|
-
"type": "commonjs"
|
33
|
-
"gitHead": "5b4d3ad41ffa002b989ba77271bb3010a1f05b2a"
|
33
|
+
"type": "commonjs"
|
34
34
|
}
|
package/src/{cli.ts → cli.js}
RENAMED
@@ -1,3 +1,4 @@
|
|
1
|
+
// @flow strict-local
|
1
2
|
/* eslint-disable no-console, monorepo/no-internal-import */
|
2
3
|
import type {ContentGraph, ContentKey, NodeId} from '@atlaspack/graph';
|
3
4
|
import type {BundleGraphEdgeType} from '@atlaspack/core/src/BundleGraph';
|
@@ -10,6 +11,7 @@ import os from 'os';
|
|
10
11
|
import nullthrows from 'nullthrows';
|
11
12
|
import invariant from 'assert';
|
12
13
|
import {serialize} from 'v8';
|
14
|
+
// $FlowFixMe
|
13
15
|
import {table} from 'table';
|
14
16
|
|
15
17
|
import {loadGraphs} from './index';
|
@@ -31,7 +33,7 @@ export async function run(input: string[]) {
|
|
31
33
|
|
32
34
|
try {
|
33
35
|
fs.accessSync(cacheDir);
|
34
|
-
} catch (e
|
36
|
+
} catch (e) {
|
35
37
|
console.error("Can't find cache dir", cacheDir);
|
36
38
|
process.exit(1);
|
37
39
|
}
|
@@ -83,7 +85,7 @@ export async function run(input: string[]) {
|
|
83
85
|
}
|
84
86
|
|
85
87
|
function parseAssetLocator(v: string) {
|
86
|
-
let id: string
|
88
|
+
let id: ?string = null;
|
87
89
|
if (v.length === 16) {
|
88
90
|
id = v;
|
89
91
|
} else {
|
@@ -136,7 +138,7 @@ export async function run(input: string[]) {
|
|
136
138
|
}
|
137
139
|
|
138
140
|
function getAsset(v: string) {
|
139
|
-
let id: string
|
141
|
+
let id: ?string = parseAssetLocator(v);
|
140
142
|
|
141
143
|
if (id == null) {
|
142
144
|
console.log(null);
|
@@ -149,7 +151,7 @@ export async function run(input: string[]) {
|
|
149
151
|
let asset = bundleGraph.getAssetById(id);
|
150
152
|
console.log('Public id', bundleGraph.getAssetPublicId(asset));
|
151
153
|
console.log(asset);
|
152
|
-
} catch (e
|
154
|
+
} catch (e) {
|
153
155
|
if (!hasAssetGraph()) {
|
154
156
|
return;
|
155
157
|
}
|
@@ -190,7 +192,7 @@ export async function run(input: string[]) {
|
|
190
192
|
bundleGraph.getAssetById(node.id),
|
191
193
|
)} ${fromProjectPathRelative(node.value.filePath)}`,
|
192
194
|
);
|
193
|
-
} catch (e
|
195
|
+
} catch (e) {
|
194
196
|
console.log(fromProjectPathRelative(node.value.filePath));
|
195
197
|
}
|
196
198
|
}
|
@@ -244,7 +246,7 @@ export async function run(input: string[]) {
|
|
244
246
|
bundleGraph.getAssetById(asset.id),
|
245
247
|
)} ${fromProjectPathRelative(asset.value.filePath)}`,
|
246
248
|
);
|
247
|
-
} catch (e
|
249
|
+
} catch (e) {
|
248
250
|
console.log(fromProjectPathRelative(asset.value.filePath));
|
249
251
|
}
|
250
252
|
if (binding === 'export' && asset.value.symbols) {
|
@@ -260,7 +262,7 @@ export async function run(input: string[]) {
|
|
260
262
|
bundleGraph.getAssetById(locAsset.id),
|
261
263
|
)} ${fromProjectPathRelative(locAsset.value.filePath)}`,
|
262
264
|
);
|
263
|
-
} catch (e
|
265
|
+
} catch (e) {
|
264
266
|
console.log(
|
265
267
|
`imported as ${symbolName} from ${fromProjectPathRelative(
|
266
268
|
locAsset.value.filePath,
|
@@ -309,12 +311,12 @@ export async function run(input: string[]) {
|
|
309
311
|
this.label = label;
|
310
312
|
this.suffix = suffix;
|
311
313
|
}
|
312
|
-
add(v: T, label
|
314
|
+
add(v: T, label: string | void, suffix: string | void): Paths<T> {
|
313
315
|
let next = new Paths(v, label, suffix);
|
314
316
|
this.children.push(next);
|
315
317
|
return next;
|
316
318
|
}
|
317
|
-
print(format: (
|
319
|
+
print(format: (T) => string, prefix = '') {
|
318
320
|
console.log(
|
319
321
|
`${prefix}${this.label} ${format(this.value)} ${this.suffix}`,
|
320
322
|
);
|
@@ -333,14 +335,7 @@ export async function run(input: string[]) {
|
|
333
335
|
let asset = nullthrows(parseAssetLocator(v), 'Asset not found');
|
334
336
|
|
335
337
|
let paths = new Paths<NodeId>(graph.getNodeIdByContentKey(asset), ' ');
|
336
|
-
let cb = (
|
337
|
-
id: NodeId,
|
338
|
-
ctx: {
|
339
|
-
lazyOutgoing: boolean;
|
340
|
-
paths: Paths<NodeId>;
|
341
|
-
},
|
342
|
-
revisiting: boolean,
|
343
|
-
) => {
|
338
|
+
let cb = (id, ctx, revisiting) => {
|
344
339
|
let {paths, lazyOutgoing} = ctx;
|
345
340
|
let node = nullthrows(graph.getNode(id));
|
346
341
|
if (node.id === asset) return ctx;
|
@@ -361,13 +356,7 @@ export async function run(input: string[]) {
|
|
361
356
|
|
362
357
|
// like graph.dfs, but revisiting nodes and skipping its children
|
363
358
|
let seen = new Set();
|
364
|
-
function walk(
|
365
|
-
id: NodeId,
|
366
|
-
ctx: {
|
367
|
-
lazyOutgoing: boolean;
|
368
|
-
paths: Paths<NodeId>;
|
369
|
-
},
|
370
|
-
) {
|
359
|
+
function walk(id, ctx) {
|
371
360
|
let revisiting = seen.has(id);
|
372
361
|
let newCtx = cb(id, ctx, revisiting);
|
373
362
|
if (revisiting) return;
|
@@ -445,7 +434,7 @@ export async function run(input: string[]) {
|
|
445
434
|
}
|
446
435
|
|
447
436
|
// eslint-disable-next-line no-unused-vars
|
448
|
-
function getBundles(_
|
437
|
+
function getBundles(_) {
|
449
438
|
if (!hasBundleGraph()) {
|
450
439
|
return;
|
451
440
|
}
|
@@ -560,7 +549,6 @@ export async function run(input: string[]) {
|
|
560
549
|
'Node is not a bundle, but a ' + node.type,
|
561
550
|
);
|
562
551
|
|
563
|
-
// @ts-expect-error TS7006
|
564
552
|
bundleGraph.traverseAssets(node.value, (asset) => {
|
565
553
|
console.log(asset.id, asset.filePath);
|
566
554
|
});
|
@@ -580,7 +568,6 @@ export async function run(input: string[]) {
|
|
580
568
|
'Node is not a bundle, but a ' + node.type,
|
581
569
|
);
|
582
570
|
|
583
|
-
// @ts-expect-error TS7006
|
584
571
|
bundleGraph.traverseBundle(node.value, (node) => {
|
585
572
|
if (node.type === 'asset') {
|
586
573
|
console.log(node.id, node.value.filePath);
|
@@ -680,7 +667,6 @@ export async function run(input: string[]) {
|
|
680
667
|
assetNodeId,
|
681
668
|
)) {
|
682
669
|
if (
|
683
|
-
// @ts-expect-error TS7006
|
684
670
|
referencingBundles.some((ref) =>
|
685
671
|
bundleGraph._graph.hasEdge(
|
686
672
|
bundleGraph._graph.getNodeIdByContentKey(ref.id),
|
@@ -694,33 +680,22 @@ export async function run(input: string[]) {
|
|
694
680
|
}
|
695
681
|
}
|
696
682
|
|
697
|
-
function _getIncomingNodeOfType(
|
698
|
-
// @ts-expect-error TS2304
|
699
|
-
bundleGraph: BundleGraph,
|
700
|
-
// @ts-expect-error TS7006
|
701
|
-
node,
|
702
|
-
type: string,
|
703
|
-
) {
|
683
|
+
function _getIncomingNodeOfType(bundleGraph, node, type: string) {
|
704
684
|
if (!hasBundleGraph()) {
|
705
685
|
return;
|
706
686
|
}
|
707
687
|
invariant(bundleGraph != null);
|
708
688
|
const bundleGraphNodeId = bundleGraph._graph.getNodeIdByContentKey(node.id);
|
709
|
-
return
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
.map((id) => nullthrows(bundleGraph._graph.getNode(id)))
|
714
|
-
// @ts-expect-error TS7006
|
715
|
-
.find((node) => node.type == type)
|
716
|
-
);
|
689
|
+
return bundleGraph._graph
|
690
|
+
.getNodeIdsConnectedTo(bundleGraphNodeId, -1)
|
691
|
+
.map((id) => nullthrows(bundleGraph._graph.getNode(id)))
|
692
|
+
.find((node) => node.type == type);
|
717
693
|
}
|
718
694
|
|
719
695
|
// We find the priority of a Bundle or BundleGroup by looking at its incoming dependencies.
|
720
696
|
// If a Bundle does not have an incoming dependency, we look for an incoming BundleGroup and its dependency
|
721
697
|
// e.g. Dep(priority = 1) -> BundleGroup -> Bundle means that the Bundle has priority 1.
|
722
|
-
|
723
|
-
function _getBundlePriority(bundleGraph: BundleGraph, bundle: BundleNode) {
|
698
|
+
function _getBundlePriority(bundleGraph, bundle) {
|
724
699
|
if (!hasBundleGraph()) {
|
725
700
|
return;
|
726
701
|
}
|
@@ -740,8 +715,7 @@ export async function run(input: string[]) {
|
|
740
715
|
return node.value.priority;
|
741
716
|
}
|
742
717
|
|
743
|
-
|
744
|
-
function _findEntryBundle(bundleGraph: BundleGraph, node: BundleNode) {
|
718
|
+
function _findEntryBundle(bundleGraph, node) {
|
745
719
|
if (!hasBundleGraph()) {
|
746
720
|
return;
|
747
721
|
}
|
@@ -749,10 +723,8 @@ export async function run(input: string[]) {
|
|
749
723
|
const bundleGraphNodeId = bundleGraph._graph.getNodeIdByContentKey(node.id);
|
750
724
|
const entryBundleGroup = bundleGraph._graph
|
751
725
|
.getNodeIdsConnectedTo(bundleGraphNodeId, -1)
|
752
|
-
// @ts-expect-error TS7006
|
753
726
|
.map((id) => nullthrows(bundleGraph._graph.getNode(id)))
|
754
727
|
.find(
|
755
|
-
// @ts-expect-error TS7006
|
756
728
|
(node) =>
|
757
729
|
node.type === 'bundle_group' &&
|
758
730
|
bundleGraph.isEntryBundleGroup(node.value),
|
@@ -761,7 +733,7 @@ export async function run(input: string[]) {
|
|
761
733
|
return entryBundleGroup;
|
762
734
|
}
|
763
735
|
// eslint-disable-next-line no-unused-vars
|
764
|
-
function inspectCache(_
|
736
|
+
function inspectCache(_) {
|
765
737
|
// displays sizing of various entries of the cache
|
766
738
|
let table: Array<Array<string | number>> = [];
|
767
739
|
table.push([
|
@@ -795,7 +767,6 @@ export async function run(input: string[]) {
|
|
795
767
|
column.shift();
|
796
768
|
invariant(column != null);
|
797
769
|
return column.reduce(
|
798
|
-
// @ts-expect-error TS2365
|
799
770
|
(accumulator, currentValue) => accumulator + currentValue,
|
800
771
|
initialValue,
|
801
772
|
);
|
@@ -809,19 +780,13 @@ export async function run(input: string[]) {
|
|
809
780
|
_printStatsTable('Cache Info', table);
|
810
781
|
}
|
811
782
|
|
812
|
-
function timeSerialize(
|
813
|
-
// @ts-expect-error TS2304
|
814
|
-
graph: AssetGraph | null | undefined | BundleGraph | RequestTracker,
|
815
|
-
) {
|
783
|
+
function timeSerialize(graph) {
|
816
784
|
let date = Date.now();
|
817
785
|
serialize(graph);
|
818
786
|
date = Date.now() - date;
|
819
787
|
return date;
|
820
788
|
}
|
821
|
-
function _printStatsTable(
|
822
|
-
header: string,
|
823
|
-
data: Array<Array<string | number>> | Array<[string, unknown]>,
|
824
|
-
) {
|
789
|
+
function _printStatsTable(header, data) {
|
825
790
|
const config = {
|
826
791
|
columnDefault: {
|
827
792
|
width: 18,
|
@@ -830,13 +795,13 @@ export async function run(input: string[]) {
|
|
830
795
|
alignment: 'center',
|
831
796
|
content: header,
|
832
797
|
},
|
833
|
-
}
|
798
|
+
};
|
834
799
|
|
835
800
|
console.log(table(data, config));
|
836
801
|
}
|
837
802
|
|
838
803
|
// eslint-disable-next-line no-unused-vars
|
839
|
-
function stats(_
|
804
|
+
function stats(_) {
|
840
805
|
let ag = {
|
841
806
|
asset: 0,
|
842
807
|
dependency: 0,
|
@@ -847,7 +812,7 @@ export async function run(input: string[]) {
|
|
847
812
|
invariant(assetGraph != null);
|
848
813
|
for (let n of assetGraph.nodes) {
|
849
814
|
if (n && n.type in ag) {
|
850
|
-
//
|
815
|
+
// $FlowFixMe
|
851
816
|
ag[n.type]++;
|
852
817
|
}
|
853
818
|
}
|
@@ -874,7 +839,7 @@ export async function run(input: string[]) {
|
|
874
839
|
sync: 0,
|
875
840
|
};
|
876
841
|
|
877
|
-
let b_ext
|
842
|
+
let b_ext = {};
|
878
843
|
|
879
844
|
const entries = new Set();
|
880
845
|
|
@@ -884,8 +849,10 @@ export async function run(input: string[]) {
|
|
884
849
|
} else if (n?.type === 'bundle') {
|
885
850
|
bg.bundle++;
|
886
851
|
|
852
|
+
// $FlowFixMe
|
887
853
|
b_ext[n.value.type] = (b_ext[n.value.type] || 0) + 1;
|
888
854
|
|
855
|
+
// $FlowFixMe
|
889
856
|
const entry_group = _findEntryBundle(bundleGraph, n);
|
890
857
|
|
891
858
|
if (entry_group != null && !entries.has(entry_group.id)) {
|
@@ -907,6 +874,7 @@ export async function run(input: string[]) {
|
|
907
874
|
}
|
908
875
|
} else if (n?.type === 'asset') {
|
909
876
|
if (
|
877
|
+
// $FlowFixMe
|
910
878
|
fromProjectPathRelative(n.value.filePath).includes('node_modules')
|
911
879
|
) {
|
912
880
|
bg.asset_node_modules++;
|
@@ -931,7 +899,6 @@ export async function run(input: string[]) {
|
|
931
899
|
|
932
900
|
let sum_b_type = 0;
|
933
901
|
for (let k in b_type) {
|
934
|
-
// @ts-expect-error TS7053
|
935
902
|
sum_b_type += b_type[k];
|
936
903
|
}
|
937
904
|
|
@@ -962,14 +929,19 @@ export async function run(input: string[]) {
|
|
962
929
|
});
|
963
930
|
|
964
931
|
const server = repl.start({useColors: true, useGlobal: true});
|
932
|
+
// $FlowFixMe[prop-missing]
|
965
933
|
server.setupHistory(
|
966
934
|
path.join(os.homedir(), '.parcel_query_history'),
|
967
935
|
() => {},
|
968
936
|
);
|
969
937
|
|
938
|
+
// $FlowFixMe[prop-missing]
|
970
939
|
server.context.bundleGraph = bundleGraph;
|
940
|
+
// $FlowFixMe[prop-missing]
|
971
941
|
server.context.assetGraph = assetGraph;
|
942
|
+
// $FlowFixMe[prop-missing]
|
972
943
|
server.context.requestTracker = requestTracker;
|
944
|
+
// $FlowFixMe[prop-missing]
|
973
945
|
server.context.cacheInfo = cacheInfo;
|
974
946
|
for (let [name, cmd] of new Map([
|
975
947
|
[
|
@@ -1088,7 +1060,6 @@ export async function run(input: string[]) {
|
|
1088
1060
|
'findBundleReason',
|
1089
1061
|
{
|
1090
1062
|
help: 'args: <bundle> <asset>. Why is the asset in the bundle',
|
1091
|
-
// @ts-expect-error TS2556
|
1092
1063
|
action: (v) => findBundleReason(...v.split(' ')),
|
1093
1064
|
},
|
1094
1065
|
],
|
@@ -1135,11 +1106,16 @@ export async function run(input: string[]) {
|
|
1135
1106
|
},
|
1136
1107
|
],
|
1137
1108
|
])) {
|
1109
|
+
// $FlowFixMe
|
1138
1110
|
server.context[name] = cmd.action;
|
1111
|
+
// $FlowFixMe
|
1139
1112
|
server.defineCommand(name, {
|
1113
|
+
// $FlowFixMe
|
1140
1114
|
help: '📦 ' + cmd.help,
|
1141
1115
|
action: (v) => {
|
1116
|
+
// $FlowFixMe
|
1142
1117
|
server.clearBufferedCommand();
|
1118
|
+
// $FlowFixMe
|
1143
1119
|
try {
|
1144
1120
|
cmd.action(v);
|
1145
1121
|
} finally {
|
@@ -1,28 +1,34 @@
|
|
1
|
+
// @flow
|
1
2
|
/* eslint-disable monorepo/no-internal-import */
|
2
|
-
import AssetGraph from '@atlaspack/core/src/AssetGraph';
|
3
|
-
import BundleGraph, {
|
3
|
+
import typeof AssetGraph from '@atlaspack/core/src/AssetGraph';
|
4
|
+
import typeof BundleGraph, {
|
4
5
|
bundleGraphEdgeTypes,
|
5
6
|
} from '@atlaspack/core/src/BundleGraph';
|
6
|
-
import RequestTracker, {
|
7
|
+
import typeof RequestTracker, {
|
7
8
|
RequestGraph,
|
8
9
|
readAndDeserializeRequestGraph,
|
9
10
|
} from '@atlaspack/core/src/RequestTracker';
|
10
|
-
import {requestGraphEdgeTypes} from '@atlaspack/core/src/RequestTracker';
|
11
|
-
import {LMDBLiteCache} from '@atlaspack/cache/src/LMDBLiteCache';
|
12
|
-
import {Priority} from '@atlaspack/core/src/types';
|
13
|
-
import {fromProjectPathRelative} from '@atlaspack/core/src/projectPath';
|
11
|
+
import typeof {requestGraphEdgeTypes} from '@atlaspack/core/src/RequestTracker';
|
12
|
+
import typeof {LMDBLiteCache} from '@atlaspack/cache/src/LMDBLiteCache';
|
13
|
+
import typeof {Priority} from '@atlaspack/core/src/types';
|
14
|
+
import typeof {fromProjectPathRelative} from '@atlaspack/core/src/projectPath';
|
14
15
|
|
15
16
|
const v =
|
16
|
-
process.env.ATLASPACK_BUILD_ENV === 'production'
|
17
|
-
process.env.ATLASPACK_REGISTER_USE_SRC !== 'true'
|
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
|
+
// $FlowFixMe(unsupported-syntax)
|
20
21
|
AssetGraph: require('@atlaspack/core' + '/lib/AssetGraph').default,
|
22
|
+
// $FlowFixMe(unsupported-syntax)
|
21
23
|
BundleGraph: require('@atlaspack/core' + '/lib/BundleGraph'),
|
24
|
+
// $FlowFixMe(unsupported-syntax)
|
22
25
|
RequestTracker: require('@atlaspack/core' + '/lib/RequestTracker'),
|
26
|
+
// $FlowFixMe(unsupported-syntax)
|
23
27
|
LMDBLiteCache: require('@atlaspack/cache' + '/lib/LMDBLiteCache')
|
24
28
|
.LMDBLiteCache,
|
29
|
+
// $FlowFixMe(unsupported-syntax)
|
25
30
|
Priority: require('@atlaspack/core' + '/lib/types').Priority,
|
31
|
+
// $FlowFixMe(unsupported-syntax)
|
26
32
|
fromProjectPathRelative: require('@atlaspack/core' + '/lib/projectPath')
|
27
33
|
.fromProjectPathRelative,
|
28
34
|
}
|
@@ -37,24 +43,21 @@ const v =
|
|
37
43
|
.fromProjectPathRelative,
|
38
44
|
};
|
39
45
|
|
40
|
-
module.exports = v
|
41
|
-
AssetGraph: AssetGraph
|
46
|
+
module.exports = (v: {|
|
47
|
+
AssetGraph: AssetGraph,
|
42
48
|
BundleGraph: {
|
43
|
-
default: BundleGraph
|
44
|
-
|
45
|
-
|
46
|
-
}
|
49
|
+
default: BundleGraph,
|
50
|
+
bundleGraphEdgeTypes: bundleGraphEdgeTypes,
|
51
|
+
...
|
52
|
+
},
|
47
53
|
RequestTracker: {
|
48
|
-
default: RequestTracker
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
// @ts-expect-error TS2749
|
59
|
-
fromProjectPathRelative: fromProjectPathRelative;
|
60
|
-
};
|
54
|
+
default: RequestTracker,
|
55
|
+
readAndDeserializeRequestGraph: readAndDeserializeRequestGraph,
|
56
|
+
RequestGraph: RequestGraph,
|
57
|
+
requestGraphEdgeTypes: requestGraphEdgeTypes,
|
58
|
+
...
|
59
|
+
},
|
60
|
+
LMDBLiteCache: LMDBLiteCache,
|
61
|
+
Priority: Priority,
|
62
|
+
fromProjectPathRelative: fromProjectPathRelative,
|
63
|
+
|});
|
@@ -1,3 +1,4 @@
|
|
1
|
+
// @flow strict-local
|
1
2
|
/* eslint-disable no-console, monorepo/no-internal-import */
|
2
3
|
import type {ContentKey, NodeId} from '@atlaspack/graph';
|
3
4
|
import type {PackagedBundleInfo} from '@atlaspack/core/src/types';
|
@@ -15,20 +16,15 @@ const {
|
|
15
16
|
requestGraphEdgeTypes,
|
16
17
|
},
|
17
18
|
LMDBLiteCache,
|
18
|
-
} =
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
// @ts-expect-error TS2749
|
28
|
-
requestTracker: RequestTracker | null | undefined;
|
29
|
-
bundleInfo: Map<ContentKey, PackagedBundleInfo> | null | undefined;
|
30
|
-
cacheInfo: Map<string, Array<string | number>> | null | undefined;
|
31
|
-
}> {
|
19
|
+
} = require('./deep-imports.js');
|
20
|
+
|
21
|
+
export async function loadGraphs(cacheDir: string): Promise<{|
|
22
|
+
assetGraph: ?AssetGraph,
|
23
|
+
bundleGraph: ?BundleGraph,
|
24
|
+
requestTracker: ?RequestTracker,
|
25
|
+
bundleInfo: ?Map<ContentKey, PackagedBundleInfo>,
|
26
|
+
cacheInfo: ?Map<string, Array<string | number>>,
|
27
|
+
|}> {
|
32
28
|
let cacheInfo: Map<string, Array<string | number>> = new Map();
|
33
29
|
const cache = new LMDBLiteCache(cacheDir);
|
34
30
|
|
@@ -58,7 +54,6 @@ export async function loadGraphs(cacheDir: string): Promise<{
|
|
58
54
|
console.log({requestGraphBlob, bundleGraphBlob, assetGraphBlob});
|
59
55
|
|
60
56
|
// Get requestTracker
|
61
|
-
// @ts-expect-error TS7034
|
62
57
|
let requestTracker;
|
63
58
|
if (requestGraphBlob != null && requestGraphKey != null) {
|
64
59
|
try {
|
@@ -79,13 +74,15 @@ export async function loadGraphs(cacheDir: string): Promise<{
|
|
79
74
|
|
80
75
|
requestTracker = new RequestTracker({
|
81
76
|
graph: requestGraph,
|
77
|
+
// $FlowFixMe
|
82
78
|
farm: null,
|
79
|
+
// $FlowFixMe
|
83
80
|
options: null,
|
84
81
|
});
|
85
82
|
let timeToDeserialize = Date.now() - date;
|
86
83
|
cacheInfo.set('RequestGraph', [bufferLength]);
|
87
84
|
cacheInfo.get('RequestGraph')?.push(timeToDeserialize);
|
88
|
-
} catch (e
|
85
|
+
} catch (e) {
|
89
86
|
console.error('Error loading Request Graph\n', e);
|
90
87
|
}
|
91
88
|
}
|
@@ -104,7 +101,7 @@ export async function loadGraphs(cacheDir: string): Promise<{
|
|
104
101
|
|
105
102
|
cacheInfo.set('BundleGraph', [Buffer.byteLength(file)]);
|
106
103
|
cacheInfo.get('BundleGraph')?.push(timeToDeserialize);
|
107
|
-
} catch (e
|
104
|
+
} catch (e) {
|
108
105
|
console.error('Error loading Bundle Graph\n', e);
|
109
106
|
}
|
110
107
|
}
|
@@ -124,19 +121,15 @@ export async function loadGraphs(cacheDir: string): Promise<{
|
|
124
121
|
|
125
122
|
cacheInfo.set('AssetGraph', [Buffer.byteLength(file)]);
|
126
123
|
cacheInfo.get('AssetGraph')?.push(timeToDeserialize);
|
127
|
-
} catch (e
|
124
|
+
} catch (e) {
|
128
125
|
console.error('Error loading Asset Graph\n', e);
|
129
126
|
}
|
130
127
|
}
|
131
128
|
|
132
129
|
function getSubRequests(id: NodeId) {
|
133
|
-
return
|
134
|
-
|
135
|
-
requestTracker.graph
|
136
|
-
.getNodeIdsConnectedFrom(id, requestGraphEdgeTypes.subrequest)
|
137
|
-
// @ts-expect-error TS7006
|
138
|
-
.map((n) => nullthrows(requestTracker.graph.getNode(n)))
|
139
|
-
);
|
130
|
+
return requestTracker.graph
|
131
|
+
.getNodeIdsConnectedFrom(id, requestGraphEdgeTypes.subrequest)
|
132
|
+
.map((n) => nullthrows(requestTracker.graph.getNode(n)));
|
140
133
|
}
|
141
134
|
|
142
135
|
// Load graphs by finding the main subrequests and loading their results
|
@@ -155,17 +148,17 @@ export async function loadGraphs(cacheDir: string): Promise<{
|
|
155
148
|
let buildRequestSubRequests = getSubRequests(buildRequestId);
|
156
149
|
|
157
150
|
let writeBundlesRequest = buildRequestSubRequests.find(
|
158
|
-
// @ts-expect-error TS7006
|
159
151
|
(n) => n.type === 1 && n.requestType === 11,
|
160
152
|
);
|
161
153
|
if (writeBundlesRequest != null) {
|
162
154
|
invariant(writeBundlesRequest.type === 1);
|
163
|
-
|
155
|
+
// $FlowFixMe[incompatible-cast]
|
156
|
+
bundleInfo = (nullthrows(writeBundlesRequest.result): Map<
|
164
157
|
ContentKey,
|
165
|
-
PackagedBundleInfo
|
166
|
-
|
158
|
+
PackagedBundleInfo,
|
159
|
+
>);
|
167
160
|
}
|
168
|
-
} catch (e
|
161
|
+
} catch (e) {
|
169
162
|
console.error('Error loading bundleInfo\n', e);
|
170
163
|
}
|
171
164
|
|
package/LICENSE
DELETED
@@ -1,201 +0,0 @@
|
|
1
|
-
Apache License
|
2
|
-
Version 2.0, January 2004
|
3
|
-
http://www.apache.org/licenses/
|
4
|
-
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6
|
-
|
7
|
-
1. Definitions.
|
8
|
-
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
11
|
-
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
13
|
-
the copyright owner that is granting the License.
|
14
|
-
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
16
|
-
other entities that control, are controlled by, or are under common
|
17
|
-
control with that entity. For the purposes of this definition,
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
19
|
-
direction or management of such entity, whether by contract or
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
22
|
-
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
24
|
-
exercising permissions granted by this License.
|
25
|
-
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
27
|
-
including but not limited to software source code, documentation
|
28
|
-
source, and configuration files.
|
29
|
-
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
31
|
-
transformation or translation of a Source form, including but
|
32
|
-
not limited to compiled object code, generated documentation,
|
33
|
-
and conversions to other media types.
|
34
|
-
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
36
|
-
Object form, made available under the License, as indicated by a
|
37
|
-
copyright notice that is included in or attached to the work
|
38
|
-
(an example is provided in the Appendix below).
|
39
|
-
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
46
|
-
the Work and Derivative Works thereof.
|
47
|
-
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
49
|
-
the original version of the Work and any modifications or additions
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
61
|
-
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
64
|
-
subsequently incorporated within the Work.
|
65
|
-
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
72
|
-
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78
|
-
where such license applies only to those patent claims licensable
|
79
|
-
by such Contributor that are necessarily infringed by their
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
82
|
-
institute patent litigation against any entity (including a
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
85
|
-
or contributory patent infringement, then any patent licenses
|
86
|
-
granted to You under this License for that Work shall terminate
|
87
|
-
as of the date such litigation is filed.
|
88
|
-
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
91
|
-
modifications, and in Source or Object form, provided that You
|
92
|
-
meet the following conditions:
|
93
|
-
|
94
|
-
(a) You must give any other recipients of the Work or
|
95
|
-
Derivative Works a copy of this License; and
|
96
|
-
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
98
|
-
stating that You changed the files; and
|
99
|
-
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
102
|
-
attribution notices from the Source form of the Work,
|
103
|
-
excluding those notices that do not pertain to any part of
|
104
|
-
the Derivative Works; and
|
105
|
-
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
108
|
-
include a readable copy of the attribution notices contained
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
111
|
-
of the following places: within a NOTICE text file distributed
|
112
|
-
as part of the Derivative Works; within the Source form or
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
114
|
-
within a display generated by the Derivative Works, if and
|
115
|
-
wherever such third-party notices normally appear. The contents
|
116
|
-
of the NOTICE file are for informational purposes only and
|
117
|
-
do not modify the License. You may add Your own attribution
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
120
|
-
that such additional attribution notices cannot be construed
|
121
|
-
as modifying the License.
|
122
|
-
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
124
|
-
may provide additional or different license terms and conditions
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
128
|
-
the conditions stated in this License.
|
129
|
-
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
133
|
-
this License, without any additional terms or conditions.
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
135
|
-
the terms of any separate license agreement you may have executed
|
136
|
-
with Licensor regarding such Contributions.
|
137
|
-
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
140
|
-
except as required for reasonable and customary use in describing the
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
142
|
-
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
152
|
-
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
158
|
-
incidental, or consequential damages of any character arising as a
|
159
|
-
result of this License or out of the use or inability to use the
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
162
|
-
other commercial damages or losses), even if such Contributor
|
163
|
-
has been advised of the possibility of such damages.
|
164
|
-
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
168
|
-
or other liability obligations and/or rights consistent with this
|
169
|
-
License. However, in accepting such obligations, You may act only
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
174
|
-
of your accepting any such warranty or additional liability.
|
175
|
-
|
176
|
-
END OF TERMS AND CONDITIONS
|
177
|
-
|
178
|
-
APPENDIX: How to apply the Apache License to your work.
|
179
|
-
|
180
|
-
To apply the Apache License to your work, attach the following
|
181
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
182
|
-
replaced with your own identifying information. (Don't include
|
183
|
-
the brackets!) The text should be enclosed in the appropriate
|
184
|
-
comment syntax for the file format. We also recommend that a
|
185
|
-
file or class name and description of purpose be included on the
|
186
|
-
same "printed page" as the copyright notice for easier
|
187
|
-
identification within third-party archives.
|
188
|
-
|
189
|
-
Copyright (c) 2024 Atlassian US., Inc.
|
190
|
-
|
191
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
192
|
-
you may not use this file except in compliance with the License.
|
193
|
-
You may obtain a copy of the License at
|
194
|
-
|
195
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
196
|
-
|
197
|
-
Unless required by applicable law or agreed to in writing, software
|
198
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
199
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
200
|
-
See the License for the specific language governing permissions and
|
201
|
-
limitations under the License.
|
package/tsconfig.json
DELETED