@payloadcms/tanstack-start 4.0.0-internal.77191e5 → 4.0.0-internal.7d5c665

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.
Files changed (145) hide show
  1. package/dist/adapters/handleServerFunctions.d.ts.map +1 -0
  2. package/dist/adapters/handleServerFunctions.js +9 -0
  3. package/dist/adapters/handleServerFunctions.js.map +1 -0
  4. package/dist/{layouts/Root/withPayloadRoot.d.ts → adapters/layout/index.d.ts} +29 -4
  5. package/dist/adapters/layout/index.d.ts.map +1 -0
  6. package/dist/adapters/layout/index.js +105 -0
  7. package/dist/adapters/layout/index.js.map +1 -0
  8. package/dist/adapters/layout/lazy.d.ts +11 -0
  9. package/dist/adapters/layout/lazy.d.ts.map +1 -0
  10. package/dist/adapters/layout/lazy.js +23 -0
  11. package/dist/adapters/layout/lazy.js.map +1 -0
  12. package/dist/adapters/layout/server.d.ts +29 -0
  13. package/dist/adapters/layout/server.d.ts.map +1 -0
  14. package/dist/adapters/layout/server.js +63 -0
  15. package/dist/adapters/layout/server.js.map +1 -0
  16. package/dist/{utilities/meta.d.ts → adapters/metadata.d.ts} +10 -1
  17. package/dist/adapters/metadata.d.ts.map +1 -0
  18. package/dist/{utilities/meta.js → adapters/metadata.js} +60 -1
  19. package/dist/adapters/metadata.js.map +1 -0
  20. package/dist/{elements/RouterAdapter/index.d.ts → adapters/router.d.ts} +1 -1
  21. package/dist/adapters/router.d.ts.map +1 -0
  22. package/dist/{elements/RouterAdapter/index.js → adapters/router.js} +11 -4
  23. package/dist/adapters/router.js.map +1 -0
  24. package/dist/{utilities/serverAdapter.server.d.ts → adapters/server.d.ts} +1 -1
  25. package/dist/adapters/server.d.ts.map +1 -0
  26. package/dist/{utilities/serverAdapter.server.js → adapters/server.js} +3 -30
  27. package/dist/adapters/server.js.map +1 -0
  28. package/dist/{routes/adminRoutes.d.ts → adapters/views/index.d.ts} +5 -9
  29. package/dist/adapters/views/index.d.ts.map +1 -0
  30. package/dist/{routes/adminRoutes.js → adapters/views/index.js} +7 -43
  31. package/dist/adapters/views/index.js.map +1 -0
  32. package/dist/adapters/views/lazy.d.ts +4 -0
  33. package/dist/adapters/views/lazy.d.ts.map +1 -0
  34. package/dist/adapters/views/lazy.js +43 -0
  35. package/dist/adapters/views/lazy.js.map +1 -0
  36. package/dist/{utilities/loadAdminPage.d.ts → adapters/views/server.d.ts} +4 -4
  37. package/dist/adapters/views/server.d.ts.map +1 -0
  38. package/dist/{utilities/loadAdminPage.js → adapters/views/server.js} +13 -75
  39. package/dist/adapters/views/server.js.map +1 -0
  40. package/dist/auth/login.js +1 -1
  41. package/dist/auth/login.js.map +1 -1
  42. package/dist/auth/logout.js +1 -1
  43. package/dist/auth/logout.js.map +1 -1
  44. package/dist/auth/refresh.js +1 -1
  45. package/dist/auth/refresh.js.map +1 -1
  46. package/dist/exports/client.d.ts +2 -4
  47. package/dist/exports/client.d.ts.map +1 -1
  48. package/dist/exports/client.js +2 -4
  49. package/dist/exports/client.js.map +1 -1
  50. package/dist/exports/layouts.d.ts +2 -3
  51. package/dist/exports/layouts.d.ts.map +1 -1
  52. package/dist/exports/layouts.js +1 -2
  53. package/dist/exports/layouts.js.map +1 -1
  54. package/dist/exports/server.d.ts +7 -9
  55. package/dist/exports/server.d.ts.map +1 -1
  56. package/dist/exports/server.js +7 -9
  57. package/dist/exports/server.js.map +1 -1
  58. package/dist/{utilities/graphqlHandler.server.d.ts → routes/graphql/handler.server.d.ts} +1 -3
  59. package/dist/routes/graphql/handler.server.d.ts.map +1 -0
  60. package/dist/{utilities/graphqlHandler.server.js → routes/graphql/handler.server.js} +9 -6
  61. package/dist/routes/graphql/handler.server.js.map +1 -0
  62. package/dist/routes/rest/handler.server.d.ts +10 -0
  63. package/dist/routes/rest/handler.server.d.ts.map +1 -0
  64. package/dist/routes/rest/handler.server.js +13 -0
  65. package/dist/routes/rest/handler.server.js.map +1 -0
  66. package/dist/routes/{apiRoute.d.ts → rest/index.d.ts} +1 -1
  67. package/dist/routes/rest/index.d.ts.map +1 -0
  68. package/dist/routes/{apiRoute.js → rest/index.js} +2 -2
  69. package/dist/routes/rest/index.js.map +1 -0
  70. package/dist/rsc/CollectionCards.js +1 -1
  71. package/dist/rsc/CollectionCards.js.map +1 -1
  72. package/dist/utilities/devConfigReload.server.js +28 -3
  73. package/dist/utilities/devConfigReload.server.js.map +1 -1
  74. package/dist/utilities/getRequestI18n.server.d.ts +1 -1
  75. package/dist/utilities/getRequestI18n.server.js +1 -1
  76. package/dist/utilities/getRequestI18n.server.js.map +1 -1
  77. package/dist/utilities/initAdminContext.server.d.ts +9 -0
  78. package/dist/utilities/initAdminContext.server.d.ts.map +1 -0
  79. package/dist/utilities/initAdminContext.server.js +13 -0
  80. package/dist/utilities/initAdminContext.server.js.map +1 -0
  81. package/dist/withPayload/config/optimizeDeps.d.ts.map +1 -1
  82. package/dist/withPayload/config/optimizeDeps.js +34 -1
  83. package/dist/withPayload/config/optimizeDeps.js.map +1 -1
  84. package/dist/withPayload/index.d.ts +8 -10
  85. package/dist/withPayload/index.d.ts.map +1 -1
  86. package/dist/withPayload/index.js +11 -13
  87. package/dist/withPayload/index.js.map +1 -1
  88. package/dist/withPayload/workarounds/stripDistStyleImports.js +1 -1
  89. package/dist/withPayload/workarounds/stripDistStyleImports.js.map +1 -1
  90. package/package.json +15 -13
  91. package/dist/elements/RouterAdapter/index.d.ts.map +0 -1
  92. package/dist/elements/RouterAdapter/index.js.map +0 -1
  93. package/dist/layouts/Root/getLayoutData.d.ts +0 -34
  94. package/dist/layouts/Root/getLayoutData.d.ts.map +0 -1
  95. package/dist/layouts/Root/getLayoutData.js +0 -97
  96. package/dist/layouts/Root/getLayoutData.js.map +0 -1
  97. package/dist/layouts/Root/withPayloadRoot.d.ts.map +0 -1
  98. package/dist/layouts/Root/withPayloadRoot.js +0 -91
  99. package/dist/layouts/Root/withPayloadRoot.js.map +0 -1
  100. package/dist/node/cssLoader.d.mts +0 -25
  101. package/dist/node/cssLoader.d.mts.map +0 -1
  102. package/dist/node/cssLoader.js +0 -70
  103. package/dist/node/cssLoader.js.map +0 -1
  104. package/dist/node/cssLoader.mjs +0 -75
  105. package/dist/node/registerCssLoader.d.mts +0 -2
  106. package/dist/node/registerCssLoader.d.mts.map +0 -1
  107. package/dist/node/registerCssLoader.js +0 -10
  108. package/dist/node/registerCssLoader.js.map +0 -1
  109. package/dist/node/registerCssLoader.mjs +0 -10
  110. package/dist/routes/adminRoutes.d.ts.map +0 -1
  111. package/dist/routes/adminRoutes.js.map +0 -1
  112. package/dist/routes/apiRoute.d.ts.map +0 -1
  113. package/dist/routes/apiRoute.js.map +0 -1
  114. package/dist/routes/layoutRoute.d.ts +0 -27
  115. package/dist/routes/layoutRoute.d.ts.map +0 -1
  116. package/dist/routes/layoutRoute.js +0 -59
  117. package/dist/routes/layoutRoute.js.map +0 -1
  118. package/dist/utilities/getRequestLocale.d.ts +0 -7
  119. package/dist/utilities/getRequestLocale.d.ts.map +0 -1
  120. package/dist/utilities/getRequestLocale.js +0 -19
  121. package/dist/utilities/getRequestLocale.js.map +0 -1
  122. package/dist/utilities/graphqlHandler.server.d.ts.map +0 -1
  123. package/dist/utilities/graphqlHandler.server.js.map +0 -1
  124. package/dist/utilities/handleAPIRoute.server.d.ts +0 -11
  125. package/dist/utilities/handleAPIRoute.server.d.ts.map +0 -1
  126. package/dist/utilities/handleAPIRoute.server.js +0 -17
  127. package/dist/utilities/handleAPIRoute.server.js.map +0 -1
  128. package/dist/utilities/handleServerFunctions.d.ts.map +0 -1
  129. package/dist/utilities/handleServerFunctions.js +0 -12
  130. package/dist/utilities/handleServerFunctions.js.map +0 -1
  131. package/dist/utilities/initReq.server.d.ts +0 -20
  132. package/dist/utilities/initReq.server.d.ts.map +0 -1
  133. package/dist/utilities/initReq.server.js +0 -123
  134. package/dist/utilities/initReq.server.js.map +0 -1
  135. package/dist/utilities/loadAdminPage.d.ts.map +0 -1
  136. package/dist/utilities/loadAdminPage.js.map +0 -1
  137. package/dist/utilities/loadLayoutData.d.ts +0 -17
  138. package/dist/utilities/loadLayoutData.d.ts.map +0 -1
  139. package/dist/utilities/loadLayoutData.js +0 -22
  140. package/dist/utilities/loadLayoutData.js.map +0 -1
  141. package/dist/utilities/meta.d.ts.map +0 -1
  142. package/dist/utilities/meta.js.map +0 -1
  143. package/dist/utilities/serverAdapter.server.d.ts.map +0 -1
  144. package/dist/utilities/serverAdapter.server.js.map +0 -1
  145. /package/dist/{utilities → adapters}/handleServerFunctions.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/exports/server.ts"],"sourcesContent":["export { login } from '../auth/login.js'\nexport { logout } from '../auth/logout.js'\nexport { refresh } from '../auth/refresh.js'\nexport { payloadApiHandlers } from '../routes/apiRoute.js'\nexport { getRequestI18n } from '../utilities/getRequestI18n.server.js'\nexport { getRequestLocale } from '../utilities/getRequestLocale.js'\nexport { handleGraphQL } from '../utilities/graphqlHandler.server.js'\nexport { handleAPIRoute } from '../utilities/handleAPIRoute.server.js'\nexport { handleServerFunctions } from '../utilities/handleServerFunctions.js'\nexport { initReq } from '../utilities/initReq.server.js'\nexport {\n loadAdminPage,\n type LoadAdminPageArgs,\n type LoadAdminPageResult,\n} from '../utilities/loadAdminPage.js'\nexport { type AdminPageMetadata, getAdminMeta } from '../utilities/meta.js'\nexport { serializeForRsc } from '../utilities/serializeForRsc.js'\nexport {\n createPageRenderServerAdapter,\n type PageNavIntent,\n tanstackServerAdapter,\n} from '../utilities/serverAdapter.server.js'\nexport { type SerializableRecord, toSerializable } from '../utilities/toSerializable.js'\nexport { getRequestTheme } from '@payloadcms/ui/utilities/getRequestTheme'\n"],"names":["login","logout","refresh","payloadApiHandlers","getRequestI18n","getRequestLocale","handleGraphQL","handleAPIRoute","handleServerFunctions","initReq","loadAdminPage","getAdminMeta","serializeForRsc","createPageRenderServerAdapter","tanstackServerAdapter","toSerializable","getRequestTheme"],"mappings":"AAAA,SAASA,KAAK,QAAQ,mBAAkB;AACxC,SAASC,MAAM,QAAQ,oBAAmB;AAC1C,SAASC,OAAO,QAAQ,qBAAoB;AAC5C,SAASC,kBAAkB,QAAQ,wBAAuB;AAC1D,SAASC,cAAc,QAAQ,wCAAuC;AACtE,SAASC,gBAAgB,QAAQ,mCAAkC;AACnE,SAASC,aAAa,QAAQ,wCAAuC;AACrE,SAASC,cAAc,QAAQ,wCAAuC;AACtE,SAASC,qBAAqB,QAAQ,wCAAuC;AAC7E,SAASC,OAAO,QAAQ,iCAAgC;AACxD,SACEC,aAAa,QAGR,gCAA+B;AACtC,SAAiCC,YAAY,QAAQ,uBAAsB;AAC3E,SAASC,eAAe,QAAQ,kCAAiC;AACjE,SACEC,6BAA6B,EAE7BC,qBAAqB,QAChB,uCAAsC;AAC7C,SAAkCC,cAAc,QAAQ,iCAAgC;AACxF,SAASC,eAAe,QAAQ,2CAA0C"}
