This package detects the framework, bundler, and library used by a project, and scaffolds the initial cypress.config.js and support files when a user configures Cypress for the first time via the Launchpad UI.
Key Commands
# Build all outputs (CJS, ESM, browser)
yarn workspace @packages/scaffold-config build
# Run a specific test file
yarn workspace @packages/scaffold-config test -- <path-to-spec>
# Run tests matching a glob pattern
yarn workspace @packages/scaffold-config test -- "<glob-pattern>"
# Type-check
yarn workspace @packages/scaffold-config check-tsArchitecture
src/detect.ts— Auto-detection logic for frameworks and bundlers installed in the user's projectsrc/frameworks.ts— Registry of supported frameworks (React, Vue, Angular, Svelte, Next.js, etc.)src/dependencies.ts— Dependency definitions and version requirements for each integrationsrc/commandFile.ts— Logic for generatingcypress.config.jscommand filessrc/supportFile.ts— Logic for generating support file scaffoldingsrc/component-index-template.ts— Template for the component index HTML filesrc/ct-detect-third-party.ts— Detection for third-party CT framework plugins
Gotchas / Notes
- The
browser/dependenciesoutput is NOT used in the production binary; it exists for internal testing purposes only. - The ESM build is compiled but not currently consumed; production usage is CJS only.
- When adding a new framework, you must also add a
<name>-configuredand<name>-unconfiguredsystem-test project and wire it intocomponent_testing_spec.ts. - New dependencies must be declared in
src/constants.tswith descriptions.
Integration Points
- Consumed by
@packages/data-contextand@packages/launchpadto drive the configuration wizard UI. - System-test projects in
system-tests/projects/exercise the scaffolding end-to-end.
Auto-Generated Files
cjs/,esm/,browser/— Generated bytsc; do not edit by hand.