@astryxdesign/cli 0.7.2-canary.081ccea → 0.7.2-canary.085e145

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 (324) hide show
  1. package/README.md +104 -84
  2. package/api/build/_adapter.d.mts +8 -0
  3. package/api/build/_adapter.mjs +12 -1
  4. package/api/build/build.doc.mjs +4 -0
  5. package/api/build/kit/kit.mjs +3 -11
  6. package/api/component/_adapter.mjs +3 -11
  7. package/api/component/component.doc.mjs +6 -1
  8. package/api/discover/_adapter.d.mts +13 -0
  9. package/api/discover/_adapter.mjs +39 -17
  10. package/api/discover/discover.doc.mjs +3 -2
  11. package/api/discover/discover.mjs +22 -8
  12. package/api/discover/discover.type.d.mts +5 -3
  13. package/api/discover/discover.type.mjs +5 -3
  14. package/api/docs/_adapter.mjs +3 -2
  15. package/api/docs/docs.doc.mjs +2 -1
  16. package/api/docs/docs.mjs +2 -1
  17. package/api/docs/docs.test.mjs +5 -2
  18. package/api/docs/reference-blocks.test.mjs +1 -3
  19. package/api/doctor/_adapter.d.mts +108 -0
  20. package/api/doctor/_adapter.mjs +223 -4
  21. package/api/doctor/doctor.d.mts +199 -0
  22. package/api/doctor/doctor.doc.mjs +3 -2
  23. package/api/doctor/doctor.mjs +503 -31
  24. package/api/doctor/doctor.test.mjs +137 -14
  25. package/api/doctor/release-checks.test.mjs +156 -0
  26. package/api/doctor/theme-checks.mjs +16 -3
  27. package/api/doctor/theme-checks.test.mjs +87 -7
  28. package/api/error.d.mts +10 -0
  29. package/api/error.mjs +25 -0
  30. package/api/hook/_adapter.mjs +3 -11
  31. package/api/hook/hook.doc.mjs +4 -0
  32. package/api/hook/list/list.d.mts +1 -1
  33. package/api/init/_adapter.d.mts +22 -0
  34. package/api/init/_adapter.mjs +59 -0
  35. package/api/init/init.d.mts +7 -5
  36. package/api/init/init.doc.mjs +28 -7
  37. package/api/init/init.mjs +28 -4
  38. package/api/init/init.type.d.mts +48 -3
  39. package/api/init/init.type.mjs +37 -3
  40. package/api/init/run/run.d.mts +1 -1
  41. package/api/init/run/run.mjs +15 -4
  42. package/api/init/user/user.d.mts +14 -0
  43. package/api/init/user/user.mjs +87 -0
  44. package/api/init/user/user.test.mjs +232 -0
  45. package/api/integration/authoring-checks.mjs +2 -2
  46. package/api/integration/integrationCheck.doc.mjs +1 -1
  47. package/api/integration/pack-check.mjs +10 -9
  48. package/api/integration/pack-check.test.mjs +9 -15
  49. package/api/integration/validate-integration.d.mts +8 -0
  50. package/api/integration/validate-integration.mjs +27 -6
  51. package/api/integration/validate-integration.type.d.mts +8 -0
  52. package/api/integration/validate-integration.type.mjs +3 -1
  53. package/api/integration/validate-unread-theme-folders.test.mjs +3 -2
  54. package/api/integration/validateIntegration.doc.mjs +1 -1
  55. package/api/search/_adapter.d.mts +11 -0
  56. package/api/search/_adapter.mjs +25 -0
  57. package/api/search/search.d.mts +1 -1
  58. package/api/search/search.doc.mjs +8 -3
  59. package/api/search/search.mjs +38 -14
  60. package/api/search/search.test.mjs +4 -1
  61. package/api/search/search.type.d.mts +14 -1
  62. package/api/search/search.type.mjs +6 -1
  63. package/api/swizzle/_adapter.mjs +2 -2
  64. package/api/swizzle/copy/copy.mjs +1 -1
  65. package/api/template/template-integration.test.mjs +1 -1
  66. package/api/theme/_adapter.d.mts +16 -0
  67. package/api/theme/_adapter.mjs +32 -5
  68. package/api/theme/build/build.d.mts +2 -1
  69. package/api/theme/build/build.mjs +70 -14
  70. package/api/theme/build/build.packed-old-core.test.mjs +20 -3
  71. package/api/theme/build/font-warning.mjs +5 -3
  72. package/api/theme/build/font-warning.test.mjs +2 -1
  73. package/api/theme/remove/remove.test.mjs +2 -2
  74. package/api/theme/targets/targets.mjs +3 -10
  75. package/api/theme/themeTargets.doc.mjs +4 -0
  76. package/api/theme/use/use.test.mjs +1 -1
  77. package/api/upgrade/_adapter.mjs +1 -1
  78. package/api/upgrade/run/run.mjs +5 -1
  79. package/api/upgrade/upgrade.doc.mjs +2 -1
  80. package/api/upgrade/upgrade.mjs +5 -1
  81. package/assets/docs/getting-started.doc.mjs +23 -3
  82. package/assets/docs/tree/add-a-component.doc.mjs +11 -1
  83. package/assets/docs/tree/add-a-theme.doc.mjs +12 -2
  84. package/assets/docs/tree/add-a-topic.doc.mjs +43 -1
  85. package/assets/docs/tree/agent-guidance.doc.mjs +18 -4
  86. package/assets/docs/tree/building-blocks.doc.mjs +4 -0
  87. package/assets/docs/tree/check-the-props.doc.mjs +1 -1
  88. package/assets/docs/tree/check-your-docs.doc.mjs +5 -5
  89. package/assets/docs/tree/checks.doc.mjs +9 -9
  90. package/assets/docs/tree/ci-and-containers.doc.mjs +88 -0
  91. package/assets/docs/tree/cli-command.doc.mjs +142 -0
  92. package/assets/docs/tree/cli.doc.mjs +6 -0
  93. package/assets/docs/tree/codemods.doc.mjs +13 -3
  94. package/assets/docs/tree/commands.doc.mjs +7 -1
  95. package/assets/docs/tree/component-imports.doc.mjs +11 -1
  96. package/assets/docs/tree/components.doc.mjs +6 -0
  97. package/assets/docs/tree/computer-agent-guide.doc.mjs +160 -0
  98. package/assets/docs/tree/computer-integrations.doc.mjs +93 -0
  99. package/assets/docs/tree/configuration.doc.mjs +7 -3
  100. package/assets/docs/tree/debug-and-gap-reports.doc.mjs +11 -1
  101. package/assets/docs/tree/define-the-theme.doc.mjs +1 -1
  102. package/assets/docs/tree/describe-the-component.doc.mjs +1 -1
  103. package/assets/docs/tree/docs.doc.mjs +6 -0
  104. package/assets/docs/tree/extend-or-replace.doc.mjs +13 -3
  105. package/assets/docs/tree/generate-a-palette.doc.mjs +2 -2
  106. package/assets/docs/tree/global-integrations.doc.mjs +124 -0
  107. package/assets/docs/tree/global.doc.mjs +131 -0
  108. package/assets/docs/tree/grade-template-with-agent.doc.mjs +4 -4
  109. package/assets/docs/tree/install-once.doc.mjs +105 -0
  110. package/assets/docs/tree/integrations.doc.mjs +5 -1
  111. package/assets/docs/tree/layout.doc.mjs +1 -1
  112. package/assets/docs/tree/links.doc.mjs +1 -1
  113. package/assets/docs/tree/monorepos.doc.mjs +84 -0
  114. package/assets/docs/tree/problems.doc.mjs +205 -0
  115. package/assets/docs/tree/project-global-or-both.doc.mjs +131 -0
  116. package/assets/docs/tree/publishing.doc.mjs +2 -2
  117. package/assets/docs/tree/quick-start.doc.mjs +15 -5
  118. package/assets/docs/tree/reference.doc.mjs +192 -0
  119. package/assets/docs/tree/replace-a-core-component.doc.mjs +11 -1
  120. package/assets/docs/tree/replace-a-core-template.doc.mjs +4 -4
  121. package/assets/docs/tree/scaffold.doc.mjs +1 -1
  122. package/assets/docs/tree/sections-and-placement.doc.mjs +3 -3
  123. package/assets/docs/tree/see-it-in-an-app.doc.mjs +13 -3
  124. package/assets/docs/tree/short-and-findable.doc.mjs +3 -3
  125. package/assets/docs/tree/single-component.doc.mjs +3 -3
  126. package/assets/docs/tree/start-a-template.doc.mjs +15 -5
  127. package/assets/docs/tree/template-doc-overview.doc.mjs +1 -1
  128. package/assets/docs/tree/templates.doc.mjs +6 -0
  129. package/assets/docs/tree/test-in-an-app.doc.mjs +4 -4
  130. package/assets/docs/tree/test-template-in-app.doc.mjs +4 -4
  131. package/assets/docs/tree/themes.doc.mjs +4 -0
  132. package/assets/docs/tree/troubleshooting.doc.mjs +15 -7
  133. package/assets/docs/tree/uninstall.doc.mjs +109 -0
  134. package/assets/docs/tree/updates.doc.mjs +92 -0
  135. package/assets/docs/tree/upgrading.doc.mjs +2 -2
  136. package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +11 -1
  137. package/assets/docs/tree/verify-packed-template.doc.mjs +2 -2
  138. package/assets/docs/tree/versioning.doc.mjs +3 -3
  139. package/assets/docs/tree/who-answers.doc.mjs +119 -0
  140. package/assets/docs/tree/write-the-template-file.doc.mjs +3 -3
  141. package/assets/docs/working-with-ai.doc.mjs +23 -9
  142. package/authoring/debug/parse.d.mts +5 -5
  143. package/authoring/discover/discover.doc.mjs +6 -0
  144. package/authoring/doctypes/_schema.d.mts +8 -3
  145. package/authoring/doctypes/_schema.mjs +1 -0
  146. package/authoring/doctypes/command/command.doc.mjs +6 -0
  147. package/authoring/doctypes/command/type.ts +14 -0
  148. package/authoring/doctypes/reference/reference.doc.mjs +1 -1
  149. package/authoring/index.d.ts +1 -0
  150. package/authoring/integration/integration.doc.mjs +18 -2
  151. package/authoring/integration/parse.test.mjs +11 -0
  152. package/authoring/integration/schema.d.mts +14 -3
  153. package/authoring/integration/schema.mjs +33 -2
  154. package/authoring/integration/type.ts +8 -0
  155. package/clients/cli/bin/astryx.mjs +20 -3
  156. package/clients/cli/cli-command.test.mjs +166 -0
  157. package/clients/cli/commands/blog.doc.mjs +1 -0
  158. package/clients/cli/commands/build-theme.batch-report.test.mjs +14 -2
  159. package/clients/cli/commands/build-theme.font-warning.test.mjs +3 -3
  160. package/clients/cli/commands/build-theme.mjs +25 -12
  161. package/clients/cli/commands/build.doc.mjs +1 -0
  162. package/clients/cli/commands/build.exit-codes-doc.test.mjs +4 -0
  163. package/clients/cli/commands/component.doc.mjs +1 -0
  164. package/clients/cli/commands/discover.broken-integration.test.mjs +7 -6
  165. package/clients/cli/commands/discover.doc.mjs +8 -0
  166. package/clients/cli/commands/discover.no-source.test.mjs +1 -0
  167. package/clients/cli/commands/docs.doc.mjs +1 -0
  168. package/clients/cli/commands/docs.mjs +49 -19
  169. package/clients/cli/commands/docs.test.mjs +2 -2
  170. package/clients/cli/commands/doctor-integration-components.doc.mjs +1 -0
  171. package/clients/cli/commands/doctor-integration-docs.doc.mjs +1 -0
  172. package/clients/cli/commands/doctor-integration-templates.doc.mjs +1 -0
  173. package/clients/cli/commands/doctor-integration-validate.doc.mjs +10 -1
  174. package/clients/cli/commands/doctor-integration.test.mjs +4 -3
  175. package/clients/cli/commands/doctor.doc.mjs +12 -2
  176. package/clients/cli/commands/doctor.mjs +12 -3
  177. package/clients/cli/commands/doctor.test.mjs +10 -4
  178. package/clients/cli/commands/gap-report.doc.mjs +1 -0
  179. package/clients/cli/commands/hook.doc.mjs +1 -0
  180. package/clients/cli/commands/init.behavior.test.mjs +5 -0
  181. package/clients/cli/commands/init.doc.mjs +29 -3
  182. package/clients/cli/commands/integration-add.doc.mjs +7 -0
  183. package/clients/cli/commands/integration-authoring.test.mjs +3 -3
  184. package/clients/cli/commands/integration-check.doc.mjs +10 -2
  185. package/clients/cli/commands/integration-check.test.mjs +31 -1
  186. package/clients/cli/commands/integration-pack.doc.mjs +8 -1
  187. package/clients/cli/commands/integration-verify.doc.mjs +8 -1
  188. package/clients/cli/commands/integration.mjs +3 -2
  189. package/clients/cli/commands/json-contract.test.mjs +6 -1
  190. package/clients/cli/commands/manifest.doc.mjs +1 -0
  191. package/clients/cli/commands/outside-project.test.mjs +774 -0
  192. package/clients/cli/commands/search.doc.mjs +1 -0
  193. package/clients/cli/commands/search.mjs +16 -11
  194. package/clients/cli/commands/search.test.mjs +429 -296
  195. package/clients/cli/commands/setup-nudge.test.mjs +26 -4
  196. package/clients/cli/commands/swizzle.doc.mjs +7 -0
  197. package/clients/cli/commands/swizzle.routing.test.mjs +1 -1
  198. package/clients/cli/commands/template.doc.mjs +1 -0
  199. package/clients/cli/commands/theme-add-lifecycle.test.mjs +3 -3
  200. package/clients/cli/commands/theme-add.doc.mjs +8 -1
  201. package/clients/cli/commands/theme-build.doc.mjs +1 -0
  202. package/clients/cli/commands/theme-eject.doc.mjs +1 -0
  203. package/clients/cli/commands/theme-list.behavior.test.mjs +6 -0
  204. package/clients/cli/commands/theme-list.doc.mjs +1 -0
  205. package/clients/cli/commands/theme-palette-generate.doc.mjs +1 -0
  206. package/clients/cli/commands/theme-remove.doc.mjs +7 -0
  207. package/clients/cli/commands/theme-targets.doc.mjs +1 -0
  208. package/clients/cli/commands/theme-template.doc.mjs +1 -0
  209. package/clients/cli/commands/theme-use.doc.mjs +7 -0
  210. package/clients/cli/commands/upgrade.config-ordering.test.mjs +2 -1
  211. package/clients/cli/commands/upgrade.doc.mjs +8 -1
  212. package/clients/cli/commands/upgrade.file-protection.test.mjs +3 -2
  213. package/clients/cli/commands/upgrade.hook-output.test.mjs +2 -1
  214. package/clients/cli/index.mjs +84 -13
  215. package/clients/cli/lib/cli-error.mjs +4 -1
  216. package/clients/cli/lib/component-format.test.mjs +1 -1
  217. package/clients/cli/lib/define-command.mjs +2 -2
  218. package/clients/cli/lib/json-shim.mjs +3 -1
  219. package/clients/cli/lib/manifest.d.ts +9 -0
  220. package/clients/cli/lib/manifest.mjs +17 -1
  221. package/clients/cli/lib/manifest.test.mjs +25 -0
  222. package/foundation/agent-docs/agent-doc-state.d.mts +21 -6
  223. package/foundation/agent-docs/agent-doc-state.mjs +29 -7
  224. package/foundation/agent-docs/agent-docs.d.mts +2 -2
  225. package/foundation/agent-docs/agent-docs.mjs +3 -3
  226. package/foundation/agent-docs/computer-agent-text.d.mts +133 -0
  227. package/foundation/agent-docs/computer-agent-text.mjs +623 -0
  228. package/foundation/agent-docs/computer-agent-text.test.mjs +602 -0
  229. package/foundation/config/project.d.mts +35 -3
  230. package/foundation/config/project.mjs +145 -8
  231. package/foundation/config/project.test.mjs +66 -0
  232. package/foundation/config/theme-state.mjs +5 -4
  233. package/foundation/discovery/cli-self-docs.mjs +20 -3
  234. package/foundation/discovery/cli-self-docs.test.mjs +3 -2
  235. package/foundation/discovery/component-replacement.mjs +2 -1
  236. package/foundation/discovery/runner-allowlist.d.mts +40 -0
  237. package/foundation/discovery/runner-allowlist.mjs +53 -0
  238. package/foundation/discovery/template-needs.mjs +5 -2
  239. package/foundation/discovery/theme-imports.mjs +8 -4
  240. package/foundation/discovery/theme-imports.test.mjs +1 -1
  241. package/foundation/doc-compiler/doc-loads.test.mjs +20 -0
  242. package/foundation/doc-compiler/inputs.mjs +4 -1
  243. package/foundation/doc-compiler/read.d.mts +1 -1
  244. package/foundation/doc-compiler/tree.test.mjs +1 -1
  245. package/foundation/env/cli-command.d.mts +83 -0
  246. package/foundation/env/cli-command.mjs +152 -0
  247. package/foundation/env/cli-command.test.mjs +129 -0
  248. package/foundation/env/node-version.test.mjs +15 -3
  249. package/foundation/env/package-manager.d.mts +61 -9
  250. package/foundation/env/package-manager.global.test.mjs +66 -0
  251. package/foundation/env/package-manager.mjs +137 -13
  252. package/foundation/env/package-manager.test.mjs +148 -9
  253. package/foundation/env/project-scope.d.mts +9 -0
  254. package/foundation/env/project-scope.mjs +33 -0
  255. package/foundation/env/search-path.d.mts +42 -0
  256. package/foundation/env/search-path.mjs +205 -0
  257. package/foundation/env/search-path.test.mjs +122 -0
  258. package/foundation/env/user-dirs.d.mts +39 -0
  259. package/foundation/env/user-dirs.mjs +93 -0
  260. package/foundation/env/user-dirs.test.mjs +72 -0
  261. package/foundation/env/user-settings.d.mts +46 -0
  262. package/foundation/env/user-settings.mjs +106 -0
  263. package/foundation/env/user-settings.test.mjs +64 -0
  264. package/foundation/fs/file-protection.mjs +15 -1
  265. package/foundation/fs/module-loader.stdout.test.mjs +3 -2
  266. package/foundation/fs/path-compare.d.mts +33 -0
  267. package/foundation/fs/path-compare.mjs +73 -0
  268. package/foundation/fs/paths.d.mts +57 -1
  269. package/foundation/fs/paths.mjs +131 -3
  270. package/foundation/fs/paths.test.mjs +10 -1
  271. package/foundation/integrations/computer-integrations.d.mts +78 -0
  272. package/foundation/integrations/computer-integrations.mjs +316 -0
  273. package/foundation/integrations/computer-integrations.test.mjs +292 -0
  274. package/foundation/integrations/integration-warnings.mjs +3 -2
  275. package/foundation/integrations/integration-warnings.test.mjs +8 -9
  276. package/foundation/integrations/integrations.d.mts +25 -1
  277. package/foundation/integrations/integrations.mjs +46 -3
  278. package/foundation/integrations/validate-contributions.d.mts +2 -0
  279. package/foundation/integrations/validate-contributions.mjs +11 -0
  280. package/foundation/release/agent-text-worker.d.mts +4 -0
  281. package/foundation/release/agent-text-worker.mjs +52 -0
  282. package/foundation/release/cache.d.mts +310 -0
  283. package/foundation/release/cache.mjs +1216 -0
  284. package/foundation/release/cache.test.mjs +920 -0
  285. package/foundation/release/choose.d.mts +207 -0
  286. package/foundation/release/choose.mjs +677 -0
  287. package/foundation/release/choose.test.mjs +427 -0
  288. package/foundation/release/core-worker.d.mts +4 -0
  289. package/foundation/release/core-worker.mjs +38 -0
  290. package/foundation/release/global-state.d.mts +259 -0
  291. package/foundation/release/global-state.mjs +472 -0
  292. package/foundation/release/global-state.test.mjs +381 -0
  293. package/foundation/release/handoff.d.mts +60 -0
  294. package/foundation/release/handoff.e2e.test.mjs +278 -0
  295. package/foundation/release/handoff.mjs +357 -0
  296. package/foundation/release/lock-lease.d.mts +23 -0
  297. package/foundation/release/lock-lease.mjs +80 -0
  298. package/foundation/release/notices.d.mts +253 -0
  299. package/foundation/release/notices.mjs +596 -0
  300. package/foundation/release/notices.test.mjs +565 -0
  301. package/foundation/release/npm-guard.d.mts +4 -0
  302. package/foundation/release/npm-guard.mjs +126 -0
  303. package/foundation/release/project.d.mts +141 -0
  304. package/foundation/release/project.mjs +466 -0
  305. package/foundation/release/project.test.mjs +288 -0
  306. package/foundation/release/refresh-worker.d.mts +4 -0
  307. package/foundation/release/refresh-worker.mjs +27 -0
  308. package/foundation/release/run-context.d.mts +47 -0
  309. package/foundation/release/run-context.mjs +149 -0
  310. package/foundation/release/update-notice-env.d.mts +28 -0
  311. package/foundation/release/update-notice-env.mjs +39 -0
  312. package/foundation/response/base.d.ts +26 -3
  313. package/foundation/response/error-codes.d.mts +3 -1
  314. package/foundation/response/error-codes.doc.mjs +12 -0
  315. package/foundation/response/error-codes.mjs +17 -0
  316. package/foundation/response/error-codes.test.mjs +2 -0
  317. package/foundation/response/json-contract.test.mjs +7 -2
  318. package/foundation/response/json.mjs +4 -1
  319. package/foundation/response/response-types.doc.mjs +8 -3
  320. package/foundation/response/response-types.doc.test.mjs +46 -0
  321. package/foundation/response/response.doc.mjs +3 -3
  322. package/foundation/xle/browser-imports.test.mjs +74 -0
  323. package/package.json +9 -9
  324. package/scripts/postinstall.mjs +21 -2
