@anthusai/papyrus 1.0.0-next.26 → 1.0.0-next.28

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.
@@ -1,12 +1,5 @@
1
- import { NewsDeskClientProvider } from "../../components/news-desk-client-provider";
2
- import { resolveDevSandboxEditorAuth } from "../../lib/dev-sandbox-editor-auth";
1
+ import { NewsroomClientShell } from "../../components/newsroom-client-shell";
3
2
 
4
3
  export default function NewsroomLayout({ children }: Readonly<{ children: React.ReactNode }>) {
5
- const devSandboxEditorAuth = resolveDevSandboxEditorAuth();
6
-
7
- return (
8
- <NewsDeskClientProvider devSandboxEditorAuth={devSandboxEditorAuth}>
9
- {children}
10
- </NewsDeskClientProvider>
11
- );
4
+ return <NewsroomClientShell>{children}</NewsroomClientShell>;
12
5
  }
package/app/page.tsx CHANGED
@@ -18,6 +18,7 @@ import { SITE_BRAND, rootRoute } from "../lib/site-brand";
18
18
  import { notFound, redirect } from "next/navigation";
19
19
  import { getReaderBasePath } from "../lib/reader-base-path";
20
20
  import { buildRootRedirectTarget } from "../lib/root-route-redirect";
21
+ import { NewsroomClientShell } from "../components/newsroom-client-shell";
21
22
  import NewsDeskRootPage, { type NewsDeskRootSearchParams } from "./newsroom/page";
22
23
 
23
24
  export const dynamic = "force-dynamic";
