@cmssy/core 16.10.0 → 16.11.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 +6 -6
- package/dist/index.js +6 -6
- package/dist/internal/locale.cjs +1 -1
- package/dist/internal/locale.js +1 -1
- package/dist/internal.cjs +1 -1
- package/dist/internal.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -45,6 +45,11 @@ var REQUIRED_CONFIG_ENV = [
|
|
|
45
45
|
["draftSecret", "CMSSY_DRAFT_SECRET"]
|
|
46
46
|
];
|
|
47
47
|
function defineCmssyConfig(config) {
|
|
48
|
+
if (typeof window !== "undefined") {
|
|
49
|
+
throw new Error(
|
|
50
|
+
"cmssy: defineCmssyConfig ran in the browser. It carries a draft secret, which opens every unpublished draft in the workspace, so it belongs to a server build alone.\n\nA client-side app - a Vite SPA, or anything else that builds its config in the browser - uses defineCmssyRouteConfig from @cmssy/react instead: org and workspaceSlug, nothing secret. Drafts are previewed from a server build.\n\nIf this module was meant to stay on the server, the import is the bug: client-side code imported a VALUE from it. Import types only, or move the value into a module that does not touch the config."
|
|
51
|
+
);
|
|
52
|
+
}
|
|
48
53
|
const resolved = { ...config };
|
|
49
54
|
const missing = [];
|
|
50
55
|
for (const [key, env] of REQUIRED_CONFIG_ENV) {
|
|
@@ -57,11 +62,6 @@ function defineCmssyConfig(config) {
|
|
|
57
62
|
}
|
|
58
63
|
}
|
|
59
64
|
if (missing.length > 0) {
|
|
60
|
-
if (typeof window !== "undefined") {
|
|
61
|
-
throw new Error(
|
|
62
|
-
"cmssy: the config was evaluated in the browser, so it cannot see the server's environment variables.\n\nThis is an import problem, not a config problem: client-side code imported a VALUE from a module that reads the cmssy config - directly, or through a helper sitting next to one.\n\nFix 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."
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
65
|
throw new Error(
|
|
66
66
|
`cmssy: missing required configuration:
|
|
67
67
|
- ${missing.join(
|
|
@@ -74,7 +74,7 @@ Set the listed environment variables (e.g. in .env.local) and restart the dev se
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
// src/version.ts
|
|
77
|
-
var CMSSY_CORE_VERSION = "16.
|
|
77
|
+
var CMSSY_CORE_VERSION = "16.11.1" ;
|
|
78
78
|
var CMSSY_USER_AGENT = `@cmssy/core/${CMSSY_CORE_VERSION}`;
|
|
79
79
|
|
|
80
80
|
// src/data/http.ts
|
package/dist/index.js
CHANGED
|
@@ -44,6 +44,11 @@ var REQUIRED_CONFIG_ENV = [
|
|
|
44
44
|
["draftSecret", "CMSSY_DRAFT_SECRET"]
|
|
45
45
|
];
|
|
46
46
|
function defineCmssyConfig(config) {
|
|
47
|
+
if (typeof window !== "undefined") {
|
|
48
|
+
throw new Error(
|
|
49
|
+
"cmssy: defineCmssyConfig ran in the browser. It carries a draft secret, which opens every unpublished draft in the workspace, so it belongs to a server build alone.\n\nA client-side app - a Vite SPA, or anything else that builds its config in the browser - uses defineCmssyRouteConfig from @cmssy/react instead: org and workspaceSlug, nothing secret. Drafts are previewed from a server build.\n\nIf this module was meant to stay on the server, the import is the bug: client-side code imported a VALUE from it. Import types only, or move the value into a module that does not touch the config."
|
|
50
|
+
);
|
|
51
|
+
}
|
|
47
52
|
const resolved = { ...config };
|
|
48
53
|
const missing = [];
|
|
49
54
|
for (const [key, env] of REQUIRED_CONFIG_ENV) {
|
|
@@ -56,11 +61,6 @@ function defineCmssyConfig(config) {
|
|
|
56
61
|
}
|
|
57
62
|
}
|
|
58
63
|
if (missing.length > 0) {
|
|
59
|
-
if (typeof window !== "undefined") {
|
|
60
|
-
throw new Error(
|
|
61
|
-
"cmssy: the config was evaluated in the browser, so it cannot see the server's environment variables.\n\nThis is an import problem, not a config problem: client-side code imported a VALUE from a module that reads the cmssy config - directly, or through a helper sitting next to one.\n\nFix 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."
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
64
|
throw new Error(
|
|
65
65
|
`cmssy: missing required configuration:
|
|
66
66
|
- ${missing.join(
|
|
@@ -73,7 +73,7 @@ Set the listed environment variables (e.g. in .env.local) and restart the dev se
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
// src/version.ts
|
|
76
|
-
var CMSSY_CORE_VERSION = "16.
|
|
76
|
+
var CMSSY_CORE_VERSION = "16.11.1" ;
|
|
77
77
|
var CMSSY_USER_AGENT = `@cmssy/core/${CMSSY_CORE_VERSION}`;
|
|
78
78
|
|
|
79
79
|
// src/data/http.ts
|
package/dist/internal/locale.cjs
CHANGED
package/dist/internal/locale.js
CHANGED
package/dist/internal.cjs
CHANGED
package/dist/internal.js
CHANGED