@@ -12,10 +12,10 @@
12
12
  */
13
13
 
14
14
  import * as path from 'node:path';
15
- import {findCoreDir} from '../../../foundation/fs/paths.mjs';
15
+ import {requireThemeCoreDir} from '../_adapter.mjs';
16
16
  import {collectThemingTargets} from '../../../foundation/discovery/theming-targets.mjs';
17
17
  import {ERROR_CODES} from '../../../foundation/response/error-codes.mjs';
18
- import {AstryxError} from '../../error.mjs';
18
+ import {AstryxError, coreDirOrThrow} from '../../error.mjs';
19
19
 
20
20
  /**
21
21
  * Whether a target matches the caller's filter loosely: any target whose key,
@@ -46,14 +46,7 @@ function matchesLoosely(target, filter) {
46
46
  * @returns {Promise<import('../theme.type.mjs').ThemeTargetsResponse>}
47
47
  */
48
48
  export async function themeTargets(filter, {cwd = process.cwd()} = {}) {
49
- const coreDir = findCoreDir(cwd);
50
- if (!coreDir) {
51
- throw new AstryxError(
52
- 'Could not find @astryxdesign/core package',
53
- undefined,
54
- ERROR_CODES.ERR_CORE_NOT_FOUND,
55
- );
56
- }
49
+ const coreDir = coreDirOrThrow(requireThemeCoreDir, cwd);
57
50
 
58
51
  const all = await collectThemingTargets(path.join(coreDir, 'src'));
59
52
  const needle = filter ? String(filter).toLowerCase() : null;
@@ -62,6 +62,10 @@ export const doc = {
62
62
  code: 'ERR_CORE_NOT_FOUND',
63
63
  when: '@astryxdesign/core cannot be resolved from cwd',
64
64
  },
65
+ {
66
+ code: 'ERR_VERSIONS_UNAVAILABLE',
67
+ when: 'outside a project, or in a project with nothing installed, the Core of the release that answers is not beside it or cached, and cannot be installed into the per-user cache (offline, a registry without it, or an unwritable cache)',
68
+ },
65
69
  {code: 'ERR_UNKNOWN_COMPONENT', when: 'a filter matches no target'},
66
70
  ],
