@artis-lab/cli 0.10.0 → 0.12.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.
@@ -1,9 +1,55 @@
1
1
  export declare const verifyWidths: readonly [1280, 390];
2
2
  export declare const verifyThemes: readonly ["light", "dark"];
3
3
  export type VerifyTheme = (typeof verifyThemes)[number];
4
- /** A copy of usercontent's artifact CSP (apps/usercontent/src/worker/csp.ts);
4
+ /** Types `artis verify` knows. Mirrors `typePackageNames` in @artis/sdk,
5
+ * re-declared because it reaches the published `.d.ts`. */
6
+ export declare const verifyTypes: readonly ["slides"];
7
+ export type VerifyType = (typeof verifyTypes)[number];
8
+ export interface VerifyOptions {
9
+ /** The type the HTML is written in; omitted for a plain page. */
10
+ type?: VerifyType;
11
+ }
12
+ export declare const GOOGLE_FONTS_STYLE_ORIGIN = "https://fonts.googleapis.com";
13
+ export declare const GOOGLE_FONTS_FONT_ORIGIN = "https://fonts.gstatic.com";
14
+ /** A copy of usercontent's artifact CSP (apps/usercontent/src/worker/csp.ts),
15
+ * `googleFonts` (a typed revision, ADR 0009) included;
5
16
  * scripts/verify-unit.mjs keeps the two identical. */
