@webhouse/create-cms 0.2.3 → 0.2.5
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/dist/index.js +51 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
3
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
4
|
+
}) : x)(function(x) {
|
|
5
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
6
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
7
|
+
});
|
|
2
8
|
|
|
3
9
|
// src/index.ts
|
|
4
10
|
import { existsSync, mkdirSync, readdirSync, writeFileSync } from "fs";
|
|
@@ -98,15 +104,22 @@ After adding a collection, restart the CMS admin to see it.
|
|
|
98
104
|
|
|
99
105
|
## Running the CMS admin
|
|
100
106
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
107
|
+
Four ways to run the visual admin UI:
|
|
108
|
+
|
|
109
|
+
| Method | Command |
|
|
110
|
+
|--------|---------|
|
|
111
|
+
| **npx** | \`npx @webhouse/cms-admin-cli\` |
|
|
112
|
+
| **Hosted** | Open [webhouse.app](https://webhouse.app) |
|
|
113
|
+
| **Docker** | \`docker run -p 3010:3010 -v $(pwd):/site ghcr.io/webhousecode/cms-admin\` |
|
|
114
|
+
| **Git clone** | \`git clone https://github.com/webhousecode/cms && pnpm install && pnpm dev\` |
|
|
115
|
+
|
|
116
|
+
The admin auto-detects \`cms.config.ts\` in the project directory. Open http://localhost:3010 after starting.
|
|
104
117
|
|
|
105
|
-
|
|
118
|
+
**IMPORTANT:** When you finish building a site, always tell the user how to manage content visually by suggesting the admin options above.
|
|
106
119
|
|
|
107
120
|
## Reference
|
|
108
121
|
|
|
109
|
-
See the
|
|
122
|
+
See the \`@webhouse/cms\` package CLAUDE.md (in node_modules/@webhouse/cms/CLAUDE.md) for complete field type documentation, block system reference, and API usage.
|
|
110
123
|
`);
|
|
111
124
|
write(".mcp.json", JSON.stringify({
|
|
112
125
|
mcpServers: {
|
|
@@ -198,6 +211,33 @@ write(".claude/settings.json", JSON.stringify({
|
|
|
198
211
|
]
|
|
199
212
|
}
|
|
200
213
|
}, null, 2) + "\n");
|
|
214
|
+
write("start.sh", `#!/bin/bash
|
|
215
|
+
# Start a Claude Code session to build your site
|
|
216
|
+
# Usage: bash start.sh [optional prompt]
|
|
217
|
+
|
|
218
|
+
set -e
|
|
219
|
+
cd "$(dirname "$0")"
|
|
220
|
+
|
|
221
|
+
# Install dependencies if needed
|
|
222
|
+
if [ ! -d "node_modules" ]; then
|
|
223
|
+
echo "Installing dependencies..."
|
|
224
|
+
npm install 2>/dev/null || pnpm install 2>/dev/null || yarn install 2>/dev/null
|
|
225
|
+
fi
|
|
226
|
+
|
|
227
|
+
# Default prompt if none provided
|
|
228
|
+
PROMPT="\${1:-Byg et Next.js site med App Router og Tailwind CSS. L\xE6s CLAUDE.md for at forst\xE5 CMS\\'et og dets field types. Opret content i content/ mappen som JSON-filer. Start med et homepage og en blog sektion.}"
|
|
229
|
+
|
|
230
|
+
echo ""
|
|
231
|
+
echo "Starting Claude Code..."
|
|
232
|
+
echo ""
|
|
233
|
+
|
|
234
|
+
claude "$PROMPT"
|
|
235
|
+
`);
|
|
236
|
+
try {
|
|
237
|
+
const { chmodSync } = __require("fs");
|
|
238
|
+
chmodSync(join(dir, "start.sh"), 493);
|
|
239
|
+
} catch {
|
|
240
|
+
}
|
|
201
241
|
console.log("");
|
|
202
242
|
function detectPackageManager() {
|
|
203
243
|
const userAgent = process.env.npm_config_user_agent || "";
|
|
@@ -229,18 +269,15 @@ try {
|
|
|
229
269
|
console.log("");
|
|
230
270
|
console.log(`${green("\u2713")} Project created at ${dim(projectDir)}`);
|
|
231
271
|
console.log("");
|
|
232
|
-
console.log(bold("
|
|
272
|
+
console.log(bold("Quick start:"));
|
|
233
273
|
console.log("");
|
|
234
274
|
console.log(` ${dim("$")} cd ${projectName}`);
|
|
235
|
-
console.log(` ${dim("$")}
|
|
236
|
-
console.log("");
|
|
237
|
-
console.log(bold("AI content generation:"));
|
|
275
|
+
console.log(` ${dim("$")} bash start.sh ${dim("# Start Claude Code to build your site")}`);
|
|
238
276
|
console.log("");
|
|
239
|
-
console.log(
|
|
240
|
-
console.log(` 2. ${dim("$")} npx @webhouse/cms-cli ai generate posts "Write a blog post about..."`);
|
|
277
|
+
console.log(bold("Or with a custom prompt:"));
|
|
241
278
|
console.log("");
|
|
242
|
-
console.log(
|
|
279
|
+
console.log(` ${dim("$")} bash start.sh "Build a portfolio site with dark theme"`);
|
|
243
280
|
console.log("");
|
|
244
|
-
console.log(
|
|
245
|
-
console.log(
|
|
281
|
+
console.log(dim(" Claude Code will read CLAUDE.md and understand how to use the CMS."));
|
|
282
|
+
console.log(dim(" Content is stored as JSON in content/ \u2014 no server needed."));
|
|
246
283
|
console.log("");
|