@astryxdesign/cli 0.7.2-canary.64e1dde → 0.7.2-canary.6c792d8

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.
Files changed (71) hide show
  1. package/README.md +62 -62
  2. package/api/component/_adapter.d.mts +31 -0
  3. package/api/component/_adapter.mjs +116 -0
  4. package/api/component/component.mjs +60 -10
  5. package/api/component/doc-links.test.mjs +386 -0
  6. package/api/discover/detail/doc/doc.mjs +9 -1
  7. package/api/docs/_adapter.d.mts +63 -0
  8. package/api/docs/_adapter.mjs +309 -16
  9. package/api/docs/integration-tree.test.mjs +22 -0
  10. package/api/docs/list/list.mjs +12 -2
  11. package/api/integration/_adapter.d.mts +23 -0
  12. package/api/integration/_adapter.mjs +45 -0
  13. package/api/integration/authoring-checks.mjs +87 -3
  14. package/api/integration/authoring-checks.test.mjs +443 -0
  15. package/api/integration/authoring-checks.type.d.mts +84 -0
  16. package/api/integration/authoring-checks.type.mjs +40 -1
  17. package/api/integration/integrationComponentConflicts.doc.mjs +3 -1
  18. package/api/integration/integrationDocConflicts.doc.mjs +7 -2
  19. package/api/integration/pack-check.mjs +4 -0
  20. package/api/integration/pack-check.test.mjs +26 -0
  21. package/api/integration/validate-integration-fixes.test.mjs +67 -0
  22. package/api/integration/validate-integration.mjs +28 -3
  23. package/api/integration/validate-integration.test.mjs +77 -8
  24. package/api/integration/validateIntegration.doc.mjs +1 -1
  25. package/api/search/search.mjs +2 -1
  26. package/assets/docs/browser-support.doc.mjs +1 -1
  27. package/assets/docs/tree/add-a-topic.doc.mjs +2 -2
  28. package/assets/docs/tree/check-the-props.doc.mjs +5 -0
  29. package/assets/docs/tree/check-your-docs.doc.mjs +10 -2
  30. package/assets/docs/tree/checks.doc.mjs +4 -4
  31. package/assets/docs/tree/debug-and-gap-reports.doc.mjs +7 -7
  32. package/assets/docs/tree/document-the-theme.doc.mjs +2 -2
  33. package/assets/docs/tree/publishing.doc.mjs +2 -2
  34. package/assets/docs/tree/sections-and-placement.doc.mjs +2 -2
  35. package/authoring/doctypes/component/type.ts +8 -0
  36. package/authoring/doctypes/hook/type.ts +4 -0
  37. package/clients/cli/commands/doctor-integration-components.doc.mjs +3 -2
  38. package/clients/cli/commands/doctor-integration-docs.doc.mjs +3 -1
  39. package/clients/cli/commands/doctor-integration.test.mjs +48 -1
  40. package/clients/cli/commands/doctor.mjs +60 -5
  41. package/clients/cli/commands/integration-authoring.test.mjs +46 -0
  42. package/clients/cli/commands/integration-check.test.mjs +79 -0
  43. package/clients/cli/commands/integration.mjs +10 -4
  44. package/foundation/discovery/copied-passages.d.mts +8 -0
  45. package/foundation/discovery/copied-passages.mjs +2 -2
  46. package/foundation/discovery/doc-consistency.d.mts +34 -0
  47. package/foundation/discovery/doc-consistency.mjs +513 -0
  48. package/foundation/discovery/doc-consistency.test.mjs +347 -0
  49. package/foundation/discovery/doc-fluff.d.mts +112 -0
  50. package/foundation/discovery/doc-fluff.mjs +328 -0
  51. package/foundation/discovery/doc-fluff.test.mjs +142 -0
  52. package/foundation/discovery/doc-types.mjs +12 -5
  53. package/foundation/discovery/doc-types.test.mjs +46 -2
  54. package/foundation/discovery/prop-drift.d.mts +25 -6
  55. package/foundation/discovery/prop-drift.mjs +171 -6
  56. package/foundation/discovery/prop-drift.test.mjs +65 -0
  57. package/foundation/discovery/stray-pointers.d.mts +52 -0
  58. package/foundation/discovery/stray-pointers.mjs +293 -0
  59. package/foundation/discovery/stray-pointers.test.mjs +86 -0
  60. package/foundation/doc-compiler/doc-loads.test.mjs +12 -0
  61. package/foundation/doc-compiler/links.d.mts +32 -0
  62. package/foundation/doc-compiler/links.mjs +163 -26
  63. package/foundation/doc-compiler/links.test.mjs +97 -4
  64. package/foundation/doc-compiler/tree.mjs +30 -1
  65. package/foundation/doc-compiler/tree.test.mjs +7 -0
  66. package/foundation/integrations/contribution-inventory.d.mts +11 -0
  67. package/foundation/integrations/contribution-inventory.mjs +50 -2
  68. package/foundation/integrations/issue.ts +6 -0
  69. package/foundation/integrations/validate-contributions.mjs +30 -1
  70. package/foundation/response/response-types.doc.mjs +4 -4
  71. package/package.json +9 -9
