Skip to content

Commit

Permalink
chore: hide and silence unnecessary post-install runs of husky (#870)
Browse files Browse the repository at this point in the history
  • Loading branch information
novusnota authored Sep 25, 2024
1 parent eb6aa86 commit 0f3dbe2
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/tact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ jobs:
yarn gen
yarn build
- name: (npm) Test compatibility with Blueprint
- name: (npm) Test creation of new Blueprint projects
if: ${{ matrix.package-manager == 'npm' }}
run: |
npm link
Expand All @@ -208,7 +208,17 @@ jobs:
npm run build
npm run test
- name: (yarn) Test compatibility with Blueprint
- name: (npm) Test Tact and Blueprint installs in existing projects
if: ${{ matrix.package-manager == 'npm' }}
run: |
# Out of the box, only npm experiences issues
# with lifecycle scripts of installed dependencies
mkdir npm-test && cd npm-test
npm init -y
npm i ../ # installing compiler relatively
npm i @ton/blueprint
- name: (yarn) Test creation of new Blueprint projects
if: ${{ matrix.package-manager == 'yarn' }}
run: |
yarn link
Expand All @@ -218,7 +228,7 @@ jobs:
yarn build
yarn test
- name: (pnpm) Test compatibility with Blueprint
- name: (pnpm) Test creation of new Blueprint projects
if: ${{ matrix.package-manager == 'pnpm' }}
run: |
npm i -g pnpm
Expand All @@ -230,7 +240,7 @@ jobs:
pnpm build
pnpm test
- name: (bun) Test compatibility with Blueprint
- name: (bun) Test creation of new Blueprint projects
if: ${{ matrix.package-manager == 'bun' }}
run: |
bun link
Expand Down
8 changes: 8 additions & 0 deletions .husky/install.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Makes all husky runs silent when it shouldn't have run
// And non-silent otherwise (direct installation of dependencies inside Tact repo)
//
// Taken from:
// https://typicode.github.io/husky/how-to.html#ci-server-and-docker

const husky = (await import("husky")).default;
console.log(husky());
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Fix `npm` installations of Tact compiler or any of the packages depending on it by hiding unnecessary post-install runs of `husky`: PR [#870](https://github.com/tact-lang/tact/pull/870)

### Release contributors

## [1.5.1] - 2024-09-18
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"knip": "knip",
"lint:all": "yarn lint && yarn fmt:check && yarn lint:schema && yarn spell && yarn knip",
"all": "yarn clean && yarn gen && yarn build && yarn coverage && yarn lint:all",
"postinstall": "husky",
"postinstall": "node .husky/install.mjs || true",
"prepack": "pinst --disable",
"postpack": "pinst --enable"
},
Expand Down

0 comments on commit 0f3dbe2

Please sign in to comment.