Skip to content

Commit 396d49a

Browse files
authored
Merge pull request #17 from haxurn/chore/improvements
feat: comprehensive SDK improvements - error handling, build system, testing, and documentation
2 parents 1f7656f + f0e2c82 commit 396d49a

58 files changed

Lines changed: 5379 additions & 8124 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "restricted",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.{yml,yaml}]
15+
indent_size = 2
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Bug Report
2+
description: Report a bug or issue with chapa-nodejs
3+
title: "[Bug]: "
4+
labels: ["bug", "triage"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for taking the time to report a bug! Please fill out the form below.
10+
11+
- type: textarea
12+
id: description
13+
attributes:
14+
label: Bug Description
15+
description: A clear and concise description of what the bug is.
16+
placeholder: Tell us what you see!
17+
validations:
18+
required: true
19+
20+
- type: textarea
21+
id: reproduction
22+
attributes:
23+
label: Steps to Reproduce
24+
description: Steps to reproduce the behavior
25+
placeholder: |
26+
1. Initialize Chapa with...
27+
2. Call method...
28+
3. See error...
29+
validations:
30+
required: true
31+
32+
- type: textarea
33+
id: expected
34+
attributes:
35+
label: Expected Behavior
36+
description: What did you expect to happen?
37+
validations:
38+
required: true
39+
40+
- type: textarea
41+
id: code
42+
attributes:
43+
label: Code Sample
44+
description: Please provide a minimal code sample that reproduces the issue
45+
render: typescript
46+
validations:
47+
required: false
48+
49+
- type: input
50+
id: version
51+
attributes:
52+
label: Package Version
53+
description: What version of chapa-nodejs are you using?
54+
placeholder: e.g., 2.3.1
55+
validations:
56+
required: true
57+
58+
- type: input
59+
id: node-version
60+
attributes:
61+
label: Node.js Version
62+
description: What version of Node.js are you using?
63+
placeholder: e.g., 20.10.0
64+
validations:
65+
required: true
66+
67+
- type: dropdown
68+
id: environment
69+
attributes:
70+
label: Environment
71+
description: Where are you running this?
72+
options:
73+
- Development
74+
- Production
75+
- Testing
76+
validations:
77+
required: true
78+
79+
- type: textarea
80+
id: additional
81+
attributes:
82+
label: Additional Context
83+
description: Add any other context about the problem here
84+
validations:
85+
required: false

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Documentation
4+
url: https://github.com/fireayehu/chapa-nodejs#readme
5+
about: Check the documentation for usage examples
6+
- name: Chapa API Documentation
7+
url: https://developer.chapa.co/docs
8+
about: Official Chapa API documentation
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Feature Request
2+
description: Suggest a new feature or enhancement
3+
title: "[Feature]: "
4+
labels: ["enhancement"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for suggesting a new feature!
10+
11+
- type: textarea
12+
id: problem
13+
attributes:
14+
label: Problem Statement
15+
description: Is your feature request related to a problem? Please describe.
16+
placeholder: I'm always frustrated when...
17+
validations:
18+
required: true
19+
20+
- type: textarea
21+
id: solution
22+
attributes:
23+
label: Proposed Solution
24+
description: Describe the solution you'd like
25+
placeholder: I would like to see...
26+
validations:
27+
required: true
28+
29+
- type: textarea
30+
id: alternatives
31+
attributes:
32+
label: Alternatives Considered
33+
description: Describe alternatives you've considered
34+
validations:
35+
required: false
36+
37+
- type: textarea
38+
id: example
39+
attributes:
40+
label: Example Usage
41+
description: Show how you'd like to use this feature
42+
render: typescript
43+
validations:
44+
required: false
45+
46+
- type: textarea
47+
id: additional
48+
attributes:
49+
label: Additional Context
50+
description: Add any other context or screenshots about the feature request
51+
validations:
52+
required: false
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Question
2+
description: Ask a question about chapa-nodejs
3+
title: "[Question]: "
4+
labels: ["question"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Have a question? We're here to help!
10+
11+
- type: textarea
12+
id: question
13+
attributes:
14+
label: Your Question
15+
description: What would you like to know?
16+
validations:
17+
required: true
18+
19+
- type: textarea
20+
id: context
21+
attributes:
22+
label: Context
23+
description: Provide any relevant context or what you've tried so far
24+
validations:
25+
required: false
26+
27+
- type: textarea
28+
id: code
29+
attributes:
30+
label: Code Sample
31+
description: If applicable, provide a code sample
32+
render: typescript
33+
validations:
34+
required: false

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
## Description
2+
<!-- Provide a brief description of the changes -->
3+
4+
## Type of Change
5+
<!-- Mark the relevant option with an "x" -->
6+
7+
- [ ] Bug fix (non-breaking change which fixes an issue)
8+
- [ ] New feature (non-breaking change which adds functionality)
9+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
10+
- [ ] Documentation update
11+
- [ ] Code refactoring
12+
- [ ] Performance improvement
13+
- [ ] Test coverage improvement
14+
15+
## Related Issue
16+
<!-- Link to the issue this PR addresses -->
17+
Closes #
18+
19+
## Changes Made
20+
<!-- List the specific changes made in this PR -->
21+
22+
-
23+
-
24+
-
25+
26+
## Testing
27+
<!-- Describe the tests you ran to verify your changes -->
28+
29+
- [ ] All existing tests pass
30+
- [ ] Added new tests for new functionality
31+
- [ ] Manual testing completed
32+
33+
## Checklist
34+
<!-- Mark completed items with an "x" -->
35+
36+
- [ ] My code follows the project's code style
37+
- [ ] I have performed a self-review of my code
38+
- [ ] I have commented my code, particularly in hard-to-understand areas
39+
- [ ] I have made corresponding changes to the documentation
40+
- [ ] My changes generate no new warnings
41+
- [ ] I have added tests that prove my fix is effective or that my feature works
42+
- [ ] New and existing unit tests pass locally with my changes
43+
- [ ] Any dependent changes have been merged and published
44+
45+
## Screenshots (if applicable)
46+
<!-- Add screenshots to help explain your changes -->
47+
48+
## Additional Notes
49+
<!-- Add any additional notes or context -->

.github/workflows/ci.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
node-version: [18.x, 20.x, 22.x]
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Setup pnpm
20+
uses: pnpm/action-setup@v4
21+
with:
22+
version: 10
23+
24+
- name: Setup Node.js ${{ matrix.node-version }}
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
cache: 'pnpm'
29+
30+
- name: Install dependencies
31+
run: pnpm install --frozen-lockfile
32+
33+
- name: Format check
34+
run: pnpm run format:check
35+
36+
- name: Lint
37+
run: pnpm run lint
38+
39+
- name: Test
40+
run: pnpm test
41+
42+
- name: Build
43+
run: pnpm run build
44+
45+
- name: Upload coverage
46+
if: matrix.node-version == '20.x'
47+
uses: codecov/codecov-action@v4
48+
with:
49+
files: ./coverage/lcov.info
50+
flags: unittests
51+
name: codecov-umbrella

.github/workflows/publish.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,34 @@ jobs:
1313
id-token: write
1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v5
16+
uses: actions/checkout@v4
1717

1818
- name: Setup pnpm
1919
uses: pnpm/action-setup@v4
2020
with:
2121
version: 10
22-
cache: true
2322

2423
- name: Setup Node.js
25-
uses: actions/setup-node@v6
24+
uses: actions/setup-node@v4
2625
with:
27-
node-version: '24'
26+
node-version: '20'
2827
registry-url: 'https://registry.npmjs.org'
28+
cache: 'pnpm'
2929

3030
- name: Install dependencies
3131
run: pnpm install --frozen-lockfile
3232

33+
- name: Format check
34+
run: pnpm run format:check
35+
36+
- name: Lint
37+
run: pnpm run lint
38+
39+
- name: Test
40+
run: pnpm test
41+
3342
- name: Build
34-
run: pnpm build
43+
run: pnpm run build
3544

3645
- name: Publish to npm
3746
run: pnpm publish --provenance --access public --no-git-checks

0 commit comments

Comments
 (0)