@easy-cms/next 1.50.0 → 1.51.0

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/dist/index.js +8 -4
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -59,15 +59,19 @@ function loadAfter() {
59
59
  function createAdminRouteHandlers(config, options = {}) {
60
60
  let handler;
61
61
  const handle = async (request) => {
62
- handler ??= resolveConfig(config).then(
63
- (resolved) => adminHandlerFor(resolved, {
62
+ handler ??= resolveConfig(config).then((resolved) => {
63
+ if (!resolved.admin.enabled)
64
+ console.warn(
65
+ `[easy-cms] admin.enabled is false: ${resolved.admin.path} answers 404. The admin route file can go.`
66
+ );
67
+ return adminHandlerFor(resolved, {
64
68
  // The site is this Next.js app.
65
69
  siteURL: resolved.admin.siteURL || "/",
66
70
  appDir: options.appDir ?? adminAppDir(),
67
71
  // Next.js strips trailing slashes; redirecting back would loop.
68
72
  trailingSlashRedirect: false
69
- })
70
- );
73
+ });
74
+ });
71
75
  return (await handler)(request);
72
76
  };
73
77
  return { GET: handle, HEAD: handle };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easy-cms/next",
3
- "version": "1.50.0",
3
+ "version": "1.51.0",
4
4
  "description": "Next.js adapter for Easy CMS",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -30,19 +30,19 @@
30
30
  "node": ">=22.12"
31
31
  },
32
32
  "dependencies": {
33
- "@easy-cms/admin": "^1.50.0"
33
+ "@easy-cms/admin": "^1.51.0"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "next": ">=15.0.0",
37
37
  "react": ">=19.0.0",
38
- "@easy-cms/core": "^1.50.0"
38
+ "@easy-cms/core": "^1.51.0"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/react": "^19.2.0",
42
42
  "next": "^16.4.3",
43
43
  "react": "^19.2.0",
44
- "@easy-cms/core": "^1.50.0",
45
- "@easy-cms/db-sqlite": "^1.50.0"
44
+ "@easy-cms/core": "^1.51.0",
45
+ "@easy-cms/db-sqlite": "^1.51.0"
46
46
  },
47
47
  "publishConfig": {
48
48
  "access": "public"