@atlaspack/bundler-experimental 2.13.24-typescript-5b4d3ad41.0 → 2.13.24

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaspack/bundler-experimental
2
2
 
3
+ ## 2.13.24
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`069de47`](https://github.com/atlassian-labs/atlaspack/commit/069de478e64fb5889f6f2ce023eb510782767fbd)]:
8
+ - @atlaspack/feature-flags@2.20.0
9
+ - @atlaspack/core@2.20.0
10
+ - @atlaspack/types@2.15.11
11
+ - @atlaspack/graph@3.5.10
12
+ - @atlaspack/utils@2.17.3
13
+ - @atlaspack/plugin@2.14.21
14
+
3
15
  ## 2.13.23
4
16
 
5
17
  ### Patch Changes
@@ -34,7 +34,7 @@ class EdgeContentGraph extends _graph().ContentGraph {
34
34
  const contentKey = this._nodeIdToContentKey.get(nodeId);
35
35
  if (node == null) {
36
36
  // Add null node to preserve node ids
37
- // @ts-expect-error TS2345
37
+ // $FlowFixMe
38
38
  newGraph.addNode(null);
39
39
  } else if (contentKey == null) {
40
40
  newGraph.addNode(node);
@@ -43,7 +43,6 @@ class EdgeContentGraph extends _graph().ContentGraph {
43
43
  }
44
44
  nodeId += 1;
45
45
  }
46
- // @ts-expect-error TS2488
47
46
  for (let edge of this.getAllEdges()) {
48
47
  const weight = this.getEdgeWeight(edge.from, edge.to);
49
48
  newGraph.addWeightedEdge(edge.from, edge.to, edge.type, weight);
@@ -48,9 +48,7 @@ function findStronglyConnectedComponents(graph) {
48
48
  let member;
49
49
  do {
50
50
  member = stack.pop();
51
- // @ts-expect-error TS2538
52
51
  state[member].onStack = false;
53
- // @ts-expect-error TS2345
54
52
  component.push(member);
55
53
  } while (member !== nodeId);
56
54
  result.push(component);
@@ -44,22 +44,15 @@ function simpleFastDominance(graph) {
44
44
  changed = false;
45
45
  for (let node of reversedPostOrder) {
46
46
  if (node === graph.rootNodeId) continue;
47
-
48
- // @ts-expect-error TS7034
49
47
  let newImmediateDominator = null;
50
- graph.forEachNodeIdConnectedTo(node,
51
- // @ts-expect-error TS2345
52
- predecessor => {
53
- // @ts-expect-error TS7005
48
+ graph.forEachNodeIdConnectedTo(node, predecessor => {
54
49
  if (newImmediateDominator == null) {
55
50
  newImmediateDominator = predecessor;
56
51
  } else {
57
52
  if (dominators[predecessor] == null) {
58
53
  return;
59
54
  }
60
- newImmediateDominator = intersect(postOrderIndexes, dominators, predecessor,
61
- // @ts-expect-error TS7005
62
- newImmediateDominator);
55
+ newImmediateDominator = intersect(postOrderIndexes, dominators, predecessor, newImmediateDominator);
63
56
  }
64
57
  }, _graph().ALL_EDGE_TYPES);
65
58
  if (dominators[node] !== newImmediateDominator) {
@@ -127,11 +120,9 @@ function intersect(postOrderIndexes, dominators, predecessor, newImmediateDomina
127
120
  let n2 = newImmediateDominator;
128
121
  while (n1 !== n2) {
129
122
  while (postOrderIndexes[n1] < postOrderIndexes[n2]) {
130
- // @ts-expect-error TS7053
131
123
  n1 = Number(dominators[n1]);
132
124
  }
133
125
  while (postOrderIndexes[n2] < postOrderIndexes[n1]) {
134
- // @ts-expect-error TS7053
135
126
  n2 = Number(dominators[n2]);
136
127
  }
137
128
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/bundler-experimental",
3
- "version": "2.13.24-typescript-5b4d3ad41.0",
3
+ "version": "2.13.24",
4
4
  "license": "(MIT OR Apache-2.0)",
5
5
  "type": "commonjs",
6
6
  "publishConfig": {
@@ -10,29 +10,24 @@
10
10
  "type": "git",
11
11
  "url": "https://github.com/atlassian-labs/atlaspack.git"
12
12
  },
13
- "main": "./lib/index.js",
14
- "source": "./src/index.ts",
15
- "types": "./lib/index.d.ts",
13
+ "main": "lib/index.js",
14
+ "source": "src/index.js",
16
15
  "engines": {
17
16
  "node": ">= 16.0.0"
18
17
  },
19
18
  "dependencies": {
20
- "@atlaspack/core": "2.19.3-typescript-5b4d3ad41.0",
21
- "@atlaspack/diagnostic": "2.14.2-typescript-5b4d3ad41.0",
22
- "@atlaspack/feature-flags": "2.19.3-typescript-5b4d3ad41.0",
23
- "@atlaspack/graph": "3.5.10-typescript-5b4d3ad41.0",
24
- "@atlaspack/logger": "2.14.14-typescript-5b4d3ad41.0",
25
- "@atlaspack/plugin": "2.14.21-typescript-5b4d3ad41.0",
26
- "@atlaspack/rust": "3.4.2-typescript-5b4d3ad41.0",
27
- "@atlaspack/types": "2.15.11-typescript-5b4d3ad41.0",
28
- "@atlaspack/utils": "2.17.3-typescript-5b4d3ad41.0",
19
+ "@atlaspack/core": "2.20.0",
20
+ "@atlaspack/diagnostic": "2.14.1",
21
+ "@atlaspack/feature-flags": "2.20.0",
22
+ "@atlaspack/graph": "3.5.10",
23
+ "@atlaspack/logger": "2.14.13",
24
+ "@atlaspack/plugin": "2.14.21",
25
+ "@atlaspack/rust": "3.4.1",
26
+ "@atlaspack/types": "2.15.11",
27
+ "@atlaspack/utils": "2.17.3",
29
28
  "nullthrows": "^1.1.1"
30
29
  },
31
30
  "devDependencies": {
32
- "@atlaspack/fs": "2.15.16-typescript-5b4d3ad41.0"
33
- },
34
- "scripts": {
35
- "check-ts": "tsc --emitDeclarationOnly --rootDir src"
36
- },
37
- "gitHead": "5b4d3ad41ffa002b989ba77271bb3010a1f05b2a"
38
- }
31
+ "@atlaspack/fs": "2.15.16"
32
+ }
33
+ }
@@ -1,4 +1,6 @@
1
- import {ContentGraph, NodeId} from '@atlaspack/graph';
1
+ // @flow strict-local
2
+
3
+ import {ContentGraph, type NodeId} from '@atlaspack/graph';
2
4
  import nullthrows from 'nullthrows';
3
5
 
4
6
  /**
@@ -17,7 +19,7 @@ export class EdgeContentGraph<N, EW> extends ContentGraph<N, number> {
17
19
  const contentKey = this._nodeIdToContentKey.get(nodeId);
18
20
  if (node == null) {
19
21
  // Add null node to preserve node ids
20
- // @ts-expect-error TS2345
22
+ // $FlowFixMe
21
23
  newGraph.addNode(null);
22
24
  } else if (contentKey == null) {
23
25
  newGraph.addNode(node);
@@ -26,7 +28,6 @@ export class EdgeContentGraph<N, EW> extends ContentGraph<N, number> {
26
28
  }
27
29
  nodeId += 1;
28
30
  }
29
- // @ts-expect-error TS2488
30
31
  for (let edge of this.getAllEdges()) {
31
32
  const weight = this.getEdgeWeight(edge.from, edge.to);
32
33
  newGraph.addWeightedEdge(edge.from, edge.to, edge.type, weight);
@@ -1,3 +1,5 @@
1
+ // @flow strict-local
2
+
1
3
  import type {Graph, NodeId} from '@atlaspack/graph';
2
4
 
3
5
  export type StronglyConnectedComponent = NodeId[];
@@ -11,17 +13,17 @@ export type StronglyConnectedComponent = NodeId[];
11
13
  * * https://web.archive.org/web/20170829214726id_/http://www.cs.ucsb.edu/~gilbert/cs240a/old/cs240aSpr2011/slides/TarjanDFS.pdf
12
14
  * * https://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm
13
15
  */
14
- export function findStronglyConnectedComponents<T, E extends number>(
16
+ export function findStronglyConnectedComponents<T, E: number>(
15
17
  graph: Graph<T, E>,
16
18
  ): StronglyConnectedComponent[] {
17
- type State = {
18
- index: null | NodeId;
19
- lowlink: null | NodeId;
20
- onStack: boolean;
21
- };
22
- const result: Array<StronglyConnectedComponent> = [];
19
+ type State = {|
20
+ index: null | NodeId,
21
+ lowlink: null | NodeId,
22
+ onStack: boolean,
23
+ |};
24
+ const result = [];
23
25
  let index = 0;
24
- const stack: Array<NodeId | number> = [];
26
+ const stack = [];
25
27
  const state: State[] = new Array(graph.nodes.length).fill(null).map(() => ({
26
28
  index: null,
27
29
  lowlink: null,
@@ -32,7 +34,7 @@ export function findStronglyConnectedComponents<T, E extends number>(
32
34
  strongConnect(nodeId);
33
35
  }
34
36
  });
35
- function strongConnect(nodeId: NodeId | number) {
37
+ function strongConnect(nodeId) {
36
38
  const nodeState = state[nodeId];
37
39
  nodeState.index = index;
38
40
  nodeState.lowlink = index;
@@ -60,14 +62,12 @@ export function findStronglyConnectedComponents<T, E extends number>(
60
62
  }
61
63
 
62
64
  if (nodeState.lowlink === nodeState.index) {
63
- const component: Array<NodeId> = [];
65
+ const component = [];
64
66
  let member;
65
67
 
66
68
  do {
67
69
  member = stack.pop();
68
- // @ts-expect-error TS2538
69
70
  state[member].onStack = false;
70
- // @ts-expect-error TS2345
71
71
  component.push(member);
72
72
  } while (member !== nodeId);
73
73
 
@@ -1,4 +1,6 @@
1
- import {NodeId, Graph, ALL_EDGE_TYPES} from '@atlaspack/graph';
1
+ // @flow strict-local
2
+
3
+ import {type NodeId, Graph, ALL_EDGE_TYPES} from '@atlaspack/graph';
2
4
 
3
5
  /**
4
6
  * Implements "A simple, fast dominance algorithm", to find the immediate
@@ -38,13 +40,10 @@ export function simpleFastDominance<T>(graph: Graph<T, number>): NodeId[] {
38
40
  for (let node of reversedPostOrder) {
39
41
  if (node === graph.rootNodeId) continue;
40
42
 
41
- // @ts-expect-error TS7034
42
43
  let newImmediateDominator = null;
43
44
  graph.forEachNodeIdConnectedTo(
44
45
  node,
45
- // @ts-expect-error TS2345
46
46
  (predecessor) => {
47
- // @ts-expect-error TS7005
48
47
  if (newImmediateDominator == null) {
49
48
  newImmediateDominator = predecessor;
50
49
  } else {
@@ -56,7 +55,6 @@ export function simpleFastDominance<T>(graph: Graph<T, number>): NodeId[] {
56
55
  postOrderIndexes,
57
56
  dominators,
58
57
  predecessor,
59
- // @ts-expect-error TS7005
60
58
  newImmediateDominator,
61
59
  );
62
60
  }
@@ -81,7 +79,7 @@ export function getGraphPostOrder<T>(
81
79
  graph: Graph<T, number>,
82
80
  type: number = 1,
83
81
  ): NodeId[] {
84
- const postOrder: Array<NodeId> = [];
82
+ const postOrder = [];
85
83
  graph.traverse(
86
84
  {
87
85
  exit: (node) => {
@@ -134,7 +132,7 @@ export function getGraphPostOrder<T>(
134
132
  */
135
133
  export function intersect(
136
134
  postOrderIndexes: number[],
137
- dominators: NodeId | null[],
135
+ dominators: (NodeId | null)[],
138
136
  predecessor: NodeId,
139
137
  newImmediateDominator: NodeId,
140
138
  ): NodeId {
@@ -142,11 +140,9 @@ export function intersect(
142
140
  let n2: number = newImmediateDominator;
143
141
  while (n1 !== n2) {
144
142
  while (postOrderIndexes[n1] < postOrderIndexes[n2]) {
145
- // @ts-expect-error TS7053
146
143
  n1 = Number(dominators[n1]);
147
144
  }
148
145
  while (postOrderIndexes[n2] < postOrderIndexes[n1]) {
149
- // @ts-expect-error TS7053
150
146
  n2 = Number(dominators[n2]);
151
147
  }
152
148
  }
@@ -1,3 +1,5 @@
1
+ // @flow strict-local
2
+
1
3
  import assert from 'assert';
2
4
  import {EdgeContentGraph} from '../../src/DominatorBundler/EdgeContentGraph';
3
5
 
@@ -1,3 +1,5 @@
1
+ // @flow strict-local
2
+
1
3
  import {Graph} from '@atlaspack/graph';
2
4
  import assert from 'assert';
3
5
  import {findStronglyConnectedComponents} from '../../../src/DominatorBundler/cycleBreaker/findStronglyConnectedComponents';
@@ -1,3 +1,5 @@
1
+ // @flow strict-local
2
+
1
3
  import assert from 'assert';
2
4
  import {Graph} from '@atlaspack/graph';
3
5
  import {simpleFastDominance} from '../../../src/DominatorBundler/findAssetDominators/simpleFastDominance';
@@ -1,3 +1,5 @@
1
+ // @flow strict-local
2
+
1
3
  /*!
2
4
  * This module provides a way to write fixtures where we don't care about the
3
5
  * code within the assets; only the shape of the asset graphs.
@@ -13,44 +15,44 @@ export type GraphEntry = AssetEntry;
13
15
  /**
14
16
  * An asset in the fixture graph. Just a path and dependencies
15
17
  */
16
- export type AssetEntry = {
17
- type: 'asset';
18
- value: {
19
- filePath: string;
20
- dependencies: DependencyEntry[];
21
- };
22
- };
18
+ export type AssetEntry = {|
19
+ type: 'asset',
20
+ value: {|
21
+ filePath: string,
22
+ dependencies: DependencyEntry[],
23
+ |},
24
+ |};
23
25
 
24
26
  /**
25
27
  * Sync or async dependency between assets
26
28
  */
27
- export type DependencyEntry = {
28
- type: 'dependency';
29
- value: {
30
- from: string;
31
- to: string;
32
- type: 'sync' | 'async';
33
- };
34
- };
29
+ export type DependencyEntry = {|
30
+ type: 'dependency',
31
+ value: {|
32
+ from: string,
33
+ to: string,
34
+ type: 'sync' | 'async',
35
+ |},
36
+ |};
35
37
 
36
- export type DependencySpec = {
37
- to: string;
38
- type: 'sync' | 'async';
39
- };
38
+ export type DependencySpec = {|
39
+ to: string,
40
+ type: 'sync' | 'async',
41
+ |};
40
42
 
41
43
  /**
42
44
  * Create an asset node in the fixture graph
43
45
  */
44
46
  export function asset(
45
47
  path: string,
46
- dependencies?: string | DependencySpec[],
48
+ dependencies?: (string | DependencySpec)[],
47
49
  ): GraphEntry {
48
50
  return {
49
51
  type: 'asset',
50
52
  value: {
51
53
  filePath: path,
52
54
  dependencies:
53
- dependencies?.map((dependency: DependencySpec | string) => {
55
+ dependencies?.map((dependency) => {
54
56
  if (typeof dependency === 'string') {
55
57
  return {
56
58
  type: 'dependency',
@@ -157,7 +159,7 @@ export async function fixtureFromGraph(
157
159
  *
158
160
  */
159
161
  export function dotFromGraph(entries: GraphEntry[]): string {
160
- const contents: Array<string> = [];
162
+ const contents = [];
161
163
 
162
164
  for (let entry of entries) {
163
165
  if (entry.type === 'asset') {
@@ -1,3 +1,5 @@
1
+ // @flow strict-local
2
+
1
3
  import {MemoryFS} from '@atlaspack/fs';
2
4
  import assert from 'assert';
3
5
  import {workerFarm} from '@atlaspack/test-utils';
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.
@@ -1,13 +0,0 @@
1
- import { ContentGraph, NodeId } from '@atlaspack/graph';
2
- /**
3
- * A `ContentGraph` that also stores weights on edges.
4
- *
5
- * @template N The type of the node weight.
6
- * @template EW The type of the edge weight.
7
- */
8
- export declare class EdgeContentGraph<N, EW> extends ContentGraph<N, number> {
9
- #private;
10
- clone(): EdgeContentGraph<N, EW>;
11
- addWeightedEdge(from: NodeId, to: NodeId, type: number, weight: EW | null): void;
12
- getEdgeWeight(from: NodeId, to: NodeId): EW | null;
13
- }
@@ -1,12 +0,0 @@
1
- import type { Graph, NodeId } from '@atlaspack/graph';
2
- export type StronglyConnectedComponent = NodeId[];
3
- /**
4
- * Robert Tarjan's algorithm to find strongly connected components in a graph.
5
- *
6
- * Time complexity: O(V + E)
7
- * Space complexity (worst case): O(V)
8
- *
9
- * * https://web.archive.org/web/20170829214726id_/http://www.cs.ucsb.edu/~gilbert/cs240a/old/cs240aSpr2011/slides/TarjanDFS.pdf
10
- * * https://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm
11
- */
12
- export declare function findStronglyConnectedComponents<T, E extends number>(graph: Graph<T, E>): StronglyConnectedComponent[];
@@ -1,58 +0,0 @@
1
- import { NodeId, Graph } from '@atlaspack/graph';
2
- /**
3
- * Implements "A simple, fast dominance algorithm", to find the immediate
4
- * dominators of all nodes in a graph.
5
- *
6
- * Returns a map of node IDs to their immediate dominator's node ID.
7
- * This map is represented by an array where the index is the node ID and the
8
- * value is its dominator.
9
- *
10
- * For example, given a node `3`, `dominators[3]` is the immediate dominator
11
- * of node 3.
12
- *
13
- * - https://www.cs.tufts.edu/comp/150FP/archive/keith-cooper/dom14.pdf
14
- */
15
- export declare function simpleFastDominance<T>(graph: Graph<T, number>): NodeId[];
16
- /**
17
- * Return the post-order of the graph.
18
- */
19
- export declare function getGraphPostOrder<T>(graph: Graph<T, number>, type?: number): NodeId[];
20
- /**
21
- * From "A Simple, Fast Dominance Algorithm"
22
- * Keith D. Cooper, Timothy J. Harvey, and Ken Kennedy:
23
- *
24
- * > The intersection routine appears at the bottom of the figure.
25
- * > It implements a “two-finger” algorithm – one can imagine a finger pointing
26
- * > to each dominator set, each finger moving independently as the comparisons
27
- * > dictate. In this case, the comparisons are on postorder numbers; for each
28
- * > intersection, we start the two fingers at the ends of the two sets, and,
29
- * > until the fingers point to the same postorder number, we move the finger
30
- * > pointing to the smaller number back one element. Remember that nodes higher
31
- * > in the dominator tree have higher postorder numbers, which is why intersect
32
- * > moves the finger whose value is less than the other finger’s. When the two
33
- * > fingers point at the same element, intersect returns that element. The set
34
- * > resulting from the intersection begins with the returned element and chains
35
- * > its way up the doms array to the entry node.
36
- *
37
- * `postOrder` is the post-order node list of the graph.
38
- *
39
- * `dominators` is the current immediate dominator state for node in the graph.
40
- *
41
- * This is coupled with the fact node ids are indexes into an array. It is a map
42
- * of NodeId -> NodeId, where the value at index `i` is the immediate dominator
43
- * of the node `i`.
44
- *
45
- * `predecessor` is one predecessor node id of the node we're currently
46
- * computing the immediate dominator for.
47
- *
48
- * `newImmediateDominator` is current best immediate dominator candidate for the
49
- * node we're computing the immediate dominator for.
50
- *
51
- * The algorithm is intersecting the dominator sets of the two predecessors and
52
- * returning dominator node with the highest post-order number by walking up
53
- * the dominator tree until the two sets intersect.
54
- *
55
- * The node with the highest post-order index is the immediate dominator, as
56
- * it is the closest to the node we're computing for.
57
- */
58
- export declare function intersect(postOrderIndexes: number[], dominators: NodeId | null[], predecessor: NodeId, newImmediateDominator: NodeId): NodeId;
package/tsconfig.json DELETED
@@ -1,4 +0,0 @@
1
- {
2
- "extends": "../../../tsconfig.json",
3
- "include": ["src"]
4
- }