@michelabboud/visual-forge-mcp 0.6.0 → 0.7.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.
Files changed (68) hide show
  1. package/CHANGELOG.md +403 -2
  2. package/README.md +88 -5
  3. package/config/pricing.json +1 -1
  4. package/dist/parser/markdown-parser.d.ts +2 -0
  5. package/dist/parser/markdown-parser.d.ts.map +1 -1
  6. package/dist/parser/markdown-parser.js +23 -10
  7. package/dist/parser/markdown-parser.js.map +1 -1
  8. package/dist/placeholders/placeholder-manager.d.ts +8 -0
  9. package/dist/placeholders/placeholder-manager.d.ts.map +1 -1
  10. package/dist/placeholders/placeholder-manager.js +71 -18
  11. package/dist/placeholders/placeholder-manager.js.map +1 -1
  12. package/dist/providers/base-provider.d.ts +13 -0
  13. package/dist/providers/base-provider.d.ts.map +1 -1
  14. package/dist/providers/base-provider.js +263 -17
  15. package/dist/providers/base-provider.js.map +1 -1
  16. package/dist/providers/gemini/gemini-provider.d.ts.map +1 -1
  17. package/dist/providers/gemini/gemini-provider.js +3 -7
  18. package/dist/providers/gemini/gemini-provider.js.map +1 -1
  19. package/dist/providers/index.d.ts.map +1 -1
  20. package/dist/providers/index.js +5 -1
  21. package/dist/providers/index.js.map +1 -1
  22. package/dist/server/mcp-server.d.ts.map +1 -1
  23. package/dist/server/mcp-server.js +4 -1
  24. package/dist/server/mcp-server.js.map +1 -1
  25. package/dist/utils/filename-sanitizer.d.ts +85 -0
  26. package/dist/utils/filename-sanitizer.d.ts.map +1 -0
  27. package/dist/utils/filename-sanitizer.js +156 -0
  28. package/dist/utils/filename-sanitizer.js.map +1 -0
  29. package/dist/utils/image-metadata-manager.d.ts +151 -0
  30. package/dist/utils/image-metadata-manager.d.ts.map +1 -0
  31. package/dist/utils/image-metadata-manager.js +172 -0
  32. package/dist/utils/image-metadata-manager.js.map +1 -0
  33. package/dist/utils/index-manager.d.ts +38 -0
  34. package/dist/utils/index-manager.d.ts.map +1 -0
  35. package/dist/utils/index-manager.js +110 -0
  36. package/dist/utils/index-manager.js.map +1 -0
  37. package/dist/utils/index.d.ts +5 -0
  38. package/dist/utils/index.d.ts.map +1 -1
  39. package/dist/utils/index.js +5 -0
  40. package/dist/utils/index.js.map +1 -1
  41. package/dist/utils/multi-format-optimizer.d.ts +96 -0
  42. package/dist/utils/multi-format-optimizer.d.ts.map +1 -0
  43. package/dist/utils/multi-format-optimizer.js +423 -0
  44. package/dist/utils/multi-format-optimizer.js.map +1 -0
  45. package/dist/utils/pricing-checker.d.ts.map +1 -1
  46. package/dist/utils/pricing-checker.js +3 -5
  47. package/dist/utils/pricing-checker.js.map +1 -1
  48. package/dist/utils/prompt-enhancer.d.ts +48 -0
  49. package/dist/utils/prompt-enhancer.d.ts.map +1 -0
  50. package/dist/utils/prompt-enhancer.js +169 -0
  51. package/dist/utils/prompt-enhancer.js.map +1 -0
  52. package/dist/utils/quality-validator.d.ts +61 -0
  53. package/dist/utils/quality-validator.d.ts.map +1 -0
  54. package/dist/utils/quality-validator.js +386 -0
  55. package/dist/utils/quality-validator.js.map +1 -0
  56. package/dist/utils/source-metadata.d.ts +56 -0
  57. package/dist/utils/source-metadata.d.ts.map +1 -0
  58. package/dist/utils/source-metadata.js +122 -0
  59. package/dist/utils/source-metadata.js.map +1 -0
  60. package/dist/workflow/workflow-orchestrator.d.ts.map +1 -1
  61. package/dist/workflow/workflow-orchestrator.js +23 -0
  62. package/dist/workflow/workflow-orchestrator.js.map +1 -1
  63. package/dist/workflow/workflow-tools.d.ts.map +1 -1
  64. package/dist/workflow/workflow-tools.js +18 -0
  65. package/dist/workflow/workflow-tools.js.map +1 -1
  66. package/docs/guides/provider-setup.md +543 -0
  67. package/package.json +2 -2
  68. package/scripts/README.md +460 -0
