@astryxdesign/cli 0.7.15 → 0.7.16-canary.g07c77c0

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 (159) hide show
  1. package/README.md +5 -3
  2. package/api/build/_adapter.d.mts +1 -0
  3. package/api/build/blocks/blocks.d.mts +1 -0
  4. package/api/build/blocks/blocks.mjs +18 -1
  5. package/api/component/_adapter.d.mts +1 -1
  6. package/api/component/_adapter.mjs +28 -1
  7. package/api/doctor/_adapter.d.mts +17 -0
  8. package/api/doctor/_adapter.mjs +43 -0
  9. package/api/doctor/built-checks.mjs +1 -1
  10. package/api/doctor/doctor.mjs +18 -4
  11. package/api/doctor/theme-checks.mjs +1 -1
  12. package/api/integration/add-contribution.mjs +3 -3
  13. package/api/integration/pack-check.mjs +14 -8
  14. package/api/integration/validate-integration.mjs +1 -1
  15. package/api/search/_adapter.mjs +15 -16
  16. package/api/search/_entries.d.mts +2 -1
  17. package/api/search/_entries.mjs +28 -1
  18. package/api/swizzle/_moduleGraph.mjs +1 -1
  19. package/api/theme/_adapter.d.mts +5 -2
  20. package/api/theme/_adapter.mjs +43 -12
  21. package/api/theme/_fork.mjs +1 -1
  22. package/api/theme/build/build.d.mts +116 -32
  23. package/api/theme/build/build.mjs +449 -102
  24. package/api/theme/eject/eject.mjs +22 -1
  25. package/api/theme/template/template.d.mts +19 -0
  26. package/api/theme/template/template.mjs +102 -25
  27. package/api/theme/theme.type.d.mts +5 -1
  28. package/api/theme/theme.type.mjs +2 -1
  29. package/api/theme/themeBuild.doc.mjs +3 -3
  30. package/api/theme/themeEject.doc.mjs +1 -1
  31. package/api/theme/themeTemplate.doc.mjs +9 -3
  32. package/api/theme-edit/_adapter.d.mts +32 -2
  33. package/api/theme-edit/_adapter.mjs +213 -36
  34. package/api/theme-edit/_check.d.mts +69 -3
  35. package/api/theme-edit/_check.mjs +1517 -218
  36. package/api/theme-edit/_color.d.mts +2 -8
  37. package/api/theme-edit/_color.mjs +292 -219
  38. package/api/theme-edit/_compiler.d.mts +1 -0
  39. package/api/theme-edit/_compiler.mjs +20 -1
  40. package/api/theme-edit/_context.d.mts +29 -0
  41. package/api/theme-edit/_context.mjs +426 -40
  42. package/api/theme-edit/_css.d.mts +60 -1
  43. package/api/theme-edit/_css.mjs +404 -28
  44. package/api/theme-edit/_edit.d.mts +9 -0
  45. package/api/theme-edit/_edit.mjs +1300 -135
  46. package/api/theme-edit/_how-commands.d.mts +11 -26
  47. package/api/theme-edit/_how-commands.mjs +30 -2
  48. package/api/theme-edit/_how-question.d.mts +7 -0
  49. package/api/theme-edit/_how-question.mjs +1304 -176
  50. package/api/theme-edit/_how.mjs +144 -30
  51. package/api/theme-edit/_overview.mjs +2 -0
  52. package/api/theme-edit/_palette.d.mts +11 -0
  53. package/api/theme-edit/_palette.mjs +194 -65
  54. package/api/theme-edit/_parts.d.mts +33 -0
  55. package/api/theme-edit/_parts.mjs +138 -9
  56. package/api/theme-edit/_png.d.mts +18 -0
  57. package/api/theme-edit/_png.mjs +95 -14
  58. package/api/theme-edit/_preview-app.d.mts +9 -0
  59. package/api/theme-edit/_preview-app.mjs +1191 -71
  60. package/api/theme-edit/_preview.d.mts +16 -3
  61. package/api/theme-edit/_preview.mjs +335 -30
  62. package/api/theme-edit/_project.d.mts +11 -0
  63. package/api/theme-edit/_project.mjs +46 -12
  64. package/api/theme-edit/_settings.d.mts +240 -5
  65. package/api/theme-edit/_settings.mjs +2561 -115
  66. package/api/theme-edit/_tables.d.mts +24 -0
  67. package/api/theme-edit/_tables.mjs +211 -149
  68. package/api/theme-edit/_vet.d.mts +42 -0
  69. package/api/theme-edit/_vet.mjs +144 -0
  70. package/api/theme-edit/theme-edit.type.d.mts +2 -1
  71. package/api/theme-edit/theme-edit.type.mjs +1 -1
  72. package/api/theme-edit/themeEditNew.doc.mjs +1 -1
  73. package/api/theme-edit/themeEditShow.doc.mjs +11 -3
  74. package/api/upgrade/registry/registry.mjs +6 -1
  75. package/assets/codemods/parse.mjs +2 -2
  76. package/assets/docs/tree/single-component.doc.mjs +11 -2
  77. package/assets/docs/tree/tokens-and-setup.doc.mjs +39 -3
  78. package/assets/docs.generated.json +2 -2
  79. package/assets/preview-app/next.config.mjs +7 -1
  80. package/assets/preview-app/package.json +1 -0
  81. package/assets/preview-app/src/app/globals.css +1 -0
  82. package/assets/self-audit.generated.json +1 -1
  83. package/assets/templates/blocks/components/Table/ColumnsVirtualizationHookUsage.doc.mjs +14 -0
  84. package/assets/templates/blocks/components/Table/ColumnsVirtualizationHookUsage.tsx +53 -0
  85. package/assets/templates/blocks/components/Table/InfiniteScrollHookUsage.doc.mjs +14 -0
  86. package/assets/templates/blocks/components/Table/InfiniteScrollHookUsage.tsx +33 -0
  87. package/assets/templates/components.generated.json +1 -1
  88. package/assets/templates/pages/dashboard/page.tsx +1 -1
  89. package/authoring/doctypes/_schema.d.mts +52 -5
  90. package/authoring/doctypes/_schema.mjs +62 -7
  91. package/authoring/doctypes/base/type.ts +10 -0
  92. package/authoring/doctypes/component/component.doc.mjs +1 -1
  93. package/authoring/doctypes/function/function.doc.mjs +6 -0
  94. package/authoring/doctypes/function/type.ts +3 -0
  95. package/authoring/doctypes/legacy.mjs +5 -1
  96. package/authoring/index.d.ts +1 -0
  97. package/authoring/shadcn/source-variants.d.mts +1 -1
  98. package/authoring/shadcn/source-variants.mjs +32 -10
  99. package/clients/cli/build-id.generated.json +1 -1
  100. package/clients/cli/commands/doctor.doc.mjs +2 -2
  101. package/clients/cli/commands/experimental/theme.mjs +237 -45
  102. package/clients/cli/commands/experimental-theme-compile.doc.mjs +2 -2
  103. package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +2 -2
  104. package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +2 -2
  105. package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +3 -3
  106. package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +2 -2
  107. package/clients/cli/commands/experimental-theme-editor.doc.mjs +1 -1
  108. package/clients/cli/commands/experimental-theme-eject.doc.mjs +1 -1
  109. package/clients/cli/commands/experimental-theme-preview-add.doc.mjs +1 -1
  110. package/clients/cli/commands/experimental-theme-template.doc.mjs +2 -2
  111. package/clients/cli/commands/theme-build.doc.mjs +2 -2
  112. package/clients/cli/commands/theme-eject.doc.mjs +1 -1
  113. package/clients/cli/commands/theme-template.doc.mjs +3 -1
  114. package/clients/cli/commands/theme.mjs +190 -46
  115. package/clients/cli/formatters/index.mjs +7 -4
  116. package/clients/cli/lib/cli-error.mjs +9 -3
  117. package/clients/cli/lib/component-format.mjs +27 -9
  118. package/clients/cli/lib/json-shim.mjs +72 -2
  119. package/clients/cli/manifest.generated.json +1 -1
  120. package/clients/cli/run.mjs +49 -0
  121. package/foundation/agent-docs/agent-docs-target.d.mts +2 -6
  122. package/foundation/agent-docs/agent-docs-target.mjs +9 -17
  123. package/foundation/agent-docs/agent-docs.mjs +3 -2
  124. package/foundation/config/config-writer.mjs +2 -2
  125. package/foundation/config/project.mjs +60 -14
  126. package/foundation/discovery/component-discovery.mjs +5 -17
  127. package/foundation/discovery/icon-set-writer.mjs +1 -1
  128. package/foundation/discovery/module-exports.mjs +1 -15
  129. package/foundation/discovery/template-adapter.mjs +44 -19
  130. package/foundation/discovery/template-source-tree.mjs +3 -16
  131. package/foundation/discovery/theme-discovery.d.mts +5 -1
  132. package/foundation/discovery/theme-discovery.mjs +30 -35
  133. package/foundation/fs/exact-codec.d.mts +35 -0
  134. package/foundation/fs/exact-codec.mjs +148 -0
  135. package/foundation/fs/gather-cache.d.mts +15 -5
  136. package/foundation/fs/gather-cache.mjs +123 -30
  137. package/foundation/fs/paths.d.mts +39 -0
  138. package/foundation/fs/paths.mjs +44 -11
  139. package/foundation/fs/read-record.mjs +11 -1
  140. package/foundation/integrations/contribution-fixes.mjs +1 -16
  141. package/foundation/integrations/may-have-integrations.mjs +3 -2
  142. package/foundation/integrations/public-imports.mjs +1 -1
  143. package/foundation/render/embedded-imports.mjs +1 -1
  144. package/foundation/render/host-exit.d.mts +8 -0
  145. package/foundation/render/host-exit.mjs +11 -0
  146. package/foundation/render/page-host.mjs +56 -10
  147. package/foundation/render/page-worker.mjs +14 -0
  148. package/foundation/render/render-page.mjs +37 -2
  149. package/foundation/response/error-codes.d.mts +2 -1
  150. package/foundation/response/error-codes.d.ts +1 -0
  151. package/foundation/response/error-codes.doc.mjs +5 -0
  152. package/foundation/response/error-codes.mjs +3 -0
  153. package/foundation/response/json.d.mts +15 -0
  154. package/foundation/response/json.mjs +52 -1
  155. package/foundation/response/response-types.doc.mjs +1 -1
  156. package/foundation/runtime/lazy-dependencies.d.mts +14 -0
  157. package/foundation/runtime/lazy-dependencies.mjs +82 -0
  158. package/foundation/xle/browser.d.mts +2 -2
  159. package/package.json +7 -6
