diff --git a/.github/workflows/pkg-pr-new.yaml b/.github/workflows/pkg-pr-new.yaml index 261be86846..16d274aca9 100644 --- a/.github/workflows/pkg-pr-new.yaml +++ b/.github/workflows/pkg-pr-new.yaml @@ -12,5 +12,5 @@ jobs: - run: corepack enable - uses: actions/setup-node@v4 - run: pnpm install - - run: pnpm build -F '@rivetkit/*' - - run: pnpm dlx pkg-pr-new publish 'engine/sdks/typescript/runner/' 'engine/sdks/typescript/runner-protocol/' 'rivetkit-typescript/packages/*' --packageManager pnpm --template './examples/*' + - run: pnpm build -F '@rivetkit/*' -F '!@rivetkit/example-registry' + - run: pnpm dlx pkg-pr-new publish 'shared/typescript/*' 'engine/sdks/typescript/runner/' 'engine/sdks/typescript/runner-protocol/' 'rivetkit-typescript/packages/*' --packageManager pnpm --template './examples/*' diff --git a/examples/chat-room-next-js/package.json b/examples/chat-room-next-js/package.json index 530c07f98b..76ca972214 100644 --- a/examples/chat-room-next-js/package.json +++ b/examples/chat-room-next-js/package.json @@ -12,7 +12,7 @@ "dependencies": { "react": "19.1.0", "react-dom": "19.1.0", - "next": "15.4.10", + "next": "16.1.1", "@rivetkit/next-js": "workspace:*", "rivetkit": "workspace:*" }, diff --git a/examples/next-js/package.json b/examples/next-js/package.json index e85c394f58..b9991e873d 100644 --- a/examples/next-js/package.json +++ b/examples/next-js/package.json @@ -13,7 +13,7 @@ "dependencies": { "react": "19.1.0", "react-dom": "19.1.0", - "next": "15.4.10", + "next": "16.1.1", "@rivetkit/next-js": "workspace:*", "rivetkit": "workspace:*" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3dd88b0b5d..32bb6ef608 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -459,8 +459,8 @@ importers: specifier: workspace:* version: link:../../rivetkit-typescript/packages/next-js next: - specifier: 15.4.10 - version: 15.4.10(@opentelemetry/api@1.9.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(sass@1.93.2) + specifier: 16.1.1 + version: 16.1.1(@opentelemetry/api@1.9.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(sass@1.93.2) react: specifier: 19.1.0 version: 19.1.0 @@ -1131,8 +1131,8 @@ importers: specifier: workspace:* version: link:../../rivetkit-typescript/packages/next-js next: - specifier: 15.4.10 - version: 15.4.10(@opentelemetry/api@1.9.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(sass@1.93.2) + specifier: 16.1.1 + version: 16.1.1(@opentelemetry/api@1.9.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(sass@1.93.2) react: specifier: 19.1.0 version: 19.1.0 @@ -2483,7 +2483,7 @@ importers: version: 15.5.6(@mdx-js/loader@3.1.1(webpack@5.101.3(esbuild@0.25.9)))(@mdx-js/react@3.1.1(@types/react@19.2.2)(react@19.2.0)) '@next/third-parties': specifier: latest - version: 16.1.1(next@15.5.9(@babel/core@7.28.5)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(sass@1.93.2))(react@19.2.0) + version: 16.1.1(next@16.1.1(@babel/core@7.28.5)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(sass@1.93.2))(react@19.2.0) '@rivet-gg/api': specifier: 25.5.3 version: 25.5.3 @@ -2572,14 +2572,14 @@ importers: specifier: ^0.1.4 version: 0.1.4 next: - specifier: ^15.5.9 - version: 15.5.9(@babel/core@7.28.5)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(sass@1.93.2) + specifier: ^16.1.1 + version: 16.1.1(@babel/core@7.28.5)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(sass@1.93.2) next-router-mock: specifier: ^1.0.4 - version: 1.0.4(next@15.5.9(@babel/core@7.28.5)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(sass@1.93.2))(react@19.2.0) + version: 1.0.4(next@16.1.1(@babel/core@7.28.5)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(sass@1.93.2))(react@19.2.0) next-sitemap: specifier: ^4.2.3 - version: 4.2.3(next@15.5.9(@babel/core@7.28.5)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(sass@1.93.2)) + version: 4.2.3(next@16.1.1(@babel/core@7.28.5)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(sass@1.93.2)) postcss: specifier: ^8.5.6 version: 8.5.6 @@ -5560,12 +5560,12 @@ packages: '@next/env@13.5.11': resolution: {integrity: sha512-fbb2C7HChgM7CemdCY+y3N1n8pcTKdqtQLbC7/EQtPdLvlMUT9JX/dBYl8MMZAtYG4uVMyPFHXckb68q/NRwqg==} - '@next/env@15.4.10': - resolution: {integrity: sha512-knhmoJ0Vv7VRf6pZEPSnciUG1S4bIhWx+qTYBW/AjxEtlzsiNORPk8sFDCEvqLfmKuey56UB9FL1UdHEV3uBrg==} - '@next/env@15.5.9': resolution: {integrity: sha512-4GlTZ+EJM7WaW2HEZcyU317tIQDjkQIyENDLxYJfSWlfqguN+dHkZgyQTV/7ykvobU7yEH5gKvreNrH4B6QgIg==} + '@next/env@16.1.1': + resolution: {integrity: sha512-3oxyM97Sr2PqiVyMyrZUtrtM3jqqFxOQJVuKclDsgj/L728iZt/GyslkN4NwarledZATCenbk4Offjk1hQmaAA==} + '@next/eslint-plugin-next@16.0.3': resolution: {integrity: sha512-6sPWmZetzFWMsz7Dhuxsdmbu3fK+/AxKRtj7OB0/3OZAI2MHB/v2FeYh271LZ9abvnM1WIwWc/5umYjx0jo5sQ==} @@ -5580,22 +5580,16 @@ packages: '@mdx-js/react': optional: true - '@next/swc-darwin-arm64@15.4.8': - resolution: {integrity: sha512-Pf6zXp7yyQEn7sqMxur6+kYcywx5up1J849psyET7/8pG2gQTVMjU3NzgIt8SeEP5to3If/SaWmaA6H6ysBr1A==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - '@next/swc-darwin-arm64@15.5.7': resolution: {integrity: sha512-IZwtxCEpI91HVU/rAUOOobWSZv4P2DeTtNaCdHqLcTJU4wdNXgAySvKa/qJCgR5m6KI8UsKDXtO2B31jcaw1Yw==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] - '@next/swc-darwin-x64@15.4.8': - resolution: {integrity: sha512-xla6AOfz68a6kq3gRQccWEvFC/VRGJmA/QuSLENSO7CZX5WIEkSz7r1FdXUjtGCQ1c2M+ndUAH7opdfLK1PQbw==} + '@next/swc-darwin-arm64@16.1.1': + resolution: {integrity: sha512-JS3m42ifsVSJjSTzh27nW+Igfha3NdBOFScr9C80hHGrWx55pTrVL23RJbqir7k7/15SKlrLHhh/MQzqBBYrQA==} engines: {node: '>= 10'} - cpu: [x64] + cpu: [arm64] os: [darwin] '@next/swc-darwin-x64@15.5.7': @@ -5604,11 +5598,11 @@ packages: cpu: [x64] os: [darwin] - '@next/swc-linux-arm64-gnu@15.4.8': - resolution: {integrity: sha512-y3fmp+1Px/SJD+5ntve5QLZnGLycsxsVPkTzAc3zUiXYSOlTPqT8ynfmt6tt4fSo1tAhDPmryXpYKEAcoAPDJw==} + '@next/swc-darwin-x64@16.1.1': + resolution: {integrity: sha512-hbyKtrDGUkgkyQi1m1IyD3q4I/3m9ngr+V93z4oKHrPcmxwNL5iMWORvLSGAf2YujL+6HxgVvZuCYZfLfb4bGw==} engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] + cpu: [x64] + os: [darwin] '@next/swc-linux-arm64-gnu@15.5.7': resolution: {integrity: sha512-NCslw3GrNIw7OgmRBxHtdWFQYhexoUCq+0oS2ccjyYLtcn1SzGzeM54jpTFonIMUjNbHmpKpziXnpxhSWLcmBA==} @@ -5616,8 +5610,8 @@ packages: cpu: [arm64] os: [linux] - '@next/swc-linux-arm64-musl@15.4.8': - resolution: {integrity: sha512-DX/L8VHzrr1CfwaVjBQr3GWCqNNFgyWJbeQ10Lx/phzbQo3JNAxUok1DZ8JHRGcL6PgMRgj6HylnLNndxn4Z6A==} + '@next/swc-linux-arm64-gnu@16.1.1': + resolution: {integrity: sha512-/fvHet+EYckFvRLQ0jPHJCUI5/B56+2DpI1xDSvi80r/3Ez+Eaa2Yq4tJcRTaB1kqj/HrYKn8Yplm9bNoMJpwQ==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] @@ -5628,10 +5622,10 @@ packages: cpu: [arm64] os: [linux] - '@next/swc-linux-x64-gnu@15.4.8': - resolution: {integrity: sha512-9fLAAXKAL3xEIFdKdzG5rUSvSiZTLLTCc6JKq1z04DR4zY7DbAPcRvNm3K1inVhTiQCs19ZRAgUerHiVKMZZIA==} + '@next/swc-linux-arm64-musl@16.1.1': + resolution: {integrity: sha512-MFHrgL4TXNQbBPzkKKur4Fb5ICEJa87HM7fczFs2+HWblM7mMLdco3dvyTI+QmLBU9xgns/EeeINSZD6Ar+oLg==} engines: {node: '>= 10'} - cpu: [x64] + cpu: [arm64] os: [linux] '@next/swc-linux-x64-gnu@15.5.7': @@ -5640,8 +5634,8 @@ packages: cpu: [x64] os: [linux] - '@next/swc-linux-x64-musl@15.4.8': - resolution: {integrity: sha512-s45V7nfb5g7dbS7JK6XZDcapicVrMMvX2uYgOHP16QuKH/JA285oy6HcxlKqwUNaFY/UC6EvQ8QZUOo19cBKSA==} + '@next/swc-linux-x64-gnu@16.1.1': + resolution: {integrity: sha512-20bYDfgOQAPUkkKBnyP9PTuHiJGM7HzNBbuqmD0jiFVZ0aOldz+VnJhbxzjcSabYsnNjMPsE0cyzEudpYxsrUQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] @@ -5652,11 +5646,11 @@ packages: cpu: [x64] os: [linux] - '@next/swc-win32-arm64-msvc@15.4.8': - resolution: {integrity: sha512-KjgeQyOAq7t/HzAJcWPGA8X+4WY03uSCZ2Ekk98S9OgCFsb6lfBE3dbUzUuEQAN2THbwYgFfxX2yFTCMm8Kehw==} + '@next/swc-linux-x64-musl@16.1.1': + resolution: {integrity: sha512-9pRbK3M4asAHQRkwaXwu601oPZHghuSC8IXNENgbBSyImHv/zY4K5udBusgdHkvJ/Tcr96jJwQYOll0qU8+fPA==} engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] + cpu: [x64] + os: [linux] '@next/swc-win32-arm64-msvc@15.5.7': resolution: {integrity: sha512-CpJVTkYI3ZajQkC5vajM7/ApKJUOlm6uP4BknM3XKvJ7VXAvCqSjSLmM0LKdYzn6nBJVSjdclx8nYJSa3xlTgQ==} @@ -5664,10 +5658,10 @@ packages: cpu: [arm64] os: [win32] - '@next/swc-win32-x64-msvc@15.4.8': - resolution: {integrity: sha512-Exsmf/+42fWVnLMaZHzshukTBxZrSwuuLKFvqhGHJ+mC1AokqieLY/XzAl3jc/CqhXLqLY3RRjkKJ9YnLPcRWg==} + '@next/swc-win32-arm64-msvc@16.1.1': + resolution: {integrity: sha512-bdfQkggaLgnmYrFkSQfsHfOhk/mCYmjnrbRCGgkMcoOBZ4n+TRRSLmT/CU5SATzlBJ9TpioUyBW/vWFXTqQRiA==} engines: {node: '>= 10'} - cpu: [x64] + cpu: [arm64] os: [win32] '@next/swc-win32-x64-msvc@15.5.7': @@ -5676,6 +5670,12 @@ packages: cpu: [x64] os: [win32] + '@next/swc-win32-x64-msvc@16.1.1': + resolution: {integrity: sha512-Ncwbw2WJ57Al5OX0k4chM68DKhEPlrXBaSXDCi2kPi5f4d8b3ejr3RRJGfKBLrn2YJL5ezNS7w2TZLHSti8CMw==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + '@next/third-parties@16.1.1': resolution: {integrity: sha512-i3NWXWiNpXGaUi6vGDrK7rC5qLhuCmuhD1BeaOh4Ma8piUBeUhOjEa1UfpVndeC3JcqWXPaYzqO1Hd1U6hql/w==} peerDependencies: @@ -11665,8 +11665,8 @@ packages: peerDependencies: next: '*' - next@15.4.10: - resolution: {integrity: sha512-itVlc79QjpKMFMRhP+kbGKaSG/gZM6RCvwhEbwmCNF06CdDiNaoHcbeg0PqkEa2GOcn8KJ0nnc7+yL7EjoYLHQ==} + next@15.5.9: + resolution: {integrity: sha512-agNLK89seZEtC5zUHwtut0+tNrc0Xw4FT/Dg+B/VLEo9pAcS9rtTKpek3V6kVcVwsB2YlqMaHdfZL4eLEVYuCg==} engines: {node: ^18.18.0 || ^19.8.0 || >= 20.0.0} hasBin: true peerDependencies: @@ -11686,9 +11686,9 @@ packages: sass: optional: true - next@15.5.9: - resolution: {integrity: sha512-agNLK89seZEtC5zUHwtut0+tNrc0Xw4FT/Dg+B/VLEo9pAcS9rtTKpek3V6kVcVwsB2YlqMaHdfZL4eLEVYuCg==} - engines: {node: ^18.18.0 || ^19.8.0 || >= 20.0.0} + next@16.1.1: + resolution: {integrity: sha512-QI+T7xrxt1pF6SQ/JYFz95ro/mg/1Znk5vBebsWwbpejj1T0A23hO7GYEaVac9QUOT2BIMiuzm0L99ooq7k0/w==} + engines: {node: '>=20.9.0'} hasBin: true peerDependencies: '@opentelemetry/api': ^1.1.0 @@ -17769,9 +17769,10 @@ snapshots: '@next/env@13.5.11': {} - '@next/env@15.4.10': {} + '@next/env@15.5.9': + optional: true - '@next/env@15.5.9': {} + '@next/env@16.1.1': {} '@next/eslint-plugin-next@16.0.3': dependencies: @@ -17784,57 +17785,57 @@ snapshots: '@mdx-js/loader': 3.1.1(webpack@5.101.3(esbuild@0.25.9)) '@mdx-js/react': 3.1.1(@types/react@19.2.2)(react@19.2.0) - '@next/swc-darwin-arm64@15.4.8': - optional: true - '@next/swc-darwin-arm64@15.5.7': optional: true - '@next/swc-darwin-x64@15.4.8': + '@next/swc-darwin-arm64@16.1.1': optional: true '@next/swc-darwin-x64@15.5.7': optional: true - '@next/swc-linux-arm64-gnu@15.4.8': + '@next/swc-darwin-x64@16.1.1': optional: true '@next/swc-linux-arm64-gnu@15.5.7': optional: true - '@next/swc-linux-arm64-musl@15.4.8': + '@next/swc-linux-arm64-gnu@16.1.1': optional: true '@next/swc-linux-arm64-musl@15.5.7': optional: true - '@next/swc-linux-x64-gnu@15.4.8': + '@next/swc-linux-arm64-musl@16.1.1': optional: true '@next/swc-linux-x64-gnu@15.5.7': optional: true - '@next/swc-linux-x64-musl@15.4.8': + '@next/swc-linux-x64-gnu@16.1.1': optional: true '@next/swc-linux-x64-musl@15.5.7': optional: true - '@next/swc-win32-arm64-msvc@15.4.8': + '@next/swc-linux-x64-musl@16.1.1': optional: true '@next/swc-win32-arm64-msvc@15.5.7': optional: true - '@next/swc-win32-x64-msvc@15.4.8': + '@next/swc-win32-arm64-msvc@16.1.1': optional: true '@next/swc-win32-x64-msvc@15.5.7': optional: true - '@next/third-parties@16.1.1(next@15.5.9(@babel/core@7.28.5)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(sass@1.93.2))(react@19.2.0)': + '@next/swc-win32-x64-msvc@16.1.1': + optional: true + + '@next/third-parties@16.1.1(next@16.1.1(@babel/core@7.28.5)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(sass@1.93.2))(react@19.2.0)': dependencies: - next: 15.5.9(@babel/core@7.28.5)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(sass@1.93.2) + next: 16.1.1(@babel/core@7.28.5)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(sass@1.93.2) react: 19.2.0 third-party-capital: 1.0.20 @@ -25368,44 +25369,18 @@ snapshots: netmask@2.0.2: {} - next-router-mock@1.0.4(next@15.5.9(@babel/core@7.28.5)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(sass@1.93.2))(react@19.2.0): + next-router-mock@1.0.4(next@16.1.1(@babel/core@7.28.5)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(sass@1.93.2))(react@19.2.0): dependencies: - next: 15.5.9(@babel/core@7.28.5)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(sass@1.93.2) + next: 16.1.1(@babel/core@7.28.5)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(sass@1.93.2) react: 19.2.0 - next-sitemap@4.2.3(next@15.5.9(@babel/core@7.28.5)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(sass@1.93.2)): + next-sitemap@4.2.3(next@16.1.1(@babel/core@7.28.5)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(sass@1.93.2)): dependencies: '@corex/deepmerge': 4.0.43 '@next/env': 13.5.11 fast-glob: 3.3.3 minimist: 1.2.8 - next: 15.5.9(@babel/core@7.28.5)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(sass@1.93.2) - - next@15.4.10(@opentelemetry/api@1.9.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(sass@1.93.2): - dependencies: - '@next/env': 15.4.10 - '@swc/helpers': 0.5.15 - caniuse-lite: 1.0.30001756 - postcss: 8.4.31 - react: 19.1.0 - react-dom: 19.1.0(react@19.1.0) - styled-jsx: 5.1.6(react@19.1.0) - optionalDependencies: - '@next/swc-darwin-arm64': 15.4.8 - '@next/swc-darwin-x64': 15.4.8 - '@next/swc-linux-arm64-gnu': 15.4.8 - '@next/swc-linux-arm64-musl': 15.4.8 - '@next/swc-linux-x64-gnu': 15.4.8 - '@next/swc-linux-x64-musl': 15.4.8 - '@next/swc-win32-arm64-msvc': 15.4.8 - '@next/swc-win32-x64-msvc': 15.4.8 - '@opentelemetry/api': 1.9.0 - babel-plugin-react-compiler: 1.0.0 - sass: 1.93.2 - sharp: 0.34.5 - transitivePeerDependencies: - - '@babel/core' - - babel-plugin-macros + next: 16.1.1(@babel/core@7.28.5)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(sass@1.93.2) next@15.5.9(@babel/core@7.28.4)(@opentelemetry/api@1.9.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.1.1(react@19.1.1))(react@19.1.1)(sass@1.93.2): dependencies: @@ -25434,24 +25409,52 @@ snapshots: - babel-plugin-macros optional: true - next@15.5.9(@babel/core@7.28.5)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(sass@1.93.2): + next@16.1.1(@babel/core@7.28.5)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(sass@1.93.2): dependencies: - '@next/env': 15.5.9 + '@next/env': 16.1.1 '@swc/helpers': 0.5.15 + baseline-browser-mapping: 2.8.29 caniuse-lite: 1.0.30001756 postcss: 8.4.31 react: 19.2.0 react-dom: 19.2.0(react@19.2.0) styled-jsx: 5.1.6(@babel/core@7.28.5)(babel-plugin-macros@3.1.0)(react@19.2.0) optionalDependencies: - '@next/swc-darwin-arm64': 15.5.7 - '@next/swc-darwin-x64': 15.5.7 - '@next/swc-linux-arm64-gnu': 15.5.7 - '@next/swc-linux-arm64-musl': 15.5.7 - '@next/swc-linux-x64-gnu': 15.5.7 - '@next/swc-linux-x64-musl': 15.5.7 - '@next/swc-win32-arm64-msvc': 15.5.7 - '@next/swc-win32-x64-msvc': 15.5.7 + '@next/swc-darwin-arm64': 16.1.1 + '@next/swc-darwin-x64': 16.1.1 + '@next/swc-linux-arm64-gnu': 16.1.1 + '@next/swc-linux-arm64-musl': 16.1.1 + '@next/swc-linux-x64-gnu': 16.1.1 + '@next/swc-linux-x64-musl': 16.1.1 + '@next/swc-win32-arm64-msvc': 16.1.1 + '@next/swc-win32-x64-msvc': 16.1.1 + '@opentelemetry/api': 1.9.0 + babel-plugin-react-compiler: 1.0.0 + sass: 1.93.2 + sharp: 0.34.5 + transitivePeerDependencies: + - '@babel/core' + - babel-plugin-macros + + next@16.1.1(@opentelemetry/api@1.9.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(sass@1.93.2): + dependencies: + '@next/env': 16.1.1 + '@swc/helpers': 0.5.15 + baseline-browser-mapping: 2.8.29 + caniuse-lite: 1.0.30001756 + postcss: 8.4.31 + react: 19.1.0 + react-dom: 19.1.0(react@19.1.0) + styled-jsx: 5.1.6(react@19.1.0) + optionalDependencies: + '@next/swc-darwin-arm64': 16.1.1 + '@next/swc-darwin-x64': 16.1.1 + '@next/swc-linux-arm64-gnu': 16.1.1 + '@next/swc-linux-arm64-musl': 16.1.1 + '@next/swc-linux-x64-gnu': 16.1.1 + '@next/swc-linux-x64-musl': 16.1.1 + '@next/swc-win32-arm64-msvc': 16.1.1 + '@next/swc-win32-x64-msvc': 16.1.1 '@opentelemetry/api': 1.9.0 babel-plugin-react-compiler: 1.0.0 sass: 1.93.2 diff --git a/rivetkit-asyncapi/asyncapi.json b/rivetkit-asyncapi/asyncapi.json index f590e85df4..61eee576f6 100644 --- a/rivetkit-asyncapi/asyncapi.json +++ b/rivetkit-asyncapi/asyncapi.json @@ -2,7 +2,7 @@ "asyncapi": "3.0.0", "info": { "title": "RivetKit WebSocket Protocol", - "version": "2.0.32", + "version": "2.0.33", "description": "WebSocket protocol for bidirectional communication between RivetKit clients and actors" }, "channels": { diff --git a/rivetkit-openapi/openapi.json b/rivetkit-openapi/openapi.json index 4cbe29da87..30c64c0749 100644 --- a/rivetkit-openapi/openapi.json +++ b/rivetkit-openapi/openapi.json @@ -1,7 +1,7 @@ { "openapi": "3.0.0", "info": { - "version": "2.0.32", + "version": "2.0.33", "title": "RivetKit API" }, "components": { @@ -83,6 +83,154 @@ "start_ts": { "type": "number", "nullable": true + }, + "error": { + "anyOf": [ + { + "type": "object", + "properties": { + "serverless_error": { + "anyOf": [ + { + "type": "object", + "properties": { + "http_error": { + "type": "object", + "properties": { + "status_code": { + "type": "number" + }, + "body": { + "type": "string" + } + }, + "required": [ + "status_code", + "body" + ] + } + }, + "required": [ + "http_error" + ] + }, + { + "type": "string", + "enum": [ + "stream_ended_early" + ] + }, + { + "type": "object", + "properties": { + "connection_error": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ] + } + }, + "required": [ + "connection_error" + ] + }, + { + "type": "string", + "enum": [ + "invalid_base64" + ] + }, + { + "type": "object", + "properties": { + "invalid_payload": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ] + } + }, + "required": [ + "invalid_payload" + ] + }, + { + "type": "string", + "enum": [ + "runner_config_not_found" + ] + }, + { + "type": "string", + "enum": [ + "runner_config_not_serverless" + ] + }, + { + "type": "string", + "enum": [ + "namespace_not_found" + ] + } + ] + } + }, + "required": [ + "serverless_error" + ] + }, + { + "type": "object", + "properties": { + "no_capacity": { + "type": "object", + "properties": { + "runner_name": { + "type": "string" + } + }, + "required": [ + "runner_name" + ] + } + }, + "required": [ + "no_capacity" + ] + }, + { + "type": "object", + "properties": { + "runner_no_response": { + "type": "object", + "properties": { + "runner_id": { + "type": "string" + } + }, + "required": [ + "runner_id" + ] + } + }, + "required": [ + "runner_no_response" + ] + }, + { + "nullable": true + } + ] } }, "required": [ @@ -193,6 +341,154 @@ "start_ts": { "type": "number", "nullable": true + }, + "error": { + "anyOf": [ + { + "type": "object", + "properties": { + "serverless_error": { + "anyOf": [ + { + "type": "object", + "properties": { + "http_error": { + "type": "object", + "properties": { + "status_code": { + "type": "number" + }, + "body": { + "type": "string" + } + }, + "required": [ + "status_code", + "body" + ] + } + }, + "required": [ + "http_error" + ] + }, + { + "type": "string", + "enum": [ + "stream_ended_early" + ] + }, + { + "type": "object", + "properties": { + "connection_error": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ] + } + }, + "required": [ + "connection_error" + ] + }, + { + "type": "string", + "enum": [ + "invalid_base64" + ] + }, + { + "type": "object", + "properties": { + "invalid_payload": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ] + } + }, + "required": [ + "invalid_payload" + ] + }, + { + "type": "string", + "enum": [ + "runner_config_not_found" + ] + }, + { + "type": "string", + "enum": [ + "runner_config_not_serverless" + ] + }, + { + "type": "string", + "enum": [ + "namespace_not_found" + ] + } + ] + } + }, + "required": [ + "serverless_error" + ] + }, + { + "type": "object", + "properties": { + "no_capacity": { + "type": "object", + "properties": { + "runner_name": { + "type": "string" + } + }, + "required": [ + "runner_name" + ] + } + }, + "required": [ + "no_capacity" + ] + }, + { + "type": "object", + "properties": { + "runner_no_response": { + "type": "object", + "properties": { + "runner_id": { + "type": "string" + } + }, + "required": [ + "runner_id" + ] + } + }, + "required": [ + "runner_no_response" + ] + }, + { + "nullable": true + } + ] } }, "required": [ @@ -306,6 +602,154 @@ "start_ts": { "type": "number", "nullable": true + }, + "error": { + "anyOf": [ + { + "type": "object", + "properties": { + "serverless_error": { + "anyOf": [ + { + "type": "object", + "properties": { + "http_error": { + "type": "object", + "properties": { + "status_code": { + "type": "number" + }, + "body": { + "type": "string" + } + }, + "required": [ + "status_code", + "body" + ] + } + }, + "required": [ + "http_error" + ] + }, + { + "type": "string", + "enum": [ + "stream_ended_early" + ] + }, + { + "type": "object", + "properties": { + "connection_error": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ] + } + }, + "required": [ + "connection_error" + ] + }, + { + "type": "string", + "enum": [ + "invalid_base64" + ] + }, + { + "type": "object", + "properties": { + "invalid_payload": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ] + } + }, + "required": [ + "invalid_payload" + ] + }, + { + "type": "string", + "enum": [ + "runner_config_not_found" + ] + }, + { + "type": "string", + "enum": [ + "runner_config_not_serverless" + ] + }, + { + "type": "string", + "enum": [ + "namespace_not_found" + ] + } + ] + } + }, + "required": [ + "serverless_error" + ] + }, + { + "type": "object", + "properties": { + "no_capacity": { + "type": "object", + "properties": { + "runner_name": { + "type": "string" + } + }, + "required": [ + "runner_name" + ] + } + }, + "required": [ + "no_capacity" + ] + }, + { + "type": "object", + "properties": { + "runner_no_response": { + "type": "object", + "properties": { + "runner_id": { + "type": "string" + } + }, + "required": [ + "runner_id" + ] + } + }, + "required": [ + "runner_no_response" + ] + }, + { + "nullable": true + } + ] } }, "required": [ diff --git a/rivetkit-typescript/packages/cloudflare-workers/src/mod.ts b/rivetkit-typescript/packages/cloudflare-workers/src/mod.ts index 40129e55fe..082b9bd078 100644 --- a/rivetkit-typescript/packages/cloudflare-workers/src/mod.ts +++ b/rivetkit-typescript/packages/cloudflare-workers/src/mod.ts @@ -1,11 +1,11 @@ -export type { Client } from "rivetkit"; -export type { DriverContext } from "./actor-driver"; -export { createActorDurableObject } from "./actor-handler-do"; -export type { InputConfig as Config } from "./config"; -export { - type Bindings, - createHandler, - createInlineClient, - HandlerOutput, - InlineOutput, -} from "./handler"; +// export type { Client } from "rivetkit"; +// export type { DriverContext } from "./actor-driver"; +// export { createActorDurableObject } from "./actor-handler-do"; +// export type { InputConfig as Config } from "./config"; +// export { +// type Bindings, +// createHandler, +// createInlineClient, +// HandlerOutput, +// InlineOutput, +// } from "./handler"; diff --git a/rivetkit-typescript/packages/next-js/src/mod.ts b/rivetkit-typescript/packages/next-js/src/mod.ts index 73b5afd511..cb7c835f15 100644 --- a/rivetkit-typescript/packages/next-js/src/mod.ts +++ b/rivetkit-typescript/packages/next-js/src/mod.ts @@ -1,232 +1,232 @@ -import { existsSync, statSync } from "node:fs"; -import { join } from "node:path"; -import type { Registry, RunConfigInput } from "rivetkit"; -import { stringifyError } from "rivetkit/utils"; -import { logger } from "./log"; - -export const toNextHandler = ( - registry: Registry, - inputConfig: RunConfigInput = {}, -) => { - // Don't run server locally since we're using the fetch handler directly - inputConfig.disableDefaultServer = true; - - // Configure serverless - inputConfig.runnerKind = "serverless"; - - if (process.env.NODE_ENV !== "production") { - // Auto-configure serverless runner if not in prod - logger().debug( - "detected development environment, auto-starting engine and auto-configuring serverless", - ); - - const publicUrl = - process.env.NEXT_PUBLIC_SITE_URL ?? - process.env.NEXT_PUBLIC_VERCEL_URL ?? - `http://127.0.0.1:${process.env.PORT ?? 3000}`; - - inputConfig.runEngine = true; - inputConfig.autoConfigureServerless = { - url: `${publicUrl}/api/rivet`, - minRunners: 0, - maxRunners: 100_000, - requestLifespan: 300, - slotsPerRunner: 1, - metadata: { provider: "next-js" }, - }; - } else { - logger().debug( - "detected production environment, will not auto-start engine and auto-configure serverless", - ); - } - - // Next logs this on every request - inputConfig.noWelcome = true; - - const { fetch } = registry.start(inputConfig); - - // Function that Next will call when handling requests - const fetchWrapper = async ( - request: Request, - { params }: { params: Promise<{ all: string[] }> }, - ): Promise => { - const { all } = await params; - - const newUrl = new URL(request.url); - newUrl.pathname = all.join("/"); - - if (process.env.NODE_ENV !== "development") { - // Handle request - const newReq = new Request(newUrl, request); - return await fetch(newReq); - } else { - // Special request handling for file watching - return await handleRequestWithFileWatcher(request, newUrl, fetch); - } - }; - - return { - GET: fetchWrapper, - POST: fetchWrapper, - PUT: fetchWrapper, - PATCH: fetchWrapper, - HEAD: fetchWrapper, - OPTIONS: fetchWrapper, - }; -}; - -/** - * Special request handler that will watch the source file to terminate this - * request once complete. - * - * See docs on watchRouteFile for more information. - */ -async function handleRequestWithFileWatcher( - request: Request, - newUrl: URL, - fetch: (request: Request, ...args: any) => Response | Promise, -): Promise { - // Create a new abort controller that we can abort, since the signal on - // the request we cannot control - const mergedController = new AbortController(); - const abortMerged = () => mergedController.abort(); - request.signal?.addEventListener("abort", abortMerged); - - // Watch for file changes in dev - // - // We spawn one watcher per-request since there is not a clean way of - // cleaning up global watchers when hot reloading in Next - const watchIntervalId = watchRouteFile(mergedController); - - // Clear interval if request is aborted - request.signal.addEventListener("abort", () => { - logger().debug("clearing file watcher interval: request aborted"); - clearInterval(watchIntervalId); - }); - - // Replace URL and abort signal - const newReq = new Request(newUrl, { - // Copy old request properties - method: request.method, - headers: request.headers, - body: request.body, - credentials: request.credentials, - cache: request.cache, - redirect: request.redirect, - referrer: request.referrer, - integrity: request.integrity, - // Override with new signal - signal: mergedController.signal, - // Required for streaming body - duplex: "half", - } as RequestInit); - - // Handle request - const response = await fetch(newReq); - - // HACK: Next.js does not provide a way to detect when a request - // finishes, so we need to tap the response stream - // - // We can't just wait for `await fetch` to finish since SSE streams run - // for longer - if (response.body) { - const wrappedStream = waitForStreamFinish(response.body, () => { - logger().debug("clearing file watcher interval: stream finished"); - clearInterval(watchIntervalId); - }); - return new Response(wrappedStream, { - status: response.status, - statusText: response.statusText, - headers: response.headers, - }); - } else { - // No response body, clear interval immediately - logger().debug("clearing file watcher interval: no response body"); - clearInterval(watchIntervalId); - return response; - } -} - -/** - * HACK: Watch for file changes on this route in order to shut down the runner. - * We do this because Next.js does not terminate long-running requests on file - * change, so we need to manually shut down the runner in order to trigger a - * new `/start` request with the new code. - * - * We don't use file watchers since those are frequently buggy x-platform and - * subject to misconfigured inotify limits. - */ -function watchRouteFile(abortController: AbortController): NodeJS.Timeout { - logger().debug("starting file watcher"); - - const routePath = join( - process.cwd(), - ".next/server/app/api/rivet/[...all]/route.js", - ); - - let lastMtime: number | null = null; - const checkFile = () => { - logger().debug({ msg: "checking for file changes", routePath }); - try { - if (!existsSync(routePath)) { - return; - } - - const stats = statSync(routePath); - const mtime = stats.mtimeMs; - - if (lastMtime !== null && mtime !== lastMtime) { - logger().info({ msg: "route file changed", routePath }); - abortController.abort(); - } - - lastMtime = mtime; - } catch (err) { - logger().info({ - msg: "failed to check for route file change", - err: stringifyError(err), - }); - } - }; - - checkFile(); - - return setInterval(checkFile, 1000); -} - -/** - * Waits for a stream to finish and calls onFinish on complete. - * - * Used for cancelling the file watcher. - */ -function waitForStreamFinish( - body: ReadableStream, - onFinish: () => void, -): ReadableStream { - const reader = body.getReader(); - return new ReadableStream({ - async start(controller) { - try { - while (true) { - const { done, value } = await reader.read(); - if (done) { - logger().debug("stream completed"); - onFinish(); - controller.close(); - break; - } - controller.enqueue(value); - } - } catch (err) { - logger().debug("stream errored"); - onFinish(); - controller.error(err); - } - }, - cancel() { - logger().debug("stream cancelled"); - onFinish(); - reader.cancel(); - }, - }); -} +// import { existsSync, statSync } from "node:fs"; +// import { join } from "node:path"; +// import type { Registry, RunConfigInput } from "rivetkit"; +// import { stringifyError } from "rivetkit/utils"; +// import { logger } from "./log"; +// +// export const toNextHandler = ( +// registry: Registry, +// inputConfig: RunConfigInput = {}, +// ) => { +// // Don't run server locally since we're using the fetch handler directly +// inputConfig.disableDefaultServer = true; +// +// // Configure serverless +// inputConfig.runnerKind = "serverless"; +// +// if (process.env.NODE_ENV !== "production") { +// // Auto-configure serverless runner if not in prod +// logger().debug( +// "detected development environment, auto-starting engine and auto-configuring serverless", +// ); +// +// const publicUrl = +// process.env.NEXT_PUBLIC_SITE_URL ?? +// process.env.NEXT_PUBLIC_VERCEL_URL ?? +// `http://127.0.0.1:${process.env.PORT ?? 3000}`; +// +// inputConfig.runEngine = true; +// inputConfig.autoConfigureServerless = { +// url: `${publicUrl}/api/rivet`, +// minRunners: 0, +// maxRunners: 100_000, +// requestLifespan: 300, +// slotsPerRunner: 1, +// metadata: { provider: "next-js" }, +// }; +// } else { +// logger().debug( +// "detected production environment, will not auto-start engine and auto-configure serverless", +// ); +// } +// +// // Next logs this on every request +// inputConfig.noWelcome = true; +// +// const { fetch } = registry.start(inputConfig); +// +// // Function that Next will call when handling requests +// const fetchWrapper = async ( +// request: Request, +// { params }: { params: Promise<{ all: string[] }> }, +// ): Promise => { +// const { all } = await params; +// +// const newUrl = new URL(request.url); +// newUrl.pathname = all.join("/"); +// +// if (process.env.NODE_ENV !== "development") { +// // Handle request +// const newReq = new Request(newUrl, request); +// return await fetch(newReq); +// } else { +// // Special request handling for file watching +// return await handleRequestWithFileWatcher(request, newUrl, fetch); +// } +// }; +// +// return { +// GET: fetchWrapper, +// POST: fetchWrapper, +// PUT: fetchWrapper, +// PATCH: fetchWrapper, +// HEAD: fetchWrapper, +// OPTIONS: fetchWrapper, +// }; +// }; +// +// /** +// * Special request handler that will watch the source file to terminate this +// * request once complete. +// * +// * See docs on watchRouteFile for more information. +// */ +// async function handleRequestWithFileWatcher( +// request: Request, +// newUrl: URL, +// fetch: (request: Request, ...args: any) => Response | Promise, +// ): Promise { +// // Create a new abort controller that we can abort, since the signal on +// // the request we cannot control +// const mergedController = new AbortController(); +// const abortMerged = () => mergedController.abort(); +// request.signal?.addEventListener("abort", abortMerged); +// +// // Watch for file changes in dev +// // +// // We spawn one watcher per-request since there is not a clean way of +// // cleaning up global watchers when hot reloading in Next +// const watchIntervalId = watchRouteFile(mergedController); +// +// // Clear interval if request is aborted +// request.signal.addEventListener("abort", () => { +// logger().debug("clearing file watcher interval: request aborted"); +// clearInterval(watchIntervalId); +// }); +// +// // Replace URL and abort signal +// const newReq = new Request(newUrl, { +// // Copy old request properties +// method: request.method, +// headers: request.headers, +// body: request.body, +// credentials: request.credentials, +// cache: request.cache, +// redirect: request.redirect, +// referrer: request.referrer, +// integrity: request.integrity, +// // Override with new signal +// signal: mergedController.signal, +// // Required for streaming body +// duplex: "half", +// } as RequestInit); +// +// // Handle request +// const response = await fetch(newReq); +// +// // HACK: Next.js does not provide a way to detect when a request +// // finishes, so we need to tap the response stream +// // +// // We can't just wait for `await fetch` to finish since SSE streams run +// // for longer +// if (response.body) { +// const wrappedStream = waitForStreamFinish(response.body, () => { +// logger().debug("clearing file watcher interval: stream finished"); +// clearInterval(watchIntervalId); +// }); +// return new Response(wrappedStream, { +// status: response.status, +// statusText: response.statusText, +// headers: response.headers, +// }); +// } else { +// // No response body, clear interval immediately +// logger().debug("clearing file watcher interval: no response body"); +// clearInterval(watchIntervalId); +// return response; +// } +// } +// +// /** +// * HACK: Watch for file changes on this route in order to shut down the runner. +// * We do this because Next.js does not terminate long-running requests on file +// * change, so we need to manually shut down the runner in order to trigger a +// * new `/start` request with the new code. +// * +// * We don't use file watchers since those are frequently buggy x-platform and +// * subject to misconfigured inotify limits. +// */ +// function watchRouteFile(abortController: AbortController): NodeJS.Timeout { +// logger().debug("starting file watcher"); +// +// const routePath = join( +// process.cwd(), +// ".next/server/app/api/rivet/[...all]/route.js", +// ); +// +// let lastMtime: number | null = null; +// const checkFile = () => { +// logger().debug({ msg: "checking for file changes", routePath }); +// try { +// if (!existsSync(routePath)) { +// return; +// } +// +// const stats = statSync(routePath); +// const mtime = stats.mtimeMs; +// +// if (lastMtime !== null && mtime !== lastMtime) { +// logger().info({ msg: "route file changed", routePath }); +// abortController.abort(); +// } +// +// lastMtime = mtime; +// } catch (err) { +// logger().info({ +// msg: "failed to check for route file change", +// err: stringifyError(err), +// }); +// } +// }; +// +// checkFile(); +// +// return setInterval(checkFile, 1000); +// } +// +// /** +// * Waits for a stream to finish and calls onFinish on complete. +// * +// * Used for cancelling the file watcher. +// */ +// function waitForStreamFinish( +// body: ReadableStream, +// onFinish: () => void, +// ): ReadableStream { +// const reader = body.getReader(); +// return new ReadableStream({ +// async start(controller) { +// try { +// while (true) { +// const { done, value } = await reader.read(); +// if (done) { +// logger().debug("stream completed"); +// onFinish(); +// controller.close(); +// break; +// } +// controller.enqueue(value); +// } +// } catch (err) { +// logger().debug("stream errored"); +// onFinish(); +// controller.error(err); +// } +// }, +// cancel() { +// logger().debug("stream cancelled"); +// onFinish(); +// reader.cancel(); +// }, +// }); +// } diff --git a/website/package.json b/website/package.json index 3763b85956..597dd445cd 100644 --- a/website/package.json +++ b/website/package.json @@ -60,7 +60,7 @@ "jszip": "^3.10.1", "mdast-util-to-string": "^4.0.0", "mdx-annotations": "^0.1.4", - "next": "^15.5.9", + "next": "^16.1.1", "next-router-mock": "^1.0.4", "next-sitemap": "^4.2.3", "postcss": "^8.5.6",