From 50b267896897a211230ae8eba3fc7fe52bf653b6 Mon Sep 17 00:00:00 2001 From: Jason Caldwell Date: Sat, 6 Apr 2024 20:21:15 -0400 Subject: [PATCH] Project update. [p][robotic] --- .browserslistrc | 2 +- .dockerignore | 2 +- .env.vault | 8 +- .gitattributes | 2 +- .gitignore | 2 +- .npmignore | 2 +- .prettierignore | 2 +- .vscode/settings.json | 2 +- .vscodeignore | 2 +- dev/.files/vite/config.mjs | 2 + .../vite/includes/c10n/cloudflare-sockets.mjs | 36 ++++++++ package-lock.json | 86 +++++++++---------- package.json | 2 +- src/preact/components/http.tsx | 9 +- src/resources/preact/apis/iso.tsx | 4 +- .../iso/prerender-spa-for-web-fixture.tsx | 2 +- .../apis/iso/prerender-spa-lazy.cfw.tsx | 6 +- .../preact/apis/iso/prerender-spa.node.tsx | 30 +++---- tsconfig.json | 2 +- wrangler.toml | 2 +- 20 files changed, 121 insertions(+), 84 deletions(-) create mode 100644 dev/.files/vite/includes/c10n/cloudflare-sockets.mjs diff --git a/.browserslistrc b/.browserslistrc index 46e2b8b4..62db6ee8 100644 --- a/.browserslistrc +++ b/.browserslistrc @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Apr 5, 2024 10:26 PM UTC. +# Last generated Apr 7, 2024 12:20 AM UTC. [production] node >= 20.9.0 diff --git a/.dockerignore b/.dockerignore index 3d587f7b..66c0e852 100644 --- a/.dockerignore +++ b/.dockerignore @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Apr 5, 2024 10:26 PM UTC. +# Last generated Apr 7, 2024 12:20 AM UTC. # Locals diff --git a/.env.vault b/.env.vault index 09230d51..3d1a4bab 100644 --- a/.env.vault +++ b/.env.vault @@ -8,12 +8,12 @@ DOTENV_VAULT_MAIN="7GW98NfL4hM4N6HbfeDXCKreVxKvcVPupFRnZ8XJ+pomaQ==" DOTENV_VAULT_MAIN_VERSION=1 # dev -DOTENV_VAULT_DEV="Y/L11rsO3zAbotHmfKtva2KinPgM64OGVzehwIEcswerS04VdBYnhUaRZhbXsJTA5YJEjO6xjs3alvTv3JxAGZJSJi2elsJv/ZJWCma3DhWYeyIyK/Pu/OmiebtP1GmPqt2yIIKU2E4USMQ6UmJRihX0HqX9E7kC9zYljjxekVm0bdItKxaXuZpm7YYLqHSGj99oEBW7IwYV3tzPuCZ73ZOeLEsQGAmzVo6reO4Ix2Dtq/W7sqnvcS5t9vjOGVzE8w==" -DOTENV_VAULT_DEV_VERSION=513 +DOTENV_VAULT_DEV="ReaTeGv9IHvPUjXpcl2EzdBtuHHm/aPRiYxx9dMGyXAuuOR3gcSFUkQG2zN+4+cKR4ujEAg3VDy8rYS8OC7zHmABphk9ww8AKLud6ZYLacWc1u1P/aGRaJRgAm3EjVuN87n20i9W1umFUog+G2+qjOS8J/MBJ/K1u7g2BE4OwYq2hb6BDouDDKRuAGjNeCY6+CXcaBMezNImePBO3+QVq41+TiP95w/wghbrOwJH4CVBB84E7OyjCccFMQorHURl4A==" +DOTENV_VAULT_DEV_VERSION=515 # ci -DOTENV_VAULT_CI="qdMWs349qTSddS+p2FLP2L3cuCG5Ux7J3tHNBzQZJgf5tcbUUSXFpoJFykC+rMygXmDCEmonk9eP0eYjiOSZgSG37l9z5uwR5UP/07rfnXBK75GJrP9ffOElZ1/FNla1Z/bVIutBaiPcPOlBIx1pR11d7e6LItJUv6+x3XuZhg==" -DOTENV_VAULT_CI_VERSION=513 +DOTENV_VAULT_CI="ui7ySDxcLXsDSRdwWOQQ4IXgoVMhd6+Brx8lPQHjNDZmPkDrBe3jYXIR7lVlv1if6aK1HkVnROjO6X0MU0Z1HFSad6Dxqqk341e/QtUTrePrYXHGCH7JTYmH6CaI0IcZeCQniwyso+lNvrhibYdHj3SvkH6MuiL+F0Hhq+0siw==" +DOTENV_VAULT_CI_VERSION=515 # stage DOTENV_VAULT_STAGE="aRP8su2YV4jZu3w1HZ/SLaots0IwJDFw75TCpvXEFeNp7tw=" diff --git a/.gitattributes b/.gitattributes index c39c036f..ecd36212 100644 --- a/.gitattributes +++ b/.gitattributes @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Apr 5, 2024 10:26 PM UTC. +# Last generated Apr 7, 2024 12:20 AM UTC. # Default diff --git a/.gitignore b/.gitignore index 0e65cfe1..7be49691 100644 --- a/.gitignore +++ b/.gitignore @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Apr 5, 2024 10:26 PM UTC. +# Last generated Apr 7, 2024 12:20 AM UTC. # Locals diff --git a/.npmignore b/.npmignore index 0f1ceb20..044256a1 100644 --- a/.npmignore +++ b/.npmignore @@ -25,7 +25,7 @@ # Generated data. # -# Last generated Apr 5, 2024 10:26 PM UTC. +# Last generated Apr 7, 2024 12:20 AM UTC. # Locals diff --git a/.prettierignore b/.prettierignore index 05ae58c5..81a8739b 100644 --- a/.prettierignore +++ b/.prettierignore @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Apr 5, 2024 10:26 PM UTC. +# Last generated Apr 7, 2024 12:20 AM UTC. # Packages diff --git a/.vscode/settings.json b/.vscode/settings.json index a0ccf3f2..8c3a7915 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,7 +7,7 @@ * @note This entire file will be updated automatically. * @note Instead of editing here, please review `./settings.mjs`. * - * Last generated using `./settings.mjs` Apr 5, 2024 10:26 PM UTC. + * Last generated using `./settings.mjs` Apr 7, 2024 12:20 AM UTC. */ { "editor.formatOnType": false, diff --git a/.vscodeignore b/.vscodeignore index 37cca1c8..916060b1 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Apr 5, 2024 10:26 PM UTC. +# Last generated Apr 7, 2024 12:20 AM UTC. # Locals diff --git a/dev/.files/vite/config.mjs b/dev/.files/vite/config.mjs index d9dcfdaf..72a0a0c5 100644 --- a/dev/.files/vite/config.mjs +++ b/dev/.files/vite/config.mjs @@ -21,6 +21,7 @@ import importAliases from '../bin/includes/import-aliases.mjs'; import u from '../bin/includes/utilities.mjs'; import viteA16sDir from './includes/a16s/dir.mjs'; import viteC10nBrandConfig from './includes/c10n/brand-config.mjs'; +import viteC10nCloudflareSockets from './includes/c10n/cloudflare-sockets.mjs'; import viteC10nHTMLTransformsConfig from './includes/c10n/html-transforms.mjs'; import viteC10nNoModulePreloadConfig from './includes/c10n/no-module-preload.mjs'; import viteC10nPostProcessingConfig from './includes/c10n/post-processing.mjs'; @@ -210,6 +211,7 @@ export default async ({ mode, command, isSsrBuild: isSSRBuild }) => { await viteIconsConfig({}), await viteC10nBrandConfig({ mode, appBaseURL }), + await viteC10nCloudflareSockets({ mode, command }), // await viteMDXConfig({ projDir }), await viteEJSConfig({ mode, projDir, srcDir, pkg, env }), diff --git a/dev/.files/vite/includes/c10n/cloudflare-sockets.mjs b/dev/.files/vite/includes/c10n/cloudflare-sockets.mjs new file mode 100644 index 00000000..7d14870a --- /dev/null +++ b/dev/.files/vite/includes/c10n/cloudflare-sockets.mjs @@ -0,0 +1,36 @@ +/** + * C10n Cloudflare sockets plugin. + * + * Vite is not aware of this config file's location. + * + * @note PLEASE DO NOT EDIT THIS FILE! + * @note This entire file will be updated automatically. + * @note Instead of editing here, please review . + */ + +/** + * Configures Cloudflare sockets plugin for Vite. + * + * @param props Props from vite config file driver. + * + * @returns Plugin configuration. + */ +export default async ({ mode, command }) => { + const virtualId = 'cloudflare:sockets'; + const resolvedVirtualId = '\0' + virtualId; + + return { + name: 'vite-plugin-c10n-cloudflare-sockets', + + resolveId(id) { + if ('dev' === mode && 'serve' === command && id === virtualId) { + return '\0' + id; + } + }, + async load(id) { + if ('dev' === mode && 'serve' === command && id === resolvedVirtualId) { + return 'export default {};'; + } + }, + }; +}; diff --git a/package-lock.json b/package-lock.json index 2a38aa89..014c85d2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@clevercanyon/utilities", - "version": "1.0.942", + "version": "1.0.943", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@clevercanyon/utilities", - "version": "1.0.942", + "version": "1.0.943", "cpu": [ "x64", "arm64" @@ -906,9 +906,9 @@ } }, "node_modules/@clevercanyon/madrun": { - "version": "1.0.194", - "resolved": "https://registry.npmjs.org/@clevercanyon/madrun/-/madrun-1.0.194.tgz", - "integrity": "sha512-gw52MS8PTxrljgJF5RhM5iJ0MEpSA6Ghvy2ZZH1fZ5VmJ4qgpbkMW+q0qyp0Tlary0BbNsHkq0Zl2Pu0oqWEVA==", + "version": "1.0.195", + "resolved": "https://registry.npmjs.org/@clevercanyon/madrun/-/madrun-1.0.195.tgz", + "integrity": "sha512-KOQHczWXo5vHhkBxrciOTHCe5fI0su67tV7LuTateLDL/TyT47DOAiGqd+xqWTlfip1eTRlVt6bc1vnj6O/iYw==", "cpu": [ "x64", "arm64" @@ -919,8 +919,8 @@ "linux" ], "dependencies": { - "@clevercanyon/utilities": "^1.0.923", - "@clevercanyon/utilities.node": "^1.0.202" + "@clevercanyon/utilities": "^1.0.942", + "@clevercanyon/utilities.node": "^1.0.203" }, "bin": { "madrun": "dist/bin/cli.js" @@ -934,9 +934,9 @@ } }, "node_modules/@clevercanyon/split-cmd.fork": { - "version": "1.0.139", - "resolved": "https://registry.npmjs.org/@clevercanyon/split-cmd.fork/-/split-cmd.fork-1.0.139.tgz", - "integrity": "sha512-FyTGSnVhpVaIAwtc8IH29oT2Rprfcc6QmmQHalC4aO/W1O65Cmo0L4p+ky9FPIOvllGf1YTIun+7cx/3UoTM0A==", + "version": "1.0.140", + "resolved": "https://registry.npmjs.org/@clevercanyon/split-cmd.fork/-/split-cmd.fork-1.0.140.tgz", + "integrity": "sha512-CjOStnsl4edGkZILjBCgVt9nFM9EKaBNSNzoDYmyLSVhZ8Ew9DmWxmOcvAgtoLtLT/0m0ssfTUFaXtDdP2ka9A==", "cpu": [ "x64", "arm64" @@ -956,9 +956,9 @@ } }, "node_modules/@clevercanyon/utilities": { - "version": "1.0.942", - "resolved": "https://registry.npmjs.org/@clevercanyon/utilities/-/utilities-1.0.942.tgz", - "integrity": "sha512-ihbBRJVgEgeT53DlEGfVZIg/+W7QiKhuHDvWb7u9bMRfw7yhD01t8+x6KvncrMuo1TlZojwqFyxTB+cS8nwnWw==", + "version": "1.0.943", + "resolved": "https://registry.npmjs.org/@clevercanyon/utilities/-/utilities-1.0.943.tgz", + "integrity": "sha512-2hIe6UuLLdVWk1o6NhMk6ckdtnRZxsiv0TuMGv8m7yasPzUs9a8aVK/Xse60Qt1YYpl8zQlFHOpIk0MzYSpUzA==", "cpu": [ "x64", "arm64" @@ -983,7 +983,7 @@ "ignore": "5.3.0", "ip-regex": "5.0.0", "micro-memoize": "4.1.2", - "micromatch": "npm:@clevercanyon/micromatch.fork@^4.0.141", + "micromatch": "npm:@clevercanyon/micromatch.fork@^4.0.142", "parse-css-color": "0.2.1", "preact": "10.19.2", "preact-render-to-string": "6.3.1", @@ -992,9 +992,9 @@ } }, "node_modules/@clevercanyon/utilities.bash": { - "version": "1.0.208", - "resolved": "https://registry.npmjs.org/@clevercanyon/utilities.bash/-/utilities.bash-1.0.208.tgz", - "integrity": "sha512-LANoTwjFWE8m+7Vl5p9HE60x6VGKn0YiipTCt7q+s1BJLuPYwvI0rtStOmrSBAwppDhaPqOJY3PeqYVR80GEFg==", + "version": "1.0.209", + "resolved": "https://registry.npmjs.org/@clevercanyon/utilities.bash/-/utilities.bash-1.0.209.tgz", + "integrity": "sha512-XMp4rE8MJ/775EWXRhqW8apELx4PYma9NNZeTr0OrRnrbEsZViPtJL9QjcYXngGFTPlDtrrAftQDh3EcClu6+Q==", "cpu": [ "x64", "arm64" @@ -1012,14 +1012,14 @@ "url": "https://github.com/sponsors/clevercanyon" }, "peerDependencies": { - "@clevercanyon/utilities": "^1.0.924", - "@clevercanyon/utilities.node": "^1.0.203" + "@clevercanyon/utilities": "^1.0.943", + "@clevercanyon/utilities.node": "^1.0.204" } }, "node_modules/@clevercanyon/utilities.cfp": { - "version": "1.0.249", - "resolved": "https://registry.npmjs.org/@clevercanyon/utilities.cfp/-/utilities.cfp-1.0.249.tgz", - "integrity": "sha512-YP9IDEwvn5bHAk3bVWiWuZTvOaYyWlH6am7oomc/wLrqW+LbkkugANfkWW9AY3erurcBnCzpxoSq05WkME9lwA==", + "version": "1.0.250", + "resolved": "https://registry.npmjs.org/@clevercanyon/utilities.cfp/-/utilities.cfp-1.0.250.tgz", + "integrity": "sha512-toBKtgIGbjLElZCVq6i1yIeMdYqSbcR9n5FS8CTsXsRUDCzOKQM6AoY26Ak42klwV+C0XeSh/9glegOUPyB80A==", "cpu": [ "x64", "arm64" @@ -1037,15 +1037,15 @@ "url": "https://github.com/sponsors/clevercanyon" }, "peerDependencies": { - "@clevercanyon/utilities": "^1.0.935", - "@clevercanyon/utilities.cfw": "^1.0.304", + "@clevercanyon/utilities": "^1.0.943", + "@clevercanyon/utilities.cfw": "^1.0.313", "@clevercanyon/utilities.web": "^1.0.157" } }, "node_modules/@clevercanyon/utilities.cfw": { - "version": "1.0.312", - "resolved": "https://registry.npmjs.org/@clevercanyon/utilities.cfw/-/utilities.cfw-1.0.312.tgz", - "integrity": "sha512-GHzzNKwNru10Actjv7wQKacwfl+YFam6cGYWmxcea9ONF9osN/2sBn4jlrsjy+ptwcFwMgxuwPjrUfZn6gjwag==", + "version": "1.0.313", + "resolved": "https://registry.npmjs.org/@clevercanyon/utilities.cfw/-/utilities.cfw-1.0.313.tgz", + "integrity": "sha512-eM0/oorwtKKme5ncTWn5KarjIQKsaO9pG8N2EBy+odiMWB6dIPSueUl3vbulIUaYBaIX3T909cyG0c3KYeYwgQ==", "cpu": [ "x64", "arm64" @@ -1064,16 +1064,16 @@ "url": "https://github.com/sponsors/clevercanyon" }, "peerDependencies": { - "@clevercanyon/utilities": "^1.0.942", + "@clevercanyon/utilities": "^1.0.943", "@cloudflare/ai": "1.0.53", "@upstash/ratelimit": "1.0.0", "@upstash/redis": "1.28.0" } }, "node_modules/@clevercanyon/utilities.node": { - "version": "1.0.203", - "resolved": "https://registry.npmjs.org/@clevercanyon/utilities.node/-/utilities.node-1.0.203.tgz", - "integrity": "sha512-tG2YtY05fnpECsVyLTbQ20OScPu2dZYme4VKOKPZmuy4ybLxRdSPuEwvZLkSZSswwLt14l1NfNwCnxXIyOpMww==", + "version": "1.0.204", + "resolved": "https://registry.npmjs.org/@clevercanyon/utilities.node/-/utilities.node-1.0.204.tgz", + "integrity": "sha512-Ys9QOBdJGEihcRcj2LqbshvNIgqJXbV/7hdSxT6cpAFo4CeYCks66bgM3P1WIilFcp3Dqo9J/e1R388LE4O18w==", "cpu": [ "x64", "arm64" @@ -1091,8 +1091,8 @@ "url": "https://github.com/sponsors/clevercanyon" }, "peerDependencies": { - "@clevercanyon/split-cmd.fork": "^1.0.138", - "@clevercanyon/utilities": "^1.0.924", + "@clevercanyon/split-cmd.fork": "^1.0.139", + "@clevercanyon/utilities": "^1.0.943", "@upstash/ratelimit": "1.0.0", "@upstash/redis": "1.28.0", "archiver": "6.0.1", @@ -1112,9 +1112,9 @@ } }, "node_modules/@clevercanyon/utilities.web": { - "version": "1.0.157", - "resolved": "https://registry.npmjs.org/@clevercanyon/utilities.web/-/utilities.web-1.0.157.tgz", - "integrity": "sha512-FwRKXgU+5bARS1KJ+noQ+MKgHqoTcRGdnZMy+EmOYB37AOgSODTP1qvcqTkgvpRVIto5A3y+RdtWlGA66rPusQ==", + "version": "1.0.158", + "resolved": "https://registry.npmjs.org/@clevercanyon/utilities.web/-/utilities.web-1.0.158.tgz", + "integrity": "sha512-TCIB/oxkqfM6D3tJTxHavExxAAb3hnPUwBhMQ5kha5y73SIlGYznwORRyOceBoZnLni1nJQRxrDFEuwuruyO3g==", "cpu": [ "x64", "arm64" @@ -1133,7 +1133,7 @@ "url": "https://github.com/sponsors/clevercanyon" }, "peerDependencies": { - "@clevercanyon/utilities": "^1.0.924" + "@clevercanyon/utilities": "^1.0.943" } }, "node_modules/@cloudflare/ai": { @@ -20018,9 +20018,9 @@ }, "node_modules/micromatch/node_modules/picomatch": { "name": "@clevercanyon/picomatch.fork", - "version": "2.3.136", - "resolved": "https://registry.npmjs.org/@clevercanyon/picomatch.fork/-/picomatch.fork-2.3.136.tgz", - "integrity": "sha512-77N8qNCZy52qsr0liIJsBEW4k+lrZCxZ1+TdEE7Xwjffme8FMfoODFm/Wj2ensYK4eP3JCzGqdsPyc+gbwucVg==", + "version": "2.3.137", + "resolved": "https://registry.npmjs.org/@clevercanyon/picomatch.fork/-/picomatch.fork-2.3.137.tgz", + "integrity": "sha512-zRsMNtuwKSiSElFQwJyXd8VpGRnDMXO88DwHOYpOXJ8eys0p5qxC1uztTsJr4bR5/ucO/TGXGrYd/pO8mDMlSg==", "cpu": [ "x64", "arm64" @@ -27269,9 +27269,9 @@ }, "node_modules/spawn-please": { "name": "@clevercanyon/spawn-please.fork", - "version": "2.0.133", - "resolved": "https://registry.npmjs.org/@clevercanyon/spawn-please.fork/-/spawn-please.fork-2.0.133.tgz", - "integrity": "sha512-B9TK4ROe5rLflk9O5dHSAXxbaJPDOP/E3CZZ7OogX8PhAlFwZTgDJm2VxReOPWwKSpnmvdNzkbTm4mdv6kSWpQ==", + "version": "2.0.134", + "resolved": "https://registry.npmjs.org/@clevercanyon/spawn-please.fork/-/spawn-please.fork-2.0.134.tgz", + "integrity": "sha512-gUVft0PANpcU5aHWH+tw+zXFQQytiUs0Isn3ft7JyNEdABCjkH6iOTCRvCpz9HJDR0T4GaNLOvqECuafsT7emw==", "cpu": [ "x64", "arm64" diff --git a/package.json b/package.json index 2b9f2875..2d9e45be 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "1.0.943", + "version": "1.0.944", "license": "GPL-3.0-or-later", "name": "@clevercanyon/utilities", "description": "Utilities for JavaScript apps running in any environment.", diff --git a/src/preact/components/http.tsx b/src/preact/components/http.tsx index 41a4082d..0c807595 100644 --- a/src/preact/components/http.tsx +++ b/src/preact/components/http.tsx @@ -4,17 +4,16 @@ import '#@initialize.ts'; -import { $env, $obj, $preact } from '#index.ts'; +import { $env, $http, $obj, $preact } from '#index.ts'; import { createContext } from 'preact'; /** * Defines types. */ -export type State = $preact.State<{ - status: number; -}>; +export type State = $preact.State<$http.ResponseConfig>; export type PartialState = Partial; export type PartialStateUpdates = PartialState; + export type Props = $preact.BasicTreeProps<{ httpState?: PartialState; }>; @@ -68,7 +67,7 @@ const reduceState = (state: State, updates: PartialStateUpdates): State => { */ export default function HTTP(props: Props): $preact.VNode { const [state, updateState] = $preact.useReducer(reduceState, undefined, (): State => { - return $obj.patchDeep(props.httpState || {}, { status: 200 }) as unknown as State; + return props.httpState || ({} as State); }); return {props.children}; } diff --git a/src/resources/preact/apis/iso.tsx b/src/resources/preact/apis/iso.tsx index eb32bbc5..38bc727c 100644 --- a/src/resources/preact/apis/iso.tsx +++ b/src/resources/preact/apis/iso.tsx @@ -124,8 +124,8 @@ export const prerenderSPA = async (options: PrerenderSPAOptions): PrerenderSPAPr let html = prerenderedData.html; // Prerendered HTML markup. - if (!html /* 404 error when render is empty. */) { - $obj.patchDeep(httpState, { status: 404 }); // Patches HTTP state. + if (!html && !Object.hasOwn(httpState, 'body')) { + $obj.patchDeep(httpState, { status: 404 }); // 404 error when render is empty. const StandAlone404 = (await import('#preact/components/404.tsx')).StandAlone; html = $preact.ssr.renderToString(); } diff --git a/src/tests/preact/apis/iso/prerender-spa-for-web-fixture.tsx b/src/tests/preact/apis/iso/prerender-spa-for-web-fixture.tsx index 347152bd..7d2167b3 100644 --- a/src/tests/preact/apis/iso/prerender-spa-for-web-fixture.tsx +++ b/src/tests/preact/apis/iso/prerender-spa-for-web-fixture.tsx @@ -98,7 +98,7 @@ describe('$preact.iso.prerenderSPA() [web-fixture]', async () => { appManifest: { 'index.html': { css: ['style.css'], file: 'script.js' } }, App, // Defined above. }); - expect(httpState.status).toBe(200); + expect(httpState.status).toBe(undefined); expect(!!docType).toBe(true), expect(!!html).toBe(true); if (fs && path && url) { diff --git a/src/tests/preact/apis/iso/prerender-spa-lazy.cfw.tsx b/src/tests/preact/apis/iso/prerender-spa-lazy.cfw.tsx index d4073d6c..d53578ca 100644 --- a/src/tests/preact/apis/iso/prerender-spa-lazy.cfw.tsx +++ b/src/tests/preact/apis/iso/prerender-spa-lazy.cfw.tsx @@ -114,7 +114,7 @@ describe('$preact.iso.prerenderSPA() [lazy-cfw]', async () => { appManifest: { 'index.html': { css: ['style.css'], file: 'script.js' } }, App, // Defined above. }); - expect(indexHTTPState.status).toBe(200); + expect(indexHTTPState.status).toBe(undefined); expect(indexDocType).toBe(''); expect(indexHTML).toContain('index'); expect(indexHTML).toContain(''); @@ -139,7 +139,7 @@ describe('$preact.iso.prerenderSPA() [lazy-cfw]', async () => { appManifest: { 'index.html': { css: ['style.css'], file: 'script.js' } }, App, // Defined above. }); - expect(testHTTPState.status).toBe(200); + expect(testHTTPState.status).toBe(undefined); expect(testDocType).toBe(''); expect(testHTML).toContain('test'); expect(testHTML).toContain(''); @@ -164,7 +164,7 @@ describe('$preact.iso.prerenderSPA() [lazy-cfw]', async () => { appManifest: { 'index.html': { css: ['style.css'], file: 'script.js' } }, App, // Defined above. }); - expect(lazyHTTPState.status).toBe(200); + expect(lazyHTTPState.status).toBe(undefined); expect(lazyDocType).toBe(''); expect(lazyHTML).toContain('lazy'); expect(lazyHTML).toContain(''); diff --git a/src/tests/preact/apis/iso/prerender-spa.node.tsx b/src/tests/preact/apis/iso/prerender-spa.node.tsx index ebda0a69..4b0adff2 100644 --- a/src/tests/preact/apis/iso/prerender-spa.node.tsx +++ b/src/tests/preact/apis/iso/prerender-spa.node.tsx @@ -186,7 +186,7 @@ describe('$preact.iso.prerenderSPA()', async () => { appManifest: { 'index.html': { css: ['style.css'], file: 'script.js' } }, App, // Defined above. }); - expect(indexHTTPState.status).toBe(200); + expect(indexHTTPState.status).toBe(undefined); expect(indexDocType).toBe(''); expect(indexHTML).toContain('index'); expect(indexHTML).toContain(''); @@ -213,7 +213,7 @@ describe('$preact.iso.prerenderSPA()', async () => { appManifest: { 'index.html': { css: ['style.css'], file: 'script.js' } }, App, // Defined above. }); - expect(blogHTTPState.status).toBe(200); + expect(blogHTTPState.status).toBe(undefined); expect(blogDocType).toBe(''); expect(blogHTML).toContain('blog'); expect(blogHTML).toContain(''); @@ -240,7 +240,7 @@ describe('$preact.iso.prerenderSPA()', async () => { appManifest: { 'index.html': { css: ['style.css'], file: 'script.js' } }, App, // Defined above. }); - expect(blogPostHTTPState.status).toBe(200); + expect(blogPostHTTPState.status).toBe(undefined); expect(blogPostDocType).toBe(''); expect(blogPostHTML).toContain('blog post'); expect(blogPostHTML).toContain(''); @@ -267,7 +267,7 @@ describe('$preact.iso.prerenderSPA()', async () => { appManifest: { 'index.html': { css: ['style.css'], file: 'script.js' } }, App, // Defined above. }); - expect(othersOtherA1HTTPState.status).toBe(200); + expect(othersOtherA1HTTPState.status).toBe(undefined); expect(othersOtherA1DocType).toBe(''); expect(othersOtherA1HTML).toContain('other-a'); expect(othersOtherA1HTML).toContain(''); @@ -292,7 +292,7 @@ describe('$preact.iso.prerenderSPA()', async () => { appManifest: { 'index.html': { css: ['style.css'], file: 'script.js' } }, App, // Defined above. }); - expect(othersOtherA2HTTPState.status).toBe(200); + expect(othersOtherA2HTTPState.status).toBe(undefined); expect(othersOtherA2DocType).toBe(''); expect(othersOtherA2HTML).toContain('other-a'); expect(othersOtherA2HTML).toContain(''); @@ -319,7 +319,7 @@ describe('$preact.iso.prerenderSPA()', async () => { appManifest: { 'index.html': { css: ['style.css'], file: 'script.js' } }, App, // Defined above. }); - expect(othersOtherB1HTTPState.status).toBe(200); + expect(othersOtherB1HTTPState.status).toBe(undefined); expect(othersOtherB1DocType).toBe(''); expect(othersOtherB1HTML).toContain('other-b'); expect(othersOtherB1HTML).toContain(''); @@ -346,7 +346,7 @@ describe('$preact.iso.prerenderSPA()', async () => { appManifest: { 'index.html': { css: ['style.css'], file: 'script.js' } }, App, // Defined above. }); - expect(othersOtherB2HTTPState.status).toBe(200); + expect(othersOtherB2HTTPState.status).toBe(undefined); expect(othersOtherB2DocType).toBe(''); expect(othersOtherB2HTML).toContain('other-b'); expect(othersOtherB2HTML).toContain(''); @@ -373,7 +373,7 @@ describe('$preact.iso.prerenderSPA()', async () => { appManifest: { 'index.html': { css: ['style.css'], file: 'script.js' } }, App, // Defined above. }); - expect(othersOtherC1HTTPState.status).toBe(200); + expect(othersOtherC1HTTPState.status).toBe(undefined); expect(othersOtherC1DocType).toBe(''); expect(othersOtherC1HTML).toContain('other-c'); expect(othersOtherC1HTML).toContain(''); @@ -400,7 +400,7 @@ describe('$preact.iso.prerenderSPA()', async () => { appManifest: { 'index.html': { css: ['style.css'], file: 'script.js' } }, App, // Defined above. }); - expect(othersOtherC2HTTPState.status).toBe(200); + expect(othersOtherC2HTTPState.status).toBe(undefined); expect(othersOtherC2DocType).toBe(''); expect(othersOtherC2HTML).toContain('other-c'); expect(othersOtherC2HTML).toContain(''); @@ -427,7 +427,7 @@ describe('$preact.iso.prerenderSPA()', async () => { appManifest: { 'index.html': { css: ['style.css'], file: 'script.js' } }, App, // Defined above. }); - expect(othersOtherC3HTTPState.status).toBe(200); + expect(othersOtherC3HTTPState.status).toBe(undefined); expect(othersOtherC3DocType).toBe(''); expect(othersOtherC3HTML).toContain('other-c'); expect(othersOtherC3HTML).toContain(''); @@ -481,7 +481,7 @@ describe('$preact.iso.prerenderSPA()', async () => { appManifest: { 'index.html': { css: ['style.css'], file: 'script.js' } }, App, // Defined above. }); - expect(othersOtherD2HTTPState.status).toBe(200); + expect(othersOtherD2HTTPState.status).toBe(undefined); expect(othersOtherD2DocType).toBe(''); expect(othersOtherD2HTML).toContain('other-d'); expect(othersOtherD2HTML).toContain(''); @@ -508,7 +508,7 @@ describe('$preact.iso.prerenderSPA()', async () => { appManifest: { 'index.html': { css: ['style.css'], file: 'script.js' } }, App, // Defined above. }); - expect(othersOtherD3HTTPState.status).toBe(200); + expect(othersOtherD3HTTPState.status).toBe(undefined); expect(othersOtherD3DocType).toBe(''); expect(othersOtherD3HTML).toContain('other-d'); expect(othersOtherD3HTML).toContain(''); @@ -535,7 +535,7 @@ describe('$preact.iso.prerenderSPA()', async () => { appManifest: { 'index.html': { css: ['style.css'], file: 'script.js' } }, App, // Defined above. }); - expect(othersOtherE1HTTPState.status).toBe(200); + expect(othersOtherE1HTTPState.status).toBe(undefined); expect(othersOtherE1DocType).toBe(''); expect(othersOtherE1HTML).toContain('other-e'); expect(othersOtherE1HTML).toContain(''); @@ -562,7 +562,7 @@ describe('$preact.iso.prerenderSPA()', async () => { appManifest: { 'index.html': { css: ['style.css'], file: 'script.js' } }, App, // Defined above. }); - expect(othersOtherE2HTTPState.status).toBe(200); + expect(othersOtherE2HTTPState.status).toBe(undefined); expect(othersOtherE2DocType).toBe(''); expect(othersOtherE2HTML).toContain('other-e'); expect(othersOtherE2HTML).toContain(''); @@ -616,7 +616,7 @@ describe('$preact.iso.prerenderSPA()', async () => { appManifest: { 'index.html': { css: ['foo.css'], file: 'foo.js' } }, App, // Defined above. }); - expect(othersOtherE4HTTPState.status).toBe(200); + expect(othersOtherE4HTTPState.status).toBe(undefined); expect(othersOtherE4DocType).toBe(''); expect(othersOtherE4HTML).toContain('other-e'); expect(othersOtherE4HTML).toContain(''); diff --git a/tsconfig.json b/tsconfig.json index 73d95a4f..c0d5eb0a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,7 +7,7 @@ * @note This entire file will be updated automatically. * @note Instead of editing here, please review `./tsconfig.mjs`. * - * Last generated using `./tsconfig.mjs` Apr 5, 2024 10:26 PM UTC. + * Last generated using `./tsconfig.mjs` Apr 7, 2024 12:20 AM UTC. */ { "include": ["./src/**/*", "./dev-types.d.ts"], diff --git a/wrangler.toml b/wrangler.toml index 5df58f25..db91eade 100644 --- a/wrangler.toml +++ b/wrangler.toml @@ -7,7 +7,7 @@ # @note This entire file will be updated automatically. # @note Instead of editing here, please review `./wrangler.mjs`. # -# Last generated using `./wrangler.mjs` Apr 5, 2024 10:26 PM UTC. +# Last generated using `./wrangler.mjs` Apr 7, 2024 12:20 AM UTC. ## send_metrics = false