@parcel/transformer-babel 2.13.3 → 2.14.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.
@@ -103,7 +103,8 @@ var _default = exports.default = new (_plugin().Transformer)({
103
103
  } = generate(ast.program, {
104
104
  sourceFileName,
105
105
  sourceMaps: !!asset.env.sourceMap,
106
- comments: true
106
+ comments: true,
107
+ importAttributesKeyword: 'with'
107
108
  });
108
109
  let map = new (_sourceMap().default)(options.projectRoot);
109
110
  if (rawMappings) {
package/lib/flow.js CHANGED
@@ -22,10 +22,14 @@ async function getFlowOptions(config, options) {
22
22
  }
23
23
 
24
24
  // Only add flow plugin if `flow-bin` is listed as a dependency in the root package.json
25
- let conf = await config.getConfigFrom(options.projectRoot + '/index', ['package.json']);
26
- let pkg = conf === null || conf === void 0 ? void 0 : conf.contents;
27
- if (!pkg || !(pkg.dependencies && pkg.dependencies['flow-bin']) && !(pkg.devDependencies && pkg.devDependencies['flow-bin'])) {
28
- return null;
25
+ // @parcel/error-overlay package in integration tests is an exception
26
+
27
+ {
28
+ let conf = await config.getConfigFrom(options.projectRoot + '/index', ['package.json']);
29
+ let pkg = conf === null || conf === void 0 ? void 0 : conf.contents;
30
+ if (!pkg || !(pkg.dependencies && pkg.dependencies['flow-bin']) && !(pkg.devDependencies && pkg.devDependencies['flow-bin'])) {
31
+ return null;
32
+ }
29
33
  }
30
34
  const babelCore = await options.packageManager.require('@babel/core', config.searchPath, {
31
35
  range: _constants.BABEL_CORE_RANGE,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcel/transformer-babel",
3
- "version": "2.13.3",
3
+ "version": "2.14.1",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -17,13 +17,13 @@
17
17
  "source": "src/BabelTransformer.js",
18
18
  "engines": {
19
19
  "node": ">= 16.0.0",
20
- "parcel": "^2.13.3"
20
+ "parcel": "^2.14.1"
21
21
  },
22
22
  "dependencies": {
23
- "@parcel/diagnostic": "2.13.3",
24
- "@parcel/plugin": "2.13.3",
23
+ "@parcel/diagnostic": "2.14.1",
24
+ "@parcel/plugin": "2.14.1",
25
25
  "@parcel/source-map": "^2.1.1",
26
- "@parcel/utils": "2.13.3",
26
+ "@parcel/utils": "2.14.1",
27
27
  "browserslist": "^4.6.6",
28
28
  "json5": "^2.2.0",
29
29
  "nullthrows": "^1.1.1",
@@ -33,7 +33,7 @@
33
33
  "@babel/core": "^7.22.11",
34
34
  "@babel/preset-env": "^7.22.14",
35
35
  "@babel/types": "^7.22.11",
36
- "@parcel/types": "2.13.3"
36
+ "@parcel/types": "2.14.1"
37
37
  },
38
- "gitHead": "d19b1f6bdb05eb5a3085f44daae15c0fe2709ab9"
38
+ "gitHead": "86bddb4031136f4b1b76e1a9a4c8a53ff4280b42"
39
39
  }
@@ -75,6 +75,7 @@ export default (new Transformer({
75
75
  sourceFileName,
76
76
  sourceMaps: !!asset.env.sourceMap,
77
77
  comments: true,
78
+ importAttributesKeyword: 'with',
78
79
  });
79
80
 
80
81
  let map = new SourceMap(options.projectRoot);
package/src/flow.js CHANGED
@@ -19,17 +19,25 @@ export default async function getFlowOptions(
19
19
  }
20
20
 
21
21
  // Only add flow plugin if `flow-bin` is listed as a dependency in the root package.json
22
- let conf = await config.getConfigFrom<PackageJSON>(
23
- options.projectRoot + '/index',
24
- ['package.json'],
25
- );
26
- let pkg = conf?.contents;
22
+ // @parcel/error-overlay package in integration tests is an exception
27
23
  if (
28
- !pkg ||
29
- (!(pkg.dependencies && pkg.dependencies['flow-bin']) &&
30
- !(pkg.devDependencies && pkg.devDependencies['flow-bin']))
24
+ !(
25
+ process.env.PARCEL_BUILD_ENV === 'test' &&
26
+ config.searchPath.includes('error-overlay')
27
+ )
31
28
  ) {
32
- return null;
29
+ let conf = await config.getConfigFrom<PackageJSON>(
30
+ options.projectRoot + '/index',
31
+ ['package.json'],
32
+ );
33
+ let pkg = conf?.contents;
34
+ if (
35
+ !pkg ||
36
+ (!(pkg.dependencies && pkg.dependencies['flow-bin']) &&
37
+ !(pkg.devDependencies && pkg.devDependencies['flow-bin']))
38
+ ) {
39
+ return null;
40
+ }
33
41
  }
34
42
 
35
43
  const babelCore: BabelCore = await options.packageManager.require(