@parity-app/cli 0.7.1 → 0.7.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/dist/bin.mjs +214 -1098
- package/dist/{client-D5kbiMmn.mjs → client-BtxrNeIk.mjs} +638 -13
- package/dist/index.d.mts +754 -380
- package/dist/index.mjs +1 -1
- package/dist/{schema-DcQLoUPP.mjs → schema-CemdtCeF.mjs} +19 -4
- package/dist/{src-C6QQltHZ.mjs → src-B9VW36v9.mjs} +1 -1
- package/dist/{src-DM51TWZ6.mjs → src-Bf12xdm5.mjs} +4 -4
- package/dist/{src-IWA2JHPw.mjs → src-DjSCuWcT.mjs} +3 -2
- package/dist/{src-B5sEtTw_.mjs → src-Q382DbAK.mjs} +1 -1
- package/dist/src-ok4hEd7p.mjs +5 -0
- package/package.json +1 -1
- package/skills/execute.md +14 -0
- package/dist/src-_5ETJOb0.mjs +0 -4
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as call, n as describeAccessibility, r as describeComponents, i as describeConsole, a as describeExec, o as describeModes, s as describeProblems, c as describeProps, l as describeStatus, u as describeTokens, d as registry, f as setCaller } from "./client-
|
|
1
|
+
export { t as call, n as describeAccessibility, r as describeComponents, i as describeConsole, a as describeExec, o as describeModes, s as describeProblems, c as describeProps, l as describeStatus, u as describeTokens, d as registry, f as setCaller } from "./client-BtxrNeIk.mjs";
|
|
@@ -135,11 +135,26 @@ function jsonText(schema) {
|
|
|
135
135
|
* problem as `/json/pointer: message`. `at` is where the value sits in a larger one, so its pointers start there.
|
|
136
136
|
*/
|
|
137
137
|
function parseData(schema, value, at = "") {
|
|
138
|
-
const
|
|
139
|
-
if (
|
|
140
|
-
const { pointer, message } =
|
|
138
|
+
const checked = checkData(schema, value, at);
|
|
139
|
+
if (checked.success) return checked.data;
|
|
140
|
+
const { pointer, message } = checked.problem;
|
|
141
141
|
throw new TypeError(`${pointer || "/"}: ${message}`);
|
|
142
142
|
}
|
|
143
|
+
/**
|
|
144
|
+
* Checks data Parity didn't make, as `parseData` does, and returns the first problem rather than throwing it, for a
|
|
145
|
+
* caller that reports it its own way: the CLI keeps the pointer out of its messages, since each names its field.
|
|
146
|
+
*/
|
|
147
|
+
function checkData(schema, value, at = "") {
|
|
148
|
+
const result = schema.safeParse(value, { error: issueText });
|
|
149
|
+
if (result.success) return {
|
|
150
|
+
success: true,
|
|
151
|
+
data: result.data
|
|
152
|
+
};
|
|
153
|
+
return {
|
|
154
|
+
success: false,
|
|
155
|
+
problem: firstProblem(result.error.issues, at)
|
|
156
|
+
};
|
|
157
|
+
}
|
|
143
158
|
/** A path inside a value as a JSON pointer (RFC 6901): `/edits/0/find`, or `` for the value itself. */
|
|
144
159
|
function jsonPointer(path) {
|
|
145
160
|
return path.map((key) => `/${String(key).replaceAll("~", "~0").replaceAll("/", "~1")}`).join("");
|
|
@@ -236,4 +251,4 @@ function bound(inclusiveWords, exclusiveWords, origin, limit, inclusive = true)
|
|
|
236
251
|
"bigint"
|
|
237
252
|
].includes(origin) ? `expected ${words} ${limit}` : void 0;
|
|
238
253
|
}
|
|
239
|
-
export {
|
|
254
|
+
export { nonBlankString as a, CodedError as c, errorDetails as d, readErrorDetails as f, jsonText as i, closest as l, fileObject as n, parseData as o, unknownReference as p, finiteNumber as r, plainObject as s, checkData as t, errorCodes as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as libraryManifestExtension, m as parseLibraryManifest, o as applyLibraryEdits, p as parseLibraryEdits } from "./src-
|
|
1
|
+
import { d as libraryManifestExtension, m as parseLibraryManifest, o as applyLibraryEdits, p as parseLibraryEdits } from "./src-DjSCuWcT.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { readFile, readdir } from "node:fs/promises";
|
|
4
4
|
import { dirname, join, resolve } from "node:path";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { r as readLibraryEdits, s as parseJsonc } from "./src-
|
|
1
|
+
import { i as jsonText, o as parseData, r as finiteNumber, s as plainObject } from "./schema-CemdtCeF.mjs";
|
|
2
|
+
import { F as packageManifest, P as lengthToPixels, c as isMadeValue, d as libraryManifestExtension, h as renderSlotOf, k as collectCustomProperties, l as isSampleElement, m as parseLibraryManifest, o as applyLibraryEdits, p as parseLibraryEdits, u as isSampleRender } from "./src-DjSCuWcT.mjs";
|
|
3
|
+
import { r as readLibraryEdits, s as parseJsonc } from "./src-B9VW36v9.mjs";
|
|
4
4
|
import { a as publishedVersions, n as packageFile, o as repositoryFiles, r as publishedSource } from "./published-CdXoUgfD.mjs";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import { mkdir, readFile, readdir, realpath, rm, stat, writeFile } from "node:fs/promises";
|
|
7
7
|
import { basename, dirname, extname, join, posix, relative, resolve, sep } from "node:path";
|
|
8
8
|
import { promisify } from "node:util";
|
|
9
|
+
import { z } from "zod";
|
|
9
10
|
import { createHash } from "node:crypto";
|
|
10
11
|
import { existsSync, realpathSync, statSync } from "node:fs";
|
|
11
12
|
import { homedir } from "node:os";
|
|
12
|
-
import { z } from "zod";
|
|
13
13
|
import { pathToFileURL } from "node:url";
|
|
14
14
|
import ts from "typescript";
|
|
15
15
|
import "semver";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as fileObject, o as parseData, r as finiteNumber, s as plainObject } from "./schema-CemdtCeF.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
// ../core/src/adapters.ts
|
|
4
4
|
const packageVersions = z.record(z.string(), z.string());
|
|
@@ -733,6 +733,7 @@ function problem(context, path, message) {
|
|
|
733
733
|
path
|
|
734
734
|
});
|
|
735
735
|
}
|
|
736
|
+
/** A project file's schema, which the project service also checks a saved document with (PAR-565). */
|
|
736
737
|
const canvasDocument = fileObject({
|
|
737
738
|
version: z.literal(3),
|
|
738
739
|
containers: z.array(containerSpec),
|
|
@@ -1467,4 +1468,4 @@ function sampleIds(sample, library) {
|
|
|
1467
1468
|
...sample.children ? { children: sample.children.map(child) } : {}
|
|
1468
1469
|
};
|
|
1469
1470
|
}
|
|
1470
|
-
export {
|
|
1471
|
+
export { remProperty as A, linkTypes as C, generateId as D, walkNodes as E, packageManifest as F, viewportWidthProperty as M, deviceKinds as N, modeSettings as O, lengthToPixels as P, linkEndKinds as S, parseCanvasDocument as T, canvasObjectKinds as _, openProps as a, imageFits as b, isMadeValue as c, libraryManifestExtension as d, parentSignals as f, canvasDocument as g, renderSlotOf as h, withLibraryContext as i, viewportHeightProperty as j, collectCustomProperties as k, isSampleElement as l, parseLibraryManifest as m, librarySource as n, applyLibraryEdits as o, parseLibraryEdits as p, sampleIds as r, componentEvidence as s, componentNode as t, isSampleRender as u, containerKinds as v, paramTypes as w, linkAllowed as x, detectionCorrections as y };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as covers, n as newestEntries, i as registryDir, a as registryEntries } from "./src-
|
|
1
|
+
export { t as covers, n as newestEntries, i as registryDir, a as registryEntries } from "./src-B9VW36v9.mjs";
|
package/package.json
CHANGED
package/skills/execute.md
CHANGED
|
@@ -403,6 +403,20 @@ theme, or `SetTokens({ primary: { default: "…", dark: "…" } })` per theme. E
|
|
|
403
403
|
saving writes them into the project's code, so do it only when the person asks to change the design system, not to style
|
|
404
404
|
one design. They're undone with the call's other changes.
|
|
405
405
|
|
|
406
|
+
`SetTokens` refuses a value the Tokens panel would refuse, throwing an `invalid_input` error that names the token and
|
|
407
|
+
theme and says what's wrong: a bracket or quote left open, a `var()` naming no token, or a token built on itself. None
|
|
408
|
+
of that call's values are kept. A value that isn't its token's kind (`"bluish"` for a color) is refused when the call
|
|
409
|
+
ends, and then nothing in the call is applied.
|
|
410
|
+
|
|
411
|
+
```js
|
|
412
|
+
SetTokens({ primary: { default: "oklch(0.55 0.2 260)", dark: "var(--foreground)" } })
|
|
413
|
+
try {
|
|
414
|
+
SetTokens({ primary: "oklch(0.55 0.2 260" })
|
|
415
|
+
} catch (error) {
|
|
416
|
+
Print(error.message) // SetTokens/primary/default: A bracket isn't closed. Add ) at the end.
|
|
417
|
+
}
|
|
418
|
+
```
|
|
419
|
+
|
|
406
420
|
## Checking
|
|
407
421
|
|
|
408
422
|
`Screenshot` renders frames offscreen at their real widths and returns how many it took; the images come back with the
|
package/dist/src-_5ETJOb0.mjs
DELETED