@@ -42,7 +43,11 @@ export default async function Home({ searchParams }: HomePageProps) {
42
43
  const publicationOwnsRoot = getReaderBasePath() !== "";
43
44
 
44
45
  if (!publicationOwnsRoot && rootRoute.kind === "newsroom" && !scenarioId) {
45
- return <NewsDeskRootPage searchParams={searchParams} />;
46
+ return (
47
+ <NewsroomClientShell>
48
+ <NewsDeskRootPage searchParams={searchParams} />
49
+ </NewsroomClientShell>
50
+ );
46
51
  }
47
52
 
48
53
  if (!publicationOwnsRoot && rootRoute.kind === "redirect") {
@@ -0,0 +1,12 @@
1
+ import { NewsDeskClientProvider } from "./news-desk-client-provider";
2
+ import { resolveDevSandboxEditorAuth } from "../lib/dev-sandbox-editor-auth";
3
+
4
+ export function NewsroomClientShell({ children }: Readonly<{ children: React.ReactNode }>) {
5
+ const devSandboxEditorAuth = resolveDevSandboxEditorAuth();
6
+
7
+ return (
8
+ <NewsDeskClientProvider devSandboxEditorAuth={devSandboxEditorAuth}>
9
+ {children}
10
+ </NewsDeskClientProvider>
11
+ );
12
+ }
@@ -15,7 +15,6 @@ function commandLines(commands, indent) {
15
15
  const NPM_CLEAN_INSTALL = "npm ci --cache .npm --prefer-offline";
16
16
  const FRONTEND_ENVIRONMENT_CAPTURE = "env | grep -e '^PAPYRUS_' -e '^SITE_ENV=' -e '^NEXT_PUBLIC_' >> .env.production";
17
17
  const CHECKOUT_AS_PAPYRUS_ROOT = "PAPYRUS_ROOT=\"$PWD\"";
18
- const RUNTIME_OUTPUTS_ENVIRONMENT = "echo PAPYRUS_AMPLIFY_OUTPUTS=.next/amplify_outputs.json >> .env.production";
19
18
  const RUNTIME_OUTPUTS_COPY = "cp amplify_outputs.json .next/amplify_outputs.json";
20
19
  function pythonProvisioningCommands(config) {
21
20
  return [
@@ -55,7 +54,6 @@ export function cmsProductionBuildSpec(config) {
55
54
  ], " "),
56
55
  ...frontendSection([], [
57
56
  FRONTEND_ENVIRONMENT_CAPTURE,
58
- ...(config.frontend === "pretext" ? [RUNTIME_OUTPUTS_ENVIRONMENT] : []),
59
57
  "npx papyrus-app sync && npm run build",
60
58
  ...(config.frontend === "pretext" ? [RUNTIME_OUTPUTS_COPY] : []),
61
59
  ], ".next", [".next/cache/**/*", ".npm/**/*"]),
@@ -73,7 +71,6 @@ export function cmsStagingBuildSpec(config) {
73
71
  "version: 1",
74
72
  ...frontendSection(preBuild, [
75
73
  FRONTEND_ENVIRONMENT_CAPTURE,
76
- RUNTIME_OUTPUTS_ENVIRONMENT,
77
74
  "npx papyrus-app sync && npm run build",
78
75
  RUNTIME_OUTPUTS_COPY,
79
76
  ], ".next", cachePaths),
@@ -24,9 +24,6 @@ const FRONTEND_ENVIRONMENT_CAPTURE =
24
24
 
25
25
  const CHECKOUT_AS_PAPYRUS_ROOT = "PAPYRUS_ROOT=\"$PWD\"";
26
26
 
27
- const RUNTIME_OUTPUTS_ENVIRONMENT =
28
- "echo PAPYRUS_AMPLIFY_OUTPUTS=.next/amplify_outputs.json >> .env.production";
29
-
30
27
  const RUNTIME_OUTPUTS_COPY = "cp amplify_outputs.json .next/amplify_outputs.json";
31
28
 
32
29
  function pythonProvisioningCommands(config: AmplifyAppShellSiteConfig): string[] {
@@ -85,7 +82,6 @@ export function cmsProductionBuildSpec(config: AmplifyAppShellSiteConfig): strin
85
82
  [],
86
83
  [
87
84
  FRONTEND_ENVIRONMENT_CAPTURE,
88
- ...(config.frontend === "pretext" ? [RUNTIME_OUTPUTS_ENVIRONMENT] : []),
89
85
  "npx papyrus-app sync && npm run build",
90
86
  ...(config.frontend === "pretext" ? [RUNTIME_OUTPUTS_COPY] : []),
91
87
  ],
@@ -114,7 +110,6 @@ export function cmsStagingBuildSpec(config: AmplifyAppShellSiteConfig): string {
114
110
  preBuild,
115
111
  [
116
112
  FRONTEND_ENVIRONMENT_CAPTURE,
117
- RUNTIME_OUTPUTS_ENVIRONMENT,
118
113
  "npx papyrus-app sync && npm run build",
119
114
  RUNTIME_OUTPUTS_COPY,
120
115
  ],
@@ -6,7 +6,11 @@ export function getAmplifyOutputsPath(): string {
6
6
  if (explicit) {
7
7
  return path.isAbsolute(explicit) ? explicit : path.join(process.cwd(), explicit);
8
8
  }
9
- return path.join(process.cwd(), "amplify_outputs.json");
9
+ const checkoutRootPath = path.join(process.cwd(), "amplify_outputs.json");
10
+ if (fs.existsSync(checkoutRootPath)) return checkoutRootPath;
11
+ const shippedBundlePath = path.join(process.cwd(), ".next", "amplify_outputs.json");
12
+ if (fs.existsSync(shippedBundlePath)) return shippedBundlePath;
13
+ return checkoutRootPath;
10
14
  }
11
15
 
12
16
  export function readAmplifyOutputsFile(): Record<string, unknown> | null {
package/package.json CHANGED
@@ -86,6 +86,7 @@
86
86
  "./components/newsroom-article-editor": "./components/newsroom-article-editor.tsx",
87
87
  "./components/newsroom-articles-view": "./components/newsroom-articles-view.tsx",
88
88
  "./components/newsroom-assignments-view": "./components/newsroom-assignments-view.tsx",
89
+ "./components/newsroom-client-shell": "./components/newsroom-client-shell.tsx",
89
90
  "./components/newsroom-ops-overview": "./components/newsroom-ops-overview.tsx",
90
91
  "./components/newsroom-ops-shell": "./components/newsroom-ops-shell.tsx",
91
92
  "./components/newsroom-references-view": "./components/newsroom-references-view.tsx",
@@ -293,7 +294,7 @@
293
294
  "optional": true
294
295
  }
295
296
  },
296
- "version": "1.0.0-next.26",
297
+ "version": "1.0.0-next.28",
297
298
  "dependencies": {
298
299
  "@aws-amplify/adapter-nextjs": "^1.7.3",
299
300
  "@aws-sdk/client-cognito-identity-provider": "3.1045.0",
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.0-next.26",
2
+ "version": "1.0.0-next.28",
3
3
  "routes": [
4
4
  {
5
5
  "file": "app/%5F_preview/[[...path]]/route.ts",