real-prototypes-skill 0.1.2 → 0.1.3
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/bin/cli.js +65 -14
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -13,10 +13,54 @@
|
|
|
13
13
|
const fs = require('fs');
|
|
14
14
|
const path = require('path');
|
|
15
15
|
const os = require('os');
|
|
16
|
+
const https = require('https');
|
|
16
17
|
|
|
17
18
|
const VERSION = require('../package.json').version;
|
|
18
19
|
const SKILL_NAME = 'real-prototypes-skill';
|
|
19
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Check for newer version on npm and notify user
|
|
23
|
+
*/
|
|
24
|
+
function checkForUpdates() {
|
|
25
|
+
return new Promise((resolve) => {
|
|
26
|
+
const req = https.get(
|
|
27
|
+
`https://registry.npmjs.org/${SKILL_NAME}/latest`,
|
|
28
|
+
{ timeout: 3000 },
|
|
29
|
+
(res) => {
|
|
30
|
+
let data = '';
|
|
31
|
+
res.on('data', chunk => data += chunk);
|
|
32
|
+
res.on('end', () => {
|
|
33
|
+
try {
|
|
34
|
+
const latest = JSON.parse(data).version;
|
|
35
|
+
if (latest && latest !== VERSION) {
|
|
36
|
+
const current = VERSION.split('.').map(Number);
|
|
37
|
+
const remote = latest.split('.').map(Number);
|
|
38
|
+
|
|
39
|
+
// Check if remote is newer
|
|
40
|
+
const isNewer = remote[0] > current[0] ||
|
|
41
|
+
(remote[0] === current[0] && remote[1] > current[1]) ||
|
|
42
|
+
(remote[0] === current[0] && remote[1] === current[1] && remote[2] > current[2]);
|
|
43
|
+
|
|
44
|
+
if (isNewer) {
|
|
45
|
+
console.log(`
|
|
46
|
+
\x1b[33m╔═══════════════════════════════════════════════════════════╗
|
|
47
|
+
║ UPDATE AVAILABLE: ${VERSION} → ${latest.padEnd(43)}║
|
|
48
|
+
║ ║
|
|
49
|
+
║ Run: npx ${SKILL_NAME}@latest --force ║
|
|
50
|
+
╚═══════════════════════════════════════════════════════════╝\x1b[0m
|
|
51
|
+
`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
} catch (e) { /* ignore parse errors */ }
|
|
55
|
+
resolve();
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
req.on('error', () => resolve());
|
|
60
|
+
req.on('timeout', () => { req.destroy(); resolve(); });
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
20
64
|
function log(message, type = 'info') {
|
|
21
65
|
const styles = {
|
|
22
66
|
info: '\x1b[36m→\x1b[0m',
|
|
@@ -302,18 +346,25 @@ function parseArgs(args) {
|
|
|
302
346
|
}
|
|
303
347
|
|
|
304
348
|
// Main
|
|
305
|
-
|
|
306
|
-
const
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
349
|
+
async function main() {
|
|
350
|
+
const args = process.argv.slice(2);
|
|
351
|
+
const options = parseArgs(args);
|
|
352
|
+
|
|
353
|
+
// Check for updates (non-blocking, 3s timeout)
|
|
354
|
+
await checkForUpdates();
|
|
355
|
+
|
|
356
|
+
switch (options.command) {
|
|
357
|
+
case 'install':
|
|
358
|
+
install(options);
|
|
359
|
+
break;
|
|
360
|
+
case 'uninstall':
|
|
361
|
+
uninstall(options);
|
|
362
|
+
break;
|
|
363
|
+
case 'help':
|
|
364
|
+
default:
|
|
365
|
+
showHelp();
|
|
366
|
+
break;
|
|
367
|
+
}
|
|
319
368
|
}
|
|
369
|
+
|
|
370
|
+
main();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "real-prototypes-skill",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Capture any web platform and generate pixel-perfect prototypes that match its design. A Claude Code skill for rapid feature prototyping.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude-code",
|