@conloca/cloud-astro 0.2.2 → 0.2.4

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 (241) hide show
  1. package/README.md +378 -207
  2. package/dist/.build-inputs.json +69 -0
  3. package/dist/src/component-manifest.d.ts +5 -3
  4. package/dist/src/component-manifest.d.ts.map +1 -1
  5. package/dist/src/component-manifest.js +7 -7
  6. package/dist/src/component-manifest.js.map +1 -1
  7. package/dist/src/constants.d.ts +14 -13
  8. package/dist/src/constants.d.ts.map +1 -1
  9. package/dist/src/constants.js +14 -13
  10. package/dist/src/constants.js.map +1 -1
  11. package/dist/src/d3-build.d.ts +70 -0
  12. package/dist/src/d3-build.d.ts.map +1 -0
  13. package/dist/src/d3-build.js +272 -0
  14. package/dist/src/d3-build.js.map +1 -0
  15. package/dist/src/descriptors.d.ts +2 -2
  16. package/dist/src/descriptors.d.ts.map +1 -1
  17. package/dist/src/descriptors.js +4 -2
  18. package/dist/src/descriptors.js.map +1 -1
  19. package/dist/src/doctor/checks-address.d.ts +18 -0
  20. package/dist/src/doctor/checks-address.d.ts.map +1 -0
  21. package/dist/src/doctor/checks-address.js +163 -0
  22. package/dist/src/doctor/checks-address.js.map +1 -0
  23. package/dist/src/doctor/checks-live.d.ts +8 -5
  24. package/dist/src/doctor/checks-live.d.ts.map +1 -1
  25. package/dist/src/doctor/checks-live.js +226 -188
  26. package/dist/src/doctor/checks-live.js.map +1 -1
  27. package/dist/src/doctor/checks-offline.d.ts +6 -25
  28. package/dist/src/doctor/checks-offline.d.ts.map +1 -1
  29. package/dist/src/doctor/checks-offline.js +30 -259
  30. package/dist/src/doctor/checks-offline.js.map +1 -1
  31. package/dist/src/doctor/checks-preview-limits.d.ts +11 -0
  32. package/dist/src/doctor/checks-preview-limits.d.ts.map +1 -0
  33. package/dist/src/doctor/checks-preview-limits.js +133 -0
  34. package/dist/src/doctor/checks-preview-limits.js.map +1 -0
  35. package/dist/src/doctor/checks-preview-live.d.ts +14 -0
  36. package/dist/src/doctor/checks-preview-live.d.ts.map +1 -0
  37. package/dist/src/doctor/checks-preview-live.js +72 -0
  38. package/dist/src/doctor/checks-preview-live.js.map +1 -0
  39. package/dist/src/doctor/checks-preview.d.ts +7 -0
  40. package/dist/src/doctor/checks-preview.d.ts.map +1 -0
  41. package/dist/src/doctor/checks-preview.js +287 -0
  42. package/dist/src/doctor/checks-preview.js.map +1 -0
  43. package/dist/src/doctor/config-scan.d.ts +12 -3
  44. package/dist/src/doctor/config-scan.d.ts.map +1 -1
  45. package/dist/src/doctor/config-scan.js +38 -11
  46. package/dist/src/doctor/config-scan.js.map +1 -1
  47. package/dist/src/doctor/run.d.ts.map +1 -1
  48. package/dist/src/doctor/run.js +16 -10
  49. package/dist/src/doctor/run.js.map +1 -1
  50. package/dist/src/doctor/types.d.ts +17 -7
  51. package/dist/src/doctor/types.d.ts.map +1 -1
  52. package/dist/src/doctor/types.js +17 -7
  53. package/dist/src/doctor/types.js.map +1 -1
  54. package/dist/src/editor-page/bundle.d.ts +90 -0
  55. package/dist/src/editor-page/bundle.d.ts.map +1 -0
  56. package/dist/src/editor-page/bundle.js +373 -0
  57. package/dist/src/editor-page/bundle.js.map +1 -0
  58. package/dist/src/editor-page/data-schemas.d.ts +16 -0
  59. package/dist/src/editor-page/data-schemas.d.ts.map +1 -0
  60. package/dist/src/editor-page/data-schemas.js +39 -0
  61. package/dist/src/editor-page/data-schemas.js.map +1 -0
  62. package/dist/src/editor-page/emit.d.ts +69 -0
  63. package/dist/src/editor-page/emit.d.ts.map +1 -0
  64. package/dist/src/editor-page/emit.js +254 -0
  65. package/dist/src/editor-page/emit.js.map +1 -0
  66. package/dist/src/editor-page/framing.d.ts +23 -0
  67. package/dist/src/editor-page/framing.d.ts.map +1 -0
  68. package/dist/src/editor-page/framing.js +39 -0
  69. package/dist/src/editor-page/framing.js.map +1 -0
  70. package/dist/src/editor-page/page.d.ts +9 -0
  71. package/dist/src/editor-page/page.d.ts.map +1 -0
  72. package/dist/src/editor-page/page.js +31 -0
  73. package/dist/src/editor-page/page.js.map +1 -0
  74. package/dist/src/editor-page/site-base.d.ts +4 -0
  75. package/dist/src/editor-page/site-base.d.ts.map +1 -0
  76. package/dist/src/editor-page/site-base.js +13 -0
  77. package/dist/src/editor-page/site-base.js.map +1 -0
  78. package/dist/src/git.d.ts +11 -8
  79. package/dist/src/git.d.ts.map +1 -1
  80. package/dist/src/git.js +25 -8
  81. package/dist/src/git.js.map +1 -1
  82. package/dist/src/index.d.ts +4 -1
  83. package/dist/src/index.d.ts.map +1 -1
  84. package/dist/src/index.js +11 -6
  85. package/dist/src/index.js.map +1 -1
  86. package/dist/src/integration.d.ts +1 -1
  87. package/dist/src/integration.d.ts.map +1 -1
  88. package/dist/src/integration.js +377 -416
  89. package/dist/src/integration.js.map +1 -1
  90. package/dist/src/node.d.ts +3 -1
  91. package/dist/src/node.d.ts.map +1 -1
  92. package/dist/src/node.js +7 -2
  93. package/dist/src/node.js.map +1 -1
  94. package/dist/src/preview/_dispatch.d.ts +12 -0
  95. package/dist/src/preview/_dispatch.d.ts.map +1 -1
  96. package/dist/src/preview/_dispatch.js +31 -0
  97. package/dist/src/preview/_dispatch.js.map +1 -1
  98. package/dist/src/preview/_resolve-opts.d.ts +19 -10
  99. package/dist/src/preview/_resolve-opts.d.ts.map +1 -1
  100. package/dist/src/preview/_resolve-opts.js +24 -11
  101. package/dist/src/preview/_resolve-opts.js.map +1 -1
  102. package/dist/src/preview/banner.d.ts +12 -9
  103. package/dist/src/preview/banner.d.ts.map +1 -1
  104. package/dist/src/preview/banner.js +46 -43
  105. package/dist/src/preview/banner.js.map +1 -1
  106. package/dist/src/preview/cloudflare-adapter.d.ts +35 -0
  107. package/dist/src/preview/cloudflare-adapter.d.ts.map +1 -0
  108. package/dist/src/preview/cloudflare-adapter.js +92 -0
  109. package/dist/src/preview/cloudflare-adapter.js.map +1 -0
  110. package/dist/src/preview/cookie.d.ts +13 -14
  111. package/dist/src/preview/cookie.d.ts.map +1 -1
  112. package/dist/src/preview/cookie.js +19 -26
  113. package/dist/src/preview/cookie.js.map +1 -1
  114. package/dist/src/preview/dispatcher.d.ts +73 -0
  115. package/dist/src/preview/dispatcher.d.ts.map +1 -0
  116. package/dist/src/preview/dispatcher.js +329 -0
  117. package/dist/src/preview/dispatcher.js.map +1 -0
  118. package/dist/src/preview/entry-code.d.ts +33 -0
  119. package/dist/src/preview/entry-code.d.ts.map +1 -0
  120. package/dist/src/preview/entry-code.js +33 -0
  121. package/dist/src/preview/entry-code.js.map +1 -0
  122. package/dist/src/preview/headers.d.ts +24 -4
  123. package/dist/src/preview/headers.d.ts.map +1 -1
  124. package/dist/src/preview/headers.js +35 -7
  125. package/dist/src/preview/headers.js.map +1 -1
  126. package/dist/src/preview/label.d.ts +8 -0
  127. package/dist/src/preview/label.d.ts.map +1 -0
  128. package/dist/src/preview/label.js +14 -0
  129. package/dist/src/preview/label.js.map +1 -0
  130. package/dist/src/preview/landing.d.ts +23 -2
  131. package/dist/src/preview/landing.d.ts.map +1 -1
  132. package/dist/src/preview/landing.js +105 -37
  133. package/dist/src/preview/landing.js.map +1 -1
  134. package/dist/src/preview/middleware.d.ts +49 -22
  135. package/dist/src/preview/middleware.d.ts.map +1 -1
  136. package/dist/src/preview/middleware.js +259 -100
  137. package/dist/src/preview/middleware.js.map +1 -1
  138. package/dist/src/preview/preview-path.d.ts +47 -5
  139. package/dist/src/preview/preview-path.d.ts.map +1 -1
  140. package/dist/src/preview/preview-path.js +65 -8
  141. package/dist/src/preview/preview-path.js.map +1 -1
  142. package/dist/src/preview/redeem-url.d.ts +7 -0
  143. package/dist/src/preview/redeem-url.d.ts.map +1 -0
  144. package/dist/src/preview/redeem-url.js +14 -0
  145. package/dist/src/preview/redeem-url.js.map +1 -0
  146. package/dist/src/preview/site-middleware.d.ts +5 -5
  147. package/dist/src/preview/site-middleware.d.ts.map +1 -1
  148. package/dist/src/preview/site-middleware.js +53 -26
  149. package/dist/src/preview/site-middleware.js.map +1 -1
  150. package/dist/src/preview-build.d.ts +29 -15
  151. package/dist/src/preview-build.d.ts.map +1 -1
  152. package/dist/src/preview-build.js +66 -25
  153. package/dist/src/preview-build.js.map +1 -1
  154. package/dist/src/preview.d.ts +1 -1
  155. package/dist/src/preview.d.ts.map +1 -1
  156. package/dist/src/preview.js +1 -1
  157. package/dist/src/preview.js.map +1 -1
  158. package/dist/src/repository.d.ts +1 -1
  159. package/dist/src/repository.js +1 -1
  160. package/dist/src/resolve-options.d.ts +17 -0
  161. package/dist/src/resolve-options.d.ts.map +1 -0
  162. package/dist/src/resolve-options.js +21 -0
  163. package/dist/src/resolve-options.js.map +1 -0
  164. package/dist/src/site-id.d.ts +0 -2
  165. package/dist/src/site-id.d.ts.map +1 -1
  166. package/dist/src/site-id.js +2 -3
  167. package/dist/src/site-id.js.map +1 -1
  168. package/dist/src/skill.d.ts +11 -0
  169. package/dist/src/skill.d.ts.map +1 -1
  170. package/dist/src/skill.js +32 -9
  171. package/dist/src/skill.js.map +1 -1
  172. package/dist/src/types.d.ts +33 -78
  173. package/dist/src/types.d.ts.map +1 -1
  174. package/package.json +63 -13
  175. package/src/component-manifest.ts +11 -8
  176. package/src/constants.ts +15 -13
  177. package/src/d3-build.ts +315 -0
  178. package/src/descriptors.ts +6 -4
  179. package/src/doctor/checks-address.ts +190 -0
  180. package/src/doctor/checks-live.ts +262 -268
  181. package/src/doctor/checks-offline.ts +32 -279
  182. package/src/doctor/checks-preview-limits.ts +137 -0
  183. package/src/doctor/checks-preview-live.ts +77 -0
  184. package/src/doctor/checks-preview.ts +302 -0
  185. package/src/doctor/config-scan.ts +35 -9
  186. package/src/doctor/run.ts +18 -16
  187. package/src/doctor/types.ts +17 -7
  188. package/src/editor-page/bundle.ts +487 -0
  189. package/src/editor-page/data-schemas.ts +47 -0
  190. package/src/editor-page/emit.ts +362 -0
  191. package/src/editor-page/framing.ts +62 -0
  192. package/src/editor-page/page.ts +37 -0
  193. package/src/editor-page/site-base.ts +11 -0
  194. package/src/git.ts +29 -10
  195. package/src/index.ts +22 -6
  196. package/src/integration.ts +399 -469
  197. package/src/node.ts +18 -2
  198. package/src/preview/_dispatch.ts +36 -1
  199. package/src/preview/_resolve-opts.ts +35 -12
  200. package/src/preview/banner.ts +61 -43
  201. package/src/preview/cloudflare-adapter.ts +103 -0
  202. package/src/preview/cookie.ts +18 -24
  203. package/src/preview/dispatcher.ts +407 -0
  204. package/src/preview/entry-code.ts +51 -0
  205. package/src/preview/headers.ts +35 -7
  206. package/src/preview/label.ts +12 -0
  207. package/src/preview/landing.ts +117 -39
  208. package/src/preview/middleware.ts +302 -115
  209. package/src/preview/preview-path.ts +83 -8
  210. package/src/preview/redeem-url.ts +14 -0
  211. package/src/preview/site-middleware.ts +60 -30
  212. package/src/preview-build.ts +85 -26
  213. package/src/preview-handler.astro +12 -9
  214. package/src/preview.ts +0 -1
  215. package/src/repository.ts +1 -1
  216. package/src/resolve-options.ts +37 -0
  217. package/src/site-id.ts +2 -4
  218. package/src/skill/SKILL.md +63 -55
  219. package/src/skill.ts +36 -8
  220. package/src/types.ts +33 -79
  221. package/src/virtual-modules.d.ts +4 -1
  222. package/dist/src/build-commit.d.ts +0 -19
  223. package/dist/src/build-commit.d.ts.map +0 -1
  224. package/dist/src/build-commit.js +0 -6
  225. package/dist/src/build-commit.js.map +0 -1
  226. package/dist/src/bundle.d.ts +0 -181
  227. package/dist/src/bundle.d.ts.map +0 -1
  228. package/dist/src/bundle.js +0 -413
  229. package/dist/src/bundle.js.map +0 -1
  230. package/dist/src/discovery.d.ts +0 -58
  231. package/dist/src/discovery.d.ts.map +0 -1
  232. package/dist/src/discovery.js +0 -133
  233. package/dist/src/discovery.js.map +0 -1
  234. package/dist/src/register.d.ts +0 -98
  235. package/dist/src/register.d.ts.map +0 -1
  236. package/dist/src/register.js +0 -103
  237. package/dist/src/register.js.map +0 -1
  238. package/src/build-commit.ts +0 -22
  239. package/src/bundle.ts +0 -570
  240. package/src/discovery.ts +0 -183
  241. package/src/register.ts +0 -180
