Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spike and explore options for CT Dev Server/Custom Config Public API #25881

Closed
lmiller1990 opened this issue Feb 20, 2023 · 3 comments
Closed
Assignees
Labels
CT Issue related to component testing

Comments

@lmiller1990
Copy link
Contributor

Description

Explore options for a Component Testing public API for third parties to inject/configure a dev-servers. We will spend a maximum of 2 days on this.

Additional Info

In CT Public API we proposed a mechanism for third parties to embed in the Cypress CT Onboarding workflow. This feature landed in #25780.

This works great for basic templates (eg, React with a top level wepback.config or vite.config. However, there is no way for a third party to specify a strategy to resolve a bundler configuration from a non-standard location.

Cypress does this internally on a framwork-by-framework basis for webpack-dev-server, see here. There is no such pattern for vite-dev-server.

Some examples of templates that to no expose a config that'd we'd like to support include:

There are some ideas/suggestions in CT Public API tech brief that might be interesting.

Ultimately, the API might be something like:

export default defineComponentFramework({
  devServer: (cypressConfig) => {
    // ???
  }
})

The way in which Cypress would consume this from a third party, and how it would work, are the goals of the spike.

Acceptance Criteria

  • Explore some options on what a public API might look like. This likely includes things like:
    • What new properties need to be included in the Component Framework Definition?
    • What level of refactoring would be required in the Cypress monorepo?
    • Can we have a consistent pattern for both webpack|vite -dev-server?

This does NOT require a working prototype or technical brief. I'd like to see some notes, perhaps a branch. The notes could be added in this issue, and eventually formalized as an additional section in the CT Public API tech brief, which is the source of truth for all CT Public API related information.

@lmiller1990
Copy link
Contributor Author

Also maybe relevant to keep in mind, there are some requests for Parcel: #17798

@lmiller1990
Copy link
Contributor Author

@lmiller1990
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CT Issue related to component testing
Projects
None yet
Development

No branches or pull requests

2 participants