Skip to content

Commit 7771f43

Browse files
committed
feat: add issue and pull request templates, CI/CD workflows, and update package.json
1 parent 1c895fe commit 7771f43

File tree

7 files changed

+215
-1
lines changed

7 files changed

+215
-1
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
name: Bug report
3+
title: "[Bug]: "
4+
about: Report a reproducible problem
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
<!-- Thanks for taking the time to report a bug! Please fill the sections below. -->
10+
11+
## Summary
12+
13+
A clear and concise description of the bug.
14+
15+
## Environment
16+
17+
- Package version: (e.g. 2.1.1)
18+
- Node.js version:
19+
- Browser + version:
20+
- OS:
21+
22+
## Reproduction
23+
24+
Steps to reproduce the behavior:
25+
26+
1.
27+
2.
28+
3.
29+
30+
### Minimal snippet
31+
32+
```js
33+
// Provide the smallest reproducible example.
34+
```
35+
36+
## Expected behavior
37+
38+
What did you expect to happen?
39+
40+
## Actual behavior
41+
42+
What actually happened?
43+
44+
## Screenshots / Logs
45+
46+
If applicable, add screenshots or console logs.
47+
48+
## Additional context
49+
50+
Add any other context or links (PRs, issues, references) here.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Questions / Usage Help
4+
url: https://github.com/Rajesh-Royal/Broprint.js/discussions
5+
about: Ask questions and get help from the community.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Feature request
3+
title: "[Feature]: "
4+
about: Suggest an idea or enhancement
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
<!-- Thanks for suggesting a feature! -->
10+
11+
## Problem
12+
13+
What problem are you trying to solve?
14+
15+
## Proposal
16+
17+
Describe the solution you'd like.
18+
19+
## Alternatives
20+
21+
Describe any alternative solutions or features you've considered.
22+
23+
## Additional context
24+
25+
Add any other context, mockups, or examples here.

.github/pull_request_template.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<!--
2+
Thank you for contributing! Please fill out the checklist below.
3+
-->
4+
5+
## Summary
6+
7+
Explain the change (what & why).
8+
9+
## Type of change
10+
11+
- [ ] Bug fix
12+
- [ ] New feature
13+
- [ ] Breaking change
14+
- [ ] Chore / Maintenance
15+
- [ ] Docs update
16+
17+
## Checklist
18+
19+
- [ ] Code builds locally (npm run build:npm)
20+
- [ ] Linting/format (if applicable) passes
21+
- [ ] Updated documentation (README / docs) if needed
22+
- [ ] Added tests or explanation why not (project currently lacks tests)
23+
- [ ] Version bump NOT included (handled by release process)
24+
25+
## How to test
26+
27+
Steps or code snippet to verify.
28+
29+
## Screenshots / Logs
30+
31+
If UI or meaningful logs changed.
32+
33+
## Related issues
34+
35+
Link to issues this PR closes (e.g. Closes #123).
36+
37+
## Additional context
38+
39+
Anything else reviewers should know.

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [ develop, master ]
6+
push:
7+
branches: [ develop ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 5
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: 20
18+
cache: 'npm'
19+
- name: Install deps
20+
run: npm ci || npm install --no-audit --no-fund
21+
- name: Build
22+
run: npm run build:npm
23+
- name: Package size (approx)
24+
run: du -sh lib || true

.github/workflows/publish.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Publish Package
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
paths-ignore:
7+
- 'docs/**'
8+
- '*.md'
9+
- 'LICENSE'
10+
workflow_dispatch: {}
11+
12+
permissions:
13+
contents: write
14+
15+
concurrency:
16+
group: publish-${{ github.ref }}
17+
cancel-in-progress: false
18+
19+
jobs:
20+
publish:
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 10
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- uses: actions/setup-node@v4
27+
with:
28+
node-version: 20
29+
registry-url: https://registry.npmjs.org
30+
always-auth: true
31+
cache: 'npm'
32+
33+
- name: Install dependencies
34+
run: npm ci || npm install --no-audit --no-fund
35+
36+
- name: Build
37+
run: npm run build:npm
38+
39+
- name: Determine version & check registry
40+
id: ver
41+
env:
42+
PKG_NAME: "@rajesh896/broprint.js"
43+
run: |
44+
VERSION=$(node -p "require('./package.json').version")
45+
echo "version=$VERSION" >> $GITHUB_OUTPUT
46+
if npm view "$PKG_NAME@$VERSION" >/dev/null 2>&1; then
47+
echo "exists=true" >> $GITHUB_OUTPUT
48+
echo "Version $VERSION already on registry; skipping publish."
49+
else
50+
echo "exists=false" >> $GITHUB_OUTPUT
51+
fi
52+
53+
- name: Publish to npm
54+
if: steps.ver.outputs.exists == 'false'
55+
env:
56+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
57+
run: npm publish --access public
58+
59+
- name: Create git tag
60+
if: steps.ver.outputs.exists == 'false'
61+
run: |
62+
VERSION=${{ steps.ver.outputs.version }}
63+
git tag v$VERSION
64+
git push origin v$VERSION || true

package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@
4141
"url": "https://github.com/Rajesh-Royal/Broprint.js/issues"
4242
},
4343
"homepage": "https://github.com/Rajesh-Royal/Broprint.js#readme",
44+
"files": [
45+
"lib",
46+
"LICENSE",
47+
"README.MD"
48+
],
4449
"dependencies": {},
45-
"devDependencies": {}
50+
"devDependencies": {
51+
"typescript": "^5.4.0"
52+
}
4653
}

0 commit comments

Comments
 (0)