@@ -0,0 +1,254 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { existsSync } from 'node:fs';
3
+ import { cp, mkdir, writeFile } from 'node:fs/promises';
4
+ import { isAbsolute, join, relative, sep } from 'node:path';
5
+ import { collectStaticPageRoutes, nonDefaultLocalesOf, } from '@conloca/astro-cms/checks';
6
+ import { readEditorDescriptors } from '@conloca/astro-cms/node';
7
+ import { isValidSiteBase } from '@conloca/content-api';
8
+ import { branchDeploysOf, CONLOCA_JSON_MAX_BYTES, contentPathsOf, EDITOR_HOST_PROTOCOL, EDITOR_PAGE_INFO_FORMATS, editorUiOrigin, isEditorPageInfo, isEditorRoute, isValidBranchName, mediaOf, PREVIEW_PROTOCOL, ROUTES_MAX, } from '@conloca/content-api/editor-host';
9
+ import { readSitesConfig } from '@conloca/content-api/node';
10
+ import { buildSandboxSrcdoc } from '@conloca/mdx/sandbox-frame';
11
+ import { emitComponentManifest } from '../component-manifest.js';
12
+ import { PACKAGE_NAME } from '../constants.js';
13
+ import { resolveEditorDescriptors } from '../descriptors.js';
14
+ import { gitOutput, resolveBuildRef } from '../git.js';
15
+ import { packageVersion } from '../package-version.js';
16
+ import { resolveBuildSiteId } from '../site-id.js';
17
+ import { bundleEditorPage } from './bundle.js';
18
+ import { emitDataSchemas } from './data-schemas.js';
19
+ import { findFramingBlockers } from './framing.js';
20
+ import { renderEditorPage } from './page.js';
21
+ import { baseMismatch } from './site-base.js';
22
+ /** The folder, relative to the build output, that holds every file of the editor page. */
23
+ const EDITOR_DIR = '_conloca/editor';
24
+ /** Writes <dir>/_conloca/editor/. The endpoint was already checked to be an app. address at config load. */
25
+ export async function emitEditorPage(input) {
26
+ const { dir, inherited, logger } = input;
27
+ const origin = editorUiOrigin(input.endpoint);
28
+ if (origin === null)
29
+ throw new Error(`${PACKAGE_NAME}: endpoint ${input.endpoint} is not an app. address`);
30
+ const base = input.base.endsWith('/') ? input.base : `${input.base}/`;
31
+ if (!isValidSiteBase(base)) {
32
+ logger.warn(`base ${base} is not a plain path of letters, digits and . _ ~ - segments; the workspace editor will not open a page under it`);
33
+ }
34
+ const contentRoot = process.env.CONLOCA_CONTENT_ROOT;
35
+ const sitesConfig = contentRoot ? await readSitesConfig(contentRoot) : undefined;
36
+ const mismatch = sitesConfig ? baseMismatch(sitesConfig, base) : undefined;
37
+ if (mismatch !== undefined)
38
+ logger.warn(mismatch);
39
+ for (const { file, header } of await findFramingBlockers(input.root)) {
40
+ logger.warn(`${file} sets ${header} for the whole site and has no /_conloca/editor/ rule, so the workspace editor cannot frame the editor page. Add the rule (npx @conloca/cli connect writes it).`);
41
+ }
42
+ const folder = join(dir, EDITOR_DIR);
43
+ if (existsSync(folder)) {
44
+ throw new Error(`${PACKAGE_NAME}: ${base}_conloca/editor/ already exists in the build output (a page or a public/ file claims it). That path is reserved for the editor page; move the content elsewhere.`);
45
+ }
46
+ const defines = Object.keys(input.vite.define ?? {});
47
+ if (defines.length > 0) {
48
+ logger.warn(`vite.define is applied to the editor page's public bundle too; make sure none of ${defines.join(', ')} holds a secret`);
49
+ }
50
+ const descriptors = await resolveEditorDescriptors(logger);
51
+ const bundle = await bundleEditorPage({
52
+ dir,
53
+ root: input.root,
54
+ vite: input.vite,
55
+ puckConfigPath: inherited.puckConfigPath,
56
+ styles: [...(inherited.siteStyles ?? []), ...(inherited.editorStyles ?? [])],
57
+ ...(descriptors === undefined ? {} : { descriptors }),
58
+ logger,
59
+ });
60
+ if (descriptors?.schemasPath) {
61
+ await emitDataSchemas({
62
+ folder,
63
+ root: input.root,
64
+ vite: input.vite,
65
+ schemasPath: descriptors.schemasPath,
66
+ logger,
67
+ });
68
+ }
69
+ let editorCssFile = null;
70
+ if (inherited.editorCss) {
71
+ const bytes = new TextEncoder().encode(inherited.editorCss);
72
+ editorCssFile = `editor.${createHash('sha256').update(bytes).digest('hex').slice(0, 16)}.css`;
73
+ await writeFile(join(folder, editorCssFile), bytes);
74
+ }
75
+ await writeFile(join(folder, 'sandbox-frame.html'), buildSandboxSrcdoc());
76
+ const channel = readEditorDescriptors(process.env);
77
+ // Only a build conlocaCMS is part of carries a vocabulary, as on the key path.
78
+ const componentManifest = channel === undefined
79
+ ? undefined
80
+ : await emitComponentManifest({
81
+ dir,
82
+ folder: EDITOR_DIR,
83
+ puckConfigPath: inherited.puckConfigPath,
84
+ projectRoot: input.root,
85
+ logger,
86
+ });
87
+ const info = editorPageInfo(input, componentManifest);
88
+ if (!isEditorPageInfo(info)) {
89
+ throw new Error(`${PACKAGE_NAME}: internal error: conloca.json failed its own format check`);
90
+ }
91
+ const repoRoot = gitOutput(['rev-parse', '--show-toplevel'], input.root);
92
+ const contentPaths = contentPathsFromBuild(channel?.contentPaths ?? [], repoRoot);
93
+ const media = mediaFromBuild(channel, repoRoot);
94
+ if (media === undefined && repoRoot !== undefined && channel?.assetsPath !== undefined) {
95
+ logger.warn(`the media folder ${channel.assetsPath} is not a folder of this site's repository, so the workspace editor cannot add images to it`);
96
+ }
97
+ const branchDeploys = branchDeploysFromEnv(process.env);
98
+ const preview = { mode: input.previewMode, protocol: PREVIEW_PROTOCOL };
99
+ const written = {
100
+ ...info,
101
+ preview,
102
+ ...(branchDeploys === undefined ? {} : { branchDeploys }),
103
+ ...(contentPaths === undefined ? {} : { contentPaths }),
104
+ ...(media === undefined ? {} : { media }),
105
+ };
106
+ const collected = await collectStaticPageRoutes({
107
+ pagesDir: input.pagesDir,
108
+ serverOutput: input.serverOutput,
109
+ nonDefaultLocales: nonDefaultLocalesOf(sitesConfig ?? { sites: {} }, info.siteId, input.i18n),
110
+ });
111
+ const { routes, left } = routesFromBuild(collected, written);
112
+ if (left > 0) {
113
+ logger.warn(`conloca.json lists ${routes.length} of ${routes.length + left} static page routes; the others have names outside the editor's route format or do not fit. \`npx @conloca/cli routes\` lists them all.`);
114
+ }
115
+ await writeFile(join(folder, 'conloca.json'), `${JSON.stringify({ ...written, routes }, null, 2)}\n`);
116
+ const url = (file) => `${base}${EDITOR_DIR}/${file}`;
117
+ const html = renderEditorPage({
118
+ protocol: info.protocol,
119
+ repo: info.repo,
120
+ siteId: info.siteId,
121
+ site: url(bundle.site),
122
+ css: bundle.css ? [url(bundle.css)] : [],
123
+ editorCss: editorCssFile === null ? null : url(editorCssFile),
124
+ sandboxFrame: url('sandbox-frame.html'),
125
+ info: url('conloca.json'),
126
+ }, origin);
127
+ await writeFile(join(folder, 'index.html'), html);
128
+ logger.info(`editor page written: ${base}${EDITOR_DIR}/`);
129
+ }
130
+ /** Copies <from>/_conloca/editor into <to>, for a preview child whose client folder serves the site. */
131
+ export async function mirrorEditorPage(fromDir, toDir) {
132
+ await mkdir(join(toDir, '_conloca'), { recursive: true });
133
+ await cp(join(fromDir, EDITOR_DIR), join(toDir, EDITOR_DIR), { recursive: true });
134
+ }
135
+ /**
136
+ * A separate preview deploy (D4) serves no editor page, but it answers its own conloca.json: its release, protocol
137
+ * and mode, read next to the site's to tell when the two deploys run different releases.
138
+ */
139
+ export async function emitPreviewServerInfo(dir, input) {
140
+ const preview = { mode: 'd4', protocol: PREVIEW_PROTOCOL };
141
+ const folder = join(dir, EDITOR_DIR);
142
+ await mkdir(folder, { recursive: true });
143
+ await writeFile(join(folder, 'conloca.json'), `${JSON.stringify({ ...editorPageInfo(input, undefined), preview }, null, 2)}\n`);
144
+ }
145
+ /**
146
+ * The Cloudflare Pages project that serves this site's branch builds: `CONLOCA_PAGES_PROJECT` (direct upload with
147
+ * wrangler) wins, else the project in a Pages build's `CF_PAGES_URL` (`https://<hash>.<project>.pages.dev`).
148
+ */
149
+ export function branchDeploysFromEnv(env) {
150
+ // An empty variable counts as unset, so it never hides CF_PAGES_URL.
151
+ let project = env.CONLOCA_PAGES_PROJECT === '' ? undefined : env.CONLOCA_PAGES_PROJECT;
152
+ if (project === undefined && env.CF_PAGES_URL !== undefined) {
153
+ try {
154
+ const url = new URL(env.CF_PAGES_URL);
155
+ const labels = url.hostname.split('.');
156
+ if (url.protocol === 'https:' && labels.length === 4 && labels.slice(2).join('.') === 'pages.dev') {
157
+ project = labels[1];
158
+ }
159
+ }
160
+ catch {
161
+ return undefined;
162
+ }
163
+ }
164
+ return project === undefined ? undefined : branchDeploysOf({ branchDeploys: { host: 'cloudflare-pages', project } });
165
+ }
166
+ /** Each content path under the repository root, written from that root ('' for the root itself); others are dropped. */
167
+ export function contentPathsFromBuild(paths, repoRoot) {
168
+ if (repoRoot === undefined)
169
+ return undefined;
170
+ const contentPaths = paths
171
+ .map((path) => relative(repoRoot, path))
172
+ .filter((path) => !isAbsolute(path))
173
+ .map((path) => path.split(sep))
174
+ .filter((segments) => segments[0] !== '..')
175
+ .map((segments) => segments.join('/'));
176
+ return contentPathsOf({ contentPaths });
177
+ }
178
+ /**
179
+ * The prerendered routes in the editor's route format, in order, up to `ROUTES_MAX` and while the whole conloca.json
180
+ * stays within `CONLOCA_JSON_MAX_BYTES`; `left` counts the prerendered routes not written.
181
+ */
182
+ export function routesFromBuild(collected, written) {
183
+ const prerendered = collected.filter((page) => page.prerendered);
184
+ const routes = [];
185
+ for (const { route } of prerendered) {
186
+ if (routes.length === ROUTES_MAX)
187
+ break;
188
+ if (!isEditorRoute(route))
189
+ continue;
190
+ routes.push(route);
191
+ const bytes = new TextEncoder().encode(`${JSON.stringify({ ...written, routes }, null, 2)}\n`).length;
192
+ if (bytes > CONLOCA_JSON_MAX_BYTES) {
193
+ routes.pop();
194
+ break;
195
+ }
196
+ }
197
+ return { routes, left: prerendered.length - routes.length };
198
+ }
199
+ /** The media folder written from the repository root, with its link base; undefined outside the repository. */
200
+ export function mediaFromBuild(channel, repoRoot) {
201
+ if (repoRoot === undefined || channel?.assetsPath === undefined || channel.assetRefBase === undefined) {
202
+ return undefined;
203
+ }
204
+ const path = relative(repoRoot, channel.assetsPath);
205
+ const segments = path.split(sep);
206
+ if (isAbsolute(path) || segments[0] === '..')
207
+ return undefined;
208
+ return mediaOf({ media: { path: segments.join('/'), refBase: channel.assetRefBase } });
209
+ }
210
+ /**
211
+ * conloca.json's facts. A repository, commit or branch that is unknown or fails its format is written as null with a
212
+ * warning; a `builtWith` that cannot be formed fails the build, since the workspace editor would refuse the page.
213
+ */
214
+ function editorPageInfo(input, componentManifest) {
215
+ const { logger } = input;
216
+ let repo = null;
217
+ if (input.repoUri !== undefined && EDITOR_PAGE_INFO_FORMATS.repo.test(input.repoUri)) {
218
+ repo = input.repoUri;
219
+ }
220
+ else {
221
+ logger.warn(`no GitHub repository resolved for this build (got ${input.repoUri ?? 'none'}); the workspace editor will refuse this page until conlocaCloud({ repoUri: 'owner/repo' }) names it`);
222
+ }
223
+ const ref = resolveBuildRef(process.env, (args) => gitOutput(args, input.root));
224
+ const commit = ref.gitSha !== undefined && EDITOR_PAGE_INFO_FORMATS.commit.test(ref.gitSha) ? ref.gitSha : null;
225
+ if (commit === null) {
226
+ logger.warn(ref.gitSha
227
+ ? `commit ${ref.gitSha} is not a 40-character git commit hash; conloca.json lists the commit as null`
228
+ : 'no commit resolved for this build; conloca.json lists the commit as null');
229
+ }
230
+ const branch = ref.branch !== undefined && isValidBranchName(ref.branch) ? ref.branch : null;
231
+ if (branch === null) {
232
+ logger.warn(ref.branch
233
+ ? `branch ${ref.branch} is not a valid git branch name; conloca.json lists the branch as null`
234
+ : 'no branch resolved for this build; conloca.json lists the branch as null');
235
+ }
236
+ const version = packageVersion();
237
+ if (version === undefined) {
238
+ throw new Error(`${PACKAGE_NAME}: could not read this package's version, so conloca.json cannot name the build and the workspace editor would refuse the page`);
239
+ }
240
+ const builtWith = `${PACKAGE_NAME}@${version}`;
241
+ if (!EDITOR_PAGE_INFO_FORMATS.builtWith.test(builtWith)) {
242
+ throw new Error(`${PACKAGE_NAME}: ${builtWith} is not a release version the workspace editor accepts`);
243
+ }
244
+ return {
245
+ protocol: EDITOR_HOST_PROTOCOL,
246
+ repo,
247
+ siteId: resolveBuildSiteId({ contentRoot: process.env.CONLOCA_CONTENT_ROOT, override: input.siteIdOverride }),
248
+ commit,
249
+ branch,
250
+ builtWith,
251
+ componentManifest: componentManifest === undefined ? null : { path: componentManifest.filename, sha256: componentManifest.hash },
252
+ };
253
+ }
254
+ //# sourceMappingURL=emit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emit.js","sourceRoot":"","sources":["../../../src/editor-page/emit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAEL,uBAAuB,EACvB,mBAAmB,GAEpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAEL,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,oBAAoB,EACpB,wBAAwB,EAGxB,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,OAAO,EACP,gBAAgB,EAGhB,UAAU,GACX,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;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,CAAC"}
@@ -0,0 +1,23 @@
1
+ export interface FramingSnippets {
2
+ /** `public/_headers` for Cloudflare Pages and Cloudflare Workers static assets; goes after any site-wide rule. */
3
+ cloudflareHeaders: string;
4
+ /** `public/_headers` for Netlify, which has no syntax for removing a header. */
5
+ netlifyHeaders: string;
6
+ /** The `headers` entries for `vercel.json`. */
7
+ vercelHeaders: {
8
+ source: string;
9
+ headers: {
10
+ key: string;
11
+ value: string;
12
+ }[];
13
+ }[];
14
+ }
15
+ /** The /_conloca/editor/ header rules that let the workspace editor frame the page (§3.6). */
16
+ export declare function framingSnippets(editorRoot: string): FramingSnippets;
17
+ export interface FramingBlocker {
18
+ file: 'public/_headers' | 'netlify.toml' | 'vercel.json';
19
+ header: 'X-Frame-Options' | 'frame-ancestors';
20
+ }
21
+ /** Committed header files that forbid framing, when none of them carries a /_conloca/editor/ rule. */
22
+ export declare function findFramingBlockers(projectRoot: string): Promise<FramingBlocker[]>;
23
+ //# sourceMappingURL=framing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"framing.d.ts","sourceRoot":"","sources":["../../../src/editor-page/framing.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,eAAe;IAC9B,kHAAkH;IAClH,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gFAAgF;IAChF,cAAc,EAAE,MAAM,CAAC;IACvB,+CAA+C;IAC/C,aAAa,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,EAAE,CAAA;KAAE,EAAE,CAAC;CAChF;AAID,8FAA8F;AAC9F,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,eAAe,CAgBnE;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,iBAAiB,GAAG,cAAc,GAAG,aAAa,CAAC;IACzD,MAAM,EAAE,iBAAiB,GAAG,iBAAiB,CAAC;CAC/C;AAKD,sGAAsG;AACtG,wBAAsB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAmBxF"}
@@ -0,0 +1,39 @@
1
+ import { readFile } from 'node:fs/promises';
2
+ import { join } from 'node:path';
3
+ const SANDBOX_FRAME_RULE = '/_conloca/editor/sandbox-frame.html\n Content-Security-Policy: sandbox allow-scripts\n';
4
+ /** The /_conloca/editor/ header rules that let the workspace editor frame the page (§3.6). */
5
+ export function framingSnippets(editorRoot) {
6
+ const frameAncestors = `frame-ancestors 'self' https://*.${editorRoot}`;
7
+ const detach = ' ! X-Frame-Options\n ! Content-Security-Policy\n';
8
+ const pathRule = (removals) => `/_conloca/editor/*\n${removals} Content-Security-Policy: ${frameAncestors}\n\n${SANDBOX_FRAME_RULE}`;
9
+ return {
10
+ cloudflareHeaders: pathRule(detach),
11
+ netlifyHeaders: pathRule(''),
12
+ vercelHeaders: [
13
+ { source: '/_conloca/editor/:path*', headers: [{ key: 'Content-Security-Policy', value: frameAncestors }] },
14
+ {
15
+ source: '/_conloca/editor/sandbox-frame.html',
16
+ headers: [{ key: 'Content-Security-Policy', value: 'sandbox allow-scripts' }],
17
+ },
18
+ ],
19
+ };
20
+ }
21
+ const HEADER_FILES = ['public/_headers', 'netlify.toml', 'vercel.json'];
22
+ const FRAMING_HEADERS = ['X-Frame-Options', 'frame-ancestors'];
23
+ /** Committed header files that forbid framing, when none of them carries a /_conloca/editor/ rule. */
24
+ export async function findFramingBlockers(projectRoot) {
25
+ // shortcut: text match, not a parse of each format; doctor --live checks the real headers.
26
+ // shortcut: a site-wide CSP with frame-ancestors still blocks on Netlify and Vercel once the rule exists, since a
27
+ // second CSP header cannot loosen the first; this reports nothing then, and doctor --live finds it.
28
+ const texts = await Promise.all(HEADER_FILES.map((file) => readFile(join(projectRoot, file), 'utf8').then((text) => text.toLowerCase(), () => undefined)));
29
+ // connect may add the rule to a different file than the one that blocks (public/_headers for a netlify.toml rule).
30
+ if (texts.some((text) => text?.includes('/_conloca/editor/')))
31
+ return [];
32
+ return HEADER_FILES.flatMap((file, index) => {
33
+ const text = texts[index];
34
+ if (text === undefined)
35
+ return [];
36
+ return FRAMING_HEADERS.filter((header) => text.includes(header.toLowerCase())).map((header) => ({ file, header }));
37
+ });
38
+ }
39
+ //# sourceMappingURL=framing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"framing.js","sourceRoot":"","sources":["../../../src/editor-page/framing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAWjC,MAAM,kBAAkB,GAAG,yFAAyF,CAAC;AAErH,8FAA8F;AAC9F,MAAM,UAAU,eAAe,CAAC,UAAkB;IAChD,MAAM,cAAc,GAAG,oCAAoC,UAAU,EAAE,CAAC;IACxE,MAAM,MAAM,GAAG,oDAAoD,CAAC;IACpE,MAAM,QAAQ,GAAG,CAAC,QAAgB,EAAE,EAAE,CACpC,uBAAuB,QAAQ,8BAA8B,cAAc,OAAO,kBAAkB,EAAE,CAAC;IACzG,OAAO;QACL,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC;QACnC,cAAc,EAAE,QAAQ,CAAC,EAAE,CAAC;QAC5B,aAAa,EAAE;YACb,EAAE,MAAM,EAAE,yBAAyB,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,yBAAyB,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC,EAAE;YAC3G;gBACE,MAAM,EAAE,qCAAqC;gBAC7C,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,yBAAyB,EAAE,KAAK,EAAE,uBAAuB,EAAE,CAAC;aAC9E;SACF;KACF,CAAC;AACJ,CAAC;AAOD,MAAM,YAAY,GAAsC,CAAC,iBAAiB,EAAE,cAAc,EAAE,aAAa,CAAC,CAAC;AAC3G,MAAM,eAAe,GAAwC,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,CAAC;AAEpG,sGAAsG;AACtG,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,WAAmB;IAC3D,2FAA2F;IAC3F,kHAAkH;IAClH,oGAAoG;IACpG,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,GAAG,CAC7B,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACxB,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC,IAAI,CAC5C,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,EAC5B,GAAG,EAAE,CAAC,SAAS,CAChB,CACF,CACF,CAAC;IACF,mHAAmH;IACnH,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,mBAAmB,CAAC,CAAC;QAAE,OAAO,EAAE,CAAC;IACzE,OAAO,YAAY,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QAC1C,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;QAC1B,IAAI,IAAI,KAAK,SAAS;YAAE,OAAO,EAAE,CAAC;QAClC,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;IACrH,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { type EditorHostPageData } from '@conloca/content-api/editor-host';
2
+ /**
3
+ * The editor page's `index.html`: the editor UI from `<editorUiOrigin>/host/v<protocol>/`, its `importmap` script, and
4
+ * the page data as a JSON block that never executes. The meta CSP admits scripts only from the page itself, that path
5
+ * and the `importmap` script's hash; it leaves styles and fonts alone, so the editor UI's stylesheet may load its web
6
+ * font.
7
+ */
8
+ export declare function renderEditorPage(data: EditorHostPageData, editorUiOrigin: string): string;
9
+ //# sourceMappingURL=page.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../src/editor-page/page.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,kCAAkC,CAAC;AAE1C;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CAuBzF"}
@@ -0,0 +1,31 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { EDITOR_HOST_PROTOCOL, EDITOR_UI_MODULE_FILES, } from '@conloca/content-api/editor-host';
3
+ /**
4
+ * The editor page's `index.html`: the editor UI from `<editorUiOrigin>/host/v<protocol>/`, its `importmap` script, and
5
+ * the page data as a JSON block that never executes. The meta CSP admits scripts only from the page itself, that path
6
+ * and the `importmap` script's hash; it leaves styles and fonts alone, so the editor UI's stylesheet may load its web
7
+ * font.
8
+ */
9
+ export function renderEditorPage(data, editorUiOrigin) {
10
+ const uiPath = `${editorUiOrigin}/host/v${EDITOR_HOST_PROTOCOL}/`;
11
+ const imports = Object.fromEntries(Object.entries(EDITOR_UI_MODULE_FILES).map(([specifier, file]) => [specifier, `${uiPath}${file}`]));
12
+ const importMapJson = JSON.stringify({ imports });
13
+ const importMapHash = createHash('sha256').update(importMapJson).digest('base64');
14
+ return [
15
+ '<!doctype html>',
16
+ '<html lang="en">',
17
+ '<head>',
18
+ '<meta charset="utf-8">',
19
+ '<meta name="robots" content="noindex, nofollow">',
20
+ `<meta http-equiv="Content-Security-Policy" content="script-src 'self' ${uiPath} 'sha256-${importMapHash}'; object-src 'none'; base-uri 'none'">`,
21
+ '<title>Conloca editor</title>',
22
+ `<script type="importmap">${importMapJson}</script>`,
23
+ // `<` escaped so no value can close the element; JSON.parse reads `\u003c` back as `<`.
24
+ `<script type="application/json" id="conloca-editor-host">${JSON.stringify(data).replaceAll('<', '\\u003c')}</script>`,
25
+ `<script type="module" src="${uiPath}entry.js"></script>`,
26
+ '</head>',
27
+ '<body><div id="root"></div></body>',
28
+ '</html>',
29
+ ].join('\n');
30
+ }
31
+ //# sourceMappingURL=page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page.js","sourceRoot":"","sources":["../../../src/editor-page/page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EACL,oBAAoB,EACpB,sBAAsB,GAEvB,MAAM,kCAAkC,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAwB,EAAE,cAAsB;IAC/E,MAAM,MAAM,GAAG,GAAG,cAAc,UAAU,oBAAoB,GAAG,CAAC;IAClE,MAAM,OAAO,GAAG,MAAM,CAAC,WAAW,CAChC,MAAM,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,EAAE,GAAG,MAAM,GAAG,IAAI,EAAE,CAAC,CAAC,CACnG,CAAC;IACF,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;IAClD,MAAM,aAAa,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAClF,OAAO;QACL,iBAAiB;QACjB,kBAAkB;QAClB,QAAQ;QACR,wBAAwB;QACxB,kDAAkD;QAClD,yEAAyE,MAAM,YAAY,aAAa,yCAAyC;QACjJ,+BAA+B;QAC/B,4BAA4B,aAAa,WAAW;QACpD,wFAAwF;QACxF,4DAA4D,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,SAAS,CAAC,WAAW;QACtH,8BAA8B,MAAM,qBAAqB;QACzD,SAAS;QACT,oCAAoC;QACpC,SAAS;KACV,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { type SitesConfig } from '@conloca/content-api';
2
+ /** The warning when Astro's base differs from the address site's base in sites.json, else undefined. */
3
+ export declare function baseMismatch(sites: SitesConfig, astroBase: string): string | undefined;
4
+ //# sourceMappingURL=site-base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"site-base.d.ts","sourceRoot":"","sources":["../../../src/editor-page/site-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEzE,wGAAwG;AACxG,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAOtF"}
@@ -0,0 +1,13 @@
1
+ import { addressSiteName } from '@conloca/content-api';
2
+ /** The warning when Astro's base differs from the address site's base in sites.json, else undefined. */
3
+ export function baseMismatch(sites, astroBase) {
4
+ const name = addressSiteName(sites);
5
+ if (name === null)
6
+ return undefined;
7
+ const base = astroBase.endsWith('/') ? astroBase : `${astroBase}/`;
8
+ const siteBase = sites.sites[name]?.base ?? '/';
9
+ if (base === siteBase)
10
+ return undefined;
11
+ return `Astro's base is ${base} but sites.json gives the site "${name}" base ${siteBase}: the workspace editor looks for the editor page under ${siteBase}_conloca/editor/ and will not find it. Make them match.`;
12
+ }
13
+ //# sourceMappingURL=site-base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"site-base.js","sourceRoot":"","sources":["../../../src/editor-page/site-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAoB,MAAM,sBAAsB,CAAC;AAEzE,wGAAwG;AACxG,MAAM,UAAU,YAAY,CAAC,KAAkB,EAAE,SAAiB;IAChE,MAAM,IAAI,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IACpC,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IACpC,MAAM,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,CAAC;IACnE,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,IAAI,GAAG,CAAC;IAChD,IAAI,IAAI,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IACxC,OAAO,mBAAmB,IAAI,mCAAmC,IAAI,UAAU,QAAQ,0DAA0D,QAAQ,yDAAyD,CAAC;AACrN,CAAC"}
package/dist/src/git.d.ts CHANGED
@@ -7,8 +7,9 @@ import { type RepositoryEnvironment } from './repository.js';
7
7
  */