1
+ {"version":3,"sources":["../../src/exports/server.ts"],"sourcesContent":["export { handleServerFunctions } from '../adapters/handleServerFunctions.js'\nexport { type AdminPageMetadata, getAdminMeta } from '../adapters/metadata.js'\nexport {\n createPageRenderServerAdapter,\n type PageNavIntent,\n tanstackServerAdapter,\n} from '../adapters/server.js'\nexport {\n loadAdminPage,\n type LoadAdminPageArgs,\n type LoadAdminPageResult,\n} from '../adapters/views/server.js'\nexport { login } from '../auth/login.js'\nexport { logout } from '../auth/logout.js'\nexport { refresh } from '../auth/refresh.js'\nexport { handleGraphQL } from '../routes/graphql/handler.server.js'\nexport { handleAPIRoute } from '../routes/rest/handler.server.js'\nexport { payloadApiHandlers } from '../routes/rest/index.js'\nexport { getRequestI18n } from '../utilities/getRequestI18n.server.js'\nexport { serializeForRsc } from '../utilities/serializeForRsc.js'\nexport { type SerializableRecord, toSerializable } from '../utilities/toSerializable.js'\nexport { getRequestTheme } from '@payloadcms/ui/utilities/getRequestTheme'\n"],"names":["handleServerFunctions","getAdminMeta","createPageRenderServerAdapter","tanstackServerAdapter","loadAdminPage","login","logout","refresh","handleGraphQL","handleAPIRoute","payloadApiHandlers","getRequestI18n","serializeForRsc","toSerializable","getRequestTheme"],"mappings":"AAAA,SAASA,qBAAqB,QAAQ,uCAAsC;AAC5E,SAAiCC,YAAY,QAAQ,0BAAyB;AAC9E,SACEC,6BAA6B,EAE7BC,qBAAqB,QAChB,wBAAuB;AAC9B,SACEC,aAAa,QAGR,8BAA6B;AACpC,SAASC,KAAK,QAAQ,mBAAkB;AACxC,SAASC,MAAM,QAAQ,oBAAmB;AAC1C,SAASC,OAAO,QAAQ,qBAAoB;AAC5C,SAASC,aAAa,QAAQ,sCAAqC;AACnE,SAASC,cAAc,QAAQ,mCAAkC;AACjE,SAASC,kBAAkB,QAAQ,0BAAyB;AAC5D,SAASC,cAAc,QAAQ,wCAAuC;AACtE,SAASC,eAAe,QAAQ,kCAAiC;AACjE,SAAkCC,cAAc,QAAQ,iCAAgC;AACxF,SAASC,eAAe,QAAQ,2CAA0C"}
@@ -2,11 +2,9 @@ import type { SanitizedConfig } from 'payload';
2
2
  /**
3
3
  * Handles GraphQL HTTP requests for TanStack Start apps.
4
4
  * Mirrors the behaviour of `@payloadcms/next`'s GraphQL route handler.
5
- *
6
- * Requires `@payloadcms/graphql` and `graphql-http` to be installed in the consuming app.
7
5
  */
8
6
  export declare const handleGraphQL: ({ config, request, }: {
9
7
  config: Promise<SanitizedConfig> | SanitizedConfig;
10
8
  request: Request;
11
9
  }) => Promise<Response>;