6
- export declare function artifactContentSecurityPolicy(origin: string): string;
17
+ export declare function artifactContentSecurityPolicy(origin: string, sandboxTokens?: readonly string[], options?: {
18
+ googleFonts?: boolean;
19
+ connectSrc?: string;
20
+ artifactHost?: boolean;
21
+ }): string;
22
+ /** One issue of the slides format check. Mirrors `SlidesIssue` in
23
+ * @artis/slides-format (re-declared: it reaches the published `.d.ts`). */
24
+ export interface VerifyFormatIssue {
25
+ severity: 'error' | 'hint';
26
+ code: string;
27
+ message: string;
28
+ slide?: {
29
+ index: number;
30
+ id?: string;
31
+ };
32
+ line?: number;
33
+ column?: number;
34
+ }
35
+ /** A slide whose content runs past its canvas, in canvas px. */
36
+ export interface SlideOverflowFinding {
37
+ /** 1-based position of the slide in the deck. */
38
+ index: number;
39
+ id?: string;
40
+ /** How far content reaches past each edge of the canvas. */
41
+ past: {
42
+ top: number;
43
+ right: number;
44
+ bottom: number;
45
+ left: number;
46
+ };
47
+ /** The outermost elements past an edge, furthest first (at most 5). */
48
+ offenders: Array<{
49
+ element: string;
50
+ past: number;
51
+ }>;
52
+ }
7
53
  export interface OverflowFinding {
8
54
  scrollWidth: number;
9
55
  clientWidth: number;
@@ -37,12 +83,20 @@ export interface VerifyRun {
37
83
  clippedSvgs: ClippedSvgFinding[];
38
84
  consoleErrors: string[];
39
85
  cspViolations: CspViolation[];
86
+ /** Typed decks only: slides whose content runs past the canvas. */
87
+ slideOverflow?: SlideOverflowFinding[];
40
88
  }
41
89
  export interface VerifyReport {
42
90
  ok: boolean;
91
+ /** The type checked; absent for a plain page. */
92
+ type?: VerifyType;
93
+ /** Typed decks only: the format check's issues. Hints do not fail. */
94
+ formatIssues?: VerifyFormatIssue[];
43
95
  runs: VerifyRun[];
44
96
  }
45
97
  export declare class VerifyUnavailableError extends Error {
98
+ /** What was checked without a browser: a typed deck's format check. */
99
+ partial?: VerifyReport;
46
100
  }
47
101
  /** Insert the theme boot as the first child of <head> — the same stamp
48
102
  * usercontent's inline boot script applies for an explicit theme. Like
@@ -51,6 +105,31 @@ export declare class VerifyUnavailableError extends Error {
51
105
  * `prefers-color-scheme`; prepending would also push the doctype out of
52
106
  * first place and render in quirks mode. */
53
107
  export declare function stampTheme(html: string, theme: VerifyTheme): string;
54
- export declare function verifyHtml(html: string): Promise<VerifyReport>;
55
- /** Human-readable report: one block per problem, listing the runs it hit. */
108
+ /** Append a type runtime's script at the end of <body>, where usercontent
109
+ * puts it, or at the end of a document without one. */
110
+ export declare function injectRuntime(html: string, src: string): string;
111
+ /** A deck's canvas, from the content of its `<meta name="slide-size">`. */
112
+ export declare function deckCanvas(html: string): {
113
+ width: number;
114
+ height: number;
115
+ };
116
+ /**
117
+ * Check a document. A plain page is rendered at 1280 and 390 px in both
118
+ * themes. A typed deck gets the format check, then one run per theme in
119
+ * which every shown slide is measured on its canvas.
120
+ */
121
+ export declare function verifyHtml(html: string, options?: VerifyOptions): Promise<VerifyReport>;
122
+ /**
123
+ * A line of the human-readable report with the C0 and C1 control
124
+ * characters taken out, except line feeds and tabs. Slide ids, element
125
+ * descriptions, format messages and console text come from the page, and an
126
+ * ESC in them would reach the terminal as an escape sequence (colours, OSC 8
127
+ * links, cursor moves). `--json` prints the report as it is.
128
+ */
129
+ export declare function stripControlCharacters(text: string): string;
130
+ /** The format check's lines, errors first, each with its level, rule code
131
+ * and place, then a count. */
132
+ export declare function formatFormatIssues(issues: VerifyFormatIssue[]): string[];
133
+ /** Human-readable report: one block per problem, listing the runs it hit.
134
+ * Control characters are taken out (`stripControlCharacters`). */
56
135
  export declare function formatVerifyReport(report: VerifyReport): string[];
package/src/lib/verify.js CHANGED
@@ -1,395 +1,32 @@
1
- import { __awaiter } from "tslib";
2
- import { createServer } from 'node:http';
3
- /*
4
- * `artis verify`: render an artifact the way viewers get it and report what
5
- * an agent cannot see from the source. Runs locally in a headless browser
6
- * (the system Chrome through the optional `playwright-core` dependency), so
7
- * it needs no server or bridge support.
8
- *
9
- * The page is served from a local origin with the same Content-Security-
10
- * Policy usercontent sends, and each theme is applied the way the bridge's
11
- * theme boot does it (`data-theme` + `color-scheme` on <html>, plus the
12
- * matching `prefers-color-scheme`).
13
- */
14
- export const verifyWidths = [1280, 390];
15
- export const verifyThemes = ['light', 'dark'];
16
- /** A copy of usercontent's artifact CSP (apps/usercontent/src/worker/csp.ts);
17
- * scripts/verify-unit.mjs keeps the two identical. */
18
- export function artifactContentSecurityPolicy(origin) {
19
- return (`sandbox allow-scripts allow-forms; default-src 'none'; ` +
20
- `script-src 'unsafe-inline' ${origin}; style-src 'unsafe-inline'; ` +
21
- 'img-src data: blob:; font-src data:');
22
- }
23
- export class VerifyUnavailableError extends Error {
24
- }
25
- function launchBrowser() {
26
- return __awaiter(this, void 0, void 0, function* () {
27
- let chromium;
28
- try {
29
- // A variable specifier keeps bundlers and tsc from requiring the
30
- // optional dependency at build time.
31
- const specifier = 'playwright-core';
32
- ({ chromium } = yield import(specifier));
33
- }
34
- catch (_a) {
35
- throw new VerifyUnavailableError('artis verify needs playwright-core. Install it next to the CLI: npm install -g playwright-core');
36
- }
37
- const executablePath = process.env['ARTIS_CHROME_PATH'];
38
- const attempts = executablePath
39
- ? [{ executablePath }]
40
- : [{ channel: 'chrome' }, { channel: 'msedge' }, { channel: 'chromium' }];
41
- for (const attempt of attempts) {
42
- try {
43
- return yield chromium.launch(Object.assign({ headless: true }, attempt));
44
- }
45
- catch (_b) {
46
- // Try the next browser.
47
- }
48
- }
49
- throw new VerifyUnavailableError(executablePath
50
- ? `Could not launch the browser at ARTIS_CHROME_PATH (${executablePath}).`
51
- : 'artis verify uses the system Google Chrome (or Edge). Install one, or set ARTIS_CHROME_PATH to a Chromium-based browser.');
52
- });
53
- }
54
- /** Serve one document at `/` with the artifact CSP, the theme stamped the
55
- * way usercontent's theme boot does it. */
56
- function serveDocument(html) {
57
- return __awaiter(this, void 0, void 0, function* () {
58
- const server = createServer((request, response) => {
59
- var _a;
60
- const url = new URL((_a = request.url) !== null && _a !== void 0 ? _a : '/', 'http://localhost');
61
- const theme = url.searchParams.get('theme') === 'dark' ? 'dark' : 'light';
62
- if (url.pathname !== '/') {
63
- response.writeHead(404).end();
64
- return;
65
- }
66
- const origin = `http://${request.headers.host}`;
67
- response.writeHead(200, {
68
- 'content-type': 'text/html; charset=utf-8',
69
- 'content-security-policy': artifactContentSecurityPolicy(origin),
70
- });
71
- response.end(stampTheme(html, theme));
72
- });
73
- yield new Promise((resolve, reject) => {
74
- server.once('error', reject);
75
- server.listen(0, '127.0.0.1', () => {
76
- server.off('error', reject);
77
- resolve();
78
- });
79
- });
80
- const { port } = server.address();
81
- return {
82
- server,
83
- url: (theme) => `http://127.0.0.1:${port}/?theme=${theme}`,
84
- };
85
- });
86
- }
87
- /** Insert the theme boot as the first child of <head> — the same stamp
88
- * usercontent's inline boot script applies for an explicit theme. Like
89
- * usercontent (which injects through an HTMLRewriter `head` handler), a
90
- * document without a `<head>` tag gets no stamp, only the matching
91
- * `prefers-color-scheme`; prepending would also push the doctype out of
92
- * first place and render in quirks mode. */
93
- export function stampTheme(html, theme) {
94
- const boot = `<script>document.documentElement.setAttribute('data-theme','${theme}');document.documentElement.style.colorScheme='${theme}';</script>`;
95
- const head = /<head\b[^>]*>/i.exec(html);
96
- if (!head) {
97
- return html;
98
- }
99
- const at = head.index + head[0].length;
100
- return html.slice(0, at) + boot + html.slice(at);
101
- }
102
- /** Records CSP violations the page itself observes. */
103
- const RECORD_CSP_VIOLATIONS = `
104
- window.__artisCsp = [];
105
- document.addEventListener('securitypolicyviolation', (event) => {
106
- window.__artisCsp.push({
107
- directive: event.effectiveDirective || event.violatedDirective,
108
- blocked: event.blockedURI || 'inline',
109
- });
110
- });`;
111
- /** In-page checks, run after load. Kept as a string so it executes in the
112
- * page untouched by the CLI's TypeScript build. */
113
- const INSPECT_PAGE = `(() => {
114
- const describe = (el) => {
115
- let text = el.tagName.toLowerCase();
116
- if (el.id) text += '#' + el.id;
117
- const cls = typeof el.className === 'string' ? el.className.trim().split(/\\s+/).filter(Boolean).slice(0, 2) : [];
118
- if (cls.length) text += '.' + cls.join('.');
119
- return text;
120
- };
121
- const root = document.documentElement;
122
- const clientWidth = root.clientWidth;
123
- const scrollWidth = Math.max(root.scrollWidth, document.body ? document.body.scrollWidth : 0);
124
- let overflow = null;
125
- if (scrollWidth > clientWidth + 1) {
126
- // Elements past either edge whose own scroll container is the page:
127
- // an element inside overflow-x: auto/hidden is contained, not the cause.
128
- const scrolls = (el) => {
129
- const ox = getComputedStyle(el).overflowX;
130
- return ox === 'auto' || ox === 'scroll' || ox === 'hidden' || ox === 'clip';
131
- };
132
- const contained = (el) => {
133
- for (let p = el.parentElement; p && p !== document.body; p = p.parentElement) {
134
- if (scrolls(p)) return true;
135
- }
136
- return false;
137
- };
138
- const rtl = getComputedStyle(root).direction === 'rtl';
139
- const offenders = [];
140
- for (const el of document.body ? document.body.querySelectorAll('*') : []) {
141
- const rect = el.getBoundingClientRect();
142
- const left = rect.left + window.scrollX;
143
- const right = rect.right + window.scrollX;
144
- // Past the left edge only counts in a right-to-left document: in LTR
145
- // it is the usual off-screen pattern (skip links, visually-hidden
146
- // text), which the page cannot scroll to anyway.
147
- const past = rtl ? Math.max(right - clientWidth, -left) : right - clientWidth;
148
- if (past > 1 && !contained(el)) offenders.push({ element: describe(el), right: Math.round(right), past });
149
- }
150
- offenders.sort((a, b) => b.past - a.past);
151
- // overflow-x: hidden on <html>/<body> hides the scrollbar but still cuts
152
- // the content off, so it is reported, flagged as hidden.
153
- const hiddenBy = [root, document.body].find((el) => {
154
- if (!el) return false;
155
- const ox = getComputedStyle(el).overflowX;
156
- return ox === 'hidden' || ox === 'clip';
157
- });
158
- overflow = {
159
- scrollWidth,
160
- clientWidth,
161
- hiddenByPage: Boolean(hiddenBy),
162
- offenders: offenders.slice(0, 5).map(({ element, right }) => ({ element, right })),
163
- };
164
- }
165
-
166
- // Drawn content of an <svg>, in its user units: the union of its visible
167
- // leaf shapes (with half their stroke), skipping anything under a
168
- // clip-path or mask (clipped on purpose) and anything not painted.
169
- const LEAVES = 'path, rect, circle, ellipse, line, polyline, polygon, text, image, use, foreignObject';
170
- const drawnBox = (svg) => {
171
- const toUser = svg.getScreenCTM();
172
- if (!toUser) return null;
173
- const inverse = toUser.inverse();
174
- let box = null;
175
- for (const leaf of svg.querySelectorAll(LEAVES)) {
176
- if (leaf.closest('defs, clipPath, mask, marker, pattern, symbol, linearGradient, radialGradient')) continue;
177
- // A nested <svg> clips its own content; it is checked on its own terms
178
- // only when it is the outermost one.
179
- if (leaf.parentElement && leaf.parentElement.closest('svg') !== svg) continue;
180
- let hidden = false;
181
- for (let el = leaf; el && el !== svg; el = el.parentElement) {
182
- const cs = getComputedStyle(el);
183
- if (el.hasAttribute('clip-path') || el.hasAttribute('mask') || (cs.clipPath && cs.clipPath !== 'none') || (cs.mask && cs.mask !== 'none') || cs.display === 'none' || Number(cs.opacity) === 0) {
184
- hidden = true;
185
- break;
186
- }
187
- }
188
- const leafStyle = getComputedStyle(leaf);
189
- if (hidden || leafStyle.visibility !== 'visible') continue;
190
- // Paints nothing (a transparent hover overlay): not visible content.
191
- const paints = (paint) => Boolean(paint) && paint !== 'none' && paint !== 'transparent' && !(paint.startsWith('rgba(') && paint.replace(/ /g, '').endsWith(',0)'));
192
- if (leaf.tagName !== 'image' && leaf.tagName !== 'use' && leaf.tagName !== 'foreignObject' && !paints(leafStyle.fill) && !paints(leafStyle.stroke)) continue;
193
- let b;
194
- try { b = leaf.getBBox(); } catch { continue; }
195
- if (b.width === 0 && b.height === 0) continue;
196
- const half = leafStyle.stroke && leafStyle.stroke !== 'none' ? (parseFloat(leafStyle.strokeWidth) || 0) / 2 : 0;
197
- const matrix = leaf.getScreenCTM();
198
- if (!matrix) continue;
199
- const m = inverse.multiply(matrix);
200
- for (const [x, y] of [[b.x - half, b.y - half], [b.x + b.width + half, b.y - half], [b.x - half, b.y + b.height + half], [b.x + b.width + half, b.y + b.height + half]]) {
201
- const px = m.a * x + m.c * y + m.e;
202
- const py = m.b * x + m.d * y + m.f;
203
- box = box
204
- ? { x1: Math.min(box.x1, px), y1: Math.min(box.y1, py), x2: Math.max(box.x2, px), y2: Math.max(box.y2, py) }
205
- : { x1: px, y1: py, x2: px, y2: py };
206
- }
207
- }
208
- return box;
209
- };
210
-
211
- // The region of user space the SVG actually shows: the viewBox scaled into
212
- // the element's box under preserveAspectRatio (meet shows more than the
213
- // viewBox, slice less), or the box itself without a viewBox.
214
- const visibleRegion = (svg) => {
215
- const width = svg.clientWidth || svg.getBoundingClientRect().width;
216
- const height = svg.clientHeight || svg.getBoundingClientRect().height;
217
- if (!width || !height) return null;
218
- const vb = svg.viewBox && svg.viewBox.baseVal;
219
- if (!vb || !(vb.width > 0) || !(vb.height > 0)) return { x1: 0, y1: 0, x2: width, y2: height };
220
- const par = svg.preserveAspectRatio.baseVal;
221
- if (par.align === 1) return { x1: vb.x, y1: vb.y, x2: vb.x + vb.width, y2: vb.y + vb.height };
222
- const scale = par.meetOrSlice === 2
223
- ? Math.max(width / vb.width, height / vb.height)
224
- : Math.min(width / vb.width, height / vb.height);
225
- const shownWidth = width / scale;
226
- const shownHeight = height / scale;
227
- const xAlign = (par.align - 2) % 3;
228
- const yAlign = Math.floor((par.align - 2) / 3);
229
- const x1 = vb.x - ((shownWidth - vb.width) * xAlign) / 2;
230
- const y1 = vb.y - ((shownHeight - vb.height) * yAlign) / 2;
231
- return { x1, y1, x2: x1 + shownWidth, y2: y1 + shownHeight };
232
- };
233
-
234
- const clippedSvgs = [];
235
- for (const svg of document.querySelectorAll('svg')) {
236
- if (svg.parentElement && svg.parentElement.closest('svg')) continue;
237
- const style = getComputedStyle(svg);
238
- if (style.overflow === 'visible' || style.display === 'none') continue;
239
- const shown = visibleRegion(svg);
240
- const drawn = shown && drawnBox(svg);
241
- if (!drawn) continue;
242
- const tolerance = Math.max(1, (shown.x2 - shown.x1) / 500);
243
- const over = {
244
- top: Math.max(0, shown.y1 - drawn.y1),
245
- right: Math.max(0, drawn.x2 - shown.x2),
246
- bottom: Math.max(0, drawn.y2 - shown.y2),
247
- left: Math.max(0, shown.x1 - drawn.x1),
248
- };
249
- if (Object.values(over).some((v) => v > tolerance)) {
250
- const round = (v) => Math.round(v * 10) / 10;
251
- clippedSvgs.push({
252
- element: describe(svg),
253
- overflow: { top: round(over.top), right: round(over.right), bottom: round(over.bottom), left: round(over.left) },
254
- });
255
- }
256
- }
257
-
258
- return { overflow, clippedSvgs, cspViolations: window.__artisCsp || [] };
259
- })()`;
260
- /** Chrome reports CSP blocks as console errors too; those are counted as
261
- * CSP violations, not as script errors. */
262
- function isCspConsoleMessage(text) {
263
- return /Content Security Policy/i.test(text);
264
- }
265
- export function verifyHtml(html) {
266
- return __awaiter(this, void 0, void 0, function* () {
267
- // Server first, then the browser, each released in its own finally: a
268
- // failed launch or close must never leave a listening server behind (it
269
- // would keep the CLI process alive).
270
- const { server, url } = yield serveDocument(html);
271
- try {
272
- const browser = yield launchBrowser();
273
- try {
274
- return yield runChecks(browser, url);
275
- }
276
- finally {
277
- yield browser.close().catch(() => undefined);
278
- }
279
- }
280
- finally {
281
- yield new Promise((resolve) => server.close(resolve));
282
- }
283
- });
284
- }
285
- function runChecks(browser, url) {
286
- return __awaiter(this, void 0, void 0, function* () {
287
- const runs = [];
288
- for (const width of verifyWidths) {
289
- for (const theme of verifyThemes) {
290
- const context = yield browser.newContext({
291
- viewport: { width, height: 900 },
292
- colorScheme: theme,
293
- });
294
- try {
295
- const page = yield context.newPage();
296
- const consoleErrors = [];
297
- page.on('console', (message) => {
298
- if (message.type() === 'error' &&
299
- !isCspConsoleMessage(message.text())) {
300
- consoleErrors.push(message.text());
301
- }
302
- });
303
- page.on('pageerror', (error) => {
304
- // eval / new Function blocked by the CSP throws an EvalError;
305
- // the securitypolicyviolation event already records it.
306
- if (!isCspConsoleMessage(error.message)) {
307
- consoleErrors.push(error.message);
308
- }
309
- });
310
- yield page.addInitScript(RECORD_CSP_VIOLATIONS);
311
- yield page.goto(url(theme), { waitUntil: 'load', timeout: 15000 });
312
- // Let late renders and web fonts settle.
313
- yield page.waitForTimeout(400);
314
- const findings = yield page.evaluate(INSPECT_PAGE);
315
- runs.push({
316
- width,
317
- theme,
318
- overflow: findings.overflow,
319
- clippedSvgs: findings.clippedSvgs,
320
- consoleErrors: [...new Set(consoleErrors)],
321
- cspViolations: dedupe(findings.cspViolations),
322
- });
323
- }
324
- finally {
325
- yield context.close();
326
- }
327
- }
328
- }
329
- return {
330
- ok: runs.every((run) => !run.overflow &&
331
- !run.clippedSvgs.length &&
332
- !run.consoleErrors.length &&
333
- !run.cspViolations.length),
334
- runs,
335
- };
336
- });
337
- }
338
- function dedupe(violations) {
339
- const seen = new Set();
340
- return violations.filter((violation) => {
341
- const key = `${violation.directive} ${violation.blocked}`;
342
- if (seen.has(key))
343
- return false;
344
- seen.add(key);
345
- return true;
346
- });
347
- }
348
- /** Human-readable report: one block per problem, listing the runs it hit. */
349
- export function formatVerifyReport(report) {
350
- if (report.ok) {
351
- return [
352
- `No problems found at ${verifyWidths.join(' and ')} px in light and dark themes.`,
353
- ];
354
- }
355
- const lines = [];
356
- const label = (run) => `${run.width}px ${run.theme}`;
357
- const group = (pick, key) => {
358
- var _a;
359
- const byKey = new Map();
360
- for (const run of report.runs) {
361
- for (const item of pick(run)) {
362
- const entry = (_a = byKey.get(key(item))) !== null && _a !== void 0 ? _a : { item, runs: [] };
363
- entry.runs.push(label(run));
364
- byKey.set(key(item), entry);
365
- }
366
- }
367
- return [...byKey.values()];
368
- };
369
- for (const run of report.runs) {
370
- if (run.overflow) {
371
- const offenders = run.overflow.offenders
372
- .map((o) => `${o.element} (to ${o.right}px)`)
373
- .join(', ');
374
- const hidden = run.overflow.hiddenByPage
375
- ? ' (hidden by overflow-x on the page, so the content past the edge is cut off)'
376
- : '';
377
- lines.push(`Horizontal overflow at ${label(run)}: page is ${run.overflow.scrollWidth}px wide in a ${run.overflow.clientWidth}px viewport${hidden}${offenders ? `; widest: ${offenders}` : ''}.`);
378
- }
379
- }
380
- for (const { item, runs } of group((run) => run.clippedSvgs, (svg) => `${svg.element} ${JSON.stringify(svg.overflow)}`)) {
381
- const sides = Object.entries(item.overflow)
382
- .filter(([, value]) => value > 0)
383
- .map(([side, value]) => `${side} ${value}`)
384
- .join(', ');
385
- lines.push(`Clipped SVG ${item.element} (content past its viewport: ${sides}) at ${runs.join(', ')}.`);
386
- }
387
- for (const { item, runs } of group((run) => run.consoleErrors, (text) => text)) {
388
- lines.push(`Console error at ${runs.join(', ')}: ${item}`);
389
- }
390
- for (const { item, runs } of group((run) => run.cspViolations, (violation) => `${violation.directive} ${violation.blocked}`)) {
391
- lines.push(`CSP violation (${item.directive}) blocking ${item.blocked} at ${runs.join(', ')}. Artifacts may load nothing external: inline it or use a data: URL.`);
392
- }
393
- return lines;
394
- }
395
- //# sourceMappingURL=verify.js.map
1
+ import {
2
+ GOOGLE_FONTS_FONT_ORIGIN,
3
+ GOOGLE_FONTS_STYLE_ORIGIN,
4
+ VerifyUnavailableError,
5
+ artifactContentSecurityPolicy,
6
+ deckCanvas,
7
+ formatFormatIssues,
8
+ formatVerifyReport,
9
+ injectRuntime,
10
+ stampTheme,
11
+ stripControlCharacters,
12
+ verifyHtml,
13
+ verifyThemes,
14
+ verifyTypes,
15
+ verifyWidths
16
+ } from "./chunk-YAZGW7Y4.js";
17
+ export {
18
+ GOOGLE_FONTS_FONT_ORIGIN,
19
+ GOOGLE_FONTS_STYLE_ORIGIN,
20
+ VerifyUnavailableError,
21
+ artifactContentSecurityPolicy,
22
+ deckCanvas,
23
+ formatFormatIssues,
24
+ formatVerifyReport,
25
+ injectRuntime,
26
+ stampTheme,
27
+ stripControlCharacters,
28
+ verifyHtml,
29
+ verifyThemes,
30
+ verifyTypes,
31
+ verifyWidths
32
+ };
@@ -1,7 +1,9 @@
1
1
  /**
2
- * CLI version, read from the package manifest that ships alongside the compiled
3
- * output. The relative specifier resolves against this file's directory, which
4
- * holds for both the Nx build output (`dist/packages/cli/src/lib/`) and an
5
- * installed package (`node_modules/@artis-lab/cli/src/lib/`).
2
+ * CLI version, read from the package manifest that ships alongside the bundled
3
+ * output. The relative specifier resolves against the directory of the file
4
+ * the code lands in: `src/lib/` for this module and for the shared chunks
5
+ * (scripts/build-cli.mjs puts them there), both in the build output
6
+ * (`dist/packages/cli/src/lib/`) and in an installed package
7
+ * (`node_modules/@artis-lab/cli/src/lib/`).
6
8
  */
7
9
  export declare const artisCliVersion: string;
@@ -1,11 +1,6 @@
1
- import { createRequire } from 'node:module';
2
- const require = createRequire(import.meta.url);
3
- /**
4
- * CLI version, read from the package manifest that ships alongside the compiled
5
- * output. The relative specifier resolves against this file's directory, which
6
- * holds for both the Nx build output (`dist/packages/cli/src/lib/`) and an
7
- * installed package (`node_modules/@artis-lab/cli/src/lib/`).
8
- */
9
- export const artisCliVersion = require('../../package.json')
10
- .version;
11
- //# sourceMappingURL=version.js.map
1
+ import {
2
+ artisCliVersion
3
+ } from "./chunk-IZYFOV2K.js";
4
+ export {
5
+ artisCliVersion
6
+ };