@atlaspack/core 2.12.1-dev.3401 → 2.12.1-dev.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.
- package/lib/AssetGraph.js +1 -2
- package/lib/Atlaspack.js +25 -3
- package/lib/AtlaspackConfig.schema.js +10 -36
- package/lib/BundleGraph.js +59 -5
- package/lib/Dependency.js +46 -1
- package/lib/Environment.js +12 -2
- package/lib/PackagerRunner.js +3 -45
- package/lib/RequestTracker.js +112 -30
- package/lib/SymbolPropagation.js +1 -1
- package/lib/Transformation.js +1 -15
- package/lib/UncommittedAsset.js +4 -4
- package/lib/Validation.js +1 -13
- package/lib/applyRuntimes.js +96 -20
- package/lib/assetUtils.js +9 -3
- package/lib/atlaspack-v3/AtlaspackV3.js +6 -8
- package/lib/atlaspack-v3/fs.js +8 -1
- package/lib/atlaspack-v3/worker/compat.js +57 -0
- package/lib/atlaspack-v3/worker/worker.js +247 -1
- package/lib/public/BundleGraph.js +68 -0
- package/lib/requests/AssetGraphRequestRust.js +79 -12
- package/lib/requests/BundleGraphRequest.js +19 -0
- package/lib/requests/WriteBundleRequest.js +15 -15
- package/lib/requests/asset-graph-diff.js +128 -0
- package/lib/resolveOptions.js +15 -8
- package/lib/types.js +2 -1
- package/package.json +19 -17
- package/src/AssetGraph.js +1 -1
- package/src/Atlaspack.js +28 -6
- package/src/AtlaspackConfig.schema.js +13 -36
- package/src/BundleGraph.js +77 -1
- package/src/CommittedAsset.js +1 -1
- package/src/Dependency.js +50 -12
- package/src/Environment.js +13 -15
- package/src/PackagerRunner.js +5 -53
- package/src/RequestTracker.js +144 -38
- package/src/SymbolPropagation.js +5 -2
- package/src/Transformation.js +1 -9
- package/src/UncommittedAsset.js +6 -6
- package/src/Validation.js +1 -7
- package/src/applyRuntimes.js +86 -22
- package/src/assetUtils.js +12 -19
- package/src/atlaspack-v3/AtlaspackV3.js +8 -11
- package/src/atlaspack-v3/fs.js +8 -3
- package/src/atlaspack-v3/jsCallable.js +4 -0
- package/src/atlaspack-v3/worker/compat.js +82 -0
- package/src/atlaspack-v3/worker/worker.js +300 -2
- package/src/public/BundleGraph.js +106 -0
- package/src/requests/AssetGraphRequestRust.js +105 -17
- package/src/requests/BundleGraphRequest.js +18 -0
- package/src/requests/WriteBundleRequest.js +17 -23
- package/src/requests/asset-graph-diff.js +145 -0
- package/src/resolveOptions.js +12 -2
- package/src/types.js +10 -0
- package/test/AssetGraph.test.js +23 -9
- package/test/AtlaspackConfigRequest.test.js +0 -161
- package/test/BundleGraph.test.js +8 -3
- package/test/Dependency.test.js +21 -0
- package/test/Environment.test.js +16 -5
- package/test/InternalAsset.test.js +8 -2
- package/test/PublicAsset.test.js +6 -2
- package/test/PublicBundle.test.js +1 -0
- package/test/PublicMutableBundleGraph.test.js +9 -4
- package/test/RequestTracker.test.js +139 -2
- package/test/SymbolPropagation.test.js +1 -0
- package/test/TargetRequest.test.js +25 -25
- package/test/requests/WriteBundleRequest.test.js +132 -0
- package/lib/atlaspack-v3/plugins/Resolver.js +0 -12
- package/lib/atlaspack-v3/plugins/index.js +0 -16
- package/src/atlaspack-v3/plugins/Resolver.js +0 -9
- package/src/atlaspack-v3/plugins/index.js +0 -3
package/test/BundleGraph.test.js
CHANGED
|
@@ -4,11 +4,14 @@ import assert from 'assert';
|
|
|
4
4
|
import BundleGraph from '../src/BundleGraph';
|
|
5
5
|
import {DEFAULT_ENV, DEFAULT_TARGETS} from './test-utils';
|
|
6
6
|
import AssetGraph, {nodeFromAssetGroup} from '../src/AssetGraph';
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
createAsset as _createAsset,
|
|
9
|
+
type AssetOptions,
|
|
10
|
+
} from '../src/assetUtils';
|
|
8
11
|
import {createDependency as _createDependency} from '../src/Dependency';
|
|
9
12
|
import {toProjectPath} from '../src/projectPath';
|
|
10
13
|
|
|
11
|
-
function createAsset(opts) {
|
|
14
|
+
function createAsset(opts: AssetOptions) {
|
|
12
15
|
return _createAsset('/', opts);
|
|
13
16
|
}
|
|
14
17
|
|
|
@@ -79,7 +82,7 @@ function createMockAssetGraph(ids: [string, string]) {
|
|
|
79
82
|
|
|
80
83
|
let dep = createDependency({
|
|
81
84
|
specifier: 'path/to/index/src/main.js',
|
|
82
|
-
specifierType: '
|
|
85
|
+
specifierType: 'url',
|
|
83
86
|
env: DEFAULT_ENV,
|
|
84
87
|
target: DEFAULT_TARGETS[0],
|
|
85
88
|
});
|
|
@@ -98,6 +101,7 @@ function createMockAssetGraph(ids: [string, string]) {
|
|
|
98
101
|
let assets = [
|
|
99
102
|
createAsset({
|
|
100
103
|
id: ids[0],
|
|
104
|
+
code: null,
|
|
101
105
|
filePath,
|
|
102
106
|
type: 'js',
|
|
103
107
|
isSource: true,
|
|
@@ -107,6 +111,7 @@ function createMockAssetGraph(ids: [string, string]) {
|
|
|
107
111
|
}),
|
|
108
112
|
createAsset({
|
|
109
113
|
id: ids[1],
|
|
114
|
+
code: null,
|
|
110
115
|
filePath,
|
|
111
116
|
type: 'js',
|
|
112
117
|
isSource: true,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import expect from 'expect';
|
|
2
|
+
import {createDependencyId} from '../src/Dependency';
|
|
3
|
+
import {createEnvironment} from '../src/Environment';
|
|
4
|
+
|
|
5
|
+
describe('Dependency', () => {
|
|
6
|
+
describe('createDependencyId', () => {
|
|
7
|
+
it('should create a stable id for a dependency', () => {
|
|
8
|
+
let id1 = createDependencyId({
|
|
9
|
+
specifier: 'foo',
|
|
10
|
+
env: createEnvironment(),
|
|
11
|
+
specifierType: 'esm',
|
|
12
|
+
});
|
|
13
|
+
let id2 = createDependencyId({
|
|
14
|
+
specifier: 'foo',
|
|
15
|
+
env: createEnvironment(),
|
|
16
|
+
specifierType: 'esm',
|
|
17
|
+
});
|
|
18
|
+
expect(id1).toEqual(id2);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
});
|
package/test/Environment.test.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
// @flow strict-local
|
|
2
2
|
|
|
3
3
|
import assert from 'assert';
|
|
4
|
+
// $FlowFixMe
|
|
5
|
+
import expect from 'expect';
|
|
4
6
|
import {createEnvironment} from '../src/Environment';
|
|
7
|
+
import {initializeMonitoring} from '../../rust';
|
|
5
8
|
|
|
6
9
|
describe('Environment', () => {
|
|
7
10
|
it('assigns a default environment with nothing passed', () => {
|
|
8
11
|
assert.deepEqual(createEnvironment(), {
|
|
9
|
-
id: '
|
|
12
|
+
id: 'd821e85f6b50315e',
|
|
10
13
|
context: 'browser',
|
|
11
14
|
engines: {
|
|
12
15
|
browsers: ['> 0.25%'],
|
|
@@ -24,7 +27,7 @@ describe('Environment', () => {
|
|
|
24
27
|
|
|
25
28
|
it('assigns a node context if a node engine is given', () => {
|
|
26
29
|
assert.deepEqual(createEnvironment({engines: {node: '>= 10.0.0'}}), {
|
|
27
|
-
id: '
|
|
30
|
+
id: '2320af923a717577',
|
|
28
31
|
context: 'node',
|
|
29
32
|
engines: {
|
|
30
33
|
node: '>= 10.0.0',
|
|
@@ -44,7 +47,7 @@ describe('Environment', () => {
|
|
|
44
47
|
assert.deepEqual(
|
|
45
48
|
createEnvironment({engines: {browsers: ['last 1 version']}}),
|
|
46
49
|
{
|
|
47
|
-
id: '
|
|
50
|
+
id: '75603271034eff15',
|
|
48
51
|
context: 'browser',
|
|
49
52
|
engines: {
|
|
50
53
|
browsers: ['last 1 version'],
|
|
@@ -63,7 +66,7 @@ describe('Environment', () => {
|
|
|
63
66
|
|
|
64
67
|
it('assigns default engines for node', () => {
|
|
65
68
|
assert.deepEqual(createEnvironment({context: 'node'}), {
|
|
66
|
-
id: '
|
|
69
|
+
id: 'e45cc12216f7857d',
|
|
67
70
|
context: 'node',
|
|
68
71
|
engines: {
|
|
69
72
|
node: '>= 8.0.0',
|
|
@@ -81,7 +84,7 @@ describe('Environment', () => {
|
|
|
81
84
|
|
|
82
85
|
it('assigns default engines for browsers', () => {
|
|
83
86
|
assert.deepEqual(createEnvironment({context: 'browser'}), {
|
|
84
|
-
id: '
|
|
87
|
+
id: 'd821e85f6b50315e',
|
|
85
88
|
context: 'browser',
|
|
86
89
|
engines: {
|
|
87
90
|
browsers: ['> 0.25%'],
|
|
@@ -97,3 +100,11 @@ describe('Environment', () => {
|
|
|
97
100
|
});
|
|
98
101
|
});
|
|
99
102
|
});
|
|
103
|
+
|
|
104
|
+
describe('createEnvironment', function () {
|
|
105
|
+
it('returns a stable hash', () => {
|
|
106
|
+
initializeMonitoring();
|
|
107
|
+
const environment = createEnvironment({});
|
|
108
|
+
expect(environment.id).toEqual('d821e85f6b50315e');
|
|
109
|
+
});
|
|
110
|
+
});
|
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
import assert from 'assert';
|
|
4
4
|
import UncommittedAsset from '../src/UncommittedAsset';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
createAsset as _createAsset,
|
|
7
|
+
type AssetOptions,
|
|
8
|
+
} from '../src/assetUtils';
|
|
6
9
|
import {createEnvironment} from '../src/Environment';
|
|
7
10
|
import {DEFAULT_OPTIONS} from './test-utils';
|
|
8
11
|
import {toProjectPath} from '../src/projectPath';
|
|
9
12
|
|
|
10
|
-
function createAsset(opts) {
|
|
13
|
+
function createAsset(opts: AssetOptions) {
|
|
11
14
|
return _createAsset('/', opts);
|
|
12
15
|
}
|
|
13
16
|
|
|
@@ -18,6 +21,7 @@ describe('InternalAsset', () => {
|
|
|
18
21
|
let asset = new UncommittedAsset({
|
|
19
22
|
value: createAsset({
|
|
20
23
|
filePath: toProjectPath('/', '/foo/asset.js'),
|
|
24
|
+
code: null,
|
|
21
25
|
env: createEnvironment(),
|
|
22
26
|
stats,
|
|
23
27
|
type: 'js',
|
|
@@ -37,6 +41,7 @@ describe('InternalAsset', () => {
|
|
|
37
41
|
let asset = new UncommittedAsset({
|
|
38
42
|
value: createAsset({
|
|
39
43
|
filePath: toProjectPath('/', '/foo/asset.js'),
|
|
44
|
+
code: null,
|
|
40
45
|
env: createEnvironment(),
|
|
41
46
|
stats,
|
|
42
47
|
type: 'js',
|
|
@@ -56,6 +61,7 @@ describe('InternalAsset', () => {
|
|
|
56
61
|
let asset = new UncommittedAsset({
|
|
57
62
|
value: createAsset({
|
|
58
63
|
filePath: toProjectPath('/', '/foo/asset.js'),
|
|
64
|
+
code: null,
|
|
59
65
|
env: createEnvironment(),
|
|
60
66
|
stats,
|
|
61
67
|
type: 'js',
|
package/test/PublicAsset.test.js
CHANGED
|
@@ -3,12 +3,15 @@
|
|
|
3
3
|
import assert from 'assert';
|
|
4
4
|
import {Asset, MutableAsset} from '../src/public/Asset';
|
|
5
5
|
import UncommittedAsset from '../src/UncommittedAsset';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
createAsset as _createAsset,
|
|
8
|
+
type AssetOptions,
|
|
9
|
+
} from '../src/assetUtils';
|
|
7
10
|
import {createEnvironment} from '../src/Environment';
|
|
8
11
|
import {DEFAULT_OPTIONS} from './test-utils';
|
|
9
12
|
import {toProjectPath} from '../src/projectPath';
|
|
10
13
|
|
|
11
|
-
function createAsset(opts) {
|
|
14
|
+
function createAsset(opts: AssetOptions) {
|
|
12
15
|
return _createAsset('/', opts);
|
|
13
16
|
}
|
|
14
17
|
|
|
@@ -19,6 +22,7 @@ describe('Public Asset', () => {
|
|
|
19
22
|
options: DEFAULT_OPTIONS,
|
|
20
23
|
value: createAsset({
|
|
21
24
|
filePath: toProjectPath('/', '/does/not/exist'),
|
|
25
|
+
code: null,
|
|
22
26
|
type: 'js',
|
|
23
27
|
env: createEnvironment({}),
|
|
24
28
|
isSource: true,
|
|
@@ -8,12 +8,15 @@ import InternalBundleGraph from '../src/BundleGraph';
|
|
|
8
8
|
import MutableBundleGraph from '../src/public/MutableBundleGraph';
|
|
9
9
|
import {DEFAULT_ENV, DEFAULT_TARGETS, DEFAULT_OPTIONS} from './test-utils';
|
|
10
10
|
import AssetGraph, {nodeFromAssetGroup} from '../src/AssetGraph';
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
createAsset as _createAsset,
|
|
13
|
+
type AssetOptions,
|
|
14
|
+
} from '../src/assetUtils';
|
|
12
15
|
import {createDependency as _createDependency} from '../src/Dependency';
|
|
13
16
|
import nullthrows from 'nullthrows';
|
|
14
17
|
import {toProjectPath} from '../src/projectPath';
|
|
15
18
|
|
|
16
|
-
function createAsset(opts) {
|
|
19
|
+
function createAsset(opts: AssetOptions) {
|
|
17
20
|
return _createAsset('/', opts);
|
|
18
21
|
}
|
|
19
22
|
|
|
@@ -139,14 +142,14 @@ function createMockAssetGraph() {
|
|
|
139
142
|
|
|
140
143
|
let dep1 = createDependency({
|
|
141
144
|
specifier: 'path/to/index/src/main.js',
|
|
142
|
-
specifierType: '
|
|
145
|
+
specifierType: 'url',
|
|
143
146
|
needsStableName: true,
|
|
144
147
|
env: DEFAULT_ENV,
|
|
145
148
|
target: DEFAULT_TARGETS[0],
|
|
146
149
|
});
|
|
147
150
|
let dep2 = createDependency({
|
|
148
151
|
specifier: 'path/to/index/src/main2.js',
|
|
149
|
-
specifierType: '
|
|
152
|
+
specifierType: 'url',
|
|
150
153
|
needsStableName: true,
|
|
151
154
|
env: DEFAULT_ENV,
|
|
152
155
|
target: DEFAULT_TARGETS[0],
|
|
@@ -160,6 +163,7 @@ function createMockAssetGraph() {
|
|
|
160
163
|
[
|
|
161
164
|
createAsset({
|
|
162
165
|
id: id1,
|
|
166
|
+
code: null,
|
|
163
167
|
filePath,
|
|
164
168
|
type: 'js',
|
|
165
169
|
isSource: true,
|
|
@@ -178,6 +182,7 @@ function createMockAssetGraph() {
|
|
|
178
182
|
[
|
|
179
183
|
createAsset({
|
|
180
184
|
id: id2,
|
|
185
|
+
code: null,
|
|
181
186
|
filePath,
|
|
182
187
|
type: 'js',
|
|
183
188
|
isSource: true,
|
|
@@ -2,11 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
import assert from 'assert';
|
|
4
4
|
import nullthrows from 'nullthrows';
|
|
5
|
-
import RequestTracker, {
|
|
5
|
+
import RequestTracker, {
|
|
6
|
+
type RunAPI,
|
|
7
|
+
cleanUpOrphans,
|
|
8
|
+
} from '../src/RequestTracker';
|
|
9
|
+
import {Graph} from '@atlaspack/graph';
|
|
6
10
|
import WorkerFarm from '@atlaspack/workers';
|
|
7
11
|
import {DEFAULT_OPTIONS} from './test-utils';
|
|
8
|
-
import {INITIAL_BUILD} from '../src/constants';
|
|
12
|
+
import {FILE_CREATE, FILE_UPDATE, INITIAL_BUILD} from '../src/constants';
|
|
9
13
|
import {makeDeferredWithPromise} from '@atlaspack/utils';
|
|
14
|
+
import {toProjectPath} from '../src/projectPath';
|
|
15
|
+
import {DEFAULT_FEATURE_FLAGS, setFeatureFlags} from '../../feature-flags/src';
|
|
10
16
|
|
|
11
17
|
const options = DEFAULT_OPTIONS;
|
|
12
18
|
const farm = new WorkerFarm({workerPath: require.resolve('../src/worker.js')});
|
|
@@ -445,4 +451,135 @@ describe('RequestTracker', () => {
|
|
|
445
451
|
|
|
446
452
|
assert.equal(tracker.graph.getNode(nodeId)?.invalidateReason, 1);
|
|
447
453
|
});
|
|
454
|
+
|
|
455
|
+
describe('respondToFSEvents', () => {
|
|
456
|
+
[true, false].forEach(value => {
|
|
457
|
+
beforeEach(() => {
|
|
458
|
+
setFeatureFlags({
|
|
459
|
+
...DEFAULT_FEATURE_FLAGS,
|
|
460
|
+
fixQuadraticCacheInvalidation: value === true ? 'NEW' : 'OLD',
|
|
461
|
+
});
|
|
462
|
+
});
|
|
463
|
+
|
|
464
|
+
afterEach(() => {
|
|
465
|
+
setFeatureFlags({
|
|
466
|
+
...DEFAULT_FEATURE_FLAGS,
|
|
467
|
+
});
|
|
468
|
+
});
|
|
469
|
+
|
|
470
|
+
describe(`optimizations feature-flag ${String(value)}`, () => {
|
|
471
|
+
it('should invalidate file requests on file changes', async () => {
|
|
472
|
+
let tracker = new RequestTracker({farm, options});
|
|
473
|
+
await tracker.runRequest({
|
|
474
|
+
id: 'abc',
|
|
475
|
+
type: 7,
|
|
476
|
+
// $FlowFixMe string isn't a valid result
|
|
477
|
+
run: async ({api}: {api: RunAPI<string | void>, ...}) => {
|
|
478
|
+
api.invalidateOnFileUpdate(toProjectPath('', 'my-file'));
|
|
479
|
+
let result = await Promise.resolve('hello');
|
|
480
|
+
api.storeResult(result);
|
|
481
|
+
},
|
|
482
|
+
input: null,
|
|
483
|
+
});
|
|
484
|
+
const requestId = tracker.graph.getNodeIdByContentKey('abc');
|
|
485
|
+
const invalidated = await tracker.respondToFSEvents(
|
|
486
|
+
[
|
|
487
|
+
{
|
|
488
|
+
type: 'update',
|
|
489
|
+
path: 'my-file',
|
|
490
|
+
},
|
|
491
|
+
],
|
|
492
|
+
Number.MAX_VALUE,
|
|
493
|
+
);
|
|
494
|
+
assert.equal(invalidated, true);
|
|
495
|
+
assert.equal(
|
|
496
|
+
tracker.graph.getNode(requestId)?.invalidateReason,
|
|
497
|
+
FILE_UPDATE,
|
|
498
|
+
);
|
|
499
|
+
assert.deepEqual(Array.from(tracker.graph.invalidNodeIds), [
|
|
500
|
+
requestId,
|
|
501
|
+
]);
|
|
502
|
+
});
|
|
503
|
+
|
|
504
|
+
it('should invalidate file name requests with invalidate above invalidations', async () => {
|
|
505
|
+
let tracker = new RequestTracker({farm, options});
|
|
506
|
+
await tracker.runRequest({
|
|
507
|
+
id: 'abc',
|
|
508
|
+
type: 7,
|
|
509
|
+
// $FlowFixMe string isn't a valid result
|
|
510
|
+
run: async ({api}: {api: RunAPI<string | void>, ...}) => {
|
|
511
|
+
api.invalidateOnFileCreate({
|
|
512
|
+
fileName: 'package.json',
|
|
513
|
+
aboveFilePath: toProjectPath(
|
|
514
|
+
'',
|
|
515
|
+
'./node_modules/something/package.json',
|
|
516
|
+
),
|
|
517
|
+
});
|
|
518
|
+
let result = await Promise.resolve('hello');
|
|
519
|
+
api.storeResult(result);
|
|
520
|
+
},
|
|
521
|
+
input: null,
|
|
522
|
+
});
|
|
523
|
+
const requestId = tracker.graph.getNodeIdByContentKey('abc');
|
|
524
|
+
const invalidated = await tracker.respondToFSEvents(
|
|
525
|
+
[
|
|
526
|
+
{
|
|
527
|
+
type: 'create',
|
|
528
|
+
path: './package.json',
|
|
529
|
+
},
|
|
530
|
+
],
|
|
531
|
+
Number.MAX_VALUE,
|
|
532
|
+
);
|
|
533
|
+
assert.equal(invalidated, true);
|
|
534
|
+
assert.equal(
|
|
535
|
+
tracker.graph.getNode(requestId)?.invalidateReason,
|
|
536
|
+
FILE_CREATE,
|
|
537
|
+
);
|
|
538
|
+
assert.deepEqual(Array.from(tracker.graph.invalidNodeIds), [
|
|
539
|
+
requestId,
|
|
540
|
+
]);
|
|
541
|
+
});
|
|
542
|
+
});
|
|
543
|
+
});
|
|
544
|
+
});
|
|
545
|
+
});
|
|
546
|
+
|
|
547
|
+
describe('cleanUpOrphans', () => {
|
|
548
|
+
it('cleans-up unreachable nodes', () => {
|
|
549
|
+
const graph: Graph<string, number> = new Graph();
|
|
550
|
+
const root = graph.addNode('root');
|
|
551
|
+
graph.setRootNodeId(root);
|
|
552
|
+
const node1 = graph.addNode('node1');
|
|
553
|
+
const node2 = graph.addNode('node2');
|
|
554
|
+
const node3 = graph.addNode('node3');
|
|
555
|
+
const orphan1 = graph.addNode('orphan1');
|
|
556
|
+
const orphan2 = graph.addNode('orphan2');
|
|
557
|
+
|
|
558
|
+
/*
|
|
559
|
+
|
|
560
|
+
root --- node1 --- node2 ----------- orphan1 --- orphan2
|
|
561
|
+
\---- node3 (^ remove)
|
|
562
|
+
|
|
563
|
+
*/
|
|
564
|
+
|
|
565
|
+
const getNonNullNodes = graph => graph.nodes.filter(node => node != null);
|
|
566
|
+
|
|
567
|
+
graph.addEdge(root, node1);
|
|
568
|
+
graph.addEdge(node1, node2);
|
|
569
|
+
graph.addEdge(node2, orphan1);
|
|
570
|
+
graph.addEdge(orphan1, orphan2);
|
|
571
|
+
graph.addEdge(root, node3);
|
|
572
|
+
|
|
573
|
+
assert.deepEqual(cleanUpOrphans(graph), []);
|
|
574
|
+
assert.equal(getNonNullNodes(graph).length, 6);
|
|
575
|
+
assert.equal(Array.from(graph.getAllEdges()).length, 5);
|
|
576
|
+
|
|
577
|
+
graph.removeEdge(node2, orphan1, 1, false);
|
|
578
|
+
assert.equal(getNonNullNodes(graph).length, 6);
|
|
579
|
+
assert.equal(Array.from(graph.getAllEdges()).length, 4);
|
|
580
|
+
|
|
581
|
+
assert.deepEqual(cleanUpOrphans(graph), [orphan1, orphan2]);
|
|
582
|
+
assert.equal(getNonNullNodes(graph).length, 4);
|
|
583
|
+
assert.equal(Array.from(graph.getAllEdges()).length, 3);
|
|
584
|
+
});
|
|
448
585
|
});
|
|
@@ -125,7 +125,7 @@ describe('TargetResolver', () => {
|
|
|
125
125
|
publicUrl: '/',
|
|
126
126
|
distDir: normalizeSeparators(path.resolve('customA')),
|
|
127
127
|
env: {
|
|
128
|
-
id: '
|
|
128
|
+
id: 'd821e85f6b50315e',
|
|
129
129
|
context: 'browser',
|
|
130
130
|
includeNodeModules: true,
|
|
131
131
|
engines: {
|
|
@@ -146,7 +146,7 @@ describe('TargetResolver', () => {
|
|
|
146
146
|
distEntry: 'b.js',
|
|
147
147
|
distDir: normalizeSeparators(path.resolve('customB')),
|
|
148
148
|
env: {
|
|
149
|
-
id: '
|
|
149
|
+
id: 'e45cc12216f7857d',
|
|
150
150
|
context: 'node',
|
|
151
151
|
includeNodeModules: false,
|
|
152
152
|
engines: {
|
|
@@ -177,7 +177,7 @@ describe('TargetResolver', () => {
|
|
|
177
177
|
distEntry: 'index.js',
|
|
178
178
|
publicUrl: '/',
|
|
179
179
|
env: {
|
|
180
|
-
id: '
|
|
180
|
+
id: 'f628a18b9d37974c',
|
|
181
181
|
context: 'node',
|
|
182
182
|
engines: {
|
|
183
183
|
node: '>= 8.0.0',
|
|
@@ -211,7 +211,7 @@ describe('TargetResolver', () => {
|
|
|
211
211
|
distEntry: 'index.js',
|
|
212
212
|
publicUrl: '/',
|
|
213
213
|
env: {
|
|
214
|
-
id: '
|
|
214
|
+
id: 'f9afb61b20ba7ecf',
|
|
215
215
|
context: 'browser',
|
|
216
216
|
engines: {
|
|
217
217
|
browsers: ['last 1 version'],
|
|
@@ -247,7 +247,7 @@ describe('TargetResolver', () => {
|
|
|
247
247
|
distEntry: 'index.js',
|
|
248
248
|
publicUrl: '/assets',
|
|
249
249
|
env: {
|
|
250
|
-
id: '
|
|
250
|
+
id: '7c0fe07c8a3a38da',
|
|
251
251
|
context: 'browser',
|
|
252
252
|
engines: {
|
|
253
253
|
browsers: ['last 1 version'],
|
|
@@ -293,7 +293,7 @@ describe('TargetResolver', () => {
|
|
|
293
293
|
distEntry: 'index.js',
|
|
294
294
|
publicUrl: '/',
|
|
295
295
|
env: {
|
|
296
|
-
id: '
|
|
296
|
+
id: 'e45cc12216f7857d',
|
|
297
297
|
context: 'node',
|
|
298
298
|
engines: {
|
|
299
299
|
node: '>= 8.0.0',
|
|
@@ -336,7 +336,7 @@ describe('TargetResolver', () => {
|
|
|
336
336
|
distEntry: 'index.js',
|
|
337
337
|
publicUrl: '/',
|
|
338
338
|
env: {
|
|
339
|
-
id: '
|
|
339
|
+
id: 'f628a18b9d37974c',
|
|
340
340
|
context: 'node',
|
|
341
341
|
engines: {
|
|
342
342
|
node: '>= 8.0.0',
|
|
@@ -370,7 +370,7 @@ describe('TargetResolver', () => {
|
|
|
370
370
|
distEntry: 'index.js',
|
|
371
371
|
publicUrl: '/',
|
|
372
372
|
env: {
|
|
373
|
-
id: '
|
|
373
|
+
id: '75603271034eff15',
|
|
374
374
|
context: 'browser',
|
|
375
375
|
engines: {
|
|
376
376
|
browsers: ['last 1 version'],
|
|
@@ -404,7 +404,7 @@ describe('TargetResolver', () => {
|
|
|
404
404
|
distEntry: 'index.js',
|
|
405
405
|
publicUrl: '/',
|
|
406
406
|
env: {
|
|
407
|
-
id: '
|
|
407
|
+
id: 'a8f05066473f62d0',
|
|
408
408
|
context: 'browser',
|
|
409
409
|
engines: {
|
|
410
410
|
browsers: ['ie11'],
|
|
@@ -455,7 +455,7 @@ describe('TargetResolver', () => {
|
|
|
455
455
|
distEntry: 'index.js',
|
|
456
456
|
publicUrl: '/',
|
|
457
457
|
env: {
|
|
458
|
-
id: '
|
|
458
|
+
id: 'f628a18b9d37974c',
|
|
459
459
|
context: 'node',
|
|
460
460
|
engines: {
|
|
461
461
|
node: '>= 8.0.0',
|
|
@@ -489,7 +489,7 @@ describe('TargetResolver', () => {
|
|
|
489
489
|
distEntry: 'index.js',
|
|
490
490
|
publicUrl: '/',
|
|
491
491
|
env: {
|
|
492
|
-
id: '
|
|
492
|
+
id: '8a530881a691863e',
|
|
493
493
|
context: 'browser',
|
|
494
494
|
engines: {
|
|
495
495
|
browsers: ['last 1 version'],
|
|
@@ -523,7 +523,7 @@ describe('TargetResolver', () => {
|
|
|
523
523
|
distEntry: 'index.js',
|
|
524
524
|
publicUrl: '/',
|
|
525
525
|
env: {
|
|
526
|
-
id: '
|
|
526
|
+
id: '4dcd5bfb2f44e1a0',
|
|
527
527
|
context: 'browser',
|
|
528
528
|
engines: {
|
|
529
529
|
browsers: ['ie11'],
|
|
@@ -566,7 +566,7 @@ describe('TargetResolver', () => {
|
|
|
566
566
|
distEntry: undefined,
|
|
567
567
|
publicUrl: 'www',
|
|
568
568
|
env: {
|
|
569
|
-
id: '
|
|
569
|
+
id: '073545c36b2ddaab',
|
|
570
570
|
context: 'browser',
|
|
571
571
|
engines: {
|
|
572
572
|
browsers: '> 0.25%',
|
|
@@ -621,7 +621,7 @@ describe('TargetResolver', () => {
|
|
|
621
621
|
distDir: normalizeSeparators(path.resolve('customB')),
|
|
622
622
|
publicUrl: '/',
|
|
623
623
|
env: {
|
|
624
|
-
id: '
|
|
624
|
+
id: 'd821e85f6b50315e',
|
|
625
625
|
context: 'browser',
|
|
626
626
|
engines: {
|
|
627
627
|
browsers: ['> 0.25%'],
|
|
@@ -663,7 +663,7 @@ describe('TargetResolver', () => {
|
|
|
663
663
|
distDir: normalizeSeparators(path.resolve('customA')),
|
|
664
664
|
publicUrl: '/',
|
|
665
665
|
env: {
|
|
666
|
-
id: '
|
|
666
|
+
id: 'd821e85f6b50315e',
|
|
667
667
|
context: 'browser',
|
|
668
668
|
engines: {
|
|
669
669
|
browsers: ['> 0.25%'],
|
|
@@ -692,7 +692,7 @@ describe('TargetResolver', () => {
|
|
|
692
692
|
distEntry: 'index.js',
|
|
693
693
|
publicUrl: '/',
|
|
694
694
|
env: {
|
|
695
|
-
id: '
|
|
695
|
+
id: '4d60aebb4fbb9f8b',
|
|
696
696
|
context: 'node',
|
|
697
697
|
engines: {
|
|
698
698
|
browsers: [
|
|
@@ -1070,7 +1070,7 @@ describe('TargetResolver', () => {
|
|
|
1070
1070
|
distEntry: 'index.mjs',
|
|
1071
1071
|
publicUrl: '/',
|
|
1072
1072
|
env: {
|
|
1073
|
-
id: '
|
|
1073
|
+
id: 'fb14362a83d338f6',
|
|
1074
1074
|
context: 'browser',
|
|
1075
1075
|
engines: {
|
|
1076
1076
|
browsers: [
|
|
@@ -1115,7 +1115,7 @@ describe('TargetResolver', () => {
|
|
|
1115
1115
|
distEntry: 'index.js',
|
|
1116
1116
|
publicUrl: '/',
|
|
1117
1117
|
env: {
|
|
1118
|
-
id: '
|
|
1118
|
+
id: 'fb14362a83d338f6',
|
|
1119
1119
|
context: 'browser',
|
|
1120
1120
|
engines: {
|
|
1121
1121
|
browsers: [
|
|
@@ -1164,7 +1164,7 @@ describe('TargetResolver', () => {
|
|
|
1164
1164
|
distEntry: 'index.js',
|
|
1165
1165
|
publicUrl: '/',
|
|
1166
1166
|
env: {
|
|
1167
|
-
id: '
|
|
1167
|
+
id: 'f628a18b9d37974c',
|
|
1168
1168
|
context: 'node',
|
|
1169
1169
|
engines: {
|
|
1170
1170
|
node: '>= 8.0.0',
|
|
@@ -1198,7 +1198,7 @@ describe('TargetResolver', () => {
|
|
|
1198
1198
|
distEntry: 'index.js',
|
|
1199
1199
|
publicUrl: '/assets',
|
|
1200
1200
|
env: {
|
|
1201
|
-
id: '
|
|
1201
|
+
id: '7c0fe07c8a3a38da',
|
|
1202
1202
|
context: 'browser',
|
|
1203
1203
|
engines: {
|
|
1204
1204
|
browsers: ['last 1 version'],
|
|
@@ -1246,7 +1246,7 @@ describe('TargetResolver', () => {
|
|
|
1246
1246
|
distDir: serveDistDir,
|
|
1247
1247
|
publicUrl: '/',
|
|
1248
1248
|
env: {
|
|
1249
|
-
id: '
|
|
1249
|
+
id: '858b9b5a5dca37d4',
|
|
1250
1250
|
context: 'browser',
|
|
1251
1251
|
engines: {
|
|
1252
1252
|
browsers: [
|
|
@@ -1283,7 +1283,7 @@ describe('TargetResolver', () => {
|
|
|
1283
1283
|
),
|
|
1284
1284
|
publicUrl: '/',
|
|
1285
1285
|
env: {
|
|
1286
|
-
id: '
|
|
1286
|
+
id: '8f31176c88184c4f',
|
|
1287
1287
|
context: 'browser',
|
|
1288
1288
|
engines: {
|
|
1289
1289
|
browsers: ['Chrome 80'],
|
|
@@ -1316,7 +1316,7 @@ describe('TargetResolver', () => {
|
|
|
1316
1316
|
distEntry: undefined,
|
|
1317
1317
|
publicUrl: '/',
|
|
1318
1318
|
env: {
|
|
1319
|
-
id: '
|
|
1319
|
+
id: '8f31176c88184c4f',
|
|
1320
1320
|
context: 'browser',
|
|
1321
1321
|
engines: {
|
|
1322
1322
|
browsers: ['Chrome 80'],
|
|
@@ -1366,7 +1366,7 @@ describe('TargetResolver', () => {
|
|
|
1366
1366
|
distEntry: undefined,
|
|
1367
1367
|
publicUrl: '/',
|
|
1368
1368
|
env: {
|
|
1369
|
-
id: '
|
|
1369
|
+
id: '75603271034eff15',
|
|
1370
1370
|
context: 'browser',
|
|
1371
1371
|
engines: {
|
|
1372
1372
|
browsers: ['last 1 version'],
|
|
@@ -1406,7 +1406,7 @@ describe('TargetResolver', () => {
|
|
|
1406
1406
|
distEntry: undefined,
|
|
1407
1407
|
publicUrl: '/',
|
|
1408
1408
|
env: {
|
|
1409
|
-
id: '
|
|
1409
|
+
id: 'd5ff950a2c05db56',
|
|
1410
1410
|
context: 'browser',
|
|
1411
1411
|
engines: {
|
|
1412
1412
|
browsers: ['IE 11'],
|