@webhouse/create-cms 0.2.3 → 0.2.4
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 +39 -9
- 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";
|
|
@@ -198,6 +204,33 @@ write(".claude/settings.json", JSON.stringify({
|
|
|
198
204
|
]
|
|
199
205
|
}
|
|
200
206
|
}, null, 2) + "\n");
|
|
207
|
+
write("start.sh", `#!/bin/bash
|
|
208
|
+
# Start a Claude Code session to build your site
|
|
209
|
+
# Usage: bash start.sh [optional prompt]
|
|
210
|
+
|
|
211
|
+
set -e
|
|
212
|
+
cd "$(dirname "$0")"
|
|
213
|
+
|
|
214
|
+
# Install dependencies if needed
|
|
215
|
+
if [ ! -d "node_modules" ]; then
|
|
216
|
+
echo "Installing dependencies..."
|
|
217
|
+
npm install 2>/dev/null || pnpm install 2>/dev/null || yarn install 2>/dev/null
|
|
218
|
+
fi
|
|
219
|
+
|
|
220
|
+
# Default prompt if none provided
|
|
221
|
+
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.}"
|
|
222
|
+
|
|
223
|
+
echo ""
|
|
224
|
+
echo "Starting Claude Code..."
|
|
225
|
+
echo ""
|
|
226
|
+
|
|
227
|
+
claude "$PROMPT"
|
|
228
|
+
`);
|
|
229
|
+
try {
|
|
230
|
+
const { chmodSync } = __require("fs");
|
|
231
|
+
chmodSync(join(dir, "start.sh"), 493);
|
|
232
|
+
} catch {
|
|
233
|
+
}
|
|
201
234
|
console.log("");
|
|
202
235
|
function detectPackageManager() {
|
|
203
236
|
const userAgent = process.env.npm_config_user_agent || "";
|
|
@@ -229,18 +262,15 @@ try {
|
|
|
229
262
|
console.log("");
|
|
230
263
|
console.log(`${green("\u2713")} Project created at ${dim(projectDir)}`);
|
|
231
264
|
console.log("");
|
|
232
|
-
console.log(bold("
|
|
265
|
+
console.log(bold("Quick start:"));
|
|
233
266
|
console.log("");
|
|
234
267
|
console.log(` ${dim("$")} cd ${projectName}`);
|
|
235
|
-
console.log(` ${dim("$")}
|
|
236
|
-
console.log("");
|
|
237
|
-
console.log(bold("AI content generation:"));
|
|
268
|
+
console.log(` ${dim("$")} bash start.sh ${dim("# Start Claude Code to build your site")}`);
|
|
238
269
|
console.log("");
|
|
239
|
-
console.log(
|
|
240
|
-
console.log(` 2. ${dim("$")} npx @webhouse/cms-cli ai generate posts "Write a blog post about..."`);
|
|
270
|
+
console.log(bold("Or with a custom prompt:"));
|
|
241
271
|
console.log("");
|
|
242
|
-
console.log(
|
|
272
|
+
console.log(` ${dim("$")} bash start.sh "Build a portfolio site with dark theme"`);
|
|
243
273
|
console.log("");
|
|
244
|
-
console.log(
|
|
245
|
-
console.log(
|
|
274
|
+
console.log(dim(" Claude Code will read CLAUDE.md and understand how to use the CMS."));
|
|
275
|
+
console.log(dim(" Content is stored as JSON in content/ \u2014 no server needed."));
|
|
246
276
|
console.log("");
|