8
8
  export declare function gitOutput(args: string[], cwd?: string): string | undefined;
9
9
  /**
10
- * The resolved pair. An empty commit variable is passed through unchanged
11
- * (`CF_PAGES_COMMIT_SHA=''` yields `gitSha: ''`); callers treat a falsy value
10
+ * The resolved pair. An empty `CF_PAGES_COMMIT_SHA` is passed through
11
+ * unchanged (`CF_PAGES_COMMIT_SHA=''` yields `gitSha: ''`; the other hosts'
12
+ * empty commit variables count as unset); callers treat a falsy value
12
13
  * as unresolved, exactly as the build hook's guard does. An empty BRANCH
13
14
  * variable counts as unset instead: GitHub Actions exports GITHUB_HEAD_REF=''
14
15
  * on every push build, which would otherwise hide GITHUB_REF_NAME.
@@ -18,17 +19,19 @@ interface BuildRef {
18
19
  branch?: string;
19
20
  }
20
21
  /**
21
- * The commit and branch this checkout stands on — the pair a registration is
22
- * keyed by. CI metadata first, most-specific source per provider. GitHub
22
+ * The commit and branch this checkout stands on — the pair conloca.json
23
+ * names, and the branch a preview build serves. CI metadata first,
24
+ * most-specific source per provider: Cloudflare Pages, Cloudflare Workers
25
+ * Builds, Netlify (whose `HEAD` and `COMMIT_REF` count only when `NETLIFY` is
26
+ * set, since other shells may export a `HEAD`), Vercel, Render, Amplify, then GitHub Actions. GitHub
23
27
  * Actions checkouts are DETACHED, so the git fallback returns the literal
24
28
  * 'HEAD' there — GITHUB_HEAD_REF (PR builds) / GITHUB_REF_NAME cover that
25
- * case, and a surviving literal 'HEAD' is treated as unresolvable: a
26
- * registration under branch 'HEAD' would never match the editor's
27
- * branch-keyed lookup, silently registering dead weight.
29
+ * case, and a surviving literal 'HEAD' is treated as unresolvable: branch
30
+ * 'HEAD' would never match the editor's branch-keyed lookup.
28
31
  */