67
71
  examples: [
@@ -92,7 +92,7 @@ describe('themeUse', () => {
92
92
  it('names theme add when the slug is not added', async () => {
93
93
  await expect(themeUse('missing', {cwd: tmpDir})).rejects.toMatchObject({
94
94
  code: 'ERR_UNKNOWN_THEME',
95
- message: expect.stringContaining('astryx theme add missing'),
95
+ message: expect.stringContaining(' theme add missing`'),
96
96
  });
97
97
  });
98
98
  });
@@ -478,7 +478,7 @@ export async function loadProjectContext(cwd, extraIntegrationSpecs = []) {
478
478
  // The CLI debug preflight may already have imported this config before core
479
479
  // CONFIG codemods run. Upgrade needs the bytes now on disk, not that module
480
480
  // cache entry; ordinary Project discovery remains cached by default.
481
- const project = await Project.load(cwd, {fresh: true});
481
+ const project = await Project.load(cwd, {fresh: true, core: 'project'});
482
482
  const postCodemodHooks = project.config.hooks?.postCodemod ?? [];
483
483
  const configuredSpecs = new Set(project.integrations ?? []);
484
484
  // Configured packages come from Project, which has already resolved provider
@@ -52,6 +52,7 @@ import {
52
52
  } from '../status/status.mjs';
53
53
  import {semverGte} from '../../../foundation/env/semver.mjs';
54
54
  import {getCliInvocation} from '../../../foundation/env/package-manager.mjs';
55
+ import {isOutsideProject} from '../../../foundation/env/project-scope.mjs';
55
56
  import {ERROR_CODES} from '../../../foundation/response/error-codes.mjs';
56
57
  import {AstryxError} from '../../error.mjs';
57
58
  import {logger} from '../../logger.mjs';
@@ -153,7 +154,10 @@ export async function run(options = {}, {cwd = process.cwd()} = {}) {
153
154
  const currentVersion = /** @type {string} */ (options.from);
154
155
  const installed = detectInstalledTargetVersion(cwd);
155
156
  if (!installed) {
156
- const msg = `Could not find installed @astryxdesign/core (or legacy @xds/core). Install the target version first, then rerun \`${getCliInvocation()} upgrade --from <old-version>\`.`;
157
+ // Outside a project there is no version to install (spec AST-081 FR3).
158
+ const msg = isOutsideProject(cwd)
159
+ ? 'Could not find installed @astryxdesign/core (or legacy @xds/core). This folder is outside a project; upgrade migrates the code of an app project that installs @astryxdesign/core.'
160
+ : `Could not find installed @astryxdesign/core (or legacy @xds/core). Install the target version first, then rerun \`${getCliInvocation()} upgrade --from <old-version>\`.`;
157
161
  logger.error(msg);
158
162
  logger.log('Aborted\n');
159
163
  throw new AstryxError(msg, undefined, ERROR_CODES.ERR_VERSION_DETECT);
@@ -24,7 +24,8 @@ export const doc = {
24
24
  'and conflicts are left untouched. `list` only lists codemods; `registry` only updates ' +
25
25
  'copied compositions. Core codemods ship inside the CLI, so a CLI older than the installed ' +
26
26
  'Core has none for the releases after its own version: the result then carries ' +
27
- '`cliBehindCore` with the command that runs the same upgrade on the matching CLI.',
27
+ '`cliBehindCore` with the command that runs the same upgrade on the matching CLI.' +
28
+ " In global mode: in a project, the CLI runs `upgrade` with the project's own CLI, whichever astryx command started it (in a project with no CLI of its own, the one you started); this function runs the codemods of the package it is imported from. With `cwd` outside a project, `list` lists this release's codemods, `registry` finds no copied compositions, and a migration writes nothing and fails with `ERR_VERSION_DETECT`. See {@link namespace:global} and {@link generic:who-answers}.",
28
29
  importPath: '@astryxdesign/cli/api',
29
30
  signature:
30
31
  'upgrade(options?: UpgradeOptions, ctx?: {cwd?: string}): Promise<UpgradeListResponse | UpgradeRegistryResponse | UpgradeStatusResponse | UpgradeRunResponse>',
@@ -26,6 +26,7 @@ import {registryUpgrade} from './registry/registry.mjs';
26
26
  import {run} from './run/run.mjs';
27
27
  import {isValidSemver} from '../../foundation/env/semver.mjs';
28
28
  import {getCliInvocation} from '../../foundation/env/package-manager.mjs';
29
+ import {isOutsideProject} from '../../foundation/env/project-scope.mjs';
29
30
  import {ERROR_CODES} from '../../foundation/response/error-codes.mjs';
30
31
  import {AstryxError} from '../error.mjs';
31
32
  import {logger} from '../logger.mjs';
@@ -91,7 +92,10 @@ export async function upgrade(options = {}, {cwd = process.cwd()} = {}) {
91
92
  }
92
93
 
93
94
  if (!options.list && !options.from) {
94
- const msg = `Missing required --from. Install the target version first, then run \`${getCliInvocation()} upgrade --from <old-version>\`.`;
95
+ // Outside a project there is no version to install (spec AST-081 FR3).
96
+ const msg = isOutsideProject(cwd)
97
+ ? 'Missing required --from. This folder is outside a project; upgrade migrates the code of an app project that installs @astryxdesign/core.'
98
+ : `Missing required --from. Install the target version first, then run \`${getCliInvocation()} upgrade --from <old-version>\`.`;
95
99
  logger.error(msg);
96
100
  logger.log('Aborted\n');
97
101
  throw new AstryxError(msg, undefined, ERROR_CODES.ERR_INVALID_ARGUMENT);
@@ -21,7 +21,7 @@ export const docs = {
21
21
  type: 'code',
22
22
  lang: 'text',
23
23
  label: 'Set up the design system',
24
- code: 'Install @astryxdesign/core, @stylexjs/stylex, @astryxdesign/theme-neutral, and @astryxdesign/cli in this project, then run `npx @astryxdesign/cli init` to set up agent docs. Read the generated files to learn the conventions.',
24
+ code: 'Install @astryxdesign/core, @stylexjs/stylex, @astryxdesign/theme-neutral, and @astryxdesign/cli in this project, then run `astryx init` to set up agent docs. Read the generated files to learn the conventions.',
25
25
  },
26
26
  {
27
27
  type: 'prose',
@@ -31,7 +31,7 @@ export const docs = {
31
31
  type: 'code',
32
32
  lang: 'text',
33
33
  label: 'Give it a look',
34
- code: 'Ask me what look and feel this app should have. Run `npx @astryxdesign/cli theme list`, install the closest theme package, and run `theme add <slug>`; use `--package` when owners share a slug. Import `themes` and `defaultThemeSlug` from the generated module once and pass `themes[defaultThemeSlug]` to `<Theme>`. Customize with `defineTheme({extends: importedTheme, ...})`. Use `theme eject` only when I ask for an independent source fork. Default to neutral if I have no preference, and show me the result before moving on.',
34
+ code: 'Ask me what look and feel this app should have. Run `astryx theme list`, install the closest theme package, and run `theme add <slug>`; use `--package` when owners share a slug. Import `themes` and `defaultThemeSlug` from the generated module once and pass `themes[defaultThemeSlug]` to `<Theme>`. Customize with `defineTheme({extends: importedTheme, ...})`. Use `theme eject` only when I ask for an independent source fork. Default to neutral if I have no preference, and show me the result before moving on.',
35
35
  },
36
36
  ],
37
37
  },
@@ -60,7 +60,27 @@ export const docs = {
60
60
  type: 'code',
61
61
  lang: 'bash',
62
62
  label: 'Terminal',
63
- code: `npx astryx init`,
63
+ code: `astryx init`,
64
+ },
65
+ ],
66
+ },
67
+ {
68
+ id: 'install-once',
69
+ title: 'Install once, use everywhere',
70
+ content: [
71
+ {
72
+ type: 'prose',
73
+ text: "Install the CLI once for your computer too, and the astryx command works in any folder, for you and for any coding agent, even before a project exists. Inside a project, the project's own version still answers, so a global install never changes what your team and CI get. Keep it in the project as well; that is the recommended setup.",
74
+ },
75
+ {
76
+ type: 'code',
77
+ lang: 'bash',
78
+ label: 'Terminal',
79
+ code: `npm i -g @astryxdesign/cli`,
80
+ },
81
+ {
82
+ type: 'prose',
83
+ text: 'Project, global, or both: {@link generic:project-global-or-both}. Everything else about global mode: {@link namespace:global}.',
64
84
  },
65
85
  ],
66
86
  },
@@ -45,7 +45,7 @@ export const docs = {
45
45
  {
46
46
  type: 'code',
47
47
  lang: 'bash',
48
- code: 'npx astryx integration add component AcmeCarousel',
48
+ code: 'astryx integration add component AcmeCarousel',
49
49
  },
50
50
  {
51
51
  type: 'code',
@@ -81,5 +81,15 @@ Declare component root ./components in astryx.integration.mjs.
81
81
  },
82
82
  ],
83
83
  },
84
+ {
85
+ id: 'global-mode',
86
+ title: 'In global mode',
87
+ content: [
88
+ {
89
+ type: 'prose',
90
+ text: "In global mode: when users install your package for their computer, beside the global CLI, your components show up in folders outside any project; inside a project, only if the project installs your package. See {@link namespace:global} and {@link generic:global-integrations}.",
91
+ },
92
+ ],
93
+ },
84
94
  ],
85
95
  };
