@parity-app/cli 0.6.3 → 0.7.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { c as errorCodes, l as errorDetails, o as CodedError, s as closest, u as readErrorDetails } from "./schema-CiVy9tZT.mjs";
3
- import { a as describeExec, c as describeProps, f as setCaller, i as describeConsole, l as describeStatus, n as describeAccessibility, o as describeModes, p as mcpCallerName, r as describeComponents, s as describeProblems, t as call, u as describeTokens } from "./client-C4An81o9.mjs";
2
+ import { c as closest, d as readErrorDetails, l as errorCodes, s as CodedError, u as errorDetails } from "./schema-DcQLoUPP.mjs";
3
+ import { a as describeExec, c as describeProps, f as setCaller, i as describeConsole, l as describeStatus, n as describeAccessibility, o as describeModes, p as mcpCallerName, r as describeComponents, s as describeProblems, t as call, u as describeTokens } from "./client-D5kbiMmn.mjs";
4
4
  import { mkdir, readFile, readdir, writeFile } from "node:fs/promises";
5
5
  import { dirname, join, normalize, relative, resolve, sep } from "node:path";
6
6
  import { parseArgs } from "node:util";
@@ -387,8 +387,8 @@ const executeOperation = {
387
387
  */
388
388
  async function runCheck(library, options) {
389
389
  if (!library) throw new Error("parity lib check <library> [--tab t] [--mode m]");
390
- const { componentNode, generateId, librarySource, withLibraryContext } = await import("./src-AKjejfTT.mjs");
391
- const { newestEntries, registryDir } = await import("./src-B40wy5fK.mjs");
390
+ const { componentNode, generateId, librarySource, withLibraryContext } = await import("./src-_5ETJOb0.mjs");
391
+ const { newestEntries, registryDir } = await import("./src-B5sEtTw_.mjs");
392
392
  const entry = (await newestEntries()).find((item) => item.manifest.id === library);
393
393
  if (!entry) throw new Error(`The registry has no library "${library}"`);
394
394
  const list = entry.manifest.components?.list ?? {};
@@ -511,8 +511,8 @@ function describeCheck(report) {
511
511
  * because it reads the project's files and its own copy of TypeScript.
512
512
  */
513
513
  async function runLib(packageName, options) {
514
- const { appManifestPath, generateLibrary, manifestText, mergeManifest, reviseLibrary } = await import("./src-C5-HaJcA.mjs");
515
- const { covers, registryDir, registryEntries } = await import("./src-B40wy5fK.mjs");
514
+ const { appManifestPath, generateLibrary, manifestText, mergeManifest, reviseLibrary } = await import("./src-DM51TWZ6.mjs");
515
+ const { covers, registryDir, registryEntries } = await import("./src-B5sEtTw_.mjs");
516
516
  const spec = packageName === void 0 ? void 0 : packageSpec(packageName);
517
517
  let root = resolve(options.root ?? ".");
518
518
  if (spec && (spec.version !== void 0 || options.registry && !options.root)) {
@@ -523,7 +523,7 @@ async function runLib(packageName, options) {
523
523
  console.error(`Installing ${spec.name} ${version} on its own…`);
524
524
  root = await installedVersion(spec.name, version);
525
525
  }
526
- const { parseLibraryEdits } = await import("./src-C5-HaJcA.mjs");
526
+ const { parseLibraryEdits } = await import("./src-DM51TWZ6.mjs");
527
527
  const trialEdits = options.edits ? parseLibraryEdits(JSON.parse(await readFile(resolve(options.edits), "utf8"))) : void 0;
528
528
  const recordedId = options.registry && spec ? options.id ?? (await registryEntries()).find((entry) => entry.manifest.package?.name === spec.name)?.manifest.id : void 0;
529
529
  const appErrors = recordedId ? await readAppErrors(registryDir(), recordedId) : void 0;
@@ -943,11 +943,15 @@ const stateSchema = object({
943
943
  },
944
944
  modes: {
945
945
  type: "array",
946
+ description: "The project's modes, primary first.",
946
947
  items: object({
947
948
  id: string,
948
949
  name: string,
949
950
  width: { type: "number" },
950
- primary: boolean_
951
+ primary: {
952
+ ...boolean_,
953
+ description: "The project's first mode: every design's main frame unless it picks another. Only one is."
954
+ }
951
955
  })
952
956
  },
953
957
  components: strings,
@@ -1,4 +1,4 @@
1
- import { d as unknownReference, n as jsonText, o as CodedError, r as nonBlankString, u as readErrorDetails } from "./schema-CiVy9tZT.mjs";
1
+ import { d as readErrorDetails, f as unknownReference, i as nonBlankString, r as jsonText, s as CodedError } from "./schema-DcQLoUPP.mjs";
2
2
  import { join } from "node:path";
3
3
  import { randomUUID } from "node:crypto";
4
4
  import { readFileSync, readdirSync, realpathSync, rmSync } from "node:fs";
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-C4An81o9.mjs";
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-D5kbiMmn.mjs";
@@ -104,6 +104,18 @@ const plainObject = z.record(z.string(), z.unknown());
104
104
  const nonBlankString = z.string().trim().min(1, "can't be blank");
105
105
  /** A number other than NaN or ±Infinity, which zod 4 refuses on its own. */
106
106
  const finiteNumber = z.number();
107
+ /**
108
+ * An object in a file Parity owns, such as a `.par`. A key it doesn't know is an error, and a key set to `undefined` is
109
+ * left out, as JSON leaves it out, so what the window saves from memory reads as it would from the file.
110
+ */
111
+ function fileObject(shape) {
112
+ return z.strictObject(shape).overwrite(withoutUnset);
113
+ }
114
+ /** Zod's own copy of an object, without the keys whose values are `undefined`. */
115
+ function withoutUnset(value) {
116
+ for (const [key, entry] of Object.entries(value)) if (entry === void 0) Reflect.deleteProperty(value, key);
117
+ return value;
118
+ }
107
119
  /** JSON text holding what `schema` checks. Text that isn't JSON fails as `expected JSON`. */
108
120
  function jsonText(schema) {
109
121
  return z.string().transform((text, context) => {
@@ -224,4 +236,4 @@ function bound(inclusiveWords, exclusiveWords, origin, limit, inclusive = true)
224
236
  "bigint"
225
237
  ].includes(origin) ? `expected ${words} ${limit}` : void 0;
226
238
  }
227
- export { plainObject as a, errorCodes as c, unknownReference as d, parseData as i, errorDetails as l, jsonText as n, CodedError as o, nonBlankString as r, closest as s, finiteNumber as t, readErrorDetails as u };
239
+ export { parseData as a, closest as c, readErrorDetails as d, unknownReference as f, nonBlankString as i, errorCodes as l, finiteNumber as n, plainObject as o, jsonText as r, CodedError as s, fileObject as t, errorDetails as u };
@@ -1 +1 @@
1
- export { t as covers, n as newestEntries, i as registryDir, a as registryEntries } from "./src-DzU4U2rh.mjs";
1
+ export { t as covers, n as newestEntries, i as registryDir, a as registryEntries } from "./src-C6QQltHZ.mjs";
@@ -1,4 +1,4 @@
1
- import { a as applyLibraryEdits, f as parseLibraryEdits, p as parseLibraryManifest, u as libraryManifestExtension } from "./src-YQY8r4mh.mjs";
1
+ import { d as libraryManifestExtension, m as parseLibraryManifest, o as applyLibraryEdits, p as parseLibraryEdits } from "./src-IWA2JHPw.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,6 +1,6 @@
1
- import { a as plainObject, i as parseData, n as jsonText, t as finiteNumber } from "./schema-CiVy9tZT.mjs";
2
- import { D as collectCustomProperties, M as packageManifest, a as applyLibraryEdits, c as isSampleElement, f as parseLibraryEdits, j as lengthToPixels, l as isSampleRender, m as renderSlotOf, p as parseLibraryManifest, s as isMadeValue, u as libraryManifestExtension } from "./src-YQY8r4mh.mjs";
3
- import { r as readLibraryEdits, s as parseJsonc } from "./src-DzU4U2rh.mjs";
1
+ import { a as parseData, n as finiteNumber, o as plainObject, r as jsonText } from "./schema-DcQLoUPP.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-IWA2JHPw.mjs";
3
+ import { r as readLibraryEdits, s as parseJsonc } from "./src-C6QQltHZ.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";