vite-hub 0.4.1 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -14
- package/dist/_internal/runtime/browser-errors.d.ts +12 -4
- package/dist/_internal/runtime/browser-errors.js +69 -27
- package/dist/_internal/runtime/redirects.d.ts +1 -2
- package/dist/_internal/runtime/redirects.js +2 -3
- package/dist/_internal/runtime/request-policy.d.ts +11 -2
- package/dist/_internal/runtime/request-policy.js +25 -6
- package/dist/_internal/runtime/security.d.ts +1 -2
- package/dist/_internal/runtime/security.js +16 -3
- package/dist/{access-BDST818p.js → access-BBHk9b5P.js} +30 -20
- package/dist/{access-policy-DjBKLo3c.js → access-policy-BM48XstY.js} +5 -6
- package/dist/{access-policy-CGXhO3Ee.d.ts → access-policy-CUbJLvlR.d.ts} +4 -8
- package/dist/{account-BnOAU055.d.ts → account-CoAO1F8G.d.ts} +9 -7
- package/dist/agent/invocations/postgres.d.ts +1 -0
- package/dist/agent/invocations/postgres.js +2 -0
- package/dist/{agent-invocations.post-CcPvfA0n.js → agent-invocations.post-BAC1aHnG.js} +16 -18
- package/dist/agents-BClUWOj7.js +1 -0
- package/dist/{agents-BDeazoAW.js → agents-Cz_uhhov.js} +4 -5
- package/dist/{agents-C94A4N9u.d.ts → agents-Gyw4VKPt.d.ts} +0 -2
- package/dist/auth/server.js +1 -2
- package/dist/{auth-BZOy7obk.d.ts → auth-CeKxL2xp.d.ts} +4 -8
- package/dist/{auth-operations-GcQk0O0X.js → auth-operations-arLIY2_2.js} +1 -2
- package/dist/{auth-types-CyqhWvYF.d.ts → auth-types-B4mq4YhK.d.ts} +1 -4
- package/dist/bin.js +34 -23
- package/dist/blob/nuxt-image.js +1 -2
- package/dist/{blob-CFLwMsjH.d.ts → blob-_TtxDb-t.d.ts} +1 -3
- package/dist/{blob-CpvlM8jp.js → blob-eH6j0AQj.js} +5 -6
- package/dist/browser-error-limits-B0yS95zt.js +24 -0
- package/dist/cache/operations.d.ts +2 -4
- package/dist/cache/operations.js +3 -4
- package/dist/cache.d.ts +1 -3
- package/dist/cache.js +2 -3
- package/dist/choices/testing.d.ts +1 -0
- package/dist/choices/testing.js +2 -0
- package/dist/{cli-config-wxKjF2Y0.js → cli-config-BX8H4ZCo.js} +12 -5
- package/dist/cli-config-DgpmE_7z.js +1 -0
- package/dist/cloudflare-app-types.d.ts +18 -0
- package/dist/{cloudflare-env-lookup-DKXdr4P_.js → cloudflare-env-lookup-DcN7pGlv.js} +1 -2
- package/dist/cms.js +1 -2
- package/dist/console/auth-types.d.ts +1 -1
- package/dist/console/auth.d.ts +1 -3
- package/dist/console/auth.js +2 -3
- package/dist/console/runtime/auth-operations.d.ts +1 -3
- package/dist/console/runtime/auth-operations.js +1 -2
- package/dist/console/runtime/client/account-views.d.ts +1 -3
- package/dist/console/runtime/client/account-views.js +1 -2
- package/dist/console/runtime/client/account.d.ts +1 -1
- package/dist/console/runtime/client/account.js +36 -48
- package/dist/console/runtime/client/add-primitive.ts +2 -2
- package/dist/console/runtime/client/appearance.d.ts +1 -2
- package/dist/console/runtime/client/appearance.js +1 -2
- package/dist/console/runtime/client/blob-media.d.ts +2 -4
- package/dist/console/runtime/client/blob-media.js +5 -6
- package/dist/console/runtime/client/comment-thread.d.ts +1 -3
- package/dist/console/runtime/client/comment-thread.js +11 -5
- package/dist/console/runtime/client/content-heads.d.ts +1 -2
- package/dist/console/runtime/client/content-heads.js +2 -3
- package/dist/console/runtime/client/documents.d.ts +2 -2
- package/dist/console/runtime/client/documents.js +1 -2
- package/dist/console/runtime/client/editor.d.ts +3 -5
- package/dist/console/runtime/client/editor.js +1 -2
- package/dist/console/runtime/client/env-groups.d.ts +1 -3
- package/dist/console/runtime/client/env-groups.js +1 -2
- package/dist/console/runtime/client/env-status.d.ts +1 -3
- package/dist/console/runtime/client/env-status.js +1 -2
- package/dist/console/runtime/client/format.d.ts +1 -3
- package/dist/console/runtime/client/format.js +1 -2
- package/dist/console/runtime/client/invocation-deletion.d.ts +1 -2
- package/dist/console/runtime/client/invocation-deletion.js +1 -2
- package/dist/console/runtime/client/invocation.d.ts +1 -2
- package/dist/console/runtime/client/invocation.js +4 -5
- package/dist/console/runtime/client/live.d.ts +2 -4
- package/dist/console/runtime/client/live.js +1 -2
- package/dist/console/runtime/client/mcp-client.d.ts +6 -4
- package/dist/console/runtime/client/mcp-client.js +12 -5
- package/dist/console/runtime/client/media-library.d.ts +1 -1
- package/dist/console/runtime/client/media-library.js +1 -2
- package/dist/console/runtime/client/media-uploads.d.ts +2 -4
- package/dist/console/runtime/client/media-uploads.js +2 -3
- package/dist/console/runtime/client/media.d.ts +1 -1
- package/dist/console/runtime/client/media.js +1 -2
- package/dist/console/runtime/client/operation-view.d.ts +2 -4
- package/dist/console/runtime/client/operation-view.js +4 -5
- package/dist/console/runtime/client/presence.d.ts +2 -4
- package/dist/console/runtime/client/presence.js +1 -2
- package/dist/console/runtime/client/preview.d.ts +1 -3
- package/dist/console/runtime/client/preview.js +1 -2
- package/dist/console/runtime/client/problem.d.ts +2 -4
- package/dist/console/runtime/client/problem.js +3 -4
- package/dist/console/runtime/client/project-link.d.ts +2 -2
- package/dist/console/runtime/client/project-link.js +1 -2
- package/dist/console/runtime/client/project-session.d.ts +19 -10
- package/dist/console/runtime/client/project-session.js +1 -723
- package/dist/console/runtime/client/project.d.ts +1 -3
- package/dist/console/runtime/client/project.js +1 -2
- package/dist/console/runtime/client/projects.d.ts +1 -1
- package/dist/console/runtime/client/projects.js +1 -2
- package/dist/console/runtime/client/publish.d.ts +2 -4
- package/dist/console/runtime/client/publish.js +1 -2
- package/dist/console/runtime/client/rate-limit.d.ts +1 -3
- package/dist/console/runtime/client/rate-limit.js +3 -4
- package/dist/console/runtime/client/read-only.d.ts +2 -4
- package/dist/console/runtime/client/read-only.js +2 -3
- package/dist/console/runtime/client/request.d.ts +2 -70
- package/dist/console/runtime/client/request.js +1 -2
- package/dist/console/runtime/client/route-query.d.ts +4 -5
- package/dist/console/runtime/client/route-query.js +1 -2
- package/dist/console/runtime/client/schedule-run.d.ts +1 -3
- package/dist/console/runtime/client/schedule-run.js +3 -4
- package/dist/console/runtime/client/schema-form.d.ts +1 -1
- package/dist/console/runtime/client/schema-form.js +1 -2
- package/dist/console/runtime/client/sections.d.ts +1 -1
- package/dist/console/runtime/client/sections.js +1 -2
- package/dist/console/runtime/client/site-access.d.ts +41 -10
- package/dist/console/runtime/client/site-access.js +157 -28
- package/dist/console/runtime/client/stored.d.ts +1 -3
- package/dist/console/runtime/client/stored.js +1 -2
- package/dist/console/runtime/client/ticket.d.ts +1 -1
- package/dist/console/runtime/client/ticket.js +1 -2
- package/dist/console/runtime/client/toast.d.ts +1 -3
- package/dist/console/runtime/client/toast.js +1 -2
- package/dist/console/runtime/client/workflow.d.ts +1 -3
- package/dist/console/runtime/client/workflow.js +3 -4
- package/dist/console/runtime/components/console-account-api-keys.vue +4 -4
- package/dist/console/runtime/components/console-account-home.vue +230 -51
- package/dist/console/runtime/components/console-account-link.vue +8 -5
- package/dist/console/runtime/components/console-account-setup.vue +10 -7
- package/dist/console/runtime/components/console-account-shell.vue +13 -19
- package/dist/console/runtime/components/console-account-unlink.vue +2 -3
- package/dist/console/runtime/components/console-app-settings.vue +8 -2
- package/dist/console/runtime/components/console-app.vue +1 -10
- package/dist/console/runtime/components/console-auth-activity.vue +2 -2
- package/dist/console/runtime/components/console-auth-chart.vue +1 -1
- package/dist/console/runtime/components/console-auth-overview.vue +1 -1
- package/dist/console/runtime/components/console-auth.vue +4 -4
- package/dist/console/runtime/components/console-comment-thread.vue +1 -1
- package/dist/console/runtime/components/console-definitions.vue +4 -4
- package/dist/console/runtime/components/console-document-dashboard.vue +2 -2
- package/dist/console/runtime/components/console-document-list.vue +2 -2
- package/dist/console/runtime/components/console-document-settings.vue +1 -1
- package/dist/console/runtime/components/console-env.vue +3 -3
- package/dist/console/runtime/components/console-home.vue +220 -311
- package/dist/console/runtime/components/console-hosted-comments-embed.vue +106 -0
- package/dist/console/runtime/components/console-loading.vue +1 -1
- package/dist/console/runtime/components/console-mcp-callback.vue +6 -1
- package/dist/console/runtime/components/console-mcp-connection.vue +3 -3
- package/dist/console/runtime/components/console-mcp-items.vue +4 -17
- package/dist/console/runtime/components/console-media-browser.vue +20 -30
- package/dist/console/runtime/components/console-media-crops.vue +3 -2
- package/dist/console/runtime/components/console-media-uploads.vue +11 -7
- package/dist/console/runtime/components/console-page-toolbar.vue +5 -10
- package/dist/console/runtime/components/console-schema-list.vue +85 -31
- package/dist/console/runtime/components/console-search-palette.vue +14 -5
- package/dist/console/runtime/components/console-section.vue +2 -1
- package/dist/console/runtime/components/console-session-inspector.vue +5 -0
- package/dist/console/runtime/components/console-session.css +8 -2
- package/dist/console/runtime/components/console-settings-value.vue +4 -5
- package/dist/console/runtime/components/console-sidebar.vue +9 -8
- package/dist/console/runtime/components/console-site.vue +36 -15
- package/dist/console/runtime/components/console-stat-grid.vue +3 -2
- package/dist/console/runtime/components/console-toaster.vue +3 -2
- package/dist/console/runtime/components/console-usage-chart.vue +1 -1
- package/dist/console/runtime/components/console-usage.vue +36 -18
- package/dist/console/runtime/components/invocation/internal/brand-icons.ts +10 -0
- package/dist/console/runtime/components/invocation/internal/invocation-brand.ts +6 -2
- package/dist/console/runtime/components/invocation/invocation.css +4 -27
- package/dist/console/runtime/console-route.d.ts +1 -3
- package/dist/console/runtime/console-route.js +1 -2
- package/dist/console/runtime/definitions.d.ts +1 -1
- package/dist/console/runtime/definitions.js +1 -2
- package/dist/console/runtime/diagnostics.ts +8 -1
- package/dist/console/runtime/mcp-client.d.ts +1 -1
- package/dist/console/runtime/mcp-client.js +1 -2
- package/dist/console/runtime/page/loader.js +45 -52
- package/dist/console/runtime/page-tool/account.js +26 -0
- package/dist/console/runtime/page-tool/page-tool.js +2 -3
- package/dist/console/runtime/public/skills/index.json +1 -1
- package/dist/console/runtime/public/skills/vitehub/SKILL.md +50 -7
- package/dist/console/runtime/public/skills/vitehub/agents/openai.yaml +1 -1
- package/dist/console/runtime/public/skills/vitehub/references/primitives/channels.md +1 -1
- package/dist/console/runtime/public/skills/vitehub/references/primitives/email.md +1 -1
- package/dist/console/runtime/public/skills/vitehub/references/project-shapes.md +1 -1
- package/dist/console/runtime/rpc.d.ts +1 -1
- package/dist/console/runtime/rpc.js +1 -2
- package/dist/console/runtime/sections.d.ts +1 -1
- package/dist/console/runtime/sections.js +1 -2
- package/dist/console/runtime/server/access-policy.d.ts +1 -1
- package/dist/console/runtime/server/access-policy.js +1 -2
- package/dist/console/runtime/server/agents.get.d.ts +2 -3
- package/dist/console/runtime/server/agents.get.js +3 -4
- package/dist/console/runtime/server/auth.d.ts +1 -1
- package/dist/console/runtime/server/auth.js +4 -5
- package/dist/console/runtime/server/blob.d.ts +1 -1
- package/dist/console/runtime/server/blob.js +1 -2
- package/dist/console/runtime/server/channel-replay.d.ts +3 -5
- package/dist/console/runtime/server/channel-replay.js +7 -7
- package/dist/console/runtime/server/database.d.ts +1 -1
- package/dist/console/runtime/server/database.get.d.ts +2 -3
- package/dist/console/runtime/server/database.get.js +4 -5
- package/dist/console/runtime/server/database.js +1 -2
- package/dist/console/runtime/server/definitions.d.ts +1 -1
- package/dist/console/runtime/server/definitions.get.d.ts +4 -6
- package/dist/console/runtime/server/definitions.get.js +5 -6
- package/dist/console/runtime/server/definitions.js +1 -2
- package/dist/console/runtime/server/development.d.ts +1 -1
- package/dist/console/runtime/server/development.js +1 -2
- package/dist/console/runtime/server/documents.d.ts +1 -1
- package/dist/console/runtime/server/documents.js +2 -2
- package/dist/console/runtime/server/env.d.ts +1 -3
- package/dist/console/runtime/server/env.get.d.ts +2 -4
- package/dist/console/runtime/server/env.get.js +7 -8
- package/dist/console/runtime/server/env.js +1 -2
- package/dist/console/runtime/server/invocation-capabilities.get.d.ts +1 -3
- package/dist/console/runtime/server/invocation-capabilities.get.js +4 -5
- package/dist/console/runtime/server/invocation-workspace.get.d.ts +3 -5
- package/dist/console/runtime/server/invocation-workspace.get.js +6 -7
- package/dist/console/runtime/server/invocation.get.d.ts +3 -5
- package/dist/console/runtime/server/invocation.get.js +8 -9
- package/dist/console/runtime/server/invocations.get.d.ts +1 -2
- package/dist/console/runtime/server/invocations.get.js +5 -6
- package/dist/console/runtime/server/logs.get.d.ts +3 -5
- package/dist/console/runtime/server/logs.get.js +7 -8
- package/dist/console/runtime/server/mcp-client-operations.d.ts +2 -4
- package/dist/console/runtime/server/mcp-client-operations.js +5 -7
- package/dist/console/runtime/server/operation-contributions.d.ts +1 -1
- package/dist/console/runtime/server/operation-contributions.js +1 -2
- package/dist/console/runtime/server/page-auth.d.ts +2 -4
- package/dist/console/runtime/server/page-auth.js +1 -2
- package/dist/console/runtime/server/page-tool.d.ts +1 -1
- package/dist/console/runtime/server/page-tool.js +12 -7
- package/dist/console/runtime/server/page-tools-route.d.ts +2 -0
- package/dist/console/runtime/server/page-tools-route.js +4 -0
- package/dist/console/runtime/server/rpc.d.ts +3 -5
- package/dist/console/runtime/server/rpc.js +12 -13
- package/dist/console/runtime/server/runtime.d.ts +1 -1
- package/dist/console/runtime/server/runtime.js +1 -2
- package/dist/console/runtime/server/search.get.d.ts +1 -3
- package/dist/console/runtime/server/search.get.js +3 -5
- package/dist/console/runtime/server/sections.d.ts +5 -5
- package/dist/console/runtime/server/sections.get.d.ts +1 -1
- package/dist/console/runtime/server/sections.get.js +8 -9
- package/dist/console/runtime/server/sections.js +6 -6
- package/dist/console/runtime/server/setup.d.ts +5 -5
- package/dist/console/runtime/server/setup.js +5 -5
- package/dist/console/runtime/server/site-entry.d.ts +1 -3
- package/dist/console/runtime/server/site-entry.js +15 -10
- package/dist/console/runtime/server/site-session.d.ts +12 -22
- package/dist/console/runtime/server/site-session.js +1 -2
- package/dist/console/runtime/server/status.get.d.ts +2 -4
- package/dist/console/runtime/server/status.get.js +6 -7
- package/dist/console/runtime/server/tickets.d.ts +1 -1
- package/dist/console/runtime/server/tickets.js +1 -2
- package/dist/console/runtime/server/usage.get.d.ts +2 -4
- package/dist/console/runtime/server/usage.get.js +8 -9
- package/dist/console/runtime/server/workspace-files.get.d.ts +3 -5
- package/dist/console/runtime/server/workspace-files.get.js +4 -5
- package/dist/console/runtime/site-access.d.ts +1 -1
- package/dist/console/runtime/site-access.js +1 -2
- package/dist/console/runtime/skills.d.ts +1 -3
- package/dist/console/runtime/skills.js +1 -2
- package/dist/console/server.d.ts +7 -11
- package/dist/console/server.js +8 -8
- package/dist/console/ui.d.ts +0 -10
- package/dist/console/ui.js +32 -28
- package/dist/console-lazy-views-VEjcbL4Q.js +1 -0
- package/dist/{console-route-CBuqZ4wO.js → console-route-DbdnLkkF.js} +3 -4
- package/dist/console.d.ts +1 -3
- package/dist/console.js +1 -2
- package/dist/{database-DyPVMjp_.d.ts → database-CPjZ3L0g.d.ts} +1 -3
- package/dist/{database-BdOBjPkS.js → database-CrgBUdIx.js} +3 -4
- package/dist/definition-catalog-1xPPtzOx.js +137 -0
- package/dist/definition-catalog-M5ua7JRS.js +1 -0
- package/dist/{definitions-BW6SvmMM.js → definitions-BFYqXchw.js} +1 -2
- package/dist/{definitions-DB4LbZ7T.d.ts → definitions-ChvMnA1L.d.ts} +0 -2
- package/dist/{definitions-Dbgxfz3I.d.ts → definitions-DRkgHKmk.d.ts} +1 -3
- package/dist/{definitions-CNq_Shkh.js → definitions-M7i2p8SR.js} +5 -6
- package/dist/deployment-CURATxjG.js +229 -0
- package/dist/deployment-l7RuKdEp.js +1 -0
- package/dist/{dev-peer-am78OsHH.js → dev-peer-DBq-isgi.js} +7 -6
- package/dist/{development-zLxOp-AO.js → development-DD567hhJ.js} +2 -3
- package/dist/{development-W5EwONyL.d.ts → development-I40mfD7B.d.ts} +1 -3
- package/dist/{diagnostics-9U_fYxMy.js → diagnostics-B2cqlCSz.js} +3 -3
- package/dist/{diagnostics-CjGiniKb.d.ts → diagnostics-BXxPggRw.d.ts} +1 -3
- package/dist/docs/nuxt.js +1 -2
- package/dist/doctor.d.ts +0 -6
- package/dist/doctor.js +15078 -2377
- package/dist/{documents-CjJTCrY8.js → documents-BOYwZ5g4.js} +7 -8
- package/dist/{documents-qrHHqlNU.js → documents-Ck_iub9w.js} +4 -5
- package/dist/{documents-BASIRZ91.d.ts → documents-DxK0tdjA.d.ts} +3 -5
- package/dist/{documents-CboVhYFz.d.ts → documents-LtkKCxtu.d.ts} +4 -8
- package/dist/durability/operations.d.ts +2 -4
- package/dist/durability/operations.js +3 -4
- package/dist/email/vue.d.ts +1 -0
- package/dist/email/vue.js +2 -0
- package/dist/{entries-Bj-jPs_J.js → entries-UFs9n1MB.js} +2 -3
- package/dist/{env-Dg1I_DWr.js → env-D-wtSupz.js} +2 -3
- package/dist/{error-diagnostics-Bm3JKYjz.js → error-diagnostics-CBtvqI30.js} +33 -22
- package/dist/{operation-definition-a5keEpCd.js → error-diagnostics-kKXseq8d.js} +11 -169
- package/dist/error-diagnostics.ts +33 -23
- package/dist/{optional-owners-BNA2OX6z.js → features-BXRKlmtN.js} +57 -345
- package/dist/features-CD5i5I8V.js +1 -0
- package/dist/{format-BOYlanIZ.js → format-Df-bS4Ly.js} +1 -2
- package/dist/gateways/testing.d.ts +1 -0
- package/dist/gateways/testing.js +2 -0
- package/dist/github-login-W-vaahWP.js +6 -0
- package/dist/{host-CkL0jjBq.js → host-DeNPYIeV.js} +1 -2
- package/dist/{http-error-Bs6e8_-8.js → http-error-BorAxJYM.js} +1 -2
- package/dist/index.d.ts +2 -8
- package/dist/index.js +5 -6
- package/dist/inspect-CWwAuL-B.js +47 -0
- package/dist/internal/agent-invocations-libsql.js +1 -2
- package/dist/internal/disabled-redis-driver.d.ts +1 -3
- package/dist/internal/disabled-redis-driver.js +2 -3
- package/dist/internal/disabled-upstash-driver.d.ts +1 -3
- package/dist/internal/disabled-upstash-driver.js +2 -3
- package/dist/internal/test-loader.d.ts +1 -3
- package/dist/internal/test-loader.js +2 -3
- package/dist/internal/test-server.js +2 -3
- package/dist/{internal-BreyUsQ6.js → internal-0C_CC601.js} +1 -2
- package/dist/{internal-CO4OqqaS.d.ts → internal-CKocv79I.d.ts} +3 -7
- package/dist/{invariant-DolT9EEx.js → invariant-Dj2R1eMr.js} +1 -2
- package/dist/{invocation-page-undo-DIZ-s3xT.js → invocation-page-undo-BEi-rO0Q.js} +5 -6
- package/dist/{invocations-CK_-G540.js → invocations-8NThe8Bx.js} +5 -6
- package/dist/{limits-BUlwWYQE.js → limits-BLo31qDR.js} +1 -2
- package/dist/logs/client.d.ts +19 -0
- package/dist/logs/client.js +11 -0
- package/dist/logs/host.d.ts +2 -4
- package/dist/logs/host.js +1 -2
- package/dist/logs/memory.d.ts +1 -1
- package/dist/logs/memory.js +1 -2
- package/dist/logs/source.d.ts +1 -1
- package/dist/logs/source.js +1 -2
- package/dist/logs.d.ts +2 -2
- package/dist/logs.js +2 -2
- package/dist/{mcp-client-CTbTbn7d.js → mcp-client-Bkh-khvr.js} +1 -2
- package/dist/{mcp-client-By4zk0vU.js → mcp-client-DiObFpDS.js} +35 -22
- package/dist/{mcp-client-C_sEmyQw.d.ts → mcp-client-Q2XbUXuP.d.ts} +1 -4
- package/dist/{media-uKX4Wy-c.d.ts → media-C79RB1oH.d.ts} +0 -2
- package/dist/{media-BHpQ-4jw.js → media-CAKz9yrp.js} +8 -9
- package/dist/{media-library-NaOMBKWS.js → media-library-BDX89xXA.js} +5 -6
- package/dist/{media-library-D9ThbXqs.d.ts → media-library-DxGu6w9z.d.ts} +0 -2
- package/dist/{memory-DTmq-Z6x.js → memory-D3EJS_Bp.js} +21 -10
- package/dist/{memory-2bbl4hcV.d.ts → memory-GK5ZGWrp.d.ts} +1 -3
- package/dist/nuxt-server-auto-imports-4aT5BD4u.js +74 -0
- package/dist/{nuxt-server-imports-DH60Z7LA.js → nuxt-server-imports-BdJqiVhT.js} +10 -18
- package/dist/nuxt.d.ts +1 -3
- package/dist/nuxt.js +339 -189
- package/dist/{object-D8pRdprI.js → object-DRSmpe04.js} +1 -2
- package/dist/{operation-contributions-DpkO_iSU.d.ts → operation-contributions-BCcQVlGb.d.ts} +1 -3
- package/dist/{operation-contributions-BdS0z3tx.js → operation-contributions-D10pjkJF.js} +4 -5
- package/dist/operation-definition-DTpNvLd8.js +164 -0
- package/dist/{operation-registry-BogGwk_I.js → operation-registry-DfQbL7vE.js} +1 -2
- package/dist/{operation-rpc-DI9txNxK.js → operation-rpc-BMdfapja.js} +3 -4
- package/dist/{operations-EOdyctDc.js → operations-CD_mu_Ww.js} +86 -9
- package/dist/operations-D7ENc68Y.js +1 -0
- package/dist/{operations-B0689BG1.d.ts → operations-DgFhA1WE.d.ts} +8 -6
- package/dist/{operations-CWP9dF3i.js → operations-vRLiH7dh.js} +35 -46
- package/dist/optional-owners-DAfShdgV.js +353 -0
- package/dist/out-Cw5Tvr92.js +20989 -0
- package/dist/{owned-paths-BnjT0FhU.js → owned-paths-MjjDftBn.js} +1 -2
- package/dist/page/pill.iife.js +25 -27
- package/dist/{page-tool-CRCK1RHV.d.ts → page-tool-BUnUbuSy.d.ts} +6 -7
- package/dist/{page-tools-BkSSBFoi.js → page-tools-BQzwuAHD.js} +28 -12
- package/dist/{page-tools-sw4I-Nqx.d.ts → page-tools-UwsfvH-B.d.ts} +2 -4
- package/dist/{page-tools-shared-D3fFoEV2.js → page-tools-shared-hJcG_xk8.js} +8 -5
- package/dist/{inspect-CDw7e0vK.js → pathe.M-eThtNZ-D4EC7Wue.js} +2 -31
- package/dist/{plugins-BqAtIEX2.d.ts → plugins-BpiTVULl.d.ts} +252 -262
- package/dist/{plugins-B-DpgDPB.js → plugins-H6-MQrsn.js} +3483 -797
- package/dist/presets/workspace.js +1 -2
- package/dist/project-BxyyclTE.js +58 -0
- package/dist/{project-CufkVP1u.d.ts → project-DKBIHOf4.d.ts} +16 -4
- package/dist/{project-DlWTGB7h.js → project-DRC67Uiu.js} +1 -2
- package/dist/{project-link-D-6UefhA.js → project-link-CeS0T8Pr.js} +57 -9
- package/dist/{project-link-BuOzBH9f.d.ts → project-link-isfdRO3Q.d.ts} +42 -6
- package/dist/{project-root-v6ba4tn7.js → project-root-mAVQGZTX.js} +1 -2
- package/dist/project-session--GN7MduT.js +764 -0
- package/dist/{projects-CAcXztf4.js → projects-BRp0iseV.js} +1 -2
- package/dist/{projects-Ddvl9EJp.d.ts → projects-mgPxrKZr.d.ts} +0 -2
- package/dist/{registry-zw6aE2N9.js → registry-B8JE5NY-.js} +1 -2
- package/dist/{registry-CDKLACCZ.js → registry-CnPC-gNu.js} +1 -2
- package/dist/{request-D7h3SQ92.d.ts → request-BC_krbEr.d.ts} +2 -4
- package/dist/request-CJCPyu2B.d.ts +70 -0
- package/dist/{request-DbFfYmCu.js → request-CQ8TkHLh.js} +4 -5
- package/dist/{request-DE8w_cSM.js → request-Cl68STwT.js} +7 -8
- package/dist/request-origin-pzWr9UUu.js +37 -0
- package/dist/rolldown-runtime-DegdyBIC.js +25 -0
- package/dist/{route-query-CRVWXIrc.js → route-query-BWVl6ZO6.js} +4 -5
- package/dist/{rpc-DIUA61pv.js → rpc-D3tsx5lZ.js} +1 -2
- package/dist/{rpc-7nlHSv3y.d.ts → rpc-oijgKQtD.d.ts} +0 -2
- package/dist/{runtime-YLWfdrtO.js → runtime-CAbuQGMP.js} +3 -4
- package/dist/{runtime-DQuHg7OO.js → runtime-CRJsqVTa.js} +2 -3
- package/dist/{runtime-B_btezs1.d.ts → runtime-Cf8R1Ztr.d.ts} +0 -2
- package/dist/{runtime-DxfJOfCd.js → runtime-CyPZMiyK.js} +2 -3
- package/dist/{runtime-OsEDfbM9.js → runtime-F0CTqBFx.js} +5 -6
- package/dist/{runtime-feature-guard-B64MMW9I.js → runtime-feature-guard-DpUn4Oxc.js} +91 -10
- package/dist/scan-module-B1A24jqP.js +1 -0
- package/dist/{scan-module-Df58L_6T.js → scan-module-BfZvDBxb.js} +2 -4
- package/dist/{schema-form-C-fy3xaU.d.ts → schema-form-Bl79Bdm-.d.ts} +0 -2
- package/dist/{secret-Dy5uqvq9.js → secret-D2KL_o2h.js} +2 -3
- package/dist/{sections-Do7X4Nwt.d.ts → sections-0qrBvGbf.d.ts} +0 -4
- package/dist/{sections-C83x0slv.js → sections-BNTdIEJw.js} +2 -3
- package/dist/{sections-BogiCmtz.d.ts → sections-BTfWK14a.d.ts} +4 -6
- package/dist/{sections-DumoLKQN.js → sections-BiCOk9qP.js} +1 -2
- package/dist/sections-DAtgYMVz.d.ts +8 -0
- package/dist/{sections-et20h8w3.js → sections-HLxb9MrG.js} +14 -7
- package/dist/{sections.get-COiLcQ0P.d.ts → sections.get-CGmtYmfu.d.ts} +2 -4
- package/dist/seo/runtime.d.ts +2 -5
- package/dist/seo/runtime.js +3 -5
- package/dist/{seo-CtLywyRx.d.ts → seo-CgW5uI9L.d.ts} +0 -2
- package/dist/seo.d.ts +1 -1
- package/dist/seo.js +1 -2
- package/dist/{server-BRJE4t-W.js → server-DsOEa4_A.js} +5 -5
- package/dist/{setup-ZbA1by7W.d.ts → setup-Ca7jtBLS.d.ts} +8 -7
- package/dist/{setup-C-5nB7aY.js → setup-DQz_i-ee.js} +16 -5
- package/dist/{site-access-BmE8HGxs.js → site-access-1JIQjY11.js} +16 -16
- package/dist/{site-access-DxfdOel1.d.ts → site-access-CUXIbbbR.d.ts} +0 -2
- package/dist/{site-access-BycrwM2v.js → site-access-CmaZ-oaL.js} +1 -2
- package/dist/site-access-Cvmjb6aw.js +1 -0
- package/dist/{site-session-odJq1dYa.js → site-session-D36fr7Wf.js} +65 -40
- package/dist/skills/operations.d.ts +1 -5
- package/dist/skills/operations.js +4 -5
- package/dist/skills/vitehub/SKILL.md +142 -0
- package/dist/skills/vitehub/agents/openai.yaml +4 -0
- package/dist/skills/vitehub/references/agent-definitions.md +36 -0
- package/dist/skills/vitehub/references/bundle.md +57 -0
- package/dist/skills/vitehub/references/capabilities-authority.md +30 -0
- package/dist/skills/vitehub/references/channels-triggers.md +27 -0
- package/dist/skills/vitehub/references/framework-composition.md +29 -0
- package/dist/skills/vitehub/references/preview-contract.md +44 -0
- package/dist/skills/vitehub/references/primitives/auth.md +14 -0
- package/dist/skills/vitehub/references/primitives/blob.md +13 -0
- package/dist/skills/vitehub/references/primitives/browser.md +17 -0
- package/dist/skills/vitehub/references/primitives/cache.md +13 -0
- package/dist/skills/vitehub/references/primitives/channels.md +11 -0
- package/dist/skills/vitehub/references/primitives/connections.md +14 -0
- package/dist/skills/vitehub/references/primitives/content.md +13 -0
- package/dist/skills/vitehub/references/primitives/database.md +15 -0
- package/dist/skills/vitehub/references/primitives/email.md +11 -0
- package/dist/skills/vitehub/references/primitives/env.md +13 -0
- package/dist/skills/vitehub/references/primitives/kv.md +13 -0
- package/dist/skills/vitehub/references/primitives/markdown-template.md +13 -0
- package/dist/skills/vitehub/references/primitives/queue.md +14 -0
- package/dist/skills/vitehub/references/primitives/rate-limit.md +11 -0
- package/dist/skills/vitehub/references/primitives/realtime.md +19 -0
- package/dist/skills/vitehub/references/primitives/sandbox-task.md +11 -0
- package/dist/skills/vitehub/references/primitives/sandbox.md +13 -0
- package/dist/skills/vitehub/references/primitives/schedule.md +11 -0
- package/dist/skills/vitehub/references/primitives/shell.md +11 -0
- package/dist/skills/vitehub/references/primitives/source.md +11 -0
- package/dist/skills/vitehub/references/primitives/workflow.md +11 -0
- package/dist/skills/vitehub/references/primitives/workspace.md +11 -0
- package/dist/skills/vitehub/references/project-patterns.md +19 -0
- package/dist/skills/vitehub/references/project-shapes.md +81 -0
- package/dist/skills/vitehub/references/proof-recovery.md +31 -0
- package/dist/skills/vitehub/references/sandboxes-hosts.md +26 -0
- package/dist/skills/vitehub/references/schedules-workflows-invocations.md +28 -0
- package/dist/skills/vitehub/references/server-primitives.md +39 -0
- package/dist/skills/vitehub/references/workspaces-sources-access.md +26 -0
- package/dist/{skills-DdpSMiCI.js → skills-C1MaGEbO.js} +1 -2
- package/dist/skills.d.ts +1 -2
- package/dist/{skills.get-Bl8cBe8u.js → skills.get-DAooGWy5.js} +3 -4
- package/dist/skills.js +1 -2
- package/dist/{source-D4wWtoHh.js → source-DYFndd0W.js} +2 -3
- package/dist/{source-S-LChQvw.d.ts → source-DemBtwla.d.ts} +0 -2
- package/dist/{stored-Dhv2qsQv.js → stored-J3TetMKf.js} +1 -2
- package/dist/task/operations.d.ts +1 -5
- package/dist/task/operations.js +3 -4
- package/dist/test/register.js +2 -3
- package/dist/test.d.ts +0 -4
- package/dist/test.js +1 -2
- package/dist/{ticket-Pr_8ZtXW.d.ts → ticket-BFWwevWN.d.ts} +0 -2
- package/dist/{ticket-Cudn1dq3.js → ticket-BwsnryuU.js} +2 -3
- package/dist/{tickets-C_0Fhc00.js → tickets-Cj9_y3gw.js} +14 -16
- package/dist/ui/motion/core.d.ts +1 -0
- package/dist/ui/motion/core.js +2 -0
- package/dist/ui/motion.d.ts +1 -0
- package/dist/ui/motion.js +2 -0
- package/dist/ui/vite.js +1 -2
- package/dist/{usage-CoQXs5nW.d.ts → usage-BduF04ks.d.ts} +0 -2
- package/dist/{usage-B4taNt4a.js → usage-ZV3TBMzE.js} +6 -5
- package/dist/{usage-index-BsGAFzyq.js → usage-index-CR_xTrXO.js} +3 -4
- package/dist/{version-DNmSsk5r.js → version-CAhBr673.js} +59 -21
- package/dist/{vite-stage-mmtwQIMA.js → vite-stage-Dmo4RgnK.js} +32 -8
- package/dist/{vue-router-C68IU1jM.d.ts → vue-router-plZJLlpm.d.ts} +120 -182
- package/dist/workspace/blob-database/postgres.d.ts +1 -0
- package/dist/workspace/blob-database/postgres.js +2 -0
- package/dist/{workspace-history-CraoERnc.js → workspace-history-B52xib2J.js} +3 -4
- package/dist/{workspace-history-CeVwBB6Q.d.ts → workspace-history-WuxgLsi4.d.ts} +0 -2
- package/package.json +190 -149
- package/dist/agents-BoWau_ei.js +0 -2
- package/dist/cli-config-UAGTmuFa.js +0 -2
- package/dist/console/runtime/server/page-session.d.ts +0 -2
- package/dist/console/runtime/server/page-session.js +0 -5
- package/dist/console-lazy-views-DXnIkdyd.js +0 -2
- package/dist/operations-CAQmIxGK.js +0 -2
- package/dist/project-C4N_Zcjl.js +0 -30
- package/dist/request-origin-Bq7mDQG9.js +0 -23
- package/dist/scan-module-D_3X08mj.js +0 -2
- package/dist/sections-CyrXbbkG.d.ts +0 -10
- package/dist/site-access-BbJUe5QI.js +0 -2
- /package/dist/{agent/channels.d.ts → channels/adapters.d.ts} +0 -0
- /package/dist/{agent/channels.js → channels/adapters.js} +0 -0
package/dist/nuxt.js
CHANGED
|
@@ -1,26 +1,62 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { n as installConsoleProjectName, r as installConsoleSections } from "./setup-
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
1
|
+
import { $ as startViteHubHints, A as cloudflareEmailDevShimSource, B as disabledUpstashDriver, C as consoleDocumentEditorSectionIds, D as staleChunkReloadPluginName, E as installStaleChunkReloadNuxt, F as defaultJournalNeedsLibsql, G as resolveDefinitionFeatures, H as hasUpstashStore, I as writeAgentInvocationsNitroPlugin, J as nitroCacheBypass, K as markCmsPresetFeaturesResolved, L as generatedModules, M as VITEHUB_AGENT_JOURNAL_STORE, N as assertAgentInvocationsRetention, O as drizzleBuildCheckPlugin, P as assertAgentInvocationsUrl, Q as reportViteHubHint, R as disabledKVConfigModule, S as consoleContributedSections, T as isConsoleContributedSectionId, U as redisDriverSpecifier, V as hasRedisStore, W as upstashDriverSpecifier, X as importRolldownExperimental, Y as describeDeploymentPlanOutput, Z as VITEHUB_NUXT_HINTS, _ as addConsoleRpcHandler, _t as VITEHUB_SERVER_DIRS, a as cloudflareExportConditions, at as isDefaultAgentJournal, b as resolveConsoleProjectName, bt as resolveViteHubProjectRoot, c as consoleInvocationRootPlugin, ct as isIncludedNitroPlugin, d as resolveConsoleAccessBuild, et as agentJournalStateUrl, f as resolveConsoleOptions, ft as VITEHUB_APP_BASE_URL, g as addConsoleAppRoutes, gt as VITEHUB_PROJECT_ROOT, h as consoleOperationFeatures, ht as VITEHUB_PREPARE, i as installBrowserErrorsNuxt, it as withDataDir, j as cloudflareWorkersDevShimSource, k as forgeBuildCheckPlugin, l as consoleOperationContributions, m as consoleDevAccessNotice, mt as VITEHUB_NITRO_CONFIG_CONTEXT, n as resolveSandboxTaskDriver, nt as withComments, o as assertConsoleAccess, ot as hasSyncDirectory, p as resolveGeneratedConsolePlugin, pt as VITEHUB_GENERATED_ROOT, q as resolveCmsPresetFeatures, r as viteHubPlugins, rt as withConnectionsDatabase, s as assertConsoleProductionAuth, st as ownerModules, t as applyCloudflareNodeCompatOptOut, tt as defaultDatabaseD1Binding, u as generatedConsolePluginRegistration, ut as withPrintedDiagnostics, v as serializeConsoleRefresh, vt as getResolvedFeatureOptions, w as discoverConsoleEntrySections, x as discoverConsoleBuildCatalog, y as writeConsoleNitroPlugin, yt as resolveNuxtServerDirs, z as disabledRedisDriver } from "./plugins-H6-MQrsn.js";
|
|
2
|
+
import { t as invariant } from "./invariant-Dj2R1eMr.js";
|
|
3
|
+
import { f as writeFileIfChanged } from "./definition-catalog-1xPPtzOx.js";
|
|
4
|
+
import { n as addViteHubDevPeerUpgradeSigner, t as addViteHubDevPeerDevHandler } from "./dev-peer-DBq-isgi.js";
|
|
5
|
+
import { i as removeViteHubDevServerFile, o as writeViteHubDevServerFile } from "./vite-stage-Dmo4RgnK.js";
|
|
6
|
+
import { n as isRecord } from "./object-DRSmpe04.js";
|
|
7
|
+
import { a as normalizeNitroPreset, c as resolveDeploymentPlan, i as hostFromNitroPreset, s as resolveBuildHost } from "./deployment-CURATxjG.js";
|
|
8
|
+
import { i as importOptionalOwner, l as requireOptionalOwner, o as isPackageInstalled, u as startPackageChecks } from "./optional-owners-DAfShdgV.js";
|
|
9
|
+
import { n as installConsoleProjectName, r as installConsoleSections } from "./setup-DQz_i-ee.js";
|
|
10
|
+
import { D as resolveConsoleSectionIds, v as insertConsoleSection } from "./sections-BiCOk9qP.js";
|
|
11
|
+
import { t as viteHubErrorDiagnostics } from "./error-diagnostics-CBtvqI30.js";
|
|
12
|
+
import { n as assertNoRemovedViteHubOptions } from "./version-CAhBr673.js";
|
|
13
|
+
import { n as viteHubServerImports$1 } from "./nuxt-server-imports-BdJqiVhT.js";
|
|
12
14
|
import { findPackageJSON } from "node:module";
|
|
13
15
|
import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
14
16
|
import { existsSync, readFileSync, readdirSync, realpathSync } from "node:fs";
|
|
15
17
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
16
|
-
import { mkdir, writeFile } from "node:fs/promises";
|
|
18
|
+
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
17
19
|
import * as v from "valibot";
|
|
18
20
|
import { mergeGeneratedSourceNitroConfig } from "@vite-hub/source/vite";
|
|
19
|
-
import { mergeConfig } from "vite";
|
|
21
|
+
import { createLogger, mergeConfig } from "vite";
|
|
20
22
|
import { createEnvImportAliases } from "@vite-hub/env/vite";
|
|
21
23
|
import { nuxtPageRoutes } from "@vite-hub/bundle/vite";
|
|
22
24
|
import { findNearestFile } from "pkg-types";
|
|
23
|
-
|
|
25
|
+
// ../internal/src/build/nuxt-vue-imports.ts
|
|
26
|
+
const fallbacksByApp = /* @__PURE__ */ new WeakMap();
|
|
27
|
+
function addNuxtVueImports(nuxt, from, names) {
|
|
28
|
+
let fallbacks = fallbacksByApp.get(nuxt);
|
|
29
|
+
if (!fallbacks) {
|
|
30
|
+
const importsByName = /* @__PURE__ */ new Map();
|
|
31
|
+
fallbacks = importsByName;
|
|
32
|
+
fallbacksByApp.set(nuxt, importsByName);
|
|
33
|
+
const warned = /* @__PURE__ */ new Set();
|
|
34
|
+
nuxt.hook?.("imports:context", async (context) => {
|
|
35
|
+
await context.getImports();
|
|
36
|
+
context.getInternalContext().addons.push({
|
|
37
|
+
name: "vitehub:vue-imports",
|
|
38
|
+
extendImports(imports) {
|
|
39
|
+
const owners = new Map(imports.filter((entry) => !entry.disabled && !entry.type).map((entry) => [entry.as ?? entry.name, entry.from]));
|
|
40
|
+
for (const [name, fallback] of importsByName) {
|
|
41
|
+
const owner = owners.get(name);
|
|
42
|
+
if (owner === void 0) imports.push({
|
|
43
|
+
as: name,
|
|
44
|
+
from: fallback,
|
|
45
|
+
name
|
|
46
|
+
});
|
|
47
|
+
else if (owner !== fallback && !warned.has(name)) {
|
|
48
|
+
warned.add(name);
|
|
49
|
+
const source = isAbsolute(owner) ? relative(nuxt.options.rootDir || process.cwd(), owner) : owner;
|
|
50
|
+
console.warn(`[vitehub] ${source} already auto-imports \`${name}\`, so ViteHub does not auto-import it from ${fallback}. Import ViteHub's composable from "${fallback}" where you need it.`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
for (const name of names) if (!fallbacks.has(name)) fallbacks.set(name, from);
|
|
58
|
+
}
|
|
59
|
+
// src/internal/nitro-optional-peers.ts
|
|
24
60
|
const manifestSchema = v.object({
|
|
25
61
|
optionalDependencies: v.optional(v.record(v.string(), v.string())),
|
|
26
62
|
peerDependenciesMeta: v.optional(v.record(v.string(), v.object({ optional: v.optional(v.boolean()) })))
|
|
@@ -65,8 +101,138 @@ function nitroOptionalPeers(config = {}) {
|
|
|
65
101
|
}
|
|
66
102
|
};
|
|
67
103
|
}
|
|
68
|
-
|
|
69
|
-
|
|
104
|
+
// src/internal/nitro-replay.ts
|
|
105
|
+
/** Node stubs for the Cloudflare runtime modules that ViteHub's generated server code imports. */
|
|
106
|
+
const cloudflareDevShims = {
|
|
107
|
+
"cloudflare:email": {
|
|
108
|
+
file: "cloudflare-email.dev.mjs",
|
|
109
|
+
source: cloudflareEmailDevShimSource
|
|
110
|
+
},
|
|
111
|
+
"cloudflare:workers": {
|
|
112
|
+
file: "cloudflare-workers.dev.mjs",
|
|
113
|
+
source: cloudflareWorkersDevShimSource
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
function isCloudflareDevShim(id) {
|
|
117
|
+
return Object.hasOwn(cloudflareDevShims, id);
|
|
118
|
+
}
|
|
119
|
+
const nitroRuntimeResolverNames = /* @__PURE__ */ new Set([
|
|
120
|
+
"@vite-hub/auth/vite",
|
|
121
|
+
"@vite-hub/blob/vite",
|
|
122
|
+
"@vite-hub/browser/vite",
|
|
123
|
+
"@vite-hub/email/vite",
|
|
124
|
+
"@vite-hub/i18n/vite",
|
|
125
|
+
"@vite-hub/kv/vite",
|
|
126
|
+
"@vite-hub/markdown-template/vite",
|
|
127
|
+
"@vite-hub/realtime/vite",
|
|
128
|
+
"@vite-hub/schedule/vite",
|
|
129
|
+
"@vite-hub/source/vite",
|
|
130
|
+
"vite-hub/optional-owner-imports",
|
|
131
|
+
"vite-hub/cloudflare-sh-syntax",
|
|
132
|
+
"vite-hub/durability",
|
|
133
|
+
"vite-hub/cloudflare-pkce-challenge",
|
|
134
|
+
"vite-hub/unavailable-services"
|
|
135
|
+
]);
|
|
136
|
+
const nitroServerTransformNames = /* @__PURE__ */ new Set([
|
|
137
|
+
"@vite-hub/env/vite",
|
|
138
|
+
"@vite-hub/i18n/vite",
|
|
139
|
+
"@vite-hub/schedule/vite",
|
|
140
|
+
"@vite-hub/source/vite",
|
|
141
|
+
"@vite-hub/workflow/vite"
|
|
142
|
+
]);
|
|
143
|
+
const nitroConfigResolvedNames = /* @__PURE__ */ new Set([
|
|
144
|
+
...nitroRuntimeResolverNames,
|
|
145
|
+
"@vite-hub/content/vite",
|
|
146
|
+
"@vite-hub/sandbox/task/vite",
|
|
147
|
+
"@vite-hub/workflow/vite",
|
|
148
|
+
"vite-hub/agent-invocations"
|
|
149
|
+
]);
|
|
150
|
+
function pluginResolveIdHandler(plugin) {
|
|
151
|
+
if (typeof plugin.resolveId === "function") return plugin.resolveId;
|
|
152
|
+
return plugin.resolveId?.handler;
|
|
153
|
+
}
|
|
154
|
+
function pluginLoadHandler(plugin) {
|
|
155
|
+
if (typeof plugin.load === "function") return plugin.load;
|
|
156
|
+
return plugin.load?.handler;
|
|
157
|
+
}
|
|
158
|
+
function withHookFilter(hook, handler) {
|
|
159
|
+
return isRecord(hook) && hook.filter !== void 0 ? {
|
|
160
|
+
filter: hook.filter,
|
|
161
|
+
handler
|
|
162
|
+
} : handler;
|
|
163
|
+
}
|
|
164
|
+
function nitroRuntimeResolver(plugin, config, agentOptions) {
|
|
165
|
+
const resolveId = nitroRuntimeResolverNames.has(plugin.name) ? pluginResolveIdHandler(plugin) : void 0;
|
|
166
|
+
const load = nitroRuntimeResolverNames.has(plugin.name) ? pluginLoadHandler(plugin) : void 0;
|
|
167
|
+
const transformWorkspaceAgent = plugin.vitehub?.agent?.transformWorkspaceAgent;
|
|
168
|
+
const serverTransform = !transformWorkspaceAgent && nitroServerTransformNames.has(plugin.name) ? typeof plugin.transform === "function" ? plugin.transform : plugin.transform?.handler : void 0;
|
|
169
|
+
if (!resolveId && !load && !transformWorkspaceAgent && !serverTransform) return;
|
|
170
|
+
const replayResolveId = resolveId && function(id, importer, options) {
|
|
171
|
+
if (isCloudflareDevShim(id) && isRecord(config.alias) && typeof config.alias[id] === "string") return;
|
|
172
|
+
return resolveId.call(this, id, importer, {
|
|
173
|
+
...options,
|
|
174
|
+
ssr: true
|
|
175
|
+
});
|
|
176
|
+
};
|
|
177
|
+
const replayLoad = load && function(id, options) {
|
|
178
|
+
return load.call(this, id, {
|
|
179
|
+
...options,
|
|
180
|
+
ssr: true
|
|
181
|
+
});
|
|
182
|
+
};
|
|
183
|
+
const replayServerTransform = serverTransform && function(code, id, options) {
|
|
184
|
+
return serverTransform.call(this, code, id, {
|
|
185
|
+
moduleType: "js",
|
|
186
|
+
...options,
|
|
187
|
+
ssr: true
|
|
188
|
+
});
|
|
189
|
+
};
|
|
190
|
+
const originalHooks = {
|
|
191
|
+
...replayResolveId ? { resolveId: withHookFilter(plugin.resolveId, replayResolveId) } : {},
|
|
192
|
+
...replayLoad ? { load: withHookFilter(plugin.load, replayLoad) } : {},
|
|
193
|
+
...replayServerTransform ? { transform: withHookFilter(plugin.transform, replayServerTransform) } : {}
|
|
194
|
+
};
|
|
195
|
+
return {
|
|
196
|
+
originalHooks,
|
|
197
|
+
plugin: {
|
|
198
|
+
name: `vite-hub/nuxt-runtime-resolver:${plugin.name}`,
|
|
199
|
+
...originalHooks,
|
|
200
|
+
...plugin.name === "@vite-hub/i18n/vite" && plugin.renderChunk ? { renderChunk: plugin.renderChunk } : {},
|
|
201
|
+
...transformWorkspaceAgent ? { transform: {
|
|
202
|
+
filter: { id: /\.[cm]?[jt]s(?:[?#]|$)/i },
|
|
203
|
+
handler: (code, id) => transformWorkspaceAgent(code, id, agentOptions)
|
|
204
|
+
} } : {}
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
// src/internal/nitro-vite-imports.ts
|
|
209
|
+
const rawImport = /[?&]raw(?:[&#]|$)/;
|
|
210
|
+
/** Loads `?raw` imports as a string default export, as Vite does. */
|
|
211
|
+
function nitroRawImports() {
|
|
212
|
+
return {
|
|
213
|
+
name: "vite-hub/nitro-raw-imports",
|
|
214
|
+
load: {
|
|
215
|
+
filter: { id: rawImport },
|
|
216
|
+
async handler(id) {
|
|
217
|
+
const file = id.replace(/[?#].*$/s, "");
|
|
218
|
+
this.addWatchFile(file);
|
|
219
|
+
return {
|
|
220
|
+
code: `export default ${JSON.stringify(await readFile(file, "utf8"))}`,
|
|
221
|
+
moduleType: "js"
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* The Vite syntax that server code can use in Nuxt 5, for Nuxt 4.7's separate Rolldown build of Nitro: `import.meta.glob()`
|
|
229
|
+
* and `?raw` imports.
|
|
230
|
+
*/
|
|
231
|
+
async function nitroViteImports(root, rolldownPath) {
|
|
232
|
+
const { viteImportGlobPlugin } = await importRolldownExperimental(root, rolldownPath);
|
|
233
|
+
return [viteImportGlobPlugin({ root }), nitroRawImports()];
|
|
234
|
+
}
|
|
235
|
+
// src/internal/nuxt-image.ts
|
|
70
236
|
function usesNuxtImage(modules) {
|
|
71
237
|
return (modules ?? []).some((entry) => (Array.isArray(entry) ? entry[0] : entry) === "@nuxt/image");
|
|
72
238
|
}
|
|
@@ -93,8 +259,40 @@ function nuxtImageProviderDependency(options) {
|
|
|
93
259
|
optional: true
|
|
94
260
|
} };
|
|
95
261
|
}
|
|
96
|
-
|
|
97
|
-
|
|
262
|
+
// src/nuxt-server-imports.ts
|
|
263
|
+
/**
|
|
264
|
+
* The server helpers that `vite-hub/nuxt` auto-imports in Nitro code, per ViteHub feature, when the app turns on
|
|
265
|
+
* Nuxt's server auto-imports (see {@link nuxtServerAutoImportsEnabled}). The table lives in
|
|
266
|
+
* `@vite-hub/internal/nuxt-server-imports`, so the `nuxt-server-imports` codemod reads the same list.
|
|
267
|
+
*
|
|
268
|
+
* The `satisfies` check fails the typecheck when a name is not a value export of its `vite-hub/*` entry.
|
|
269
|
+
*/
|
|
270
|
+
const viteHubServerImports = viteHubServerImports$1;
|
|
271
|
+
/**
|
|
272
|
+
* Whether the app turns on Nuxt's server auto-imports, with `experimental.nitroAutoImports` or `nitroLegacy.imports`
|
|
273
|
+
* (`nitroLegacy: true` includes it). Nuxt 5 makes the same check before it adds the Nitro and H3 helpers.
|
|
274
|
+
*/
|
|
275
|
+
function nuxtServerAutoImportsEnabled(options) {
|
|
276
|
+
if (options.experimental?.nitroAutoImports === true) return true;
|
|
277
|
+
const legacy = options.nitroLegacy;
|
|
278
|
+
if (legacy === true) return true;
|
|
279
|
+
if (typeof legacy !== "object" || legacy === null) return false;
|
|
280
|
+
return Boolean(("imports" in legacy ? legacy.imports : void 0) ?? true);
|
|
281
|
+
}
|
|
282
|
+
/** The import entries for the enabled features, in table order. */
|
|
283
|
+
function resolveViteHubServerImports(enabled) {
|
|
284
|
+
const imports = [];
|
|
285
|
+
for (const [feature, sources] of Object.entries(viteHubServerImports)) {
|
|
286
|
+
if (!enabled[feature]) continue;
|
|
287
|
+
for (const [from, names] of Object.entries(sources)) for (const name of names) imports.push({
|
|
288
|
+
from,
|
|
289
|
+
name,
|
|
290
|
+
priority: -1
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
return imports;
|
|
294
|
+
}
|
|
295
|
+
// src/nuxt.ts
|
|
98
296
|
const doctorExtensionEntry = fileURLToPath(new URL("./doctor", import.meta.url));
|
|
99
297
|
const consoleRuntimeRoot = fileURLToPath(new URL("./console/runtime", import.meta.url));
|
|
100
298
|
/** True when the app names a Blob driver or stores, which works on hosts without a default Blob store. */
|
|
@@ -156,6 +354,7 @@ const agentVueComposables = [
|
|
|
156
354
|
];
|
|
157
355
|
const h3RuntimeRoot = dirname(fileURLToPath(import.meta.resolve("h3/package.json")));
|
|
158
356
|
const cloudflareTypes = fileURLToPath(new URL("./cloudflare-types.d.ts", import.meta.url));
|
|
357
|
+
const cloudflareAppTypes = fileURLToPath(new URL("./cloudflare-app-types.d.ts", import.meta.url));
|
|
159
358
|
const cloudflareWorkersDeclaration = fileURLToPath(new URL("./cloudflare-workers.d.ts", import.meta.url));
|
|
160
359
|
function emailTemplateResolver(root) {
|
|
161
360
|
const { resolveEmailTemplateModulePath } = requireOptionalOwner(ownerModules.emailVite, "email");
|
|
@@ -174,20 +373,6 @@ function isExternalId(external, id, importer, isResolved) {
|
|
|
174
373
|
if (external === void 0) return false;
|
|
175
374
|
return [external].flat().some((entry) => typeof entry === "string" ? entry === id : entry.test(id));
|
|
176
375
|
}
|
|
177
|
-
/** Node stubs for the Cloudflare runtime modules that ViteHub's generated server code imports. */
|
|
178
|
-
const cloudflareDevShims = {
|
|
179
|
-
"cloudflare:email": {
|
|
180
|
-
file: "cloudflare-email.dev.mjs",
|
|
181
|
-
source: cloudflareEmailDevShimSource
|
|
182
|
-
},
|
|
183
|
-
"cloudflare:workers": {
|
|
184
|
-
file: "cloudflare-workers.dev.mjs",
|
|
185
|
-
source: cloudflareWorkersDevShimSource
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
function isCloudflareDevShim(id) {
|
|
189
|
-
return Object.hasOwn(cloudflareDevShims, id);
|
|
190
|
-
}
|
|
191
376
|
/**
|
|
192
377
|
* `nuxt dev` with the Cloudflare preset runs the server on Node, where ViteHub aliases `cloudflare:workers` and
|
|
193
378
|
* `cloudflare:email` to Node stubs. ViteHub's generated Nitro plugins list those schemes as external for the Worker
|
|
@@ -251,7 +436,7 @@ function normalizeGeneratedNitroPlugins(config, root) {
|
|
|
251
436
|
}
|
|
252
437
|
/**
|
|
253
438
|
* Put these plugins before Nitro's own resolvers, so they see generated and cache imports first. Each one goes first, so
|
|
254
|
-
* in a build
|
|
439
|
+
* in a build the Forge and Drizzle checks can see imports before Nitro resolves them.
|
|
255
440
|
*/
|
|
256
441
|
function installNitroBuildPlugins(config, generatedRoots, dev = false, sections = [], build = false) {
|
|
257
442
|
const rollupConfig = config.rollupConfig ??= {};
|
|
@@ -262,42 +447,13 @@ function installNitroBuildPlugins(config, generatedRoots, dev = false, sections
|
|
|
262
447
|
nitroOptionalPeers(config),
|
|
263
448
|
consoleOperationFeatures(sections),
|
|
264
449
|
...dev ? [nitroCloudflareWorkersDev] : [],
|
|
265
|
-
...build ? [forgeBuildCheckPlugin()] : []
|
|
450
|
+
...build ? [forgeBuildCheckPlugin(), withPrintedDiagnostics(drizzleBuildCheckPlugin())] : []
|
|
266
451
|
]) if (!plugins.some((candidate) => candidate.name === plugin.name)) plugins.unshift(plugin);
|
|
267
452
|
}
|
|
268
453
|
function pluginOptionHasName(option, name) {
|
|
269
454
|
if (Array.isArray(option)) return option.some((candidate) => pluginOptionHasName(candidate, name));
|
|
270
455
|
return Boolean(option && Reflect.get(Object(option), "name") === name);
|
|
271
456
|
}
|
|
272
|
-
const nitroRuntimeResolverNames = /* @__PURE__ */ new Set([
|
|
273
|
-
"@vite-hub/auth/vite",
|
|
274
|
-
"@vite-hub/blob/vite",
|
|
275
|
-
"@vite-hub/browser/vite",
|
|
276
|
-
"@vite-hub/email/vite",
|
|
277
|
-
"@vite-hub/kv/vite",
|
|
278
|
-
"@vite-hub/markdown-template/vite",
|
|
279
|
-
"@vite-hub/realtime/vite",
|
|
280
|
-
"vite-hub/optional-owner-imports",
|
|
281
|
-
"vite-hub/cloudflare-sh-syntax",
|
|
282
|
-
"vite-hub/durability",
|
|
283
|
-
"vite-hub/cloudflare-pkce-challenge",
|
|
284
|
-
"vite-hub/unavailable-services"
|
|
285
|
-
]);
|
|
286
|
-
const nitroConfigResolvedNames = /* @__PURE__ */ new Set([
|
|
287
|
-
...nitroRuntimeResolverNames,
|
|
288
|
-
"@vite-hub/content/vite",
|
|
289
|
-
"@vite-hub/sandbox/task/vite",
|
|
290
|
-
"@vite-hub/schedule/vite",
|
|
291
|
-
"@vite-hub/workflow/vite"
|
|
292
|
-
]);
|
|
293
|
-
function pluginResolveIdHandler(plugin) {
|
|
294
|
-
if (typeof plugin.resolveId === "function") return plugin.resolveId;
|
|
295
|
-
return plugin.resolveId?.handler;
|
|
296
|
-
}
|
|
297
|
-
function pluginLoadHandler(plugin) {
|
|
298
|
-
if (typeof plugin.load === "function") return plugin.load;
|
|
299
|
-
return plugin.load?.handler;
|
|
300
|
-
}
|
|
301
457
|
function pluginConfigResolvedHandler(plugin) {
|
|
302
458
|
if (typeof plugin.configResolved === "function") return plugin.configResolved;
|
|
303
459
|
return plugin.configResolved?.handler;
|
|
@@ -307,63 +463,20 @@ function asReplayResolvedConfig(config) {
|
|
|
307
463
|
find,
|
|
308
464
|
replacement
|
|
309
465
|
}));
|
|
466
|
+
if (!("logger" in config)) Object.assign(config, { logger: createLogger("silent") });
|
|
310
467
|
return config;
|
|
311
468
|
}
|
|
312
|
-
async function finalizeNitroReplayPlugins(plugins, config) {
|
|
469
|
+
async function finalizeNitroReplayPlugins(plugins, config, nitroOnly) {
|
|
313
470
|
const databaseOwners = plugins.filter((plugin) => plugin.name === "@vite-hub/database/vite");
|
|
314
|
-
const consumers = plugins.filter((plugin) => nitroConfigResolvedNames.has(plugin.name));
|
|
471
|
+
const consumers = plugins.filter((plugin) => nitroConfigResolvedNames.has(plugin.name) || nitroOnly && plugin.name === "@vite-hub/env/vite");
|
|
315
472
|
for (const plugin of [...databaseOwners, ...consumers]) {
|
|
316
473
|
const configResolved = pluginConfigResolvedHandler(plugin);
|
|
317
474
|
if (!configResolved) continue;
|
|
318
475
|
await configResolved.call({}, asReplayResolvedConfig(config));
|
|
319
476
|
}
|
|
320
477
|
}
|
|
321
|
-
/** Keep the hook's filter, so the bundler skips the replayed hook for ids that the plugin does not own. */
|
|
322
|
-
function withHookFilter(hook, handler) {
|
|
323
|
-
return isRecord(hook) && hook.filter !== void 0 ? {
|
|
324
|
-
filter: hook.filter,
|
|
325
|
-
handler
|
|
326
|
-
} : handler;
|
|
327
|
-
}
|
|
328
|
-
function nitroRuntimeResolver(plugin, config, agentOptions) {
|
|
329
|
-
const resolveId = nitroRuntimeResolverNames.has(plugin.name) ? pluginResolveIdHandler(plugin) : void 0;
|
|
330
|
-
const load = nitroRuntimeResolverNames.has(plugin.name) ? pluginLoadHandler(plugin) : void 0;
|
|
331
|
-
const transformWorkspaceAgent = plugin.vitehub?.agent?.transformWorkspaceAgent;
|
|
332
|
-
const workflowTransform = plugin.name === "@vite-hub/workflow/vite" ? typeof plugin.transform === "function" ? plugin.transform : plugin.transform?.handler : void 0;
|
|
333
|
-
if (!resolveId && !load && !transformWorkspaceAgent && !workflowTransform) return;
|
|
334
|
-
const replayResolveId = resolveId && function(id, importer, options) {
|
|
335
|
-
if (isCloudflareDevShim(id) && isRecord(config.alias) && typeof config.alias[id] === "string") return;
|
|
336
|
-
return resolveId.call(this, id, importer, {
|
|
337
|
-
...options,
|
|
338
|
-
ssr: true
|
|
339
|
-
});
|
|
340
|
-
};
|
|
341
|
-
const replayLoad = load && function(id, options) {
|
|
342
|
-
return load.call(this, id, {
|
|
343
|
-
...options,
|
|
344
|
-
ssr: true
|
|
345
|
-
});
|
|
346
|
-
};
|
|
347
|
-
const replayWorkflowTransform = workflowTransform && function(code, id, options) {
|
|
348
|
-
return workflowTransform.call(this, code, id, {
|
|
349
|
-
moduleType: "js",
|
|
350
|
-
...options,
|
|
351
|
-
ssr: true
|
|
352
|
-
});
|
|
353
|
-
};
|
|
354
|
-
return {
|
|
355
|
-
name: `vite-hub/nuxt-runtime-resolver:${plugin.name}`,
|
|
356
|
-
...replayResolveId ? { resolveId: withHookFilter(plugin.resolveId, replayResolveId) } : {},
|
|
357
|
-
...replayLoad ? { load: withHookFilter(plugin.load, replayLoad) } : {},
|
|
358
|
-
...replayWorkflowTransform ? { transform: withHookFilter(plugin.transform, replayWorkflowTransform) } : {},
|
|
359
|
-
...transformWorkspaceAgent ? { transform: {
|
|
360
|
-
filter: { id: /\.[cm]?[jt]s(?:[?#]|$)/i },
|
|
361
|
-
handler: (code, id) => transformWorkspaceAgent(code, id, agentOptions)
|
|
362
|
-
} } : {}
|
|
363
|
-
};
|
|
364
|
-
}
|
|
365
478
|
function installNitroRuntimeResolvers(config, plugins, agentOptions) {
|
|
366
|
-
const resolvers = plugins.map((plugin) => nitroRuntimeResolver(plugin, config, agentOptions)).filter((plugin) => Boolean(plugin));
|
|
479
|
+
const resolvers = plugins.map((plugin) => nitroRuntimeResolver(plugin, config, agentOptions)?.plugin).filter((plugin) => Boolean(plugin));
|
|
367
480
|
if (!resolvers.length) return;
|
|
368
481
|
const rollupConfig = config.rollupConfig ??= {};
|
|
369
482
|
const configuredPlugins = rollupConfig.plugins;
|
|
@@ -371,6 +484,16 @@ function installNitroRuntimeResolvers(config, plugins, agentOptions) {
|
|
|
371
484
|
rollupConfig.plugins = nitroPlugins;
|
|
372
485
|
for (const resolver of resolvers) if (!nitroPlugins.some((candidate) => pluginOptionHasName(candidate, resolver.name))) nitroPlugins.push(resolver);
|
|
373
486
|
}
|
|
487
|
+
async function installNitroViteImports(config, root) {
|
|
488
|
+
const rollupConfig = config.rollupConfig ??= {};
|
|
489
|
+
const configuredPlugins = rollupConfig.plugins;
|
|
490
|
+
const plugins = Array.isArray(configuredPlugins) ? configuredPlugins : configuredPlugins ? [configuredPlugins] : [];
|
|
491
|
+
rollupConfig.plugins = plugins;
|
|
492
|
+
if (plugins.some((plugin) => isRecord(plugin) && plugin.name === "vite-hub/nitro-raw-imports")) return;
|
|
493
|
+
const paths = isRecord(config.deps) ? config.deps.paths : void 0;
|
|
494
|
+
const rolldownPath = isRecord(paths) && typeof paths.rolldown === "string" ? paths.rolldown : void 0;
|
|
495
|
+
plugins.push(...await nitroViteImports(root, rolldownPath));
|
|
496
|
+
}
|
|
374
497
|
function addTypeScriptDefaults(options, includes, excludes, key = "tsConfig") {
|
|
375
498
|
const typescript = options.typescript ??= {};
|
|
376
499
|
const tsConfig = typescript[key] ??= {};
|
|
@@ -418,6 +541,31 @@ export default defineNuxtPlugin({
|
|
|
418
541
|
mode: "client"
|
|
419
542
|
});
|
|
420
543
|
}
|
|
544
|
+
async function addWebContainerBoundaryPlugin(nuxt, projectRoot, routes) {
|
|
545
|
+
const src = join(projectRoot, ".vitehub/web-container/nuxt-boundary.mjs");
|
|
546
|
+
await writeFileIfChanged(src, `import { addRouteMiddleware, defineNuxtPlugin, navigateTo, useRouter } from "#imports"
|
|
547
|
+
import { matchesWebContainerRoute } from "vite-hub/web-container"
|
|
548
|
+
|
|
549
|
+
const routes = ${JSON.stringify(routes)}
|
|
550
|
+
const isolated = path => matchesWebContainerRoute(path, routes)
|
|
551
|
+
|
|
552
|
+
export default defineNuxtPlugin({
|
|
553
|
+
name: "vitehub:web-container",
|
|
554
|
+
setup() {
|
|
555
|
+
const router = useRouter()
|
|
556
|
+
addRouteMiddleware("vitehub-web-container", (to, from) => {
|
|
557
|
+
// The first navigation of a page load has nothing to leave.
|
|
558
|
+
if (from.matched.length > 0 && isolated(to.path) !== isolated(from.path)) return navigateTo(router.resolve(to.fullPath).href, { external: true })
|
|
559
|
+
}, { global: true })
|
|
560
|
+
},
|
|
561
|
+
})
|
|
562
|
+
`);
|
|
563
|
+
const plugins = nuxt.options.plugins ??= [];
|
|
564
|
+
if (!plugins.some((plugin) => (typeof plugin === "string" ? plugin : plugin.src) === src)) plugins.push({
|
|
565
|
+
src,
|
|
566
|
+
mode: "client"
|
|
567
|
+
});
|
|
568
|
+
}
|
|
421
569
|
/**
|
|
422
570
|
* Restarts the dev server when a file of `server/sync/` comes or goes. Sync reads the folder when the server starts, for
|
|
423
571
|
* the routes and the types of `useSync()`, so a new definition answers `SYNC_UNKNOWN_NAME` until a restart.
|
|
@@ -465,42 +613,6 @@ export default defineNuxtPlugin({
|
|
|
465
613
|
mode: "client"
|
|
466
614
|
});
|
|
467
615
|
}
|
|
468
|
-
function addVueImports(nuxt, from, names) {
|
|
469
|
-
nuxt.options.imports ??= {};
|
|
470
|
-
const imports = nuxt.options.imports.imports ??= [];
|
|
471
|
-
for (const name of names) {
|
|
472
|
-
const existing = imports.find((entry) => (entry.as ?? entry.name) === name);
|
|
473
|
-
if (existing && existing.from !== from) throw viteHubErrorDiagnostics.VITE_HUB_B0008({ message: `[vitehub] Cannot auto-import ${name} from ${from} because it is already configured from ${existing.from}.` });
|
|
474
|
-
if (!existing) imports.push({
|
|
475
|
-
from,
|
|
476
|
-
name
|
|
477
|
-
});
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
/**
|
|
481
|
-
* Add ViteHub's server helpers to the auto-imports that Nuxt 5 gives to Nitro code. The app turns them off with
|
|
482
|
-
* `nitro: { imports: false }`, which makes `imports` false here, or with `imports: { autoImport: false }`, which Nuxt
|
|
483
|
-
* copies to `imports.autoImport`. A name that another source already configures keeps that source.
|
|
484
|
-
*/
|
|
485
|
-
function addNitroImports(config, entries) {
|
|
486
|
-
if (!isRecord(config.imports) || config.imports.autoImport === false) return;
|
|
487
|
-
const options = config.imports;
|
|
488
|
-
const imports = Array.isArray(options.imports) ? options.imports : options.imports = [];
|
|
489
|
-
const taken = /* @__PURE__ */ new Map();
|
|
490
|
-
for (const entry of imports) taken.set(entry.as ?? entry.name, entry.from);
|
|
491
|
-
for (const preset of Array.isArray(options.presets) ? options.presets : []) {
|
|
492
|
-
if (!isRecord(preset) || typeof preset.from !== "string" || !Array.isArray(preset.imports)) continue;
|
|
493
|
-
for (const item of preset.imports) {
|
|
494
|
-
const name = typeof item === "string" ? item : isRecord(item) ? item.as ?? item.name : void 0;
|
|
495
|
-
if (typeof name === "string") taken.set(name, preset.from);
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
for (const entry of entries) {
|
|
499
|
-
if (taken.has(entry.name)) continue;
|
|
500
|
-
imports.push(entry);
|
|
501
|
-
taken.set(entry.name, entry.from);
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
616
|
async function installConsole({ nuxt, projectRoot, name, sections, discovery, writeGeneratedPlugin, canDiscoverDefinitions, access, writePlugin }) {
|
|
505
617
|
const { discoveryRoot, serverDirs } = discovery;
|
|
506
618
|
const plugin = resolveGeneratedConsolePlugin(projectRoot, nuxt.options.dev === true);
|
|
@@ -715,7 +827,7 @@ async function applyNitroConfig(plugins, nitroConfig, nuxt, projectRoot, deferHi
|
|
|
715
827
|
});
|
|
716
828
|
}
|
|
717
829
|
}
|
|
718
|
-
await finalizeNitroReplayPlugins(plugins, config);
|
|
830
|
+
await finalizeNitroReplayPlugins(plugins, config, !nuxt.options.experimental?.nitroViteEnvironment);
|
|
719
831
|
if (!nuxt.options.dev && !nuxt.options._prepare) await (plugins.find((plugin) => plugin.name === "@vite-hub/rate-limit/vite")?.api)?.validateNitroBuild?.(asReplayResolvedConfig(Object.assign({}, config, { command: environment.command })));
|
|
720
832
|
if (config.nitro) {
|
|
721
833
|
installVitePluginNitroModules(config.nitro, plugins);
|
|
@@ -757,13 +869,15 @@ async function installViteHubUIRuntime(nuxt) {
|
|
|
757
869
|
ui.addViteHubUIComponents(nuxt);
|
|
758
870
|
});
|
|
759
871
|
}
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
872
|
+
function assertSupportedNuxt(nuxt) {
|
|
873
|
+
const builder = nuxt.options.server?.builder;
|
|
874
|
+
if (builder === "vite" || builder === "@nuxt/vite-server") throw viteHubErrorDiagnostics.VITE_HUB_B0023({ message: "[vitehub] vite-hub/nuxt needs Nitro 3, but Nuxt's Vite-only server builder does not run Nitro. Remove server.builder to use Nuxt's default Nitro builder." });
|
|
875
|
+
const version = nuxt._version;
|
|
876
|
+
const [major = NaN, minor = NaN] = (version ?? "").split(".").map((part) => Number.parseInt(part, 10));
|
|
877
|
+
const nitroMajor = nuxt.options._nitroMajor;
|
|
878
|
+
if (nitroMajor === void 0 ? !(major < 5) : nitroMajor === 3) return;
|
|
879
|
+
const nitroOptIn = nitroMajor === 2 && major === 4 && minor >= 7;
|
|
880
|
+
throw viteHubErrorDiagnostics.VITE_HUB_B0023({ message: nitroOptIn ? `[vitehub] vite-hub/nuxt needs Nitro 3. This app runs Nuxt ${version} with Nitro 2. If the nitro package is missing, run pnpm add nitro. If it is already listed, remove any configuration that forces Nitro 2.` : `[vitehub] vite-hub/nuxt needs Nitro 3, which runs on Nuxt 4.7 with the nitro package, or on Nuxt 5. This app runs Nuxt ${version}. Upgrade Nuxt and add Nitro 3: pnpm add nuxt@^4.7.0 nitro` });
|
|
767
881
|
}
|
|
768
882
|
function isPlainObject(value) {
|
|
769
883
|
if (typeof value !== "object" || value === null) return false;
|
|
@@ -793,7 +907,7 @@ function mergeNuxtModuleOptions(inline, config) {
|
|
|
793
907
|
const viteHubNuxtModule = async function viteHubNuxtModule(inlineOptions, nuxtInstance) {
|
|
794
908
|
if (!nuxtInstance) return;
|
|
795
909
|
const nuxt = nuxtInstance;
|
|
796
|
-
assertSupportedNuxt(nuxt
|
|
910
|
+
assertSupportedNuxt(nuxt);
|
|
797
911
|
if (nuxt.hook) Reflect.apply(nuxt.hook, nuxt, ["doctor:extendExtensions", (entries) => {
|
|
798
912
|
entries.push(doctorExtensionEntry);
|
|
799
913
|
}]);
|
|
@@ -827,13 +941,14 @@ const viteHubNuxtModule = async function viteHubNuxtModule(inlineOptions, nuxtIn
|
|
|
827
941
|
*/
|
|
828
942
|
const writeNuxtAgentJournal = async (database, databaseRoot) => {
|
|
829
943
|
if (!options.agent || nuxt.options.dev || nuxt.options.vitehubCliDiscovery || !isDefaultAgentJournal(agentJournal)) return;
|
|
830
|
-
const
|
|
944
|
+
const definitions = {
|
|
831
945
|
root: databaseRoot,
|
|
832
946
|
serverDirs: resolveNuxtServerDirs(nuxt.options)
|
|
833
|
-
}
|
|
834
|
-
|
|
947
|
+
};
|
|
948
|
+
const d1Binding = agentJournal?.databaseUrl ? void 0 : defaultDatabaseD1Binding(plan.host, database, definitions);
|
|
949
|
+
assertAgentInvocationsRetention(agentJournal?.retention, { d1: d1Binding }, agentJournal?.databaseUrl);
|
|
835
950
|
if (!nuxt.options._prepare) assertAgentInvocationsUrl(plan.host, agentJournal?.databaseUrl);
|
|
836
|
-
nuxt.options.vite[
|
|
951
|
+
nuxt.options.vite[VITEHUB_AGENT_JOURNAL_STORE] = { d1: d1Binding };
|
|
837
952
|
const libsql = defaultJournalNeedsLibsql({
|
|
838
953
|
build: true,
|
|
839
954
|
databaseUrl: agentJournal?.databaseUrl,
|
|
@@ -932,6 +1047,10 @@ const viteHubNuxtModule = async function viteHubNuxtModule(inlineOptions, nuxtIn
|
|
|
932
1047
|
source: true,
|
|
933
1048
|
workflow: Boolean(options.workflow)
|
|
934
1049
|
});
|
|
1050
|
+
if (nuxtServerAutoImportsEnabled(nuxt.options)) {
|
|
1051
|
+
const { installNuxtServerAutoImports } = await import("./nuxt-server-auto-imports-4aT5BD4u.js");
|
|
1052
|
+
installNuxtServerAutoImports(nuxtInstance, serverAutoImports);
|
|
1053
|
+
}
|
|
935
1054
|
let consoleHasPrimaryAuth = false;
|
|
936
1055
|
let consoleAccess;
|
|
937
1056
|
if (consoleOptions) {
|
|
@@ -960,6 +1079,16 @@ const viteHubNuxtModule = async function viteHubNuxtModule(inlineOptions, nuxtIn
|
|
|
960
1079
|
access: consoleAccess,
|
|
961
1080
|
runtimeCapabilityImports,
|
|
962
1081
|
development: nuxt.options.dev === true,
|
|
1082
|
+
target: {
|
|
1083
|
+
host: {
|
|
1084
|
+
name: plan.host,
|
|
1085
|
+
preset: nitroPreset
|
|
1086
|
+
},
|
|
1087
|
+
framework: {
|
|
1088
|
+
name: "nuxt",
|
|
1089
|
+
version: nuxt._version
|
|
1090
|
+
}
|
|
1091
|
+
},
|
|
963
1092
|
...consoleOptions?.pill === false ? {} : { pageTool: { base: nuxt.options.app?.baseURL || "/" } }
|
|
964
1093
|
});
|
|
965
1094
|
const viteConfig = nuxt.options.vite;
|
|
@@ -970,12 +1099,23 @@ const viteHubNuxtModule = async function viteHubNuxtModule(inlineOptions, nuxtIn
|
|
|
970
1099
|
...secondaryProjectRoots.map((root) => relative(nuxt.options.buildDir, join(root, ".vitehub/**/*.d.ts")))
|
|
971
1100
|
];
|
|
972
1101
|
const generatedData = secondaryProjectRoots.map((root) => relative(nuxt.options.buildDir, join(root, ".vitehub/data/**/*.d.ts")));
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
1102
|
+
addTypeScriptDefaults(nuxt.options, generatedTypes, generatedData);
|
|
1103
|
+
addTypeScriptDefaults(nuxt.options, generatedTypes, generatedData, "sharedTsConfig");
|
|
1104
|
+
addTypeScriptDefaults(nuxt.options.nitro ??= {}, generatedTypes, generatedData);
|
|
1105
|
+
if (plan.host === "cloudflare") {
|
|
1106
|
+
const hasWorkerTypes = isPackageInstalled("@cloudflare/workers-types");
|
|
1107
|
+
const appTypes = { path: hasWorkerTypes ? cloudflareAppTypes : cloudflareWorkersDeclaration };
|
|
1108
|
+
const serverTypes = { path: hasWorkerTypes ? cloudflareTypes : cloudflareWorkersDeclaration };
|
|
1109
|
+
nuxt.hook?.("prepare:types", ({ references, sharedReferences, serverReferences, tsConfig, sharedTsConfig }) => {
|
|
1110
|
+
references.push(appTypes);
|
|
1111
|
+
sharedReferences?.push(appTypes);
|
|
1112
|
+
serverReferences?.push(serverTypes);
|
|
1113
|
+
if (hasWorkerTypes) for (const config of [tsConfig, sharedTsConfig]) {
|
|
1114
|
+
const paths = (config.compilerOptions ??= {}).paths ??= {};
|
|
1115
|
+
paths["cloudflare:workers"] ??= [cloudflareAppTypes];
|
|
1116
|
+
}
|
|
1117
|
+
});
|
|
1118
|
+
}
|
|
979
1119
|
if (options.database) {
|
|
980
1120
|
const databaseOptions = options.database === true ? {} : { ...options.database };
|
|
981
1121
|
const defaultD1 = plan.host === "cloudflare" && !("driver" in databaseOptions) && !usesOnlyPostgresDatabases(resolveViteHubProjectRoot(rootDir, { projectRoot: databaseOptions.projectRoot }), databaseOptions.projectRoot === void 0 && nuxt.options.serverDir ? [nuxt.options.serverDir] : void 0);
|
|
@@ -1038,11 +1178,19 @@ const viteHubNuxtModule = async function viteHubNuxtModule(inlineOptions, nuxtIn
|
|
|
1038
1178
|
if (envPlugin) for (const plugin of replayPlugins) deploymentOutputEnvPluginHandler(plugin)?.(envPlugin);
|
|
1039
1179
|
if (options.env !== false) await envPlugin?.api?.prepareTypes?.(envPlugin.api.resolveDeclarations?.(viteConfig), viteRoot);
|
|
1040
1180
|
const emailPlugin = replayPlugins.find((plugin) => plugin.name === "@vite-hub/email/vite");
|
|
1041
|
-
const
|
|
1042
|
-
materialize
|
|
1181
|
+
const prepareEmailTemplates = (materialize) => emailPlugin?.api?.prepareTypes?.({
|
|
1182
|
+
materialize,
|
|
1043
1183
|
projectRoot,
|
|
1044
|
-
serverDirs: resolveNuxtServerDirs(nuxt.options)
|
|
1045
|
-
|
|
1184
|
+
serverDirs: resolveNuxtServerDirs(nuxt.options),
|
|
1185
|
+
vue: {
|
|
1186
|
+
pluginOptions: nuxt.options.vite?.vue,
|
|
1187
|
+
alias: mergeConfig({ resolve: { alias: nuxt.options.alias } }, { resolve: nuxt.options.vite?.resolve }).resolve.alias
|
|
1188
|
+
}
|
|
1189
|
+
});
|
|
1190
|
+
const emailTemplatePaths = await prepareEmailTemplates(false) ?? {};
|
|
1191
|
+
nuxt.hook?.("build:before", async () => {
|
|
1192
|
+
if (!nuxt.options._prepare && !nuxt.options.vitehubCliDiscovery) await prepareEmailTemplates(true);
|
|
1193
|
+
});
|
|
1046
1194
|
const emailCleanupPlugin = replayPlugins.find((plugin) => plugin.name === "@vite-hub/email/optional-peer-resolver");
|
|
1047
1195
|
if (!emailPlugin) await emailCleanupPlugin?.api?.prepareTypes?.(projectRoot);
|
|
1048
1196
|
const sourcePlugin = replayPlugins.find((plugin) => plugin.name === "@vite-hub/source/vite");
|
|
@@ -1143,7 +1291,7 @@ const viteHubNuxtModule = async function viteHubNuxtModule(inlineOptions, nuxtIn
|
|
|
1143
1291
|
await typesPlugin?.api?.prepareTypes?.({ projectRoot });
|
|
1144
1292
|
consoleWorkflowConfigResolved = true;
|
|
1145
1293
|
const replayedDatabase = hasReplayedDatabaseDiscoveryRoot ? getResolvedFeatureOptions(replayConfig, "database") ?? options.database : options.database;
|
|
1146
|
-
await writeNuxtAgentJournal(replayedDatabase && replayedDatabase !== true && hasReplayedDatabaseDiscoveryRoot ? {
|
|
1294
|
+
if (plan.host === "cloudflare") await writeNuxtAgentJournal(replayedDatabase && replayedDatabase !== true && hasReplayedDatabaseDiscoveryRoot ? {
|
|
1147
1295
|
...replayedDatabase,
|
|
1148
1296
|
projectRoot: replayedDatabaseDiscoveryRoot
|
|
1149
1297
|
} : replayedDatabase, hasReplayedDatabaseDiscoveryRoot ? projectRoot : journalDatabaseRoot);
|
|
@@ -1207,10 +1355,13 @@ const viteHubNuxtModule = async function viteHubNuxtModule(inlineOptions, nuxtIn
|
|
|
1207
1355
|
]);
|
|
1208
1356
|
if (incomingNoExternals === false && Array.isArray(config.noExternals)) nitro3ExternalLists.set(config, config.noExternals);
|
|
1209
1357
|
else nitro3ExternalLists.delete(config);
|
|
1210
|
-
if (!nuxt.options.experimental?.nitroViteEnvironment)
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1358
|
+
if (!nuxt.options.experimental?.nitroViteEnvironment) {
|
|
1359
|
+
installNitroRuntimeResolvers(config, replayPlugins, {
|
|
1360
|
+
root: replayConfig.root || viteRoot,
|
|
1361
|
+
serverDirs: resolveNuxtServerDirs(nuxt.options)
|
|
1362
|
+
});
|
|
1363
|
+
await installNitroViteImports(config, rootDir);
|
|
1364
|
+
}
|
|
1214
1365
|
normalizeGeneratedNitroPlugins(config, projectRoot);
|
|
1215
1366
|
installNitroBuildPlugins(config, [join(projectRoot, ".vitehub"), join(nuxt.options.buildDir, "vitehub")], nuxt.options.dev === true && plan.host === "cloudflare", consoleSections, !nuxt.options.dev);
|
|
1216
1367
|
if (nuxt.options.dev && plan.host === "cloudflare") await writeCloudflareDevShims(nuxt.options.buildDir, config.alias ??= {});
|
|
@@ -1243,25 +1394,24 @@ const viteHubNuxtModule = async function viteHubNuxtModule(inlineOptions, nuxtIn
|
|
|
1243
1394
|
}
|
|
1244
1395
|
if (!hasUpstashStore(kv)) alias[upstashDriverSpecifier] ??= disabledUpstashDriver;
|
|
1245
1396
|
if (!hasRedisStore(kv)) alias[redisDriverSpecifier] ??= disabledRedisDriver;
|
|
1246
|
-
addNitroImports(config, serverAutoImports);
|
|
1247
1397
|
});
|
|
1248
1398
|
if (options.agent) {
|
|
1249
|
-
|
|
1399
|
+
addNuxtVueImports(nuxt, "vite-hub/agent/vue", agentVueComposables);
|
|
1250
1400
|
const optimizeDeps = nuxt.options.vite.optimizeDeps ??= {};
|
|
1251
1401
|
const include = optimizeDeps.include ??= [];
|
|
1252
1402
|
if (!include.includes("vite-hub/agent/vue")) include.push("vite-hub/agent/vue");
|
|
1253
1403
|
}
|
|
1254
|
-
|
|
1404
|
+
addNuxtVueImports(nuxt, "vite-hub/source/client", ["useCollection"]);
|
|
1255
1405
|
if (options.observability && options.observability !== true && options.observability.browserErrors) await installBrowserErrorsNuxt(nuxt, projectRoot);
|
|
1256
1406
|
await installStaleChunkReloadNuxt(nuxt, projectRoot);
|
|
1257
|
-
if (isPackageInstalled("@vite-hub/choices"))
|
|
1407
|
+
if (isPackageInstalled("@vite-hub/choices")) addNuxtVueImports(nuxt, "vite-hub/choices/vue", ["useChoices"]);
|
|
1258
1408
|
if (isPackageInstalled("@vite-hub/forms")) {
|
|
1259
|
-
|
|
1260
|
-
if (isPackageInstalled("@formisch/vue"))
|
|
1409
|
+
addNuxtVueImports(nuxt, "vite-hub/forms/vue", ["useFormAction"]);
|
|
1410
|
+
if (isPackageInstalled("@formisch/vue")) addNuxtVueImports(nuxt, "vite-hub/forms/formisch", ["useFormSubmit"]);
|
|
1261
1411
|
}
|
|
1262
1412
|
if (options.device !== false && isPackageInstalled("@vite-hub/device")) {
|
|
1263
|
-
|
|
1264
|
-
|
|
1413
|
+
addNuxtVueImports(nuxt, "vite-hub/device/vue", ["useStoredData", "useStoredFetch"]);
|
|
1414
|
+
addNuxtVueImports(nuxt, "vite-hub/device", [
|
|
1265
1415
|
"setDeviceAccount",
|
|
1266
1416
|
"clearDevice",
|
|
1267
1417
|
"inspectDevice"
|
|
@@ -1271,9 +1421,10 @@ const viteHubNuxtModule = async function viteHubNuxtModule(inlineOptions, nuxtIn
|
|
|
1271
1421
|
auth: Boolean(effectiveAuth) && options.device?.account !== false
|
|
1272
1422
|
});
|
|
1273
1423
|
}
|
|
1424
|
+
if (options.webContainer) await addWebContainerBoundaryPlugin(nuxt, projectRoot, options.webContainer.routes);
|
|
1274
1425
|
if (isPackageInstalled("@vite-hub/sync") && hasSyncDirectory(projectRoot, resolveNuxtServerDirs(nuxt.options))) {
|
|
1275
|
-
|
|
1276
|
-
|
|
1426
|
+
addNuxtVueImports(nuxt, "vite-hub/sync/vue", ["useSync"]);
|
|
1427
|
+
addNuxtVueImports(nuxt, "vite-hub/sync/client", ["clearSync"]);
|
|
1277
1428
|
if (effectiveAuth) await addSyncSignOutPlugin(nuxt, projectRoot);
|
|
1278
1429
|
}
|
|
1279
1430
|
if (nuxt.options.dev && isPackageInstalled("@vite-hub/sync")) restartOnSyncDefinitions(nuxt, projectRoot);
|
|
@@ -1283,7 +1434,7 @@ const viteHubNuxtModule = async function viteHubNuxtModule(inlineOptions, nuxtIn
|
|
|
1283
1434
|
nitroMajorVersion: 3,
|
|
1284
1435
|
projectRoot
|
|
1285
1436
|
});
|
|
1286
|
-
|
|
1437
|
+
addNuxtVueImports(nuxt, "vite-hub/i18n/vue", ["useLocale"]);
|
|
1287
1438
|
}
|
|
1288
1439
|
if (effectiveAuth) {
|
|
1289
1440
|
const envOptions = options.env || {};
|
|
@@ -1302,10 +1453,10 @@ const viteHubNuxtModule = async function viteHubNuxtModule(inlineOptions, nuxtIn
|
|
|
1302
1453
|
nuxtAlias[name] ??= path;
|
|
1303
1454
|
nitroAlias[name] ??= path;
|
|
1304
1455
|
}
|
|
1305
|
-
if (options.blob)
|
|
1456
|
+
if (options.blob) addNuxtVueImports(nuxt, "vite-hub/blob/vue", ["useMultipartUpload", "useUpload"]);
|
|
1306
1457
|
if (options.realtime) {
|
|
1307
|
-
|
|
1308
|
-
|
|
1458
|
+
addNuxtVueImports(nuxt, "vite-hub/realtime", ["defineRealtime"]);
|
|
1459
|
+
addNuxtVueImports(nuxt, "vite-hub/realtime/vue", ["useRealtimeTiptap"]);
|
|
1309
1460
|
}
|
|
1310
1461
|
if (consoleOptions) generatedConsolePluginPath = await installConsole({
|
|
1311
1462
|
nuxt,
|
|
@@ -1378,5 +1529,4 @@ function usesOnlyPostgresDatabases(rootDir, serverDirs) {
|
|
|
1378
1529
|
const definitions = discoverDatabaseDefinitions(rootDir, { serverDirs });
|
|
1379
1530
|
return definitions.length > 0 && definitions.every((definition) => readDatabaseDefinitionDialect(definition.handler) === "postgresql");
|
|
1380
1531
|
}
|
|
1381
|
-
//#endregion
|
|
1382
1532
|
export { viteHubNuxtModule as default };
|