fix: Husky automatic installation (#16206)

Co-authored-by: Nicolò Ribaudo <[email protected]>
This commit is contained in:
liuxingbaoyu
2024-01-08 16:28:29 +01:00
committed by GitHub
co-authored by Nicolò Ribaudo
parent 570fc1bfed
commit 19a10bca10
4 changed files with 19 additions and 3 deletions
+3 -2
View File
@@ -410,10 +410,11 @@ jobs:
- name: Support self-references on old Node.js
run: |
echo '{
"type": "commonjs",
"private": true,
"devDependencies": {
"@babel/runtime": "workspace:*",
"@babel/runtime-corejs3": "workspace:*"
"@babel/runtime": "workspace:^",
"@babel/runtime-corejs3": "workspace:^"
}
}' > packages/package.json
node -e "
+2
View File
@@ -6,6 +6,8 @@ conditions:
USE_ESM:
default: false
enableConstraintsChecks: true
enableGlobalCache: true
# Disable hardened mode. The Hardened mode will be run in the prepare-yarn-cache CI job.
+1 -1
View File
@@ -5,7 +5,7 @@
"private": true,
"type": "commonjs",
"scripts": {
"prepare": "is-ci || husky install",
"postinstall": "node scripts/postinstall.js",
"bootstrap": "make bootstrap",
"codesandbox:build": "make build-no-bundle",
"build": "make build",
+13
View File
@@ -0,0 +1,13 @@
import { existsSync, copyFileSync } from "fs";
import isCI from "is-ci";
import husky from "husky";
if (!isCI) {
if (!existsSync(".husky/_/husky.sh")) {
husky.install();
}
if (!existsSync(".vscode/settings.json")) {
copyFileSync(".vscode/settings.example.json", ".vscode/settings.json");
}
}