diff options
-rw-r--r-- | .github/workflows/builds.yml | 11 | ||||
-rwxr-xr-x | .husky/pre-commit | 5 | ||||
-rw-r--r-- | package.json | 3 |
3 files changed, 14 insertions, 5 deletions
diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 806b2a2..9a3533e 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml | |||
@@ -14,7 +14,7 @@ on: | |||
14 | workflow_dispatch: | 14 | workflow_dispatch: |
15 | inputs: | 15 | inputs: |
16 | message: | 16 | message: |
17 | description: 'Message for build' | 17 | description: "Message for build" |
18 | required: true | 18 | required: true |
19 | 19 | ||
20 | jobs: | 20 | jobs: |
@@ -31,8 +31,13 @@ jobs: | |||
31 | - name: Use Node.js specified in the '.nvmrc' file | 31 | - name: Use Node.js specified in the '.nvmrc' file |
32 | uses: actions/setup-node@v3 | 32 | uses: actions/setup-node@v3 |
33 | with: | 33 | with: |
34 | node-version-file: '.nvmrc' | 34 | node-version-file: ".nvmrc" |
35 | - name: Install pnpm | 35 | - name: Install pnpm |
36 | run: npm i -gf "pnpm@$(node -p 'require("./package.json").engines.pnpm')" && pnpm -v | 36 | run: npm i -gf "pnpm@$(node -p 'require("./package.json").engines.pnpm')" && pnpm -v |
37 | - name: Install node dependencies recursively | 37 | - name: Install node dependencies recursively |
38 | run: pnpm i && pnpm lint && pnpm reformat-files && pnpm package | 38 | run: pnpm i |
39 | - name: Check code style and formatting | ||
40 | if: ${{ github.event_name == 'pull_request' }} | ||
41 | run: pnpm lint && pnpm reformat-files | ||
42 | - name: Package recipes | ||
43 | run: pnpm package | ||
diff --git a/.husky/pre-commit b/.husky/pre-commit index cf9de02..da4248e 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | . "$(dirname "$0")/_/husky.sh" | 2 | . "$(dirname "$0")/_/husky.sh" |
3 | 3 | ||
4 | pnpm i && pnpm lint && pnpm reformat-files && pnpm package | 4 | pnpm i || exit 1 |
5 | pnpm lint:fix --quiet || exit 1 | ||
6 | pnpm reformat-files || exit 1 | ||
7 | pnpm package || exit 1 | ||
diff --git a/package.json b/package.json index d4cacd4..f243f82 100644 --- a/package.json +++ b/package.json | |||
@@ -12,7 +12,8 @@ | |||
12 | "prepare": "pnpm dlx husky install", | 12 | "prepare": "pnpm dlx husky install", |
13 | "package": "node scripts/package.js", | 13 | "package": "node scripts/package.js", |
14 | "create": "node scripts/create.js", | 14 | "create": "node scripts/create.js", |
15 | "lint": "eslint . --fix --report-unused-disable-directives", | 15 | "lint": "eslint \"{recipes,scripts}/**/*.{js,jsx,ts,tsx}\" --quiet", |
16 | "lint:fix": "npm run lint -- --fix", | ||
16 | "reformat-files": "prettier --ignore-path .eslintignore --write --require-pragma \"**/*.{js,json,scss}\"", | 17 | "reformat-files": "prettier --ignore-path .eslintignore --write --require-pragma \"**/*.{js,json,scss}\"", |
17 | "contributors": "all-contributors" | 18 | "contributors": "all-contributors" |
18 | }, | 19 | }, |