@programinglive/commiter 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/ISSUE_TEMPLATE/bug_report.md +28 -0
- package/.github/ISSUE_TEMPLATE/config.yml +5 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +24 -0
- package/CHANGELOG.md +20 -0
- package/CODE_OF_CONDUCT.md +36 -0
- package/LICENSE +21 -0
- package/PUBLISH.md +116 -0
- package/README.md +177 -0
- package/SECURITY.md +30 -0
- package/commitlint.config.js +1 -0
- package/index.js +105 -0
- package/package.json +61 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Create a report to help us improve
|
|
4
|
+
labels: bug
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Describe the bug
|
|
8
|
+
A clear and concise description of what the bug is.
|
|
9
|
+
|
|
10
|
+
## To Reproduce
|
|
11
|
+
Steps to reproduce the behavior:
|
|
12
|
+
1. Go to '...'
|
|
13
|
+
2. Click on '...'
|
|
14
|
+
3. See error
|
|
15
|
+
|
|
16
|
+
## Expected behavior
|
|
17
|
+
A clear and concise description of what you expected to happen.
|
|
18
|
+
|
|
19
|
+
## Screenshots or logs
|
|
20
|
+
If applicable, add screenshots, logs, or stack traces to help explain your problem.
|
|
21
|
+
|
|
22
|
+
## Environment
|
|
23
|
+
- Package version:
|
|
24
|
+
- Node.js version:
|
|
25
|
+
- OS:
|
|
26
|
+
|
|
27
|
+
## Additional context
|
|
28
|
+
Add any other context about the problem here.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest an idea for this project
|
|
4
|
+
labels: enhancement
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Summary
|
|
8
|
+
Describe the feature you would like to see.
|
|
9
|
+
|
|
10
|
+
## Problem or Use Case
|
|
11
|
+
What problem does this feature solve? Why is it needed?
|
|
12
|
+
|
|
13
|
+
## Proposed Solution
|
|
14
|
+
Describe your proposed solution or implementation ideas.
|
|
15
|
+
|
|
16
|
+
## Alternatives
|
|
17
|
+
List any alternative solutions or features you've considered.
|
|
18
|
+
|
|
19
|
+
## Additional context
|
|
20
|
+
Add any other context, mockups, or screenshots about the feature request here.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Pull Request Checklist
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
|
|
5
|
+
Describe the changes in this pull request.
|
|
6
|
+
|
|
7
|
+
## Related Issues
|
|
8
|
+
|
|
9
|
+
Link related issues (e.g. closes #123).
|
|
10
|
+
|
|
11
|
+
## Testing
|
|
12
|
+
|
|
13
|
+
- [ ] `npm install`
|
|
14
|
+
- [ ] `npm test`
|
|
15
|
+
- [ ] `npm run release -- --dry-run` (if release-related)
|
|
16
|
+
|
|
17
|
+
## Checklist
|
|
18
|
+
|
|
19
|
+
- [ ] I've read the [Code of Conduct](../CODE_OF_CONDUCT.md)
|
|
20
|
+
- [ ] I've read the [Contributing Guidelines](../CONTRIBUTING.md)
|
|
21
|
+
- [ ] My commits follow the Conventional Commits format (`type(scope): subject`)
|
|
22
|
+
- [ ] Documentation has been updated if needed
|
|
23
|
+
- [ ] New dependencies are justified and added to `package.json`
|
|
24
|
+
- [ ] No `any` types were introduced (TypeScript rule)
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
|
+
|
|
5
|
+
## 1.0.0 (2025-10-17)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### โจ Features
|
|
9
|
+
|
|
10
|
+
* initial project setup with standard-version and conventional commits ([0accf6d](https://github.com/programinglive/commiter/commit/0accf6dba678c1946629aa3f1b691bea7e20cd95))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### ๐ Documentation
|
|
14
|
+
|
|
15
|
+
* add community health files and apply package tooling ([0fa802b](https://github.com/programinglive/commiter/commit/0fa802b6129053d3f32030cec561e5926dd09c42))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### ๐งน Chores
|
|
19
|
+
|
|
20
|
+
* update package metadata ([7c112f3](https://github.com/programinglive/commiter/commit/7c112f3d82e2c92ed31fa3e60fafd5ca0429184d))
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
We pledge to make participation in `@programinglive/commiter` open, welcoming, and harassment-free for everyone, regardless of age, body size, disability, ethnicity, gender identity or expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
|
5
|
+
|
|
6
|
+
## Our Standards
|
|
7
|
+
**Positive behaviours**
|
|
8
|
+
- Showing empathy and kindness toward other people
|
|
9
|
+
- Respecting differing opinions, viewpoints, and experiences
|
|
10
|
+
- Giving and gracefully accepting constructive feedback
|
|
11
|
+
- Accepting responsibility and apologizing when mistakes occur
|
|
12
|
+
|
|
13
|
+
**Unacceptable behaviours**
|
|
14
|
+
- Use of sexualized language or imagery, or unwelcome sexual attention
|
|
15
|
+
- Trolling, insulting or derogatory comments, and personal attacks
|
|
16
|
+
- Public or private harassment
|
|
17
|
+
- Publishing others' private information without permission
|
|
18
|
+
- Other conduct which would reasonably be considered inappropriate in a professional setting
|
|
19
|
+
|
|
20
|
+
## Enforcement Responsibilities
|
|
21
|
+
Project maintainers are responsible for clarifying standards of acceptable behaviour and will take appropriate corrective action in response to unacceptable behaviour. Maintainers have the right to remove, edit, or reject contributions that do not align with this Code of Conduct.
|
|
22
|
+
|
|
23
|
+
## Scope
|
|
24
|
+
This Code of Conduct applies within all project spaces and when an individual is officially representing the project in public spaces.
|
|
25
|
+
|
|
26
|
+
## Enforcement
|
|
27
|
+
Report incidents to `security@programinglive.com`. All complaints will be reviewed promptly and treated confidentially.
|
|
28
|
+
|
|
29
|
+
## Enforcement Guidelines
|
|
30
|
+
1. **Correction** โ Private warning for minor violations and clarification of expectations.
|
|
31
|
+
2. **Warning** โ Consequence for a single serious violation or repeated minor violations.
|
|
32
|
+
3. **Temporary Ban** โ Temporary exclusion from community interactions when behaviour is unacceptable.
|
|
33
|
+
4. **Permanent Ban** โ Permanent removal from the community for sustained inappropriate behaviour or harassment.
|
|
34
|
+
|
|
35
|
+
## Attribution
|
|
36
|
+
Adapted from the [Contributor Covenant](https://www.contributor-covenant.org/version/2/1/code_of_conduct.html).
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Programming Live
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/PUBLISH.md
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# Publishing to NPM
|
|
2
|
+
|
|
3
|
+
This guide explains how to publish the `@programinglive/commiter` package to npm.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
1. **NPM Account**: Create an account at [npmjs.com](https://www.npmjs.com/)
|
|
8
|
+
2. **Login to NPM**: Run `npm login` in your terminal
|
|
9
|
+
3. **Organization Access**: Ensure you have access to the `@programinglive` organization on npm
|
|
10
|
+
|
|
11
|
+
## Publishing Steps
|
|
12
|
+
|
|
13
|
+
### 1. Login to NPM
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm login
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Enter your npm credentials when prompted.
|
|
20
|
+
|
|
21
|
+
### 2. Verify Package Configuration
|
|
22
|
+
|
|
23
|
+
Check that `package.json` is correctly configured:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm pack --dry-run
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
This shows what files will be included in the package.
|
|
30
|
+
|
|
31
|
+
### 3. Publish the Package
|
|
32
|
+
|
|
33
|
+
For the first publish:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm publish --access public
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Note**: The `--access public` flag is required for scoped packages (@programinglive/commiter) to be publicly accessible.
|
|
40
|
+
|
|
41
|
+
### 4. Verify Publication
|
|
42
|
+
|
|
43
|
+
Check your package on npm:
|
|
44
|
+
```
|
|
45
|
+
https://www.npmjs.com/package/@programinglive/commiter
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Releasing New Versions
|
|
49
|
+
|
|
50
|
+
After the initial publish, use the built-in release commands:
|
|
51
|
+
|
|
52
|
+
### Patch Release (1.0.0 โ 1.0.1)
|
|
53
|
+
```bash
|
|
54
|
+
npm run release:patch
|
|
55
|
+
git push --follow-tags origin main
|
|
56
|
+
npm publish
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Minor Release (1.0.0 โ 1.1.0)
|
|
60
|
+
```bash
|
|
61
|
+
npm run release:minor
|
|
62
|
+
git push --follow-tags origin main
|
|
63
|
+
npm publish
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Major Release (1.0.0 โ 2.0.0)
|
|
67
|
+
```bash
|
|
68
|
+
npm run release:major
|
|
69
|
+
git push --follow-tags origin main
|
|
70
|
+
npm publish
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Automated Release Workflow
|
|
74
|
+
|
|
75
|
+
1. Make changes and commit using conventional commits
|
|
76
|
+
2. Run the appropriate release command
|
|
77
|
+
3. Push to GitHub with tags
|
|
78
|
+
4. Publish to npm
|
|
79
|
+
|
|
80
|
+
Example:
|
|
81
|
+
```bash
|
|
82
|
+
# Make changes
|
|
83
|
+
git add .
|
|
84
|
+
git commit -m "feat(cli): add interactive setup wizard"
|
|
85
|
+
|
|
86
|
+
# Create release
|
|
87
|
+
npm run release:minor
|
|
88
|
+
|
|
89
|
+
# Push to GitHub
|
|
90
|
+
git push --follow-tags origin main
|
|
91
|
+
|
|
92
|
+
# Publish to npm
|
|
93
|
+
npm publish
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Unpublishing (Emergency Only)
|
|
97
|
+
|
|
98
|
+
If you need to unpublish a version within 72 hours:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
npm unpublish @programinglive/commiter@1.0.0
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**Warning**: Unpublishing is permanent and should only be used in emergencies.
|
|
105
|
+
|
|
106
|
+
## Package Visibility
|
|
107
|
+
|
|
108
|
+
- **Public**: Anyone can install and use the package
|
|
109
|
+
- **Open Source**: MIT licensed - users can modify and distribute
|
|
110
|
+
- **Free**: No cost to install or use
|
|
111
|
+
|
|
112
|
+
## Support
|
|
113
|
+
|
|
114
|
+
For issues or questions:
|
|
115
|
+
- GitHub Issues: https://github.com/programinglive/commiter/issues
|
|
116
|
+
- NPM Package: https://www.npmjs.com/package/@programinglive/commiter
|
package/README.md
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# Commiter ๐
|
|
2
|
+
|
|
3
|
+
A standardized commit convention and release management tool for your repository using `standard-version`.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- โ
**Enforced Commit Conventions** - Uses Conventional Commits format
|
|
8
|
+
- ๐ฏ **Automated Versioning** - Semantic versioning (major, minor, patch)
|
|
9
|
+
- ๐ **Changelog Generation** - Automatic CHANGELOG.md with icons
|
|
10
|
+
- ๐ **Git Hooks** - Pre-commit and commit-msg validation via Husky
|
|
11
|
+
- ๐จ **Icon Support** - Each commit type has a dedicated icon in releases
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
Install the package globally or as a dev dependency in your project:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# Install globally
|
|
19
|
+
npm install -g @programinglive/commiter
|
|
20
|
+
|
|
21
|
+
# Or install as dev dependency
|
|
22
|
+
npm install --save-dev @programinglive/commiter
|
|
23
|
+
|
|
24
|
+
# Or use npx (no installation required)
|
|
25
|
+
npx @programinglive/commiter
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
After installation in your project, the Husky hooks will be automatically set up for commit message validation.
|
|
29
|
+
|
|
30
|
+
## Commit Message Format
|
|
31
|
+
|
|
32
|
+
All commits must follow the [Conventional Commits](https://www.conventionalcommits.org/) specification:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
<type>(<scope>): <subject>
|
|
36
|
+
|
|
37
|
+
<body>
|
|
38
|
+
|
|
39
|
+
<footer>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Commit Types with Icons
|
|
43
|
+
|
|
44
|
+
| Type | Icon | Description | Changelog Section |
|
|
45
|
+
|------|------|-------------|-------------------|
|
|
46
|
+
| `feat` | โจ | New feature | โจ Features |
|
|
47
|
+
| `fix` | ๐ | Bug fix | ๐ Bug Fixes |
|
|
48
|
+
| `perf` | โก | Performance improvement | โก Performance |
|
|
49
|
+
| `refactor` | โป๏ธ | Code refactoring | โป๏ธ Refactors |
|
|
50
|
+
| `docs` | ๐ | Documentation changes | ๐ Documentation |
|
|
51
|
+
| `style` | ๐ | Code style changes | ๐ Styles |
|
|
52
|
+
| `test` | โ
| Test additions/changes | โ
Tests |
|
|
53
|
+
| `build` | ๐๏ธ | Build system changes | ๐๏ธ Build System |
|
|
54
|
+
| `ci` | ๐ท | CI/CD changes | ๐ท Continuous Integration |
|
|
55
|
+
| `chore` | ๐งน | Maintenance tasks | ๐งน Chores |
|
|
56
|
+
| `revert` | โช | Revert previous commit | โช Reverts |
|
|
57
|
+
|
|
58
|
+
### Examples
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# Feature
|
|
62
|
+
git commit -m "feat(auth): add JWT authentication"
|
|
63
|
+
|
|
64
|
+
# Bug fix
|
|
65
|
+
git commit -m "fix(api): resolve null pointer exception"
|
|
66
|
+
|
|
67
|
+
# Breaking change
|
|
68
|
+
git commit -m "feat(api)!: redesign user endpoint
|
|
69
|
+
|
|
70
|
+
BREAKING CHANGE: The user endpoint now returns different data structure"
|
|
71
|
+
|
|
72
|
+
# With scope and body
|
|
73
|
+
git commit -m "perf(database): optimize query performance
|
|
74
|
+
|
|
75
|
+
Reduced query time by 50% using indexed columns"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Release Commands
|
|
79
|
+
|
|
80
|
+
### Patch Release (1.0.0 โ 1.0.1)
|
|
81
|
+
|
|
82
|
+
For bug fixes and minor changes:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
npm run release:patch
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Minor Release (1.0.0 โ 1.1.0)
|
|
89
|
+
|
|
90
|
+
For new features (backwards compatible):
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
npm run release:minor
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Major Release (1.0.0 โ 2.0.0)
|
|
97
|
+
|
|
98
|
+
For breaking changes:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
npm run release:major
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Automatic Release
|
|
105
|
+
|
|
106
|
+
Let `standard-version` determine the version bump based on commits:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
npm run release
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## What Happens During Release?
|
|
113
|
+
|
|
114
|
+
1. ๐ Analyzes commits since last release
|
|
115
|
+
2. ๐ข Bumps version in `package.json`
|
|
116
|
+
3. ๐ Updates `CHANGELOG.md` with icons
|
|
117
|
+
4. ๐ท๏ธ Creates a git tag
|
|
118
|
+
5. ๐พ Commits changes with format: `chore(release): v1.2.3 ๐`
|
|
119
|
+
|
|
120
|
+
## Push Your Release
|
|
121
|
+
|
|
122
|
+
After running a release command, push to remote:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
git push --follow-tags origin main
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Pre-commit Hooks
|
|
129
|
+
|
|
130
|
+
The following hooks are automatically enforced:
|
|
131
|
+
|
|
132
|
+
- **commit-msg**: Validates commit message format using commitlint
|
|
133
|
+
- **pre-commit**: Runs tests before allowing commits
|
|
134
|
+
|
|
135
|
+
## Configuration Files
|
|
136
|
+
|
|
137
|
+
- `package.json` - Contains `standard-version` configuration
|
|
138
|
+
- `commitlint.config.js` - Commitlint rules
|
|
139
|
+
- `.husky/commit-msg` - Commit message validation hook
|
|
140
|
+
- `.husky/pre-commit` - Pre-commit test hook
|
|
141
|
+
|
|
142
|
+
## Troubleshooting
|
|
143
|
+
|
|
144
|
+
### Commit message validation fails
|
|
145
|
+
|
|
146
|
+
Ensure your commit message follows the format:
|
|
147
|
+
```
|
|
148
|
+
type(scope): subject
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Valid types: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`, `revert`
|
|
152
|
+
|
|
153
|
+
### First release
|
|
154
|
+
|
|
155
|
+
If this is your first release and you don't have a version tag yet:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
npm run release -- --first-release
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Dry run
|
|
162
|
+
|
|
163
|
+
To see what would happen without making changes:
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
npm run release -- --dry-run
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Contributing
|
|
170
|
+
|
|
171
|
+
Contributions are welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests.
|
|
172
|
+
|
|
173
|
+
## License
|
|
174
|
+
|
|
175
|
+
MIT License - see the [LICENSE](LICENSE) file for details.
|
|
176
|
+
|
|
177
|
+
This project is open source and free to use, modify, and distribute at your own risk.
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Reporting a Vulnerability
|
|
4
|
+
|
|
5
|
+
If you discover a security vulnerability in `@programinglive/commiter`, please report it responsibly.
|
|
6
|
+
|
|
7
|
+
Send your report to: [security@programinglive.com](mailto:security@programinglive.com).
|
|
8
|
+
|
|
9
|
+
Please include:
|
|
10
|
+
- A detailed description of the vulnerability
|
|
11
|
+
- Steps to reproduce the issue
|
|
12
|
+
- Any potential impact
|
|
13
|
+
- Optional: Suggested mitigation or patch
|
|
14
|
+
|
|
15
|
+
We aim to respond within **48 hours** and will keep you informed of our progress.
|
|
16
|
+
|
|
17
|
+
## Supported Versions
|
|
18
|
+
|
|
19
|
+
We support the latest released version of the package. Please ensure you are running the most recent version before reporting issues.
|
|
20
|
+
|
|
21
|
+
## Disclosure Policy
|
|
22
|
+
|
|
23
|
+
We follow a coordinated disclosure process:
|
|
24
|
+
1. Acknowledge receipt of your report within 48 hours
|
|
25
|
+
2. Assess the vulnerability and determine severity
|
|
26
|
+
3. Fix the issue and prepare a release
|
|
27
|
+
4. Credit the reporter (if desired)
|
|
28
|
+
5. Publish a security advisory detailing the fix
|
|
29
|
+
|
|
30
|
+
Thank you for helping keep our project secure!
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = { extends: ['@commitlint/config-conventional'] };
|
package/index.js
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Commiter - Commit convention tooling for standard-version releases
|
|
5
|
+
*
|
|
6
|
+
* This package helps enforce conventional commits and automate releases
|
|
7
|
+
* with beautiful changelogs featuring icons for each commit type.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const { execSync } = require('child_process');
|
|
11
|
+
const fs = require('fs');
|
|
12
|
+
const path = require('path');
|
|
13
|
+
|
|
14
|
+
function setupCommiter() {
|
|
15
|
+
console.log('๐ Setting up Commiter...\n');
|
|
16
|
+
|
|
17
|
+
// Check if package.json exists
|
|
18
|
+
if (!fs.existsSync('package.json')) {
|
|
19
|
+
console.error('โ Error: package.json not found. Please run this in a Node.js project directory.');
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
try {
|
|
24
|
+
// Install dependencies
|
|
25
|
+
console.log('๐ฆ Installing dependencies...');
|
|
26
|
+
execSync('npm install --save-dev standard-version @commitlint/cli @commitlint/config-conventional husky', {
|
|
27
|
+
stdio: 'inherit'
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
// Read package.json
|
|
31
|
+
const packageJsonPath = path.join(process.cwd(), 'package.json');
|
|
32
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
|
33
|
+
|
|
34
|
+
// Add scripts
|
|
35
|
+
packageJson.scripts = packageJson.scripts || {};
|
|
36
|
+
packageJson.scripts.prepare = 'husky';
|
|
37
|
+
packageJson.scripts.release = 'standard-version';
|
|
38
|
+
packageJson.scripts['release:major'] = 'npm run release -- --release-as major';
|
|
39
|
+
packageJson.scripts['release:minor'] = 'npm run release -- --release-as minor';
|
|
40
|
+
packageJson.scripts['release:patch'] = 'npm run release -- --release-as patch';
|
|
41
|
+
|
|
42
|
+
// Add standard-version config
|
|
43
|
+
packageJson['standard-version'] = {
|
|
44
|
+
releaseCommitMessageFormat: 'chore(release): {{currentTag}} ๐',
|
|
45
|
+
types: [
|
|
46
|
+
{ type: 'feat', section: 'โจ Features' },
|
|
47
|
+
{ type: 'fix', section: '๐ Bug Fixes' },
|
|
48
|
+
{ type: 'perf', section: 'โก Performance' },
|
|
49
|
+
{ type: 'refactor', section: 'โป๏ธ Refactors' },
|
|
50
|
+
{ type: 'docs', section: '๐ Documentation' },
|
|
51
|
+
{ type: 'style', section: '๐ Styles' },
|
|
52
|
+
{ type: 'test', section: 'โ
Tests' },
|
|
53
|
+
{ type: 'build', section: '๐๏ธ Build System' },
|
|
54
|
+
{ type: 'ci', section: '๐ท Continuous Integration' },
|
|
55
|
+
{ type: 'chore', section: '๐งน Chores' },
|
|
56
|
+
{ type: 'revert', section: 'โช Reverts' }
|
|
57
|
+
]
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// Write updated package.json
|
|
61
|
+
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2) + '\n');
|
|
62
|
+
|
|
63
|
+
// Create commitlint config
|
|
64
|
+
console.log('โ๏ธ Creating commitlint config...');
|
|
65
|
+
const commitlintConfig = `module.exports = { extends: ['@commitlint/config-conventional'] };\n`;
|
|
66
|
+
fs.writeFileSync('commitlint.config.js', commitlintConfig);
|
|
67
|
+
|
|
68
|
+
// Initialize Husky
|
|
69
|
+
console.log('๐ถ Setting up Husky...');
|
|
70
|
+
execSync('npx husky init', { stdio: 'inherit' });
|
|
71
|
+
|
|
72
|
+
// Create commit-msg hook
|
|
73
|
+
const huskyDir = path.join(process.cwd(), '.husky');
|
|
74
|
+
if (!fs.existsSync(huskyDir)) {
|
|
75
|
+
fs.mkdirSync(huskyDir, { recursive: true });
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const commitMsgHook = `#!/usr/bin/env sh
|
|
79
|
+
|
|
80
|
+
npx --no -- commitlint --edit "$1"
|
|
81
|
+
`;
|
|
82
|
+
fs.writeFileSync(path.join(huskyDir, 'commit-msg'), commitMsgHook);
|
|
83
|
+
fs.chmodSync(path.join(huskyDir, 'commit-msg'), 0o755);
|
|
84
|
+
|
|
85
|
+
console.log('\nโ
Commiter setup complete!\n');
|
|
86
|
+
console.log('๐ Available commands:');
|
|
87
|
+
console.log(' npm run release:major - Create a major release (1.0.0 โ 2.0.0)');
|
|
88
|
+
console.log(' npm run release:minor - Create a minor release (1.0.0 โ 1.1.0)');
|
|
89
|
+
console.log(' npm run release:patch - Create a patch release (1.0.0 โ 1.0.1)');
|
|
90
|
+
console.log(' npm run release - Auto-detect version bump\n');
|
|
91
|
+
console.log('๐ฏ Commit format: type(scope): subject');
|
|
92
|
+
console.log(' Example: feat(auth): add user login\n');
|
|
93
|
+
|
|
94
|
+
} catch (error) {
|
|
95
|
+
console.error('โ Error during setup:', error.message);
|
|
96
|
+
process.exit(1);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Run setup if called directly
|
|
101
|
+
if (require.main === module) {
|
|
102
|
+
setupCommiter();
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
module.exports = { setupCommiter };
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@programinglive/commiter",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Commit convention tooling for standard-version releases with beautiful changelogs",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"commiter": "./index.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"test": "echo \"No tests specified\"",
|
|
11
|
+
"prepare": "husky",
|
|
12
|
+
"release": "standard-version",
|
|
13
|
+
"release:major": "npm run release -- --release-as major",
|
|
14
|
+
"release:minor": "npm run release -- --release-as minor",
|
|
15
|
+
"release:patch": "npm run release -- --release-as patch"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"commit",
|
|
19
|
+
"conventional-commits",
|
|
20
|
+
"standard-version",
|
|
21
|
+
"changelog",
|
|
22
|
+
"versioning",
|
|
23
|
+
"semantic-release",
|
|
24
|
+
"git-hooks",
|
|
25
|
+
"husky",
|
|
26
|
+
"commitlint"
|
|
27
|
+
],
|
|
28
|
+
"author": "Programming Live",
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "git+https://github.com/programinglive/commiter.git"
|
|
33
|
+
},
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/programinglive/commiter/issues"
|
|
36
|
+
},
|
|
37
|
+
"homepage": "https://github.com/programinglive/commiter#readme",
|
|
38
|
+
"type": "commonjs",
|
|
39
|
+
"standard-version": {
|
|
40
|
+
"releaseCommitMessageFormat": "chore(release): {{currentTag}} ๐",
|
|
41
|
+
"types": [
|
|
42
|
+
{ "type": "feat", "section": "โจ Features" },
|
|
43
|
+
{ "type": "fix", "section": "๐ Bug Fixes" },
|
|
44
|
+
{ "type": "perf", "section": "โก Performance" },
|
|
45
|
+
{ "type": "refactor", "section": "โป๏ธ Refactors" },
|
|
46
|
+
{ "type": "docs", "section": "๐ Documentation" },
|
|
47
|
+
{ "type": "style", "section": "๐ Styles" },
|
|
48
|
+
{ "type": "test", "section": "โ
Tests" },
|
|
49
|
+
{ "type": "build", "section": "๐๏ธ Build System" },
|
|
50
|
+
{ "type": "ci", "section": "๐ท Continuous Integration" },
|
|
51
|
+
{ "type": "chore", "section": "๐งน Chores" },
|
|
52
|
+
{ "type": "revert", "section": "โช Reverts" }
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@commitlint/cli": "^20.1.0",
|
|
57
|
+
"@commitlint/config-conventional": "^20.0.0",
|
|
58
|
+
"husky": "^9.1.7",
|
|
59
|
+
"standard-version": "^9.5.0"
|
|
60
|
+
}
|
|
61
|
+
}
|