@anthusai/papyrus 5.42.0 → 5.42.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/package.json +1 -1
- package/routes.manifest.json +1 -1
- package/src/with-papyrus.d.mts +1 -0
- package/src/with-papyrus.mjs +16 -0
package/package.json
CHANGED
package/routes.manifest.json
CHANGED
package/src/with-papyrus.d.mts
CHANGED
package/src/with-papyrus.mjs
CHANGED
|
@@ -56,6 +56,18 @@ export function mergeTranspilePackages(existing = []) {
|
|
|
56
56
|
return [...new Set([...existing, ...DEFAULT_TRANSPILE_PACKAGES])];
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
/**
|
|
60
|
+
* chatticus's prebuilt chat runtime is written against zod 4 (`z.looseObject`) and imports bare `zod`.
|
|
61
|
+
* Publication repos pin zod 3.25 through a root `overrides` entry (Amplify constructs need it), which
|
|
62
|
+
* also flattens chatticus's own zod 4 dependency, so the bundle then fails to build. zod 3.25 ships the
|
|
63
|
+
* zod 4 API at `zod/v4`; point only chatticus's `zod` imports there, leaving every other zod import alone.
|
|
64
|
+
*/
|
|
65
|
+
export const CHATTICUS_PACKAGE_PATH = /[\\/]node_modules[\\/]chatticus[\\/]/;
|
|
66
|
+
|
|
67
|
+
export function redirectChatticusZod(resource) {
|
|
68
|
+
if (resource.request === "zod" && CHATTICUS_PACKAGE_PATH.test(resource.context ?? "")) resource.request = "zod/v4";
|
|
69
|
+
}
|
|
70
|
+
|
|
59
71
|
export const RUNTIME_TRACED_FILES = ["./corpora/**/*", "./amplify_outputs.json"];
|
|
60
72
|
|
|
61
73
|
export function mergeOutputFileTracingIncludes(existing = {}) {
|
|
@@ -99,6 +111,10 @@ export function withPapyrus(nextConfig = {}, options = {}) {
|
|
|
99
111
|
},
|
|
100
112
|
webpack(config, context) {
|
|
101
113
|
config.resolve.alias = { ...config.resolve.alias, ...aliases };
|
|
114
|
+
config.plugins = [
|
|
115
|
+
...(config.plugins ?? []),
|
|
116
|
+
new context.webpack.NormalModuleReplacementPlugin(/^zod$/, redirectChatticusZod),
|
|
117
|
+
];
|
|
102
118
|
return typeof nextConfig.webpack === "function" ? nextConfig.webpack(config, context) : config;
|
|
103
119
|
},
|
|
104
120
|
};
|