@@ -26,7 +26,7 @@ export const docs = {
26
26
  {
27
27
  type: 'code',
28
28
  lang: 'bash',
29
- code: 'npx astryx integration add theme ocean',
29
+ code: 'astryx integration add theme ocean',
30
30
  },
31
31
  {
32
32
  type: 'code',
@@ -63,7 +63,7 @@ Declare theme root ./themes in astryx.integration.mjs.
63
63
  {
64
64
  type: 'code',
65
65
  lang: 'bash',
66
- code: 'npx astryx integration add theme ocean --from neutral',
66
+ code: 'astryx integration add theme ocean --from neutral',
67
67
  },
68
68
  {
69
69
  type: 'prose',
@@ -85,5 +85,15 @@ Declare theme root ./themes in astryx.integration.mjs.
85
85
  },
86
86
  ],
87
87
  },
88
+ {
89
+ id: 'global-mode',
90
+ title: 'In global mode',
91
+ content: [
92
+ {
93
+ type: 'prose',
94
+ text: 'In global mode: when users install your package for their computer, beside the global CLI, your themes are listed in folders outside any project, where `theme add` lists but writes nothing; inside a project, only if the project installs your package. See {@link namespace:global} and {@link generic:global-integrations}.',
95
+ },
96
+ ],
97
+ },
88
98
  ],
