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

fix(vite-dev-server): windows supportFile + preserve optimize entries #18286

Merged

Conversation

userquin
Copy link
Contributor

@userquin userquin commented Sep 28, 2021

Context

This PR fix and closes #18261

  • preserve optimizedDeps.entries configured on target project
  • transform windows absolute paths to relative
  • transform windows paths to use / to match fast glob patterns

How to test

  1. Follow the CONTRIBUTING.md guide
  2. clone my branch, yarn && yarn build --scope npm/vite-dev-server && cd npm/vite-dev-server && yarn link.
  3. clone the repo on Vite dev server optimize entries #18261 , yarn && yarn link "@cypress/vite-dev-server"
  4. edit package.json and change "@cypress/vite-dev-server": "2.1.0" with "@cypress/vite-dev-server": "0.0.0-development"
  5. run yarn test:component:run: the result should be the expected
  6. if running yarn test:component:run from previous step again, delete node_modules/.vite directory before run it again

Once finished testing, unlink from npm/vite-dev-server package and from target project.

Current Behavior

see #18261

New Behavior

  • works on windows.
  • target project optimizeDeps.entries entries should be preserved

Tests

PENDING (this is why is on draft)

- preserve `optimizedDeps.entries` configured on target project
- transform windows absolute paths to relative
- transform windows paths to use `/` to match fast glob patterns
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Sep 28, 2021

Thanks for taking the time to open a PR!

@userquin userquin changed the title fix(master - vite-dev-server): fix(master - vite-dev-server): windows supportFile + preserve optimize entries Sep 28, 2021
@userquin
Copy link
Contributor Author

@lmiller1990 feel free to change to ready to review if there is no need to add tests for preserve optimizeDeps entries and merge when necessary.

@lmiller1990 lmiller1990 marked this pull request as ready for review September 29, 2021 04:11
@lmiller1990 lmiller1990 self-requested a review September 29, 2021 04:11
Copy link
Contributor

@lmiller1990 lmiller1990 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, exactly what I was expecting when I was thinking about how to fix this. I think this is fine for now, might be nice to investigate using AppVeyor to run the Vite tests at some point in the nearish future.

@lmiller1990 lmiller1990 self-requested a review September 29, 2021 04:16
@lmiller1990
Copy link
Contributor

I will hold off on merging until our semantic release step is fixed, it's currently failing on CI. It should be resolved soon. Thanks!

@userquin
Copy link
Contributor Author

@lmiller1990 adding the supportFile shouln't be outside this if statement if((options.specs && options.specs.length))?

@JessicaSachs
Copy link
Contributor

@lmiller1990 adding the supportFile shouln't be outside this if statement if((options.specs && options.specs.length))?

We can add the support file if there are no specs. That's fine. We can go either way, honestly.

@JessicaSachs JessicaSachs changed the title fix(master - vite-dev-server): windows supportFile + preserve optimize entries fix(vite-dev-server): windows supportFile + preserve optimize entries Oct 1, 2021
@JessicaSachs JessicaSachs merged commit ea2f6a4 into cypress-io:master Oct 1, 2021
tgriesser added a commit that referenced this pull request Oct 8, 2021
* develop: (31 commits)
  fix: `everyNthFrame` should only be applied for Chrome 89+ (#18392)
  docs: General updates to contributing guide (#18283)
  chore: Update Chrome (beta) to 95.0.4638.40 (#18389)
  chore: use circleci timings split for e2e tests (#18367)
  fix: fixed title (#18370)
  chore(deps): update dependency electron to v14 🌟 (#18384)
  chore(server): share client route (#18215)
  fix: Prevent Cypress from crashing when argument parsing "spec: {}" (#18312)
  chore: update husky dev dependency to v7 (#18345)
  feat: add defineConfig function to help type config (#18302)
  chore: Update Chrome (stable) to 94.0.4606.71 (#18324)
  feat: allow to use TypeScript in the config file (#18300)
  allow select to be called with empty array (#18329)
  fix(vite-dev-server): windows `supportFile` + preserve optimize entries (#18286)
  chore: fix semantic-release dry run (#18332)
  fix(driver): improve status_code_flags_invalid error message (#18316)
  chore(deps): update dependency electron to v13.5.0 🌟 (#18318)
  chore: Update Chrome (stable) to 94.0.4606.61 and Chrome (beta) to 95.0.4638.32 (#18229)
  fix(proxy-logging): use constant consoleProps object (#18207)
  feat(driver): Add "overwrite" option to cy.screenshot() (#18280)
  ...
tgriesser added a commit that referenced this pull request Oct 8, 2021
* develop: (33 commits)
  fix: remove .json check from require_async, prevent child_process spawn (#18416)
  percy snapshot the tooltip visually, prevent it from being hidden
  fix: `everyNthFrame` should only be applied for Chrome 89+ (#18392)
  docs: General updates to contributing guide (#18283)
  chore: Update Chrome (beta) to 95.0.4638.40 (#18389)
  chore: use circleci timings split for e2e tests (#18367)
  fix: fixed title (#18370)
  chore(deps): update dependency electron to v14 🌟 (#18384)
  chore(server): share client route (#18215)
  fix: Prevent Cypress from crashing when argument parsing "spec: {}" (#18312)
  chore: update husky dev dependency to v7 (#18345)
  feat: add defineConfig function to help type config (#18302)
  chore: Update Chrome (stable) to 94.0.4606.71 (#18324)
  feat: allow to use TypeScript in the config file (#18300)
  allow select to be called with empty array (#18329)
  fix(vite-dev-server): windows `supportFile` + preserve optimize entries (#18286)
  chore: fix semantic-release dry run (#18332)
  fix(driver): improve status_code_flags_invalid error message (#18316)
  chore(deps): update dependency electron to v13.5.0 🌟 (#18318)
  chore: Update Chrome (stable) to 94.0.4606.61 and Chrome (beta) to 95.0.4638.32 (#18229)
  ...
mjhenkes pushed a commit that referenced this pull request Jul 28, 2022
…es (#18286)

Co-authored-by: Jessica Sachs <jess@jessicasachs.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants