spacefn-docs 0.0.0-stage → 0.11.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/LICENSE +200 -0
- package/README.md +15 -2
- package/assets/reader.css +1131 -0
- package/assets/reader.js +324 -0
- package/content/1-getting-started.md +107 -0
- package/content/2-conventions.md +138 -0
- package/content/3-best-practices.md +68 -0
- package/content/4-folders/1-app/1-entry.md +48 -0
- package/content/4-folders/1-app/2-routes.md +92 -0
- package/content/4-folders/1-app/3-db.md +81 -0
- package/content/4-folders/1-app/4-queues.md +46 -0
- package/content/4-folders/1-app/5-crons.md +30 -0
- package/content/4-folders/1-app/6-assets.md +53 -0
- package/content/4-folders/1-app/7-durable-objects.md +60 -0
- package/content/4-folders/1-app/8-workflows.md +46 -0
- package/content/4-folders/1-app/index.md +43 -0
- package/content/4-folders/2-modules.md +71 -0
- package/content/4-folders/3-lib.md +60 -0
- package/content/4-folders/4-public.md +24 -0
- package/content/4-folders/5-docs.md +23 -0
- package/content/4-folders/6-configs.md +57 -0
- package/content/4-folders/7-space.md +34 -0
- package/content/4-folders/8-env.md +34 -0
- package/content/4-folders/9-package-json.md +37 -0
- package/content/4-folders/index.md +50 -0
- package/content/5-deployment/1-cloudflare.md +56 -0
- package/content/5-deployment/2-bun.md +68 -0
- package/content/5-deployment/3-infrastructure.md +67 -0
- package/content/5-deployment/4-ci-cd.md +131 -0
- package/content/5-deployment/index.md +48 -0
- package/content/6-guides/1-entry.md +113 -0
- package/content/6-guides/2-routes.md +162 -0
- package/content/6-guides/3-pages.md +148 -0
- package/content/6-guides/4-frontend.md +232 -0
- package/content/6-guides/5-database.md +178 -0
- package/content/6-guides/6-services.md +125 -0
- package/content/6-guides/7-jobs.md +61 -0
- package/content/6-guides/8-auth.md +111 -0
- package/content/6-guides/9-testing.md +70 -0
- package/content/6-guides/index.md +21 -0
- package/content/7-reference/1-config.md +67 -0
- package/content/7-reference/2-cli.md +27 -0
- package/content/7-reference/3-writing-docs.md +206 -0
- package/content/7-reference/index.md +15 -0
- package/content/index.md +49 -0
- package/content/logo.svg +12 -0
- package/dist/index.d.mts +72 -0
- package/dist/index.mjs +713 -0
- package/examples/README.md +18 -0
- package/examples/datastar/.env.example +2 -0
- package/examples/datastar/README.md +17 -0
- package/examples/datastar/app/assets/main.ts +4 -0
- package/examples/datastar/app/assets/site.css +3 -0
- package/examples/datastar/app/db/main/config.json +5 -0
- package/examples/datastar/app/db/main/migrations/0001_votes.sql +8 -0
- package/examples/datastar/app/db/main/queries/add-vote.sql +3 -0
- package/examples/datastar/app/db/main/queries/tally.sql +1 -0
- package/examples/datastar/app/entry.ts +28 -0
- package/examples/datastar/app/routes/_middleware.ts +4 -0
- package/examples/datastar/app/routes/health.ts +7 -0
- package/examples/datastar/app/routes/index.ts +43 -0
- package/examples/datastar/configs/env.ts +6 -0
- package/examples/datastar/configs/infra.ts +85 -0
- package/examples/datastar/configs/tsconfig.json +15 -0
- package/examples/datastar/configs/vite.ts +4 -0
- package/examples/datastar/configs/vitest.ts +9 -0
- package/examples/datastar/lib/types/rocket.d.ts +30 -0
- package/examples/datastar/lib/ui/base.css +17 -0
- package/examples/datastar/lib/ui/layout.ts +27 -0
- package/examples/datastar/modules/poll/client/poll-meter.ts +39 -0
- package/examples/datastar/modules/poll/poll.css +13 -0
- package/examples/datastar/modules/poll/poll.test.ts +48 -0
- package/examples/datastar/modules/poll/poll.ts +62 -0
- package/examples/datastar/modules/poll/views.ts +52 -0
- package/examples/datastar/package.json +33 -0
- package/examples/datastar/tsconfig.json +4 -0
- package/examples/lightningcss/.env.example +1 -0
- package/examples/lightningcss/README.md +15 -0
- package/examples/lightningcss/app/assets/site.css +3 -0
- package/examples/lightningcss/app/entry.ts +28 -0
- package/examples/lightningcss/app/routes/_middleware.ts +4 -0
- package/examples/lightningcss/app/routes/health.ts +7 -0
- package/examples/lightningcss/app/routes/index.ts +12 -0
- package/examples/lightningcss/configs/Dockerfile +26 -0
- package/examples/lightningcss/configs/Dockerfile.dockerignore +9 -0
- package/examples/lightningcss/configs/env.ts +4 -0
- package/examples/lightningcss/configs/infra.ts +55 -0
- package/examples/lightningcss/configs/tsconfig.json +15 -0
- package/examples/lightningcss/configs/vite.ts +19 -0
- package/examples/lightningcss/configs/vitest.ts +9 -0
- package/examples/lightningcss/lib/ui/layout.ts +17 -0
- package/examples/lightningcss/lib/ui/tokens.css +23 -0
- package/examples/lightningcss/modules/releases/releases.css +20 -0
- package/examples/lightningcss/modules/releases/releases.test.ts +18 -0
- package/examples/lightningcss/modules/releases/releases.ts +21 -0
- package/examples/lightningcss/modules/releases/views.ts +25 -0
- package/examples/lightningcss/package.json +33 -0
- package/examples/lightningcss/tsconfig.json +4 -0
- package/examples/mini-shopify/.env.example +6 -0
- package/examples/mini-shopify/README.md +19 -0
- package/examples/mini-shopify/app/assets/site.css +2 -0
- package/examples/mini-shopify/app/db/platform/config.json +5 -0
- package/examples/mini-shopify/app/db/platform/migrations/0001_shops.sql +10 -0
- package/examples/mini-shopify/app/db/platform/queries/add-shop.sql +4 -0
- package/examples/mini-shopify/app/db/platform/queries/find-shop.sql +3 -0
- package/examples/mini-shopify/app/db/platform/queries/list-shops.sql +1 -0
- package/examples/mini-shopify/app/db/shop/config.json +6 -0
- package/examples/mini-shopify/app/db/shop/migrations/0001_products.sql +11 -0
- package/examples/mini-shopify/app/db/shop/queries/add-product.sql +4 -0
- package/examples/mini-shopify/app/db/shop/queries/list-products.sql +1 -0
- package/examples/mini-shopify/app/db/shop/queries/sell-product.sql +2 -0
- package/examples/mini-shopify/app/entry.ts +25 -0
- package/examples/mini-shopify/app/routes/_middleware.ts +4 -0
- package/examples/mini-shopify/app/routes/health.ts +7 -0
- package/examples/mini-shopify/app/routes/index.ts +26 -0
- package/examples/mini-shopify/app/routes/s/[shop]/_middleware.ts +6 -0
- package/examples/mini-shopify/app/routes/s/[shop]/index.ts +32 -0
- package/examples/mini-shopify/configs/Dockerfile +26 -0
- package/examples/mini-shopify/configs/Dockerfile.dockerignore +9 -0
- package/examples/mini-shopify/configs/env.ts +14 -0
- package/examples/mini-shopify/configs/infra.ts +55 -0
- package/examples/mini-shopify/configs/tsconfig.json +15 -0
- package/examples/mini-shopify/configs/vite.ts +4 -0
- package/examples/mini-shopify/configs/vitest.ts +9 -0
- package/examples/mini-shopify/lib/ui/base.css +19 -0
- package/examples/mini-shopify/lib/ui/layout.ts +17 -0
- package/examples/mini-shopify/modules/catalog/catalog.ts +31 -0
- package/examples/mini-shopify/modules/catalog/views.ts +39 -0
- package/examples/mini-shopify/modules/shops/host.test.ts +38 -0
- package/examples/mini-shopify/modules/shops/host.ts +73 -0
- package/examples/mini-shopify/modules/shops/shops.test.ts +63 -0
- package/examples/mini-shopify/modules/shops/shops.ts +64 -0
- package/examples/mini-shopify/modules/shops/views.ts +28 -0
- package/examples/mini-shopify/package.json +35 -0
- package/examples/mini-shopify/tsconfig.json +4 -0
- package/examples/react/.env.example +2 -0
- package/examples/react/README.md +18 -0
- package/examples/react/app/assets/site.css +3 -0
- package/examples/react/app/entry.ts +28 -0
- package/examples/react/app/routes/_middleware.ts +4 -0
- package/examples/react/app/routes/about.ts +10 -0
- package/examples/react/app/routes/health.ts +7 -0
- package/examples/react/app/routes/index.ts +12 -0
- package/examples/react/configs/Dockerfile +26 -0
- package/examples/react/configs/Dockerfile.dockerignore +9 -0
- package/examples/react/configs/env.ts +6 -0
- package/examples/react/configs/infra.ts +55 -0
- package/examples/react/configs/tsconfig.json +16 -0
- package/examples/react/configs/vite.ts +7 -0
- package/examples/react/configs/vitest.ts +9 -0
- package/examples/react/lib/ui/base.css +12 -0
- package/examples/react/lib/ui/layout.ts +18 -0
- package/examples/react/modules/about/views.ts +8 -0
- package/examples/react/modules/shop/products.ts +18 -0
- package/examples/react/modules/shop/shop.css +13 -0
- package/examples/react/modules/shop/shop.test.ts +28 -0
- package/examples/react/modules/shop/shop.ts +13 -0
- package/examples/react/modules/shop/ui/Cart.island.tsx +31 -0
- package/examples/react/modules/shop/views.ts +16 -0
- package/examples/react/package.json +38 -0
- package/examples/react/tsconfig.json +4 -0
- package/examples/services-bun/README.md +10 -0
- package/examples/services-bun/app/assets/main.ts +4 -0
- package/examples/services-bun/app/assets/style.css +1 -0
- package/examples/services-bun/app/crons/nightly.ts +5 -0
- package/examples/services-bun/app/entry.ts +9 -0
- package/examples/services-bun/app/queues/jobs.ts +5 -0
- package/examples/services-bun/app/routes/index.ts +10 -0
- package/examples/services-bun/app/routes/runtime.ts +5 -0
- package/examples/services-bun/app/routes/send.ts +8 -0
- package/examples/services-bun/app/routes/version.ts +5 -0
- package/examples/services-bun/configs/Dockerfile +10 -0
- package/examples/services-bun/configs/Dockerfile.dockerignore +4 -0
- package/examples/services-bun/configs/infra.ts +28 -0
- package/examples/services-bun/configs/tsconfig.json +15 -0
- package/examples/services-bun/configs/vite.ts +4 -0
- package/examples/services-bun/lib/ui/base.css +3 -0
- package/examples/services-bun/lib/ui/layout.ts +13 -0
- package/examples/services-bun/modules/status/client/ready.ts +4 -0
- package/examples/services-bun/modules/status/status.ts +20 -0
- package/examples/services-bun/modules/status/views.ts +4 -0
- package/examples/services-bun/package.json +30 -0
- package/examples/services-bun/public/robots.txt +1 -0
- package/examples/services-bun/tsconfig.json +4 -0
- package/examples/services-cloudflare/README.md +9 -0
- package/examples/services-cloudflare/app/assets/main.ts +4 -0
- package/examples/services-cloudflare/app/crons/nightly.ts +5 -0
- package/examples/services-cloudflare/app/db/main/config.json +4 -0
- package/examples/services-cloudflare/app/db/main/migrations/0001_notes.sql +2 -0
- package/examples/services-cloudflare/app/db/main/queries/add-note.sql +1 -0
- package/examples/services-cloudflare/app/db/main/queries/count-notes.sql +3 -0
- package/examples/services-cloudflare/app/entry.ts +10 -0
- package/examples/services-cloudflare/app/queues/jobs.ts +5 -0
- package/examples/services-cloudflare/app/routes/files.ts +5 -0
- package/examples/services-cloudflare/app/routes/index.ts +10 -0
- package/examples/services-cloudflare/app/routes/limited.ts +7 -0
- package/examples/services-cloudflare/app/routes/send.ts +8 -0
- package/examples/services-cloudflare/configs/env.ts +3 -0
- package/examples/services-cloudflare/configs/infra.ts +85 -0
- package/examples/services-cloudflare/configs/tsconfig.json +15 -0
- package/examples/services-cloudflare/configs/vite.ts +4 -0
- package/examples/services-cloudflare/lib/ui/layout.ts +12 -0
- package/examples/services-cloudflare/modules/files/files.ts +9 -0
- package/examples/services-cloudflare/modules/status/client/ready.ts +4 -0
- package/examples/services-cloudflare/modules/status/status.ts +27 -0
- package/examples/services-cloudflare/modules/status/views.ts +8 -0
- package/examples/services-cloudflare/package.json +30 -0
- package/examples/services-cloudflare/public/robots.txt +1 -0
- package/examples/services-cloudflare/tsconfig.json +4 -0
- package/examples/solid/.env.example +2 -0
- package/examples/solid/README.md +18 -0
- package/examples/solid/app/assets/site.css +3 -0
- package/examples/solid/app/entry.ts +28 -0
- package/examples/solid/app/routes/_middleware.ts +4 -0
- package/examples/solid/app/routes/about.ts +10 -0
- package/examples/solid/app/routes/health.ts +7 -0
- package/examples/solid/app/routes/index.ts +12 -0
- package/examples/solid/configs/Dockerfile +26 -0
- package/examples/solid/configs/Dockerfile.dockerignore +9 -0
- package/examples/solid/configs/env.ts +6 -0
- package/examples/solid/configs/infra.ts +55 -0
- package/examples/solid/configs/tsconfig.json +17 -0
- package/examples/solid/configs/vite.ts +7 -0
- package/examples/solid/configs/vitest.ts +12 -0
- package/examples/solid/lib/ui/base.css +12 -0
- package/examples/solid/lib/ui/layout.ts +18 -0
- package/examples/solid/modules/about/views.ts +8 -0
- package/examples/solid/modules/shop/products.ts +18 -0
- package/examples/solid/modules/shop/shop.css +13 -0
- package/examples/solid/modules/shop/shop.test.ts +28 -0
- package/examples/solid/modules/shop/shop.ts +13 -0
- package/examples/solid/modules/shop/ui/Cart.island.tsx +31 -0
- package/examples/solid/modules/shop/views.ts +16 -0
- package/examples/solid/package.json +35 -0
- package/examples/solid/tsconfig.json +4 -0
- package/examples/starter-bun/.env.example +2 -0
- package/examples/starter-bun/AGENTS.md +9 -0
- package/examples/starter-bun/README.md +47 -0
- package/examples/starter-bun/app/assets/site.css +3 -0
- package/examples/starter-bun/app/db/main/config.json +5 -0
- package/examples/starter-bun/app/db/main/migrations/0001_todos.sql +9 -0
- package/examples/starter-bun/app/db/main/queries/add-todo.sql +2 -0
- package/examples/starter-bun/app/db/main/queries/list-todos.sql +2 -0
- package/examples/starter-bun/app/db/main/queries/toggle-todo.sql +2 -0
- package/examples/starter-bun/app/entry.ts +28 -0
- package/examples/starter-bun/app/routes/_middleware.ts +4 -0
- package/examples/starter-bun/app/routes/health.ts +7 -0
- package/examples/starter-bun/app/routes/index.ts +44 -0
- package/examples/starter-bun/configs/Dockerfile +26 -0
- package/examples/starter-bun/configs/Dockerfile.dockerignore +9 -0
- package/examples/starter-bun/configs/env.ts +6 -0
- package/examples/starter-bun/configs/infra.ts +55 -0
- package/examples/starter-bun/configs/tsconfig.json +15 -0
- package/examples/starter-bun/configs/vite.ts +4 -0
- package/examples/starter-bun/configs/vitest.ts +9 -0
- package/examples/starter-bun/docs/index.md +5 -0
- package/examples/starter-bun/lib/ui/base.css +17 -0
- package/examples/starter-bun/lib/ui/layout.ts +22 -0
- package/examples/starter-bun/modules/todos/todos.css +16 -0
- package/examples/starter-bun/modules/todos/todos.test.ts +33 -0
- package/examples/starter-bun/modules/todos/todos.ts +31 -0
- package/examples/starter-bun/modules/todos/views.ts +38 -0
- package/examples/starter-bun/package.json +32 -0
- package/examples/starter-bun/public/favicon.svg +1 -0
- package/examples/starter-bun/tsconfig.json +4 -0
- package/examples/starter-cloudflare/.env.example +2 -0
- package/examples/starter-cloudflare/AGENTS.md +9 -0
- package/examples/starter-cloudflare/README.md +47 -0
- package/examples/starter-cloudflare/app/assets/site.css +3 -0
- package/examples/starter-cloudflare/app/db/main/config.json +5 -0
- package/examples/starter-cloudflare/app/db/main/migrations/0001_todos.sql +9 -0
- package/examples/starter-cloudflare/app/db/main/queries/add-todo.sql +2 -0
- package/examples/starter-cloudflare/app/db/main/queries/list-todos.sql +2 -0
- package/examples/starter-cloudflare/app/db/main/queries/toggle-todo.sql +2 -0
- package/examples/starter-cloudflare/app/entry.ts +28 -0
- package/examples/starter-cloudflare/app/routes/_middleware.ts +4 -0
- package/examples/starter-cloudflare/app/routes/health.ts +7 -0
- package/examples/starter-cloudflare/app/routes/index.ts +44 -0
- package/examples/starter-cloudflare/configs/env.ts +6 -0
- package/examples/starter-cloudflare/configs/infra.ts +85 -0
- package/examples/starter-cloudflare/configs/tsconfig.json +15 -0
- package/examples/starter-cloudflare/configs/vite.ts +4 -0
- package/examples/starter-cloudflare/configs/vitest.ts +9 -0
- package/examples/starter-cloudflare/docs/index.md +5 -0
- package/examples/starter-cloudflare/lib/ui/base.css +17 -0
- package/examples/starter-cloudflare/lib/ui/layout.ts +22 -0
- package/examples/starter-cloudflare/modules/todos/todos.css +16 -0
- package/examples/starter-cloudflare/modules/todos/todos.test.ts +33 -0
- package/examples/starter-cloudflare/modules/todos/todos.ts +31 -0
- package/examples/starter-cloudflare/modules/todos/views.ts +38 -0
- package/examples/starter-cloudflare/package.json +32 -0
- package/examples/starter-cloudflare/public/favicon.svg +1 -0
- package/examples/starter-cloudflare/tsconfig.json +4 -0
- package/examples/svelte/.env.example +2 -0
- package/examples/svelte/README.md +18 -0
- package/examples/svelte/app/assets/site.css +3 -0
- package/examples/svelte/app/entry.ts +28 -0
- package/examples/svelte/app/routes/_middleware.ts +4 -0
- package/examples/svelte/app/routes/about.ts +10 -0
- package/examples/svelte/app/routes/health.ts +7 -0
- package/examples/svelte/app/routes/index.ts +12 -0
- package/examples/svelte/configs/env.ts +6 -0
- package/examples/svelte/configs/infra.ts +85 -0
- package/examples/svelte/configs/tsconfig.json +15 -0
- package/examples/svelte/configs/vite.ts +9 -0
- package/examples/svelte/configs/vitest.ts +9 -0
- package/examples/svelte/lib/types/svelte.d.ts +8 -0
- package/examples/svelte/lib/ui/base.css +12 -0
- package/examples/svelte/lib/ui/layout.ts +18 -0
- package/examples/svelte/modules/about/views.ts +8 -0
- package/examples/svelte/modules/shop/products.ts +18 -0
- package/examples/svelte/modules/shop/shop.css +13 -0
- package/examples/svelte/modules/shop/shop.test.ts +28 -0
- package/examples/svelte/modules/shop/shop.ts +13 -0
- package/examples/svelte/modules/shop/ui/Cart.island.svelte +23 -0
- package/examples/svelte/modules/shop/views.ts +16 -0
- package/examples/svelte/package.json +35 -0
- package/examples/svelte/tsconfig.json +4 -0
- package/examples/tailwind/.env.example +2 -0
- package/examples/tailwind/README.md +16 -0
- package/examples/tailwind/app/assets/site.css +2 -0
- package/examples/tailwind/app/entry.ts +28 -0
- package/examples/tailwind/app/routes/_middleware.ts +4 -0
- package/examples/tailwind/app/routes/health.ts +7 -0
- package/examples/tailwind/app/routes/index.ts +30 -0
- package/examples/tailwind/configs/Dockerfile +26 -0
- package/examples/tailwind/configs/Dockerfile.dockerignore +9 -0
- package/examples/tailwind/configs/env.ts +6 -0
- package/examples/tailwind/configs/infra.ts +55 -0
- package/examples/tailwind/configs/tsconfig.json +15 -0
- package/examples/tailwind/configs/vite.ts +7 -0
- package/examples/tailwind/configs/vitest.ts +9 -0
- package/examples/tailwind/lib/ui/components.ts +21 -0
- package/examples/tailwind/lib/ui/layout.ts +21 -0
- package/examples/tailwind/lib/ui/theme.css +10 -0
- package/examples/tailwind/modules/team/team.test.ts +30 -0
- package/examples/tailwind/modules/team/team.ts +34 -0
- package/examples/tailwind/modules/team/views.ts +45 -0
- package/examples/tailwind/package.json +35 -0
- package/examples/tailwind/tsconfig.json +4 -0
- package/examples/vue/.env.example +2 -0
- package/examples/vue/README.md +18 -0
- package/examples/vue/app/assets/site.css +3 -0
- package/examples/vue/app/entry.ts +28 -0
- package/examples/vue/app/routes/_middleware.ts +4 -0
- package/examples/vue/app/routes/about.ts +10 -0
- package/examples/vue/app/routes/health.ts +7 -0
- package/examples/vue/app/routes/index.ts +12 -0
- package/examples/vue/configs/env.ts +6 -0
- package/examples/vue/configs/infra.ts +85 -0
- package/examples/vue/configs/tsconfig.json +15 -0
- package/examples/vue/configs/vite.ts +7 -0
- package/examples/vue/configs/vitest.ts +9 -0
- package/examples/vue/lib/types/vue.d.ts +8 -0
- package/examples/vue/lib/ui/base.css +12 -0
- package/examples/vue/lib/ui/layout.ts +18 -0
- package/examples/vue/modules/about/views.ts +8 -0
- package/examples/vue/modules/shop/products.ts +18 -0
- package/examples/vue/modules/shop/shop.css +13 -0
- package/examples/vue/modules/shop/shop.test.ts +28 -0
- package/examples/vue/modules/shop/shop.ts +13 -0
- package/examples/vue/modules/shop/ui/Cart.island.vue +27 -0
- package/examples/vue/modules/shop/views.ts +16 -0
- package/examples/vue/package.json +35 -0
- package/examples/vue/tsconfig.json +4 -0
- package/package.json +44 -3
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { html } from "spacefn";
|
|
2
|
+
|
|
3
|
+
import { badge, card } from "#lib/ui/components.ts";
|
|
4
|
+
|
|
5
|
+
import type { Member } from "./team.ts";
|
|
6
|
+
|
|
7
|
+
/** The members as cards. Datastar swaps the list in by its id as the search changes. */
|
|
8
|
+
export const memberList = (props: { readonly members: readonly Member[] }) =>
|
|
9
|
+
html`<ul id="${memberList.id}" class="grid gap-3 sm:grid-cols-2">
|
|
10
|
+
${
|
|
11
|
+
props.members.length === 0
|
|
12
|
+
? html`<li class="text-gray-500">No one matches.</li>`
|
|
13
|
+
: props.members.map(
|
|
14
|
+
(member) =>
|
|
15
|
+
html`<li>
|
|
16
|
+
${card(
|
|
17
|
+
html`<h2 class="text-lg font-semibold">${member.name}</h2>
|
|
18
|
+
<p class="mt-1 flex gap-2">
|
|
19
|
+
${badge(member.role)} ${member.lead ? badge("Lead", "brand") : ""}
|
|
20
|
+
</p>`,
|
|
21
|
+
)}
|
|
22
|
+
</li>`,
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
</ul>`;
|
|
26
|
+
memberList.id = "team-members";
|
|
27
|
+
|
|
28
|
+
/** The page's body: the title, the search box and the list. */
|
|
29
|
+
export const teamPage = (props: {
|
|
30
|
+
readonly title: string;
|
|
31
|
+
/** What the search box asks for as you type. */
|
|
32
|
+
readonly search: string;
|
|
33
|
+
readonly members: readonly Member[];
|
|
34
|
+
}) =>
|
|
35
|
+
html`<main class="mx-auto max-w-2xl space-y-6 p-6" data-signals="{team: {query: ''}}">
|
|
36
|
+
<h1 class="text-brand-700 dark:text-brand-50 text-3xl font-bold">${props.title}</h1>
|
|
37
|
+
<input
|
|
38
|
+
type="search"
|
|
39
|
+
placeholder="Search by name or role"
|
|
40
|
+
class="rounded-card focus:outline-brand-600 w-full border border-gray-300 px-3 py-2 focus:outline-2 dark:border-gray-700 dark:bg-gray-900"
|
|
41
|
+
data-bind:team.query
|
|
42
|
+
data-on:input__debounce.200ms="@get('${props.search}')"
|
|
43
|
+
/>
|
|
44
|
+
${memberList({ members: props.members })}
|
|
45
|
+
</main>`;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "tailwind",
|
|
3
|
+
"private": true,
|
|
4
|
+
"description": "Tailwind CSS v4 through its Vite plugin: design tokens in lib/ui/theme.css, components from utility classes, a live search with Datastar.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"imports": {
|
|
7
|
+
"#configs/*": "./configs/*",
|
|
8
|
+
"#lib/*": "./lib/*",
|
|
9
|
+
"#modules/*": "./modules/*",
|
|
10
|
+
"#space/*": "./.space/*"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"postinstall": "space gen",
|
|
14
|
+
"dev": "space dev",
|
|
15
|
+
"build": "space build",
|
|
16
|
+
"deploy": "space deploy",
|
|
17
|
+
"docs": "space docs",
|
|
18
|
+
"test": "vitest run --config configs/vitest.ts",
|
|
19
|
+
"typecheck": "tsc --noEmit"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"effect": "4.1.4",
|
|
23
|
+
"spacefn": "^0.11.0"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@alchemy.run/docker": "2.0.0-beta.87",
|
|
27
|
+
"@tailwindcss/vite": "4.3.5",
|
|
28
|
+
"alchemy": "2.0.0-beta.87",
|
|
29
|
+
"spacefn-docs": "^0.11.0",
|
|
30
|
+
"tailwindcss": "4.3.5",
|
|
31
|
+
"typescript": "^7.0.2",
|
|
32
|
+
"vite": "8.3.8",
|
|
33
|
+
"vitest": "5.1.1"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# vue
|
|
2
|
+
|
|
3
|
+
A [Vue](https://vuejs.org) island on a spacefn app (Cloudflare): the pages are server-rendered `html`, and the cart is a Vue component that runs only in the browser.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
pnpm dev
|
|
7
|
+
pnpm test
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
How it fits together:
|
|
11
|
+
|
|
12
|
+
- **The plugin** is Vue's own Vite plugin, beside spacefn's in `configs/vite.ts`.
|
|
13
|
+
- **The shop** is a feature, `modules/shop/`: `shop.ts` gives the page its data, `views.ts` renders it, and the cart is its client component, `modules/shop/ui/Cart.island.vue`. Its name makes it an island called `Cart`, and its default export is the component. `products.ts` holds what the server and the browser share, so it imports nothing server-only.
|
|
14
|
+
- **The island**: codegen writes `.space/islands/Cart.ts`, which starts the component with Vue in the browser, and `.space/islands.ts`. The page renders `island("Cart", { products })` from `#space/islands.ts`, with the props typed from the component when `vue-tsc` checks it (plain `tsc` takes any props): the element, the props as JSON, and the script, once however many carts the page has.
|
|
15
|
+
- **The about page** is a feature of its own, `modules/about/`.
|
|
16
|
+
- **Only the shop loads Vue**: `/about` renders no cart, so it gets no script. The server only imports the component's types, so Vue never runs there.
|
|
17
|
+
|
|
18
|
+
Rendering the component on the server too isn't supported: an island starts empty, and fills in once its script runs.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { app, databases, errorPage, staticFiles, telemetry } from "spacefn";
|
|
2
|
+
import { platform } from "spacefn/platform";
|
|
3
|
+
|
|
4
|
+
import Env from "#configs/env.ts";
|
|
5
|
+
import { manifest } from "#space/manifest.ts";
|
|
6
|
+
|
|
7
|
+
// The app: the file conventions (manifest) and what runs with them. It's yours to change;
|
|
8
|
+
// spacefn only provides the pieces. The same file runs on Cloudflare and on Bun.
|
|
9
|
+
export default app(manifest, {
|
|
10
|
+
// In order: each can use the ones before it, and routes, pages, queues and crons use them all.
|
|
11
|
+
services: [
|
|
12
|
+
// This target's Kv, Blob, Queue, Bus, RateLimiter, HttpClient and database connections.
|
|
13
|
+
platform(manifest),
|
|
14
|
+
// configs/env.ts, read from the environment.
|
|
15
|
+
Env.layer,
|
|
16
|
+
// app/db/*, migrated as each config.json says.
|
|
17
|
+
databases(manifest),
|
|
18
|
+
// Traces, logs and metrics over OTLP, once OTEL_EXPORTER_OTLP_ENDPOINT is set.
|
|
19
|
+
telemetry(manifest.name),
|
|
20
|
+
],
|
|
21
|
+
// Around every request, before app/routes/_middleware.ts. staticFiles() serves the client
|
|
22
|
+
// build on Bun; Cloudflare serves it as assets before the Worker runs.
|
|
23
|
+
before: [staticFiles()],
|
|
24
|
+
// Effect HttpRouter layers beside the file routes, e.g. an HttpApi.
|
|
25
|
+
routes: [],
|
|
26
|
+
// What a failed request answers: an HTML page for browsers, JSON for the rest.
|
|
27
|
+
onError: errorPage,
|
|
28
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { page } from "spacefn";
|
|
3
|
+
|
|
4
|
+
import { layout } from "#lib/ui/layout.ts";
|
|
5
|
+
import { aboutPage } from "#modules/about/views.ts";
|
|
6
|
+
|
|
7
|
+
export default page({
|
|
8
|
+
loader: Effect.void,
|
|
9
|
+
render: () => layout("About", aboutPage()),
|
|
10
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { page } from "spacefn";
|
|
3
|
+
|
|
4
|
+
import { layout } from "#lib/ui/layout.ts";
|
|
5
|
+
import * as Shop from "#modules/shop/shop.ts";
|
|
6
|
+
import { shopPage } from "#modules/shop/views.ts";
|
|
7
|
+
|
|
8
|
+
// The shop at /: the page with the cart, so the only one that loads its script.
|
|
9
|
+
export default page({
|
|
10
|
+
loader: Effect.all({ title: Shop.title, products: Shop.products }),
|
|
11
|
+
render: (ctx) => layout(ctx.data.title, shopPage(ctx.data)),
|
|
12
|
+
});
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// The app's infrastructure: a plain Alchemy stack. `space deploy` runs `alchemy deploy configs/infra.ts`.
|
|
2
|
+
import * as Cloudflare from "@alchemy.run/cloudflare";
|
|
3
|
+
import * as Alchemy from "alchemy";
|
|
4
|
+
import { Effect } from "effect";
|
|
5
|
+
import { variables } from "spacefn/infra";
|
|
6
|
+
|
|
7
|
+
import env from "#configs/env.ts";
|
|
8
|
+
// What the file conventions ask for (databases, queues, crons, ...), as plain data from app/.
|
|
9
|
+
import { app } from "#space/infra.ts";
|
|
10
|
+
|
|
11
|
+
export default Alchemy.Stack(
|
|
12
|
+
app.name,
|
|
13
|
+
{
|
|
14
|
+
providers: Cloudflare.providers(),
|
|
15
|
+
// Deploy state in your Cloudflare account, so CI and other machines share it. Local under `space dev`.
|
|
16
|
+
state: process.env.ALCHEMY_DEV ? Alchemy.localState() : Cloudflare.state(),
|
|
17
|
+
},
|
|
18
|
+
Effect.gen(function* () {
|
|
19
|
+
const stage = yield* Alchemy.Stage;
|
|
20
|
+
const bindings: Record<string, any> = {
|
|
21
|
+
// Kv and Blob. R2 must be enabled on the account; remove BLOB if the app doesn't use Blob.
|
|
22
|
+
KV: yield* Cloudflare.KV.Namespace("KV"),
|
|
23
|
+
BLOB: yield* Cloudflare.R2.Bucket("BLOB"),
|
|
24
|
+
// The Durable Objects behind Bus and RateLimiter.
|
|
25
|
+
SPACE_BUS: Cloudflare.DurableObject("SpaceBus"),
|
|
26
|
+
SPACE_RATE_LIMITER: Cloudflare.DurableObject("SpaceRateLimiter"),
|
|
27
|
+
// configs/env.ts's variables, from .env.<stage> or the environment; Env.secret ones as secrets.
|
|
28
|
+
...variables(env),
|
|
29
|
+
...variables({ OTEL_EXPORTER_OTLP_ENDPOINT: "plain", OTEL_EXPORTER_OTLP_HEADERS: "secret" }),
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
// app/db/<name>/: D1 here; a libSQL database reads DB_<NAME>_URL and DB_<NAME>_AUTH_TOKEN.
|
|
33
|
+
for (const db of app.databases)
|
|
34
|
+
if (db.driver === "d1") bindings[db.binding] = yield* Cloudflare.D1.Database(db.binding);
|
|
35
|
+
else if (db.driver === "libsql")
|
|
36
|
+
Object.assign(
|
|
37
|
+
bindings,
|
|
38
|
+
variables({ [`${db.binding}_URL`]: "plain", [`${db.binding}_AUTH_TOKEN`]: "secret" }),
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
// app/queues/<name>.ts: queue names are unique per account, so they carry the app and stage.
|
|
42
|
+
const prefix = `${app.name}-${stage}-`.toLowerCase();
|
|
43
|
+
bindings.SPACE_QUEUE_PREFIX = prefix;
|
|
44
|
+
const queues: { binding: string; queue: Cloudflare.Queues.Queue }[] = [];
|
|
45
|
+
for (const { name, binding } of app.queues) {
|
|
46
|
+
const queue = yield* Cloudflare.Queues.Queue(binding, { name: prefix + name });
|
|
47
|
+
bindings[binding] = queue;
|
|
48
|
+
queues.push({ binding, queue });
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// app/durable-objects/ and app/workflows/.
|
|
52
|
+
for (const { className, binding } of app.durableObjects)
|
|
53
|
+
bindings[binding] = Cloudflare.DurableObject(className);
|
|
54
|
+
for (const { className, binding } of app.workflows)
|
|
55
|
+
bindings[binding] = Cloudflare.Workflow(className, { className });
|
|
56
|
+
|
|
57
|
+
const worker = yield* Cloudflare.Website.Vite("Worker", {
|
|
58
|
+
// Vite runs in .space/: its vite.config.ts is configs/vite.ts, and entry.ts runs app/entry.ts.
|
|
59
|
+
rootDir: ".space",
|
|
60
|
+
main: "./entry.ts",
|
|
61
|
+
crons: [...app.crons],
|
|
62
|
+
env: bindings,
|
|
63
|
+
// What a deploy hashes to tell whether to rebuild, from .space/.
|
|
64
|
+
memo: {
|
|
65
|
+
include: [
|
|
66
|
+
"**/*",
|
|
67
|
+
"../app/**",
|
|
68
|
+
"../configs/**",
|
|
69
|
+
"../package.json",
|
|
70
|
+
...app.folders.map((folder) => `../${folder}/**`),
|
|
71
|
+
],
|
|
72
|
+
exclude: ["data/**"],
|
|
73
|
+
lockfile: true,
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
for (const { binding, queue } of queues)
|
|
78
|
+
yield* Cloudflare.Queues.Consumer(`${binding}_CONSUMER`, {
|
|
79
|
+
queueId: queue.queueId,
|
|
80
|
+
scriptName: worker.workerName,
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
return { url: worker.url };
|
|
84
|
+
}),
|
|
85
|
+
);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"lib": ["ES2022", "ESNext.Disposable", "DOM", "DOM.Iterable"],
|
|
5
|
+
"module": "preserve",
|
|
6
|
+
"moduleResolution": "bundler",
|
|
7
|
+
"allowImportingTsExtensions": true,
|
|
8
|
+
"verbatimModuleSyntax": true,
|
|
9
|
+
"strict": true,
|
|
10
|
+
"noEmit": true,
|
|
11
|
+
"skipLibCheck": true,
|
|
12
|
+
"types": []
|
|
13
|
+
},
|
|
14
|
+
"include": ["../app", "../lib", "../modules", "../configs"]
|
|
15
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import vue from "@vitejs/plugin-vue";
|
|
2
|
+
import { space } from "spacefn/vite";
|
|
3
|
+
import { defineConfig } from "vite";
|
|
4
|
+
|
|
5
|
+
// Vue's own Vite plugin, beside spacefn's: it compiles the components that
|
|
6
|
+
// islands are. Pages stay server-rendered html.
|
|
7
|
+
export default defineConfig({ plugins: [vue(), space({ target: "cloudflare" })] });
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { defineConfig, mergeConfig } from "vitest/config";
|
|
2
|
+
|
|
3
|
+
import vite from "./vite.ts";
|
|
4
|
+
|
|
5
|
+
// The app's Vite config, so tests get the spacefn plugin (and spacefn/assets) too.
|
|
6
|
+
export default mergeConfig(
|
|
7
|
+
vite,
|
|
8
|
+
defineConfig({ test: { include: ["{app,lib,modules}/**/*.test.ts"] } }),
|
|
9
|
+
);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// What TypeScript sees of a .vue file: Vite compiles it, tsc doesn't read it.
|
|
2
|
+
// For checked templates and island props, run vue-tsc instead of tsc.
|
|
3
|
+
declare module "*.vue" {
|
|
4
|
+
import type { DefineComponent } from "vue";
|
|
5
|
+
|
|
6
|
+
const component: DefineComponent<any, any, any>;
|
|
7
|
+
export default component;
|
|
8
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* The base styles every page shares. */
|
|
2
|
+
:root {
|
|
3
|
+
--space: 0.5rem;
|
|
4
|
+
color-scheme: light dark;
|
|
5
|
+
font-family: system-ui, sans-serif;
|
|
6
|
+
}
|
|
7
|
+
body {
|
|
8
|
+
max-width: 32rem;
|
|
9
|
+
margin: calc(var(--space) * 6) auto;
|
|
10
|
+
padding: 0 calc(var(--space) * 2);
|
|
11
|
+
line-height: 1.5;
|
|
12
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { html, type HtmlValue } from "spacefn";
|
|
2
|
+
import { assets } from "spacefn/assets";
|
|
3
|
+
|
|
4
|
+
/** The HTML around every page: its title, the site's styles and the links between pages. */
|
|
5
|
+
export const layout = (title: string, body: HtmlValue) =>
|
|
6
|
+
html`<!doctype html>
|
|
7
|
+
<html lang="en">
|
|
8
|
+
<head>
|
|
9
|
+
<meta charset="utf-8" />
|
|
10
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
11
|
+
<title>${title}</title>
|
|
12
|
+
${assets("site")}
|
|
13
|
+
</head>
|
|
14
|
+
<body>
|
|
15
|
+
<nav><a href="/">Shop</a> · <a href="/about">About</a></nav>
|
|
16
|
+
${body}
|
|
17
|
+
</body>
|
|
18
|
+
</html>`;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { html } from "spacefn";
|
|
2
|
+
|
|
3
|
+
/** The about page's body: plain server-rendered HTML, with no island. */
|
|
4
|
+
export const aboutPage = () =>
|
|
5
|
+
html`<main>
|
|
6
|
+
<h1>About</h1>
|
|
7
|
+
<p>This page is plain server-rendered HTML: it loads the site's styles, and not the cart.</p>
|
|
8
|
+
</main>`;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Shared by the server, which renders the page, and the browser, which runs the cart:
|
|
2
|
+
// so this file imports nothing server-only.
|
|
3
|
+
|
|
4
|
+
export interface Product {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly name: string;
|
|
7
|
+
/** In cents. */
|
|
8
|
+
readonly price: number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** What the shop sells. */
|
|
12
|
+
export const PRODUCTS: readonly Product[] = [
|
|
13
|
+
{ id: "mug", name: "Mug", price: 1200 },
|
|
14
|
+
{ id: "shirt", name: "T-shirt", price: 2500 },
|
|
15
|
+
{ id: "sticker", name: "Sticker", price: 300 },
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
export const formatPrice = (cents: number) => `$${(cents / 100).toFixed(2)}`;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Layer } from "effect";
|
|
2
|
+
import { memoryServices, testApp, testEnv } from "spacefn/testing";
|
|
3
|
+
import { describe, expect, it } from "vitest";
|
|
4
|
+
|
|
5
|
+
import Env from "#configs/env.ts";
|
|
6
|
+
import { manifest } from "#space/manifest.ts";
|
|
7
|
+
|
|
8
|
+
const app = () =>
|
|
9
|
+
testApp(manifest, Layer.mergeAll(memoryServices, Env.layer.pipe(Layer.provide(testEnv({})))));
|
|
10
|
+
|
|
11
|
+
describe("the shop", () => {
|
|
12
|
+
it("renders the cart's island with its props, and loads its script once", async () => {
|
|
13
|
+
await using shop = app();
|
|
14
|
+
const page = await (await shop.fetch("/")).text();
|
|
15
|
+
expect(page).toMatch(
|
|
16
|
+
/<spacefn-island name="Cart"[^>]*><script type="application\/json">\{"products":\[\{"id":"mug"/,
|
|
17
|
+
);
|
|
18
|
+
const script = '<script type="module" src="/.space/islands/Cart.ts"></script>';
|
|
19
|
+
expect(page.split(script).length).toBe(2);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it("doesn't load the cart on a page without it", async () => {
|
|
23
|
+
await using shop = app();
|
|
24
|
+
const page = await (await shop.fetch("/about")).text();
|
|
25
|
+
expect(page).toContain('<link rel="stylesheet" href="/app/assets/site.css">');
|
|
26
|
+
expect(page).not.toContain("islands/Cart");
|
|
27
|
+
});
|
|
28
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
|
|
3
|
+
import Env from "#configs/env.ts";
|
|
4
|
+
|
|
5
|
+
import { PRODUCTS } from "./products.ts";
|
|
6
|
+
|
|
7
|
+
/** The shop's name, from configs/env.ts. */
|
|
8
|
+
export const title = Effect.gen(function* () {
|
|
9
|
+
return (yield* Env).SHOP_NAME;
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
/** What the shop sells. An app would read it from a database; the example keeps it in code. */
|
|
13
|
+
export const products = Effect.succeed(PRODUCTS);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, reactive } from "vue";
|
|
3
|
+
|
|
4
|
+
import { formatPrice, type Product } from "../products.ts";
|
|
5
|
+
|
|
6
|
+
// The cart: add products, see the total. Its state lives in the browser.
|
|
7
|
+
const props = defineProps<{ products: readonly Product[] }>();
|
|
8
|
+
const counts = reactive<Record<string, number>>({});
|
|
9
|
+
const total = computed(() =>
|
|
10
|
+
props.products.reduce((sum, product) => sum + product.price * (counts[product.id] ?? 0), 0),
|
|
11
|
+
);
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<div class="cart">
|
|
16
|
+
<ul>
|
|
17
|
+
<li v-for="product in products" :key="product.id">
|
|
18
|
+
<span>{{ product.name }}</span>
|
|
19
|
+
<button type="button" @click="counts[product.id] = (counts[product.id] ?? 0) + 1">
|
|
20
|
+
Add
|
|
21
|
+
</button>
|
|
22
|
+
<output>{{ counts[product.id] ?? 0 }}</output>
|
|
23
|
+
</li>
|
|
24
|
+
</ul>
|
|
25
|
+
<p>Total: {{ formatPrice(total) }}</p>
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { html } from "spacefn";
|
|
2
|
+
|
|
3
|
+
import { island } from "#space/islands.ts";
|
|
4
|
+
|
|
5
|
+
import type { Product } from "./products.ts";
|
|
6
|
+
|
|
7
|
+
/** The shop's page: server-rendered, with the Vue cart as an island. */
|
|
8
|
+
export const shopPage = (props: {
|
|
9
|
+
readonly title: string;
|
|
10
|
+
readonly products: readonly Product[];
|
|
11
|
+
}) =>
|
|
12
|
+
html`<main>
|
|
13
|
+
<h1>${props.title}</h1>
|
|
14
|
+
${island("Cart", { products: props.products })}
|
|
15
|
+
<noscript>The cart needs JavaScript.</noscript>
|
|
16
|
+
</main>`;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "vue",
|
|
3
|
+
"private": true,
|
|
4
|
+
"description": "A Vue island on a server-rendered spacefn page: a client-only cart, loaded only on the page that uses it.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"imports": {
|
|
7
|
+
"#configs/*": "./configs/*",
|
|
8
|
+
"#lib/*": "./lib/*",
|
|
9
|
+
"#modules/*": "./modules/*",
|
|
10
|
+
"#space/*": "./.space/*"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"postinstall": "space gen",
|
|
14
|
+
"dev": "space dev",
|
|
15
|
+
"build": "space build",
|
|
16
|
+
"deploy": "space deploy",
|
|
17
|
+
"docs": "space docs",
|
|
18
|
+
"test": "vitest run --config configs/vitest.ts",
|
|
19
|
+
"typecheck": "tsc --noEmit"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"effect": "4.1.4",
|
|
23
|
+
"spacefn": "^0.11.0",
|
|
24
|
+
"vue": "3.5.45"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@alchemy.run/cloudflare": "2.0.0-beta.87",
|
|
28
|
+
"@vitejs/plugin-vue": "6.0.10",
|
|
29
|
+
"alchemy": "2.0.0-beta.87",
|
|
30
|
+
"spacefn-docs": "^0.11.0",
|
|
31
|
+
"typescript": "^7.0.2",
|
|
32
|
+
"vite": "8.3.8",
|
|
33
|
+
"vitest": "5.1.1"
|
|
34
|
+
}
|
|
35
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,47 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spacefn-docs",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.11.0",
|
|
4
|
+
"description": "spacefn's docs and examples, and the reader `space docs` serves them with",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"docs",
|
|
7
|
+
"spacefn"
|
|
8
|
+
],
|
|
9
|
+
"homepage": "https://github.com/space-fn/spacefn#readme",
|
|
10
|
+
"license": "Apache-2.0",
|
|
11
|
+
"author": "wai-lin",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/space-fn/spacefn.git",
|
|
15
|
+
"directory": "packages/docs"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"assets",
|
|
20
|
+
"content",
|
|
21
|
+
"examples"
|
|
22
|
+
],
|
|
23
|
+
"type": "module",
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/index.d.mts",
|
|
27
|
+
"import": "./dist/index.mjs",
|
|
28
|
+
"default": "./dist/index.mjs"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@shikijs/transformers": "^4.6.0",
|
|
33
|
+
"marked": "^18.2.1",
|
|
34
|
+
"shiki": "^4.6.0"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@types/node": "^26.6.6",
|
|
38
|
+
"tsdown": "0.23.7",
|
|
39
|
+
"typescript": "^7.0.2",
|
|
40
|
+
"vitest": "5.1.1"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "tsdown",
|
|
44
|
+
"typecheck": "tsc --noEmit",
|
|
45
|
+
"test": "vitest run"
|
|
46
|
+
}
|
|
6
47
|
}
|