mirror of
https://github.com/cypress-io/cypress.git
synced 2026-04-22 15:12:27 -05:00
8ff38cdb01
* fix: Improve TypeScript support for custom queries * Typo fix * Fix TS more * Move 'ensures' off of cy and onto Cypress * Type fixes * One missed replacement * Test fixes * Properly pass in to ensureRunnable * Add .eslintignores to quiet down warnings * Review feedback * Update cli/types/cypress.d.ts Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com> Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>
@packages/scaffold-config
Logic related to scaffolding new projects using launchpad, including detecting component frameworks and bundlers, installing dependencies and creating cypress.config.js files.
We have integrations for popular code generators like Create React App, Next.js and Vue CLI, and ship a cypress.config.js that will work out of the box for those templates.
We will also attempt to scaffold a configuration file for projects using React and Vue projects using Vite and Webpack that are not necessarily created using a code generator.
Supported Frameworks and Libraries
| Name | Version | Dev Server | Version | Library | Component Adaptor | Example Project |
|---|---|---|---|---|---|---|
| Create React App | 5.x | Webpack | 5.x | React 16, 17 | @cypress/react@latest |
[TODO] |
| Create React App | 4.x | Webpack | 4.x | React 16, 17 | @cypress/react@latest |
Link |
| React | - | Vite | 2.x | React 16, 17 | @cypress/react@latest |
Link |
| Vue | - | Vite | 2.x | Vue 3 | @cypress/vue@latest |
Link |
| Vue CLI | 4.x | Webpack | 4.x | Vue 2 | @cypress/vue2@latest |
Link |
| Vue CLI | 4.x | Webpack | 4.x | Vue 3 | @cypress/vue@latest |
Link |
| Vue CLI | 5.x | Webpack | 5.x | Vue 2 | @cypress/vue2@latest |
Covered by other Vue CLI test projects. |
| Vue CLI | 5.x | Webpack | 5.x | Vue 3 | @cypress/vue@latest |
Link |
| Nuxt.js | 2.x | Webpack | 4.x, 5.x | Vue 2 | @cypress/vue2@latest |
Link |
TODO
These should be supported but currently are not configured.
| Name | Version | Dev Server | Version | Library | Component Adaptor | Example Project |
|---|---|---|---|---|---|---|
| Next.js | 11.x, 12.x | Webpack | 4.x, 5.x | React 16, 17 | @cypress/react@latest |
Link |
Adding More Projects
The process for adding a new library/framework/bundler is as follows:
- Add your framework in
src/frameworks.ts. - Any new dependencies are declared in
src/constants.ts. Don't forget to add a description. - Ensure your project has the correct library and bundler detected with a test in
test/unit/detect.spec.ts. - Add a new project with the correct
cypress.config.jsandpackage.jsonto system-tests/projects. It should be<name>-configured, which is a working example with some specs. Ensure it will run on CI by adding it tocomponent_testing_spec.ts. - Add another project called
<name>-unconfigured, which represents the project prior to having Cypress added. This will be used in step 5. - Add a test to
scaffold-component-testing.cy.tsto ensure your project has the correctcypress.config.jsgenerated. Use an existing test as a template.