@@ -0,0 +1,82 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file The CLI's heavy parsing and transform dependencies, each loaded on
5
+ * first use rather than when a module that may use it is imported.
6
+ * @input Nothing; each getter requires its package once and keeps it.
7
+ * @output `babelParser` (and `babelParse`, its `parse`), `babelCore`,
8
+ * `jscodeshift` and `selectorParser`: the same module objects a static
9
+ * import gives, since each package resolves to the same file for `require`
10
+ * as for `import` (test/lazy-dependencies.test.mjs checks it).
11
+ * @position The first-use loader for these packages on the API's import
12
+ * path (authoring/ may not import foundation, so the ShadCN source variants
13
+ * keep their own). Everything that imports the CLI's API reaches the
14
+ * modules that parse or rewrite sources, and most runs never parse one, so
15
+ * loading Babel and jscodeshift with them cost every importer about 350
16
+ * modules. Each package is still resolved when this module loads, which
17
+ * reads no module, so every module that imports this loader needs all four
18
+ * packages installed: a broken install without one fails when such a
19
+ * module loads, never as a parse that quietly finds nothing. The `Project`
20
+ * seam and the agent docs reach this loader through component discovery,
21
+ * so on such an install every command except `help`, `--version`, `blog`
22
+ * and `manifest` stops at load; a run with no options names the missing
23
+ * package (an option the failed command does not declare is rejected as
24
+ * unknown first).
25
+ */
26
+
27
+ import {createRequire} from 'node:module';
28
+
29
+ const require = createRequire(import.meta.url);
30
+
31
+ // Resolved, not loaded: a missing package fails here, at import.
32
+ for (const pkg of [
33
+ '@babel/parser',
34
+ '@babel/core',
35
+ 'jscodeshift',
36
+ 'postcss-selector-parser',
37
+ ]) {
38
+ require.resolve(pkg);
39
+ }
40
+
41
+ /** @type {typeof import('@babel/parser') | undefined} */
42
+ let parser;
43
+ /** @type {typeof import('@babel/core') | undefined} */
44
+ let core;
45
+ /** @type {any} */
46
+ let codeshift;
47
+ /** @type {typeof import('postcss-selector-parser') | undefined} */
48
+ let selectors;
49
+
50
+ /** @returns {typeof import('@babel/parser')} */
51
+ export const babelParser = () => (parser ??= require('@babel/parser'));
52
+
53
+ /** @type {typeof import('@babel/parser').parse} */
54
+ export const babelParse = (input, options) =>
55
+ babelParser().parse(input, options);
56
+
57
+ /** @returns {typeof import('@babel/core')} */
58
+ export const babelCore = () => (core ??= require('@babel/core'));
59
+
60
+ /**
61
+ * Untyped here: jscodeshift ships no types, and this module is reached by
62
+ * type checks that do not load the CLI's ambient declaration for it.
63
+ * @returns {any}
64
+ */
65
+ export const jscodeshift = () => (codeshift ??= require('jscodeshift'));
66
+
67
+ /** @returns {typeof import('postcss-selector-parser')} */
68
+ export const selectorParser = () =>
69
+ (selectors ??= require('postcss-selector-parser'));
70
+
71
+ /**
72
+ * Every package loaded on first use, here and in the ShadCN source variants,
73
+ * for the test that each resolves to one file either way.
74
+ */
75
+ export const LAZY_PACKAGES = [
76
+ '@babel/parser',
77
+ '@babel/core',
78
+ 'jscodeshift',
79
+ 'postcss-selector-parser',
80
+ 'recast',
81
+ '@babel/plugin-transform-typescript',
82
+ ];
@@ -15,7 +15,7 @@
15
15
  */
