create-shibumi 0.3.4 → 0.3.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/README.md +1 -1
- package/package.json +1 -1
- package/scripts/ship.lock.json +3 -3
- package/src/create.ts +9 -0
- package/src/templates/blog/README.md +4 -3
- package/src/templates/blog/agents.md +22 -11
- package/src/templates/blog/bun.lock +7 -753
- package/src/templates/blog/gitignore +1 -2
- package/src/templates/blog/package.json +8 -9
- package/src/templates/blog/scripts/build.ts +48 -0
- package/src/templates/blog/scripts/preview.ts +42 -0
- package/src/templates/blog/serve.ts +11 -0
- package/src/templates/blog/src/app.ts +418 -0
- package/src/templates/blog/src/layout.html +25 -0
- package/src/templates/blog/src/pages/404.html +6 -0
- package/src/templates/blog/src/pages/index.html +11 -0
- package/src/templates/blog/src/pages/post.html +15 -0
- package/src/templates/blog/src/site.ts +7 -2
- package/src/templates/blog/tsconfig.json +18 -4
- package/src/templates/full-stack/Dockerfile +1 -1
- package/src/templates/full-stack/agents.md +1 -1
- package/src/templates/full-stack/compose.yaml +5 -2
- package/src/templates/full-stack/src/env.ts +1 -1
- package/src/templates/ship.ts +50 -15
- package/src/templates/static/scripts/preview.ts +1 -1
- package/src/templates/blog/astro.config.mjs +0 -13
- package/src/templates/blog/src/components/BaseHead.astro +0 -41
- package/src/templates/blog/src/content.config.ts +0 -20
- package/src/templates/blog/src/layouts/Base.astro +0 -37
- package/src/templates/blog/src/pages/404.astro +0 -11
- package/src/templates/blog/src/pages/index.astro +0 -33
- package/src/templates/blog/src/pages/llms.txt.ts +0 -29
- package/src/templates/blog/src/pages/posts/[id].astro +0 -32
- package/src/templates/blog/src/pages/posts/[id].md.ts +0 -18
- package/src/templates/blog/src/pages/robots.txt.ts +0 -6
- package/src/templates/blog/src/pages/rss.xml.ts +0 -21
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ bun create shibumi@latest .
|
|
|
17
17
|
## Three starting points
|
|
18
18
|
|
|
19
19
|
1. **Bun full-stack app**: Hono, HTML, CSS, Alpine, Zod, tests, a health endpoint, and SQLite through Drizzle with migrations, persistent data, backup, and restore.
|
|
20
|
-
2. **Blog**:
|
|
20
|
+
2. **Blog**: the shibumistack.dev engine — a Bun + Hono markdown renderer with posts, RSS, sitemap, SEO meta, and llms.txt.
|
|
21
21
|
3. **Static site**: publish a verified build directory such as `./dist`, `public`, `build`, or `out` from any framework.
|
|
22
22
|
|
|
23
23
|
All three deploy to a Linux VPS or homelab through [shibumi-server](https://server.shibumistack.dev). Other providers can wait until their generated projects pass the same artifact and deployment tests.
|
package/package.json
CHANGED
package/scripts/ship.lock.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
"url": "https://shibumistack.dev/ship/
|
|
3
|
-
"sha256": "
|
|
4
|
-
}
|
|
2
|
+
"url": "https://shibumistack.dev/ship/v51.ts",
|
|
3
|
+
"sha256": "73f45cbea9a8b7b1c71b80921728d4e700859e8f85cb4fcf1885f0e370fafe51"
|
|
4
|
+
}
|
package/src/create.ts
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
writeFileSync,
|
|
10
10
|
} from "fs";
|
|
11
11
|
import { dirname, join } from "path";
|
|
12
|
+
import packageJson from "../package.json";
|
|
12
13
|
import { validateName, type TemplateId } from "./args";
|
|
13
14
|
|
|
14
15
|
export interface CreateOptions {
|
|
@@ -139,6 +140,14 @@ export async function createProject(
|
|
|
139
140
|
// tmp was created exclusively by mkdtemp above and is empty.
|
|
140
141
|
cpSync(templateSrc, tmp, { recursive: true });
|
|
141
142
|
|
|
143
|
+
// The blog template's generator meta records which create-shibumi
|
|
144
|
+
// release scaffolded the project. Templates are static files, so the
|
|
145
|
+
// version is substituted here rather than evaluated at render time.
|
|
146
|
+
const generatorLayout = join(tmp, "src", "layout.html");
|
|
147
|
+
if (existsSync(generatorLayout)) {
|
|
148
|
+
writeFileSync(generatorLayout, readFileSync(generatorLayout, "utf8").replaceAll("{{generator-version}}", packageJson.version));
|
|
149
|
+
}
|
|
150
|
+
|
|
142
151
|
// npm pack always strips .gitignore files, so templates store the file
|
|
143
152
|
// as "gitignore" and it is renamed into place here.
|
|
144
153
|
const packSafeIgnore = join(tmp, "gitignore");
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
# Shibumi blog
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A blog on the same engine as shibumistack.dev: a small Bun + Hono renderer with the boring parts done — RSS, sitemap, OG and SEO meta from a schema your posts can't skip, an `llms.txt`, and a markdown alternate of every post for readers who curl. No framework dependency; posts are markdown in `src/content/blog/` rendered by Bun's markdown engine.
|
|
4
4
|
|
|
5
5
|
```sh
|
|
6
6
|
bun install
|
|
7
|
-
bun dev
|
|
7
|
+
bun dev # live server on http://localhost:9001
|
|
8
|
+
bun build # pre-render dist/
|
|
8
9
|
```
|
|
9
10
|
|
|
10
|
-
Write posts in `src/content/blog/`. Set `
|
|
11
|
+
Write posts in `src/content/blog/`. Set `url` in `src/site.ts`, then `bun ship:setup` and `bun ship` to deploy. `agents.md` has the house rules.
|
|
@@ -1,26 +1,37 @@
|
|
|
1
1
|
# Agent Notes
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Blog generated by create-shibumi on the shibumistack.dev engine: a Bun + Hono renderer that pre-renders to static files. Built as HTML for people and markdown for agents.
|
|
4
4
|
|
|
5
5
|
## Commands
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
|
-
bun dev #
|
|
9
|
-
bun run build #
|
|
10
|
-
bun run
|
|
8
|
+
bun dev # live render on http://localhost:9001 (PORT/SHIBUMI_PORT to change)
|
|
9
|
+
bun run build # pre-render dist/ (same app, one pass)
|
|
10
|
+
bun run preview # serve dist/ locally
|
|
11
|
+
bun run check # tsc --noEmit
|
|
11
12
|
bun ship:setup # configure the deploy target (preconfigured: static, dist/, build script)
|
|
12
13
|
bun ship # verify dist/, build the static image, upload, deploy
|
|
13
14
|
bun ship:webhook # opt in to push-to-deploy; --off reverses it
|
|
14
15
|
```
|
|
15
16
|
|
|
17
|
+
## Engine
|
|
18
|
+
|
|
19
|
+
- `src/app.ts` is a Hono app. `serve.ts` serves it live; `scripts/build.ts` pre-renders the same routes to `dist/` at build time. Nothing runs a server in production — ship packages the static output.
|
|
20
|
+
- `src/layout.html` is the frame: `{{tokens}}` are escaped values, `<!-- insert:name -->` markers are filled by the app, and an unresolved token or insert fails the build loudly.
|
|
21
|
+
- Markdown is rendered by Bun's built-in engine (`Bun.markdown.render`) with a safe renderer: raw HTML is dropped, links must be http(s)/mailto/tel/relative/fragment, images must be https or local, and code blocks get classed spans. Frontmatter is parsed with `Bun.YAML`.
|
|
22
|
+
|
|
23
|
+
## Posts
|
|
24
|
+
|
|
25
|
+
- Posts are markdown files in `src/content/blog/` with YAML frontmatter: `title` (1 to 60 characters), `description` (50 to 160 characters; drives meta, RSS, and llms.txt), `date`, optional `ogImage` and `ogImageAlt` (alt text for the image, also used for `og:image:alt`/`twitter:image:alt`), and an optional `draft` flag (default false).
|
|
26
|
+
- `draft: true` keeps a post out of everything: no page, no listing, no RSS, no llms.txt, no sitemap, no markdown alternate. Publish by removing the flag and running `bun ship`.
|
|
27
|
+
- An invalid post (missing or out-of-range frontmatter, unsafe file name) fails `bun build` and `bun dev` with a clear message; a bad post never ships silently.
|
|
28
|
+
- Files in `public/` are served verbatim by URL. Reference them from markdown as absolute paths (``).
|
|
29
|
+
|
|
16
30
|
## Routes and templates
|
|
17
31
|
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
- `src/pages/index.astro` lists posts; `src/pages/posts/[id].astro` renders one; `src/layouts/Base.astro` and `src/components/BaseHead.astro` own the frame and every meta tag.
|
|
22
|
-
- Generated endpoints: `/rss.xml`, `/llms.txt`, `/robots.txt`, and a markdown alternate for every post at `/posts/<id>.md`. All derive from the content collection; never hand-edit their output.
|
|
23
|
-
- Site identity lives in `src/site.ts`. Design lives in `public/style.css` (one file, shibumi tokens, semantic selectors).
|
|
32
|
+
- `/` lists posts; `/posts/<id>` renders one. Markup lives in `src/pages/index.html` and `src/pages/post.html`, styled by `public/style.css` (one file, shibumi tokens, semantic selectors).
|
|
33
|
+
- Generated endpoints: `/rss.xml`, `/llms.txt`, `/robots.txt`, `/sitemap.xml`, and a markdown alternate for every post at `/posts/<id>.md`. All derive from the content collection; never hand-edit their output.
|
|
34
|
+
- Site identity lives in `src/site.ts`, including `url`; set it to the real domain before the first ship — canonicals, og:url, RSS, and the sitemap derive from it.
|
|
24
35
|
|
|
25
36
|
## Trust boundaries and validation
|
|
26
37
|
|
|
@@ -36,4 +47,4 @@ None.
|
|
|
36
47
|
|
|
37
48
|
## Checks required before commit
|
|
38
49
|
|
|
39
|
-
Set `
|
|
50
|
+
Set `url` in `src/site.ts` to the real domain before the first `bun ship`. `bun run check` and `bun run build` must pass; the build fails on any unresolved template token, unvalidated frontmatter, or unsafe file name.
|