From b3812409c1a2a79a17eef52856ba7f30344a02a2 Mon Sep 17 00:00:00 2001 From: Maxime-NS Date: Mon, 8 Dec 2025 19:35:00 +0100 Subject: [PATCH 1/2] feat: test branch protection --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 48dd63f..7068ede 100644 --- a/README.md +++ b/README.md @@ -47,4 +47,4 @@ To learn more about developing your project with Expo, look at the following res Join our community of developers creating universal apps. - [Expo on GitHub](https://github.com/expo/expo): View our open source platform and contribute. -- [Discord community](https://chat.expo.dev): Chat with Expo users and ask questions. +- [Discord community](https://chat.expo.dev): Chat with other Expo users and ask questions. From 5c940903e943173f168a6eca1a2036e3dacda628 Mon Sep 17 00:00:00 2001 From: Maxime-NS Date: Mon, 8 Dec 2025 19:47:48 +0100 Subject: [PATCH 2/2] fix: remove husky --- .husky/pre-commit | 1 - .husky/pre-push | 1 - package.json | 2 -- pnpm-lock.yaml | 10 ------- scripts/block-pushes-on-core-branches.ts | 35 ------------------------ 5 files changed, 49 deletions(-) delete mode 100644 .husky/pre-commit delete mode 100644 .husky/pre-push delete mode 100644 scripts/block-pushes-on-core-branches.ts diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100644 index d6a9069..0000000 --- a/.husky/pre-commit +++ /dev/null @@ -1 +0,0 @@ -pnpm tsx scripts/block-pushes-on-core-branches.ts diff --git a/.husky/pre-push b/.husky/pre-push deleted file mode 100644 index d6a9069..0000000 --- a/.husky/pre-push +++ /dev/null @@ -1 +0,0 @@ -pnpm tsx scripts/block-pushes-on-core-branches.ts diff --git a/package.json b/package.json index 8a6961c..83c76ec 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,6 @@ "ios": "expo start --ios", "web": "expo start --web", "lint": "expo lint", - "prepare": "husky", "migrate": "npx convex run migrations:runAll", "migrate:dryrun": "npx convex run migrations:runAll \"{dryRun: true}\"", "migrate:status": "npx convex run --component migrations lib:getStatus", @@ -77,7 +76,6 @@ "dotenv-cli": "^11.0.0", "eslint": "^9.25.0", "eslint-config-expo": "~10.0.0", - "husky": "^9.1.7", "npm-run-all2": "^8.0.4", "prettier-plugin-tailwindcss": "^0.5.14", "tailwindcss": "^3.4.18", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bbcfd56..9a3aadd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -165,9 +165,6 @@ importers: eslint-config-expo: specifier: ~10.0.0 version: 10.0.0(eslint@9.39.1(jiti@1.21.7))(typescript@5.9.3) - husky: - specifier: ^9.1.7 - version: 9.1.7 npm-run-all2: specifier: ^8.0.4 version: 8.0.4 @@ -3218,11 +3215,6 @@ packages: resolution: {integrity: sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==} engines: {node: '>= 14'} - husky@9.1.7: - resolution: {integrity: sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==} - engines: {node: '>=18'} - hasBin: true - hyphenate-style-name@1.1.0: resolution: {integrity: sha512-WDC/ui2VVRrz3jOVi+XtjqkDjiVjTtFaAGiW37k6b+ohyQ5wYDOGkvCZa8+H0nx3gyvv0+BST9xuOgIyGQ00gw==} @@ -8971,8 +8963,6 @@ snapshots: transitivePeerDependencies: - supports-color - husky@9.1.7: {} - hyphenate-style-name@1.1.0: {} ieee754@1.2.1: {} diff --git a/scripts/block-pushes-on-core-branches.ts b/scripts/block-pushes-on-core-branches.ts deleted file mode 100644 index 693fd6d..0000000 --- a/scripts/block-pushes-on-core-branches.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { execSync } from "child_process"; - -const protectedBranches = ["main", "preview", "qa", "dev"]; - -const getCurrentBranch = () => - execSync("git symbolic-ref --short HEAD", { encoding: "utf8" }).trim(); - -const currentBranch = getCurrentBranch(); - -if (protectedBranches.includes(currentBranch)) { - console.error(`🚫 Branch "${currentBranch}" is protected.`); - - if (currentBranch === "main") { - console.error('🔒 No direct commits or pushes to "main".'); - console.error('➡ Use PR from "preview" → "main".'); - } - - if (currentBranch === "preview") { - console.error('🔒 No direct commits or pushes to "preview".'); - console.error('➡ Use PR from "qa" → "preview".'); - } - - if (currentBranch === "qa") { - console.error('🔒 No direct commits or pushes to "qa".'); - console.error('➡ Use PR from "dev" → "qa".'); - } - - if (currentBranch === "dev") { - console.error('🔒 No direct commits or pushes to "dev".'); - console.error("➡ Create a feature/sub branch:"); - console.error(" git checkout -b feature/xyz"); - } - - process.exit(1); -}