Skip to content

Commit 50199e6

Browse files
updated package npm initial publish
1 parent 15a843c commit 50199e6

4 files changed

Lines changed: 141 additions & 2 deletions

File tree

PUBLISHING.md

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# Publishing
2+
3+
CapabilityKit publishes two public npm packages:
4+
5+
- `@capabilitykit/core`
6+
- `@capabilitykit/cli`
7+
8+
Publish `@capabilitykit/core` first because `@capabilitykit/cli` depends on it.
9+
10+
## Prerequisites
11+
12+
Confirm you are logged in as an npm user with publish access to the `@capabilitykit` org:
13+
14+
```powershell
15+
npm whoami
16+
npm access list packages @capabilitykit
17+
```
18+
19+
If needed, log in:
20+
21+
```powershell
22+
npm login
23+
```
24+
25+
## Choose The Version
26+
27+
Use semantic versioning:
28+
29+
- Patch: bug fixes, docs/package metadata fixes, internal cleanup with no new API.
30+
- Minor: new backwards-compatible features.
31+
- Major: breaking changes.
32+
33+
Both packages can usually move together while the project is small.
34+
35+
## Update Versions
36+
37+
From the repo root, update both workspace package versions:
38+
39+
```powershell
40+
npm version patch --workspace @capabilitykit/core --no-git-tag-version
41+
npm version patch --workspace @capabilitykit/cli --no-git-tag-version
42+
npm install
43+
```
44+
45+
Replace `patch` with `minor` or `major` when appropriate.
46+
47+
If `@capabilitykit/cli` depends on the exact new core range, update `packages/cli/package.json` before running `npm install`.
48+
49+
Example:
50+
51+
```json
52+
"@capabilitykit/core": "^0.1.1"
53+
```
54+
55+
## Verify Locally
56+
57+
Run the full verification loop:
58+
59+
```powershell
60+
npm run verify
61+
```
62+
63+
Inspect the files that npm will publish:
64+
65+
```powershell
66+
npm pack --workspace @capabilitykit/core --dry-run
67+
npm pack --workspace @capabilitykit/cli --dry-run
68+
```
69+
70+
The package contents should be limited to `dist/` and `package.json`.
71+
72+
## Publish
73+
74+
Publish core first:
75+
76+
```powershell
77+
npm publish --workspace @capabilitykit/core --access public
78+
```
79+
80+
Then publish the CLI:
81+
82+
```powershell
83+
npm publish --workspace @capabilitykit/cli --access public
84+
```
85+
86+
If npm asks for two-factor authentication, rerun the command with the current one-time password:
87+
88+
```powershell
89+
npm publish --workspace @capabilitykit/core --access public --otp 123456
90+
npm publish --workspace @capabilitykit/cli --access public --otp 123456
91+
```
92+
93+
## Verify The Published Packages
94+
95+
Registry metadata can lag for a few minutes. After publishing, check:
96+
97+
```powershell
98+
npm view @capabilitykit/core version
99+
npm view @capabilitykit/cli version
100+
npx @capabilitykit/cli --version
101+
```
102+
103+
If `npm view` returns 404 immediately after a successful publish, wait and retry. Also confirm npm sees the packages under the org:
104+
105+
```powershell
106+
npm access list packages @capabilitykit
107+
npm dist-tag ls @capabilitykit/core
108+
npm dist-tag ls @capabilitykit/cli
109+
```
110+
111+
## Commit The Release Prep
112+
113+
Commit the version and lockfile changes:
114+
115+
```powershell
116+
git status
117+
git add package.json package-lock.json packages/core/package.json packages/cli/package.json
118+
git commit -m "Release 0.1.1"
119+
```
120+
121+
Adjust the version in the commit message.
122+
123+
## Important Notes
124+
125+
Published npm versions are immutable. If a package version has already been published, fixes require a new version number.
126+
127+
Do not publish the root package. The root `package.json` is private and only coordinates the workspace.

package-lock.json

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/cli/package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
{
22
"name": "@capabilitykit/cli",
33
"version": "0.1.0",
4+
"description": "Command line tools for CapabilityKit capability specs.",
5+
"license": "MIT",
46
"type": "module",
57
"main": "dist/index.js",
68
"types": "dist/index.d.ts",
9+
"files": [
10+
"dist"
11+
],
712
"bin": {
813
"capabilitykit": "dist/index.js"
914
},
@@ -12,7 +17,7 @@
1217
"start": "node dist/index.js"
1318
},
1419
"dependencies": {
15-
"@capabilitykit/core": "file:../core",
20+
"@capabilitykit/core": "^0.1.0",
1621
"commander": "^13.1.0",
1722
"yaml": "^2.7.1"
1823
}

packages/core/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
{
22
"name": "@capabilitykit/core",
33
"version": "0.1.0",
4+
"description": "Core parser, compiler, and validation APIs for CapabilityKit.",
5+
"license": "MIT",
46
"type": "module",
57
"main": "dist/index.js",
68
"types": "dist/index.d.ts",
9+
"files": [
10+
"dist"
11+
],
712
"exports": {
813
".": {
914
"types": "./dist/index.d.ts",

0 commit comments

Comments
 (0)