@astryxdesign/cli 0.7.9-canary.f9281ef → 0.7.9

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 (49) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/README.md +1 -1
  3. package/api/component/__fixtures__/resolutions/modules.txt +5 -5
  4. package/api/swizzle/copy/copy.d.mts +17 -1
  5. package/api/swizzle/copy/copy.mjs +240 -5
  6. package/api/swizzle/swizzle.doc.mjs +1 -1
  7. package/api/swizzle/swizzle.type.mjs +1 -1
  8. package/api/theme/build/build.mjs +342 -72
  9. package/api/theme/build/core-interception.mjs +92 -29
  10. package/api/theme/build/icon-imports.d.mts +35 -4
  11. package/api/theme/build/icon-imports.mjs +299 -38
  12. package/assets/discover/official-packages.json +8 -0
  13. package/assets/docs/author-a-theme.doc.mjs +3 -1
  14. package/assets/docs/icons.doc.mjs +29 -0
  15. package/assets/docs/motion.doc.mjs +1 -1
  16. package/assets/templates/blocks/components/Calendar/useCalendarDaysHookUsage.doc.mjs +14 -0
  17. package/assets/templates/blocks/components/Calendar/useCalendarDaysHookUsage.tsx +71 -0
  18. package/assets/templates/blocks/components/Hooks/useInputContainerHookUsage.doc.mjs +15 -0
  19. package/assets/templates/blocks/components/Hooks/useInputContainerHookUsage.tsx +93 -0
  20. package/assets/templates/blocks/components/Hooks/useMergedRefsHookUsage.doc.mjs +14 -0
  21. package/assets/templates/blocks/components/Hooks/useMergedRefsHookUsage.tsx +78 -0
  22. package/assets/templates/blocks/components/Hooks/useScrollLockHookUsage.doc.mjs +14 -0
  23. package/assets/templates/blocks/components/Hooks/useScrollLockHookUsage.tsx +80 -0
  24. package/assets/templates/blocks/components/Hooks/useScrollOverflowHookUsage.doc.mjs +14 -0
  25. package/assets/templates/blocks/components/Hooks/useScrollOverflowHookUsage.tsx +94 -0
  26. package/assets/templates/blocks/components/Icon/useIconHookUsage.doc.mjs +19 -0
  27. package/assets/templates/blocks/components/Icon/useIconHookUsage.tsx +68 -0
  28. package/assets/templates/blocks/components/Link/useLinkComponentHookUsage.doc.mjs +14 -0
  29. package/assets/templates/blocks/components/Link/useLinkComponentHookUsage.tsx +89 -0
  30. package/assets/templates/blocks/components/Overlay/useOverlayHookUsage.doc.mjs +21 -0
  31. package/assets/templates/blocks/components/Overlay/useOverlayHookUsage.tsx +49 -0
  32. package/assets/templates/blocks/components/Table/useTableSortableStateHookUsage.doc.mjs +14 -0
  33. package/assets/templates/blocks/components/Table/useTableSortableStateHookUsage.tsx +61 -0
  34. package/assets/templates/blocks/components/usePanGesture/PanDraggableBox.doc.mjs +15 -0
  35. package/assets/templates/blocks/components/usePanGesture/PanDraggableBox.tsx +98 -0
  36. package/assets/templates/blocks/components/usePanGesture/PanPlayingCard.doc.mjs +14 -0
  37. package/assets/templates/blocks/components/usePanGesture/PanPlayingCard.tsx +147 -0
  38. package/assets/templates/themes/neutral/neutralPaletteRefs.generated.ts +2 -2
  39. package/assets/templates/themes/neutral/neutralTheme.ts +30 -4
  40. package/assets/theme.template.ts +14 -2
  41. package/authoring/doctypes/base/type.ts +41 -0
  42. package/authoring/doctypes/component/component.doc.mjs +7 -1
  43. package/authoring/doctypes/component/type.ts +5 -0
  44. package/authoring/index.d.ts +2 -0
  45. package/clients/cli/commands/swizzle.mjs +10 -0
  46. package/clients/cli/lib/component-format.mjs +49 -0
  47. package/foundation/discovery/component-discovery.mjs +17 -6
  48. package/foundation/response/response-types.doc.mjs +1 -1
  49. package/package.json +9 -9
