create-kide-app 0.1.8 → 0.1.9
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 +1 -1
- package/index.js +37 -27
- package/package.json +4 -1
package/README.md
CHANGED
package/index.js
CHANGED
|
@@ -169,9 +169,13 @@ async function main() {
|
|
|
169
169
|
const branchArgs = templateRef ? ["--branch", templateRef] : [];
|
|
170
170
|
// execFileSync, not execSync: no shell, so projectDir is passed as one argv entry
|
|
171
171
|
// and can never be reinterpreted as a command regardless of what it contains.
|
|
172
|
-
execFileSync(
|
|
173
|
-
|
|
174
|
-
|
|
172
|
+
execFileSync(
|
|
173
|
+
"git",
|
|
174
|
+
["clone", "--depth", "1", ...branchArgs, REPO, projectDir],
|
|
175
|
+
{
|
|
176
|
+
stdio: "pipe",
|
|
177
|
+
},
|
|
178
|
+
);
|
|
175
179
|
try {
|
|
176
180
|
templateCommit = execSync("git rev-parse HEAD", {
|
|
177
181
|
cwd: projectDir,
|
|
@@ -208,31 +212,24 @@ async function main() {
|
|
|
208
212
|
const targetDir = path.join(adaptersDir, target);
|
|
209
213
|
|
|
210
214
|
if (target === "cloudflare") {
|
|
215
|
+
// The Cloudflare adapter/storage/env implementations live in the tree at
|
|
216
|
+
// src/cms/platform/cloudflare. We only copy the target's Astro/Drizzle/wrangler config and
|
|
217
|
+
// flip the two platform selectors to point at that profile — no source files are overwritten.
|
|
211
218
|
cpSync(
|
|
212
219
|
path.join(targetDir, "astro.config.mjs"),
|
|
213
220
|
path.join(projectDir, "astro.config.mjs"),
|
|
214
221
|
);
|
|
215
|
-
cpSync(
|
|
216
|
-
path.join(targetDir, "src/cms/adapters/db.ts"),
|
|
217
|
-
path.join(projectDir, "src/cms/adapters/db.ts"),
|
|
218
|
-
);
|
|
219
222
|
cpSync(
|
|
220
223
|
path.join(targetDir, "drizzle.config.ts"),
|
|
221
224
|
path.join(projectDir, "drizzle.config.ts"),
|
|
222
225
|
);
|
|
223
|
-
|
|
224
|
-
path.join(
|
|
225
|
-
|
|
226
|
-
);
|
|
227
|
-
cpSync(
|
|
228
|
-
path.join(targetDir, "src/cms/adapters/cf-env.ts"),
|
|
229
|
-
path.join(projectDir, "src/cms/adapters/cf-env.ts"),
|
|
226
|
+
writeFileSync(
|
|
227
|
+
path.join(projectDir, "src/cms/adapters/db.ts"),
|
|
228
|
+
'export * from "../platform/cloudflare/database";\n',
|
|
230
229
|
);
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
path.join(targetDir, "src/pages/uploads/[...path].ts"),
|
|
235
|
-
path.join(uploadsRouteDir, "[...path].ts"),
|
|
230
|
+
writeFileSync(
|
|
231
|
+
path.join(projectDir, "src/cms/adapters/storage.ts"),
|
|
232
|
+
'export * from "../platform/cloudflare/storage";\n',
|
|
236
233
|
);
|
|
237
234
|
}
|
|
238
235
|
|
|
@@ -243,7 +240,7 @@ async function main() {
|
|
|
243
240
|
|
|
244
241
|
if (target === "cloudflare") {
|
|
245
242
|
delete pkg.dependencies["@astrojs/node"];
|
|
246
|
-
pkg.dependencies["@astrojs/cloudflare"] = "
|
|
243
|
+
pkg.dependencies["@astrojs/cloudflare"] = "~14.1.7";
|
|
247
244
|
|
|
248
245
|
// Move better-sqlite3 to devDependencies — drizzle-kit needs it to push schema to local D1
|
|
249
246
|
if (pkg.dependencies["better-sqlite3"]) {
|
|
@@ -272,7 +269,7 @@ async function main() {
|
|
|
272
269
|
);
|
|
273
270
|
writeFileSync(path.join(projectDir, "wrangler.toml"), wranglerContent);
|
|
274
271
|
|
|
275
|
-
pkg.devDependencies.wrangler = "^4.
|
|
272
|
+
pkg.devDependencies.wrangler = "^4.83.0";
|
|
276
273
|
|
|
277
274
|
pkg.scripts.dev = "astro dev";
|
|
278
275
|
pkg.scripts.build = "astro build";
|
|
@@ -713,12 +710,25 @@ async function main() {
|
|
|
713
710
|
// --- Done ---
|
|
714
711
|
|
|
715
712
|
if (target === "local") {
|
|
716
|
-
p.
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
}
|
|
720
|
-
|
|
721
|
-
|
|
713
|
+
const startDev = await p.confirm({
|
|
714
|
+
message: "Start the dev server now?",
|
|
715
|
+
initialValue: true,
|
|
716
|
+
});
|
|
717
|
+
|
|
718
|
+
if (!p.isCancel(startDev) && startDev) {
|
|
719
|
+
p.outro("Starting dev server...");
|
|
720
|
+
try {
|
|
721
|
+
execSync(`${pm.run} dev`, { cwd: projectDir, stdio: "inherit" });
|
|
722
|
+
} catch {
|
|
723
|
+
console.log(`\n Project directory: ${projectDir}`);
|
|
724
|
+
console.log(` To start again: cd ${projectName} && pnpm dev\n`);
|
|
725
|
+
}
|
|
726
|
+
} else {
|
|
727
|
+
p.note(
|
|
728
|
+
[`cd ${projectName}`, "", `${pm.run} dev`].join("\n"),
|
|
729
|
+
"Next steps",
|
|
730
|
+
);
|
|
731
|
+
p.outro("Project created!");
|
|
722
732
|
}
|
|
723
733
|
} else {
|
|
724
734
|
if (cf.deployed && cf.url) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-kide-app",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Scaffold a new Kide CMS project",
|
|
5
5
|
"author": "Matti Hernesniemi",
|
|
6
6
|
"license": "MIT",
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
"bin": {
|
|
9
9
|
"create-kide-app": "./index.js"
|
|
10
10
|
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"release": "npm version patch && git push --follow-tags && npm publish"
|
|
13
|
+
},
|
|
11
14
|
"files": [
|
|
12
15
|
"index.js"
|
|
13
16
|
],
|