@runelight/cli 0.0.9
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/LICENSE +21 -0
- package/dist/browser-capture.d.ts +4 -0
- package/dist/browser-capture.d.ts.map +1 -0
- package/dist/browser-capture.js +124 -0
- package/dist/browser-capture.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/package.json +45 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 tuoxiansp
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { RunelightCaptureBackend, RunelightCaptureOptions } from "@runelight/core/cli";
|
|
2
|
+
export declare const playwrightBrowserCaptureBackend: RunelightCaptureBackend;
|
|
3
|
+
export declare function capturePreviewPage(options: RunelightCaptureOptions): Promise<void>;
|
|
4
|
+
//# sourceMappingURL=browser-capture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-capture.d.ts","sourceRoot":"","sources":["../src/browser-capture.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAM3F,eAAO,MAAM,+BAA+B,EAAE,uBAE7C,CAAA;AAED,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAkBxF"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { setTimeout as delay } from "node:timers/promises";
|
|
3
|
+
import { chromium } from "playwright";
|
|
4
|
+
const previewCaptureBoundsSelector = "[data-runelight-preview-capture-bounds]";
|
|
5
|
+
const previewFrameGroupSelector = "[data-runelight-preview-frame-group]";
|
|
6
|
+
const previewCaptureCanvasPadding = 32;
|
|
7
|
+
export const playwrightBrowserCaptureBackend = {
|
|
8
|
+
capturePreviewPage,
|
|
9
|
+
};
|
|
10
|
+
export async function capturePreviewPage(options) {
|
|
11
|
+
const originalCwd = process.cwd();
|
|
12
|
+
process.chdir(options.cwd);
|
|
13
|
+
let browser;
|
|
14
|
+
try {
|
|
15
|
+
browser = await chromium.launch();
|
|
16
|
+
const page = await browser.newPage({ viewport: parseViewport(options.viewport) });
|
|
17
|
+
await gotoWhenReady(page, options.url);
|
|
18
|
+
await waitForPreviewCaptureLayout(page);
|
|
19
|
+
const clip = await previewCaptureClip(page);
|
|
20
|
+
await page.screenshot({ path: join(options.cwd, options.out), omitBackground: true, ...(clip ? { clip } : { fullPage: true }) });
|
|
21
|
+
}
|
|
22
|
+
finally {
|
|
23
|
+
try {
|
|
24
|
+
await browser?.close();
|
|
25
|
+
}
|
|
26
|
+
finally {
|
|
27
|
+
process.chdir(originalCwd);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function parseViewport(viewport) {
|
|
32
|
+
const [width, height] = viewport.split("x").map((value) => Number.parseInt(value, 10));
|
|
33
|
+
if (!width || !height) {
|
|
34
|
+
throw new Error(`Invalid viewport: ${viewport}`);
|
|
35
|
+
}
|
|
36
|
+
return { width, height };
|
|
37
|
+
}
|
|
38
|
+
async function waitForPreviewCaptureLayout(page) {
|
|
39
|
+
try {
|
|
40
|
+
await page.waitForFunction((selector) => {
|
|
41
|
+
const frameGroup = document.querySelector(selector);
|
|
42
|
+
return !frameGroup || frameGroup.getAttribute("data-runelight-preview-frame-group-measured") === "true";
|
|
43
|
+
}, previewFrameGroupSelector, { timeout: 5_000 });
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
// Capture should still work for hosts that do not expose Runelight contact-sheet layout markers.
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
async function previewCaptureClip(page) {
|
|
50
|
+
const bounds = await previewCaptureBoundsBox(page);
|
|
51
|
+
if (!bounds)
|
|
52
|
+
return undefined;
|
|
53
|
+
const pageSize = await page.evaluate(() => ({
|
|
54
|
+
height: Math.max(document.documentElement.scrollHeight, document.body?.scrollHeight ?? 0),
|
|
55
|
+
width: Math.max(document.documentElement.scrollWidth, document.body?.scrollWidth ?? 0),
|
|
56
|
+
}));
|
|
57
|
+
const x = Math.max(0, Math.floor(bounds.x - previewCaptureCanvasPadding));
|
|
58
|
+
const y = Math.max(0, Math.floor(bounds.y - previewCaptureCanvasPadding));
|
|
59
|
+
const right = Math.min(pageSize.width, Math.ceil(bounds.x + bounds.width + previewCaptureCanvasPadding));
|
|
60
|
+
const bottom = Math.min(pageSize.height, Math.ceil(bounds.y + bounds.height + previewCaptureCanvasPadding));
|
|
61
|
+
return {
|
|
62
|
+
x,
|
|
63
|
+
y,
|
|
64
|
+
width: Math.max(1, right - x),
|
|
65
|
+
height: Math.max(1, bottom - y),
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
async function previewCaptureBoundsBox(page) {
|
|
69
|
+
return page.evaluate((selector) => {
|
|
70
|
+
const element = document.querySelector(selector);
|
|
71
|
+
if (!(element instanceof HTMLElement))
|
|
72
|
+
return null;
|
|
73
|
+
if (element.hasAttribute("data-runelight-preview-frame")) {
|
|
74
|
+
const descendantRects = [...element.querySelectorAll("*")]
|
|
75
|
+
.filter((node) => {
|
|
76
|
+
const style = window.getComputedStyle(node);
|
|
77
|
+
if (style.display === "contents" || style.visibility === "hidden")
|
|
78
|
+
return false;
|
|
79
|
+
const rect = node.getBoundingClientRect();
|
|
80
|
+
return rect.width > 0 && rect.height > 0;
|
|
81
|
+
})
|
|
82
|
+
.map((node) => node.getBoundingClientRect());
|
|
83
|
+
if (descendantRects.length > 0)
|
|
84
|
+
return unionDomRects(descendantRects);
|
|
85
|
+
}
|
|
86
|
+
const rect = element.getBoundingClientRect();
|
|
87
|
+
return {
|
|
88
|
+
x: rect.x,
|
|
89
|
+
y: rect.y,
|
|
90
|
+
width: rect.width,
|
|
91
|
+
height: rect.height,
|
|
92
|
+
};
|
|
93
|
+
function unionDomRects(rects) {
|
|
94
|
+
const left = Math.min(...rects.map((rect) => rect.left));
|
|
95
|
+
const top = Math.min(...rects.map((rect) => rect.top));
|
|
96
|
+
const right = Math.max(...rects.map((rect) => rect.right));
|
|
97
|
+
const bottom = Math.max(...rects.map((rect) => rect.bottom));
|
|
98
|
+
return {
|
|
99
|
+
x: left,
|
|
100
|
+
y: top,
|
|
101
|
+
width: right - left,
|
|
102
|
+
height: bottom - top,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
}, previewCaptureBoundsSelector);
|
|
106
|
+
}
|
|
107
|
+
async function gotoWhenReady(page, url) {
|
|
108
|
+
const deadline = Date.now() + 30_000;
|
|
109
|
+
let lastError;
|
|
110
|
+
while (Date.now() < deadline) {
|
|
111
|
+
try {
|
|
112
|
+
const response = await page.goto(url, { waitUntil: "networkidle", timeout: 5_000 });
|
|
113
|
+
if (!response || response.ok())
|
|
114
|
+
return;
|
|
115
|
+
lastError = new Error(`Preview returned HTTP ${response.status()} for ${url}`);
|
|
116
|
+
}
|
|
117
|
+
catch (error) {
|
|
118
|
+
lastError = error;
|
|
119
|
+
}
|
|
120
|
+
await delay(500);
|
|
121
|
+
}
|
|
122
|
+
throw lastError instanceof Error ? lastError : new Error(`Timed out waiting for preview URL: ${url}`);
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=browser-capture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-capture.js","sourceRoot":"","sources":["../src/browser-capture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAE1D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAGrC,MAAM,4BAA4B,GAAG,yCAAyC,CAAA;AAC9E,MAAM,yBAAyB,GAAG,sCAAsC,CAAA;AACxE,MAAM,2BAA2B,GAAG,EAAE,CAAA;AAEtC,MAAM,CAAC,MAAM,+BAA+B,GAA4B;IACtE,kBAAkB;CACnB,CAAA;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,OAAgC;IACvE,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE,CAAA;IACjC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IAC1B,IAAI,OAAgE,CAAA;IACpE,IAAI,CAAC;QACH,OAAO,GAAG,MAAM,QAAQ,CAAC,MAAM,EAAE,CAAA;QACjC,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE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AQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,MAAM,CAAA;IACpC,IAAI,SAAkB,CAAA;IAEtB,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ,EAAE,CAAC;QAC7B,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAA;YACnF,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,EAAE,EAAE;gBAAE,OAAM;YACtC,SAAS,GAAG,IAAI,KAAK,CAAC,yBAAyB,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,EAAE,CAAC,CAAA;QAChF,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,SAAS,GAAG,KAAK,CAAA;QACnB,CAAC;QACD,MAAM,KAAK,CAAC,GAAG,CAAC,CAAA;IAClB,CAAC;IAED,MAAM,SAAS,YAAY,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,sCAAsC,GAAG,EAAE,CAAC,CAAA;AACvG,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { runCLI } from "@runelight/core/cli";
|
|
3
|
+
import { playwrightBrowserCaptureBackend } from "./browser-capture.js";
|
|
4
|
+
const abortController = new AbortController();
|
|
5
|
+
process.once("SIGINT", () => abortController.abort());
|
|
6
|
+
process.once("SIGTERM", () => abortController.abort());
|
|
7
|
+
const result = await runCLI(process.argv.slice(2), {
|
|
8
|
+
captureBackend: playwrightBrowserCaptureBackend,
|
|
9
|
+
cwd: process.cwd(),
|
|
10
|
+
hostStdio: "inherit",
|
|
11
|
+
signal: abortController.signal,
|
|
12
|
+
stdout: "",
|
|
13
|
+
stderr: "",
|
|
14
|
+
writeStderr: (chunk) => process.stderr.write(chunk),
|
|
15
|
+
writeStdout: (chunk) => process.stdout.write(chunk),
|
|
16
|
+
});
|
|
17
|
+
if (result.stdout && !abortController.signal.aborted)
|
|
18
|
+
process.stdout.write(result.stdout);
|
|
19
|
+
if (result.stderr)
|
|
20
|
+
process.stderr.write(result.stderr);
|
|
21
|
+
process.exitCode = result.exitCode;
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,+BAA+B,EAAE,MAAM,sBAAsB,CAAA;AAEtE,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAA;AAC7C,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC,CAAA;AACrD,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC,CAAA;AAEtD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;IACjD,cAAc,EAAE,+BAA+B;IAC/C,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;IAClB,SAAS,EAAE,SAAS;IACpB,MAAM,EAAE,eAAe,CAAC,MAAM;IAC9B,MAAM,EAAE,EAAE;IACV,MAAM,EAAE,EAAE;IACV,WAAW,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC;IACnD,WAAW,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC;CACpD,CAAC,CAAA;AAEF,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,OAAO;IAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;AACzF,IAAI,MAAM,CAAC,MAAM;IAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;AACtD,OAAO,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@runelight/cli",
|
|
3
|
+
"version": "0.0.9",
|
|
4
|
+
"description": "Runelight command line interface for starting Studio, capture, and project checks.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/tuoxiansp/runelight.git",
|
|
10
|
+
"directory": "packages/cli"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/tuoxiansp/runelight/issues"
|
|
14
|
+
},
|
|
15
|
+
"homepage": "https://github.com/tuoxiansp/runelight#readme",
|
|
16
|
+
"keywords": [
|
|
17
|
+
"runelight",
|
|
18
|
+
"cli",
|
|
19
|
+
"studio",
|
|
20
|
+
"component-preview"
|
|
21
|
+
],
|
|
22
|
+
"bin": {
|
|
23
|
+
"runelight": "./dist/index.js"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist"
|
|
27
|
+
],
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"playwright": "^1.60.0",
|
|
30
|
+
"@runelight/core": "0.0.9"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"typescript": "^6.0.3",
|
|
34
|
+
"vitest": "^4.1.7"
|
|
35
|
+
},
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public"
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"clean": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
|
|
41
|
+
"build": "pnpm clean && tsc -p tsconfig.build.json",
|
|
42
|
+
"test": "vitest run",
|
|
43
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
44
|
+
}
|
|
45
|
+
}
|