Skip to content

Commit 1339f17

Browse files
committed
feat: modernize project with Prettier, Husky, and GitHub workflows
- Add Prettier 3.7.3 for code formatting - Add Husky 9.1.7 + lint-staged 16.2.7 for pre-commit hooks - Update GitHub Actions to v6 (checkout, setup-node) - Add publish workflow for GitHub Release-based npm publishing - Simplify CI workflow (remove matrix, add format check) - Add issue/PR templates and dependabot config - Add CONTRIBUTING.md guide - Add README badges (CI, npm downloads, license) - Update CHANGELOG for upcoming release - Fix 15 security vulnerabilities (upgrade to semantic-release 25.0.2) - Format all code with Prettier
1 parent 70f4c97 commit 1339f17

File tree

17 files changed

+2848
-1805
lines changed

17 files changed

+2848
-1805
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: Bug Report
3+
about: Create a report to help us improve
4+
title: '[BUG] '
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
## Bug Description
10+
11+
A clear and concise description of what the bug is.
12+
13+
## Steps to Reproduce
14+
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
## Expected Behavior
21+
22+
A clear and concise description of what you expected to happen.
23+
24+
## Actual Behavior
25+
26+
A clear and concise description of what actually happened.
27+
28+
## Environment
29+
30+
- Node version: [e.g. 18.0.0]
31+
- Package version: [e.g. 1.2.1]
32+
- OS: [e.g. macOS, Windows, Linux]
33+
34+
## Additional Context
35+
36+
Add any other context about the problem here.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Feature Request
3+
about: Suggest an idea for this project
4+
title: '[FEATURE] '
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
## Feature Description
10+
11+
A clear and concise description of the feature you'd like to see.
12+
13+
## Problem It Solves
14+
15+
Describe the problem this feature would solve. Ex. I'm always frustrated when [...]
16+
17+
## Proposed Solution
18+
19+
A clear and concise description of what you want to happen.
20+
21+
## Alternatives Considered
22+
23+
A clear and concise description of any alternative solutions or features you've considered.
24+
25+
## Additional Context
26+
27+
Add any other context or screenshots about the feature request here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
## Description
2+
3+
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
4+
5+
Fixes # (issue)
6+
7+
## Type of Change
8+
9+
- [ ] Bug fix (non-breaking change which fixes an issue)
10+
- [ ] New feature (non-breaking change which adds functionality)
11+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
12+
- [ ] Documentation update
13+
14+
## Testing
15+
16+
Please describe the tests you ran to verify your changes. Provide instructions so we can reproduce.
17+
18+
```bash
19+
npm test
20+
npm run lint
21+
npm run format -- --check
22+
```
23+
24+
## Checklist
25+
26+
- [ ] My code follows the style guidelines of this project
27+
- [ ] I have performed a self-review of my code
28+
- [ ] I have commented my code, particularly in hard-to-understand areas
29+
- [ ] I have made corresponding changes to the documentation
30+
- [ ] My changes generate no new warnings
31+
- [ ] I have added tests that prove my fix is effective or that my feature works
32+
- [ ] New and existing unit tests pass locally with my changes
33+
- [ ] I have used conventional commits for my commit messages

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: 'npm'
4+
directory: '/'
5+
schedule:
6+
interval: 'weekly'
7+
open-pull-requests-limit: 10
8+
- package-ecosystem: 'github-actions'
9+
directory: '/'
10+
schedule:
11+
interval: 'weekly'
12+
open-pull-requests-limit: 5

.github/workflows/ci.yml

Lines changed: 6 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -9,44 +9,14 @@ on:
99
jobs:
1010
test:
1111
runs-on: ubuntu-latest
12-
strategy:
13-
matrix:
14-
node: [18, 20, 22]
1512
steps:
16-
- uses: actions/checkout@v4
17-
- uses: actions/setup-node@v4
18-
with:
19-
node-version: ${{ matrix.node }}
20-
- run: node --version
21-
- run: npm install
22-
- run: npm test
23-
- name: coverage
24-
uses: codecov/codecov-action@v5
25-
with:
26-
name: actions ${{ matrix.node }}
27-
28-
lint:
29-
runs-on: ubuntu-latest
30-
steps:
31-
- uses: actions/checkout@v4
32-
- uses: actions/setup-node@v4
13+
- uses: actions/checkout@v6
14+
- uses: actions/setup-node@v6
3315
with:
3416
node-version: 20
35-
- run: npm install
17+
cache: 'npm'
18+
- run: npm ci
3619
- run: npm run lint
37-
38-
release:
39-
if: github.ref == 'refs/heads/main'
40-
runs-on: ubuntu-latest
41-
needs: [test, lint]
42-
steps:
43-
- uses: actions/checkout@v4
44-
- uses: actions/setup-node@v4
45-
with:
46-
node-version: 20
47-
- run: npm install
20+
- run: npm run format -- --check
21+
- run: npm test
4822
- run: npm run build
49-
- run: npx semantic-release
50-
env:
51-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/publish.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Publish to npm and GitHub Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
12+
packages: write
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v6
16+
17+
- name: Use Node.js
18+
uses: actions/setup-node@v6
19+
with:
20+
node-version: '20'
21+
registry-url: 'https://registry.npmjs.org'
22+
cache: 'npm'
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Lint
28+
run: npm run lint
29+
30+
- name: Format check
31+
run: npm run format -- --check
32+
33+
- name: Run tests
34+
run: npm test
35+
36+
- name: Build
37+
run: npm run build
38+
39+
- name: Publish to npm
40+
env:
41+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
42+
run: npm publish --access public
43+
44+
- name: Upload build artifact to GitHub Release
45+
uses: softprops/action-gh-release@v2
46+
with:
47+
files: dist/**/*
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx lint-staged

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"trailingComma": "all",
5+
"printWidth": 80,
6+
"tabWidth": 2
7+
}

