-
Notifications
You must be signed in to change notification settings - Fork 3.4k
WIP: support Angular 21 inside @cypress/schematic
#33027
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
base: develop
Are you sure you want to change the base?
Conversation
cypress
|
||||||||||||||||||||||||||||||||||||||||
| Project |
cypress
|
| Branch Review |
chore/cypress-schematic-angular-21
|
| Run status |
|
| Run duration | 19m 37s |
| Commit |
|
| Committer | Bill Glesias |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
10
|
|
|
1097
|
|
|
4
|
|
|
26703
|
| View all changes introduced in this branch ↗︎ | |
Warning
Partial Report: The results for the Application Quality reports may be incomplete.
UI Coverage
45.74%
|
|
|---|---|
|
|
186
|
|
|
161
|
Accessibility
98%
|
|
|---|---|
|
|
4 critical
8 serious
2 moderate
2 minor
|
|
|
101
|
b3e5b6a to
9a38f7c
Compare
| if (overwrite || !json.get(path)) { | ||
| json.modify(path, version) | ||
| // mock the correct binary here for now | ||
| json.modify(path, 'https://cdn.cypress.io/beta/npm/15.8.0/darwin-arm64/feat/add_zoneless_angular_harness-d64f6cf48ca1d64475a53a44e83c2d58cc627dd9/cypress.tgz') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Hardcoded beta binary URL replaces actual Cypress version
The addPackageJsonDependency function ignores the version parameter passed from the caller and hardcodes a specific beta CDN URL instead. When users run ng add @cypress/schematic, this causes Cypress to be installed from a specific feature branch beta build rather than the latest stable version from npm. The version variable is destructured but never used, as indicated by the @ts-expect-error comment acknowledging this should be removed. This appears to be debug code that was accidentally committed.
Additional Locations (1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is currently the only way to test the zoneless handler as it isn't published
| const { projects } = angularJsonValue | ||
|
|
||
| // if using Angular 21 or greater, we need to use the cypress/angular-zoneless mount function | ||
| const applyPath = isSemverGte(options.__version__, '21.0.0') ? './files-ct-zoneless' : './files-ct' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Null version causes semver comparison to throw error
The isSemverGte(options.__version__, '21.0.0') call can throw a TypeError when options.__version__ is null. The getAngularSemverVersion function returns null when it can't parse the Angular version or when @angular/core isn't found in dependencies. The semver gte function throws when given null as the first argument rather than returning false. This would cause the schematic to crash for projects with unusual or missing Angular version specifications.
9a38f7c to
efbeea7
Compare
efbeea7 to
4ee10c4
Compare
Additional details
Adds Angular 21 support and proper scaffolding to
@cypress/schematic. This work cannot be finalized until Cypress15.8.0is released containing the zoneless changesSteps to test
How has the user experience changed?
PR Tasks
cypress-documentation?type definitions?Note
Adds Angular 21 support, switching CT scaffolding to cypress/angular-zoneless for >=21 and updating tests, templates, and dependencies accordingly.
getAngularSemverVersion) and select CT templates:./files-ct-zonelessfor>=21, otherwise./files-ct.semver; bump Angular devkit/CLI/schematics to v21; add debug note to CONTRIBUTING.addPackageJsonDependency.files-ct-zoneless/component.ts.templateusingcypress/angular-zonelessmount.files-ct-zoneless/component-index.html.template.angular-20andangular-21.cli/angular-zonelessand pass--standalonefor Angular 21 component generation.--componentflag to configure support file.NgModule/WrapperModule, provider module, and adjustmount.cy.tsfor zoneless usage.tsconfig.app.jsonto includecypresstypes.Written by Cursor Bugbot for commit efbeea7. This will update automatically on new commits. Configure here.