create-kide-app 0.1.1 → 0.1.2
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/index.js +39 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -61,6 +61,19 @@ async function main() {
|
|
|
61
61
|
process.exit(0);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
let seedDemo = false;
|
|
65
|
+
if (!cloudflare) {
|
|
66
|
+
const seed = await p.confirm({
|
|
67
|
+
message: "Seed database with demo content?",
|
|
68
|
+
initialValue: false,
|
|
69
|
+
});
|
|
70
|
+
if (p.isCancel(seed)) {
|
|
71
|
+
p.cancel("Setup cancelled.");
|
|
72
|
+
process.exit(0);
|
|
73
|
+
}
|
|
74
|
+
seedDemo = seed;
|
|
75
|
+
}
|
|
76
|
+
|
|
64
77
|
const s = p.spinner();
|
|
65
78
|
|
|
66
79
|
s.start("Cloning kide-cms");
|
|
@@ -113,6 +126,32 @@ async function main() {
|
|
|
113
126
|
s.stop("pnpm install failed — run it manually");
|
|
114
127
|
}
|
|
115
128
|
|
|
129
|
+
if (seedDemo) {
|
|
130
|
+
s.start("Generating CMS schema");
|
|
131
|
+
try {
|
|
132
|
+
execSync("pnpm cms:generate", { cwd: projectDir, stdio: "pipe" });
|
|
133
|
+
s.stop("Schema generated");
|
|
134
|
+
} catch {
|
|
135
|
+
s.stop("Schema generation failed — run `pnpm cms:generate` manually");
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
s.start("Pushing schema to database");
|
|
139
|
+
try {
|
|
140
|
+
execSync("pnpm exec drizzle-kit push --force", { cwd: projectDir, stdio: "pipe" });
|
|
141
|
+
s.stop("Schema pushed");
|
|
142
|
+
} catch {
|
|
143
|
+
s.stop("Schema push failed — will be set up on first dev start");
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
s.start("Seeding demo content");
|
|
147
|
+
try {
|
|
148
|
+
execSync("pnpm cms:seed", { cwd: projectDir, stdio: "pipe" });
|
|
149
|
+
s.stop("Demo content seeded");
|
|
150
|
+
} catch {
|
|
151
|
+
s.stop("Seeding failed — run `pnpm cms:seed` manually");
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
116
155
|
if (cloudflare) {
|
|
117
156
|
p.note(
|
|
118
157
|
[
|