Skip to content

Commit

Permalink
[Breaking] Changes for upcoming v21 release (#2430)
Browse files Browse the repository at this point in the history
* refactor: app config required fields, menu links structure, drop deprecated menu.json support

* refactor(cli): options of build and compile-html commands

* refactor(test-utils): remove deprecated options, change some default flags

* feat(test-utils): add helper mapResourceAccessToAppliedPermissions

* feat(app-config): expose helper functions for entryPointUriPath

* refactor: migrate starter template and adjust create-mc-app patching logic

* chore: drop node v12

* docs: update changesets

* fix: ts error

* fix(mc-scripts): typos

* fix: better defaults in test-utils

* fix: node engine

* test: fix assertions

* test: fix assertions

* test: fix more tests setup

* test: fix assertions

* refactor(playground): remove unnecessary test

* fix: prettier

* refactor: expose entryPoint helpers from app-shell

* fix: expose helpers from new ssr entry point

* refactor(schema): validate entryPointUriPath using regex

* fix: fake url placeholder

* chore: leftover

* fix: placeholder url

* test: always use the new loginByOidc command

* chore: min node 14"

* refactor(cypress): improve logs

* fix(cypress): navigate to channels page using link

* chore: remove unnecessary types dependency

* chore: missing env vars

* refactor(create-mc-app): improve validations

* fix(starter): provide initial project key

* fix(ci): missing env vars

* fix(ci): remove whitespace

* fix(create-mc-app): missing dep

* fix(create-mc-app): allow to pass initial project key via CLI option

* fix(create-mc-app): allow to skip prompts with default values using --yes option

* fix(cypress): try to have a more stable percy snapshot

* refactor: disable percy snapshot for starter welcome page

* chore: prerelease mode

* docs: update refs

* ci(changesets): version packages (rc) (#2454)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* refactor: use version range for Babel packages

* chore: ignore .cache folder from tests

* docs(assets): update readme

* chore: upgrade to eslint v8

* docs: changeset

* refactor: apply suggestions from code review

Co-authored-by: Tobias Deekens <[email protected]>

* chore: update eslint deps to latest

* fix: eslint types resolution

* fix: keep callback function for waitForElementToBeRemoved

* chore: fix eslint deps

* ci(changesets): version packages (rc) (#2456)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore: include .nvmrc in starter template

* fix(mc-scripts): include webpack fallback polyfills for url and querystring

* chore(mc-scripts): upgrade react-dev-utils to v12

* ci(changesets): version packages (rc) (#2457)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* docs(application-config): add links to doc for schema properties

* refactor(constants): the applicationId is required

* refactor(mc-scripts): remove webpack workaround and migrate deprecated dev server function call

* docs: update readme/package.json links to docs specific pages

* fix: compilation errors

* test: fixes

* feat(app-shell): enforce 'view' permission check for main application route (#2459)

* feat(app-shell): enforce 'view' permission check for main application route

* test: disable permission check in most of the internal tests

* ci(changesets): version packages (rc) (#2458)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix(mc-scripts): webpackdevserver deprecation warnings

* fix: unset initialProjectKey for account app

* ci(changesets): version packages (rc) (#2460)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore: upgrade gatsby/docs dependencies

* refactor: clean up props

* refactor(babel-preset): update dependencies and comments

* refactor(app-shell): make onRegisterErrorListeners optional

* fix: eslint config setup

* ci(changesets): version packages (rc) (#2462)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* refactor: improve test-utils defaults

* ci(changesets): version packages (rc) (#2463)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: eslint config depends on babel preset, define more preconfigured babel preset entry points by environment

* refactor(mc-scripts): adjust webpack dev server error message for /api/graphql route

* ci(changesets): version packages (rc) (#2464)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore: update peer deps min versions

* chore: update lockfile

* Upgrade to Stylelint v14 (#2465)

* chore: upgrade stylelint to v14

* docs: update readme of jest-stylelint-runner

* refactor: remove stylelint support for css-in-js

* fix: lint only css files

* fix(stylelint): ignore some rules

* ci(changesets): version packages (rc) (#2466)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* refactor(webpack): update css-loader to v6, support both .mod.css and .module.css (#2467)

* refactor(webpack): update css-loader to v6, support both .mod.css and .module.css

* fix(webpack): use correct option

* ci(changesets): version packages (rc) (#2468)

* chore: exit prerelease mode

Co-authored-by: CT Release Bot <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Tobias Deekens <[email protected]>
  • Loading branch information
4 people authored Feb 2, 2022
1 parent 84d891b commit bb1f7d7
Show file tree
Hide file tree
Showing 224 changed files with 7,156 additions and 7,020 deletions.
6 changes: 6 additions & 0 deletions .changeset/cool-seals-decide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@commercetools-frontend/babel-preset-mc-app': patch
'@commercetools-frontend/eslint-config-mc-app': patch
---

ESLint config depends on Babel preset. Add pre-configured entry points for Babel preset for different environments.
5 changes: 5 additions & 0 deletions .changeset/eight-hornets-hope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@commercetools-frontend/cypress': major
---

The peer dependency min version for `cypress` is now `8`.
18 changes: 18 additions & 0 deletions .changeset/fresh-crabs-join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
'merchant-center-application-template-starter': major
'@commercetools-frontend/application-config': major
'@commercetools-frontend/application-shell': major
'playground': major
'@commercetools-local/visual-testing-app': major
---

Following breaking changes were introduced:

- New required fields in the Custom Application config.
- Menu links structure in Custom Application config changed a bit.
- The `ENABLE_OIDC_FOR_DEVELOPMENT` is now the default behavior.
- The deprecated `menu.json` file and the `DEV_ONLY_` props have been removed.

Note that if you were testing your Custom Application with Cypress, you need to use the `@commercetools-frontend/cypress` package to be able to use the `cy.loginByOidc` command.

For more information see [Release notes v21](https://docs.commercetools.com/custom-applications/releases/2022-01-31-custom-applications-v21).
5 changes: 5 additions & 0 deletions .changeset/friendly-dodos-sing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@commercetools-frontend/mc-scripts': patch
---

Upgrade `react-dev-utils` to `v12`
5 changes: 5 additions & 0 deletions .changeset/hip-days-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@commercetools-frontend/eslint-config-mc-app': patch
---

Fix config setup
15 changes: 15 additions & 0 deletions .changeset/hungry-bobcats-relax.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
'merchant-center-application-template-starter': major
'@commercetools-frontend/application-config': major
'@commercetools-frontend/application-shell': major
'@commercetools-frontend/application-shell-connectors': major
'@commercetools-frontend/create-mc-app': major
'@commercetools-frontend/cypress': major
'@commercetools-frontend/mc-dev-authentication': major
'@commercetools-frontend/mc-html-template': major
'@commercetools-frontend/mc-scripts': major
'playground': major
'@commercetools-local/visual-testing-app': major
---

Drop Node.js `v12`. Recommended min Node.js version is `v14` or `v16`.
15 changes: 15 additions & 0 deletions .changeset/large-knives-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
'merchant-center-application-template-starter': major
'@commercetools-frontend/create-mc-app': major
'@commercetools-frontend/cypress': major
'playground': major
---

Following breaking changes were introduced:

- The starter template has been updated to use the new Org-level Custom Application features.
- The Custom Application config of the starter template has been converted from `.json` to `.mjs`, to allow importing and referencing constants.
- When installing the starter template using the `create-mc-app` CLI, the Custom Application config is updated with some of the user inputs, like `entryPointUriPath`.
- If no `entryPointUriPath` is provided, a random one is assigned.

For more information see [Release notes v21](https://docs.commercetools.com/custom-applications/releases/2022-01-31-custom-applications-v21).
6 changes: 6 additions & 0 deletions .changeset/lovely-mugs-arrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@commercetools-frontend/application-config': patch
'@commercetools-frontend/application-shell': patch
---

Unset `initialProjectKey` for `account` app.
18 changes: 18 additions & 0 deletions .changeset/many-tables-appear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
'merchant-center-application-template-starter': major
'@commercetools-frontend/mc-dev-authentication': major
'@commercetools-frontend/mc-html-template': major
'@commercetools-frontend/mc-scripts': major
'playground': major
'@commercetools-local/visual-testing-app': major
---

Following breaking changes were introduced:

- In `mc-scripts`, the `build` command additionally compiles the `index.html` by default.
- Running the `compile-html` command by default should not be necessary anymore. However, you can pass `--build-only` to the `build` command to opt-out of the compilation step, in case you want to run it separately, for example to use the `--transformer`.
- Running the `compile-html` command by default does not print to `stdout` the JSON string with the security headers. You can opt into the old behavior by passing the `--print-security-headers` option.
- The `--inline-csp` of `compile-html` has been dropped, as it's now the built-in behavior.
- The `dist` folder created by the `build` command has been removed. Instead, the `build` command writes the production bundles directly into the `public` folder.

For more information see [Release notes v21](https://docs.commercetools.com/custom-applications/releases/2022-01-31-custom-applications-v21).
35 changes: 35 additions & 0 deletions .changeset/moody-queens-shout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
'merchant-center-application-template-starter': patch
'@commercetools-backend/express': patch
'@commercetools-backend/loggers': patch
'@commercetools-frontend/actions-global': patch
'@commercetools-frontend/application-components': patch
'@commercetools-frontend/application-config': patch
'@commercetools-frontend/application-shell': patch
'@commercetools-frontend/application-shell-connectors': patch
'@commercetools-frontend/babel-preset-mc-app': patch
'@commercetools-frontend/browser-history': patch
'@commercetools-frontend/constants': patch
'@commercetools-frontend/create-mc-app': patch
'@commercetools-frontend/cypress': patch
'@commercetools-frontend/eslint-config-mc-app': patch
'@commercetools-frontend/i18n': patch
'@commercetools-frontend/jest-preset-mc-app': patch
'@commercetools-frontend/jest-stylelint-runner': patch
'@commercetools-frontend/l10n': patch
'@commercetools-frontend/mc-dev-authentication': patch
'@commercetools-frontend/mc-html-template': patch
'@commercetools-frontend/mc-scripts': patch
'@commercetools-frontend/notifications': patch
'@commercetools-frontend/permissions': patch
'@commercetools-frontend/react-notifications': patch
'@commercetools-frontend/sdk': patch
'@commercetools-frontend/sentry': patch
'@commercetools-frontend/url-utils': patch
'playground': patch
'@commercetools-local/visual-testing-app': patch
'@commercetools-website/custom-applications': patch
'@commercetools-website/components-playground': patch
---

Use version range for Babel packages.
5 changes: 5 additions & 0 deletions .changeset/neat-seahorses-flash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@commercetools-frontend/mc-scripts': patch
---

Fix WebpackDevServer deprecation warnings
5 changes: 5 additions & 0 deletions .changeset/nice-points-breathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@commercetools-frontend/application-shell': major
---

The peer dependencies min version for `@testing-library/react` is now `12` and for `@testing-library/react-hooks` is now `7`.
5 changes: 5 additions & 0 deletions .changeset/olive-students-jump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@commercetools-frontend/mc-scripts': minor
---

Update `css-loader` to `v6`. Support both `.mod.css` and `.module.css` for CSS module files.
5 changes: 5 additions & 0 deletions .changeset/polite-glasses-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@commercetools-frontend/application-shell': minor
---

The application `View` permission is automatically applied to the `project` object, based on the `environment.entryPointUriPath` value. You can always override the permission values by explicitly assigning `project.allAppliedPermissions`.
6 changes: 6 additions & 0 deletions .changeset/popular-avocados-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@commercetools-frontend/application-shell': minor
'@commercetools-frontend/constants': minor
---

The `applicationId` is required.
5 changes: 5 additions & 0 deletions .changeset/popular-ears-beam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@commercetools-frontend/mc-scripts': patch
---

Include fallback polyfills in Webpack config for `url` and `querystring`.
65 changes: 65 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"mode": "exit",
"tag": "rc",
"initialVersions": {
"merchant-center-application-template-starter": "18.3.14",
"@commercetools-backend/express": "20.12.3",
"@commercetools-backend/loggers": "20.12.3",
"@commercetools-frontend/actions-global": "20.12.3",
"@commercetools-frontend/application-components": "20.13.0",
"@commercetools-frontend/application-config": "20.12.3",
"@commercetools-frontend/application-shell": "20.13.0",
"@commercetools-frontend/application-shell-connectors": "20.12.3",
"@commercetools-frontend/assets": "20.12.3",
"@commercetools-frontend/babel-preset-mc-app": "20.12.3",
"@commercetools-frontend/browser-history": "20.12.3",
"@commercetools-frontend/constants": "20.12.3",
"@commercetools-frontend/create-mc-app": "20.10.6",
"@commercetools-frontend/cypress": "20.13.0",
"@commercetools-frontend/eslint-config-mc-app": "20.12.3",
"@commercetools-frontend/i18n": "20.13.0",
"@commercetools-frontend/jest-preset-mc-app": "20.12.3",
"@commercetools-frontend/jest-stylelint-runner": "20.12.3",
"@commercetools-frontend/l10n": "20.12.3",
"@commercetools-frontend/mc-dev-authentication": "20.10.6",
"@commercetools-frontend/mc-html-template": "20.12.3",
"@commercetools-frontend/mc-scripts": "20.13.0",
"@commercetools-frontend/notifications": "20.12.3",
"@commercetools-frontend/permissions": "20.12.3",
"@commercetools-frontend/react-notifications": "20.12.3",
"@commercetools-frontend/sdk": "20.12.3",
"@commercetools-frontend/sentry": "20.12.3",
"@commercetools-frontend/url-utils": "20.12.3",
"playground": "18.6.5",
"@commercetools-local/visual-testing-app": "18.2.3",
"@commercetools-website/custom-applications": "18.3.9",
"@commercetools-website/components-playground": "17.1.14"
},
"changesets": [
"cool-seals-decide",
"dull-mails-poke",
"eight-hornets-hope",
"fresh-crabs-join",
"friendly-dodos-sing",
"hip-days-fix",
"hungry-bobcats-relax",
"large-knives-turn",
"lovely-mugs-arrive",
"many-tables-appear",
"moody-queens-shout",
"neat-seahorses-flash",
"nice-points-breathe",
"olive-students-jump",
"polite-glasses-listen",
"popular-avocados-obey",
"popular-ears-beam",
"red-days-do",
"red-guests-sneeze",
"tall-dolls-study",
"thin-cows-develop",
"thirty-eyes-listen",
"tidy-lemons-film",
"tricky-hornets-remain",
"young-mayflies-obey"
]
}
12 changes: 12 additions & 0 deletions .changeset/red-days-do.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'@commercetools-frontend/jest-stylelint-runner': major
'@commercetools-frontend/mc-scripts': major
---

Upgrade Stylelint and PostCSS dependencies.

The peer dependency min version for `stylelint` is now `14`. If your project has a Stylelint config file, we recommend to follow the [Migrating to 14.0.0 guide](https://github.com/stylelint/stylelint/blob/main/docs/migration-guide/to-14.md).

> Note that the syntax support for CSS-in-JS languages has been removed from Stylelint and therefore is not available by default in the `jest-stylelint-runner`.
Moreover, the `postcss-color-mod-function` dependency has been removed, as the `color-mod()` function is [not part of the CSS Color spec](https://github.com/w3c/csswg-drafts/commit/034b063697c3dadf144504f52e0858a79cd84414) anymore. If you were relying on this function you need to find another solution.
5 changes: 5 additions & 0 deletions .changeset/red-guests-sneeze.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@commercetools-frontend/application-shell': patch
---

Make `onRegisterErrorListeners` optional
Loading

1 comment on commit bb1f7d7

@vercel
Copy link

@vercel vercel bot commented on bb1f7d7 Feb 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.