create-kide-app 0.0.12 → 0.0.13

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.
Files changed (2) hide show
  1. package/index.js +18 -5
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -94,6 +94,9 @@ async function main() {
94
94
  cpSync(path.join(targetDir, "db.ts"), path.join(projectDir, "src/cms/adapters/db.ts"));
95
95
  cpSync(path.join(targetDir, "drizzle.config.ts"), path.join(projectDir, "drizzle.config.ts"));
96
96
 
97
+ // Write .npmrc to allow native module build scripts (pnpm 10+ blocks them by default)
98
+ writeFileSync(path.join(projectDir, ".npmrc"), "ignore-scripts=false\n");
99
+
97
100
  if (target === "cloudflare") {
98
101
  cpSync(path.join(targetDir, "storage.ts"), path.join(projectDir, "src/cms/adapters/storage.ts"));
99
102
  const uploadsRouteDir = path.join(projectDir, "src/pages/uploads");
@@ -150,11 +153,21 @@ async function main() {
150
153
  s.start("Installing dependencies");
151
154
  try {
152
155
  execSync(pm.install, { cwd: projectDir, stdio: "pipe" });
153
- // Rebuild native deps that pnpm may have skipped (e.g. better-sqlite3 bindings)
154
- try {
155
- execSync("pnpm rebuild better-sqlite3", { cwd: projectDir, stdio: "pipe" });
156
- } catch {
157
- // Ignore — only matters for local target
156
+ // Ensure better-sqlite3 native bindings are built (pnpm 10+ may block install scripts)
157
+ if (target === "local") {
158
+ try {
159
+ execSync("pnpm rebuild better-sqlite3", { cwd: projectDir, stdio: "pipe" });
160
+ } catch {
161
+ // Fallback: directly run prebuild-install in the package directory
162
+ try {
163
+ const sqliteDir = execSync("find node_modules/.pnpm -type d -name better-sqlite3 -path '*/node_modules/better-sqlite3' | head -1", {
164
+ cwd: projectDir,
165
+ }).toString().trim();
166
+ if (sqliteDir) {
167
+ execSync("npx prebuild-install || node-gyp rebuild", { cwd: path.join(projectDir, sqliteDir), stdio: "pipe" });
168
+ }
169
+ } catch {}
170
+ }
158
171
  }
159
172
  s.stop("Dependencies installed");
160
173
  } catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-kide-app",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "description": "Scaffold a new Kide CMS project",
5
5
  "author": "Matti Hernesniemi",
6
6
  "license": "MIT",