89
99
  };
@@ -27,7 +27,7 @@ export const docs = {
27
27
  {
28
28
  type: 'code',
29
29
  lang: 'bash',
30
- code: 'npx astryx integration add doc deploying\n# Read it the way an app will\nnpx astryx docs deploying',
30
+ code: 'astryx integration add doc deploying\n# Read it the way an app will\nastryx docs deploying',
31
31
  },
32
32
  {
33
33
  type: 'code',
@@ -73,6 +73,38 @@ export const docs = {
73
73
  },
74
74
  ],
75
75
  },
76
+ {
77
+ id: 'write-commands-without-a-runner',
78
+ title: 'Write commands without a runner',
79
+ content: [
80
+ {
81
+ type: 'prose',
82
+ text: 'Start every CLI command in a doc with the word astryx alone, with no runner such as npx or pnpm exec in front. The CLI prefixes each one when it prints the doc, with the command the reader runs: `pnpm exec astryx` or `yarn astryx` from their package manager, or the `cliCommand` an integration sets. See {@link generic:cli-command}.',
83
+ },
84
+ {
85
+ type: 'code',
86
+ lang: 'javascript',
87
+ label: 'docs/deploying.doc.mjs',
88
+ code: "{type: 'prose', text: 'Check the app with `astryx doctor` before you ship.'},\n{type: 'code', lang: 'bash', code: 'astryx doctor'},",
89
+ },
90
+ {
91
+ type: 'code',
92
+ lang: 'text',
93
+ label:
94
+ "Read in an app whose integration sets cliCommand: 'acme astryx'",
95
+ code: 'Check the app with `acme astryx doctor` before you ship.\n\n```bash\nacme astryx doctor\n```',
96
+ },
97
+ {
98
+ type: 'list',
99
+ style: 'unordered',
100
+ items: [
101
+ 'The CLI prefixes an inline code span that starts with the word astryx, a command at the start of a line, or after `&&`, `||`, `;` or `|`, in a `bash`, `sh`, `shell`, `zsh`, `console`, `text` or `markdown` code block or one with no language, and a table cell that holds only a command.',
102
+ 'Code in other languages, such as a `js` example, and the word astryx in plain prose stay as written.',
103
+ '`--json` returns the doc as written, so a reader that shows it prefixes the commands itself.',
104
+ ],
105
+ },
106
+ ],
107
+ },
76
108
  {
77
109
  id: 'pick-the-doc-kind',
78
110
  title: 'Pick the doc kind',
@@ -143,5 +175,15 @@ export const docs = {
143
175
  },
144
176
  ],
