Skip to content

Commit d52ab41

Browse files
committed
Unify scripts with flag-based configuration
- Create unified lint.mjs script with flags (--fix, --all, --affected, --staged, --pre-commit) - Update test.mjs and test-affected.mjs with consistent flags - Remove special case for package.json in affected-test-mapper - Simplify package.json scripts to use unified scripts - Update .husky/pre-commit to use new flag-based commands - Add --help flag support to all scripts
1 parent 2513592 commit d52ab41

File tree

6 files changed

+486
-25
lines changed

6 files changed

+486
-25
lines changed

.husky/pre-commit

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
if [ -z "${DISABLE_PRECOMMIT_LINT}" ]; then
2-
pnpm run lint --staged
2+
pnpm lint --pre-commit
33
else
44
echo "Skipping lint due to DISABLE_PRECOMMIT_LINT env var"
55
fi
66

77
if [ -z "${DISABLE_PRECOMMIT_TEST}" ]; then
8-
pnpm run test-pre-commit
8+
dotenvx -q run -f .env.precommit -- pnpm test --pre-commit
99
else
1010
echo "Skipping testing due to DISABLE_PRECOMMIT_TEST env var"
1111
fi

package.json

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,15 @@
4949
"coverage:percent": "node scripts/coverage-percent.mjs",
5050
"coverage:type": "type-coverage",
5151
"coverage:type:verbose": "type-coverage --detail",
52-
"fix": "node scripts/lint-affected.mjs --fix",
52+
"lint": "node scripts/lint.mjs",
53+
"fix": "node scripts/lint.mjs --fix",
5354
"knip:dependencies": "knip --dependencies",
5455
"knip:exports": "knip --include exports,duplicates",
5556
"prepare": "husky",
5657
"prepublishOnly": "echo 'ERROR: Use GitHub Actions workflow for publishing' && exit 1",
57-
"pretest:unit": "pnpm run build",
5858
"test": "node scripts/test.mjs",
59-
"test:quick": "node scripts/test.mjs --skip-checks",
60-
"test:coverage": "node scripts/test.mjs --coverage",
61-
"test:affected": "node scripts/test-affected.mjs",
62-
"test:unit": "dotenvx -q run -f .env.test -- vitest --config .config/vitest.config.mts --run",
63-
"test:unit:coverage": "dotenvx -q run -f .env.test -- vitest --config .config/vitest.config.mts run --coverage",
64-
"test:unit:update": "dotenvx -q run -f .env.test -- vitest --config .config/vitest.config.mts --run --update",
6559
"test-ci": "dotenvx -q run -f .env.test -- vitest --config .config/vitest.config.mts --run",
6660
"type-ci": "pnpm run check:tsc",
67-
"test-pre-commit": "dotenvx -q run -f .env.precommit -- node scripts/test-affected.mjs --staged",
6861
"update": "run-p --aggregate-output update:* && run-s update:data:npm",
6962
"update:deps": "node scripts/taze.mjs",
7063
"update:socket": "pnpm -r update '@socketsecurity/*' '@socketregistry/*' --latest",

0 commit comments

Comments
 (0)