@@ -766,12 +766,7 @@ function caseSpelledComponentSource(srcDir, name) {
766
766
  */
767
767
  export function resolveImportPath(coreDir, componentName) {
768
768
  const srcDir = path.join(coreDir, 'src');
769
- const pkgPath = path.join(coreDir, 'package.json');
770
- const pkg = pathExists(pkgPath)
771
- ? JSON.parse(fs.readFileSync(pkgPath, 'utf-8'))
772
- : null;
773
-
774
- const exportKeys = Object.keys(pkg?.exports || {});
769
+ const exportKeys = exportKeysOf(coreDir);
775
770
 
776
771
  // Priority 1: exact subpath export matching the component name (e.g. ./Heading)
777
772
  // This allows convenience re-export directories to win over the source directory.
@@ -799,6 +794,22 @@ export function resolveImportPath(coreDir, componentName) {
799
794
  return '@astryxdesign/core';
800
795
  }
801
796
 
797
+ /**
798
+ * The subpaths the package's `exports` map names, read once per operation:
799
+ * a search resolves the import of every component.
800
+ * @param {string} coreDir
801
+ * @returns {string[]}
802
+ */
803
+ function exportKeysOf(coreDir) {
804
+ const pkgPath = path.join(coreDir, 'package.json');
805
+ return oncePerListing(`export-keys\0${pkgPath}`, () => {
806
+ const pkg = pathExists(pkgPath)
807
+ ? JSON.parse(fs.readFileSync(pkgPath, 'utf-8'))
808
+ : null;
809
+ return Object.keys(pkg?.exports || {});
810
+ });
811
+ }
812
+
802
813
  /**
803
814
  * Does a package's `exports` map publish this subpath?
804
815
  *
@@ -262,7 +262,7 @@ export const doc = {
262
262
  {
263
263
  value: 'swizzle.copy',
264
264
  description:
265
- "An eject receipt: component name, owning package, output directory, files-copied count, the written file names, whether any file uses StyleX, and, when the owner has an issues URL, feedback ({issuesUrl, ghCommand?}): where to report the gap that led to swizzling. The envelope's package names the same owning package.",
265
+ "An eject receipt: component name, owning package, output directory, files-copied count, the copied file names (relative to the component folder; owner modules copied beside it start with ../), whether any file uses StyleX, and, when the owner has an issues URL, feedback ({issuesUrl, ghCommand?}): where to report the gap that led to swizzling. The envelope's package names the same owning package.",
266
266
  },
267
267
 
268
268
  // gap reports
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astryxdesign/cli",
3
- "version": "0.7.9-canary.f9281ef",
3
+ "version": "0.7.9",
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.f9281ef",
128
- "@astryxdesign/core": "0.7.9-canary.f9281ef",
129
- "@astryxdesign/lab": "0.7.9-canary.f9281ef",
130
- "@astryxdesign/theme-neutral": "0.7.9-canary.f9281ef"
127
+ "@astryxdesign/charts": "*",
128
+ "@astryxdesign/core": "*",
129
+ "@astryxdesign/lab": "*",
130
+ "@astryxdesign/theme-neutral": "*"
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.f9281ef",
148
- "@astryxdesign/core": "0.7.9-canary.f9281ef",
149
- "@astryxdesign/lab": "0.7.9-canary.f9281ef",
150
- "@astryxdesign/theme-neutral": "0.7.9-canary.f9281ef",
147
+ "@astryxdesign/charts": "*",
148
+ "@astryxdesign/core": "*",
149
+ "@astryxdesign/lab": "*",
150
+ "@astryxdesign/theme-neutral": "*",
151
151
  "@heroicons/react": "^2.2.0",
152
152
  "@stylexjs/stylex": "^0.19.0",
153
153
  "@types/babel__core": "^7.20.5",