@atlaspack/transformer-js 3.2.5 → 3.2.7

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.
@@ -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, _tsconfig$contents;
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
- let tsconfig = await config.getConfigFrom(options.projectRoot + '/index', ['tsconfig.json', 'jsconfig.json']);
180
- let compilerOptions = tsconfig === null || tsconfig === void 0 || (_tsconfig$contents = tsconfig.contents) === null || _tsconfig$contents === void 0 ? void 0 : _tsconfig$contents.compilerOptions;
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.5",
3
+ "version": "3.2.7",
4
4
  "license": "(MIT OR Apache-2.0)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -23,12 +23,12 @@
23
23
  ],
24
24
  "dependencies": {
25
25
  "@atlaspack/diagnostic": "2.14.1",
26
- "@atlaspack/feature-flags": "2.15.0",
27
- "@atlaspack/plugin": "2.14.7",
28
- "@atlaspack/rust": "3.3.2",
26
+ "@atlaspack/feature-flags": "2.16.0",
27
+ "@atlaspack/plugin": "2.14.9",
28
+ "@atlaspack/rust": "3.3.4",
29
29
  "@parcel/source-map": "^2.1.1",
30
- "@atlaspack/utils": "2.14.7",
31
- "@atlaspack/workers": "2.14.7",
30
+ "@atlaspack/utils": "2.14.9",
31
+ "@atlaspack/workers": "2.14.9",
32
32
  "@swc/helpers": "^0.5.15",
33
33
  "browserslist": "^4.6.6",
34
34
  "nullthrows": "^1.1.1",
@@ -206,11 +206,22 @@ export default (new Transformer({
206
206
  pkg?.peerDependencies?.react,
207
207
  );
208
208
 
209
- let tsconfig = await config.getConfigFrom<TSConfig>(
210
- options.projectRoot + '/index',
211
- ['tsconfig.json', 'jsconfig.json'],
212
- );
213
- let compilerOptions = tsconfig?.contents?.compilerOptions;
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 =