create-kide-app 0.0.11 → 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.
- package/index.js +19 -0
- 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,6 +153,22 @@ async function main() {
|
|
|
150
153
|
s.start("Installing dependencies");
|
|
151
154
|
try {
|
|
152
155
|
execSync(pm.install, { cwd: projectDir, stdio: "pipe" });
|
|
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
|
+
}
|
|
171
|
+
}
|
|
153
172
|
s.stop("Dependencies installed");
|
|
154
173
|
} catch {
|
|
155
174
|
s.stop(`${pm.install} failed — run it manually`);
|