@commercetools-frontend/babel-preset-mc-app 25.1.0 → 26.0.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.
Files changed (3) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/create.js +12 -2
  3. package/package.json +9 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @commercetools-frontend/babel-preset-mc-app
2
2
 
3
+ ## 26.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#3934](https://github.com/commercetools/merchant-center-application-kit/pull/3934) [`6c91a27`](https://github.com/commercetools/merchant-center-application-kit/commit/6c91a27d2b59e1d329e21cfb1d4c18f6cd205186) Thanks [@ByronDWall](https://github.com/ByronDWall)! - fix(security): move `babel-plugin-istanbul` to optional peer dependency to resolve SNYK-JS-INFLIGHT-6095116
8
+
9
+ The `babel-plugin-istanbul` package transitively depends on the deprecated and vulnerable `inflight@1.0.6` via `test-exclude → glob@7 → inflight`. By moving it from a direct dependency to an optional peer dependency, consumers of `@commercetools-frontend/babel-preset-mc-app` will no longer inherit this vulnerability in their dependency tree.
10
+
11
+ **Breaking change:** Projects that use `ENABLE_BABEL_PLUGIN_ISTANBUL=true` for code coverage instrumentation must now explicitly install `babel-plugin-istanbul` as a dev dependency:
12
+
13
+ ```sh
14
+ pnpm add -D babel-plugin-istanbul
15
+ ```
16
+
17
+ A runtime check has been added that provides a clear error message if coverage is enabled but the plugin is not installed. Projects that do not use Istanbul coverage instrumentation are not affected.
18
+
19
+ ## 25.2.0
20
+
21
+ ### Patch Changes
22
+
23
+ - [#3923](https://github.com/commercetools/merchant-center-application-kit/pull/3923) [`3b47e62`](https://github.com/commercetools/merchant-center-application-kit/commit/3b47e62fc0d7f63ac9fbf05fba907e4ac5705f41) Thanks [@tylermorrisford](https://github.com/tylermorrisford)! - Adds overrides for two transient dependencies.
24
+
25
+ - [#3927](https://github.com/commercetools/merchant-center-application-kit/pull/3927) [`246ba28`](https://github.com/commercetools/merchant-center-application-kit/commit/246ba28620cea5b3ce14567e7ec721cc87401fb0) Thanks [@misama-ct](https://github.com/misama-ct)! - Fix SNYK-JS-INFLIGHT-6095116 vulnerability by removing dependencies on the deprecated `inflight` package.
26
+
27
+ - [#3922](https://github.com/commercetools/merchant-center-application-kit/pull/3922) [`4d19484`](https://github.com/commercetools/merchant-center-application-kit/commit/4d19484452f0955c84ecd4d13f1949bdfbdeadbf) Thanks [@tylermorrisford](https://github.com/tylermorrisford)! - Adds override for transient dependency security issue.
28
+
29
+ - [#3924](https://github.com/commercetools/merchant-center-application-kit/pull/3924) [`a19546c`](https://github.com/commercetools/merchant-center-application-kit/commit/a19546c7d145da501b8e6d922664c2adaafad524) Thanks [@tylermorrisford](https://github.com/tylermorrisford)! - Adds override for tar package version.
30
+
3
31
  ## 25.1.0
4
32
 
5
33
  ## 25.0.0
package/create.js CHANGED
@@ -52,6 +52,18 @@ module.exports = function createBabePresetConfigForMcApp(api, opts = {}, env) {
52
52
  const isIstanbulPluginEnabled =
53
53
  process.env.ENABLE_BABEL_PLUGIN_ISTANBUL === 'true';
54
54
 
55
+ if (isIstanbulPluginEnabled) {
56
+ try {
57
+ require.resolve('babel-plugin-istanbul');
58
+ } catch (e) {
59
+ throw new Error(
60
+ 'Coverage instrumentation is enabled (ENABLE_BABEL_PLUGIN_ISTANBUL=true) ' +
61
+ 'but babel-plugin-istanbul is not installed. ' +
62
+ 'Install it with: pnpm add -D babel-plugin-istanbul'
63
+ );
64
+ }
65
+ }
66
+
55
67
  return {
56
68
  presets: [
57
69
  isEnvTest && [
@@ -198,8 +210,6 @@ module.exports = function createBabePresetConfigForMcApp(api, opts = {}, env) {
198
210
  // https://emotion.sh/docs/@emotion/babel-preset-css-prop
199
211
  options.runtime === 'automatic' &&
200
212
  require('@emotion/babel-plugin').default,
201
- // Cherry-pick Lodash modules
202
- require('babel-plugin-lodash').default,
203
213
  isIstanbulPluginEnabled && [
204
214
  require('babel-plugin-istanbul').default,
205
215
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercetools-frontend/babel-preset-mc-app",
3
- "version": "25.1.0",
3
+ "version": "26.0.0",
4
4
  "description": "Babel preset used by a MC application",
5
5
  "bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
6
6
  "repository": {
@@ -42,14 +42,20 @@
42
42
  "@emotion/babel-plugin": "^11.13.5",
43
43
  "@emotion/babel-preset-css-prop": "^11.12.0",
44
44
  "babel-plugin-dev-expression": "^0.2.3",
45
- "babel-plugin-istanbul": "7.0.1",
46
45
  "babel-plugin-formatjs": "^10.5.25",
47
- "babel-plugin-lodash": "^3.3.4",
48
46
  "babel-plugin-macros": "^3.1.0",
49
47
  "babel-plugin-preval": "^5.1.0",
50
48
  "babel-plugin-transform-react-remove-prop-types": "^0.4.24",
51
49
  "core-js": "^3.32.2"
52
50
  },
51
+ "peerDependencies": {
52
+ "babel-plugin-istanbul": "^7.0.0"
53
+ },
54
+ "peerDependenciesMeta": {
55
+ "babel-plugin-istanbul": {
56
+ "optional": true
57
+ }
58
+ },
53
59
  "engines": {
54
60
  "node": "18.x || 20.x || >=22.0.0"
55
61
  }