blume 1.6.5 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/bin/blume.mjs +3 -2
- package/dist/cli/chunk-0qhq7b8q.js +111 -0
- package/dist/cli/chunk-0qhq7b8q.js.map +11 -0
- package/dist/cli/chunk-18tjv4f7.js +96 -0
- package/dist/cli/chunk-18tjv4f7.js.map +10 -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-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-5d4q7121.js +4064 -0
- package/dist/cli/chunk-5d4q7121.js.map +40 -0
- package/dist/cli/chunk-5hs6gb7n.js +32 -0
- package/dist/cli/chunk-5hs6gb7n.js.map +10 -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-9qs6acpw.js +176 -0
- package/dist/cli/chunk-9qs6acpw.js.map +10 -0
- package/dist/cli/chunk-agy5rzxy.js +2453 -0
- package/dist/cli/chunk-agy5rzxy.js.map +15 -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-cfw6x4rm.js +1967 -0
- package/dist/cli/chunk-cfw6x4rm.js.map +34 -0
- package/dist/cli/chunk-ckh3a410.js +277 -0
- package/dist/cli/chunk-ckh3a410.js.map +11 -0
- package/dist/cli/chunk-drke6t0h.js +259 -0
- package/dist/cli/chunk-drke6t0h.js.map +11 -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-j6pxe0dt.js +69 -0
- package/dist/cli/chunk-j6pxe0dt.js.map +11 -0
- package/dist/cli/chunk-jk1zwka1.js +387 -0
- package/dist/cli/chunk-jk1zwka1.js.map +12 -0
- package/dist/cli/chunk-jtb45atp.js +467 -0
- package/dist/cli/chunk-jtb45atp.js.map +14 -0
- package/dist/cli/chunk-jxkxjsc1.js +76 -0
- package/dist/cli/chunk-jxkxjsc1.js.map +10 -0
- package/dist/cli/chunk-kwx90v78.js +81 -0
- package/dist/cli/chunk-kwx90v78.js.map +10 -0
- package/dist/cli/chunk-n0nyat6g.js +30 -0
- package/dist/cli/chunk-n0nyat6g.js.map +10 -0
- package/dist/cli/chunk-pxj10x8y.js +35 -0
- package/dist/cli/chunk-pxj10x8y.js.map +10 -0
- package/dist/cli/chunk-qq9nm3qd.js +1141 -0
- package/dist/cli/chunk-qq9nm3qd.js.map +19 -0
- package/dist/cli/chunk-s102bysw.js +5170 -0
- package/dist/cli/chunk-s102bysw.js.map +47 -0
- package/dist/cli/chunk-s5dsk8bj.js +769 -0
- package/dist/cli/chunk-s5dsk8bj.js.map +13 -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-tnskyrej.js +117 -0
- package/dist/cli/chunk-tnskyrej.js.map +10 -0
- package/dist/cli/chunk-v2ymm99c.js +1016 -0
- package/dist/cli/chunk-v2ymm99c.js.map +13 -0
- package/dist/cli/chunk-v5mm027v.js +185 -0
- package/dist/cli/chunk-v5mm027v.js.map +11 -0
- package/dist/cli/chunk-vt8fgygt.js +23 -0
- package/dist/cli/chunk-vt8fgygt.js.map +10 -0
- package/dist/cli/chunk-vxv4x1n8.js +17 -0
- package/dist/cli/chunk-vxv4x1n8.js.map +10 -0
- package/dist/cli/chunk-wd27zjcz.js +60 -0
- package/dist/cli/chunk-wd27zjcz.js.map +10 -0
- package/dist/cli/chunk-x66c5yjn.js +23 -0
- package/dist/cli/chunk-x66c5yjn.js.map +10 -0
- package/dist/cli/chunk-xv91q4nm.js +5314 -0
- package/dist/cli/chunk-xv91q4nm.js.map +58 -0
- package/dist/cli/chunk-y3g15rvv.js +679 -0
- package/dist/cli/chunk-y3g15rvv.js.map +15 -0
- package/dist/cli/chunk-ye9zdkgv.js +136 -0
- package/dist/cli/chunk-ye9zdkgv.js.map +10 -0
- package/dist/cli/chunk-ynacq3ev.js +1062 -0
- package/dist/cli/chunk-ynacq3ev.js.map +25 -0
- package/dist/cli/chunk-zr3ygrq3.js +54 -0
- package/dist/cli/chunk-zr3ygrq3.js.map +10 -0
- package/dist/cli/index.js +55 -27597
- package/dist/cli/index.js.map +5 -243
- package/dist/types/ai/ask-context.d.ts +26 -0
- package/dist/types/components/layout/nav-utils.d.ts +33 -1
- package/dist/types/core/code-fences.d.ts +11 -0
- package/dist/types/core/package-root.d.ts +1 -1
- package/dist/types/core/schema.d.ts +70 -0
- package/dist/types/theme/fonts.d.ts +22 -22
- package/docs/02-deployment.mdx +22 -1
- package/docs/configuration/ask-ai.mdx +1 -1
- package/docs/configuration/customization.mdx +2 -9
- package/docs/content/navigation.mdx +2 -0
- package/docs/content/syntax.mdx +1 -1
- package/docs/discoverability/open-graph.mdx +4 -0
- package/docs/reference/cli.mdx +1 -1
- package/package.json +4 -2
- 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 +161 -28
- 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 +280 -53
- package/src/astro/module-types.ts +83 -0
- package/src/astro/templates.ts +256 -108
- 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 +70 -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/Icon.astro +24 -0
- package/src/components/content/GithubInfo.astro +4 -1
- package/src/components/icon-sprite-middleware.ts +41 -0
- package/src/components/icon-sprite.ts +93 -0
- package/src/components/layout/IconSprite.astro +11 -0
- package/src/components/layout/NavTree.astro +156 -188
- package/src/components/layout/NavTreeCache.astro +45 -0
- package/src/components/layout/NavTreeScript.astro +256 -0
- package/src/components/layout/PageActions.astro +11 -5
- package/src/components/layout/PageLayout.astro +21 -3
- package/src/components/layout/ReferenceLayout.astro +21 -4
- package/src/components/layout/RootLayout.astro +44 -6
- package/src/components/layout/nav-cache.ts +49 -0
- package/src/components/layout/nav-utils.ts +69 -1
- package/src/components/layout/page-locale.ts +29 -0
- package/src/core/api-name.ts +18 -0
- package/src/core/code-fences.ts +48 -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 +19 -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/markdown/language-icon.ts +64 -20
- package/src/markdown/mermaid.ts +11 -0
- package/src/og/cache.ts +236 -0
- package/src/og/card.ts +18 -16
- package/src/og/index.ts +8 -1
- package/src/openapi/render-mdx.ts +9 -5
- package/src/registry/eject.ts +23 -10
- package/src/theme/entry.ts +41 -7
- package/src/theme/fonts.ts +30 -23
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
packageRoot
|
|
4
|
+
} from "./chunk-6kzzpsx8.js";
|
|
5
|
+
|
|
6
|
+
// src/registry/registry.ts
|
|
7
|
+
import { join } from "pathe";
|
|
8
|
+
var packageSrc = join(packageRoot(), "src");
|
|
9
|
+
var layoutComponent = (config) => {
|
|
10
|
+
const target = `components/blume/${config.file}`;
|
|
11
|
+
return {
|
|
12
|
+
description: config.description,
|
|
13
|
+
files: [
|
|
14
|
+
{
|
|
15
|
+
rewrite: true,
|
|
16
|
+
source: `components/layout/${config.file}`,
|
|
17
|
+
target
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
name: config.name,
|
|
21
|
+
postInstall: [
|
|
22
|
+
"Register it in components.ts:",
|
|
23
|
+
' import { defineComponents } from "blume";',
|
|
24
|
+
` import ${config.slot} from "./${target}";`,
|
|
25
|
+
"",
|
|
26
|
+
` export default defineComponents({ layout: { ${config.slot} } });`,
|
|
27
|
+
"",
|
|
28
|
+
"It imports the rest from `blume/*`, so it matches the built-in until you edit it."
|
|
29
|
+
]
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
var contentComponent = (config) => {
|
|
33
|
+
const target = `components/blume/${config.file}`;
|
|
34
|
+
return {
|
|
35
|
+
description: config.description,
|
|
36
|
+
files: [
|
|
37
|
+
{
|
|
38
|
+
rewrite: true,
|
|
39
|
+
source: `components/content/${config.file}`,
|
|
40
|
+
target
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
name: config.name,
|
|
44
|
+
postInstall: [
|
|
45
|
+
"Register it in components.ts:",
|
|
46
|
+
' import { defineComponents } from "blume";',
|
|
47
|
+
` import ${config.tag} from "./${target}";`,
|
|
48
|
+
"",
|
|
49
|
+
` export default defineComponents({ mdx: { ${config.tag} } });`,
|
|
50
|
+
"",
|
|
51
|
+
"It imports the rest from `blume/*`, so it matches the built-in until you edit it."
|
|
52
|
+
]
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
var CONTENT_COMPONENTS = [
|
|
56
|
+
{
|
|
57
|
+
description: "Aside for notes, tips, and warnings.",
|
|
58
|
+
file: "Callout.astro",
|
|
59
|
+
name: "callout",
|
|
60
|
+
tag: "Callout"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
description: "A linkable card with icon, title, and body.",
|
|
64
|
+
file: "Card.astro",
|
|
65
|
+
name: "card",
|
|
66
|
+
tag: "Card"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
description: "A responsive grid of cards.",
|
|
70
|
+
file: "CardGroup.astro",
|
|
71
|
+
name: "card-group",
|
|
72
|
+
tag: "CardGroup"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
description: "Tabbed code blocks for multiple languages.",
|
|
76
|
+
file: "CodeGroup.astro",
|
|
77
|
+
name: "code-group",
|
|
78
|
+
tag: "CodeGroup"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
description: "A small status/label badge.",
|
|
82
|
+
file: "Badge.astro",
|
|
83
|
+
name: "badge",
|
|
84
|
+
tag: "Badge"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
description: "A numbered list of steps.",
|
|
88
|
+
file: "Steps.astro",
|
|
89
|
+
name: "steps",
|
|
90
|
+
tag: "Steps"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
description: "A single step within Steps.",
|
|
94
|
+
file: "Step.astro",
|
|
95
|
+
name: "step",
|
|
96
|
+
tag: "Step"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
description: "A tabbed content panel.",
|
|
100
|
+
file: "Tabs.astro",
|
|
101
|
+
name: "tabs",
|
|
102
|
+
tag: "Tabs"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
description: "A single tab within Tabs.",
|
|
106
|
+
file: "Tab.astro",
|
|
107
|
+
name: "tab",
|
|
108
|
+
tag: "Tab"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
description: "A collapsible accordion group.",
|
|
112
|
+
file: "Accordion.astro",
|
|
113
|
+
name: "accordion",
|
|
114
|
+
tag: "Accordion"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
description: "A single item within an Accordion.",
|
|
118
|
+
file: "AccordionItem.astro",
|
|
119
|
+
name: "accordion-item",
|
|
120
|
+
tag: "AccordionItem"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
description: "A multi-column layout.",
|
|
124
|
+
file: "Columns.astro",
|
|
125
|
+
name: "columns",
|
|
126
|
+
tag: "Columns"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
description: "A single column within Columns.",
|
|
130
|
+
file: "Column.astro",
|
|
131
|
+
name: "column",
|
|
132
|
+
tag: "Column"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
description: "A bordered frame around an image or embed.",
|
|
136
|
+
file: "Frame.astro",
|
|
137
|
+
name: "frame",
|
|
138
|
+
tag: "Frame"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
description: "An inline expand/collapse disclosure.",
|
|
142
|
+
file: "Expandable.astro",
|
|
143
|
+
name: "expandable",
|
|
144
|
+
tag: "Expandable"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
description: "A titled content panel.",
|
|
148
|
+
file: "Panel.astro",
|
|
149
|
+
name: "panel",
|
|
150
|
+
tag: "Panel"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
description: "A hover tooltip.",
|
|
154
|
+
file: "Tooltip.astro",
|
|
155
|
+
name: "tooltip",
|
|
156
|
+
tag: "Tooltip"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
description: "A compact linkable tile.",
|
|
160
|
+
file: "Tile.astro",
|
|
161
|
+
name: "tile",
|
|
162
|
+
tag: "Tile"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
description: "A styled prompt / terminal block.",
|
|
166
|
+
file: "Prompt.astro",
|
|
167
|
+
name: "prompt",
|
|
168
|
+
tag: "Prompt"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
description: "A responsive, privacy-friendly YouTube embed.",
|
|
172
|
+
file: "YouTube.astro",
|
|
173
|
+
name: "youtube",
|
|
174
|
+
tag: "YouTube"
|
|
175
|
+
}
|
|
176
|
+
];
|
|
177
|
+
var registry = [
|
|
178
|
+
layoutComponent({
|
|
179
|
+
description: "The top navigation bar (logo, search, nav links).",
|
|
180
|
+
file: "Header.astro",
|
|
181
|
+
name: "header",
|
|
182
|
+
slot: "Header"
|
|
183
|
+
}),
|
|
184
|
+
layoutComponent({
|
|
185
|
+
description: "The sidebar navigation tree.",
|
|
186
|
+
file: "NavTree.astro",
|
|
187
|
+
name: "sidebar",
|
|
188
|
+
slot: "Sidebar"
|
|
189
|
+
}),
|
|
190
|
+
layoutComponent({
|
|
191
|
+
description: "The breadcrumb trail shown above page content.",
|
|
192
|
+
file: "Breadcrumbs.astro",
|
|
193
|
+
name: "breadcrumbs",
|
|
194
|
+
slot: "Breadcrumbs"
|
|
195
|
+
}),
|
|
196
|
+
layoutComponent({
|
|
197
|
+
description: "The on-this-page table of contents.",
|
|
198
|
+
file: "TableOfContents.astro",
|
|
199
|
+
name: "table-of-contents",
|
|
200
|
+
slot: "TableOfContents"
|
|
201
|
+
}),
|
|
202
|
+
layoutComponent({
|
|
203
|
+
description: "The previous/next pagination footer.",
|
|
204
|
+
file: "Pagination.astro",
|
|
205
|
+
name: "pagination",
|
|
206
|
+
slot: "Pagination"
|
|
207
|
+
}),
|
|
208
|
+
layoutComponent({
|
|
209
|
+
description: 'The "Was this page helpful?" feedback rating.',
|
|
210
|
+
file: "PageFeedback.astro",
|
|
211
|
+
name: "feedback",
|
|
212
|
+
slot: "Feedback"
|
|
213
|
+
}),
|
|
214
|
+
...CONTENT_COMPONENTS.map(contentComponent)
|
|
215
|
+
];
|
|
216
|
+
var findItem = (name) => registry.find((item) => item.name === name);
|
|
217
|
+
|
|
218
|
+
export { packageSrc, registry, findItem };
|
|
219
|
+
|
|
220
|
+
//# debugId=2BDCE672B82B453C64756E2164756E21
|
|
221
|
+
//# sourceMappingURL=chunk-3r94j3tc.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/registry/registry.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { join } from \"pathe\";\n\nimport { packageRoot } from \"../core/package-root.ts\";\n\n/** A file copied into the user's project by `blume add`. */\nexport interface RegistryFile {\n /** Path to the source file, relative to the blume package `src` directory. */\n source: string;\n /** Destination path relative to the project root. */\n target: string;\n /** Rewrite the file's relative imports to `blume/*` specifiers on copy. */\n rewrite?: boolean;\n}\n\nexport interface RegistryItem {\n name: string;\n description: string;\n files: RegistryFile[];\n /** Lines printed after install to guide the user. */\n postInstall: string[];\n}\n\n/** Absolute path to the blume package `src` directory (the copy source root). */\nexport const packageSrc = join(packageRoot(), \"src\");\n\n/**\n * A built-in layout component offered as editable source. `blume add` rewrites\n * its relative imports to `blume/*`, so it renders identically to the built-in\n * until the user changes it, then registers under the matching `layout` slot.\n */\nconst layoutComponent = (config: {\n name: string;\n description: string;\n /** Source basename under `src/components/layout`. */\n file: string;\n /** Layout slot key, also the import name in the post-install hint. */\n slot: string;\n}): RegistryItem => {\n const target = `components/blume/${config.file}`;\n return {\n description: config.description,\n files: [\n {\n rewrite: true,\n source: `components/layout/${config.file}`,\n target,\n },\n ],\n name: config.name,\n postInstall: [\n \"Register it in components.ts:\",\n ' import { defineComponents } from \"blume\";',\n ` import ${config.slot} from \"./${target}\";`,\n \"\",\n ` export default defineComponents({ layout: { ${config.slot} } });`,\n \"\",\n \"It imports the rest from `blume/*`, so it matches the built-in until you edit it.\",\n ],\n };\n};\n\n/**\n * A built-in MDX content component offered as editable source. Like\n * {@link layoutComponent}, but registered under the `mdx` map (the tag you write\n * in `.mdx`) rather than a `layout` slot.\n */\nconst contentComponent = (config: {\n name: string;\n description: string;\n /** Source basename under `src/components/content`. */\n file: string;\n /** MDX tag / component name, also the import name in the post-install hint. */\n tag: string;\n}): RegistryItem => {\n const target = `components/blume/${config.file}`;\n return {\n description: config.description,\n files: [\n {\n rewrite: true,\n source: `components/content/${config.file}`,\n target,\n },\n ],\n name: config.name,\n postInstall: [\n \"Register it in components.ts:\",\n ' import { defineComponents } from \"blume\";',\n ` import ${config.tag} from \"./${target}\";`,\n \"\",\n ` export default defineComponents({ mdx: { ${config.tag} } });`,\n \"\",\n \"It imports the rest from `blume/*`, so it matches the built-in until you edit it.\",\n ],\n };\n};\n\n/** Every user-facing content component, by `blume add` name → source basename. */\nconst CONTENT_COMPONENTS: {\n name: string;\n description: string;\n file: string;\n tag: string;\n}[] = [\n {\n description: \"Aside for notes, tips, and warnings.\",\n file: \"Callout.astro\",\n name: \"callout\",\n tag: \"Callout\",\n },\n {\n description: \"A linkable card with icon, title, and body.\",\n file: \"Card.astro\",\n name: \"card\",\n tag: \"Card\",\n },\n {\n description: \"A responsive grid of cards.\",\n file: \"CardGroup.astro\",\n name: \"card-group\",\n tag: \"CardGroup\",\n },\n {\n description: \"Tabbed code blocks for multiple languages.\",\n file: \"CodeGroup.astro\",\n name: \"code-group\",\n tag: \"CodeGroup\",\n },\n {\n description: \"A small status/label badge.\",\n file: \"Badge.astro\",\n name: \"badge\",\n tag: \"Badge\",\n },\n {\n description: \"A numbered list of steps.\",\n file: \"Steps.astro\",\n name: \"steps\",\n tag: \"Steps\",\n },\n {\n description: \"A single step within Steps.\",\n file: \"Step.astro\",\n name: \"step\",\n tag: \"Step\",\n },\n {\n description: \"A tabbed content panel.\",\n file: \"Tabs.astro\",\n name: \"tabs\",\n tag: \"Tabs\",\n },\n {\n description: \"A single tab within Tabs.\",\n file: \"Tab.astro\",\n name: \"tab\",\n tag: \"Tab\",\n },\n {\n description: \"A collapsible accordion group.\",\n file: \"Accordion.astro\",\n name: \"accordion\",\n tag: \"Accordion\",\n },\n {\n description: \"A single item within an Accordion.\",\n file: \"AccordionItem.astro\",\n name: \"accordion-item\",\n tag: \"AccordionItem\",\n },\n {\n description: \"A multi-column layout.\",\n file: \"Columns.astro\",\n name: \"columns\",\n tag: \"Columns\",\n },\n {\n description: \"A single column within Columns.\",\n file: \"Column.astro\",\n name: \"column\",\n tag: \"Column\",\n },\n {\n description: \"A bordered frame around an image or embed.\",\n file: \"Frame.astro\",\n name: \"frame\",\n tag: \"Frame\",\n },\n {\n description: \"An inline expand/collapse disclosure.\",\n file: \"Expandable.astro\",\n name: \"expandable\",\n tag: \"Expandable\",\n },\n {\n description: \"A titled content panel.\",\n file: \"Panel.astro\",\n name: \"panel\",\n tag: \"Panel\",\n },\n {\n description: \"A hover tooltip.\",\n file: \"Tooltip.astro\",\n name: \"tooltip\",\n tag: \"Tooltip\",\n },\n {\n description: \"A compact linkable tile.\",\n file: \"Tile.astro\",\n name: \"tile\",\n tag: \"Tile\",\n },\n {\n description: \"A styled prompt / terminal block.\",\n file: \"Prompt.astro\",\n name: \"prompt\",\n tag: \"Prompt\",\n },\n {\n description: \"A responsive, privacy-friendly YouTube embed.\",\n file: \"YouTube.astro\",\n name: \"youtube\",\n tag: \"YouTube\",\n },\n];\n\n/** The built-in, Blume-owned source registry. */\nexport const registry: RegistryItem[] = [\n layoutComponent({\n description: \"The top navigation bar (logo, search, nav links).\",\n file: \"Header.astro\",\n name: \"header\",\n slot: \"Header\",\n }),\n layoutComponent({\n description: \"The sidebar navigation tree.\",\n file: \"NavTree.astro\",\n name: \"sidebar\",\n slot: \"Sidebar\",\n }),\n layoutComponent({\n description: \"The breadcrumb trail shown above page content.\",\n file: \"Breadcrumbs.astro\",\n name: \"breadcrumbs\",\n slot: \"Breadcrumbs\",\n }),\n layoutComponent({\n description: \"The on-this-page table of contents.\",\n file: \"TableOfContents.astro\",\n name: \"table-of-contents\",\n slot: \"TableOfContents\",\n }),\n layoutComponent({\n description: \"The previous/next pagination footer.\",\n file: \"Pagination.astro\",\n name: \"pagination\",\n slot: \"Pagination\",\n }),\n layoutComponent({\n description: 'The \"Was this page helpful?\" feedback rating.',\n file: \"PageFeedback.astro\",\n name: \"feedback\",\n slot: \"Feedback\",\n }),\n ...CONTENT_COMPONENTS.map(contentComponent),\n];\n\nexport const findItem = (name: string): RegistryItem | undefined =>\n registry.find((item) => item.name === name);\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;;;;AAAA;AAuBO,IAAM,aAAa,KAAK,YAAY,GAAG,KAAK;AAOnD,IAAM,kBAAkB,CAAC,WAOL;AAAA,EAClB,MAAM,SAAS,oBAAoB,OAAO;AAAA,EAC1C,OAAO;AAAA,IACL,aAAa,OAAO;AAAA,IACpB,OAAO;AAAA,MACL;AAAA,QACE,SAAS;AAAA,QACT,QAAQ,qBAAqB,OAAO;AAAA,QACpC;AAAA,MACF;AAAA,IACF;AAAA,IACA,MAAM,OAAO;AAA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AAM;AAAA,EACR,CAAC;AAAA,EACD,gBAAgB;AAAA,IACd,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,EACR,CAAC;AAAA,EACD,gBAAgB;AAAA,IACd,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,EACR,CAAC;AAAA,EACD,gBAAgB;AAAA,IACd,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,EACR,CAAC;AAAA,EACD,gBAAgB;AAAA,IACd,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,EACR,CAAC;AAAA,EACD,gBAAgB;AAAA,IACd,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,EACR,CAAC;AAAA,EACD,GAAG,mBAAmB,IAAI,gBAAgB;AAC5C;AAEO,IAAM,WAAW,CAAC,SACvB,SAAS,KAAK,CAAC,SAAS,KAAK,SAAS,IAAI;",
|
|
8
|
+
"debugId": "2BDCE672B82B453C64756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
findItem,
|
|
4
|
+
packageSrc,
|
|
5
|
+
registry
|
|
6
|
+
} from "./chunk-3r94j3tc.js";
|
|
7
|
+
import"./chunk-6kzzpsx8.js";
|
|
8
|
+
import {
|
|
9
|
+
logger
|
|
10
|
+
} from "./chunk-ey89bjj1.js";
|
|
11
|
+
import {
|
|
12
|
+
commandMeta
|
|
13
|
+
} from "./chunk-2aj8ddew.js";
|
|
14
|
+
|
|
15
|
+
// src/cli/commands/add.ts
|
|
16
|
+
import { existsSync } from "node:fs";
|
|
17
|
+
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
18
|
+
import { defineCommand } from "citty";
|
|
19
|
+
import { dirname as dirname2, join } from "pathe";
|
|
20
|
+
|
|
21
|
+
// src/registry/rewrite-imports.ts
|
|
22
|
+
import { dirname, relative, resolve } from "pathe";
|
|
23
|
+
var FROM_IMPORT = /(?<prefix>^[ \t]*(?:import|export)\b[^;]*?\bfrom[ \t]*)(?<quote>["'])(?<spec>\.[^"']*)\k<quote>/gmu;
|
|
24
|
+
var SIDE_EFFECT_IMPORT = /(?<prefix>^[ \t]*import[ \t]+)(?<quote>["'])(?<spec>\.[^"']*)\k<quote>/gmu;
|
|
25
|
+
var rewriteImports = (content, sourceFile, srcRoot) => {
|
|
26
|
+
const rewrite = (match, prefix, quote, spec) => {
|
|
27
|
+
const resolved = resolve(dirname(sourceFile), spec);
|
|
28
|
+
if (resolved === sourceFile) {
|
|
29
|
+
return match;
|
|
30
|
+
}
|
|
31
|
+
const rel = relative(srcRoot, resolved);
|
|
32
|
+
if (rel.startsWith("..")) {
|
|
33
|
+
return match;
|
|
34
|
+
}
|
|
35
|
+
return `${prefix}${quote}blume/${rel}${quote}`;
|
|
36
|
+
};
|
|
37
|
+
return content.replaceAll(FROM_IMPORT, rewrite).replaceAll(SIDE_EFFECT_IMPORT, rewrite);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// src/cli/commands/add.ts
|
|
41
|
+
var addCommand = defineCommand({
|
|
42
|
+
args: {
|
|
43
|
+
force: { description: "Overwrite existing files.", type: "boolean" },
|
|
44
|
+
name: {
|
|
45
|
+
description: "Registry item to install.",
|
|
46
|
+
required: false,
|
|
47
|
+
type: "positional"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
meta: commandMeta.add,
|
|
51
|
+
async run({ args }) {
|
|
52
|
+
const root = process.cwd();
|
|
53
|
+
if (!args.name) {
|
|
54
|
+
logger.info("Available registry items:");
|
|
55
|
+
for (const item2 of registry) {
|
|
56
|
+
process.stdout.write(` ${item2.name} — ${item2.description}
|
|
57
|
+
`);
|
|
58
|
+
}
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const item = findItem(args.name);
|
|
62
|
+
if (!item) {
|
|
63
|
+
logger.error(`Unknown registry item: ${args.name}`);
|
|
64
|
+
logger.info(`Run \`blume add\` to list available items.`);
|
|
65
|
+
process.exit(1);
|
|
66
|
+
}
|
|
67
|
+
const plan = item.files.map((file) => ({
|
|
68
|
+
file,
|
|
69
|
+
skip: existsSync(join(root, file.target)) && !args.force,
|
|
70
|
+
target: join(root, file.target)
|
|
71
|
+
}));
|
|
72
|
+
await Promise.all(plan.filter((entry) => !entry.skip).map(async (entry) => {
|
|
73
|
+
const source = join(packageSrc, entry.file.source);
|
|
74
|
+
const raw = await readFile(source, "utf-8");
|
|
75
|
+
const content = entry.file.rewrite ? rewriteImports(raw, source, packageSrc) : raw;
|
|
76
|
+
await mkdir(dirname2(entry.target), { recursive: true });
|
|
77
|
+
await writeFile(entry.target, content, "utf-8");
|
|
78
|
+
}));
|
|
79
|
+
for (const entry of plan) {
|
|
80
|
+
if (entry.skip) {
|
|
81
|
+
logger.warn(`Skipped existing ${entry.file.target} (use --force to overwrite)`);
|
|
82
|
+
} else {
|
|
83
|
+
logger.success(`Added ${entry.file.target}`);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (item.postInstall.length > 0) {
|
|
87
|
+
process.stdout.write(`
|
|
88
|
+
Next steps:
|
|
89
|
+
`);
|
|
90
|
+
for (const line of item.postInstall) {
|
|
91
|
+
process.stdout.write(` ${line}
|
|
92
|
+
`);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
export {
|
|
98
|
+
addCommand
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
//# debugId=2570752CA48BB3F964756E2164756E21
|
|
102
|
+
//# sourceMappingURL=chunk-4trphnvy.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/cli/commands/add.ts", "../src/registry/rewrite-imports.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { existsSync } from \"node:fs\";\nimport { mkdir, readFile, writeFile } from \"node:fs/promises\";\n\nimport { defineCommand } from \"citty\";\nimport { dirname, join } from \"pathe\";\n\nimport { findItem, packageSrc, registry } from \"../../registry/registry.ts\";\nimport { rewriteImports } from \"../../registry/rewrite-imports.ts\";\nimport { commandMeta } from \"../command-meta.ts\";\nimport { logger } from \"../log.ts\";\n\nexport const addCommand = defineCommand({\n args: {\n force: { description: \"Overwrite existing files.\", type: \"boolean\" },\n name: {\n description: \"Registry item to install.\",\n required: false,\n type: \"positional\",\n },\n },\n meta: commandMeta.add,\n async run({ args }) {\n const root = process.cwd();\n\n if (!args.name) {\n logger.info(\"Available registry items:\");\n for (const item of registry) {\n process.stdout.write(` ${item.name} — ${item.description}\\n`);\n }\n return;\n }\n\n const item = findItem(args.name);\n if (!item) {\n logger.error(`Unknown registry item: ${args.name}`);\n logger.info(`Run \\`blume add\\` to list available items.`);\n process.exit(1);\n }\n\n const plan = item.files.map((file) => ({\n file,\n skip: existsSync(join(root, file.target)) && !args.force,\n target: join(root, file.target),\n }));\n\n await Promise.all(\n plan\n .filter((entry) => !entry.skip)\n .map(async (entry) => {\n const source = join(packageSrc, entry.file.source);\n const raw = await readFile(source, \"utf-8\");\n // Built-in components carry relative imports into the package; rewrite\n // them to `blume/*` so the installed copy resolves them.\n const content = entry.file.rewrite\n ? rewriteImports(raw, source, packageSrc)\n : raw;\n await mkdir(dirname(entry.target), { recursive: true });\n await writeFile(entry.target, content, \"utf-8\");\n })\n );\n\n for (const entry of plan) {\n if (entry.skip) {\n logger.warn(\n `Skipped existing ${entry.file.target} (use --force to overwrite)`\n );\n } else {\n logger.success(`Added ${entry.file.target}`);\n }\n }\n\n if (item.postInstall.length > 0) {\n process.stdout.write(`\\nNext steps:\\n`);\n for (const line of item.postInstall) {\n process.stdout.write(` ${line}\\n`);\n }\n }\n },\n});\n",
|
|
6
|
+
"import { dirname, relative, resolve } from \"pathe\";\n\n// A relative specifier (starting with `.`) in an `import … from \"…\"` or\n// `export … from \"…\"` statement. Anchored to the start of a line (`m` flag) and\n// bounded by `[^;]` so it only matches a real statement — not a `from \"./…\"`\n// that happens to appear inside a string or JSX text — while still allowing a\n// multiline import body between the keyword and `from`.\nconst FROM_IMPORT =\n /(?<prefix>^[ \\t]*(?:import|export)\\b[^;]*?\\bfrom[ \\t]*)(?<quote>[\"'])(?<spec>\\.[^\"']*)\\k<quote>/gmu;\n\n// A side-effect `import \"./…\"` at the start of a line.\nconst SIDE_EFFECT_IMPORT =\n /(?<prefix>^[ \\t]*import[ \\t]+)(?<quote>[\"'])(?<spec>\\.[^\"']*)\\k<quote>/gmu;\n\n/**\n * Rewrite a built-in component's relative imports to `blume/*` package\n * specifiers, so a copy installed by `blume add` resolves the rest of the\n * framework from the package instead of broken relative paths.\n *\n * `sourceFile` is the original file's absolute path and `srcRoot` the package\n * `src` directory; a relative import is resolved against the source, mapped to\n * its path under `src`, and re-emitted as `blume/<that path>`. Two specifiers\n * are left untouched: a self-reference (a component importing itself, e.g. the\n * recursive nav tree) stays relative so the copy recurses into the copy, and\n * anything resolving outside `src` is left as-is.\n */\nexport const rewriteImports = (\n content: string,\n sourceFile: string,\n srcRoot: string\n): string => {\n const rewrite = (\n match: string,\n prefix: string,\n quote: string,\n spec: string\n ): string => {\n const resolved = resolve(dirname(sourceFile), spec);\n if (resolved === sourceFile) {\n return match;\n }\n const rel = relative(srcRoot, resolved);\n if (rel.startsWith(\"..\")) {\n return match;\n }\n return `${prefix}${quote}blume/${rel}${quote}`;\n };\n return content\n .replaceAll(FROM_IMPORT, rewrite)\n .replaceAll(SIDE_EFFECT_IMPORT, rewrite);\n};\n"
|
|
7
|
+
],
|
|
8
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AACA;AAEA;AACA,oBAAS;;;ACJT;AAOA,IAAM,cACJ;AAGF,IAAM,qBACJ;AAcK,IAAM,iBAAiB,CAC5B,SACA,YACA,YACW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,KAAK,MAAM,KAAK,MAAM;AAAA,IAChC,EAAE;AAAA,IAEF,MAAM,QAAQ,IACZ,KACG,OAAO,CAAC,UAAU,CAAC,MAAM,IAAI,EAC7B,IAAI,OAAO,UAAU;AAAA,MACpB,MAAM,SAAS,KAAK,YAAY,MAAM,KAAK,MAAM;AAAA,MACjD,MAAM,MAAM,MAAM,SAAS,QAAQ,OAAO;AAAA,MAG1C,MAAM,UAAU,MAAM,KAAK,UACvB,eAAe,KAAK,QAAQ,UAAU,IACtC;AAAA,MACJ,MAAM,MAAM,SAAQ,MAAM,MAAM,GAAG,EAAE,WAAW,KAAK,CAAC;AAAA,MACtD,MAAM,UAAU,MAAM,QAAQ,SAAS,OAAO;AAAA,KAC/C,CACL;AAAA,IAEA,WAAW,SAAS,MAAM;AAAA,MACxB,IAAI,MAAM,MAAM;AAAA,QACd,OAAO,KACL,oBAAoB,MAAM,KAAK,mCACjC;AAAA,MACF,EAAO;AAAA,QACL,OAAO,QAAQ,SAAS,MAAM,KAAK,QAAQ;AAAA;AAAA,IAE/C;AAAA,IAEA,IAAI,KAAK,YAAY,SAAS,GAAG;AAAA,MAC/B,QAAQ,OAAO,MAAM;AAAA;AAAA,CAAiB;AAAA,MACtC,WAAW,QAAQ,KAAK,aAAa;AAAA,QACnC,QAAQ,OAAO,MAAM,KAAK;AAAA,CAAQ;AAAA,MACpC;AAAA,IACF;AAAA;AAEJ,CAAC;",
|
|
9
|
+
"debugId": "2570752CA48BB3F964756E2164756E21",
|
|
10
|
+
"names": []
|
|
11
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
packageRoot
|
|
4
|
+
} from "./chunk-6kzzpsx8.js";
|
|
5
|
+
|
|
6
|
+
// src/core/version.ts
|
|
7
|
+
import { readFileSync } from "node:fs";
|
|
8
|
+
import { join } from "pathe";
|
|
9
|
+
var cached;
|
|
10
|
+
var getBlumeVersion = () => {
|
|
11
|
+
if (cached === undefined) {
|
|
12
|
+
const pkgPath = join(packageRoot(), "package.json");
|
|
13
|
+
cached = JSON.parse(readFileSync(pkgPath, "utf-8")).version;
|
|
14
|
+
}
|
|
15
|
+
return cached;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { getBlumeVersion };
|
|
19
|
+
|
|
20
|
+
//# debugId=C3D76F992F5A14AE64756E2164756E21
|
|
21
|
+
//# sourceMappingURL=chunk-4xyggvgf.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/core/version.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { readFileSync } from \"node:fs\";\n\nimport { join } from \"pathe\";\n\nimport { packageRoot } from \"./package-root.ts\";\n\nlet cached: string | undefined;\n\n/**\n * The installed Blume package version, read lazily from its `package.json`.\n *\n * Computed on demand (not at module load) so importing the `blume` barrel has no\n * filesystem side effect, and anchored at the package root so it resolves the\n * same whether running from source or the bundled CLI.\n */\nexport const getBlumeVersion = (): string => {\n if (cached === undefined) {\n const pkgPath = join(packageRoot(), \"package.json\");\n // SAFETY: this reads blume's own package.json, which always declares a\n // `version` (publishing requires it).\n cached = (JSON.parse(readFileSync(pkgPath, \"utf-8\")) as { version: string })\n .version;\n }\n return cached;\n};\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;;;;AAAA;AAEA;AAIA,IAAI;AASG,IAAM,kBAAkB,MAAc;AAAA,EAC3C,IAAI,WAAW,WAAW;AAAA,IACxB,MAAM,UAAU,KAAK,YAAY,GAAG,cAAc;AAAA,IAGlD,SAAU,KAAK,MAAM,aAAa,SAAS,OAAO,CAAC,EAChD;AAAA,EACL;AAAA,EACA,OAAO;AAAA;",
|
|
8
|
+
"debugId": "C3D76F992F5A14AE64756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|