@easy-cms/next 0.48.0 → 0.60.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.
- package/README.md +2 -1
- package/dist/config.js +6 -1
- package/dist/index.d.ts +8 -5
- package/dist/index.js +2 -2
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -55,7 +55,8 @@ Pages that read from the CMS should be dynamic (or use `revalidate`), otherwise
|
|
|
55
55
|
tries to query the database while prerendering.
|
|
56
56
|
|
|
57
57
|
`createRouteHandlers(config, { trustProxy: true })` uses `X-Forwarded-For` for login rate limiting;
|
|
58
|
-
enable it behind a proxy you trust
|
|
58
|
+
enable it behind a proxy you trust (Vercel and Netlify are recognized without it). It also takes
|
|
59
|
+
`basePath` and `getClientIp(request)`.
|
|
59
60
|
|
|
60
61
|
## Links
|
|
61
62
|
|
package/dist/config.js
CHANGED
|
@@ -2,7 +2,12 @@
|
|
|
2
2
|
import { existsSync } from "fs";
|
|
3
3
|
import { createRequire } from "module";
|
|
4
4
|
import { dirname, isAbsolute, join, relative, resolve } from "path";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
applyPlugins,
|
|
7
|
+
CONFIG_FILE_NAMES,
|
|
8
|
+
importConfig,
|
|
9
|
+
resolveAdminModule
|
|
10
|
+
} from "@easy-cms/core/internal";
|
|
6
11
|
var SERVER_EXTERNAL_PACKAGES = [
|
|
7
12
|
"@easy-cms/core",
|
|
8
13
|
"@easy-cms/admin",
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import { Config, EasyCMS, AuthUser } from '@easy-cms/core';
|
|
1
|
+
import { ApiHandlerOptions, Config, EasyCMS, AuthUser } from '@easy-cms/core';
|
|
2
|
+
export { ApiHandlerOptions } from '@easy-cms/core';
|
|
2
3
|
|
|
3
4
|
type Handler = (request: Request) => Promise<Response>;
|
|
5
|
+
|
|
4
6
|
/**
|
|
5
7
|
* The Easy CMS Local API for this server, typed from your config. Use it in Server
|
|
6
8
|
* Components, Route Handlers and Server Actions. The instance survives hot reloads, and is the
|
|
7
9
|
* same for every server layer, which Next.js each bundles the config into.
|
|
8
10
|
*/
|
|
9
11
|
declare function getEasyCMS<const C extends Config>(config: C): Promise<EasyCMS<C>>;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
/**
|
|
13
|
+
* `basePath`, `getClientIp` and `trustProxy` (use `X-Forwarded-For` for the client IP, only
|
|
14
|
+
* behind a proxy you trust; Vercel and Netlify are recognized without it).
|
|
15
|
+
*/
|
|
16
|
+
type RouteHandlerOptions = ApiHandlerOptions;
|
|
14
17
|
/**
|
|
15
18
|
* REST API route handlers. In `app/api/cms/[...path]/route.ts` (matching `routes.api`):
|
|
16
19
|
*
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,7 @@ function getEasyCMS(config) {
|
|
|
12
12
|
return sharedEasyCMS(config);
|
|
13
13
|
}
|
|
14
14
|
function createRouteHandlers(config, options = {}) {
|
|
15
|
-
const handle = createApiHandler(config,
|
|
15
|
+
const handle = createApiHandler(config, options);
|
|
16
16
|
return {
|
|
17
17
|
GET: handle,
|
|
18
18
|
HEAD: handle,
|
|
@@ -29,7 +29,7 @@ function createAdminRouteHandlers(config, options = {}) {
|
|
|
29
29
|
handler ??= resolveConfig(config).then(
|
|
30
30
|
(resolved) => adminHandlerFor(resolved, {
|
|
31
31
|
// The site is this Next.js app.
|
|
32
|
-
|
|
32
|
+
siteURL: resolved.admin.siteURL || "/",
|
|
33
33
|
appDir: options.appDir ?? adminAppDir(),
|
|
34
34
|
// Next.js strips trailing slashes; redirecting back would loop.
|
|
35
35
|
trailingSlashRedirect: false
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@easy-cms/next",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.60.0",
|
|
4
4
|
"description": "Next.js adapter for Easy CMS",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -26,19 +26,19 @@
|
|
|
26
26
|
"node": ">=22.12"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@easy-cms/admin": "^0.
|
|
29
|
+
"@easy-cms/admin": "^0.60.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"next": ">=15.0.0",
|
|
33
33
|
"react": ">=19.0.0",
|
|
34
|
-
"@easy-cms/core": "^0.
|
|
34
|
+
"@easy-cms/core": "^0.60.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/react": "^19.2.0",
|
|
38
38
|
"next": "^16.3.8",
|
|
39
39
|
"react": "^19.2.0",
|
|
40
|
-
"@easy-cms/core": "^0.
|
|
41
|
-
"@easy-cms/db-sqlite": "^0.
|
|
40
|
+
"@easy-cms/core": "^0.60.0",
|
|
41
|
+
"@easy-cms/db-sqlite": "^0.60.0"
|
|
42
42
|
},
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public"
|