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.
@@ -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
- logger.info("Running file-based migrations on startup...");
1790
- await config.db.runMigrations();
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/config';
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", "bunx --bun 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
  });
@@ -3,7 +3,7 @@ import {
3
3
  } from "../chunk-a3qae86h.js";
4
4
  import {
5
5
  createAPIRouter
6
- } from "../chunk-h2y2t07h.js";
6
+ } from "../chunk-pqjyh3tk.js";
7
7
  import"../chunk-b1g8jmth.js";
8
8
  import"../chunk-2vbfc4q8.js";
9
9
  import"../chunk-hthm9srb.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createAPIRouter
3
- } from "../chunk-h2y2t07h.js";
3
+ } from "../chunk-pqjyh3tk.js";
4
4
  import"../chunk-b1g8jmth.js";
5
5
  import"../chunk-2vbfc4q8.js";
6
6
  import"../chunk-hthm9srb.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createAPIRouter
3
- } from "../chunk-h2y2t07h.js";
3
+ } from "../chunk-pqjyh3tk.js";
4
4
  import"../chunk-b1g8jmth.js";
5
5
  import"../chunk-2vbfc4q8.js";
6
6
  import"../chunk-hthm9srb.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "../chunk-a3qae86h.js";
4
4
  import {
5
5
  createAPIRouter
6
- } from "../chunk-h2y2t07h.js";
6
+ } from "../chunk-pqjyh3tk.js";
7
7
  import"../chunk-b1g8jmth.js";
8
8
  import"../chunk-2vbfc4q8.js";
9
9
  import"../chunk-hthm9srb.js";
package/dist/server.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  hydrateDoc,
8
8
  parsePopulate,
9
9
  populateDoc
10
- } from "./chunk-h2y2t07h.js";
10
+ } from "./chunk-pqjyh3tk.js";
11
11
  import {
12
12
  defineConfig
13
13
  } from "./chunk-1bd7fz7n.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opacacms",
3
- "version": "0.3.7",
3
+ "version": "0.3.8",
4
4
  "license": "MIT",
5
5
  "description": "OpacaCMS: A lightweight, type-safe, and developer-first Headless CMS for the edge and beyond.",
6
6
  "keywords": [