Skip to content

Commit

Permalink
refactor: move package.json scripts to ci (#424)
Browse files Browse the repository at this point in the history
Co-authored-by: Almanov Nikita <131481562+nikkeyl@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and nikkeyl authored Aug 18, 2024
1 parent 8b10dfc commit 0dfbbb3
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 70 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/editorconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
run: bun i

- name: Lint
run: bun lint:editorconfig
run: bun editorconfig-checker
9 changes: 1 addition & 8 deletions .github/workflows/eslint.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
name: ESLint

on:
workflow_run:
workflows:
- CodeQL
types:
- completed
pull_request:
branches:
- main
Expand All @@ -17,8 +12,6 @@ jobs:
eslint:
name: ESLint

if: ${{ github.event.workflow_run.conclusion == 'success' }}

runs-on: ubuntu-latest
timeout-minutes: 10

Expand All @@ -33,4 +26,4 @@ jobs:
run: bun i

- name: Lint
run: bun lint:ts
run: bun eslint src/**/*.ts
2 changes: 1 addition & 1 deletion .github/workflows/prettier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
run: bun i

- name: Lint
run: bun lint:formatting
run: bun prettier . --check
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
# NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
run: bun release
run: bun semantic-release
2 changes: 1 addition & 1 deletion .github/workflows/remark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ jobs:
run: bun i

- name: Lint
run: bun lint:md
run: bun remark . --quiet --frail
9 changes: 1 addition & 8 deletions .github/workflows/spec.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
name: Spec

on:
workflow_run:
workflows:
- ESLint
types:
- completed
pull_request:
branches:
- main
Expand All @@ -17,8 +12,6 @@ jobs:
spec:
name: Spec

if: ${{ github.event.workflow_run.conclusion == 'success' }}

runs-on: ubuntu-latest
timeout-minutes: 10

Expand All @@ -33,4 +26,4 @@ jobs:
run: bun i

- name: Specs
run: bun spec
run: bun test
41 changes: 2 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ This template includes ready-made solutions for integration with:
- **GitHub**.
- **Commitlint**.
- **Conventional Commits**.
- **Husky & Lint Staged**.
- **Husky**.
- **Lint Staged**.
- **GitHub Actions**.
- **Semantic Release**.
- **Bun**.
Expand Down Expand Up @@ -127,44 +128,6 @@ This template includes ready-made solutions for integration with:

- `init`: Installs dependencies and **Husky**.

- `spec`: Runs **Bun** and the tests in the **specs/** folder.

> Also runs using the [`spec.yaml`](.github/workflows/spec.yaml) workflow.
- `spec:coverage`: Runs **Bun** with `--coverage` flag.

- `release`: Runs **Semantic Release**.

- `lint:editorconfig`: Runs **Editorconfig Checker** and
checks all files in the project.

> Also runs with the [`editorconfig.yaml`](.github/workflows/editorconfig.yaml)
> workflow.
- `lint:formatting`: Runs **Prettier** with the `--check` flag
for all files.

> Runs with the [`prettier.yaml`](.github/workflows/prettier.yaml)
>
> Also run with a `pre-commit` hook.
- `lint:md`: Runs **Remark** with the `--quiet` flag and
checks all **Markdown** files.

> Also runs with the [`remark.yaml`](.github/workflows/remark.yaml)
> workflow.
- `lint:ts`: Runs **ESLint** with the flag `--fix`
for all **TypeScript** files.

> Runs with the [`eslint.yaml`](.github/workflows/eslint.yaml)
> workflow.
>
> Also run with a `pre-commit` hook.
- `prettify`: Runs **Prettier** with the `--write` flag
for all files.

## Workflows

- [`auto-merge-dependabot-pull-request.yaml`](.github/workflows/auto-merge-dependabot-pull-request.yaml):
Expand Down
3 changes: 1 addition & 2 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export default {
'**/*.md': 'remark --quiet --frail',
'**/*': 'prettier --write',
'*': 'prettier --write',
'src/**/*.ts': 'eslint --fix',
};
10 changes: 1 addition & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,7 @@
"index.js"
],
"scripts": {
"init": "bun i && husky",
"spec": "bun test",
"spec:coverage": "bun test --coverage",
"release": "semantic-release",
"lint:editorconfig": "editorconfig-checker",
"lint:formatting": "prettier . --check",
"lint:md": "remark . --quiet --frail",
"lint:ts": "eslint src/**/*.ts --fix",
"prettify": "prettier . --write"
"init": "bun i && husky"
},
"devDependencies": {
"@archoleat/commitlint-define-config": "^1.0.9",
Expand Down

0 comments on commit 0dfbbb3

Please sign in to comment.