145
177
  },
178
+ {
179
+ id: 'global-mode',
180
+ title: 'In global mode',
181
+ content: [
182
+ {
183
+ type: 'prose',
184
+ text: 'In global mode: when users install your package for their computer, beside the global CLI, your doc topics show up in folders outside any project; inside a project, only if the project installs your package. See {@link namespace:global} and {@link generic:global-integrations}.',
185
+ },
186
+ ],
187
+ },
146
188
  ],
147
189
  };
@@ -27,7 +27,7 @@ export const docs = {
27
27
  {
28
28
  type: 'code',
29
29
  lang: 'bash',
30
- code: "npx astryx integration add agent-doc 'Use AcmeCarousel for rotating content.'",
30
+ code: "astryx integration add agent-doc 'Use AcmeCarousel for rotating content.'",
31
31
  },
32
32
  {
33
33
  type: 'prose',
@@ -80,6 +80,10 @@ export default {
80
80
  type: 'prose',
81
81
  text: 'A line is one line of plain text. Line breaks, control characters, spaces at either end, and managed-block markers such as `<!-- ASTRYX:START -->` are rejected.',
82
82
  },
83
+ {
84
+ type: 'prose',
85
+ text: 'Start a command in a line with the word astryx alone, with no runner in front, as in: Run astryx doctor before finishing. The block names the command the app runs once, at its top, for every command below it, so your line works in every app. See {@link generic:cli-command}.',
86
+ },
83
87
  ],
84
88
  },
