@payloadcms/tanstack-start 4.0.0-internal.cea8867 → 4.0.0-internal.e387174
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.
- package/dist/exports/client.d.ts +1 -1
- package/dist/exports/client.d.ts.map +1 -1
- package/dist/exports/client.js +1 -1
- package/dist/exports/client.js.map +1 -1
- package/dist/exports/server.d.ts +1 -1
- package/dist/exports/server.d.ts.map +1 -1
- package/dist/exports/server.js +1 -1
- package/dist/exports/server.js.map +1 -1
- package/dist/exports/vite.d.ts +2 -2
- package/dist/exports/vite.d.ts.map +1 -1
- package/dist/exports/vite.js +1 -1
- package/dist/exports/vite.js.map +1 -1
- package/dist/layouts/Root/getLayoutData.d.ts.map +1 -1
- package/dist/layouts/Root/getLayoutData.js +1 -1
- package/dist/layouts/Root/getLayoutData.js.map +1 -1
- package/dist/layouts/Root/index.js +2 -4
- package/dist/layouts/Root/index.js.map +1 -1
- package/dist/layouts/Root/withPayloadRoot.d.ts +31 -7
- package/dist/layouts/Root/withPayloadRoot.d.ts.map +1 -1
- package/dist/layouts/Root/withPayloadRoot.js +34 -33
- package/dist/layouts/Root/withPayloadRoot.js.map +1 -1
- package/dist/node/cssLoader.d.mts +2 -24
- package/dist/node/cssLoader.d.mts.map +1 -1
- package/dist/routes/adminRoutes.d.ts.map +1 -1
- package/dist/routes/layoutRoute.d.ts.map +1 -1
- package/dist/utilities/getRequestTheme.d.ts +10 -0
- package/dist/utilities/getRequestTheme.d.ts.map +1 -0
- package/dist/utilities/getRequestTheme.js +25 -0
- package/dist/utilities/getRequestTheme.js.map +1 -0
- package/dist/utilities/graphqlHandler.server.d.ts.map +1 -1
- package/dist/utilities/serverAdapter.server.d.ts.map +1 -1
- package/dist/vite/constants.d.ts +42 -0
- package/dist/vite/constants.d.ts.map +1 -0
- package/dist/vite/{config/optimizeDeps.js → constants.js} +63 -9
- package/dist/vite/constants.js.map +1 -0
- package/dist/vite/plugin.d.ts +38 -0
- package/dist/vite/plugin.d.ts.map +1 -0
- package/dist/vite/plugin.js +177 -0
- package/dist/vite/plugin.js.map +1 -0
- package/dist/vite/plugins/clientModuleResolution.d.ts.map +1 -0
- package/dist/vite/plugins/clientModuleResolution.js.map +1 -0
- package/dist/vite/plugins/devTransforms.d.ts.map +1 -0
- package/dist/vite/{workarounds → plugins}/devTransforms.js +0 -5
- package/dist/vite/plugins/devTransforms.js.map +1 -0
- package/dist/vite/plugins/reactDomServerInRsc.d.ts.map +1 -0
- package/dist/vite/plugins/reactDomServerInRsc.js.map +1 -0
- package/dist/vite/plugins/stripDistStyleImports.d.ts.map +1 -0
- package/dist/vite/plugins/stripDistStyleImports.js.map +1 -0
- package/dist/vite/plugins/wrapCjsForClient.d.ts.map +1 -0
- package/dist/vite/plugins/wrapCjsForClient.js.map +1 -0
- package/package.json +5 -10
- package/dist/vite/config/external.d.ts +0 -11
- package/dist/vite/config/external.d.ts.map +0 -1
- package/dist/vite/config/external.js +0 -48
- package/dist/vite/config/external.js.map +0 -1
- package/dist/vite/config/optimizeDeps.d.ts +0 -25
- package/dist/vite/config/optimizeDeps.d.ts.map +0 -1
- package/dist/vite/config/optimizeDeps.js.map +0 -1
- package/dist/vite/config/scss.d.ts +0 -14
- package/dist/vite/config/scss.d.ts.map +0 -1
- package/dist/vite/config/scss.js +0 -28
- package/dist/vite/config/scss.js.map +0 -1
- package/dist/vite/index.d.ts +0 -99
- package/dist/vite/index.d.ts.map +0 -1
- package/dist/vite/index.js +0 -258
- package/dist/vite/index.js.map +0 -1
- package/dist/vite/workarounds/clientModuleResolution.d.ts.map +0 -1
- package/dist/vite/workarounds/clientModuleResolution.js.map +0 -1
- package/dist/vite/workarounds/devTransforms.d.ts.map +0 -1
- package/dist/vite/workarounds/devTransforms.js.map +0 -1
- package/dist/vite/workarounds/reactDomServerInRsc.d.ts.map +0 -1
- package/dist/vite/workarounds/reactDomServerInRsc.js.map +0 -1
- package/dist/vite/workarounds/stripDistStyleImports.d.ts.map +0 -1
- package/dist/vite/workarounds/stripDistStyleImports.js.map +0 -1
- package/dist/vite/workarounds/stubPrettierInClient.d.ts +0 -13
- package/dist/vite/workarounds/stubPrettierInClient.d.ts.map +0 -1
- package/dist/vite/workarounds/stubPrettierInClient.js +0 -32
- package/dist/vite/workarounds/stubPrettierInClient.js.map +0 -1
- package/dist/vite/workarounds/wrapCjsForClient.d.ts.map +0 -1
- package/dist/vite/workarounds/wrapCjsForClient.js.map +0 -1
- /package/dist/vite/{workarounds → plugins}/clientModuleResolution.d.ts +0 -0
- /package/dist/vite/{workarounds → plugins}/clientModuleResolution.js +0 -0
- /package/dist/vite/{workarounds → plugins}/devTransforms.d.ts +0 -0
- /package/dist/vite/{workarounds → plugins}/reactDomServerInRsc.d.ts +0 -0
- /package/dist/vite/{workarounds → plugins}/reactDomServerInRsc.js +0 -0
- /package/dist/vite/{workarounds → plugins}/stripDistStyleImports.d.ts +0 -0
- /package/dist/vite/{workarounds → plugins}/stripDistStyleImports.js +0 -0
- /package/dist/vite/{workarounds → plugins}/wrapCjsForClient.d.ts +0 -0
- /package/dist/vite/{workarounds → plugins}/wrapCjsForClient.js +0 -0
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Stubs `prettier` in the CLIENT bundle only.
|
|
3
|
-
*
|
|
4
|
-
* `payload`'s barrel transitively pulls `json-schema-to-typescript` → `prettier`
|
|
5
|
-
* (CommonJS) into the client graph. That path is type-gen only and never runs in
|
|
6
|
-
* the browser, but the bundler still drags in `prettier`'s `index.cjs`, which
|
|
7
|
-
* fails to parse as ESM and breaks the client build. SSR/RSC keep real prettier.
|
|
8
|
-
*
|
|
9
|
-
* Delete once `payload`'s barrel no longer reaches type-gen from the client graph.
|
|
10
|
-
*/ export function stubPrettierInClient() {
|
|
11
|
-
const RESOLVED_ID = '\0payload:prettier-client-stub';
|
|
12
|
-
return {
|
|
13
|
-
name: 'payload:stub-prettier-in-client',
|
|
14
|
-
enforce: 'pre',
|
|
15
|
-
load (id) {
|
|
16
|
-
if (id === RESOLVED_ID) {
|
|
17
|
-
return 'export const format = (source) => source;\nexport default { format };';
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
resolveId (id, importer, options) {
|
|
21
|
-
if (options?.ssr) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
// Only stub the type-gen import; leave a host's own client `prettier` alone.
|
|
25
|
-
if (id === 'prettier' && importer?.includes('json-schema-to-typescript')) {
|
|
26
|
-
return RESOLVED_ID;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
//# sourceMappingURL=stubPrettierInClient.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/vite/workarounds/stubPrettierInClient.ts"],"sourcesContent":["import type { PluginOption } from 'vite'\n\n/**\n * Stubs `prettier` in the CLIENT bundle only.\n *\n * `payload`'s barrel transitively pulls `json-schema-to-typescript` → `prettier`\n * (CommonJS) into the client graph. That path is type-gen only and never runs in\n * the browser, but the bundler still drags in `prettier`'s `index.cjs`, which\n * fails to parse as ESM and breaks the client build. SSR/RSC keep real prettier.\n *\n * Delete once `payload`'s barrel no longer reaches type-gen from the client graph.\n */\nexport function stubPrettierInClient(): PluginOption {\n const RESOLVED_ID = '\\0payload:prettier-client-stub'\n\n return {\n name: 'payload:stub-prettier-in-client',\n enforce: 'pre',\n load(id) {\n if (id === RESOLVED_ID) {\n return 'export const format = (source) => source;\\nexport default { format };'\n }\n },\n resolveId(id, importer, options) {\n if (options?.ssr) {\n return\n }\n // Only stub the type-gen import; leave a host's own client `prettier` alone.\n if (id === 'prettier' && importer?.includes('json-schema-to-typescript')) {\n return RESOLVED_ID\n }\n },\n }\n}\n"],"names":["stubPrettierInClient","RESOLVED_ID","name","enforce","load","id","resolveId","importer","options","ssr","includes"],"mappings":"AAEA;;;;;;;;;CASC,GACD,OAAO,SAASA;IACd,MAAMC,cAAc;IAEpB,OAAO;QACLC,MAAM;QACNC,SAAS;QACTC,MAAKC,EAAE;YACL,IAAIA,OAAOJ,aAAa;gBACtB,OAAO;YACT;QACF;QACAK,WAAUD,EAAE,EAAEE,QAAQ,EAAEC,OAAO;YAC7B,IAAIA,SAASC,KAAK;gBAChB;YACF;YACA,6EAA6E;YAC7E,IAAIJ,OAAO,cAAcE,UAAUG,SAAS,8BAA8B;gBACxE,OAAOT;YACT;QACF;IACF;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wrapCjsForClient.d.ts","sourceRoot":"","sources":["../../../src/vite/workarounds/wrapCjsForClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAExC;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,IAAI,YAAY,CAqE/C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/vite/workarounds/wrapCjsForClient.ts"],"sourcesContent":["import type { PluginOption } from 'vite'\n\n/**\n * Wraps CJS `node_modules` files in ESM-compatible code when served to the\n * client.\n *\n * Packages in `optimizeDeps.exclude` (like `payload`, `@payloadcms/ui`) import\n * CJS dependencies that Vite serves via raw `/@fs/` URLs, bypassing\n * pre-bundling. The browser fails to parse them because they use\n * `module.exports` / `exports.X` syntax.\n *\n * This plugin detects CJS patterns in the transform phase and wraps them with\n * a CommonJS-like runtime shim so the browser can execute them as ESM.\n */\nexport function wrapCjsForClient(): PluginOption {\n return {\n name: 'payload:wrap-cjs-client',\n apply: 'serve',\n enforce: 'post',\n transform(code, id, options) {\n if (options?.ssr) {\n return\n }\n\n if (!id.includes('/node_modules/') || id.includes('/node_modules/.vite/')) {\n return\n }\n\n const cleanId = id.replace(/\\?.*$/, '')\n if (!cleanId.endsWith('.js') && !cleanId.endsWith('.cjs')) {\n return\n }\n\n if (code.includes('import ') || code.includes('export ')) {\n return\n }\n\n if (\n !code.includes('module.exports') &&\n !code.includes('exports.') &&\n !code.includes('Object.defineProperty(exports')\n ) {\n return\n }\n\n const namedExports = extractCjsExports(code)\n const names = Object.keys(namedExports)\n\n const declaredIdentifiers = extractDeclaredIdentifiers(code)\n const safeNames = names.filter((name) => !declaredIdentifiers.has(name))\n\n // If the module already declares its own top-level `require` (rare but\n // possible for hand-written CJS), skip injecting our stub so we don't\n // produce a `SyntaxError: Identifier 'require' has already been declared`.\n const injectRequireStub = !declaredIdentifiers.has('require')\n\n const wrapped = [\n `var module = { exports: {} };`,\n `var exports = module.exports;`,\n // Expose a `require` stub so UMD wrappers that gate their CJS branch on\n // `typeof require === 'function'` (e.g. pluralize) take that branch and\n // assign to our `module.exports` instead of falling through to the\n // browser-globals branch (`root.foo = ...`), which throws in strict ESM\n // because the IIFE receives `this === undefined`.\n // The stub throws on actual invocation so any module that *really* needs\n // require fails loudly instead of silently misbehaving.\n injectRequireStub\n ? `var require = function require() { throw new Error(\"require() is not available in the browser bundle\"); };`\n : ``,\n ``,\n code,\n ``,\n `var __cjs_result__ = module.exports;`,\n `export default __cjs_result__;`,\n ...safeNames.map(\n (name) =>\n `export var ${name} = typeof __cjs_result__ === 'object' && __cjs_result__ !== null ? __cjs_result__[\"${name}\"] : undefined;`,\n ),\n ].join('\\n')\n\n return { code: wrapped, map: null }\n },\n }\n}\n\nfunction extractCjsExports(code: string): Record<string, true> {\n const found: Record<string, true> = {}\n const patterns = [\n /exports\\.(\\w+)\\s*=/g,\n /exports\\[[\"'](\\w+)[\"']\\]\\s*=/g,\n /Object\\.defineProperty\\(exports,\\s*[\"'](\\w+)[\"']/g,\n ]\n for (const re of patterns) {\n let m\n while ((m = re.exec(code)) !== null) {\n const name = m[1]!\n if (name !== '__esModule' && name !== 'default') {\n found[name] = true\n }\n }\n }\n return found\n}\n\n/**\n * Detects top-level identifiers declared with class/function/var/let/const in\n * CJS code. Used to avoid re-declaring them via `export var` in the CJS\n * wrapper, which would cause `SyntaxError: Identifier has already been\n * declared` in strict mode (ESM).\n */\nfunction extractDeclaredIdentifiers(code: string): Set<string> {\n const identifiers = new Set<string>()\n const patterns = [/\\bclass\\s+(\\w+)/g, /\\bfunction\\s+(\\w+)/g, /\\b(?:var|let|const)\\s+(\\w+)/g]\n for (const re of patterns) {\n let m\n while ((m = re.exec(code)) !== null) {\n identifiers.add(m[1]!)\n }\n }\n return identifiers\n}\n"],"names":["wrapCjsForClient","name","apply","enforce","transform","code","id","options","ssr","includes","cleanId","replace","endsWith","namedExports","extractCjsExports","names","Object","keys","declaredIdentifiers","extractDeclaredIdentifiers","safeNames","filter","has","injectRequireStub","wrapped","map","join","found","patterns","re","m","exec","identifiers","Set","add"],"mappings":"AAEA;;;;;;;;;;;CAWC,GACD,OAAO,SAASA;IACd,OAAO;QACLC,MAAM;QACNC,OAAO;QACPC,SAAS;QACTC,WAAUC,IAAI,EAAEC,EAAE,EAAEC,OAAO;YACzB,IAAIA,SAASC,KAAK;gBAChB;YACF;YAEA,IAAI,CAACF,GAAGG,QAAQ,CAAC,qBAAqBH,GAAGG,QAAQ,CAAC,yBAAyB;gBACzE;YACF;YAEA,MAAMC,UAAUJ,GAAGK,OAAO,CAAC,SAAS;YACpC,IAAI,CAACD,QAAQE,QAAQ,CAAC,UAAU,CAACF,QAAQE,QAAQ,CAAC,SAAS;gBACzD;YACF;YAEA,IAAIP,KAAKI,QAAQ,CAAC,cAAcJ,KAAKI,QAAQ,CAAC,YAAY;gBACxD;YACF;YAEA,IACE,CAACJ,KAAKI,QAAQ,CAAC,qBACf,CAACJ,KAAKI,QAAQ,CAAC,eACf,CAACJ,KAAKI,QAAQ,CAAC,kCACf;gBACA;YACF;YAEA,MAAMI,eAAeC,kBAAkBT;YACvC,MAAMU,QAAQC,OAAOC,IAAI,CAACJ;YAE1B,MAAMK,sBAAsBC,2BAA2Bd;YACvD,MAAMe,YAAYL,MAAMM,MAAM,CAAC,CAACpB,OAAS,CAACiB,oBAAoBI,GAAG,CAACrB;YAElE,uEAAuE;YACvE,sEAAsE;Y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ACA,OAAOE;AACT"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|