-
Notifications
You must be signed in to change notification settings - Fork 3.3k
fix: use srcRoot for angular build context #25090
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
Conversation
Thanks for taking the time to open a PR!
|
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.
Some QoL comments, no obvious problems - sure would be nice to see if this works for the user.
It's also possible
@@ -0,0 +1,8 @@ | |||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic' |
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.
I wonder if we need a basic Angular project in project-fixtures
at some point, so we iterate over it like we do for React in system tests, testing against each supported major 🤔
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.
We do have one, but this project felt different enough that I thought I'd make a new one. If I was to reuse the angular
project-fixture, I'd have had to overwrite almost every file (every config file + the src code is in a different directory)
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.
I agree with @ZachJW34 that this is worth a different project since the source root is pretty fundamental part of the app.
@@ -217,7 +217,7 @@ function createFakeContext (projectRoot: string, defaultProjectConfig: Cypress.A | |||
getProjectMetadata: () => { | |||
return { | |||
root: defaultProjectConfig.root, | |||
sourceRoot: defaultProjectConfig.root, |
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.
Did this API change between majors? Should we check defaultProjectConfig.root ?? defaultProjectConfig.sourceRoot
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.
No it didn't change, I believe it was just a mistake on our part.
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.
Looks good 👍🏻 would be nice to confirm that this solves the user's issue specifically
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.
Great job with this. This was certainly an oversight on our end
Going to hold off on merging for a day or so, hoping the original poster of the issue has a chance to try out the binary |
Going to go ahead and get this merged. |
User facing changelog
Fix issue with Angular CT where custom srcRoot was not being respected.
Additional details
We were passing in
root
rather thansrcRoot
, causing some path issues.I wasn't able to reproduce the exact issue the user is having. I'm building the binaries for this PR and will share to the user.
Steps to test
npm i @angular/cli -g
(you'll need a global version >=13 and <= 15)ng new
Choose default optionssrc
folder toui
src
intsconfig.app.json
andangular.json
toui
ng serve
npm i -D cypress && npx cypress open
yarn workspace @cypress/webpack-dev-server build
yarn cypress:open --project <path-to-angular-project>
How has the user experience changed?
Screen.Recording.2022-12-09.at.9.59.43.AM.mov
PR Tasks
cypress-documentation
?type definitions
?