Remove need to manually compile JS binary for hashFiles utility (#2770)

* Add in pre-commit hook and husky integration to compile the js binary on commit

* Lint/format before build
This commit is contained in:
Ryan van Zeben
2023-08-24 10:14:11 -04:00
committed by GitHub
parent 7b53c38294
commit 8dd2cec3af
6 changed files with 1572 additions and 573 deletions

View File

@@ -1,11 +1,19 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": false,
"arrowParens": "avoid",
"parser": "typescript"
}
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": false,
"arrowParens": "avoid",
"overrides": [
{
"files": "*.{js,ts,json}",
"options": {
"tabWidth": 2
}
}
]
}

View File

@@ -1,4 +1,3 @@
To compile this package (output will be stored in `Misc/layoutbin`) run `npm install && npm run all`.
To compile this package (output will be stored in `Misc/layoutbin`) run `npm install && npm run prepare && npm run all`.
> Note: this package also needs to be recompiled for dependabot PRs updating one of
> its dependencies.
When you commit changes to the JSON or Typescript file, the javascript binary will be automatically re-compiled and added to the latest commit.

File diff suppressed because it is too large Load Diff

View File

@@ -9,7 +9,9 @@
"format-check": "prettier --check **/*.ts",
"lint": "eslint src/**/*.ts",
"pack": "ncc build -o ../../layoutbin/hashFiles",
"all": "npm run build && npm run format && npm run lint && npm run pack"
"all": "npm run format && npm run lint && npm run build && npm run pack",
"prepare": "cd ../../../../ && husky install"
},
"repository": {
"type": "git",
@@ -18,6 +20,16 @@
"keywords": [
"actions"
],
"lint-staged": {
"*.md": [
"prettier --write",
"git add ."
],
"*.{ts,json}": [
"sh -c 'npm run all'",
"git add ."
]
},
"author": "GitHub Actions",
"license": "MIT",
"dependencies": {
@@ -31,7 +43,9 @@
"eslint": "^8.47.0",
"eslint-plugin-github": "^4.9.2",
"eslint-plugin-prettier": "^5.0.0",
"prettier": "^3.0.2",
"typescript": "^5.1.6"
"prettier": "^3.0.1",
"typescript": "^5.1.6",
"husky": "^8.0.3",
"lint-staged": "^14.0.0"
}
}
}