@astryxdesign/cli 0.7.9-canary.048476f → 0.7.9-canary.3b44b43

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.
@@ -274,11 +274,6 @@ export function topicLinks(catalog: DocsCatalog, entry: import("../../foundation
274
274
  * decides.
275
275
  * @param {unknown} topic
276
276
  * @param {{cwd?: string}} [options]
277
- * @param {DocsCatalog} [loaded] internal: a catalog the read already loaded,
278
- * so the read and every part of it share one snapshot of the project's docs
279
- * (and its memoized lowering) instead of loading the project again for each
280
- * part. It is a separate argument, never an option, so no caller of the
281
- * public `docs()` can set it
282
277
  * @returns {Promise<
283
278
  * | {kind: 'topic', catalog: DocsCatalog, entry: import('../../foundation/discovery/docs-discovery.mjs').DocsTopicEntry}
284
279
  * | {kind: 'node', catalog: DocsCatalog, tree: import('../../foundation/doc-compiler/tree.mjs').DocsTree, node: import('../../foundation/doc-compiler/tree.mjs').TreeNode}
@@ -287,7 +282,7 @@ export function topicLinks(catalog: DocsCatalog, entry: import("../../foundation
287
282
  */
288
283
  export function resolveDocsArgument(topic: unknown, { cwd }?: {
289
284
  cwd?: string;
290
- }, loaded?: DocsCatalog): Promise<{
285
+ }): Promise<{
291
286
  kind: "topic";
292
287
  catalog: DocsCatalog;
293
288
  entry: import("../../foundation/discovery/docs-discovery.mjs").DocsTopicEntry;
@@ -363,14 +358,13 @@ export function notLoaded(catalog: DocsCatalog): string;
363
358
  * and lower it for the topic readers.
364
359
  * @param {unknown} topic
365
360
  * @param {{lang?: string | null, zh?: boolean, dense?: boolean, cwd?: string}} [options]
366
- * @param {DocsCatalog} [loaded] internal, as {@link resolveDocsArgument}
367
361
  */
368
362
  export function resolveTopicDocs(topic: unknown, options?: {
369
363
  lang?: string | null;
370
364
  zh?: boolean;
371
365
  dense?: boolean;
372
366
  cwd?: string;
373
- }, loaded?: DocsCatalog): Promise<{
367
+ }): Promise<{
374
368
  catalog: DocsCatalog;
375
369
  node: import("../../foundation/doc-compiler/compile.mjs").CompiledReferenceNode;
376
370
  lang: string | null;
@@ -1721,19 +1721,14 @@ export async function topicLinks(catalog, entry) {
1721
1721
  * decides.
1722
1722
  * @param {unknown} topic
1723
1723
  * @param {{cwd?: string}} [options]
1724
- * @param {DocsCatalog} [loaded] internal: a catalog the read already loaded,
1725
- * so the read and every part of it share one snapshot of the project's docs
1726
- * (and its memoized lowering) instead of loading the project again for each
1727
- * part. It is a separate argument, never an option, so no caller of the
1728
- * public `docs()` can set it
1729
1724
  * @returns {Promise<
1730
1725
  * | {kind: 'topic', catalog: DocsCatalog, entry: import('../../foundation/discovery/docs-discovery.mjs').DocsTopicEntry}
1731
1726
  * | {kind: 'node', catalog: DocsCatalog, tree: import('../../foundation/doc-compiler/tree.mjs').DocsTree, node: import('../../foundation/doc-compiler/tree.mjs').TreeNode}
1732
1727
  * | {kind: 'unknown', catalog: DocsCatalog}
1733
1728
  * >}
1734
1729
  */
1735
- export async function resolveDocsArgument(topic, {cwd} = {}, loaded) {
1736
- const catalog = loaded ?? (await loadDocsCatalog(cwd));
1730
+ export async function resolveDocsArgument(topic, {cwd} = {}) {
1731
+ const catalog = await loadDocsCatalog(cwd);
1737
1732
  if (typeof topic !== 'string' || topic === '')
1738
1733
  return {kind: 'unknown', catalog};
1739
1734
  const tree = await projectTree(catalog);
@@ -1947,14 +1942,13 @@ export function notLoaded(catalog) {
1947
1942
  * and lower it for the topic readers.
1948
1943
  * @param {unknown} topic
1949
1944
  * @param {{lang?: string | null, zh?: boolean, dense?: boolean, cwd?: string}} [options]
1950
- * @param {DocsCatalog} [loaded] internal, as {@link resolveDocsArgument}
1951
1945
  */
1952
- export async function resolveTopicDocs(topic, options = {}, loaded) {
1946
+ export async function resolveTopicDocs(topic, options = {}) {
1953
1947
  const {lang = null, zh = false, dense = false, cwd} = options;
1954
1948
  const effectiveLang = lang || (dense ? 'dense' : zh ? 'zh' : null);
1955
1949
  // A public API caller could pass a non-string topic; it lands on the same
1956
1950
  // stable code as an unknown name rather than a raw TypeError.
1957
- const found = await resolveDocsArgument(topic, {cwd}, loaded);
1951
+ const found = await resolveDocsArgument(topic, {cwd});
1958
1952
  if (found.kind !== 'topic') {
1959
1953
  throw found.kind === 'node'
1960
1954
  ? new AstryxError(
@@ -30,17 +30,14 @@ export function section(topic: string, sectionName: string, options?: {
30
30
  * with the section its own section read returns for the query; when that
31
31
  * section's key (its `id`, else the key its title derives) is the query in
32
32
  * some guides, those guides answer first. No guide, or several, fail with ERR_UNKNOWN_SECTION, naming
33
- * the guides to read instead. Every guide is read from `catalog`, the one the
34
- * namespace read loaded, so the read loads the project once, not once per
35
- * guide below the namespace.
36
- * @param {import('../../../../foundation/discovery/docs-discovery.mjs').DocsCatalog} catalog
33
+ * the guides to read instead.
37
34
  * @param {import('../../../../foundation/doc-compiler/tree.mjs').DocsTree} tree
38
35
  * @param {import('../../../../foundation/doc-compiler/tree.mjs').TreeNode} namespace
39
36
  * @param {string} sectionName
40
37
  * @param {object} [options] as {@link section}
41
38
  * @returns {Promise<import('../../docs.type.mjs').DocsDetailSectionResponse>}
42
39
  */
43
- export function namespaceSection(catalog: import("../../../../foundation/discovery/docs-discovery.mjs").DocsCatalog, tree: import("../../../../foundation/doc-compiler/tree.mjs").DocsTree, namespace: import("../../../../foundation/doc-compiler/tree.mjs").TreeNode, sectionName: string, options?: object): Promise<import("../../docs.type.mjs").DocsDetailSectionResponse>;
40
+ export function namespaceSection(tree: import("../../../../foundation/doc-compiler/tree.mjs").DocsTree, namespace: import("../../../../foundation/doc-compiler/tree.mjs").TreeNode, sectionName: string, options?: object): Promise<import("../../docs.type.mjs").DocsDetailSectionResponse>;
44
41
  /**
45
42
  * The guide a namespace section read answers from, or null to ask. When the
46
43
  * query matches sections in several guides, the read asks the reader which
@@ -130,10 +130,7 @@ async function sectionResponse({catalog, node, lang, entry}, sections, match) {
130
130
  * with the section its own section read returns for the query; when that
131
131
  * section's key (its `id`, else the key its title derives) is the query in
132
132
  * some guides, those guides answer first. No guide, or several, fail with ERR_UNKNOWN_SECTION, naming
133
- * the guides to read instead. Every guide is read from `catalog`, the one the
134
- * namespace read loaded, so the read loads the project once, not once per
135
- * guide below the namespace.
136
- * @param {import('../../../../foundation/discovery/docs-discovery.mjs').DocsCatalog} catalog
133
+ * the guides to read instead.
137
134
  * @param {import('../../../../foundation/doc-compiler/tree.mjs').DocsTree} tree
138
135
  * @param {import('../../../../foundation/doc-compiler/tree.mjs').TreeNode} namespace
139
136
  * @param {string} sectionName
@@ -141,7 +138,6 @@ async function sectionResponse({catalog, node, lang, entry}, sections, match) {
141
138
  * @returns {Promise<import('../../docs.type.mjs').DocsDetailSectionResponse>}
142
139
  */
143
140
  export async function namespaceSection(
144
- catalog,
145
141
  tree,
146
142
  namespace,
147
143
  sectionName,
@@ -152,7 +148,7 @@ export async function namespaceSection(
152
148
  /** @type {Omit<GuideMatch, 'match'>[]} */
153
149
  const reads = [];
154
150
  for (const guide of guides) {
155
- const resolved = await resolveTopicDocs(guide.route, options, catalog);
151
+ const resolved = await resolveTopicDocs(guide.route, options);
156
152
  reads.push({guide, resolved, sections: readerSections(resolved.node)});
157
153
  }
158
154
 
package/api/docs/docs.mjs CHANGED
@@ -155,13 +155,7 @@ async function docsRead(topic, section, options = {}) {
155
155
  // A namespace answers a section read from the one guide below it that
156
156
  // has the section (spec:AST-046 FR6). A typed doc is one read.
157
157
  if (found.node.kind === 'namespace') {
158
- return namespaceSection(
159
- found.catalog,
160
- found.tree,
161
- found.node,
162
- section,
163
- options,
164
- );
158
+ return namespaceSection(found.tree, found.node, section, options);
165
159
  }
166
160
  throw new AstryxError(
167
161
  `"${found.node.route}" has no sections. Read it whole: ${formatCliCommand(`docs ${found.node.route}`)}.`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astryxdesign/cli",
3
- "version": "0.7.9-canary.048476f",
3
+ "version": "0.7.9-canary.3b44b43",
4
4
  "displayName": "CLI",
5
5
  "description": "Scaffold projects, browse templates, generate themes, and get agent-ready docs from the command line.",
6
6
  "author": "Meta Open Source",
@@ -124,10 +124,10 @@
124
124
  "zod": "^4.4.3"
125
125
  },
126
126
  "peerDependencies": {
127
- "@astryxdesign/charts": "0.7.9-canary.048476f",
128
- "@astryxdesign/core": "0.7.9-canary.048476f",
129
- "@astryxdesign/lab": "0.7.9-canary.048476f",
130
- "@astryxdesign/theme-neutral": "0.7.9-canary.048476f"
127
+ "@astryxdesign/charts": "0.7.9-canary.3b44b43",
128
+ "@astryxdesign/core": "0.7.9-canary.3b44b43",
129
+ "@astryxdesign/lab": "0.7.9-canary.3b44b43",
130
+ "@astryxdesign/theme-neutral": "0.7.9-canary.3b44b43"
131
131
  },
132
132
  "peerDependenciesMeta": {
133
133
  "@astryxdesign/charts": {
@@ -144,10 +144,10 @@
144
144
  }
145
145
  },
146
146
  "devDependencies": {
147
- "@astryxdesign/charts": "0.7.9-canary.048476f",
148
- "@astryxdesign/core": "0.7.9-canary.048476f",
149
- "@astryxdesign/lab": "0.7.9-canary.048476f",
150
- "@astryxdesign/theme-neutral": "0.7.9-canary.048476f",
147
+ "@astryxdesign/charts": "0.7.9-canary.3b44b43",
148
+ "@astryxdesign/core": "0.7.9-canary.3b44b43",
149
+ "@astryxdesign/lab": "0.7.9-canary.3b44b43",
150
+ "@astryxdesign/theme-neutral": "0.7.9-canary.3b44b43",
151
151
  "@heroicons/react": "^2.2.0",
152
152
  "@stylexjs/stylex": "^0.19.0",
153
153
  "@types/babel__core": "^7.20.5",