CHANGELOG.md

Lines changed: 47 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,68 @@
1-
# [1.3.0](https://github.com/Jszigeti/axios-error-handler/compare/v1.2.0...v1.3.0) (2024-12-11)
1+
# Changelog
22

3+
All notable changes to this project will be documented in this file.
34

4-
### Features
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
57

6-
* add tests, update README, set up GitHub Actions, and fix code ([91428c0](https://github.com/Jszigeti/axios-error-handler/commit/91428c0451459f18732eb45f45cdd19c517fa599))
8+
## [Unreleased]
79

8-
# [1.2.0](https://github.com/Jszigeti/axios-error-handler/compare/v1.1.0...v1.2.0) (2024-12-11)
10+
### Added
911

12+
- Prettier 3.7.3 for code formatting
13+
- Husky 9.1.7 + lint-staged 16.2.7 for pre-commit hooks
14+
- GitHub Actions v6 (checkout, setup-node)
15+
- Publish workflow for GitHub Release-based npm publishing
16+
- Issue and PR templates
17+
- Dependabot configuration
18+
- CONTRIBUTING.md guide
19+
- Comprehensive README badges (CI, npm downloads, license)
1020

11-
### Features
21+
### Changed
22+
23+
- Upgraded all dependencies to latest versions
24+
- Migrated to semantic-release 25.0.2
25+
- Simplified CI workflow (removed matrix, added format check)
26+
- Formatted all code with Prettier
27+
- Improved package.json with format script, engines, and lint-staged config
1228

13-
* add tests, update README, set up GitHub Actions, and fix code ([b18c7db](https://github.com/Jszigeti/axios-error-handler/commit/b18c7db40ba9933d2c1e8fa5517917218b2dc540))
29+
### Fixed
1430

15-
# [1.1.0](https://github.com/Jszigeti/axios-error-handler/compare/v1.0.1...v1.1.0) (2024-12-11)
31+
- Fixed 15 security vulnerabilities by upgrading dependencies
1632

33+
## [1.3.0] - 2024-12-11
1734

1835
### Features
1936

20-
* add tests, update README, set up GitHub Actions, and fix code ([db7f897](https://github.com/Jszigeti/axios-error-handler/commit/db7f897891ab4a19d3ee0792aeba24b6902999ea))
37+
- add tests, update README, set up GitHub Actions, and fix code
2138

22-
## [1.0.1](https://github.com/Jszigeti/axios-error-handler/compare/v1.0.0...v1.0.1) (2024-12-11)
39+
## [1.2.0] - 2024-12-11
2340

41+
### Features
2442

25-
### Bug Fixes
43+
- add tests, update README, set up GitHub Actions, and fix code
44+
45+
## [1.1.0] - 2024-12-11
2646

27-
* update semantic-release configuration ([22cbf59](https://github.com/Jszigeti/axios-error-handler/commit/22cbf5991874ba9ed6631e2fa6e24545a22e6f68))
47+
### Features
48+
49+
- add tests, update README, set up GitHub Actions, and fix code
50+
51+
## [1.0.1] - 2024-12-11
2852

29-
# 1.0.0 (2024-12-11)
53+
### Bug Fixes
54+
55+
- update semantic-release configuration
3056

57+
## [1.0.0] - 2024-12-11
3158

3259
### Bug Fixes
3360

34-
* update semantic-release configuration ([7b63e30](https://github.com/Jszigeti/axios-error-handler/commit/7b63e30a2585995d08c0d59ae942efd99958d547))
61+
- update semantic-release configuration
62+
63+
[unreleased]: https://github.com/Jszigeti/axios-error-handler/compare/v1.3.0...HEAD
64+
[1.3.0]: https://github.com/Jszigeti/axios-error-handler/compare/v1.2.0...v1.3.0
65+
[1.2.0]: https://github.com/Jszigeti/axios-error-handler/compare/v1.1.0...v1.2.0
66+
[1.1.0]: https://github.com/Jszigeti/axios-error-handler/compare/v1.0.1...v1.1.0
67+
[1.0.1]: https://github.com/Jszigeti/axios-error-handler/compare/v1.0.0...v1.0.1
68+
[1.0.0]: https://github.com/Jszigeti/axios-error-handler/releases/tag/v1.0.0

0 commit comments

Comments
 (0)