mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-22 16:18:45 -05:00
3a8797e54d
* fix: wire up scaffolded indexHtml to dev servers * fix vite tests * update vuecli-5, fix system tests * fix vite build error and launchpad test * remove only * address comments, remove gitignores * remove only
@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 | Tool Version | Dev Server | Dev Server Version | Library Version (s) | Component Adaptor Version | 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, React 17 | @cypress/react@latest |
Link |
| React | - | Vite | 2.x | React 16, React 17 | @cypress/react@latest |
Link |
| Vue | - | Vite | 2.x | Vue 3 | @cypress/vue@^3.0.0 |
Link |
| Vue CLI | 4.x | Webpack | 4.x | Vue 2 | @cypress/vue@2.0.4 |
Link |
| Vue CLI | 4.x | Webpack | 4.x | Vue 3 | @cypress/vue@latest |
Link |
| Vue CLI | 5.x | Webpack | 5.x | Vue 2 | @cypress/vue@^2.0.0 |
Covered by other Vue CLI test projects. |
| Vue CLI | 5.x | Webpack | 5.x | Vue 3 | @cypress/vue@^3.0.0 |
Link |
| Nuxt.js | 2.x | Webpack | 4.x, 5.x | Vue 2 | @cypress/vue@2.0.4 |
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/integration/detect.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.
TODO
These should be supported but currently are not configured.
| Name | Tool Version | Dev Server | Dev Server Version | Library Version (s) | Component Adaptor Version | Example Project |
|---|---|---|---|---|---|---|
| Next.js | 11.x, 12.x | Webpack | 4.x, 5.x | React 16, 17 | @cypress/react@latest |
Link |