12
- //# sourceMappingURL=graphqlHandler.server.d.ts.map
10
+ //# sourceMappingURL=handler.server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handler.server.d.ts","sourceRoot":"","sources":["../../../src/routes/graphql/handler.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA2B,eAAe,EAAE,MAAM,SAAS,CAAA;AAyFvE;;;GAGG;AACH,eAAO,MAAM,aAAa,yBAGvB;IACD,MAAM,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,eAAe,CAAA;IAClD,OAAO,EAAE,OAAO,CAAA;CACjB,KAAG,OAAO,CAAC,QAAQ,CAiEnB,CAAA"}
@@ -1,4 +1,4 @@
1
- import { addDataAndFileToRequest, addLocalesToRequestFromData, createPayloadRequest, headersWithCors, logError, mergeHeaders } from 'payload';
1
+ import { addDataAndFileToRequest, addLocalesToRequestFromData, createPayloadRequestFromWebRequest, headersWithCors, logError, mergeHeaders } from 'payload';
2
2
  const handleError = async ({ err, payload, req })=>{
3
3
  const status = err.originalError?.status || 500;
4
4
  let errorMessage = err.message;
@@ -68,19 +68,22 @@ const getGraphql = async (config)=>{
68
68
  /**
69
69
  * Handles GraphQL HTTP requests for TanStack Start apps.
70
70
  * Mirrors the behaviour of `@payloadcms/next`'s GraphQL route handler.
71
- *
72
- * Requires `@payloadcms/graphql` and `graphql-http` to be installed in the consuming app.
73
71
  */ export const handleGraphQL = async ({ config, request })=>{
74
72
  const originalRequest = request.clone();
75
- const req = await createPayloadRequest({
73
+ const req = await createPayloadRequestFromWebRequest({
76
74
  canSetHeaders: true,
77
75
  config,
78
76
  request
79
77
  });
78
+ const { payload } = req;
79
+ if (payload.config.graphQL?.disable) {
80
+ return new Response(null, {
81
+ status: 404
82
+ });
83
+ }
80
84
  await addDataAndFileToRequest(req);
81
85
  addLocalesToRequestFromData(req);
82
86
  const { schema, validationRules } = await getGraphql(config);
83
- const { payload } = req;
84
87
  const graphqlHttpHandlerPath = 'graphql-http/lib/use/fetch';
85
88
  const { createHandler } = await import(/* @vite-ignore */ graphqlHttpHandlerPath);
86
89
  const headers = {};
@@ -126,4 +129,4 @@ const getGraphql = async (config)=>{
126
129
  });
127
130
  };
128
131
 
129
- //# sourceMappingURL=graphqlHandler.server.js.map
132
+ //# sourceMappingURL=handler.server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/routes/graphql/handler.server.ts"],"sourcesContent":["import type { Payload, PayloadRequest, SanitizedConfig } from 'payload'\n\nimport {\n addDataAndFileToRequest,\n addLocalesToRequestFromData,\n createPayloadRequestFromWebRequest,\n headersWithCors,\n logError,\n mergeHeaders,\n} from 'payload'\n\nconst handleError = async ({\n err,\n payload,\n req,\n}: {\n err: any\n payload: Payload\n req: PayloadRequest\n}): Promise<any> => {\n const status = err.originalError?.status || 500\n let errorMessage = err.message\n logError({ err, payload })\n\n if (!payload.config.debug && status === 500) {\n errorMessage = 'Something went wrong.'\n }\n\n let response: any = {\n extensions: {\n name: err?.originalError?.name || undefined,\n data: (err && err.originalError && err.originalError.data) || undefined,\n stack: payload.config.debug ? err.stack : undefined,\n statusCode: status,\n },\n locations: err.locations,\n message: errorMessage,\n path: err.path,\n }\n\n await payload.config.hooks.afterError?.reduce(async (promise, hook) => {\n await promise\n\n const result = await hook({\n context: req.context,\n error: err,\n graphqlResult: response,\n req,\n })\n\n if (result) {\n response = result.graphqlResult || response\n }\n }, Promise.resolve())\n\n return response\n}\n\nlet cached: { graphql: any; promise: null | Promise<any> } = { graphql: null, promise: null }\n\nconst getGraphql = async (config: Promise<SanitizedConfig> | SanitizedConfig) => {\n if (process.env.NODE_ENV === 'development') {\n cached = { graphql: null, promise: null }\n }\n\n if (cached.graphql) {\n return cached.graphql\n }\n\n if (!cached.promise) {\n const resolvedConfig = await config\n const graphqlPackage = '@payloadcms/graphql'\n const { configToSchema } = await import(/* @vite-ignore */ graphqlPackage)\n cached.promise = new Promise((resolve) => {\n const schema = configToSchema(resolvedConfig)\n resolve(cached.graphql || schema)\n })\n }\n\n try {\n cached.graphql = await cached.promise\n } catch (e) {\n cached.promise = null\n throw e\n }\n\n return cached.graphql\n}\n\n/**\n * Handles GraphQL HTTP requests for TanStack Start apps.\n * Mirrors the behaviour of `@payloadcms/next`'s GraphQL route handler.\n */\nexport const handleGraphQL = async ({\n config,\n request,\n}: {\n config: Promise<SanitizedConfig> | SanitizedConfig\n request: Request\n}): Promise<Response> => {\n const originalRequest = request.clone()\n\n const req = await createPayloadRequestFromWebRequest({\n canSetHeaders: true,\n config,\n request,\n })\n\n const { payload } = req\n\n if (payload.config.graphQL?.disable) {\n return new Response(null, {\n status: 404,\n })\n }\n\n await addDataAndFileToRequest(req)\n addLocalesToRequestFromData(req)\n\n const { schema, validationRules } = await getGraphql(config)\n\n const graphqlHttpHandlerPath = 'graphql-http/lib/use/fetch'\n const { createHandler } = await import(/* @vite-ignore */ graphqlHttpHandlerPath)\n\n const headers: Record<string, string> = {}\n const apiResponse = await createHandler({\n context: { headers, req },\n onOperation: async (_request: any, args: any, result: any) => {\n const response =\n typeof payload.extensions === 'function'\n ? await payload.extensions({\n args,\n req: _request,\n result,\n })\n : result\n if (response.errors) {\n const errors = await Promise.all(\n response.errors.map((error: any) => {\n return handleError({ err: error, payload, req })\n }),\n )\n return { ...response, errors }\n }\n return response\n },\n schema,\n validationRules: (_: any, args: any, defaultRules: any) =>\n defaultRules.concat(validationRules(args)),\n })(originalRequest)\n\n const resHeaders = headersWithCors({\n headers: new Headers(apiResponse.headers),\n req,\n })\n\n for (const key of Object.keys(headers)) {\n resHeaders.append(key, headers[key]!)\n }\n\n return new Response(apiResponse.body, {\n headers: req.responseHeaders ? mergeHeaders(req.responseHeaders, resHeaders) : resHeaders,\n status: apiResponse.status,\n })\n}\n"],"names":["addDataAndFileToRequest","addLocalesToRequestFromData","createPayloadRequestFromWebRequest","headersWithCors","logError","mergeHeaders","handleError","err","payload","req","status","originalError","errorMessage","message","config","debug","response","extensions","name","undefined","data","stack","statusCode","locations","path","hooks","afterError","reduce","promise","hook","result","context","error","graphqlResult","Promise","resolve","cached","graphql","getGraphql","process","env","NODE_ENV","resolvedConfig","graphqlPackage","configToSchema","schema","e","handleGraphQL","request","originalRequest","clone","canSetHeaders","graphQL","disable","Response","validationRules","graphqlHttpHandlerPath","createHandler","headers","apiResponse","onOperation","_request","args","errors","all","map","_","defaultRules","concat","resHeaders","Headers","key","Object","keys","append","body","responseHeaders"],"mappings":"AAEA,SACEA,uBAAuB,EACvBC,2BAA2B,EAC3BC,kCAAkC,EAClCC,eAAe,EACfC,QAAQ,EACRC,YAAY,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,GAAG,CAC9BhD,SAAS+C,MAAM,CAACE,GAAG,CAAC,CAACjC;oBACnB,OAAO1B,YAAY;wBAAEC,KAAKyB;wBAAOxB;wBAASC;oBAAI;gBAChD;gBAEF,OAAO;oBAAE,GAAGO,QAAQ;oBAAE+C;gBAAO;YAC/B;YACA,OAAO/C;QACT;QACA6B;QACAU,iBAAiB,CAACW,GAAQJ,MAAWK,eACnCA,aAAaC,MAAM,CAACb,gBAAgBO;IACxC,GAAGb;IAEH,MAAMoB,aAAalE,gBAAgB;QACjCuD,SAAS,IAAIY,QAAQX,YAAYD,OAAO;QACxCjD;IACF;IAEA,KAAK,MAAM8D,OAAOC,OAAOC,IAAI,CAACf,SAAU;QACtCW,WAAWK,MAAM,CAACH,KAAKb,OAAO,CAACa,IAAI;IACrC;IAEA,OAAO,IAAIjB,SAASK,YAAYgB,IAAI,EAAE;QACpCjB,SAASjD,IAAImE,eAAe,GAAGvE,aAAaI,IAAImE,eAAe,EAAEP,cAAcA;QAC/E3D,QAAQiD,YAAYjD,MAAM;IAC5B;AACF,EAAC"}
@@ -0,0 +1,10 @@
1
+ import type { SanitizedConfig } from 'payload';
2
+ /**
3
+ * Routes a TanStack Start API request to Payload's endpoint handler. The framework adapter
4
+ * wires this into the app's API route and supplies the resolved `config`.
5
+ */
6
+ export declare function handleAPIRoute({ config, request, }: {
7
+ config: SanitizedConfig;
8
+ request: Request;
9
+ }): Promise<Response>;
10
+ //# sourceMappingURL=handler.server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handler.server.d.ts","sourceRoot":"","sources":["../../../src/routes/rest/handler.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAI9C;;;GAGG;AACH,wBAAsB,cAAc,CAAC,EACnC,MAAM,EACN,OAAO,GACR,EAAE;IACD,MAAM,EAAE,eAAe,CAAA;IACvB,OAAO,EAAE,OAAO,CAAA;CACjB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAMpB"}
@@ -0,0 +1,13 @@
1
+ import { handleEndpoints } from 'payload';
2
+ /**
3
+ * Routes a TanStack Start API request to Payload's endpoint handler. The framework adapter
4
+ * wires this into the app's API route and supplies the resolved `config`.
5
+ */ export async function handleAPIRoute({ config, request }) {
6
+ return handleEndpoints({
7
+ config,
8
+ path: new URL(request.url).pathname,
9
+ request
10
+ });
11
+ }
12
+
13
+ //# sourceMappingURL=handler.server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/routes/rest/handler.server.ts"],"sourcesContent":["import type { SanitizedConfig } from 'payload'\n\nimport { handleEndpoints } from 'payload'\n\n/**\n * Routes a TanStack Start API request to Payload's endpoint handler. The framework adapter\n * wires this into the app's API route and supplies the resolved `config`.\n */\nexport async function handleAPIRoute({\n config,\n request,\n}: {\n config: SanitizedConfig\n request: Request\n}): Promise<Response> {\n return handleEndpoints({\n config,\n path: new URL(request.url).pathname,\n request,\n })\n}\n"],"names":["handleEndpoints","handleAPIRoute","config","request","path","URL","url","pathname"],"mappings":"AAEA,SAASA,eAAe,QAAQ,UAAS;AAEzC;;;CAGC,GACD,OAAO,eAAeC,eAAe,EACnCC,MAAM,EACNC,OAAO,EAIR;IACC,OAAOH,gBAAgB;QACrBE;QACAE,MAAM,IAAIC,IAAIF,QAAQG,GAAG,EAAEC,QAAQ;QACnCJ;IACF;AACF"}
@@ -31,4 +31,4 @@ export declare function payloadApiHandlers({ getConfig, }: {
31
31
  getConfig: () => Promise<SanitizedConfig>;
32
32
  }): Record<'DELETE' | 'GET' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT', ApiRouteHandler>;
33
33
  export {};
34
- //# sourceMappingURL=apiRoute.d.ts.map
34
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/routes/rest/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,KAAK,eAAe,GAAG,CAAC,GAAG,EAAE;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,GACV,EAAE;IACD,SAAS,EAAE,MAAM,OAAO,CAAC,eAAe,CAAC,CAAA;CAC1C,GAAG,MAAM,CAAC,QAAQ,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,EAAE,eAAe,CAAC,CAcnF"}
@@ -24,7 +24,7 @@
24
24
  * key, leaking the config graph into the client bundle.
25
25
  */ export function payloadApiHandlers({ getConfig }) {
26
26
  const handler = async ({ request })=>{
27
- const { handleAPIRoute } = await import('../utilities/handleAPIRoute.server.js');
27
+ const { handleAPIRoute } = await import('./handler.server.js');
28
28
  return handleAPIRoute({
29
29
  config: await getConfig(),
30
30
  request
@@ -40,4 +40,4 @@
40
40
  };
41
41
  }
42
42
 
43
- //# sourceMappingURL=apiRoute.js.map
43
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/routes/rest/index.ts"],"sourcesContent":["import type { SanitizedConfig } from 'payload'\n\ntype ApiRouteHandler = (ctx: { request: Request }) => Promise<Response>\n\n/**\n * Builds the method handlers for the Payload REST/GraphQL catch-all\n * (`/_payload/api/$`). The app supplies `getConfig` (an `@payload-config`\n * import) since the package cannot resolve the consumer's config.\n *\n * Imported from `@payloadcms/tanstack-start/server` (not the root barrel) so\n * the server-only `handleAPIRoute` graph never reaches the client bundle.\n *\n * Spread the result into a literal `server.handlers` key so TanStack Start's\n * client compiler can statically see — and prune — the server-only route:\n *\n * ```ts\n * import { payloadApiHandlers } from '@payloadcms/tanstack-start/server'\n *\n * export const Route = createFileRoute('/_payload/api/$')({\n * server: {\n * handlers: payloadApiHandlers({ getConfig: async () => (await import('@payload-config')).default }),\n * },\n * })\n * ```\n *\n * The compiler only strips a literal `server:` key from a route-options object\n * expression; wrapping the whole options object in a factory call hides the\n * key, leaking the config graph into the client bundle.\n */\nexport function payloadApiHandlers({\n getConfig,\n}: {\n getConfig: () => Promise<SanitizedConfig>\n}): Record<'DELETE' | 'GET' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT', ApiRouteHandler> {\n const handler: ApiRouteHandler = async ({ request }) => {\n const { handleAPIRoute } = await import('./handler.server.js')\n return handleAPIRoute({ config: await getConfig(), request })\n }\n\n return {\n DELETE: handler,\n GET: handler,\n OPTIONS: handler,\n PATCH: handler,\n POST: handler,\n PUT: handler,\n }\n}\n"],"names":["payloadApiHandlers","getConfig","handler","request","handleAPIRoute","config","DELETE","GET","OPTIONS","PATCH","POST","PUT"],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;CAwBC,GACD,OAAO,SAASA,mBAAmB,EACjCC,SAAS,EAGV;IACC,MAAMC,UAA2B,OAAO,EAAEC,OAAO,EAAE;QACjD,MAAM,EAAEC,cAAc,EAAE,GAAG,MAAM,MAAM,CAAC;QACxC,OAAOA,eAAe;YAAEC,QAAQ,MAAMJ;YAAaE;QAAQ;IAC7D;IAEA,OAAO;QACLG,QAAQJ;QACRK,KAAKL;QACLM,SAASN;QACTO,OAAOP;QACPQ,MAAMR;QACNS,KAAKT;IACP;AACF"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { CollectionCardsClient } from '@payloadcms/ui';
2
3
  import { getCollectionCardsData } from '@payloadcms/ui/server';
3
- import { CollectionCardsClient } from '@payloadcms/ui/widgets/CollectionCards/index.client';
4
4
  import React from 'react';
5
5
  export async function CollectionCards(props) {
6
6
  const data = await getCollectionCardsData(props.req);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/rsc/CollectionCards.tsx"],"sourcesContent":["import type { WidgetServerProps } from 'payload'\n\nimport { getCollectionCardsData } from '@payloadcms/ui/server'\nimport { CollectionCardsClient } from '@payloadcms/ui/widgets/CollectionCards/index.client'\nimport React from 'react'\n\nexport async function CollectionCards(props: WidgetServerProps) {\n const data = await getCollectionCardsData(props.req)\n\n return <CollectionCardsClient {...data} />\n}\n"],"names":["getCollectionCardsData","CollectionCardsClient","React","CollectionCards","props","data","req"],"mappings":";AAEA,SAASA,sBAAsB,QAAQ,wBAAuB;AAC9D,SAASC,qBAAqB,QAAQ,sDAAqD;AAC3F,OAAOC,WAAW,QAAO;AAEzB,OAAO,eAAeC,gBAAgBC,KAAwB;IAC5D,MAAMC,OAAO,MAAML,uBAAuBI,MAAME,GAAG;IAEnD,qBAAO,KAACL;QAAuB,GAAGI,IAAI;;AACxC"}
1
+ {"version":3,"sources":["../../src/rsc/CollectionCards.tsx"],"sourcesContent":["import type { WidgetServerProps } from 'payload'\n\nimport { CollectionCardsClient } from '@payloadcms/ui'\nimport { getCollectionCardsData } from '@payloadcms/ui/server'\nimport React from 'react'\n\nexport async function CollectionCards(props: WidgetServerProps) {\n const data = await getCollectionCardsData(props.req)\n\n return <CollectionCardsClient {...data} />\n}\n"],"names":["CollectionCardsClient","getCollectionCardsData","React","CollectionCards","props","data","req"],"mappings":";AAEA,SAASA,qBAAqB,QAAQ,iBAAgB;AACtD,SAASC,sBAAsB,QAAQ,wBAAuB;AAC9D,OAAOC,WAAW,QAAO;AAEzB,OAAO,eAAeC,gBAAgBC,KAAwB;IAC5D,MAAMC,OAAO,MAAMJ,uBAAuBG,MAAME,GAAG;IAEnD,qBAAO,KAACN;QAAuB,GAAGK,IAAI;;AACxC"}
@@ -4,7 +4,7 @@ import { PAYLOAD_CONFIG_CHANGED_EVENT } from './devConfigReloadEvent.js';
4
4
  * Subscribes the Payload instance to the config-changed event that the
5
5
  * `payload:dev-config-reload` Vite plugin broadcasts.
6
6
  *
7
- * Imported for its side effect by `initReq.server.ts`, the adapter's only
7
+ * Imported for its side effect by `initAdminContext.server.ts`, the adapter's only
8
8
  * `getPayload` call site, so the strategy is registered before an instance can
9
9
  * be built. Registration is module-scoped on both ends: this runs inside the
10
10
  * app's server graph and so resolves the same copy of `payload` that
@@ -19,20 +19,45 @@ import { PAYLOAD_CONFIG_CHANGED_EVENT } from './devConfigReloadEvent.js';
19
19
  * production build.
20
20
  */ const hot = import.meta.hot;
21
21
  if (hot) {
22
+ registerDevReloadStrategy(createConfigChangedStrategy({
23
+ hot
24
+ }));
25
+ }
26
+ /**
27
+ * Builds a dev reload strategy that forwards the config-changed event to every
28
+ * connected instance.
29
+ *
30
+ * After a program reload, the first request to re-import this module replaces
31
+ * the old listener with a new one, but the cached Payload instance only connects
32
+ * to it on its next `getPayload` call - and a request such as a frontend page
33
+ * render may never make one. An event that lands in that gap has no one to
34
+ * notify, so it is held and replayed to the next connection instead of being
35
+ * dropped - which would otherwise leave the instance serving the old config
36
+ * indefinitely.
37
+ */ function createConfigChangedStrategy({ hot }) {
22
38
  const listeners = new Set();
39
+ let hasPendingReload = false;
23
40
  hot.on(PAYLOAD_CONFIG_CHANGED_EVENT, ()=>{
41
+ if (listeners.size === 0) {
42
+ hasPendingReload = true;
43
+ return;
44
+ }
24
45
  for (const onReload of listeners){
25
46
  onReload();
26
47
  }
27
48
  });
28
- registerDevReloadStrategy({
49
+ return {
29
50
  connect: (onReload)=>{
30
51
  listeners.add(onReload);
52
+ if (hasPendingReload) {
53
+ hasPendingReload = false;
54
+ onReload();
55
+ }
31
56
  return ()=>{
32
57
  listeners.delete(onReload);
33
58
  };
34
59
  }
35
- });
60
+ };
36
61
  }
37
62
 
38
63
  //# sourceMappingURL=devConfigReload.server.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utilities/devConfigReload.server.ts"],"sourcesContent":["import { registerDevReloadStrategy } from 'payload'\n\nimport { PAYLOAD_CONFIG_CHANGED_EVENT } from './devConfigReloadEvent.js'\n\n/**\n * Subscribes the Payload instance to the config-changed event that the\n * `payload:dev-config-reload` Vite plugin broadcasts.\n *\n * Imported for its side effect by `initReq.server.ts`, the adapter's only\n * `getPayload` call site, so the strategy is registered before an instance can\n * be built. Registration is module-scoped on both ends: this runs inside the\n * app's server graph and so resolves the same copy of `payload` that\n * `getPayload` is called on, and each Vite environment (`ssr`, `rsc`) registers\n * its own listener against its own copy.\n *\n * Vite re-evaluates this module on a program reload, which drops the listeners\n * the previous instance had collected. `getPayload` reconnects on its next call\n * because the registered strategy is a new object - see `connectDevReload`.\n *\n * `import.meta.hot` is only defined during dev serve, so this is inert in a\n * production build.\n */\nconst hot = (import.meta as unknown as { hot?: ViteHotContext }).hot\n\nif (hot) {\n const listeners = new Set<() => void>()\n\n hot.on(PAYLOAD_CONFIG_CHANGED_EVENT, () => {\n for (const onReload of listeners) {\n onReload()\n }\n })\n\n registerDevReloadStrategy({\n connect: (onReload) => {\n listeners.add(onReload)\n\n return () => {\n listeners.delete(onReload)\n }\n },\n })\n}\n\ntype ViteHotContext = {\n on: (event: string, cb: () => void) => void\n}\n"],"names":["registerDevReloadStrategy","PAYLOAD_CONFIG_CHANGED_EVENT","hot","listeners","Set","on","onReload","connect","add","delete"],"mappings":"AAAA,SAASA,yBAAyB,QAAQ,UAAS;AAEnD,SAASC,4BAA4B,QAAQ,4BAA2B;AAExE;;;;;;;;;;;;;;;;;CAiBC,GACD,MAAMC,MAAM,AAAC,YAAoDA,GAAG;AAEpE,IAAIA,KAAK;IACP,MAAMC,YAAY,IAAIC;IAEtBF,IAAIG,EAAE,CAACJ,8BAA8B;QACnC,KAAK,MAAMK,YAAYH,UAAW;YAChCG;QACF;IACF;IAEAN,0BAA0B;QACxBO,SAAS,CAACD;YACRH,UAAUK,GAAG,CAACF;YAEd,OAAO;gBACLH,UAAUM,MAAM,CAACH;YACnB;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["../../src/utilities/devConfigReload.server.ts"],"sourcesContent":["import { registerDevReloadStrategy } from 'payload'\n\nimport { PAYLOAD_CONFIG_CHANGED_EVENT } from './devConfigReloadEvent.js'\n\n/**\n * Subscribes the Payload instance to the config-changed event that the\n * `payload:dev-config-reload` Vite plugin broadcasts.\n *\n * Imported for its side effect by `initAdminContext.server.ts`, the adapter's only\n * `getPayload` call site, so the strategy is registered before an instance can\n * be built. Registration is module-scoped on both ends: this runs inside the\n * app's server graph and so resolves the same copy of `payload` that\n * `getPayload` is called on, and each Vite environment (`ssr`, `rsc`) registers\n * its own listener against its own copy.\n *\n * Vite re-evaluates this module on a program reload, which drops the listeners\n * the previous instance had collected. `getPayload` reconnects on its next call\n * because the registered strategy is a new object - see `connectDevReload`.\n *\n * `import.meta.hot` is only defined during dev serve, so this is inert in a\n * production build.\n */\nconst hot = (import.meta as unknown as { hot?: ViteHotContext }).hot\n\nif (hot) {\n registerDevReloadStrategy(createConfigChangedStrategy({ hot }))\n}\n\n/**\n * Builds a dev reload strategy that forwards the config-changed event to every\n * connected instance.\n *\n * After a program reload, the first request to re-import this module replaces\n * the old listener with a new one, but the cached Payload instance only connects\n * to it on its next `getPayload` call - and a request such as a frontend page\n * render may never make one. An event that lands in that gap has no one to\n * notify, so it is held and replayed to the next connection instead of being\n * dropped - which would otherwise leave the instance serving the old config\n * indefinitely.\n */\nfunction createConfigChangedStrategy({ hot }: { hot: ViteHotContext }): {\n connect: (onReload: () => void) => () => void\n} {\n const listeners = new Set<() => void>()\n let hasPendingReload = false\n\n hot.on(PAYLOAD_CONFIG_CHANGED_EVENT, () => {\n if (listeners.size === 0) {\n hasPendingReload = true\n return\n }\n\n for (const onReload of listeners) {\n onReload()\n }\n })\n\n return {\n connect: (onReload) => {\n listeners.add(onReload)\n\n if (hasPendingReload) {\n hasPendingReload = false\n onReload()\n }\n\n return () => {\n listeners.delete(onReload)\n }\n },\n }\n}\n\ntype ViteHotContext = {\n on: (event: string, cb: () => void) => void\n}\n"],"names":["registerDevReloadStrategy","PAYLOAD_CONFIG_CHANGED_EVENT","hot","createConfigChangedStrategy","listeners","Set","hasPendingReload","on","size","onReload","connect","add","delete"],"mappings":"AAAA,SAASA,yBAAyB,QAAQ,UAAS;AAEnD,SAASC,4BAA4B,QAAQ,4BAA2B;AAExE;;;;;;;;;;;;;;;;;CAiBC,GACD,MAAMC,MAAM,AAAC,YAAoDA,GAAG;AAEpE,IAAIA,KAAK;IACPF,0BAA0BG,4BAA4B;QAAED;IAAI;AAC9D;AAEA;;;;;;;;;;;CAWC,GACD,SAASC,4BAA4B,EAAED,GAAG,EAA2B;IAGnE,MAAME,YAAY,IAAIC;IACtB,IAAIC,mBAAmB;IAEvBJ,IAAIK,EAAE,CAACN,8BAA8B;QACnC,IAAIG,UAAUI,IAAI,KAAK,GAAG;YACxBF,mBAAmB;YACnB;QACF;QAEA,KAAK,MAAMG,YAAYL,UAAW;YAChCK;QACF;IACF;IAEA,OAAO;QACLC,SAAS,CAACD;YACRL,UAAUO,GAAG,CAACF;YAEd,IAAIH,kBAAkB;gBACpBA,mBAAmB;gBACnBG;YACF;YAEA,OAAO;gBACLL,UAAUQ,MAAM,CAACH;YACnB;QACF;IACF;AACF"}
@@ -2,7 +2,7 @@ import type { I18nClient } from '@payloadcms/translations';
2
2
  import type { SanitizedConfig } from 'payload';
3
3
  /**
4
4
  * Resolves the client `I18n` for the current TanStack Start request without a
5
- * full `initReq` (no `getPayload`/auth/access). Mirrors the Next.js adapter's
5
+ * full `initAdminContext` (no `getPayload`/auth/access). Mirrors the Next.js adapter's
6
6
  * `getNextRequestI18n` and feeds the shared `generatePageMetadata`, which only
7
7
  * needs `config` + `i18n` to translate admin-page titles.
8
8
  */
@@ -3,7 +3,7 @@ import { getRequest } from '@tanstack/react-start/server';
3
3
  import { getRequestLanguage, parseCookies } from 'payload';
4
4
  /**
5
5
  * Resolves the client `I18n` for the current TanStack Start request without a
6
- * full `initReq` (no `getPayload`/auth/access). Mirrors the Next.js adapter's
6
+ * full `initAdminContext` (no `getPayload`/auth/access). Mirrors the Next.js adapter's
7
7
  * `getNextRequestI18n` and feeds the shared `generatePageMetadata`, which only
8
8
  * needs `config` + `i18n` to translate admin-page titles.
9
9
  */ export async function getRequestI18n({ config }) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utilities/getRequestI18n.server.ts"],"sourcesContent":["import type { I18nClient } from '@payloadcms/translations'\nimport type { SanitizedConfig } from 'payload'\n\nimport { initI18n } from '@payloadcms/translations'\nimport { getRequest } from '@tanstack/react-start/server'\nimport { getRequestLanguage, parseCookies } from 'payload'\n\n/**\n * Resolves the client `I18n` for the current TanStack Start request without a\n * full `initReq` (no `getPayload`/auth/access). Mirrors the Next.js adapter's\n * `getNextRequestI18n` and feeds the shared `generatePageMetadata`, which only\n * needs `config` + `i18n` to translate admin-page titles.\n */\nexport async function getRequestI18n({ config }: { config: SanitizedConfig }): Promise<I18nClient> {\n const webRequest = getRequest()\n const headers = new Headers(webRequest.headers)\n const cookies = parseCookies(headers)\n\n const languageCode = getRequestLanguage({ config, cookies, headers })\n\n return initI18n({\n config: config.i18n,\n context: 'client',\n language: languageCode,\n })\n}\n"],"names":["initI18n","getRequest","getRequestLanguage","parseCookies","getRequestI18n","config","webRequest","headers","Headers","cookies","languageCode","i18n","context","language"],"mappings":"AAGA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,UAAU,QAAQ,+BAA8B;AACzD,SAASC,kBAAkB,EAAEC,YAAY,QAAQ,UAAS;AAE1D;;;;;CAKC,GACD,OAAO,eAAeC,eAAe,EAAEC,MAAM,EAA+B;IAC1E,MAAMC,aAAaL;IACnB,MAAMM,UAAU,IAAIC,QAAQF,WAAWC,OAAO;IAC9C,MAAME,UAAUN,aAAaI;IAE7B,MAAMG,eAAeR,mBAAmB;QAAEG;QAAQI;QAASF;IAAQ;IAEnE,OAAOP,SAAS;QACdK,QAAQA,OAAOM,IAAI;QACnBC,SAAS;QACTC,UAAUH;IACZ;AACF"}
1
+ {"version":3,"sources":["../../src/utilities/getRequestI18n.server.ts"],"sourcesContent":["import type { I18nClient } from '@payloadcms/translations'\nimport type { SanitizedConfig } from 'payload'\n\nimport { initI18n } from '@payloadcms/translations'\nimport { getRequest } from '@tanstack/react-start/server'\nimport { getRequestLanguage, parseCookies } from 'payload'\n\n/**\n * Resolves the client `I18n` for the current TanStack Start request without a\n * full `initAdminContext` (no `getPayload`/auth/access). Mirrors the Next.js adapter's\n * `getNextRequestI18n` and feeds the shared `generatePageMetadata`, which only\n * needs `config` + `i18n` to translate admin-page titles.\n */\nexport async function getRequestI18n({ config }: { config: SanitizedConfig }): Promise<I18nClient> {\n const webRequest = getRequest()\n const headers = new Headers(webRequest.headers)\n const cookies = parseCookies(headers)\n\n const languageCode = getRequestLanguage({ config, cookies, headers })\n\n return initI18n({\n config: config.i18n,\n context: 'client',\n language: languageCode,\n })\n}\n"],"names":["initI18n","getRequest","getRequestLanguage","parseCookies","getRequestI18n","config","webRequest","headers","Headers","cookies","languageCode","i18n","context","language"],"mappings":"AAGA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,UAAU,QAAQ,+BAA8B;AACzD,SAASC,kBAAkB,EAAEC,YAAY,QAAQ,UAAS;AAE1D;;;;;CAKC,GACD,OAAO,eAAeC,eAAe,EAAEC,MAAM,EAA+B;IAC1E,MAAMC,aAAaL;IACnB,MAAMM,UAAU,IAAIC,QAAQF,WAAWC,OAAO;IAC9C,MAAME,UAAUN,aAAaI;IAE7B,MAAMG,eAAeR,mBAAmB;QAAEG;QAAQI;QAASF;IAAQ;IAEnE,OAAOP,SAAS;QACdK,QAAQA,OAAOM,IAAI;QACnBC,SAAS;QACTC,UAAUH;IACZ;AACF"}
@@ -0,0 +1,9 @@
1
+ import type { ServerAdapter } from 'payload';
2
+ import type { InitAdminContextArgs } from 'payload/internal';
3
+ import './devConfigReload.server.js';
4
+ type TanStackInitAdminContextArgs = {
5
+ serverAdapter?: ServerAdapter;
6
+ } & Omit<InitAdminContextArgs, 'cache' | 'requestURL' | 'serverAdapter'>;
7
+ export declare const initAdminContext: ({ serverAdapter, ...args }: TanStackInitAdminContextArgs) => Promise<import("payload").AdminContext>;
8
+ export {};
9
+ //# sourceMappingURL=initAdminContext.server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"initAdminContext.server.d.ts","sourceRoot":"","sources":["../../src/utilities/initAdminContext.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAC5C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAO5D,OAAO,6BAA6B,CAAA;AAGpC,KAAK,4BAA4B,GAAG;IAClC,aAAa,CAAC,EAAE,aAAa,CAAA;CAC9B,GAAG,IAAI,CAAC,oBAAoB,EAAE,OAAO,GAAG,YAAY,GAAG,eAAe,CAAC,CAAA;AAExE,eAAO,MAAM,gBAAgB,+BAG1B,4BAA4B,4CAK3B,CAAA"}
@@ -0,0 +1,13 @@
1
+ import { getRequest } from '@tanstack/react-start/server';
2
+ import { initAdminContext as initPayloadAdminContext } from 'payload/internal';
3
+ // Registers the dev reload strategy before `initPayloadAdminContext` can build an instance.
4
+ // Side-effect only, and a no-op outside of dev serve.
5
+ import './devConfigReload.server.js';
6
+ import { tanstackServerAdapter } from '../adapters/server.js';
7
+ export const initAdminContext = ({ serverAdapter = tanstackServerAdapter, ...args })=>initPayloadAdminContext({
8
+ ...args,
9
+ requestURL: getRequest().url,
10
+ serverAdapter
11
+ });
12
+
13
+ //# sourceMappingURL=initAdminContext.server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utilities/initAdminContext.server.ts"],"sourcesContent":["import type { ServerAdapter } from 'payload'\nimport type { InitAdminContextArgs } from 'payload/internal'\n\nimport { getRequest } from '@tanstack/react-start/server'\nimport { initAdminContext as initPayloadAdminContext } from 'payload/internal'\n\n// Registers the dev reload strategy before `initPayloadAdminContext` can build an instance.\n// Side-effect only, and a no-op outside of dev serve.\nimport './devConfigReload.server.js'\nimport { tanstackServerAdapter } from '../adapters/server.js'\n\ntype TanStackInitAdminContextArgs = {\n serverAdapter?: ServerAdapter\n} & Omit<InitAdminContextArgs, 'cache' | 'requestURL' | 'serverAdapter'>\n\nexport const initAdminContext = ({\n serverAdapter = tanstackServerAdapter,\n ...args\n}: TanStackInitAdminContextArgs) =>\n initPayloadAdminContext({\n ...args,\n requestURL: getRequest().url,\n serverAdapter,\n })\n"],"names":["getRequest","initAdminContext","initPayloadAdminContext","tanstackServerAdapter","serverAdapter","args","requestURL","url"],"mappings":"AAGA,SAASA,UAAU,QAAQ,+BAA8B;AACzD,SAASC,oBAAoBC,uBAAuB,QAAQ,mBAAkB;AAE9E,4FAA4F;AAC5F,sDAAsD;AACtD,OAAO,8BAA6B;AACpC,SAASC,qBAAqB,QAAQ,wBAAuB;AAM7D,OAAO,MAAMF,mBAAmB,CAAC,EAC/BG,gBAAgBD,qBAAqB,EACrC,GAAGE,MAC0B,GAC7BH,wBAAwB;QACtB,GAAGG,IAAI;QACPC,YAAYN,aAAaO,GAAG;QAC5BH;IACF,GAAE"}
@@ -1 +1 @@
1
- {"version":3,"file":"optimizeDeps.d.ts","sourceRoot":"","sources":["../../../src/withPayload/config/optimizeDeps.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,EAAE,MAAM,EAyB/C,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,2BAA2B,EAAE,MAAM,EA+E/C,CAAA"}
1
+ {"version":3,"file":"optimizeDeps.d.ts","sourceRoot":"","sources":["../../../src/withPayload/config/optimizeDeps.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,EAAE,MAAM,EA0D/C,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,2BAA2B,EAAE,MAAM,EA+E/C,CAAA"}
@@ -27,10 +27,43 @@
27
27
  '@azure/storage-blob',
28
28
  // Preserve RSC client boundaries on storage admin upload handlers.
29
29
  '@payloadcms/storage-azure',
30
+ '@payloadcms/storage-r2',
30
31
  '@payloadcms/storage-vercel-blob',
31
32
  '@aws-sdk/client-s3',
32
33
  '@aws-sdk/s3-request-presigner',
33
- '@google-cloud/storage'
34
+ '@google-cloud/storage',
35
+ // Packages whose admin component barrel re-exports `'use client'` modules
36
+ // without carrying the directive itself. Pre-bundling one puts those modules
37
+ // in the optimized dep chunk *and* in the `rsc` environment as client
38
+ // references, which `@vitejs/plugin-rsc` warns about ("client component
39
+ // dependency is inconsistently optimized") once per component. Barrels that
40
+ // start with `'use client'` (e.g. `richtext-lexical`, `plugin-stripe`) don't
41
+ // warn and stay pre-bundled. Only shows up in published installs; workspace
42
+ // source is never pre-bundled.
43
+ '@payloadcms/plugin-cloud-storage',
44
+ '@payloadcms/plugin-ecommerce',
45
+ '@payloadcms/plugin-form-builder',
46
+ '@payloadcms/plugin-import-export',
47
+ '@payloadcms/plugin-multi-tenant',
48
+ '@payloadcms/plugin-search',
49
+ '@payloadcms/plugin-sentry',
50
+ '@payloadcms/plugin-seo',
51
+ // Database adapters and their drivers. The client scan reaches them through the
52
+ // Payload config (it follows server functions' `import('@payload-config')`
53
+ // without TanStack's server-fn stripping), so Vite would pre-bundle the whole
54
+ // driver for a browser that never loads it. Mongoose 9 has no browser build, so
55
+ // that bundles `mongodb`, whose optional `@aws-sdk/credential-providers` peer —
56
+ // when linked, as in the monorepo via `@payloadcms/payload-cloud` — fails the
57
+ // same `MISSING_EXPORT` way. Published installs reach the adapter packages;
58
+ // the monorepo, which resolves them to source, reaches the drivers.
59
+ '@payloadcms/db-d1-sqlite',
60
+ '@payloadcms/db-mongodb',
61
+ '@payloadcms/db-postgres',
62
+ '@payloadcms/db-sqlite',
63
+ '@payloadcms/db-vercel-postgres',
64
+ '@payloadcms/drizzle',
65
+ 'mongodb',
66
+ 'mongoose'
34
67
  ];
35
68
  /**
36
69
  * Transitive dependencies of `@payloadcms/ui` and `payload` that need to be
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/withPayload/config/optimizeDeps.ts"],"sourcesContent":["/**\n * Client dep-optimizer config used by `withPayload`. Kept separate from the\n * SSR/RSC externalization config (`./external.ts`) so each concern stays small.\n */\n\n/**\n * Packages we know contain Node-only code or top-level side effects requiring\n * Node APIs. Excluding them from the client optimizer prevents Vite from\n * walking into their main entries and trying to bundle server-only imports\n * for the browser.\n */\nexport const optimizeDepsExcludeDefaults: string[] = [\n 'sharp',\n '@payloadcms/ui',\n '@payloadcms/tanstack-start',\n 'payload',\n 'pino',\n 'pino-pretty',\n 'busboy',\n 'get-tsconfig',\n 'ws',\n 'croner',\n 'prompts',\n 'file-type',\n // Server-only SDKs used by `@payloadcms/storage-*` adapters. Vite\n // sometimes walks these from the main package entry while scanning\n // workspace deps, and the browser sub-bundles do not expose the\n // server-only APIs (e.g. `BlobSASPermissions`), which crashes the dev\n // server with a `MISSING_EXPORT` error before any test runs.\n '@azure/storage-blob',\n // Preserve RSC client boundaries on storage admin upload handlers.\n '@payloadcms/storage-azure',\n '@payloadcms/storage-vercel-blob',\n '@aws-sdk/client-s3',\n '@aws-sdk/s3-request-presigner',\n '@google-cloud/storage',\n]\n\n/**\n * Transitive dependencies of `@payloadcms/ui` and `payload` that need to be\n * pre-bundled for the client. Vite's auto-discovery doesn't reliably pick\n * these up because their parent packages are in `optimizeDeps.exclude`, so we\n * list them explicitly using the `parent > child` syntax.\n *\n * Each entry below fixes a specific late-discovery re-optimization: without it,\n * Vite discovers the dep *after* its initial crawl, forcing a full dep\n * re-optimization mid-session that 404s in-flight `.vite/deps/*` chunks and\n * remounts the admin (dropping client state). This is why the list can't simply\n * be deleted — it is the \"complete first pass\" for the admin's dep graph.\n */\nexport const optimizeDepsIncludeDefaults: string[] = [\n '@payloadcms/ui > sonner',\n '@payloadcms/ui > @faceless-ui/modal',\n '@payloadcms/ui > @faceless-ui/window-info',\n '@payloadcms/ui > @faceless-ui/scroll-info',\n '@payloadcms/ui > @dnd-kit/core',\n '@payloadcms/ui > @dnd-kit/sortable',\n '@payloadcms/ui > @dnd-kit/utilities',\n '@payloadcms/ui > react-datepicker',\n '@payloadcms/ui > react-select',\n '@payloadcms/ui > react-select/creatable',\n '@payloadcms/ui > react-image-crop',\n '@payloadcms/ui > @monaco-editor/react',\n '@payloadcms/ui > date-fns',\n '@payloadcms/ui > date-fns/transpose',\n '@payloadcms/ui > @date-fns/tz/date/mini',\n '@payloadcms/ui > uuid',\n '@payloadcms/ui > use-context-selector',\n '@payloadcms/ui > bson-objectid',\n '@payloadcms/ui > dequal',\n '@payloadcms/ui > object-to-formdata',\n '@payloadcms/ui > md5',\n 'payload > deepmerge',\n 'payload > pluralize',\n // `scheduler` is a transitive dep of `react-dom`, not a direct dependency of\n // the app, so a bare `'scheduler'` specifier fails to resolve from an isolated\n // install (`test/node_modules` built with `pnpm i --ignore-workspace`), where\n // it isn't hoisted to the top level. Path it through `react-dom` so the\n // optimizer resolves the exact copy the runtime loads.\n 'react-dom > scheduler',\n // `@payloadcms/ui` (in `optimizeDeps.exclude`) ships compiled output that the\n // React Compiler rewrote to `import { c } from 'react/compiler-runtime'`.\n // Because its parent is excluded, the optimizer never crawls in to discover\n // this entry, so Vite serves `react/compiler-runtime` raw. That file is\n // CommonJS (`module.exports = require(...)`), so the named `c` export can't be\n // statically extracted and every client component throws \"does not provide an\n // export named 'c'\". Pre-bundling it lets esbuild synthesize the named export.\n 'react/compiler-runtime',\n // Transitive deps that Vite otherwise discovers *after* the initial crawl\n // (react-select pulls in @floating-ui at runtime; react-is is reached via\n // react-transition-group/prop-types; the default date-fns locale is loaded\n // through a dynamic `date-fns/locale/${key}` import). A late discovery forces\n // a full dep re-optimization mid-session, which 404s every in-flight\n // `.vite/deps/*` chunk (\"Pre-transform error: file does not exist in the\n // optimize deps directory\") and breaks the admin UI in CI cold starts.\n // Pre-bundling them keeps the first optimization pass complete.\n '@payloadcms/ui > react-select > @floating-ui/dom',\n '@payloadcms/ui > react-select > @floating-ui/dom > @floating-ui/core',\n '@payloadcms/ui > react-select > prop-types > react-is',\n '@payloadcms/ui > date-fns/locale/en-US',\n // Further late discoveries observed re-optimizing mid-run in CI cold starts\n // (see CI logs: \"✨ new dependencies optimized: @dnd-kit/modifiers / zod /\n // dequal/lite\"). The modular dashboard pulls in `@dnd-kit/modifiers` on first\n // render; form-state diffing reaches `dequal/lite` (a distinct entry point\n // from the already-listed `dequal`); client-side field validation reaches\n // `zod` *through `payload`* — it is `ssrExternal` server-side but still\n // bundled into the client, and must be pathed via `payload` so the optimizer\n // pre-bundles the exact copy the runtime loads.\n '@payloadcms/ui > @dnd-kit/modifiers',\n '@payloadcms/ui > dequal/lite',\n 'payload > zod',\n // The storage client-upload suites (esp. vercel-blob) crawl part of the\n // `payload` server runtime into the client bundle and discover these late,\n // triggering several \"optimized dependencies changed. reloading\" waves that\n // reload the page mid-test (the bulk-upload drawer's Create New button /\n // dropzone vanish and the direct-to-bucket PUT never fires). Pre-bundle the\n // whole observed set so the first pass is complete.\n 'payload > undici',\n 'payload > jose',\n 'payload > dataloader',\n 'payload > path-to-regexp',\n 'payload > console-table-printer',\n 'payload > ci-info',\n 'payload > image-dimensions',\n 'payload > ipaddr.js',\n 'payload > range-parser',\n 'payload > sanitize-filename',\n // `@azure/storage-blob` is excluded, so pre-bundle its CommonJS browser dependency explicitly.\n '@azure/storage-blob > events',\n]\n"],"names":["optimizeDepsExcludeDefaults","optimizeDepsIncludeDefaults"],"mappings":"AAAA;;;CAGC,GAED;;;;;CAKC,GACD,OAAO,MAAMA,8BAAwC;IACnD;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,kEAAkE;IAClE,mEAAmE;IACnE,gEAAgE;IAChE,sEAAsE;IACtE,6DAA6D;IAC7D;IACA,mEAAmE;IACnE;IACA;IACA;IACA;IACA;CACD,CAAA;AAED;;;;;;;;;;;CAWC,GACD,OAAO,MAAMC,8BAAwC;IACnD;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,6EAA6E;IAC7E,+EAA+E;IAC/E,8EAA8E;IAC9E,wEAAwE;IACxE,uDAAuD;IACvD;IACA,8EAA8E;IAC9E,0EAA0E;IAC1E,4EAA4E;IAC5E,wEAAwE;IACxE,+EAA+E;IAC/E,8EAA8E;IAC9E,+EAA+E;IAC/E;IACA,0EAA0E;IAC1E,0EAA0E;IAC1E,2EAA2E;IAC3E,8EAA8E;IAC9E,qEAAqE;IACrE,yEAAyE;IACzE,uEAAuE;IACvE,gEAAgE;IAChE;IACA;IACA;IACA;IACA,4EAA4E;IAC5E,0EAA0E;IAC1E,8EAA8E;IAC9E,2EAA2E;IAC3E,0EAA0E;IAC1E,wEAAwE;IACxE,6EAA6E;IAC7E,gDAAgD;IAChD;IACA;IACA;IACA,wEAAwE;IACxE,2EAA2E;IAC3E,4EAA4E;IAC5E,yEAAyE;IACzE,4EAA4E;IAC5E,oDAAoD;IACpD;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,+FAA+F;IAC/F;CACD,CAAA"}
1
+ {"version":3,"sources":["../../../src/withPayload/config/optimizeDeps.ts"],"sourcesContent":["/**\n * Client dep-optimizer config used by `withPayload`. Kept separate from the\n * SSR/RSC externalization config (`./external.ts`) so each concern stays small.\n */\n\n/**\n * Packages we know contain Node-only code or top-level side effects requiring\n * Node APIs. Excluding them from the client optimizer prevents Vite from\n * walking into their main entries and trying to bundle server-only imports\n * for the browser.\n */\nexport const optimizeDepsExcludeDefaults: string[] = [\n 'sharp',\n '@payloadcms/ui',\n '@payloadcms/tanstack-start',\n 'payload',\n 'pino',\n 'pino-pretty',\n 'busboy',\n 'get-tsconfig',\n 'ws',\n 'croner',\n 'prompts',\n 'file-type',\n // Server-only SDKs used by `@payloadcms/storage-*` adapters. Vite\n // sometimes walks these from the main package entry while scanning\n // workspace deps, and the browser sub-bundles do not expose the\n // server-only APIs (e.g. `BlobSASPermissions`), which crashes the dev\n // server with a `MISSING_EXPORT` error before any test runs.\n '@azure/storage-blob',\n // Preserve RSC client boundaries on storage admin upload handlers.\n '@payloadcms/storage-azure',\n '@payloadcms/storage-r2',\n '@payloadcms/storage-vercel-blob',\n '@aws-sdk/client-s3',\n '@aws-sdk/s3-request-presigner',\n '@google-cloud/storage',\n // Packages whose admin component barrel re-exports `'use client'` modules\n // without carrying the directive itself. Pre-bundling one puts those modules\n // in the optimized dep chunk *and* in the `rsc` environment as client\n // references, which `@vitejs/plugin-rsc` warns about (\"client component\n // dependency is inconsistently optimized\") once per component. Barrels that\n // start with `'use client'` (e.g. `richtext-lexical`, `plugin-stripe`) don't\n // warn and stay pre-bundled. Only shows up in published installs; workspace\n // source is never pre-bundled.\n '@payloadcms/plugin-cloud-storage',\n '@payloadcms/plugin-ecommerce',\n '@payloadcms/plugin-form-builder',\n '@payloadcms/plugin-import-export',\n '@payloadcms/plugin-multi-tenant',\n '@payloadcms/plugin-search',\n '@payloadcms/plugin-sentry',\n '@payloadcms/plugin-seo',\n // Database adapters and their drivers. The client scan reaches them through the\n // Payload config (it follows server functions' `import('@payload-config')`\n // without TanStack's server-fn stripping), so Vite would pre-bundle the whole\n // driver for a browser that never loads it. Mongoose 9 has no browser build, so\n // that bundles `mongodb`, whose optional `@aws-sdk/credential-providers` peer —\n // when linked, as in the monorepo via `@payloadcms/payload-cloud` — fails the\n // same `MISSING_EXPORT` way. Published installs reach the adapter packages;\n // the monorepo, which resolves them to source, reaches the drivers.\n '@payloadcms/db-d1-sqlite',\n '@payloadcms/db-mongodb',\n '@payloadcms/db-postgres',\n '@payloadcms/db-sqlite',\n '@payloadcms/db-vercel-postgres',\n '@payloadcms/drizzle',\n 'mongodb',\n 'mongoose',\n]\n\n/**\n * Transitive dependencies of `@payloadcms/ui` and `payload` that need to be\n * pre-bundled for the client. Vite's auto-discovery doesn't reliably pick\n * these up because their parent packages are in `optimizeDeps.exclude`, so we\n * list them explicitly using the `parent > child` syntax.\n *\n * Each entry below fixes a specific late-discovery re-optimization: without it,\n * Vite discovers the dep *after* its initial crawl, forcing a full dep\n * re-optimization mid-session that 404s in-flight `.vite/deps/*` chunks and\n * remounts the admin (dropping client state). This is why the list can't simply\n * be deleted — it is the \"complete first pass\" for the admin's dep graph.\n */\nexport const optimizeDepsIncludeDefaults: string[] = [\n '@payloadcms/ui > sonner',\n '@payloadcms/ui > @faceless-ui/modal',\n '@payloadcms/ui > @faceless-ui/window-info',\n '@payloadcms/ui > @faceless-ui/scroll-info',\n '@payloadcms/ui > @dnd-kit/core',\n '@payloadcms/ui > @dnd-kit/sortable',\n '@payloadcms/ui > @dnd-kit/utilities',\n '@payloadcms/ui > react-datepicker',\n '@payloadcms/ui > react-select',\n '@payloadcms/ui > react-select/creatable',\n '@payloadcms/ui > react-image-crop',\n '@payloadcms/ui > @monaco-editor/react',\n '@payloadcms/ui > date-fns',\n '@payloadcms/ui > date-fns/transpose',\n '@payloadcms/ui > @date-fns/tz/date/mini',\n '@payloadcms/ui > uuid',\n '@payloadcms/ui > use-context-selector',\n '@payloadcms/ui > bson-objectid',\n '@payloadcms/ui > dequal',\n '@payloadcms/ui > object-to-formdata',\n '@payloadcms/ui > md5',\n 'payload > deepmerge',\n 'payload > pluralize',\n // `scheduler` is a transitive dep of `react-dom`, not a direct dependency of\n // the app, so a bare `'scheduler'` specifier fails to resolve from an isolated\n // install (`test/node_modules` built with `pnpm i --ignore-workspace`), where\n // it isn't hoisted to the top level. Path it through `react-dom` so the\n // optimizer resolves the exact copy the runtime loads.\n 'react-dom > scheduler',\n // `@payloadcms/ui` (in `optimizeDeps.exclude`) ships compiled output that the\n // React Compiler rewrote to `import { c } from 'react/compiler-runtime'`.\n // Because its parent is excluded, the optimizer never crawls in to discover\n // this entry, so Vite serves `react/compiler-runtime` raw. That file is\n // CommonJS (`module.exports = require(...)`), so the named `c` export can't be\n // statically extracted and every client component throws \"does not provide an\n // export named 'c'\". Pre-bundling it lets esbuild synthesize the named export.\n 'react/compiler-runtime',\n // Transitive deps that Vite otherwise discovers *after* the initial crawl\n // (react-select pulls in @floating-ui at runtime; react-is is reached via\n // react-transition-group/prop-types; the default date-fns locale is loaded\n // through a dynamic `date-fns/locale/${key}` import). A late discovery forces\n // a full dep re-optimization mid-session, which 404s every in-flight\n // `.vite/deps/*` chunk (\"Pre-transform error: file does not exist in the\n // optimize deps directory\") and breaks the admin UI in CI cold starts.\n // Pre-bundling them keeps the first optimization pass complete.\n '@payloadcms/ui > react-select > @floating-ui/dom',\n '@payloadcms/ui > react-select > @floating-ui/dom > @floating-ui/core',\n '@payloadcms/ui > react-select > prop-types > react-is',\n '@payloadcms/ui > date-fns/locale/en-US',\n // Further late discoveries observed re-optimizing mid-run in CI cold starts\n // (see CI logs: \"✨ new dependencies optimized: @dnd-kit/modifiers / zod /\n // dequal/lite\"). The modular dashboard pulls in `@dnd-kit/modifiers` on first\n // render; form-state diffing reaches `dequal/lite` (a distinct entry point\n // from the already-listed `dequal`); client-side field validation reaches\n // `zod` *through `payload`* — it is `ssrExternal` server-side but still\n // bundled into the client, and must be pathed via `payload` so the optimizer\n // pre-bundles the exact copy the runtime loads.\n '@payloadcms/ui > @dnd-kit/modifiers',\n '@payloadcms/ui > dequal/lite',\n 'payload > zod',\n // The storage client-upload suites (esp. vercel-blob) crawl part of the\n // `payload` server runtime into the client bundle and discover these late,\n // triggering several \"optimized dependencies changed. reloading\" waves that\n // reload the page mid-test (the bulk-upload drawer's Create New button /\n // dropzone vanish and the direct-to-bucket PUT never fires). Pre-bundle the\n // whole observed set so the first pass is complete.\n 'payload > undici',\n 'payload > jose',\n 'payload > dataloader',\n 'payload > path-to-regexp',\n 'payload > console-table-printer',\n 'payload > ci-info',\n 'payload > image-dimensions',\n 'payload > ipaddr.js',\n 'payload > range-parser',\n 'payload > sanitize-filename',\n // `@azure/storage-blob` is excluded, so pre-bundle its CommonJS browser dependency explicitly.\n '@azure/storage-blob > events',\n]\n"],"names":["optimizeDepsExcludeDefaults","optimizeDepsIncludeDefaults"],"mappings":"AAAA;;;CAGC,GAED;;;;;CAKC,GACD,OAAO,MAAMA,8BAAwC;IACnD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;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,+FAA+F;IAC/F;CACD,CAAA"}
@@ -5,10 +5,14 @@ import rsc from '@vitejs/plugin-rsc';
5
5
  export type WithPayloadOptions = {
6
6
  /** Extra import-protection `ignoreImporters` patterns for the TanStack Start plugin. */
7
7
  additionalIgnoreImporters?: RegExp[];
8
- /** Route id of Payload's admin layout, eager-loaded instead of code-split. Defaults to `'/_payload'`. */
9
- adminRouteId?: string;
10
8
  /** Extra globs exempted from the `.client.*` SSR denial (beyond the default node_modules exemption). */
11
9
  clientDenialExcludeFiles?: string[];
10
+ /**
11
+ * Packages added to `ssr.external` on dev serve only (the build bundles them).
12
+ * List CommonJS deps that 500 with `__cjs_module_runner_transform` — the RSC
13
+ * plugin's CJS-to-ESM rewrite breaks on their circular `require`s.
14
+ */
15
+ devServerExternalPackages?: string[];
12
16
  /** Path to the user's `payload.config.ts` (required) */
13
17
  payloadConfigPath: string;
14
18
  /** TanStack router routes directory relative to `srcDirectory`. Defaults to `'app'` */
@@ -86,12 +90,6 @@ export declare function payloadReactOptions(): NonNullable<Parameters<typeof vit
86
90
  export type PayloadTanstackStartOptionsArgs = {
87
91
  /** Additional import-protection `ignoreImporters` patterns. */
88
92
  additionalIgnoreImporters?: RegExp[];
89
- /**
90
- * Route id of Payload's admin layout route, eager-loaded (not code-split) so it
91
- * hydrates on first paint. It and its children skip splitting; host routes keep
92
- * TanStack's default. Defaults to `'/_payload'` (the `_payload.tsx` convention).
93
- */
94
- adminRouteId?: string;
95
93
  /**
96
94
  * Extra globs exempted from TanStack's `.client.*` SSR denial, on top of the
97
95
  * default node_modules exemption. Needed only when Payload's own `.client.*`
@@ -104,8 +102,8 @@ export type PayloadTanstackStartOptionsArgs = {
104
102
  srcDirectory?: string;
105
103
  };
106
104
  /**
107
- * The `tanstackStart` options Payload's admin requires (import-protection and
108
- * code-splitting). TanStack Start is one-per-app, so a host that already runs it
105
+ * The `tanstackStart` options Payload's admin requires (import protection and
106
+ * route discovery). TanStack Start is one-per-app, so a host that already runs it
109
107
  * should merge these into its single `tanstackStart` call.
110
108
  */
111
109
  export declare function payloadTanstackStartOptions(args?: PayloadTanstackStartOptionsArgs): NonNullable<Parameters<typeof tanstackStart>[0]>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/withPayload/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAwB,UAAU,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAA;AAI3F,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AACjE,OAAO,SAAS,MAAM,sBAAsB,CAAA;AAC5C,OAAO,GAAG,MAAM,oBAAoB,CAAA;AAyEpC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,wFAAwF;IACxF,yBAAyB,CAAC,EAAE,MAAM,EAAE,CAAA;IACpC,yGAAyG;IACzG,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,wGAAwG;IACxG,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAA;IACnC,wDAAwD;IACxD,iBAAiB,EAAE,MAAM,CAAA;IACzB,uFAAuF;IACvF,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,yFAAyF;IACzF,yBAAyB,CAAC,EAAE,OAAO,CAAA;IACnC,qDAAqD;IACrD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,wFAAwF;IACxF,IAAI,CAAC,EAAE,UAAU,CAAA;CAClB,CAAA;AAED,mIAAmI;AACnI,MAAM,MAAM,mBAAmB,GAAG;IAChC,SAAS,EAAE,MAAM,EAAE,CAAA;CACpB,CAAA;AAED,wEAAwE;AACxE,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,mBAAmB,CAAA;IAC1B,KAAK,EAAE,WAAW,CAAC,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACnD,GAAG,EAAE,WAAW,CAAC,UAAU,CAAC,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CAAA;CAChE,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,GAAG,EAAE,SAAS,CAAA;IACd,qFAAqF;IACrF,aAAa,EAAE,oBAAoB,CAAA;CACpC,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,EAAE,yBAAyB,KAAK,UAAU,CAAA;AAEnF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,SAAS,GAAG,kBAAkB,EACrC,OAAO,EAAE,kBAAkB,GAC1B,kBAAkB,CA8HpB;AAED,oGAAoG;AACpG,wBAAgB,iBAAiB,IAAI,WAAW,CAAC,UAAU,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAE1E;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,mBAAmB,CAEzD;AAED,mFAAmF;AACnF,wBAAgB,mBAAmB,IAAI,WAAW,CAAC,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAElF;AAED,MAAM,MAAM,+BAA+B,GAAG;IAC5C,+DAA+D;IAC/D,yBAAyB,CAAC,EAAE,MAAM,EAAE,CAAA;IACpC;;;;OAIG;IACH,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAA;IACnC,wFAAwF;IACxF,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,sDAAsD;IACtD,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,GAAE,+BAAoC,GACzC,WAAW,CAAC,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CA+BlD"}
@@ -86,7 +86,7 @@ import { wrapCjsForClient } from './workarounds/wrapCjsForClient.js';
86
86
  * )
87
87
  * ```
88
88
  */ export function withPayload(build, options) {
89
- const { additionalIgnoreImporters = [], adminRouteId, clientDenialExcludeFiles = [], payloadConfigPath, routesDirectory = 'app', silenceDependencyWarnings = true, srcDirectory = 'src', vite } = options;
89
+ const { additionalIgnoreImporters = [], clientDenialExcludeFiles = [], devServerExternalPackages = [], payloadConfigPath, routesDirectory = 'app', silenceDependencyWarnings = true, srcDirectory = 'src', vite } = options;
90
90
  return (env)=>{
91
91
  // `pluralize` ships a UMD wrapper that throws when run through Vite's dev SSR
92
92
  // transform, so dev serve keeps it external and lets Node require it.
@@ -106,7 +106,13 @@ import { wrapCjsForClient } from './workarounds/wrapCjsForClient.js';
106
106
  // externalizes the package boundaries (`buildExternalPackages`) and drops
107
107
  // `pluralize` so it bundles — leaving it in `ssr.external` here would win over
108
108
  // `noExternal` and re-emit the bare specifier.
109
- const ssrExternal = isBuild ? buildExternalPackages : ssrExternalPackages;
109
+ // Dev serve also honors `devServerExternalPackages`, the app's own CJS
110
+ // dependencies that break under the RSC plugin's CJS-to-ESM rewrite; the build
111
+ // needs none of it, since Rollup bundles CJS correctly.
112
+ const ssrExternal = isBuild ? buildExternalPackages : [
113
+ ...ssrExternalPackages,
114
+ ...devServerExternalPackages
115
+ ];
110
116
  const base = {
111
117
  build: {
112
118
  cssMinify: 'esbuild'
@@ -201,7 +207,6 @@ import { wrapCjsForClient } from './workarounds/wrapCjsForClient.js';
201
207
  rsc: payloadRscOptions(),
202
208
  tanstackStart: payloadTanstackStartOptions({
203
209
  additionalIgnoreImporters,
204
- adminRouteId,
205
210
  clientDenialExcludeFiles,
206
211
  routesDirectory,
207
212
  srcDirectory
@@ -247,11 +252,11 @@ import { wrapCjsForClient } from './workarounds/wrapCjsForClient.js';
247
252
  };
248
253
  }
249
254
  /**
250
- * The `tanstackStart` options Payload's admin requires (import-protection and
251
- * code-splitting). TanStack Start is one-per-app, so a host that already runs it
255
+ * The `tanstackStart` options Payload's admin requires (import protection and
256
+ * route discovery). TanStack Start is one-per-app, so a host that already runs it
252
257
  * should merge these into its single `tanstackStart` call.
253
258
  */ export function payloadTanstackStartOptions(args = {}) {
254
- const { additionalIgnoreImporters = [], adminRouteId = '/_payload', clientDenialExcludeFiles = [], routesDirectory = 'app', srcDirectory = 'src' } = args;
259
+ const { additionalIgnoreImporters = [], clientDenialExcludeFiles = [], routesDirectory = 'app', srcDirectory = 'src' } = args;
255
260
  return {
256
261
  importProtection: {
257
262
  client: {
@@ -280,13 +285,6 @@ import { wrapCjsForClient } from './workarounds/wrapCjsForClient.js';
280
285
  }
281
286
  },
282
287
  router: {
283
- codeSplittingOptions: {
284
- // Eager-load only Payload's admin routes so they hydrate on first paint —
285
- // a split admin renders but isn't interactive until its lazy `?tsr-split=`
286
- // chunk lands. Returning `[]` disables splitting for a route; `undefined`
287
- // lets host routes keep TanStack's default per-route splitting.
288
- splitBehavior: ({ routeId })=>routeId === adminRouteId || routeId.startsWith(`${adminRouteId}/`) ? [] : undefined
289
- },
290
288
  // Ignore generated importMap files and colocated `*.functions.ts` modules
291
289
  // (they define `createServerFn`s, not routes).
292
290
  routeFileIgnorePattern: 'importMap\\.(?:d\\.ts|js|server\\.ts)$|\\.functions\\.',