@@ -0,0 +1,460 @@
1
+ # NPM Manager Script
2
+
3
+ Production-ready bash script for managing npm package lifecycle with comprehensive safety checks and verbose logging.
4
+
5
+ ## Features
6
+
7
+ ### ✅ Safety Features
8
+ - **Validates package.json** before any operation
9
+ - **Checks npm authentication** before publish
10
+ - **Verifies git status** (warns about uncommitted changes)
11
+ - **Runs tests** before publish (with --skip-tests option)
12
+ - **Runs build** before publish (with --skip-build option)
13
+ - **Security audit** checks for vulnerabilities
14
+ - **Confirms before destructive actions** (deprecate, unpublish)
15
+ - **Creates git tags** automatically after publish
16
+ - **Dry-run mode** for safe testing (`--dry-run`)
17
+ - **Checks if version already published** before attempting publish
18
+
19
+ ### 📦 Package Management
20
+ - **Publish** to npm with comprehensive pre-publish checks
21
+ - **Version bumping** (patch, minor, major, or specific version)
22
+ - **Package info** from npm registry
23
+ - **Package stats** (quality, popularity, downloads)
24
+ - **Distribution tags** management
25
+ - **Access control** management
26
+ - **Token management** for authentication
27
+
28
+ ### 🔒 Authentication
29
+ - Supports **NPM_TOKEN** environment variable
30
+ - Supports **recovery codes** via `npm login --auth-type=legacy`
31
+ - Validates authentication before operations
32
+
33
+ ### 📝 Logging
34
+ - **Color-coded output** for easy reading
35
+ - **Comprehensive logging** to `npm-manager.log`
36
+ - **Verbose mode** for detailed output
37
+
38
+ ## Installation
39
+
40
+ ```bash
41
+ # Make script executable
42
+ chmod +x scripts/npm-manager.sh
43
+
44
+ # Optional: Create alias in your shell profile
45
+ alias npm-mgr='./scripts/npm-manager.sh'
46
+ ```
47
+
48
+ ## Usage
49
+
50
+ ### Basic Commands
51
+
52
+ ```bash
53
+ # Show help
54
+ ./scripts/npm-manager.sh --help
55
+
56
+ # Show package info
57
+ ./scripts/npm-manager.sh info
58
+
59
+ # Show package statistics
60
+ ./scripts/npm-manager.sh stats
61
+
62
+ # Show distribution tags
63
+ ./scripts/npm-manager.sh tags
64
+ ```
65
+
66
+ ### Version Management
67
+
68
+ ```bash
69
+ # Bump patch version (0.6.0 → 0.6.1)
70
+ ./scripts/npm-manager.sh bump patch
71
+
72
+ # Bump minor version (0.6.0 → 0.7.0)
73
+ ./scripts/npm-manager.sh bump minor
74
+
75
+ # Bump major version (0.6.0 → 1.0.0)
76
+ ./scripts/npm-manager.sh bump major
77
+
78
+ # Set specific version
79
+ ./scripts/npm-manager.sh bump 2.0.0
80
+
81
+ # Dry run (see what would happen)
82
+ ./scripts/npm-manager.sh bump patch --dry-run
83
+ ```
84
+
85
+ ### Publishing
86
+
87
+ ```bash
88
+ # Publish to npm (runs all checks)
89
+ ./scripts/npm-manager.sh publish
90
+
91
+ # Publish with specific tag
92
+ ./scripts/npm-manager.sh publish beta
93
+
94
+ # Dry run publish (safe testing)
95
+ ./scripts/npm-manager.sh publish --dry-run
96
+
97
+ # Skip tests (use with caution)
98
+ ./scripts/npm-manager.sh publish --skip-tests
99
+
100
+ # Skip build
101
+ ./scripts/npm-manager.sh publish --skip-build
102
+
103
+ # Force (skip confirmations - dangerous!)
104
+ ./scripts/npm-manager.sh publish --force
105
+ ```
106
+
107
+ ### Testing & Building
108
+
109
+ ```bash
110
+ # Run tests only
111
+ ./scripts/npm-manager.sh test
112
+
113
+ # Run build only
114
+ ./scripts/npm-manager.sh build
115
+
116
+ # Run security audit
117
+ ./scripts/npm-manager.sh audit
118
+
119
+ # Check for outdated dependencies
120
+ ./scripts/npm-manager.sh outdated
121
+ ```
122
+
123
+ ### Access & Tokens
124
+
125
+ ```bash
126
+ # Manage package access
127
+ ./scripts/npm-manager.sh access
128
+
129
+ # Manage npm tokens
130
+ ./scripts/npm-manager.sh tokens
131
+ ```
132
+
133
+ ### Deprecation & Unpublish
134
+
135
+ ```bash
136
+ # Deprecate a version
137
+ ./scripts/npm-manager.sh deprecate 1.0.0 "Please upgrade to 2.0.0"
138
+
139
+ # Unpublish a version (DANGEROUS - requires multiple confirmations)
140
+ ./scripts/npm-manager.sh unpublish 1.0.0
141
+ ```
142
+
143
+ ## Options
144
+
145
+ | Option | Description |
146
+ |--------|-------------|
147
+ | `--dry-run` | Simulate actions without making changes |
148
+ | `--skip-tests` | Skip running tests before publish |
149
+ | `--skip-build` | Skip running build before publish |
150
+ | `--force` | Skip confirmations (use with extreme caution) |
151
+ | `--verbose` | Enable verbose output |
152
+ | `-h, --help` | Show help message |
153
+
154
+ ## Environment Variables
155
+
156
+ | Variable | Description |
157
+ |----------|-------------|
158
+ | `NPM_TOKEN` | npm authentication token (alternative to npm login) |
159
+
160
+ ## Recommended Workflow
161
+
162
+ ### 1. Development
163
+ ```bash
164
+ # Make your changes
165
+ git add .
166
+ git commit -m "feat: Add new feature"
167
+ ```
168
+
169
+ ### 2. Testing
170
+ ```bash
171
+ # Run tests
172
+ ./scripts/npm-manager.sh test
173
+
174
+ # Run build
175
+ ./scripts/npm-manager.sh build
176
+
177
+ # Run audit
178
+ ./scripts/npm-manager.sh audit
179
+ ```
180
+
181
+ ### 3. Version Bump
182
+ ```bash
183
+ # Bump version (patch for bug fixes, minor for features, major for breaking changes)
184
+ ./scripts/npm-manager.sh bump patch
185
+
186
+ # Update CHANGELOG.md with changes
187
+ vim CHANGELOG.md
188
+
189
+ # Commit version bump
190
+ git commit -am "chore: Bump version to $(node -pe "require('./package.json').version")"
191
+ ```
192
+
193
+ ### 4. Publish
194
+ ```bash
195
+ # Dry run first (recommended)
196
+ ./scripts/npm-manager.sh publish --dry-run
197
+
198
+ # Actually publish
199
+ ./scripts/npm-manager.sh publish
200
+
201
+ # Push changes and tags
202
+ git push && git push --tags
203
+ ```
204
+
205
+ ## Pre-Publish Checks
206
+
207
+ The script automatically performs these checks before publishing:
208
+
209
+ 1. ✅ **package.json validation** - Ensures valid JSON and required fields
210
+ 2. ✅ **npm authentication** - Verifies you're logged in
211
+ 3. ✅ **Git status check** - Warns about uncommitted changes
212
+ 4. ✅ **Version check** - Ensures version isn't already published
213
+ 5. ✅ **Tests** - Runs `npm test` (can skip with --skip-tests)
214
+ 6. ✅ **Build** - Runs `npm run build` (can skip with --skip-build)
215
+ 7. ✅ **Security audit** - Checks for vulnerabilities
216
+ 8. ✅ **Outdated dependencies** - Warns about outdated packages
217
+ 9. ✅ **File list** - Shows what will be published
218
+ 10. ✅ **Final confirmation** - Asks "Are you absolutely sure?"
219
+
220
+ ## Authentication
221
+
222
+ ### Method 1: NPM Token (Recommended for CI/CD)
223
+
224
+ ```bash
225
+ # Set environment variable
226
+ export NPM_TOKEN=npm_your_token_here
227
+
228
+ # Or create .env file
229
+ echo "NPM_TOKEN=npm_your_token_here" > .env
230
+
231
+ # Script will use token automatically
232
+ ./scripts/npm-manager.sh publish
233
+ ```
234
+
235
+ ### Method 2: npm login
236
+
237
+ ```bash
238
+ # Standard login
239
+ npm login
240
+
241
+ # With 2FA/recovery codes
242
+ npm login --auth-type=legacy
243
+
244
+ # Then use script
245
+ ./scripts/npm-manager.sh publish
246
+ ```
247
+
248
+ ## Examples
249
+
250
+ ### Complete Release Workflow
251
+
252
+ ```bash
253
+ # 1. Make sure everything is committed
254
+ git status
255
+
256
+ # 2. Run full test suite
257
+ ./scripts/npm-manager.sh test
258
+
259
+ # 3. Bump version
260
+ ./scripts/npm-manager.sh bump minor
261
+
262
+ # 4. Update CHANGELOG.md
263
+ echo "## [$(node -pe "require('./package.json').version")] - $(date +%Y-%m-%d)" >> CHANGELOG.md
264
+ vim CHANGELOG.md
265
+
266
+ # 5. Commit version bump
267
+ git commit -am "chore: Release v$(node -pe "require('./package.json').version")"
268
+
269
+ # 6. Dry run publish (check everything)
270
+ ./scripts/npm-manager.sh publish --dry-run
271
+
272
+ # 7. Actually publish
273
+ ./scripts/npm-manager.sh publish
274
+
275
+ # 8. Push to GitHub
276
+ git push && git push --tags
277
+ ```
278
+
279
+ ### Beta Release
280
+
281
+ ```bash
282
+ # Bump to beta version
283
+ ./scripts/npm-manager.sh bump 1.0.0-beta.1
284
+
285
+ # Publish with beta tag
286
+ ./scripts/npm-manager.sh publish beta
287
+ ```
288
+
289
+ ### Deprecate Old Version
290
+
291
+ ```bash
292
+ # Deprecate specific version
293
+ ./scripts/npm-manager.sh deprecate 0.5.0 "Security vulnerability fixed in 0.6.0. Please upgrade."
294
+ ```
295
+
296
+ ### Emergency Unpublish (within 72 hours)
297
+
298
+ ```bash
299
+ # Only works if published less than 72 hours ago
300
+ # Requires multiple confirmations
301
+ ./scripts/npm-manager.sh unpublish 1.0.0
302
+ ```
303
+
304
+ ## Safety Features in Detail
305
+
306
+ ### Dry Run Mode
307
+ Test any operation without making actual changes:
308
+ ```bash
309
+ ./scripts/npm-manager.sh publish --dry-run
310
+ ./scripts/npm-manager.sh bump patch --dry-run
311
+ ```
312
+
313
+ ### Git Tag Creation
314
+ Automatically creates and pushes git tags:
315
+ - Tag format: `v{version}` (e.g., `v0.6.0`)
316
+ - Asks for confirmation before pushing
317
+ - Includes version in tag message
318
+
319
+ ### Multiple Confirmations for Dangerous Operations
320
+ - **Unpublish**: Requires typing package name + 2 confirmations
321
+ - **Deprecate**: Requires confirmation with preview
322
+ - **Publish**: Shows complete summary and asks for confirmation
323
+
324
+ ### Logging
325
+ All operations are logged to `npm-manager.log`:
326
+ ```bash
327
+ # View recent activity
328
+ tail -f npm-manager.log
329
+
330
+ # Search logs
331
+ grep "publish" npm-manager.log
332
+ ```
333
+
334
+ ## Troubleshooting
335
+
336
+ ### Authentication Issues
337
+
338
+ ```bash
339
+ # Check if authenticated
340
+ npm whoami
341
+
342
+ # Login with recovery codes
343
+ npm login --auth-type=legacy
344
+
345
+ # Or use token
346
+ export NPM_TOKEN=your_token_here
347
+ ```
348
+
349
+ ### Build/Test Failures
350
+
351
+ ```bash
352
+ # Skip tests if they're failing but you need to publish
353
+ ./scripts/npm-manager.sh publish --skip-tests
354
+
355
+ # Skip build
356
+ ./scripts/npm-manager.sh publish --skip-build
357
+
358
+ # Skip both (not recommended)
359
+ ./scripts/npm-manager.sh publish --skip-tests --skip-build
360
+ ```
361
+
362
+ ### Version Already Published
363
+
364
+ ```bash
365
+ # Error: "Version X.Y.Z is already published"
366
+ # Solution: Bump to new version
367
+ ./scripts/npm-manager.sh bump patch
368
+ ```
369
+
370
+ ### Git Uncommitted Changes
371
+
372
+ ```bash
373
+ # Warning: "You have uncommitted changes"
374
+ # Option 1: Commit them
375
+ git add .
376
+ git commit -m "Your changes"
377
+
378
+ # Option 2: Continue anyway (script will ask)
379
+ # Option 3: Stash them
380
+ git stash
381
+ ```
382
+
383
+ ## Integration with CI/CD
384
+
385
+ ### GitHub Actions Example
386
+
387
+ ```yaml
388
+ name: Publish to NPM
389
+
390
+ on:
391
+ push:
392
+ tags:
393
+ - 'v*'
394
+
395
+ jobs:
396
+ publish:
397
+ runs-on: ubuntu-latest
398
+ steps:
399
+ - uses: actions/checkout@v3
400
+ - uses: actions/setup-node@v3
401
+ with:
402
+ node-version: '20'
403
+ - run: npm ci
404
+ - name: Publish to npm
405
+ env:
406
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
407
+ run: ./scripts/npm-manager.sh publish --skip-tests --force
408
+ ```
409
+
410
+ ### GitLab CI Example
411
+
412
+ ```yaml
413
+ publish:
414
+ stage: deploy
415
+ only:
416
+ - tags
417
+ script:
418
+ - export NPM_TOKEN=$NPM_TOKEN
419
+ - ./scripts/npm-manager.sh publish --skip-tests --force
420
+ ```
421
+
422
+ ## Best Practices
423
+
424
+ 1. **Always test before publishing**
425
+ ```bash
426
+ ./scripts/npm-manager.sh test
427
+ ```
428
+
429
+ 2. **Use dry-run first**
430
+ ```bash
431
+ ./scripts/npm-manager.sh publish --dry-run
432
+ ```
433
+
434
+ 3. **Update CHANGELOG.md**
435
+ - Document all changes
436
+ - Follow semantic versioning
437
+
438
+ 4. **Never use --force in production**
439
+ - Only use in CI/CD after thorough testing
440
+ - Dangerous to skip confirmations
441
+
442
+ 5. **Keep git in sync**
443
+ ```bash
444
+ git push && git push --tags
445
+ ```
446
+
447
+ 6. **Monitor after publish**
448
+ - Check npm registry: https://www.npmjs.com/package/your-package
449
+ - Monitor for issues
450
+ - Check download stats
451
+
452
+ ## Support
453
+
454
+ - **Script Issues**: Check `npm-manager.log` for detailed logs
455
+ - **npm Issues**: Visit https://docs.npmjs.com/
456
+ - **Package Issues**: Check your package.json and npm registry
457
+
458
+ ## License
459
+
460
+ Part of Visual Forge MCP project.