29
32
  export declare function resolveBuildRef(env?: RepositoryEnvironment, git?: (args: string[]) => string | undefined): BuildRef;
30
33
  /**
31
- * The repository a registration is filed under: the explicit option and CI
34
+ * The repository the editor page names: the explicit option and CI
32
35
  * metadata are free to read; git is spawned ONLY when neither resolved it.
33
36
  * Config loading is a hot path in Astro and must not start a subprocess on
34
37
  * every integration instance.
@@ -1 +1 @@
1
- {"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/git.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,KAAK,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAElF;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAO1E;AAED;;;;;;GAMG;AACH,UAAU,QAAQ;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,GAAG,GAAE,qBAAmC,EACxC,GAAG,GAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,MAAM,GAAG,SAAqB,GACtD,QAAQ,CAMV;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,GAAG,EAAE,qBAAqB,EAC1B,GAAG,GAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,MAAM,GAAG,SAAqB,GACtD,MAAM,GAAG,SAAS,CAKpB"}
1
+ {"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/git.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,KAAK,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAElF;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAO1E;AAED;;;;;;;GAOG;AACH,UAAU,QAAQ;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,GAAG,GAAE,qBAAmC,EACxC,GAAG,GAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,MAAM,GAAG,SAAqB,GACtD,QAAQ,CAsBV;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,GAAG,EAAE,qBAAqB,EAC1B,GAAG,GAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,MAAM,GAAG,SAAqB,GACtD,MAAM,GAAG,SAAS,CAKpB"}
package/dist/src/git.js CHANGED
@@ -16,22 +16,39 @@ export function gitOutput(args, cwd) {
16
16
  }
17
17
  }
18
18
  /**
19
- * The commit and branch this checkout stands on — the pair a registration is
20
- * keyed by. CI metadata first, most-specific source per provider. GitHub
19
+ * The commit and branch this checkout stands on — the pair conloca.json
20
+ * names, and the branch a preview build serves. CI metadata first,
21
+ * most-specific source per provider: Cloudflare Pages, Cloudflare Workers
22
+ * Builds, Netlify (whose `HEAD` and `COMMIT_REF` count only when `NETLIFY` is
23
+ * set, since other shells may export a `HEAD`), Vercel, Render, Amplify, then GitHub Actions. GitHub
21
24
  * Actions checkouts are DETACHED, so the git fallback returns the literal
22
25
  * 'HEAD' there — GITHUB_HEAD_REF (PR builds) / GITHUB_REF_NAME cover that
23
- * case, and a surviving literal 'HEAD' is treated as unresolvable: a
24
- * registration under branch 'HEAD' would never match the editor's
25
- * branch-keyed lookup, silently registering dead weight.
26
+ * case, and a surviving literal 'HEAD' is treated as unresolvable: branch
27
+ * 'HEAD' would never match the editor's branch-keyed lookup.
26
28
  */
