@artis-lab/cli 0.14.0 → 0.15.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.
- package/README.md +18 -14
- package/package.json +2 -5
- package/src/bin.js +12 -4
- package/src/lib/app.js +12 -4
- package/src/lib/{chunk-CT5TD6L2.js → chunk-2LRPXCLL.js} +24 -47
- package/src/lib/{chunk-MEPQKMK5.js → chunk-43EXTJSU.js} +1 -1
- package/src/lib/{chunk-H32QAUSA.js → chunk-HUWOFEEU.js} +7 -0
- package/src/lib/chunk-IKQ5U3DH.js +146 -0
- package/src/lib/chunk-JPCT7RRK.js +1761 -0
- package/src/lib/chunk-VBJGJXYL.js +1238 -0
- package/src/lib/chunk-VLYS5R67.js +113 -0
- package/src/lib/cli.js +86 -60
- package/src/lib/commands.js +24 -0
- package/src/lib/exit-codes.js +5 -3
- package/src/lib/files.js +2 -2
- package/src/lib/next-actions.js +12 -5
- package/src/lib/skill-install.js +9 -4
- package/src/bin.d.ts +0 -2
- package/src/index.d.ts +0 -1
- package/src/index.js +0 -76
- package/src/lib/app.d.ts +0 -3
- package/src/lib/args.d.ts +0 -4
- package/src/lib/args.js +0 -12
- package/src/lib/chunk-CCCATRMP.js +0 -591
- package/src/lib/chunk-KJV7R7DE.js +0 -82
- package/src/lib/chunk-PG7WDW5F.js +0 -2420
- package/src/lib/chunk-Q5KBGVKT.js +0 -155
- package/src/lib/cli.d.ts +0 -147
- package/src/lib/config.d.ts +0 -50
- package/src/lib/exit-codes.d.ts +0 -28
- package/src/lib/files.d.ts +0 -19
- package/src/lib/next-actions.d.ts +0 -13
- package/src/lib/oauth.d.ts +0 -45
- package/src/lib/revision-bases.d.ts +0 -9
- package/src/lib/skill-install.d.ts +0 -50
- package/src/lib/verify.d.ts +0 -152
- package/src/lib/version.d.ts +0 -9
package/src/lib/verify.d.ts
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
export declare const verifyWidths: readonly [1280, 390];
|
|
2
|
-
export declare const verifyThemes: readonly ["light", "dark"];
|
|
3
|
-
export type VerifyTheme = (typeof verifyThemes)[number];
|
|
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 files are written in; omitted for an html artifact. */
|
|
10
|
-
type?: VerifyType;
|
|
11
|
-
/**
|
|
12
|
-
* Loads one of the artifact's assets (ADR 0023) for `/_blob/<id>`, when
|
|
13
|
-
* verifying a published artifact. Without it (a local file) asset
|
|
14
|
-
* references are answered empty and listed in `assetsNotLoaded`; with
|
|
15
|
-
* it, an asset it resolves to `undefined` (not found) is a 404, which
|
|
16
|
-
* the page reports, and one it rejects for (it could not check, such as
|
|
17
|
-
* a key without the role that reads assets) is answered empty and
|
|
18
|
-
* listed, like a local file's.
|
|
19
|
-
*/
|
|
20
|
-
loadAsset?: (assetId: string) => Promise<{
|
|
21
|
-
bytes: Uint8Array;
|
|
22
|
-
contentType: string;
|
|
23
|
-
} | undefined>;
|
|
24
|
-
}
|
|
25
|
-
export declare const GOOGLE_FONTS_STYLE_ORIGIN = "https://fonts.googleapis.com";
|
|
26
|
-
export declare const GOOGLE_FONTS_FONT_ORIGIN = "https://fonts.gstatic.com";
|
|
27
|
-
/** A copy of usercontent's artifact CSP (apps/usercontent/src/worker/csp.ts),
|
|
28
|
-
* `googleFonts` (a typed revision, ADR 0009) included;
|
|
29
|
-
* scripts/verify-unit.mjs keeps the two identical. */
|
|
30
|
-
export declare function artifactContentSecurityPolicy(origin: string, sandboxTokens?: readonly string[], options?: {
|
|
31
|
-
googleFonts?: boolean;
|
|
32
|
-
connectSrc?: string;
|
|
33
|
-
artifactHost?: boolean;
|
|
34
|
-
}): string;
|
|
35
|
-
/** One issue of the slides format check. Mirrors `SlidesIssue` in
|
|
36
|
-
* @artis/slides-format (re-declared: it reaches the published `.d.ts`). */
|
|
37
|
-
export interface VerifyFormatIssue {
|
|
38
|
-
severity: 'error' | 'hint';
|
|
39
|
-
code: string;
|
|
40
|
-
message: string;
|
|
41
|
-
slide?: {
|
|
42
|
-
index: number;
|
|
43
|
-
id?: string;
|
|
44
|
-
};
|
|
45
|
-
/** The deck file it is in; `line` and `column` count in that file. */
|
|
46
|
-
file?: string;
|
|
47
|
-
line?: number;
|
|
48
|
-
column?: number;
|
|
49
|
-
}
|
|
50
|
-
/** A slide whose content runs past its canvas, in canvas px. */
|
|
51
|
-
export interface SlideOverflowFinding {
|
|
52
|
-
/** 1-based position of the slide in the deck. */
|
|
53
|
-
index: number;
|
|
54
|
-
id?: string;
|
|
55
|
-
/** How far content reaches past each edge of the canvas. */
|
|
56
|
-
past: {
|
|
57
|
-
top: number;
|
|
58
|
-
right: number;
|
|
59
|
-
bottom: number;
|
|
60
|
-
left: number;
|
|
61
|
-
};
|
|
62
|
-
/** The outermost elements past an edge, furthest first (at most 5). */
|
|
63
|
-
offenders: Array<{
|
|
64
|
-
element: string;
|
|
65
|
-
past: number;
|
|
66
|
-
}>;
|
|
67
|
-
}
|
|
68
|
-
export interface OverflowFinding {
|
|
69
|
-
scrollWidth: number;
|
|
70
|
-
clientWidth: number;
|
|
71
|
-
/** `overflow-x: hidden` on <html>/<body>: no scrollbar, but the content
|
|
72
|
-
* past the edge is still cut off. */
|
|
73
|
-
hiddenByPage: boolean;
|
|
74
|
-
/** Elements reaching past the right edge, widest first (at most 5). */
|
|
75
|
-
offenders: Array<{
|
|
76
|
-
element: string;
|
|
77
|
-
right: number;
|
|
78
|
-
}>;
|
|
79
|
-
}
|
|
80
|
-
export interface ClippedSvgFinding {
|
|
81
|
-
element: string;
|
|
82
|
-
/** How far drawn content extends past the SVG viewport, per side. */
|
|
83
|
-
overflow: {
|
|
84
|
-
top: number;
|
|
85
|
-
right: number;
|
|
86
|
-
bottom: number;
|
|
87
|
-
left: number;
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
export interface CspViolation {
|
|
91
|
-
directive: string;
|
|
92
|
-
blocked: string;
|
|
93
|
-
}
|
|
94
|
-
export interface VerifyRun {
|
|
95
|
-
width: number;
|
|
96
|
-
theme: VerifyTheme;
|
|
97
|
-
overflow: OverflowFinding | null;
|
|
98
|
-
clippedSvgs: ClippedSvgFinding[];
|
|
99
|
-
consoleErrors: string[];
|
|
100
|
-
cspViolations: CspViolation[];
|
|
101
|
-
/** Typed decks only: slides whose content runs past the canvas. */
|
|
102
|
-
slideOverflow?: SlideOverflowFinding[];
|
|
103
|
-
}
|
|
104
|
-
export interface VerifyReport {
|
|
105
|
-
ok: boolean;
|
|
106
|
-
/** Asset ids the page referenced that a local verify could not load
|
|
107
|
-
* (ADR 0023). Not a failure: verify the published artifact to check
|
|
108
|
-
* them. */
|
|
109
|
-
assetsNotLoaded?: string[];
|
|
110
|
-
/** The type checked; absent for a plain page. */
|
|
111
|
-
type?: VerifyType;
|
|
112
|
-
/** Typed decks only: the format check's issues. Hints do not fail. */
|
|
113
|
-
formatIssues?: VerifyFormatIssue[];
|
|
114
|
-
runs: VerifyRun[];
|
|
115
|
-
}
|
|
116
|
-
export declare class VerifyUnavailableError extends Error {
|
|
117
|
-
/** What was checked without a browser: a typed deck's format check. */
|
|
118
|
-
partial?: VerifyReport;
|
|
119
|
-
}
|
|
120
|
-
/** Insert the theme boot as the first child of <head> — the same stamp
|
|
121
|
-
* usercontent's inline boot script applies for an explicit theme. Like
|
|
122
|
-
* usercontent (which injects through an HTMLRewriter `head` handler), a
|
|
123
|
-
* document without a `<head>` tag gets no stamp, only the matching
|
|
124
|
-
* `prefers-color-scheme`; prepending would also push the doctype out of
|
|
125
|
-
* first place and render in quirks mode. */
|
|
126
|
-
export declare function stampTheme(html: string, theme: VerifyTheme): string;
|
|
127
|
-
/** Append a type runtime's script at the end of <body>, where usercontent
|
|
128
|
-
* puts it, or at the end of a document without one. */
|
|
129
|
-
export declare function injectRuntime(html: string, src: string): string;
|
|
130
|
-
/** Check an html artifact's one document (`index.html`). */
|
|
131
|
-
export declare function verifyHtml(html: string, options?: Omit<VerifyOptions, 'type'>): Promise<VerifyReport>;
|
|
132
|
-
/**
|
|
133
|
-
* Check a revision's files. A plain page (an html artifact's `index.html`)
|
|
134
|
-
* is rendered at 1280 and 390 px in both themes. A typed deck gets the
|
|
135
|
-
* format check, then one run per theme in which every shown slide is
|
|
136
|
-
* measured on its canvas.
|
|
137
|
-
*/
|
|
138
|
-
export declare function verifyFiles(files: Readonly<Record<string, string>>, options?: VerifyOptions): Promise<VerifyReport>;
|
|
139
|
-
/**
|
|
140
|
-
* A line of the human-readable report with the C0 and C1 control
|
|
141
|
-
* characters taken out, except line feeds and tabs. Slide ids, element
|
|
142
|
-
* descriptions, format messages and console text come from the page, and an
|
|
143
|
-
* ESC in them would reach the terminal as an escape sequence (colours, OSC 8
|
|
144
|
-
* links, cursor moves). `--json` prints the report as it is.
|
|
145
|
-
*/
|
|
146
|
-
export declare function stripControlCharacters(text: string): string;
|
|
147
|
-
/** The format check's lines, errors first, each with its level, rule code
|
|
148
|
-
* and place, then a count. */
|
|
149
|
-
export declare function formatFormatIssues(issues: VerifyFormatIssue[]): string[];
|
|
150
|
-
/** Human-readable report: one block per problem, listing the runs it hit.
|
|
151
|
-
* Control characters are taken out (`stripControlCharacters`). */
|
|
152
|
-
export declare function formatVerifyReport(report: VerifyReport): string[];
|
package/src/lib/version.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
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/`).
|
|
8
|
-
*/
|
|
9
|
-
export declare const artisCliVersion: string;
|