diff --git a/local_testing/testpages/package.json b/local_testing/testpages/package.json index 865c779b..6631231a 100644 --- a/local_testing/testpages/package.json +++ b/local_testing/testpages/package.json @@ -10,7 +10,7 @@ }, "dependencies": { "@pantheon-systems/pcc-react-sample-library": "workspace:*", - "next": "^14.2.10", + "next": "^14.2.15", "react": "18.3.1", "react-dom": "18.3.1" }, diff --git a/packages/cli/package.json b/packages/cli/package.json index 884d0823..53f1d95e 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -37,7 +37,7 @@ }, "dependencies": { "@pantheon-systems/pcc-sdk-core": "workspace:*", - "axios": "^1.7.5", + "axios": "^1.7.6", "bluebird": "^3.7.2", "boxen": "^7.1.1", "chalk": "^5.3.0", diff --git a/packages/react-sdk/package.json b/packages/react-sdk/package.json index 1f42d416..31d435da 100644 --- a/packages/react-sdk/package.json +++ b/packages/react-sdk/package.json @@ -78,7 +78,7 @@ "eslint": "^8.57.0", "eslint-config-pcc-custom": "workspace:*", "jest": "29.5.0", - "next": "^14.2.10", + "next": "^14.2.15", "octokit": "^3.2.1", "ora": "^6.3.1", "react": "18.3.1", diff --git a/packages/vue-sdk/package.json b/packages/vue-sdk/package.json index 28aef525..68ca9376 100644 --- a/packages/vue-sdk/package.json +++ b/packages/vue-sdk/package.json @@ -62,7 +62,7 @@ "tsup": "^8.2.4", "typescript": "^5.5.4", "unplugin-vue": "^4.5.2", - "vite": "^5.1.8", + "vite": "^5.2.14", "vue": "3.4.27", "vue-3": "npm:vue@^3.4.27" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 398e52e2..f1a2c8f3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -88,8 +88,8 @@ importers: specifier: workspace:* version: link:../../packages/react-sample-library next: - specifier: ^14.2.10 - version: 14.2.10(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1) + specifier: ^14.2.15 + version: 14.2.22(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1) react: specifier: 18.3.1 version: 18.3.1 @@ -150,8 +150,8 @@ importers: specifier: workspace:* version: link:../core axios: - specifier: ^1.7.5 - version: 1.7.5 + specifier: ^1.7.6 + version: 1.7.9 bluebird: specifier: ^3.7.2 version: 3.7.2 @@ -340,7 +340,7 @@ importers: version: 8.1.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(encoding@0.1.13)(prettier@3.2.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@storybook/nextjs': specifier: ^8.1.4 - version: 8.1.4(@jest/globals@29.7.0)(@swc/core@1.4.2(@swc/helpers@0.5.5))(@types/jest@29.5.1)(babel-plugin-macros@3.1.0)(encoding@0.1.13)(esbuild@0.20.2)(jest@29.5.0(@types/node@20.11.21)(babel-plugin-macros@3.1.0))(next@14.2.10(@babel/core@7.25.2)(@playwright/test@1.49.1)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1))(prettier@3.2.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1)(type-fest@3.13.1)(typescript@5.5.4)(vitest@1.3.1(@types/node@20.11.21)(jsdom@22.1.0)(sass@1.71.1)(terser@5.28.1))(webpack-hot-middleware@2.26.1)(webpack@5.90.3(@swc/core@1.4.2(@swc/helpers@0.5.5))(esbuild@0.20.2)) + version: 8.1.4(@jest/globals@29.7.0)(@swc/core@1.4.2(@swc/helpers@0.5.5))(@types/jest@29.5.1)(babel-plugin-macros@3.1.0)(encoding@0.1.13)(esbuild@0.20.2)(jest@29.5.0(@types/node@20.11.21)(babel-plugin-macros@3.1.0))(next@14.2.22(@babel/core@7.25.2)(@playwright/test@1.49.1)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1))(prettier@3.2.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1)(type-fest@3.13.1)(typescript@5.5.4)(vitest@1.3.1(@types/node@20.11.21)(jsdom@22.1.0)(sass@1.71.1)(terser@5.28.1))(webpack-hot-middleware@2.26.1)(webpack@5.90.3(@swc/core@1.4.2(@swc/helpers@0.5.5))(esbuild@0.20.2)) '@storybook/react': specifier: ^8.1.4 version: 8.1.4(encoding@0.1.13)(prettier@3.2.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.5.4) @@ -463,8 +463,8 @@ importers: specifier: 29.5.0 version: 29.5.0(@types/node@20.16.1)(babel-plugin-macros@3.1.0) next: - specifier: ^14.2.10 - version: 14.2.10(@babel/core@7.25.2)(@playwright/test@1.49.1)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1) + specifier: ^14.2.15 + version: 14.2.22(@babel/core@7.25.2)(@playwright/test@1.49.1)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1) octokit: specifier: ^3.2.1 version: 3.2.1 @@ -570,10 +570,10 @@ importers: version: 5.5.4 unplugin-vue: specifier: ^4.5.2 - version: 4.5.2(vite@5.2.13(@types/node@20.11.21)(sass@1.71.1)(terser@5.28.1))(vue@3.4.27(typescript@5.5.4)) + version: 4.5.2(vite@5.4.10(@types/node@20.11.21)(sass@1.71.1)(terser@5.28.1))(vue@3.4.27(typescript@5.5.4)) vite: - specifier: ^5.1.8 - version: 5.2.13(@types/node@20.11.21)(sass@1.71.1)(terser@5.28.1) + specifier: ^5.2.14 + version: 5.4.10(@types/node@20.11.21)(sass@1.71.1)(terser@5.28.1) vue: specifier: 3.4.27 version: 3.4.27(typescript@5.5.4) @@ -697,11 +697,11 @@ importers: specifier: ^2.0.1 version: 2.0.1 next: - specifier: ^14.2.10 - version: 14.2.10(@babel/core@7.25.2)(@playwright/test@1.49.1)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1) + specifier: ^14.2.15 + version: 14.2.22(@babel/core@7.25.2)(@playwright/test@1.49.1)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1) next-seo: specifier: ^5.15.0 - version: 5.15.0(next@14.2.10(@babel/core@7.25.2)(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + version: 5.15.0(next@14.2.22(@babel/core@7.25.2)(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) query-string: specifier: ^8.2.0 version: 8.2.0 @@ -738,7 +738,7 @@ importers: version: 13.4.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@vitejs/plugin-react': specifier: ^4.2.1 - version: 4.2.1(vite@5.2.13(@types/node@20.16.1)(sass@1.71.1)(terser@5.28.1)) + version: 4.2.1(vite@5.4.10(@types/node@20.16.1)(sass@1.71.1)(terser@5.28.1)) autoprefixer: specifier: ^10.4.17 version: 10.4.17(postcss@8.4.35) @@ -767,8 +767,8 @@ importers: specifier: ^5.5.4 version: 5.5.4 vite: - specifier: ^5.1.8 - version: 5.2.13(@types/node@20.16.1)(sass@1.71.1)(terser@5.28.1) + specifier: ^5.2.14 + version: 5.4.10(@types/node@20.16.1)(sass@1.71.1)(terser@5.28.1) vitest: specifier: ^1.3.1 version: 1.3.1(@types/node@20.16.1)(jsdom@22.1.0)(sass@1.71.1)(terser@5.28.1) @@ -806,8 +806,8 @@ importers: specifier: ^2.0.1 version: 2.0.1 next: - specifier: ^14.2.10 - version: 14.2.10(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1) + specifier: ^14.2.15 + version: 14.2.22(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1) query-string: specifier: ^8.2.0 version: 8.2.0 @@ -844,7 +844,7 @@ importers: version: 13.4.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@vitejs/plugin-react': specifier: ^4.2.1 - version: 4.2.1(vite@5.2.13(@types/node@20.16.1)(sass@1.71.1)(terser@5.28.1)) + version: 4.2.1(vite@5.4.10(@types/node@20.16.1)(sass@1.71.1)(terser@5.28.1)) autoprefixer: specifier: ^10.4.17 version: 10.4.17(postcss@8.4.35) @@ -876,8 +876,8 @@ importers: specifier: ^5.5.4 version: 5.5.4 vite: - specifier: ^5.1.8 - version: 5.2.13(@types/node@20.16.1)(sass@1.71.1)(terser@5.28.1) + specifier: ^5.2.14 + version: 5.4.10(@types/node@20.16.1)(sass@1.71.1)(terser@5.28.1) vitest: specifier: ^1.3.1 version: 1.3.1(@types/node@20.16.1)(jsdom@22.1.0)(sass@1.71.1)(terser@5.28.1) @@ -918,11 +918,11 @@ importers: specifier: ^2.0.1 version: 2.0.1 next: - specifier: ^14.2.10 - version: 14.2.10(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1) + specifier: ^14.2.15 + version: 14.2.22(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1) next-seo: specifier: ^5.15.0 - version: 5.15.0(next@14.2.10(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + version: 5.15.0(next@14.2.22(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) query-string: specifier: ^8.2.0 version: 8.2.0 @@ -962,7 +962,7 @@ importers: version: 18.3.0 '@vitejs/plugin-react': specifier: ^4.2.1 - version: 4.2.1(vite@5.2.13(@types/node@20.16.1)(sass@1.71.1)(terser@5.28.1)) + version: 4.2.1(vite@5.4.10(@types/node@20.16.1)(sass@1.71.1)(terser@5.28.1)) autoprefixer: specifier: ^10.4.17 version: 10.4.17(postcss@8.4.35) @@ -991,8 +991,8 @@ importers: specifier: ^5.5.4 version: 5.5.4 vite: - specifier: ^5.1.8 - version: 5.2.13(@types/node@20.16.1)(sass@1.71.1)(terser@5.28.1) + specifier: ^5.2.14 + version: 5.4.10(@types/node@20.16.1)(sass@1.71.1)(terser@5.28.1) vitest: specifier: ^1.3.1 version: 1.3.1(@types/node@20.16.1)(jsdom@22.1.0)(sass@1.71.1)(terser@5.28.1) @@ -3469,62 +3469,62 @@ packages: resolution: {integrity: sha512-q3L9i3HoNfz0SGpTIS4zTcKBbRkxzCRpd169eyiTuk3IwcPC3/85mzLHranlKo2b+HYT0gu37YxGB45aD8A3Tw==} engines: {node: '>=18.0.0'} - '@next/env@14.2.10': - resolution: {integrity: sha512-dZIu93Bf5LUtluBXIv4woQw2cZVZ2DJTjax5/5DOs3lzEOeKLy7GxRSr4caK9/SCPdaW6bCgpye6+n4Dh9oJPw==} + '@next/env@14.2.22': + resolution: {integrity: sha512-EQ6y1QeNQglNmNIXvwP/Bb+lf7n9WtgcWvtoFsHquVLCJUuxRs+6SfZ5EK0/EqkkLex4RrDySvKgKNN7PXip7Q==} '@next/eslint-plugin-next@14.2.3': resolution: {integrity: sha512-L3oDricIIjgj1AVnRdRor21gI7mShlSwU/1ZGHmqM3LzHhXXhdkrfeNY5zif25Bi5Dd7fiJHsbhoZCHfXYvlAw==} - '@next/swc-darwin-arm64@14.2.10': - resolution: {integrity: sha512-V3z10NV+cvMAfxQUMhKgfQnPbjw+Ew3cnr64b0lr8MDiBJs3eLnM6RpGC46nhfMZsiXgQngCJKWGTC/yDcgrDQ==} + '@next/swc-darwin-arm64@14.2.22': + resolution: {integrity: sha512-HUaLiehovgnqY4TMBZJ3pDaOsTE1spIXeR10pWgdQVPYqDGQmHJBj3h3V6yC0uuo/RoY2GC0YBFRkOX3dI9WVQ==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] - '@next/swc-darwin-x64@14.2.10': - resolution: {integrity: sha512-Y0TC+FXbFUQ2MQgimJ/7Ina2mXIKhE7F+GUe1SgnzRmwFY3hX2z8nyVCxE82I2RicspdkZnSWMn4oTjIKz4uzA==} + '@next/swc-darwin-x64@14.2.22': + resolution: {integrity: sha512-ApVDANousaAGrosWvxoGdLT0uvLBUC+srqOcpXuyfglA40cP2LBFaGmBjhgpxYk5z4xmunzqQvcIgXawTzo2uQ==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] - '@next/swc-linux-arm64-gnu@14.2.10': - resolution: {integrity: sha512-ZfQ7yOy5zyskSj9rFpa0Yd7gkrBnJTkYVSya95hX3zeBG9E55Z6OTNPn1j2BTFWvOVVj65C3T+qsjOyVI9DQpA==} + '@next/swc-linux-arm64-gnu@14.2.22': + resolution: {integrity: sha512-3O2J99Bk9aM+d4CGn9eEayJXHuH9QLx0BctvWyuUGtJ3/mH6lkfAPRI4FidmHMBQBB4UcvLMfNf8vF0NZT7iKw==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - '@next/swc-linux-arm64-musl@14.2.10': - resolution: {integrity: sha512-n2i5o3y2jpBfXFRxDREr342BGIQCJbdAUi/K4q6Env3aSx8erM9VuKXHw5KNROK9ejFSPf0LhoSkU/ZiNdacpQ==} + '@next/swc-linux-arm64-musl@14.2.22': + resolution: {integrity: sha512-H/hqfRz75yy60y5Eg7DxYfbmHMjv60Dsa6IWHzpJSz4MRkZNy5eDnEW9wyts9bkxwbOVZNPHeb3NkqanP+nGPg==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - '@next/swc-linux-x64-gnu@14.2.10': - resolution: {integrity: sha512-GXvajAWh2woTT0GKEDlkVhFNxhJS/XdDmrVHrPOA83pLzlGPQnixqxD8u3bBB9oATBKB//5e4vpACnx5Vaxdqg==} + '@next/swc-linux-x64-gnu@14.2.22': + resolution: {integrity: sha512-LckLwlCLcGR1hlI5eiJymR8zSHPsuruuwaZ3H2uudr25+Dpzo6cRFjp/3OR5UYJt8LSwlXv9mmY4oI2QynwpqQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - '@next/swc-linux-x64-musl@14.2.10': - resolution: {integrity: sha512-opFFN5B0SnO+HTz4Wq4HaylXGFV+iHrVxd3YvREUX9K+xfc4ePbRrxqOuPOFjtSuiVouwe6uLeDtabjEIbkmDA==} + '@next/swc-linux-x64-musl@14.2.22': + resolution: {integrity: sha512-qGUutzmh0PoFU0fCSu0XYpOfT7ydBZgDfcETIeft46abPqP+dmePhwRGLhFKwZWxNWQCPprH26TjaTxM0Nv8mw==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - '@next/swc-win32-arm64-msvc@14.2.10': - resolution: {integrity: sha512-9NUzZuR8WiXTvv+EiU/MXdcQ1XUvFixbLIMNQiVHuzs7ZIFrJDLJDaOF1KaqttoTujpcxljM/RNAOmw1GhPPQQ==} + '@next/swc-win32-arm64-msvc@14.2.22': + resolution: {integrity: sha512-K6MwucMWmIvMb9GlvT0haYsfIPxfQD8yXqxwFy4uLFMeXIb2TcVYQimxkaFZv86I7sn1NOZnpOaVk5eaxThGIw==} engines: {node: '>= 10'} cpu: [arm64] os: [win32] - '@next/swc-win32-ia32-msvc@14.2.10': - resolution: {integrity: sha512-fr3aEbSd1GeW3YUMBkWAu4hcdjZ6g4NBl1uku4gAn661tcxd1bHs1THWYzdsbTRLcCKLjrDZlNp6j2HTfrw+Bg==} + '@next/swc-win32-ia32-msvc@14.2.22': + resolution: {integrity: sha512-5IhDDTPEbzPR31ZzqHe90LnNe7BlJUZvC4sA1thPJV6oN5WmtWjZ0bOYfNsyZx00FJt7gggNs6SrsX0UEIcIpA==} engines: {node: '>= 10'} cpu: [ia32] os: [win32] - '@next/swc-win32-x64-msvc@14.2.10': - resolution: {integrity: sha512-UjeVoRGKNL2zfbcQ6fscmgjBAS/inHBh63mjIlfPg/NG8Yn2ztqylXt5qilYb6hoHIwaU2ogHknHWWmahJjgZQ==} + '@next/swc-win32-x64-msvc@14.2.22': + resolution: {integrity: sha512-nvRaB1PyG4scn9/qNzlkwEwLzuoPH3Gjp7Q/pLuwUgOTt1oPMlnCI3A3rgkt+eZnU71emOiEv/mR201HoURPGg==} engines: {node: '>= 10'} cpu: [x64] os: [win32] @@ -6039,8 +6039,8 @@ packages: axios@0.21.4: resolution: {integrity: sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==} - axios@1.7.5: - resolution: {integrity: sha512-fZu86yCo+svH3uqJ/yTdQ0QHpQu5oL+/QE+QPSv6BZSkDAoky9vytxp7u5qk83OJFS3kEBcesWni9WTZAv3tSw==} + axios@1.7.9: + resolution: {integrity: sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==} axobject-query@3.2.1: resolution: {integrity: sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg==} @@ -10396,8 +10396,8 @@ packages: next-tick@1.1.0: resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==} - next@14.2.10: - resolution: {integrity: sha512-sDDExXnh33cY3RkS9JuFEKaS4HmlWmDKP1VJioucCG6z5KuA008DPsDZOzi8UfqEk3Ii+2NCQSJrfbEWtZZfww==} + next@14.2.22: + resolution: {integrity: sha512-Ps2caobQ9hlEhscLPiPm3J3SYhfwfpMqzsoCMZGWxt9jBRK9hoBZj2A37i8joKhsyth2EuVKDVJCTF5/H4iEDw==} engines: {node: '>=18.17.0'} hasBin: true peerDependencies: @@ -12788,7 +12788,6 @@ packages: sudo-prompt@8.2.5: resolution: {integrity: sha512-rlBo3HU/1zAJUrkY6jNxDOC9eVYliG6nS4JA8u8KAshITd07tafMc/Br7xQwCSseXwJ2iCcHCE8SNWX3q8Z+kw==} - deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. superjson@2.2.1: resolution: {integrity: sha512-8iGv75BYOa0xRJHK5vRLEjE2H/i4lulTjzpUXic3Eg8akftYjkmQDa8JARQ42rlczXyFR3IeRoeFCc7RxHsYZA==} @@ -17690,37 +17689,37 @@ snapshots: '@netlify/node-cookies': 0.1.0 urlpattern-polyfill: 8.0.2 - '@next/env@14.2.10': {} + '@next/env@14.2.22': {} '@next/eslint-plugin-next@14.2.3': dependencies: glob: 10.3.10 - '@next/swc-darwin-arm64@14.2.10': + '@next/swc-darwin-arm64@14.2.22': optional: true - '@next/swc-darwin-x64@14.2.10': + '@next/swc-darwin-x64@14.2.22': optional: true - '@next/swc-linux-arm64-gnu@14.2.10': + '@next/swc-linux-arm64-gnu@14.2.22': optional: true - '@next/swc-linux-arm64-musl@14.2.10': + '@next/swc-linux-arm64-musl@14.2.22': optional: true - '@next/swc-linux-x64-gnu@14.2.10': + '@next/swc-linux-x64-gnu@14.2.22': optional: true - '@next/swc-linux-x64-musl@14.2.10': + '@next/swc-linux-x64-musl@14.2.22': optional: true - '@next/swc-win32-arm64-msvc@14.2.10': + '@next/swc-win32-arm64-msvc@14.2.22': optional: true - '@next/swc-win32-ia32-msvc@14.2.10': + '@next/swc-win32-ia32-msvc@14.2.22': optional: true - '@next/swc-win32-x64-msvc@14.2.10': + '@next/swc-win32-x64-msvc@14.2.22': optional: true '@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1': @@ -19667,7 +19666,7 @@ snapshots: '@storybook/manager@8.1.4': {} - '@storybook/nextjs@8.1.4(@jest/globals@29.7.0)(@swc/core@1.4.2(@swc/helpers@0.5.5))(@types/jest@29.5.1)(babel-plugin-macros@3.1.0)(encoding@0.1.13)(esbuild@0.20.2)(jest@29.5.0(@types/node@20.11.21)(babel-plugin-macros@3.1.0))(next@14.2.10(@babel/core@7.25.2)(@playwright/test@1.49.1)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1))(prettier@3.2.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1)(type-fest@3.13.1)(typescript@5.5.4)(vitest@1.3.1(@types/node@20.11.21)(jsdom@22.1.0)(sass@1.71.1)(terser@5.28.1))(webpack-hot-middleware@2.26.1)(webpack@5.90.3(@swc/core@1.4.2(@swc/helpers@0.5.5))(esbuild@0.20.2))': + '@storybook/nextjs@8.1.4(@jest/globals@29.7.0)(@swc/core@1.4.2(@swc/helpers@0.5.5))(@types/jest@29.5.1)(babel-plugin-macros@3.1.0)(encoding@0.1.13)(esbuild@0.20.2)(jest@29.5.0(@types/node@20.11.21)(babel-plugin-macros@3.1.0))(next@14.2.22(@babel/core@7.25.2)(@playwright/test@1.49.1)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1))(prettier@3.2.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1)(type-fest@3.13.1)(typescript@5.5.4)(vitest@1.3.1(@types/node@20.11.21)(jsdom@22.1.0)(sass@1.71.1)(terser@5.28.1))(webpack-hot-middleware@2.26.1)(webpack@5.90.3(@swc/core@1.4.2(@swc/helpers@0.5.5))(esbuild@0.20.2))': dependencies: '@babel/core': 7.24.6 '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.24.6) @@ -19700,7 +19699,7 @@ snapshots: fs-extra: 11.2.0 image-size: 1.1.1 loader-utils: 3.2.1 - next: 14.2.10(@babel/core@7.25.2)(@playwright/test@1.49.1)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1) + next: 14.2.22(@babel/core@7.25.2)(@playwright/test@1.49.1)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1) node-polyfill-webpack-plugin: 2.0.1(webpack@5.90.3(@swc/core@1.4.2(@swc/helpers@0.5.5))(esbuild@0.20.2)) pnp-webpack-plugin: 1.7.0(typescript@5.5.4) postcss: 8.4.38 @@ -20649,14 +20648,14 @@ snapshots: dependencies: resolve: 1.22.8 - '@vitejs/plugin-react@4.2.1(vite@5.2.13(@types/node@20.16.1)(sass@1.71.1)(terser@5.28.1))': + '@vitejs/plugin-react@4.2.1(vite@5.4.10(@types/node@20.16.1)(sass@1.71.1)(terser@5.28.1))': dependencies: '@babel/core': 7.25.2 '@babel/plugin-transform-react-jsx-self': 7.23.3(@babel/core@7.25.2) '@babel/plugin-transform-react-jsx-source': 7.23.3(@babel/core@7.25.2) '@types/babel__core': 7.20.5 react-refresh: 0.14.0 - vite: 5.2.13(@types/node@20.16.1)(sass@1.71.1)(terser@5.28.1) + vite: 5.4.10(@types/node@20.16.1)(sass@1.71.1)(terser@5.28.1) transitivePeerDependencies: - supports-color @@ -21433,7 +21432,7 @@ snapshots: transitivePeerDependencies: - debug - axios@1.7.5: + axios@1.7.9: dependencies: follow-redirects: 1.15.6(debug@4.3.5) form-data: 4.0.0 @@ -28008,23 +28007,23 @@ snapshots: neo-async@2.6.2: {} - next-seo@5.15.0(next@14.2.10(@babel/core@7.25.2)(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + next-seo@5.15.0(next@14.2.22(@babel/core@7.25.2)(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - next: 14.2.10(@babel/core@7.25.2)(@playwright/test@1.49.1)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1) + next: 14.2.22(@babel/core@7.25.2)(@playwright/test@1.49.1)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - next-seo@5.15.0(next@14.2.10(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + next-seo@5.15.0(next@14.2.22(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - next: 14.2.10(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1) + next: 14.2.22(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) next-tick@1.1.0: {} - next@14.2.10(@babel/core@7.25.2)(@playwright/test@1.49.1)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1): + next@14.2.22(@babel/core@7.25.2)(@playwright/test@1.49.1)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1): dependencies: - '@next/env': 14.2.10 + '@next/env': 14.2.22 '@swc/helpers': 0.5.5 busboy: 1.6.0 caniuse-lite: 1.0.30001651 @@ -28034,24 +28033,24 @@ snapshots: react-dom: 18.3.1(react@18.3.1) styled-jsx: 5.1.1(@babel/core@7.25.2)(babel-plugin-macros@3.1.0)(react@18.3.1) optionalDependencies: - '@next/swc-darwin-arm64': 14.2.10 - '@next/swc-darwin-x64': 14.2.10 - '@next/swc-linux-arm64-gnu': 14.2.10 - '@next/swc-linux-arm64-musl': 14.2.10 - '@next/swc-linux-x64-gnu': 14.2.10 - '@next/swc-linux-x64-musl': 14.2.10 - '@next/swc-win32-arm64-msvc': 14.2.10 - '@next/swc-win32-ia32-msvc': 14.2.10 - '@next/swc-win32-x64-msvc': 14.2.10 + '@next/swc-darwin-arm64': 14.2.22 + '@next/swc-darwin-x64': 14.2.22 + '@next/swc-linux-arm64-gnu': 14.2.22 + '@next/swc-linux-arm64-musl': 14.2.22 + '@next/swc-linux-x64-gnu': 14.2.22 + '@next/swc-linux-x64-musl': 14.2.22 + '@next/swc-win32-arm64-msvc': 14.2.22 + '@next/swc-win32-ia32-msvc': 14.2.22 + '@next/swc-win32-x64-msvc': 14.2.22 '@playwright/test': 1.49.1 sass: 1.71.1 transitivePeerDependencies: - '@babel/core' - babel-plugin-macros - next@14.2.10(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1): + next@14.2.22(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.71.1): dependencies: - '@next/env': 14.2.10 + '@next/env': 14.2.22 '@swc/helpers': 0.5.5 busboy: 1.6.0 caniuse-lite: 1.0.30001651 @@ -28061,15 +28060,15 @@ snapshots: react-dom: 18.3.1(react@18.3.1) styled-jsx: 5.1.1(@babel/core@7.24.6)(babel-plugin-macros@3.1.0)(react@18.3.1) optionalDependencies: - '@next/swc-darwin-arm64': 14.2.10 - '@next/swc-darwin-x64': 14.2.10 - '@next/swc-linux-arm64-gnu': 14.2.10 - '@next/swc-linux-arm64-musl': 14.2.10 - '@next/swc-linux-x64-gnu': 14.2.10 - '@next/swc-linux-x64-musl': 14.2.10 - '@next/swc-win32-arm64-msvc': 14.2.10 - '@next/swc-win32-ia32-msvc': 14.2.10 - '@next/swc-win32-x64-msvc': 14.2.10 + '@next/swc-darwin-arm64': 14.2.22 + '@next/swc-darwin-x64': 14.2.22 + '@next/swc-linux-arm64-gnu': 14.2.22 + '@next/swc-linux-arm64-musl': 14.2.22 + '@next/swc-linux-x64-gnu': 14.2.22 + '@next/swc-linux-x64-musl': 14.2.22 + '@next/swc-win32-arm64-msvc': 14.2.22 + '@next/swc-win32-ia32-msvc': 14.2.22 + '@next/swc-win32-x64-msvc': 14.2.22 '@playwright/test': 1.49.1 sass: 1.71.1 transitivePeerDependencies: @@ -29309,8 +29308,8 @@ snapshots: postcss@8.4.31: dependencies: nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.0 + picocolors: 1.1.1 + source-map-js: 1.2.1 postcss@8.4.35: dependencies: @@ -30229,7 +30228,7 @@ snapshots: dependencies: chokidar: 3.6.0 immutable: 4.3.5 - source-map-js: 1.2.1 + source-map-js: 1.2.0 saxes@6.0.0: dependencies: @@ -31662,13 +31661,13 @@ snapshots: - vue - webpack-sources - unplugin-vue@4.5.2(vite@5.2.13(@types/node@20.11.21)(sass@1.71.1)(terser@5.28.1))(vue@3.4.27(typescript@5.5.4)): + unplugin-vue@4.5.2(vite@5.4.10(@types/node@20.11.21)(sass@1.71.1)(terser@5.28.1))(vue@3.4.27(typescript@5.5.4)): dependencies: debug: 4.3.4 unplugin: 1.5.1 vue: 3.4.27(typescript@5.5.4) optionalDependencies: - vite: 5.2.13(@types/node@20.11.21)(sass@1.71.1)(terser@5.28.1) + vite: 5.4.10(@types/node@20.11.21)(sass@1.71.1)(terser@5.28.1) transitivePeerDependencies: - supports-color @@ -31890,12 +31889,13 @@ snapshots: debug: 4.3.4 pathe: 1.1.2 picocolors: 1.0.0 - vite: 5.2.13(@types/node@20.11.21)(sass@1.71.1)(terser@5.28.1) + vite: 5.4.10(@types/node@20.11.21)(sass@1.71.1)(terser@5.28.1) transitivePeerDependencies: - '@types/node' - less - lightningcss - sass + - sass-embedded - stylus - sugarss - supports-color @@ -31907,12 +31907,13 @@ snapshots: debug: 4.3.4 pathe: 1.1.2 picocolors: 1.0.0 - vite: 5.2.13(@types/node@20.16.1)(sass@1.71.1)(terser@5.28.1) + vite: 5.4.10(@types/node@20.16.1)(sass@1.71.1)(terser@5.28.1) transitivePeerDependencies: - '@types/node' - less - lightningcss - sass + - sass-embedded - stylus - sugarss - supports-color @@ -32012,6 +32013,17 @@ snapshots: sass: 1.71.1 terser: 5.28.1 + vite@5.4.10(@types/node@20.11.21)(sass@1.71.1)(terser@5.28.1): + dependencies: + esbuild: 0.21.5 + postcss: 8.4.47 + rollup: 4.20.0 + optionalDependencies: + '@types/node': 20.11.21 + fsevents: 2.3.3 + sass: 1.71.1 + terser: 5.28.1 + vite@5.4.10(@types/node@20.16.1)(sass@1.71.1)(terser@5.28.1): dependencies: esbuild: 0.21.5 @@ -32059,6 +32071,7 @@ snapshots: - less - lightningcss - sass + - sass-embedded - stylus - sugarss - supports-color @@ -32093,6 +32106,7 @@ snapshots: - less - lightningcss - sass + - sass-embedded - stylus - sugarss - supports-color diff --git a/starters/nextjs-starter-approuter-ts/app/api/pantheoncloud/[...command]/api-options.ts b/starters/nextjs-starter-approuter-ts/app/api/pantheoncloud/[...command]/api-options.ts index 6950f77a..922ceb1f 100644 --- a/starters/nextjs-starter-approuter-ts/app/api/pantheoncloud/[...command]/api-options.ts +++ b/starters/nextjs-starter-approuter-ts/app/api/pantheoncloud/[...command]/api-options.ts @@ -3,7 +3,7 @@ import { serverSmartComponentMap } from "../../../../components/smart-components export const pantheonAPIOptions: PantheonAPIOptions = { resolvePath: (article) => `/articles/${article.slug || article.id}`, - getSiteId: () => process.env.PCC_SITE_ID, + getSiteId: () => process.env.PCC_SITE_ID as string, smartComponentMap: serverSmartComponentMap, componentPreviewPath: (componentName) => `/component-preview/${componentName}`, diff --git a/starters/nextjs-starter-approuter-ts/app/articles/[...uri]/article-view.tsx b/starters/nextjs-starter-approuter-ts/app/articles/[...uri]/article-view.tsx index c1273bc3..22da44db 100644 --- a/starters/nextjs-starter-approuter-ts/app/articles/[...uri]/article-view.tsx +++ b/starters/nextjs-starter-approuter-ts/app/articles/[...uri]/article-view.tsx @@ -5,13 +5,30 @@ import queryString from "query-string"; import { pantheonAPIOptions } from "../../api/pantheoncloud/[...command]/api-options"; import { ClientsideArticleView } from "./clientside-articleview"; -export const ArticleView = async ({ params, searchParams }) => { - const { article, grant } = await getServersideArticle(params, searchParams); +export interface ArticleViewProps { + params: { uri: string }; + searchParams: { + publishingLevel: "PRODUCTION" | "REALTIME"; + pccGrant: string | undefined; + }; +} + +export const ArticleView = async ({ + params, + searchParams, +}: ArticleViewProps) => { + const { article, grant } = await getServersideArticle({ + params, + searchParams, + }); - return ; + return ; }; -export async function getServersideArticle(params, searchParams) { +export async function getServersideArticle({ + params, + searchParams, +}: ArticleViewProps) { const { uri } = params; const { publishingLevel, pccGrant, ...query } = searchParams; @@ -20,7 +37,8 @@ export async function getServersideArticle(params, searchParams) { const article = await PCCConvenienceFunctions.getArticleBySlugOrId( slugOrId, - publishingLevel?.toString().toUpperCase() || "PRODUCTION", + (publishingLevel?.toString().toUpperCase() as "PRODUCTION" | "REALTIME") || + "PRODUCTION", ); if (!article) { @@ -29,7 +47,8 @@ export async function getServersideArticle(params, searchParams) { if ( article.slug?.trim().length && - article.slug.toLowerCase() !== slugOrId?.trim().toLowerCase() + article.slug.toLowerCase() !== slugOrId?.trim().toLowerCase() && + pantheonAPIOptions.resolvePath != null ) { // If the article was accessed by the id rather than the slug - then redirect to the canonical // link (mostly for SEO purposes than anything else). diff --git a/starters/nextjs-starter-approuter-ts/app/articles/[...uri]/clientside-articleview.tsx b/starters/nextjs-starter-approuter-ts/app/articles/[...uri]/clientside-articleview.tsx index 001837f7..301e7afd 100644 --- a/starters/nextjs-starter-approuter-ts/app/articles/[...uri]/clientside-articleview.tsx +++ b/starters/nextjs-starter-approuter-ts/app/articles/[...uri]/clientside-articleview.tsx @@ -15,11 +15,11 @@ updateConfig({ }); export const ClientsideArticleView = ({ - grant, article, + grant, }: { - grant: string; article: Article; + grant?: string | undefined; }) => { return (
@@ -16,8 +23,11 @@ export default async function ArticlePage({ params, searchParams }) { ); } -export async function generateMetadata({ params, searchParams }) { - const { article } = await getServersideArticle(params, searchParams); +export async function generateMetadata({ + params, + searchParams, +}: ArticleViewProps) { + const { article } = await getServersideArticle({ params, searchParams }); return getSeoMetadata(article); } diff --git a/starters/nextjs-starter-approuter-ts/app/articles/page.tsx b/starters/nextjs-starter-approuter-ts/app/articles/page.tsx index 3540856c..470bdde0 100644 --- a/starters/nextjs-starter-approuter-ts/app/articles/page.tsx +++ b/starters/nextjs-starter-approuter-ts/app/articles/page.tsx @@ -3,12 +3,12 @@ import ArticleList from "../../components/article-list"; import Layout from "../../components/layout"; import { PAGE_SIZE } from "../../constants"; -async function fetchNextPages(cursor: string) { +async function fetchNextPages(cursor?: string | null | undefined) { "use server"; const { data, cursor: newCursor } = await PCCConvenienceFunctions.getPaginatedArticles({ pageSize: PAGE_SIZE, - cursor, + cursor: cursor || undefined, }); return { data, diff --git a/starters/nextjs-starter-approuter-ts/app/authors/[author]/page.tsx b/starters/nextjs-starter-approuter-ts/app/authors/[author]/page.tsx index d8d2ae83..b996a1ed 100644 --- a/starters/nextjs-starter-approuter-ts/app/authors/[author]/page.tsx +++ b/starters/nextjs-starter-approuter-ts/app/authors/[author]/page.tsx @@ -12,8 +12,8 @@ import ArticleList from "../../../components/article-list"; import Layout from "../../../components/layout"; import { PAGE_SIZE } from "../../../constants"; -function fetchNextPages(author?: string) { - return async (cursor: string) => { +function fetchNextPages(author?: string | null | undefined) { + return async (cursor?: string | null | undefined) => { "use server"; const { data, cursor: newCursor } = await PCCConvenienceFunctions.getPaginatedArticles({ @@ -24,7 +24,7 @@ function fetchNextPages(author?: string) { : { author, }, - cursor, + cursor: cursor || undefined, }); return { @@ -34,7 +34,11 @@ function fetchNextPages(author?: string) { }; } -export default async function ArticlesListTemplate({ params }) { +export default async function ArticlesListTemplate({ + params, +}: { + params: { author: string }; +}) { const author = params.author ? decodeURIComponent(params.author) : undefined; const { @@ -66,7 +70,10 @@ export default async function ArticlesListTemplate({ params }) { totalCount={totalCount} fetcher={fetchNextPages(author)} additionalHeader={ -
+
{ const params = [{ uri: article.id }]; - if (article.metadata.slug) { + if (article.metadata?.slug) { params.push({ uri: String(article.metadata.slug) }); } return params; diff --git a/starters/nextjs-starter-approuter-ts/app/examples/ssg-isr/page.tsx b/starters/nextjs-starter-approuter-ts/app/examples/ssg-isr/page.tsx index 143f7ac8..7b1fe31f 100644 --- a/starters/nextjs-starter-approuter-ts/app/examples/ssg-isr/page.tsx +++ b/starters/nextjs-starter-approuter-ts/app/examples/ssg-isr/page.tsx @@ -9,12 +9,12 @@ export const metadata: Metadata = { description: "Example of using SSG and ISR", }; -async function fetchNextPages(cursor: string) { +async function fetchNextPages(cursor?: string | null | undefined) { "use server"; const { data, cursor: newCursor } = await PCCConvenienceFunctions.getPaginatedArticles({ pageSize: PAGE_SIZE, - cursor, + cursor: cursor || undefined, }); return { diff --git a/starters/nextjs-starter-approuter-ts/app/layout.tsx b/starters/nextjs-starter-approuter-ts/app/layout.tsx index 8dc914ba..faefcbad 100644 --- a/starters/nextjs-starter-approuter-ts/app/layout.tsx +++ b/starters/nextjs-starter-approuter-ts/app/layout.tsx @@ -2,13 +2,14 @@ import { Poppins } from "next/font/google"; // import Script from "next/script"; import "../styles/globals.css"; +import { PropsWithChildren } from "react"; const poppins = Poppins({ subsets: ["latin"], weight: ["400", "500", "700"], }); -function MyApp({ children }) { +function MyApp({ children }: PropsWithChildren) { return ( diff --git a/starters/nextjs-starter-approuter-ts/app/search/page.tsx b/starters/nextjs-starter-approuter-ts/app/search/page.tsx index 76236e7f..e50e7312 100644 --- a/starters/nextjs-starter-approuter-ts/app/search/page.tsx +++ b/starters/nextjs-starter-approuter-ts/app/search/page.tsx @@ -2,14 +2,20 @@ import { PCCConvenienceFunctions } from "@pantheon-systems/pcc-react-sdk/server" import Layout from "../../components/layout"; import SearchResults from "./search-results"; -export default async function SearchPage({ searchParams }) { +interface Props { + searchParams: { q?: string | null | undefined }; +} + +export default async function SearchPage({ searchParams }: Props) { const searchResults = await PCCConvenienceFunctions.getAllArticlesWithSummary( { publishingLevel: "PRODUCTION", }, - { - bodyContains: searchParams.q, - }, + searchParams.q + ? { + bodyContains: searchParams.q, + } + : undefined, true, ); @@ -23,7 +29,7 @@ export default async function SearchPage({ searchParams }) { ); } -export function generateMetadata({ searchParams }) { +export function generateMetadata({ searchParams }: Props) { return { title: `Search results for "${searchParams.q}"`, description: `Search results for "${searchParams.q}"`, diff --git a/starters/nextjs-starter-approuter-ts/app/search/search-results.tsx b/starters/nextjs-starter-approuter-ts/app/search/search-results.tsx index c88e3cf9..3b536436 100644 --- a/starters/nextjs-starter-approuter-ts/app/search/search-results.tsx +++ b/starters/nextjs-starter-approuter-ts/app/search/search-results.tsx @@ -33,15 +33,15 @@ export default function SearchResults({
{isLoading ? ( - ) : ( + ) : summary ? ( {summary} - )} + ) : null}
) : null}
- {isLoading || searchResults?.length > 0 ? ( + {isLoading || (searchResults && searchResults.length > 0) ? ( (searchResults ?? Array.from({ length: 5 })).map((result, index) => (
@@ -59,11 +59,11 @@ export default function SearchResults({

{isLoading ? ( - ) : ( + ) : result.snippet ? ( markdownToTxt( result.snippet.replaceAll(/{#h\..*}\n/g, "\n"), ) - )} + ) : null}

diff --git a/starters/nextjs-starter-approuter-ts/components/article-list.tsx b/starters/nextjs-starter-approuter-ts/components/article-list.tsx index 542dd2e3..042d92a5 100644 --- a/starters/nextjs-starter-approuter-ts/components/article-list.tsx +++ b/starters/nextjs-starter-approuter-ts/components/article-list.tsx @@ -16,7 +16,7 @@ interface Props { articles: PaginatedArticle[] | ArticleWithoutContent[]; totalCount: number; cursor: string; - fetcher: (cursor: string) => Promise<{ + fetcher: (cursor?: string | null | undefined) => Promise<{ data: PaginatedArticle[] | ArticleWithoutContent[]; newCursor: string; }>; diff --git a/starters/nextjs-starter-approuter-ts/components/article-view.tsx b/starters/nextjs-starter-approuter-ts/components/article-view.tsx index c95f836c..70ce0930 100644 --- a/starters/nextjs-starter-approuter-ts/components/article-view.tsx +++ b/starters/nextjs-starter-approuter-ts/components/article-view.tsx @@ -67,17 +67,21 @@ const ArticleHeader = ({ articleTitle: string; seoMetadata: Metadata; }) => { + const author = Array.isArray(seoMetadata.authors) + ? seoMetadata.authors[0] + : seoMetadata.authors; + return (
{articleTitle}
- {seoMetadata.authors?.[0]?.name ? ( + {author?.name ? ( <>
{`Avatar
-
- {seoMetadata.authors?.[0]?.name} -
+
{author?.name}
 
@@ -118,7 +120,7 @@ export function StaticArticleView({ article, onlyContent }: ArticleViewProps) { <> {article.title} - {article.metadata?.["Description"] && ( + {article.metadata?.["Description"] ? (

{article.metadata?.["Description"]?.toString() || ""}

- )} + ) : null}
@@ -107,12 +107,18 @@ export function ArticleGridCard({ ); } -function GridItemCoverImage({ imageSrc, imageAltText }) { +function GridItemCoverImage({ + imageSrc, + imageAltText, +}: { + imageSrc: string | null; + imageAltText?: string | null | undefined; +}) { return imageSrc != null ? ( // eslint-disable-next-line @next/next/no-img-element {imageAltText} ) : ( diff --git a/starters/nextjs-starter-approuter-ts/components/header/search-bar.tsx b/starters/nextjs-starter-approuter-ts/components/header/search-bar.tsx index fa41c255..cf28d52d 100644 --- a/starters/nextjs-starter-approuter-ts/components/header/search-bar.tsx +++ b/starters/nextjs-starter-approuter-ts/components/header/search-bar.tsx @@ -77,7 +77,7 @@ export default function SearchBar() { function SearchBarForm({ defaultSearchQuery, }: { - defaultSearchQuery?: string; + defaultSearchQuery?: string | null | undefined; }) { const onSubmit: FormEventHandler = (e) => { e.preventDefault(); @@ -96,7 +96,7 @@ function SearchBarForm({ >

{title}

diff --git a/starters/nextjs-starter-approuter-ts/hooks/usePagination.ts b/starters/nextjs-starter-approuter-ts/hooks/usePagination.ts index 9a9f41f8..84b5c1f1 100644 --- a/starters/nextjs-starter-approuter-ts/hooks/usePagination.ts +++ b/starters/nextjs-starter-approuter-ts/hooks/usePagination.ts @@ -7,7 +7,7 @@ import { useEffect, useState } from "react"; interface Props { cursor?: string; initialArticles?: PaginatedArticle[] | ArticleWithoutContent[]; - fetcher: (cursor: string) => Promise<{ + fetcher: (cursor: string | null | undefined) => Promise<{ data: PaginatedArticle[] | ArticleWithoutContent[]; newCursor: string; }>; diff --git a/starters/nextjs-starter-approuter-ts/lib/utils.ts b/starters/nextjs-starter-approuter-ts/lib/utils.ts index dad3b900..d3b3a6ca 100644 --- a/starters/nextjs-starter-approuter-ts/lib/utils.ts +++ b/starters/nextjs-starter-approuter-ts/lib/utils.ts @@ -16,7 +16,17 @@ export function formatDate(input: string | number): string { }); } -export function getSeoMetadata(article: ArticleWithoutContent): Metadata { +export function getSeoMetadata( + article: ArticleWithoutContent | null, +): Metadata { + if (article == null) { + return { + openGraph: { + type: "website", + }, + }; + } + const tags: string[] = article.tags && article.tags.length > 0 ? article.tags : []; const imageProperties = [ @@ -53,7 +63,7 @@ export function getSeoMetadata(article: ArticleWithoutContent): Metadata { authors, openGraph: { type: "website", - title: article.title, + title: article.title || undefined, images: imageProperties, description, }, diff --git a/starters/nextjs-starter-approuter-ts/package.json b/starters/nextjs-starter-approuter-ts/package.json index 0f78d8db..22b0b170 100644 --- a/starters/nextjs-starter-approuter-ts/package.json +++ b/starters/nextjs-starter-approuter-ts/package.json @@ -36,7 +36,7 @@ "clsx": "^2.1.1", "dotenv": "^16.4.5", "markdown-to-txt": "^2.0.1", - "next": "^14.2.10", + "next": "^14.2.15", "query-string": "^8.2.0", "react": "18.3.1", "react-dom": "18.3.1", @@ -61,7 +61,7 @@ "tailwindcss": "^3.4.1", "tailwindcss-animate": "^1.0.7", "typescript": "^5.5.4", - "vite": "^5.1.8", + "vite": "^5.2.14", "vitest": "^1.3.1", "vitest-fetch-mock": "^0.2.2" } diff --git a/starters/nextjs-starter-approuter-ts/tsconfig.json b/starters/nextjs-starter-approuter-ts/tsconfig.json index c5f3cdff..7f1f45e5 100644 --- a/starters/nextjs-starter-approuter-ts/tsconfig.json +++ b/starters/nextjs-starter-approuter-ts/tsconfig.json @@ -8,7 +8,8 @@ ], "allowJs": true, "skipLibCheck": true, - "strict": false, + "strict": true, + "strictNullChecks": true, "forceConsistentCasingInFileNames": true, "noEmit": true, "incremental": true, diff --git a/starters/nextjs-starter-ts/components/article-view.tsx b/starters/nextjs-starter-ts/components/article-view.tsx index 4ad3d86f..f514853e 100644 --- a/starters/nextjs-starter-ts/components/article-view.tsx +++ b/starters/nextjs-starter-ts/components/article-view.tsx @@ -40,7 +40,15 @@ type ArticleViewProps = { onlyContent?: boolean; }; -const ArticleHeader = ({ article, articleTitle, seoMetadata }) => { +const ArticleHeader = ({ + article, + articleTitle, + seoMetadata, +}: { + article: Article; + articleTitle: string | null; + seoMetadata: ReturnType; +}) => { return (
{articleTitle}
diff --git a/starters/nextjs-starter-ts/components/grid.tsx b/starters/nextjs-starter-ts/components/grid.tsx index 4ea9f118..d1de8d1f 100644 --- a/starters/nextjs-starter-ts/components/grid.tsx +++ b/starters/nextjs-starter-ts/components/grid.tsx @@ -59,7 +59,7 @@ export function ArticleGridCard({ isWide = false, }: ArticleGridCardProps) { const targetHref = `${basePath}/${article.slug || article.id}`; - const imageSrc = article.metadata?.["Hero Image"] || null; + const imageSrc = (article.metadata?.["Hero Image"] as string) || null; return (
{article.title} - {article.metadata?.["Description"] && ( + {article.metadata?.["Description"] ? (

{article.metadata?.["Description"]?.toString() || ""}

- )} + ) : null}
@@ -107,7 +107,13 @@ export function ArticleGridCard({ ); } -function GridItemCoverImage({ imageSrc, imageAltText }) { +function GridItemCoverImage({ + imageSrc, + imageAltText, +}: { + imageSrc: string | null | undefined; + imageAltText?: string | undefined; +}) { return imageSrc != null ? ( // eslint-disable-next-line @next/next/no-img-element

{title}

diff --git a/starters/nextjs-starter-ts/components/smart-components/error-boundary.tsx b/starters/nextjs-starter-ts/components/smart-components/error-boundary.tsx index 81ce4662..ea8ea8c9 100644 --- a/starters/nextjs-starter-ts/components/smart-components/error-boundary.tsx +++ b/starters/nextjs-starter-ts/components/smart-components/error-boundary.tsx @@ -36,10 +36,10 @@ const SmartComponentSuspenseErrorBoundary = ({ children }: Props) => { export const withSmartComponentErrorBoundary = // eslint-disable-next-line react/display-name - (Component: React.ComponentType) => (props: Record) => ( + (Component: React.ComponentType) => (props: Record) => ( ); -export default SmartComponentErrorBoundary; \ No newline at end of file +export default SmartComponentErrorBoundary; diff --git a/starters/nextjs-starter-ts/lib/utils.ts b/starters/nextjs-starter-ts/lib/utils.ts index 1379565f..47404737 100644 --- a/starters/nextjs-starter-ts/lib/utils.ts +++ b/starters/nextjs-starter-ts/lib/utils.ts @@ -67,7 +67,7 @@ export function getSeoMetadata(article: ArticleWithoutContent) { description, openGraph: { type: "website", - title: article.title, + title: article.title || undefined, images: imageProperties, description, article: { diff --git a/starters/nextjs-starter-ts/package.json b/starters/nextjs-starter-ts/package.json index 4eb5c161..6d0da273 100644 --- a/starters/nextjs-starter-ts/package.json +++ b/starters/nextjs-starter-ts/package.json @@ -38,7 +38,7 @@ "dotenv": "^16.4.5", "react-icons": "^5.4.0", "markdown-to-txt": "^2.0.1", - "next": "^14.2.10", + "next": "^14.2.15", "next-seo": "^5.15.0", "query-string": "^8.2.0", "react": "18.3.1", @@ -63,7 +63,7 @@ "tailwindcss": "^3.4.1", "tailwindcss-animate": "^1.0.7", "typescript": "^5.5.4", - "vite": "^5.1.8", + "vite": "^5.2.14", "vitest": "^1.3.1", "vitest-fetch-mock": "^0.2.2" } diff --git a/starters/nextjs-starter-ts/pages/_app.tsx b/starters/nextjs-starter-ts/pages/_app.tsx index 6e2931af..adb920bd 100644 --- a/starters/nextjs-starter-ts/pages/_app.tsx +++ b/starters/nextjs-starter-ts/pages/_app.tsx @@ -2,13 +2,15 @@ import { Poppins } from "next/font/google"; // import Script from "next/script"; import "../styles/globals.css"; +import { AppProps } from "next/app"; +import React from "react"; const poppins = Poppins({ subsets: ["latin"], weight: ["400", "500", "700"], }); -function MyApp({ Component, pageProps }) { +function MyApp({ Component, pageProps }: AppProps) { return (
{/* Google Analytics: Replace XXXXXXXXXX with your google analytics id and uncomment the following code. */} diff --git a/starters/nextjs-starter-ts/pages/api/utils/oembed.ts b/starters/nextjs-starter-ts/pages/api/utils/oembed.ts index a9938cd4..cf7e30e5 100644 --- a/starters/nextjs-starter-ts/pages/api/utils/oembed.ts +++ b/starters/nextjs-starter-ts/pages/api/utils/oembed.ts @@ -9,7 +9,7 @@ const oembedURLs = { export default async function handler( req: NextApiRequest, - res: NextApiResponse + res: NextApiResponse, ) { const url = req.query.url; let type = req.query.type; @@ -20,7 +20,7 @@ export default async function handler( if (Array.isArray(type)) type = type[0]; - const oembedUrl = oembedURLs[type]; + const oembedUrl = oembedURLs[type as keyof typeof oembedURLs]; if (!oembedUrl) { res.status(404).json({ error: "Not found" }); @@ -29,7 +29,7 @@ export default async function handler( const queryParams = { url }; const response = await fetch( - `${oembedUrl}?${queryString.stringify(queryParams)}` + `${oembedUrl}?${queryString.stringify(queryParams)}`, ); if (response.ok) { diff --git a/starters/nextjs-starter-ts/pages/api/utils/paginate.ts b/starters/nextjs-starter-ts/pages/api/utils/paginate.ts index 0993d310..5bc31550 100644 --- a/starters/nextjs-starter-ts/pages/api/utils/paginate.ts +++ b/starters/nextjs-starter-ts/pages/api/utils/paginate.ts @@ -5,7 +5,7 @@ export default async function handler( req: NextApiRequest, res: NextApiResponse, ) { - let cursor: string; + let cursor: string | undefined; if (Array.isArray(req.query.cursor)) cursor = req.query.cursor[0]; else cursor = req.query.cursor; @@ -16,7 +16,7 @@ export default async function handler( return res.status(400).json("Invalid pageSize"); } - let author: string; + let author: string | null | undefined; if (Array.isArray(req.query.author)) author = req.query.author[0]; else author = req.query.author; diff --git a/starters/nextjs-starter-ts/pages/articles/[...uri].tsx b/starters/nextjs-starter-ts/pages/articles/[...uri].tsx index 45a6531a..52e39b61 100644 --- a/starters/nextjs-starter-ts/pages/articles/[...uri].tsx +++ b/starters/nextjs-starter-ts/pages/articles/[...uri].tsx @@ -27,7 +27,7 @@ export default function ArticlePage({ article, grant }: ArticlePageProps) { > @@ -43,13 +43,24 @@ export default function ArticlePage({ article, grant }: ArticlePageProps) { export async function getServerSideProps({ req: { cookies }, query: { uri, publishingLevel, pccGrant, ...query }, +}: { + req: { + cookies: Record; + }; + query: { + uri: string; + publishingLevel: "PRODUCTION" | "REALTIME" | undefined; + pccGrant: string; + }; }) { const slugOrId = uri[uri.length - 1]; const grant = pccGrant || cookies["PCC-GRANT"] || null; const article = await PCCConvenienceFunctions.getArticleBySlugOrId( slugOrId, - publishingLevel ? publishingLevel.toString().toUpperCase() : "PRODUCTION", + publishingLevel + ? (publishingLevel.toString().toUpperCase() as "PRODUCTION" | "REALTIME") + : "PRODUCTION", ); if (!article) { @@ -60,7 +71,8 @@ export async function getServerSideProps({ if ( article.slug?.trim().length && - article.slug.toLowerCase() !== slugOrId?.trim().toLowerCase() + article.slug.toLowerCase() !== slugOrId?.trim().toLowerCase() && + pantheonAPIOptions.resolvePath != null ) { // If the article was accessed by the id rather than the slug - then redirect to the canonical // link (mostly for SEO purposes than anything else). diff --git a/starters/nextjs-starter-ts/pages/articles/index.tsx b/starters/nextjs-starter-ts/pages/articles/index.tsx index f848d056..0b407b65 100644 --- a/starters/nextjs-starter-ts/pages/articles/index.tsx +++ b/starters/nextjs-starter-ts/pages/articles/index.tsx @@ -1,4 +1,5 @@ import { + Article, ArticleWithoutContent, PCCConvenienceFunctions, } from "@pantheon-systems/pcc-react-sdk"; @@ -11,7 +12,17 @@ import { usePagination } from "../../hooks/usePagination"; const PAGE_SIZE = 20; -export default function ArticlesListTemplate({ articles, totalCount, cursor }) { +interface Props { + articles: Article[]; + totalCount: number; + cursor: string; +} + +export default function ArticlesListTemplate({ + articles, + totalCount, + cursor, +}: Props) { const { data: currentArticles, onPageChange, diff --git a/starters/nextjs-starter-ts/pages/authors/[author].tsx b/starters/nextjs-starter-ts/pages/authors/[author].tsx index b08a50e6..4c7fd3b2 100644 --- a/starters/nextjs-starter-ts/pages/authors/[author].tsx +++ b/starters/nextjs-starter-ts/pages/authors/[author].tsx @@ -1,4 +1,5 @@ import { + Article, ArticleWithoutContent, PCCConvenienceFunctions, } from "@pantheon-systems/pcc-react-sdk"; @@ -24,6 +25,11 @@ export default function ArticlesListTemplate({ totalCount, cursor, author, +}: { + articles: Article[]; + totalCount: number; + cursor: string; + author?: string; }) { const { data: currentArticles, @@ -93,7 +99,11 @@ export default function ArticlesListTemplate({ ); } -export async function getServerSideProps({ query: { author } }) { +export async function getServerSideProps({ + query: { author }, +}: { + query: { author: string }; +}) { const { data: articles, totalCount, diff --git a/starters/nextjs-starter-ts/pages/component-preview/[id].tsx b/starters/nextjs-starter-ts/pages/component-preview/[id].tsx index 00b8e3f7..626eb19f 100644 --- a/starters/nextjs-starter-ts/pages/component-preview/[id].tsx +++ b/starters/nextjs-starter-ts/pages/component-preview/[id].tsx @@ -11,8 +11,11 @@ export default function SmartComponentPreview() { ? JSON.parse(Buffer.from(attrs, "base64").toString()) : {}; - const SmartComponent = - clientSmartComponentMap[id?.toString()]?.reactComponent; + const SmartComponent = id + ? clientSmartComponentMap[ + id.toString() as keyof typeof clientSmartComponentMap + ]?.reactComponent + : null; return (
diff --git a/starters/nextjs-starter-ts/pages/examples/ssg-isr/[uri].tsx b/starters/nextjs-starter-ts/pages/examples/ssg-isr/[uri].tsx index bccc4e94..ad755ae1 100644 --- a/starters/nextjs-starter-ts/pages/examples/ssg-isr/[uri].tsx +++ b/starters/nextjs-starter-ts/pages/examples/ssg-isr/[uri].tsx @@ -18,7 +18,7 @@ export default function ArticlePage({ article }: ArticlePageProps) { return ( @@ -30,17 +30,17 @@ export default function ArticlePage({ article }: ArticlePageProps) { ); } -export const getStaticProps: GetStaticProps<{}, { uri: string }> = async ({ - params: { uri }, -}) => { - if (!uri) { +export const getStaticProps: GetStaticProps<{}> = async ({ params }) => { + if (!params?.uri) { return { notFound: true, }; } try { - const article = await PCCConvenienceFunctions.getArticleBySlugOrId(uri); + const article = await PCCConvenienceFunctions.getArticleBySlugOrId( + params?.uri?.toString(), + ); if (!article) { return { @@ -74,7 +74,7 @@ export const getStaticPaths: GetStaticPaths = async () => { const pagePaths = publishedArticles.map((article) => { const id = article.id; - const slug = article.metadata.slug; + const slug = article.metadata?.slug; // Generate both slug and id paths for each article const paths = [ diff --git a/starters/nextjs-starter-ts/pages/examples/ssg-isr/index.tsx b/starters/nextjs-starter-ts/pages/examples/ssg-isr/index.tsx index 64cdf320..4e860fd5 100644 --- a/starters/nextjs-starter-ts/pages/examples/ssg-isr/index.tsx +++ b/starters/nextjs-starter-ts/pages/examples/ssg-isr/index.tsx @@ -1,4 +1,5 @@ import { + Article, ArticleWithoutContent, PCCConvenienceFunctions, } from "@pantheon-systems/pcc-react-sdk"; @@ -11,11 +12,17 @@ import { usePagination } from "../../../hooks/usePagination"; const PAGE_SIZE = 20; +interface Props { + articles: Article[]; + totalCount: number; + cursor: string; +} + export default function SSGISRExampleTemplate({ articles, totalCount, cursor, -}) { +}: Props) { const { data: currentArticles, onPageChange, diff --git a/starters/nextjs-starter-ts/pages/index.tsx b/starters/nextjs-starter-ts/pages/index.tsx index e5460876..388e270a 100644 --- a/starters/nextjs-starter-ts/pages/index.tsx +++ b/starters/nextjs-starter-ts/pages/index.tsx @@ -1,4 +1,7 @@ -import { PCCConvenienceFunctions } from "@pantheon-systems/pcc-react-sdk"; +import { + Article, + PCCConvenienceFunctions, +} from "@pantheon-systems/pcc-react-sdk"; import { NextSeo } from "next-seo"; import Image from "next/image"; import Link from "next/link"; @@ -6,7 +9,7 @@ import { HomepageArticleGrid } from "../components/grid"; import Layout from "../components/layout"; import { Button } from "../components/ui/button"; -export default function Home({ articles }) { +export default function Home({ articles }: { articles: Article[] }) { return ( ) : ( - {data.summary} + {data?.summary || ""} )}
) : null}
- {isLoading || data?.searchResults?.length > 0 ? ( + {isLoading || + (data?.searchResults != null && data.searchResults.length > 0) ? ( (data?.searchResults ?? Array.from({ length: 5 })).map( (result, index) => ( @@ -87,11 +88,11 @@ export default function Search() {

{isLoading ? ( - ) : ( + ) : result.snippet ? ( markdownToTxt( result.snippet.replaceAll(/{#h\..*}\n/g, "\n"), ) - )} + ) : null}

diff --git a/starters/nextjs-starter-ts/tsconfig.json b/starters/nextjs-starter-ts/tsconfig.json index a160b879..4987446c 100644 --- a/starters/nextjs-starter-ts/tsconfig.json +++ b/starters/nextjs-starter-ts/tsconfig.json @@ -8,7 +8,8 @@ ], "allowJs": true, "skipLibCheck": true, - "strict": false, + "strict": true, + "strictNullChecks": true, "forceConsistentCasingInFileNames": true, "noEmit": true, "incremental": true, diff --git a/starters/nextjs-starter/package.json b/starters/nextjs-starter/package.json index 964f74b6..ac141d0d 100644 --- a/starters/nextjs-starter/package.json +++ b/starters/nextjs-starter/package.json @@ -36,7 +36,7 @@ "clsx": "^2.1.1", "dotenv": "^16.4.5", "markdown-to-txt": "^2.0.1", - "next": "^14.2.10", + "next": "^14.2.15", "next-seo": "^5.15.0", "query-string": "^8.2.0", "react": "18.3.1", @@ -61,7 +61,7 @@ "tailwindcss": "^3.4.1", "tailwindcss-animate": "^1.0.7", "typescript": "^5.5.4", - "vite": "^5.1.8", + "vite": "^5.2.14", "vitest": "^1.3.1", "vitest-fetch-mock": "^0.2.2" } diff --git a/starters/nextjs-starter/pages/component-preview/[id].tsx b/starters/nextjs-starter/pages/component-preview/[id].jsx similarity index 85% rename from starters/nextjs-starter/pages/component-preview/[id].tsx rename to starters/nextjs-starter/pages/component-preview/[id].jsx index 00b8e3f7..d4c81b4e 100644 --- a/starters/nextjs-starter/pages/component-preview/[id].tsx +++ b/starters/nextjs-starter/pages/component-preview/[id].jsx @@ -3,7 +3,6 @@ import { clientSmartComponentMap } from "../../components/smart-components"; export default function SmartComponentPreview() { const router = useRouter(); - const { id, attrs } = router.query; const decodedAttrs = @@ -11,8 +10,9 @@ export default function SmartComponentPreview() { ? JSON.parse(Buffer.from(attrs, "base64").toString()) : {}; - const SmartComponent = - clientSmartComponentMap[id?.toString()]?.reactComponent; + const SmartComponent = id + ? clientSmartComponentMap[id.toString()]?.reactComponent + : null; return (
diff --git a/starters/nextjs-starter/tsconfig.json b/starters/nextjs-starter/tsconfig.json index 6db37c02..105c03a3 100644 --- a/starters/nextjs-starter/tsconfig.json +++ b/starters/nextjs-starter/tsconfig.json @@ -8,7 +8,8 @@ ], "allowJs": true, "skipLibCheck": true, - "strict": false, + "strict": true, + "strictNullChecks": true, "forceConsistentCasingInFileNames": true, "noEmit": true, "incremental": true,