Skip to content

Commit 8dd2cec

Browse files
authored
Remove need to manually compile JS binary for hashFiles utility (actions#2770)
* Add in pre-commit hook and husky integration to compile the js binary on commit * Lint/format before build
1 parent 7b53c38 commit 8dd2cec

File tree

6 files changed

+1570
-571
lines changed

6 files changed

+1570
-571
lines changed

.husky/pre-commit

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
cd src/Misc/expressionFunc/hashFiles
5+
6+
npx lint-staged
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1+
12
{
2-
"printWidth": 80,
3-
"tabWidth": 2,
4-
"useTabs": false,
5-
"semi": false,
6-
"singleQuote": true,
7-
"trailingComma": "none",
8-
"bracketSpacing": false,
9-
"arrowParens": "avoid",
10-
"parser": "typescript"
11-
}
3+
"printWidth": 80,
4+
"tabWidth": 2,
5+
"useTabs": false,
6+
"semi": false,
7+
"singleQuote": true,
8+
"trailingComma": "none",
9+
"bracketSpacing": false,
10+
"arrowParens": "avoid",
11+
"overrides": [
12+
{
13+
"files": "*.{js,ts,json}",
14+
"options": {
15+
"tabWidth": 2
16+
}
17+
}
18+
]
19+
}
+2-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
To compile this package (output will be stored in `Misc/layoutbin`) run `npm install && npm run all`.
1+
To compile this package (output will be stored in `Misc/layoutbin`) run `npm install && npm run prepare && npm run all`.
22

3-
> Note: this package also needs to be recompiled for dependabot PRs updating one of
4-
> its dependencies.
3+
When you commit changes to the JSON or Typescript file, the javascript binary will be automatically re-compiled and added to the latest commit.

0 commit comments

Comments
 (0)