@programinglive/commiter 1.0.8 → 1.0.11

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/PUBLISH.md CHANGED
@@ -1,116 +1,142 @@
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
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
+ ### Option 1: Manual Publishing (Traditional)
76
+ 1. Make changes and commit using conventional commits
77
+ 2. Run the appropriate release command
78
+ 3. Push to GitHub with tags
79
+ 4. Publish to npm
80
+
81
+ Example:
82
+ ```bash
83
+ # Make changes
84
+ git add .
85
+ git commit -m "feat(cli): add interactive setup wizard"
86
+
87
+ # Create release
88
+ npm run release:minor
89
+
90
+ # Push to GitHub
91
+ git push --follow-tags origin main
92
+
93
+ # Publish to npm
94
+ npm publish
95
+ ```
96
+
97
+ ### Option 2: Automated Publishing (Recommended)
98
+ 1. Make changes and commit using conventional commits
99
+ 2. Run the appropriate release command
100
+ 3. Push to GitHub with tags - **npm publishing happens automatically**
101
+
102
+ Example:
103
+ ```bash
104
+ # Make changes
105
+ git add .
106
+ git commit -m "feat(cli): add interactive setup wizard"
107
+
108
+ # Create release
109
+ npm run release:minor
110
+
111
+ # Push to GitHub (triggers automatic npm publish)
112
+ git push --follow-tags origin main
113
+ ```
114
+
115
+ **Setup Required for Automated Publishing:**
116
+ 1. Add `NPM_TOKEN` secret to your GitHub repository
117
+ 2. The GitHub Actions workflow (`.github/workflows/publish.yml`) will automatically:
118
+ - Run tests
119
+ - Publish to npm when a tag starting with `v` is pushed
120
+ - Use the `--access public` flag for scoped packages
121
+
122
+ ## Unpublishing (Emergency Only)
123
+
124
+ If you need to unpublish a version within 72 hours:
125
+
126
+ ```bash
127
+ npm unpublish @programinglive/commiter@1.0.0
128
+ ```
129
+
130
+ **Warning**: Unpublishing is permanent and should only be used in emergencies.
131
+
132
+ ## Package Visibility
133
+
134
+ - **Public**: Anyone can install and use the package
135
+ - **Open Source**: MIT licensed - users can modify and distribute
136
+ - **Free**: No cost to install or use
137
+
138
+ ## Support
139
+
140
+ For issues or questions:
141
+ - GitHub Issues: https://github.com/programinglive/commiter/issues
142
+ - NPM Package: https://www.npmjs.com/package/@programinglive/commiter
package/README.md CHANGED
@@ -1,181 +1,186 @@
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
- Release commits generated by `standard-version` such as `chore(release): 1.0.0 🚀` are automatically ignored by `commitlint`.
154
-
155
- ### First release
156
-
157
- If this is your first release and you don't have a version tag yet:
158
-
159
- ```bash
160
- npm run release -- --first-release
161
- ```
162
-
163
- Running the setup command ensures the default `npm test` script is `echo "No tests specified"`, preventing the Husky `pre-commit` hook from failing during this initial release. Replace it with your real test command once available.
164
-
165
- ### Dry run
166
-
167
- To see what would happen without making changes:
168
-
169
- ```bash
170
- npm run release -- --dry-run
171
- ```
172
-
173
- ## Contributing
174
-
175
- Contributions are welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests.
176
-
177
- ## License
178
-
179
- MIT License - see the [LICENSE](LICENSE) file for details.
180
-
181
- This project is open source and free to use, modify, and distribute at your own risk.
1
+ # Commiter 🚀
2
+
3
+ [![npm version](https://img.shields.io/npm/v/%40programinglive%2Fcommiter.svg)](https://www.npmjs.com/package/@programinglive/commiter)
4
+ [![npm downloads](https://img.shields.io/npm/dm/%40programinglive%2Fcommiter.svg)](https://www.npmjs.com/package/@programinglive/commiter)
5
+ [![publish status](https://img.shields.io/github/actions/workflow/status/programinglive/commiter/publish.yml?label=publish)](https://github.com/programinglive/commiter/actions/workflows/publish.yml)
6
+ [![license: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
7
+
8
+ A standardized commit convention and release management tool for your repository using `standard-version`.
9
+
10
+ ## Features
11
+
12
+ - ✅ **Enforced Commit Conventions** - Uses Conventional Commits format
13
+ - 🎯 **Automated Versioning** - Semantic versioning (major, minor, patch)
14
+ - 📝 **Changelog Generation** - Automatic CHANGELOG.md with icons
15
+ - 🔒 **Git Hooks** - Pre-commit and commit-msg validation via Husky
16
+ - 🎨 **Icon Support** - Each commit type has a dedicated icon in releases
17
+
18
+ ## Installation
19
+
20
+ Install the package globally or as a dev dependency in your project:
21
+
22
+ ```bash
23
+ # Install globally
24
+ npm install -g @programinglive/commiter
25
+
26
+ # Or install as dev dependency
27
+ npm install --save-dev @programinglive/commiter
28
+
29
+ # Or use npx (no installation required)
30
+ npx @programinglive/commiter
31
+ ```
32
+
33
+ After installation in your project, the Husky hooks will be automatically set up for commit message validation.
34
+
35
+ ## Commit Message Format
36
+
37
+ All commits must follow the [Conventional Commits](https://www.conventionalcommits.org/) specification:
38
+
39
+ ```
40
+ <type>(<scope>): <subject>
41
+
42
+ <body>
43
+
44
+ <footer>
45
+ ```
46
+
47
+ ### Commit Types with Icons
48
+
49
+ | Type | Icon | Description | Changelog Section |
50
+ |------|------|-------------|-------------------|
51
+ | `feat` | | New feature | Features |
52
+ | `fix` | 🐛 | Bug fix | 🐛 Bug Fixes |
53
+ | `perf` | | Performance improvement | Performance |
54
+ | `refactor` | ♻️ | Code refactoring | ♻️ Refactors |
55
+ | `docs` | 📝 | Documentation changes | 📝 Documentation |
56
+ | `style` | 💄 | Code style changes | 💄 Styles |
57
+ | `test` | ✅ | Test additions/changes | ✅ Tests |
58
+ | `build` | 🏗️ | Build system changes | 🏗️ Build System |
59
+ | `ci` | 👷 | CI/CD changes | 👷 Continuous Integration |
60
+ | `chore` | 🧹 | Maintenance tasks | 🧹 Chores |
61
+ | `revert` | ⏪ | Revert previous commit | ⏪ Reverts |
62
+
63
+ ### Examples
64
+
65
+ ```bash
66
+ # Feature
67
+ git commit -m "feat(auth): add JWT authentication"
68
+
69
+ # Bug fix
70
+ git commit -m "fix(api): resolve null pointer exception"
71
+
72
+ # Breaking change
73
+ git commit -m "feat(api)!: redesign user endpoint
74
+
75
+ BREAKING CHANGE: The user endpoint now returns different data structure"
76
+
77
+ # With scope and body
78
+ git commit -m "perf(database): optimize query performance
79
+
80
+ Reduced query time by 50% using indexed columns"
81
+ ```
82
+
83
+ ## Release Commands
84
+
85
+ ### Patch Release (1.0.0 → 1.0.1)
86
+
87
+ For bug fixes and minor changes:
88
+
89
+ ```bash
90
+ npm run release:patch
91
+ ```
92
+
93
+ ### Minor Release (1.0.0 → 1.1.0)
94
+
95
+ For new features (backwards compatible):
96
+
97
+ ```bash
98
+ npm run release:minor
99
+ ```
100
+
101
+ ### Major Release (1.0.0 → 2.0.0)
102
+
103
+ For breaking changes:
104
+
105
+ ```bash
106
+ npm run release:major
107
+ ```
108
+
109
+ ### Automatic Release
110
+
111
+ Let `standard-version` determine the version bump based on commits:
112
+
113
+ ```bash
114
+ npm run release
115
+ ```
116
+
117
+ ## What Happens During Release?
118
+
119
+ 1. 📊 Analyzes commits since last release
120
+ 2. 🔢 Bumps version in `package.json`
121
+ 3. 📝 Updates `CHANGELOG.md` with icons
122
+ 4. 🏷️ Creates a git tag
123
+ 5. 💾 Commits changes with format: `chore(release): v1.2.3 🚀`
124
+
125
+ ## Push Your Release
126
+
127
+ After running a release command, push to remote:
128
+
129
+ ```bash
130
+ git push --follow-tags origin main
131
+ ```
132
+
133
+ ## Pre-commit Hooks
134
+
135
+ The following hooks are automatically enforced:
136
+
137
+ - **commit-msg**: Validates commit message format using commitlint
138
+ - **pre-commit**: Runs tests before allowing commits
139
+
140
+ ## Configuration Files
141
+
142
+ - `package.json` - Contains `standard-version` configuration
143
+ - `commitlint.config.js` - Commitlint rules
144
+ - `.husky/commit-msg` - Commit message validation hook
145
+ - `.husky/pre-commit` - Pre-commit test hook
146
+
147
+ ## Troubleshooting
148
+
149
+ ### Commit message validation fails
150
+
151
+ Ensure your commit message follows the format:
152
+ ```
153
+ type(scope): subject
154
+ ```
155
+
156
+ Valid types: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`, `revert`
157
+
158
+ Release commits generated by `standard-version` such as `chore(release): 1.0.0 🚀` are automatically ignored by `commitlint`.
159
+
160
+ ### First release
161
+
162
+ If this is your first release and you don't have a version tag yet:
163
+
164
+ ```bash
165
+ npm run release -- --first-release
166
+ ```
167
+
168
+ Running the setup command ensures the default `npm test` script is `echo "No tests specified"`, preventing the Husky `pre-commit` hook from failing during this initial release. Replace it with your real test command once available.
169
+
170
+ ### Dry run
171
+
172
+ To see what would happen without making changes:
173
+
174
+ ```bash
175
+ npm run release -- --dry-run
176
+ ```
177
+
178
+ ## Contributing
179
+
180
+ Contributions are welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests.
181
+
182
+ ## License
183
+
184
+ MIT License - see the [LICENSE](LICENSE) file for details.
185
+
186
+ This project is open source and free to use, modify, and distribute at your own risk.