@cloudhal/cli 0.9.0 → 0.10.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 (170) hide show
  1. package/README.md +12 -0
  2. package/dist/assets/starters/blog/package.json +4 -4
  3. package/dist/assets/starters/blog/src/env.d.ts +2 -1
  4. package/dist/assets/studio/assets/{AccountPage-nAu_rO1o.js → AccountPage-KnRb0NdZ.js} +2 -2
  5. package/dist/assets/studio/assets/ActivityPage-97xHggMx.js +2 -0
  6. package/dist/assets/studio/assets/{AgentModes-_sBUnXcz.js → AgentModes-B0ndZk6-.js} +2 -2
  7. package/dist/assets/studio/assets/AgentsPage-CaSUxYA6.js +2 -0
  8. package/dist/assets/studio/assets/{AnalyticsPage-C-ex-HSB.js → AnalyticsPage-BDDle79P.js} +2 -2
  9. package/dist/assets/studio/assets/{ApprovalsPage-s6dwVD03.js → ApprovalsPage-fQ97gTra.js} +3 -3
  10. package/dist/assets/studio/assets/{ArticleEditorPage-T1evZ638.js → ArticleEditorPage-BTuLTrRz.js} +2 -2
  11. package/dist/assets/studio/assets/ArticlesPage-C2W82JpU.js +3 -0
  12. package/dist/assets/studio/assets/{AssetPage-5LwLx1gR.js → AssetPage-DSFmG_Q5.js} +2 -2
  13. package/dist/assets/studio/assets/{Audit-DQffLTzE.js → Audit-Cdm2BctF.js} +2 -2
  14. package/dist/assets/studio/assets/{AuditBadges-CY1uAjI6.js → AuditBadges-CHSvcm9k.js} +2 -2
  15. package/dist/assets/studio/assets/{AutomationsPage-BDlQj-9A.js → AutomationsPage-2s5bhqNl.js} +2 -2
  16. package/dist/assets/studio/assets/{BodyChanges-DIjm1bJU.js → BodyChanges-D_RmA99y.js} +2 -2
  17. package/dist/assets/studio/assets/{BodyEditor-DeqV1Lsh.js → BodyEditor-upQbsOnb.js} +3 -3
  18. package/dist/assets/studio/assets/BookOpen.es-RObyiWbm.js +2 -0
  19. package/dist/assets/studio/assets/{BuildPage-CQjvu0rJ.js → BuildPage-2G7MJdni.js} +2 -2
  20. package/dist/assets/studio/assets/CollectionSettingsPage-DWqVO7uC.js +3 -0
  21. package/dist/assets/studio/assets/{CollectionsPage-7s3YSr_B.js → CollectionsPage-VEyhuzvN.js} +2 -2
  22. package/dist/assets/studio/assets/{CommandMenu-N_Ip-LPa.js → CommandMenu-B8e_1Mqk.js} +2 -2
  23. package/dist/assets/studio/assets/{CommentThreadControls-CQyiHy0N.js → CommentThreadControls-B4KqsWwR.js} +2 -2
  24. package/dist/assets/studio/assets/{CommentThreadPage-DVSOcxOD.js → CommentThreadPage-Cqf0lMA5.js} +2 -2
  25. package/dist/assets/studio/assets/{CommenterPage-CPXdSFdV.js → CommenterPage-JE30gYuF.js} +2 -2
  26. package/dist/assets/studio/assets/{Comments-DJVsgCAa.js → Comments-Z1pe7Eje.js} +2 -2
  27. package/dist/assets/studio/assets/CommentsPage-Byp1E9GE.js +2 -0
  28. package/dist/assets/studio/assets/{ConfirmDialog-UY7UuQt8.js → ConfirmDialog-DQTBjdtz.js} +2 -2
  29. package/dist/assets/studio/assets/{Crumbs-DEIiY7p1.js → Crumbs-Cq31DDaP.js} +2 -2
  30. package/dist/assets/studio/assets/{DateTimeField-DyVXd_hG.js → DateTimeField-Q1t2hZH5.js} +2 -2
  31. package/dist/assets/studio/assets/{DeleteReferences-cijJ-S_1.js → DeleteReferences-BZ2-Q7z6.js} +2 -2
  32. package/dist/assets/studio/assets/{EditorPreview-C3-nmzAO.js → EditorPreview-B-rAr0p-.js} +2 -2
  33. package/dist/assets/studio/assets/{Elevation-DmmvKhh3.js → Elevation-29GlZjiJ.js} +2 -2
  34. package/dist/assets/studio/assets/{ElevationRequest-Cayyvqqw.js → ElevationRequest-xDKz9GBv.js} +2 -2
  35. package/dist/assets/studio/assets/EndedBadge-DtZBIxsu.js +2 -0
  36. package/dist/assets/studio/assets/{EntryFieldsCard-aHg_PtwX.js → EntryFieldsCard-CfVGl2oF.js} +2 -2
  37. package/dist/assets/studio/assets/{FieldsSection-Dapb2jAb.js → FieldsSection-Dk0IMgIZ.js} +2 -2
  38. package/dist/assets/studio/assets/{ForgotPasswordPage-jJLhjZX7.js → ForgotPasswordPage-Dg6lorsR.js} +2 -2
  39. package/dist/assets/studio/assets/{Gating-HCCmndPb.js → Gating-EbYJlaF7.js} +2 -2
  40. package/dist/assets/studio/assets/{GovernanceDialog-Cx3r0q-n.js → GovernanceDialog-DkjblwWT.js} +2 -2
  41. package/dist/assets/studio/assets/{InvitePage-BHGVYDQW.js → InvitePage-CBcoLQGE.js} +2 -2
  42. package/dist/assets/studio/assets/{ListFieldColumns-BW5Ycf3p.js → ListFieldColumns-Cg7t430N.js} +2 -2
  43. package/dist/assets/studio/assets/ListToolbar-Dl7JF_yL.js +2 -0
  44. package/dist/assets/studio/assets/{ListingSections-Cifcu5P5.js → ListingSections-DE8G9HwU.js} +2 -2
  45. package/dist/assets/studio/assets/{LoginPage-C3-Zu_Ta.js → LoginPage-BZ2zkZBy.js} +2 -2
  46. package/dist/assets/studio/assets/MediaPage-CibPwRXq.js +2 -0
  47. package/dist/assets/studio/assets/{MediaPicker-CHinIGGd.js → MediaPicker-xq3mDN8O.js} +2 -2
  48. package/dist/assets/studio/assets/{MediaUpload-FEtMnYgM.js → MediaUpload-DJp_mOuJ.js} +2 -2
  49. package/dist/assets/studio/assets/{MembersPage-DRQlIhLy.js → MembersPage-D2QqLRh4.js} +2 -2
  50. package/dist/assets/studio/assets/{Menus-DpTuIwZQ.js → Menus-v4k8Tqrz.js} +2 -2
  51. package/dist/assets/studio/assets/{NavigationPage-dmNWCcLa.js → NavigationPage-DUQGXS9h.js} +2 -2
  52. package/dist/assets/studio/assets/{NewSiteDialog-CXajABEy.js → NewSiteDialog-C486WUcS.js} +2 -2
  53. package/dist/assets/studio/assets/{NotificationItems-Bql2PkI9.js → NotificationItems-D3ujSgoI.js} +2 -2
  54. package/dist/assets/studio/assets/{OAuthConsentPage-B-DOabVo.js → OAuthConsentPage-DY6uMxQA.js} +2 -2
  55. package/dist/assets/studio/assets/{PageEditorPage-CtOD2ZcK.js → PageEditorPage-CTFpnMWJ.js} +2 -2
  56. package/dist/assets/studio/assets/{PagesPage-DptpPusO.js → PagesPage-Cp2zJvKd.js} +2 -2
  57. package/dist/assets/studio/assets/{PreviewPanel-DGRZbOUK.js → PreviewPanel-B0Zrx9cb.js} +2 -2
  58. package/dist/assets/studio/assets/{ProjectPage-B6bKsTrC.js → ProjectPage-D0vxqEn5.js} +2 -2
  59. package/dist/assets/studio/assets/Readers-lfVDLYVb.js +3 -0
  60. package/dist/assets/studio/assets/{RedirectDialog-Bi6gecDo.js → RedirectDialog-B3hR7k-E.js} +2 -2
  61. package/dist/assets/studio/assets/RedirectsPage-VuBze2PX.js +2 -0
  62. package/dist/assets/studio/assets/{RelativeTime-pU7izbH5.js → RelativeTime-BosTteS_.js} +2 -2
  63. package/dist/assets/studio/assets/{ReleaseApproval-BJE5qtlq.js → ReleaseApproval-4oFAS20M.js} +2 -2
  64. package/dist/assets/studio/assets/{ReleasePage-WSfD9gZ3.js → ReleasePage-y62qZka_.js} +2 -2
  65. package/dist/assets/studio/assets/{ReleaseParts-BtLl_1C4.js → ReleaseParts-D3Wde1-q.js} +2 -2
  66. package/dist/assets/studio/assets/{ResetPasswordPage-G4u5dPGv.js → ResetPasswordPage-B-n3laYY.js} +2 -2
  67. package/dist/assets/studio/assets/{RowMenu-BDHWbqzj.js → RowMenu-C_Fth9Tb.js} +2 -2
  68. package/dist/assets/studio/assets/{ScheduleCard-CU87XC4_.js → ScheduleCard-BtnPrYUf.js} +2 -2
  69. package/dist/assets/studio/assets/{ScheduleDialog-DZywcZBs.js → ScheduleDialog-DJWak8Wh.js} +2 -2
  70. package/dist/assets/studio/assets/ScheduleHistoryPage-8U2zrU-1.js +2 -0
  71. package/dist/assets/studio/assets/{ScheduleStatusBadge-BvBYX3z6.js → ScheduleStatusBadge-CPRnml63.js} +2 -2
  72. package/dist/assets/studio/assets/{Schedules-WQwT-Vor.js → Schedules-CA_-r-KT.js} +2 -2
  73. package/dist/assets/studio/assets/SchedulesPage-Bnep_bBB.js +2 -0
  74. package/dist/assets/studio/assets/{Seo-BFG0drND.js → Seo-CUN9ExWK.js} +2 -2
  75. package/dist/assets/studio/assets/{SeoPreview-BUgjhYVU.js → SeoPreview-BGYVNywR.js} +2 -2
  76. package/dist/assets/studio/assets/{Settings-b3xnPmhf.js → Settings-CK5oaZyf.js} +2 -2
  77. package/dist/assets/studio/assets/{SiteOverviewPage-Ca_9NhG1.js → SiteOverviewPage-DMYnsrCp.js} +2 -2
  78. package/dist/assets/studio/assets/{SiteSettingsPage-Ci9KyZ3V.js → SiteSettingsPage-C1yPr0YD.js} +2 -2
  79. package/dist/assets/studio/assets/{SitesPage-DqXhJDMt.js → SitesPage-BDnqFs_w.js} +3 -3
  80. package/dist/assets/studio/assets/{SkillsPage-IgK0RwyD.js → SkillsPage-DsgOPOHD.js} +3 -3
  81. package/dist/assets/studio/assets/SnapshotsPage-juzxuJIY.js +2 -0
  82. package/dist/assets/studio/assets/{StatTile-IFSjHMic.js → StatTile-CdA1sdEg.js} +2 -2
  83. package/dist/assets/studio/assets/{StatusActions-B1rqPKp6.js → StatusActions-D-UibiFD.js} +3 -3
  84. package/dist/assets/studio/assets/{TableSkeleton-DqggMdG0.js → TableSkeleton-CuNEabtp.js} +2 -2
  85. package/dist/assets/studio/assets/{TagsMigration-D6F-LQG_.js → TagsMigration-CY_RNwEY.js} +2 -2
  86. package/dist/assets/studio/assets/{TaxonomyPage-dXgi9R5w.js → TaxonomyPage-Bnd_ZR0b.js} +2 -2
  87. package/dist/assets/studio/assets/{TaxonomySettingsDialog-HND1ryKG.js → TaxonomySettingsDialog-BDbLpc0k.js} +2 -2
  88. package/dist/assets/studio/assets/{TermEditorPage-DXL3ULWI.js → TermEditorPage-C71fUt6l.js} +2 -2
  89. package/dist/assets/studio/assets/{TermPickers-C8Bo9FgX.js → TermPickers-LA43obMi.js} +2 -2
  90. package/dist/assets/studio/assets/{TranslationList-BhzYkuAS.js → TranslationList-dYkcEWXh.js} +2 -2
  91. package/dist/assets/studio/assets/{TranslationsPage-6f2UMDgu.js → TranslationsPage-DMiG7Px3.js} +2 -2
  92. package/dist/assets/studio/assets/{UsedByCard-0ZXWZYKn.js → UsedByCard-Ci5WhXZr.js} +2 -2
  93. package/dist/assets/studio/assets/{UsedByList-CqGtfhzh.js → UsedByList-DTTSbfiJ.js} +2 -2
  94. package/dist/assets/studio/assets/{charts-Bp8JMtwp.js → charts-CyD9XIr2.js} +2 -2
  95. package/dist/assets/studio/assets/{collapsible-l8g94on4w7qfosmn-D4VL6lMu.js → collapsible-l8g94on4w7qfosmn-DXZ5cSxa.js} +2 -2
  96. package/dist/assets/studio/assets/collection-icons-DDkx4yxb.js +2 -0
  97. package/dist/assets/studio/assets/{combobox-hdxtsm2gqcxxgfju-BJ6B99nZ.js → combobox-hdxtsm2gqcxxgfju-BL58YHDj.js} +2 -2
  98. package/dist/assets/studio/assets/{deleteLabels-CXdCOUFd.js → deleteLabels-C6_mnHMW.js} +2 -2
  99. package/dist/assets/studio/assets/{editor-BJhMMfuG.js → editor-D-UcfC7J.js} +2 -2
  100. package/dist/assets/studio/assets/index-B9v-eWBt.js +3 -0
  101. package/dist/assets/studio/assets/index-D0ZLq-an.css +2 -0
  102. package/dist/assets/studio/assets/{layer-dialog-j5ywmzs46ccg6oqy-C7BM4aKu.js → layer-dialog-j5ywmzs46ccg6oqy-DdH4sADt.js} +2 -2
  103. package/dist/assets/studio/assets/{tag-input-ohfybx5dbxy3houy-CsTz-ays.js → tag-input-ohfybx5dbxy3houy-BME_pSFN.js} +2 -2
  104. package/dist/assets/studio/assets/useCollectionView-YtozZNNc.js +3 -0
  105. package/dist/assets/studio/index.html +3 -2
  106. package/dist/src/cli/commands-remote.d.ts +8 -1
  107. package/dist/src/cli/commands-remote.js +36 -1
  108. package/dist/src/cli/help.d.ts +1 -1
  109. package/dist/src/cli/help.js +10 -1
  110. package/dist/src/cli.d.ts +9 -0
  111. package/dist/src/cli.js +3 -0
  112. package/dist/src/commands/deploy/finish.d.ts +32 -0
  113. package/dist/src/commands/deploy/finish.js +119 -0
  114. package/dist/src/commands/deploy/options.d.ts +4 -1
  115. package/dist/src/commands/deploy/options.js +4 -1
  116. package/dist/src/commands/deploy/prepare.d.ts +333 -6
  117. package/dist/src/commands/deploy/prepare.js +32 -26
  118. package/dist/src/commands/deploy/release/checks.d.ts +10 -0
  119. package/dist/src/commands/deploy/release/checks.js +93 -0
  120. package/dist/src/commands/deploy/release/configs.d.ts +37 -0
  121. package/dist/src/commands/deploy/release/configs.js +106 -0
  122. package/dist/src/commands/deploy/release/errors.d.ts +33 -0
  123. package/dist/src/commands/deploy/release/errors.js +44 -0
  124. package/dist/src/commands/deploy/release/extract.d.ts +19 -0
  125. package/dist/src/commands/deploy/release/extract.js +95 -0
  126. package/dist/src/commands/deploy/release/fetch-release.d.ts +27 -0
  127. package/dist/src/commands/deploy/release/fetch-release.js +179 -0
  128. package/dist/src/commands/deploy/release/index.d.ts +10 -0
  129. package/dist/src/commands/deploy/release/index.js +289 -0
  130. package/dist/src/commands/deploy/release/options.d.ts +37 -0
  131. package/dist/src/commands/deploy/release/options.js +39 -0
  132. package/dist/src/commands/deploy/release/theme-check.d.ts +23 -0
  133. package/dist/src/commands/deploy/release/theme-check.js +181 -0
  134. package/dist/src/commands/deploy/release/trust.d.ts +25 -0
  135. package/dist/src/commands/deploy/release/trust.js +195 -0
  136. package/dist/src/commands/deploy/schedules-guard.d.ts +6 -1
  137. package/dist/src/commands/deploy/schedules-guard.js +8 -3
  138. package/dist/src/commands/deploy/ship.d.ts +6 -1
  139. package/dist/src/commands/deploy/ship.js +6 -2
  140. package/dist/src/commands/deploy.d.ts +4 -0
  141. package/dist/src/commands/deploy.js +24 -68
  142. package/dist/src/commands/fields.js +1 -1
  143. package/dist/src/commands/import-apply.js +5 -1
  144. package/dist/src/commands/import-revert.js +7 -1
  145. package/dist/src/commands/import.js +14 -2
  146. package/dist/src/commands/sync.js +2 -0
  147. package/dist/src/config-build-keys.d.ts +54 -0
  148. package/dist/src/config-build-keys.js +131 -0
  149. package/dist/src/config.d.ts +2 -0
  150. package/dist/src/config.js +1 -1
  151. package/dist/src/render-chrome.d.ts +12 -2
  152. package/dist/src/render-chrome.js +130 -68
  153. package/package.json +13 -12
  154. package/dist/assets/studio/assets/ActivityPage-WMRfMUvK.js +0 -2
  155. package/dist/assets/studio/assets/AgentsPage-DLLmx-so.js +0 -2
  156. package/dist/assets/studio/assets/ArticlesPage-DMpZFnlE.js +0 -3
  157. package/dist/assets/studio/assets/CollectionSettingsPage-DWscLife.js +0 -3
  158. package/dist/assets/studio/assets/CommentsPage-Cf_CseQi.js +0 -2
  159. package/dist/assets/studio/assets/EndedBadge-SSv5wA-H.js +0 -2
  160. package/dist/assets/studio/assets/ListToolbar-AiTPzw9z.js +0 -2
  161. package/dist/assets/studio/assets/MediaPage-By0qbkgh.js +0 -2
  162. package/dist/assets/studio/assets/Readers-Bvy9rxlu.js +0 -3
  163. package/dist/assets/studio/assets/RedirectsPage-XukadT0D.js +0 -2
  164. package/dist/assets/studio/assets/ScheduleHistoryPage-BA8TT-E9.js +0 -2
  165. package/dist/assets/studio/assets/SchedulesPage-B-H3TV5a.js +0 -2
  166. package/dist/assets/studio/assets/SnapshotsPage-8W2qFiqI.js +0 -2
  167. package/dist/assets/studio/assets/collection-icons-KuQZKlox.js +0 -2
  168. package/dist/assets/studio/assets/index-IQPO-IzP.css +0 -2
  169. package/dist/assets/studio/assets/index-jx_2-Qkj.js +0 -3
  170. package/dist/assets/studio/assets/useCollectionView-DIAOpQTO.js +0 -3
