@atlaspack/transformer-js 3.2.3-canary.5 → 3.2.3-canary.52
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/JSTransformer.js +4 -3
- package/package.json +8 -8
- package/src/JSTransformer.js +16 -5
package/lib/JSTransformer.js
CHANGED
|
@@ -163,7 +163,7 @@ var _default = exports.default = new (_plugin().Transformer)({
|
|
|
163
163
|
let pkg = await config.getPackage();
|
|
164
164
|
let isJSX, pragma, pragmaFrag, jsxImportSource, automaticJSXRuntime, reactRefresh, decorators, useDefineForClassFields;
|
|
165
165
|
if (config.isSource) {
|
|
166
|
-
var _pkg$dependencies2, _pkg$devDependencies2, _pkg$peerDependencies2,
|
|
166
|
+
var _pkg$dependencies2, _pkg$devDependencies2, _pkg$peerDependencies2, _await$config$getConf, _await$config$getConf2;
|
|
167
167
|
let reactLib;
|
|
168
168
|
if (pkg !== null && pkg !== void 0 && pkg.alias && pkg.alias['react']) {
|
|
169
169
|
// e.g.: `{ alias: { "react": "preact/compat" } }`
|
|
@@ -176,8 +176,9 @@ var _default = exports.default = new (_plugin().Transformer)({
|
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
178
|
reactRefresh = options.hmrOptions && options.mode === 'development' && Boolean((pkg === null || pkg === void 0 || (_pkg$dependencies2 = pkg.dependencies) === null || _pkg$dependencies2 === void 0 ? void 0 : _pkg$dependencies2.react) || (pkg === null || pkg === void 0 || (_pkg$devDependencies2 = pkg.devDependencies) === null || _pkg$devDependencies2 === void 0 ? void 0 : _pkg$devDependencies2.react) || (pkg === null || pkg === void 0 || (_pkg$peerDependencies2 = pkg.peerDependencies) === null || _pkg$peerDependencies2 === void 0 ? void 0 : _pkg$peerDependencies2.react));
|
|
179
|
-
|
|
180
|
-
|
|
179
|
+
const compilerOptions = (0, _featureFlags().getFeatureFlag)('granularTsConfigInvalidation') ? (_await$config$getConf = await config.getConfigFrom(options.projectRoot + '/index', ['tsconfig.json', 'jsconfig.json'], {
|
|
180
|
+
configKey: 'compilerOptions'
|
|
181
|
+
})) === null || _await$config$getConf === void 0 ? void 0 : _await$config$getConf.contents : (_await$config$getConf2 = await config.getConfigFrom(options.projectRoot + '/index', ['tsconfig.json', 'jsconfig.json'])) === null || _await$config$getConf2 === void 0 || (_await$config$getConf2 = _await$config$getConf2.contents) === null || _await$config$getConf2 === void 0 ? void 0 : _await$config$getConf2.compilerOptions;
|
|
181
182
|
|
|
182
183
|
// Use explicitly defined JSX options in tsconfig.json over inferred values from dependencies.
|
|
183
184
|
pragma = (compilerOptions === null || compilerOptions === void 0 ? void 0 : compilerOptions.jsxFactory) || (reactLib ? JSX_PRAGMA[reactLib].pragma : undefined);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/transformer-js",
|
|
3
|
-
"version": "3.2.3-canary.
|
|
3
|
+
"version": "3.2.3-canary.52+0470a7712",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
"src"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@atlaspack/diagnostic": "2.14.1-canary.
|
|
26
|
-
"@atlaspack/feature-flags": "2.14.1-canary.
|
|
27
|
-
"@atlaspack/plugin": "2.14.5-canary.
|
|
28
|
-
"@atlaspack/rust": "3.2.1-canary.
|
|
29
|
-
"@atlaspack/utils": "2.14.5-canary.
|
|
30
|
-
"@atlaspack/workers": "2.14.5-canary.
|
|
25
|
+
"@atlaspack/diagnostic": "2.14.1-canary.120+0470a7712",
|
|
26
|
+
"@atlaspack/feature-flags": "2.14.1-canary.120+0470a7712",
|
|
27
|
+
"@atlaspack/plugin": "2.14.5-canary.52+0470a7712",
|
|
28
|
+
"@atlaspack/rust": "3.2.1-canary.52+0470a7712",
|
|
29
|
+
"@atlaspack/utils": "2.14.5-canary.52+0470a7712",
|
|
30
|
+
"@atlaspack/workers": "2.14.5-canary.52+0470a7712",
|
|
31
31
|
"@parcel/source-map": "^2.1.1",
|
|
32
32
|
"@swc/helpers": "^0.5.15",
|
|
33
33
|
"browserslist": "^4.6.6",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"@atlaspack/core": "^2.13.1"
|
|
40
40
|
},
|
|
41
41
|
"type": "commonjs",
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "0470a7712ba36afa7434a9fe5baec025cb6a35ad"
|
|
43
43
|
}
|
package/src/JSTransformer.js
CHANGED
|
@@ -206,11 +206,22 @@ export default (new Transformer({
|
|
|
206
206
|
pkg?.peerDependencies?.react,
|
|
207
207
|
);
|
|
208
208
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
209
|
+
const compilerOptions: TSConfig['compilerOptions'] = getFeatureFlag(
|
|
210
|
+
'granularTsConfigInvalidation',
|
|
211
|
+
)
|
|
212
|
+
? (
|
|
213
|
+
await config.getConfigFrom<TSConfig['compilerOptions']>(
|
|
214
|
+
options.projectRoot + '/index',
|
|
215
|
+
['tsconfig.json', 'jsconfig.json'],
|
|
216
|
+
{configKey: 'compilerOptions'},
|
|
217
|
+
)
|
|
218
|
+
)?.contents
|
|
219
|
+
: (
|
|
220
|
+
await config.getConfigFrom<TSConfig>(
|
|
221
|
+
options.projectRoot + '/index',
|
|
222
|
+
['tsconfig.json', 'jsconfig.json'],
|
|
223
|
+
)
|
|
224
|
+
)?.contents?.compilerOptions;
|
|
214
225
|
|
|
215
226
|
// Use explicitly defined JSX options in tsconfig.json over inferred values from dependencies.
|
|
216
227
|
pragma =
|