]> git.ipfire.org Git - thirdparty/vuejs/create-vue.git/commitdiff
fix: add `cypress install` to `prepare` script to fix pnpm 10 compatibility
authorHaoqun Jiang <haoqunjiang@gmail.com>
Thu, 6 Feb 2025 15:57:40 +0000 (23:57 +0800)
committerCédric Exbrayat <cexbrayat@users.noreply.github.com>
Thu, 6 Feb 2025 19:07:23 +0000 (20:07 +0100)
This approach works with both pnpm 10 and other package managers:
- If Cypress's `postinstall` script has been run, it'll do nothing other
than print a message.
- If `postinstall` hasn't been run, it'll download the Cypress binary.

As for why using `prepare` instead of `postinstall`, please refer to the
discussion thread where `husky` decided to use `prepare`:
- <https://github.com/typicode/husky/issues/884>

template/config/cypress/package.json

index 49c1dc947b21214d3ad3940e548360bc4359075b..4714685a4e2ffb6717d9d12b2482d717685e639f 100644 (file)
@@ -1,5 +1,6 @@
 {
   "scripts": {
+    "prepare": "cypress install",
     "test:e2e": "start-server-and-test preview http://localhost:4173 'cypress run --e2e'",
     "test:e2e:dev": "start-server-and-test 'vite dev --port 4173' http://localhost:4173 'cypress open --e2e'"
   },