From f05d07e685c66d9c0bf792187bb18cd6984b579a Mon Sep 17 00:00:00 2001 From: p_0g_8mm3_ <37022952+pr0gr8mm3r@users.noreply.github.com> Date: Mon, 24 Jan 2022 21:12:57 +0100 Subject: [PATCH 01/25] Make component category translatable --- .../DynamicZone/components/ComponentPicker/Category/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/core/admin/admin/src/content-manager/components/DynamicZone/components/ComponentPicker/Category/index.js b/packages/core/admin/admin/src/content-manager/components/DynamicZone/components/ComponentPicker/Category/index.js index bb41d92dcd..745e095afa 100644 --- a/packages/core/admin/admin/src/content-manager/components/DynamicZone/components/ComponentPicker/Category/index.js +++ b/packages/core/admin/admin/src/content-manager/components/DynamicZone/components/ComponentPicker/Category/index.js @@ -4,6 +4,7 @@ import { Accordion, AccordionToggle, AccordionContent } from '@strapi/design-sys import { Box } from '@strapi/design-system/Box'; import styled from 'styled-components'; import ComponentCard from './ComponentCard'; +import { useIntl } from 'react-intl'; const Grid = styled.div` display: grid; @@ -12,6 +13,8 @@ const Grid = styled.div` `; const Category = ({ category, components, isOdd, isOpen, onAddComponent, onToggle }) => { + const { formatMessage } = useIntl(); + const handleToggle = () => { onToggle(category); }; @@ -20,7 +23,7 @@ const Category = ({ category, components, isOdd, isOpen, onAddComponent, onToggl From dc95212332ec3b97616f8e2772fc06e523a57731 Mon Sep 17 00:00:00 2001 From: p_0g_8mm3_ <37022952+pr0gr8mm3r@users.noreply.github.com> Date: Mon, 24 Jan 2022 21:20:34 +0100 Subject: [PATCH 02/25] fix import order --- .../DynamicZone/components/ComponentPicker/Category/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/admin/admin/src/content-manager/components/DynamicZone/components/ComponentPicker/Category/index.js b/packages/core/admin/admin/src/content-manager/components/DynamicZone/components/ComponentPicker/Category/index.js index 745e095afa..42d29dc841 100644 --- a/packages/core/admin/admin/src/content-manager/components/DynamicZone/components/ComponentPicker/Category/index.js +++ b/packages/core/admin/admin/src/content-manager/components/DynamicZone/components/ComponentPicker/Category/index.js @@ -3,8 +3,8 @@ import PropTypes from 'prop-types'; import { Accordion, AccordionToggle, AccordionContent } from '@strapi/design-system/Accordion'; import { Box } from '@strapi/design-system/Box'; import styled from 'styled-components'; -import ComponentCard from './ComponentCard'; import { useIntl } from 'react-intl'; +import ComponentCard from './ComponentCard'; const Grid = styled.div` display: grid; From a49141679c6eda6fe80b48554eb36c45f35df489 Mon Sep 17 00:00:00 2001 From: WalkingPizza Date: Fri, 28 Jan 2022 22:03:23 +0100 Subject: [PATCH 03/25] Handle user not found error in email confirmation --- packages/plugins/users-permissions/server/controllers/auth.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/plugins/users-permissions/server/controllers/auth.js b/packages/plugins/users-permissions/server/controllers/auth.js index d1b4e5c37d..c9dfd6ade4 100644 --- a/packages/plugins/users-permissions/server/controllers/auth.js +++ b/packages/plugins/users-permissions/server/controllers/auth.js @@ -422,6 +422,10 @@ module.exports = { where: { email: params.email }, }); + if (!user) { + throw new ApplicationError('user.not.found'); + } + if (user.confirmed) { throw new ApplicationError('already.confirmed'); } From b8753c9d358d271b94e3d04cead4f3c7f15c9f73 Mon Sep 17 00:00:00 2001 From: Gustav Hansen Date: Mon, 31 Jan 2022 09:36:03 +0100 Subject: [PATCH 04/25] Docs: Update contributing guide --- CONTRIBUTING.md | 90 ++++++++++++++++++++++++------------------------- 1 file changed, 44 insertions(+), 46 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c3093a7757..3540a301f4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contribute to Strapi -Strapi is an open-source project administered by [the Strapi team](https://strapi.io/company). We appreciate your interest and efforts to contribute to Strapi. +Strapi is an open-source project administered by [the Strapi team](https://strapi.io/about-us). We appreciate your interest and efforts to contribute to Strapi. All efforts to contribute are highly appreciated, we recommend you talk to a maintainer prior to spending a lot of time making a pull request that may not align with the project roadmap. @@ -14,23 +14,23 @@ The core team and the contributors send pull requests which go through the same Feature Requests by the community are highly encouraged. Please feel free to submit a [feature request](https://portal.productboard.com/strapi) or to upvote 👍 [an existing feature request](https://portal.productboard.com/strapi) in the ProductBoard. -## RFCs +## Request For Comments (RFCs) -Some important changes in Strapi require some thoughts to be put into the design phase before starting working on a PR. +Larger changes in Strapi require a thourough design phase before starting working on a PR. -The RFC (Request For Comments) process will help us create consensus among the core team and include as much feedback as possible from the community, for these upcoming changes. +The Request For Comments (RFC) process will help us create consensus among the core team and include as much feedback as possible from the community, for these upcoming changes. -Before contributing, you will probably have to create a RFC on this [strapi/rfcs](https://github.com/strapi/rfcs) repo. +Before contributing larger chunks of code that might affect core functionalities, you will have to create a public RFC on the [strapi/rfcs](https://github.com/strapi/rfcs) repository. ## Code of Conduct -This project and everyone participating in it are governed by the [Strapi Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please read the [full text](CODE_OF_CONDUCT.md) so that you can read which actions may or may not be tolerated. +This project and everyone participating in it, are governed by the [Strapi Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold it. Make sure to read the [full text](CODE_OF_CONDUCT.md), to understand which type of actions may or may not be tolerated. ## Contributor License Agreement (CLA) ### Individual -In order to accept your pull request, we need you to submit a CLA. You only need to do this once. If you are submitting a pull request for the first time, you can complete your CLA [here](https://cla.strapi.io/strapi/strapi) or just submit a Pull Request and our CLA Bot will ask you to sign the CLA before merging your Pull Request. +In order to accept your pull request, we need you to submit a CLA. You only need to do this once. If you are submitting a pull request for the first time, you can complete your CLA [here](https://cla.strapi.io/strapi/strapi) or just submit a pull request and our CLA Bot will ask you to sign the CLA before merging it. ### Company @@ -38,11 +38,11 @@ If you are making contributions to our repositories on behalf of your company, t ## Documentation -Pull requests relating to fixing documentation for the latest release should be directed towards the [documentation repo](https://github.com/strapi/documentation). Please see the documentation [contributing guide](https://github.com/strapi/documentation/blob/main/CONTRIBUTING.md) for more information on how to make the documentation pull request. +Pull requests relating to fixing documentation for the latest release should be directed towards the [documentation repo](https://github.com/strapi/documentation). Please see the documentation [contributing guide](https://github.com/strapi/documentation/blob/main/CONTRIBUTING.md) for more information. ## Bugs -We are using [GitHub Issues](https://github.com/strapi/strapi/issues) to manage our public bugs. We keep a close eye on this so before filing a new issue, try to make sure the problem does not already exist. +We are using [GitHub Issues](https://github.com/strapi/strapi/issues) to manage our public bugs. We keep a close eye on them. Before filing a new issue, try to make sure your problem does not already exist. --- @@ -53,31 +53,30 @@ The core team will review your pull request and will either merge it, request ch **Before submitting your pull request** make sure the following requirements are fulfilled: - Fork the repository and create your branch from `master`. -- Run `yarn setup` in the repository root. -- If you’ve fixed a bug or added code that should be tested, add the tests and then link the corresponding issue in either your commit or your PR! +- Run `yarn setup` in the root of the repository. +- If you’ve fixed a bug or added code that should be tested, please make sure to add tests - Ensure the test suites are passing: - `yarn test:unit` - `yarn test:front` - Make sure your code lints (`yarn lint`). +- If your contribution fixes an existing issue, please make sure to link it in your pull request. ## Contribution Prerequisites -- You have [Node](https://nodejs.org/en/) at >= v12 and <= v16 and [Yarn](https://yarnpkg.com/en/) at v1.2.0+. -- You are familiar with Git. +- You have [Node.js](https://nodejs.org/en/) at version >= v12 and <= v16 and [Yarn](https://yarnpkg.com/en/) at v1.2.0+ installed. +- You are familiar with [Git](https://git-scm.com). ## Development Workflow _For users running on Apple Silicon M1, you may encounter errors thrown by `sharp`. You may need to re-install `libvps` or to build `sharp` manually following [this issue comment](https://github.com/lovell/sharp/issues/2460#issuecomment-751491241) in order to start the project._ -To facilitate the contribution, we have drastically reduced the amount of commands necessary to install the entire development environment. +First of all, you need to check if you are using the [required versions of Node.js and npm](https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/deployment.html). -First of all, you need to check if you're using the [required versions of Node.js and npm](https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/deployment.html). - -Then, please follow the instructions below: +Now, please follow the instructions below: #### 1. Fork the [repository](https://github.com/strapi/strapi) -[Go to the repository](https://github.com/strapi/strapi) and fork it to your own GitHub account. +[Go to the repository](https://github.com/strapi/strapi) and fork it using your own GitHub account. #### 2. Clone from your repository @@ -87,32 +86,32 @@ git clone git@github.com:YOUR_USERNAME/strapi.git #### 3. Install the dependencies -Go to the root of the repository. +Go to the root of the repository and run the common setup: ```bash -cd strapi && yarn setup +cd strapi +yarn setup ``` #### 4. Start the example application -To start a test example application to test your changes quickly and also for the next step. - ```bash -cd strapi/examples/getstarted && yarn develop -``` - -Read the `getstarted` application README [here](./examples/getstarted/README.md) for more details. - -#### 5. Running the administration panel in development mode - -**Start the administration panel server for development** - -```bash -cd strapi/packages/strapi-admin +cd ./examples/getstarted yarn develop ``` -The administration panel will be available at http://localhost:4000/admin +Make sure to read the [`getstarted` application README](./examples/getstarted/README.md) for more details. + +#### 5. Running the administration panel in development mode + +Start the administration panel server for development: + +```bash +cd ./packages/core/admin +yarn develop +``` + +The administration panel should now be available at http://localhost:4000/admin **Awesome! You are now able to contribute to Strapi.** @@ -120,10 +119,10 @@ The administration panel will be available at http://localhost:4000/admin - `yarn watch` starts yarn watch in all packages. - `yarn build` builds the `strapi-helper-plugin` (use this command when you develop in the administration panel). -- `yarn setup` installs the dependencies. +- `yarn setup` installs dependencies. - `yarn lint` lints the codebase. -- `yarn test:clean` removes the coverage. -- `yarn test:front` runs the front-end related tests. +- `yarn test:clean` removes the coverage reports. +- `yarn test:front` runs front-end related tests. - `yarn test:front:watch` runs an interactive test watcher for the front-end. - `yarn test:unit` runs the back-end unit tests. - `yarn test:e2e` runs an end-to-end test suite. @@ -138,7 +137,6 @@ The end-to-end tests require a Strapi app to be able to run. You can generate a ```bash $ yarn test:generate-app sqlite -$ yarn test:generate-app mongo $ yarn test:generate-app postgres $ yarn test:generate-app mysql ``` @@ -155,18 +153,18 @@ $ node test/e2e.js --db=postgres $ node test/e2e.js --db=mysql ``` -**Running the tests for the CE** +**Running the tests for the Community Editon (CE)** -The test suites will run the tests for the EE version of Strapi. Should you want to test the CE version you will need to use the ENV variable `STRAPI_DISABLE_EE`: +The test suites will run the tests for the Enterprise Edition (EE) version of Strapi. Should you want to test the Community Edition (CE) version you will need to set the environment variable `STRAPI_DISABLE_EE`: ```bash $ STRAPI_DISABLE_EE=true node test/e2e.js $ STRAPI_DISABLE_EE=true yarn test:e2e ``` -**Specifying a license to use for the EE e2e tests** +**Specifying a license to use for the Enterprise Edition (EE) e2e tests** -The EE tests need a valid license to run correctly. To specify which license to use you can use `STRAPI_LICENSE`. You can specify it in an env file or as a prefix to the cli command: +The Enterprise Edition tests need a valid license to run correctly. To specify which license to use you can use the environment variable `STRAPI_LICENSE`. You can specify it either in an environment file or before running the CLI command: ```bash $ STRAPI_LICENSE= node test/e2e.js @@ -179,18 +177,18 @@ $ STRAPI_LICENSE= yarn test:e2e ### Repository Organization -We chose to use a monorepo design that exploits [Yarn Workspaces](https://yarnpkg.com/en/docs/workspaces) in the way [React](https://github.com/facebook/react/tree/master/packages) or [Babel](https://github.com/babel/babel/tree/master/packages) does. This allows the community to easily maintain the whole ecosystem, keep it up-to-date and consistent. +We chose to use a monorepo design using [Yarn Workspaces](https://yarnpkg.com/en/docs/workspaces) in the way [React](https://github.com/facebook/react/tree/master/packages) or [Babel](https://github.com/babel/babel/tree/master/packages) does. This allows us to maintain the whole ecosystem, keep it up-to-date and consistent. -We do our best to keep the master branch as clean as possible, with tests passing at all times. However, it may happen that the master branch moves faster than the release cycle. Therefore check the [releases on npm](https://www.npmjs.com/package/strapi) so that you're always up-to-date with the latest stable version. +We do our best to keep the master branch as clean as possible, with tests passing at all times. However, it may happen that the master branch moves faster than the release cycle. Therefore check the [releases on npm](https://www.npmjs.com/package/@strapi/strapi) so that you are always up-to-date with the latest stable version. ### Reporting an issue Before submitting an issue you need to make sure: -- You are experiencing a concrete technical issue with Strapi. +- You are experiencing a technical issue with Strapi. - You have already searched for related [issues](https://github.com/strapi/strapi/issues), and found none open (if you found a related _closed_ issue, please link to it from your post). - You are not asking a question about how to use Strapi or about whether or not Strapi has a certain feature. For general help using Strapi, you may: - - Refer to [the official Strapi documentation](https://strapi.io). + - Refer to [the official Strapi documentation](https://docs.strapi.io). - Ask a member of the community in the [Strapi Discord Community](https://discord.strapi.io/). - Ask a question on [our community forum](https://forum.strapi.io). - Your issue title is concise, on-topic and polite. From 253849654281b5bdec96887f81b25c879788d291 Mon Sep 17 00:00:00 2001 From: Gustav Hansen Date: Fri, 4 Feb 2022 10:53:23 +0100 Subject: [PATCH 05/25] Update CONTRIBUTING.md Co-authored-by: Pierre Wizla --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3540a301f4..c9a03927bd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,7 +16,7 @@ Feature Requests by the community are highly encouraged. Please feel free to sub ## Request For Comments (RFCs) -Larger changes in Strapi require a thourough design phase before starting working on a PR. +Larger changes in Strapi require a thorough design phase before starting working on a PR. The Request For Comments (RFC) process will help us create consensus among the core team and include as much feedback as possible from the community, for these upcoming changes. From 96a6dec1fe795ee76379525a9027c8d68f0df5e7 Mon Sep 17 00:00:00 2001 From: Gustav Hansen Date: Fri, 4 Feb 2022 10:53:38 +0100 Subject: [PATCH 06/25] Update CONTRIBUTING.md Co-authored-by: Pierre Wizla --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c9a03927bd..d40fe52553 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -30,7 +30,7 @@ This project and everyone participating in it, are governed by the [Strapi Code ### Individual -In order to accept your pull request, we need you to submit a CLA. You only need to do this once. If you are submitting a pull request for the first time, you can complete your CLA [here](https://cla.strapi.io/strapi/strapi) or just submit a pull request and our CLA Bot will ask you to sign the CLA before merging it. +In order to accept your pull request, we need you to submit a CLA. You only need to do this once. If you are submitting a pull request for the first time, you can complete your CLA [here](https://cla.strapi.io/strapi/strapi) or just submit a pull request and our CLA bot will ask you to sign the CLA before merging it. ### Company From 336330abd6ff6e57242ee36ae879852fb3de1014 Mon Sep 17 00:00:00 2001 From: Gustav Hansen Date: Fri, 4 Feb 2022 10:53:45 +0100 Subject: [PATCH 07/25] Update CONTRIBUTING.md Co-authored-by: Pierre Wizla --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d40fe52553..f674a76691 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -24,7 +24,7 @@ Before contributing larger chunks of code that might affect core functionalities ## Code of Conduct -This project and everyone participating in it, are governed by the [Strapi Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold it. Make sure to read the [full text](CODE_OF_CONDUCT.md), to understand which type of actions may or may not be tolerated. +This project, and everyone participating in it, are governed by the [Strapi Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold it. Make sure to read the [full text](CODE_OF_CONDUCT.md) to understand which type of actions may or may not be tolerated. ## Contributor License Agreement (CLA) From e9790c758ad5d982a7fb7273685754ad69feaf03 Mon Sep 17 00:00:00 2001 From: Gustav Hansen Date: Fri, 4 Feb 2022 11:00:22 +0100 Subject: [PATCH 08/25] Docs: Make introduction more concise --- CONTRIBUTING.md | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3540a301f4..00c12833f8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,18 +1,12 @@ # Contribute to Strapi -Strapi is an open-source project administered by [the Strapi team](https://strapi.io/about-us). We appreciate your interest and efforts to contribute to Strapi. +Strapi is an open-source project administered by [the Strapi team](https://strapi.io/about-us). We appreciate your interest and efforts to contribute to Strapi. See the [LICENSE](https://github.com/strapi/strapi/blob/master/LICENSE) licensing information. All work done is available on GitHub. -All efforts to contribute are highly appreciated, we recommend you talk to a maintainer prior to spending a lot of time making a pull request that may not align with the project roadmap. - -## Open Development & Community Driven - -Strapi is an open-source project. See the [LICENSE](https://github.com/strapi/strapi/blob/master/LICENSE) file for licensing information. All the work done is available on GitHub. - -The core team and the contributors send pull requests which go through the same validation process. +We highly appreciate your effort to contribute, but we recommend you to talk to a maintainer prior to spending a lot of time making a pull request that may not align with the project roadmap. Every pull request, whether is from strapi or contributors, goes through the same process. ## Feature Requests -Feature Requests by the community are highly encouraged. Please feel free to submit a [feature request](https://portal.productboard.com/strapi) or to upvote 👍 [an existing feature request](https://portal.productboard.com/strapi) in the ProductBoard. +Feature Requests by the community are highly encouraged. Feel free to submit a new one or upvote an existing feature request on [ProductBoard](https://portal.productboard.com/strapi). ## Request For Comments (RFCs) From 03f34f4a8f14f2a7e2e1524a99c9b87bb7cf8459 Mon Sep 17 00:00:00 2001 From: Gustav Hansen Date: Fri, 4 Feb 2022 11:19:40 +0100 Subject: [PATCH 09/25] Docs: Improve wording --- CONTRIBUTING.md | 94 +++++++++++++++++++++++-------------------------- 1 file changed, 44 insertions(+), 50 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6a2b8a1224..99322608d4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,13 +8,13 @@ We highly appreciate your effort to contribute, but we recommend you to talk to Feature Requests by the community are highly encouraged. Feel free to submit a new one or upvote an existing feature request on [ProductBoard](https://portal.productboard.com/strapi). -## Request For Comments (RFCs) +## Request For Comments (RFC) -Larger changes in Strapi require a thorough design phase before starting working on a PR. +Larger chunks of changes in Strapi, that might effect many users, require a thorough design phase before starting working on a PR. -The Request For Comments (RFC) process will help us create consensus among the core team and include as much feedback as possible from the community, for these upcoming changes. +The Request For Comments process will help us create consensus among the core team and include as much feedback as possible from the community, for these upcoming changes. -Before contributing larger chunks of code that might affect core functionalities, you will have to create a public RFC on the [strapi/rfcs](https://github.com/strapi/rfcs) repository. +Request For Comments have to be created on the [strapi/rfcs](https://github.com/strapi/rfcs) repository. ## Code of Conduct @@ -22,72 +22,66 @@ This project, and everyone participating in it, are governed by the [Strapi Code ## Contributor License Agreement (CLA) -### Individual +### Individual contribution -In order to accept your pull request, we need you to submit a CLA. You only need to do this once. If you are submitting a pull request for the first time, you can complete your CLA [here](https://cla.strapi.io/strapi/strapi) or just submit a pull request and our CLA bot will ask you to sign the CLA before merging it. +In order to accept your pull request, you need to submit a Contributor License Agreement (CLA). You only need to do this once. If you are submitting a pull request for the first time, you can complete your CLA [here](https://cla.strapi.io/strapi/strapi) or submit a pull request and our CLA bot will automatically ask you to sign before merging the pull request. -### Company +### Company contribution If you are making contributions to our repositories on behalf of your company, then we will need a Corporate Contributor License Agreement (CLA) signed. In order to do that, please contact us at [contributions@strapi.io](mailto:contributions@strapi.io). ## Documentation -Pull requests relating to fixing documentation for the latest release should be directed towards the [documentation repo](https://github.com/strapi/documentation). Please see the documentation [contributing guide](https://github.com/strapi/documentation/blob/main/CONTRIBUTING.md) for more information. +Pull requests related to fixing documentation for the latest release should be directed towards the [documentation repository](https://github.com/strapi/documentation). Please follow the [documentation contributing guide](https://github.com/strapi/documentation/blob/main/CONTRIBUTING.md) for more information. ## Bugs -We are using [GitHub Issues](https://github.com/strapi/strapi/issues) to manage our public bugs. We keep a close eye on them. Before filing a new issue, try to make sure your problem does not already exist. +Strapi is using [GitHub issues](https://github.com/strapi/strapi/issues) to manage bugs. We keep a close eye on them. Before filing a new issue, try to make sure your problem does not already exist. --- ## Before Submitting a Pull Request -The core team will review your pull request and will either merge it, request changes to it, or close it. - -**Before submitting your pull request** make sure the following requirements are fulfilled: - -- Fork the repository and create your branch from `master`. -- Run `yarn setup` in the root of the repository. -- If you’ve fixed a bug or added code that should be tested, please make sure to add tests -- Ensure the test suites are passing: - - `yarn test:unit` - - `yarn test:front` -- Make sure your code lints (`yarn lint`). -- If your contribution fixes an existing issue, please make sure to link it in your pull request. +The Strapi core team will review your pull request and either merge it, request changes to it, or close it. ## Contribution Prerequisites - You have [Node.js](https://nodejs.org/en/) at version >= v12 and <= v16 and [Yarn](https://yarnpkg.com/en/) at v1.2.0+ installed. - You are familiar with [Git](https://git-scm.com). +**Before submitting your pull request** make sure the following requirements are fulfilled: + +- Fork the repository and create your new branch from `master`. +- Run `yarn setup` in the root of the repository. +- If you’ve fixed a bug or added code that should be tested, please make sure to add tests +- Ensure the following test suites are passing: + - `yarn test:unit` + - `yarn test:front` +- Make sure your code lints by running `yarn lint`. +- If your contribution fixes an existing issue, please make sure to link it in your pull request. + ## Development Workflow -_For users running on Apple Silicon M1, you may encounter errors thrown by `sharp`. You may need to re-install `libvps` or to build `sharp` manually following [this issue comment](https://github.com/lovell/sharp/issues/2460#issuecomment-751491241) in order to start the project._ - -First of all, you need to check if you are using the [required versions of Node.js and npm](https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/deployment.html). - -Now, please follow the instructions below: - -#### 1. Fork the [repository](https://github.com/strapi/strapi) +### 1. Fork the [repository](https://github.com/strapi/strapi) [Go to the repository](https://github.com/strapi/strapi) and fork it using your own GitHub account. -#### 2. Clone from your repository +### 2. Clone your repository ```bash git clone git@github.com:YOUR_USERNAME/strapi.git ``` -#### 3. Install the dependencies +### 3. Install the dependencies -Go to the root of the repository and run the common setup: +Go to the root of the repository and run the setup: ```bash cd strapi yarn setup ``` -#### 4. Start the example application +### 4. Start the example application ```bash cd ./examples/getstarted @@ -96,7 +90,7 @@ yarn develop Make sure to read the [`getstarted` application README](./examples/getstarted/README.md) for more details. -#### 5. Running the administration panel in development mode +### 5. Running the administration panel in development mode Start the administration panel server for development: @@ -105,11 +99,11 @@ cd ./packages/core/admin yarn develop ``` -The administration panel should now be available at http://localhost:4000/admin +The administration panel should now be available at http://localhost:4000/admin. Make sure the example application (step 4) is still running. **Awesome! You are now able to contribute to Strapi.** -#### 6. Available commands +### 6. Available commands - `yarn watch` starts yarn watch in all packages. - `yarn build` builds the `strapi-helper-plugin` (use this command when you develop in the administration panel). @@ -125,7 +119,7 @@ The administration panel should now be available at http://localhost:4000/admin --- -## Running the e2e tests +## Running the End-To-End (e2e) tests The end-to-end tests require a Strapi app to be able to run. You can generate a "test app" using `yarn test:generate-app `: @@ -135,9 +129,9 @@ $ yarn test:generate-app postgres $ yarn test:generate-app mysql ``` -You require a new app every time you run the tests. Otherwise, the test suite will fail. A script is available to make this process easier: `node test/e2e.js`. It'll delete the current test app, generate a new one, and run the test suite. +A new app is required every time you run the end-to-end tests< otherwise, the test suite will fail. A script is available to make this process easier: `node test/e2e.js`. It will delete the current test app, generate a new one and run the test suite. -**Changing the database:** +### Changing the database By default the script `test/e2e,js` creates an app that uses `sqlite`. But you can run the test suites using different databases: @@ -147,18 +141,18 @@ $ node test/e2e.js --db=postgres $ node test/e2e.js --db=mysql ``` -**Running the tests for the Community Editon (CE)** +### Running the tests for the Community Editon (CE)\*\* -The test suites will run the tests for the Enterprise Edition (EE) version of Strapi. Should you want to test the Community Edition (CE) version you will need to set the environment variable `STRAPI_DISABLE_EE`: +The test suites are running the tests for the Enterprise Edition (EE) version of Strapi by default. Should you want to test the Community Edition (CE) version, you will need to set the environment variable `STRAPI_DISABLE_EE` to true: ```bash $ STRAPI_DISABLE_EE=true node test/e2e.js $ STRAPI_DISABLE_EE=true yarn test:e2e ``` -**Specifying a license to use for the Enterprise Edition (EE) e2e tests** +### Specifying a license to use for the Enterprise Edition (EE) -The Enterprise Edition tests need a valid license to run correctly. To specify which license to use you can use the environment variable `STRAPI_LICENSE`. You can specify it either in an environment file or before running the CLI command: +The Enterprise Edition tests need a valid license to run correctly. To specify a license you can use the environment variable `STRAPI_LICENSE`: ```bash $ STRAPI_LICENSE= node test/e2e.js @@ -182,17 +176,17 @@ Before submitting an issue you need to make sure: - You are experiencing a technical issue with Strapi. - You have already searched for related [issues](https://github.com/strapi/strapi/issues), and found none open (if you found a related _closed_ issue, please link to it from your post). - You are not asking a question about how to use Strapi or about whether or not Strapi has a certain feature. For general help using Strapi, you may: - - Refer to [the official Strapi documentation](https://docs.strapi.io). + - Refer to the [official Strapi documentation](https://docs.strapi.io). - Ask a member of the community in the [Strapi Discord Community](https://discord.strapi.io/). - - Ask a question on [our community forum](https://forum.strapi.io). + - Ask a question on the [Strapi community forum](https://forum.strapi.io). - Your issue title is concise, on-topic and polite. -- You can and do provide steps to reproduce your issue. +- You provide steps to reproduce the issue. - You have tried all the following (if relevant) and your issue remains: - Make sure you have the right application started. - Make sure the [issue template](.github/ISSUE_TEMPLATE) is respected. - Make sure your issue body is readable and [well formatted](https://guides.github.com/features/mastering-markdown). - - Make sure you've killed the Strapi server with CTRL+C and started it again. - - Make sure the application you are using to reproduce the issue has a clean `node_modules` directory, meaning: - - no dependencies are linked (e.g. you haven't run `yarn link`) - - that you haven't made any inline changes to files in the `node_modules` folder - - that you don't have any weird global dependency loops. The easiest way to double-check any of the above, if you aren't sure, is to run: `$ rm -rf node_modules && yarn cache clean && yarn`. + - Make sure you've stopped the Strapi server with CTRL+C and restarted it. + - Make sure your application has a clean `node_modules` directory, meaning: + - you didn't linkt any dependencies (e.g. by running `yarn link`) + - you haven't made any inline changes to files in the `node_modules` directory + - you don't have any global dependency loops. The easiest way to double-check any of the above, if you aren't sure, is to run: `$ rm -rf node_modules && yarn cache clean && yarn setup`. From 79fd16cd239d4f5d94173972f170a14f5c7a91b2 Mon Sep 17 00:00:00 2001 From: Eggwise Date: Wed, 2 Mar 2022 10:58:17 +0100 Subject: [PATCH 10/25] Add snake_case param for validating generate input --- .../generators/generators/lib/plops/utils/validate-input.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/generators/generators/lib/plops/utils/validate-input.js b/packages/generators/generators/lib/plops/utils/validate-input.js index 3be8d9a1c4..45c72f1a2d 100644 --- a/packages/generators/generators/lib/plops/utils/validate-input.js +++ b/packages/generators/generators/lib/plops/utils/validate-input.js @@ -1,10 +1,10 @@ 'use strict'; -module.exports = input => { - const regex = /^[A-Za-z-]+$/g; +module.exports = (input, allowSnakeCase = false) => { + const regex = allowSnakeCase ? /^[A-Za-z-|_]+$/g : /^[A-Za-z-]+$/g; if (!input) { - return 'You must provide an input'; + return "You must provide an input"; } return regex.test(input) || "Please use only letters, '-' and no spaces"; From 79c5733019c09d99e839faa59cda48187b30739b Mon Sep 17 00:00:00 2001 From: Eggwise Date: Wed, 2 Mar 2022 11:02:27 +0100 Subject: [PATCH 11/25] Allow snake_case in validation for content type attr --- .../generators/lib/plops/prompts/get-attributes-prompts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/generators/generators/lib/plops/prompts/get-attributes-prompts.js b/packages/generators/generators/lib/plops/prompts/get-attributes-prompts.js index b14b18f5e5..3ae51071c8 100644 --- a/packages/generators/generators/lib/plops/prompts/get-attributes-prompts.js +++ b/packages/generators/generators/lib/plops/prompts/get-attributes-prompts.js @@ -50,7 +50,7 @@ module.exports = async inquirer => { type: 'input', name: 'attributeName', message: 'Name of attribute', - validate: input => validateInput(input), + validate: input => validateInput(input, true), }, { type: 'list', From 81cbf3b690b1e6543845219b356e01a83ec81620 Mon Sep 17 00:00:00 2001 From: Luan Date: Wed, 2 Mar 2022 23:33:22 -0300 Subject: [PATCH 12/25] fix: sanitization of date type in query param --- .../core/utils/lib/convert-query-params.js | 5 +++ .../graphql/tests/fields/date.test.e2e.js | 32 +++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/packages/core/utils/lib/convert-query-params.js b/packages/core/utils/lib/convert-query-params.js index 314c8f0cb6..cd0e428ea4 100644 --- a/packages/core/utils/lib/convert-query-params.js +++ b/packages/core/utils/lib/convert-query-params.js @@ -339,6 +339,11 @@ const convertAndSanitizeFilters = (filters, schema) => { } } + // Handle dates + else if (value instanceof Date) { + return filters; + } + // Handle operators else { if (['$null', '$notNull'].includes(key)) { diff --git a/packages/plugins/graphql/tests/fields/date.test.e2e.js b/packages/plugins/graphql/tests/fields/date.test.e2e.js index 068001939c..0699b605fd 100644 --- a/packages/plugins/graphql/tests/fields/date.test.e2e.js +++ b/packages/plugins/graphql/tests/fields/date.test.e2e.js @@ -113,5 +113,37 @@ describe('Test Graphql API End to End', () => { }); } ); + + test.each(['2022-03-17', null])('Can filter query with date: %s', async value => { + const res = await graphqlQuery({ + query: /* GraphQL */ ` + query posts($data: PostInput!) { + posts(filters: { myDate: { gt: $data } }) { + data { + attributes { + myDate + } + } + } + } + `, + variables: { + data: { + myDate: value, + }, + }, + }); + + const { body } = res; + + expect(res.statusCode).toBe(200); + expect(body).toEqual({ + data: { + posts: { + data: {}, + }, + }, + }); + }); }); }); From d940c346d2784454e24e924dc247da76f4308e7e Mon Sep 17 00:00:00 2001 From: vallerydelexy Date: Fri, 4 Mar 2022 05:13:55 +0700 Subject: [PATCH 13/25] cleanup commented out block of code --- .../content-manager/pages/EditView/index.js | 188 ------------------ 1 file changed, 188 deletions(-) diff --git a/packages/core/admin/admin/src/content-manager/pages/EditView/index.js b/packages/core/admin/admin/src/content-manager/pages/EditView/index.js index b169688f5b..40f94b8170 100644 --- a/packages/core/admin/admin/src/content-manager/pages/EditView/index.js +++ b/packages/core/admin/admin/src/content-manager/pages/EditView/index.js @@ -364,194 +364,6 @@ const EditView = ({ }} ); - - // return ( - // - // {({ - // componentsDataStructure, - // contentTypeDataStructure, - // data, - // isCreatingEntry, - // isLoadingForData, - // onDelete, - // onDeleteSucceeded, - // onPost, - // onPublish, - // onPut, - // onUnpublish, - // redirectionLink, - // status, - // }) => { - // return ( - // - // - //
- //
- //
- // {formattedContentTypeLayout.map((block, blockIndex) => { - // if (isDynamicZone(block)) { - // const { - // 0: { - // 0: { name, fieldSchema, metadatas, labelIcon }, - // }, - // } = block; - // const baselineAlignementSize = blockIndex === 0 ? '3px' : '0'; - - // return ( - // - // - // - // ); - // } - - // return ( - // - // {block.map((fieldsBlock, fieldsBlockIndex) => { - // return ( - //
- // {fieldsBlock.map( - // ({ name, size, fieldSchema, labelIcon, metadatas }, fieldIndex) => { - // const isComponent = fieldSchema.type === 'component'; - - // if (isComponent) { - // const { component, max, min, repeatable = false } = fieldSchema; - // const componentUid = fieldSchema.component; - - // return ( - // - // ); - // } - - // return ( - //
- // - //
- // ); - // } - // )} - //
- // ); - // })} - //
- // ); - // })} - //
- //
- // - // - // {currentContentTypeLayoutData.layouts.editRelations.length > 0 && ( - // - //
- // {currentContentTypeLayoutData.layouts.editRelations.map( - // ({ name, fieldSchema, labelIcon, metadatas, queryInfos }) => { - // return ( - // - // ); - // } - // )} - //
- //
- // )} - // - //
    - // - // { - // // trackUsage('willEditContentTypeLayoutFromEditView'); - // }} - // /> - // - // {slug !== 'strapi::administrator' && ( - // - // { - // trackUsage('willEditEditLayout'); - // }} - // icon="fa-cog" - // url={`/plugins/content-type-builder/content-types/${slug}`} - // /> - // - // )} - // {/* TODO add DOCUMENTATION */} - // - - // {allowedActions.canDelete && ( - // - // )} - //
- //
- //
- //
- // - // - // ); - // }} - // - // ); }; EditView.defaultProps = { From c8880cfdd3761bfb5a9111d649bbfaad10277328 Mon Sep 17 00:00:00 2001 From: Luan Date: Fri, 4 Mar 2022 18:22:36 -0300 Subject: [PATCH 14/25] test: datetime in GraphQL API --- .../graphql/tests/fields/datetime.test.e2e.js | 152 ++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 packages/plugins/graphql/tests/fields/datetime.test.e2e.js diff --git a/packages/plugins/graphql/tests/fields/datetime.test.e2e.js b/packages/plugins/graphql/tests/fields/datetime.test.e2e.js new file mode 100644 index 0000000000..80e2b9ced2 --- /dev/null +++ b/packages/plugins/graphql/tests/fields/datetime.test.e2e.js @@ -0,0 +1,152 @@ +'use strict'; + +// Helpers. +const { createTestBuilder } = require('../../../../../test/helpers/builder'); +const { createStrapiInstance } = require('../../../../../test/helpers/strapi'); +const { createAuthRequest } = require('../../../../../test/helpers/request'); + +const builder = createTestBuilder(); +let strapi; +let rq; +let graphqlQuery; + +const postModel = { + attributes: { + myDatetime: { + type: 'datetime', + }, + }, + singularName: 'post', + pluralName: 'posts', + displayName: 'Post', + description: '', + collectionName: '', +}; + +describe('Test Graphql API End to End', () => { + beforeAll(async () => { + await builder.addContentType(postModel).build(); + + strapi = await createStrapiInstance(); + rq = await createAuthRequest({ strapi }); + + graphqlQuery = body => { + return rq({ + url: '/graphql', + method: 'POST', + body, + }); + }; + }); + + afterAll(async () => { + await strapi.destroy(); + await builder.cleanup(); + }); + + describe('GraphQL - Datetime field', () => { + test.each(['2022-03-17T15:06:57.878Z', null])( + 'Can create an entity with date equals: %s', + async value => { + const res = await graphqlQuery({ + query: /* GraphQL */ ` + mutation createPost($data: PostInput!) { + createPost(data: $data) { + data { + attributes { + myDatetime + } + } + } + } + `, + variables: { + data: { + myDatetime: value, + }, + }, + }); + + const { body } = res; + + expect(res.statusCode).toBe(200); + expect(body).toEqual({ + data: { + createPost: { + data: { + attributes: { myDatetime: value }, + }, + }, + }, + }); + } + ); + + test.each(['2022-03-17', {}, [], 'something'])( + 'Cannot create an entity with date equals: %s', + async value => { + const res = await graphqlQuery({ + query: /* GraphQL */ ` + mutation createPost($data: PostInput!) { + createPost(data: $data) { + data { + attributes { + myDatetime + } + } + } + } + `, + variables: { + data: { + myDatetime: value, + }, + }, + }); + + const { body } = res; + + expect(res.statusCode).toBe(400); + expect(body).toMatchObject({ + errors: [ + { + extensions: { code: 'BAD_USER_INPUT' }, + }, + ], + }); + } + ); + + test.each(['2022-03-17T15:06:57.878Z', null])('Can filter query with date: %s', async value => { + const res = await graphqlQuery({ + query: /* GraphQL */ ` + query posts($data: PostInput!) { + posts(filters: { myDatetime: { gt: $data } }) { + data { + attributes { + myDatetime + } + } + } + } + `, + variables: { + data: { + myDatetime: value, + }, + }, + }); + + const { body } = res; + + expect(res.statusCode).toBe(200); + expect(body).toEqual({ + data: { + posts: { + data: {}, + }, + }, + }); + }); + }); +}); From ef888f0f81a8e4b9b4b2999394cc1f3b594407f7 Mon Sep 17 00:00:00 2001 From: Luan Date: Fri, 4 Mar 2022 18:54:24 -0300 Subject: [PATCH 15/25] test: fixes for date and datetime fields in GraphQL --- .../graphql/tests/fields/date.test.e2e.js | 12 +++++------- .../graphql/tests/fields/datetime.test.e2e.js | 18 ++++++++---------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/packages/plugins/graphql/tests/fields/date.test.e2e.js b/packages/plugins/graphql/tests/fields/date.test.e2e.js index 0699b605fd..b19a79a66c 100644 --- a/packages/plugins/graphql/tests/fields/date.test.e2e.js +++ b/packages/plugins/graphql/tests/fields/date.test.e2e.js @@ -114,11 +114,11 @@ describe('Test Graphql API End to End', () => { } ); - test.each(['2022-03-17', null])('Can filter query with date: %s', async value => { + test.each(['2022-03-17'])('Can filter query with date: %s', async value => { const res = await graphqlQuery({ query: /* GraphQL */ ` - query posts($data: PostInput!) { - posts(filters: { myDate: { gt: $data } }) { + query posts($myDate: Date!) { + posts(filters: { myDate: { gt: $myDate } }) { data { attributes { myDate @@ -128,9 +128,7 @@ describe('Test Graphql API End to End', () => { } `, variables: { - data: { - myDate: value, - }, + myDate: value, }, }); @@ -140,7 +138,7 @@ describe('Test Graphql API End to End', () => { expect(body).toEqual({ data: { posts: { - data: {}, + data: [], }, }, }); diff --git a/packages/plugins/graphql/tests/fields/datetime.test.e2e.js b/packages/plugins/graphql/tests/fields/datetime.test.e2e.js index 80e2b9ced2..76162f524f 100644 --- a/packages/plugins/graphql/tests/fields/datetime.test.e2e.js +++ b/packages/plugins/graphql/tests/fields/datetime.test.e2e.js @@ -45,8 +45,8 @@ describe('Test Graphql API End to End', () => { }); describe('GraphQL - Datetime field', () => { - test.each(['2022-03-17T15:06:57.878Z', null])( - 'Can create an entity with date equals: %s', + test.each(['2022-03-17T15:06:57.000Z', null])( + 'Can create an entity with datetime equals: %s', async value => { const res = await graphqlQuery({ query: /* GraphQL */ ` @@ -83,7 +83,7 @@ describe('Test Graphql API End to End', () => { ); test.each(['2022-03-17', {}, [], 'something'])( - 'Cannot create an entity with date equals: %s', + 'Cannot create an entity with datetime equals: %s', async value => { const res = await graphqlQuery({ query: /* GraphQL */ ` @@ -117,11 +117,11 @@ describe('Test Graphql API End to End', () => { } ); - test.each(['2022-03-17T15:06:57.878Z', null])('Can filter query with date: %s', async value => { + test.each(['2022-03-17T15:06:57.878Z'])('Can filter query with datetime: %s', async value => { const res = await graphqlQuery({ query: /* GraphQL */ ` - query posts($data: PostInput!) { - posts(filters: { myDatetime: { gt: $data } }) { + query posts($myDatetime: DateTime!) { + posts(filters: { myDatetime: { gt: $myDatetime } }) { data { attributes { myDatetime @@ -131,9 +131,7 @@ describe('Test Graphql API End to End', () => { } `, variables: { - data: { - myDatetime: value, - }, + myDatetime: value, }, }); @@ -143,7 +141,7 @@ describe('Test Graphql API End to End', () => { expect(body).toEqual({ data: { posts: { - data: {}, + data: [], }, }, }); From 506cf9e15b4dd033e2c1523744af97ab97e8aa53 Mon Sep 17 00:00:00 2001 From: Luan Date: Fri, 4 Mar 2022 18:57:14 -0300 Subject: [PATCH 16/25] refactor: apply review suggestion of generic parsing --- packages/core/utils/lib/convert-query-params.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/packages/core/utils/lib/convert-query-params.js b/packages/core/utils/lib/convert-query-params.js index cd0e428ea4..6e5102b06e 100644 --- a/packages/core/utils/lib/convert-query-params.js +++ b/packages/core/utils/lib/convert-query-params.js @@ -4,7 +4,7 @@ * Converts the standard Strapi REST query params to a more usable format for querying * You can read more here: https://docs.strapi.io/developer-docs/latest/developer-resources/database-apis-reference/rest-api.html#filters */ -const { has, isEmpty, isObject, cloneDeep, get } = require('lodash/fp'); +const { has, isEmpty, isObject, isPlainObject, cloneDeep, get } = require('lodash/fp'); const _ = require('lodash'); const parseType = require('./parse-type'); const contentTypesUtils = require('./content-types'); @@ -286,7 +286,7 @@ const convertFiltersQueryParams = (filters, schema) => { }; const convertAndSanitizeFilters = (filters, schema) => { - if (!isObject(filters)) { + if (!isPlainObject(filters)) { return filters; } @@ -339,11 +339,6 @@ const convertAndSanitizeFilters = (filters, schema) => { } } - // Handle dates - else if (value instanceof Date) { - return filters; - } - // Handle operators else { if (['$null', '$notNull'].includes(key)) { @@ -354,7 +349,7 @@ const convertAndSanitizeFilters = (filters, schema) => { } // Remove empty objects & arrays - if (isObject(filters[key]) && isEmpty(filters[key])) { + if (isPlainObject(filters[key]) && isEmpty(filters[key])) { removeOperator(key); } } From e56ff6fe3d0d80f0fa3779dbd4947b617a4ea953 Mon Sep 17 00:00:00 2001 From: Hung Viet Nguyen Date: Thu, 10 Mar 2022 01:10:57 +0700 Subject: [PATCH 17/25] Remove enzyme --- jest.base-config.front.js | 2 +- package.json | 2 -- packages/admin-test-utils/lib/setup/enzyme-setup.js | 10 ---------- .../admin-test-utils/lib/setup/styled-components.js | 3 +++ packages/admin-test-utils/package.json | 2 -- packages/core/helper-plugin/package.json | 2 -- 6 files changed, 4 insertions(+), 17 deletions(-) delete mode 100644 packages/admin-test-utils/lib/setup/enzyme-setup.js create mode 100644 packages/admin-test-utils/lib/setup/styled-components.js diff --git a/jest.base-config.front.js b/jest.base-config.front.js index da102ab937..b9565ff6a2 100644 --- a/jest.base-config.front.js +++ b/jest.base-config.front.js @@ -47,7 +47,7 @@ module.exports = { '/packages/admin-test-utils/lib/mocks/ResizeObserver.js', ], setupFilesAfterEnv: [ - '/packages/admin-test-utils/lib/setup/enzyme-setup.js', + '/packages/admin-test-utils/lib/setup/styled-components.js', '/packages/admin-test-utils/lib/setup/strapi.js', ], transform: { diff --git a/package.json b/package.json index aff2e4c7b1..501add2d5e 100644 --- a/package.json +++ b/package.json @@ -81,8 +81,6 @@ "chokidar": "3.5.3", "cross-env": "7.0.3", "dotenv": "14.2.0", - "enzyme": "3.11.0", - "enzyme-adapter-react-16": "1.15.6", "eslint": "7.32.0", "eslint-config-airbnb": "18.2.1", "eslint-config-airbnb-base": "14.2.1", diff --git a/packages/admin-test-utils/lib/setup/enzyme-setup.js b/packages/admin-test-utils/lib/setup/enzyme-setup.js deleted file mode 100644 index 2065462a11..0000000000 --- a/packages/admin-test-utils/lib/setup/enzyme-setup.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -require('jest-styled-components'); -const { configure } = require('enzyme'); -const Adapter = require('enzyme-adapter-react-16'); - -configure({ - adapter: new Adapter(), - disableLifecycleMethods: false, -}); diff --git a/packages/admin-test-utils/lib/setup/styled-components.js b/packages/admin-test-utils/lib/setup/styled-components.js new file mode 100644 index 0000000000..5a13a5c611 --- /dev/null +++ b/packages/admin-test-utils/lib/setup/styled-components.js @@ -0,0 +1,3 @@ +'use strict'; + +require('jest-styled-components'); diff --git a/packages/admin-test-utils/package.json b/packages/admin-test-utils/package.json index ecb2c1cea3..ffa458f4e1 100644 --- a/packages/admin-test-utils/package.json +++ b/packages/admin-test-utils/package.json @@ -22,8 +22,6 @@ }, "devDependencies": { "@testing-library/jest-dom": "5.16.2", - "enzyme": "3.11.0", - "enzyme-adapter-react-16": "1.15.6", "jest-styled-components": "7.0.2" }, "scripts": { diff --git a/packages/core/helper-plugin/package.json b/packages/core/helper-plugin/package.json index 013215119b..70993ecb07 100644 --- a/packages/core/helper-plugin/package.json +++ b/packages/core/helper-plugin/package.json @@ -81,8 +81,6 @@ "babel-loader": "^8.2.2", "cross-env": "^7.0.3", "date-fns": "2.22.1", - "enzyme": "3.9.0", - "enzyme-adapter-react-16": "1.15.6", "rimraf": "3.0.2" }, "peerDependencies": { From f3050126c4d09c9369581a35e7a04b83b8a1a226 Mon Sep 17 00:00:00 2001 From: Hung Viet Nguyen Date: Thu, 10 Mar 2022 15:35:01 +0700 Subject: [PATCH 18/25] Remove enzyme related packages from yarn.lock --- yarn.lock | 273 +++--------------------------------------------------- 1 file changed, 15 insertions(+), 258 deletions(-) diff --git a/yarn.lock b/yarn.lock index d6014bc9bc..619b93de93 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6332,21 +6332,6 @@ airbnb-js-shims@^2.2.1: string.prototype.padstart "^3.0.0" symbol.prototype.description "^1.0.0" -airbnb-prop-types@^2.16.0: - version "2.16.0" - resolved "https://registry.yarnpkg.com/airbnb-prop-types/-/airbnb-prop-types-2.16.0.tgz#b96274cefa1abb14f623f804173ee97c13971dc2" - integrity sha512-7WHOFolP/6cS96PhKNrslCLMYAI8yB1Pp6u6XmxozQOiZbsI5ycglZr5cHhBFfuRcQQjzCMith5ZPZdYiJCxUg== - dependencies: - array.prototype.find "^2.1.1" - function.prototype.name "^1.1.2" - is-regex "^1.1.0" - object-is "^1.1.2" - object.assign "^4.1.0" - object.entries "^1.1.2" - prop-types "^15.7.2" - prop-types-exact "^1.2.0" - react-is "^16.13.1" - ajv-errors@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/ajv-errors/-/ajv-errors-1.0.1.tgz#f35986aceb91afadec4102fbd85014950cefa64d" @@ -6760,27 +6745,7 @@ array-unique@^0.3.2: resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= -array.prototype.filter@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/array.prototype.filter/-/array.prototype.filter-1.0.1.tgz#20688792acdb97a09488eaaee9eebbf3966aae21" - integrity sha512-Dk3Ty7N42Odk7PjU/Ci3zT4pLj20YvuVnneG/58ICM6bt4Ij5kZaJTVQ9TSaWaIECX2sFyz4KItkVZqHNnciqw== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.0" - es-array-method-boxes-properly "^1.0.0" - is-string "^1.0.7" - -array.prototype.find@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/array.prototype.find/-/array.prototype.find-2.1.2.tgz#6abbd0c2573925d8094f7d23112306af8c16d534" - integrity sha512-00S1O4ewO95OmmJW7EesWfQlrCrLEL8kZ40w3+GkLX2yTt0m2ggcePPa2uHPJ9KUmJvwRq+lCV9bD8Yim23x/Q== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.0" - -array.prototype.flat@^1.2.1, array.prototype.flat@^1.2.3, array.prototype.flat@^1.2.5: +array.prototype.flat@^1.2.1, array.prototype.flat@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz#07e0975d84bbc7c48cd1879d609e682598d33e13" integrity sha512-KaYU+S+ndVqyUnignHftkwc58o3uVU1jzczILJ1tN2YaIZpFIKBiP/x/j97E5MVPsaCloPbqWLB/8qCTVvT2qg== @@ -8065,7 +8030,7 @@ cheerio-select@^1.5.0: domhandler "^4.2.0" domutils "^2.7.0" -cheerio@^1.0.0-rc.2, cheerio@^1.0.0-rc.3, cheerio@^1.0.0-rc.5: +cheerio@^1.0.0-rc.5: version "1.0.0-rc.10" resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-1.0.0-rc.10.tgz#2ba3dcdfcc26e7956fc1f440e61d51c643379f3e" integrity sha512-g0J0q/O6mW8z5zxQ3A8E8J1hUgp4SMOvEoW/x84OwyHKe/Zccz83PVT4y5Crcr530FV6NgmKI1qvGTKVl9XXVw== @@ -9660,11 +9625,6 @@ dir-glob@^3.0.1: dependencies: path-type "^4.0.0" -discontinuous-range@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/discontinuous-range/-/discontinuous-range-1.0.0.tgz#e38331f0844bba49b9a9cb71c771585aab1bc65a" - integrity sha1-44Mx8IRLukm5qctxx3FYWqsbxlo= - dkim-signer@0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/dkim-signer/-/dkim-signer-0.2.2.tgz#aa81ec071eeed3622781baa922044d7800e5f308" @@ -10099,97 +10059,6 @@ envinfo@^7.7.3, envinfo@^7.7.4: resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.8.1.tgz#06377e3e5f4d379fea7ac592d5ad8927e0c4d475" integrity sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw== -enzyme-adapter-react-16@1.15.6: - version "1.15.6" - resolved "https://registry.yarnpkg.com/enzyme-adapter-react-16/-/enzyme-adapter-react-16-1.15.6.tgz#fd677a658d62661ac5afd7f7f541f141f8085901" - integrity sha512-yFlVJCXh8T+mcQo8M6my9sPgeGzj85HSHi6Apgf1Cvq/7EL/J9+1JoJmJsRxZgyTvPMAqOEpRSu/Ii/ZpyOk0g== - dependencies: - enzyme-adapter-utils "^1.14.0" - enzyme-shallow-equal "^1.0.4" - has "^1.0.3" - object.assign "^4.1.2" - object.values "^1.1.2" - prop-types "^15.7.2" - react-is "^16.13.1" - react-test-renderer "^16.0.0-0" - semver "^5.7.0" - -enzyme-adapter-utils@^1.14.0: - version "1.14.0" - resolved "https://registry.yarnpkg.com/enzyme-adapter-utils/-/enzyme-adapter-utils-1.14.0.tgz#afbb0485e8033aa50c744efb5f5711e64fbf1ad0" - integrity sha512-F/z/7SeLt+reKFcb7597IThpDp0bmzcH1E9Oabqv+o01cID2/YInlqHbFl7HzWBl4h3OdZYedtwNDOmSKkk0bg== - dependencies: - airbnb-prop-types "^2.16.0" - function.prototype.name "^1.1.3" - has "^1.0.3" - object.assign "^4.1.2" - object.fromentries "^2.0.3" - prop-types "^15.7.2" - semver "^5.7.1" - -enzyme-shallow-equal@^1.0.1, enzyme-shallow-equal@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/enzyme-shallow-equal/-/enzyme-shallow-equal-1.0.4.tgz#b9256cb25a5f430f9bfe073a84808c1d74fced2e" - integrity sha512-MttIwB8kKxypwHvRynuC3ahyNc+cFbR8mjVIltnmzQ0uKGqmsfO4bfBuLxb0beLNPhjblUEYvEbsg+VSygvF1Q== - dependencies: - has "^1.0.3" - object-is "^1.1.2" - -enzyme@3.11.0: - version "3.11.0" - resolved "https://registry.yarnpkg.com/enzyme/-/enzyme-3.11.0.tgz#71d680c580fe9349f6f5ac6c775bc3e6b7a79c28" - integrity sha512-Dw8/Gs4vRjxY6/6i9wU0V+utmQO9kvh9XLnz3LIudviOnVYDEe2ec+0k+NQoMamn1VrjKgCUOWj5jG/5M5M0Qw== - dependencies: - array.prototype.flat "^1.2.3" - cheerio "^1.0.0-rc.3" - enzyme-shallow-equal "^1.0.1" - function.prototype.name "^1.1.2" - has "^1.0.3" - html-element-map "^1.2.0" - is-boolean-object "^1.0.1" - is-callable "^1.1.5" - is-number-object "^1.0.4" - is-regex "^1.0.5" - is-string "^1.0.5" - is-subset "^0.1.1" - lodash.escape "^4.0.1" - lodash.isequal "^4.5.0" - object-inspect "^1.7.0" - object-is "^1.0.2" - object.assign "^4.1.0" - object.entries "^1.1.1" - object.values "^1.1.1" - raf "^3.4.1" - rst-selector-parser "^2.2.3" - string.prototype.trim "^1.2.1" - -enzyme@3.9.0: - version "3.9.0" - resolved "https://registry.yarnpkg.com/enzyme/-/enzyme-3.9.0.tgz#2b491f06ca966eb56b6510068c7894a7e0be3909" - integrity sha512-JqxI2BRFHbmiP7/UFqvsjxTirWoM1HfeaJrmVSZ9a1EADKkZgdPcAuISPMpoUiHlac9J4dYt81MC5BBIrbJGMg== - dependencies: - array.prototype.flat "^1.2.1" - cheerio "^1.0.0-rc.2" - function.prototype.name "^1.1.0" - has "^1.0.3" - html-element-map "^1.0.0" - is-boolean-object "^1.0.0" - is-callable "^1.1.4" - is-number-object "^1.0.3" - is-regex "^1.0.4" - is-string "^1.0.4" - is-subset "^0.1.1" - lodash.escape "^4.0.1" - lodash.isequal "^4.5.0" - object-inspect "^1.6.0" - object-is "^1.0.1" - object.assign "^4.1.0" - object.entries "^1.0.4" - object.values "^1.0.4" - raf "^3.4.0" - rst-selector-parser "^2.2.3" - string.prototype.trim "^1.1.2" - err-code@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/err-code/-/err-code-2.0.3.tgz#23c2f3b756ffdfc608d30e27c9a941024807e7f9" @@ -11501,7 +11370,7 @@ function-bind@^1.1.1: resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== -function.prototype.name@^1.1.0, function.prototype.name@^1.1.2, function.prototype.name@^1.1.3: +function.prototype.name@^1.1.0: version "1.1.5" resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.5.tgz#cce0505fe1ffb80503e6f9e46cc64e46a12a9621" integrity sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA== @@ -12449,14 +12318,6 @@ hpack.js@^2.1.6: readable-stream "^2.0.1" wbuf "^1.1.0" -html-element-map@^1.0.0, html-element-map@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/html-element-map/-/html-element-map-1.3.1.tgz#44b2cbcfa7be7aa4ff59779e47e51012e1c73c08" - integrity sha512-6XMlxrAFX4UEEGxctfFnmrFaaZFNf9i5fNuV5wZ3WWQ4FVaNP1aX1LkX9j2mfEx1NpjeE/rL3nmgEn23GdFmrg== - dependencies: - array.prototype.filter "^1.0.0" - call-bind "^1.0.2" - html-encoding-sniffer@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz#42a6dc4fd33f00281176e8b23759ca4e4fa185f3" @@ -13118,7 +12979,7 @@ is-bluebird@^1.0.2: resolved "https://registry.yarnpkg.com/is-bluebird/-/is-bluebird-1.0.2.tgz#096439060f4aa411abee19143a84d6a55346d6e2" integrity sha1-CWQ5Bg9KpBGr7hkUOoTWpVNG1uI= -is-boolean-object@^1.0.0, is-boolean-object@^1.0.1, is-boolean-object@^1.1.0: +is-boolean-object@^1.1.0: version "1.1.2" resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== @@ -13136,7 +12997,7 @@ is-buffer@^2.0.0, is-buffer@^2.0.5: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== -is-callable@^1.1.4, is-callable@^1.1.5, is-callable@^1.2.4: +is-callable@^1.1.4, is-callable@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== @@ -13332,7 +13193,7 @@ is-node-process@^1.0.1: resolved "https://registry.yarnpkg.com/is-node-process/-/is-node-process-1.0.1.tgz#4fc7ac3a91e8aac58175fe0578abbc56f2831b23" integrity sha512-5IcdXuf++TTNt3oGl9EBdkvndXA8gmc4bz/Y+mdEpWh3Mcn/+kOw6hI7LD5CocqJWMzeb0I0ClndRVNdEPuJXQ== -is-number-object@^1.0.3, is-number-object@^1.0.4: +is-number-object@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.6.tgz#6a7aaf838c7f0686a50b4553f7e54a96494e89f0" integrity sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g== @@ -13408,7 +13269,7 @@ is-potential-custom-element-name@^1.0.1: resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== -is-regex@^1.0.4, is-regex@^1.0.5, is-regex@^1.1.0, is-regex@^1.1.2, is-regex@^1.1.4: +is-regex@^1.0.4, is-regex@^1.1.2, is-regex@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== @@ -13470,18 +13331,13 @@ is-stream@^2.0.0: resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== -is-string@^1.0.4, is-string@^1.0.5, is-string@^1.0.7: +is-string@^1.0.5, is-string@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== dependencies: has-tostringtag "^1.0.0" -is-subset@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-subset/-/is-subset-0.1.1.tgz#8a59117d932de1de00f245fcdd39ce43f1e939a6" - integrity sha1-ilkRfZMt4d4A8kX83TnOQ/HpOaY= - is-symbol@^1.0.2, is-symbol@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" @@ -15001,16 +14857,6 @@ lodash.deburr@^4.1.0: resolved "https://registry.yarnpkg.com/lodash.deburr/-/lodash.deburr-4.1.0.tgz#ddb1bbb3ef07458c0177ba07de14422cb033ff9b" integrity sha1-3bG7s+8HRYwBd7oH3hRCLLAz/5s= -lodash.escape@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/lodash.escape/-/lodash.escape-4.0.1.tgz#c9044690c21e04294beaa517712fded1fa88de98" - integrity sha1-yQRGkMIeBClL6qUXcS/e0fqI3pg= - -lodash.flattendeep@^4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2" - integrity sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI= - lodash.get@^4.4.2: version "4.4.2" resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" @@ -15026,11 +14872,6 @@ lodash.isboolean@^3.0.3: resolved "https://registry.yarnpkg.com/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz#6c2e171db2a257cd96802fd43b01b20d5f5870f6" integrity sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY= -lodash.isequal@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" - integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA= - lodash.isinteger@^4.0.4: version "4.0.4" resolved "https://registry.yarnpkg.com/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz#619c0af3d03f8b04c31f5882840b77b11cd68343" @@ -16039,11 +15880,6 @@ mongoose@^5.5.13: sift "13.5.2" sliced "1.0.1" -moo@^0.5.0: - version "0.5.1" - resolved "https://registry.yarnpkg.com/moo/-/moo-0.5.1.tgz#7aae7f384b9b09f620b6abf6f74ebbcd1b65dbc4" - integrity sha512-I1mnb5xn4fO80BH9BLcF0yLypy2UKl+Cb01Fu0hJRkJjlCRtxZMWkTdAtDd5ZqCOxtCkhmRwyI57vWT+1iZ67w== - move-concurrently@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92" @@ -16224,16 +16060,6 @@ natural-compare@^1.4.0: resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= -nearley@^2.7.10: - version "2.20.1" - resolved "https://registry.yarnpkg.com/nearley/-/nearley-2.20.1.tgz#246cd33eff0d012faf197ff6774d7ac78acdd474" - integrity sha512-+Mc8UaAebFzgV+KpI5n7DasuuQCHA89dmwm7JXw3TV43ukfNQ9DnBH3Mdb2g/I4Fdxc26pwimBWvjIw0UAILSQ== - dependencies: - commander "^2.19.0" - moo "^0.5.0" - railroad-diagrams "^1.0.0" - randexp "0.4.6" - needle@^2.2.1: version "2.9.1" resolved "https://registry.yarnpkg.com/needle/-/needle-2.9.1.tgz#22d1dffbe3490c2b83e301f7709b6736cd8f2684" @@ -16809,12 +16635,12 @@ object-copy@^0.1.0: define-property "^0.2.5" kind-of "^3.0.3" -object-inspect@^1.11.0, object-inspect@^1.6.0, object-inspect@^1.7.0, object-inspect@^1.9.0: +object-inspect@^1.11.0, object-inspect@^1.9.0: version "1.12.0" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.0.tgz#6e2c120e868fd1fd18cb4f18c31741d0d6e776f0" integrity sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g== -object-is@^1.0.1, object-is@^1.0.2, object-is@^1.1.2: +object-is@^1.0.1: version "1.1.5" resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.5.tgz#b9deeaa5fc7f1846a0faecdceec138e5778f53ac" integrity sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw== @@ -16859,7 +16685,7 @@ object.defaults@^1.1.0: for-own "^1.0.0" isobject "^3.0.0" -object.entries@^1.0.4, object.entries@^1.1.0, object.entries@^1.1.1, object.entries@^1.1.2, object.entries@^1.1.5: +object.entries@^1.1.0, object.entries@^1.1.2, object.entries@^1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.5.tgz#e1acdd17c4de2cd96d5a08487cfb9db84d881861" integrity sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g== @@ -16868,7 +16694,7 @@ object.entries@^1.0.4, object.entries@^1.1.0, object.entries@^1.1.1, object.entr define-properties "^1.1.3" es-abstract "^1.19.1" -"object.fromentries@^2.0.0 || ^1.0.0", object.fromentries@^2.0.3, object.fromentries@^2.0.5: +"object.fromentries@^2.0.0 || ^1.0.0", object.fromentries@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.5.tgz#7b37b205109c21e741e605727fe8b0ad5fa08251" integrity sha512-CAyG5mWQRRiBU57Re4FKoTBjXfDoNwdFVH2Y1tS9PqCsfUTymAohOkEMSG3aRNKmv4lV3O7p1et7c187q6bynw== @@ -16909,7 +16735,7 @@ object.pick@^1.2.0, object.pick@^1.3.0: dependencies: isobject "^3.0.1" -object.values@^1.0.4, object.values@^1.1.0, object.values@^1.1.1, object.values@^1.1.2, object.values@^1.1.5: +object.values@^1.1.0, object.values@^1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.5.tgz#959f63e3ce9ef108720333082131e4a459b716ac" integrity sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg== @@ -18268,15 +18094,6 @@ promzard@^0.3.0: dependencies: read "1" -prop-types-exact@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/prop-types-exact/-/prop-types-exact-1.2.0.tgz#825d6be46094663848237e3925a98c6e944e9869" - integrity sha512-K+Tk3Kd9V0odiXFP9fwDHUYRyvK3Nun3GVyPapSIs5OBkITAm15W0CPFD/YKTkMUAbc0b9CUwRQp2ybiBIq+eA== - dependencies: - has "^1.0.3" - object.assign "^4.1.0" - reflect.ownkeys "^0.2.0" - prop-types@^15.0.0, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.2, prop-types@^15.7.2, prop-types@^15.8.1: version "15.8.1" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" @@ -18494,31 +18311,11 @@ quick-lru@^5.1.1: resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA== -raf@^3.4.0, raf@^3.4.1: - version "3.4.1" - resolved "https://registry.yarnpkg.com/raf/-/raf-3.4.1.tgz#0742e99a4a6552f445d73e3ee0328af0ff1ede39" - integrity sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA== - dependencies: - performance-now "^2.1.0" - -railroad-diagrams@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz#eb7e6267548ddedfb899c1b90e57374559cddb7e" - integrity sha1-635iZ1SN3t+4mcG5Dlc3RVnN234= - ramda@^0.21.0: version "0.21.0" resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.21.0.tgz#a001abedb3ff61077d4ff1d577d44de77e8d0a35" integrity sha1-oAGr7bP/YQd9T/HVd9RN536NCjU= -randexp@0.4.6: - version "0.4.6" - resolved "https://registry.yarnpkg.com/randexp/-/randexp-0.4.6.tgz#e986ad5e5e31dae13ddd6f7b3019aa7c87f60ca3" - integrity sha512-80WNmd9DA0tmZrw9qQa62GPPWfuXJknrmVmLcxvq4uZBdYqb1wYoKTmnlGUchvVWe0XiLupYkBoXVOxz3C8DYQ== - dependencies: - discontinuous-range "1.0.0" - ret "~0.1.10" - randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5, randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" @@ -18764,7 +18561,7 @@ react-is@17.0.2, "react-is@^16.12.0 || ^17.0.0", react-is@^17.0.1, react-is@^17. resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== -react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.6: +react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== @@ -18934,16 +18731,6 @@ react-test-renderer@17.0.2: react-shallow-renderer "^16.13.1" scheduler "^0.20.2" -react-test-renderer@^16.0.0-0: - version "16.14.0" - resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.14.0.tgz#e98360087348e260c56d4fe2315e970480c228ae" - integrity sha512-L8yPjqPE5CZO6rKsKXRO/rVPiaCOy0tQQJbC+UjPNlobl5mad59lvPjwFsQHTvL03caVDIVr9x9/OSgDe6I5Eg== - dependencies: - object-assign "^4.1.1" - prop-types "^15.6.2" - react-is "^16.8.6" - scheduler "^0.19.1" - react-textarea-autosize@^8.3.0: version "8.3.3" resolved "https://registry.yarnpkg.com/react-textarea-autosize/-/react-textarea-autosize-8.3.3.tgz#f70913945369da453fd554c168f6baacd1fa04d8" @@ -19201,11 +18988,6 @@ redux@^4.0.0, redux@^4.0.1, redux@^4.1.1: dependencies: "@babel/runtime" "^7.9.2" -reflect.ownkeys@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/reflect.ownkeys/-/reflect.ownkeys-0.2.0.tgz#749aceec7f3fdf8b63f927a04809e90c5c0b3460" - integrity sha1-dJrO7H8/34tj+SegSAnpDFwLNGA= - refractor@^3.1.0: version "3.6.0" resolved "https://registry.yarnpkg.com/refractor/-/refractor-3.6.0.tgz#ac318f5a0715ead790fcfb0c71f4dd83d977935a" @@ -19712,14 +19494,6 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" -rst-selector-parser@^2.2.3: - version "2.2.3" - resolved "https://registry.yarnpkg.com/rst-selector-parser/-/rst-selector-parser-2.2.3.tgz#81b230ea2fcc6066c89e3472de794285d9b03d91" - integrity sha1-gbIw6i/MYGbInjRy3nlChdmwPZE= - dependencies: - lodash.flattendeep "^4.4.0" - nearley "^2.7.10" - rsvp@^4.8.4: version "4.8.5" resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" @@ -19847,14 +19621,6 @@ saxes@^5.0.1: dependencies: xmlchars "^2.2.0" -scheduler@^0.19.1: - version "0.19.1" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.19.1.tgz#4f3e2ed2c1a7d65681f4c854fa8c5a1ccb40f196" - integrity sha512-n/zwRWRYSUj0/3g/otKDRPMh6qv2SYMWNq85IEa8iZyAv8od9zDYpGSnpBEjNgcMNq6Scbu5KfIPxNF72R/2EA== - dependencies: - loose-envify "^1.1.0" - object-assign "^4.1.1" - scheduler@^0.20.2: version "0.20.2" resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.2.tgz#4baee39436e34aa93b4874bddcbf0fe8b8b50e91" @@ -19926,7 +19692,7 @@ semver-compare@^1.0.0: resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w= -"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.6.0, semver@^5.7.0, semver@^5.7.1: +"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.6.0, semver@^5.7.1: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -20836,15 +20602,6 @@ string.prototype.padstart@^3.0.0: define-properties "^1.1.3" es-abstract "^1.19.1" -string.prototype.trim@^1.1.2, string.prototype.trim@^1.2.1: - version "1.2.5" - resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.5.tgz#a587bcc8bfad8cb9829a577f5de30dd170c1682c" - integrity sha512-Lnh17webJVsD6ECeovpVN17RlAKjmz4rF9S+8Y45CkMc/ufVpTkU3vZIyIC7sllQ1FCvObZnnCdNs/HXTUOTlg== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.1" - string.prototype.trimend@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80" From ba73a398dd8801b682f98c71b140d38104e8f18e Mon Sep 17 00:00:00 2001 From: Kevin Antonio Rateni Iatauro <34224657+WalkingPizza@users.noreply.github.com> Date: Thu, 10 Mar 2022 17:51:47 +0100 Subject: [PATCH 19/25] Removed user not found error --- .../plugins/users-permissions/server/controllers/auth.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/plugins/users-permissions/server/controllers/auth.js b/packages/plugins/users-permissions/server/controllers/auth.js index a9531424bb..6f6d3c14bc 100644 --- a/packages/plugins/users-permissions/server/controllers/auth.js +++ b/packages/plugins/users-permissions/server/controllers/auth.js @@ -338,7 +338,7 @@ module.exports = { params.confirmed = true; } - const user = await getService('user').add(params); + const user = await getService('user').add(params); const sanitizedUser = await sanitizeUser(user, ctx); @@ -420,7 +420,10 @@ module.exports = { }); if (!user) { - throw new ApplicationError('user.not.found'); + return ctx.send({ + email: params.email, + sent: true + }); } if (user.confirmed) { From e22bc04d3512466cf4d578b371c9db2c3cfb9455 Mon Sep 17 00:00:00 2001 From: sv-developer Date: Fri, 11 Mar 2022 08:23:21 +0100 Subject: [PATCH 20/25] Use seperate validation function for attribute input validation --- .../lib/plops/prompts/get-attributes-prompts.js | 4 ++-- .../lib/plops/utils/validate-attribute-input.js | 11 +++++++++++ .../generators/lib/plops/utils/validate-input.js | 4 ++-- 3 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 packages/generators/generators/lib/plops/utils/validate-attribute-input.js diff --git a/packages/generators/generators/lib/plops/prompts/get-attributes-prompts.js b/packages/generators/generators/lib/plops/prompts/get-attributes-prompts.js index 3ae51071c8..9dc980ea5b 100644 --- a/packages/generators/generators/lib/plops/prompts/get-attributes-prompts.js +++ b/packages/generators/generators/lib/plops/prompts/get-attributes-prompts.js @@ -1,6 +1,6 @@ 'use strict'; -const validateInput = require('../utils/validate-input'); +const validateInputForAttribute = require('../utils/validate-input'); const DEFAULT_TYPES = [ // advanced types @@ -50,7 +50,7 @@ module.exports = async inquirer => { type: 'input', name: 'attributeName', message: 'Name of attribute', - validate: input => validateInput(input, true), + validate: input => validateInputForAttribute(input), }, { type: 'list', diff --git a/packages/generators/generators/lib/plops/utils/validate-attribute-input.js b/packages/generators/generators/lib/plops/utils/validate-attribute-input.js new file mode 100644 index 0000000000..b8a8e2bb68 --- /dev/null +++ b/packages/generators/generators/lib/plops/utils/validate-attribute-input.js @@ -0,0 +1,11 @@ +'use strict'; + +module.exports = (input) => { + const regex = /^[A-Za-z-|_]+$/g + + if (!input) { + return "You must provide an input"; + } + + return regex.test(input) || "Please use only letters, '-', '_', and no spaces"; +}; diff --git a/packages/generators/generators/lib/plops/utils/validate-input.js b/packages/generators/generators/lib/plops/utils/validate-input.js index 45c72f1a2d..6108ad30b5 100644 --- a/packages/generators/generators/lib/plops/utils/validate-input.js +++ b/packages/generators/generators/lib/plops/utils/validate-input.js @@ -1,7 +1,7 @@ 'use strict'; -module.exports = (input, allowSnakeCase = false) => { - const regex = allowSnakeCase ? /^[A-Za-z-|_]+$/g : /^[A-Za-z-]+$/g; +module.exports = (input) => { + const regex = /^[A-Za-z-]+$/g; if (!input) { return "You must provide an input"; From 1f1bfecd4a493999bfe296f5d1ee03b70bb9d1de Mon Sep 17 00:00:00 2001 From: sv-developer Date: Fri, 11 Mar 2022 09:44:12 +0100 Subject: [PATCH 21/25] Fix naming and import fail --- .../generators/lib/plops/prompts/get-attributes-prompts.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/generators/generators/lib/plops/prompts/get-attributes-prompts.js b/packages/generators/generators/lib/plops/prompts/get-attributes-prompts.js index 9dc980ea5b..85855e537f 100644 --- a/packages/generators/generators/lib/plops/prompts/get-attributes-prompts.js +++ b/packages/generators/generators/lib/plops/prompts/get-attributes-prompts.js @@ -1,6 +1,6 @@ 'use strict'; -const validateInputForAttribute = require('../utils/validate-input'); +const validateAttributeInput = require('../utils/validate-attribute-input'); const DEFAULT_TYPES = [ // advanced types @@ -50,7 +50,7 @@ module.exports = async inquirer => { type: 'input', name: 'attributeName', message: 'Name of attribute', - validate: input => validateInputForAttribute(input), + validate: input => validateAttributeInput(input), }, { type: 'list', From 8314fb4f6b913dddcc4b1d089c85a5484a77b975 Mon Sep 17 00:00:00 2001 From: ronronscelestes Date: Fri, 11 Mar 2022 11:10:58 +0100 Subject: [PATCH 22/25] fixed release notification stacking in Admin --- .../src/components/AuthenticatedApp/index.js | 11 ++++++++-- .../AuthenticatedApp/tests/index.test.js | 3 +++ .../components/AuthenticatedApp/utils/api.js | 21 ++++++++++++++++++- .../core/admin/admin/src/pages/Admin/index.js | 4 +--- 4 files changed, 33 insertions(+), 6 deletions(-) diff --git a/packages/core/admin/admin/src/components/AuthenticatedApp/index.js b/packages/core/admin/admin/src/components/AuthenticatedApp/index.js index 2fd9061802..bbe6da4a25 100644 --- a/packages/core/admin/admin/src/components/AuthenticatedApp/index.js +++ b/packages/core/admin/admin/src/components/AuthenticatedApp/index.js @@ -1,6 +1,12 @@ import React, { useMemo, useState, useEffect, useRef } from 'react'; // TODO: DS add loader -import { auth, LoadingIndicatorPage, AppInfosContext, useGuidedTour } from '@strapi/helper-plugin'; +import { + auth, + LoadingIndicatorPage, + AppInfosContext, + useGuidedTour, + useNotification, +} from '@strapi/helper-plugin'; import { useQueries } from 'react-query'; import get from 'lodash/get'; import packageJSON from '../../../../package.json'; @@ -20,6 +26,7 @@ const strapiVersion = packageJSON.version; const AuthenticatedApp = () => { const { setGuidedTourVisibility } = useGuidedTour(); + const toggleNotification = useNotification(); const setGuidedTourVisibilityRef = useRef(setGuidedTourVisibility); const userInfo = auth.getUserInfo(); const userName = get(userInfo, 'username') || getFullName(userInfo.firstname, userInfo.lastname); @@ -34,7 +41,7 @@ const AuthenticatedApp = () => { { queryKey: 'app-infos', queryFn: fetchAppInfo }, { queryKey: 'strapi-release', - queryFn: fetchStrapiLatestRelease, + queryFn: () => fetchStrapiLatestRelease(toggleNotification), enabled: showReleaseNotification, initialData: strapiVersion, }, diff --git a/packages/core/admin/admin/src/components/AuthenticatedApp/tests/index.test.js b/packages/core/admin/admin/src/components/AuthenticatedApp/tests/index.test.js index 4b5a245312..beed21cbbd 100644 --- a/packages/core/admin/admin/src/components/AuthenticatedApp/tests/index.test.js +++ b/packages/core/admin/admin/src/components/AuthenticatedApp/tests/index.test.js @@ -21,6 +21,9 @@ jest.mock('@strapi/helper-plugin', () => ({ useGuidedTour: jest.fn(() => ({ setGuidedTourVisibility: jest.fn(), })), + useNotification: jest.fn(() => ({ + toggleNotification: jest.fn(), + })), })); jest.mock('../utils/api', () => ({ diff --git a/packages/core/admin/admin/src/components/AuthenticatedApp/utils/api.js b/packages/core/admin/admin/src/components/AuthenticatedApp/utils/api.js index 7fe32ce8f9..d43f51439b 100644 --- a/packages/core/admin/admin/src/components/AuthenticatedApp/utils/api.js +++ b/packages/core/admin/admin/src/components/AuthenticatedApp/utils/api.js @@ -1,15 +1,34 @@ import axios from 'axios'; +import checkLatestStrapiVersion from './checkLatestStrapiVersion'; import { axiosInstance } from '../../../core/utils'; import packageJSON from '../../../../../package.json'; const strapiVersion = packageJSON.version; +const showUpdateNotif = !JSON.parse(localStorage.getItem('STRAPI_UPDATE_NOTIF')); -const fetchStrapiLatestRelease = async () => { +const fetchStrapiLatestRelease = async toggleNotification => { try { const { data: { tag_name }, } = await axios.get('https://api.github.com/repos/strapi/strapi/releases/latest'); + const shouldUpdateStrapi = checkLatestStrapiVersion(strapiVersion, tag_name); + + if (shouldUpdateStrapi && showUpdateNotif) { + toggleNotification({ + type: 'info', + message: { id: 'notification.version.update.message' }, + link: { + url: `https://github.com/strapi/strapi/releases/tag/${tag_name}`, + label: { + id: 'notification.version.update.link', + }, + }, + blockTransition: true, + onClose: () => localStorage.setItem('STRAPI_UPDATE_NOTIF', true), + }); + } + return tag_name; } catch (err) { // Don't throw an error diff --git a/packages/core/admin/admin/src/pages/Admin/index.js b/packages/core/admin/admin/src/pages/Admin/index.js index c282f92b77..14c9594558 100644 --- a/packages/core/admin/admin/src/pages/Admin/index.js +++ b/packages/core/admin/admin/src/pages/Admin/index.js @@ -12,7 +12,7 @@ import { DndProvider } from 'react-dnd'; import { HTML5Backend } from 'react-dnd-html5-backend'; import LeftMenu from '../../components/LeftMenu'; import AppLayout from '../../layouts/AppLayout'; -import { useMenu, useReleaseNotification } from '../../hooks'; +import { useMenu } from '../../hooks'; import Onboarding from './Onboarding'; import { createRoute } from '../../utils'; import GuidedTourModal from '../../components/GuidedTour/Modal'; @@ -48,8 +48,6 @@ const useTrackUsage = () => { }; const Admin = () => { - // Show a notification when the current version of Strapi is not the latest one - useReleaseNotification(); useTrackUsage(); const { isLoading, generalSectionLinks, pluginsSectionLinks } = useMenu(); const { menu } = useStrapiApp(); From 6b900e7573d7ab3126447b2bfd2750bfcab91522 Mon Sep 17 00:00:00 2001 From: Gustav Hansen Date: Fri, 11 Mar 2022 13:43:33 +0100 Subject: [PATCH 23/25] Docs: Bump require contributing node version to 14 --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 99322608d4..7c7030d498 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -46,7 +46,7 @@ The Strapi core team will review your pull request and either merge it, request ## Contribution Prerequisites -- You have [Node.js](https://nodejs.org/en/) at version >= v12 and <= v16 and [Yarn](https://yarnpkg.com/en/) at v1.2.0+ installed. +- You have [Node.js](https://nodejs.org/en/) at version >= v14 and <= v16 and [Yarn](https://yarnpkg.com/en/) at v1.2.0+ installed. - You are familiar with [Git](https://git-scm.com). **Before submitting your pull request** make sure the following requirements are fulfilled: From f435ad12cad601e4e8fbba15b91b96fddd420d4e Mon Sep 17 00:00:00 2001 From: Gustav Hansen Date: Fri, 11 Mar 2022 13:55:27 +0100 Subject: [PATCH 24/25] Docs: Improve wording of contributing guide --- CONTRIBUTING.md | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7c7030d498..5d2de78792 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,7 @@ Strapi is an open-source project administered by [the Strapi team](https://strapi.io/about-us). We appreciate your interest and efforts to contribute to Strapi. See the [LICENSE](https://github.com/strapi/strapi/blob/master/LICENSE) licensing information. All work done is available on GitHub. -We highly appreciate your effort to contribute, but we recommend you to talk to a maintainer prior to spending a lot of time making a pull request that may not align with the project roadmap. Every pull request, whether is from strapi or contributors, goes through the same process. +We highly appreciate your effort to contribute, but we recommend you talk to a maintainer before spending a lot of time making a pull request that may not align with the project roadmap. Whether it is from Strapi or contributors, every pull request goes through the same process. ## Feature Requests @@ -10,11 +10,11 @@ Feature Requests by the community are highly encouraged. Feel free to submit a n ## Request For Comments (RFC) -Larger chunks of changes in Strapi, that might effect many users, require a thorough design phase before starting working on a PR. +Larger chunks of changes to Strapi that might affect many users require a thorough design phase before starting working on a PR. We will do our best to respond as soon as possible, but since we need to discuss these proposals thoroughly, please do not expect them to be merged and accepted immediately. -The Request For Comments process will help us create consensus among the core team and include as much feedback as possible from the community, for these upcoming changes. +The Request For Comments process will help us create consensus among the core team and include as much feedback as possible from the community for these upcoming changes. -Request For Comments have to be created on the [strapi/rfcs](https://github.com/strapi/rfcs) repository. +A Request For Comments has to be created on the [strapi/rfcs](https://github.com/strapi/rfcs) repository. ## Code of Conduct @@ -24,11 +24,11 @@ This project, and everyone participating in it, are governed by the [Strapi Code ### Individual contribution -In order to accept your pull request, you need to submit a Contributor License Agreement (CLA). You only need to do this once. If you are submitting a pull request for the first time, you can complete your CLA [here](https://cla.strapi.io/strapi/strapi) or submit a pull request and our CLA bot will automatically ask you to sign before merging the pull request. +You need to sign a Contributor License Agreement (CLA) to accept your pull request. You only need to do this once. If you submit a pull request for the first time, you can complete your CLA [here](https://cla.strapi.io/strapi/strapi), or our CLA bot will automatically ask you to sign before merging the pull request. ### Company contribution -If you are making contributions to our repositories on behalf of your company, then we will need a Corporate Contributor License Agreement (CLA) signed. In order to do that, please contact us at [contributions@strapi.io](mailto:contributions@strapi.io). +If you make contributions to our repositories on behalf of your company, we will need a Corporate Contributor License Agreement (CLA) signed. To do that, please get in touch with us at [contributions@strapi.io](mailto:contributions@strapi.io). ## Documentation @@ -36,13 +36,13 @@ Pull requests related to fixing documentation for the latest release should be d ## Bugs -Strapi is using [GitHub issues](https://github.com/strapi/strapi/issues) to manage bugs. We keep a close eye on them. Before filing a new issue, try to make sure your problem does not already exist. +Strapi is using [GitHub issues](https://github.com/strapi/strapi/issues) to manage bugs. We keep a close eye on them. Before filing a new issue, try to ensure your problem does not already exist. --- ## Before Submitting a Pull Request -The Strapi core team will review your pull request and either merge it, request changes to it, or close it. +The Strapi core team will review your pull request and either merge it, request changes, or close it. ## Contribution Prerequisites @@ -53,7 +53,7 @@ The Strapi core team will review your pull request and either merge it, request - Fork the repository and create your new branch from `master`. - Run `yarn setup` in the root of the repository. -- If you’ve fixed a bug or added code that should be tested, please make sure to add tests +- If you've fixed a bug or added code that should be tested, please make sure to add tests - Ensure the following test suites are passing: - `yarn test:unit` - `yarn test:front` @@ -79,6 +79,7 @@ Go to the root of the repository and run the setup: ```bash cd strapi yarn setup + ``` ### 4. Start the example application @@ -129,7 +130,7 @@ $ yarn test:generate-app postgres $ yarn test:generate-app mysql ``` -A new app is required every time you run the end-to-end tests< otherwise, the test suite will fail. A script is available to make this process easier: `node test/e2e.js`. It will delete the current test app, generate a new one and run the test suite. +A new app is required every time you run the end-to-end tests otherwise, the test suite will fail. A script is available to make this process easier: `node test/e2e.js`. It will delete the current test app, generate a new one and run the test suite. ### Changing the database @@ -143,7 +144,7 @@ $ node test/e2e.js --db=mysql ### Running the tests for the Community Editon (CE)\*\* -The test suites are running the tests for the Enterprise Edition (EE) version of Strapi by default. Should you want to test the Community Edition (CE) version, you will need to set the environment variable `STRAPI_DISABLE_EE` to true: +The test suites run the tests for the Enterprise Edition (EE) version of Strapi by default. Should you want to test the Community Edition (CE) version, you will need to set the environment variable `STRAPI_DISABLE_EE` to true: ```bash $ STRAPI_DISABLE_EE=true node test/e2e.js @@ -152,7 +153,7 @@ $ STRAPI_DISABLE_EE=true yarn test:e2e ### Specifying a license to use for the Enterprise Edition (EE) -The Enterprise Edition tests need a valid license to run correctly. To specify a license you can use the environment variable `STRAPI_LICENSE`: +The Enterprise Edition tests need a valid license to run correctly. To specify a license, you can use the environment variable `STRAPI_LICENSE`: ```bash $ STRAPI_LICENSE= node test/e2e.js @@ -165,28 +166,28 @@ $ STRAPI_LICENSE= yarn test:e2e ### Repository Organization -We chose to use a monorepo design using [Yarn Workspaces](https://yarnpkg.com/en/docs/workspaces) in the way [React](https://github.com/facebook/react/tree/master/packages) or [Babel](https://github.com/babel/babel/tree/master/packages) does. This allows us to maintain the whole ecosystem, keep it up-to-date and consistent. +We chose to use a monorepo design using [Yarn Workspaces](https://yarnpkg.com/en/docs/workspaces) in the way [React](https://github.com/facebook/react/tree/master/packages) or [Babel](https://github.com/babel/babel/tree/master/packages) does. This allows us to maintain the whole ecosystem keep it up-to-date and consistent. -We do our best to keep the master branch as clean as possible, with tests passing at all times. However, it may happen that the master branch moves faster than the release cycle. Therefore check the [releases on npm](https://www.npmjs.com/package/@strapi/strapi) so that you are always up-to-date with the latest stable version. +We do our best to keep the master branch as clean as possible, with tests passing at all times. However, the master branch can move faster than the release cycle. Therefore check the [releases on npm](https://www.npmjs.com/package/@strapi/strapi) so that you are always up-to-date with the latest stable version. ### Reporting an issue Before submitting an issue you need to make sure: - You are experiencing a technical issue with Strapi. -- You have already searched for related [issues](https://github.com/strapi/strapi/issues), and found none open (if you found a related _closed_ issue, please link to it from your post). +- You have already searched for related [issues](https://github.com/strapi/strapi/issues) and found none open (if you found a related _closed_ issue, please link to it from your post). - You are not asking a question about how to use Strapi or about whether or not Strapi has a certain feature. For general help using Strapi, you may: - Refer to the [official Strapi documentation](https://docs.strapi.io). - Ask a member of the community in the [Strapi Discord Community](https://discord.strapi.io/). - Ask a question on the [Strapi community forum](https://forum.strapi.io). -- Your issue title is concise, on-topic and polite. +- Your issue title is concise, on-topic, and polite. - You provide steps to reproduce the issue. -- You have tried all the following (if relevant) and your issue remains: +- You have tried all the following (if relevant), and your issue remains: - Make sure you have the right application started. - Make sure the [issue template](.github/ISSUE_TEMPLATE) is respected. - Make sure your issue body is readable and [well formatted](https://guides.github.com/features/mastering-markdown). - Make sure you've stopped the Strapi server with CTRL+C and restarted it. - Make sure your application has a clean `node_modules` directory, meaning: - - you didn't linkt any dependencies (e.g. by running `yarn link`) + - you didn't link any dependencies (e.g., by running `yarn link`) - you haven't made any inline changes to files in the `node_modules` directory - - you don't have any global dependency loops. The easiest way to double-check any of the above, if you aren't sure, is to run: `$ rm -rf node_modules && yarn cache clean && yarn setup`. + - you don't have any global dependency loops. If you aren't sure, the easiest way to double-check any of the above is to run: `$ rm -rf node_modules && yarn cache clean && yarn setup`. From 5ae49815453f31cb92a9e4a86df6223647241913 Mon Sep 17 00:00:00 2001 From: ronronscelestes Date: Mon, 14 Mar 2022 10:49:11 +0100 Subject: [PATCH 25/25] bump DS --- packages/core/admin/package.json | 4 ++-- packages/core/helper-plugin/package.json | 4 ++-- yarn.lock | 16 ++++++++-------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/core/admin/package.json b/packages/core/admin/package.json index d537384afc..c4f2faf817 100644 --- a/packages/core/admin/package.json +++ b/packages/core/admin/package.json @@ -53,9 +53,9 @@ "@fortawesome/free-solid-svg-icons": "^5.15.3", "@fortawesome/react-fontawesome": "^0.1.14", "@strapi/babel-plugin-switch-ee-ce": "4.1.3", - "@strapi/design-system": "0.0.1-alpha.78", + "@strapi/design-system": "0.0.1-alpha.79", "@strapi/helper-plugin": "4.1.3", - "@strapi/icons": "0.0.1-alpha.78", + "@strapi/icons": "0.0.1-alpha.79", "@strapi/utils": "4.1.3", "axios": "0.24.0", "babel-loader": "8.2.3", diff --git a/packages/core/helper-plugin/package.json b/packages/core/helper-plugin/package.json index c00e185bcb..38e9e1c35b 100644 --- a/packages/core/helper-plugin/package.json +++ b/packages/core/helper-plugin/package.json @@ -76,8 +76,8 @@ "@storybook/builder-webpack5": "6.4.10", "@storybook/manager-webpack5": "6.4.10", "@storybook/react": "^6.3.7", - "@strapi/design-system": "0.0.1-alpha.78", - "@strapi/icons": "0.0.1-alpha.78", + "@strapi/design-system": "0.0.1-alpha.79", + "@strapi/icons": "0.0.1-alpha.79", "babel-loader": "^8.2.2", "cross-env": "^7.0.3", "date-fns": "2.22.1", diff --git a/yarn.lock b/yarn.lock index 150790ec96..b784e4ac2a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4972,19 +4972,19 @@ resolve-from "^5.0.0" store2 "^2.12.0" -"@strapi/design-system@0.0.1-alpha.78": - version "0.0.1-alpha.78" - resolved "https://registry.yarnpkg.com/@strapi/design-system/-/design-system-0.0.1-alpha.78.tgz#40920e863ce85661fb3de2cbdb27f678be32110d" - integrity sha512-4zOnfJ7onYKFZ1RD/yOUmoxrkPizyXDGL9mFlyObGSMxwa8qAMylRtNCLM88EAap3bL/LSLV0JXNI5GyM8r9hw== +"@strapi/design-system@0.0.1-alpha.79": + version "0.0.1-alpha.79" + resolved "https://registry.yarnpkg.com/@strapi/design-system/-/design-system-0.0.1-alpha.79.tgz#23e6a7f73383b72148c926fa74ed0ba1acc32f0a" + integrity sha512-o/F55Qjwao1HkqKcL8ovQ280QijJH8dLfzP+t3XMNL5Ihh3HBD2wcMS6dOsrnNDGdDE0LWQfG8bDbLPmWHmk1A== dependencies: "@internationalized/number" "^3.0.2" compute-scroll-into-view "^1.0.17" prop-types "^15.7.2" -"@strapi/icons@0.0.1-alpha.78": - version "0.0.1-alpha.78" - resolved "https://registry.yarnpkg.com/@strapi/icons/-/icons-0.0.1-alpha.78.tgz#08e2a9b70665ac01d8425037eaa2e65fc0967832" - integrity sha512-w5+YeDwhqhZxw1joLt5pJAvOXStE6u55lB89aB3IUvQmyvMCeY8xXv2V3h0pa9NUYFWMgeRDndDkDQWepX6Y6w== +"@strapi/icons@0.0.1-alpha.79": + version "0.0.1-alpha.79" + resolved "https://registry.yarnpkg.com/@strapi/icons/-/icons-0.0.1-alpha.79.tgz#eff8790ea3897419489a61cbfd72a436661d1420" + integrity sha512-mIPzpwOir92939rSRuRS22GLWFpLfQDyoK0vMZUsGD7uujNnRon//TUa9DJTjTHjdEjRwWO60JbJOePgJ+2cvg== dependencies: rimraf "^3.0.2"