@cmssy/next 4.6.0 → 4.6.1
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/index.cjs +10 -1
- package/dist/index.js +10 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -10,7 +10,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
10
10
|
var server = require('next/server');
|
|
11
11
|
var crypto$1 = require('crypto');
|
|
12
12
|
|
|
13
|
-
// src/
|
|
13
|
+
// src/create-cmssy-page.tsx
|
|
14
14
|
var CMSSY_SESSION_COOKIE = "cmssy_session";
|
|
15
15
|
var SESSION_MAX_AGE_SECONDS = 30 * 24 * 60 * 60;
|
|
16
16
|
var MIN_SESSION_SECRET_LENGTH = 32;
|
|
@@ -114,6 +114,15 @@ function defineCmssyConfig(config) {
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
if (missing.length > 0) {
|
|
117
|
+
if (typeof window !== "undefined") {
|
|
118
|
+
throw new Error(
|
|
119
|
+
`cmssy: the config was evaluated in the browser, so it cannot see the server's environment variables.
|
|
120
|
+
|
|
121
|
+
This is an import problem, not a config problem: a client component ("use client") imported a VALUE from a module that reads the cmssy config - directly, or through a helper next to one.
|
|
122
|
+
|
|
123
|
+
Fix it by importing types only (they are erased at build time), or by moving the value into a module that does not touch the config.`
|
|
124
|
+
);
|
|
125
|
+
}
|
|
117
126
|
throw new Error(
|
|
118
127
|
`cmssy: missing required configuration:
|
|
119
128
|
- ${missing.join(
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
9
9
|
import { NextResponse } from 'next/server';
|
|
10
10
|
import { createHmac, timingSafeEqual } from 'crypto';
|
|
11
11
|
|
|
12
|
-
// src/
|
|
12
|
+
// src/create-cmssy-page.tsx
|
|
13
13
|
var CMSSY_SESSION_COOKIE = "cmssy_session";
|
|
14
14
|
var SESSION_MAX_AGE_SECONDS = 30 * 24 * 60 * 60;
|
|
15
15
|
var MIN_SESSION_SECRET_LENGTH = 32;
|
|
@@ -113,6 +113,15 @@ function defineCmssyConfig(config) {
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
if (missing.length > 0) {
|
|
116
|
+
if (typeof window !== "undefined") {
|
|
117
|
+
throw new Error(
|
|
118
|
+
`cmssy: the config was evaluated in the browser, so it cannot see the server's environment variables.
|
|
119
|
+
|
|
120
|
+
This is an import problem, not a config problem: a client component ("use client") imported a VALUE from a module that reads the cmssy config - directly, or through a helper next to one.
|
|
121
|
+
|
|
122
|
+
Fix it by importing types only (they are erased at build time), or by moving the value into a module that does not touch the config.`
|
|
123
|
+
);
|
|
124
|
+
}
|
|
116
125
|
throw new Error(
|
|
117
126
|
`cmssy: missing required configuration:
|
|
118
127
|
- ${missing.join(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cmssy/next",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.1",
|
|
4
4
|
"description": "Next.js App Router bindings for cmssy headless sites (createCmssyPage + draft preview)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cmssy",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"dist"
|
|
47
47
|
],
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@cmssy/react": "^4.6.
|
|
49
|
+
"@cmssy/react": "^4.6.1",
|
|
50
50
|
"next": ">=15",
|
|
51
51
|
"react": "^18.2.0 || ^19.0.0",
|
|
52
52
|
"react-dom": "^18.2.0 || ^19.0.0"
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"tsup": "^8.3.0",
|
|
61
61
|
"typescript": "^5.6.0",
|
|
62
62
|
"vitest": "^2.1.0",
|
|
63
|
-
"@cmssy/react": "4.6.
|
|
63
|
+
"@cmssy/react": "4.6.1"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"jose": "^6.2.3",
|