@anthusai/papyrus 1.0.0-next.36 → 1.0.0-next.38
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.mjs +8 -2
package/package.json
CHANGED
package/routes.manifest.json
CHANGED
package/src/with-papyrus.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { fileURLToPath } from "node:url";
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Wrap a publication repo's Next config for Papyrus (SPIKE, PPY-82be6c).
|
|
7
|
-
* - transpile the package
|
|
7
|
+
* - transpile the package and the dependencies that ship TypeScript source (cyclotron),
|
|
8
8
|
* - alias `papyrus-site` -> ./papyrus.config.ts,
|
|
9
9
|
* `papyrus-amplify-outputs` -> ./amplify_outputs.json and
|
|
10
10
|
* `papyrus-site-theme` -> ./publication/theme.css when it exists, else the shipped
|
|
@@ -23,6 +23,12 @@ const SERVER_EXTERNAL = [
|
|
|
23
23
|
"@aws-amplify/data-schema",
|
|
24
24
|
];
|
|
25
25
|
|
|
26
|
+
export const DEFAULT_TRANSPILE_PACKAGES = ["@anthusai/papyrus", "cyclotron"];
|
|
27
|
+
|
|
28
|
+
export function mergeTranspilePackages(existing = []) {
|
|
29
|
+
return [...new Set([...existing, ...DEFAULT_TRANSPILE_PACKAGES])];
|
|
30
|
+
}
|
|
31
|
+
|
|
26
32
|
export const RUNTIME_TRACED_FILES = ["./corpora/**/*", "./amplify_outputs.json"];
|
|
27
33
|
|
|
28
34
|
export function mergeOutputFileTracingIncludes(existing = {}) {
|
|
@@ -49,7 +55,7 @@ export function withPapyrus(nextConfig = {}, options = {}) {
|
|
|
49
55
|
return {
|
|
50
56
|
distDir: process.env.NEXT_DIST_DIR || ".next",
|
|
51
57
|
...nextConfig,
|
|
52
|
-
transpilePackages:
|
|
58
|
+
transpilePackages: mergeTranspilePackages(nextConfig.transpilePackages),
|
|
53
59
|
serverExternalPackages: [...new Set([...(nextConfig.serverExternalPackages ?? []), ...SERVER_EXTERNAL])],
|
|
54
60
|
outputFileTracingIncludes: mergeOutputFileTracingIncludes(nextConfig.outputFileTracingIncludes),
|
|
55
61
|
images: nextConfig.images ?? { remotePatterns: [{ protocol: "https", hostname: "**" }] },
|