@astryxdesign/cli 0.7.1 → 0.7.2-canary.01eab6a

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 (101) hide show
  1. package/README.md +7 -7
  2. package/api/component/_adapter.d.mts +41 -1
  3. package/api/component/_adapter.mjs +93 -7
  4. package/api/component/component.mjs +22 -5
  5. package/api/component/component.test.mjs +420 -167
  6. package/api/component/integration-export-name.test.mjs +644 -0
  7. package/api/component/list/list.mjs +42 -4
  8. package/api/gap-report/gap-report.mjs +67 -4
  9. package/api/integration/_adapter.d.mts +12 -0
  10. package/api/integration/_adapter.mjs +54 -0
  11. package/api/integration/add-contribution.component-names.test.mjs +66 -0
  12. package/api/integration/add-contribution.mjs +7 -3
  13. package/api/integration/authoring-checks.mjs +11 -2
  14. package/api/integration/authoring-checks.test.mjs +39 -0
  15. package/api/integration/authoring-checks.type.d.mts +9 -0
  16. package/api/integration/authoring-checks.type.mjs +14 -1
  17. package/api/integration/integrationComponentConflicts.doc.mjs +21 -5
  18. package/api/integration/pack-check.mjs +61 -107
  19. package/api/integration/pack-check.test.mjs +359 -0
  20. package/api/search/search.d.mts +9 -0
  21. package/api/search/search.mjs +108 -16
  22. package/api/search/search.test.mjs +36 -0
  23. package/api/swizzle/copy/copy.mjs +28 -14
  24. package/api/template/table-filter-view-tabs.test.mjs +45 -0
  25. package/api/template/template.test.mjs +120 -3
  26. package/api/theme/build/build.core-on-demand.test.mjs +113 -0
  27. package/api/theme/build/build.d.mts +13 -13
  28. package/api/theme/build/build.family.test.mjs +16 -0
  29. package/api/theme/build/build.mjs +149 -55
  30. package/api/theme/themeBuild.doc.mjs +3 -3
  31. package/assets/codemods/transforms/next/__tests__/migrate-list-edge-compensation-to-edge.test.mjs +120 -0
  32. package/assets/codemods/transforms/next/index.mjs +11 -1
  33. package/assets/codemods/transforms/next/migrate-list-edge-compensation-to-edge.mjs +198 -0
  34. package/assets/docs/tree/add-a-component.doc.mjs +10 -0
  35. package/assets/docs/tree/check-the-props.doc.mjs +145 -0
  36. package/assets/docs/tree/checks.doc.mjs +4 -4
  37. package/assets/docs/tree/component-family.doc.mjs +5 -1
  38. package/assets/docs/tree/component-imports.doc.mjs +8 -0
  39. package/assets/docs/tree/describe-the-component.doc.mjs +1 -1
  40. package/assets/docs/tree/single-component.doc.mjs +3 -2
  41. package/assets/docs/tree/troubleshooting.doc.mjs +9 -1
  42. package/assets/docs/tree/versioning.doc.mjs +1 -0
  43. package/assets/docs/working-with-ai.doc.mjs +43 -4
  44. package/assets/templates/blocks/components/Drawer/DrawerForm.doc.mjs +24 -0
  45. package/assets/templates/blocks/components/Drawer/DrawerForm.tsx +62 -0
  46. package/assets/templates/blocks/components/Drawer/DrawerScrim.doc.mjs +22 -0
  47. package/assets/templates/blocks/components/Drawer/DrawerScrim.tsx +68 -0
  48. package/assets/templates/blocks/components/Drawer/DrawerShowcase.doc.mjs +22 -0
  49. package/assets/templates/blocks/components/Drawer/DrawerShowcase.tsx +41 -0
  50. package/assets/templates/blocks/components/Drawer/DrawerStart.doc.mjs +21 -0
  51. package/assets/templates/blocks/components/Drawer/DrawerStart.tsx +41 -0
  52. package/assets/templates/blocks/components/Drawer/DrawerWidths.doc.mjs +22 -0
  53. package/assets/templates/blocks/components/Drawer/DrawerWidths.tsx +54 -0
  54. package/assets/templates/blocks/components/DrawerHeader/DrawerHeaderShowcase.doc.mjs +15 -0
  55. package/assets/templates/blocks/components/DrawerHeader/DrawerHeaderShowcase.tsx +73 -0
  56. package/assets/templates/blocks/components/DrawerHeader/DrawerHeaderSubtitleEndContent.doc.mjs +22 -0
  57. package/assets/templates/blocks/components/DrawerHeader/DrawerHeaderSubtitleEndContent.tsx +49 -0
  58. package/assets/templates/blocks/components/DrawerHeader/DrawerHeaderWithCloseButton.doc.mjs +21 -0
  59. package/assets/templates/blocks/components/DrawerHeader/DrawerHeaderWithCloseButton.tsx +42 -0
  60. package/assets/templates/pages/detail-page/page.tsx +3 -3
  61. package/assets/templates/pages/table-filter/page.tsx +3 -2
  62. package/assets/templates/pages/table-inbox/page.tsx +10 -8
  63. package/authoring/doctypes/base/type.ts +6 -0
  64. package/authoring/doctypes/component/component.doc.mjs +4 -4
  65. package/authoring/doctypes/component/type.ts +6 -3
  66. package/clients/cli/commands/build-theme.path-safety.test.mjs +84 -0
  67. package/clients/cli/commands/build-theme.registry.test.mjs +5 -2
  68. package/clients/cli/commands/doctor-integration-components.doc.mjs +9 -3
  69. package/clients/cli/commands/doctor-integration.test.mjs +327 -0
  70. package/clients/cli/commands/doctor.mjs +74 -0
  71. package/clients/cli/commands/theme-build.doc.mjs +2 -2
  72. package/clients/cli/lib/component-format.mjs +5 -1
  73. package/foundation/discovery/component-discovery.d.mts +190 -10
  74. package/foundation/discovery/component-discovery.export-names.test.mjs +760 -0
  75. package/foundation/discovery/component-discovery.mjs +864 -56
  76. package/foundation/discovery/component-discovery.test.mjs +96 -0
  77. package/foundation/discovery/component-replacement.mjs +18 -0
  78. package/foundation/discovery/component-replacement.test.mjs +40 -0
  79. package/foundation/discovery/module-exports.d.mts +27 -0
  80. package/foundation/discovery/module-exports.mjs +356 -31
  81. package/foundation/discovery/module-exports.test.mjs +172 -0
  82. package/foundation/discovery/package-tsconfig.d.mts +14 -0
  83. package/foundation/discovery/package-tsconfig.mjs +228 -0
  84. package/foundation/discovery/package-tsconfig.test.mjs +210 -0
  85. package/foundation/discovery/project-typescript.d.mts +23 -0
  86. package/foundation/discovery/project-typescript.mjs +61 -0
  87. package/foundation/discovery/prop-drift.d.mts +220 -0
  88. package/foundation/discovery/prop-drift.mjs +1765 -0
  89. package/foundation/discovery/prop-drift.test.mjs +1197 -0
  90. package/foundation/discovery/template-adapter.mjs +74 -5
  91. package/foundation/discovery/unresolved-references.d.mts +62 -0
  92. package/foundation/discovery/unresolved-references.mjs +790 -0
  93. package/foundation/discovery/unresolved-references.test.mjs +567 -0
  94. package/foundation/doc-compiler/doc-loads.test.mjs +9 -1
  95. package/foundation/doc-compiler/inputs.mjs +23 -0
  96. package/foundation/doc-compiler/inputs.test.mjs +0 -1
  97. package/foundation/integrations/contribution-inventory.mjs +6 -1
  98. package/foundation/response/response-types.doc.mjs +1 -1
  99. package/foundation/xle/registry.mjs +4 -0
  100. package/foundation/xle/registry.test.mjs +28 -0
  101. package/package.json +10 -10