27
29
  export function resolveBuildRef(env = process.env, git = gitOutput) {
28
- const gitSha = env.CF_PAGES_COMMIT_SHA ?? git(['rev-parse', 'HEAD']);
29
- const rawBranch = env.CF_PAGES_BRANCH || env.GITHUB_HEAD_REF || env.GITHUB_REF_NAME || git(['rev-parse', '--abbrev-ref', 'HEAD']);
30
+ const netlify = env.NETLIFY === 'true';
31
+ const gitSha = env.CF_PAGES_COMMIT_SHA ??
32
+ (env.WORKERS_CI_COMMIT_SHA || undefined) ??
33
+ (netlify ? env.COMMIT_REF || undefined : undefined) ??
34
+ (env.VERCEL_GIT_COMMIT_SHA || undefined) ??
35
+ (env.RENDER_GIT_COMMIT || undefined) ??
36
+ (env.AWS_COMMIT_ID || undefined) ??
37
+ git(['rev-parse', 'HEAD']);
38
+ const rawBranch = env.CF_PAGES_BRANCH ||
39
+ env.WORKERS_CI_BRANCH ||
40
+ (netlify ? env.HEAD : undefined) ||
41
+ env.VERCEL_GIT_COMMIT_REF ||
42
+ env.RENDER_GIT_BRANCH ||
43
+ env.AWS_BRANCH ||
44
+ env.GITHUB_HEAD_REF ||
45
+ env.GITHUB_REF_NAME ||
46
+ git(['rev-parse', '--abbrev-ref', 'HEAD']);
30
47
  const branch = rawBranch === 'HEAD' ? undefined : rawBranch;
31
48
  return { ...(gitSha === undefined ? {} : { gitSha }), ...(branch === undefined ? {} : { branch }) };
32
49
  }
