@conloca/cloud-astro 0.0.0-stage → 0.2.2
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.
- package/README.md +328 -2
- package/dist/src/build-commit.d.ts +19 -0
- package/dist/src/build-commit.d.ts.map +1 -0
- package/dist/src/build-commit.js +6 -0
- package/dist/src/build-commit.js.map +1 -0
- package/dist/src/bundle.d.ts +181 -0
- package/dist/src/bundle.d.ts.map +1 -0
- package/dist/src/bundle.js +413 -0
- package/dist/src/bundle.js.map +1 -0
- package/dist/src/component-manifest.d.ts +29 -0
- package/dist/src/component-manifest.d.ts.map +1 -0
- package/dist/src/component-manifest.js +53 -0
- package/dist/src/component-manifest.js.map +1 -0
- package/dist/src/constants.d.ts +26 -0
- package/dist/src/constants.d.ts.map +1 -0
- package/dist/src/constants.js +26 -0
- package/dist/src/constants.js.map +1 -0
- package/dist/src/descriptors.d.ts +25 -0
- package/dist/src/descriptors.d.ts.map +1 -0
- package/dist/src/descriptors.js +65 -0
- package/dist/src/descriptors.js.map +1 -0
- package/dist/src/discovery.d.ts +58 -0
- package/dist/src/discovery.d.ts.map +1 -0
- package/dist/src/discovery.js +133 -0
- package/dist/src/discovery.js.map +1 -0
- package/dist/src/doctor/checks-live.d.ts +15 -0
- package/dist/src/doctor/checks-live.d.ts.map +1 -0
- package/dist/src/doctor/checks-live.js +229 -0
- package/dist/src/doctor/checks-live.js.map +1 -0
- package/dist/src/doctor/checks-offline.d.ts +36 -0
- package/dist/src/doctor/checks-offline.d.ts.map +1 -0
- package/dist/src/doctor/checks-offline.js +301 -0
- package/dist/src/doctor/checks-offline.js.map +1 -0
- package/dist/src/doctor/config-scan.d.ts +55 -0
- package/dist/src/doctor/config-scan.d.ts.map +1 -0
- package/dist/src/doctor/config-scan.js +178 -0
- package/dist/src/doctor/config-scan.js.map +1 -0
- package/dist/src/doctor/run.d.ts +4 -0
- package/dist/src/doctor/run.d.ts.map +1 -0
- package/dist/src/doctor/run.js +29 -0
- package/dist/src/doctor/run.js.map +1 -0
- package/dist/src/doctor/types.d.ts +60 -0
- package/dist/src/doctor/types.d.ts.map +1 -0
- package/dist/src/doctor/types.js +18 -0
- package/dist/src/doctor/types.js.map +1 -0
- package/dist/src/doctor.d.ts +9 -0
- package/dist/src/doctor.d.ts.map +1 -0
- package/dist/src/doctor.js +12 -0
- package/dist/src/doctor.js.map +1 -0
- package/dist/src/git.d.ts +38 -0
- package/dist/src/git.d.ts.map +1 -0
- package/dist/src/git.js +43 -0
- package/dist/src/git.js.map +1 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +7 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/integration.d.ts +6 -0
- package/dist/src/integration.d.ts.map +1 -0
- package/dist/src/integration.js +544 -0
- package/dist/src/integration.js.map +1 -0
- package/dist/src/message-of.d.ts +3 -0
- package/dist/src/message-of.d.ts.map +1 -0
- package/dist/src/message-of.js +5 -0
- package/dist/src/message-of.js.map +1 -0
- package/dist/src/node.d.ts +3 -0
- package/dist/src/node.d.ts.map +1 -0
- package/dist/src/node.js +4 -0
- package/dist/src/node.js.map +1 -0
- package/dist/src/package-version.d.ts +7 -0
- package/dist/src/package-version.d.ts.map +1 -0
- package/dist/src/package-version.js +17 -0
- package/dist/src/package-version.js.map +1 -0
- package/dist/src/preview/_dispatch.d.ts +55 -0
- package/dist/src/preview/_dispatch.d.ts.map +1 -0
- package/dist/src/preview/_dispatch.js +72 -0
- package/dist/src/preview/_dispatch.js.map +1 -0
- package/dist/src/preview/_resolve-opts.d.ts +30 -0
- package/dist/src/preview/_resolve-opts.d.ts.map +1 -0
- package/dist/src/preview/_resolve-opts.js +73 -0
- package/dist/src/preview/_resolve-opts.js.map +1 -0
- package/dist/src/preview/banner.d.ts +29 -0
- package/dist/src/preview/banner.d.ts.map +1 -0
- package/dist/src/preview/banner.js +94 -0
- package/dist/src/preview/banner.js.map +1 -0
- package/dist/src/preview/content-api.d.ts +110 -0
- package/dist/src/preview/content-api.d.ts.map +1 -0
- package/dist/src/preview/content-api.js +216 -0
- package/dist/src/preview/content-api.js.map +1 -0
- package/dist/src/preview/cookie.d.ts +36 -0
- package/dist/src/preview/cookie.d.ts.map +1 -0
- package/dist/src/preview/cookie.js +59 -0
- package/dist/src/preview/cookie.js.map +1 -0
- package/dist/src/preview/headers.d.ts +25 -0
- package/dist/src/preview/headers.d.ts.map +1 -0
- package/dist/src/preview/headers.js +31 -0
- package/dist/src/preview/headers.js.map +1 -0
- package/dist/src/preview/landing.d.ts +22 -0
- package/dist/src/preview/landing.d.ts.map +1 -0
- package/dist/src/preview/landing.js +70 -0
- package/dist/src/preview/landing.js.map +1 -0
- package/dist/src/preview/middleware.d.ts +118 -0
- package/dist/src/preview/middleware.d.ts.map +1 -0
- package/dist/src/preview/middleware.js +197 -0
- package/dist/src/preview/middleware.js.map +1 -0
- package/dist/src/preview/preview-path.d.ts +21 -0
- package/dist/src/preview/preview-path.d.ts.map +1 -0
- package/dist/src/preview/preview-path.js +29 -0
- package/dist/src/preview/preview-path.js.map +1 -0
- package/dist/src/preview/satteri-workerd.d.ts +17 -0
- package/dist/src/preview/satteri-workerd.d.ts.map +1 -0
- package/dist/src/preview/satteri-workerd.js +18 -0
- package/dist/src/preview/satteri-workerd.js.map +1 -0
- package/dist/src/preview/site-middleware.d.ts +69 -0
- package/dist/src/preview/site-middleware.d.ts.map +1 -0
- package/dist/src/preview/site-middleware.js +160 -0
- package/dist/src/preview/site-middleware.js.map +1 -0
- package/dist/src/preview/workerd-shim.d.ts +19 -0
- package/dist/src/preview/workerd-shim.d.ts.map +1 -0
- package/dist/src/preview/workerd-shim.js +33 -0
- package/dist/src/preview/workerd-shim.js.map +1 -0
- package/dist/src/preview-build.d.ts +71 -0
- package/dist/src/preview-build.d.ts.map +1 -0
- package/dist/src/preview-build.js +115 -0
- package/dist/src/preview-build.js.map +1 -0
- package/dist/src/preview.d.ts +6 -0
- package/dist/src/preview.d.ts.map +1 -0
- package/dist/src/preview.js +12 -0
- package/dist/src/preview.js.map +1 -0
- package/dist/src/register.d.ts +98 -0
- package/dist/src/register.d.ts.map +1 -0
- package/dist/src/register.js +103 -0
- package/dist/src/register.js.map +1 -0
- package/dist/src/repository.d.ts +18 -0
- package/dist/src/repository.d.ts.map +1 -0
- package/dist/src/repository.js +46 -0
- package/dist/src/repository.js.map +1 -0
- package/dist/src/site-id.d.ts +18 -0
- package/dist/src/site-id.d.ts.map +1 -0
- package/dist/src/site-id.js +70 -0
- package/dist/src/site-id.js.map +1 -0
- package/dist/src/site-middleware.d.ts +18 -0
- package/dist/src/site-middleware.d.ts.map +1 -0
- package/dist/src/site-middleware.js +47 -0
- package/dist/src/site-middleware.js.map +1 -0
- package/dist/src/skill.d.ts +26 -0
- package/dist/src/skill.d.ts.map +1 -0
- package/dist/src/skill.js +67 -0
- package/dist/src/skill.js.map +1 -0
- package/dist/src/types.d.ts +135 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +2 -0
- package/dist/src/types.js.map +1 -0
- package/package.json +182 -4
- package/src/build-commit.ts +22 -0
- package/src/bundle.ts +570 -0
- package/src/component-manifest.ts +75 -0
- package/src/constants.ts +28 -0
- package/src/descriptors.ts +92 -0
- package/src/discovery.ts +183 -0
- package/src/doctor/checks-live.ts +324 -0
- package/src/doctor/checks-offline.ts +325 -0
- package/src/doctor/config-scan.ts +205 -0
- package/src/doctor/run.ts +39 -0
- package/src/doctor/types.ts +71 -0
- package/src/doctor.ts +14 -0
- package/src/git.ts +66 -0
- package/src/index.ts +8 -0
- package/src/integration.ts +607 -0
- package/src/message-of.ts +4 -0
- package/src/node.ts +5 -0
- package/src/package-version.ts +16 -0
- package/src/preview/_dispatch.ts +105 -0
- package/src/preview/_resolve-opts.ts +89 -0
- package/src/preview/banner.ts +96 -0
- package/src/preview/content-api.ts +293 -0
- package/src/preview/cookie.ts +54 -0
- package/src/preview/headers.ts +30 -0
- package/src/preview/landing.ts +73 -0
- package/src/preview/middleware.ts +309 -0
- package/src/preview/preview-path.ts +28 -0
- package/src/preview/satteri-workerd.ts +24 -0
- package/src/preview/site-middleware.ts +210 -0
- package/src/preview/workerd-shim.ts +31 -0
- package/src/preview-build.ts +147 -0
- package/src/preview-handler.astro +55 -0
- package/src/preview-handler.d.ts +6 -0
- package/src/preview.ts +22 -0
- package/src/register.ts +180 -0
- package/src/repository.ts +54 -0
- package/src/site-id.ts +86 -0
- package/src/site-middleware.ts +55 -0
- package/src/skill/SKILL.md +69 -0
- package/src/skill.ts +66 -0
- package/src/types.ts +137 -0
- package/src/virtual-modules.d.ts +52 -0
package/src/skill.ts
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { dirname, join } from 'node:path';
|
|
4
|
+
import { pathToFileURL } from 'node:url';
|
|
5
|
+
import { messageOf } from './message-of.js';
|
|
6
|
+
|
|
7
|
+
export const SKILL_RELATIVE_PATH = join('.claude', 'skills', 'conloca-cloud', 'SKILL.md');
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The canonical page, located from the package root (through the package's own `./package.json` export) so the
|
|
11
|
+
* built `dist/src/skill.js` and the source `src/skill.ts` reach the same shipped `src/skill/SKILL.md`. Resolved on
|
|
12
|
+
* demand, not at import: a copy running outside its package boundary must fail inside scaffoldSkill's
|
|
13
|
+
* fail-soft path, never while the site's Astro config is loading.
|
|
14
|
+
*/
|
|
15
|
+
export function skillTemplateUrl(): URL {
|
|
16
|
+
const packageRoot = dirname(createRequire(import.meta.url).resolve('@conloca/cloud-astro/package.json'));
|
|
17
|
+
return pathToFileURL(join(packageRoot, 'src', 'skill', 'SKILL.md'));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
type SkillLogger = { info(msg: string): void; debug(msg: string): void };
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The nearest directory, from the Astro project root up to the git root, that
|
|
24
|
+
* carries a `.claude/`. Repo-root layouts are the real ones: a site's
|
|
25
|
+
* Astro project is usually a workspace member below the repo root. Needs a git
|
|
26
|
+
* root: a project outside any repository gets nothing.
|
|
27
|
+
*/
|
|
28
|
+
export function findClaudeHome(projectRoot: string): string | undefined {
|
|
29
|
+
let dir = projectRoot;
|
|
30
|
+
let home: string | undefined;
|
|
31
|
+
for (;;) {
|
|
32
|
+
if (home === undefined && existsSync(join(dir, '.claude'))) home = dir;
|
|
33
|
+
// The git root bounds the walk; without one there is no repo to scaffold into
|
|
34
|
+
// (a stray ~/.claude must never receive a global copy).
|
|
35
|
+
if (existsSync(join(dir, '.git'))) return home;
|
|
36
|
+
const parent = dirname(dir);
|
|
37
|
+
if (parent === dir) return undefined;
|
|
38
|
+
dir = parent;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Write the skill page once — never overwrite, never throw. A read-only CI
|
|
44
|
+
* checkout must not break a build over documentation.
|
|
45
|
+
*/
|
|
46
|
+
export function scaffoldSkill(projectRoot: string, logger: SkillLogger): 'written' | 'exists' | 'skipped' | 'failed' {
|
|
47
|
+
const home = findClaudeHome(projectRoot);
|
|
48
|
+
if (home === undefined) {
|
|
49
|
+
logger.debug('no .claude/ directory between the project and the git root — agent skill not scaffolded');
|
|
50
|
+
return 'skipped';
|
|
51
|
+
}
|
|
52
|
+
const target = join(home, SKILL_RELATIVE_PATH);
|
|
53
|
+
if (existsSync(target)) return 'exists';
|
|
54
|
+
try {
|
|
55
|
+
mkdirSync(dirname(target), { recursive: true });
|
|
56
|
+
writeFileSync(target, readFileSync(skillTemplateUrl(), 'utf8'), { flag: 'wx' });
|
|
57
|
+
logger.info(`agent skill written to ${target}`);
|
|
58
|
+
return 'written';
|
|
59
|
+
} catch (error) {
|
|
60
|
+
// The exclusive write lost a race with a concurrent build (or a symlink sits
|
|
61
|
+
// at the path): the page is there, which is the truthful outcome.
|
|
62
|
+
if ((error as NodeJS.ErrnoException).code === 'EEXIST') return 'exists';
|
|
63
|
+
logger.info(`agent skill not written to ${target} (${messageOf(error)})`);
|
|
64
|
+
return 'failed';
|
|
65
|
+
}
|
|
66
|
+
}
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import type { AstroIntegration } from 'astro';
|
|
2
|
+
import type { Plugin as EsbuildPlugin } from 'esbuild';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Configuration for a recursive preview build that runs immediately after the
|
|
6
|
+
* site's production build completes. The preview build emits the SSR routes
|
|
7
|
+
* that serve draft preview.
|
|
8
|
+
*
|
|
9
|
+
* Set to `false` to explicitly opt out of preview builds for sites that do not
|
|
10
|
+
* need a draft/preview pipeline.
|
|
11
|
+
*/
|
|
12
|
+
export interface PreviewBuildOptions {
|
|
13
|
+
/**
|
|
14
|
+
* Optional alternative Astro adapter to use for the preview build.
|
|
15
|
+
* Falls back to the project's default adapter when omitted.
|
|
16
|
+
*/
|
|
17
|
+
adapter?: AstroIntegration;
|
|
18
|
+
/**
|
|
19
|
+
* Adapter-specific config overrides forwarded to the recursive build.
|
|
20
|
+
*/
|
|
21
|
+
config?: Record<string, unknown>;
|
|
22
|
+
/**
|
|
23
|
+
* Output directory for the preview build. Defaults to `.conloca/preview-server`
|
|
24
|
+
* — outside `dist/`, so the secret-baked artifact can never ride a wholesale
|
|
25
|
+
* static upload of the site and Astro's dist-clearing cannot wipe it.
|
|
26
|
+
*/
|
|
27
|
+
outDir?: string;
|
|
28
|
+
/**
|
|
29
|
+
* If true, fail the parent build when the preview build fails. Defaults to
|
|
30
|
+
* true; set false while setting up.
|
|
31
|
+
*/
|
|
32
|
+
required?: boolean;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Options accepted by {@link conlocaCloud}.
|
|
37
|
+
*
|
|
38
|
+
* Registration authenticates with one build token (`cbt_<id>.<secret>`)
|
|
39
|
+
* issued by the endpoint. Repository identity is normally detected from CI metadata or the Git
|
|
40
|
+
* checkout.
|
|
41
|
+
*/
|
|
42
|
+
export interface ConlocaCloudOptions {
|
|
43
|
+
/** Editor endpoint, e.g. 'https://cms.example.com', no trailing slash. */
|
|
44
|
+
endpoint: string;
|
|
45
|
+
/**
|
|
46
|
+
* Advanced override for repository identity, normalized to `owner/repo`.
|
|
47
|
+
* Normally omit this: Conloca detects GitHub, Vercel, or GitLab CI metadata,
|
|
48
|
+
* then falls back to the checkout's `remote.origin.url`. Registration is
|
|
49
|
+
* rejected when the token does not cover the detected repo.
|
|
50
|
+
*/
|
|
51
|
+
repoUri?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Advanced override for the deployable-site id, for CMS-less builds where
|
|
54
|
+
* `conlocaCMS` does not publish CONLOCA_CONTENT_ROOT. When the CMS channel IS
|
|
55
|
+
* present, the content root's sites.json is authoritative and an override
|
|
56
|
+
* that contradicts it fails the build — never a silent pick.
|
|
57
|
+
*/
|
|
58
|
+
siteId?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Build token issued by the endpoint. Prefer injecting it via the
|
|
61
|
+
* CONLOCA_BUILD_TOKEN environment variable instead of committing it here;
|
|
62
|
+
* when neither is present the build skips registration (fail soft, unless
|
|
63
|
+
* `requireRegistration` is set).
|
|
64
|
+
*/
|
|
65
|
+
buildToken?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Entry module of the puck config to compile into the editor bundle,
|
|
68
|
+
* e.g. './src/puck.config.tsx'. Same option name as @conloca/astro-cms.
|
|
69
|
+
*/
|
|
70
|
+
puckConfigPath: string;
|
|
71
|
+
/**
|
|
72
|
+
* Site CSS for accurate preview rendering — same option name and shape
|
|
73
|
+
* as `conlocaCMS({ siteStyles })`, and compiled the same way: by the site's
|
|
74
|
+
* own Vite pipeline (its plugins, PostCSS config and preprocessors), into
|
|
75
|
+
* the canvas stylesheet each build registers, ahead of the
|
|
76
|
+
* component modules, e.g. './src/styles/index.scss'. Paths resolve against
|
|
77
|
+
* the project root. The assets these stylesheets reference are emitted under
|
|
78
|
+
* `/_conloca/`, and an entry that fails to compile fails the build. Component
|
|
79
|
+
* `*.module.(s)css` imports compile in automatically — list here only what
|
|
80
|
+
* lives outside the component graph.
|
|
81
|
+
*/
|
|
82
|
+
siteStyles?: string | string[];
|
|
83
|
+
/**
|
|
84
|
+
* esbuild plugins for the editor bundle (puck config, its components and the
|
|
85
|
+
* conlocaCMS schemas module). That bundle is built with esbuild, outside the
|
|
86
|
+
* site's Vite pipeline, so a source transform the site's Vite plugins apply
|
|
87
|
+
* — e.g. Typia's `createValidate<T>()` generation in page schemas — must be
|
|
88
|
+
* passed here in its esbuild form too, or the bundle carries untransformed
|
|
89
|
+
* calls that throw when the editor loads it.
|
|
90
|
+
*/
|
|
91
|
+
editorBundlePlugins?: EsbuildPlugin[];
|
|
92
|
+
/**
|
|
93
|
+
* Representative content route for build-time style discovery — the SAME
|
|
94
|
+
* name and meaning as `conlocaCMS`'s option: the page whose styles and
|
|
95
|
+
* content-wrapper shape prose editing should adopt. When set, the build
|
|
96
|
+
* reads that route's rendered page (a prerendered file, or the booted node
|
|
97
|
+
* server entry), collects its CSS and wrapper shape, and registers them
|
|
98
|
+
* alongside the bundle. Unset: discovery is skipped and the editor falls
|
|
99
|
+
* back to the prose-safe derived tier.
|
|
100
|
+
*
|
|
101
|
+
* @example '/blog/welcome-post'
|
|
102
|
+
*/
|
|
103
|
+
fragmentPreviewRoute?: string;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Public base URL of the deployed site, used to absolutize the editor
|
|
107
|
+
* bundle URL when no dedicated preview domain is configured. Falls back to
|
|
108
|
+
* the CF_PAGES_URL env var; without either, registration is skipped.
|
|
109
|
+
*/
|
|
110
|
+
publicBaseUrl?: string;
|
|
111
|
+
/**
|
|
112
|
+
* Optional dedicated preview deployment as a hostname or absolute URL. A
|
|
113
|
+
* hostname is normalized to HTTPS. When set, editor assets and preview links
|
|
114
|
+
* use this deployment instead of the production site's public base URL.
|
|
115
|
+
*/
|
|
116
|
+
previewDomain?: string;
|
|
117
|
+
/**
|
|
118
|
+
* Recursive preview build configuration. Set to `false` to opt out.
|
|
119
|
+
* Defaults to enabled with project defaults.
|
|
120
|
+
*/
|
|
121
|
+
previewBuild?: PreviewBuildOptions | false;
|
|
122
|
+
/**
|
|
123
|
+
* The token issuer (the JWT `iss` the preview middleware pins).
|
|
124
|
+
* Set it to bake the value into the preview artifact; otherwise the
|
|
125
|
+
* deployment must supply `CONLOCA_SAAS_ISSUER` at runtime.
|
|
126
|
+
*/
|
|
127
|
+
saasIssuer?: string;
|
|
128
|
+
/**
|
|
129
|
+
* Fail the build when registration is SKIPPED for a missing prerequisite
|
|
130
|
+
* (no build token, no repository identity, no git sha/branch, no public
|
|
131
|
+
* base URL). Default false, so a plain `astro build` without the token
|
|
132
|
+
* stays untouched. Turn it on in CI once setup is done: a deploy can
|
|
133
|
+
* then never silently leave the editor at the endpoint stale. An ATTEMPTED
|
|
134
|
+
* registration that fails always fails the build, regardless of this.
|
|
135
|
+
*/
|
|
136
|
+
requireRegistration?: boolean;
|
|
137
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ambient declaration for the build-time virtual module the integration serves.
|
|
3
|
+
*
|
|
4
|
+
* Kept in its OWN file with no top-level import/export: in a module (a file
|
|
5
|
+
* that imports or exports anything), a `declare module` is treated as
|
|
6
|
+
* augmenting an existing module rather than declaring a new ambient one.
|
|
7
|
+
*
|
|
8
|
+
* `virtual:conloca-preview-opts` carries the preview middleware's configuration
|
|
9
|
+
* baked in during the recursive preview build, so a preview deployment needs no
|
|
10
|
+
* runtime env vars. It resolves to `{}` outside that build.
|
|
11
|
+
*/
|
|
12
|
+
declare module 'virtual:conloca-preview-opts' {
|
|
13
|
+
const baked: {
|
|
14
|
+
secret?: string;
|
|
15
|
+
saasEndpoint?: string;
|
|
16
|
+
saasIssuer?: string;
|
|
17
|
+
saasAudience?: string;
|
|
18
|
+
buildCommit?: string;
|
|
19
|
+
};
|
|
20
|
+
export default baked;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The routing config astro-cms's vite plugin serves to the site build. The
|
|
25
|
+
* middleware entry is compiled INTO the site's build graph (addMiddleware
|
|
26
|
+
* entrypoint), where the module resolves; this declaration only teaches tsc.
|
|
27
|
+
*/
|
|
28
|
+
declare module 'virtual:conloca-routing-config' {
|
|
29
|
+
import type { ResolvedRoutingConfig } from '@conloca/astro-cms';
|
|
30
|
+
|
|
31
|
+
const config: ResolvedRoutingConfig;
|
|
32
|
+
export default config;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Astro's content-collections module, resolvable only inside a site build.
|
|
37
|
+
* Declared with the narrow surface the middleware entry consumes (the same
|
|
38
|
+
* projection `createCollectionBackedContentAPI` expects).
|
|
39
|
+
*/
|
|
40
|
+
declare module 'astro:content' {
|
|
41
|
+
export function getCollection(collection: string): Promise<{ data: Record<string, unknown> }[]>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The Cloudflare Workers runtime module (bindings live here since Astro v6
|
|
46
|
+
* removed `locals.runtime.env`). Only resolvable inside workerd; the preview
|
|
47
|
+
* middleware imports it dynamically and treats a failed import as "not on
|
|
48
|
+
* Cloudflare Workers". Declared with the narrow surface consumed (the env bag).
|
|
49
|
+
*/
|
|
50
|
+
declare module 'cloudflare:workers' {
|
|
51
|
+
export const env: Record<string, unknown>;
|
|
52
|
+
}
|