opacacms 0.3.7 → 0.3.8
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/{chunk-h2y2t07h.js → chunk-pqjyh3tk.js} +11 -2
- package/dist/cli/index.js +8 -2
- package/dist/runtimes/bun.js +1 -1
- package/dist/runtimes/cloudflare-workers.js +1 -1
- package/dist/runtimes/next.js +1 -1
- package/dist/runtimes/node.js +1 -1
- package/dist/server.js +1 -1
- package/package.json +1 -1
|
@@ -1786,8 +1786,17 @@ function createDatabaseInitMiddleware(config, state) {
|
|
|
1786
1786
|
const shouldMigrate = config.runMigrationsOnStartup || isDev;
|
|
1787
1787
|
if (shouldMigrate) {
|
|
1788
1788
|
if (config.runMigrationsOnStartup && config.db.runMigrations) {
|
|
1789
|
-
|
|
1790
|
-
|
|
1789
|
+
try {
|
|
1790
|
+
logger.info("Running file-based migrations on startup...");
|
|
1791
|
+
await config.db.runMigrations();
|
|
1792
|
+
} catch (e) {
|
|
1793
|
+
if (e.code === "ENOENT" && e.path && e.path.includes("migrations")) {
|
|
1794
|
+
logger.debug("No 'migrations' folder found. Skipping file-based migrations.");
|
|
1795
|
+
} else {
|
|
1796
|
+
logger.error("Error running migrations on startup:");
|
|
1797
|
+
console.error(e);
|
|
1798
|
+
}
|
|
1799
|
+
}
|
|
1791
1800
|
}
|
|
1792
1801
|
await runAuthMigrations(config.db);
|
|
1793
1802
|
} else {
|
package/dist/cli/index.js
CHANGED
|
@@ -2031,7 +2031,7 @@ var init_init = __esm(() => {
|
|
|
2031
2031
|
const nextPathPrefix = framework === "nextjs" ? `${srcDir}app/(opaca)/` : "";
|
|
2032
2032
|
const cfPathPrefix = framework === "cloudflare-workers" ? "src/(opaca)/" : "";
|
|
2033
2033
|
const pathPrefix = framework === "nextjs" ? nextPathPrefix : cfPathPrefix;
|
|
2034
|
-
const configCode = `import { defineConfig } from 'opacacms
|
|
2034
|
+
const configCode = `import { defineConfig } from 'opacacms';
|
|
2035
2035
|
${dbImport}
|
|
2036
2036
|
import { posts } from './${pathPrefix}_collections/posts';
|
|
2037
2037
|
import { siteSettings } from './${pathPrefix}_globals/site-settings';
|
|
@@ -2243,7 +2243,7 @@ console.log('\uD83D\uDE80 OpacaCMS Backend Listening on http://localhost:3001');
|
|
|
2243
2243
|
if (!pkg.dependencies["kysely-bun-sqlite"])
|
|
2244
2244
|
pkg.dependencies["kysely-bun-sqlite"] = "latest";
|
|
2245
2245
|
if (framework === "nextjs" && pkg.scripts && pkg.scripts.dev) {
|
|
2246
|
-
pkg.scripts.dev = pkg.scripts.dev.replace("next dev", "
|
|
2246
|
+
pkg.scripts.dev = pkg.scripts.dev.replace("next dev", "bun --bun next dev");
|
|
2247
2247
|
}
|
|
2248
2248
|
} else if (dbType === "better-sqlite3") {
|
|
2249
2249
|
if (!pkg.dependencies["better-sqlite3"])
|
|
@@ -2264,6 +2264,12 @@ console.log('\uD83D\uDE80 OpacaCMS Backend Listening on http://localhost:3001');
|
|
|
2264
2264
|
Vt2(`1. Check the newly created \`opaca.config.ts\` and \`(opaca)\` folder.
|
|
2265
2265
|
2. Run \`npm install\` (or your preferred package manager) to install dependencies.
|
|
2266
2266
|
3. Start your dev server!`, "Next Steps");
|
|
2267
|
+
if (dbType === "better-sqlite3") {
|
|
2268
|
+
Vt2(import_picocolors.default.yellow(`WARNING: better-sqlite3 relies on C++ native bindings.
|
|
2269
|
+
` + `It often fails to compile or locate bindings on newer Node.js versions (e.g. 20/22).
|
|
2270
|
+
` + `If you encounter 'Could not locate bindings file' errors during development,
|
|
2271
|
+
` + "consider switching to 'bun-sqlite' (if using Bun) or PostgreSQL."), "Important Note");
|
|
2272
|
+
}
|
|
2267
2273
|
Gt(`Build something awesome! \uD83C\uDF88`);
|
|
2268
2274
|
}
|
|
2269
2275
|
});
|
package/dist/runtimes/bun.js
CHANGED
package/dist/runtimes/next.js
CHANGED
package/dist/runtimes/node.js
CHANGED
package/dist/server.js
CHANGED