@@ -24,7 +24,10 @@
24
24
  import * as fs from 'node:fs';
25
25
  import * as path from 'node:path';
26
26
  import {isValidSemver} from '../env/semver.mjs';
27
- import {findSourceOnlyCandidates} from './contribution-inventory.mjs';
27
+ import {
28
+ findSourceOnlyCandidates,
29
+ findTemplateSourceOnlyCandidates,
30
+ } from './contribution-inventory.mjs';
28
31
  import {
29
32
  CODEMOD_FILE_RE,
30
33
  CODEMOD_SKIP_DIRS,
@@ -295,6 +298,32 @@ async function checkTemplates(integration, issues) {
295
298
  issueError('invalid_template', /** @type {any} */ (err).message),
296
299
  );
297
300
  }
301
+ checkTemplateSourcesWithoutDoc(integration, issues);
302
+ }
303
+
304
+ /**
305
+ * Warn about a `.tsx` directly in the templates root with no same-stem template
306
+ * metadata: template discovery pairs sources with docs, so `astryx template`
307
+ * never lists it. A PascalCase file directly in a shared components root is
308
+ * left to the component check, which already warns about it.
309
+ * @param {LoadedIntegration} integration loaded-integration-shaped object
310
+ * @param {Issue[]} issues
311
+ */
312
+ function checkTemplateSourcesWithoutDoc(integration, issues) {
313
+ const root = /** @type {string} */ (integration.templates);
314
+ const sharedComponents =
315
+ integration.components != null &&
316
+ path.resolve(integration.components) === path.resolve(root);
317
+ for (const file of findTemplateSourceOnlyCandidates(root)) {
318
+ if (sharedComponents && /^[A-Z]/u.test(file)) continue;
319
+ const stem = file.slice(0, -'.tsx'.length);
320
+ issues.push(
321
+ issueWarning(
322
+ 'source_without_template_doc',
323
+ `Template source "${file}" has no same-stem metadata file ${stem}.doc.mjs, so \`astryx template\` never lists it. Fix: add ${stem}.doc.mjs beside it with type: 'page' or 'block'; \`astryx docs authoring integration-template-doc\` lists its fields. If it is not a template, move it out of the templates root.`,
324
+ ),
325
+ );
326
+ }
298
327
  }
299
328
 
