create-shibumi 0.3.2 → 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.
Files changed (38) hide show
  1. package/README.md +1 -1
  2. package/package.json +3 -3
  3. package/scripts/shibumi.lock.json +0 -1
  4. package/scripts/ship.lock.json +3 -3
  5. package/src/create.ts +9 -0
  6. package/src/templates/blog/README.md +4 -3
  7. package/src/templates/blog/agents.md +22 -11
  8. package/src/templates/blog/bun.lock +7 -753
  9. package/src/templates/blog/gitignore +1 -2
  10. package/src/templates/blog/package.json +8 -9
  11. package/src/templates/blog/scripts/build.ts +48 -0
  12. package/src/templates/blog/scripts/preview.ts +42 -0
  13. package/src/templates/blog/serve.ts +11 -0
  14. package/src/templates/blog/src/app.ts +418 -0
  15. package/src/templates/blog/src/layout.html +25 -0
  16. package/src/templates/blog/src/pages/404.html +6 -0
  17. package/src/templates/blog/src/pages/index.html +11 -0
  18. package/src/templates/blog/src/pages/post.html +15 -0
  19. package/src/templates/blog/src/site.ts +7 -2
  20. package/src/templates/blog/tsconfig.json +18 -4
  21. package/src/templates/full-stack/Dockerfile +1 -1
  22. package/src/templates/full-stack/agents.md +1 -1
  23. package/src/templates/full-stack/compose.yaml +5 -2
  24. package/src/templates/full-stack/public/vendor/shibumi.css +15 -3
  25. package/src/templates/full-stack/src/env.ts +1 -1
  26. package/src/templates/ship.ts +50 -15
  27. package/src/templates/static/scripts/preview.ts +1 -1
  28. package/src/templates/blog/astro.config.mjs +0 -13
  29. package/src/templates/blog/src/components/BaseHead.astro +0 -41
  30. package/src/templates/blog/src/content.config.ts +0 -20
  31. package/src/templates/blog/src/layouts/Base.astro +0 -37
  32. package/src/templates/blog/src/pages/404.astro +0 -11
  33. package/src/templates/blog/src/pages/index.astro +0 -33
  34. package/src/templates/blog/src/pages/llms.txt.ts +0 -29
  35. package/src/templates/blog/src/pages/posts/[id].astro +0 -32
  36. package/src/templates/blog/src/pages/posts/[id].md.ts +0 -18
  37. package/src/templates/blog/src/pages/robots.txt.ts +0 -6
  38. 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**: Astro with posts, RSS, sitemap, SEO meta, and llms.txt.
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
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "create-shibumi",
3
- "version": "0.3.2",
3
+ "version": "0.3.6",
4
4
  "description": "Scaffold a Shibumi Stack project: Bun, Hono, Zod, Drizzle, SQLite, Alpine",
5
5
  "type": "module",
6
6
  "bin": {
7
- "create-shibumi": "./src/cli.ts"
7
+ "create-shibumi": "src/cli.ts"
8
8
  },
9
9
  "files": [
10
10
  "src/cli.ts",
@@ -46,7 +46,7 @@
46
46
  "license": "MIT",
47
47
  "repository": {
48
48
  "type": "git",
49
- "url": "https://github.com/shibumistack/create-shibumi"
49
+ "url": "git+https://github.com/shibumistack/create-shibumi.git"
50
50
  },
51
51
  "homepage": "https://shibumistack.dev",
52
52
  "dependencies": {
@@ -1,5 +1,4 @@
1
1
  {
2
- "version": "0.2.7",
3
2
  "extensions": [
4
3
  {
5
4
  "name": "admin",
@@ -1,4 +1,4 @@
1
1
  {
2
- "url": "https://shibumistack.dev/ship/v48.ts",
3
- "sha256": "425a8ca3d0b9b8b27660906ea38ec9acb3441a0e0fcf0bd3be191a8e3bd5bea6"
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
- An Astro blog 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.
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 `site` in `astro.config.mjs`, then `bun ship:setup` and `bun ship` to deploy. `agents.md` has the house rules.
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
- Astro blog generated by create-shibumi. Static output, shibumi design tokens, served as HTML for people and markdown for agents.
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 # astro dev server
9
- bun run build # astro build to dist/
10
- bun run check # astro check (types + templates)
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 (`![alt](/photo.jpg)`).
29
+
16
30
  ## Routes and templates
17
31
 
18
- - Posts are markdown files in `src/content/blog/`; the schema in `src/content.config.ts` requires title (max 60), description (50 to 160 characters, drives meta/RSS/llms.txt), date, optional ogImage, and an optional `draft` flag (default false).
19
- - `draft: true` keeps a post out of everything: no page, no listing, no RSS, no llms.txt, no markdown alternate. Publish by removing the flag and running `bun ship`.
20
- - Images: put files in `src/assets/` and reference them relatively from the markdown (`![alt](../../assets/photo.jpg)`); Astro optimizes them at build. Files in `public/` are served verbatim by URL.
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 `site` in `astro.config.mjs` to the real domain before the first `bun ship`; sitemap, RSS, canonicals, and og:url derive from it. `bun run check` and `bun run build` must pass. Keep `build.format: "directory"` so the static server routes clean URLs.
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.