ops-toolkit 1.2.1 → 1.2.2
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/.env.example +9 -0
- package/.release-it.json +3 -1
- package/AGENTS.md +13 -9
- package/CHANGELOG.md +10 -1
- package/docs/PUBLISH.md +172 -0
- package/package.json +8 -5
package/.env.example
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
# Environment variables for ops-toolkit
|
|
2
2
|
# Copy this file to .env and fill in your values
|
|
3
3
|
|
|
4
|
+
# Publishing to npm
|
|
5
|
+
# Get an automation token from: https://www.npmjs.com/settings/tokens
|
|
6
|
+
NPM_TOKEN=your_npm_automation_token_here
|
|
7
|
+
|
|
8
|
+
# GitHub releases (optional, for creating GitHub releases)
|
|
9
|
+
# Get a personal access token from: https://github.com/settings/tokens
|
|
10
|
+
# Required scopes: repo
|
|
11
|
+
GITHUB_TOKEN=your_github_token_here
|
|
12
|
+
|
|
4
13
|
# Debug mode
|
|
5
14
|
DEBUG=false
|
|
6
15
|
NODE_ENV=development
|
package/.release-it.json
CHANGED
|
@@ -13,11 +13,13 @@
|
|
|
13
13
|
},
|
|
14
14
|
"npm": {
|
|
15
15
|
"publish": true,
|
|
16
|
-
"access": "public"
|
|
16
|
+
"access": "public",
|
|
17
|
+
"skipChecks": true
|
|
17
18
|
},
|
|
18
19
|
"hooks": {
|
|
19
20
|
"before:init": ["bun run lint", "bun run typecheck"],
|
|
20
21
|
"after:bump": ["bun run build"],
|
|
22
|
+
"before:release": "npm config set //registry.npmjs.org/:_authToken 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",
|
|
21
23
|
"after:release": ["git push origin HEAD"]
|
|
22
24
|
},
|
|
23
25
|
"plugins": {
|
package/AGENTS.md
CHANGED
|
@@ -36,6 +36,9 @@ bun test # Run all tests
|
|
|
36
36
|
### Git & Release
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
|
+
bun run publish:patch # Upgrade patch version and publish (e.g., 1.2.1 → 1.2.2)
|
|
40
|
+
bun run publish:minor # Upgrade minor version and publish (e.g., 1.2.1 → 1.3.0)
|
|
41
|
+
bun run publish:major # Upgrade major version and publish (e.g., 1.2.1 → 2.0.0)
|
|
39
42
|
bun run release # Create release with changelog
|
|
40
43
|
bun run release:minor # Minor version bump
|
|
41
44
|
bun run release:major # Major version bump
|
|
@@ -199,15 +202,16 @@ try {
|
|
|
199
202
|
|
|
200
203
|
## Quick Reference
|
|
201
204
|
|
|
202
|
-
| Task | Command
|
|
203
|
-
| ---------------- |
|
|
204
|
-
| Start dev server | `bun run dev`
|
|
205
|
-
| Build project | `bun run build`
|
|
206
|
-
| Run tests | `bun test`
|
|
207
|
-
| Type check | `bun run typecheck`
|
|
208
|
-
| Lint and fix | `bun run lint:fix`
|
|
209
|
-
| Format code | `bun run format`
|
|
210
|
-
|
|
|
205
|
+
| Task | Command |
|
|
206
|
+
| ---------------- | ----------------------- |
|
|
207
|
+
| Start dev server | `bun run dev` |
|
|
208
|
+
| Build project | `bun run build` |
|
|
209
|
+
| Run tests | `bun test` |
|
|
210
|
+
| Type check | `bun run typecheck` |
|
|
211
|
+
| Lint and fix | `bun run lint:fix` |
|
|
212
|
+
| Format code | `bun run format` |
|
|
213
|
+
| Publish to npm | `bun run publish:patch` |
|
|
214
|
+
| Debug | F5 in VS Code |
|
|
211
215
|
|
|
212
216
|
## OpenCode Custom Commands
|
|
213
217
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
## [1.2.2](https://github.com/liangshaojie/ops-toolkit/compare/v1.2.1...v1.2.2) (2026-01-11)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add optimized npm publish commands ([5e96ee6](https://github.com/liangshaojie/ops-toolkit/commit/5e96ee649f1aa0cb9c9200c3a918800003029c27))
|
|
9
|
+
|
|
1
10
|
# Changelog
|
|
2
11
|
|
|
3
12
|
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.
|
|
@@ -23,4 +32,4 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
23
32
|
### Documentation
|
|
24
33
|
|
|
25
34
|
- add custom commands reference ([340cc12](https://github.com/username/ops-toolkit/commits/340cc12889d30b99a21334457e28e601a5fc2bb9))
|
|
26
|
-
- add development guide with tips and tricks ([b8017af](https://github.com/username/ops-toolkit/commits/b8017affb22ff7448c897d47e4b3b57c548c80b1))
|
|
35
|
+
- add development guide with tips and tricks ([b8017af](https://github.com/username/ops-toolkit/commits/b8017affb22ff7448c897d47e4b3b57c548c80b1))
|
package/docs/PUBLISH.md
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# Publishing to npm
|
|
2
|
+
|
|
3
|
+
## Quick Start
|
|
4
|
+
|
|
5
|
+
To publish a new version to npm, run one of the following commands:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Patch version (bug fixes): 1.2.1 → 1.2.2
|
|
9
|
+
bun run publish:patch
|
|
10
|
+
|
|
11
|
+
# Minor version (new features): 1.2.1 → 1.3.0
|
|
12
|
+
bun run publish:minor
|
|
13
|
+
|
|
14
|
+
# Major version (breaking changes): 1.2.1 → 2.0.0
|
|
15
|
+
bun run publish:major
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## What Happens When You Publish
|
|
19
|
+
|
|
20
|
+
The `publish:*` commands automatically:
|
|
21
|
+
|
|
22
|
+
1. **Quality Checks**
|
|
23
|
+
- Run ESLint to check code quality
|
|
24
|
+
- Run TypeScript type checking
|
|
25
|
+
|
|
26
|
+
2. **Version Bump**
|
|
27
|
+
- Increment version number in package.json
|
|
28
|
+
- Create git tag (e.g., v1.2.2)
|
|
29
|
+
- Create git commit with changelog
|
|
30
|
+
|
|
31
|
+
3. **Build**
|
|
32
|
+
- Build the project
|
|
33
|
+
- Generate distribution files in `dist/`
|
|
34
|
+
|
|
35
|
+
4. **Changelog**
|
|
36
|
+
- Update CHANGELOG.md with changes
|
|
37
|
+
- Based on git commit history
|
|
38
|
+
|
|
39
|
+
5. **Publish**
|
|
40
|
+
- Publish package to npm registry
|
|
41
|
+
- Create GitHub release
|
|
42
|
+
- Push git tags and commits to remote
|
|
43
|
+
|
|
44
|
+
## Prerequisites
|
|
45
|
+
|
|
46
|
+
Before publishing, make sure:
|
|
47
|
+
|
|
48
|
+
1. **Code is committed**
|
|
49
|
+
- All changes are committed to git
|
|
50
|
+
- Working directory is clean
|
|
51
|
+
|
|
52
|
+
2. **Tests pass**
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
bun test
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
3. **Build succeeds**
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
bun run build
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
4. **You're logged in to npm**
|
|
65
|
+
```bash
|
|
66
|
+
npm login
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Version Guidelines
|
|
70
|
+
|
|
71
|
+
### Patch (bug fixes)
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
bun run publish:patch
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Use for:
|
|
78
|
+
|
|
79
|
+
- Bug fixes
|
|
80
|
+
- Small improvements
|
|
81
|
+
- Non-breaking changes
|
|
82
|
+
- Documentation updates
|
|
83
|
+
|
|
84
|
+
### Minor (new features)
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
bun run publish:minor
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Use for:
|
|
91
|
+
|
|
92
|
+
- New features
|
|
93
|
+
- Backwards compatible changes
|
|
94
|
+
- Adding functionality
|
|
95
|
+
|
|
96
|
+
### Major (breaking changes)
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
bun run publish:major
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Use for:
|
|
103
|
+
|
|
104
|
+
- Breaking changes
|
|
105
|
+
- API changes
|
|
106
|
+
- Removing features
|
|
107
|
+
|
|
108
|
+
## Troubleshooting
|
|
109
|
+
|
|
110
|
+
### "Git working directory not clean"
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
# Commit your changes first
|
|
114
|
+
git add .
|
|
115
|
+
git commit -m "your commit message"
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### "403 Forbidden - You cannot publish over previously published versions"
|
|
119
|
+
|
|
120
|
+
This means the version already exists on npm. The publish commands will automatically bump the version, so you shouldn't see this error.
|
|
121
|
+
|
|
122
|
+
### Build errors
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
# Check build output
|
|
126
|
+
bun run build
|
|
127
|
+
|
|
128
|
+
# Fix any errors, then try publishing again
|
|
129
|
+
bun run publish:patch
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Manual Publishing
|
|
133
|
+
|
|
134
|
+
If you need more control, you can use `release-it` directly:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
# Interactive release
|
|
138
|
+
npx release-it
|
|
139
|
+
|
|
140
|
+
# Specific version
|
|
141
|
+
npx release-it 1.2.5
|
|
142
|
+
|
|
143
|
+
# Skip git operations
|
|
144
|
+
npx release-it --no-git --no-github
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## After Publishing
|
|
148
|
+
|
|
149
|
+
Once published, users can install your package:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
# Global installation
|
|
153
|
+
npm install -g ops-toolkit
|
|
154
|
+
|
|
155
|
+
# Or using bun
|
|
156
|
+
bun install -g ops-toolkit
|
|
157
|
+
|
|
158
|
+
# Run the CLI
|
|
159
|
+
ops --help
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Configuration
|
|
163
|
+
|
|
164
|
+
Publishing behavior is configured in `.release-it.json`:
|
|
165
|
+
|
|
166
|
+
- **Git**: Automatic commits and tags
|
|
167
|
+
- **NPM**: Automatic publishing to public registry
|
|
168
|
+
- **GitHub**: Automatic releases
|
|
169
|
+
- **Hooks**: Pre-publish checks and post-build actions
|
|
170
|
+
- **Changelog**: Auto-generated from commit history
|
|
171
|
+
|
|
172
|
+
For more details, see [release-it documentation](https://github.com/release-it/release-it).
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ops-toolkit",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "A comprehensive DevOps CLI toolkit with terminal UI",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"ops": "
|
|
8
|
-
"ops-toolkit": "
|
|
7
|
+
"ops": "dist/bin/ops-toolkit.js",
|
|
8
|
+
"ops-toolkit": "dist/bin/ops-toolkit.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"dev": "bun --watch src/index.ts",
|
|
@@ -20,7 +20,10 @@
|
|
|
20
20
|
"release": "standard-version",
|
|
21
21
|
"release:minor": "standard-version --release-as minor",
|
|
22
22
|
"release:major": "standard-version --release-as major",
|
|
23
|
-
"publish": "release-it"
|
|
23
|
+
"publish": "release-it",
|
|
24
|
+
"publish:patch": "release-it --increment=patch --ci",
|
|
25
|
+
"publish:minor": "release-it --increment=minor --ci",
|
|
26
|
+
"publish:major": "release-it --increment=major --ci"
|
|
24
27
|
},
|
|
25
28
|
"keywords": [
|
|
26
29
|
"cli",
|
|
@@ -37,7 +40,7 @@
|
|
|
37
40
|
"license": "MIT",
|
|
38
41
|
"repository": {
|
|
39
42
|
"type": "git",
|
|
40
|
-
"url": "https://github.com/liangshaojie/ops-toolkit.git"
|
|
43
|
+
"url": "git+https://github.com/liangshaojie/ops-toolkit.git"
|
|
41
44
|
},
|
|
42
45
|
"bugs": {
|
|
43
46
|
"url": "https://github.com/liangshaojie/ops-toolkit/issues"
|