@rivetkit/next-js 2.0.41 → 2.0.43-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/nathan/rivet/rivetkit-typescript/packages/next-js/dist/client/mod.js","../../src/client/mod.ts"],"names":[],"mappings":"AAAA;ACAA,mEAAc","file":"/Users/nathan/rivet/rivetkit-typescript/packages/next-js/dist/client/mod.js","sourcesContent":[null,"export * from \"@rivetkit/react\";\n"]}
1
+ {"version":3,"sources":["/home/runner/work/rivet/rivet/rivetkit-typescript/packages/next-js/dist/client/mod.js","../../src/client/mod.ts"],"names":[],"mappings":"AAAA;ACAA,mEAAc","file":"/home/runner/work/rivet/rivet/rivetkit-typescript/packages/next-js/dist/client/mod.js","sourcesContent":[null,"export * from \"@rivetkit/react\";\n"]}
package/dist/mod.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/nathan/rivet/rivetkit-typescript/packages/next-js/dist/mod.js","../src/log.ts","../src/mod.ts"],"names":[],"mappings":"AAAA;ACAA,mCAA0B;AAEnB,SAAS,MAAA,CAAA,EAAS;AACxB,EAAA,OAAO,4BAAA,gBAA0B,CAAA;AAClC;ADCA;AACA;AEIA,IAAM,mBAAA,EAAqB,IAAA,CAAK,KAAA,CAAM,IAAA,CAAK,GAAA,CAAI,EAAA,EAAI,GAAI,CAAA;AAEhD,IAAM,cAAA,EAAgB,CAAC,QAAA,EAAA,GAA4B;AAEzD,EAAA,QAAA,CAAS,MAAA,CAAO,aAAA,EAAe,KAAA;AAG/B,EAAA,QAAA,CAAS,MAAA,CAAO,WAAA,EAAa;AAAA,IAC5B,GAAG,QAAA,CAAS,MAAA,CAAO,UAAA;AAAA,IACnB,QAAA,EAAU;AAAA,EACX,CAAA;AAEA,EAAA,GAAA,CAAI,OAAA,CAAQ,GAAA,CAAI,SAAA,IAAa,YAAA,EAAc;AAC1C,IAAA,MAAA,CAAO,CAAA,CAAE,KAAA;AAAA,MACR;AAAA,IACD,CAAA;AAEA,IAAA,MAAM,UAAA,oCACL,OAAA,CAAQ,GAAA,CAAI,oBAAA,UACZ,OAAA,CAAQ,GAAA,CAAI,wBAAA,UACZ,CAAA,iBAAA,mBAAoB,OAAA,CAAQ,GAAA,CAAI,IAAA,UAAQ,KAAI,CAAA,GAAA;AAIJ,IAAA;AACQ,IAAA;AAC/B,MAAA;AACL,MAAA;AACA,MAAA;AACK,MAAA;AACD,MAAA;AACgB,MAAA;AACjC,IAAA;AAGyB,IAAA;AACL,MAAA;AACV,MAAA;AACV,IAAA;AACM,EAAA;AACG,IAAA;AACR,MAAA;AACD,IAAA;AACD,EAAA;AAG4B,EAAA;AAKJ,EAAA;AACD,IAAA;AACe,IAAA;AACC,IAAA;AAEuB,IAAA;AAC9D,EAAA;AAEO,EAAA;AACD,IAAA;AACC,IAAA;AACD,IAAA;AACG,IAAA;AACD,IAAA;AACD,IAAA;AACG,IAAA;AACV,EAAA;AACD;AFxB4I;AACA;AACA","file":"/Users/nathan/rivet/rivetkit-typescript/packages/next-js/dist/mod.js","sourcesContent":[null,"import { getLogger } from \"rivetkit/log\";\n\nexport function logger() {\n\treturn getLogger(\"driver-next-js\");\n}\n","import type { Registry } from \"rivetkit\";\nimport { logger } from \"./log\";\n\n// Runner version set to seconds since epoch when the module loads in development mode.\n//\n// This creates a version number that increments each time the code is updated\n// and the module reloads, allowing the engine to detect code changes via the\n// /metadata endpoint and hot-reload all actors by draining older runners.\n//\n// We use seconds (not milliseconds) because the runner version is a u32 on the engine side.\nconst DEV_RUNNER_VERSION = Math.floor(Date.now() / 1000);\n\nexport const toNextHandler = (registry: Registry<any>) => {\n\t// Don't run server locally since we're using the fetch handler directly\n\tregistry.config.serveManager = false;\n\n\t// Set basePath to \"/\" since Next.js route strips the /api/rivet prefix\n\tregistry.config.serverless = {\n\t\t...registry.config.serverless,\n\t\tbasePath: \"/\",\n\t};\n\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tlogger().debug(\n\t\t\t\"detected development environment, auto-starting engine and auto-configuring serverless\",\n\t\t);\n\n\t\tconst publicUrl =\n\t\t\tprocess.env.NEXT_PUBLIC_SITE_URL ??\n\t\t\tprocess.env.NEXT_PUBLIC_VERCEL_URL ??\n\t\t\t`http://127.0.0.1:${process.env.PORT ?? 3000}`;\n\n\t\t// Set these on the registry's config directly since the legacy inputConfig\n\t\t// isn't used by the serverless router\n\t\tregistry.config.serverless.spawnEngine = true;\n\t\tregistry.config.serverless.configureRunnerPool = {\n\t\t\turl: `${publicUrl}/api/rivet`,\n\t\t\tminRunners: 0,\n\t\t\tmaxRunners: 100_000,\n\t\t\trequestLifespan: 300,\n\t\t\tslotsPerRunner: 1,\n\t\t\tmetadata: { provider: \"next-js\" },\n\t\t};\n\n\t\t// Set runner version to enable hot-reloading on code changes\n\t\tregistry.config.runner = {\n\t\t\t...registry.config.runner,\n\t\t\tversion: DEV_RUNNER_VERSION,\n\t\t};\n\t} else {\n\t\tlogger().debug(\n\t\t\t\"detected production environment, will not auto-start engine and auto-configure serverless\",\n\t\t);\n\t}\n\n\t// Next logs this on every request\n\tregistry.config.noWelcome = true;\n\n\tconst fetchWrapper = async (\n\t\trequest: Request,\n\t\t{ params }: { params: Promise<{ all: string[] }> },\n\t): Promise<Response> => {\n\t\tconst { all } = await params;\n\t\tconst targetUrl = new URL(request.url);\n\t\ttargetUrl.pathname = `/${all.join(\"/\")}`;\n\n\t\treturn await registry.handler(new Request(targetUrl, request));\n\t};\n\n\treturn {\n\t\tGET: fetchWrapper,\n\t\tPOST: fetchWrapper,\n\t\tPUT: fetchWrapper,\n\t\tDELETE: fetchWrapper,\n\t\tPATCH: fetchWrapper,\n\t\tHEAD: fetchWrapper,\n\t\tOPTIONS: fetchWrapper,\n\t};\n};\n"]}
1
+ {"version":3,"sources":["/home/runner/work/rivet/rivet/rivetkit-typescript/packages/next-js/dist/mod.js","../src/log.ts","../src/mod.ts"],"names":[],"mappings":"AAAA;AC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ist/mod.js","sourcesContent":[null,"import { getLogger } from \"rivetkit/log\";\n\nexport function logger() {\n\treturn getLogger(\"driver-next-js\");\n}\n","import type { Registry } from \"rivetkit\";\nimport { logger } from \"./log\";\n\n// Runner version set to seconds since epoch when the module loads in development mode.\n//\n// This creates a version number that increments each time the code is updated\n// and the module reloads, allowing the engine to detect code changes via the\n// /metadata endpoint and hot-reload all actors by draining older runners.\n//\n// We use seconds (not milliseconds) because the runner version is a u32 on the engine side.\nconst DEV_RUNNER_VERSION = Math.floor(Date.now() / 1000);\n\nexport const toNextHandler = (registry: Registry<any>) => {\n\t// Don't run server locally since we're using the fetch handler directly\n\tregistry.config.serveManager = false;\n\n\t// Set basePath to \"/\" since Next.js route strips the /api/rivet prefix\n\tregistry.config.serverless = {\n\t\t...registry.config.serverless,\n\t\tbasePath: \"/\",\n\t};\n\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tlogger().debug(\n\t\t\t\"detected development environment, auto-starting engine and auto-configuring serverless\",\n\t\t);\n\n\t\tconst publicUrl =\n\t\t\tprocess.env.NEXT_PUBLIC_SITE_URL ??\n\t\t\tprocess.env.NEXT_PUBLIC_VERCEL_URL ??\n\t\t\t`http://127.0.0.1:${process.env.PORT ?? 3000}`;\n\n\t\t// Set these on the registry's config directly since the legacy inputConfig\n\t\t// isn't used by the serverless router\n\t\tregistry.config.serverless.spawnEngine = true;\n\t\tregistry.config.serverless.configureRunnerPool = {\n\t\t\turl: `${publicUrl}/api/rivet`,\n\t\t\tminRunners: 0,\n\t\t\tmaxRunners: 100_000,\n\t\t\trequestLifespan: 300,\n\t\t\tslotsPerRunner: 1,\n\t\t\tmetadata: { provider: \"next-js\" },\n\t\t};\n\n\t\t// Set runner version to enable hot-reloading on code changes\n\t\tregistry.config.runner = {\n\t\t\t...registry.config.runner,\n\t\t\tversion: DEV_RUNNER_VERSION,\n\t\t};\n\t} else {\n\t\tlogger().debug(\n\t\t\t\"detected production environment, will not auto-start engine and auto-configure serverless\",\n\t\t);\n\t}\n\n\t// Next logs this on every request\n\tregistry.config.noWelcome = true;\n\n\tconst fetchWrapper = async (\n\t\trequest: Request,\n\t\t{ params }: { params: Promise<{ all: string[] }> },\n\t): Promise<Response> => {\n\t\tconst { all } = await params;\n\t\tconst targetUrl = new URL(request.url);\n\t\ttargetUrl.pathname = `/${all.join(\"/\")}`;\n\n\t\treturn await registry.handler(new Request(targetUrl, request));\n\t};\n\n\treturn {\n\t\tGET: fetchWrapper,\n\t\tPOST: fetchWrapper,\n\t\tPUT: fetchWrapper,\n\t\tDELETE: fetchWrapper,\n\t\tPATCH: fetchWrapper,\n\t\tHEAD: fetchWrapper,\n\t\tOPTIONS: fetchWrapper,\n\t};\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rivetkit/next-js",
3
- "version": "2.0.41",
3
+ "version": "2.0.43-rc.1",
4
4
  "description": "Next.js integration for RivetKit actors and client",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [
@@ -49,8 +49,8 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "hono": "^4.8.3",
52
- "@rivetkit/react": "2.0.41",
53
- "rivetkit": "^2.0.41"
52
+ "@rivetkit/react": "2.0.43-rc.1",
53
+ "rivetkit": "^2.0.43-rc.1"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "react": "^18 || ^19",