@parity-app/cli 0.7.0 → 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
@@ -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-BaOpaXkV.mjs");
391
- const { newestEntries, registryDir } = await import("./src-vUHtM2X4.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-x0VQ8I6l.mjs");
515
- const { covers, registryDir, registryEntries } = await import("./src-vUHtM2X4.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-x0VQ8I6l.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;
@@ -1 +1 @@
1
- export { t as covers, n as newestEntries, i as registryDir, a as registryEntries } from "./src-D2kRGtaF.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-CSah1pZ-.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
1
  import { a as parseData, n as finiteNumber, o as plainObject, r as jsonText } from "./schema-DcQLoUPP.mjs";
2
- import { E 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-CSah1pZ-.mjs";
3
- import { r as readLibraryEdits, s as parseJsonc } from "./src-D2kRGtaF.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";
@@ -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 { deviceKinds as A, walkNodes as C, remProperty as D, collectCustomProperties as E, packageManifest as M, viewportHeightProperty as O, parseCanvasDocument as S, modeSettings as T, imageFits as _, applyLibraryEdits as a, linkTypes as b, isSampleElement as c, parentSignals as d, parseLibraryEdits as f, containerKinds as g, canvasObjectKinds as h, withLibraryContext as i, lengthToPixels as j, viewportWidthProperty as k, isSampleRender as l, renderSlotOf as m, librarySource as n, componentEvidence as o, parseLibraryManifest as p, sampleIds as r, isMadeValue as s, componentNode as t, libraryManifestExtension as u, linkAllowed as v, generateId as w, paramTypes as x, linkEndKinds as y };
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 };
@@ -0,0 +1,4 @@
1
+ import "./schema-DcQLoUPP.mjs";
2
+ export { t as componentNode, T as generateId, n as librarySource, i as withLibraryContext } from "./src-IWA2JHPw.mjs";
3
+ import "./src-C6QQltHZ.mjs";
4
+ import "./src-DM51TWZ6.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parity-app/cli",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Drive the Parity app from a terminal or an agent: read state, run edits, take screenshots, serve MCP.",
@@ -1,4 +0,0 @@
1
- import "./schema-DcQLoUPP.mjs";
2
- export { t as componentNode, w as generateId, n as librarySource, i as withLibraryContext } from "./src-CSah1pZ-.mjs";
3
- import "./src-D2kRGtaF.mjs";
4
- import "./src-x0VQ8I6l.mjs";