@michaelthielemann/kestrel 1.2.1 → 1.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.
- package/README.md +33 -3
- package/layers/admin/app/pages/admin/[collection]/[id].nuxt.test.ts +200 -0
- package/layers/auth/nuxt.config.ts +0 -0
- package/layers/auth/server/api/auth/session.get.ts +0 -0
- package/layers/auth/server/utils/password.ts +0 -0
- package/layers/auth/server/utils/session.ts +5 -2
- package/layers/collections/nuxt.config.ts +0 -0
- package/layers/core/modules/kestrel/app-shell.ts +55 -0
- package/layers/core/modules/kestrel/index.ts +17 -0
- package/layers/core/server/api/[collection]/[id]/translations.get.ts +0 -0
- package/layers/core/server/api/[collection]/options.get.test.ts +60 -0
- package/layers/core/server/api/[collection]/translations.get.test.ts +90 -0
- package/layers/core/server/utils/blocks.ts +0 -0
- package/layers/core/server/utils/seo.ts +0 -0
- package/layers/fields/nuxt.config.ts +0 -0
- package/layers/media/server/api/media/[id].get.ts +0 -0
- package/layers/media/server/api/media/index.get.ts +0 -0
- package/layers/public/app/app.vue +0 -0
- package/layers/public/app/error.vue +0 -0
- package/layers/public/app/layouts/default.vue +0 -0
- package/layers/ui/app/assets/scss/_reset.scss +0 -0
- package/layers/ui/app/assets/scss/main.scss +0 -0
- package/layers/ui/app/components/ui/Alert.vue +0 -0
- package/package.json +6 -2
- package/scripts/copy-create-payload.mjs +52 -0
- package/scripts/hash-password.mjs +6 -15
- package/scripts/kestrel.mjs +216 -0
- package/scripts/lib/cli.mjs +114 -0
- package/scripts/lib/password.mjs +19 -0
- package/scripts/lib/scaffold.mjs +174 -0
- package/templates/starter/README.md +65 -0
- package/templates/starter/_env.example +17 -0
- package/templates/starter/_gitignore +26 -0
- package/templates/starter/_package.json +22 -0
- package/templates/starter/app/app.vue +7 -0
- package/templates/starter/app/blocks/Prose.vue +12 -0
- package/templates/starter/app/layouts/default.vue +6 -0
- package/templates/starter/nuxt.config.ts +20 -0
- package/templates/starter/pnpm-workspace.yaml +8 -0
- package/templates/starter/tsconfig.json +3 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Auth/session is env-only — secrets never belong in a committed config file. `.env.example` is the
|
|
2
|
+
# committed copy of this template; `.env` holds the real values and is gitignored.
|
|
3
|
+
#
|
|
4
|
+
# The two below are read per request. Every other KESTREL_* var is read once when the app is BUILT
|
|
5
|
+
# (dev start / build / generate) and frozen into runtimeConfig — see docs/configuration.md.
|
|
6
|
+
|
|
7
|
+
# Session signing secret, >= 32 bytes. Required in production. Generate: kestrel secret
|
|
8
|
+
KESTREL_SESSION_SECRET=
|
|
9
|
+
|
|
10
|
+
# Admin password hash. Without it /admin renders but sign-in answers 503. Generate: kestrel hash-password
|
|
11
|
+
KESTREL_ADMIN_PASSWORD_HASH=
|
|
12
|
+
|
|
13
|
+
# Drops the __Host- cookie prefix and the Secure flag. Plain-HTTP localhost ONLY; rejected in production.
|
|
14
|
+
KESTREL_SECURE_COOKIES=false
|
|
15
|
+
|
|
16
|
+
# Optional: session lifetime in seconds (default 604800 = 7 days)
|
|
17
|
+
# KESTREL_SESSION_MAX_AGE=604800
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules
|
|
3
|
+
|
|
4
|
+
# Nuxt / Nitro build output
|
|
5
|
+
.nuxt
|
|
6
|
+
.nitro
|
|
7
|
+
.cache
|
|
8
|
+
.output
|
|
9
|
+
dist
|
|
10
|
+
|
|
11
|
+
# Secrets
|
|
12
|
+
.env
|
|
13
|
+
.env.*
|
|
14
|
+
!.env.example
|
|
15
|
+
|
|
16
|
+
# Runtime database, uploads and published output
|
|
17
|
+
.data
|
|
18
|
+
*.sqlite
|
|
19
|
+
*.sqlite-shm
|
|
20
|
+
*.sqlite-wal
|
|
21
|
+
|
|
22
|
+
# Logs
|
|
23
|
+
*.log
|
|
24
|
+
|
|
25
|
+
# OS / editor
|
|
26
|
+
.DS_Store
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{name}}",
|
|
3
|
+
"private": true,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "nuxt dev",
|
|
7
|
+
"build": "nuxt build",
|
|
8
|
+
"preview": "nuxt preview",
|
|
9
|
+
"generate": "nuxt generate",
|
|
10
|
+
"typecheck": "nuxt prepare && nuxt typecheck && tsc -p .nuxt/tsconfig.server.json --noEmit",
|
|
11
|
+
"hash-password": "kestrel hash-password",
|
|
12
|
+
"doctor": "kestrel doctor"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@michaelthielemann/kestrel": "{{version}}"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"nuxt": "{{nuxtVersion}}",
|
|
19
|
+
"typescript": "{{typescriptVersion}}",
|
|
20
|
+
"vue-tsc": "{{vueTscVersion}}"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// One SFC is one block type: the filename names it, defineProps is its schema. Add a sibling to add one.
|
|
3
|
+
defineProps({
|
|
4
|
+
body: richtextField({ required: true }),
|
|
5
|
+
})
|
|
6
|
+
defineBlock({ label: { en: 'Prose' }, icon: 'file-text' })
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<!-- richtext is sanitized server-side on write -->
|
|
11
|
+
<div class="block-prose" v-html="body" />
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default defineNuxtConfig({
|
|
2
|
+
compatibilityDate: '2026-06-02',
|
|
3
|
+
future: { compatibilityVersion: 4 },
|
|
4
|
+
// This one line composes the whole CMS. Opt-in extension layers go after it.
|
|
5
|
+
extends: ['@michaelthielemann/kestrel'],
|
|
6
|
+
// Not inherited from an extended layer, so it has to be repeated here.
|
|
7
|
+
typescript: { tsConfig: { compilerOptions: { noUncheckedIndexedAccess: false } } },
|
|
8
|
+
nitro: { typescript: { tsConfig: { compilerOptions: { noUncheckedIndexedAccess: false } } } },
|
|
9
|
+
// Auth/session is env-only, see `.env`. Every key here is optional.
|
|
10
|
+
kestrel: {
|
|
11
|
+
db: '.data/db.sqlite',
|
|
12
|
+
// Baked into canonical URLs, hreflang, sitemap.xml and llms.txt at build time. Set it to the public
|
|
13
|
+
// origin before the first real deploy — or leave it to KESTREL_SITE_URL per environment.
|
|
14
|
+
siteUrl: 'http://localhost:3000',
|
|
15
|
+
siteName: '{{name}}',
|
|
16
|
+
media: { uploadDir: '.data/uploads' },
|
|
17
|
+
// locales: ['en', 'de'],
|
|
18
|
+
// collections: { pages: false },
|
|
19
|
+
},
|
|
20
|
+
})
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# pnpm blocks dependency build scripts unless they are listed here, and Kestrel's SQLite driver and image
|
|
2
|
+
# pipeline are native — without this `pnpm install` completes but the app cannot start. Delete this file
|
|
3
|
+
# if you use npm or yarn. (`pnpm.onlyBuiltDependencies` in package.json is silently ignored on pnpm 11.)
|
|
4
|
+
allowBuilds:
|
|
5
|
+
'@parcel/watcher': true
|
|
6
|
+
better-sqlite3: true
|
|
7
|
+
esbuild: true
|
|
8
|
+
sharp: true
|