@atlaspack/core 2.12.1-canary.3481 → 2.12.1-canary.3483
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/Environment.js +2 -0
- package/lib/TargetDescriptor.schema.js +3 -0
- package/lib/atlaspack-v3/worker/compat/environment.js +1 -0
- package/lib/public/Environment.js +3 -0
- package/lib/requests/TargetRequest.js +3 -1
- package/package.json +17 -17
- package/src/Environment.js +2 -0
- package/src/TargetDescriptor.schema.js +3 -0
- package/src/atlaspack-v3/worker/compat/environment.js +2 -0
- package/src/public/Environment.js +4 -0
- package/src/requests/TargetRequest.js +3 -0
- package/src/types.js +1 -0
- package/test/Environment.test.js +5 -0
- package/test/TargetRequest.test.js +25 -0
package/lib/Environment.js
CHANGED
|
@@ -30,6 +30,7 @@ function createEnvironment({
|
|
|
30
30
|
isLibrary = false,
|
|
31
31
|
shouldScopeHoist = false,
|
|
32
32
|
sourceMap,
|
|
33
|
+
unstableSingleFileOutput = false,
|
|
33
34
|
loc
|
|
34
35
|
} = {
|
|
35
36
|
/*::...null*/
|
|
@@ -102,6 +103,7 @@ function createEnvironment({
|
|
|
102
103
|
shouldOptimize,
|
|
103
104
|
shouldScopeHoist,
|
|
104
105
|
sourceMap,
|
|
106
|
+
unstableSingleFileOutput,
|
|
105
107
|
loc
|
|
106
108
|
};
|
|
107
109
|
res.id = getEnvironmentHash(res);
|
|
@@ -174,6 +174,9 @@ class Environment {
|
|
|
174
174
|
get loc() {
|
|
175
175
|
return (0, _utils.fromInternalSourceLocation)(this.#options.projectRoot, this.#environment.loc);
|
|
176
176
|
}
|
|
177
|
+
get unstableSingleFileOutput() {
|
|
178
|
+
return this.#environment.unstableSingleFileOutput;
|
|
179
|
+
}
|
|
177
180
|
|
|
178
181
|
// $FlowFixMe[unsupported-syntax]
|
|
179
182
|
[inspect]() {
|
|
@@ -220,7 +220,8 @@ class TargetResolver {
|
|
|
220
220
|
outputFormat: descriptor.outputFormat ?? this.options.defaultTargetOptions.outputFormat,
|
|
221
221
|
shouldOptimize: this.options.defaultTargetOptions.shouldOptimize && descriptor.optimize !== false,
|
|
222
222
|
shouldScopeHoist: this.options.defaultTargetOptions.shouldScopeHoist && descriptor.scopeHoist !== false,
|
|
223
|
-
sourceMap: normalizeSourceMap(this.options, descriptor.sourceMap)
|
|
223
|
+
sourceMap: normalizeSourceMap(this.options, descriptor.sourceMap),
|
|
224
|
+
unstableSingleFileOutput: descriptor.__unstable_singleFileOutput
|
|
224
225
|
})
|
|
225
226
|
};
|
|
226
227
|
if (descriptor.distEntry != null) {
|
|
@@ -770,6 +771,7 @@ class TargetResolver {
|
|
|
770
771
|
engines: descriptor.engines ?? pkgEngines,
|
|
771
772
|
context: descriptor.context,
|
|
772
773
|
includeNodeModules: descriptor.includeNodeModules,
|
|
774
|
+
unstableSingleFileOutput: descriptor.__unstable_singleFileOutput,
|
|
773
775
|
outputFormat: descriptor.outputFormat ?? this.options.defaultTargetOptions.outputFormat ?? inferredOutputFormat ?? undefined,
|
|
774
776
|
isLibrary,
|
|
775
777
|
shouldOptimize: this.options.defaultTargetOptions.shouldOptimize && (
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/core",
|
|
3
|
-
"version": "2.12.1-canary.
|
|
3
|
+
"version": "2.12.1-canary.3483+d6354624a",
|
|
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.
|
|
24
|
-
"@atlaspack/cache": "2.12.1-canary.
|
|
25
|
-
"@atlaspack/diagnostic": "2.12.1-canary.
|
|
26
|
-
"@atlaspack/events": "2.12.1-canary.
|
|
27
|
-
"@atlaspack/feature-flags": "2.12.1-canary.
|
|
28
|
-
"@atlaspack/fs": "2.12.1-canary.
|
|
29
|
-
"@atlaspack/graph": "3.2.1-canary.
|
|
30
|
-
"@atlaspack/logger": "2.12.1-canary.
|
|
31
|
-
"@atlaspack/package-manager": "2.12.1-canary.
|
|
32
|
-
"@atlaspack/plugin": "2.12.1-canary.
|
|
33
|
-
"@atlaspack/profiler": "2.12.1-canary.
|
|
34
|
-
"@atlaspack/rust": "2.12.1-canary.
|
|
35
|
-
"@atlaspack/types": "2.12.1-canary.
|
|
36
|
-
"@atlaspack/utils": "2.12.1-canary.
|
|
37
|
-
"@atlaspack/workers": "2.12.1-canary.
|
|
23
|
+
"@atlaspack/build-cache": "2.12.1-canary.3483+d6354624a",
|
|
24
|
+
"@atlaspack/cache": "2.12.1-canary.3483+d6354624a",
|
|
25
|
+
"@atlaspack/diagnostic": "2.12.1-canary.3483+d6354624a",
|
|
26
|
+
"@atlaspack/events": "2.12.1-canary.3483+d6354624a",
|
|
27
|
+
"@atlaspack/feature-flags": "2.12.1-canary.3483+d6354624a",
|
|
28
|
+
"@atlaspack/fs": "2.12.1-canary.3483+d6354624a",
|
|
29
|
+
"@atlaspack/graph": "3.2.1-canary.3483+d6354624a",
|
|
30
|
+
"@atlaspack/logger": "2.12.1-canary.3483+d6354624a",
|
|
31
|
+
"@atlaspack/package-manager": "2.12.1-canary.3483+d6354624a",
|
|
32
|
+
"@atlaspack/plugin": "2.12.1-canary.3483+d6354624a",
|
|
33
|
+
"@atlaspack/profiler": "2.12.1-canary.3483+d6354624a",
|
|
34
|
+
"@atlaspack/rust": "2.12.1-canary.3483+d6354624a",
|
|
35
|
+
"@atlaspack/types": "2.12.1-canary.3483+d6354624a",
|
|
36
|
+
"@atlaspack/utils": "2.12.1-canary.3483+d6354624a",
|
|
37
|
+
"@atlaspack/workers": "2.12.1-canary.3483+d6354624a",
|
|
38
38
|
"@mischnic/json-sourcemap": "^0.1.0",
|
|
39
39
|
"@parcel/source-map": "^2.1.1",
|
|
40
40
|
"base-x": "^3.0.8",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"browser": {
|
|
66
66
|
"./src/serializerCore.js": "./src/serializerCore.browser.js"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "d6354624a264ee06d1f203f70f36af1a8650db52"
|
|
69
69
|
}
|
package/src/Environment.js
CHANGED
|
@@ -30,6 +30,7 @@ export function createEnvironment({
|
|
|
30
30
|
isLibrary = false,
|
|
31
31
|
shouldScopeHoist = false,
|
|
32
32
|
sourceMap,
|
|
33
|
+
unstableSingleFileOutput = false,
|
|
33
34
|
loc,
|
|
34
35
|
}: EnvironmentOpts = {
|
|
35
36
|
/*::...null*/
|
|
@@ -105,6 +106,7 @@ export function createEnvironment({
|
|
|
105
106
|
shouldOptimize,
|
|
106
107
|
shouldScopeHoist,
|
|
107
108
|
sourceMap,
|
|
109
|
+
unstableSingleFileOutput,
|
|
108
110
|
loc,
|
|
109
111
|
};
|
|
110
112
|
|
|
@@ -29,6 +29,7 @@ export class Environment implements IEnvironment {
|
|
|
29
29
|
shouldScopeHoist: boolean;
|
|
30
30
|
sourceMap: ?TargetSourceMapOptions;
|
|
31
31
|
loc: ?SourceLocation;
|
|
32
|
+
unstableSingleFileOutput: boolean;
|
|
32
33
|
|
|
33
34
|
constructor(inner: NapiEnvironment) {
|
|
34
35
|
// TODO
|
|
@@ -46,6 +47,7 @@ export class Environment implements IEnvironment {
|
|
|
46
47
|
this.shouldScopeHoist = inner.shouldScopeHoist;
|
|
47
48
|
this.sourceMap = inner.sourceMap;
|
|
48
49
|
this.loc = inner.loc;
|
|
50
|
+
this.unstableSingleFileOutput = false;
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
// TODO
|
|
@@ -225,6 +225,10 @@ export default class Environment implements IEnvironment {
|
|
|
225
225
|
);
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
+
get unstableSingleFileOutput(): boolean {
|
|
229
|
+
return this.#environment.unstableSingleFileOutput;
|
|
230
|
+
}
|
|
231
|
+
|
|
228
232
|
// $FlowFixMe[unsupported-syntax]
|
|
229
233
|
[inspect](): string {
|
|
230
234
|
return `Env(${this.#environment.context})`;
|
|
@@ -312,6 +312,8 @@ export class TargetResolver {
|
|
|
312
312
|
this.options,
|
|
313
313
|
descriptor.sourceMap,
|
|
314
314
|
),
|
|
315
|
+
unstableSingleFileOutput:
|
|
316
|
+
descriptor.__unstable_singleFileOutput,
|
|
315
317
|
}),
|
|
316
318
|
};
|
|
317
319
|
|
|
@@ -1069,6 +1071,7 @@ export class TargetResolver {
|
|
|
1069
1071
|
engines: descriptor.engines ?? pkgEngines,
|
|
1070
1072
|
context: descriptor.context,
|
|
1071
1073
|
includeNodeModules: descriptor.includeNodeModules,
|
|
1074
|
+
unstableSingleFileOutput: descriptor.__unstable_singleFileOutput,
|
|
1072
1075
|
outputFormat:
|
|
1073
1076
|
descriptor.outputFormat ??
|
|
1074
1077
|
this.options.defaultTargetOptions.outputFormat ??
|
package/src/types.js
CHANGED
package/test/Environment.test.js
CHANGED
|
@@ -22,6 +22,7 @@ describe('Environment', () => {
|
|
|
22
22
|
sourceMap: undefined,
|
|
23
23
|
loc: undefined,
|
|
24
24
|
sourceType: 'module',
|
|
25
|
+
unstableSingleFileOutput: false,
|
|
25
26
|
});
|
|
26
27
|
});
|
|
27
28
|
|
|
@@ -40,6 +41,7 @@ describe('Environment', () => {
|
|
|
40
41
|
sourceMap: undefined,
|
|
41
42
|
loc: undefined,
|
|
42
43
|
sourceType: 'module',
|
|
44
|
+
unstableSingleFileOutput: false,
|
|
43
45
|
});
|
|
44
46
|
});
|
|
45
47
|
|
|
@@ -60,6 +62,7 @@ describe('Environment', () => {
|
|
|
60
62
|
sourceMap: undefined,
|
|
61
63
|
loc: undefined,
|
|
62
64
|
sourceType: 'module',
|
|
65
|
+
unstableSingleFileOutput: false,
|
|
63
66
|
},
|
|
64
67
|
);
|
|
65
68
|
});
|
|
@@ -79,6 +82,7 @@ describe('Environment', () => {
|
|
|
79
82
|
sourceMap: undefined,
|
|
80
83
|
loc: undefined,
|
|
81
84
|
sourceType: 'module',
|
|
85
|
+
unstableSingleFileOutput: false,
|
|
82
86
|
});
|
|
83
87
|
});
|
|
84
88
|
|
|
@@ -97,6 +101,7 @@ describe('Environment', () => {
|
|
|
97
101
|
sourceMap: undefined,
|
|
98
102
|
loc: undefined,
|
|
99
103
|
sourceType: 'module',
|
|
104
|
+
unstableSingleFileOutput: false,
|
|
100
105
|
});
|
|
101
106
|
});
|
|
102
107
|
});
|
|
@@ -138,6 +138,7 @@ describe('TargetResolver', () => {
|
|
|
138
138
|
sourceMap: {},
|
|
139
139
|
loc: undefined,
|
|
140
140
|
sourceType: 'module',
|
|
141
|
+
unstableSingleFileOutput: false,
|
|
141
142
|
},
|
|
142
143
|
},
|
|
143
144
|
{
|
|
@@ -159,6 +160,7 @@ describe('TargetResolver', () => {
|
|
|
159
160
|
sourceMap: {},
|
|
160
161
|
loc: undefined,
|
|
161
162
|
sourceType: 'module',
|
|
163
|
+
unstableSingleFileOutput: false,
|
|
162
164
|
},
|
|
163
165
|
},
|
|
164
166
|
],
|
|
@@ -190,6 +192,7 @@ describe('TargetResolver', () => {
|
|
|
190
192
|
sourceMap: {},
|
|
191
193
|
loc: undefined,
|
|
192
194
|
sourceType: 'module',
|
|
195
|
+
unstableSingleFileOutput: false,
|
|
193
196
|
},
|
|
194
197
|
loc: {
|
|
195
198
|
filePath: relative(
|
|
@@ -226,6 +229,7 @@ describe('TargetResolver', () => {
|
|
|
226
229
|
},
|
|
227
230
|
loc: undefined,
|
|
228
231
|
sourceType: 'module',
|
|
232
|
+
unstableSingleFileOutput: false,
|
|
229
233
|
},
|
|
230
234
|
loc: {
|
|
231
235
|
filePath: relative(
|
|
@@ -260,6 +264,7 @@ describe('TargetResolver', () => {
|
|
|
260
264
|
sourceMap: {},
|
|
261
265
|
loc: undefined,
|
|
262
266
|
sourceType: 'module',
|
|
267
|
+
unstableSingleFileOutput: false,
|
|
263
268
|
},
|
|
264
269
|
loc: {
|
|
265
270
|
filePath: relative(
|
|
@@ -306,6 +311,7 @@ describe('TargetResolver', () => {
|
|
|
306
311
|
sourceMap: undefined,
|
|
307
312
|
loc: undefined,
|
|
308
313
|
sourceType: 'module',
|
|
314
|
+
unstableSingleFileOutput: false,
|
|
309
315
|
},
|
|
310
316
|
loc: {
|
|
311
317
|
filePath: relative(
|
|
@@ -349,6 +355,7 @@ describe('TargetResolver', () => {
|
|
|
349
355
|
sourceMap: {},
|
|
350
356
|
loc: undefined,
|
|
351
357
|
sourceType: 'module',
|
|
358
|
+
unstableSingleFileOutput: false,
|
|
352
359
|
},
|
|
353
360
|
loc: {
|
|
354
361
|
filePath: relative(
|
|
@@ -383,6 +390,7 @@ describe('TargetResolver', () => {
|
|
|
383
390
|
sourceMap: {},
|
|
384
391
|
loc: undefined,
|
|
385
392
|
sourceType: 'module',
|
|
393
|
+
unstableSingleFileOutput: false,
|
|
386
394
|
},
|
|
387
395
|
loc: {
|
|
388
396
|
filePath: relative(
|
|
@@ -417,6 +425,7 @@ describe('TargetResolver', () => {
|
|
|
417
425
|
sourceMap: {},
|
|
418
426
|
loc: undefined,
|
|
419
427
|
sourceType: 'module',
|
|
428
|
+
unstableSingleFileOutput: false,
|
|
420
429
|
},
|
|
421
430
|
loc: {
|
|
422
431
|
filePath: relative(
|
|
@@ -468,6 +477,7 @@ describe('TargetResolver', () => {
|
|
|
468
477
|
sourceMap: {},
|
|
469
478
|
loc: undefined,
|
|
470
479
|
sourceType: 'module',
|
|
480
|
+
unstableSingleFileOutput: false,
|
|
471
481
|
},
|
|
472
482
|
loc: {
|
|
473
483
|
filePath: relative(
|
|
@@ -502,6 +512,7 @@ describe('TargetResolver', () => {
|
|
|
502
512
|
sourceMap: {},
|
|
503
513
|
loc: undefined,
|
|
504
514
|
sourceType: 'module',
|
|
515
|
+
unstableSingleFileOutput: false,
|
|
505
516
|
},
|
|
506
517
|
loc: {
|
|
507
518
|
filePath: relative(
|
|
@@ -536,6 +547,7 @@ describe('TargetResolver', () => {
|
|
|
536
547
|
sourceMap: {},
|
|
537
548
|
loc: undefined,
|
|
538
549
|
sourceType: 'module',
|
|
550
|
+
unstableSingleFileOutput: false,
|
|
539
551
|
},
|
|
540
552
|
loc: {
|
|
541
553
|
filePath: relative(
|
|
@@ -579,6 +591,7 @@ describe('TargetResolver', () => {
|
|
|
579
591
|
sourceMap: {},
|
|
580
592
|
loc: undefined,
|
|
581
593
|
sourceType: 'module',
|
|
594
|
+
unstableSingleFileOutput: false,
|
|
582
595
|
},
|
|
583
596
|
loc: {
|
|
584
597
|
filePath: relative(
|
|
@@ -634,6 +647,7 @@ describe('TargetResolver', () => {
|
|
|
634
647
|
sourceMap: {},
|
|
635
648
|
loc: undefined,
|
|
636
649
|
sourceType: 'module',
|
|
650
|
+
unstableSingleFileOutput: false,
|
|
637
651
|
},
|
|
638
652
|
},
|
|
639
653
|
],
|
|
@@ -676,6 +690,7 @@ describe('TargetResolver', () => {
|
|
|
676
690
|
sourceMap: {},
|
|
677
691
|
loc: undefined,
|
|
678
692
|
sourceType: 'module',
|
|
693
|
+
unstableSingleFileOutput: false,
|
|
679
694
|
},
|
|
680
695
|
source: 'customA/index.js',
|
|
681
696
|
},
|
|
@@ -710,6 +725,7 @@ describe('TargetResolver', () => {
|
|
|
710
725
|
sourceMap: {},
|
|
711
726
|
loc: undefined,
|
|
712
727
|
sourceType: 'module',
|
|
728
|
+
unstableSingleFileOutput: false,
|
|
713
729
|
},
|
|
714
730
|
loc: {
|
|
715
731
|
filePath: relative(path.join(CONTEXT_FIXTURE_PATH, 'package.json')),
|
|
@@ -1088,6 +1104,7 @@ describe('TargetResolver', () => {
|
|
|
1088
1104
|
sourceMap: {},
|
|
1089
1105
|
loc: undefined,
|
|
1090
1106
|
sourceType: 'module',
|
|
1107
|
+
unstableSingleFileOutput: false,
|
|
1091
1108
|
},
|
|
1092
1109
|
loc: {
|
|
1093
1110
|
filePath: relative(path.join(fixture, 'package.json')),
|
|
@@ -1133,6 +1150,7 @@ describe('TargetResolver', () => {
|
|
|
1133
1150
|
sourceMap: {},
|
|
1134
1151
|
loc: undefined,
|
|
1135
1152
|
sourceType: 'module',
|
|
1153
|
+
unstableSingleFileOutput: false,
|
|
1136
1154
|
},
|
|
1137
1155
|
loc: {
|
|
1138
1156
|
filePath: relative(path.join(fixture, 'package.json')),
|
|
@@ -1177,6 +1195,7 @@ describe('TargetResolver', () => {
|
|
|
1177
1195
|
sourceMap: {},
|
|
1178
1196
|
loc: undefined,
|
|
1179
1197
|
sourceType: 'module',
|
|
1198
|
+
unstableSingleFileOutput: false,
|
|
1180
1199
|
},
|
|
1181
1200
|
loc: {
|
|
1182
1201
|
filePath: relative(
|
|
@@ -1211,6 +1230,7 @@ describe('TargetResolver', () => {
|
|
|
1211
1230
|
sourceMap: {},
|
|
1212
1231
|
loc: undefined,
|
|
1213
1232
|
sourceType: 'module',
|
|
1233
|
+
unstableSingleFileOutput: false,
|
|
1214
1234
|
},
|
|
1215
1235
|
loc: {
|
|
1216
1236
|
filePath: relative(
|
|
@@ -1264,6 +1284,7 @@ describe('TargetResolver', () => {
|
|
|
1264
1284
|
sourceMap: {},
|
|
1265
1285
|
loc: undefined,
|
|
1266
1286
|
sourceType: 'module',
|
|
1287
|
+
unstableSingleFileOutput: false,
|
|
1267
1288
|
},
|
|
1268
1289
|
},
|
|
1269
1290
|
],
|
|
@@ -1296,6 +1317,7 @@ describe('TargetResolver', () => {
|
|
|
1296
1317
|
sourceMap: {},
|
|
1297
1318
|
loc: undefined,
|
|
1298
1319
|
sourceType: 'module',
|
|
1320
|
+
unstableSingleFileOutput: false,
|
|
1299
1321
|
},
|
|
1300
1322
|
},
|
|
1301
1323
|
],
|
|
@@ -1329,6 +1351,7 @@ describe('TargetResolver', () => {
|
|
|
1329
1351
|
sourceMap: {},
|
|
1330
1352
|
loc: undefined,
|
|
1331
1353
|
sourceType: 'module',
|
|
1354
|
+
unstableSingleFileOutput: false,
|
|
1332
1355
|
},
|
|
1333
1356
|
loc: {
|
|
1334
1357
|
filePath: relative(
|
|
@@ -1379,6 +1402,7 @@ describe('TargetResolver', () => {
|
|
|
1379
1402
|
sourceMap: {},
|
|
1380
1403
|
loc: undefined,
|
|
1381
1404
|
sourceType: 'module',
|
|
1405
|
+
unstableSingleFileOutput: false,
|
|
1382
1406
|
},
|
|
1383
1407
|
loc: {
|
|
1384
1408
|
filePath: relative(
|
|
@@ -1419,6 +1443,7 @@ describe('TargetResolver', () => {
|
|
|
1419
1443
|
sourceMap: {},
|
|
1420
1444
|
loc: undefined,
|
|
1421
1445
|
sourceType: 'module',
|
|
1446
|
+
unstableSingleFileOutput: false,
|
|
1422
1447
|
},
|
|
1423
1448
|
loc: {
|
|
1424
1449
|
filePath: relative(
|