skillui 1.1.1 → 1.1.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/dist/extractors/ultra/animations.js +3 -6
- package/dist/extractors/ultra/components-dom.js +3 -6
- package/dist/extractors/ultra/interactions.js +3 -6
- package/dist/extractors/ultra/layout.js +3 -6
- package/dist/extractors/ultra/pages.js +3 -6
- package/dist/modes/ultra.js +4 -8
- package/dist/playwright-loader.d.ts +10 -0
- package/dist/playwright-loader.js +71 -0
- package/package.json +1 -1
|
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.captureAnimations = captureAnimations;
|
|
37
37
|
const fs = __importStar(require("fs"));
|
|
38
38
|
const path = __importStar(require("path"));
|
|
39
|
+
const playwright_loader_1 = require("../../playwright-loader");
|
|
39
40
|
/**
|
|
40
41
|
* Ultra mode — Full Animation Extractor
|
|
41
42
|
*
|
|
@@ -67,13 +68,9 @@ async function captureAnimations(url, skillDir) {
|
|
|
67
68
|
webglDetected: false,
|
|
68
69
|
lottieCount: 0,
|
|
69
70
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
playwright = require('playwright');
|
|
73
|
-
}
|
|
74
|
-
catch {
|
|
71
|
+
const playwright = (0, playwright_loader_1.loadPlaywright)();
|
|
72
|
+
if (!playwright)
|
|
75
73
|
return empty;
|
|
76
|
-
}
|
|
77
74
|
const scrollDir = path.join(skillDir, 'screens', 'scroll');
|
|
78
75
|
fs.mkdirSync(scrollDir, { recursive: true });
|
|
79
76
|
const browser = await playwright.chromium.launch({ headless: true });
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.detectDOMComponents = detectDOMComponents;
|
|
4
|
+
const playwright_loader_1 = require("../../playwright-loader");
|
|
4
5
|
/**
|
|
5
6
|
* Ultra mode — DOM Component Detector
|
|
6
7
|
*
|
|
@@ -12,13 +13,9 @@ exports.detectDOMComponents = detectDOMComponents;
|
|
|
12
13
|
* Requires Playwright (optional peer dependency).
|
|
13
14
|
*/
|
|
14
15
|
async function detectDOMComponents(url) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
playwright = require('playwright');
|
|
18
|
-
}
|
|
19
|
-
catch {
|
|
16
|
+
const playwright = (0, playwright_loader_1.loadPlaywright)();
|
|
17
|
+
if (!playwright)
|
|
20
18
|
return [];
|
|
21
|
-
}
|
|
22
19
|
const browser = await playwright.chromium.launch({ headless: true });
|
|
23
20
|
try {
|
|
24
21
|
const context = await browser.newContext({
|
|
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.captureInteractions = captureInteractions;
|
|
37
37
|
const fs = __importStar(require("fs"));
|
|
38
38
|
const path = __importStar(require("path"));
|
|
39
|
+
const playwright_loader_1 = require("../../playwright-loader");
|
|
39
40
|
const TRACKED_PROPS = [
|
|
40
41
|
'backgroundColor',
|
|
41
42
|
'color',
|
|
@@ -67,13 +68,9 @@ const INTERACTIVE_SELECTORS = [
|
|
|
67
68
|
* Returns InteractionRecord[] for INTERACTIONS.md generation.
|
|
68
69
|
*/
|
|
69
70
|
async function captureInteractions(url, skillDir) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
playwright = require('playwright');
|
|
73
|
-
}
|
|
74
|
-
catch {
|
|
71
|
+
const playwright = (0, playwright_loader_1.loadPlaywright)();
|
|
72
|
+
if (!playwright)
|
|
75
73
|
return [];
|
|
76
|
-
}
|
|
77
74
|
const statesDir = path.join(skillDir, 'screens', 'states');
|
|
78
75
|
fs.mkdirSync(statesDir, { recursive: true });
|
|
79
76
|
const records = [];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.extractLayouts = extractLayouts;
|
|
4
|
+
const playwright_loader_1 = require("../../playwright-loader");
|
|
4
5
|
/**
|
|
5
6
|
* Ultra mode — DOM Layout Extractor
|
|
6
7
|
*
|
|
@@ -13,13 +14,9 @@ exports.extractLayouts = extractLayouts;
|
|
|
13
14
|
* Requires Playwright (optional peer dependency).
|
|
14
15
|
*/
|
|
15
16
|
async function extractLayouts(url) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
playwright = require('playwright');
|
|
19
|
-
}
|
|
20
|
-
catch {
|
|
17
|
+
const playwright = (0, playwright_loader_1.loadPlaywright)();
|
|
18
|
+
if (!playwright)
|
|
21
19
|
return [];
|
|
22
|
-
}
|
|
23
20
|
const browser = await playwright.chromium.launch({ headless: true });
|
|
24
21
|
try {
|
|
25
22
|
const context = await browser.newContext({
|
|
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.capturePageScreenshots = capturePageScreenshots;
|
|
37
37
|
const fs = __importStar(require("fs"));
|
|
38
38
|
const path = __importStar(require("path"));
|
|
39
|
+
const playwright_loader_1 = require("../../playwright-loader");
|
|
39
40
|
/**
|
|
40
41
|
* Ultra mode — Page & Section Screenshots
|
|
41
42
|
*
|
|
@@ -47,13 +48,9 @@ const path = __importStar(require("path"));
|
|
|
47
48
|
* Requires Playwright (optional peer dependency).
|
|
48
49
|
*/
|
|
49
50
|
async function capturePageScreenshots(originUrl, skillDir, maxPages) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
playwright = require('playwright');
|
|
53
|
-
}
|
|
54
|
-
catch {
|
|
51
|
+
const playwright = (0, playwright_loader_1.loadPlaywright)();
|
|
52
|
+
if (!playwright)
|
|
55
53
|
return { pages: [], sections: [] };
|
|
56
|
-
}
|
|
57
54
|
const pagesDir = path.join(skillDir, 'screens', 'pages');
|
|
58
55
|
const sectionsDir = path.join(skillDir, 'screens', 'sections');
|
|
59
56
|
fs.mkdirSync(pagesDir, { recursive: true });
|
package/dist/modes/ultra.js
CHANGED
|
@@ -46,6 +46,7 @@ const interactions_md_1 = require("../writers/interactions-md");
|
|
|
46
46
|
const components_md_1 = require("../writers/components-md");
|
|
47
47
|
const animations_md_1 = require("../writers/animations-md");
|
|
48
48
|
const tokens_json_1 = require("../writers/tokens-json");
|
|
49
|
+
const playwright_loader_1 = require("../playwright-loader");
|
|
49
50
|
/**
|
|
50
51
|
* Ultra mode orchestrator.
|
|
51
52
|
*
|
|
@@ -72,15 +73,10 @@ async function runUltraMode(url, profile, skillDir, opts) {
|
|
|
72
73
|
fs.mkdirSync(path.join(skillDir, 'screens', 'scroll'), { recursive: true });
|
|
73
74
|
fs.mkdirSync(path.join(skillDir, 'references'), { recursive: true });
|
|
74
75
|
fs.mkdirSync(path.join(skillDir, 'tokens'), { recursive: true });
|
|
75
|
-
|
|
76
|
-
try {
|
|
77
|
-
require.resolve('playwright');
|
|
78
|
-
hasPlaywright = true;
|
|
79
|
-
}
|
|
80
|
-
catch { /* not installed */ }
|
|
76
|
+
const hasPlaywright = (0, playwright_loader_1.loadPlaywright)() !== null;
|
|
81
77
|
if (!hasPlaywright) {
|
|
82
|
-
process.stdout.write('\n ⚠ Playwright not
|
|
83
|
-
process.stdout.write('
|
|
78
|
+
process.stdout.write('\n ⚠ Playwright not found — ultra visual features skipped\n');
|
|
79
|
+
process.stdout.write(' Fix: npm install -g playwright && npx playwright install chromium\n\n');
|
|
84
80
|
(0, tokens_json_1.writeTokensJson)(profile, skillDir);
|
|
85
81
|
writeStubs(skillDir);
|
|
86
82
|
const emptyAnim = emptyAnimResult();
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loads playwright from any location it might be installed:
|
|
3
|
+
* 1. Bundled with the CLI (peer dep)
|
|
4
|
+
* 2. In the user's cwd node_modules (local project install)
|
|
5
|
+
* 3. In the global npm prefix (npm install -g playwright)
|
|
6
|
+
*
|
|
7
|
+
* Returns the playwright module or null if not found anywhere.
|
|
8
|
+
*/
|
|
9
|
+
export declare function loadPlaywright(): any | null;
|
|
10
|
+
//# sourceMappingURL=playwright-loader.d.ts.map
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.loadPlaywright = loadPlaywright;
|
|
37
|
+
const path = __importStar(require("path"));
|
|
38
|
+
const child_process_1 = require("child_process");
|
|
39
|
+
/**
|
|
40
|
+
* Loads playwright from any location it might be installed:
|
|
41
|
+
* 1. Bundled with the CLI (peer dep)
|
|
42
|
+
* 2. In the user's cwd node_modules (local project install)
|
|
43
|
+
* 3. In the global npm prefix (npm install -g playwright)
|
|
44
|
+
*
|
|
45
|
+
* Returns the playwright module or null if not found anywhere.
|
|
46
|
+
*/
|
|
47
|
+
function loadPlaywright() {
|
|
48
|
+
// 1. Try standard require (works when playwright is in same node_modules tree)
|
|
49
|
+
try {
|
|
50
|
+
return require('playwright');
|
|
51
|
+
}
|
|
52
|
+
catch { /* fall through */ }
|
|
53
|
+
// 2. Try from cwd (user ran: npm install playwright in their project)
|
|
54
|
+
try {
|
|
55
|
+
const cwdPath = path.join(process.cwd(), 'node_modules', 'playwright');
|
|
56
|
+
return require(cwdPath);
|
|
57
|
+
}
|
|
58
|
+
catch { /* fall through */ }
|
|
59
|
+
// 3. Try from global npm prefix (npm install -g playwright)
|
|
60
|
+
try {
|
|
61
|
+
const globalRoot = (0, child_process_1.execSync)('npm root -g', {
|
|
62
|
+
encoding: 'utf-8',
|
|
63
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
64
|
+
timeout: 5000,
|
|
65
|
+
}).trim();
|
|
66
|
+
return require(path.join(globalRoot, 'playwright'));
|
|
67
|
+
}
|
|
68
|
+
catch { /* fall through */ }
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=playwright-loader.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skillui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Reverse-engineer design systems from any website, repo, or project. Extracts colors, fonts, spacing, animations, and components — packaged as a .skill file for Claude. Pure static analysis, zero AI, zero API keys.",
|
|
5
5
|
"main": "dist/cli.js",
|
|
6
6
|
"bin": {
|