devforgeai 1.0.8 → 1.0.10
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/docs/CNAME +1 -0
- package/docs/NPM-Publish.md +341 -0
- package/docs/api/API.md +1054 -0
- package/docs/architecture/ARCHITECTURE.md +724 -0
- package/docs/guides/DEVELOPER-GUIDE.md +398 -0
- package/docs/guides/ROADMAP.md +48 -0
- package/docs/guides/TROUBLESHOOTING.md +631 -0
- package/docs/index.html +2045 -0
- package/package.json +2 -2
- package/src/cli/commands/install.js +21 -4
- package/src/cli/lib/components.js +5 -9
- package/devforgeai/specs/context/.gitkeep +0 -0
- package/devforgeai/specs/context/anti-patterns.md +0 -285
- package/devforgeai/specs/context/architecture-constraints.md +0 -323
- package/devforgeai/specs/context/coding-standards.md +0 -472
- package/devforgeai/specs/context/dependencies.md +0 -208
- package/devforgeai/specs/context/source-tree.md +0 -1217
- package/devforgeai/specs/context/tech-stack.md +0 -560
package/docs/CNAME
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
devforgeai.com
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
# NPM Package Publishing Guide
|
|
2
|
+
|
|
3
|
+
Reference for publishing, versioning, deprecating, and unpublishing the `devforgeai` npm package.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Prerequisites
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Verify npm is installed
|
|
11
|
+
npm --version
|
|
12
|
+
|
|
13
|
+
# Log in to npm (one-time, or when token expires)
|
|
14
|
+
npm login
|
|
15
|
+
|
|
16
|
+
# Verify you're authenticated
|
|
17
|
+
npm whoami
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 1. Publishing a New Package (First Time)
|
|
23
|
+
|
|
24
|
+
### 1.1 Verify package.json
|
|
25
|
+
|
|
26
|
+
Ensure these fields are set correctly:
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"name": "devforgeai",
|
|
31
|
+
"version": "1.0.0",
|
|
32
|
+
"description": "...",
|
|
33
|
+
"main": "lib/cli.js",
|
|
34
|
+
"bin": { "devforgeai": "bin/devforgeai.js" },
|
|
35
|
+
"files": ["bin/", "lib/", "src/cli/", "..."]
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Key fields:
|
|
40
|
+
- `name` — must be unique on npm (or scoped: `@org/devforgeai`)
|
|
41
|
+
- `version` — semver format (MAJOR.MINOR.PATCH)
|
|
42
|
+
- `files` — whitelist of files to include in the package (everything else excluded)
|
|
43
|
+
|
|
44
|
+
### 1.2 Dry Run (Preview What Gets Published)
|
|
45
|
+
|
|
46
|
+
Always dry-run first to verify package contents:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# Show what files will be included
|
|
50
|
+
npm pack --dry-run
|
|
51
|
+
|
|
52
|
+
# Write files will be included to a text file
|
|
53
|
+
npm pack --dry-run 2>&1 | tee npm-pack-manifest.txt
|
|
54
|
+
|
|
55
|
+
# Creates a tarball locally without publishing (inspect contents)
|
|
56
|
+
npm pack
|
|
57
|
+
tar -tzf devforgeai-1.0.0.tgz
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 1.3 Publish
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Publish to npm registry
|
|
64
|
+
npm publish
|
|
65
|
+
|
|
66
|
+
# Publish with a specific tag (e.g., beta, next)
|
|
67
|
+
npm publish --tag beta
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 1.4 Verify Publication
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# Check the package on npm
|
|
74
|
+
npm view devforgeai
|
|
75
|
+
|
|
76
|
+
# Check specific version
|
|
77
|
+
npm view devforgeai versions --json
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## 2. Version Bumping
|
|
83
|
+
|
|
84
|
+
### 2.1 Semantic Versioning (SemVer)
|
|
85
|
+
|
|
86
|
+
| Bump Type | When to Use | Example |
|
|
87
|
+
|-----------|-------------|---------|
|
|
88
|
+
| `patch` | Bug fixes, minor changes, no API changes | 1.0.0 -> 1.0.1 |
|
|
89
|
+
| `minor` | New features, backward compatible | 1.0.0 -> 1.1.0 |
|
|
90
|
+
| `major` | Breaking changes | 1.0.0 -> 2.0.0 |
|
|
91
|
+
|
|
92
|
+
### 2.2 Bump and Publish
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# Bump version in package.json (auto-updates package.json and package-lock.json)
|
|
96
|
+
npm version patch # 1.0.3 -> 1.0.4
|
|
97
|
+
npm version minor # 1.0.3 -> 1.1.0
|
|
98
|
+
npm version major # 1.0.3 -> 2.0.0
|
|
99
|
+
|
|
100
|
+
# npm version also creates a git commit and tag automatically
|
|
101
|
+
# To skip the git commit/tag:
|
|
102
|
+
npm version patch --no-git-tag-version
|
|
103
|
+
|
|
104
|
+
# Then publish
|
|
105
|
+
npm publish
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### 2.3 Pre-release Versions
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
# Create pre-release versions
|
|
112
|
+
npm version prerelease --preid=beta # 1.0.3 -> 1.0.4-beta.0
|
|
113
|
+
npm version prerelease --preid=beta # 1.0.4-beta.0 -> 1.0.4-beta.1
|
|
114
|
+
|
|
115
|
+
# Publish with a tag so it doesn't become "latest"
|
|
116
|
+
npm publish --tag beta
|
|
117
|
+
|
|
118
|
+
# Users install pre-release with:
|
|
119
|
+
npm install devforgeai@beta
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### 2.4 Manual Version Bump
|
|
123
|
+
|
|
124
|
+
If you prefer to edit `package.json` directly:
|
|
125
|
+
|
|
126
|
+
1. Edit `version` field in `package.json`
|
|
127
|
+
2. Run `npm publish`
|
|
128
|
+
|
|
129
|
+
No `npm version` command needed — but you won't get the automatic git tag.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## 3. Managing Tags
|
|
134
|
+
|
|
135
|
+
Tags control what version users get with `npm install devforgeai`.
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
# View current tags
|
|
139
|
+
npm dist-tag ls devforgeai
|
|
140
|
+
|
|
141
|
+
# Move the "latest" tag to a specific version
|
|
142
|
+
npm dist-tag add devforgeai@1.0.3 latest
|
|
143
|
+
|
|
144
|
+
# Add a custom tag
|
|
145
|
+
npm dist-tag add devforgeai@2.0.0-beta.1 beta
|
|
146
|
+
|
|
147
|
+
# Remove a tag
|
|
148
|
+
npm dist-tag rm devforgeai beta
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## 4. Deprecating Versions
|
|
154
|
+
|
|
155
|
+
Deprecation shows a warning when users install the version but does NOT remove it.
|
|
156
|
+
This is the **recommended first step** before unpublishing.
|
|
157
|
+
|
|
158
|
+
### 4.1 Deprecate Specific Versions
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
# Deprecate a single version
|
|
162
|
+
npm deprecate devforgeai@1.0.0 "Upgrade to 1.0.3 - includes security hardening"
|
|
163
|
+
|
|
164
|
+
# Deprecate a range of versions
|
|
165
|
+
npm deprecate "devforgeai@<1.0.3" "Upgrade to >=1.0.3 - includes RCA-046/047 security hardening"
|
|
166
|
+
|
|
167
|
+
# Deprecate with a detailed message
|
|
168
|
+
npm deprecate devforgeai@1.0.1 "This version has known test integrity issues. Please upgrade to 1.0.3+"
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### 4.2 What Users See
|
|
172
|
+
|
|
173
|
+
When someone installs a deprecated version:
|
|
174
|
+
|
|
175
|
+
```
|
|
176
|
+
npm warn deprecated devforgeai@1.0.0: Upgrade to 1.0.3 - includes security hardening
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
The package still installs — deprecation is a warning, not a block.
|
|
180
|
+
|
|
181
|
+
### 4.3 Un-deprecate a Version
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
# Remove deprecation by passing an empty string
|
|
185
|
+
npm deprecate devforgeai@1.0.0 ""
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## 5. Unpublishing Versions
|
|
191
|
+
|
|
192
|
+
Unpublishing **permanently removes** a version from npm. Use with caution.
|
|
193
|
+
|
|
194
|
+
### 5.1 npm Unpublish Rules
|
|
195
|
+
|
|
196
|
+
| Condition | Allowed? |
|
|
197
|
+
|-----------|----------|
|
|
198
|
+
| Within 72 hours of publish | Yes |
|
|
199
|
+
| After 72 hours | No (requires npm support) |
|
|
200
|
+
| Version has dependents | Blocked by npm |
|
|
201
|
+
| Last version of a package | Requires `--force` |
|
|
202
|
+
|
|
203
|
+
### 5.2 Unpublish a Specific Version
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
# Unpublish a single version (within 72-hour window)
|
|
207
|
+
npm unpublish devforgeai@1.0.0
|
|
208
|
+
|
|
209
|
+
# If npm warns about dependents, you can force (use carefully)
|
|
210
|
+
npm unpublish devforgeai@1.0.0 --force
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### 5.3 Unpublish the Entire Package
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
# Remove ALL versions (nuclear option - rarely appropriate)
|
|
217
|
+
npm unpublish devforgeai --force
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
After unpublishing an entire package, the name is blocked for 24 hours — you cannot republish with the same name immediately.
|
|
221
|
+
|
|
222
|
+
### 5.4 Recommended Workflow: Deprecate Then Unpublish
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
# Step 1: Deprecate first (gives users warning)
|
|
226
|
+
npm deprecate devforgeai@1.0.0 "This version will be removed. Upgrade to 1.0.3+"
|
|
227
|
+
|
|
228
|
+
# Step 2: Wait a reasonable period (days/weeks) for users to migrate
|
|
229
|
+
|
|
230
|
+
# Step 3: Unpublish (within 72-hour window of original publish)
|
|
231
|
+
npm unpublish devforgeai@1.0.0
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## 6. Checking Package Status
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
# View all published versions
|
|
240
|
+
npm view devforgeai versions --json
|
|
241
|
+
|
|
242
|
+
# View detailed info for a version
|
|
243
|
+
npm view devforgeai@1.0.3
|
|
244
|
+
|
|
245
|
+
# View download counts
|
|
246
|
+
npm view devforgeai
|
|
247
|
+
|
|
248
|
+
# Check who has publish access
|
|
249
|
+
npm access ls-collaborators devforgeai
|
|
250
|
+
|
|
251
|
+
# View package size
|
|
252
|
+
npm pack --dry-run 2>&1 | tail -1
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## 7. Common Workflows
|
|
258
|
+
|
|
259
|
+
### Patch Release (Bug Fix)
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
# 1. Make changes
|
|
263
|
+
# 2. Bump version
|
|
264
|
+
npm version patch --no-git-tag-version
|
|
265
|
+
# 3. Dry-run
|
|
266
|
+
npm pack --dry-run
|
|
267
|
+
# 4. Publish
|
|
268
|
+
npm publish
|
|
269
|
+
# 5. Verify
|
|
270
|
+
npm view devforgeai versions --json
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### Deprecate Old Versions After Security Fix
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
# Deprecate all versions below the fix
|
|
277
|
+
npm deprecate "devforgeai@<1.0.3" "Security fix in 1.0.3. Please upgrade."
|
|
278
|
+
|
|
279
|
+
# Verify deprecation
|
|
280
|
+
npm view devforgeai@1.0.0
|
|
281
|
+
# Should show "DEPRECATED" in output
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
### Publish Beta for Testing
|
|
285
|
+
|
|
286
|
+
```bash
|
|
287
|
+
npm version prerelease --preid=beta --no-git-tag-version
|
|
288
|
+
npm publish --tag beta
|
|
289
|
+
# Users test with: npm install devforgeai@beta
|
|
290
|
+
# When ready: npm dist-tag add devforgeai@1.1.0-beta.3 latest
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
## 8. Troubleshooting
|
|
296
|
+
|
|
297
|
+
| Error | Fix |
|
|
298
|
+
|-------|-----|
|
|
299
|
+
| `npm ERR! 403 Forbidden` | Run `npm login` — token may have expired |
|
|
300
|
+
| `npm ERR! 402 Payment Required` | Package name may be scoped — use `npm publish --access public` |
|
|
301
|
+
| `npm ERR! You cannot publish over the previously published versions` | Bump version first with `npm version patch` |
|
|
302
|
+
| `npm ERR! Cannot unpublish` | Past 72-hour window — contact npm support or deprecate instead |
|
|
303
|
+
| `ENEEDAUTH` | Not logged in — run `npm login` |
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
## 9. .npmignore vs files Field
|
|
308
|
+
|
|
309
|
+
This project uses the `files` whitelist in `package.json` (preferred approach). The `.npmignore` file provides a secondary exclusion layer.
|
|
310
|
+
|
|
311
|
+
- **`files` in package.json**: Whitelist — only listed paths are included
|
|
312
|
+
- **`.npmignore`**: Blacklist — listed paths are excluded from what `files` includes
|
|
313
|
+
- **Both present**: `files` takes precedence, `.npmignore` filters within that
|
|
314
|
+
|
|
315
|
+
`package.json`, `README.md`, and `LICENSE` are always included regardless of settings.
|
|
316
|
+
|
|
317
|
+
---
|
|
318
|
+
|
|
319
|
+
## Quick Reference Card
|
|
320
|
+
|
|
321
|
+
```bash
|
|
322
|
+
# Publish
|
|
323
|
+
npm publish # publish latest
|
|
324
|
+
npm publish --tag beta # publish as beta
|
|
325
|
+
|
|
326
|
+
# Version
|
|
327
|
+
npm version patch|minor|major # bump + git tag
|
|
328
|
+
npm version patch --no-git-tag-version # bump only
|
|
329
|
+
|
|
330
|
+
# Deprecate
|
|
331
|
+
npm deprecate devforgeai@1.0.0 "message" # warn users
|
|
332
|
+
npm deprecate devforgeai@1.0.0 "" # un-deprecate
|
|
333
|
+
|
|
334
|
+
# Unpublish (within 72 hours)
|
|
335
|
+
npm unpublish devforgeai@1.0.0 # remove version
|
|
336
|
+
|
|
337
|
+
# Inspect
|
|
338
|
+
npm view devforgeai versions --json # list versions
|
|
339
|
+
npm pack --dry-run # preview package
|
|
340
|
+
npm dist-tag ls devforgeai # list tags
|
|
341
|
+
```
|