@@ -38,16 +38,343 @@ export interface DeploySettings {
38
38
  * turns on, said once.
39
39
  */
40
40
  export declare function deploySettings(ctx: DeployContext): Promise<DeploySettings>;
41
- /**
42
- * 3. the site Worker: its config, the theme's block types (RFC-0015 §6), design settings
43
- * (RFC-0017 §1) and DESIGN.md (RFC-0021 §1) checked before anything is built, then the build.
44
- */
45
- export declare function buildSite(ctx: DeployContext, input: {
41
+ export interface SiteConfigInput {
46
42
  withIds: DeploymentNames;
47
43
  analytics: AnalyticsDeployment | undefined;
48
44
  comments: CommentsDeployment;
49
45
  observability: ObservabilityDeployment;
50
- }): Promise<{
46
+ }
47
+ /** 3a. the site Worker's config (RFC-0034 §4–5: with the other sites it serves), written as today. */
48
+ export declare function siteConfigFor(ctx: DeployContext, input: SiteConfigInput): Promise<{
49
+ ai_search: {
50
+ binding: string;
51
+ instance_name: string;
52
+ }[];
53
+ d1_databases: {
54
+ binding: string;
55
+ database_name: string;
56
+ database_id?: string;
57
+ }[];
58
+ r2_buckets: {
59
+ binding: string;
60
+ bucket_name: string;
61
+ }[];
62
+ routes: {
63
+ pattern: string;
64
+ custom_domain: boolean;
65
+ }[];
66
+ $schema: string;
67
+ name: string;
68
+ main: string;
69
+ compatibility_date: string;
70
+ compatibility_flags: string[];
71
+ analytics_engine_datasets?: {
72
+ binding: string;
73
+ dataset: string;
74
+ }[];
75
+ ratelimits?: {
76
+ name: string;
77
+ namespace_id: string;
78
+ simple: {
79
+ limit: number;
80
+ period: number;
81
+ };
82
+ }[];
83
+ vars: {
84
+ CLOUDHAL_SEARCH_PROVIDER: string;
85
+ CLOUDHAL_SEARCH_MONTHLY_LIMIT: string;
86
+ CLOUDHAL_SITE_IDS: string;
87
+ CLOUDHAL_ANALYTICS?: string;
88
+ CLOUDHAL_ANALYTICS_DEFAULTS?: string;
89
+ CLOUDHAL_SITE_HOSTS?: string;
90
+ CLOUDHAL_REDIRECT_HOSTS?: string;
91
+ CLOUDHAL_REDIRECT_TO?: string;
92
+ } | {
93
+ CLOUDHAL_SEARCH_PROVIDER?: never;
94
+ CLOUDHAL_SEARCH_MONTHLY_LIMIT?: never;
95
+ CLOUDHAL_SITE_IDS: string;
96
+ CLOUDHAL_ANALYTICS?: string;
97
+ CLOUDHAL_ANALYTICS_DEFAULTS?: string;
98
+ CLOUDHAL_SITE_HOSTS?: string;
99
+ CLOUDHAL_REDIRECT_HOSTS?: string;
100
+ CLOUDHAL_REDIRECT_TO?: string;
101
+ } | {
102
+ CLOUDHAL_SEARCH_PROVIDER: string;
103
+ CLOUDHAL_SEARCH_MONTHLY_LIMIT: string;
104
+ CLOUDHAL_SITE_ID: string;
105
+ CLOUDHAL_ANALYTICS?: string;
106
+ CLOUDHAL_ANALYTICS_DEFAULTS?: string;
107
+ CLOUDHAL_SITE_HOSTS?: string;
108
+ CLOUDHAL_REDIRECT_HOSTS?: string;
109
+ CLOUDHAL_REDIRECT_TO?: string;
110
+ } | {
111
+ CLOUDHAL_SEARCH_PROVIDER?: never;
112
+ CLOUDHAL_SEARCH_MONTHLY_LIMIT?: never;
113
+ CLOUDHAL_SITE_ID: string;
114
+ CLOUDHAL_ANALYTICS?: string;
115
+ CLOUDHAL_ANALYTICS_DEFAULTS?: string;
116
+ CLOUDHAL_SITE_HOSTS?: string;
117
+ CLOUDHAL_REDIRECT_HOSTS?: string;
118
+ CLOUDHAL_REDIRECT_TO?: string;
119
+ };
120
+ cache: {
121
+ enabled: boolean;
122
+ };
123
+ observability: {
124
+ enabled: boolean;
125
+ head_sampling_rate?: number;
126
+ redact_query_string: boolean;
127
+ traces?: {
128
+ enabled: boolean;
129
+ head_sampling_rate?: number;
130
+ };
131
+ };
132
+ } | {
133
+ ai_search: {
134
+ binding: string;
135
+ instance_name: string;
136
+ }[];
137
+ d1_databases: {
138
+ binding: string;
139
+ database_name: string;
140
+ database_id?: string;
141
+ }[];
142
+ r2_buckets: {
143
+ binding: string;
144
+ bucket_name: string;
145
+ }[];
146
+ routes?: never;
147
+ $schema: string;
148
+ name: string;
149
+ main: string;
150
+ compatibility_date: string;
151
+ compatibility_flags: string[];
152
+ analytics_engine_datasets?: {
153
+ binding: string;
154
+ dataset: string;
155
+ }[];
156
+ ratelimits?: {
157
+ name: string;
158
+ namespace_id: string;
159
+ simple: {
160
+ limit: number;
161
+ period: number;
162
+ };
163
+ }[];
164
+ vars: {
165
+ CLOUDHAL_SEARCH_PROVIDER: string;
166
+ CLOUDHAL_SEARCH_MONTHLY_LIMIT: string;
167
+ CLOUDHAL_SITE_IDS: string;
168
+ CLOUDHAL_ANALYTICS?: string;
169
+ CLOUDHAL_ANALYTICS_DEFAULTS?: string;
170
+ CLOUDHAL_SITE_HOSTS?: string;
171
+ CLOUDHAL_REDIRECT_HOSTS?: string;
172
+ CLOUDHAL_REDIRECT_TO?: string;
173
+ } | {
174
+ CLOUDHAL_SEARCH_PROVIDER?: never;
175
+ CLOUDHAL_SEARCH_MONTHLY_LIMIT?: never;
176
+ CLOUDHAL_SITE_IDS: string;
177
+ CLOUDHAL_ANALYTICS?: string;
178
+ CLOUDHAL_ANALYTICS_DEFAULTS?: string;
179
+ CLOUDHAL_SITE_HOSTS?: string;
180
+ CLOUDHAL_REDIRECT_HOSTS?: string;
181
+ CLOUDHAL_REDIRECT_TO?: string;
182
+ } | {
183
+ CLOUDHAL_SEARCH_PROVIDER: string;
184
+ CLOUDHAL_SEARCH_MONTHLY_LIMIT: string;
185
+ CLOUDHAL_SITE_ID: string;
186
+ CLOUDHAL_ANALYTICS?: string;
187
+ CLOUDHAL_ANALYTICS_DEFAULTS?: string;
188
+ CLOUDHAL_SITE_HOSTS?: string;
189
+ CLOUDHAL_REDIRECT_HOSTS?: string;
190
+ CLOUDHAL_REDIRECT_TO?: string;
191
+ } | {
192
+ CLOUDHAL_SEARCH_PROVIDER?: never;
193
+ CLOUDHAL_SEARCH_MONTHLY_LIMIT?: never;
194
+ CLOUDHAL_SITE_ID: string;
195
+ CLOUDHAL_ANALYTICS?: string;
196
+ CLOUDHAL_ANALYTICS_DEFAULTS?: string;
197
+ CLOUDHAL_SITE_HOSTS?: string;
198
+ CLOUDHAL_REDIRECT_HOSTS?: string;
199
+ CLOUDHAL_REDIRECT_TO?: string;
200
+ };
201
+ cache: {
202
+ enabled: boolean;
203
+ };
204
+ observability: {
205
+ enabled: boolean;
206
+ head_sampling_rate?: number;
207
+ redact_query_string: boolean;
208
+ traces?: {
209
+ enabled: boolean;
210
+ head_sampling_rate?: number;
211
+ };
212
+ };
213
+ } | {
214
+ ai_search?: never;
215
+ d1_databases: {
216
+ binding: string;
217
+ database_name: string;
218
+ database_id?: string;
219
+ }[];
220
+ r2_buckets: {
221
+ binding: string;
222
+ bucket_name: string;
223
+ }[];
224
+ routes: {
225
+ pattern: string;
226
+ custom_domain: boolean;
227
+ }[];
228
+ $schema: string;
229
+ name: string;
230
+ main: string;
231
+ compatibility_date: string;
232
+ compatibility_flags: string[];
233
+ analytics_engine_datasets?: {
234
+ binding: string;
235
+ dataset: string;
236
+ }[];
237
+ ratelimits?: {
238
+ name: string;
239
+ namespace_id: string;
240
+ simple: {
241
+ limit: number;
242
+ period: number;
243
+ };
244
+ }[];
245
+ vars: {
246
+ CLOUDHAL_SEARCH_PROVIDER: string;
247
+ CLOUDHAL_SEARCH_MONTHLY_LIMIT: string;
248
+ CLOUDHAL_SITE_IDS: string;
249
+ CLOUDHAL_ANALYTICS?: string;
250
+ CLOUDHAL_ANALYTICS_DEFAULTS?: string;
251
+ CLOUDHAL_SITE_HOSTS?: string;
252
+ CLOUDHAL_REDIRECT_HOSTS?: string;
253
+ CLOUDHAL_REDIRECT_TO?: string;
254
+ } | {
255
+ CLOUDHAL_SEARCH_PROVIDER?: never;
256
+ CLOUDHAL_SEARCH_MONTHLY_LIMIT?: never;
257
+ CLOUDHAL_SITE_IDS: string;
258
+ CLOUDHAL_ANALYTICS?: string;
259
+ CLOUDHAL_ANALYTICS_DEFAULTS?: string;
260
+ CLOUDHAL_SITE_HOSTS?: string;
261
+ CLOUDHAL_REDIRECT_HOSTS?: string;
262
+ CLOUDHAL_REDIRECT_TO?: string;
263
+ } | {
264
+ CLOUDHAL_SEARCH_PROVIDER: string;
265
+ CLOUDHAL_SEARCH_MONTHLY_LIMIT: string;
266
+ CLOUDHAL_SITE_ID: string;
267
+ CLOUDHAL_ANALYTICS?: string;
268
+ CLOUDHAL_ANALYTICS_DEFAULTS?: string;
269
+ CLOUDHAL_SITE_HOSTS?: string;
270
+ CLOUDHAL_REDIRECT_HOSTS?: string;
271
+ CLOUDHAL_REDIRECT_TO?: string;
272
+ } | {
273
+ CLOUDHAL_SEARCH_PROVIDER?: never;
274
+ CLOUDHAL_SEARCH_MONTHLY_LIMIT?: never;
275
+ CLOUDHAL_SITE_ID: string;
276
+ CLOUDHAL_ANALYTICS?: string;
277
+ CLOUDHAL_ANALYTICS_DEFAULTS?: string;
278
+ CLOUDHAL_SITE_HOSTS?: string;
279
+ CLOUDHAL_REDIRECT_HOSTS?: string;
280
+ CLOUDHAL_REDIRECT_TO?: string;
281
+ };
282
+ cache: {
283
+ enabled: boolean;
284
+ };
285
+ observability: {
286
+ enabled: boolean;
287
+ head_sampling_rate?: number;
288
+ redact_query_string: boolean;
289
+ traces?: {
290
+ enabled: boolean;
291
+ head_sampling_rate?: number;
292
+ };
293
+ };
294
+ } | {
295
+ ai_search?: never;
296
+ d1_databases: {
297
+ binding: string;
298
+ database_name: string;
299
+ database_id?: string;
300
+ }[];
301
+ r2_buckets: {
302
+ binding: string;
303
+ bucket_name: string;
304
+ }[];
305
+ routes?: never;
306
+ $schema: string;
307
+ name: string;
308
+ main: string;
309
+ compatibility_date: string;
310
+ compatibility_flags: string[];
311
+ analytics_engine_datasets?: {
312
+ binding: string;
313
+ dataset: string;
314
+ }[];
315
+ ratelimits?: {
316
+ name: string;
317
+ namespace_id: string;
318
+ simple: {
319
+ limit: number;
320
+ period: number;
321
+ };
322
+ }[];
323
+ vars: {
324
+ CLOUDHAL_SEARCH_PROVIDER: string;
325
+ CLOUDHAL_SEARCH_MONTHLY_LIMIT: string;
326
+ CLOUDHAL_SITE_IDS: string;
327
+ CLOUDHAL_ANALYTICS?: string;
328
+ CLOUDHAL_ANALYTICS_DEFAULTS?: string;
329
+ CLOUDHAL_SITE_HOSTS?: string;
330
+ CLOUDHAL_REDIRECT_HOSTS?: string;
331
+ CLOUDHAL_REDIRECT_TO?: string;
332
+ } | {
333
+ CLOUDHAL_SEARCH_PROVIDER?: never;
334
+ CLOUDHAL_SEARCH_MONTHLY_LIMIT?: never;
335
+ CLOUDHAL_SITE_IDS: string;
336
+ CLOUDHAL_ANALYTICS?: string;
337
+ CLOUDHAL_ANALYTICS_DEFAULTS?: string;
338
+ CLOUDHAL_SITE_HOSTS?: string;
339
+ CLOUDHAL_REDIRECT_HOSTS?: string;
340
+ CLOUDHAL_REDIRECT_TO?: string;
341
+ } | {
342
+ CLOUDHAL_SEARCH_PROVIDER: string;
343
+ CLOUDHAL_SEARCH_MONTHLY_LIMIT: string;
344
+ CLOUDHAL_SITE_ID: string;
345
+ CLOUDHAL_ANALYTICS?: string;
346
+ CLOUDHAL_ANALYTICS_DEFAULTS?: string;
347
+ CLOUDHAL_SITE_HOSTS?: string;
348
+ CLOUDHAL_REDIRECT_HOSTS?: string;
349
+ CLOUDHAL_REDIRECT_TO?: string;
350
+ } | {
351
+ CLOUDHAL_SEARCH_PROVIDER?: never;
352
+ CLOUDHAL_SEARCH_MONTHLY_LIMIT?: never;
353
+ CLOUDHAL_SITE_ID: string;
354
+ CLOUDHAL_ANALYTICS?: string;
355
+ CLOUDHAL_ANALYTICS_DEFAULTS?: string;
356
+ CLOUDHAL_SITE_HOSTS?: string;
357
+ CLOUDHAL_REDIRECT_HOSTS?: string;
358
+ CLOUDHAL_REDIRECT_TO?: string;
359
+ };
360
+ cache: {
361
+ enabled: boolean;
362
+ };
363
+ observability: {
364
+ enabled: boolean;
365
+ head_sampling_rate?: number;
366
+ redact_query_string: boolean;
367
+ traces?: {
368
+ enabled: boolean;
369
+ head_sampling_rate?: number;
370
+ };
371
+ };
372
+ }>;
373
+ /**
374
+ * 3. the site Worker: its config, the theme's block types (RFC-0015 §6), design settings
375
+ * (RFC-0017 §1) and DESIGN.md (RFC-0021 §1) checked before anything is built, then the build.
376
+ */
377
+ export declare function buildSite(ctx: DeployContext, input: SiteConfigInput): Promise<{
51
378
  siteConfig: string;
52
379
  blockTypes: string | undefined;
53
380
  themeSettings: string | undefined;
@@ -268,37 +268,43 @@ function logFeatures(
268
268
  );
269
269
  }
270
270
 
271
- /**
272
- * 3. the site Worker: its config, the theme's block types (RFC-0015 §6), design settings
273
- * (RFC-0017 §1) and DESIGN.md (RFC-0021 §1) checked before anything is built, then the build.
274
- */
275
- export async function buildSite(
276
- ctx ,
277
- input
278
-
279
-
280
-
281
-
282
- ,
283
- ) {
284
- const { options, cfg, site, log } = ctx;
285
- // RFC-0034 §4–5: the other sites this Worker serves, checked and with their routes.
271
+
272
+
273
+
274
+
275
+
276
+
277
+
278
+ /** 3a. the site Worker's config (RFC-0034 §4–5: with the other sites it serves), written as today. */
279
+ export async function siteConfigFor(ctx , input ) {
280
+ const { options, cfg, site } = ctx;
286
281
  const served = await servedSites(ctx);
282
+ const config = siteWorkerConfig({
283
+ ...input.withIds,
284
+ siteId: cfg.siteId,
285
+ ...(served.siteIds ? { siteIds: served.siteIds } : {}),
286
+ ...(served.hosts.length > 0 ? { domains: served.hosts } : {}),
287
+ ...(cfg.domains?.site ? { domain: cfg.domains.site, siteHosts: [cfg.domains.site] } : {}),
288
+ ...(cfg.domains?.redirects ? { redirects: cfg.domains.redirects } : {}),
289
+ ...(input.analytics ? { analytics: input.analytics } : {}),
290
+ comments: input.comments,
291
+ observability: input.observability,
292
+ });
287
293
  await writeWranglerConfig(
288
294
  siteConfigPath(options.projectDir),
289
- siteWorkerConfig({
290
- ...input.withIds,
291
- siteId: cfg.siteId,
292
- ...(served.siteIds ? { siteIds: served.siteIds } : {}),
293
- ...(served.hosts.length > 0 ? { domains: served.hosts } : {}),
294
- ...(cfg.domains?.site ? { domain: cfg.domains.site, siteHosts: [cfg.domains.site] } : {}),
295
- ...(cfg.domains?.redirects ? { redirects: cfg.domains.redirects } : {}),
296
- ...(input.analytics ? { analytics: input.analytics } : {}),
297
- comments: input.comments,
298
- observability: input.observability,
299
- }),
295
+ config,
300
296
  `Cloudhal site Worker for ${site.name}`,
301
297
  );
298
+ return config;
299
+ }
300
+
301
+ /**
302
+ * 3. the site Worker: its config, the theme's block types (RFC-0015 §6), design settings
303
+ * (RFC-0017 §1) and DESIGN.md (RFC-0021 §1) checked before anything is built, then the build.
304
+ */
305
+ export async function buildSite(ctx , input ) {
306
+ const { options, log } = ctx;
307
+ await siteConfigFor(ctx, input);
302
308
  await loadBlockRegistry(options.projectDir);
303
309
  await loadThemeSettings(options.projectDir);
304
310
  const blockTypes = await blockTypesFile(options.projectDir);
@@ -0,0 +1,10 @@
1
+ import { type ProjectConfig } from "../../../config.js";
2
+ import { type ThemeDifference } from "./theme-check.js";
3
+ /** Another installation, several sites, Workers Builds: refused before anything is fetched. */
4
+ export declare function checkProjectShape(cfg: ProjectConfig, workersBuilds: boolean | undefined): void;
5
+ /** The project's files that differ from the starter: refused, or listed with the flag. */
6
+ export declare function checkTheme(projectDir: string, discard: boolean | undefined, log: (line: string) => void): Promise<ThemeDifference[]>;
7
+ /** `cloudhal.json` keys the bundle cannot honour (`config-build-keys.ts`). */
8
+ export declare function checkBuildKeys(projectDir: string, features: Readonly<Record<string, boolean>>): Promise<void>;
9
+ /** The wrangler that will run is at least the bundle's (`manifest.toolchain.wrangler`). */
10
+ export declare function checkWrangler(projectDir: string, required: string | undefined, known?: string): Promise<void>;
@@ -0,0 +1,93 @@
1
+ /**
2
+ * What `deploy --release` checks before it downloads the tarball (RFC-0046 §11b): the project's
3
+ * shape, its theme files against this CLI's starter, its `cloudhal.json` build keys, and the
4
+ * wrangler that will upload the bytes.
5
+ */
6
+ import { readFile } from "node:fs/promises";
7
+ import path from "node:path";
8
+ import { installedWranglerVersion, versionAtLeast } from "../../../cloudflare/wrangler.js";
9
+ import { CONFIG_FILE, } from "../../../config.js";
10
+ import { buildKeyProblems } from "../../../config-build-keys.js";
11
+ import { inWorkersBuilds } from "../workers-builds.js";
12
+ import { refuseDeploy, WITHOUT_RELEASE } from "./errors.js";
13
+ import {
14
+ cliStarter,
15
+ listDifferences,
16
+
17
+ themeDifferences,
18
+ } from "./theme-check.js";
19
+
20
+ /** Another installation, several sites, Workers Builds: refused before anything is fetched. */
21
+ export function checkProjectShape(cfg , workersBuilds ) {
22
+ if (cfg.installation)
23
+ refuseDeploy(
24
+ "project-unsupported",
25
+ `this project's site Worker joins the installation in ${cfg.installation} (cloudhal.json \`installation\`); --release installs a whole deployment. ${WITHOUT_RELEASE}`,
26
+ );
27
+ if (cfg.sites)
28
+ refuseDeploy(
29
+ "project-unsupported",
30
+ `this project serves several sites (cloudhal.json \`sites\`), which --release does not install. ${WITHOUT_RELEASE}`,
31
+ );
32
+ if (inWorkersBuilds(workersBuilds))
33
+ refuseDeploy(
34
+ "project-unsupported",
35
+ "--release does not run in Cloudflare Workers Builds: a build there deploys the checkout.",
36
+ );
37
+ }
38
+
39
+ /** The project's files that differ from the starter: refused, or listed with the flag. */
40
+ export async function checkTheme(
41
+ projectDir ,
42
+ discard ,
43
+ log ,
44
+ ) {
45
+ const diffs = await themeDifferences(projectDir, await cliStarter());
46
+ if (diffs.length === 0) return [];
47
+ if (!discard)
48
+ refuseDeploy(
49
+ "theme-differs",
50
+ `--release installs this CLI's official theme, and these build inputs differ from it:\n${listDifferences(diffs)}\nRun \`cloudhal deploy\` without --release to build the project as it is, or add --discard-local-theme to deploy the official theme anyway (your files stay on disk; they are not deployed).`,
51
+ );
52
+ log(
53
+ `--discard-local-theme: the official theme is deployed; these ${diffs.length} files of the project are not:\n${listDifferences(diffs, true)}`,
54
+ );
55
+ return diffs;
56
+ }
57
+
58
+ /** `cloudhal.json` keys the bundle cannot honour (`config-build-keys.ts`). */
59
+ export async function checkBuildKeys(
60
+ projectDir ,
61
+ features ,
62
+ ) {
63
+ const raw = JSON.parse(await readFile(path.join(projectDir, CONFIG_FILE), "utf8"))
64
+
65
+
66
+ ;
67
+ const problems = buildKeyProblems(raw, features);
68
+ if (problems.length === 0) return;
69
+ const lines = problems.map((p) =>
70
+ p.problem === "unknown"
71
+ ? ` ${p.key}: this CLI does not know the key`
72
+ : ` ${p.key}: ${JSON.stringify(p.value)} differs from the starter's (the bundle was built without it)`,
73
+ );
74
+ refuseDeploy(
75
+ "config-build-key",
76
+ `cloudhal.json sets keys the signed bundle cannot honour (--discard-local-theme does not cover these):\n${lines.join("\n")}\nChange them, or ${WITHOUT_RELEASE.charAt(0).toLowerCase()}${WITHOUT_RELEASE.slice(1)}`,
77
+ );
78
+ }
79
+
80
+ /** The wrangler that will run is at least the bundle's (`manifest.toolchain.wrangler`). */
81
+ export async function checkWrangler(
82
+ projectDir ,
83
+ required ,
84
+ known ,
85
+ ) {
86
+ if (!required) return;
87
+ const installed = known ?? (await installedWranglerVersion(projectDir));
88
+ if (!installed || !versionAtLeast(installed, required))
89
+ refuseDeploy(
90
+ "wrangler-too-old",
91
+ `--release needs wrangler ${required} or newer, the version the bundle was built with (found ${installed ?? "none"}). Run \`pnpm add -D wrangler@^${required}\`.`,
92
+ );
93
+ }
@@ -0,0 +1,37 @@
1
+ import type { ReleaseManifest } from "@cloudhal/release-verify";
2
+ import { type adminWorkerConfig, type siteWorkerConfig } from "../../../cloudflare/config.js";
3
+ import type { ExtractedWorker, WorkerRole } from "./extract.js";
4
+ /** Manifest module types → wrangler rule types. */
5
+ export declare const RULE_TYPES: Readonly<Record<string, string>>;
6
+ type GeneratedConfig = ReturnType<typeof siteWorkerConfig> | ReturnType<typeof adminWorkerConfig>;
7
+ /** `config` changed to upload `worker`'s extracted bytes as they are (see the file comment). */
8
+ export declare function releaseConfig(config: GeneratedConfig, input: {
9
+ role: WorkerRole;
10
+ worker: ExtractedWorker;
11
+ manifest: ReleaseManifest;
12
+ /** The directory the config is written to; every path in it is relative to that. */
13
+ configDir: string;
14
+ }): Record<string, unknown>;
15
+ /** Writes both configs; returns their paths and directories (wrangler runs in each). */
16
+ export declare function writeReleaseConfigs(input: {
17
+ deployDir: string;
18
+ manifest: ReleaseManifest;
19
+ site: {
20
+ config: ReturnType<typeof siteWorkerConfig>;
21
+ worker: ExtractedWorker;
22
+ };
23
+ admin: {
24
+ config: ReturnType<typeof adminWorkerConfig>;
25
+ worker: ExtractedWorker;
26
+ };
27
+ }): Promise<{
28
+ site: {
29
+ dir: string;
30
+ configPath: string;
31
+ };
32
+ admin: {
33
+ dir: string;
34
+ configPath: string;
35
+ };
36
+ }>;
37
+ export {};
@@ -0,0 +1,106 @@
1
+ /**
2
+ * The wrangler configs that deploy a verified bundle's bytes unchanged (RFC-0046 §11b): the same
3
+ * configs `cloudhal deploy` generates today (`siteWorkerConfig`, `adminWorkerConfig`), with
4
+ *
5
+ * - `main` the extracted main module and `no_bundle: true`;
6
+ * - one `rules` entry per module type whose globs are exactly that type's module paths, with
7
+ * `fallthrough: false`, and `preserve_file_names`, so wrangler uploads exactly the listed
8
+ * modules under the names the bundle's code imports;
9
+ * - the compatibility date and flags of the manifest;
10
+ * - `assets.directory` the extracted assets, with the manifest's routing config.
11
+ *
12
+ * They live in `.cloudhal/deploy/release-config/{site,admin}/wrangler.jsonc`, next to nothing else.
13
+ */
14
+ import { mkdir } from "node:fs/promises";
15
+ import path from "node:path";
16
+
17
+ import {
18
+
19
+
20
+ writeWranglerConfig,
21
+ } from "../../../cloudflare/config.js";
22
+
23
+
24
+ /** Manifest module types → wrangler rule types. */
25
+ export const RULE_TYPES = {
26
+ esm: "ESModule",
27
+ cjs: "CommonJS",
28
+ wasm: "CompiledWasm",
29
+ text: "Text",
30
+ data: "Data",
31
+ };
32
+
33
+
34
+
35
+ const posix = (p ) => p.split(path.sep).join("/");
36
+
37
+ /** `config` changed to upload `worker`'s extracted bytes as they are (see the file comment). */
38
+ export function releaseConfig(
39
+ config ,
40
+ input
41
+
42
+
43
+
44
+
45
+
46
+ ,
47
+ ) {
48
+ const { $schema: _schema, ...rest } = config ;
49
+ const w = input.worker;
50
+ const rel = (p ) => posix(path.relative(input.configDir, p)) || ".";
51
+ const rules = Object.entries(w.modulesByType).map(([type, paths]) => {
52
+ const rule = RULE_TYPES[type];
53
+ if (!rule) throw new Error(`the bundle lists a module of unknown type ${type}`);
54
+ return { type: rule, globs: [...paths].sort(), fallthrough: false };
55
+ });
56
+ const generatedAssets =
57
+ typeof rest.assets === "object" && rest.assets ? (rest.assets ) : {};
58
+ const runtime = input.manifest.runtime;
59
+ return {
60
+ ...rest,
61
+ main: rel(path.join(w.modulesDir, w.mainModule)),
62
+ base_dir: rel(w.modulesDir),
63
+ no_bundle: true,
64
+ find_additional_modules: true,
65
+ preserve_file_names: true,
66
+ rules,
67
+ compatibility_date: runtime.compatibilityDate,
68
+ compatibility_flags: [...runtime.compatibilityFlags],
69
+ assets: {
70
+ ...generatedAssets,
71
+ binding: "ASSETS",
72
+ directory: rel(w.assetsDir),
73
+ ...(input.manifest.workers[input.role].assets.config ?? {}),
74
+ },
75
+ };
76
+ }
77
+
78
+ /** Writes both configs; returns their paths and directories (wrangler runs in each). */
79
+ export async function writeReleaseConfigs(input
80
+
81
+
82
+
83
+
84
+ )
85
+
86
+
87
+ {
88
+ const out = {} ;
89
+ for (const role of ["site", "admin"] ) {
90
+ const dir = path.join(input.deployDir, "release-config", role);
91
+ await mkdir(dir, { recursive: true });
92
+ const configPath = path.join(dir, "wrangler.jsonc");
93
+ await writeWranglerConfig(
94
+ configPath,
95
+ releaseConfig(input[role].config, {
96
+ role,
97
+ worker: input[role].worker,
98
+ manifest: input.manifest,
99
+ configDir: dir,
100
+ }),
101
+ `Cloudhal ${role} Worker from the signed release v${input.manifest.version} (deploy --release)`,
102
+ );
103
+ out[role] = { dir, configPath };
104
+ }
105
+ return out;
106
+ }