@lemonadecms/create 0.0.0-stage → 0.1.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/CHANGELOG.md +13 -0
- package/LICENSE +21 -0
- package/README.md +26 -2
- package/bin/create-lemonade.mjs +122 -0
- package/dist/catalog.json +604 -0
- package/dist/templates/angular/angular.json +54 -0
- package/dist/templates/angular/locks/npm-lock.json.template +7079 -0
- package/dist/templates/angular/locks/pnpm-lock.yaml.template +4234 -0
- package/dist/templates/angular/package.json +61 -0
- package/dist/templates/angular/src/app/app.config.server.ts +23 -0
- package/dist/templates/angular/src/app/app.config.ts +34 -0
- package/dist/templates/angular/src/app/app.ts +9 -0
- package/dist/templates/angular/src/app/blog.service.ts +74 -0
- package/dist/templates/angular/src/app/journal.html +71 -0
- package/dist/templates/angular/src/app/journal.ts +47 -0
- package/dist/templates/angular/src/index.html +14 -0
- package/dist/templates/angular/src/main.server.ts +5 -0
- package/dist/templates/angular/src/main.ts +6 -0
- package/dist/templates/angular/src/server.ts +79 -0
- package/dist/templates/angular/tsconfig.app.json +8 -0
- package/dist/templates/angular/tsconfig.json +21 -0
- package/dist/templates/astro/astro.config.mjs +7 -0
- package/dist/templates/astro/locks/npm-lock.json.template +5478 -0
- package/dist/templates/astro/locks/pnpm-lock.yaml.template +3530 -0
- package/dist/templates/astro/package.json +42 -0
- package/dist/templates/astro/src/components/BlogView.astro +92 -0
- package/dist/templates/astro/src/layouts/Site.astro +23 -0
- package/dist/templates/astro/src/pages/articles/[id].astro +13 -0
- package/dist/templates/astro/src/pages/index.astro +13 -0
- package/dist/templates/astro/src/pages/lemonade/preview/[...path].ts +4 -0
- package/dist/templates/astro/src/pages/lemonade/preview.ts +4 -0
- package/dist/templates/astro/tsconfig.json +9 -0
- package/dist/templates/next/app/articles/[id]/page.tsx +29 -0
- package/dist/templates/next/app/data.ts +12 -0
- package/dist/templates/next/app/error.tsx +15 -0
- package/dist/templates/next/app/layout.tsx +13 -0
- package/dist/templates/next/app/lemonade/preview/[[...path]]/route.ts +7 -0
- package/dist/templates/next/app/loading.tsx +7 -0
- package/dist/templates/next/app/not-found.tsx +8 -0
- package/dist/templates/next/app/page.tsx +17 -0
- package/dist/templates/next/app/view.tsx +111 -0
- package/dist/templates/next/locks/npm-lock.json.template +1158 -0
- package/dist/templates/next/locks/pnpm-lock.yaml.template +715 -0
- package/dist/templates/next/next-env.d.ts +2 -0
- package/dist/templates/next/next.config.mjs +8 -0
- package/dist/templates/next/package.json +44 -0
- package/dist/templates/next/proxy.ts +19 -0
- package/dist/templates/next/tsconfig.json +25 -0
- package/dist/templates/nuxt/app/app.vue +1 -0
- package/dist/templates/nuxt/app/components/JournalView.vue +75 -0
- package/dist/templates/nuxt/app/pages/articles/[id].vue +8 -0
- package/dist/templates/nuxt/app/pages/index.vue +8 -0
- package/dist/templates/nuxt/locks/npm-lock.json.template +9113 -0
- package/dist/templates/nuxt/locks/pnpm-lock.yaml.template +6466 -0
- package/dist/templates/nuxt/nuxt.config.ts +27 -0
- package/dist/templates/nuxt/package.json +54 -0
- package/dist/templates/nuxt/server/api/blog/[id].get.ts +10 -0
- package/dist/templates/nuxt/server/api/blog.get.ts +9 -0
- package/dist/templates/nuxt/server/middleware/preview.ts +9 -0
- package/dist/templates/nuxt/server/utils/cms-environment.ts +15 -0
- package/dist/templates/nuxt/tsconfig.json +7 -0
- package/dist/templates/shared/GETTING_STARTED.md +29 -0
- package/dist/templates/shared/README.md +8 -0
- package/dist/templates/shared/env.example.template +11 -0
- package/dist/templates/shared/gitignore.template +13 -0
- package/dist/templates/shared/model-template.json +75 -0
- package/dist/templates/shared/public/blog.css +255 -0
- package/dist/templates/shared/public/lemonade.svg +5 -0
- package/dist/templates/shared/schema-contract.json +37 -0
- package/dist/templates/shared/scripts/cms-tools.mjs +171 -0
- package/dist/templates/shared/scripts/environment.mjs +68 -0
- package/dist/templates/shared/scripts/run.mjs +122 -0
- package/dist/templates/shared/server/blog.d.mts +35 -0
- package/dist/templates/shared/server/blog.mjs +159 -0
- package/dist/templates/shared/server/config.d.mts +11 -0
- package/dist/templates/shared/server/config.mjs +42 -0
- package/dist/templates/shared/server/preview.d.mts +4 -0
- package/dist/templates/shared/server/preview.mjs +276 -0
- package/dist/templates/shared/src/types/cms-models.ts +37 -0
- package/package.json +24 -4
- package/src/arguments.mjs +55 -0
- package/src/catalog.mjs +134 -0
- package/src/errors.mjs +10 -0
- package/src/generation.mjs +103 -0
- package/src/paths.mjs +90 -0
- package/src/prompts.mjs +65 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
// Metadata and the page share one request-local read. Waiting for metadata
|
|
3
|
+
// keeps the completed article HTML readable when browser JavaScript is off.
|
|
4
|
+
htmlLimitedBots: /.*/,
|
|
5
|
+
cacheComponents: false,
|
|
6
|
+
poweredByHeader: false,
|
|
7
|
+
logging: { incomingRequests: false },
|
|
8
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "lemonade-blog",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": "^22.23.5 || ^24.22.3"
|
|
8
|
+
},
|
|
9
|
+
"packageManager": "npm@11.6.2",
|
|
10
|
+
"lemonade": {
|
|
11
|
+
"framework": "next",
|
|
12
|
+
"contract": 1
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"dev": "node scripts/run.mjs dev",
|
|
16
|
+
"check": "node scripts/run.mjs check",
|
|
17
|
+
"build": "node scripts/run.mjs build",
|
|
18
|
+
"start": "node scripts/run.mjs start",
|
|
19
|
+
"cms:setup": "node scripts/cms-tools.mjs setup",
|
|
20
|
+
"cms:check": "node scripts/cms-tools.mjs check",
|
|
21
|
+
"cms:types": "node scripts/cms-tools.mjs types"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@lemonadecms/client": "0.2.3",
|
|
25
|
+
"markdown-it": "15.0.3",
|
|
26
|
+
"next": "16.4.6",
|
|
27
|
+
"react": "19.3.1",
|
|
28
|
+
"react-dom": "19.3.1"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/node": "24.10.1",
|
|
32
|
+
"@types/markdown-it": "14.1.2",
|
|
33
|
+
"typescript": "5.9.3",
|
|
34
|
+
"@types/react": "19.3.0",
|
|
35
|
+
"@types/react-dom": "19.3.0"
|
|
36
|
+
},
|
|
37
|
+
"pnpm": {
|
|
38
|
+
"onlyBuiltDependencies": [
|
|
39
|
+
"@parcel/watcher",
|
|
40
|
+
"esbuild",
|
|
41
|
+
"sharp"
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { NextResponse, type NextRequest } from 'next/server';
|
|
2
|
+
import { configuration } from './server/config.mjs';
|
|
3
|
+
export function proxy(_request: NextRequest) {
|
|
4
|
+
if (!configuration())
|
|
5
|
+
return new NextResponse(
|
|
6
|
+
'<!doctype html><html lang="en"><head><meta name="viewport" content="width=device-width,initial-scale=1"><title>Connect your journal</title><link rel="stylesheet" href="/blog.css"></head><body><main class="notice"><h1>Connect your workspace to start your journal.</h1><p>Follow GETTING_STARTED.md, configure the private .env and run cms:check.</p><a href="https://app.lemonadecms.com">Open Studio</a></main></body></html>',
|
|
7
|
+
{
|
|
8
|
+
status: 503,
|
|
9
|
+
headers: {
|
|
10
|
+
'Content-Type': 'text/html; charset=utf-8',
|
|
11
|
+
'Cache-Control': 'private, no-store',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
);
|
|
15
|
+
const response = NextResponse.next();
|
|
16
|
+
response.headers.set('Cache-Control', 'private, no-store');
|
|
17
|
+
return response;
|
|
18
|
+
}
|
|
19
|
+
export const config = { matcher: ['/', '/articles/:path*'] };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"lib": ["dom", "dom.iterable", "esnext"],
|
|
5
|
+
"allowJs": true,
|
|
6
|
+
"checkJs": false,
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"strict": true,
|
|
9
|
+
"noEmit": true,
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"module": "esnext",
|
|
12
|
+
"moduleResolution": "bundler",
|
|
13
|
+
"resolveJsonModule": true,
|
|
14
|
+
"isolatedModules": true,
|
|
15
|
+
"jsx": "react-jsx",
|
|
16
|
+
"incremental": true,
|
|
17
|
+
"plugins": [
|
|
18
|
+
{
|
|
19
|
+
"name": "next"
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
|
24
|
+
"exclude": ["node_modules"]
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<template><NuxtPage /></template>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type {BlogView} from '../../server/blog.mjs';
|
|
3
|
+
defineProps<{view:BlogView}>();
|
|
4
|
+
const messages:Record<string,string>={unconfigured:'Connect your workspace to start your journal.',invalid:'This page link is invalid.','not-found':'This article is not available.',unavailable:'Content is temporarily unavailable.',denied:'Content access was denied. Review your published read token.','context-mismatch':'The content connection does not match the configured workspace, environment or language.'};
|
|
5
|
+
</script>
|
|
6
|
+
<template>
|
|
7
|
+
<a class="skip" href="#content">Skip to content</a>
|
|
8
|
+
<header>
|
|
9
|
+
<a class="brand" href="/"
|
|
10
|
+
><span class="mark" aria-hidden="true" />Lemonade journal</a
|
|
11
|
+
><a href="https://app.lemonadecms.com">Studio</a>
|
|
12
|
+
</header>
|
|
13
|
+
<main id="content">
|
|
14
|
+
<section v-if="view.state!=='ready'" class="notice" role="status">
|
|
15
|
+
<h1>{{messages[view.state]}}</h1>
|
|
16
|
+
<p>
|
|
17
|
+
Check GETTING_STARTED.md and your connection. Published content is never
|
|
18
|
+
replaced by demonstration data.
|
|
19
|
+
</p>
|
|
20
|
+
<a class="button" href="/">Return to journal</a>
|
|
21
|
+
</section>
|
|
22
|
+
<article v-else-if="view.article" class="article">
|
|
23
|
+
<a :href="`/?page=${view.page}`">Back to journal</a>
|
|
24
|
+
<h1>{{view.article.title}}</h1>
|
|
25
|
+
<p class="byline">
|
|
26
|
+
<span>{{view.article.author}}</span
|
|
27
|
+
><time>{{view.article.date}}</time>
|
|
28
|
+
</p>
|
|
29
|
+
<img
|
|
30
|
+
v-if="view.article.image"
|
|
31
|
+
class="post-image"
|
|
32
|
+
:src="view.article.image"
|
|
33
|
+
:alt="view.article.imageAlt"
|
|
34
|
+
/>
|
|
35
|
+
<div class="body" v-html="view.article.bodyHtml" />
|
|
36
|
+
</article>
|
|
37
|
+
<template v-else
|
|
38
|
+
><section class="hero">
|
|
39
|
+
<h1>A little room<br />for good ideas.</h1>
|
|
40
|
+
<p>Notes, stories and new perspectives. Published with Lemonade CMS.</p>
|
|
41
|
+
</section>
|
|
42
|
+
<section v-if="view.posts.length" class="posts" aria-label="Published articles">
|
|
43
|
+
<article v-for="post in view.posts" :key="post.id" class="post">
|
|
44
|
+
<img
|
|
45
|
+
v-if="post.image"
|
|
46
|
+
class="post-image"
|
|
47
|
+
:src="post.image"
|
|
48
|
+
alt=""
|
|
49
|
+
loading="lazy"
|
|
50
|
+
/>
|
|
51
|
+
<h2>
|
|
52
|
+
<a :href="`/articles/${post.id}?page=${view.page}`">{{post.title}}</a>
|
|
53
|
+
</h2>
|
|
54
|
+
<p>{{post.description}}</p>
|
|
55
|
+
<div class="byline">
|
|
56
|
+
<span>{{post.author}}</span
|
|
57
|
+
><time>{{post.date}}</time>
|
|
58
|
+
</div>
|
|
59
|
+
</article>
|
|
60
|
+
</section>
|
|
61
|
+
<section v-else class="notice">
|
|
62
|
+
<h2>No published articles yet</h2>
|
|
63
|
+
<p>
|
|
64
|
+
Publish an author and article in the selected Studio environment to begin.
|
|
65
|
+
</p>
|
|
66
|
+
</section>
|
|
67
|
+
<nav class="pagination" aria-label="Article pages">
|
|
68
|
+
<a v-if="view.hasPrevious" :href="`/?page=${view.page-1}`">Previous page</a
|
|
69
|
+
><span v-else /><span>Page {{view.page}}</span
|
|
70
|
+
><a v-if="view.hasNext" :href="`/?page=${view.page+1}`">Next page</a
|
|
71
|
+
><span v-else /></nav
|
|
72
|
+
></template>
|
|
73
|
+
</main>
|
|
74
|
+
<footer>Your ideas, thoughtfully published.</footer>
|
|
75
|
+
</template>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type {BlogView} from '../../../server/blog.mjs';
|
|
3
|
+
const route=useRoute();const {data:view,error}=await useAsyncData('article:'+route.fullPath,()=>$fetch<BlogView>('/api/blog/'+encodeURIComponent(String(route.params.id)),{query:route.query}));
|
|
4
|
+
if(error.value||!view.value)throw createError({statusCode:503,statusMessage:'Content unavailable'});
|
|
5
|
+
if(import.meta.server)setResponseStatus(view.value.status);
|
|
6
|
+
useHead({htmlAttrs:{lang:()=>view.value?.locale||'en'},title:()=>view.value?.title,meta:[{name:'description',content:()=>view.value?.description}],link:[{rel:'canonical',href:()=>view.value?.canonical}]});
|
|
7
|
+
</script>
|
|
8
|
+
<template><JournalView v-if="view" :view="view" /></template>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type {BlogView} from '../../server/blog.mjs';
|
|
3
|
+
const route=useRoute();const {data:view,error}=await useAsyncData('blog:'+route.fullPath,()=>$fetch<BlogView>('/api/blog',{query:route.query}));
|
|
4
|
+
if(error.value||!view.value)throw createError({statusCode:503,statusMessage:'Content unavailable'});
|
|
5
|
+
if(import.meta.server)setResponseStatus(view.value.status);
|
|
6
|
+
useHead({htmlAttrs:{lang:()=>view.value?.locale||'en'},title:()=>view.value?.title,meta:[{name:'description',content:()=>view.value?.description}],link:[{rel:'canonical',href:()=>view.value?.canonical}]});
|
|
7
|
+
</script>
|
|
8
|
+
<template><JournalView v-if="view" :view="view" /></template>
|