@@ -20,6 +20,7 @@ import path from 'node:path';
20
20
  import {findCoreDir} from '../fs/paths.mjs';
21
21
  import {
22
22
  discoverComponents,
23
+ familyMember,
23
24
  findComponentReadme,
24
25
  resolveImportPath,
25
26
  } from '../discovery/component-discovery.mjs';
@@ -126,6 +127,9 @@ export async function buildRegistry({cwd = process.cwd()} = {}) {
126
127
  } catch {
127
128
  continue; // a malformed doc must not take down the whole language
128
129
  }
130
+ // A member documented in its family's doc (VStack in Stack's doc) is
131
+ // registered by the family's own folder, with every other member.
132
+ if (familyMember(docs, dirName)) continue;
129
133
  const importPath = resolveImportPath(coreDir, dirName);
130
134
 
131
135
  const register = (/** @type {string} */ rawName, /** @type {import('./xle-ast').DocProp[]} */ props) => {
@@ -0,0 +1,28 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file The layout-language registry over the real @astryxdesign/core tree:
5
+ * the import path it emits for each component.
6
+ */
7
+
8
+ import {describe, it, expect} from 'vitest';
9
+ import * as path from 'node:path';
10
+ import {fileURLToPath} from 'node:url';
11
+ import {buildRegistry} from './registry.mjs';
12
+
13
+ const REPO = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../../..');
14
+
15
+ describe('buildRegistry import paths', () => {
16
+ it('keeps the Stack family on the paths it registers from Stack\'s folder', async () => {
17
+ // HStack and VStack are listed components whose docs live in Stack's doc.
18
+ // Listing them must not let their folders re-register the family under
19
+ // their own paths: a member's folder registers nothing, Stack's does.
20
+ const {components} = await buildRegistry({cwd: REPO});
21
+ const importOf = (/** @type {string} */ name) => components.get(name)?.importPath;
22
+ for (const name of ['Stack', 'StackItem', 'HStack', 'VStack']) {
23
+ expect(importOf(name), name).toBe('@astryxdesign/core/Stack');
24
+ }
25
+ expect(importOf('Heading')).toBe('@astryxdesign/core/Heading');
26
+ expect(importOf('Text')).toBe('@astryxdesign/core/Text');
27
+ }, 120_000);
28
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astryxdesign/cli",
3
- "version": "0.7.1",
3
+ "version": "0.7.2-canary.01eab6a",
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",
@@ -96,15 +96,15 @@
96
96
  "jscodeshift": "^17.3.0",
97
97
  "node-diff3": "3.2.1",
98
98
  "postcss": "^8.5.23",
99
- "postcss-selector-parser": "^7.1.5",
99
+ "postcss-selector-parser": "^7.1.6",
100
100
  "recast": "0.23.21",
101
101
  "zod": "^4.4.3"
102
102
  },
103
103
  "peerDependencies": {
104
- "@astryxdesign/charts": "*",
105
- "@astryxdesign/core": "*",
106
- "@astryxdesign/lab": "*",
107
- "@astryxdesign/theme-neutral": "*"
104
+ "@astryxdesign/charts": "0.7.2-canary.01eab6a",
105
+ "@astryxdesign/core": "0.7.2-canary.01eab6a",
106
+ "@astryxdesign/lab": "0.7.2-canary.01eab6a",
107
+ "@astryxdesign/theme-neutral": "0.7.2-canary.01eab6a"
108
108
  },
109
109
  "peerDependenciesMeta": {
110
110
  "@astryxdesign/charts": {
@@ -121,10 +121,10 @@
121
121
  }
122
122
  },
123
123
  "devDependencies": {
124
- "@astryxdesign/charts": "*",
125
- "@astryxdesign/core": "*",
126
- "@astryxdesign/lab": "*",
127
- "@astryxdesign/theme-neutral": "*",
124
+ "@astryxdesign/charts": "0.7.2-canary.01eab6a",
125
+ "@astryxdesign/core": "0.7.2-canary.01eab6a",
126
+ "@astryxdesign/lab": "0.7.2-canary.01eab6a",
127
+ "@astryxdesign/theme-neutral": "0.7.2-canary.01eab6a",
128
128
  "@heroicons/react": "^2.2.0",
129
129
  "@stylexjs/stylex": "^0.19.0",
130
130
  "@types/babel__core": "^7.20.5",