blume 1.6.4 → 1.6.6
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/CHANGELOG.md +41 -0
- package/bin/blume.mjs +3 -2
- package/dist/cli/chunk-0ewz4trd.js +679 -0
- package/dist/cli/chunk-0ewz4trd.js.map +15 -0
- package/dist/cli/chunk-27gtm2ym.js +69 -0
- package/dist/cli/chunk-27gtm2ym.js.map +11 -0
- package/dist/cli/chunk-2aj8ddew.js +72 -0
- package/dist/cli/chunk-2aj8ddew.js.map +10 -0
- package/dist/cli/chunk-3k0kzs6d.js +69 -0
- package/dist/cli/chunk-3k0kzs6d.js.map +11 -0
- package/dist/cli/chunk-3r94j3tc.js +221 -0
- package/dist/cli/chunk-3r94j3tc.js.map +10 -0
- package/dist/cli/chunk-4trphnvy.js +102 -0
- package/dist/cli/chunk-4trphnvy.js.map +11 -0
- package/dist/cli/chunk-4xyggvgf.js +21 -0
- package/dist/cli/chunk-4xyggvgf.js.map +10 -0
- package/dist/cli/chunk-5hs6gb7n.js +32 -0
- package/dist/cli/chunk-5hs6gb7n.js.map +10 -0
- package/dist/cli/chunk-5yvt556e.js +185 -0
- package/dist/cli/chunk-5yvt556e.js.map +11 -0
- package/dist/cli/chunk-62qsssnh.js +3808 -0
- package/dist/cli/chunk-62qsssnh.js.map +36 -0
- package/dist/cli/chunk-6kzzpsx8.js +26 -0
- package/dist/cli/chunk-6kzzpsx8.js.map +10 -0
- package/dist/cli/chunk-8gnpdsn1.js +952 -0
- package/dist/cli/chunk-8gnpdsn1.js.map +12 -0
- package/dist/cli/chunk-9sh49q0h.js +30 -0
- package/dist/cli/chunk-9sh49q0h.js.map +10 -0
- package/dist/cli/chunk-aerwpe14.js +2370 -0
- package/dist/cli/chunk-aerwpe14.js.map +15 -0
- package/dist/cli/chunk-ag1zyr5x.js +176 -0
- package/dist/cli/chunk-ag1zyr5x.js.map +10 -0
- package/dist/cli/chunk-bawgnt8x.js +277 -0
- package/dist/cli/chunk-bawgnt8x.js.map +11 -0
- package/dist/cli/chunk-bcy492zc.js +16 -0
- package/dist/cli/chunk-bcy492zc.js.map +10 -0
- package/dist/cli/chunk-btfr9yvw.js +41 -0
- package/dist/cli/chunk-btfr9yvw.js.map +10 -0
- package/dist/cli/chunk-cbjnx4s8.js +73 -0
- package/dist/cli/chunk-cbjnx4s8.js.map +10 -0
- package/dist/cli/chunk-cnvm6k3e.js +96 -0
- package/dist/cli/chunk-cnvm6k3e.js.map +10 -0
- package/dist/cli/chunk-etsqspj6.js +5170 -0
- package/dist/cli/chunk-etsqspj6.js.map +47 -0
- package/dist/cli/chunk-ev67ycx0.js +15 -0
- package/dist/cli/chunk-ev67ycx0.js.map +10 -0
- package/dist/cli/chunk-ey89bjj1.js +209 -0
- package/dist/cli/chunk-ey89bjj1.js.map +11 -0
- package/dist/cli/chunk-f75cqye8.js +76 -0
- package/dist/cli/chunk-f75cqye8.js.map +10 -0
- package/dist/cli/chunk-j00ezcg5.js +259 -0
- package/dist/cli/chunk-j00ezcg5.js.map +11 -0
- package/dist/cli/chunk-jtb45atp.js +467 -0
- package/dist/cli/chunk-jtb45atp.js.map +14 -0
- package/dist/cli/chunk-m3p3wahd.js +117 -0
- package/dist/cli/chunk-m3p3wahd.js.map +10 -0
- package/dist/cli/chunk-n0y172hf.js +387 -0
- package/dist/cli/chunk-n0y172hf.js.map +12 -0
- package/dist/cli/chunk-n4qjabmt.js +1062 -0
- package/dist/cli/chunk-n4qjabmt.js.map +25 -0
- package/dist/cli/chunk-nyqzjdhj.js +111 -0
- package/dist/cli/chunk-nyqzjdhj.js.map +11 -0
- package/dist/cli/chunk-pxj10x8y.js +35 -0
- package/dist/cli/chunk-pxj10x8y.js.map +10 -0
- package/dist/cli/chunk-s4jn7f1q.js +54 -0
- package/dist/cli/chunk-s4jn7f1q.js.map +10 -0
- package/dist/cli/chunk-s4k1pnvf.js +81 -0
- package/dist/cli/chunk-s4k1pnvf.js.map +10 -0
- package/dist/cli/chunk-s5e5jt53.js +227 -0
- package/dist/cli/chunk-s5e5jt53.js.map +11 -0
- package/dist/cli/chunk-sbdqrjbb.js +81 -0
- package/dist/cli/chunk-sbdqrjbb.js.map +10 -0
- package/dist/cli/chunk-tc89yh2r.js +136 -0
- package/dist/cli/chunk-tc89yh2r.js.map +10 -0
- package/dist/cli/chunk-vt8fgygt.js +23 -0
- package/dist/cli/chunk-vt8fgygt.js.map +10 -0
- package/dist/cli/chunk-vv237fp3.js +1002 -0
- package/dist/cli/chunk-vv237fp3.js.map +13 -0
- package/dist/cli/chunk-vv3f8mb6.js +5314 -0
- package/dist/cli/chunk-vv3f8mb6.js.map +58 -0
- package/dist/cli/chunk-vxv4x1n8.js +17 -0
- package/dist/cli/chunk-vxv4x1n8.js.map +10 -0
- package/dist/cli/chunk-wb067mv3.js +758 -0
- package/dist/cli/chunk-wb067mv3.js.map +13 -0
- package/dist/cli/chunk-wd27zjcz.js +60 -0
- package/dist/cli/chunk-wd27zjcz.js.map +10 -0
- package/dist/cli/chunk-wkq5tbtq.js +1141 -0
- package/dist/cli/chunk-wkq5tbtq.js.map +19 -0
- package/dist/cli/chunk-x1vrdjyk.js +1967 -0
- package/dist/cli/chunk-x1vrdjyk.js.map +34 -0
- package/dist/cli/chunk-x66c5yjn.js +23 -0
- package/dist/cli/chunk-x66c5yjn.js.map +10 -0
- package/dist/cli/index.js +55 -27587
- package/dist/cli/index.js.map +5 -243
- package/dist/types/ai/ask-context.d.ts +26 -0
- package/dist/types/core/code-fences.d.ts +11 -0
- package/dist/types/core/config-input.d.ts +10 -0
- package/dist/types/core/package-root.d.ts +1 -1
- package/dist/types/core/schema.d.ts +74 -1
- package/docs/02-deployment.mdx +1 -1
- package/docs/configuration/analytics.mdx +21 -2
- package/docs/configuration/ask-ai.mdx +1 -1
- package/docs/configuration/customization.mdx +2 -9
- package/docs/content/syntax.mdx +1 -1
- package/docs/reference/cli.mdx +1 -1
- package/package.json +16 -14
- package/src/ai/api/handlers.ts +4 -7
- package/src/ai/api/paths.ts +8 -0
- package/src/ai/api/spec.ts +2 -1
- package/src/ai/ask-context.ts +378 -22
- package/src/astro/generate.ts +25 -29
- package/src/astro/include-hmr.ts +10 -13
- package/src/astro/include-refresh.ts +0 -0
- package/src/astro/index.ts +6 -1
- package/src/astro/integration.ts +269 -53
- package/src/astro/module-types.ts +74 -0
- package/src/astro/templates.ts +85 -97
- package/src/audit/image-size.ts +10 -8
- package/src/cli/command-meta.ts +77 -0
- package/src/cli/commands/add.ts +2 -4
- package/src/cli/commands/audit.ts +2 -4
- package/src/cli/commands/build.ts +42 -346
- package/src/cli/commands/check.ts +2 -4
- package/src/cli/commands/dev.ts +31 -42
- package/src/cli/commands/doctor.ts +2 -4
- package/src/cli/commands/eject.ts +3 -41
- package/src/cli/commands/eval.ts +2 -5
- package/src/cli/commands/init.ts +2 -4
- package/src/cli/commands/mcp-stdio.ts +2 -5
- package/src/cli/commands/preview.ts +3 -5
- package/src/cli/commands/sync.ts +2 -4
- package/src/cli/commands/translate.ts +2 -5
- package/src/cli/commands/validate.ts +2 -4
- package/src/cli/commands/version.ts +2 -4
- package/src/cli/eject-scripts.ts +0 -45
- package/src/cli/host-args.ts +16 -0
- package/src/cli/index.ts +84 -35
- package/src/cli/lazy-command.ts +47 -0
- package/src/components/content/GithubInfo.astro +4 -1
- package/src/components/content/mermaid-element.ts +8 -0
- package/src/components/layout/Analytics.astro +20 -1
- package/src/components/layout/PageLayout.astro +14 -3
- package/src/components/layout/ReferenceLayout.astro +15 -4
- package/src/components/layout/RootLayout.astro +15 -4
- package/src/components/layout/analytics-client.ts +2 -1
- package/src/components/layout/page-locale.ts +29 -0
- package/src/components/openapi/AsyncApiOperation.astro +5 -3
- package/src/components/openapi/Authorization.astro +4 -6
- package/src/components/openapi/Bindings.astro +2 -2
- package/src/components/openapi/Description.astro +109 -0
- package/src/components/openapi/GraphqlFieldsTable.astro +5 -7
- package/src/components/openapi/GraphqlOperation.astro +4 -3
- package/src/components/openapi/GraphqlType.astro +4 -6
- package/src/components/openapi/ParametersTable.astro +5 -7
- package/src/components/openapi/RequestBody.astro +2 -4
- package/src/components/openapi/Responses.astro +4 -3
- package/src/components/openapi/SchemaProperty.astro +11 -6
- package/src/components/openapi/description.ts +91 -0
- package/src/core/api-name.ts +18 -0
- package/src/core/code-fences.ts +48 -0
- package/src/core/config-input.ts +10 -0
- package/src/core/content-assets.ts +3 -7
- package/src/core/includes.ts +3 -7
- package/src/core/package-root.ts +1 -1
- package/src/core/schema.ts +27 -0
- package/src/core/sources/normalize.ts +2 -37
- package/src/core/sources/obsidian.ts +3 -2
- package/src/core/svg-dimensions.ts +97 -0
- package/src/core/version-cut.ts +2 -2
- package/src/deploy/artifacts.ts +370 -0
- package/src/deploy/cloudflare-negotiation.ts +97 -32
- package/src/deploy/function-bundle.ts +66 -20
- package/src/deploy/sitemap.ts +6 -0
- package/src/deploy/vercel-negotiation.ts +8 -30
- package/src/og/card.ts +6 -12
- package/src/openapi/render-mdx.ts +9 -5
- package/src/registry/eject.ts +0 -2
- package/src/theme/entry.ts +9 -2
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/core/probe.ts
|
|
4
|
+
import pMap from "p-map";
|
|
5
|
+
var PROBE_CONCURRENCY = 8;
|
|
6
|
+
var PROBE_TIMEOUT_MS = 1e4;
|
|
7
|
+
var STATUS_NOT_FOUND = 404;
|
|
8
|
+
var STATUS_GONE = 410;
|
|
9
|
+
var STATUS_METHOD_NOT_ALLOWED = 405;
|
|
10
|
+
var STATUS_NOT_IMPLEMENTED = 501;
|
|
11
|
+
var request = async (url, method, timeoutMs) => {
|
|
12
|
+
const controller = new AbortController;
|
|
13
|
+
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
14
|
+
const started = performance.now();
|
|
15
|
+
try {
|
|
16
|
+
const response = await fetch(url, {
|
|
17
|
+
method,
|
|
18
|
+
redirect: "follow",
|
|
19
|
+
signal: controller.signal
|
|
20
|
+
});
|
|
21
|
+
return {
|
|
22
|
+
encoding: response.headers.get("content-encoding"),
|
|
23
|
+
finalUrl: response.url,
|
|
24
|
+
ms: Math.round(performance.now() - started),
|
|
25
|
+
ok: response.ok,
|
|
26
|
+
redirected: response.redirected,
|
|
27
|
+
robotsTag: response.headers.get("x-robots-tag"),
|
|
28
|
+
status: response.status
|
|
29
|
+
};
|
|
30
|
+
} catch (error) {
|
|
31
|
+
if (error instanceof Error && error.name === "AbortError") {
|
|
32
|
+
return { ok: false, timedOut: true };
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
error: error instanceof Error ? error.message : String(error),
|
|
36
|
+
ok: false
|
|
37
|
+
};
|
|
38
|
+
} finally {
|
|
39
|
+
clearTimeout(timer);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var probe = async (url, options = {}) => {
|
|
43
|
+
const timeoutMs = options.timeoutMs ?? PROBE_TIMEOUT_MS;
|
|
44
|
+
const head = await request(url, "HEAD", timeoutMs);
|
|
45
|
+
const unreachable = !head.ok && head.status === undefined && !head.timedOut;
|
|
46
|
+
const retry = head.status === STATUS_METHOD_NOT_ALLOWED || head.status === STATUS_NOT_IMPLEMENTED || unreachable;
|
|
47
|
+
return retry ? await request(url, "GET", timeoutMs) : head;
|
|
48
|
+
};
|
|
49
|
+
var gradeExternal = (result) => {
|
|
50
|
+
if (result.ok) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
if (result.timedOut) {
|
|
54
|
+
return { detail: "request timed out", severity: "warning" };
|
|
55
|
+
}
|
|
56
|
+
if (result.status === undefined) {
|
|
57
|
+
return { detail: result.error ?? "unreachable", severity: "error" };
|
|
58
|
+
}
|
|
59
|
+
if (result.status === STATUS_NOT_FOUND || result.status === STATUS_GONE) {
|
|
60
|
+
return { detail: `HTTP ${result.status}`, severity: "error" };
|
|
61
|
+
}
|
|
62
|
+
return { detail: `HTTP ${result.status}`, severity: "warning" };
|
|
63
|
+
};
|
|
64
|
+
var probeAll = async (urls, options = {}) => {
|
|
65
|
+
const unique = [...new Set(urls)];
|
|
66
|
+
const entries = await pMap(unique, async (url) => [url, await probe(url, options)], { concurrency: Math.max(1, options.concurrency ?? PROBE_CONCURRENCY) });
|
|
67
|
+
return new Map(entries);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export { gradeExternal, probeAll };
|
|
71
|
+
|
|
72
|
+
//# debugId=A29226CDC8AC5EB464756E2164756E21
|
|
73
|
+
//# sourceMappingURL=chunk-cbjnx4s8.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/core/probe.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import pMap from \"p-map\";\n\nimport type { DiagnosticSeverity } from \"./types.ts\";\n\nexport const PROBE_CONCURRENCY = 8;\nexport const PROBE_TIMEOUT_MS = 10_000;\n\nconst STATUS_NOT_FOUND = 404;\nconst STATUS_GONE = 410;\nconst STATUS_METHOD_NOT_ALLOWED = 405;\nconst STATUS_NOT_IMPLEMENTED = 501;\n\n/** The outcome of a single HTTP probe, with failures normalized rather than thrown. */\nexport interface ProbeResult {\n ok: boolean;\n status?: number;\n timedOut?: boolean;\n error?: string;\n /** Whether the request was redirected before landing on `status`. */\n redirected?: boolean;\n /** The URL finally landed on, after following redirects. */\n finalUrl?: string;\n /** `Content-Encoding` of the response, when the server set one. */\n encoding?: string | null;\n /** Wall-clock milliseconds for the request. */\n ms?: number;\n /** `X-Robots-Tag` of the response, when the server set one. */\n robotsTag?: string | null;\n}\n\n/** Probe a URL with the given method, normalizing failures to a result. */\nconst request = async (\n url: string,\n method: \"GET\" | \"HEAD\",\n timeoutMs: number\n): Promise<ProbeResult> => {\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(), timeoutMs);\n const started = performance.now();\n try {\n const response = await fetch(url, {\n method,\n redirect: \"follow\",\n signal: controller.signal,\n });\n return {\n encoding: response.headers.get(\"content-encoding\"),\n finalUrl: response.url,\n ms: Math.round(performance.now() - started),\n ok: response.ok,\n redirected: response.redirected,\n robotsTag: response.headers.get(\"x-robots-tag\"),\n status: response.status,\n };\n } catch (error) {\n if (error instanceof Error && error.name === \"AbortError\") {\n return { ok: false, timedOut: true };\n }\n return {\n error: error instanceof Error ? error.message : String(error),\n ok: false,\n };\n } finally {\n clearTimeout(timer);\n }\n};\n\n/**\n * Probe a single URL: HEAD first, falling back to GET.\n *\n * Plenty of servers reject HEAD outright (405/501) or drop the connection, so a\n * HEAD-only probe would report healthy pages as dead.\n */\nexport const probe = async (\n url: string,\n options: { timeoutMs?: number } = {}\n): Promise<ProbeResult> => {\n const timeoutMs = options.timeoutMs ?? PROBE_TIMEOUT_MS;\n const head = await request(url, \"HEAD\", timeoutMs);\n const unreachable = !head.ok && head.status === undefined && !head.timedOut;\n const retry =\n head.status === STATUS_METHOD_NOT_ALLOWED ||\n head.status === STATUS_NOT_IMPLEMENTED ||\n unreachable;\n return retry ? await request(url, \"GET\", timeoutMs) : head;\n};\n\n/** Grade a probe result into a severity + detail, or null when the URL is fine. */\nexport const gradeExternal = (\n result: ProbeResult\n): { severity: DiagnosticSeverity; detail: string } | null => {\n if (result.ok) {\n return null;\n }\n if (result.timedOut) {\n return { detail: \"request timed out\", severity: \"warning\" };\n }\n if (result.status === undefined) {\n return { detail: result.error ?? \"unreachable\", severity: \"error\" };\n }\n // A 404/410 is definitively dead. A 403/429/5xx may well be rate limiting or a\n // transient blip, which is not the author's bug to fix.\n if (result.status === STATUS_NOT_FOUND || result.status === STATUS_GONE) {\n return { detail: `HTTP ${result.status}`, severity: \"error\" };\n }\n return { detail: `HTTP ${result.status}`, severity: \"warning\" };\n};\n\n/**\n * Probe many URLs with bounded concurrency, deduplicating first. Returns a map\n * from URL to its result — the caller decides what each one means.\n */\nexport const probeAll = async (\n urls: readonly string[],\n options: { concurrency?: number; timeoutMs?: number } = {}\n): Promise<Map<string, ProbeResult>> => {\n const unique = [...new Set(urls)];\n const entries = await pMap(\n unique,\n async (url) => [url, await probe(url, options)] as const,\n { concurrency: Math.max(1, options.concurrency ?? PROBE_CONCURRENCY) }\n );\n return new Map(entries);\n};\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;AAAA;AAIO,IAAM,oBAAoB;AAC1B,IAAM,mBAAmB;AAEhC,IAAM,mBAAmB;AACzB,IAAM,cAAc;AACpB,IAAM,4BAA4B;AAClC,IAAM,yBAAyB;AAqB/B,IAAM,UAAU,OACd,KACA,QACA,cACyB;AAAA,EACzB,MAAM,aAAa,IAAI;AAAA,EACvB,MAAM,QAAQ,WAAW,MAAM,WAAW,MAAM,GAAG,SAAS;AAAA,EAC5D,MAAM,UAAU,YAAY,IAAI;AAAA,EAChC,IAAI;AAAA,IACF,MAAM,WAAW,MAAM,MAAM,KAAK;AAAA,MAChC;AAAA,MACA,UAAU;AAAA,MACV,QAAQ,WAAW;AAAA,IACrB,CAAC;AAAA,IACD,OAAO;AAAA,MACL,UAAU,SAAS,QAAQ,IAAI,kBAAkB;AAAA,MACjD,UAAU,SAAS;AAAA,MACnB,IAAI,KAAK,MAAM,YAAY,IAAI,IAAI,OAAO;AAAA,MAC1C,IAAI,SAAS;AAAA,MACb,YAAY,SAAS;AAAA,MACrB,WAAW,SAAS,QAAQ,IAAI,cAAc;AAAA,MAC9C,QAAQ,SAAS;AAAA,IACnB;AAAA,IACA,OAAO,OAAO;AAAA,IACd,IAAI,iBAAiB,SAAS,MAAM,SAAS,cAAc;AAAA,MACzD,OAAO,EAAE,IAAI,OAAO,UAAU,KAAK;AAAA,IACrC;AAAA,IACA,OAAO;AAAA,MACL,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAAA,MAC5D,IAAI;AAAA,IACN;AAAA,YACA;AAAA,IACA,aAAa,KAAK;AAAA;AAAA;AAUf,IAAM,QAAQ,OACnB,KACA,UAAkC,CAAC,MACV;AAAA,EACzB,MAAM,YAAY,QAAQ,aAAa;AAAA,EACvC,MAAM,OAAO,MAAM,QAAQ,KAAK,QAAQ,SAAS;AAAA,EACjD,MAAM,cAAc,CAAC,KAAK,MAAM,KAAK,WAAW,aAAa,CAAC,KAAK;AAAA,EACnE,MAAM,QACJ,KAAK,WAAW,6BAChB,KAAK,WAAW,0BAChB;AAAA,EACF,OAAO,QAAQ,MAAM,QAAQ,KAAK,OAAO,SAAS,IAAI;AAAA;AAIjD,IAAM,gBAAgB,CAC3B,WAC4D;AAAA,EAC5D,IAAI,OAAO,IAAI;AAAA,IACb,OAAO;AAAA,EACT;AAAA,EACA,IAAI,OAAO,UAAU;AAAA,IACnB,OAAO,EAAE,QAAQ,qBAAqB,UAAU,UAAU;AAAA,EAC5D;AAAA,EACA,IAAI,OAAO,WAAW,WAAW;AAAA,IAC/B,OAAO,EAAE,QAAQ,OAAO,SAAS,eAAe,UAAU,QAAQ;AAAA,EACpE;AAAA,EAGA,IAAI,OAAO,WAAW,oBAAoB,OAAO,WAAW,aAAa;AAAA,IACvE,OAAO,EAAE,QAAQ,QAAQ,OAAO,UAAU,UAAU,QAAQ;AAAA,EAC9D;AAAA,EACA,OAAO,EAAE,QAAQ,QAAQ,OAAO,UAAU,UAAU,UAAU;AAAA;AAOzD,IAAM,WAAW,OACtB,MACA,UAAwD,CAAC,MACnB;AAAA,EACtC,MAAM,SAAS,CAAC,GAAG,IAAI,IAAI,IAAI,CAAC;AAAA,EAChC,MAAM,UAAU,MAAM,KACpB,QACA,OAAO,QAAQ,CAAC,KAAK,MAAM,MAAM,KAAK,OAAO,CAAC,GAC9C,EAAE,aAAa,KAAK,IAAI,GAAG,QAAQ,eAAe,iBAAiB,EAAE,CACvE;AAAA,EACA,OAAO,IAAI,IAAI,OAAO;AAAA;",
|
|
8
|
+
"debugId": "A29226CDC8AC5EB464756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
ensureGitignore
|
|
4
|
+
} from "./chunk-5hs6gb7n.js";
|
|
5
|
+
import {
|
|
6
|
+
prepareProject
|
|
7
|
+
} from "./chunk-nyqzjdhj.js";
|
|
8
|
+
import"./chunk-9sh49q0h.js";
|
|
9
|
+
import"./chunk-btfr9yvw.js";
|
|
10
|
+
import {
|
|
11
|
+
refuseIfDevRunning
|
|
12
|
+
} from "./chunk-tc89yh2r.js";
|
|
13
|
+
import"./chunk-62qsssnh.js";
|
|
14
|
+
import"./chunk-n4qjabmt.js";
|
|
15
|
+
import"./chunk-pxj10x8y.js";
|
|
16
|
+
import"./chunk-sbdqrjbb.js";
|
|
17
|
+
import"./chunk-5yvt556e.js";
|
|
18
|
+
import"./chunk-ev67ycx0.js";
|
|
19
|
+
import"./chunk-vt8fgygt.js";
|
|
20
|
+
import"./chunk-3r94j3tc.js";
|
|
21
|
+
import"./chunk-aerwpe14.js";
|
|
22
|
+
import"./chunk-3k0kzs6d.js";
|
|
23
|
+
import"./chunk-vxv4x1n8.js";
|
|
24
|
+
import"./chunk-wd27zjcz.js";
|
|
25
|
+
import"./chunk-etsqspj6.js";
|
|
26
|
+
import"./chunk-vv3f8mb6.js";
|
|
27
|
+
import"./chunk-27gtm2ym.js";
|
|
28
|
+
import"./chunk-4xyggvgf.js";
|
|
29
|
+
import"./chunk-6kzzpsx8.js";
|
|
30
|
+
import {
|
|
31
|
+
logger
|
|
32
|
+
} from "./chunk-ey89bjj1.js";
|
|
33
|
+
import {
|
|
34
|
+
commandMeta
|
|
35
|
+
} from "./chunk-2aj8ddew.js";
|
|
36
|
+
|
|
37
|
+
// src/cli/commands/check.ts
|
|
38
|
+
import { existsSync } from "node:fs";
|
|
39
|
+
import { check } from "@astrojs/check";
|
|
40
|
+
import { sync } from "astro";
|
|
41
|
+
import { defineCommand } from "citty";
|
|
42
|
+
import { join } from "pathe";
|
|
43
|
+
var checkCommand = defineCommand({
|
|
44
|
+
args: {
|
|
45
|
+
isolated: {
|
|
46
|
+
description: "Type-check in an isolated .blume-verify runtime so a running dev server is untouched. For verifying changes while `blume dev` runs.",
|
|
47
|
+
type: "boolean"
|
|
48
|
+
},
|
|
49
|
+
preview: {
|
|
50
|
+
description: "Include drafts and unpublished CMS content.",
|
|
51
|
+
type: "boolean"
|
|
52
|
+
},
|
|
53
|
+
strict: {
|
|
54
|
+
description: "Fail on content diagnostics as well as type errors.",
|
|
55
|
+
type: "boolean"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
meta: commandMeta.check,
|
|
59
|
+
async run({ args }) {
|
|
60
|
+
const root = process.cwd();
|
|
61
|
+
const runtimeDir = args.isolated ? ".blume-verify" : process.env.BLUME_RUNTIME_DIR;
|
|
62
|
+
refuseIfDevRunning(root, "checking", { isolatedHint: true, runtimeDir });
|
|
63
|
+
if (args.isolated) {
|
|
64
|
+
await ensureGitignore(root, [".blume-verify/"]);
|
|
65
|
+
}
|
|
66
|
+
const project = await prepareProject({
|
|
67
|
+
mode: "build",
|
|
68
|
+
preview: args.preview,
|
|
69
|
+
root,
|
|
70
|
+
runtimeDir,
|
|
71
|
+
strict: args.strict
|
|
72
|
+
});
|
|
73
|
+
const { outDir } = project.context;
|
|
74
|
+
await sync({ logLevel: "warn", root: outDir });
|
|
75
|
+
const tsconfig = join(root, "tsconfig.json");
|
|
76
|
+
logger.start(`Type-checking ${project.graph.pages.length} page(s)`);
|
|
77
|
+
const failed = await check({
|
|
78
|
+
minimumFailingSeverity: "error",
|
|
79
|
+
minimumSeverity: "hint",
|
|
80
|
+
root: outDir,
|
|
81
|
+
tsconfig: existsSync(tsconfig) ? tsconfig : undefined,
|
|
82
|
+
watch: false
|
|
83
|
+
});
|
|
84
|
+
if (failed) {
|
|
85
|
+
logger.error("Type check failed.");
|
|
86
|
+
process.exit(1);
|
|
87
|
+
}
|
|
88
|
+
logger.success("No type errors.");
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
export {
|
|
92
|
+
checkCommand
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
//# debugId=3E921ABECB33B7AC64756E2164756E21
|
|
96
|
+
//# sourceMappingURL=chunk-cnvm6k3e.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/cli/commands/check.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { existsSync } from \"node:fs\";\n\nimport { check } from \"@astrojs/check\";\nimport { sync } from \"astro\";\nimport { defineCommand } from \"citty\";\nimport { join } from \"pathe\";\n\nimport { ensureGitignore } from \"../../core/gitignore.ts\";\nimport { commandMeta } from \"../command-meta.ts\";\nimport { refuseIfDevRunning } from \"../dev-lock.ts\";\nimport { logger } from \"../log.ts\";\nimport { prepareProject } from \"../prepare.ts\";\n\nexport const checkCommand = defineCommand({\n args: {\n isolated: {\n description:\n \"Type-check in an isolated .blume-verify runtime so a running dev server is untouched. For verifying changes while `blume dev` runs.\",\n type: \"boolean\",\n },\n preview: {\n description: \"Include drafts and unpublished CMS content.\",\n type: \"boolean\",\n },\n strict: {\n description: \"Fail on content diagnostics as well as type errors.\",\n type: \"boolean\",\n },\n },\n meta: commandMeta.check,\n async run({ args }) {\n const root = process.cwd();\n\n // `blume check` regenerates `.blume` just like `build`, so it must refuse a\n // live dev server unless isolated. `--isolated` (or BLUME_RUNTIME_DIR)\n // relocates the runtime to `.blume-verify`, which dev never locks.\n const runtimeDir = args.isolated\n ? \".blume-verify\"\n : process.env.BLUME_RUNTIME_DIR;\n refuseIfDevRunning(root, \"checking\", { isolatedHint: true, runtimeDir });\n if (args.isolated) {\n await ensureGitignore(root, [\".blume-verify/\"]);\n }\n\n const project = await prepareProject({\n mode: \"build\",\n preview: args.preview,\n root,\n runtimeDir,\n strict: args.strict,\n });\n\n const { outDir } = project.context;\n\n // Generate Astro's content/collection and font types into `.blume/.astro`\n // so `astro:*` virtual modules resolve during the check.\n await sync({ logLevel: \"warn\", root: outDir });\n\n // The project-root tsconfig is what covers the authored `pages/` and config;\n // without it astro check only sees the generated `.blume` project. Falls back\n // to the generated project's own tsconfig when the project has none.\n const tsconfig = join(root, \"tsconfig.json\");\n\n logger.start(`Type-checking ${project.graph.pages.length} page(s)`);\n const failed = await check({\n minimumFailingSeverity: \"error\",\n minimumSeverity: \"hint\",\n root: outDir,\n tsconfig: existsSync(tsconfig) ? tsconfig : undefined,\n watch: false,\n });\n\n if (failed) {\n logger.error(\"Type check failed.\");\n process.exit(1);\n }\n\n logger.success(\"No type errors.\");\n },\n});\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AACA;AACA;AAQO,IAAM,eAAe,cAAc;AAAA,EACxC,MAAM;AAAA,IACJ,UAAU;AAAA,MACR,aACE;AAAA,MACF,MAAM;AAAA,IACR;AAAA,IACA,SAAS;AAAA,MACP,aAAa;AAAA,MACb,MAAM;AAAA,IACR;AAAA,IACA,QAAQ;AAAA,MACN,aAAa;AAAA,MACb,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EACA,MAAM,YAAY;AAAA,OACZ,IAAG,GAAG,QAAQ;AAAA,IAClB,MAAM,OAAO,QAAQ,IAAI;AAAA,IAKzB,MAAM,aAAa,KAAK,WACpB,kBACA,QAAQ,IAAI;AAAA,IAChB,mBAAmB,MAAM,YAAY,EAAE,cAAc,MAAM,WAAW,CAAC;AAAA,IACvE,IAAI,KAAK,UAAU;AAAA,MACjB,MAAM,gBAAgB,MAAM,CAAC,gBAAgB,CAAC;AAAA,IAChD;AAAA,IAEA,MAAM,UAAU,MAAM,eAAe;AAAA,MACnC,MAAM;AAAA,MACN,SAAS,KAAK;AAAA,MACd;AAAA,MACA;AAAA,MACA,QAAQ,KAAK;AAAA,IACf,CAAC;AAAA,IAED,QAAQ,WAAW,QAAQ;AAAA,IAI3B,MAAM,KAAK,EAAE,UAAU,QAAQ,MAAM,OAAO,CAAC;AAAA,IAK7C,MAAM,WAAW,KAAK,MAAM,eAAe;AAAA,IAE3C,OAAO,MAAM,iBAAiB,QAAQ,MAAM,MAAM,gBAAgB;AAAA,IAClE,MAAM,SAAS,MAAM,MAAM;AAAA,MACzB,wBAAwB;AAAA,MACxB,iBAAiB;AAAA,MACjB,MAAM;AAAA,MACN,UAAU,WAAW,QAAQ,IAAI,WAAW;AAAA,MAC5C,OAAO;AAAA,IACT,CAAC;AAAA,IAED,IAAI,QAAQ;AAAA,MACV,OAAO,MAAM,oBAAoB;AAAA,MACjC,QAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,IAEA,OAAO,QAAQ,iBAAiB;AAAA;AAEpC,CAAC;",
|
|
8
|
+
"debugId": "3E921ABECB33B7AC64756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|