@endora-commerce/cli 0.100.0

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 (356) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +37 -0
  3. package/dist/bin/endora.d.ts +28 -0
  4. package/dist/bin/endora.d.ts.map +1 -0
  5. package/dist/bin/endora.js +926 -0
  6. package/dist/bin/endora.js.map +1 -0
  7. package/dist/check/estate.d.ts +189 -0
  8. package/dist/check/estate.d.ts.map +1 -0
  9. package/dist/check/estate.js +1037 -0
  10. package/dist/check/estate.js.map +1 -0
  11. package/dist/check/hosts.d.ts +25 -0
  12. package/dist/check/hosts.d.ts.map +1 -0
  13. package/dist/check/hosts.js +1347 -0
  14. package/dist/check/hosts.js.map +1 -0
  15. package/dist/check/index.d.ts +60 -0
  16. package/dist/check/index.d.ts.map +1 -0
  17. package/dist/check/index.js +111 -0
  18. package/dist/check/index.js.map +1 -0
  19. package/dist/check/layout.d.ts +136 -0
  20. package/dist/check/layout.d.ts.map +1 -0
  21. package/dist/check/layout.js +262 -0
  22. package/dist/check/layout.js.map +1 -0
  23. package/dist/check/ledger.d.ts +98 -0
  24. package/dist/check/ledger.d.ts.map +1 -0
  25. package/dist/check/ledger.js +173 -0
  26. package/dist/check/ledger.js.map +1 -0
  27. package/dist/check/peer-owners.d.ts +116 -0
  28. package/dist/check/peer-owners.d.ts.map +1 -0
  29. package/dist/check/peer-owners.js +225 -0
  30. package/dist/check/peer-owners.js.map +1 -0
  31. package/dist/check/report.d.ts +33 -0
  32. package/dist/check/report.d.ts.map +1 -0
  33. package/dist/check/report.js +107 -0
  34. package/dist/check/report.js.map +1 -0
  35. package/dist/check/run.d.ts +147 -0
  36. package/dist/check/run.d.ts.map +1 -0
  37. package/dist/check/run.js +111 -0
  38. package/dist/check/run.js.map +1 -0
  39. package/dist/checks.d.ts +17 -0
  40. package/dist/checks.d.ts.map +1 -0
  41. package/dist/checks.js +17 -0
  42. package/dist/checks.js.map +1 -0
  43. package/dist/dev/index.d.ts +83 -0
  44. package/dist/dev/index.d.ts.map +1 -0
  45. package/dist/dev/index.js +298 -0
  46. package/dist/dev/index.js.map +1 -0
  47. package/dist/generate/divergence.d.ts +38 -0
  48. package/dist/generate/divergence.d.ts.map +1 -0
  49. package/dist/generate/divergence.js +237 -0
  50. package/dist/generate/divergence.js.map +1 -0
  51. package/dist/generate/index.d.ts +90 -0
  52. package/dist/generate/index.d.ts.map +1 -0
  53. package/dist/generate/index.js +369 -0
  54. package/dist/generate/index.js.map +1 -0
  55. package/dist/index.d.ts +23 -0
  56. package/dist/index.d.ts.map +1 -0
  57. package/dist/index.js +35 -0
  58. package/dist/index.js.map +1 -0
  59. package/dist/inputs/declaration.d.ts +18 -0
  60. package/dist/inputs/declaration.d.ts.map +1 -0
  61. package/dist/inputs/declaration.js +64 -0
  62. package/dist/inputs/declaration.js.map +1 -0
  63. package/dist/inputs/env-file.d.ts +73 -0
  64. package/dist/inputs/env-file.d.ts.map +1 -0
  65. package/dist/inputs/env-file.js +134 -0
  66. package/dist/inputs/env-file.js.map +1 -0
  67. package/dist/inputs/prompt.d.ts +21 -0
  68. package/dist/inputs/prompt.d.ts.map +1 -0
  69. package/dist/inputs/prompt.js +59 -0
  70. package/dist/inputs/prompt.js.map +1 -0
  71. package/dist/inputs/resolve.d.ts +163 -0
  72. package/dist/inputs/resolve.d.ts.map +1 -0
  73. package/dist/inputs/resolve.js +290 -0
  74. package/dist/inputs/resolve.js.map +1 -0
  75. package/dist/install/host.d.ts +27 -0
  76. package/dist/install/host.d.ts.map +1 -0
  77. package/dist/install/host.js +90 -0
  78. package/dist/install/host.js.map +1 -0
  79. package/dist/install/index.d.ts +173 -0
  80. package/dist/install/index.d.ts.map +1 -0
  81. package/dist/install/index.js +793 -0
  82. package/dist/install/index.js.map +1 -0
  83. package/dist/install/wizard.d.ts +144 -0
  84. package/dist/install/wizard.d.ts.map +1 -0
  85. package/dist/install/wizard.js +362 -0
  86. package/dist/install/wizard.js.map +1 -0
  87. package/dist/lib/admin-artefacts.d.ts +70 -0
  88. package/dist/lib/admin-artefacts.d.ts.map +1 -0
  89. package/dist/lib/admin-artefacts.js +354 -0
  90. package/dist/lib/admin-artefacts.js.map +1 -0
  91. package/dist/lib/admin-surfaces.d.ts +298 -0
  92. package/dist/lib/admin-surfaces.d.ts.map +1 -0
  93. package/dist/lib/admin-surfaces.js +669 -0
  94. package/dist/lib/admin-surfaces.js.map +1 -0
  95. package/dist/lib/delegated-composer.d.ts +85 -0
  96. package/dist/lib/delegated-composer.d.ts.map +1 -0
  97. package/dist/lib/delegated-composer.js +241 -0
  98. package/dist/lib/delegated-composer.js.map +1 -0
  99. package/dist/lib/divergence-artefacts.d.ts +305 -0
  100. package/dist/lib/divergence-artefacts.d.ts.map +1 -0
  101. package/dist/lib/divergence-artefacts.js +828 -0
  102. package/dist/lib/divergence-artefacts.js.map +1 -0
  103. package/dist/lib/divergence.d.ts +337 -0
  104. package/dist/lib/divergence.d.ts.map +1 -0
  105. package/dist/lib/divergence.js +1005 -0
  106. package/dist/lib/divergence.js.map +1 -0
  107. package/dist/lib/docs-artefacts.d.ts +395 -0
  108. package/dist/lib/docs-artefacts.d.ts.map +1 -0
  109. package/dist/lib/docs-artefacts.js +781 -0
  110. package/dist/lib/docs-artefacts.js.map +1 -0
  111. package/dist/lib/emitted-exports.d.ts +21 -0
  112. package/dist/lib/emitted-exports.d.ts.map +1 -0
  113. package/dist/lib/emitted-exports.js +96 -0
  114. package/dist/lib/emitted-exports.js.map +1 -0
  115. package/dist/lib/emitted-freshness.d.ts +112 -0
  116. package/dist/lib/emitted-freshness.d.ts.map +1 -0
  117. package/dist/lib/emitted-freshness.js +288 -0
  118. package/dist/lib/emitted-freshness.js.map +1 -0
  119. package/dist/lib/entity-index-artefact.d.ts +95 -0
  120. package/dist/lib/entity-index-artefact.d.ts.map +1 -0
  121. package/dist/lib/entity-index-artefact.js +210 -0
  122. package/dist/lib/entity-index-artefact.js.map +1 -0
  123. package/dist/lib/instance-build-inputs.d.ts +108 -0
  124. package/dist/lib/instance-build-inputs.d.ts.map +1 -0
  125. package/dist/lib/instance-build-inputs.js +165 -0
  126. package/dist/lib/instance-build-inputs.js.map +1 -0
  127. package/dist/lib/module-docs.d.ts +473 -0
  128. package/dist/lib/module-docs.d.ts.map +1 -0
  129. package/dist/lib/module-docs.js +711 -0
  130. package/dist/lib/module-docs.js.map +1 -0
  131. package/dist/lib/module-package-subpaths.d.ts +56 -0
  132. package/dist/lib/module-package-subpaths.d.ts.map +1 -0
  133. package/dist/lib/module-package-subpaths.js +223 -0
  134. package/dist/lib/module-package-subpaths.js.map +1 -0
  135. package/dist/lib/module-packages.d.ts +200 -0
  136. package/dist/lib/module-packages.d.ts.map +1 -0
  137. package/dist/lib/module-packages.js +580 -0
  138. package/dist/lib/module-packages.js.map +1 -0
  139. package/dist/lib/module-population.d.ts +129 -0
  140. package/dist/lib/module-population.d.ts.map +1 -0
  141. package/dist/lib/module-population.js +172 -0
  142. package/dist/lib/module-population.js.map +1 -0
  143. package/dist/lib/module-roots.d.ts +337 -0
  144. package/dist/lib/module-roots.d.ts.map +1 -0
  145. package/dist/lib/module-roots.js +586 -0
  146. package/dist/lib/module-roots.js.map +1 -0
  147. package/dist/lib/nested-checkouts.d.ts +33 -0
  148. package/dist/lib/nested-checkouts.d.ts.map +1 -0
  149. package/dist/lib/nested-checkouts.js +160 -0
  150. package/dist/lib/nested-checkouts.js.map +1 -0
  151. package/dist/lib/platform-root.d.ts +43 -0
  152. package/dist/lib/platform-root.d.ts.map +1 -0
  153. package/dist/lib/platform-root.js +134 -0
  154. package/dist/lib/platform-root.js.map +1 -0
  155. package/dist/lib/platform-surface.d.ts +235 -0
  156. package/dist/lib/platform-surface.d.ts.map +1 -0
  157. package/dist/lib/platform-surface.js +393 -0
  158. package/dist/lib/platform-surface.js.map +1 -0
  159. package/dist/lib/port-registrations.d.ts +223 -0
  160. package/dist/lib/port-registrations.d.ts.map +1 -0
  161. package/dist/lib/port-registrations.js +532 -0
  162. package/dist/lib/port-registrations.js.map +1 -0
  163. package/dist/lib/read-size.d.ts +154 -0
  164. package/dist/lib/read-size.d.ts.map +1 -0
  165. package/dist/lib/read-size.js +182 -0
  166. package/dist/lib/read-size.js.map +1 -0
  167. package/dist/lib/registration-owners.d.ts +79 -0
  168. package/dist/lib/registration-owners.d.ts.map +1 -0
  169. package/dist/lib/registration-owners.js +77 -0
  170. package/dist/lib/registration-owners.js.map +1 -0
  171. package/dist/lib/release-index.d.ts +53 -0
  172. package/dist/lib/release-index.d.ts.map +1 -0
  173. package/dist/lib/release-index.js +162 -0
  174. package/dist/lib/release-index.js.map +1 -0
  175. package/dist/lib/repeating-timers.d.ts +79 -0
  176. package/dist/lib/repeating-timers.d.ts.map +1 -0
  177. package/dist/lib/repeating-timers.js +189 -0
  178. package/dist/lib/repeating-timers.js.map +1 -0
  179. package/dist/lib/source-text.d.ts +34 -0
  180. package/dist/lib/source-text.d.ts.map +1 -0
  181. package/dist/lib/source-text.js +80 -0
  182. package/dist/lib/source-text.js.map +1 -0
  183. package/dist/lib/specifiers.d.ts +20 -0
  184. package/dist/lib/specifiers.d.ts.map +1 -0
  185. package/dist/lib/specifiers.js +130 -0
  186. package/dist/lib/specifiers.js.map +1 -0
  187. package/dist/lib/sql-tables.d.ts +166 -0
  188. package/dist/lib/sql-tables.d.ts.map +1 -0
  189. package/dist/lib/sql-tables.js +464 -0
  190. package/dist/lib/sql-tables.js.map +1 -0
  191. package/dist/lib/switchable-modules.d.ts +54 -0
  192. package/dist/lib/switchable-modules.d.ts.map +1 -0
  193. package/dist/lib/switchable-modules.js +104 -0
  194. package/dist/lib/switchable-modules.js.map +1 -0
  195. package/dist/lib/tailwind-sources.d.ts +136 -0
  196. package/dist/lib/tailwind-sources.d.ts.map +1 -0
  197. package/dist/lib/tailwind-sources.js +307 -0
  198. package/dist/lib/tailwind-sources.js.map +1 -0
  199. package/dist/lib/ui-layer.d.ts +54 -0
  200. package/dist/lib/ui-layer.d.ts.map +1 -0
  201. package/dist/lib/ui-layer.js +57 -0
  202. package/dist/lib/ui-layer.js.map +1 -0
  203. package/dist/lib/workspace-packages.d.ts +186 -0
  204. package/dist/lib/workspace-packages.d.ts.map +1 -0
  205. package/dist/lib/workspace-packages.js +351 -0
  206. package/dist/lib/workspace-packages.js.map +1 -0
  207. package/dist/new-instance/deploy.d.ts +211 -0
  208. package/dist/new-instance/deploy.d.ts.map +1 -0
  209. package/dist/new-instance/deploy.js +1381 -0
  210. package/dist/new-instance/deploy.js.map +1 -0
  211. package/dist/new-instance/docs-toolchain.d.ts +66 -0
  212. package/dist/new-instance/docs-toolchain.d.ts.map +1 -0
  213. package/dist/new-instance/docs-toolchain.js +69 -0
  214. package/dist/new-instance/docs-toolchain.js.map +1 -0
  215. package/dist/new-instance/host.d.ts +124 -0
  216. package/dist/new-instance/host.d.ts.map +1 -0
  217. package/dist/new-instance/host.js +276 -0
  218. package/dist/new-instance/host.js.map +1 -0
  219. package/dist/new-instance/index.d.ts +118 -0
  220. package/dist/new-instance/index.d.ts.map +1 -0
  221. package/dist/new-instance/index.js +567 -0
  222. package/dist/new-instance/index.js.map +1 -0
  223. package/dist/new-instance/modules.d.ts +188 -0
  224. package/dist/new-instance/modules.d.ts.map +1 -0
  225. package/dist/new-instance/modules.js +392 -0
  226. package/dist/new-instance/modules.js.map +1 -0
  227. package/dist/new-instance/template.d.ts +505 -0
  228. package/dist/new-instance/template.d.ts.map +1 -0
  229. package/dist/new-instance/template.js +1886 -0
  230. package/dist/new-instance/template.js.map +1 -0
  231. package/dist/new-module/emit.d.ts +67 -0
  232. package/dist/new-module/emit.d.ts.map +1 -0
  233. package/dist/new-module/emit.js +1393 -0
  234. package/dist/new-module/emit.js.map +1 -0
  235. package/dist/new-module/host.d.ts +67 -0
  236. package/dist/new-module/host.d.ts.map +1 -0
  237. package/dist/new-module/host.js +224 -0
  238. package/dist/new-module/host.js.map +1 -0
  239. package/dist/new-module/index.d.ts +32 -0
  240. package/dist/new-module/index.d.ts.map +1 -0
  241. package/dist/new-module/index.js +193 -0
  242. package/dist/new-module/index.js.map +1 -0
  243. package/dist/new-module/spec.d.ts +188 -0
  244. package/dist/new-module/spec.d.ts.map +1 -0
  245. package/dist/new-module/spec.js +404 -0
  246. package/dist/new-module/spec.js.map +1 -0
  247. package/dist/new-module/text.d.ts +15 -0
  248. package/dist/new-module/text.d.ts.map +1 -0
  249. package/dist/new-module/text.js +22 -0
  250. package/dist/new-module/text.js.map +1 -0
  251. package/dist/new-storefront/dockerfile.d.ts +20 -0
  252. package/dist/new-storefront/dockerfile.d.ts.map +1 -0
  253. package/dist/new-storefront/dockerfile.js +131 -0
  254. package/dist/new-storefront/dockerfile.js.map +1 -0
  255. package/dist/new-storefront/gitignore.d.ts +23 -0
  256. package/dist/new-storefront/gitignore.d.ts.map +1 -0
  257. package/dist/new-storefront/gitignore.js +39 -0
  258. package/dist/new-storefront/gitignore.js.map +1 -0
  259. package/dist/new-storefront/index.d.ts +93 -0
  260. package/dist/new-storefront/index.d.ts.map +1 -0
  261. package/dist/new-storefront/index.js +329 -0
  262. package/dist/new-storefront/index.js.map +1 -0
  263. package/dist/new-storefront/npmrc.d.ts +98 -0
  264. package/dist/new-storefront/npmrc.d.ts.map +1 -0
  265. package/dist/new-storefront/npmrc.js +217 -0
  266. package/dist/new-storefront/npmrc.js.map +1 -0
  267. package/dist/new-storefront/reference.d.ts +189 -0
  268. package/dist/new-storefront/reference.d.ts.map +1 -0
  269. package/dist/new-storefront/reference.js +430 -0
  270. package/dist/new-storefront/reference.js.map +1 -0
  271. package/dist/new-storefront/rewrite.d.ts +171 -0
  272. package/dist/new-storefront/rewrite.d.ts.map +1 -0
  273. package/dist/new-storefront/rewrite.js +701 -0
  274. package/dist/new-storefront/rewrite.js.map +1 -0
  275. package/dist/release-index.json +284 -0
  276. package/dist/rules/action-route-permissions.d.ts +141 -0
  277. package/dist/rules/action-route-permissions.d.ts.map +1 -0
  278. package/dist/rules/action-route-permissions.js +556 -0
  279. package/dist/rules/action-route-permissions.js.map +1 -0
  280. package/dist/rules/bundle-pairing.d.ts +74 -0
  281. package/dist/rules/bundle-pairing.d.ts.map +1 -0
  282. package/dist/rules/bundle-pairing.js +281 -0
  283. package/dist/rules/bundle-pairing.js.map +1 -0
  284. package/dist/rules/channel-resolution.d.ts +17 -0
  285. package/dist/rules/channel-resolution.d.ts.map +1 -0
  286. package/dist/rules/channel-resolution.js +382 -0
  287. package/dist/rules/channel-resolution.js.map +1 -0
  288. package/dist/rules/command-coverage.d.ts +210 -0
  289. package/dist/rules/command-coverage.d.ts.map +1 -0
  290. package/dist/rules/command-coverage.js +714 -0
  291. package/dist/rules/command-coverage.js.map +1 -0
  292. package/dist/rules/container-imports.d.ts +60 -0
  293. package/dist/rules/container-imports.d.ts.map +1 -0
  294. package/dist/rules/container-imports.js +158 -0
  295. package/dist/rules/container-imports.js.map +1 -0
  296. package/dist/rules/default-language-prose.d.ts +212 -0
  297. package/dist/rules/default-language-prose.d.ts.map +1 -0
  298. package/dist/rules/default-language-prose.js +710 -0
  299. package/dist/rules/default-language-prose.js.map +1 -0
  300. package/dist/rules/diacritic-folds.d.ts +238 -0
  301. package/dist/rules/diacritic-folds.d.ts.map +1 -0
  302. package/dist/rules/diacritic-folds.js +681 -0
  303. package/dist/rules/diacritic-folds.js.map +1 -0
  304. package/dist/rules/entity-tenant-classification.d.ts +171 -0
  305. package/dist/rules/entity-tenant-classification.d.ts.map +1 -0
  306. package/dist/rules/entity-tenant-classification.js +323 -0
  307. package/dist/rules/entity-tenant-classification.js.map +1 -0
  308. package/dist/rules/entry-presence.d.ts +142 -0
  309. package/dist/rules/entry-presence.d.ts.map +1 -0
  310. package/dist/rules/entry-presence.js +339 -0
  311. package/dist/rules/entry-presence.js.map +1 -0
  312. package/dist/rules/entry-scope.d.ts +91 -0
  313. package/dist/rules/entry-scope.d.ts.map +1 -0
  314. package/dist/rules/entry-scope.js +404 -0
  315. package/dist/rules/entry-scope.js.map +1 -0
  316. package/dist/rules/env-inputs.d.ts +222 -0
  317. package/dist/rules/env-inputs.d.ts.map +1 -0
  318. package/dist/rules/env-inputs.js +951 -0
  319. package/dist/rules/env-inputs.js.map +1 -0
  320. package/dist/rules/kernel-boundary.d.ts +37 -0
  321. package/dist/rules/kernel-boundary.d.ts.map +1 -0
  322. package/dist/rules/kernel-boundary.js +195 -0
  323. package/dist/rules/kernel-boundary.js.map +1 -0
  324. package/dist/rules/nul-bytes.d.ts +233 -0
  325. package/dist/rules/nul-bytes.d.ts.map +1 -0
  326. package/dist/rules/nul-bytes.js +332 -0
  327. package/dist/rules/nul-bytes.js.map +1 -0
  328. package/dist/rules/platform-surface.d.ts +479 -0
  329. package/dist/rules/platform-surface.d.ts.map +1 -0
  330. package/dist/rules/platform-surface.js +749 -0
  331. package/dist/rules/platform-surface.js.map +1 -0
  332. package/dist/rules/port-catches.d.ts +225 -0
  333. package/dist/rules/port-catches.d.ts.map +1 -0
  334. package/dist/rules/port-catches.js +1374 -0
  335. package/dist/rules/port-catches.js.map +1 -0
  336. package/dist/rules/port-shape.d.ts +213 -0
  337. package/dist/rules/port-shape.d.ts.map +1 -0
  338. package/dist/rules/port-shape.js +670 -0
  339. package/dist/rules/port-shape.js.map +1 -0
  340. package/dist/rules/queue-names.d.ts +108 -0
  341. package/dist/rules/queue-names.d.ts.map +1 -0
  342. package/dist/rules/queue-names.js +395 -0
  343. package/dist/rules/queue-names.js.map +1 -0
  344. package/dist/rules/singleton-identity.d.ts +205 -0
  345. package/dist/rules/singleton-identity.d.ts.map +1 -0
  346. package/dist/rules/singleton-identity.js +830 -0
  347. package/dist/rules/singleton-identity.js.map +1 -0
  348. package/dist/rules/subscribe-seam.d.ts +121 -0
  349. package/dist/rules/subscribe-seam.d.ts.map +1 -0
  350. package/dist/rules/subscribe-seam.js +594 -0
  351. package/dist/rules/subscribe-seam.js.map +1 -0
  352. package/dist/rules/transaction-context.d.ts +40 -0
  353. package/dist/rules/transaction-context.d.ts.map +1 -0
  354. package/dist/rules/transaction-context.js +294 -0
  355. package/dist/rules/transaction-context.js.map +1 -0
  356. package/package.json +59 -0