33
50
  /**
34
- * The repository a registration is filed under: the explicit option and CI
51
+ * The repository the editor page names: the explicit option and CI
35
52
  * metadata are free to read; git is spawned ONLY when neither resolved it.
36
53
  * Config loading is a hot path in Astro and must not start a subproc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EAAE,CAAC;QACtC,mBAAmB,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,CACxF,CAAC;AACJ,CAAC"}
@@ -1,3 +1,6 @@
1
- export { conlocaCloud, PACKAGE_NAME, PREVIEW_BUILD_ENV_FLAG } from './integration.js';
1
+ export { DEFAULT_EDITOR_ENDPOINT, EDITOR_HOST_PROTOCOL, EDITOR_PAGE_PATH, type EditorHostPageData, type EditorPageInfo, } from '@conloca/content-api/editor-host';
2
+ export { type FramingBlocker, type FramingSnippets, findFramingBlockers, framingSnippets, } from './editor-page/framing.js';
3
+ export { conlocaCloud as default, conlocaCloud, PACKAGE_NAME, PREVIEW_BUILD_ENV_FLAG } from './integration.js';
4
+ export { agentSkill } from './skill.js';
2
5
  export type { ConlocaCloudOptions, PreviewBuildOptions } from './types.js';
3
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AACtF,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,EAChB,KAAK,kBAAkB,EACvB,KAAK,cAAc,GACpB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,mBAAmB,EACnB,eAAe,GAChB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,YAAY,IAAI,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE/G,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC"}
package/dist/src/index.js CHANGED
@@ -1,7 +1,12 @@
1
- // Public surface for `@conloca/cloud-astro` — the site's Astro
2
- // integration. The build pipeline (editor-bundle compile + registration POST)
3
- // runs from `astro:build:done`; the preview modules serve draft pages out of
4
- // the recursive preview build and read their content through
5
- // `PreviewContentAPI`.
6
- export { conlocaCloud, PACKAGE_NAME, PREVIEW_BUILD_ENV_FLAG } from './integration.js';
1
+ // Public surface for `@conloca/cloud-astro` — the site's Astro integration.
2
+ // Every `astro build` writes your site's editor page to /_conloca/editor/ from
3
+ // `astro:build:done`; the preview modules serve draft pages out of the
4
+ // recursive preview build and read their content through `PreviewContentAPI`.
5
+ export { DEFAULT_EDITOR_ENDPOINT, EDITOR_HOST_PROTOCOL, EDITOR_PAGE_PATH, } from '@conloca/content-api/editor-host';
6
+ // The /_conloca/editor/ header rules that `conloca connect` writes and doctor checks.
7
+ export { findFramingBlockers, framingSnippets, } from './editor-page/framing.js';
8
+ // The default export is what `astro add @conloca/cloud-astro` wires in.
9
+ export { conlocaCloud as default, conlocaCloud, PACKAGE_NAME, PREVIEW_BUILD_ENV_FLAG } from './integration.js';
10
+ // The page `conloca upgrade` compares against the site's copy and refreshes.
11
+ export { agentSkill } from './skill.js';
7
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,8EAA8E;AAC9E,6EAA6E;AAC7E,6DAA6D;AAC7D,uBAAuB;AAEvB,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,+EAA+E;AAC/E,uEAAuE;AACvE,8EAA8E;AAE9E,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,GAGjB,MAAM,kCAAkC,CAAC;AAC1C,sFAAsF;AACtF,OAAO,EAGL,mBAAmB,EACnB,eAAe,GAChB,MAAM,0BAA0B,CAAC;AAClC,wEAAwE;AACxE,OAAO,EAAE,YAAY,IAAI,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC/G,6EAA6E;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC"}
@@ -2,5 +2,5 @@ import type { AstroIntegration } from 'astro';
2
2
  import { PACKAGE_NAME, PREVIEW_BUILD_ENV_FLAG } from './constants.js';
3
3
  import type { ConlocaCloudOptions } from './types.js';
4
4
  export { PACKAGE_NAME, PREVIEW_BUILD_ENV_FLAG };
5
- export declare function conlocaCloud(options: ConlocaCloudOptions): AstroIntegration;
5
+ export declare function conlocaCloud(options?: ConlocaCloudOptions): AstroIntegration;
6
6
  //# sourceMappingURL=integration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../src/integration.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAA0B,MAAM,OAAO,CAAC;AAMtE,OAAO,EAAuB,YAAY,EAAE,sBAAsB,EAA2B,MAAM,gBAAgB,CAAC;AAUpH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAKtD,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,CAAC;AA6BhD,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,gBAAgB,CAyW3E"}
1
+ {"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../src/integration.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAmBtE,OAAO,KAAK,EAAE,mBAAmB,EAAuB,MAAM,YAAY,CAAC;AAK3E,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,CAAC;AA0BhD,wBAAgB,YAAY,CAAC,OAAO,GAAE,mBAAwB,GAAG,gBAAgB,CAibhF"}