@atlaspack/core 2.28.0 → 2.29.1

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.
@@ -31,97 +31,16 @@ describe('AssetGraphRequestRust -> getAssetGraph', function () {
31
31
  });
32
32
 
33
33
  function getSerializedGraph() {
34
- return {
35
- edges: [0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6],
36
- nodes: [
37
- {
38
- type: 'root',
39
- },
40
- {
41
- type: 'dependency',
42
- value: {
43
- id: 'b01a088f112fa82f',
44
- dependency: {
45
- bundleBehavior: null,
46
- env: structuredClone(
47
- fromEnvironmentId(
48
- createEnvironment({
49
- context: 'browser',
50
- engines: {
51
- browsers: [
52
- 'last 1 Chrome version',
53
- 'last 1 Safari version',
54
- 'last 1 Firefox version',
55
- 'last 1 Edge version',
56
- ],
57
- },
58
- includeNodeModules: true,
59
- isLibrary: false,
60
- loc: null,
61
- outputFormat: 'global',
62
- shouldScopeHoist: true,
63
- shouldOptimize: false,
64
- sourceMap: {},
65
- sourceType: 'module',
66
- }),
67
- ),
68
- ),
69
- loc: null,
70
- meta: {},
71
- pipeline: null,
72
- priority: 0,
73
- range: null,
74
- resolveFrom: null,
75
- sourceAssetId: null,
76
- sourcePath: null,
77
- specifier: '/index.html',
78
- specifierType: 2,
79
- symbols: null,
80
- target: {
81
- distDir: '/dist',
82
- distEntry: null,
83
- env: structuredClone(
84
- fromEnvironmentId(
85
- createEnvironment({
86
- context: 'browser',
87
- engines: {
88
- browsers: [
89
- 'last 1 Chrome version',
90
- 'last 1 Safari version',
91
- 'last 1 Firefox version',
92
- 'last 1 Edge version',
93
- ],
94
- },
95
- includeNodeModules: true,
96
- isLibrary: false,
97
- loc: null,
98
- outputFormat: 'global',
99
- shouldScopeHoist: true,
100
- shouldOptimize: false,
101
- sourceMap: {},
102
- sourceType: 'module',
103
- }),
104
- ),
105
- ),
106
- loc: null,
107
- name: 'default',
108
- publicUrl: '/',
109
- },
110
- isEntry: true,
111
- isOptional: false,
112
- needsStableName: true,
113
- shouldWrap: false,
114
- isEsm: false,
115
- placeholder: null,
116
- },
117
- },
118
- has_deferred: false,
119
- },
120
- {
121
- type: 'asset',
122
- value: {
123
- id: 'e2056518260d7dc7',
124
- bundleBehavior: 1,
34
+ let nodes = [
35
+ {
36
+ type: 'root',
37
+ },
38
+ {
39
+ type: 'dependency',
40
+ value: {
41
+ id: 'b01a088f112fa82f',
42
+ dependency: {
43
+ bundleBehavior: null,
125
44
  env: structuredClone(
126
45
  fromEnvironmentId(
127
46
  createEnvironment({
@@ -145,35 +64,20 @@ function getSerializedGraph() {
145
64
  }),
146
65
  ),
147
66
  ),
148
- filePath: '/index.html',
149
- type: 'html',
67
+ loc: null,
150
68
  meta: {},
151
69
  pipeline: null,
152
- query: null,
153
- stats: {
154
- size: 93,
155
- time: 2,
156
- },
70
+ priority: 0,
71
+ range: null,
72
+ resolveFrom: null,
73
+ sourceAssetId: null,
74
+ sourcePath: null,
75
+ specifier: '/index.html',
76
+ specifierType: 2,
157
77
  symbols: null,
158
- sideEffects: true,
159
- isBundleSplittable: true,
160
- isSource: true,
161
- hasCjsExports: false,
162
- staticExports: false,
163
- shouldWrap: false,
164
- hasNodeReplacements: false,
165
- isConstantModule: false,
166
- conditions: [],
167
- configPath: null,
168
- configKeyPath: null,
169
- },
170
- },
171
- {
172
- type: 'dependency',
173
- value: {
174
- id: 'aece0f57a78d1ef8',
175
- dependency: {
176
- bundleBehavior: null,
78
+ target: {
79
+ distDir: '/dist',
80
+ distEntry: null,
177
81
  env: structuredClone(
178
82
  fromEnvironmentId(
179
83
  createEnvironment({
@@ -189,7 +93,7 @@ function getSerializedGraph() {
189
93
  includeNodeModules: true,
190
94
  isLibrary: false,
191
95
  loc: null,
192
- outputFormat: 'esmodule',
96
+ outputFormat: 'global',
193
97
  shouldScopeHoist: true,
194
98
  shouldOptimize: false,
195
99
  sourceMap: {},
@@ -198,32 +102,75 @@ function getSerializedGraph() {
198
102
  ),
199
103
  ),
200
104
  loc: null,
201
- meta: {},
202
- pipeline: null,
203
- priority: 1,
204
- range: null,
205
- resolveFrom: null,
206
- sourceAssetId: 'e2056518260d7dc7',
207
- sourcePath: '/index.html',
208
- specifier: './index.ts',
209
- specifierType: 2,
210
- sourceAssetType: 'html',
211
- symbols: null,
212
- target: null,
213
- isEntry: false,
214
- isOptional: false,
215
- needsStableName: false,
216
- shouldWrap: false,
217
- isEsm: true,
218
- placeholder: null,
105
+ name: 'default',
106
+ publicUrl: '/',
219
107
  },
108
+ isEntry: true,
109
+ isOptional: false,
110
+ needsStableName: true,
111
+ shouldWrap: false,
112
+ isEsm: false,
113
+ placeholder: null,
114
+ },
115
+ },
116
+ has_deferred: false,
117
+ },
118
+ {
119
+ type: 'asset',
120
+ value: {
121
+ id: 'e2056518260d7dc7',
122
+ bundleBehavior: 1,
123
+ env: structuredClone(
124
+ fromEnvironmentId(
125
+ createEnvironment({
126
+ context: 'browser',
127
+ engines: {
128
+ browsers: [
129
+ 'last 1 Chrome version',
130
+ 'last 1 Safari version',
131
+ 'last 1 Firefox version',
132
+ 'last 1 Edge version',
133
+ ],
134
+ },
135
+ includeNodeModules: true,
136
+ isLibrary: false,
137
+ loc: null,
138
+ outputFormat: 'global',
139
+ shouldScopeHoist: true,
140
+ shouldOptimize: false,
141
+ sourceMap: {},
142
+ sourceType: 'module',
143
+ }),
144
+ ),
145
+ ),
146
+ filePath: '/index.html',
147
+ type: 'html',
148
+ meta: {},
149
+ pipeline: null,
150
+ query: null,
151
+ stats: {
152
+ size: 93,
153
+ time: 2,
220
154
  },
221
- has_deferred: false,
155
+ symbols: null,
156
+ sideEffects: true,
157
+ isBundleSplittable: true,
158
+ isSource: true,
159
+ hasCjsExports: false,
160
+ staticExports: false,
161
+ shouldWrap: false,
162
+ hasNodeReplacements: false,
163
+ isConstantModule: false,
164
+ conditions: [],
165
+ configPath: null,
166
+ configKeyPath: null,
222
167
  },
223
- {
224
- type: 'asset',
225
- value: {
226
- id: '79c128d4f549c408',
168
+ },
169
+ {
170
+ type: 'dependency',
171
+ value: {
172
+ id: 'aece0f57a78d1ef8',
173
+ dependency: {
227
174
  bundleBehavior: null,
228
175
  env: structuredClone(
229
176
  fromEnvironmentId(
@@ -248,122 +195,90 @@ function getSerializedGraph() {
248
195
  }),
249
196
  ),
250
197
  ),
251
- filePath: '/index.ts',
252
- type: 'js',
253
- meta: {
254
- hasCJSExports: false,
255
- staticExports: true,
256
- shouldWrap: false,
257
- id: 'cc346b5b74d3d478',
258
- },
198
+ loc: null,
199
+ meta: {},
259
200
  pipeline: null,
260
- query: null,
261
- stats: {
262
- size: 121,
263
- time: 39,
264
- },
265
- symbols: [],
266
- sideEffects: true,
267
- isBundleSplittable: true,
268
- isSource: true,
269
- hasCjsExports: false,
270
- staticExports: true,
201
+ priority: 1,
202
+ range: null,
203
+ resolveFrom: null,
204
+ sourceAssetId: 'e2056518260d7dc7',
205
+ sourcePath: '/index.html',
206
+ specifier: './index.ts',
207
+ specifierType: 2,
208
+ sourceAssetType: 'html',
209
+ symbols: null,
210
+ target: null,
211
+ isEntry: false,
212
+ isOptional: false,
213
+ needsStableName: false,
271
214
  shouldWrap: false,
272
- hasNodeReplacements: false,
273
- isConstantModule: false,
274
- conditions: [],
275
- configPath: null,
276
- configKeyPath: null,
215
+ isEsm: true,
216
+ placeholder: null,
277
217
  },
278
218
  },
279
- {
280
- type: 'dependency',
281
- value: {
282
- id: 'cfe74f65a41af1a7',
283
- dependency: {
284
- bundleBehavior: null,
285
- env: structuredClone(
286
- fromEnvironmentId(
287
- createEnvironment({
288
- context: 'browser',
289
- engines: {
290
- browsers: [
291
- 'last 1 Chrome version',
292
- 'last 1 Safari version',
293
- 'last 1 Firefox version',
294
- 'last 1 Edge version',
295
- ],
296
- },
297
- includeNodeModules: true,
298
- isLibrary: false,
299
- loc: null,
300
- outputFormat: 'esmodule',
301
- shouldScopeHoist: true,
302
- shouldOptimize: false,
303
- sourceMap: {},
304
- sourceType: 'module',
305
- }),
306
- ),
307
- ),
308
- loc: {
309
- filePath: '/index.ts',
310
- start: {
311
- line: 1,
312
- column: 21,
313
- },
314
- end: {
315
- line: 1,
316
- column: 32,
219
+ has_deferred: false,
220
+ },
221
+ {
222
+ type: 'asset',
223
+ value: {
224
+ id: '79c128d4f549c408',
225
+ bundleBehavior: null,
226
+ env: structuredClone(
227
+ fromEnvironmentId(
228
+ createEnvironment({
229
+ context: 'browser',
230
+ engines: {
231
+ browsers: [
232
+ 'last 1 Chrome version',
233
+ 'last 1 Safari version',
234
+ 'last 1 Firefox version',
235
+ 'last 1 Edge version',
236
+ ],
317
237
  },
318
- },
319
- meta: {
320
- kind: 'Import',
321
- },
322
- pipeline: null,
323
- priority: 0,
324
- range: null,
325
- resolveFrom: null,
326
- sourceAssetId: 'cc346b5b74d3d478',
327
- sourcePath: '/index.ts',
328
- specifier: './library',
329
- specifierType: 0,
330
- sourceAssetType: 'ts',
331
- symbols: [
332
- {
333
- local:
334
- '$cc346b5b74d3d478$import$b83d1a328c413a1a$2e2bcd8739ae039',
335
- exported: 'default',
336
- loc: {
337
- filePath: '/index.ts',
338
- start: {
339
- line: 1,
340
- column: 8,
341
- },
342
- end: {
343
- line: 1,
344
- column: 15,
345
- },
346
- },
347
- isWeak: false,
348
- isEsmExport: false,
349
- selfReferenced: false,
350
- },
351
- ],
352
- target: null,
353
- isEntry: false,
354
- isOptional: false,
355
- needsStableName: false,
356
- shouldWrap: false,
357
- isEsm: true,
358
- placeholder: null,
359
- },
238
+ includeNodeModules: true,
239
+ isLibrary: false,
240
+ loc: null,
241
+ outputFormat: 'esmodule',
242
+ shouldScopeHoist: true,
243
+ shouldOptimize: false,
244
+ sourceMap: {},
245
+ sourceType: 'module',
246
+ }),
247
+ ),
248
+ ),
249
+ filePath: '/index.ts',
250
+ type: 'js',
251
+ meta: {
252
+ hasCJSExports: false,
253
+ staticExports: true,
254
+ shouldWrap: false,
255
+ id: 'cc346b5b74d3d478',
360
256
  },
361
- has_deferred: false,
257
+ pipeline: null,
258
+ query: null,
259
+ stats: {
260
+ size: 121,
261
+ time: 39,
262
+ },
263
+ symbols: [],
264
+ sideEffects: true,
265
+ isBundleSplittable: true,
266
+ isSource: true,
267
+ hasCjsExports: false,
268
+ staticExports: true,
269
+ shouldWrap: false,
270
+ hasNodeReplacements: false,
271
+ isConstantModule: false,
272
+ conditions: [],
273
+ configPath: null,
274
+ configKeyPath: null,
362
275
  },
363
- {
364
- type: 'asset',
365
- value: {
366
- id: '13fc7969eb974fe3',
276
+ },
277
+ {
278
+ type: 'dependency',
279
+ value: {
280
+ id: 'cfe74f65a41af1a7',
281
+ dependency: {
367
282
  bundleBehavior: null,
368
283
  env: structuredClone(
369
284
  fromEnvironmentId(
@@ -388,54 +303,141 @@ function getSerializedGraph() {
388
303
  }),
389
304
  ),
390
305
  ),
391
- filePath: '/library.ts',
392
- type: 'js',
306
+ loc: {
307
+ filePath: '/index.ts',
308
+ start: {
309
+ line: 1,
310
+ column: 21,
311
+ },
312
+ end: {
313
+ line: 1,
314
+ column: 32,
315
+ },
316
+ },
393
317
  meta: {
394
- hasCJSExports: false,
395
- staticExports: true,
396
- shouldWrap: false,
397
- id: '579fff58dabc69a5',
318
+ kind: 'Import',
398
319
  },
399
320
  pipeline: null,
400
- query: null,
401
- stats: {
402
- size: 58,
403
- time: 1,
404
- },
321
+ priority: 0,
322
+ range: null,
323
+ resolveFrom: null,
324
+ sourceAssetId: 'cc346b5b74d3d478',
325
+ sourcePath: '/index.ts',
326
+ specifier: './library',
327
+ specifierType: 0,
328
+ sourceAssetType: 'ts',
405
329
  symbols: [
406
330
  {
407
- local: '$579fff58dabc69a5$export$2e2bcd8739ae039',
331
+ local:
332
+ '$cc346b5b74d3d478$import$b83d1a328c413a1a$2e2bcd8739ae039',
408
333
  exported: 'default',
409
334
  loc: {
410
- filePath: '/library.ts',
335
+ filePath: '/index.ts',
411
336
  start: {
412
337
  line: 1,
413
- column: 1,
338
+ column: 8,
414
339
  },
415
340
  end: {
416
341
  line: 1,
417
- column: 26,
342
+ column: 15,
418
343
  },
419
344
  },
420
345
  isWeak: false,
421
- isEsmExport: true,
346
+ isEsmExport: false,
422
347
  selfReferenced: false,
423
348
  },
424
349
  ],
425
- sideEffects: true,
426
- isBundleSplittable: true,
427
- isSource: true,
428
- hasCjsExports: false,
350
+ target: null,
351
+ isEntry: false,
352
+ isOptional: false,
353
+ needsStableName: false,
354
+ shouldWrap: false,
355
+ isEsm: true,
356
+ placeholder: null,
357
+ },
358
+ },
359
+ has_deferred: false,
360
+ },
361
+ {
362
+ type: 'asset',
363
+ value: {
364
+ id: '13fc7969eb974fe3',
365
+ bundleBehavior: null,
366
+ env: structuredClone(
367
+ fromEnvironmentId(
368
+ createEnvironment({
369
+ context: 'browser',
370
+ engines: {
371
+ browsers: [
372
+ 'last 1 Chrome version',
373
+ 'last 1 Safari version',
374
+ 'last 1 Firefox version',
375
+ 'last 1 Edge version',
376
+ ],
377
+ },
378
+ includeNodeModules: true,
379
+ isLibrary: false,
380
+ loc: null,
381
+ outputFormat: 'esmodule',
382
+ shouldScopeHoist: true,
383
+ shouldOptimize: false,
384
+ sourceMap: {},
385
+ sourceType: 'module',
386
+ }),
387
+ ),
388
+ ),
389
+ filePath: '/library.ts',
390
+ type: 'js',
391
+ meta: {
392
+ hasCJSExports: false,
429
393
  staticExports: true,
430
394
  shouldWrap: false,
431
- hasNodeReplacements: false,
432
- isConstantModule: false,
433
- conditions: [],
434
- configPath: null,
435
- configKeyPath: null,
395
+ id: '579fff58dabc69a5',
396
+ },
397
+ pipeline: null,
398
+ query: null,
399
+ stats: {
400
+ size: 58,
401
+ time: 1,
436
402
  },
403
+ symbols: [
404
+ {
405
+ local: '$579fff58dabc69a5$export$2e2bcd8739ae039',
406
+ exported: 'default',
407
+ loc: {
408
+ filePath: '/library.ts',
409
+ start: {
410
+ line: 1,
411
+ column: 1,
412
+ },
413
+ end: {
414
+ line: 1,
415
+ column: 26,
416
+ },
417
+ },
418
+ isWeak: false,
419
+ isEsmExport: true,
420
+ selfReferenced: false,
421
+ },
422
+ ],
423
+ sideEffects: true,
424
+ isBundleSplittable: true,
425
+ isSource: true,
426
+ hasCjsExports: false,
427
+ staticExports: true,
428
+ shouldWrap: false,
429
+ hasNodeReplacements: false,
430
+ isConstantModule: false,
431
+ conditions: [],
432
+ configPath: null,
433
+ configKeyPath: null,
437
434
  },
438
- ],
435
+ },
436
+ ];
437
+
438
+ return {
439
+ edges: [0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6],
440
+ nodes: nodes.map((n) => JSON.stringify(n)),
439
441
  updates: [],
440
442
  };
441
443
  }