@@ -0,0 +1,567 @@
1
+ /**
2
+ * `endora new instance <dir>` — the command.
3
+ *
4
+ * It writes a repository that **composes** this platform for one deployment:
5
+ * one workspace, one module list, and a copy of nothing
6
+ * (`contracts/instance-repository.md` §5, `contracts/instance-tree.md`).
7
+ *
8
+ * ## The order is `new storefront`'s, and so is the discipline
9
+ *
10
+ * **Validate completely, then write** (R5.2). Every refusal — the target
11
+ * directory, the deployment name, the registry, the CLI's own version, the
12
+ * packages, the module set and its closure — is decided before the first
13
+ * `mkdirSync`, because *"a half-written instance installs against ranges
14
+ * nothing resolves and its next command is a manual clean-up"*. There is one
15
+ * `for (const file of plan.files)` loop in this file and it is the last thing
16
+ * that happens.
17
+ *
18
+ * ## What is different from `new storefront`, and it is one thing
19
+ *
20
+ * That command **copies** a reference tree and rewrites every declaration in it
21
+ * that names something above the storefront's own directory. This one copies
22
+ * nothing (D-207), so there is no rewriter beside it and R5.5's *"no outward
23
+ * reference"* is a property of the template rather than a step in the command.
24
+ * A rewriting step appearing here would be evidence that something was copied
25
+ * that should not have been (NFR-002).
26
+ *
27
+ * ## Exit codes
28
+ *
29
+ * `cli-surface.md` §2, unchanged and shared with every other command: **0** it
30
+ * did what it was asked, **1** a refusal the operator can act on, **2** an input
31
+ * it could not read. `instance-tree.md` §4's table maps the eight classes onto
32
+ * those, and F5–F8 are `2` rather than `1` for the estate's own reason — a run
33
+ * that could not read its input has said nothing, and a scaffold written from
34
+ * values it could not read is worse than no scaffold.
35
+ *
36
+ * ## It never prompts, and that is why it can never hang
37
+ *
38
+ * `cli-product.md` R2.5c. Every input this command needs is a flag or the
39
+ * positional; the values a *running* instance needs are the client's and are
40
+ * listed in the `.env.example` it writes, which is the tier-2 file the four-tier
41
+ * resolution reads on the next command rather than a value this one invents. So
42
+ * the provenance line R2.5a requires is printed on every run and its
43
+ * `defaulted=` is `0` by arithmetic, over a resolution with nothing in it.
44
+ * `packages/cli/test/new-instance-command.test.ts` proves the guarantee the only
45
+ * way it can be proved — by spawning, with pipes on both descriptors.
46
+ */
47
+ import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from 'node:fs';
48
+ import { basename, dirname, isAbsolute, join, resolve } from 'node:path';
49
+ import { parseEnvFile } from '../inputs/env-file.js';
50
+ import { generateSecret, interactivityOf, planResolution, provenanceLine, } from '../inputs/resolve.js';
51
+ import { npmrcContent, normalizeRegistry } from '../new-storefront/npmrc.js';
52
+ import { assertTopology, DEFAULT_TOPOLOGY, developmentAddresses, developmentMailUrl, DEV_COMPOSE_PATH, } from './deploy.js';
53
+ import { DOCS_TOOLCHAIN } from './docs-toolchain.js';
54
+ import { ADMIN_KIT_PACKAGE, ADMIN_SHELL_PACKAGE, InstanceHostError, InstanceInputError, resolveInstanceHost, } from './host.js';
55
+ import { instanceEnvironmentInputs, loadModuleCandidates, resolveModuleSet, } from './modules.js';
56
+ import { assertDeploymentName, assertWorkspaceName, memberRefusal, planInstance, wiringLineCount, } from './template.js';
57
+ /**
58
+ * The target must be empty — or hold nothing but a `.env`.
59
+ *
60
+ * F1. The exception is `new storefront`'s and is the operator's own second
61
+ * input tier (`input-resolution.md` R1.2): a `.env` the client placed there
62
+ * before running is an **input**, and a command whose only acceptable target
63
+ * holds no file at all would leave that tier unreachable.
64
+ *
65
+ * Completion — a re-run that writes an absent member and touches nothing else —
66
+ * is `specs/118-instance-member-selection/` §3.4's R3.6 and narrows this
67
+ * refusal. It is not implemented here, so a non-empty directory is refused
68
+ * whether or not it holds an instance, which is the fail-closed direction: a
69
+ * command that guessed at completion would merge into files it does not own.
70
+ */
71
+ function refuseOccupiedDirectory(targetDir) {
72
+ if (!existsSync(targetDir))
73
+ return;
74
+ const entries = readdirSync(targetDir);
75
+ if (entries.length === 0)
76
+ return;
77
+ if (entries.length === 1 && entries[0] === '.env')
78
+ return;
79
+ throw new InstanceInputError('F1', `${targetDir} exists and is not empty (${entries.slice(0, 5).join(', ')}). This command ` +
80
+ `never merges into a directory: an instance's files are yours — the deployment ` +
81
+ `declaration, the entry points, the manifest that is the module list — and writing over ` +
82
+ `them would silently discard whatever you had put there. Scaffold into an empty ` +
83
+ `directory. A directory holding nothing but a \`.env\` is the one exception: that file ` +
84
+ `is where you may place values this command and the next would otherwise ask you for.`);
85
+ }
86
+ export async function runNewInstance(options) {
87
+ const cwd = options.cwd ?? process.cwd();
88
+ if (options.dir === undefined || options.dir.trim().length === 0) {
89
+ // R5.1 — no default target. A default would either overwrite something or
90
+ // invent a name nobody chose, and the name is the workspace's own.
91
+ throw new InstanceInputError('F1', `\`new instance\` takes the directory to write, and has no default. The directory's ` +
92
+ `basename becomes the workspace name, so a default would invent a name nobody chose.`);
93
+ }
94
+ const targetDir = isAbsolute(options.dir) ? options.dir : resolve(cwd, options.dir);
95
+ // --- validate, in the order the operator can act on -----------------------
96
+ refuseOccupiedDirectory(targetDir);
97
+ const name = basename(targetDir);
98
+ assertWorkspaceName(name);
99
+ const deployment = options.deployment ?? name;
100
+ assertDeploymentName(deployment);
101
+ // F3 — an operator-fixable refusal, decided with the rest of them and before
102
+ // anything is written (R5.2). `single-host` is the default on the owner's own
103
+ // *"the most common scenario is probably all three layers on one machine"*.
104
+ const topology = options.topology === undefined ? DEFAULT_TOPOLOGY : assertTopology(options.topology);
105
+ // F10 / F11 — the member vocabulary, decided with the rest and before any
106
+ // package is resolved: a name outside it, or the one member that composes the
107
+ // platform, is the operator's to change (`instance-members.md` §5.6).
108
+ const without = new Set((options.without ?? []).map((name) => name.trim()).filter((name) => name.length > 0));
109
+ const declinedRefusal = memberRefusal([...without]);
110
+ if (declinedRefusal !== null) {
111
+ throw new InstanceInputError(without.has('backend') ? 'F11' : 'F10', declinedRefusal);
112
+ }
113
+ // F5 — `--registry` is not a URL, or the configuration cannot be read. The
114
+ // writer is `new-storefront/npmrc.ts` verbatim (R5.7); what changes is the
115
+ // class its refusal is reported under, because `instance-tree.md` §4 puts a
116
+ // registry this run could not read among the inputs it could not read.
117
+ let registry = null;
118
+ let npmrc = null;
119
+ if (options.registry !== undefined) {
120
+ try {
121
+ registry = normalizeRegistry(options.registry);
122
+ }
123
+ catch (error) {
124
+ throw new InstanceHostError('F5', error instanceof Error ? error.message : String(error));
125
+ }
126
+ }
127
+ const host = resolveInstanceHost({
128
+ cwd,
129
+ targetDir,
130
+ ...(options.moduleUrl === undefined ? {} : { moduleUrl: options.moduleUrl }),
131
+ });
132
+ const platform = host.packages.get(`${host.scope}platform`);
133
+ const { candidates, platformEnv } = await loadModuleCandidates(host.packages, platform);
134
+ const modules = resolveModuleSet(options.modules ?? [], candidates, {
135
+ seed: options.moduleSeed,
136
+ });
137
+ if (registry !== null) {
138
+ try {
139
+ npmrc = npmrcContent(registry, [host.scope.slice(0, -1)]);
140
+ }
141
+ catch (error) {
142
+ throw new InstanceHostError('F5', error instanceof Error ? error.message : String(error));
143
+ }
144
+ }
145
+ const declaredRanges = new Map();
146
+ for (const field of ['peerDependencies', 'dependencies']) {
147
+ const block = platform.manifest[field];
148
+ if (block === null || typeof block !== 'object')
149
+ continue;
150
+ for (const [dependency, range] of Object.entries(block)) {
151
+ if (typeof range === 'string' && !declaredRanges.has(dependency)) {
152
+ declaredRanges.set(dependency, range);
153
+ }
154
+ }
155
+ }
156
+ // R2.3's first named source, for the one range no platform manifest carries.
157
+ const typescriptRange = typescriptRangeOf(host);
158
+ if (typescriptRange !== undefined)
159
+ declaredRanges.set('typescript', typescriptRange);
160
+ const adminShell = host.packages.get(`${host.scope}${ADMIN_SHELL_PACKAGE}`);
161
+ const adminKit = host.packages.get(`${host.scope}${ADMIN_KIT_PACKAGE}`);
162
+ // What this instance reads from its environment (FR-010): the platform's own
163
+ // declaration and the manifest of every module this run installed. Both come
164
+ // off the packages resolved beside the target directory, which is R2.3 — the
165
+ // declaration is the **installed** platform's and the **installed** modules',
166
+ // not this CLI's idea of them.
167
+ const declared = instanceEnvironmentInputs(platformEnv, modules.ids.map((id) => candidates.get(id)));
168
+ // Tier 2 — the `.env` of the **target directory**, never of the working
169
+ // directory and never of an ancestor (R1.2). A command run inside a checkout
170
+ // of ours must not silently inherit that checkout's development
171
+ // configuration, which is how a client's first instance would come to carry
172
+ // `postgresql://b2b:b2b@localhost:5432/b2b`.
173
+ const envPath = join(targetDir, '.env');
174
+ const existingEnv = existsSync(envPath) ? readFileSync(envPath, 'utf8') : '';
175
+ // R2.5b's four tiers, through the one module every command resolves with
176
+ // (R5.3) — and this command uses **three** of them. Tier 1 is empty: it takes
177
+ // no flag for a runtime value. Tier 3, the prompt, is refused structurally by
178
+ // `nonInteractive`, so the partition is the same whether or not a terminal is
179
+ // attached and this command still cannot hang (R2.5c). Tier 4, the refusal, is
180
+ // not this command's either: an unanswered required input is **what
181
+ // `.env.example` is for**, and a scaffolder that refused to write a tree until
182
+ // its client had a database would be refusing the only artefact that tells
183
+ // them which values they owe. So `missing` and `unset` are read here as the
184
+ // file's population rather than as a reason to stop, and `toGenerate` is the
185
+ // one tier that acts.
186
+ const resolution = planResolution({
187
+ declared,
188
+ // A declined admin is a member not written, and an input only it reads is
189
+ // out of the population exactly as it is for an unavailable one (118 §6).
190
+ members: adminShell !== undefined && adminKit !== undefined && !without.has('admin')
191
+ ? ['backend', 'admin']
192
+ : ['backend'],
193
+ flags: {},
194
+ envFile: parseEnvFile(existingEnv),
195
+ interactivity: { ...interactivityOf({ nonInteractive: true, dryRun: options.dryRun === true }), nonInteractive: true },
196
+ language: 'en',
197
+ });
198
+ // R2.5d — the one class of value this tool may invent, and it invents it
199
+ // **once**: the plan is pure, so a `randomBytes` call inside it would render a
200
+ // different tree on every evaluation and `--dry-run` would stop describing the
201
+ // run it previews. A dry run generates nothing at all and says so.
202
+ const generated = options.dryRun === true
203
+ ? []
204
+ : resolution.toGenerate.map((input) => ({
205
+ name: input.name,
206
+ value: generateSecret(),
207
+ provenance: 'generated',
208
+ }));
209
+ const plan = planInstance({
210
+ name,
211
+ deployment,
212
+ scope: host.scope,
213
+ platformVersion: host.platformVersion,
214
+ enginesNode: host.enginesNode,
215
+ packageManager: host.packageManager,
216
+ // A module the host carries is in the set and contributes no dependency
217
+ // entry: an instance naming it would be asking a registry for a package
218
+ // nobody publishes (`modules.ts`' `carriedByHost`).
219
+ //
220
+ // The **version** comes with the name, off the candidate, which read it from
221
+ // the manifest of the package this run resolved beside the target directory
222
+ // — the same manifest, on the same install, that the platform will later
223
+ // discover and compose (`host.ts`' `readPackage`). It is not the platform's
224
+ // and it is not this CLI's: a release moves packages at different rates, and
225
+ // a range built from another package's version is one no registry can
226
+ // satisfy.
227
+ modules: modules.ids
228
+ .filter((id) => !candidates.get(id).carriedByHost)
229
+ .map((id) => ({
230
+ id,
231
+ packageName: candidates.get(id).packageName,
232
+ version: candidates.get(id).version,
233
+ })),
234
+ adminShellVersion: adminShell?.version ?? null,
235
+ adminKitVersion: adminKit?.version ?? null,
236
+ adminRanges: adminRangesOf(adminShell),
237
+ adminPeers: composedOptionalPeers(host, [
238
+ ...(adminShell === undefined ? [] : [adminShell]),
239
+ ...(adminKit === undefined ? [] : [adminKit]),
240
+ ...modules.ids
241
+ .map((id) => host.packages.get(candidates.get(id).packageName))
242
+ .filter((pkg) => pkg !== undefined),
243
+ ]),
244
+ cliVersion: host.cliVersion,
245
+ docsRanges: new Map(DOCS_TOOLCHAIN.map((entry) => [entry.name, entry.range])),
246
+ declaredRanges,
247
+ registry,
248
+ npmrc,
249
+ topology,
250
+ without,
251
+ declared,
252
+ existingEnv,
253
+ generated: new Map(generated.map((entry) => [entry.name, entry.value])),
254
+ });
255
+ // R2.5a — the provenance line, printed on every run including a dry one. The
256
+ // set is what the target's own `.env` already answered plus what this run
257
+ // generated, and `defaulted=` is `0` by the same subtraction that makes it
258
+ // unfakeable anywhere else. It is printed rather than skipped: a run that said
259
+ // nothing about its inputs is indistinguishable from one that invented them.
260
+ const resolved = [...resolution.resolved, ...generated];
261
+ const result = {
262
+ targetDir,
263
+ host,
264
+ plan,
265
+ modules,
266
+ deployment,
267
+ topology,
268
+ dryRun: options.dryRun === true,
269
+ wiringLines: wiringLineCount(plan),
270
+ provenance: provenanceLine(resolved),
271
+ resolved,
272
+ wouldGenerate: options.dryRun === true ? resolution.toGenerate.map((input) => input.name) : [],
273
+ nextSteps: nextSteps(targetDir, deployment, topology, modules.ids, {
274
+ admin: plan.members.includes('admin'),
275
+ // Read off the document **this plan holds**, never re-derived: the two
276
+ // cannot then disagree about a port, and a step naming an address the
277
+ // client's own file does not publish is worse than no step.
278
+ environment: developmentEnvironment(plan, declared),
279
+ mailUrl: developmentMailUrl(developmentDocument(plan)),
280
+ }),
281
+ };
282
+ if (result.dryRun)
283
+ return result;
284
+ // --- write. Everything above has already decided (R5.2) -------------------
285
+ for (const file of plan.files) {
286
+ const target = join(targetDir, file.path);
287
+ mkdirSync(dirname(target), { recursive: true });
288
+ writeFileSync(target, file.content, 'utf8');
289
+ }
290
+ return result;
291
+ }
292
+ /**
293
+ * The packages an admin project has to supply because the packages it composes
294
+ * declare them **optional** (§2.4; FR-022 read from the consumer's side).
295
+ *
296
+ * `manifests:generate` marks a module package's peer optional *"when every
297
+ * non-test reach into it came from a UI layer"* — the whole point being that a
298
+ * backend-only consumer can decline to resolve React, a router and a charting
299
+ * library. That declaration says something exact about the other consumer:
300
+ * **an admin project composes those UI layers, so for an admin project the
301
+ * optional peers are not optional at all.** They are precisely the set a host
302
+ * that renders these packages must have, and nothing else in either tree says
303
+ * what it is.
304
+ *
305
+ * It is derived rather than listed because a list is wrong the moment a module
306
+ * grows a screen. Measured before it existed, on the acceptance criterion's own
307
+ * run: `@endora-commerce/page-builder-core` resolved, its
308
+ * `@measured/puck` peer did not — pnpm does not auto-install an optional peer —
309
+ * and Vite bound the import to an `__vite-optional-peer-dep:` stub, so the
310
+ * scaffolded admin failed to bundle on a package the client had installed.
311
+ *
312
+ * The walk starts at the packages the admin mounts and follows their
313
+ * `@endora-commerce/*` peers, because a module's screens render the page-builder
314
+ * family's components and those declare optional peers of their own. A peer this
315
+ * run did not resolve contributes nothing: its optional peers are unknown, and
316
+ * inventing them is what R2.5a forbids.
317
+ */
318
+ function composedOptionalPeers(host, roots) {
319
+ const collected = new Map();
320
+ const seen = new Set();
321
+ const queue = [...roots];
322
+ while (queue.length > 0) {
323
+ const pkg = queue.shift();
324
+ if (seen.has(pkg.name))
325
+ continue;
326
+ seen.add(pkg.name);
327
+ const peers = pkg.manifest['peerDependencies'];
328
+ if (peers === null || typeof peers !== 'object')
329
+ continue;
330
+ const meta = pkg.manifest['peerDependenciesMeta'];
331
+ const optional = (name) => meta !== null &&
332
+ typeof meta === 'object' &&
333
+ meta[name] !== null &&
334
+ typeof meta[name] === 'object' &&
335
+ (meta[name].optional === true);
336
+ for (const [name, range] of Object.entries(peers)) {
337
+ const resolved = host.packages.get(name);
338
+ // Follow every scope peer, optional or not: an optional peer of a package
339
+ // this admin composes is this admin's to supply, and the package that
340
+ // declares it may itself be reached only as somebody else's peer.
341
+ if (resolved !== undefined)
342
+ queue.push(resolved);
343
+ if (!optional(name))
344
+ continue;
345
+ if (collected.has(name))
346
+ continue;
347
+ // A **module** package is never declared here, whoever peers on it: the
348
+ // module set is the root manifest's and appears exactly once in the
349
+ // written tree (R3.6), and pnpm links a root dependency into the root's
350
+ // `node_modules`, which is where this member's resolution reaches it. A
351
+ // module that peers on a module the client did not install is a module
352
+ // set that is short, and Vite says so loudly — which is the right answer,
353
+ // and is not one this member's manifest may quietly paper over.
354
+ if (resolved?.endora?.type === 'module')
355
+ continue;
356
+ if (resolved !== undefined) {
357
+ // A `workspace:` range is what a packed sibling carries here and is
358
+ // unresolvable outside a workspace; the version it resolved at is the
359
+ // fact this run actually has (R2.5a).
360
+ collected.set(name, `^${resolved.version}`);
361
+ continue;
362
+ }
363
+ if (typeof range === 'string' && range.length > 0 && !range.startsWith('workspace:')) {
364
+ collected.set(name, range);
365
+ }
366
+ }
367
+ }
368
+ return collected;
369
+ }
370
+ /**
371
+ * What the admin shell says a host that mounts it must resolve (§2.4, R2.5a).
372
+ *
373
+ * Its `peerDependencies`, which is the declaration whose whole meaning is *"the
374
+ * consumer supplies this"* — React and the router — plus the optional peers by
375
+ * which it states what kind of application a host is: a Vite build with
376
+ * Tailwind v4. Read off the shell's own manifest and off nothing else, so a
377
+ * shell that widens `react` widens this in the same run with nothing here to
378
+ * edit, and a name it stops declaring becomes an omission naming that name
379
+ * rather than a range this command chose.
380
+ *
381
+ * A `workspace:` range is filtered out by the reader rather than here: it is
382
+ * unresolvable outside this repository's own workspace, and an instance's
383
+ * manifest carrying one would be a scaffold that cannot install.
384
+ */
385
+ function adminRangesOf(shell) {
386
+ const ranges = new Map();
387
+ if (shell === undefined)
388
+ return ranges;
389
+ for (const field of ['peerDependencies', 'devDependencies']) {
390
+ const block = shell.manifest[field];
391
+ if (block === null || typeof block !== 'object')
392
+ continue;
393
+ for (const [name, range] of Object.entries(block)) {
394
+ if (typeof range === 'string' && !ranges.has(name))
395
+ ranges.set(name, range);
396
+ }
397
+ }
398
+ return ranges;
399
+ }
400
+ /**
401
+ * The range for the one build tool no platform manifest declares.
402
+ *
403
+ * The CLI's own — R2.3 names *"the CLI's own manifest"* first among the three
404
+ * things a command may derive from, and this build compiles the same TypeScript
405
+ * an instance will. `undefined` when it declares none, in which case the entry
406
+ * is simply not written (see `devDependenciesFor`).
407
+ */
408
+ function typescriptRangeOf(host) {
409
+ for (const field of ['dependencies', 'devDependencies']) {
410
+ const block = host.ownManifest[field];
411
+ if (block === null || typeof block !== 'object')
412
+ continue;
413
+ const range = block['typescript'];
414
+ if (typeof range === 'string')
415
+ return range;
416
+ }
417
+ return undefined;
418
+ }
419
+ /**
420
+ * The steps that are the operator's, and the second command they have not met.
421
+ *
422
+ * R3.4: `endora new instance` prints `endora new storefront` as a next step,
423
+ * *"in the shape `endora new module` prints its next steps today. Discoverability
424
+ * is what makes two commands one product; a client who has to read documentation
425
+ * to learn the second command exists has been handed three commands sharing a
426
+ * prefix."*
427
+ *
428
+ * The demo step is here rather than in the tree, and that is D-216's own shape:
429
+ * a scaffold writes no demo artefact unasked and the capability is discoverable
430
+ * through this block, because *"a capability announced as a deficiency is not
431
+ * optional"*. **That sentence was written and the step was not**, for as long as
432
+ * there was no CLI to run it with; `specs/123-oss-install-experience/` T2-E is
433
+ * the merge request in which the docstring and the array finally say the same
434
+ * thing.
435
+ */
436
+ /**
437
+ * The development compose **this plan holds**, as text.
438
+ *
439
+ * Read off the plan rather than rendered a second time: a second render would
440
+ * be a second document, and the whole property FR-105 buys is that the printed
441
+ * addresses and the file the client starts cannot disagree.
442
+ */
443
+ function developmentDocument(plan) {
444
+ return plan.files.find((file) => file.path === DEV_COMPOSE_PATH)?.content ?? '';
445
+ }
446
+ /**
447
+ * FR-105's intersection, both halves.
448
+ *
449
+ * The **compose** half is `developmentAddresses`, which answers only for the
450
+ * services the rendered document runs. The **declaration** half is here: an
451
+ * input this instance does not declare is not this instance's, whoever else
452
+ * reads it — so an instance that installs neither `search` nor `email` is told
453
+ * about neither `MEILISEARCH_API_KEY` nor `SMTP_URL`, and neither name is
454
+ * written down in the deciding code. The platform's own three are always
455
+ * declared and therefore always survive this filter, which is why it can be
456
+ * stated as a rule rather than as a list.
457
+ */
458
+ function developmentEnvironment(plan, declared) {
459
+ const names = new Set(declared.map((input) => input.name));
460
+ return new Map([...developmentAddresses(developmentDocument(plan))].filter(([name]) => names.has(name)));
461
+ }
462
+ /**
463
+ * What a client is told to run, in order (R3.4).
464
+ *
465
+ * Exported so a proof can read the sequence rather than a process's stdout: it
466
+ * is the only statement anywhere of the order the steps go in, and the order is
467
+ * the part that was wrong — `start` before `build`, and no module install at
468
+ * all (`specs/110-instance-repository/` T141).
469
+ *
470
+ * `moduleIds` is the resolved set, and it is a parameter rather than a constant
471
+ * for the reason `cliAliasesFor` is derived: a step naming a command this
472
+ * instance cannot run is worse than no step, because it fails at the one moment
473
+ * a client cannot tell a missing module from a broken install.
474
+ */
475
+ export function nextSteps(targetDir, deployment, topology = DEFAULT_TOPOLOGY, moduleIds = [], development = {}) {
476
+ const addresses = [...(development.environment ?? new Map())];
477
+ return [
478
+ `cd ${targetDir} && pnpm install — every range in the manifest is published semver. ` +
479
+ `Nothing in this tree is a copy of ours, so \`pnpm update\` is how a platform fix ` +
480
+ `reaches you, with no file here edited.`,
481
+ // `specs/125-first-mile-install/` FR-108, and it is first for a reason a
482
+ // client would otherwise meet as an error: `migrate` is four lines below and
483
+ // it needs a database. This command wrote `compose.dev.yml` beside the
484
+ // manifest and it runs as written — three of this sequence's steps used to
485
+ // be "provision PostgreSQL", "provision Redis" and "provision a search
486
+ // engine", and they were printed nowhere at all.
487
+ `pnpm run dev:services — PostgreSQL, Redis, Meilisearch and a mail catcher, from ` +
488
+ `\`compose.dev.yml\` beside your manifest. It waits until each one reports healthy, ` +
489
+ `which is what stops \`migrate\` racing a database that is still initialising. ` +
490
+ `\`pnpm run dev:services:down\` stops them and keeps their data.` +
491
+ (development.mailUrl === undefined
492
+ ? ''
493
+ : ` Mail this instance sends goes to that catcher and is read at ${development.mailUrl} ` +
494
+ `— nothing leaves your machine.`),
495
+ `open .env and fill it in — this command already wrote it, with the secrets it ` +
496
+ `generated filled in and everything else this instance reads left blank. Do NOT copy ` +
497
+ `.env.example over it: that file is the same population with no secret in it, for you ` +
498
+ `to commit and for your colleagues to read. Every entry in it names what it decides, ` +
499
+ `and an optional one names what leaving it unset costs.` +
500
+ // The values that match the file this same run rendered, printed rather
501
+ // than written: writing them is FR-105 and waits on a ruling. They are
502
+ // read off the rendered document, so a changed port moves this sentence
503
+ // in the same run — and they are a DEVELOPMENT machine's, which is why
504
+ // they are printed here and are in no `.env.example`.
505
+ (addresses.length === 0
506
+ ? ''
507
+ : ` For the services \`dev:services\` starts, these are the values: ` +
508
+ `${addresses.map(([name, value]) => `${name}=${value}`).join(', ')}. ` +
509
+ `They match \`compose.dev.yml\` as it stands; on a machine that is not a ` +
510
+ `development one, they are not what you want.`),
511
+ `pnpm run setup — generate, build, migrate and \`module:install --all\`, in that order. ` +
512
+ `Each of the four is still its own script and can be run on its own: \`generate\` ` +
513
+ `renders what your admin project and documentation site are built from, \`build\` ` +
514
+ `compiles every member, \`migrate\` applies the schema in the order the installed ` +
515
+ `manifests compute, and \`module:install --all\` installs every module you declared ` +
516
+ `in dependency order. Until that last one has run, the platform refuses to start, ` +
517
+ `naming the modules it requires.`,
518
+ ...(moduleIds.includes('admin_users')
519
+ ? [
520
+ `pnpm run admin:create -- --email=<you> --password=<secret> --first-name=<f> ` +
521
+ `--last-name=<l> — the administrator you will log in as. It is idempotent and it ` +
522
+ `bootstraps the \`platform_admin\` role on the first run, so there is nothing to ` +
523
+ `set up before it. Nothing else creates one: a freshly migrated instance has no ` +
524
+ `account at all, and the operator interface has nobody to admit.`,
525
+ ]
526
+ : []),
527
+ `pnpm run start — the API. \`apps/${deployment}/modules/\` is where your own overlay ` +
528
+ `module goes when you want to change something; \`divergence.ts\` beside it is where ` +
529
+ `you declare what you changed.`,
530
+ // FR-110 — baseline step D1, which was printed nowhere: the admin member
531
+ // declares `preview` and nothing named it, so a client who built the bundle
532
+ // had no command to look at it with.
533
+ ...(development.admin === true
534
+ ? [
535
+ `pnpm run preview:admin — the admin bundle \`build\` produced, served. It talks to ` +
536
+ `the API from your browser, so \`start\` above has to be running; the origin it ` +
537
+ `calls was inlined at build time, which is why moving a built bundle between ` +
538
+ `environments is a rebuild rather than a redeploy.`,
539
+ ]
540
+ : []),
541
+ ...(topology === 'three-host'
542
+ ? [
543
+ `deploy/three-host/ — one compose example and one \`.env.example\` per machine, ` +
544
+ `plus \`deploy/README.md\` for the order they come up in. The three \`.env\` ` +
545
+ `files are not interchangeable: each carries exactly what its own compose file ` +
546
+ `reads, so copying one onto another host either hands it secrets it has no use ` +
547
+ `for or starts it with blanks.`,
548
+ ]
549
+ : []),
550
+ `pnpm run cli demo seed — optional, and off unless you ask: a shop's worth of example ` +
551
+ `data from every module that declares any, which \`pnpm run cli demo reset\` withdraws ` +
552
+ `again leaving your own rows alone. An instance you are going to sell from wants none ` +
553
+ `of it; an instance you are evaluating wants it before the first screen. It is named ` +
554
+ `here rather than written into your tree as a script, which is D-216's own shape.`,
555
+ `endora new storefront <dir> — the customer-facing storefront, which is its own ` +
556
+ `repository. It shares two \`.env\` values with this one and nothing else.`,
557
+ ];
558
+ }
559
+ export { InstanceHostError, InstanceInputError };
560
+ /**
561
+ * The member vocabulary and its refusal, re-exported for `endora install`:
562
+ * that command validates `--without` with its other preconditions and renders
563
+ * the checklist from the vocabulary, and it reaches both through this runner
564
+ * rather than through the template, which it must not name (125 FR-143).
565
+ */
566
+ export { MEMBER_VOCABULARY, memberRefusal } from './template.js';
567
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/new-instance/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC1F,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EACL,cAAc,EACd,eAAe,EACf,cAAc,EACd,cAAc,GAEf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,GAEjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,GAGpB,MAAM,WAAW,C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