@wular/coder 0.4.0 → 0.4.2
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/README.md +69 -70
- package/dist/{add-ej0X9e3a.js → add-C2y-mVzl.js} +1 -1
- package/dist/{add-U-pty9qJ.js → add-CLYTF_up.js} +1 -1
- package/dist/{add-CE-70LFs.js → add-DRsPpQFl.js} +1 -1
- package/dist/{add-BxpLHnvD.js → add-DkpUwhtO.js} +1 -1
- package/dist/{add-json-CEa-6luW.js → add-json-5uPnWPoD.js} +1 -1
- package/dist/{agent-BsYx3Odz.js → agent-hw3zKw8y.js} +1 -1
- package/dist/{agent-JdtZozvP.js → agent-r5mMcehf.js} +1 -1
- package/dist/{alias-DX-Bm86x.js → alias-_0Rwf2cA.js} +1 -1
- package/dist/{app-BT5f7zL5.js → app-oE8G1-bi.js} +1 -1
- package/dist/{approvals-C-AvFt6s.js → approvals-DbVrsxec.js} +1 -1
- package/dist/{approve-DOmpQRNd.js → approve-DeAhFL-m.js} +1 -1
- package/dist/{apps-CjfrZyM5.js → apps-eujHiNca.js} +1 -1
- package/dist/{archive-BziJ1rQ-.js → archive-BCUfymIB.js} +1 -1
- package/dist/{archive-BUB8gFKD.js → archive-DZ6vpMHb.js} +1 -1
- package/dist/{archive-sweep-CtBcARgN.js → archive-sweep-Cxbh8yAI.js} +1 -1
- package/dist/{ask-dE3U3ss2.js → ask-BU2WVxVM.js} +1 -1
- package/dist/auth-CBWTmAPA.js +1 -0
- package/dist/{auth-BFny--17.js → auth-Dmn2U7rr.js} +1 -1
- package/dist/{cli-BilSDkvE.js → cli-DWCR7iqa.js} +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +1 -1
- package/dist/{config-Da_cwoxI.js → config-12pK4qW7.js} +1 -1
- package/dist/{create-C_iMJV4Y.js → create-D3f6q0Yq.js} +1 -1
- package/dist/credentials-l6dsrZLL.js +1 -0
- package/dist/dash/manifest.json +841 -955
- package/dist/dash/public/assets/chunks/{agent-pills-69c965aae1737cef.js → agent-pills-dd0b7643e125bbf1.js} +1 -1
- package/dist/dash/public/assets/chunks/{agent-settings-form-a1ce70812eea3f20.js → agent-settings-form-45ae6aeaaed2b568.js} +1 -1
- package/dist/dash/public/assets/chunks/{agents-grid-f62180478e43c192.js → agents-grid-b906da80c31fc035.js} +1 -1
- package/dist/dash/public/assets/chunks/{badge-d07f35e9abc80e14.js → badge-676b01e0c615bf7b.js} +1 -1
- package/dist/dash/public/assets/chunks/{card-be04148b64223a52.js → card-e0901d68b79dfa93.js} +1 -1
- package/dist/dash/public/assets/chunks/{combo-32c321a7a84fa902.js → combo-952a457d52360d88.js} +1 -1
- package/dist/dash/public/assets/chunks/{composer-aec9c3c691f1f79a.js → composer-49f9e7c5c4dfda3b.js} +1 -1
- package/dist/dash/public/assets/chunks/composer-f331d00837143aee.js +1 -0
- package/dist/dash/public/assets/chunks/{confirm-b4e2c16aef4b3431.js → confirm-f2fe4ba9905a89c6.js} +1 -1
- package/dist/dash/public/assets/chunks/{connect-apps-a5a63941e287c33f.js → connect-apps-661f3b3a85f1776a.js} +1 -1
- package/dist/dash/public/assets/chunks/{connect-repositories-e4c049b5b4384623.js → connect-repositories-5389ec8701a3deac.js} +1 -1
- package/dist/dash/public/assets/chunks/{credentials-list-2b7d0c771b89f9c5.js → credentials-list-e6177d0943517929.js} +2 -2
- package/dist/dash/public/assets/chunks/{custom-range-53b70e0d9eeae84e.js → custom-range-03ba6fb2ade7d282.js} +1 -1
- package/dist/dash/public/assets/chunks/{editor-691d2bcecb1ecb87.js → editor-34cb529d6d8a4b09.js} +2 -2
- package/dist/dash/public/assets/chunks/{engines-list-a5fe1671601ce3b0.js → engines-list-2f1acee3ecc8461a.js} +1 -1
- package/dist/dash/public/assets/chunks/{field-9e12e5fc8774b6e5.js → field-901f1f35c18c39c9.js} +1 -1
- package/dist/dash/public/assets/chunks/{heads-4041a925d63ab116.js → heads-1570a3a6db331979.js} +1 -1
- package/dist/dash/public/assets/chunks/{instructions-4e0d18b9b40edbd7.js → instructions-052fa45a9daf6db6.js} +1 -1
- package/dist/dash/public/assets/chunks/instructions-d0a4b0d95009c262.js +1 -0
- package/dist/dash/public/assets/chunks/{list-d7eb9e02cf261fbe.js → list-87b359bebd26986a.js} +1 -1
- package/dist/dash/public/assets/chunks/{mcp-list-a450533109045ef5.js → mcp-list-b42f0d2ee463b37d.js} +1 -1
- package/dist/dash/public/assets/chunks/{models-list-1e273c6843858148.js → models-list-0669d26fd662aec3.js} +1 -1
- package/dist/dash/public/assets/chunks/{platform-actions-87f3f76ec1b840cb.js → platform-actions-c92ca3c6198a9387.js} +1 -1
- package/dist/dash/public/assets/chunks/{runners-list-fc7cdae4fa93e78b.js → runners-list-9fffa50432c470c9.js} +1 -1
- package/dist/dash/public/assets/chunks/{segmented-6091dfb2f954799f.js → segmented-358ff2b4992b8384.js} +1 -1
- package/dist/dash/public/assets/chunks/{select-dd09a6b9544cfde2.js → select-1013702bdfb1ade4.js} +1 -1
- package/dist/dash/public/assets/chunks/{sentinel-ff7143a47fd22835.js → sentinel-c972a33dc69a5135.js} +1 -1
- package/dist/dash/public/assets/chunks/shared-init-20e199043ff5d00f.js +2 -0
- package/dist/dash/public/assets/chunks/shared-init-88cce66bb3cfe1e5.js +5 -0
- package/dist/dash/public/assets/chunks/{tail-5a5bfcd308535d70.js → tail-7c27aab8ba268bd9.js} +1 -1
- package/dist/dash/public/assets/chunks/{task-actions-7919ca0e901131f4.js → task-actions-a9603d520434baab.js} +1 -1
- package/dist/dash/public/assets/chunks/{task-view-e8a0f99c992fa11e.js → task-view-f7039cb330bcb0b5.js} +3 -3
- package/dist/dash/public/assets/chunks/{tasks-list-7b72f5b295349532.js → tasks-list-2a905b4a0c3a9042.js} +1 -1
- package/dist/dash/public/assets/chunks/{toolbar-9b18a5d26dee37c3.js → toolbar-f964fa864699f095.js} +1 -1
- package/dist/dash/public/assets/chunks/{versions-list-8cdf3a41c56b2152.js → versions-list-fc2e0d2a7382e049.js} +1 -1
- package/dist/dash/public/assets/dash-49ca85b59ac65c20.css +1 -0
- package/dist/dash/public/assets/dash-account-96fc41be318839fa.css +1 -0
- package/dist/dash/public/assets/dash-agents-290a7b21c7dc0c92.css +1 -0
- package/dist/dash/public/assets/dash-agents-new-a7a07bf4ebda24c2.css +1 -0
- package/dist/dash/public/assets/dash-agents-param-slug-69a72fb0bbd14cc2.css +1 -0
- package/dist/dash/public/assets/dash-agents-param-slug-edit-397bdfb2f0ca328c.css +1 -0
- package/dist/dash/public/assets/dash-agents-param-slug-platforms-a7b3b7247c27f1d2.css +1 -0
- package/dist/dash/public/assets/dash-agents-param-slug-settings-8389b7d0555e8ccf.css +1 -0
- package/dist/dash/public/assets/dash-agents-param-slug-tasks-5987b8aea5e8f30d.css +1 -0
- package/dist/dash/public/assets/dash-agents-param-slug-usage-19abc69e1d4e6b0a.css +1 -0
- package/dist/dash/public/assets/dash-settings-53b8e6a8f656fa1a.css +1 -0
- package/dist/dash/public/assets/dash-settings-param-tab-ac61fdfdd6fd533f.css +1 -0
- package/dist/dash/public/assets/dash-tasks-cc0b1d32874b731c.css +1 -0
- package/dist/dash/public/assets/dash-tasks-param-id-02b8c7bd99cc1090.css +1 -0
- package/dist/dash/public/assets/dash-usage-884943221f76ad93.css +1 -0
- package/dist/dash/public/assets/pnext-client-17ba55bb57a1f4da.js +1 -0
- package/dist/dash/public/assets/{pnext-client-0b6720fdec66eeb0.js → pnext-client-1afa4148bea69ad2.js} +1 -1
- package/dist/dash/public/assets/{pnext-client-4cf2e27d0b9c0365.js → pnext-client-2693db10b197ade1.js} +1 -1
- package/dist/dash/public/assets/pnext-client-43f52a07f8067b1b.js +1 -0
- package/dist/dash/public/assets/pnext-client-4594b693fe612835.js +1 -0
- package/dist/dash/public/assets/pnext-client-73f73e24f8141fb6.js +1 -0
- package/dist/dash/public/assets/pnext-client-7574da4651b40eae.js +1 -0
- package/dist/dash/public/assets/pnext-client-7b3a2c1092cbbb02.js +1 -0
- package/dist/dash/public/assets/pnext-client-816fe5fc96d3f768.js +1 -0
- package/dist/dash/public/assets/pnext-client-86cb956b448b0887.js +1 -0
- package/dist/dash/public/assets/pnext-client-8b64e3c030164288.js +1 -0
- package/dist/dash/public/assets/pnext-client-8f6161084c595a22.js +1 -0
- package/dist/dash/public/assets/pnext-client-9203ec11926e5d04.js +1 -0
- package/dist/dash/public/assets/pnext-client-a38b446f941d44df.js +1 -0
- package/dist/dash/public/assets/pnext-client-bd8d51aaa095e8a4.js +1 -0
- package/dist/dash/public/assets/pnext-client-e9821d1f1bdb281d.js +1 -0
- package/dist/dash/server/bundle-0.1.6-b29ec45cb963d47f/entry.js +2 -0
- package/dist/{default-vYPT26DR.js → default-CwQXCtoB.js} +1 -1
- package/dist/{default-Bobztoxf.js → default-De8FXiWz.js} +1 -1
- package/dist/{delete-z1_86nf6.js → delete-BD6AnCLg.js} +1 -1
- package/dist/{delete-D8gEwoOj.js → delete-cS01oOIb.js} +1 -1
- package/dist/{disable-DVKd-0Xb.js → disable-BMWWeYFQ.js} +1 -1
- package/dist/{discover-Df-a8K4R.js → discover-Cfx5RPU7.js} +1 -1
- package/dist/{docs-DKJnqZqt.js → docs-DWegDRiu.js} +1 -1
- package/dist/{enable-C8Zf_wpN.js → enable-Cfzeau2x.js} +1 -1
- package/dist/flow/index.d.ts +1 -1
- package/dist/{flow-17k25MHt.js → flow-kAxxVOiR.js} +1 -1
- package/dist/{index-DT7EST00.d.ts → index-CZjFX5zV.d.ts} +1 -1
- package/dist/{init-CoMfFxbG.js → init-C4tDFH4G.js} +1 -1
- package/dist/integrations-D-L3uQRj.js +1 -0
- package/dist/{list-BYiG8Zav.js → list-5Ljf9TxF.js} +2 -2
- package/dist/{list-BAKvxSbh.js → list-COAo7eZd.js} +1 -1
- package/dist/{list-DX-z3SBp.js → list-DuPqU3fk.js} +1 -1
- package/dist/{list-C5w01-8q.js → list-DzGuMkQy.js} +1 -1
- package/dist/{list-VToARh3C.js → list-J8d_zh-o.js} +1 -1
- package/dist/{list-BxEywhHU.js → list-vOvIpbOH.js} +1 -1
- package/dist/{list-CIW2joV1.js → list-vpyS-hv8.js} +1 -1
- package/dist/{list-DpCf4G-H.js → list-way5oLO0.js} +1 -1
- package/dist/{login-DkkslfBx.js → login-BBw95-S3.js} +1 -1
- package/dist/{login-BFxX4jJy.js → login-CNmeRAL7.js} +1 -1
- package/dist/{logout-BHAtw4Z8.js → logout-j0dTo_Ib.js} +1 -1
- package/dist/{maintenance-C5FklUw3.js → maintenance-DkLVtqM7.js} +1 -1
- package/dist/{mcp-CCZOAo06.js → mcp-CsmBtlW9.js} +1 -1
- package/dist/{migrate-C4vM7DQN.js → migrate-D4nzYhk8.js} +1 -1
- package/dist/{model-Bs1StDo3.js → model-B79MFtRV.js} +1 -1
- package/dist/{push-CUC55Bqd.js → push-DbdnbZYt.js} +1 -1
- package/dist/{queue-6io_NOP3.js → queue-C9fSdE_X.js} +27 -27
- package/dist/refresh-BDmap1RA.js +1 -0
- package/dist/{remove-B93LNkZI.js → remove-BNzbUhaK.js} +1 -1
- package/dist/{remove-eQ8y5C5p.js → remove-CLpL12Ya.js} +1 -1
- package/dist/{remove-CuH8a3L9.js → remove-CaYH9Cna.js} +1 -1
- package/dist/{remove-C5_xggx7.js → remove-D-QeeZQL.js} +1 -1
- package/dist/{rename-CYfy03FE.js → rename-Bhcb4t9F.js} +1 -1
- package/dist/{result-BEtQZHaY.js → result-BfTfJayl.js} +1 -1
- package/dist/{result-BzaM3inj.js → result-D8DsvJDu.js} +1 -1
- package/dist/{resume-DYzKvyEw.js → resume-aZ8yWDBh.js} +1 -1
- package/dist/{review-oIBeECZE.js → review-BEhDcX4b.js} +1 -1
- package/dist/{rotate-key-IdMYH7gg.js → rotate-key-BqnKhTK8.js} +1 -1
- package/dist/{run-CTtd0Znc.js → run-BWbabvub.js} +1 -1
- package/dist/{run-CawRGnOg.js → run-BdPjxaZU.js} +1 -1
- package/dist/{run-BDYl0CKl.js → run-Dqe38jX8.js} +1 -1
- package/dist/runner-BPpiJvHx.js +1 -0
- package/dist/sdk.d.ts +2 -2
- package/dist/sdk.js +1 -1
- package/dist/{serve-CPnmrKyf.js → serve-C0WC-QrV.js} +2 -2
- package/dist/{serve-GmRO89s5.js → serve-CcObDKKQ.js} +1 -1
- package/dist/{serve-CE8YV2e9.js → serve-Ck95047c.js} +1 -1
- package/dist/{serve-CQKZxzFE.js → serve-DA5I2qXj.js} +2 -2
- package/dist/{server-Kb22cWfF.js → server-BxLFZL80.js} +1 -1
- package/dist/{setup-host-GFTUzzZJ.js → setup-host-DLd_j2Uw.js} +1 -1
- package/dist/{shared-DVtzWhUT.js → shared-BLkGRKty.js} +1 -1
- package/dist/{show-COTZEYgc.js → show-DzoQIs75.js} +1 -1
- package/dist/{show-CMUg8SJu.js → show-FC3dJcD-.js} +1 -1
- package/dist/{status-D26U--p8.js → status-BU3DR1XU.js} +1 -1
- package/dist/{steer-C6uARLp5.js → steer-P_38hRRD.js} +1 -1
- package/dist/{stop-BrGI3hSS.js → stop-BJGDRPsp.js} +1 -1
- package/dist/{stop-ByCAlbmN.js → stop-BWY6k6v5.js} +1 -1
- package/dist/{store-DzqXS2wT.js → store-B3ZHoBJY.js} +4 -4
- package/dist/{store-B94tSate.js → store-BLi19UDE.js} +1 -1
- package/dist/{task-CgOKgkEG.js → task-b2BK481M.js} +1 -1
- package/dist/{test-NEbhlxvo.js → test-BrSrhop9.js} +1 -1
- package/dist/{tools-D0Zfs8Hx.js → tools-CgswhJzh.js} +1 -1
- package/dist/{types-Dve7Z0ZP.d.ts → types-I5Cwtl_K.d.ts} +2 -2
- package/dist/{unalias-C9NqmSDq.js → unalias-mMHXqok7.js} +1 -1
- package/dist/{update-BTxYQj7Z.js → update-DbOWToPy.js} +1 -1
- package/dist/{upgrade-hA0yWBvx.js → upgrade-D6oC9HQI.js} +2 -2
- package/dist/{usage-BhqoCjvE.js → usage-Cb8Dtv9V.js} +1 -1
- package/dist/{usage-C4d9X2Uq.js → usage-DMs-IIJC.js} +1 -1
- package/dist/{watch-DtRuC0Wc.js → watch-BcMQXGYO.js} +1 -1
- package/dist/{watch-CSdj24ct.js → watch-eE2XiwsC.js} +1 -1
- package/dist/{worker-DX7P9kWl.js → worker-DrucI22w.js} +1 -1
- package/dist/{workflow-Dcmdooi8.js → workflow-Cshghoas.js} +1 -1
- package/docs/cli.md +145 -0
- package/package.json +3 -2
- package/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
- package/src/core/defaults.ts +25 -0
- package/src/server/dash/app/dash/layout.css +58 -1
- package/src/server/dash/app/dash/layout.tsx +16 -4
- package/src/server/dash/app/dash/settings/[tab]/page.tsx +1 -1
- package/src/server/dash/comps/nav/side-toggle.tsx +1 -1
- package/src/server/dash/comps/ui/menu.tsx +5 -1
- package/src/server/dash/comps/ui/toast.css +3 -2
- package/dist/auth-DWHIzqbA.js +0 -1
- package/dist/credentials-B1jv6dkg.js +0 -1
- package/dist/dash/public/assets/chunks/composer-e56860d72742379e.js +0 -1
- package/dist/dash/public/assets/chunks/instructions-b00959bd4bb70502.js +0 -1
- package/dist/dash/public/assets/chunks/shared-init-986901c810947c12.js +0 -5
- package/dist/dash/public/assets/chunks/shared-init-baceed9fd2d43661.js +0 -2
- package/dist/dash/public/assets/dash-9e02d5d1a6d42ee3.css +0 -1
- package/dist/dash/public/assets/dash-account-04859899c1838ada.css +0 -1
- package/dist/dash/public/assets/dash-agents-9e678137267dec07.css +0 -1
- package/dist/dash/public/assets/dash-agents-new-26fa27b17ef9b8d8.css +0 -1
- package/dist/dash/public/assets/dash-agents-param-slug-b975c48f8abf3444.css +0 -1
- package/dist/dash/public/assets/dash-agents-param-slug-edit-e13fda599bb04843.css +0 -1
- package/dist/dash/public/assets/dash-agents-param-slug-platforms-70292932cb27bc96.css +0 -1
- package/dist/dash/public/assets/dash-agents-param-slug-settings-71f9a86251723fcc.css +0 -1
- package/dist/dash/public/assets/dash-agents-param-slug-tasks-fb8eb2ed71006601.css +0 -1
- package/dist/dash/public/assets/dash-agents-param-slug-usage-7c8740f1cdd52c71.css +0 -1
- package/dist/dash/public/assets/dash-settings-8eb818da462227e8.css +0 -1
- package/dist/dash/public/assets/dash-settings-param-tab-849a1a9542e273f5.css +0 -1
- package/dist/dash/public/assets/dash-tasks-81e510e0b6931b42.css +0 -1
- package/dist/dash/public/assets/dash-tasks-param-id-bbd2a83342f2ec10.css +0 -1
- package/dist/dash/public/assets/dash-usage-8e0259e03eaed1bd.css +0 -1
- package/dist/dash/public/assets/pnext-client-073464b8f422ef57.js +0 -1
- package/dist/dash/public/assets/pnext-client-1e9cb2f4f6387a87.js +0 -1
- package/dist/dash/public/assets/pnext-client-2f0e78dd006fed0f.js +0 -1
- package/dist/dash/public/assets/pnext-client-3c62e2aa2cbe9fe1.js +0 -1
- package/dist/dash/public/assets/pnext-client-43a88896ed42dd39.js +0 -1
- package/dist/dash/public/assets/pnext-client-587008fa987d3073.js +0 -1
- package/dist/dash/public/assets/pnext-client-676360cc86f31573.js +0 -1
- package/dist/dash/public/assets/pnext-client-813427605f424145.js +0 -1
- package/dist/dash/public/assets/pnext-client-82de7cf6dfc35b98.js +0 -1
- package/dist/dash/public/assets/pnext-client-831e8004c09f0b5b.js +0 -1
- package/dist/dash/public/assets/pnext-client-9b557fe468a45ca3.js +0 -1
- package/dist/dash/public/assets/pnext-client-ab7c900c802fe827.js +0 -1
- package/dist/dash/public/assets/pnext-client-d87d00e402811f0c.js +0 -1
- package/dist/dash/public/assets/pnext-client-fbdb7c1da7eda7e5.js +0 -1
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/boot-B2MFTRO2.js +0 -28
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/build-tier-XJJSL5FR.js +0 -2702
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-2HFY3DQT.js +0 -206
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-2ICEVELW.js +0 -832
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-3UPROT2C.js +0 -33
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-4P5CMIYT.js +0 -1580
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-4TKZKZ3Q.js +0 -129
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-5RDEILQB.js +0 -435
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-62KEQM43.js +0 -23
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-6KQSWT6D.js +0 -829
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-7DCNCW6O.js +0 -722
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-B4THCTQP.js +0 -20
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-C2LIV2MM.js +0 -170
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-CCATPVTW.js +0 -376
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-COXJAPTU.js +0 -87
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-E6IXL2NJ.js +0 -6268
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-FLGRBFAH.js +0 -1196
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-FTJVHFWD.js +0 -59
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-H523KSIH.js +0 -5149
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-HT6KKX6A.js +0 -18
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-JESFYECC.js +0 -436
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-JRPJM2XY.js +0 -15
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-L2IWDUXG.js +0 -105
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-L5P4Y4UC.js +0 -181
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-NQE46AZN.js +0 -645
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-PA4QEARJ.js +0 -127
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-PZ5AXOLW.js +0 -7144
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-SNVPTULL.js +0 -2395
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-T3QZT3PG.js +0 -218
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-VC5O2SDP.js +0 -70
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-WZX4V6CM.js +0 -229
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-XUUIDXY5.js +0 -625
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-ZHFDO3PR.js +0 -263
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/compile-CE2DN7ZA.js +0 -16
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/config-UREY7XJT.js +0 -14
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/config-loader-UI2XE3PZ.js +0 -15
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/entry.js +0 -217
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/generate-I2PPTDFD.js +0 -14
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/modules-UVOCE4C2.js +0 -46
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/pipeline-UW47K537.js +0 -961
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/proxy-ITGOVJBW.js +0 -24
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/register-4SA55SWT.js +0 -12577
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/router-JNKHLBCZ.js +0 -503
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/routes-PD6J2NXW.js +0 -52
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/tsconfig-defaults-ZXEH7RQK.js +0 -13
- package/dist/integrations-5xCaXSd-.js +0 -1
- package/dist/refresh-BIrmrWYq.js +0 -1
- package/dist/runner-D7ScbIHJ.js +0 -1
- package/src/server/dash/app/dash/token-from-hash.tsx +0 -17
|
@@ -1,961 +0,0 @@
|
|
|
1
|
-
import { createRequire as __pnextCreateRequire } from "node:module";
|
|
2
|
-
const require = __pnextCreateRequire("file:///Users/muzam/Code/workshop/coder-workspace/node_modules/.bun/@wular+pnext@0.1.5+62547eec5a2188e3/node_modules/@wular/pnext/package.json");
|
|
3
|
-
import {
|
|
4
|
-
handleRouteModule,
|
|
5
|
-
routeParamsFromPath
|
|
6
|
-
} from "./chunk-C2LIV2MM.js";
|
|
7
|
-
import {
|
|
8
|
-
isPprShellUpgradeEligible,
|
|
9
|
-
metadataRouteHandlerModule,
|
|
10
|
-
renderGlobalNotFoundResponse,
|
|
11
|
-
renderPageResponse,
|
|
12
|
-
renderPageWithStatus,
|
|
13
|
-
runWithCacheScope
|
|
14
|
-
} from "./chunk-PZ5AXOLW.js";
|
|
15
|
-
import {
|
|
16
|
-
setRequestRuntime
|
|
17
|
-
} from "./chunk-VC5O2SDP.js";
|
|
18
|
-
import {
|
|
19
|
-
abortUpstreamFetchOnDisconnect,
|
|
20
|
-
bootstrapCompat
|
|
21
|
-
} from "./chunk-COXJAPTU.js";
|
|
22
|
-
import {
|
|
23
|
-
markErrorLogged
|
|
24
|
-
} from "./chunk-62KEQM43.js";
|
|
25
|
-
import {
|
|
26
|
-
normalizePathname,
|
|
27
|
-
parseNavState,
|
|
28
|
-
publishEmittedAssets,
|
|
29
|
-
selectRouteForRequest
|
|
30
|
-
} from "./chunk-SNVPTULL.js";
|
|
31
|
-
import {
|
|
32
|
-
applyProxyResponse,
|
|
33
|
-
createProxyRunner
|
|
34
|
-
} from "./chunk-7DCNCW6O.js";
|
|
35
|
-
import {
|
|
36
|
-
canonicalTrailingSlashPath,
|
|
37
|
-
importModuleOnce,
|
|
38
|
-
malformedUrlResponse,
|
|
39
|
-
registerServerRuntime,
|
|
40
|
-
serverBundleTargetForRuntime,
|
|
41
|
-
trailingSlashRedirect
|
|
42
|
-
} from "./chunk-E6IXL2NJ.js";
|
|
43
|
-
import "./chunk-L2IWDUXG.js";
|
|
44
|
-
import {
|
|
45
|
-
flushWorkUnit,
|
|
46
|
-
flushWorkUnitOnClose,
|
|
47
|
-
getWorkUnit,
|
|
48
|
-
loadConfig,
|
|
49
|
-
pathToFileHref,
|
|
50
|
-
runWithWorkUnit,
|
|
51
|
-
setPhase,
|
|
52
|
-
setWorkUnitRoute
|
|
53
|
-
} from "./chunk-JESFYECC.js";
|
|
54
|
-
import "./chunk-5RDEILQB.js";
|
|
55
|
-
import "./chunk-JRPJM2XY.js";
|
|
56
|
-
import {
|
|
57
|
-
getRenderSpanExtensions
|
|
58
|
-
} from "./chunk-CCATPVTW.js";
|
|
59
|
-
import "./chunk-HT6KKX6A.js";
|
|
60
|
-
import "./chunk-NQE46AZN.js";
|
|
61
|
-
import {
|
|
62
|
-
resolveManifest
|
|
63
|
-
} from "./chunk-2HFY3DQT.js";
|
|
64
|
-
import {
|
|
65
|
-
finalizeResponse,
|
|
66
|
-
getAssetExtensions,
|
|
67
|
-
getProxyExtensions,
|
|
68
|
-
getRenderExtensions,
|
|
69
|
-
getRequestExtensions,
|
|
70
|
-
reportRequestError,
|
|
71
|
-
runInitHooks,
|
|
72
|
-
setRequestExtensions,
|
|
73
|
-
withRouteRuntime
|
|
74
|
-
} from "./chunk-4P5CMIYT.js";
|
|
75
|
-
import {
|
|
76
|
-
stopEsbuildService
|
|
77
|
-
} from "./chunk-FTJVHFWD.js";
|
|
78
|
-
import "./chunk-3UPROT2C.js";
|
|
79
|
-
|
|
80
|
-
// ../node_modules/.bun/@wular+pnext@0.1.5+62547eec5a2188e3/node_modules/@wular/pnext/src/cli/serve/pipeline.ts
|
|
81
|
-
import { existsSync } from "node:fs";
|
|
82
|
-
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
83
|
-
import { stat } from "node:fs/promises";
|
|
84
|
-
import path2 from "node:path";
|
|
85
|
-
import { constants as zlibConstants, createGzip, gzipSync } from "node:zlib";
|
|
86
|
-
import { Readable } from "node:stream";
|
|
87
|
-
|
|
88
|
-
// ../node_modules/.bun/@wular+pnext@0.1.5+62547eec5a2188e3/node_modules/@wular/pnext/src/routing/forwarded.ts
|
|
89
|
-
var FORWARDED_HOST = "x-forwarded-host";
|
|
90
|
-
var FORWARDED_PORT = "x-forwarded-port";
|
|
91
|
-
var FORWARDED_PROTO = "x-forwarded-proto";
|
|
92
|
-
var FORWARDED_FOR = "x-forwarded-for";
|
|
93
|
-
function withForwardedHeaders(request, peer) {
|
|
94
|
-
const headers = request.headers;
|
|
95
|
-
const hasHost = headers.has(FORWARDED_HOST);
|
|
96
|
-
const hasPort = headers.has(FORWARDED_PORT);
|
|
97
|
-
const hasProto = headers.has(FORWARDED_PROTO);
|
|
98
|
-
const hasFor = headers.has(FORWARDED_FOR);
|
|
99
|
-
if (hasHost && hasPort && hasProto && (hasFor || !peer)) return request;
|
|
100
|
-
let url;
|
|
101
|
-
try {
|
|
102
|
-
url = new URL(request.url);
|
|
103
|
-
} catch {
|
|
104
|
-
return request;
|
|
105
|
-
}
|
|
106
|
-
const host = headers.get("host") ?? url.host;
|
|
107
|
-
const proto = url.protocol.replace(":", "");
|
|
108
|
-
const port = url.port;
|
|
109
|
-
const next = new Headers(headers);
|
|
110
|
-
if (!hasHost) next.set(FORWARDED_HOST, host);
|
|
111
|
-
if (!hasPort) next.set(FORWARDED_PORT, port);
|
|
112
|
-
if (!hasProto) next.set(FORWARDED_PROTO, proto);
|
|
113
|
-
if (!hasFor && peer) {
|
|
114
|
-
const address = peer.requestIP(request)?.address;
|
|
115
|
-
if (address) next.set(FORWARDED_FOR, address);
|
|
116
|
-
}
|
|
117
|
-
return new Request(request, { headers: next });
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
// ../node_modules/.bun/@wular+pnext@0.1.5+62547eec5a2188e3/node_modules/@wular/pnext/src/utils/content-type.ts
|
|
121
|
-
import path from "node:path";
|
|
122
|
-
var contentTypes = {
|
|
123
|
-
".avif": "image/avif",
|
|
124
|
-
".bmp": "image/bmp",
|
|
125
|
-
".css": "text/css; charset=utf-8",
|
|
126
|
-
".eot": "application/vnd.ms-fontobject",
|
|
127
|
-
".gif": "image/gif",
|
|
128
|
-
".htm": "text/html; charset=utf-8",
|
|
129
|
-
".html": "text/html; charset=utf-8",
|
|
130
|
-
".ico": "image/x-icon",
|
|
131
|
-
".jpeg": "image/jpeg",
|
|
132
|
-
".jpg": "image/jpeg",
|
|
133
|
-
".js": "text/javascript; charset=utf-8",
|
|
134
|
-
".json": "application/json; charset=utf-8",
|
|
135
|
-
".mjs": "text/javascript; charset=utf-8",
|
|
136
|
-
".otf": "font/otf",
|
|
137
|
-
".png": "image/png",
|
|
138
|
-
".svg": "image/svg+xml",
|
|
139
|
-
".tif": "image/tiff",
|
|
140
|
-
".tiff": "image/tiff",
|
|
141
|
-
".ttf": "font/ttf",
|
|
142
|
-
".wasm": "application/wasm",
|
|
143
|
-
".webp": "image/webp",
|
|
144
|
-
".woff": "font/woff",
|
|
145
|
-
".woff2": "font/woff2"
|
|
146
|
-
};
|
|
147
|
-
function contentType(file) {
|
|
148
|
-
return contentTypes[path.extname(file).toLowerCase()] ?? "application/octet-stream";
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
// ../node_modules/.bun/@wular+pnext@0.1.5+62547eec5a2188e3/node_modules/@wular/pnext/src/cli/serve/pipeline.ts
|
|
152
|
-
async function moduleHrefForRoute(config, route) {
|
|
153
|
-
const { devServerModuleHref } = await import("./modules-UVOCE4C2.js");
|
|
154
|
-
return devServerModuleHref(config, route.file, "build", {
|
|
155
|
-
conditionTarget: serverBundleTargetForRuntime(route.segmentConfig?.runtime)
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
async function createRequestHandler(options = {}) {
|
|
159
|
-
const config = options.config ?? await loadConfig(options.root, { serve: true });
|
|
160
|
-
await bootstrapCompat(config);
|
|
161
|
-
const manifestPath = path2.join(config.outPath, "manifest.json");
|
|
162
|
-
const manifest = resolveManifest(
|
|
163
|
-
options.manifest ?? JSON.parse(await readFile(manifestPath, "utf8")),
|
|
164
|
-
config.outPath,
|
|
165
|
-
config.root
|
|
166
|
-
);
|
|
167
|
-
const persistManifest = async () => {
|
|
168
|
-
const stored = JSON.parse(await readFile(manifestPath, "utf8"));
|
|
169
|
-
stored.staticFiles = manifest.staticFiles;
|
|
170
|
-
await writeFile(manifestPath, `${JSON.stringify(stored, null, 2)}
|
|
171
|
-
`);
|
|
172
|
-
};
|
|
173
|
-
runInitHooks(config);
|
|
174
|
-
publishEmittedAssets(config.outPath, manifest.assetNames);
|
|
175
|
-
setRequestRuntime({ config, routes: manifest.routes, dev: false });
|
|
176
|
-
const proxyRunner = createProxyRunner(config, {
|
|
177
|
-
compiledModuleHref: manifest.proxyModule ? pathToFileHref(path2.resolve(config.outPath, manifest.proxyModule)) : void 0
|
|
178
|
-
});
|
|
179
|
-
const routesById = new Map(manifest.routes.map((route) => [route.id, route]));
|
|
180
|
-
const nextCompat = Boolean(config.compat?.next);
|
|
181
|
-
const regenerating = /* @__PURE__ */ new Map();
|
|
182
|
-
async function regenerateStaticFile(pathname, file, relative, metadata, reason) {
|
|
183
|
-
if (!metadata.routeId) return;
|
|
184
|
-
const route = routesById.get(metadata.routeId);
|
|
185
|
-
if (!route) return;
|
|
186
|
-
await runWithWorkUnit("render", async () => {
|
|
187
|
-
const url = new URL(`http://pnext.local${pathname}`);
|
|
188
|
-
const params = routeParamsFromPath(route, pathname);
|
|
189
|
-
const fetchCache = route.segmentConfig?.fetchCache;
|
|
190
|
-
try {
|
|
191
|
-
if (route.kind === "handler") {
|
|
192
|
-
setWorkUnitRoute("route-handler", "isr", { revalidateReason: reason });
|
|
193
|
-
setPhase("handler");
|
|
194
|
-
registerServerRuntime(config, route.sourceFiles);
|
|
195
|
-
const href = compatModuleMode(config) ? await moduleHrefForRoute(config, route) : pathToFileHref(route.file);
|
|
196
|
-
const module = await importModuleOnce(href);
|
|
197
|
-
const rendered = await getRenderExtensions().collectRenderMeta(
|
|
198
|
-
() => withRouteRuntime(
|
|
199
|
-
route.segmentConfig?.runtime,
|
|
200
|
-
() => runWithCacheScope(
|
|
201
|
-
() => handleRouteModule(module, new Request(url), params, { routeFile: route.file })
|
|
202
|
-
)
|
|
203
|
-
),
|
|
204
|
-
{ fetchCache, blockingStaleFetches: true, route: pathname, handler: true }
|
|
205
|
-
);
|
|
206
|
-
if (rendered.value.status >= 500) return;
|
|
207
|
-
await writeFile(file, new Uint8Array(await rendered.value.arrayBuffer()));
|
|
208
|
-
manifest.staticFiles[relative] = {
|
|
209
|
-
...metadata,
|
|
210
|
-
status: rendered.value.status,
|
|
211
|
-
headers: [...rendered.value.headers.entries()],
|
|
212
|
-
...rendered.tags.length > 0 ? { tags: rendered.tags } : {}
|
|
213
|
-
};
|
|
214
|
-
} else {
|
|
215
|
-
setWorkUnitRoute("html", "isr", { revalidateReason: reason });
|
|
216
|
-
setPhase("render");
|
|
217
|
-
const rendered = await getRenderExtensions().collectRenderMeta(
|
|
218
|
-
() => withRouteRuntime(
|
|
219
|
-
route.segmentConfig?.runtime,
|
|
220
|
-
() => renderPageWithStatus({
|
|
221
|
-
config,
|
|
222
|
-
route,
|
|
223
|
-
params,
|
|
224
|
-
url,
|
|
225
|
-
...route.usesRequest ? { request: new Request(url) } : {},
|
|
226
|
-
staticMetadataFiles: manifest.staticMetadataFiles,
|
|
227
|
-
staticModuleMetadata: manifest.staticModuleMetadata,
|
|
228
|
-
staticRouteMetadata: manifest.staticRouteMetadata
|
|
229
|
-
})
|
|
230
|
-
),
|
|
231
|
-
{ fetchCache, blockingStaleFetches: true, route: pathname }
|
|
232
|
-
);
|
|
233
|
-
if (rendered.value.status >= 500) return;
|
|
234
|
-
await writeFile(file, rendered.value.html);
|
|
235
|
-
manifest.staticFiles[relative] = {
|
|
236
|
-
...metadata,
|
|
237
|
-
status: rendered.value.status,
|
|
238
|
-
...rendered.tags.length > 0 ? { tags: rendered.tags } : {}
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
} catch (error) {
|
|
242
|
-
const unit = getWorkUnit();
|
|
243
|
-
await reportRequestError(
|
|
244
|
-
error,
|
|
245
|
-
{ method: "GET", url: url.href, headers: new Headers() },
|
|
246
|
-
{
|
|
247
|
-
phase: unit?.phase,
|
|
248
|
-
routeKind: unit?.routeKind,
|
|
249
|
-
...unit?.responseHints ?? {}
|
|
250
|
-
}
|
|
251
|
-
);
|
|
252
|
-
throw error;
|
|
253
|
-
}
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
function runRegeneration(pathname, file, relative, metadata, reason) {
|
|
257
|
-
const existing = regenerating.get(file);
|
|
258
|
-
if (existing) return existing;
|
|
259
|
-
const task = regenerateStaticFile(pathname, file, relative, metadata, reason).catch((error) => {
|
|
260
|
-
console.warn(`pnext start: background revalidate failed for ${pathname}:`, error);
|
|
261
|
-
}).finally(() => {
|
|
262
|
-
regenerating.delete(file);
|
|
263
|
-
});
|
|
264
|
-
regenerating.set(file, task);
|
|
265
|
-
return task;
|
|
266
|
-
}
|
|
267
|
-
function scheduleRegen(pathname, file, relative, metadata) {
|
|
268
|
-
void runRegeneration(pathname, file, relative, metadata, "stale");
|
|
269
|
-
}
|
|
270
|
-
setRequestExtensions({
|
|
271
|
-
onDemandRevalidatePath: async (pathname) => {
|
|
272
|
-
const built = await builtFileInfo(config.outPath, pathname, manifest.staticFiles);
|
|
273
|
-
if (!built?.metadata) return;
|
|
274
|
-
await runRegeneration(pathname, built.file, built.relative, built.metadata, "on-demand");
|
|
275
|
-
}
|
|
276
|
-
});
|
|
277
|
-
async function renderNotFound(request) {
|
|
278
|
-
const built = await maybeBuiltFile(
|
|
279
|
-
config.outPath,
|
|
280
|
-
"/404",
|
|
281
|
-
manifest.staticFiles,
|
|
282
|
-
request.method,
|
|
283
|
-
request.headers,
|
|
284
|
-
nextCompat
|
|
285
|
-
);
|
|
286
|
-
if (built) {
|
|
287
|
-
setWorkUnitRoute("html", "static");
|
|
288
|
-
const headers = new Headers(built.headers);
|
|
289
|
-
headers.set("x-nextjs-cache", "HIT");
|
|
290
|
-
if (!hasBuildCapturedCacheControl(manifest.staticFiles?.["404.html"])) {
|
|
291
|
-
headers.delete("cache-control");
|
|
292
|
-
}
|
|
293
|
-
headers.delete("content-length");
|
|
294
|
-
return compressResponse(new Response(built.body, { status: 404, headers }), request);
|
|
295
|
-
}
|
|
296
|
-
return compressResponse(
|
|
297
|
-
await renderGlobalNotFoundResponse({
|
|
298
|
-
config,
|
|
299
|
-
url: new URL(request.url),
|
|
300
|
-
request,
|
|
301
|
-
staticMetadataFiles: manifest.staticMetadataFiles,
|
|
302
|
-
staticModuleMetadata: manifest.staticModuleMetadata,
|
|
303
|
-
staticRouteMetadata: manifest.staticRouteMetadata
|
|
304
|
-
}),
|
|
305
|
-
request
|
|
306
|
-
);
|
|
307
|
-
}
|
|
308
|
-
stopEsbuildService();
|
|
309
|
-
return function handleRequest(request, server) {
|
|
310
|
-
return runWithWorkUnit("render", async () => {
|
|
311
|
-
const unit = getWorkUnit();
|
|
312
|
-
try {
|
|
313
|
-
const raw = await handle(request, server);
|
|
314
|
-
const finalized = await finalizeResponse(
|
|
315
|
-
raw,
|
|
316
|
-
{ method: request.method, url: new URL(request.url), headers: request.headers },
|
|
317
|
-
{
|
|
318
|
-
routeKind: unit?.routeKind ?? "html",
|
|
319
|
-
routeMode: unit?.routeMode,
|
|
320
|
-
hints: unit?.responseHints
|
|
321
|
-
}
|
|
322
|
-
);
|
|
323
|
-
const response = maybeCloseNodeFetchConnection(finalized, request);
|
|
324
|
-
abortUpstreamFetchOnDisconnect(response.body, request.signal);
|
|
325
|
-
return flushWorkUnitOnClose(response, unit, request.signal);
|
|
326
|
-
} catch (error) {
|
|
327
|
-
await reportRequestError(
|
|
328
|
-
error,
|
|
329
|
-
{ method: request.method, url: request.url, headers: request.headers },
|
|
330
|
-
{ phase: unit?.phase, routeKind: unit?.routeKind }
|
|
331
|
-
);
|
|
332
|
-
if (markErrorLogged(error)) {
|
|
333
|
-
console.error(`pnext start: request failed for ${request.url}:`, error);
|
|
334
|
-
}
|
|
335
|
-
flushWorkUnit(unit);
|
|
336
|
-
return new Response("Internal Server Error", { status: 500 });
|
|
337
|
-
}
|
|
338
|
-
});
|
|
339
|
-
};
|
|
340
|
-
async function handle(request, server) {
|
|
341
|
-
const badRequest = malformedUrlResponse(request);
|
|
342
|
-
if (badRequest) return badRequest;
|
|
343
|
-
request = withForwardedHeaders(request, server);
|
|
344
|
-
const requestedUrl = new URL(request.url);
|
|
345
|
-
const assetStripped = stripAssetPrefix(request, config.assetPrefix);
|
|
346
|
-
if (assetStripped) request = assetStripped;
|
|
347
|
-
if (config.basePath && !assetStripped) {
|
|
348
|
-
const stripped = stripBasePath(request, config.basePath);
|
|
349
|
-
if (!stripped) {
|
|
350
|
-
const answered = await runOutsideBasePathInterceptors(request, config);
|
|
351
|
-
if (answered instanceof Response) return answered;
|
|
352
|
-
const rewritten2 = answered && stripBasePath(answered.request, config.basePath);
|
|
353
|
-
if (!rewritten2) return await renderNotFound(request);
|
|
354
|
-
request = rewritten2;
|
|
355
|
-
} else {
|
|
356
|
-
request = stripped;
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
const skipProxyNormalize = getProxyExtensions().skipUrlNormalize();
|
|
360
|
-
if (nextCompat && !skipProxyNormalize) {
|
|
361
|
-
request = normalizeDataRequest(request, config) ?? request;
|
|
362
|
-
}
|
|
363
|
-
const bypassToken = getRequestExtensions().revalidateBypassToken();
|
|
364
|
-
const revalidateBypass = Boolean(
|
|
365
|
-
bypassToken && request.headers.get("x-prerender-revalidate") === bypassToken
|
|
366
|
-
);
|
|
367
|
-
const canonicalUrl = new URL(request.url);
|
|
368
|
-
const canonicalHeaders = request.headers;
|
|
369
|
-
let proxyResponse;
|
|
370
|
-
const proxyResult = revalidateBypass ? void 0 : await proxyRunner(request);
|
|
371
|
-
if (proxyResult instanceof Response) return proxyResult;
|
|
372
|
-
if (proxyResult) {
|
|
373
|
-
request = proxyResult.request;
|
|
374
|
-
proxyResponse = proxyResult.response;
|
|
375
|
-
}
|
|
376
|
-
if (nextCompat && skipProxyNormalize) {
|
|
377
|
-
request = normalizeDataRequest(request, config) ?? request;
|
|
378
|
-
}
|
|
379
|
-
for (const interceptor of getRequestExtensions().interceptors) {
|
|
380
|
-
const result = await interceptor(request, { config });
|
|
381
|
-
if (result instanceof Response)
|
|
382
|
-
return applyProxyResponse(compressResponse(result, request), proxyResponse);
|
|
383
|
-
if (result) request = result.request;
|
|
384
|
-
}
|
|
385
|
-
let url = new URL(request.url);
|
|
386
|
-
const rewritten = url.href !== canonicalUrl.href;
|
|
387
|
-
const canonicalRequestUrl = new URL(canonicalUrl);
|
|
388
|
-
canonicalRequestUrl.search = url.search;
|
|
389
|
-
const canonicalRequest = canonicalRequestUrl.href === request.url ? request : new Request(canonicalRequestUrl, { headers: canonicalHeaders });
|
|
390
|
-
const method = request.method.toUpperCase();
|
|
391
|
-
const canonicalRedirect = trailingSlashRedirect(config, requestedUrl, method);
|
|
392
|
-
if (canonicalRedirect) return applyProxyResponse(canonicalRedirect, proxyResponse);
|
|
393
|
-
const nav = parseNavState(request);
|
|
394
|
-
const selection = selectRouteForRequest(manifest.routes, url.pathname, nav);
|
|
395
|
-
const softDynamic = Boolean(
|
|
396
|
-
nav && selection?.route.kind === "page" && (selection.route.slotDirs?.length || selection.route.synthetic || selection.route.interception || selection.childrenPath !== normalizePathname(url.pathname))
|
|
397
|
-
);
|
|
398
|
-
const pprDocumentResume = selection?.route.kind === "page" && selection.route.ppr;
|
|
399
|
-
const draftBypass = hasDraftBypassCookie(request.headers);
|
|
400
|
-
const built = method === "GET" || method === "HEAD" ? await builtFileInfo(config.outPath, url.pathname, manifest.staticFiles, nextCompat) : null;
|
|
401
|
-
const hardStaticStale = built !== null && // Content-hashed build assets are immutable and are never route outputs, so a
|
|
402
|
-
// revalidatePath/revalidateTag must not mark them stale. Without this,
|
|
403
|
-
// revalidatePath('/', 'layout') - whose pattern matches EVERY path - would flag the client entry
|
|
404
|
-
// script as stale, drop it from static serving, and leave the browser without the router
|
|
405
|
-
// runtime, silently downgrading every soft navigation to a hard one.
|
|
406
|
-
!isImmutableAssetFile(built.relative) && getRequestExtensions().staticStaleness(
|
|
407
|
-
url.pathname,
|
|
408
|
-
built.mtimeMs,
|
|
409
|
-
built.metadata?.tags ?? []
|
|
410
|
-
);
|
|
411
|
-
const staleReason = built ? getRequestExtensions().staticStalenessReason(
|
|
412
|
-
url.pathname,
|
|
413
|
-
built.mtimeMs,
|
|
414
|
-
built.metadata?.tags ?? []
|
|
415
|
-
) ?? "on-demand" : void 0;
|
|
416
|
-
const softStale = staleReason === "soft";
|
|
417
|
-
const staleOnDemand = hardStaticStale && !softStale;
|
|
418
|
-
const hardExpired = built?.metadata?.expireSeconds !== void 0 && isHtmlPageFile(built.file) && Date.now() - built.mtimeMs >= built.metadata.expireSeconds * 1e3;
|
|
419
|
-
const builtIsPageHtml = built !== null && isHtmlPageFile(built.file);
|
|
420
|
-
if (built && !staleOnDemand && !(softDynamic && builtIsPageHtml) && !(pprDocumentResume && builtIsPageHtml) && !hardExpired && !revalidateBypass) {
|
|
421
|
-
const servedBuilt = built;
|
|
422
|
-
const metadata = built.metadata;
|
|
423
|
-
const route = metadata?.routeId ? routesById.get(metadata.routeId) : void 0;
|
|
424
|
-
if (route?.segmentConfig?.runtime === "edge" || route?.segmentConfig?.runtime === "experimental-edge") {
|
|
425
|
-
withRouteRuntime(route.segmentConfig.runtime, () => void 0);
|
|
426
|
-
}
|
|
427
|
-
const staticFile = await maybeBuiltFile(
|
|
428
|
-
config.outPath,
|
|
429
|
-
url.pathname,
|
|
430
|
-
manifest.staticFiles,
|
|
431
|
-
request.method,
|
|
432
|
-
request.headers,
|
|
433
|
-
nextCompat
|
|
434
|
-
);
|
|
435
|
-
if (staticFile && !(draftBypass && isHtmlResponse(staticFile))) {
|
|
436
|
-
const staticMode = servedBuilt.metadata?.revalidateSeconds !== void 0 ? "isr" : "static";
|
|
437
|
-
setWorkUnitRoute(
|
|
438
|
-
isHtmlResponse(staticFile) ? "html" : "static-asset",
|
|
439
|
-
staticMode,
|
|
440
|
-
servedBuilt.metadata?.revalidateSeconds !== void 0 ? { revalidateSeconds: servedBuilt.metadata.revalidateSeconds } : void 0
|
|
441
|
-
);
|
|
442
|
-
if (isHtmlResponse(staticFile) && !hasBuildCapturedCacheControl(servedBuilt.metadata)) {
|
|
443
|
-
staticFile.headers.delete("cache-control");
|
|
444
|
-
}
|
|
445
|
-
if (servedBuilt.metadata) {
|
|
446
|
-
const servedTtl = servedBuilt.metadata.revalidateSeconds;
|
|
447
|
-
const expired = softStale || servedTtl !== void 0 && Date.now() - servedBuilt.mtimeMs >= servedTtl * 1e3;
|
|
448
|
-
if (expired) {
|
|
449
|
-
scheduleRegen(
|
|
450
|
-
url.pathname,
|
|
451
|
-
servedBuilt.file,
|
|
452
|
-
servedBuilt.relative,
|
|
453
|
-
servedBuilt.metadata
|
|
454
|
-
);
|
|
455
|
-
staticFile.headers.set("x-nextjs-cache", "STALE");
|
|
456
|
-
} else {
|
|
457
|
-
staticFile.headers.set("x-nextjs-cache", "HIT");
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
return applyProxyResponse(compressResponse(staticFile, request), proxyResponse);
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
if (url.pathname.startsWith("/_next/static/") && !built) {
|
|
464
|
-
setWorkUnitRoute("static-asset");
|
|
465
|
-
return applyProxyResponse(
|
|
466
|
-
new Response("Not Found", {
|
|
467
|
-
status: 404,
|
|
468
|
-
headers: {
|
|
469
|
-
"cache-control": "private, no-cache, no-store, max-age=0, must-revalidate",
|
|
470
|
-
"content-type": "text/plain;charset=utf-8"
|
|
471
|
-
}
|
|
472
|
-
}),
|
|
473
|
-
proxyResponse
|
|
474
|
-
);
|
|
475
|
-
}
|
|
476
|
-
const stalePage = built && (staleOnDemand || hardExpired) && isHtmlPageFile(built.file) ? built.file : null;
|
|
477
|
-
const matched = selection;
|
|
478
|
-
if (!matched) {
|
|
479
|
-
return applyProxyResponse(await renderNotFound(canonicalRequest), proxyResponse);
|
|
480
|
-
}
|
|
481
|
-
if (matched.route.kind === "handler") {
|
|
482
|
-
setWorkUnitRoute(
|
|
483
|
-
"route-handler",
|
|
484
|
-
staleOnDemand ? "isr" : routeModeOf(matched.route),
|
|
485
|
-
responseHintsFor(matched.route, staleReason)
|
|
486
|
-
);
|
|
487
|
-
setPhase("handler");
|
|
488
|
-
const renderedHandler = await getRenderExtensions().collectRenderMeta(
|
|
489
|
-
() => handleRoute(config, matched.route, canonicalRequest, matched.params),
|
|
490
|
-
{
|
|
491
|
-
fetchCache: matched.route.segmentConfig?.fetchCache,
|
|
492
|
-
refreshFetches: staleOnDemand,
|
|
493
|
-
route: url.pathname,
|
|
494
|
-
handler: true
|
|
495
|
-
}
|
|
496
|
-
);
|
|
497
|
-
const handlerResponse = renderedHandler.value;
|
|
498
|
-
if (built && staleOnDemand && !stalePage && method === "GET" && handlerResponse.status === 200) {
|
|
499
|
-
try {
|
|
500
|
-
await writeFile(built.file, new Uint8Array(await handlerResponse.clone().arrayBuffer()));
|
|
501
|
-
handlerResponse.headers.set("x-nextjs-cache", "MISS");
|
|
502
|
-
} catch {
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
if (!built && matched.route.hasStaticParams && // force-dynamic / revalidate 0 opt the handler out of static output:
|
|
506
|
-
// every request must re-run it (generateSitemaps + force-dynamic must
|
|
507
|
-
// produce a fresh sitemap per request — dynamic-in-generate-params).
|
|
508
|
-
matched.route.segmentConfig?.dynamic !== "force-dynamic" && matched.route.segmentConfig?.revalidate !== 0 && method === "GET" && handlerResponse.status < 500) {
|
|
509
|
-
const file = lazyStaticHandlerPath(config.outPath, url.pathname);
|
|
510
|
-
try {
|
|
511
|
-
if (!file) throw new Error("unsafe path");
|
|
512
|
-
await mkdir(path2.dirname(file), { recursive: true });
|
|
513
|
-
await writeFile(file, new Uint8Array(await handlerResponse.clone().arrayBuffer()));
|
|
514
|
-
const relative = path2.relative(path2.join(config.outPath, "public"), file).split(path2.sep).join("/");
|
|
515
|
-
const routeRevalidate = matched.route.segmentConfig?.revalidate;
|
|
516
|
-
const revalidateSeconds = typeof routeRevalidate === "number" && routeRevalidate > 0 ? renderedHandler.revalidateSeconds === void 0 ? routeRevalidate : Math.min(routeRevalidate, renderedHandler.revalidateSeconds) : renderedHandler.revalidateSeconds;
|
|
517
|
-
manifest.staticFiles ??= {};
|
|
518
|
-
manifest.staticFiles[relative] = {
|
|
519
|
-
status: handlerResponse.status,
|
|
520
|
-
headers: [...handlerResponse.headers.entries()],
|
|
521
|
-
routeId: matched.route.id,
|
|
522
|
-
...revalidateSeconds !== void 0 ? { revalidateSeconds } : {},
|
|
523
|
-
...renderedHandler.tags.length > 0 ? { tags: renderedHandler.tags } : {}
|
|
524
|
-
};
|
|
525
|
-
await persistManifest();
|
|
526
|
-
handlerResponse.headers.set("x-nextjs-cache", "MISS");
|
|
527
|
-
} catch {
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
return applyProxyResponse(handlerResponse, proxyResponse);
|
|
531
|
-
}
|
|
532
|
-
if (matched.route.segmentConfig?.dynamic === "error" && matched.route.usesRequest) {
|
|
533
|
-
return applyProxyResponse(
|
|
534
|
-
new Response(
|
|
535
|
-
`Page with dynamic = "error" encountered dynamic data method on ${url.pathname}`,
|
|
536
|
-
{ status: 500 }
|
|
537
|
-
),
|
|
538
|
-
proxyResponse
|
|
539
|
-
);
|
|
540
|
-
}
|
|
541
|
-
if (!dynamicParamsAllowed(matched.route, matched.params)) {
|
|
542
|
-
return applyProxyResponse(await renderNotFound(canonicalRequest), proxyResponse);
|
|
543
|
-
}
|
|
544
|
-
const forceStaticRoute = matched.route.segmentConfig?.dynamic === "force-static";
|
|
545
|
-
const renderUrl = forceStaticRoute ? new URL(canonicalUrl.pathname, canonicalUrl.origin) : canonicalRequestUrl;
|
|
546
|
-
const renderRequest = forceStaticRoute ? new Request(renderUrl) : method === "POST" ? new Request(canonicalRequest.url, { headers: canonicalRequest.headers }) : canonicalRequest;
|
|
547
|
-
const pageRevalidateReason = stalePage ? staleReason : hardExpired ? "on-demand" : void 0;
|
|
548
|
-
setWorkUnitRoute(
|
|
549
|
-
"html",
|
|
550
|
-
pageRevalidateReason ? "isr" : routeModeOf(matched.route),
|
|
551
|
-
responseHintsFor(matched.route, pageRevalidateReason)
|
|
552
|
-
);
|
|
553
|
-
const renderMatchedPage = () => withRouteRuntime(
|
|
554
|
-
matched.route.segmentConfig?.runtime,
|
|
555
|
-
() => renderPageResponse({
|
|
556
|
-
config,
|
|
557
|
-
route: matched.route,
|
|
558
|
-
params: matched.params,
|
|
559
|
-
url: renderUrl,
|
|
560
|
-
request: renderRequest,
|
|
561
|
-
staticMetadataFiles: manifest.staticMetadataFiles,
|
|
562
|
-
staticModuleMetadata: manifest.staticModuleMetadata,
|
|
563
|
-
staticRouteMetadata: manifest.staticRouteMetadata,
|
|
564
|
-
...nav || rewritten ? {
|
|
565
|
-
nav: {
|
|
566
|
-
...nav ? { soft: true, state: nav } : {},
|
|
567
|
-
childrenPath: matched.childrenPath,
|
|
568
|
-
targetPath: matched.targetPath
|
|
569
|
-
}
|
|
570
|
-
} : {}
|
|
571
|
-
})
|
|
572
|
-
);
|
|
573
|
-
const renderedPage = await getRenderExtensions().collectRenderMeta(renderMatchedPage, {
|
|
574
|
-
fetchCache: matched.route.segmentConfig?.fetchCache,
|
|
575
|
-
refreshFetches: Boolean(stalePage),
|
|
576
|
-
route: url.pathname
|
|
577
|
-
});
|
|
578
|
-
const renderRevalidateSeconds = renderedPage.revalidateSeconds ?? (typeof matched.route.segmentConfig?.revalidate === "number" ? matched.route.segmentConfig.revalidate : void 0);
|
|
579
|
-
const renderWasDynamic = matched.route.mode === "dynamic" || matched.route.usesRequest || renderedPage.noStore === true;
|
|
580
|
-
if (renderRevalidateSeconds !== void 0 && renderRevalidateSeconds > 0 && !renderWasDynamic) {
|
|
581
|
-
setWorkUnitRoute("html", "isr", {
|
|
582
|
-
...getWorkUnit()?.responseHints ?? {},
|
|
583
|
-
revalidateSeconds: renderRevalidateSeconds
|
|
584
|
-
});
|
|
585
|
-
}
|
|
586
|
-
const pageResponse = renderedPage.value;
|
|
587
|
-
if (matched.route.linkHeader && !pageResponse.headers.has("link")) {
|
|
588
|
-
pageResponse.headers.set("link", matched.route.linkHeader);
|
|
589
|
-
}
|
|
590
|
-
const cacheLifeHeaders = cacheLifeResponseHeaders(matched.route.cacheLife);
|
|
591
|
-
if (cacheLifeHeaders.length > 0 && matched.route.kind === "page") {
|
|
592
|
-
for (const [key, value] of cacheLifeHeaders) {
|
|
593
|
-
if (key === "cache-control" && pageResponse.headers.has("cache-control")) continue;
|
|
594
|
-
pageResponse.headers.set(key, value);
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
const lazyStaticCapable = matched.route.kind === "page" && // A request that can promote a fallback shell into a more specific route
|
|
598
|
-
// shell must keep re-entering the renderer: caching its first (still
|
|
599
|
-
// un-upgraded) render on disk would serve every later request as a HIT
|
|
600
|
-
// and the upgraded shell would never reach the client.
|
|
601
|
-
!isPprShellUpgradeEligible(config, matched.route, url) && (forceStaticRoute || !matched.route.usesRequest && // Next never statically caches `runtime = 'edge'` pages (they are
|
|
602
|
-
// excluded from build prerendering too — see build.ts); their data
|
|
603
|
-
// stability comes from the fetch cache alone.
|
|
604
|
-
matched.route.segmentConfig?.runtime !== "edge" && (matched.route.hasStaticParams || matched.route.mode === "static"));
|
|
605
|
-
if (!stalePage && !built && !nav && !draftBypass && lazyStaticCapable && !renderedPage.noStore && method === "GET" && url.search === "" && pageResponse.status === 200 && (pageResponse.headers.get("content-type") ?? "").includes("text/html")) {
|
|
606
|
-
try {
|
|
607
|
-
const file = lazyStaticHtmlPath(config.outPath, url.pathname);
|
|
608
|
-
if (!file) throw new Error("unsafe path");
|
|
609
|
-
await mkdir(path2.dirname(file), { recursive: true });
|
|
610
|
-
await writeFile(file, await pageResponse.clone().text());
|
|
611
|
-
const relative = path2.relative(path2.join(config.outPath, "public"), file).split(path2.sep).join("/");
|
|
612
|
-
manifest.staticFiles ??= {};
|
|
613
|
-
manifest.staticFiles[relative] = {
|
|
614
|
-
status: 200,
|
|
615
|
-
// Persist the cacheLife SWR headers (and the route's prerendered
|
|
616
|
-
// Link header) so later static HITs (served by maybeBuiltFile
|
|
617
|
-
// straight off disk) re-emit them without a render.
|
|
618
|
-
headers: [
|
|
619
|
-
...matched.route.linkHeader ? [["link", matched.route.linkHeader]] : [],
|
|
620
|
-
...cacheLifeHeaders
|
|
621
|
-
],
|
|
622
|
-
routeId: matched.route.id,
|
|
623
|
-
kind: "page",
|
|
624
|
-
...renderedPage.revalidateSeconds !== void 0 ? { revalidateSeconds: renderedPage.revalidateSeconds } : {},
|
|
625
|
-
...matched.route.cacheLife?.expireSeconds !== void 0 ? { expireSeconds: matched.route.cacheLife.expireSeconds } : {},
|
|
626
|
-
...matched.route.cacheLife?.staleSeconds !== void 0 ? { staleSeconds: matched.route.cacheLife.staleSeconds } : {},
|
|
627
|
-
...renderedPage.tags.length > 0 ? { tags: renderedPage.tags } : {}
|
|
628
|
-
};
|
|
629
|
-
pageResponse.headers.set("x-nextjs-cache", "MISS");
|
|
630
|
-
} catch {
|
|
631
|
-
}
|
|
632
|
-
}
|
|
633
|
-
if (stalePage && !nav && !softDynamic && !draftBypass && method === "GET" && pageResponse.status === 200 && (pageResponse.headers.get("content-type") ?? "").includes("text/html")) {
|
|
634
|
-
try {
|
|
635
|
-
await writeFile(stalePage, await pageResponse.clone().text());
|
|
636
|
-
pageResponse.headers.set("x-nextjs-cache", "MISS");
|
|
637
|
-
} catch {
|
|
638
|
-
}
|
|
639
|
-
}
|
|
640
|
-
if (revalidateBypass) {
|
|
641
|
-
if (built && method === "GET" && pageResponse.status === 200 && (pageResponse.headers.get("content-type") ?? "").includes("text/html")) {
|
|
642
|
-
try {
|
|
643
|
-
await writeFile(built.file, await pageResponse.clone().text());
|
|
644
|
-
} catch {
|
|
645
|
-
}
|
|
646
|
-
}
|
|
647
|
-
pageResponse.headers.set("x-nextjs-cache", "REVALIDATED");
|
|
648
|
-
}
|
|
649
|
-
return applyProxyResponse(compressResponse(pageResponse, request), proxyResponse);
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
function normalizeDataRequest(request, config) {
|
|
653
|
-
const method = request.method.toUpperCase();
|
|
654
|
-
if (method !== "GET" && method !== "HEAD") return null;
|
|
655
|
-
const url = new URL(request.url);
|
|
656
|
-
const match = /^\/_next\/data\/[^/]+(\/.+)\.json$/.exec(url.pathname);
|
|
657
|
-
if (!match) return null;
|
|
658
|
-
const page = match[1] === "/index" ? "/" : match[1];
|
|
659
|
-
url.pathname = canonicalTrailingSlashPath(page, Boolean(config.trailingSlash));
|
|
660
|
-
const headers = new Headers(request.headers);
|
|
661
|
-
headers.set("x-nextjs-data", "1");
|
|
662
|
-
return new Request(url, { method, headers });
|
|
663
|
-
}
|
|
664
|
-
async function runOutsideBasePathInterceptors(request, config) {
|
|
665
|
-
for (const interceptor of getRequestExtensions().outsideBasePathInterceptors) {
|
|
666
|
-
const result = await interceptor(request, { config, outsideBasePath: true });
|
|
667
|
-
if (result) return result;
|
|
668
|
-
}
|
|
669
|
-
return void 0;
|
|
670
|
-
}
|
|
671
|
-
function stripBasePath(request, basePath) {
|
|
672
|
-
const url = new URL(request.url);
|
|
673
|
-
const { pathname } = url;
|
|
674
|
-
if (pathname !== basePath && !pathname.startsWith(`${basePath}/`)) return null;
|
|
675
|
-
url.pathname = pathname.slice(basePath.length) || "/";
|
|
676
|
-
return new Request(url, request);
|
|
677
|
-
}
|
|
678
|
-
function stripAssetPrefix(request, assetPrefix) {
|
|
679
|
-
if (!assetPrefix) return null;
|
|
680
|
-
let prefixValue = assetPrefix;
|
|
681
|
-
if (/^[a-z][a-z0-9+.-]*:\/\//i.test(assetPrefix)) {
|
|
682
|
-
prefixValue = new URL(assetPrefix).pathname;
|
|
683
|
-
}
|
|
684
|
-
const prefix = `/${prefixValue.replace(/^\/+|\/+$/g, "")}`;
|
|
685
|
-
if (prefix === "/") return null;
|
|
686
|
-
const url = new URL(request.url);
|
|
687
|
-
const { pathname } = url;
|
|
688
|
-
if (!pathname.startsWith(`${prefix}/assets/`) && !pathname.startsWith(`${prefix}/_next/static/`)) {
|
|
689
|
-
return null;
|
|
690
|
-
}
|
|
691
|
-
url.pathname = pathname.slice(prefix.length);
|
|
692
|
-
return new Request(url, request);
|
|
693
|
-
}
|
|
694
|
-
function maybeCloseNodeFetchConnection(response, request) {
|
|
695
|
-
const userAgent = request.headers.get("user-agent") ?? "";
|
|
696
|
-
if (!userAgent.includes("node-fetch")) return response;
|
|
697
|
-
response.headers.set("connection", "close");
|
|
698
|
-
return response;
|
|
699
|
-
}
|
|
700
|
-
function compatModuleMode(config) {
|
|
701
|
-
return Boolean(config.compat?.next || config.compat?.react || config.compat?.reactCompiler);
|
|
702
|
-
}
|
|
703
|
-
async function handleRoute(config, route, request, params) {
|
|
704
|
-
return withRouteRuntime(route.segmentConfig?.runtime, async () => {
|
|
705
|
-
registerServerRuntime(config, route.sourceFiles);
|
|
706
|
-
const spans = getRenderSpanExtensions();
|
|
707
|
-
const module = await spans.withFindPageComponentsSpan(route.route, async () => {
|
|
708
|
-
const href = compatModuleMode(config) ? await moduleHrefForRoute(config, route) : new URL(`file://${route.file}`).href;
|
|
709
|
-
const imported = await importModuleOnce(href);
|
|
710
|
-
return metadataRouteHandlerModule(imported, route) ?? imported;
|
|
711
|
-
});
|
|
712
|
-
return spans.withRouteHandlerSpan(
|
|
713
|
-
route.route,
|
|
714
|
-
() => runWithCacheScope(
|
|
715
|
-
() => handleRouteModule(module, request, params, { routeFile: route.file })
|
|
716
|
-
)
|
|
717
|
-
);
|
|
718
|
-
});
|
|
719
|
-
}
|
|
720
|
-
function hasDraftBypassCookie(headers) {
|
|
721
|
-
return /(?:^|;\s*)__prerender_bypass=/.test(headers.get("cookie") ?? "");
|
|
722
|
-
}
|
|
723
|
-
function isHtmlResponse(response) {
|
|
724
|
-
return (response.headers.get("content-type") ?? "").includes("text/html");
|
|
725
|
-
}
|
|
726
|
-
function routeModeOf(route) {
|
|
727
|
-
if (route.segmentConfig?.dynamic === "force-dynamic") return "dynamic";
|
|
728
|
-
const revalidate = route.segmentConfig?.revalidate;
|
|
729
|
-
if (typeof revalidate === "number" && revalidate > 0) return "isr";
|
|
730
|
-
return route.mode === "static" ? "static" : "dynamic";
|
|
731
|
-
}
|
|
732
|
-
function responseHintsFor(route, revalidateReason) {
|
|
733
|
-
const runtime = route.segmentConfig?.runtime;
|
|
734
|
-
const revalidate = route.segmentConfig?.revalidate;
|
|
735
|
-
if (!revalidateReason && !runtime && typeof revalidate !== "number") return void 0;
|
|
736
|
-
return {
|
|
737
|
-
...revalidateReason ? { revalidateReason } : {},
|
|
738
|
-
...runtime ? { runtime } : {},
|
|
739
|
-
...typeof revalidate === "number" && revalidate > 0 ? { revalidateSeconds: revalidate } : {}
|
|
740
|
-
};
|
|
741
|
-
}
|
|
742
|
-
function hasBuildCapturedCacheControl(metadata) {
|
|
743
|
-
return (metadata?.headers ?? []).some(([key]) => key.toLowerCase() === "cache-control");
|
|
744
|
-
}
|
|
745
|
-
async function builtFileInfo(outPath, pathname, staticFiles = {}, nextStaticFallback = false) {
|
|
746
|
-
const file = await firstFile(
|
|
747
|
-
path2.join(outPath, "public"),
|
|
748
|
-
builtFileCandidates(outPath, pathname, nextStaticFallback)
|
|
749
|
-
);
|
|
750
|
-
if (!file) return null;
|
|
751
|
-
const publicPath = path2.join(outPath, "public");
|
|
752
|
-
const fileStat = await stat(file);
|
|
753
|
-
const relative = path2.relative(publicPath, file).split(path2.sep).join("/");
|
|
754
|
-
return { file, relative, mtimeMs: fileStat.mtimeMs, metadata: staticFiles[relative] };
|
|
755
|
-
}
|
|
756
|
-
function builtFileCandidates(outPath, pathname, nextStaticFallback = false) {
|
|
757
|
-
const publicPath = path2.join(outPath, "public");
|
|
758
|
-
const trimmed = pathname.replace(/^\/+/, "");
|
|
759
|
-
if (pathname === "/") return [path2.join(publicPath, "index.html")];
|
|
760
|
-
const candidates = [
|
|
761
|
-
path2.join(publicPath, trimmed, "index.html"),
|
|
762
|
-
path2.join(publicPath, trimmed),
|
|
763
|
-
path2.join(publicPath, `${trimmed.replace(/\/+$/, "")}.html`)
|
|
764
|
-
];
|
|
765
|
-
try {
|
|
766
|
-
const decoded = decodeURIComponent(trimmed);
|
|
767
|
-
if (decoded !== trimmed && !decoded.split("/").some((seg) => seg === ".." || seg === "")) {
|
|
768
|
-
candidates.push(
|
|
769
|
-
path2.join(publicPath, decoded, "index.html"),
|
|
770
|
-
path2.join(publicPath, `${decoded.replace(/\/+$/, "")}.html`)
|
|
771
|
-
);
|
|
772
|
-
}
|
|
773
|
-
} catch {
|
|
774
|
-
}
|
|
775
|
-
if (nextStaticFallback && trimmed.startsWith("_next/static/")) {
|
|
776
|
-
const asset = trimmed.slice("_next/static/".length);
|
|
777
|
-
candidates.push(path2.join(publicPath, "assets", asset));
|
|
778
|
-
}
|
|
779
|
-
return candidates;
|
|
780
|
-
}
|
|
781
|
-
function lazyStaticHtmlPath(outPath, pathname) {
|
|
782
|
-
const publicPath = path2.join(outPath, "public");
|
|
783
|
-
const file = pathname === "/" ? path2.join(publicPath, "index.html") : path2.join(publicPath, pathname.replace(/^\/+|\/+$/g, ""), "index.html");
|
|
784
|
-
const relative = path2.relative(publicPath, file);
|
|
785
|
-
if (relative.startsWith("..") || path2.isAbsolute(relative)) return null;
|
|
786
|
-
return file;
|
|
787
|
-
}
|
|
788
|
-
function lazyStaticHandlerPath(outPath, pathname) {
|
|
789
|
-
if (pathname === "/") return null;
|
|
790
|
-
const publicPath = path2.join(outPath, "public");
|
|
791
|
-
const file = path2.join(publicPath, pathname.replace(/^\/+|\/+$/g, ""));
|
|
792
|
-
const relative = path2.relative(publicPath, file);
|
|
793
|
-
if (relative.startsWith("..") || path2.isAbsolute(relative)) return null;
|
|
794
|
-
return file;
|
|
795
|
-
}
|
|
796
|
-
function isHtmlPageFile(file) {
|
|
797
|
-
return file.endsWith(".html");
|
|
798
|
-
}
|
|
799
|
-
function cacheLifeResponseHeaders(life) {
|
|
800
|
-
if (!life) return [];
|
|
801
|
-
const headers = [];
|
|
802
|
-
const { revalidateSeconds, expireSeconds, staleSeconds } = life;
|
|
803
|
-
if (revalidateSeconds !== void 0 && expireSeconds !== void 0) {
|
|
804
|
-
const swr = Math.max(0, expireSeconds - revalidateSeconds);
|
|
805
|
-
headers.push(["cache-control", `s-maxage=${revalidateSeconds}, stale-while-revalidate=${swr}`]);
|
|
806
|
-
}
|
|
807
|
-
if (staleSeconds !== void 0) headers.push(["x-nextjs-stale-time", String(staleSeconds)]);
|
|
808
|
-
return headers;
|
|
809
|
-
}
|
|
810
|
-
function isImmutableAssetFile(relative) {
|
|
811
|
-
return relative.startsWith("assets/") || relative.startsWith("_next/static/");
|
|
812
|
-
}
|
|
813
|
-
function dynamicParamsAllowed(route, params) {
|
|
814
|
-
const governed = route.segmentConfig?.dynamicParamsFalse;
|
|
815
|
-
if (!governed?.length) return true;
|
|
816
|
-
const allowed = route.prerenderedParams ?? [];
|
|
817
|
-
const required = route.segmentConfig?.strictDynamicParams ? [...route.params, ...route.catchAll ? [route.catchAll] : []] : governed;
|
|
818
|
-
return allowed.some((set) => required.every((param) => paramValueEqual(set[param], params[param])));
|
|
819
|
-
}
|
|
820
|
-
function paramValueEqual(a, b) {
|
|
821
|
-
if (a === void 0 || b === void 0) return false;
|
|
822
|
-
const join = (value) => Array.isArray(value) ? value.join("/") : value;
|
|
823
|
-
return join(a) === join(b);
|
|
824
|
-
}
|
|
825
|
-
async function maybeBuiltFile(outPath, pathname, staticFiles = {}, method = "GET", requestHeaders, nextStaticFallback = false) {
|
|
826
|
-
const normalizedMethod = method.toUpperCase();
|
|
827
|
-
if (normalizedMethod !== "GET" && normalizedMethod !== "HEAD") return null;
|
|
828
|
-
const publicPath = path2.join(outPath, "public");
|
|
829
|
-
const file = await firstFile(
|
|
830
|
-
publicPath,
|
|
831
|
-
builtFileCandidates(outPath, pathname, nextStaticFallback)
|
|
832
|
-
);
|
|
833
|
-
if (!file) return null;
|
|
834
|
-
const relative = path2.relative(publicPath, file).split(path2.sep).join("/");
|
|
835
|
-
const metadata = staticFiles[relative];
|
|
836
|
-
const headers = new Headers(metadata?.headers);
|
|
837
|
-
if (!headers.has("content-type")) headers.set("content-type", contentType(file));
|
|
838
|
-
const fileStat = await stat(file);
|
|
839
|
-
const variant = requestHeaders?.get("rsc") === "1" ? "-rsc" : "";
|
|
840
|
-
const etag = `W/"${fileStat.size.toString(16)}-${Math.trunc(fileStat.mtimeMs).toString(16)}${variant}"`;
|
|
841
|
-
if (!headers.has("cache-control")) {
|
|
842
|
-
headers.set("cache-control", immutableAssetPath(relative) ? immutableCacheControl : "no-cache");
|
|
843
|
-
headers.set("etag", etag);
|
|
844
|
-
if (requestHeaders?.get("if-none-match") === etag) {
|
|
845
|
-
return new Response(null, { status: 304, headers });
|
|
846
|
-
}
|
|
847
|
-
}
|
|
848
|
-
const raw = await readFile(file);
|
|
849
|
-
let body = raw;
|
|
850
|
-
if (compressibleContentType(headers.get("content-type") ?? "") && raw.length > 1024 && acceptsGzip(requestHeaders)) {
|
|
851
|
-
const zipped = cachedGzip(`${file}:${etag}`, raw);
|
|
852
|
-
if (zipped.length < raw.length) {
|
|
853
|
-
body = zipped;
|
|
854
|
-
headers.set("content-encoding", "gzip");
|
|
855
|
-
headers.append("vary", "accept-encoding");
|
|
856
|
-
}
|
|
857
|
-
}
|
|
858
|
-
return new Response(normalizedMethod === "HEAD" ? null : body, {
|
|
859
|
-
status: metadata?.status ?? 200,
|
|
860
|
-
headers
|
|
861
|
-
});
|
|
862
|
-
}
|
|
863
|
-
function appendVaryToken(headers, token) {
|
|
864
|
-
const existing = headers.get("vary");
|
|
865
|
-
if (!existing) {
|
|
866
|
-
headers.set("vary", token);
|
|
867
|
-
return;
|
|
868
|
-
}
|
|
869
|
-
const tokens = existing.split(",").map((part) => part.trim().toLowerCase());
|
|
870
|
-
if (tokens.includes(token.toLowerCase()) || tokens.includes("*")) return;
|
|
871
|
-
headers.set("vary", `${existing}, ${token}`);
|
|
872
|
-
}
|
|
873
|
-
function compressResponse(response, request) {
|
|
874
|
-
if (!response.body || response.status === 304 || response.status === 204) return response;
|
|
875
|
-
if (response.headers.get("content-encoding")) return response;
|
|
876
|
-
if (!compressibleContentType(response.headers.get("content-type") ?? "")) return response;
|
|
877
|
-
const headers = new Headers(response.headers);
|
|
878
|
-
appendVaryToken(headers, "accept-encoding");
|
|
879
|
-
if (!acceptsGzip(request.headers)) {
|
|
880
|
-
return new Response(response.body, { status: response.status, headers });
|
|
881
|
-
}
|
|
882
|
-
const knownLength = Number(headers.get("content-length"));
|
|
883
|
-
if (Number.isFinite(knownLength) && knownLength <= 1024) {
|
|
884
|
-
return new Response(response.body, { status: response.status, headers });
|
|
885
|
-
}
|
|
886
|
-
headers.set("content-encoding", "gzip");
|
|
887
|
-
headers.delete("content-length");
|
|
888
|
-
return new Response(streamingGzip(response.body), {
|
|
889
|
-
status: response.status,
|
|
890
|
-
headers
|
|
891
|
-
});
|
|
892
|
-
}
|
|
893
|
-
function streamingGzip(body) {
|
|
894
|
-
const gzip = createGzip();
|
|
895
|
-
const reader = body.getReader();
|
|
896
|
-
void (async () => {
|
|
897
|
-
try {
|
|
898
|
-
for (; ; ) {
|
|
899
|
-
const { done, value } = await reader.read();
|
|
900
|
-
if (done) break;
|
|
901
|
-
gzip.write(value);
|
|
902
|
-
await new Promise((resolve) => gzip.flush(zlibConstants.Z_SYNC_FLUSH, resolve));
|
|
903
|
-
}
|
|
904
|
-
gzip.end();
|
|
905
|
-
} catch (error) {
|
|
906
|
-
gzip.destroy(error);
|
|
907
|
-
reader.cancel(error).catch(() => void 0);
|
|
908
|
-
}
|
|
909
|
-
})();
|
|
910
|
-
return Readable.toWeb(gzip);
|
|
911
|
-
}
|
|
912
|
-
function compressibleContentType(type) {
|
|
913
|
-
return /^(text\/|application\/(javascript|json|manifest|xml)|image\/svg)/.test(type);
|
|
914
|
-
}
|
|
915
|
-
function acceptsGzip(requestHeaders) {
|
|
916
|
-
return requestHeaders?.get("accept-encoding")?.includes("gzip") ?? false;
|
|
917
|
-
}
|
|
918
|
-
var gzipCache = /* @__PURE__ */ new Map();
|
|
919
|
-
var gzipCacheLimit = 512;
|
|
920
|
-
function cachedGzip(key, body) {
|
|
921
|
-
const cached = gzipCache.get(key);
|
|
922
|
-
if (cached) return cached;
|
|
923
|
-
const zipped = gzipSync(body, { level: 6 });
|
|
924
|
-
if (gzipCache.size >= gzipCacheLimit) {
|
|
925
|
-
const oldest = gzipCache.keys().next().value;
|
|
926
|
-
if (oldest !== void 0) gzipCache.delete(oldest);
|
|
927
|
-
}
|
|
928
|
-
gzipCache.set(key, zipped);
|
|
929
|
-
return zipped;
|
|
930
|
-
}
|
|
931
|
-
var immutableCacheControl = "public, max-age=31536000, immutable";
|
|
932
|
-
function immutableAssetPath(relativePath) {
|
|
933
|
-
return immutableAssetPrefixes().some((prefix) => relativePath.startsWith(prefix));
|
|
934
|
-
}
|
|
935
|
-
function immutableAssetPrefixes() {
|
|
936
|
-
return [
|
|
937
|
-
"assets/",
|
|
938
|
-
"_next/static/",
|
|
939
|
-
...getAssetExtensions().staticAssetPublicPrefixes().map((prefix) => prefix.replace(/^\/+/, ""))
|
|
940
|
-
];
|
|
941
|
-
}
|
|
942
|
-
async function firstFile(root, files) {
|
|
943
|
-
for (const file of files) {
|
|
944
|
-
if (!isInside(root, file)) continue;
|
|
945
|
-
if (!existsSync(file)) continue;
|
|
946
|
-
if ((await stat(file)).isFile()) return file;
|
|
947
|
-
}
|
|
948
|
-
return null;
|
|
949
|
-
}
|
|
950
|
-
function isInside(root, file) {
|
|
951
|
-
const relative = path2.relative(root, file);
|
|
952
|
-
return relative === "" || !relative.startsWith("..") && !path2.isAbsolute(relative);
|
|
953
|
-
}
|
|
954
|
-
export {
|
|
955
|
-
compressResponse,
|
|
956
|
-
createRequestHandler,
|
|
957
|
-
immutableAssetPath,
|
|
958
|
-
immutableAssetPrefixes,
|
|
959
|
-
immutableCacheControl,
|
|
960
|
-
maybeBuiltFile
|
|
961
|
-
};
|