@commercetools-frontend/jest-preset-mc-app 27.9.0 → 27.9.2
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/CHANGELOG.md +84 -0
- package/jest-preset.js +4 -1
- package/load-config.js +5 -0
- package/package.json +8 -8
- package/setup-tests.js +18 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,89 @@
|
|
|
1
1
|
# @commercetools-frontend/jest-preset-mc-app
|
|
2
2
|
|
|
3
|
+
## 27.9.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#4084](https://github.com/commercetools/merchant-center-application-kit/pull/4084) [`dfc3f1c`](https://github.com/commercetools/merchant-center-application-kit/commit/dfc3f1cf4773f6e2b4c667bb4544d0dc5614c826) Thanks [@renovate](https://github.com/apps/renovate)! - Update `babel-jest` and `babel-preset-jest`, update
|
|
8
|
+
`@commercetools/nimbus` from 3.4.0 to 3.5.0, and provide a
|
|
9
|
+
`window.matchMedia` fallback for jsdom compatibility.
|
|
10
|
+
|
|
11
|
+
Update `serialize-javascript` to 7.1.0.
|
|
12
|
+
|
|
13
|
+
- Updated dependencies []:
|
|
14
|
+
- @commercetools-frontend/babel-preset-mc-app@27.9.2
|
|
15
|
+
|
|
16
|
+
## 27.9.1
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [#4077](https://github.com/commercetools/merchant-center-application-kit/pull/4077) [`959d69e`](https://github.com/commercetools/merchant-center-application-kit/commit/959d69e609263f5a6486c1060954ec5a379f0cb5) Thanks [@ByronDWall](https://github.com/ByronDWall)! - Batch-consolidated patch/minor Renovate dependency updates (rate-limited dashboard backlog, ~116 items reviewed).
|
|
21
|
+
|
|
22
|
+
The `@flopflip/*` 15.1.7 → 15.1.11 bump pulls in `@launchdarkly/js-client-sdk` v4 as a
|
|
23
|
+
transitive dependency, replacing the unscoped `launchdarkly-js-client-sdk` v3. This is a
|
|
24
|
+
breaking change for `SetupFlopFlipProvider` in `application-shell`:
|
|
25
|
+
|
|
26
|
+
- The LaunchDarkly user context type now requires either a `key` or `anonymous: true`,
|
|
27
|
+
never an optional `key`. `getUserContextForLaunchDarklyAdapter` now returns an
|
|
28
|
+
anonymous context when there's no authenticated user, instead of a context with an
|
|
29
|
+
undefined `key`.
|
|
30
|
+
- `sdk.clientOptions.sendEventsOnlyForVariation` was removed; the new SDK's `allFlags`
|
|
31
|
+
no longer sends analytics events by default, which was the entire point of that option.
|
|
32
|
+
|
|
33
|
+
`@commercetools/composable-commerce-test-data` 13.12.0 → 13.13.1 pulling in
|
|
34
|
+
`@faker-js/faker` v10 (which dropped its CJS build) was previously allowlisted in the
|
|
35
|
+
root `jest.test.config.js`'s `transformIgnorePatterns`, but `jest-preset-mc-app`'s own
|
|
36
|
+
preset — the one actually consumed by the standalone starter templates
|
|
37
|
+
(`application-templates/starter{,-typescript}`, `custom-views-templates/starter{,-typescript}`)
|
|
38
|
+
— has its own separate `transformIgnorePatterns` and was missed, so their CI jobs kept
|
|
39
|
+
failing with `Cannot use import statement outside a module`. Added `@faker-js/faker`
|
|
40
|
+
to that preset's allowlist too.
|
|
41
|
+
|
|
42
|
+
Bumped the following, each a real `dependencies` entry (not `devDependencies`) of the listed package(s), so each gets a version bump here:
|
|
43
|
+
|
|
44
|
+
- `@flopflip/*` (combine-adapters, http-adapter, launchdarkly-adapter, memory-adapter, react-broadcast, types) 15.1.7 → 15.1.11 — `application-shell` (all six), `application-components` (`react-broadcast`)
|
|
45
|
+
- `@pmmmwh/react-refresh-webpack-plugin` 0.6.1 → 0.6.2 — `mc-scripts`
|
|
46
|
+
- `@radix-ui/react-dialog` 1.1.14 → 1.1.23, `@types/react-dom` ^19.0.2 → ^19.2.4 — `application-components`
|
|
47
|
+
- `semver` 7.7.2 → 7.8.5, `uuid` 14.0.0 → 14.0.1 — `cypress`
|
|
48
|
+
- `@rollup/pluginutils` 5.2.0 → 5.4.0, `graphql` 16.11.0 → 16.14.2, `html-webpack-plugin` 5.6.3 → 5.6.8, `mini-css-extract-plugin` 2.9.4 → 2.10.2, `postcss` 8.5.23 → 8.5.26, `react-refresh` 0.17.0 → 0.18.0 — `mc-scripts` (`webpack` 5.105.1 → 5.109.2 was reverted; see below)
|
|
49
|
+
- `graphql` 16.11.0 → 16.14.2, `uuid` 14.0.0 → 14.0.1 — `application-shell-connectors`
|
|
50
|
+
- `cosmiconfig` 9.0.0 → 9.0.2, `graphql` 16.11.0 → 16.14.2 — `jest-preset-mc-app` (the `jest`/`babel-jest`/`babel-preset-jest`/`jest-environment-jsdom`/`jest-mock` bump was reverted; see the pnpm-regression/typecheck fix commits on this branch for why)
|
|
51
|
+
- `@types/react-dom` ^19.0.2 → ^19.2.4 — `react-notifications`, `application-shell` (also `@reduxjs/toolkit` 2.9.0 → 2.12.0, `graphql` 16.11.0 → 16.14.2, `uuid` 14.0.0 → 14.0.1)
|
|
52
|
+
- `typescript` 5.9.2 → 5.9.3 — `eslint-config-mc-app`, `eslint-config-node`
|
|
53
|
+
- `semver` 7.7.2 → 7.8.5 — `create-mc-app`
|
|
54
|
+
- `uuid` 14.0.0 → 14.0.1 — `sdk`
|
|
55
|
+
- `@formatjs/icu-messageformat-parser` 2.11.2 → 2.11.4 — `i18n`
|
|
56
|
+
- `@sentry/browser`, `@sentry/react`, `@sentry/types` 8.55.0 → 8.55.2 — `sentry`
|
|
57
|
+
- `serialize-javascript` 7.0.5 → 7.0.7 — `mc-html-template`
|
|
58
|
+
- `ajv` 8.18.0 → 8.20.0, `cosmiconfig` 9.0.0 → 9.0.2, `cosmiconfig-typescript-loader` 6.1.0 → 6.3.0 — `application-config`
|
|
59
|
+
- `winston` 3.17.0 → 3.19.0 — `loggers`
|
|
60
|
+
|
|
61
|
+
Other updates in this batch (`@testing-library/*`, `@manypkg/cli`, `@percy/cypress`, `@percy/puppeteer`, `@preconstruct/cli`, `@apollo/client`, `jest`, `jest-each`, `react`, `react-dom`, `react-redux`, `@commercetools/nimbus`, `@commercetools/composable-commerce-test-data`, `@percy/cli`, `@percy/core`, `@changesets/*`, `rimraf`, `sentry-testkit`, `start-server-and-test`, `fflate`, `formik`, `qs`, `node`, `pnpm`, and GitHub Actions digest/version pins) only touch devDependencies, `peerDependencies`, root-level repo tooling, CI configuration, or private template/playground packages, so they don't require a version bump here.
|
|
62
|
+
|
|
63
|
+
`webpack` 5.105.1 → 5.109.2 was reverted: webpack's `ProgressPlugin` now defers option-schema validation from the constructor to a `compiler.hooks.validate` tap, reading `this.options` at that later point instead of validating the raw constructor args immediately. `webpackbar@5.0.2` (unmaintained, used by `mc-scripts`'s dev config via `new WebpackBar()`) calls `super({ activeModules: true })` and then immediately overwrites `this.options` with its own `name`/`color`/`reporters`/`reporter` keys — none of which are in `ProgressPlugin`'s schema. With eager validation this was masked; with the new deferred validation it fails every `mc-scripts start`/dev build with "Invalid options object. Progress Plugin has been initialized using an options object that does not match the API schema." Held back at 5.105.1 until `webpackbar` is fixed/replaced or dropped in favor of webpack's now-built-in progress bar.
|
|
64
|
+
|
|
65
|
+
- [#4081](https://github.com/commercetools/merchant-center-application-kit/pull/4081) [`cf89841`](https://github.com/commercetools/merchant-center-application-kit/commit/cf898418eddf3dbde7275d44705cd751bdc87c37) Thanks [@ByronDWall](https://github.com/ByronDWall)! - Trivial ecosystem-churn dependency migrations pass: bumped several major-version dependencies whose API surface is either unchanged for our usage or only needed a mechanical import fix, verified via the full test/typecheck/build suite (see PR description for the per-dependency breakdown and the ones that were dropped after turning out not to be mechanical).
|
|
66
|
+
|
|
67
|
+
- `glob` 10.x → 13.x (`mc-scripts`, `codemod`)
|
|
68
|
+
- `dotenv` 16.x → 17.x (`mc-scripts`)
|
|
69
|
+
- `fs-extra` 10.x → 11.x (`mc-scripts`)
|
|
70
|
+
- `jwt-decode` 3.x → 4.x (`mc-scripts`, `application-shell`) — named export migration
|
|
71
|
+
- `open` 10.x → 11.x (`mc-scripts`)
|
|
72
|
+
- `webpackbar` 5.x → 7.x (`mc-scripts`)
|
|
73
|
+
- `thread-loader` 3.x → 4.x (`mc-scripts`)
|
|
74
|
+
- `svg-url-loader` 7.x → 8.x (`mc-scripts`)
|
|
75
|
+
- `jscodeshift` 0.16.x → 17.x (`codemod`) — versioning-scheme renumbering, not a real breaking jump
|
|
76
|
+
- `downshift` 6.x → 9.x (`application-shell`)
|
|
77
|
+
- `fuse.js` 6.x → 7.x (`application-shell`)
|
|
78
|
+
- `memoize-one` 5.x → 6.x (`application-shell`)
|
|
79
|
+
- `qss` 2.x → 3.x (`application-shell`, `sdk`, `browser-history`)
|
|
80
|
+
- `unfetch` 4.x → 5.x (`application-shell`, `sdk`, `jest-preset-mc-app`)
|
|
81
|
+
- `reselect` 4.x → 5.x (`react-notifications`)
|
|
82
|
+
- `@manypkg/get-packages` 1.x → 3.x (`cypress`)
|
|
83
|
+
|
|
84
|
+
- Updated dependencies []:
|
|
85
|
+
- @commercetools-frontend/babel-preset-mc-app@27.9.1
|
|
86
|
+
|
|
3
87
|
## 27.9.0
|
|
4
88
|
|
|
5
89
|
### Patch Changes
|
package/jest-preset.js
CHANGED
|
@@ -42,7 +42,10 @@ module.exports = {
|
|
|
42
42
|
url: 'https://mc.europe-west1.gcp.commercetools.com/',
|
|
43
43
|
},
|
|
44
44
|
testPathIgnorePatterns: ['node_modules', 'cypress'],
|
|
45
|
-
|
|
45
|
+
// `uuid` and `@faker-js/faker` ship ESM-only builds; allowlist them (plus
|
|
46
|
+
// pnpm's `.pnpm` nesting segment) so Babel still transforms them instead of
|
|
47
|
+
// Jest choking on their `import` syntax.
|
|
48
|
+
transformIgnorePatterns: ['node_modules/(?!(uuid|@faker-js/faker|\\.pnpm))'],
|
|
46
49
|
testRegex: '\\.spec\\.jsx?$',
|
|
47
50
|
transform: {
|
|
48
51
|
'^.+\\.(js|jsx|mjs|ts|tsx)$': defaultTransformBabelJest,
|
package/load-config.js
CHANGED
|
@@ -20,6 +20,11 @@ const defaultConfig = {
|
|
|
20
20
|
/.*"importFrom" and "exportTo" will be removed in a future version of postcss-custom-properties.*/,
|
|
21
21
|
/.*Browserslist: caniuse-lite is outdated.*/,
|
|
22
22
|
/.*Browserslist: browsers data \(caniuse-lite\) is \d+ months old.*/,
|
|
23
|
+
// @apollo/client v3.14 deprecated `onCompleted`/`onError` on `useQuery`
|
|
24
|
+
// (recommends deriving state from `data`/`error` in a `useEffect`
|
|
25
|
+
// instead). Silenced pending a migration of existing `onCompleted`/
|
|
26
|
+
// `onError` usages (e.g. `am-i-logged-in.tsx`); the options still work.
|
|
27
|
+
/.*go\.apollo\.dev\/c\/err#.*(onCompleted|onError).*/,
|
|
23
28
|
],
|
|
24
29
|
notThrowWarnings: [
|
|
25
30
|
/.*@commercetools-frontend\/permissions.*/,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/jest-preset-mc-app",
|
|
3
|
-
"version": "27.9.
|
|
3
|
+
"version": "27.9.2",
|
|
4
4
|
"description": "Jest preset used by a MC application",
|
|
5
5
|
"bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
6
6
|
"repository": {
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"@formatjs/intl-pluralrules": "^5.2.5",
|
|
31
31
|
"@sheerun/mutationobserver-shim": "0.3.3",
|
|
32
32
|
"@testing-library/jest-dom": "^6.6.3",
|
|
33
|
-
"babel-jest": "30.
|
|
34
|
-
"babel-preset-jest": "30.
|
|
33
|
+
"babel-jest": "30.4.1",
|
|
34
|
+
"babel-preset-jest": "30.4.0",
|
|
35
35
|
"colors": "1.4.0",
|
|
36
|
-
"cosmiconfig": "9.0.
|
|
37
|
-
"graphql": "16.
|
|
36
|
+
"cosmiconfig": "9.0.2",
|
|
37
|
+
"graphql": "16.14.2",
|
|
38
38
|
"graphql-tag": "^2.12.6",
|
|
39
39
|
"identity-obj-proxy": "3.0.0",
|
|
40
40
|
"intl": "1.2.5",
|
|
@@ -45,11 +45,11 @@
|
|
|
45
45
|
"jest-watch-typeahead": "3.0.1",
|
|
46
46
|
"raf": "3.4.1",
|
|
47
47
|
"setimmediate": "1.0.5",
|
|
48
|
-
"unfetch": "
|
|
49
|
-
"@commercetools-frontend/babel-preset-mc-app": "^27.9.
|
|
48
|
+
"unfetch": "5.0.0",
|
|
49
|
+
"@commercetools-frontend/babel-preset-mc-app": "^27.9.2"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@testing-library/react": "16.
|
|
52
|
+
"@testing-library/react": "16.3.2",
|
|
53
53
|
"jest": "30.2.0"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
package/setup-tests.js
CHANGED
|
@@ -22,3 +22,21 @@ Object.defineProperty(window, 'TextDecoder', {
|
|
|
22
22
|
writable: true,
|
|
23
23
|
value: util.TextDecoder,
|
|
24
24
|
});
|
|
25
|
+
|
|
26
|
+
if (!window.matchMedia) {
|
|
27
|
+
Object.defineProperty(window, 'matchMedia', {
|
|
28
|
+
writable: true,
|
|
29
|
+
value: (query) => ({
|
|
30
|
+
matches: false,
|
|
31
|
+
media: query,
|
|
32
|
+
onchange: null,
|
|
33
|
+
addListener() {},
|
|
34
|
+
removeListener() {},
|
|
35
|
+
addEventListener() {},
|
|
36
|
+
removeEventListener() {},
|
|
37
|
+
dispatchEvent() {
|
|
38
|
+
return false;
|
|
39
|
+
},
|
|
40
|
+
}),
|
|
41
|
+
});
|
|
42
|
+
}
|