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: patch-package is not applied in dist'ed build #19239

Merged
merged 8 commits into from Dec 3, 2021

Conversation

tgriesser
Copy link
Member

@tgriesser tgriesser commented Dec 3, 2021

User facing changelog

Due to changes to build process changes in #17285, the patch-package scripts were not being properly applied as they were previously. Fixes the build process to include the scripts entries in both the root & packages for the yarn install, so the postinstall entries are applied properly.

Added tests in testStaticAssets.ts to ensure the correct patches are being applied.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 3, 2021

Thanks for taking the time to open a PR!

@cypress
Copy link

cypress bot commented Dec 3, 2021



Test summary

18717 0 202 0Flakiness 1


Run details

Project cypress
Status Passed
Commit 5bfb385
Started Dec 3, 2021 10:42 PM
Ended Dec 3, 2021 10:53 PM
Duration 11:11 💡
OS Linux Debian - 10.10
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

cypress/integration/commands/net_stubbing_spec.ts Flakiness
1 network stubbing > waiting and aliasing > can timeout waiting on a single request using "alias.request"

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@tgriesser tgriesser marked this pull request as ready for review December 3, 2021 22:08
@tgriesser tgriesser requested a review from a team as a code owner December 3, 2021 22:08
@tgriesser tgriesser requested review from jennifer-shehane, brian-mann and chrisbreiding and removed request for a team December 3, 2021 22:08
Comment on lines +17 to +18
"engine.io": "5.0.0",
"engine.io-parser": "4.0.2",
Copy link
Member Author

Choose a reason for hiding this comment

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

Needed to add this, as it was being hoisted when devDeps are stripped & patch wasn't being applied.

@@ -113,6 +113,7 @@
"trash": "5.2.0",
"tree-kill": "1.2.2",
"ts-node": "8.5.4",
"tsconfig-paths": "3.10.1",
Copy link
Member

Choose a reason for hiding this comment

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

why did this need move from a dev-dep?

Copy link
Member Author

Choose a reason for hiding this comment

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

Trying to find where it failed - might have only been locally when I was writing the test case for the patch being applied, and it wasn't... and then I noticed that we do indeed use the package in a prod situation:

debug('registering project TS with options %o', tsOptions)
require('tsconfig-paths/register')
tsnode.register(tsOptions)
} catch (err) {
debug(`typescript doesn't exist. ts-node setup failed.`)
debug('error message: %s', err.message)

Copy link
Member

Choose a reason for hiding this comment

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

Nice catch then!

@@ -68,15 +68,23 @@ export async function buildCypressApp (options: BuildCypressAppOpts) {
// Copy Packages: We want to copy the package.json, files, and output
Copy link
Member

Choose a reason for hiding this comment

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

why re-name from .patch to .dev.patch?

Copy link
Member

Choose a reason for hiding this comment

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

Do the patches in packages/socket/patches & packages/server/patches also need to be renamed to .dev.patch?

Copy link
Member Author

@tgriesser tgriesser Dec 3, 2021

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Ahhhh okay 👍🏻

Copy link
Member Author

@tgriesser tgriesser Dec 3, 2021

Choose a reason for hiding this comment

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

Oops, had the wrong link, updated the above with the failing circle job. But here's the docs: https://github.com/ds300/patch-package#dev-only-patches

And no, the socket & server ones are prod dependencies, so they remain .patch

chrisbreiding
chrisbreiding previously approved these changes Dec 3, 2021
emilyrohrbough
emilyrohrbough previously approved these changes Dec 3, 2021
tgriesser added a commit that referenced this pull request Dec 8, 2021
…text

* 10.0-release: (45 commits)
  fix: various Nav Bar fixes (#19283)
  build: add patch package as a dev dependency for fe-shared
  chore: hoist is - fun with cached dependencies
  build: hoist is hard
  build: better hoisting strategy
  fix: remove windows and mac workflow from branch
  revert: remove change about node version 17
  build: remove testing of desktop-gui assets
  build: run window & mac CI in this branch
  build: more fixes
  build: remove toycode mdi from launchpad
  rename patch because of dev dep
  build: fix  merge issue in packages generation
  chore: update sass for windows compatibility
  fix: Do not crash when a ill formed URL request is proxied (#19274)
  fix: remove desktop-gui from circle.yml
  change whitepace in patch
  fix: adding timeout option to writeFile command (#19015)
  release 9.1.1
  fix: patch-package is not applied in dist'ed build (#19239)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants