create-shibumi 0.2.8 → 0.3.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.
Files changed (52) hide show
  1. package/README.md +17 -4
  2. package/package.json +2 -2
  3. package/scripts/ship.lock.json +2 -2
  4. package/src/adopt.ts +250 -0
  5. package/src/args.ts +32 -6
  6. package/src/cli.ts +230 -41
  7. package/src/templates/blog/agents.md +4 -1
  8. package/src/templates/blog/bun.lock +1 -0
  9. package/src/templates/blog/gitignore +2 -0
  10. package/src/templates/blog/package.json +4 -2
  11. package/src/templates/blog/public/favicon.svg +1 -0
  12. package/src/templates/blog/public/style.css +77 -4
  13. package/src/templates/blog/src/components/BaseHead.astro +4 -0
  14. package/src/templates/blog/src/content/blog/one-vps-is-plenty.md +7 -5
  15. package/src/templates/blog/src/content/blog/own-your-source.md +9 -5
  16. package/src/templates/blog/src/content/blog/writing-for-agents.md +7 -5
  17. package/src/templates/blog/src/content.config.ts +3 -0
  18. package/src/templates/blog/src/layouts/Base.astro +12 -1
  19. package/src/templates/blog/src/pages/index.astro +5 -2
  20. package/src/templates/blog/src/pages/llms.txt.ts +1 -1
  21. package/src/templates/blog/src/pages/posts/[id].astro +2 -1
  22. package/src/templates/blog/src/pages/posts/[id].md.ts +1 -1
  23. package/src/templates/blog/src/pages/rss.xml.ts +1 -1
  24. package/src/templates/full-stack/agents.md +1 -0
  25. package/src/templates/full-stack/package.json +1 -0
  26. package/src/templates/full-stack/public/favicon.svg +1 -0
  27. package/src/templates/full-stack/public/style.css +5 -6
  28. package/src/templates/full-stack/src/app.ts +5 -3
  29. package/src/templates/ship.ts +551 -153
  30. package/src/templates/static/agents.md +1 -0
  31. package/src/templates/{web → static}/bun.lock +1 -21
  32. package/src/templates/static/gitignore +2 -0
  33. package/src/templates/static/package.json +6 -2
  34. package/src/templates/static/public/favicon.svg +1 -0
  35. package/src/templates/static/public/index.html +11 -3
  36. package/src/templates/static/public/style.css +66 -20
  37. package/src/templates/web/.dockerignore +0 -12
  38. package/src/templates/web/Dockerfile +0 -24
  39. package/src/templates/web/README.md +0 -10
  40. package/src/templates/web/agents.md +0 -54
  41. package/src/templates/web/compose.yaml +0 -17
  42. package/src/templates/web/gitignore +0 -5
  43. package/src/templates/web/package.json +0 -34
  44. package/src/templates/web/public/app.js +0 -11
  45. package/src/templates/web/public/style.css +0 -150
  46. package/src/templates/web/public/vendor/alpine-csp-3.16.2.min.js +0 -23
  47. package/src/templates/web/public/vendor/shibumi.css +0 -422
  48. package/src/templates/web/src/app.ts +0 -106
  49. package/src/templates/web/src/env.ts +0 -21
  50. package/src/templates/web/src/server.ts +0 -23
  51. package/src/templates/web/test/app.test.ts +0 -145
  52. package/src/templates/web/tsconfig.json +0 -13
@@ -4,7 +4,7 @@ import { getCollection, getEntry } from "astro:content";
4
4
  import type { APIRoute } from "astro";
5
5
 
6
6
  export async function getStaticPaths() {
7
- return (await getCollection("blog")).map((post) => ({ params: { id: post.id } }));
7
+ return (await getCollection("blog", ({ data }) => !data.draft)).map((post) => ({ params: { id: post.id } }));
8
8
  }
9
9
 
10
10
  export const GET: APIRoute = async ({ params }) => {
@@ -4,7 +4,7 @@ import { getCollection } from "astro:content";
4
4
  import { SITE } from "../site";
5
5
 
6
6
  export const GET: APIRoute = async (context) => {
7
- const posts = (await getCollection("blog")).sort(
7
+ const posts = (await getCollection("blog", ({ data }) => !data.draft)).sort(
8
8
  (a, b) => b.data.date.valueOf() - a.data.date.valueOf()
9
9
  );
10
10
  return rss({
@@ -15,6 +15,7 @@ bun db:migrate # backup (when needed), then apply pending migrations
15
15
  bun db:backup # manual VACUUM INTO backup with sha256 sidecar
16
16
  bun db:restore <backup> # offline restore; stop the app first
17
17
  bun ship # build image, upload, deploy via shibumi-server
18
+ bun ship:webhook # opt in to push-to-deploy; --off reverses it
18
19
  bun run shibumi add <name> # install an extension (auth, email); --dry-run previews
19
20
  ```
20
21
 
@@ -15,6 +15,7 @@
15
15
  "ship:update": "bun scripts/ship.ts --update",
16
16
  "ship:status": "bun scripts/ship.ts --status",
17
17
  "ship:logs": "bun scripts/ship.ts --logs",
18
+ "ship:webhook": "bun scripts/ship.ts --webhook",
18
19
  "ship:env": "bun scripts/ship.ts --env",
19
20
  "shibumi": "bun scripts/shibumi.ts",
20
21
  "shi": "bun scripts/shibumi.ts",
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><style>text{fill:#e95f19;font-family:"Hiragino Sans","Noto Sans JP",sans-serif}@media (prefers-color-scheme:dark){text{fill:#ff8648}}</style><text x="50" y="55" font-size="62" text-anchor="middle" dominant-baseline="central">渋</text></svg>
@@ -89,7 +89,7 @@ body {
89
89
  border-top: 1px solid var(--line);
90
90
  }
91
91
 
92
- main .endpoints a {
92
+ main .endpoints a:not(.btn):not(.button) {
93
93
  display: flex;
94
94
  align-items: baseline;
95
95
  justify-content: space-between;
@@ -101,13 +101,12 @@ main .endpoints a {
101
101
  transition: background 160ms ease;
102
102
  }
103
103
 
104
- main .endpoints a:hover,
105
- main .endpoints a:focus-visible {
104
+ main .endpoints a:not(.btn):not(.button):hover,
105
+ main .endpoints a:not(.btn):not(.button):focus-visible {
106
106
  background: var(--faint);
107
107
  }
108
108
 
109
- .endpoint-path {
110
- font-family: var(--font-mono);
109
+ main .endpoints code {
111
110
  font-size: var(--text-sm);
112
111
  }
113
112
  /* Inline code as rounded chips on the faint layer. */
@@ -120,7 +119,7 @@ main .endpoints a:focus-visible {
120
119
  }
121
120
 
122
121
 
123
- main .endpoints a:hover .endpoint-path {
122
+ main .endpoints a:hover code {
124
123
  color: var(--accent);
125
124
  }
126
125
 
@@ -107,6 +107,8 @@ const page = `<!doctype html>
107
107
  <meta charset="utf-8" />
108
108
  <meta name="viewport" content="width=device-width, initial-scale=1" />
109
109
  <title>Full Stack app · shibumi</title>
110
+ <link rel="icon" type="image/svg+xml" href="/public/favicon.svg" />
111
+ <meta name="generator" content="create-shibumi (shibumistack.dev)" />
110
112
  <link rel="stylesheet" href="/public/vendor/shibumi.css" />
111
113
  <link rel="stylesheet" href="/public/style.css" />
112
114
  <!-- app.js must load before Alpine so the alpine:init listener exists
@@ -125,9 +127,9 @@ const page = `<!doctype html>
125
127
  <span class="demo-hint">stored in SQLite; reloads and deploys keep it</span>
126
128
  </section>
127
129
  <ul class="endpoints">
128
- <li><a href="/api/hello?name=you"><span class="endpoint-path">GET /api/hello</span><span>query validated with Zod</span></a></li>
129
- <li><a href="/api/notes"><span class="endpoint-path">GET /api/notes</span><span>Drizzle read from SQLite on the data volume</span></a></li>
130
- <li><a href="/healthz"><span class="endpoint-path">GET /healthz</span><span>the check every deploy waits for</span></a></li>
130
+ <li><a href="/api/hello?name=you"><code>GET /api/hello</code><span>query validated with Zod</span></a></li>
131
+ <li><a href="/api/notes"><code>GET /api/notes</code><span>Drizzle read from SQLite on the data volume</span></a></li>
132
+ <li><a href="/healthz"><code>GET /healthz</code><span>the check every deploy waits for</span></a></li>
131
133
  </ul>
132
134
  <footer class="colophon">
133
135
  <p>This page lives in <code>src/app.ts</code>. House rules for coding agents are in <code>agents.md</code>. Add features with <code>bun shi add auth</code>.</p>