16
16
  export function checkExpression(expression: string, registry: import("./xle-ast").Registry | import("./browser").SerializedRegistry | object, opts?: {
17
17
  blocks?: import("./browser").XLEBlock[] | undefined;
18
- form?: "compact" | "outline" | "auto" | undefined;
18
+ form?: "compact" | "auto" | "outline" | undefined;
19
19
  loose?: boolean | undefined;
20
20
  }): import("./browser").CheckResult;
21
21
  /**
@@ -34,7 +34,7 @@ export function checkExpression(expression: string, registry: import("./xle-ast"
34
34
  */
35
35
  export function expandExpression(expression: string, registry: import("./xle-ast").Registry | import("./browser").SerializedRegistry | object, opts?: {
36
36
  blocks?: import("./browser").XLEBlock[] | undefined;
37
- form?: "compact" | "outline" | "auto" | undefined;
37
+ form?: "compact" | "auto" | "outline" | undefined;
38
38
  loose?: boolean | undefined;
39
39
  name?: string | undefined;
40
40
  blockModules?: Map<string, import("./xle-ast").BlockModule> | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astryxdesign/cli",
3
- "version": "0.7.15",
3
+ "version": "0.7.16-canary.g07c77c0",
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",
@@ -111,6 +111,7 @@
111
111
  "@babel/parser": "7.29.8",
112
112
  "@babel/plugin-transform-typescript": "7.29.7",
113
113
  "@babel/types": "7.29.8",
114
+ "@csstools/css-syntax-patches-for-csstree": "1.1.6",
114
115
  "@stylexjs/babel-plugin": "^0.19.1",
115
116
  "ast-types": "0.16.3",
116
117
  "commander": "^12.1.0",
@@ -126,7 +127,7 @@
126
127
  "zod": "^4.6.7"
127
128
  },
128
129
  "peerDependencies": {
129
- "@astryxdesign/core": "*"
130
+ "@astryxdesign/core": "0.7.16-canary.g07c77c0"
130
131
  },
131
132
  "peerDependenciesMeta": {
132
133
  "@astryxdesign/core": {
@@ -134,10 +135,10 @@
134
135
  }
135
136
  },
136
137
  "devDependencies": {
137
- "@astryxdesign/charts": "*",
138
- "@astryxdesign/core": "*",
139
- "@astryxdesign/lab": "*",
140
- "@astryxdesign/theme-neutral": "*",
138
+ "@astryxdesign/charts": "0.7.16-canary.g07c77c0",
139
+ "@astryxdesign/core": "0.7.16-canary.g07c77c0",
140
+ "@astryxdesign/lab": "0.7.16-canary.g07c77c0",
141
+ "@astryxdesign/theme-neutral": "0.7.16-canary.g07c77c0",
141
142
  "@heroicons/react": "^2.2.0",
142
143
  "@stylexjs/stylex": "^0.19.1",
143
144
  "@types/babel__core": "^7.20.5",