@parity-app/cli 0.7.0 → 0.7.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/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-x0VQ8I6l.mjs → src-CPka3fhs.mjs} +4 -4
- package/dist/{src-vUHtM2X4.mjs → src-Chy2scQg.mjs} +1 -1
- package/dist/{src-CSah1pZ-.mjs → src-Csdxx4kB.mjs} +16 -3
- package/dist/{src-D2kRGtaF.mjs → src-CzZ9eIU8.mjs} +1 -1
- package/dist/src-tY0sf-AQ.mjs +5 -0
- package/package.json +1 -1
- package/dist/src-BaOpaXkV.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,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 { D as collectCustomProperties, M as lengthToPixels, N as packageManifest, c as isMadeValue, d as libraryManifestExtension, h as renderSlotOf, l as isSampleElement, m as parseLibraryManifest, o as applyLibraryEdits, p as parseLibraryEdits, u as isSampleRender } from "./src-Csdxx4kB.mjs";
|
|
3
|
+
import { r as readLibraryEdits, s as parseJsonc } from "./src-CzZ9eIU8.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 +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-CzZ9eIU8.mjs";
|
|
@@ -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());
|
|
@@ -1192,6 +1192,16 @@ function expectStringRecord(value, path) {
|
|
|
1192
1192
|
for (const [key, item] of Object.entries(record)) expectString(item, `${path}/${key}`);
|
|
1193
1193
|
return record;
|
|
1194
1194
|
}
|
|
1195
|
+
// ../core/src/project.ts
|
|
1196
|
+
/**
|
|
1197
|
+
* Props that say what's open or chosen: `defaultOpen` on what opens (a dialog, a popover, a menu), `defaultValue` on
|
|
1198
|
+
* what opens or chooses its items by value (an accordion, a navigation menu, tabs) and `value` on those items.
|
|
1199
|
+
*/
|
|
1200
|
+
const openProps = [
|
|
1201
|
+
"defaultOpen",
|
|
1202
|
+
"defaultValue",
|
|
1203
|
+
"value"
|
|
1204
|
+
];
|
|
1195
1205
|
// ../core/src/library-insert.ts
|
|
1196
1206
|
/** Nodes whose `children` is the name `componentNode` gave them, rather than text someone set. */
|
|
1197
1207
|
const named = /* @__PURE__ */ new WeakSet();
|
|
@@ -1408,6 +1418,8 @@ function elementProps(props) {
|
|
|
1408
1418
|
* Discovery has already rewritten module imports for the name the project installed the package under.
|
|
1409
1419
|
*/
|
|
1410
1420
|
function librarySource(library, name, component, path) {
|
|
1421
|
+
const declared = new Set(Object.keys(component.props ?? {}).map((prop) => prop.replace(/\?$/, "")));
|
|
1422
|
+
const open = openProps.filter((prop) => declared.has(prop));
|
|
1411
1423
|
return {
|
|
1412
1424
|
path,
|
|
1413
1425
|
export: name,
|
|
@@ -1419,7 +1431,8 @@ function librarySource(library, name, component, path) {
|
|
|
1419
1431
|
...component.visual === false ? { visual: false } : {},
|
|
1420
1432
|
...component.optionalParents ? { optionalParents: component.optionalParents.map((parent) => `${library}/${parent}`) } : {},
|
|
1421
1433
|
...component.parentParts ? { parentParts: true } : {},
|
|
1422
|
-
...component.sample ? { sample: sampleIds(component.sample, library) } : {}
|
|
1434
|
+
...component.sample ? { sample: sampleIds(component.sample, library) } : {},
|
|
1435
|
+
...open.length > 0 ? { openProps: open } : {}
|
|
1423
1436
|
};
|
|
1424
1437
|
}
|
|
1425
1438
|
/**
|
|
@@ -1454,4 +1467,4 @@ function sampleIds(sample, library) {
|
|
|
1454
1467
|
...sample.children ? { children: sample.children.map(child) } : {}
|
|
1455
1468
|
};
|
|
1456
1469
|
}
|
|
1457
|
-
export {
|
|
1470
|
+
export { viewportWidthProperty as A, parseCanvasDocument as C, collectCustomProperties as D, modeSettings as E, lengthToPixels as M, packageManifest as N, remProperty as O, paramTypes as S, generateId as T, containerKinds as _, openProps as a, linkEndKinds as b, isMadeValue as c, libraryManifestExtension as d, parentSignals as f, canvasObjectKinds as g, renderSlotOf as h, withLibraryContext as i, deviceKinds as j, viewportHeightProperty 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, imageFits as v, walkNodes as w, linkTypes as x, linkAllowed as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as libraryManifestExtension, m as parseLibraryManifest, o as applyLibraryEdits, p as parseLibraryEdits } from "./src-Csdxx4kB.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";
|
package/package.json
CHANGED
package/dist/src-BaOpaXkV.mjs
DELETED