300
329
  /**
@@ -328,12 +328,12 @@ export const doc = {
328
328
  {
329
329
  value: 'integration.pack-check',
330
330
  description:
331
- 'The packed-package check: name, version, packable, tarball {filename, fileCount, size, unpackedSize} or null, inventory {manifest, roots [{kind, path, expectedFiles, missingFiles, complete}], expectedFiles, packedFiles}, contributions {local, packed}, each null or {themes [{slug, exportName}], components, templates [{id, type, name}], codemods [{version, id}], docs, agentDocsAppend}, and issues [{code, severity, message}].',
331
+ 'The packed-package check: name, version, packable, tarball {filename, fileCount, size, unpackedSize} or null, inventory {manifest, roots [{kind, path, expectedFiles, missingFiles, complete}], expectedFiles, packedFiles}, contributions {local, packed}, each null or {themes [{slug, exportName}], components, templates [{id, type, name}], codemods [{version, id}], docs, agentDocsAppend}, and issues [{code, severity, message, fix?, file?, line?}] (the issues validation finds in the source and, prefixed packed_, in the packed tree, with the fix and the place when the check knows them).',
332
332
  },
333
333
  {
334
334
  value: 'integration.validate',
335
335
  description:
336
- 'The validation result: validated (false when nothing was validated: with no package.json the issues list carries one no_package error so the command exits 1, and with a package.json but no integration manifest the issues list is empty and proves nothing), the package name and version (both null when validated is false) plus issues, an AstryxIntegrationIssue[] of {code, severity: warning | error, message}. When the manifest loads, docTypes checks each doc against its published authoring type: status (checked | skipped), reason, typescript, docs, findings (all warnings, each naming the field and a fix), unchecked, and fixtures (test fixture docs not checked).',
336
+ 'The validation result: validated (false when nothing was validated: with no package.json the issues list carries one no_package error so the command exits 1, and with a package.json but no integration manifest the issues list is empty and proves nothing), the package name and version (both null when validated is false) plus issues, an AstryxIntegrationIssue[] of {code, severity: warning | error, message, fix?, file?, line?} (fix: the change that resolves it; file and line: where, relative to the package). When the manifest loads, docTypes checks each doc against its published authoring type: status (checked | skipped), reason, typescript, docs, findings (all warnings, each naming the field and a fix), unchecked, and fixtures (test fixture docs not checked).',
337
337
  },
338
338
  {
339
339
  value: 'integration.template-conflicts',
@@ -343,12 +343,12 @@ export const doc = {
343
343
  {
344
344
  value: 'integration.component-conflicts',
345
345
  description:
346
- 'validated (false when no integration manifest was found, so nothing was inspected), the integration identity, structural issues, and non-blocking conflicts where an integration component name is also owned by Core; each conflict includes the exact package-qualified command. When the manifest loads and declares a components root, propDrift compares documented props with the TypeScript props: status (checked | skipped), reason, typescript, components, typesCompared, typesSkipped, findings (all warnings), unchecked, typesNotCompared, and propsNotChecked.',
346
+ 'validated (false when no integration manifest was found, so nothing was inspected), the integration identity, structural issues, and non-blocking conflicts where an integration component name is also owned by Core; each conflict includes the exact package-qualified command. When the manifest loads and declares a components root, propDrift compares documented props with the TypeScript props: status (checked | skipped), reason, typescript, components, typesCompared, typesSkipped, findings (all warnings; a default_mismatch carries docDefault, codeDefault, and a fix), unchecked, typesNotCompared, and propsNotChecked.',
347
347
  },
348
348
  {
349
349
  value: 'integration.doc-conflicts',
350
350
  description:
351
- 'validated (false when no integration manifest was found, so nothing was inspected), the integration identity, structural issues, and Core doc overlaps. Each finding includes `severity` (`info` | `error`) and `relationship` (`replaces` | `extends` | `accidental`). copiedPassages lists each pair of topics that repeat 10 or more words of prose word for word: topic, section, otherTopic, otherOwner (package | core), words, passages, owner (the topic that should keep the text), text (the passage as the topic writes it), line (where the copy starts in the topic to change, or null), and message (the exact replacement); each is also a copied_passage warning in issues.',
351
+ 'validated (false when no integration manifest was found, so nothing was inspected), the integration identity, structural issues, and Core doc overlaps. Each finding includes `severity` (`info` | `error`) and `relationship` (`replaces` | `extends` | `accidental`). copiedPassages lists each pair of topics that repeat 10 or more words of prose word for word: topic, section, otherTopic, otherOwner (package | core), words, passages, owner (the topic that should keep the text), text (the passage as the topic writes it), line (where the copy starts in the topic to change, or null), and message (the exact replacement); each is also a copied_passage warning in issues. fluff lists padding phrases and low-density topics: topic, kind (phrase | density), phrase, section, file (relative to the package root), line, density, and message (what to cut or write instead); each is also a doc_fluff warning in issues. strayPointers lists each code span that is exactly `astryx docs <name>` for a doc that exists, in the prose, description or summary of a topic or the text fields of a component doc: topic (the topic or component doc), kind (topic | component), section, field (the field outside any section, such as description or usage.bestPractices[0].description, else null), file (relative to the package root), line, pointer (the written command), link (the {@link} that replaces it), and message; each is also a stray_doc_pointer warning in issues.',
352
352
  },
353
353
  {
354
354
  value: 'integration.check',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astryxdesign/cli",
3
- "version": "0.7.2-canary.64e1dde",
3
+ "version": "0.7.2-canary.6c792d8",
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",
@@ -101,10 +101,10 @@
101
101
  "zod": "^4.4.3"
102
102
  },
103
103
  "peerDependencies": {
104
- "@astryxdesign/charts": "0.7.2-canary.64e1dde",
105
- "@astryxdesign/core": "0.7.2-canary.64e1dde",
106
- "@astryxdesign/lab": "0.7.2-canary.64e1dde",
107
- "@astryxdesign/theme-neutral": "0.7.2-canary.64e1dde"
104
+ "@astryxdesign/charts": "0.7.2-canary.6c792d8",
105
+ "@astryxdesign/core": "0.7.2-canary.6c792d8",
106
+ "@astryxdesign/lab": "0.7.2-canary.6c792d8",
107
+ "@astryxdesign/theme-neutral": "0.7.2-canary.6c792d8"
108
108
  },
109
109
  "peerDependenciesMeta": {
110
110
  "@astryxdesign/charts": {
@@ -121,10 +121,10 @@
121
121
  }
122
122
  },
123
123
  "devDependencies": {
124
- "@astryxdesign/charts": "0.7.2-canary.64e1dde",
125
- "@astryxdesign/core": "0.7.2-canary.64e1dde",
126
- "@astryxdesign/lab": "0.7.2-canary.64e1dde",
127
- "@astryxdesign/theme-neutral": "0.7.2-canary.64e1dde",
124
+ "@astryxdesign/charts": "0.7.2-canary.6c792d8",
125
+ "@astryxdesign/core": "0.7.2-canary.6c792d8",
126
+ "@astryxdesign/lab": "0.7.2-canary.6c792d8",
127
+ "@astryxdesign/theme-neutral": "0.7.2-canary.6c792d8",
128
128
  "@heroicons/react": "^2.2.0",
129
129
  "@stylexjs/stylex": "^0.19.0",
130
130
  "@types/babel__core": "^7.20.5",