85
89
  {
@@ -93,7 +97,7 @@ export default {
93
97
  {
94
98
  type: 'code',
95
99
  lang: 'bash',
96
- code: 'npx astryx init --features agents',
100
+ code: 'astryx init --features agents',
97
101
  },
98
102
  {
99
103
  type: 'code',
@@ -119,9 +123,9 @@ export default {
119
123
  {
120
124
  type: 'code',
121
125
  lang: 'bash',
122
- code: `npx astryx init --features agents
126
+ code: `astryx init --features agents
123
127
  # Or: --from takes the Core version the app had before
124
- npx astryx upgrade --from <version> --apply`,
128
+ astryx upgrade --from <version> --apply`,
125
129
  },
126
130
  {
127
131
  type: 'code',
@@ -134,5 +138,15 @@ npx astryx upgrade --from <version> --apply`,
134
138
  },
135
139
  ],
136
140
  },
141
+ {
142
+ id: 'global-mode',
143
+ title: 'In global mode',
144
+ content: [
145
+ {
146
+ type: 'prose',
147
+ text: "In global mode: the agent guide the CLI keeps for the computer carries no integration's guidance, because it serves every folder; your guidance reaches agents through the agent docs `init` writes in an app that installs your package. See {@link namespace:global} and {@link generic:computer-agent-guide}.",
148
+ },
149
+ ],
150
+ },
137
151
  ],
138
152
  };
@@ -23,6 +23,10 @@ export const docs = {
23
23
  },
24
24
  },
25
25
  blocks: [
26
+ {
27
+ type: 'prose',
28
+ text: 'In global mode: every kind your package adds also applies outside projects when users install it for their computer, beside the global CLI; inside a project, only if the project installs it. See {@link namespace:global} and {@link generic:global-integrations}.',
29
+ },
26
30
  {
27
31
  type: 'prose',
28
32
  text: 'These are everything you can add to an integration. Mix them however you like. You are not limited to any one thing.',
@@ -37,7 +37,7 @@ export const docs = {
37
37
  {
38
38
  type: 'code',
39
39
  lang: 'bash',
40
- code: 'npx astryx doctor integration components',
40
+ code: 'astryx doctor integration components',
41
41
  },
42
42
  {
43
43
  type: 'code',
@@ -27,7 +27,7 @@ export const docs = {
27
27
  {
28
28
  type: 'code',
29
29
  lang: 'bash',
30
- code: 'npx astryx doctor integration docs\n# In an app, check an installed package\nnpx astryx doctor integration docs @acme/astryx-widgets',
30
+ code: 'astryx doctor integration docs\n# In an app, check an installed package\nastryx doctor integration docs @acme/astryx-widgets',
31
31
  },
32
32
  {
33
33
  type: 'code',
@@ -109,7 +109,7 @@ export const docs = {
109
109
  {
110
110
  type: 'code',
111
111
  lang: 'bash',
112
- code: 'npx astryx doctor integration validate',
112
+ code: 'astryx doctor integration validate',
113
113
  },
114
114
  {
115
115
  type: 'code',
@@ -144,12 +144,12 @@ fix: Remove \`summary\`: SingleComponentDoc has no field \`summary\`.`,
144
144
  content: [
145
145
  {
146
146
  type: 'prose',
147
- text: '`npx astryx doctor` also measures every read and warns on one over 32 KB. Run it in your package or in an app that installs it; `doctor integration docs` does not check size.',
147
+ text: '`astryx doctor` also measures every read and warns on one over 32 KB. Run it in your package or in an app that installs it; `doctor integration docs` does not check size.',
148
148
  },
149
149
  {
150
150
  type: 'code',
151
151
  lang: 'bash',
152
- code: 'npx astryx doctor',
152
+ code: 'astryx doctor',
153
153
  },
154
154
  {
155
155
  type: 'code',
@@ -173,7 +173,7 @@ fix: Remove \`summary\`: SingleComponentDoc has no field \`summary\`.`,
173
173
  {
174
174
  type: 'code',
175
175
  lang: 'bash',
176
- code: 'npx astryx integration verify',
176
+ code: 'astryx integration verify',
177
177
  },
178
178
  {
179
179
  type: 'code',
@@ -29,37 +29,37 @@ export const docs = {
29
29
  headers: ['Command', 'Proves', 'Exits 1 when', 'Only warns when'],
30
30
  rows: [
31
31
  [
32
- '`npx astryx doctor integration validate`',
32
+ '`astryx doctor integration validate`',
33
33
  'The manifest loads, each root holds contributions the CLI can read, and each doc matches its authoring type',
34
34
  'A declared root is missing (`missing_root`), a contribution does not load (`invalid_doc`, `invalid_component`, `invalid_theme`), or two templates in the package replace one Core id (`ambiguous_template_replacement`)',
35
35
  "The manifest has a key this CLI does not know (`unknown_manifest_key`), or a doc field does not match the doc's authoring type: a field the type does not have, a missing required field, or a value outside the field's type. It also warns on what no reader can serve: a prop listed twice (`duplicate_prop`), a `propDescriptions` key that names no documented prop (`unknown_translated_prop`), a section with no content (`empty_section`), two sections of a topic with one key (`duplicate_section_key`), or a `.doc.zh.mjs` or `.doc.dense.mjs` overlay beside no topic file (`orphan_doc_overlay`). It checks docs with your installed `typescript`, or, where that is missing or has no JavaScript compiler API (TypeScript 7), with an installed `@typescript/typescript6`; without either, it prints `[skip] Docs not type-checked`. With no `astryx.integration.mjs` it prints a hint and exits 0",
36
36
  ],
37
37
  [
38
- '`npx astryx doctor integration components`',
38
+ '`astryx doctor integration components`',
39
39
  "No component name clashes with a Core component, each `replaces` names one Core component, and each component doc's props match the component's TypeScript props",
40
40
  'Core is not installed (`core_not_found`). In a package that declares the CLI range that turns replacement on, a `replaces` target is missing (`missing_component_replacement_target`) or invalid (`invalid_component_replacement`), or two components replace one Core component (`ambiguous_component_replacement`)',
41
41
  'A name clashes with Core, a component sets `replaces` in a package without that range (`inactive_component_replacement`, plus any missing, invalid, or duplicate `replaces` reported as a warning), or a documented prop differs from the code: it is missing there (`not_in_code`), the doc omits a prop the package declares (`not_in_doc`), or its `required` (`required_mismatch`), type (`type_mismatch`), or literal `default` (`default_mismatch`) disagrees, or a `{@link}` in a component doc names no doc (`invalid_doc_graph`). It reads props with your installed `typescript`; without it, it prints `[skip] Props not compared`',
42
42
  ],
43
43
  [
44
- '`npx astryx doctor integration templates`',
44
+ '`astryx doctor integration templates`',
45
45
  'Each `replaces` names a Core template of the same type',
46
46
  'A `replaces` target is missing (`missing_template_replacement_target`) or of the other type (`invalid_template_replacement`), or two templates replace one id (`ambiguous_template_replacement`)',
47
47
  'A template id matches a Core id without `replaces`',
48
48
  ],
49
49
  [
50
- '`npx astryx doctor integration docs`',
50
+ '`astryx doctor integration docs`',
51
51
  'Your docs tree, every link, topic names against Core, passages two topics repeat word for word, padding phrases and low-density topics, and written pointers to docs',
52
52
  'A topic takes a Core topic name without `replaces` or `extends`, a doc is invalid (`invalid_doc`), or a namespace or placement fails, which hides the doc (`invalid_doc_graph`)',
53
53
  'A link names no doc (`invalid_doc_graph`), two topics repeat a passage word for word (`copied_passage`), prose pads with a listed phrase or falls under the density floor (`doc_fluff`), or prose, a description or summary, or the text of a component doc writes `astryx docs <name>` where a link would be checked (`stray_doc_pointer`)',
54
54
  ],
55
55
  [
56
- '`npx astryx integration check`',
56
+ '`astryx integration check`',
57
57
  'Everything the four `doctor integration` checks prove, in one command, for your build',
58
58
  'Any of the four would exit 1 on its own. With `--strict`, also any warning, and any check that did not run, such as a package with no `astryx.integration.*`',
59
59
  'Anything the four warn about, unless you pass `--strict`',
60
60
  ],
61
61
  [
62
- '`npx astryx integration verify`',
62
+ '`astryx integration verify`',
63
63
  'The packed package holds every file, shows the same contributions, resolves every public import, and declares the CLI it needs',
64
64
  'Anything `validate` fails on, no manifest, a file left out of the `.tgz` file, an import that does not resolve, or a missing CLI peer',
65
65
  'Anything `validate` warns about, or a component sets `replaces` and the package does not declare the CLI range that turns it on (`component_replaces_needs_cli`)',
@@ -68,7 +68,7 @@ export const docs = {
68
68
  },
69
69
  {
70
70
  type: 'prose',
71
- text: 'Pass a package name, such as `npx astryx doctor integration validate @acme/astryx-widgets`, to check an installed copy from an app instead. To fix a props finding, see {@link generic:check-the-props}.',
71
+ text: 'Pass a package name, such as `astryx doctor integration validate @acme/astryx-widgets`, to check an installed copy from an app instead. To fix a props finding, see {@link generic:check-the-props}.',
72
72
  },
73
73
  ],
74
74
  },
@@ -92,8 +92,8 @@ export const docs = {
92
92
  '`integration check` runs `validate`, `components`, `templates`, and `docs` in that order, prints each result, then a summary, and exits 1 when any of them would.',
93
93
  '`--strict` also exits 1 on any warning and on any check that did not run. Without it, warnings keep exit code 0: use that while you fix the warnings a package already has.',
94
94
  'Its exit codes and JSON are a contract for your build: a new check, or a new failure code, joins only in a minor release that names it in the release notes. A patch can still ship a Core component, template, or CLI topic whose name conflicts with one of yours.',
95
- '`integration verify` runs `validate` but none of the other three: a Core name clash, a `replaces` that names no Core template, a topic that takes a Core name, or a hidden guide still passes it. Run both before you publish: `npx astryx integration check --strict && npx astryx integration verify`.',
96
- 'Bare `npx astryx doctor` in the package also warns about a doc section over 32 KB, which no check above measures.',
95
+ '`integration verify` runs `validate` but none of the other three: a Core name clash, a `replaces` that names no Core template, a topic that takes a Core name, or a hidden guide still passes it. Run both before you publish: `astryx integration check --strict && astryx integration verify`.',
96
+ 'Bare `astryx doctor` in the package also warns about a doc section over 32 KB, which no check above measures.',
97
97
  ],
98
98
  },
99
99
  ],
@@ -0,0 +1,88 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file `astryx docs global/ci-and-containers`: Astryx in CI and containers: no
5
+ * update checks, caching versions, read-only home folders (spec AST-081 FR6,
6
+ * FR7, FR10).
7
+ */
8
+
9
+ /** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
10
+ export const docs = {
11
+ type: 'generic',
12
+ name: 'ci-and-containers',
13
+ placement: {
14
+ parent: 'namespace:global',
15
+ slot: 'guides',
16
+ order: 8,
17
+ },
18
+ title: 'CI and containers',
19
+ category: 'guide',
20
+ keywords: [
21
+ 'ci',
22
+ 'github actions',
23
+ 'container',
24
+ 'docker',
25
+ 'read-only home',
26
+ 'cache the release cache',
27
+ ],
28
+ description:
29
+ "What Astryx does in CI and containers: no update checks or notices, the project's version as always, and how to cache versions or work with a read-only home folder.",
30
+ sections: [
31
+ {
32
+ id: 'in-ci',
33
+ title: 'In CI',
34
+ content: [
35
+ {
36
+ type: 'list',
37
+ style: 'unordered',
38
+ items: [
39
+ 'Most CI services set `CI=true`. When `CI` is set to anything but empty, `0`, or `false`, Astryx never checks for updates and never prints a notice; `CI=false`, `CI=0`, and an empty `CI` do not count. `NO_UPDATE_NOTIFIER`, set to anything, does the same anywhere.',
40
+ "Add `@astryxdesign/cli` to the project as a devDependency at the same version as `@astryxdesign/core`; then CI runs the version pinned in the repo, and nothing is fetched. A global install in a CI image also works: in a project, it runs the project's version.",
41
+ 'Use `--json` for output a script reads; it never carries the answered-by line or a notice.',
42
+ ],
43
+ },
44
+ ],
45
+ },
46
+ {
47
+ id: 'cache',
48
+ title: 'Cache project versions',
49
+ content: [
50
+ {
51
+ type: 'prose',
52
+ text: "When the project installs its own CLI and you install the project's dependencies first, there is nothing to cache. Astryx downloads into its cache only the CLI version a project whose own CLI cannot start needs, and, outside a project, the Core of a global install for commands that read components. In CI it downloads nothing in the background, so a global install in a CI image fetches that Core on its first component command. To skip those downloads on every run, cache this folder between runs:",
53
+ },
54
+ {
55
+ type: 'table',
56
+ headers: ['Linux', 'macOS', 'Windows'],
57
+ rows: [
58
+ [
59
+ '`~/.cache/astryx` (or `$XDG_CACHE_HOME/astryx`)',
60
+ '`~/Library/Caches/astryx`',
61
+ '`%LOCALAPPDATA%\\astryx\\Cache`',
62
+ ],
63
+ ],
64
+ },
65
+ ],
66
+ },
67
+ {
68
+ id: 'read-only',
69
+ title: 'Read-only home folders',
70
+ content: [
71
+ {
72
+ type: 'prose',
73
+ text: "When the cache cannot be written, a project whose own CLI cannot start is answered by the global install, with a warning naming the folder. Point `XDG_CACHE_HOME` at a writable absolute path, or reinstall the project's dependencies. The global install's daily check and agent guide are skipped quietly when they cannot be written.",
74
+ },
75
+ ],
76
+ },
77
+ {
78
+ id: 'more',
79
+ title: 'More on global mode',
80
+ content: [
81
+ {
82
+ type: 'prose',
83
+ text: 'This page is part of {@link namespace:global}, which explains what global mode is and how each part works.',
84
+ },
85
+ ],
86
+ },
87
+ ],
88
+ };