@atlaspack/core 2.23.2-dev-inline-requires-reuse-bdc9ca9c3.0 → 2.23.3-inline-requires-take-2-2a0c642df.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.
@@ -6,6 +6,7 @@ import {md} from '@atlaspack/diagnostic';
6
6
  import {normalizeSeparators} from '@atlaspack/utils';
7
7
  import {TargetResolver} from '../src/requests/TargetRequest';
8
8
  import {DEFAULT_OPTIONS as _DEFAULT_OPTIONS, relative} from './test-utils';
9
+ import {createEnvironment} from '../src/Environment';
9
10
 
10
11
  const DEFAULT_OPTIONS = {
11
12
  ..._DEFAULT_OPTIONS,
@@ -122,8 +123,7 @@ describe('TargetResolver', () => {
122
123
  name: 'customA',
123
124
  publicUrl: '/',
124
125
  distDir: normalizeSeparators(path.resolve('customA')),
125
- env: {
126
- id: 'd821e85f6b50315e',
126
+ env: createEnvironment({
127
127
  context: 'browser',
128
128
  includeNodeModules: true,
129
129
  engines: {
@@ -137,15 +137,14 @@ describe('TargetResolver', () => {
137
137
  loc: undefined,
138
138
  sourceType: 'module',
139
139
  unstableSingleFileOutput: false,
140
- },
140
+ }),
141
141
  },
142
142
  {
143
143
  name: 'customB',
144
144
  publicUrl: '/',
145
145
  distEntry: 'b.js',
146
146
  distDir: normalizeSeparators(path.resolve('customB')),
147
- env: {
148
- id: 'e45cc12216f7857d',
147
+ env: createEnvironment({
149
148
  context: 'node',
150
149
  includeNodeModules: false,
151
150
  engines: {
@@ -159,7 +158,7 @@ describe('TargetResolver', () => {
159
158
  loc: undefined,
160
159
  sourceType: 'module',
161
160
  unstableSingleFileOutput: false,
162
- },
161
+ }),
163
162
  },
164
163
  ],
165
164
  );
@@ -176,8 +175,7 @@ describe('TargetResolver', () => {
176
175
  distDir: 'fixtures/common-targets/dist/main',
177
176
  distEntry: 'index.js',
178
177
  publicUrl: '/',
179
- env: {
180
- id: 'f628a18b9d37974c',
178
+ env: createEnvironment({
181
179
  context: 'node',
182
180
  engines: {
183
181
  node: '>= 8.0.0',
@@ -191,7 +189,7 @@ describe('TargetResolver', () => {
191
189
  loc: undefined,
192
190
  sourceType: 'module',
193
191
  unstableSingleFileOutput: false,
194
- },
192
+ }),
195
193
  loc: {
196
194
  filePath: relative(
197
195
  path.join(COMMON_TARGETS_FIXTURE_PATH, 'package.json'),
@@ -211,8 +209,7 @@ describe('TargetResolver', () => {
211
209
  distDir: 'fixtures/common-targets/dist/module',
212
210
  distEntry: 'index.js',
213
211
  publicUrl: '/',
214
- env: {
215
- id: 'f9afb61b20ba7ecf',
212
+ env: createEnvironment({
216
213
  context: 'browser',
217
214
  engines: {
218
215
  browsers: ['last 1 version'],
@@ -228,7 +225,7 @@ describe('TargetResolver', () => {
228
225
  loc: undefined,
229
226
  sourceType: 'module',
230
227
  unstableSingleFileOutput: false,
231
- },
228
+ }),
232
229
  loc: {
233
230
  filePath: relative(
234
231
  path.join(COMMON_TARGETS_FIXTURE_PATH, 'package.json'),
@@ -248,8 +245,7 @@ describe('TargetResolver', () => {
248
245
  distDir: 'fixtures/common-targets/dist/browser',
249
246
  distEntry: 'index.js',
250
247
  publicUrl: '/assets',
251
- env: {
252
- id: '7c0fe07c8a3a38da',
248
+ env: createEnvironment({
253
249
  context: 'browser',
254
250
  engines: {
255
251
  browsers: ['last 1 version'],
@@ -263,7 +259,7 @@ describe('TargetResolver', () => {
263
259
  loc: undefined,
264
260
  sourceType: 'module',
265
261
  unstableSingleFileOutput: false,
266
- },
262
+ }),
267
263
  loc: {
268
264
  filePath: relative(
269
265
  path.join(COMMON_TARGETS_FIXTURE_PATH, 'package.json'),
@@ -295,8 +291,7 @@ describe('TargetResolver', () => {
295
291
  ),
296
292
  distEntry: 'index.js',
297
293
  publicUrl: '/',
298
- env: {
299
- id: 'e45cc12216f7857d',
294
+ env: createEnvironment({
300
295
  context: 'node',
301
296
  engines: {
302
297
  node: '>= 8.0.0',
@@ -310,7 +305,7 @@ describe('TargetResolver', () => {
310
305
  loc: undefined,
311
306
  sourceType: 'module',
312
307
  unstableSingleFileOutput: false,
313
- },
308
+ }),
314
309
  loc: {
315
310
  filePath: relative(
316
311
  path.join(COMMON_TARGETS_IGNORE_FIXTURE_PATH, 'package.json'),
@@ -339,8 +334,7 @@ describe('TargetResolver', () => {
339
334
  distDir: 'fixtures/custom-targets/dist/main',
340
335
  distEntry: 'index.js',
341
336
  publicUrl: '/',
342
- env: {
343
- id: 'f628a18b9d37974c',
337
+ env: createEnvironment({
344
338
  context: 'node',
345
339
  engines: {
346
340
  node: '>= 8.0.0',
@@ -354,7 +348,7 @@ describe('TargetResolver', () => {
354
348
  loc: undefined,
355
349
  sourceType: 'module',
356
350
  unstableSingleFileOutput: false,
357
- },
351
+ }),
358
352
  loc: {
359
353
  filePath: relative(
360
354
  path.join(CUSTOM_TARGETS_FIXTURE_PATH, 'package.json'),
@@ -374,8 +368,7 @@ describe('TargetResolver', () => {
374
368
  distDir: 'fixtures/custom-targets/dist/browserModern',
375
369
  distEntry: 'index.js',
376
370
  publicUrl: '/',
377
- env: {
378
- id: '75603271034eff15',
371
+ env: createEnvironment({
379
372
  context: 'browser',
380
373
  engines: {
381
374
  browsers: ['last 1 version'],
@@ -389,7 +382,7 @@ describe('TargetResolver', () => {
389
382
  loc: undefined,
390
383
  sourceType: 'module',
391
384
  unstableSingleFileOutput: false,
392
- },
385
+ }),
393
386
  loc: {
394
387
  filePath: relative(
395
388
  path.join(CUSTOM_TARGETS_FIXTURE_PATH, 'package.json'),
@@ -409,8 +402,7 @@ describe('TargetResolver', () => {
409
402
  distDir: 'fixtures/custom-targets/dist/browserLegacy',
410
403
  distEntry: 'index.js',
411
404
  publicUrl: '/',
412
- env: {
413
- id: 'a8f05066473f62d0',
405
+ env: createEnvironment({
414
406
  context: 'browser',
415
407
  engines: {
416
408
  browsers: ['ie11'],
@@ -424,7 +416,7 @@ describe('TargetResolver', () => {
424
416
  loc: undefined,
425
417
  sourceType: 'module',
426
418
  unstableSingleFileOutput: false,
427
- },
419
+ }),
428
420
  loc: {
429
421
  filePath: relative(
430
422
  path.join(CUSTOM_TARGETS_FIXTURE_PATH, 'package.json'),
@@ -461,8 +453,7 @@ describe('TargetResolver', () => {
461
453
  distDir: 'fixtures/custom-targets/dist/main',
462
454
  distEntry: 'index.js',
463
455
  publicUrl: '/',
464
- env: {
465
- id: 'f628a18b9d37974c',
456
+ env: createEnvironment({
466
457
  context: 'node',
467
458
  engines: {
468
459
  node: '>= 8.0.0',
@@ -476,7 +467,7 @@ describe('TargetResolver', () => {
476
467
  loc: undefined,
477
468
  sourceType: 'module',
478
469
  unstableSingleFileOutput: false,
479
- },
470
+ }),
480
471
  loc: {
481
472
  filePath: relative(
482
473
  path.join(CUSTOM_TARGETS_FIXTURE_PATH, 'package.json'),
@@ -496,8 +487,7 @@ describe('TargetResolver', () => {
496
487
  distDir: 'fixtures/custom-targets/dist/browserModern',
497
488
  distEntry: 'index.js',
498
489
  publicUrl: '/',
499
- env: {
500
- id: '8a530881a691863e',
490
+ env: createEnvironment({
501
491
  context: 'browser',
502
492
  engines: {
503
493
  browsers: ['last 1 version'],
@@ -511,7 +501,7 @@ describe('TargetResolver', () => {
511
501
  loc: undefined,
512
502
  sourceType: 'module',
513
503
  unstableSingleFileOutput: false,
514
- },
504
+ }),
515
505
  loc: {
516
506
  filePath: relative(
517
507
  path.join(CUSTOM_TARGETS_FIXTURE_PATH, 'package.json'),
@@ -531,8 +521,7 @@ describe('TargetResolver', () => {
531
521
  distDir: 'fixtures/custom-targets/dist/browserLegacy',
532
522
  distEntry: 'index.js',
533
523
  publicUrl: '/',
534
- env: {
535
- id: '4dcd5bfb2f44e1a0',
524
+ env: createEnvironment({
536
525
  context: 'browser',
537
526
  engines: {
538
527
  browsers: ['ie11'],
@@ -546,7 +535,7 @@ describe('TargetResolver', () => {
546
535
  loc: undefined,
547
536
  sourceType: 'module',
548
537
  unstableSingleFileOutput: false,
549
- },
538
+ }),
550
539
  loc: {
551
540
  filePath: relative(
552
541
  path.join(CUSTOM_TARGETS_FIXTURE_PATH, 'package.json'),
@@ -575,8 +564,7 @@ describe('TargetResolver', () => {
575
564
  distDir: 'fixtures/custom-targets-distdir/www',
576
565
  distEntry: undefined,
577
566
  publicUrl: 'www',
578
- env: {
579
- id: '073545c36b2ddaab',
567
+ env: createEnvironment({
580
568
  context: 'browser',
581
569
  engines: {
582
570
  browsers: '> 0.25%',
@@ -590,7 +578,7 @@ describe('TargetResolver', () => {
590
578
  loc: undefined,
591
579
  sourceType: 'module',
592
580
  unstableSingleFileOutput: false,
593
- },
581
+ }),
594
582
  loc: {
595
583
  filePath: relative(
596
584
  path.join(CUSTOM_TARGETS_DISTDIR_FIXTURE_PATH, 'package.json'),
@@ -631,8 +619,7 @@ describe('TargetResolver', () => {
631
619
  name: 'customB',
632
620
  distDir: normalizeSeparators(path.resolve('customB')),
633
621
  publicUrl: '/',
634
- env: {
635
- id: 'd821e85f6b50315e',
622
+ env: createEnvironment({
636
623
  context: 'browser',
637
624
  engines: {
638
625
  browsers: ['> 0.25%'],
@@ -646,7 +633,7 @@ describe('TargetResolver', () => {
646
633
  loc: undefined,
647
634
  sourceType: 'module',
648
635
  unstableSingleFileOutput: false,
649
- },
636
+ }),
650
637
  },
651
638
  ],
652
639
  );
@@ -674,8 +661,7 @@ describe('TargetResolver', () => {
674
661
  name: 'customA',
675
662
  distDir: normalizeSeparators(path.resolve('customA')),
676
663
  publicUrl: '/',
677
- env: {
678
- id: 'd821e85f6b50315e',
664
+ env: createEnvironment({
679
665
  context: 'browser',
680
666
  engines: {
681
667
  browsers: ['> 0.25%'],
@@ -689,7 +675,7 @@ describe('TargetResolver', () => {
689
675
  loc: undefined,
690
676
  sourceType: 'module',
691
677
  unstableSingleFileOutput: false,
692
- },
678
+ }),
693
679
  source: 'customA/index.js',
694
680
  },
695
681
  ],
@@ -704,8 +690,7 @@ describe('TargetResolver', () => {
704
690
  distDir: 'fixtures/context/dist/main',
705
691
  distEntry: 'index.js',
706
692
  publicUrl: '/',
707
- env: {
708
- id: '4d60aebb4fbb9f8b',
693
+ env: createEnvironment({
709
694
  context: 'node',
710
695
  engines: {
711
696
  browsers: [
@@ -724,7 +709,7 @@ describe('TargetResolver', () => {
724
709
  loc: undefined,
725
710
  sourceType: 'module',
726
711
  unstableSingleFileOutput: false,
727
- },
712
+ }),
728
713
  loc: {
729
714
  filePath: relative(path.join(CONTEXT_FIXTURE_PATH, 'package.json')),
730
715
  start: {
@@ -1076,8 +1061,7 @@ describe('TargetResolver', () => {
1076
1061
  distDir: relative(path.join(fixture, 'dist')),
1077
1062
  distEntry: 'index.mjs',
1078
1063
  publicUrl: '/',
1079
- env: {
1080
- id: 'fb14362a83d338f6',
1064
+ env: createEnvironment({
1081
1065
  context: 'browser',
1082
1066
  engines: {
1083
1067
  browsers: [
@@ -1096,7 +1080,7 @@ describe('TargetResolver', () => {
1096
1080
  loc: undefined,
1097
1081
  sourceType: 'module',
1098
1082
  unstableSingleFileOutput: false,
1099
- },
1083
+ }),
1100
1084
  loc: {
1101
1085
  filePath: relative(path.join(fixture, 'package.json')),
1102
1086
  start: {
@@ -1122,8 +1106,7 @@ describe('TargetResolver', () => {
1122
1106
  distDir: relative(path.join(fixture, 'dist')),
1123
1107
  distEntry: 'index.js',
1124
1108
  publicUrl: '/',
1125
- env: {
1126
- id: 'fb14362a83d338f6',
1109
+ env: createEnvironment({
1127
1110
  context: 'browser',
1128
1111
  engines: {
1129
1112
  browsers: [
@@ -1142,7 +1125,7 @@ describe('TargetResolver', () => {
1142
1125
  loc: undefined,
1143
1126
  sourceType: 'module',
1144
1127
  unstableSingleFileOutput: false,
1145
- },
1128
+ }),
1146
1129
  loc: {
1147
1130
  filePath: relative(path.join(fixture, 'package.json')),
1148
1131
  start: {
@@ -1172,8 +1155,7 @@ describe('TargetResolver', () => {
1172
1155
  distDir: 'fixtures/common-targets/dist/main',
1173
1156
  distEntry: 'index.js',
1174
1157
  publicUrl: '/',
1175
- env: {
1176
- id: 'f628a18b9d37974c',
1158
+ env: createEnvironment({
1177
1159
  context: 'node',
1178
1160
  engines: {
1179
1161
  node: '>= 8.0.0',
@@ -1187,7 +1169,7 @@ describe('TargetResolver', () => {
1187
1169
  loc: undefined,
1188
1170
  sourceType: 'module',
1189
1171
  unstableSingleFileOutput: false,
1190
- },
1172
+ }),
1191
1173
  loc: {
1192
1174
  filePath: relative(
1193
1175
  path.join(COMMON_TARGETS_FIXTURE_PATH, 'package.json'),
@@ -1207,8 +1189,7 @@ describe('TargetResolver', () => {
1207
1189
  distDir: 'fixtures/common-targets/dist/browser',
1208
1190
  distEntry: 'index.js',
1209
1191
  publicUrl: '/assets',
1210
- env: {
1211
- id: '7c0fe07c8a3a38da',
1192
+ env: createEnvironment({
1212
1193
  context: 'browser',
1213
1194
  engines: {
1214
1195
  browsers: ['last 1 version'],
@@ -1222,7 +1203,7 @@ describe('TargetResolver', () => {
1222
1203
  loc: undefined,
1223
1204
  sourceType: 'module',
1224
1205
  unstableSingleFileOutput: false,
1225
- },
1206
+ }),
1226
1207
  loc: {
1227
1208
  filePath: relative(
1228
1209
  path.join(COMMON_TARGETS_FIXTURE_PATH, 'package.json'),
@@ -1256,8 +1237,7 @@ describe('TargetResolver', () => {
1256
1237
  name: 'default',
1257
1238
  distDir: serveDistDir,
1258
1239
  publicUrl: '/',
1259
- env: {
1260
- id: '858b9b5a5dca37d4',
1240
+ env: createEnvironment({
1261
1241
  context: 'browser',
1262
1242
  engines: {
1263
1243
  browsers: [
@@ -1276,7 +1256,7 @@ describe('TargetResolver', () => {
1276
1256
  loc: undefined,
1277
1257
  sourceType: 'module',
1278
1258
  unstableSingleFileOutput: false,
1279
- },
1259
+ }),
1280
1260
  },
1281
1261
  ],
1282
1262
  );
@@ -1294,8 +1274,7 @@ describe('TargetResolver', () => {
1294
1274
  path.join(DEFAULT_DISTPATH_FIXTURE_PATHS.none, 'dist'),
1295
1275
  ),
1296
1276
  publicUrl: '/',
1297
- env: {
1298
- id: '8f31176c88184c4f',
1277
+ env: createEnvironment({
1299
1278
  context: 'browser',
1300
1279
  engines: {
1301
1280
  browsers: ['Chrome 80'],
@@ -1309,7 +1288,7 @@ describe('TargetResolver', () => {
1309
1288
  loc: undefined,
1310
1289
  sourceType: 'module',
1311
1290
  unstableSingleFileOutput: false,
1312
- },
1291
+ }),
1313
1292
  },
1314
1293
  ],
1315
1294
  );
@@ -1328,8 +1307,7 @@ describe('TargetResolver', () => {
1328
1307
  ),
1329
1308
  distEntry: undefined,
1330
1309
  publicUrl: '/',
1331
- env: {
1332
- id: '8f31176c88184c4f',
1310
+ env: createEnvironment({
1333
1311
  context: 'browser',
1334
1312
  engines: {
1335
1313
  browsers: ['Chrome 80'],
@@ -1343,7 +1321,7 @@ describe('TargetResolver', () => {
1343
1321
  loc: undefined,
1344
1322
  sourceType: 'module',
1345
1323
  unstableSingleFileOutput: false,
1346
- },
1324
+ }),
1347
1325
  loc: {
1348
1326
  filePath: relative(
1349
1327
  path.join(DEFAULT_DISTPATH_FIXTURE_PATHS.one, 'package.json'),
@@ -1379,8 +1357,7 @@ describe('TargetResolver', () => {
1379
1357
  ),
1380
1358
  distEntry: undefined,
1381
1359
  publicUrl: '/',
1382
- env: {
1383
- id: '75603271034eff15',
1360
+ env: createEnvironment({
1384
1361
  context: 'browser',
1385
1362
  engines: {
1386
1363
  browsers: ['last 1 version'],
@@ -1394,7 +1371,7 @@ describe('TargetResolver', () => {
1394
1371
  loc: undefined,
1395
1372
  sourceType: 'module',
1396
1373
  unstableSingleFileOutput: false,
1397
- },
1374
+ }),
1398
1375
  loc: {
1399
1376
  filePath: relative(
1400
1377
  path.join(DEFAULT_DISTPATH_FIXTURE_PATHS.two, 'package.json'),
@@ -1420,8 +1397,7 @@ describe('TargetResolver', () => {
1420
1397
  ),
1421
1398
  distEntry: undefined,
1422
1399
  publicUrl: '/',
1423
- env: {
1424
- id: 'd5ff950a2c05db56',
1400
+ env: createEnvironment({
1425
1401
  context: 'browser',
1426
1402
  engines: {
1427
1403
  browsers: ['IE 11'],
@@ -1435,7 +1411,7 @@ describe('TargetResolver', () => {
1435
1411
  loc: undefined,
1436
1412
  sourceType: 'module',
1437
1413
  unstableSingleFileOutput: false,
1438
- },
1414
+ }),
1439
1415
  loc: {
1440
1416
  filePath: relative(
1441
1417
  path.join(DEFAULT_DISTPATH_FIXTURE_PATHS.two, 'package.json'),