Skip to content

Commit

Permalink
chore: add lefthook to do a clean build before commit
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Aug 16, 2024
1 parent 287549e commit c0d283f
Show file tree
Hide file tree
Showing 12 changed files with 287 additions and 163 deletions.
2 changes: 1 addition & 1 deletion dist/actions/hdi.647acde1.js.map

Large diffs are not rendered by default.

40 changes: 20 additions & 20 deletions dist/actions/setup-cpp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/actions/setup-cpp.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/legacy/hdi.619de66c.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/legacy/setup-cpp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/legacy/setup-cpp.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/modern/hdi.647acde1.js.map

Large diffs are not rendered by default.

40 changes: 20 additions & 20 deletions dist/modern/setup-cpp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/modern/setup-cpp.js.map

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pre-commit:
parallel: false
commands:
lint:
run: pnpm run lint
build:
run: pnpm run clean && pnpm i && pnpm run build -- --no-color && git add ./dist
17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@
"tsconfig.json"
],
"scripts": {
"build": "turbo build && pnpm run build.root",
"build.root": "run-p lint.root.tsc build.root.parcel copy.matchers && run-s build.root.babel build.root.modern",
"build.root.parcel": "cross-env NODE_ENV=production parcel build",
"build.root.babel": "babel ./dist --out-dir dist --plugins @upleveled/babel-plugin-remove-node-prefix --plugins @babel/plugin-transform-private-methods --compact --no-babelrc --source-maps true",
"build.root.modern": "shx cp -r ./dist/actions/* ./dist/modern",
"build": "turbo build && run-p lint.root.tsc build.parcel copy.matchers && run-s build.babel build.modern",
"build.parcel": "cross-env NODE_ENV=production parcel build",
"build.babel": "babel ./dist --out-dir dist --plugins @upleveled/babel-plugin-remove-node-prefix --plugins @babel/plugin-transform-private-methods --compact --no-babelrc --source-maps true",
"build.modern": "shx cp -r ./dist/actions/* ./dist/modern",
"bump": "ncu -u -x numerous,execa,prettier,@types/node,eslint,@types/eslint && pnpm update && pnpx typesync && pnpm run clean",
"clean": "shx rm -rf ./dist ./exe ./packages/*/dist/ ./.parcel-cache && shx mkdir -p ./dist/legacy ./dist/actions ./dist/modern ",
"copy.matchers": "run-p copy.matchers.legacy copy.matchers.actions",
Expand All @@ -40,16 +39,15 @@
"dev": "cross-env NODE_ENV=development parcel watch",
"docs": "shx rm -rf packages/*/README.md && pnpm -r exec readme --path ../../dev/readme/template.md -y && pnpm -r exec ts-readme",
"format": "run-s lint.dprint",
"lint": "turbo lint && pnpm run lint.root",
"lint.root": "run-p --aggregate-output --continue-on-error lint.cspell lint.root.eslint lint.dprint lint.root.tsc lint.biome",
"lint": "turbo lint && run-p --aggregate-output --continue-on-error lint.**",
"lint.cspell": "cspell lint --no-progress --show-suggestions --cache --cache-location ./.cache/cspell/.cspellcache",
"lint.root.eslint": "eslint ./{src,dev}/**/*.{ts,tsx,js,jsx,cjs,mjs,json,yaml} --no-error-on-unmatched-pattern --cache --cache-location ./.cache/eslint/ --fix",
"lint.biome": "biome check --write --unsafe",
"lint.dprint": "dprint fmt",
"lint.root.tsc": "tsc --noEmit --pretty",
"lint.root.eslint": "eslint ./{src,dev}/**/*.{ts,tsx,js,jsx,cjs,mjs,json,yaml} --no-error-on-unmatched-pattern --cache --cache-location ./.cache/eslint/ --fix",
"pack.exe": "shx rm -rf ./dist/tsconfig.tsbuildinfo && node ./dev/scripts/pack-exe.mjs",
"prepublishOnly": "rm ./dist/tsconfig.tsbuildinfo",
"test.lint": "run-p --aggregate-output --continue-on-error lint.cspell test.lint.root.eslint test.lint.dprint lint.root.tsc test.lint.biome",
"test.lint": "run-p --aggregate-output --continue-on-error test.lint.** lint.cspell lint.root.tsc",
"test.lint.root.eslint": "eslint ./{src,dev}/**/*.{ts,tsx,js,jsx,cjs,mjs,json,yaml} --no-error-on-unmatched-pattern --cache --cache-location ./.cache/eslint/",
"test.lint.biome": "biome check",
"test.lint.dprint": "dprint check",
Expand Down Expand Up @@ -94,6 +92,7 @@
"execa": "^7.2.0",
"is-url-online": "^1.5.0",
"jest": "^29.7.0",
"lefthook": "^1.7.12",
"macos-release": "^3.3.0",
"micro-memoize": "^4.1.2",
"mkdirp": "^3.0.1",
Expand Down
330 changes: 224 additions & 106 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

0 comments on commit c0d283f

Please sign in to comment.