@atlaspack/core 2.28.0 → 2.29.0
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 +31 -0
- package/dist/AtlaspackConfig.schema.js +9 -0
- package/dist/atlaspack-v3/AtlaspackV3.js +2 -9
- package/dist/atlaspack-v3/NapiWorkerPool.js +5 -1
- package/dist/requests/AssetGraphRequestRust.js +17 -6
- package/lib/AtlaspackConfig.schema.js +9 -0
- package/lib/atlaspack-v3/AtlaspackV3.js +2 -9
- package/lib/atlaspack-v3/NapiWorkerPool.js +4 -1
- package/lib/requests/AssetGraphRequestRust.js +20 -8
- package/lib/types/AtlaspackConfig.schema.d.ts +7 -0
- package/package.json +14 -14
- package/src/AtlaspackConfig.schema.ts +9 -0
- package/src/atlaspack-v3/AtlaspackV3.ts +2 -13
- package/src/atlaspack-v3/NapiWorkerPool.ts +5 -1
- package/src/requests/AssetGraphRequestRust.ts +23 -11
- package/test/AtlaspackConfigRequest.test.ts +1 -1
- package/test/requests/AssetGraphRequestRust.test.ts +278 -276
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# @atlaspack/core
|
|
2
2
|
|
|
3
|
+
## 2.29.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#898](https://github.com/atlassian-labs/atlaspack/pull/898) [`a884bd2`](https://github.com/atlassian-labs/atlaspack/commit/a884bd2a6bd6f37d088fb886dd9b88e85328501b) Thanks [@mattcompiles](https://github.com/mattcompiles)! - Add `unstable_alias` feature to .parcelrc V3 builds for configuring build specific aliases
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [#899](https://github.com/atlassian-labs/atlaspack/pull/899) [`5710532`](https://github.com/atlassian-labs/atlaspack/commit/57105322b26ce42af2cbfcc0506cff929e50b630) Thanks [@mattcompiles](https://github.com/mattcompiles)! - Fix v3 environment ids not being consistent with v2
|
|
12
|
+
|
|
13
|
+
- [#901](https://github.com/atlassian-labs/atlaspack/pull/901) [`6fac01d`](https://github.com/atlassian-labs/atlaspack/commit/6fac01dbb1bfc5b971176c1a1c008297bf4b8f91) Thanks [@benjervis](https://github.com/benjervis)! - Makes the serialization and LMDB write steps into separate Promises, so that we can return them separately and parallelise some work.
|
|
14
|
+
|
|
15
|
+
- [#905](https://github.com/atlassian-labs/atlaspack/pull/905) [`432d571`](https://github.com/atlassian-labs/atlaspack/commit/432d571ea4e9fc67be12304fcafe8c445e844174) Thanks [@mattcompiles](https://github.com/mattcompiles)! - Decrease max V3 JS workers to 4
|
|
16
|
+
|
|
17
|
+
- [#899](https://github.com/atlassian-labs/atlaspack/pull/899) [`5710532`](https://github.com/atlassian-labs/atlaspack/commit/57105322b26ce42af2cbfcc0506cff929e50b630) Thanks [@mattcompiles](https://github.com/mattcompiles)! - Add HMR and react-refresh support to v3
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [[`a884bd2`](https://github.com/atlassian-labs/atlaspack/commit/a884bd2a6bd6f37d088fb886dd9b88e85328501b), [`25fee72`](https://github.com/atlassian-labs/atlaspack/commit/25fee723d2228d0482ec8a8f1b8379ccd2977ce7), [`6fac01d`](https://github.com/atlassian-labs/atlaspack/commit/6fac01dbb1bfc5b971176c1a1c008297bf4b8f91), [`2f3af93`](https://github.com/atlassian-labs/atlaspack/commit/2f3af9374bcc082e6f4835f6f5a2b98e32ea45b4), [`432d571`](https://github.com/atlassian-labs/atlaspack/commit/432d571ea4e9fc67be12304fcafe8c445e844174), [`042cd95`](https://github.com/atlassian-labs/atlaspack/commit/042cd95a32ad38cd02d57aa3344c36d4e7ab8f9c), [`28f5424`](https://github.com/atlassian-labs/atlaspack/commit/28f5424f7e2080dd4fbbeb1bc5314a530197a23e), [`a884bd2`](https://github.com/atlassian-labs/atlaspack/commit/a884bd2a6bd6f37d088fb886dd9b88e85328501b), [`5710532`](https://github.com/atlassian-labs/atlaspack/commit/57105322b26ce42af2cbfcc0506cff929e50b630), [`44eb8c3`](https://github.com/atlassian-labs/atlaspack/commit/44eb8c388d3e63f1ef5d835aee7aee5d1bb0620f)]:
|
|
20
|
+
- @atlaspack/rust@3.12.0
|
|
21
|
+
- @atlaspack/feature-flags@2.27.1
|
|
22
|
+
- @atlaspack/cache@3.2.35
|
|
23
|
+
- @atlaspack/fs@2.15.35
|
|
24
|
+
- @atlaspack/logger@2.14.32
|
|
25
|
+
- @atlaspack/source-map@3.1.1
|
|
26
|
+
- @atlaspack/utils@3.2.1
|
|
27
|
+
- @atlaspack/graph@3.6.2
|
|
28
|
+
- @atlaspack/package-manager@2.14.40
|
|
29
|
+
- @atlaspack/profiler@2.15.1
|
|
30
|
+
- @atlaspack/workers@2.14.40
|
|
31
|
+
- @atlaspack/plugin@2.14.40
|
|
32
|
+
- @atlaspack/types@2.15.30
|
|
33
|
+
|
|
3
34
|
## 2.28.0
|
|
4
35
|
|
|
5
36
|
### Minor Changes
|
|
@@ -97,6 +97,15 @@ exports.default = {
|
|
|
97
97
|
compressors: mapPipelineSchema('compressor', 'compressors'),
|
|
98
98
|
reporters: pipelineSchema('reporter', 'reporters'),
|
|
99
99
|
runtimes: pipelineSchema('runtime', 'runtimes'),
|
|
100
|
+
// This isn't currently supported in V2, however we need to allow it to
|
|
101
|
+
// parse as even V3 builds need the AtlaspackConfigRequest
|
|
102
|
+
unstable_alias: {
|
|
103
|
+
type: 'object',
|
|
104
|
+
properties: {},
|
|
105
|
+
additionalProperties: {
|
|
106
|
+
type: 'string',
|
|
107
|
+
},
|
|
108
|
+
},
|
|
100
109
|
filePath: {
|
|
101
110
|
type: 'string',
|
|
102
111
|
},
|
|
@@ -48,15 +48,8 @@ class AtlaspackV3 {
|
|
|
48
48
|
this._napiWorkerPool.shutdown();
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
let [graph, error] = await (0, rust_1.atlaspackNapiBuildAssetGraph)(this._atlaspack_napi);
|
|
54
|
-
if (error !== null) {
|
|
55
|
-
throw new diagnostic_1.default({
|
|
56
|
-
diagnostic: error,
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
return graph;
|
|
51
|
+
buildAssetGraph() {
|
|
52
|
+
return (0, rust_1.atlaspackNapiBuildAssetGraph)(this._atlaspack_napi);
|
|
60
53
|
}
|
|
61
54
|
async respondToFsEvents(events) {
|
|
62
55
|
// @ts-expect-error TS2488
|
|
@@ -29,7 +29,11 @@ class NapiWorkerPool {
|
|
|
29
29
|
_NapiWorkerPool_napiWorkers.set(this, void 0);
|
|
30
30
|
_NapiWorkerPool_workerCount.set(this, void 0);
|
|
31
31
|
// @ts-expect-error TS2322
|
|
32
|
-
__classPrivateFieldSet(this, _NapiWorkerPool_workerCount, workerCount ??
|
|
32
|
+
__classPrivateFieldSet(this, _NapiWorkerPool_workerCount, workerCount ??
|
|
33
|
+
ATLASPACK_NAPI_WORKERS ??
|
|
34
|
+
// Default to a maximum of 4 workers as performance worsens beyond that
|
|
35
|
+
// point in most cases
|
|
36
|
+
Math.min((0, rust_1.getAvailableThreads)(), 4), "f");
|
|
33
37
|
if (!__classPrivateFieldGet(this, _NapiWorkerPool_workerCount, "f")) {
|
|
34
38
|
// TODO use main thread if workerCount is 0
|
|
35
39
|
}
|
|
@@ -22,11 +22,13 @@ function createAssetGraphRequestRust(rustAtlaspack) {
|
|
|
22
22
|
id: input.name,
|
|
23
23
|
run: async (input) => {
|
|
24
24
|
let options = input.options;
|
|
25
|
-
let
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
let { assetGraphPromise, commitPromise } = await rustAtlaspack.buildAssetGraph();
|
|
26
|
+
let [serializedAssetGraph, assetGraphError] = (await assetGraphPromise);
|
|
27
|
+
if (assetGraphError) {
|
|
28
|
+
throw new diagnostic_1.default({
|
|
29
|
+
diagnostic: assetGraphError,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
30
32
|
// Don't reuse a previous asset graph result if Rust didn't have one too
|
|
31
33
|
let prevResult = null;
|
|
32
34
|
if (serializedAssetGraph.hadPreviousGraph) {
|
|
@@ -58,6 +60,14 @@ function createAssetGraphRequestRust(rustAtlaspack) {
|
|
|
58
60
|
changedAssetsPropagation,
|
|
59
61
|
previousSymbolPropagationErrors: undefined,
|
|
60
62
|
};
|
|
63
|
+
let [_commitResult, commitError] = await commitPromise;
|
|
64
|
+
if (commitError) {
|
|
65
|
+
throw new diagnostic_1.default({
|
|
66
|
+
diagnostic: {
|
|
67
|
+
message: 'Error committing asset graph in Rust: ' + commitError.message,
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
}
|
|
61
71
|
await input.api.storeResult(result);
|
|
62
72
|
input.api.invalidateOnBuild();
|
|
63
73
|
return result;
|
|
@@ -146,7 +156,7 @@ function getAssetGraph(serializedGraph, prevAssetGraph) {
|
|
|
146
156
|
].join(':');
|
|
147
157
|
let envId = envs.get(envKey);
|
|
148
158
|
if (envId == null) {
|
|
149
|
-
envId =
|
|
159
|
+
envId = (0, Environment_1.getEnvironmentHash)(env);
|
|
150
160
|
envs.set(envKey, envId);
|
|
151
161
|
}
|
|
152
162
|
return envId;
|
|
@@ -168,6 +178,7 @@ function getAssetGraph(serializedGraph, prevAssetGraph) {
|
|
|
168
178
|
let node = isUpdateNode
|
|
169
179
|
? serializedGraph.updates[index - nodeTypeSwitchoverIndex]
|
|
170
180
|
: serializedGraph.nodes[index];
|
|
181
|
+
node = JSON.parse(node);
|
|
171
182
|
if (node.type === 'entry') {
|
|
172
183
|
let id = 'entry:' + ++entry;
|
|
173
184
|
graph.addNodeByContentKey(id, {
|
|
@@ -94,6 +94,15 @@ var _default = exports.default = {
|
|
|
94
94
|
compressors: mapPipelineSchema('compressor', 'compressors'),
|
|
95
95
|
reporters: pipelineSchema('reporter', 'reporters'),
|
|
96
96
|
runtimes: pipelineSchema('runtime', 'runtimes'),
|
|
97
|
+
// This isn't currently supported in V2, however we need to allow it to
|
|
98
|
+
// parse as even V3 builds need the AtlaspackConfigRequest
|
|
99
|
+
unstable_alias: {
|
|
100
|
+
type: 'object',
|
|
101
|
+
properties: {},
|
|
102
|
+
additionalProperties: {
|
|
103
|
+
type: 'string'
|
|
104
|
+
}
|
|
105
|
+
},
|
|
97
106
|
filePath: {
|
|
98
107
|
type: 'string'
|
|
99
108
|
},
|
|
@@ -69,15 +69,8 @@ class AtlaspackV3 {
|
|
|
69
69
|
this._napiWorkerPool.shutdown();
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
let [graph, error] = await (0, _rust().atlaspackNapiBuildAssetGraph)(this._atlaspack_napi);
|
|
75
|
-
if (error !== null) {
|
|
76
|
-
throw new (_diagnostic().default)({
|
|
77
|
-
diagnostic: error
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
return graph;
|
|
72
|
+
buildAssetGraph() {
|
|
73
|
+
return (0, _rust().atlaspackNapiBuildAssetGraph)(this._atlaspack_napi);
|
|
81
74
|
}
|
|
82
75
|
async respondToFsEvents(events) {
|
|
83
76
|
// @ts-expect-error TS2488
|
|
@@ -47,7 +47,10 @@ class NapiWorkerPool {
|
|
|
47
47
|
workerCount: undefined
|
|
48
48
|
}) {
|
|
49
49
|
// @ts-expect-error TS2322
|
|
50
|
-
this.#workerCount = workerCount ?? ATLASPACK_NAPI_WORKERS ??
|
|
50
|
+
this.#workerCount = workerCount ?? ATLASPACK_NAPI_WORKERS ??
|
|
51
|
+
// Default to a maximum of 4 workers as performance worsens beyond that
|
|
52
|
+
// point in most cases
|
|
53
|
+
Math.min((0, _rust().getAvailableThreads)(), 4);
|
|
51
54
|
if (!this.#workerCount) {
|
|
52
55
|
// TODO use main thread if workerCount is 0
|
|
53
56
|
}
|
|
@@ -46,13 +46,16 @@ function createAssetGraphRequestRust(rustAtlaspack) {
|
|
|
46
46
|
id: input.name,
|
|
47
47
|
run: async input => {
|
|
48
48
|
let options = input.options;
|
|
49
|
-
let
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
let {
|
|
50
|
+
assetGraphPromise,
|
|
51
|
+
commitPromise
|
|
52
|
+
} = await rustAtlaspack.buildAssetGraph();
|
|
53
|
+
let [serializedAssetGraph, assetGraphError] = await assetGraphPromise;
|
|
54
|
+
if (assetGraphError) {
|
|
55
|
+
throw new (_diagnostic().default)({
|
|
56
|
+
diagnostic: assetGraphError
|
|
57
|
+
});
|
|
58
|
+
}
|
|
56
59
|
|
|
57
60
|
// Don't reuse a previous asset graph result if Rust didn't have one too
|
|
58
61
|
let prevResult = null;
|
|
@@ -91,6 +94,14 @@ function createAssetGraphRequestRust(rustAtlaspack) {
|
|
|
91
94
|
changedAssetsPropagation,
|
|
92
95
|
previousSymbolPropagationErrors: undefined
|
|
93
96
|
};
|
|
97
|
+
let [_commitResult, commitError] = await commitPromise;
|
|
98
|
+
if (commitError) {
|
|
99
|
+
throw new (_diagnostic().default)({
|
|
100
|
+
diagnostic: {
|
|
101
|
+
message: 'Error committing asset graph in Rust: ' + commitError.message
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
94
105
|
await input.api.storeResult(result);
|
|
95
106
|
input.api.invalidateOnBuild();
|
|
96
107
|
return result;
|
|
@@ -169,7 +180,7 @@ function getAssetGraph(serializedGraph, prevAssetGraph) {
|
|
|
169
180
|
let envKey = [env.context, env.engines.atlaspack, env.engines.browsers, env.engines.electron, env.engines.node, env.includeNodeModules, env.isLibrary, env.outputFormat, env.shouldScopeHoist, env.shouldOptimize, env.sourceType].join(':');
|
|
170
181
|
let envId = envs.get(envKey);
|
|
171
182
|
if (envId == null) {
|
|
172
|
-
envId =
|
|
183
|
+
envId = (0, _Environment.getEnvironmentHash)(env);
|
|
173
184
|
envs.set(envKey, envId);
|
|
174
185
|
}
|
|
175
186
|
return envId;
|
|
@@ -188,6 +199,7 @@ function getAssetGraph(serializedGraph, prevAssetGraph) {
|
|
|
188
199
|
for (let index = 0; index < nodesCount; index++) {
|
|
189
200
|
let isUpdateNode = index >= nodeTypeSwitchoverIndex;
|
|
190
201
|
let node = isUpdateNode ? serializedGraph.updates[index - nodeTypeSwitchoverIndex] : serializedGraph.nodes[index];
|
|
202
|
+
node = JSON.parse(node);
|
|
191
203
|
if (node.type === 'entry') {
|
|
192
204
|
let id = 'entry:' + ++entry;
|
|
193
205
|
graph.addNodeByContentKey(id, {
|
|
@@ -34,6 +34,13 @@ declare const _default: {
|
|
|
34
34
|
compressors: SchemaEntity;
|
|
35
35
|
reporters: SchemaEntity;
|
|
36
36
|
runtimes: SchemaEntity;
|
|
37
|
+
unstable_alias: {
|
|
38
|
+
type: string;
|
|
39
|
+
properties: {};
|
|
40
|
+
additionalProperties: {
|
|
41
|
+
type: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
37
44
|
filePath: {
|
|
38
45
|
type: string;
|
|
39
46
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.29.0",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -24,21 +24,21 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@mischnic/json-sourcemap": "^0.1.0",
|
|
26
26
|
"@atlaspack/build-cache": "2.13.6",
|
|
27
|
-
"@atlaspack/cache": "3.2.
|
|
27
|
+
"@atlaspack/cache": "3.2.35",
|
|
28
28
|
"@atlaspack/diagnostic": "2.14.4",
|
|
29
29
|
"@atlaspack/events": "2.14.4",
|
|
30
|
-
"@atlaspack/feature-flags": "2.27.
|
|
31
|
-
"@atlaspack/fs": "2.15.
|
|
32
|
-
"@atlaspack/graph": "3.6.
|
|
33
|
-
"@atlaspack/logger": "2.14.
|
|
34
|
-
"@atlaspack/package-manager": "2.14.
|
|
35
|
-
"@atlaspack/plugin": "2.14.
|
|
36
|
-
"@atlaspack/profiler": "2.15.
|
|
37
|
-
"@atlaspack/rust": "3.
|
|
38
|
-
"@atlaspack/types": "2.15.
|
|
39
|
-
"@atlaspack/utils": "3.2.
|
|
40
|
-
"@atlaspack/workers": "2.14.
|
|
41
|
-
"@atlaspack/source-map": "3.1.
|
|
30
|
+
"@atlaspack/feature-flags": "2.27.1",
|
|
31
|
+
"@atlaspack/fs": "2.15.35",
|
|
32
|
+
"@atlaspack/graph": "3.6.2",
|
|
33
|
+
"@atlaspack/logger": "2.14.32",
|
|
34
|
+
"@atlaspack/package-manager": "2.14.40",
|
|
35
|
+
"@atlaspack/plugin": "2.14.40",
|
|
36
|
+
"@atlaspack/profiler": "2.15.1",
|
|
37
|
+
"@atlaspack/rust": "3.12.0",
|
|
38
|
+
"@atlaspack/types": "2.15.30",
|
|
39
|
+
"@atlaspack/utils": "3.2.1",
|
|
40
|
+
"@atlaspack/workers": "2.14.40",
|
|
41
|
+
"@atlaspack/source-map": "3.1.1",
|
|
42
42
|
"base-x": "^3.0.8",
|
|
43
43
|
"browserslist": "^4.6.6",
|
|
44
44
|
"clone": "^2.1.1",
|
|
@@ -107,6 +107,15 @@ export default {
|
|
|
107
107
|
compressors: mapPipelineSchema('compressor', 'compressors') as SchemaEntity,
|
|
108
108
|
reporters: pipelineSchema('reporter', 'reporters') as SchemaEntity,
|
|
109
109
|
runtimes: pipelineSchema('runtime', 'runtimes') as SchemaEntity,
|
|
110
|
+
// This isn't currently supported in V2, however we need to allow it to
|
|
111
|
+
// parse as even V3 builds need the AtlaspackConfigRequest
|
|
112
|
+
unstable_alias: {
|
|
113
|
+
type: 'object',
|
|
114
|
+
properties: {},
|
|
115
|
+
additionalProperties: {
|
|
116
|
+
type: 'string',
|
|
117
|
+
},
|
|
118
|
+
},
|
|
110
119
|
filePath: {
|
|
111
120
|
type: 'string',
|
|
112
121
|
},
|
|
@@ -91,19 +91,8 @@ export class AtlaspackV3 {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
let [graph, error] = await atlaspackNapiBuildAssetGraph(
|
|
97
|
-
this._atlaspack_napi,
|
|
98
|
-
);
|
|
99
|
-
|
|
100
|
-
if (error !== null) {
|
|
101
|
-
throw new ThrowableDiagnostic({
|
|
102
|
-
diagnostic: error,
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
return graph;
|
|
94
|
+
buildAssetGraph(): Promise<any> {
|
|
95
|
+
return atlaspackNapiBuildAssetGraph(this._atlaspack_napi) as Promise<any>;
|
|
107
96
|
}
|
|
108
97
|
|
|
109
98
|
async respondToFsEvents(events: Array<Event>): Promise<boolean> {
|
|
@@ -23,7 +23,11 @@ export class NapiWorkerPool implements INapiWorkerPool {
|
|
|
23
23
|
constructor({workerCount}: NapiWorkerPoolOptions = {workerCount: undefined}) {
|
|
24
24
|
// @ts-expect-error TS2322
|
|
25
25
|
this.#workerCount =
|
|
26
|
-
workerCount ??
|
|
26
|
+
workerCount ??
|
|
27
|
+
ATLASPACK_NAPI_WORKERS ??
|
|
28
|
+
// Default to a maximum of 4 workers as performance worsens beyond that
|
|
29
|
+
// point in most cases
|
|
30
|
+
Math.min(getAvailableThreads(), 4);
|
|
27
31
|
if (!this.#workerCount) {
|
|
28
32
|
// TODO use main thread if workerCount is 0
|
|
29
33
|
}
|
|
@@ -53,18 +53,17 @@ export function createAssetGraphRequestRust(
|
|
|
53
53
|
id: input.name,
|
|
54
54
|
run: async (input) => {
|
|
55
55
|
let options = input.options;
|
|
56
|
-
let
|
|
57
|
-
|
|
56
|
+
let {assetGraphPromise, commitPromise} =
|
|
57
|
+
await rustAtlaspack.buildAssetGraph();
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
JSON.parse(node),
|
|
62
|
-
);
|
|
59
|
+
let [serializedAssetGraph, assetGraphError] =
|
|
60
|
+
(await assetGraphPromise) as [SerializedAssetGraphDelta, Error | null];
|
|
63
61
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
if (assetGraphError) {
|
|
63
|
+
throw new ThrowableDiagnostic({
|
|
64
|
+
diagnostic: assetGraphError,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
68
67
|
|
|
69
68
|
// Don't reuse a previous asset graph result if Rust didn't have one too
|
|
70
69
|
let prevResult = null;
|
|
@@ -106,6 +105,17 @@ export function createAssetGraphRequestRust(
|
|
|
106
105
|
previousSymbolPropagationErrors: undefined,
|
|
107
106
|
};
|
|
108
107
|
|
|
108
|
+
let [_commitResult, commitError] = await commitPromise;
|
|
109
|
+
|
|
110
|
+
if (commitError) {
|
|
111
|
+
throw new ThrowableDiagnostic({
|
|
112
|
+
diagnostic: {
|
|
113
|
+
message:
|
|
114
|
+
'Error committing asset graph in Rust: ' + commitError.message,
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
|
|
109
119
|
await input.api.storeResult(result);
|
|
110
120
|
input.api.invalidateOnBuild();
|
|
111
121
|
|
|
@@ -213,7 +223,7 @@ export function getAssetGraph(
|
|
|
213
223
|
|
|
214
224
|
let envId = envs.get(envKey);
|
|
215
225
|
if (envId == null) {
|
|
216
|
-
envId =
|
|
226
|
+
envId = getEnvironmentHash(env);
|
|
217
227
|
envs.set(envKey, envId);
|
|
218
228
|
}
|
|
219
229
|
|
|
@@ -242,6 +252,8 @@ export function getAssetGraph(
|
|
|
242
252
|
? serializedGraph.updates[index - nodeTypeSwitchoverIndex]
|
|
243
253
|
: serializedGraph.nodes[index];
|
|
244
254
|
|
|
255
|
+
node = JSON.parse(node);
|
|
256
|
+
|
|
245
257
|
if (node.type === 'entry') {
|
|
246
258
|
let id = 'entry:' + ++entry;
|
|
247
259
|
|
|
@@ -133,7 +133,7 @@ describe('AtlaspackConfigRequest', () => {
|
|
|
133
133
|
(e: any) => {
|
|
134
134
|
assert.strictEqual(
|
|
135
135
|
e.diagnostics[0].codeFrames[0].codeHighlights[0].message,
|
|
136
|
-
`Possible values: "$schema", "bundler", "resolvers", "transformers", "validators", "namers", "packagers", "optimizers", "compressors", "reporters", "runtimes", "filePath", "resolveFrom"`,
|
|
136
|
+
`Possible values: "$schema", "bundler", "resolvers", "transformers", "validators", "namers", "packagers", "optimizers", "compressors", "reporters", "runtimes", "unstable\\_alias", "filePath", "resolveFrom"`,
|
|
137
137
|
);
|
|
138
138
|
return true;
|
|
139
139
|
},
|