@atlaspack/core 2.12.1-canary.3527 → 2.12.1-canary.3530

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.
@@ -27,7 +27,6 @@ function _rust() {
27
27
  }
28
28
  var _AssetGraph = _interopRequireWildcard(require("../AssetGraph"));
29
29
  var _constants = require("../constants");
30
- var _projectPath = require("../projectPath");
31
30
  var _RequestTracker = require("../RequestTracker");
32
31
  var _SymbolPropagation = require("../SymbolPropagation");
33
32
  function _sourceMap() {
@@ -148,33 +147,13 @@ function getAssetGraph(serializedGraph, options) {
148
147
  } else if (node.type === 'asset') {
149
148
  let asset = node.value;
150
149
  let id = asset.id;
150
+ asset.committed = true;
151
+ asset.contentKey = id;
152
+ asset.env.id = getEnvId(asset.env);
151
153
  asset.meta.id = id;
152
- asset = {
153
- ...asset,
154
- uniqueKey: asset.uniqueKey ?? undefined,
155
- pipeline: asset.pipeline ?? undefined,
156
- range: asset.range ?? undefined,
157
- resolveFrom: asset.resolveFrom ?? undefined,
158
- target: asset.target ?? undefined,
159
- plugin: asset.plugin ?? undefined,
160
- query: asset.query ?? undefined,
161
- configPath: asset.configPath ?? undefined,
162
- configKeyPath: asset.configKeyPath ?? undefined,
163
- isLargeBlob: asset.isLargeBlob ?? false,
164
- isSource: asset.isSource ?? false,
165
- sourcePath: asset.sourcePath ?? undefined,
166
- env: {
167
- ...asset.env,
168
- loc: asset.env.loc ?? undefined,
169
- id: getEnvId(asset.env),
170
- sourceType: asset.env.sourceType
171
- },
172
- bundleBehavior: asset.bundleBehavior === 255 ? null : asset.bundleBehavior,
173
- committed: true,
174
- contentKey: id,
175
- filePath: (0, _projectPath.toProjectPath)(options.projectRoot, asset.filePath),
176
- symbols: asset.symbols != null ? new Map(asset.symbols.map(mapSymbols)) : null
177
- };
154
+ if (asset.symbols != null) {
155
+ asset.symbols = new Map(asset.symbols.map(mapSymbols));
156
+ }
178
157
  if (asset.map) {
179
158
  let mapKey = (0, _rust().hashString)(`${_constants.ATLASPACK_VERSION}:map:${asset.id}`);
180
159
  let sourceMap = new (_sourceMap().default)(options.projectRoot);
@@ -194,35 +173,18 @@ function getAssetGraph(serializedGraph, options) {
194
173
  value: asset
195
174
  });
196
175
  } else if (node.type === 'dependency') {
197
- var _dependency$symbols;
198
176
  let id = node.value.id;
199
177
  let dependency = node.value.dependency;
200
- dependency = {
201
- ...dependency,
202
- id,
203
- env: {
204
- ...dependency.env,
205
- id: getEnvId(dependency.env),
206
- sourceType: dependency.env.sourceType,
207
- loc: dependency.env.loc ?? undefined
208
- },
209
- pipeline: dependency.pipeline ?? undefined,
210
- range: dependency.range ?? undefined,
211
- resolveFrom: dependency.resolveFrom ?? undefined,
212
- target: dependency.target ?? undefined,
213
- bundleBehavior: dependency.bundleBehavior === 255 ? null : dependency.bundleBehavior,
214
- contentKey: id,
215
- loc: dependency.loc ? {
216
- ...dependency.loc,
217
- filePath: (0, _projectPath.toProjectPath)(options.projectRoot, dependency.loc.filePath)
218
- } : undefined,
219
- sourcePath: dependency.sourcePath ? (0, _projectPath.toProjectPath)(options.projectRoot, dependency.sourcePath) : undefined,
220
- symbols:
221
- // Dependency.symbols are always set to an empty map when scope hoisting
222
- // is enabled. Some tests will fail if this is not the case. We should
223
- // make this consistant when we re-visit packaging.
224
- dependency.symbols != null || dependency.env.shouldScopeHoist ? new Map((_dependency$symbols = dependency.symbols) === null || _dependency$symbols === void 0 ? void 0 : _dependency$symbols.map(mapSymbols)) : undefined
225
- };
178
+ dependency.id = id;
179
+ dependency.env.id = getEnvId(dependency.env);
180
+
181
+ // Dependency.symbols are always set to an empty map when scope hoisting
182
+ // is enabled. Some tests will fail if this is not the case. We should
183
+ // make this consistant when we re-visit packaging.
184
+ if (dependency.symbols != null || dependency.env.shouldScopeHoist) {
185
+ var _dependency$symbols;
186
+ dependency.symbols = new Map((_dependency$symbols = dependency.symbols) === null || _dependency$symbols === void 0 ? void 0 : _dependency$symbols.map(mapSymbols));
187
+ }
226
188
  let usedSymbolsDown = new Set();
227
189
  let usedSymbolsUp = new Map();
228
190
  if (dependency.isEntry && dependency.isLibrary) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/core",
3
- "version": "2.12.1-canary.3527+3766d627c",
3
+ "version": "2.12.1-canary.3530+52a1243ea",
4
4
  "license": "(MIT OR Apache-2.0)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -20,21 +20,21 @@
20
20
  "check-ts": "tsc --noEmit index.d.ts"
21
21
  },
22
22
  "dependencies": {
23
- "@atlaspack/build-cache": "2.12.1-canary.3527+3766d627c",
24
- "@atlaspack/cache": "2.12.1-canary.3527+3766d627c",
25
- "@atlaspack/diagnostic": "2.12.1-canary.3527+3766d627c",
26
- "@atlaspack/events": "2.12.1-canary.3527+3766d627c",
27
- "@atlaspack/feature-flags": "2.12.1-canary.3527+3766d627c",
28
- "@atlaspack/fs": "2.12.1-canary.3527+3766d627c",
29
- "@atlaspack/graph": "3.2.1-canary.3527+3766d627c",
30
- "@atlaspack/logger": "2.12.1-canary.3527+3766d627c",
31
- "@atlaspack/package-manager": "2.12.1-canary.3527+3766d627c",
32
- "@atlaspack/plugin": "2.12.1-canary.3527+3766d627c",
33
- "@atlaspack/profiler": "2.12.1-canary.3527+3766d627c",
34
- "@atlaspack/rust": "2.12.1-canary.3527+3766d627c",
35
- "@atlaspack/types": "2.12.1-canary.3527+3766d627c",
36
- "@atlaspack/utils": "2.12.1-canary.3527+3766d627c",
37
- "@atlaspack/workers": "2.12.1-canary.3527+3766d627c",
23
+ "@atlaspack/build-cache": "2.12.1-canary.3530+52a1243ea",
24
+ "@atlaspack/cache": "2.12.1-canary.3530+52a1243ea",
25
+ "@atlaspack/diagnostic": "2.12.1-canary.3530+52a1243ea",
26
+ "@atlaspack/events": "2.12.1-canary.3530+52a1243ea",
27
+ "@atlaspack/feature-flags": "2.12.1-canary.3530+52a1243ea",
28
+ "@atlaspack/fs": "2.12.1-canary.3530+52a1243ea",
29
+ "@atlaspack/graph": "3.2.1-canary.3530+52a1243ea",
30
+ "@atlaspack/logger": "2.12.1-canary.3530+52a1243ea",
31
+ "@atlaspack/package-manager": "2.12.1-canary.3530+52a1243ea",
32
+ "@atlaspack/plugin": "2.12.1-canary.3530+52a1243ea",
33
+ "@atlaspack/profiler": "2.12.1-canary.3530+52a1243ea",
34
+ "@atlaspack/rust": "2.12.1-canary.3530+52a1243ea",
35
+ "@atlaspack/types": "2.12.1-canary.3530+52a1243ea",
36
+ "@atlaspack/utils": "2.12.1-canary.3530+52a1243ea",
37
+ "@atlaspack/workers": "2.12.1-canary.3530+52a1243ea",
38
38
  "@mischnic/json-sourcemap": "^0.1.0",
39
39
  "@parcel/source-map": "^2.1.1",
40
40
  "base-x": "^3.0.8",
@@ -66,5 +66,5 @@
66
66
  "browser": {
67
67
  "./src/serializerCore.js": "./src/serializerCore.browser.js"
68
68
  },
69
- "gitHead": "3766d627cee17159b930f3117730d214c4774152"
69
+ "gitHead": "52a1243ea1791fd2d7682e32947ffa894ca9668e"
70
70
  }
@@ -9,7 +9,6 @@ import type {Async} from '@atlaspack/types';
9
9
  import AssetGraph, {nodeFromAssetGroup} from '../AssetGraph';
10
10
  import type {AtlaspackV3} from '../atlaspack-v3';
11
11
  import {ATLASPACK_VERSION} from '../constants';
12
- import {toProjectPath} from '../projectPath';
13
12
  import {requestTypes, type StaticRunOpts} from '../RequestTracker';
14
13
  import {propagateSymbols} from '../SymbolPropagation';
15
14
  import type {Environment} from '../types';
@@ -166,36 +165,13 @@ function getAssetGraph(serializedGraph, options) {
166
165
  let asset = node.value;
167
166
  let id = asset.id;
168
167
 
168
+ asset.committed = true;
169
+ asset.contentKey = id;
170
+ asset.env.id = getEnvId(asset.env);
169
171
  asset.meta.id = id;
170
-
171
- asset = {
172
- ...asset,
173
- uniqueKey: asset.uniqueKey ?? undefined,
174
- pipeline: asset.pipeline ?? undefined,
175
- range: asset.range ?? undefined,
176
- resolveFrom: asset.resolveFrom ?? undefined,
177
- target: asset.target ?? undefined,
178
- plugin: asset.plugin ?? undefined,
179
- query: asset.query ?? undefined,
180
- configPath: asset.configPath ?? undefined,
181
- configKeyPath: asset.configKeyPath ?? undefined,
182
- isLargeBlob: asset.isLargeBlob ?? false,
183
- isSource: asset.isSource ?? false,
184
- sourcePath: asset.sourcePath ?? undefined,
185
- env: {
186
- ...asset.env,
187
- loc: asset.env.loc ?? undefined,
188
- id: getEnvId(asset.env),
189
- sourceType: asset.env.sourceType,
190
- },
191
- bundleBehavior:
192
- asset.bundleBehavior === 255 ? null : asset.bundleBehavior,
193
- committed: true,
194
- contentKey: id,
195
- filePath: toProjectPath(options.projectRoot, asset.filePath),
196
- symbols:
197
- asset.symbols != null ? new Map(asset.symbols.map(mapSymbols)) : null,
198
- };
172
+ if (asset.symbols != null) {
173
+ asset.symbols = new Map(asset.symbols.map(mapSymbols));
174
+ }
199
175
 
200
176
  if (asset.map) {
201
177
  let mapKey = hashString(`${ATLASPACK_VERSION}:map:${asset.id}`);
@@ -222,42 +198,16 @@ function getAssetGraph(serializedGraph, options) {
222
198
  let id = node.value.id;
223
199
  let dependency = node.value.dependency;
224
200
 
225
- dependency = {
226
- ...dependency,
227
- id,
228
- env: {
229
- ...dependency.env,
230
- id: getEnvId(dependency.env),
231
- sourceType: dependency.env.sourceType,
232
- loc: dependency.env.loc ?? undefined,
233
- },
234
- pipeline: dependency.pipeline ?? undefined,
235
- range: dependency.range ?? undefined,
236
- resolveFrom: dependency.resolveFrom ?? undefined,
237
- target: dependency.target ?? undefined,
238
- bundleBehavior:
239
- dependency.bundleBehavior === 255 ? null : dependency.bundleBehavior,
240
- contentKey: id,
241
- loc: dependency.loc
242
- ? {
243
- ...dependency.loc,
244
- filePath: toProjectPath(
245
- options.projectRoot,
246
- dependency.loc.filePath,
247
- ),
248
- }
249
- : undefined,
250
- sourcePath: dependency.sourcePath
251
- ? toProjectPath(options.projectRoot, dependency.sourcePath)
252
- : undefined,
253
- symbols:
254
- // Dependency.symbols are always set to an empty map when scope hoisting
255
- // is enabled. Some tests will fail if this is not the case. We should
256
- // make this consistant when we re-visit packaging.
257
- dependency.symbols != null || dependency.env.shouldScopeHoist
258
- ? new Map(dependency.symbols?.map(mapSymbols))
259
- : undefined,
260
- };
201
+ dependency.id = id;
202
+ dependency.env.id = getEnvId(dependency.env);
203
+
204
+ // Dependency.symbols are always set to an empty map when scope hoisting
205
+ // is enabled. Some tests will fail if this is not the case. We should
206
+ // make this consistant when we re-visit packaging.
207
+ if (dependency.symbols != null || dependency.env.shouldScopeHoist) {
208
+ dependency.symbols = new Map(dependency.symbols?.map(mapSymbols));
209
+ }
210
+
261
211
  let usedSymbolsDown = new Set();
262
212
  let usedSymbolsUp = new Map();
263
213
  if (dependency.isEntry && dependency.isLibrary) {