dineway 0.1.49 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{activity-events-CwM7yxPW.mjs → activity-events-y6eT8UW6.mjs} +6 -38
- package/dist/actor-CrObAPV0.mjs +37 -0
- package/dist/after-BfniwgIf.mjs +9 -0
- package/dist/{allowed-origins-CyGnbgBd.mjs → allowed-origins-_oeyP6x-.mjs} +1 -1
- package/dist/api/route-utils.d.mts +10 -10
- package/dist/api/route-utils.mjs +16 -13
- package/dist/api/schemas/index.d.mts +2 -2
- package/dist/api/schemas/index.mjs +5 -4
- package/dist/{api-BMIxRIEN.mjs → api-ByrU2q-Z.mjs} +60 -36
- package/dist/{api-tokens-DtvdtIkm.mjs → api-tokens-CjVMQT-X.mjs} +6 -2
- package/dist/{apply-D_RlTYtC.mjs → apply-bZswmZPm.mjs} +117 -77
- package/dist/astro/image-endpoint.d.mts +7 -0
- package/dist/astro/image-endpoint.mjs +54 -0
- package/dist/astro/index.d.mts +35 -11
- package/dist/astro/index.mjs +157 -23
- package/dist/astro/integration/shims/use-sync-external-store-with-selector.js +71 -0
- package/dist/astro/integration/shims/use-sync-external-store.js +1 -0
- package/dist/astro/middleware/auth.d.mts +10 -10
- package/dist/astro/middleware/auth.mjs +42 -24
- package/dist/astro/middleware/redirect.mjs +13 -4
- package/dist/astro/middleware/request-context.mjs +8 -5
- package/dist/astro/middleware/seed.d.mts +1 -1
- package/dist/astro/middleware/seed.mjs +2 -2
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.mjs +333 -192
- package/dist/astro/routes/admin.astro +6 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +7 -6
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +7 -6
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +4 -4
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +6 -6
- package/dist/astro/routes/api/admin/briefing.mjs +21 -17
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +4 -4
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +9 -8
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +9 -8
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +9 -8
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +17 -14
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +17 -14
- package/dist/astro/routes/api/admin/bylines/index.mjs +17 -14
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +14 -12
- package/dist/astro/routes/api/admin/comments/_id_.mjs +6 -5
- package/dist/astro/routes/api/admin/comments/bulk.mjs +11 -9
- package/dist/astro/routes/api/admin/comments/counts.mjs +6 -5
- package/dist/astro/routes/api/admin/comments/index.mjs +11 -9
- package/dist/astro/routes/api/admin/context/_id_/history.mjs +26 -24
- package/dist/astro/routes/api/admin/context/_id_/index.mjs +26 -24
- package/dist/astro/routes/api/admin/context/_id_/review.mjs +31 -28
- package/dist/astro/routes/api/admin/context/_id_/supersede.mjs +31 -28
- package/dist/astro/routes/api/admin/context/diff.mjs +30 -27
- package/dist/astro/routes/api/admin/context/index.mjs +31 -28
- package/dist/astro/routes/api/admin/context/stale.mjs +30 -27
- package/dist/astro/routes/api/admin/hitl-requests/_id_/index.mjs +26 -24
- package/dist/astro/routes/api/admin/hitl-requests/_id_/resolve.mjs +30 -27
- package/dist/astro/routes/api/admin/hitl-requests/index.mjs +30 -27
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +27 -25
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +3 -3
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +6 -6
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +6 -6
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +55 -51
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +55 -51
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +47 -43
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +53 -49
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +52 -48
- package/dist/astro/routes/api/admin/plugins/index.mjs +47 -43
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +2 -2
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +46 -42
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +52 -48
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +46 -42
- package/dist/astro/routes/api/admin/plugins/updates.mjs +46 -42
- package/dist/astro/routes/api/admin/review-requests/_id_/index.mjs +5 -5
- package/dist/astro/routes/api/admin/review-requests/_id_/resolve.mjs +31 -27
- package/dist/astro/routes/api/admin/review-requests/index.mjs +10 -9
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +46 -42
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +2 -2
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +46 -42
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +3 -3
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +2 -2
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +8 -7
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +4 -4
- package/dist/astro/routes/api/admin/users/index.mjs +7 -6
- package/dist/astro/routes/api/auth/dev-bypass.mjs +4 -4
- package/dist/astro/routes/api/auth/invite/accept.mjs +2 -2
- package/dist/astro/routes/api/auth/invite/complete.mjs +12 -11
- package/dist/astro/routes/api/auth/invite/index.mjs +9 -8
- package/dist/astro/routes/api/auth/invite/register-options.mjs +11 -10
- package/dist/astro/routes/api/auth/logout.mjs +2 -2
- package/dist/astro/routes/api/auth/magic-link/send.mjs +11 -10
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +3 -3
- package/dist/astro/routes/api/auth/me.mjs +9 -8
- package/dist/astro/routes/api/auth/mode.mjs +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +3 -3
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +6 -5
- package/dist/astro/routes/api/auth/passkey/index.mjs +1 -1
- package/dist/astro/routes/api/auth/passkey/options.mjs +12 -11
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +10 -9
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +11 -10
- package/dist/astro/routes/api/auth/passkey/verify.mjs +11 -10
- package/dist/astro/routes/api/auth/setup-token/index.mjs +5 -5
- package/dist/astro/routes/api/auth/setup-token/verify.mjs +2 -2
- package/dist/astro/routes/api/auth/signup/complete.mjs +12 -11
- package/dist/astro/routes/api/auth/signup/request.mjs +11 -10
- package/dist/astro/routes/api/auth/signup/verify.mjs +2 -2
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +15 -13
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.d.mts +8 -0
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +160 -0
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +11 -10
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +10 -9
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +10 -9
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +16 -14
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +10 -9
- package/dist/astro/routes/api/content/_collection_/authors.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/index.mjs +10 -9
- package/dist/astro/routes/api/content/_collection_/trash.mjs +7 -6
- package/dist/astro/routes/api/dashboard.mjs +9 -8
- package/dist/astro/routes/api/dev/emails.mjs +2 -2
- package/dist/astro/routes/api/health.mjs +1 -1
- package/dist/astro/routes/api/import/probe.d.mts +3 -3
- package/dist/astro/routes/api/import/probe.mjs +22 -10
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +9 -6
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +19 -1
- package/dist/astro/routes/api/import/wordpress/execute.mjs +84 -37
- package/dist/astro/routes/api/import/wordpress/media.d.mts +13 -1
- package/dist/astro/routes/api/import/wordpress/media.mjs +19 -13
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +35 -32
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +18 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +120 -100
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +24 -12
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +56 -2
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +283 -55
- package/dist/astro/routes/api/manifest.mjs +14 -5
- package/dist/astro/routes/api/mcp.mjs +265 -69
- package/dist/astro/routes/api/media/_id_/confirm.mjs +38 -10
- package/dist/astro/routes/api/media/_id_.mjs +11 -7
- package/dist/astro/routes/api/media/file/_...key_.mjs +1 -1
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +2 -2
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +2 -2
- package/dist/astro/routes/api/media/providers/index.mjs +2 -2
- package/dist/astro/routes/api/media/upload-url.mjs +11 -10
- package/dist/astro/routes/api/media.mjs +27 -34
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +31 -28
- package/dist/astro/routes/api/menus/_name_/items.mjs +31 -28
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +31 -28
- package/dist/astro/routes/api/menus/_name_/translations.mjs +31 -28
- package/dist/astro/routes/api/menus/_name_.mjs +31 -28
- package/dist/astro/routes/api/menus/index.mjs +31 -28
- package/dist/astro/routes/api/oauth/authorize.mjs +7 -7
- package/dist/astro/routes/api/oauth/device/authorize.mjs +6 -6
- package/dist/astro/routes/api/oauth/device/code.mjs +9 -9
- package/dist/astro/routes/api/oauth/device/token.mjs +8 -8
- package/dist/astro/routes/api/oauth/register.mjs +4 -4
- package/dist/astro/routes/api/oauth/token/refresh.mjs +6 -6
- package/dist/astro/routes/api/oauth/token/revoke.mjs +6 -6
- package/dist/astro/routes/api/oauth/token.mjs +6 -6
- package/dist/astro/routes/api/openapi.json.mjs +4 -3
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +30 -30
- package/dist/astro/routes/api/redirects/404s/index.mjs +11 -10
- package/dist/astro/routes/api/redirects/404s/summary.mjs +11 -10
- package/dist/astro/routes/api/redirects/_id_.mjs +32 -29
- package/dist/astro/routes/api/redirects/index.mjs +32 -29
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +2 -2
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +2 -2
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +47 -43
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +47 -43
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +47 -43
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +47 -43
- package/dist/astro/routes/api/schema/collections/index.mjs +47 -43
- package/dist/astro/routes/api/schema/index.mjs +13 -14
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +46 -42
- package/dist/astro/routes/api/schema/orphans/index.mjs +46 -42
- package/dist/astro/routes/api/search/enable.mjs +11 -10
- package/dist/astro/routes/api/search/index.mjs +10 -9
- package/dist/astro/routes/api/search/rebuild.mjs +11 -10
- package/dist/astro/routes/api/search/stats.mjs +6 -6
- package/dist/astro/routes/api/search/suggest.mjs +10 -9
- package/dist/astro/routes/api/sections/_slug_.mjs +31 -28
- package/dist/astro/routes/api/sections/index.mjs +31 -28
- package/dist/astro/routes/api/settings/email.mjs +4 -4
- package/dist/astro/routes/api/settings.mjs +31 -28
- package/dist/astro/routes/api/setup/admin-verify.mjs +14 -13
- package/dist/astro/routes/api/setup/admin.mjs +12 -11
- package/dist/astro/routes/api/setup/dev-bypass.mjs +31 -25
- package/dist/astro/routes/api/setup/dev-reset.mjs +2 -2
- package/dist/astro/routes/api/setup/index.mjs +29 -25
- package/dist/astro/routes/api/setup/status.mjs +3 -3
- package/dist/astro/routes/api/snapshot.mjs +8 -7
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +34 -31
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +34 -31
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +34 -31
- package/dist/astro/routes/api/taxonomies/index.mjs +34 -31
- package/dist/astro/routes/api/themes/preview.mjs +5 -5
- package/dist/astro/routes/api/typegen.mjs +4 -4
- package/dist/astro/routes/api/well-known/auth.mjs +3 -3
- package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +3 -3
- package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +3 -3
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +30 -27
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +31 -28
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +31 -28
- package/dist/astro/routes/api/widget-areas/_name_.mjs +28 -26
- package/dist/astro/routes/api/widget-areas/index.mjs +31 -28
- package/dist/astro/routes/api/widget-components.mjs +2 -2
- package/dist/astro/routes/robots.txt.mjs +8 -7
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +23 -14
- package/dist/astro/routes/sitemap.xml.mjs +9 -8
- package/dist/astro/session-driver.d.mts +1 -1
- package/dist/astro/session-driver.mjs +2 -2
- package/dist/astro/types.d.mts +21 -13
- package/dist/{audit-BeNsSyfU.mjs → audit-ByVKIwWF.mjs} +1 -1
- package/dist/auth/providers/github.d.mts +1 -1
- package/dist/auth/providers/google.d.mts +1 -1
- package/dist/{auth-control-guard-Dr14I98m.mjs → auth-control-guard-CqeUmQsv.mjs} +1 -1
- package/dist/{authorize-BLO0m7fW.mjs → authorize-CcBxcHtz.mjs} +1 -1
- package/dist/{briefing-DJX6irto.mjs → briefing-BJaJI8dm.mjs} +2 -1
- package/dist/{briefing-CkTee1ex.mjs → briefing-CawZ59CY.mjs} +90 -28
- package/dist/bundle-7C_DpkEq.mjs +602 -0
- package/dist/{byline-BVC1lV6G.mjs → byline-e51-fWRs.mjs} +30 -62
- package/dist/{byline-fields-uJlygdzM.d.mts → byline-fields-CUvbslGc.d.mts} +80 -37
- package/dist/{byline-fields-Cj39WhXC.mjs → byline-fields-D-N5qVIG.mjs} +1 -1
- package/dist/{byline-fields-cNrLJVRs.mjs → byline-fields-DOJO16Gm.mjs} +3 -3
- package/dist/{byline-registry-4v6tXMNX.mjs → byline-registry-87nNnYl4.mjs} +2 -2
- package/dist/{bylines-LN9XISRo.mjs → bylines-CMQNCNFh.mjs} +9 -3
- package/dist/{bylines-DwokOFj6.mjs → bylines-y4LO-dTj.mjs} +5 -5
- package/dist/{cache-Bac05gBd.mjs → cache-C-FNTFYK.mjs} +2 -2
- package/dist/{chunks-CuUt7K50.mjs → chunks-CxBt-GxR.mjs} +1 -1
- package/dist/cli/index.mjs +94 -659
- package/dist/client/external-auth-headers.d.mts +1 -1
- package/dist/client/index.d.mts +1 -1
- package/dist/client/index.mjs +2 -1
- package/dist/{comment-Beue8-15.mjs → comment-DlA4iChg.mjs} +13 -3
- package/dist/comment-reaction-DfFao1ST.mjs +58 -0
- package/dist/{comments-DcjFIfqX.mjs → comments-DApFGMsP.mjs} +1 -1
- package/dist/{content-CBxYGWfL.mjs → content-Bh4BDjv8.mjs} +51 -34
- package/dist/content-refresh-CgutSUfO.mjs +1576 -0
- package/dist/{context-CQVNZaR8.mjs → context-C5W3G18y.mjs} +111 -50
- package/dist/{context-Df1xVYyr.mjs → context-CK4ym2Sf.mjs} +2 -2
- package/dist/{context-route-helpers-B9wj8Rmh.mjs → context-route-helpers-MASyGgWf.mjs} +2 -1
- package/dist/{cron-DxCAU_Sn.mjs → cron-cKcNTix_.mjs} +7 -3
- package/dist/{dashboard-B7ZUNuyF.mjs → dashboard-DQkVT7Ei.mjs} +4 -4
- package/dist/db/index.d.mts +3 -3
- package/dist/db/index.mjs +1 -1
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/{device-flow-BZVGftqi.mjs → device-flow-BnqRH-T9.mjs} +5 -5
- package/dist/{placeholder-d54Qr_7n.mjs → enrich-DIFIFA8O.mjs} +36 -9
- package/dist/{error-DCSuUAZW.mjs → error-CytFlgcd.mjs} +5 -0
- package/dist/field-defs-cache-DRNdhBJv.mjs +49 -0
- package/dist/{fts-manager-B5l_qwrA.mjs → fts-manager-Crzypjqu.mjs} +1 -1
- package/dist/hitl-Hw1RmWOq.mjs +677 -0
- package/dist/{hitl-requests-7NlzVeUA.mjs → hitl-requests-B4Vbcmaq.mjs} +2 -2
- package/dist/{hitl-route-helpers-k---_H3-.mjs → hitl-route-helpers-hEVzvP8l.mjs} +5 -4
- package/dist/import-Bh9biJfx.mjs +1354 -0
- package/dist/{index-CZiWCQDp.d.mts → index-D4y6NGiy.d.mts} +75 -3
- package/dist/index.d.mts +17 -16
- package/dist/index.mjs +80 -68
- package/dist/{jsonld-DZ67souc.d.mts → jsonld-Dq0gsnOH.d.mts} +8 -4
- package/dist/{load-D9OiGr2m.mjs → load-DmYeniXl.mjs} +1 -1
- package/dist/{loader--GOYux8M.mjs → loader-CjWqjweO.mjs} +117 -31
- package/dist/{manifest-schema-qh2P7RDX.mjs → manifest-schema-BxVPYMJR.mjs} +34 -1
- package/dist/mcp-reviewed-executor-TwVbMzG6.mjs +555 -0
- package/dist/media/image-endpoint.d.mts +32 -0
- package/dist/media/image-endpoint.mjs +111 -0
- package/dist/media/index.d.mts +27 -2
- package/dist/media/index.mjs +5 -3
- package/dist/media/local-runtime.d.mts +16 -11
- package/dist/media/local-runtime.mjs +9 -7
- package/dist/{media-CbKyYukG.mjs → media-DMj0grzC.mjs} +3 -1
- package/dist/{media-allowlist-BYxJIcTO.mjs → media-allowlist-BlVCSzHx.mjs} +1 -1
- package/dist/media-url-lEKSrpr9.mjs +20 -0
- package/dist/{menus-BZbXf-ej.mjs → menus-TaW1gKnk.mjs} +19 -5
- package/dist/{menus-C7F0sCrC.mjs → menus-xvsnVZXw.mjs} +80 -15
- package/dist/{normalize-ByemhhfW.mjs → normalize-5ek_z7de.mjs} +8 -1
- package/dist/{oauth-authorization-DF-LCsIA.mjs → oauth-authorization-DiaGvRVz.mjs} +5 -5
- package/dist/{oauth-clients-Du-V0fEm.mjs → oauth-clients-Dl9E8dEM.mjs} +2 -2
- package/dist/object-cache/memory.d.mts +14 -0
- package/dist/object-cache/memory.mjs +55 -0
- package/dist/object-cache-D51qOseS.mjs +419 -0
- package/dist/page/index.d.mts +4 -3
- package/dist/page/index.mjs +2 -2
- package/dist/{parse-CneSgl7-.mjs → parse-CbymENaR.mjs} +1 -1
- package/dist/{parser-DxfsARXL.mjs → parser-C1nYd-81.mjs} +151 -9
- package/dist/{placeholder-CXfoCtCd.d.mts → placeholder-uvNRZBX9.d.mts} +12 -4
- package/dist/plugin-utils.d.mts +9 -9
- package/dist/plugins/adapt-sandbox-entry.d.mts +9 -9
- package/dist/plugins/adapt-sandbox-entry.mjs +11 -2
- package/dist/{plugins-DzfqRREq.mjs → plugins-BolVa-tl.mjs} +831 -63
- package/dist/{transport-LSdZVXHF.mjs → portable-text-dA_UlJwW.mjs} +1 -134
- package/dist/{preview-C-3YTX2U.mjs → preview-vSVg6fwG.mjs} +4 -3
- package/dist/process-cache-7xgAO9JY.mjs +106 -0
- package/dist/{provider-loader-9it4vd6L.d.mts → provider-loader-MD8zAbnH.d.mts} +1 -1
- package/dist/{public-url-B4xV4rGa.d.mts → public-url-gsp3oUbu.d.mts} +1 -1
- package/dist/{query-Ds0EnMFX.mjs → query-CfRCdaL3.mjs} +281 -76
- package/dist/{query-CZ3TH_Uu.mjs → query-jaAmw8E1.mjs} +11 -6
- package/dist/{rate-limit-i0G3IAOX.mjs → rate-limit-ZLdyWoZF.mjs} +2 -2
- package/dist/{redirect-CEACczxo.mjs → redirect-BAjt4Z6b.mjs} +2 -2
- package/dist/{redirects-DYj1yPxs.mjs → redirects-BTdwpQtE.mjs} +47 -24
- package/dist/{redirects-ocRJmQHP.mjs → redirects-CA-xylPG.mjs} +19 -11
- package/dist/{registry-D7HACema.mjs → registry-CtyVedcN.mjs} +130 -77
- package/dist/request-context.d.mts +2 -0
- package/dist/{request-meta-DAb6xaP9.mjs → request-meta-CUypToDJ.mjs} +1 -1
- package/dist/{review-requests-Qum4713s.mjs → review-requests-C9Ff11Vq.mjs} +1 -1
- package/dist/{review-requests-BW2NxY-l.mjs → review-requests-DUyEmtmG.mjs} +1 -1
- package/dist/{runner-09sTqtv0.d.mts → runner-1tC2tIRV.d.mts} +1 -1
- package/dist/runner-DB7CRfOF.mjs +6740 -0
- package/dist/{runtime-C4-2lSFg.d.mts → runtime-BOeiQsCv.d.mts} +1952 -1489
- package/dist/runtime.d.mts +10 -10
- package/dist/runtime.mjs +3 -3
- package/dist/schema-DXdYj4R3.mjs +8 -0
- package/dist/{search-Gdrqj582.mjs → search-DSaLgEFI.mjs} +5 -3
- package/dist/{secrets-CeGpBFV2.mjs → secrets-CDZo2k8L.mjs} +14 -11
- package/dist/{sections-BOjU13Y-.mjs → sections-PVVXHGfp.mjs} +2 -2
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +21 -18
- package/dist/seo/index.d.mts +1 -1
- package/dist/seo/index.mjs +3 -12
- package/dist/{seo-CLj8lS7Q.mjs → seo-CQG3GCHQ.mjs} +5 -2
- package/dist/{seo-contributions-CqVvReEj.mjs → seo-contributions-C1EnikHB.mjs} +11 -3
- package/dist/{seo-5lJOtB5J.mjs → seo-qa7Dn0jK.mjs} +22 -4
- package/dist/{service-jGlhrICs.mjs → service-DiN4ZuPp.mjs} +2 -2
- package/dist/session-user-CAKImna3.mjs +22 -0
- package/dist/{settings-CUXOxzsT.mjs → settings-BbqgHWpU.mjs} +28 -55
- package/dist/{settings-DlBsT2VS.mjs → settings-i4VPP8bT.mjs} +2 -2
- package/dist/{setup-complete-BRrdPYjZ.mjs → setup-complete-B8fl-mjV.mjs} +1 -1
- package/dist/{site-activity-DONFrMBJ.mjs → site-activity-Dy3FROs0.mjs} +1 -1
- package/dist/{site-context-C8Az_P_I.mjs → site-context-DQiL8Fl5.mjs} +23 -652
- package/dist/{site-url-DIMD68go.mjs → site-url-BML3GQYm.mjs} +1 -1
- package/dist/status-DANd8ERo.mjs +21 -0
- package/dist/storage/local.d.mts +1 -1
- package/dist/storage/local.mjs +1 -1
- package/dist/storage/s3.d.mts +1 -1
- package/dist/storage/s3.mjs +1 -1
- package/dist/{taxonomies-D9Sw4wWM.mjs → taxonomies-9s-v03H-.mjs} +36 -29
- package/dist/taxonomies-DRiixp_E.mjs +443 -0
- package/dist/{taxonomy-B169Nm6B.mjs → taxonomy-Dvsw6BOs.mjs} +44 -9
- package/dist/transport-BNmCqLu7.mjs +134 -0
- package/dist/types-4garmdWa.mjs +66 -0
- package/dist/{types-DSPGWjxO.d.mts → types-C8XW6L19.d.mts} +225 -4
- package/dist/{types-GaCtZ1k9.d.mts → types-CDpH6MA4.d.mts} +18 -0
- package/dist/{types-DRIKLmJI.d.mts → types-C_ly5eTp.d.mts} +17 -2
- package/dist/types-DF7ZuGGk.d.mts +118 -0
- package/dist/types-DU0bU2Wu.d.mts +2392 -0
- package/dist/{types-CwawBUTa.d.mts → types-DW_-sFyz.d.mts} +2 -1
- package/dist/{types-CSgR9nQB.mjs → types-Dq1qT19x.mjs} +1 -1
- package/dist/ui/server-runtime.d.mts +15 -15
- package/dist/ui/server-runtime.mjs +24 -20
- package/dist/url-Cac7a9QZ.mjs +33 -0
- package/dist/{user-DTLoZs16.mjs → user-BIZPzCb9.mjs} +2 -2
- package/dist/{utils-B8hBJ9Oz.mjs → utils-CMDhr5Xd.mjs} +129 -7
- package/dist/{validate-DzjCdy6v.d.mts → validate-CZvb-BKB.d.mts} +10 -7
- package/dist/{validate-DWmPO6oj.mjs → validate-DNs0pTSc.mjs} +11 -6
- package/dist/version-BTvfRGc6.mjs +6 -0
- package/dist/{widgets-BpJ8EpPd.mjs → widgets-f0ibZUIq.mjs} +46 -43
- package/dist/{wordpress-slugs-DHNR9LpG.mjs → wordpress-slugs-BhHJX8XE.mjs} +1 -1
- package/dist/{zod-generator-K91-g665.mjs → zod-generator-B7TMjyFJ.mjs} +41 -13
- package/package.json +30 -8
- package/src/components/Block.astro +50 -0
- package/src/components/Comments.astro +143 -1
- package/src/components/DinewayHead.astro +19 -2
- package/src/components/DinewayImage.astro +66 -33
- package/src/components/DinewayMedia.astro +1 -2
- package/src/components/Image.astro +85 -40
- package/src/components/InlinePortableTextEditor.tsx +12 -2
- package/src/components/JsonLdScript.astro +9 -0
- package/src/components/LiveSearch.astro +40 -4
- package/src/components/index.ts +4 -0
- package/src/components/live-search-routing.ts +30 -0
- package/src/components/portable-text-text-align.ts +15 -0
- package/src/ui.ts +2 -0
- package/dist/entity-aliases-4y93Yjuc.mjs +0 -51
- package/dist/import-4YBXbDkI.mjs +0 -684
- package/dist/runner-DzIpHGND.mjs +0 -2836
- package/dist/schema-Bsi-VpYv.mjs +0 -8
- package/dist/taxonomies-CZ-_DitR.mjs +0 -327
- package/dist/types-CuJOqHfM.d.mts +0 -758
- package/dist/version-C4gfn0PJ.mjs +0 -6
- /package/dist/{adapters-OQCImOL7.d.mts → adapters-NVSs4UH7.d.mts} +0 -0
- /package/dist/{api-tokens-CYUoFGo7.mjs → api-tokens-2r7OWi_I.mjs} +0 -0
- /package/dist/{challenge-store-DFxX0_15.mjs → challenge-store-Bjlepa2E.mjs} +0 -0
- /package/dist/{components--pg6zBvu.mjs → components-Bclf98Be.mjs} +0 -0
- /package/dist/{context-types-r8oFvyOq.mjs → context-types-DqTo6C79.mjs} +0 -0
- /package/dist/{default-B6iaLvP7.mjs → default--K40jqm0.mjs} +0 -0
- /package/dist/{email-console-BOVqIYpB.mjs → email-console-ChgKFO8-.mjs} +0 -0
- /package/dist/{escape-BDgouFFY.mjs → escape-Bd4P_xKg.mjs} +0 -0
- /package/dist/{experimental-workflows-CSMffP6q.mjs → experimental-workflows-BMsUnIAw.mjs} +0 -0
- /package/dist/{mime-CbKsKDCB.mjs → mime-CA7Lgovc.mjs} +0 -0
- /package/dist/{mode-CZqCF9dZ.mjs → mode-C4CIyjtR.mjs} +0 -0
- /package/dist/{oauth-state-store-qncPB_IU.mjs → oauth-state-store-CNoXafF7.mjs} +0 -0
- /package/dist/{oauth-user-lookup-BFjWF8wK.mjs → oauth-user-lookup-Ygw4bNyt.mjs} +0 -0
- /package/dist/{options-LsPjZlqD.mjs → options-DQPTH5n0.mjs} +0 -0
- /package/dist/{passkey-config-DzHQK90v.mjs → passkey-config-BUwu8BA3.mjs} +0 -0
- /package/dist/{patterns-DKAX6oqN.mjs → patterns-BhAvqO0S.mjs} +0 -0
- /package/dist/{provider-loader-DzUxejk7.mjs → provider-loader-D0w9dqjm.mjs} +0 -0
- /package/dist/{public-url-B_m9IwdV.mjs → public-url-BEz_sM9n.mjs} +0 -0
- /package/dist/{redirect-BjIBtDWY.mjs → redirect-wphRBv4y.mjs} +0 -0
- /package/dist/{request-cache-ho99schz.mjs → request-cache-D9GQBxMP.mjs} +0 -0
- /package/dist/{resolve-DTuDyYKs.mjs → resolve-Cb6Dbz-C.mjs} +0 -0
- /package/dist/{setup-nonce-pyGfc9hV.mjs → setup-nonce-CoyjILvW.mjs} +0 -0
- /package/dist/{sidecar-client-mJxwayYN.mjs → sidecar-client-C3mqXg4C.mjs} +0 -0
- /package/dist/{slugify-BqebcqBg.mjs → slugify-KSsVD_D3.mjs} +0 -0
- /package/dist/{ssrf-DiKqWd3N.mjs → ssrf-DWe8jwAp.mjs} +0 -0
- /package/dist/{tokens-SLmgowfd.mjs → tokens-1RK1n6ED.mjs} +0 -0
- /package/dist/{transaction-CFLhEOuH.mjs → transaction-C2EOMTJA.mjs} +0 -0
- /package/dist/{transport-BnsNxh2l.d.mts → transport-CcJu3Co8.d.mts} +0 -0
- /package/dist/{trusted-proxy-BgIIcbsN.mjs → trusted-proxy-DTXQ2IMv.mjs} +0 -0
- /package/dist/{types-CJ8DkL0q.mjs → types-B3t5cxhU.mjs} +0 -0
- /package/dist/{types-nP9vGUFq.d.mts → types-C46EvNdc.d.mts} +0 -0
- /package/dist/{types-Cg276-3z.mjs → types-C5CVgwsV.mjs} +0 -0
- /package/dist/{types-DZpT-PnG.d.mts → types-POH8PQZh.d.mts} +0 -0
- /package/dist/{types-Dryvv7LH.d.mts → types-Rc3gQqqw.d.mts} +0 -0
- /package/dist/{url-w7Mp5qAD.mjs → url-CpyFDFpO.mjs} +0 -0
package/dist/cli/index.mjs
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as __exportAll, i as runMigrations, n as getMigrationStatus, t as getMigrationFingerprint } from "../runner-
|
|
2
|
+
import { a as __exportAll, i as runMigrations, n as getMigrationStatus, t as getMigrationFingerprint } from "../runner-DB7CRfOF.mjs";
|
|
3
3
|
import { t as createDatabase } from "../connection-CiJWiWya.mjs";
|
|
4
4
|
import { t as validateIdentifier } from "../validate-VPnKoIzW.mjs";
|
|
5
5
|
import { l as listTablesLike } from "../dialect-helpers-fk43GbDb.mjs";
|
|
6
6
|
import { n as getI18nConfig, r as isI18nEnabled } from "../config-CVssduLe.mjs";
|
|
7
7
|
import { i as encodeBase64url } from "../base64-F8-DUraK.mjs";
|
|
8
|
-
import "../types-
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import { t as
|
|
13
|
-
import { t as
|
|
14
|
-
import { t as
|
|
15
|
-
import "../
|
|
16
|
-
import "../
|
|
17
|
-
import "../
|
|
18
|
-
import
|
|
19
|
-
import "../
|
|
20
|
-
import {
|
|
21
|
-
import "../
|
|
22
|
-
import
|
|
23
|
-
import {
|
|
24
|
-
import "../
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import
|
|
8
|
+
import "../types-Dq1qT19x.mjs";
|
|
9
|
+
import { o as isMissingTableError } from "../loader-CjWqjweO.mjs";
|
|
10
|
+
import "../object-cache-D51qOseS.mjs";
|
|
11
|
+
import { n as slugify } from "../slugify-KSsVD_D3.mjs";
|
|
12
|
+
import { t as ContentRepository } from "../content-Bh4BDjv8.mjs";
|
|
13
|
+
import { t as MediaRepository } from "../media-DMj0grzC.mjs";
|
|
14
|
+
import { t as TaxonomyRepository } from "../taxonomy-Dvsw6BOs.mjs";
|
|
15
|
+
import { t as OptionsRepository } from "../options-DQPTH5n0.mjs";
|
|
16
|
+
import "../redirect-BAjt4Z6b.mjs";
|
|
17
|
+
import "../request-cache-D9GQBxMP.mjs";
|
|
18
|
+
import "../byline-registry-87nNnYl4.mjs";
|
|
19
|
+
import "../field-defs-cache-DRNdhBJv.mjs";
|
|
20
|
+
import { t as BylineRepository } from "../byline-e51-fWRs.mjs";
|
|
21
|
+
import "../content-refresh-CgutSUfO.mjs";
|
|
22
|
+
import "../fts-manager-Crzypjqu.mjs";
|
|
23
|
+
import { n as SchemaRegistry } from "../registry-CtyVedcN.mjs";
|
|
24
|
+
import "../settings-BbqgHWpU.mjs";
|
|
25
|
+
import { n as VERSION } from "../version-BTvfRGc6.mjs";
|
|
26
|
+
import { a as reconcileManifestAccess, i as pluginManifestSchema } from "../manifest-schema-BxVPYMJR.mjs";
|
|
27
|
+
import "../ssrf-DWe8jwAp.mjs";
|
|
28
|
+
import { n as fingerprintKey, r as generateEncryptionKey, t as DinewaySecretsError } from "../secrets-CDZo2k8L.mjs";
|
|
29
|
+
import { t as validateSeed } from "../validate-DNs0pTSc.mjs";
|
|
30
|
+
import { t as applySeed } from "../apply-bZswmZPm.mjs";
|
|
28
31
|
import { createHeaderAwareFetch, customHeadersInterceptor, isRedirectResponse, resolveCustomHeaders } from "../client/external-auth-headers.mjs";
|
|
29
|
-
import {
|
|
32
|
+
import { t as convertDataForRead } from "../portable-text-dA_UlJwW.mjs";
|
|
30
33
|
import { DinewayClient } from "../client/index.mjs";
|
|
31
34
|
import { LocalStorage } from "../storage/local.mjs";
|
|
35
|
+
import { r as fileExists$11, t as bundleCommand } from "../bundle-7C_DpkEq.mjs";
|
|
32
36
|
import { createHash, randomUUID } from "node:crypto";
|
|
33
37
|
import { sql } from "kysely";
|
|
34
|
-
import { imageSize } from "image-size";
|
|
35
38
|
import { createGzipDecoder, unpackTar } from "modern-tar";
|
|
36
|
-
import { createReadStream,
|
|
37
|
-
import { basename, dirname,
|
|
38
|
-
import { pathToFileURL } from "node:url";
|
|
39
|
+
import { createReadStream, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
40
|
+
import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
39
41
|
import { defineCommand, runCommand, runMain } from "citty";
|
|
40
42
|
import { createInterface } from "node:readline/promises";
|
|
41
43
|
import consola, { consola as consola$1 } from "consola";
|
|
42
44
|
import pc from "picocolors";
|
|
43
45
|
import { ForgewayClient } from "@forgeway/sdk";
|
|
44
|
-
import { access, chmod,
|
|
46
|
+
import { access, chmod, mkdir, readFile, readdir, stat, writeFile } from "node:fs/promises";
|
|
45
47
|
import { homedir } from "node:os";
|
|
46
48
|
import { spawn } from "node:child_process";
|
|
47
|
-
import { pipeline } from "node:stream/promises";
|
|
48
|
-
import { packTar } from "modern-tar/fs";
|
|
49
49
|
|
|
50
50
|
//#region src/cli/commands/deploy/utils/forgeway-secrets.ts
|
|
51
51
|
const DINEWAY_USER_CONFIG_DIR_NAME = "dineway";
|
|
@@ -1367,7 +1367,11 @@ function isHostedSitesResource(resource) {
|
|
|
1367
1367
|
}
|
|
1368
1368
|
function isCreditResource(resource) {
|
|
1369
1369
|
const normalized = resource.toLowerCase();
|
|
1370
|
-
return normalized.includes("credit") || normalized.includes("firecrawl") || normalized.includes("dataforseo")
|
|
1370
|
+
return normalized.includes("credit") || normalized.includes("firecrawl") || normalized.includes("dataforseo");
|
|
1371
|
+
}
|
|
1372
|
+
function isQuotaResource(resource) {
|
|
1373
|
+
const normalized = resource.toLowerCase();
|
|
1374
|
+
return normalized.includes("quota") || normalized.includes("place_search") || normalized.includes("place_get") || normalized.includes("/api/places");
|
|
1371
1375
|
}
|
|
1372
1376
|
function getCliPaywallRefreshStatus(paywall, account) {
|
|
1373
1377
|
if (isHostedSitesResource(paywall.resource)) {
|
|
@@ -1391,6 +1395,10 @@ function getCliPaywallRefreshStatus(paywall, account) {
|
|
|
1391
1395
|
message: "There are still no provider credits. Complete checkout or top up credits in Dineway Web."
|
|
1392
1396
|
};
|
|
1393
1397
|
}
|
|
1398
|
+
if (isQuotaResource(paywall.resource)) return {
|
|
1399
|
+
blocked: false,
|
|
1400
|
+
message: "Account quota status refreshed. Re-run the blocked command when ready."
|
|
1401
|
+
};
|
|
1394
1402
|
return {
|
|
1395
1403
|
blocked: false,
|
|
1396
1404
|
message: "Account status refreshed. Re-run the blocked command when ready."
|
|
@@ -1533,7 +1541,7 @@ function collectUploadIncludeFiles(directory = dinewayUploadsJoin(dinewayForgewa
|
|
|
1533
1541
|
\t});
|
|
1534
1542
|
}
|
|
1535
1543
|
`;
|
|
1536
|
-
async function fileExists$
|
|
1544
|
+
async function fileExists$10(path) {
|
|
1537
1545
|
try {
|
|
1538
1546
|
await access(path);
|
|
1539
1547
|
return true;
|
|
@@ -1694,7 +1702,7 @@ function configurePackageJson(pkg, adapter) {
|
|
|
1694
1702
|
}
|
|
1695
1703
|
async function configureAstroConfig(cwd, adapter, dryRun) {
|
|
1696
1704
|
const configPath = join(cwd, "astro.config.mjs");
|
|
1697
|
-
if (!await fileExists$
|
|
1705
|
+
if (!await fileExists$10(configPath)) return [];
|
|
1698
1706
|
const current = await readFile(configPath, "utf-8");
|
|
1699
1707
|
const next = configureAstroConfigSource(current, adapter);
|
|
1700
1708
|
if (next === current) return [{
|
|
@@ -1713,7 +1721,7 @@ async function configureAstroConfig(cwd, adapter, dryRun) {
|
|
|
1713
1721
|
}
|
|
1714
1722
|
async function configurePackage(cwd, adapter, dryRun) {
|
|
1715
1723
|
const packagePath = join(cwd, "package.json");
|
|
1716
|
-
if (!await fileExists$
|
|
1724
|
+
if (!await fileExists$10(packagePath)) return [];
|
|
1717
1725
|
const current = await readFile(packagePath, "utf-8");
|
|
1718
1726
|
const nextPkg = configurePackageJson(JSON.parse(current), adapter);
|
|
1719
1727
|
const next = JSON.stringify(nextPkg, null, " ") + "\n";
|
|
@@ -1732,7 +1740,7 @@ async function configurePackage(cwd, adapter, dryRun) {
|
|
|
1732
1740
|
}];
|
|
1733
1741
|
}
|
|
1734
1742
|
async function configureAstroDeployAdapter(cwd, adapter, dryRun = false) {
|
|
1735
|
-
if (!await fileExists$
|
|
1743
|
+
if (!await fileExists$10(join(cwd, "astro.config.mjs"))) return [];
|
|
1736
1744
|
return [...await configureAstroConfig(cwd, adapter, dryRun), ...await configurePackage(cwd, adapter, dryRun)];
|
|
1737
1745
|
}
|
|
1738
1746
|
|
|
@@ -1822,7 +1830,7 @@ volumes:
|
|
|
1822
1830
|
|
|
1823
1831
|
//#endregion
|
|
1824
1832
|
//#region src/cli/commands/deploy/targets/docker.ts
|
|
1825
|
-
async function fileExists$
|
|
1833
|
+
async function fileExists$9(path) {
|
|
1826
1834
|
try {
|
|
1827
1835
|
await access(path);
|
|
1828
1836
|
return true;
|
|
@@ -1832,7 +1840,7 @@ async function fileExists$10(path) {
|
|
|
1832
1840
|
}
|
|
1833
1841
|
async function writeGeneratedFile$2(cwd, relativePath, content, dryRun) {
|
|
1834
1842
|
const path = join(cwd, relativePath);
|
|
1835
|
-
if (await fileExists$
|
|
1843
|
+
if (await fileExists$9(path)) return {
|
|
1836
1844
|
path: relativePath,
|
|
1837
1845
|
action: "exists"
|
|
1838
1846
|
};
|
|
@@ -1922,7 +1930,7 @@ const EDGE_HYPHENS_RE$2 = /^-|-$/g;
|
|
|
1922
1930
|
const LINE_SPLIT_RE = /\r?\n/;
|
|
1923
1931
|
const DEFAULT_REGION$1 = "iad";
|
|
1924
1932
|
const FLY_VOLUME_NAME = "dineway_data";
|
|
1925
|
-
async function fileExists$
|
|
1933
|
+
async function fileExists$8(path) {
|
|
1926
1934
|
try {
|
|
1927
1935
|
await access(path);
|
|
1928
1936
|
return true;
|
|
@@ -1932,7 +1940,7 @@ async function fileExists$9(path) {
|
|
|
1932
1940
|
}
|
|
1933
1941
|
async function writeGeneratedFile$1(cwd, relativePath, content, dryRun) {
|
|
1934
1942
|
const path = join(cwd, relativePath);
|
|
1935
|
-
if (await fileExists$
|
|
1943
|
+
if (await fileExists$8(path)) return {
|
|
1936
1944
|
path: relativePath,
|
|
1937
1945
|
action: "exists"
|
|
1938
1946
|
};
|
|
@@ -2263,7 +2271,7 @@ function normalizeForgewayUser$1(user) {
|
|
|
2263
2271
|
function getFetch(deps) {
|
|
2264
2272
|
return deps.fetch ?? fetch;
|
|
2265
2273
|
}
|
|
2266
|
-
async function fileExists$
|
|
2274
|
+
async function fileExists$7(path) {
|
|
2267
2275
|
try {
|
|
2268
2276
|
await access(path);
|
|
2269
2277
|
return true;
|
|
@@ -2288,7 +2296,7 @@ function formatDuration(ms) {
|
|
|
2288
2296
|
if (ms < 1e3) return `${ms}ms`;
|
|
2289
2297
|
return `${Math.round(ms / 100) / 10}s`;
|
|
2290
2298
|
}
|
|
2291
|
-
function formatBytes
|
|
2299
|
+
function formatBytes(bytes) {
|
|
2292
2300
|
if (bytes < 1024) return `${bytes} B`;
|
|
2293
2301
|
const units = [
|
|
2294
2302
|
"KB",
|
|
@@ -2761,18 +2769,18 @@ function deriveForgewaySiteSlug(restaurantName, city) {
|
|
|
2761
2769
|
async function resolveSeedPath$1(cwd, explicitSeedPath) {
|
|
2762
2770
|
if (explicitSeedPath) {
|
|
2763
2771
|
const resolved = resolve(cwd, explicitSeedPath);
|
|
2764
|
-
if (!await fileExists$
|
|
2772
|
+
if (!await fileExists$7(resolved)) throw new Error(`Seed file not found: ${explicitSeedPath}`);
|
|
2765
2773
|
return resolved;
|
|
2766
2774
|
}
|
|
2767
2775
|
const convention = resolve(cwd, ".dineway", "seed.json");
|
|
2768
|
-
if (await fileExists$
|
|
2776
|
+
if (await fileExists$7(convention)) return convention;
|
|
2769
2777
|
const pkg = await readDeployPackageJson(cwd).catch(() => null);
|
|
2770
2778
|
if (typeof pkg?.dineway?.seed === "string") {
|
|
2771
2779
|
const configured = resolve(cwd, pkg.dineway.seed);
|
|
2772
|
-
if (await fileExists$
|
|
2780
|
+
if (await fileExists$7(configured)) return configured;
|
|
2773
2781
|
}
|
|
2774
2782
|
const legacyConvention = resolve(cwd, "seed", "seed.json");
|
|
2775
|
-
if (await fileExists$
|
|
2783
|
+
if (await fileExists$7(legacyConvention)) return legacyConvention;
|
|
2776
2784
|
return null;
|
|
2777
2785
|
}
|
|
2778
2786
|
async function readSeedTitle(seedPath) {
|
|
@@ -3140,7 +3148,7 @@ async function deploySiteProject(options) {
|
|
|
3140
3148
|
consola.start("Scanning deploy files");
|
|
3141
3149
|
const localFiles = await (options.deps.collectDeploymentFiles ?? collectDeploymentFiles)(options.sourceDir);
|
|
3142
3150
|
if (localFiles.length === 0) throw new Error("No deployable files found in the source directory.");
|
|
3143
|
-
consola.success(`Scanned ${localFiles.length} files (${formatBytes
|
|
3151
|
+
consola.success(`Scanned ${localFiles.length} files (${formatBytes(deploymentFileSize(localFiles))}) in ${formatDuration(Date.now() - scanStart)}`);
|
|
3144
3152
|
const createStart = Date.now();
|
|
3145
3153
|
consola.start("Creating Forgeway deployment");
|
|
3146
3154
|
const createResult = await ossFetch(options.context, `/api/deployments/sites/${encodeURIComponent(options.siteId)}/deploy`, options.deps, {
|
|
@@ -3159,7 +3167,7 @@ async function deploySiteProject(options) {
|
|
|
3159
3167
|
const pendingFiles = createResult.files.filter((file) => !file.uploadedAt);
|
|
3160
3168
|
const pendingSize = pendingFiles.reduce((total, file) => total + file.size, 0);
|
|
3161
3169
|
if (pendingFiles.length === 0) consola.success("No file uploads needed");
|
|
3162
|
-
else consola.start(`Uploading ${pendingFiles.length} changed files (${formatBytes
|
|
3170
|
+
else consola.start(`Uploading ${pendingFiles.length} changed files (${formatBytes(pendingSize)})`);
|
|
3163
3171
|
let uploadedCount = 0;
|
|
3164
3172
|
await runWithConcurrency(pendingFiles, DIRECT_UPLOAD_CONCURRENCY, async (manifestFile) => {
|
|
3165
3173
|
const localFile = localFileByPath.get(manifestFile.path);
|
|
@@ -3303,7 +3311,7 @@ pnpm-debug.log*
|
|
|
3303
3311
|
yarn-debug.log*
|
|
3304
3312
|
yarn-error.log*
|
|
3305
3313
|
`;
|
|
3306
|
-
async function fileExists$
|
|
3314
|
+
async function fileExists$6(path) {
|
|
3307
3315
|
try {
|
|
3308
3316
|
await access(path);
|
|
3309
3317
|
return true;
|
|
@@ -3313,7 +3321,7 @@ async function fileExists$7(path) {
|
|
|
3313
3321
|
}
|
|
3314
3322
|
async function writeGeneratedFile(cwd, relativePath, content, dryRun) {
|
|
3315
3323
|
const path = join(cwd, relativePath);
|
|
3316
|
-
if (await fileExists$
|
|
3324
|
+
if (await fileExists$6(path)) return {
|
|
3317
3325
|
path: relativePath,
|
|
3318
3326
|
action: "exists"
|
|
3319
3327
|
};
|
|
@@ -3446,7 +3454,7 @@ const gcpTarget = {
|
|
|
3446
3454
|
env: options.env,
|
|
3447
3455
|
stdio: "inherit"
|
|
3448
3456
|
});
|
|
3449
|
-
if (result.code !== 0 && !await fileExists$
|
|
3457
|
+
if (result.code !== 0 && !await fileExists$6(join(cwd, "Dockerfile"))) {
|
|
3450
3458
|
await writeFile(join(cwd, "Dockerfile"), generateDockerfile(), "utf-8");
|
|
3451
3459
|
result = await runCommand$1("gcloud", deployArgs, {
|
|
3452
3460
|
cwd,
|
|
@@ -3465,7 +3473,7 @@ const gcpTarget = {
|
|
|
3465
3473
|
|
|
3466
3474
|
//#endregion
|
|
3467
3475
|
//#region src/cli/commands/deploy/utils/build.ts
|
|
3468
|
-
async function fileExists$
|
|
3476
|
+
async function fileExists$5(path) {
|
|
3469
3477
|
try {
|
|
3470
3478
|
await access(path);
|
|
3471
3479
|
return true;
|
|
@@ -3474,19 +3482,19 @@ async function fileExists$6(path) {
|
|
|
3474
3482
|
}
|
|
3475
3483
|
}
|
|
3476
3484
|
async function detectBuildCommand(cwd) {
|
|
3477
|
-
if (await fileExists$
|
|
3485
|
+
if (await fileExists$5(join(cwd, "pnpm-lock.yaml"))) return {
|
|
3478
3486
|
packageManager: "pnpm",
|
|
3479
3487
|
command: "pnpm",
|
|
3480
3488
|
args: ["build"],
|
|
3481
3489
|
display: "pnpm build"
|
|
3482
3490
|
};
|
|
3483
|
-
if (await fileExists$
|
|
3491
|
+
if (await fileExists$5(join(cwd, "yarn.lock"))) return {
|
|
3484
3492
|
packageManager: "yarn",
|
|
3485
3493
|
command: "yarn",
|
|
3486
3494
|
args: ["build"],
|
|
3487
3495
|
display: "yarn build"
|
|
3488
3496
|
};
|
|
3489
|
-
if (await fileExists$
|
|
3497
|
+
if (await fileExists$5(join(cwd, "bun.lock")) || await fileExists$5(join(cwd, "bun.lockb"))) return {
|
|
3490
3498
|
packageManager: "bun",
|
|
3491
3499
|
command: "bun",
|
|
3492
3500
|
args: ["run", "build"],
|
|
@@ -3517,7 +3525,7 @@ const INVALID_RAILWAY_PROJECT_CHARS_RE = /[^a-z0-9-]+/g;
|
|
|
3517
3525
|
const REPEATED_HYPHENS_RE = /-+/g;
|
|
3518
3526
|
const EDGE_HYPHENS_RE = /^-|-$/g;
|
|
3519
3527
|
const RAILWAY_BUILDER = "RAILPACK";
|
|
3520
|
-
async function fileExists$
|
|
3528
|
+
async function fileExists$4(path) {
|
|
3521
3529
|
try {
|
|
3522
3530
|
await access(path);
|
|
3523
3531
|
return true;
|
|
@@ -3611,7 +3619,7 @@ const railwayTarget = {
|
|
|
3611
3619
|
async generateConfig(cwd, options) {
|
|
3612
3620
|
const generated = await configureAstroDeployAdapter(cwd, "node", options.dryRun);
|
|
3613
3621
|
const railwayPath = join(cwd, "railway.json");
|
|
3614
|
-
if (await fileExists$
|
|
3622
|
+
if (await fileExists$4(railwayPath)) return [...generated, {
|
|
3615
3623
|
path: "railway.json",
|
|
3616
3624
|
action: "exists"
|
|
3617
3625
|
}];
|
|
@@ -3968,7 +3976,7 @@ async function readPackageJson$2(cwd) {
|
|
|
3968
3976
|
return null;
|
|
3969
3977
|
}
|
|
3970
3978
|
}
|
|
3971
|
-
async function fileExists$
|
|
3979
|
+
async function fileExists$3(path) {
|
|
3972
3980
|
try {
|
|
3973
3981
|
await access(path);
|
|
3974
3982
|
return true;
|
|
@@ -4015,7 +4023,7 @@ const devCommand = defineCommand({
|
|
|
4015
4023
|
}
|
|
4016
4024
|
const database = resolveCliDatabaseTarget(cwd, args.database);
|
|
4017
4025
|
consola.info(`Database: ${database.display}`);
|
|
4018
|
-
if (database.localPath && !await fileExists$
|
|
4026
|
+
if (database.localPath && !await fileExists$3(database.localPath)) consola.start("Database not found, initializing...");
|
|
4019
4027
|
const db = createDatabase({ url: database.url });
|
|
4020
4028
|
try {
|
|
4021
4029
|
consola.start("Checking database migrations...");
|
|
@@ -4054,8 +4062,8 @@ const devCommand = defineCommand({
|
|
|
4054
4062
|
"--port",
|
|
4055
4063
|
args.port
|
|
4056
4064
|
];
|
|
4057
|
-
const pnpmLockExists = await fileExists$
|
|
4058
|
-
const yarnLockExists = await fileExists$
|
|
4065
|
+
const pnpmLockExists = await fileExists$3(resolve(cwd, "pnpm-lock.yaml"));
|
|
4066
|
+
const yarnLockExists = await fileExists$3(resolve(cwd, "yarn.lock"));
|
|
4059
4067
|
let cmd;
|
|
4060
4068
|
let cmdArgs;
|
|
4061
4069
|
if (pnpmLockExists) {
|
|
@@ -4099,7 +4107,7 @@ const devCommand = defineCommand({
|
|
|
4099
4107
|
*
|
|
4100
4108
|
* Diagnose database health: connection, migrations, schema integrity.
|
|
4101
4109
|
*/
|
|
4102
|
-
async function fileExists$
|
|
4110
|
+
async function fileExists$2(path) {
|
|
4103
4111
|
try {
|
|
4104
4112
|
await access(path);
|
|
4105
4113
|
return true;
|
|
@@ -4112,7 +4120,7 @@ function printResult(result) {
|
|
|
4112
4120
|
}
|
|
4113
4121
|
async function checkDatabase(database) {
|
|
4114
4122
|
const results = [];
|
|
4115
|
-
if (database.localPath && !await fileExists$
|
|
4123
|
+
if (database.localPath && !await fileExists$2(database.localPath)) {
|
|
4116
4124
|
results.push({
|
|
4117
4125
|
name: "database",
|
|
4118
4126
|
status: "fail",
|
|
@@ -4166,7 +4174,7 @@ async function checkDatabase(database) {
|
|
|
4166
4174
|
});
|
|
4167
4175
|
} catch {}
|
|
4168
4176
|
try {
|
|
4169
|
-
const count = (await sql`SELECT COUNT(id) as count FROM
|
|
4177
|
+
const count = (await sql`SELECT COUNT(id) as count FROM users`.execute(db)).rows[0]?.count ?? 0;
|
|
4170
4178
|
results.push({
|
|
4171
4179
|
name: "users",
|
|
4172
4180
|
status: count > 0 ? "pass" : "warn",
|
|
@@ -4314,7 +4322,7 @@ async function exportSeed(db, withContent) {
|
|
|
4314
4322
|
const { bylines, idToSeedId: bylineIdToSeedId } = await exportBylines(db);
|
|
4315
4323
|
if (bylines.length > 0) seed.bylines = bylines;
|
|
4316
4324
|
if (withContent !== void 0) {
|
|
4317
|
-
const collections = withContent === "" || withContent === "true" ? null : withContent.split(",").map((s) => s.trim()).filter(Boolean);
|
|
4325
|
+
const collections = withContent === "" || withContent === "true" || withContent === "all" ? null : withContent.split(",").map((s) => s.trim()).filter(Boolean);
|
|
4318
4326
|
seed.content = await exportContent(db, seed.collections || [], collections, bylineIdToSeedId, i18nEnabled);
|
|
4319
4327
|
}
|
|
4320
4328
|
return seed;
|
|
@@ -4444,8 +4452,8 @@ async function exportTaxonomies(db, i18nEnabled) {
|
|
|
4444
4452
|
for (const def of defs) {
|
|
4445
4453
|
const defSeedId = i18nEnabled && def.locale ? `tax:${def.name}:${def.locale}` : `tax:${def.name}`;
|
|
4446
4454
|
const terms = await termRepo.findByName(def.name, { locale: def.locale });
|
|
4447
|
-
const
|
|
4448
|
-
for (const term of terms)
|
|
4455
|
+
const groupToSlug = /* @__PURE__ */ new Map();
|
|
4456
|
+
for (const term of terms) groupToSlug.set(term.translationGroup ?? term.id, term.slug);
|
|
4449
4457
|
const termGroupToSeedId = /* @__PURE__ */ new Map();
|
|
4450
4458
|
const seedTerms = [];
|
|
4451
4459
|
for (const term of terms) {
|
|
@@ -4456,7 +4464,7 @@ async function exportTaxonomies(db, i18nEnabled) {
|
|
|
4456
4464
|
label: term.label,
|
|
4457
4465
|
description: typeof term.data?.description === "string" ? term.data.description : void 0
|
|
4458
4466
|
};
|
|
4459
|
-
if (term.parentId) seedTerm.parent =
|
|
4467
|
+
if (term.parentId) seedTerm.parent = groupToSlug.get(term.parentId);
|
|
4460
4468
|
if (i18nEnabled && term.locale) {
|
|
4461
4469
|
seedTerm.locale = term.locale;
|
|
4462
4470
|
if (term.translationGroup) {
|
|
@@ -4745,7 +4753,7 @@ async function getTaxonomyAssignments(taxonomyRepo, collection, entryId) {
|
|
|
4745
4753
|
*
|
|
4746
4754
|
* Initialize database from template config in package.json
|
|
4747
4755
|
*/
|
|
4748
|
-
async function fileExists$
|
|
4756
|
+
async function fileExists$1(path) {
|
|
4749
4757
|
try {
|
|
4750
4758
|
await access(path);
|
|
4751
4759
|
return true;
|
|
@@ -4845,7 +4853,7 @@ const initCommand = defineCommand({
|
|
|
4845
4853
|
if (alreadyInitialized && args.force) consola.warn("Re-initializing (--force)...");
|
|
4846
4854
|
if (config?.schema) {
|
|
4847
4855
|
const schemaPath = resolve(cwd, config.schema);
|
|
4848
|
-
if (await fileExists$
|
|
4856
|
+
if (await fileExists$1(schemaPath)) {
|
|
4849
4857
|
consola.start(`Running schema: ${config.schema}`);
|
|
4850
4858
|
try {
|
|
4851
4859
|
await runSqlFile(db, schemaPath);
|
|
@@ -5388,593 +5396,6 @@ const menuCommand = defineCommand({
|
|
|
5388
5396
|
}
|
|
5389
5397
|
});
|
|
5390
5398
|
|
|
5391
|
-
//#endregion
|
|
5392
|
-
//#region src/cli/commands/bundle-utils.ts
|
|
5393
|
-
/**
|
|
5394
|
-
* Bundle utility functions
|
|
5395
|
-
*
|
|
5396
|
-
* Shared logic extracted from the bundle command so it can be tested
|
|
5397
|
-
* without the CLI harness and tsdown dependency.
|
|
5398
|
-
*/
|
|
5399
|
-
const MAX_BUNDLE_SIZE = 256 * 1024;
|
|
5400
|
-
const MAX_FILE_SIZE = 128 * 1024;
|
|
5401
|
-
const MAX_FILE_COUNT = 20;
|
|
5402
|
-
const MAX_SCREENSHOTS = 5;
|
|
5403
|
-
const MAX_SCREENSHOT_WIDTH = 1920;
|
|
5404
|
-
const MAX_SCREENSHOT_HEIGHT = 1080;
|
|
5405
|
-
const ICON_SIZE = 256;
|
|
5406
|
-
function toFileImportSpecifier(filePath) {
|
|
5407
|
-
return pathToFileURL(filePath).href;
|
|
5408
|
-
}
|
|
5409
|
-
/** Matches Node.js built-in imports in bundled output. */
|
|
5410
|
-
const NODE_BUILTIN_IMPORT_RE = /(?:import|export|require)\s*(?:\(|[^(]*?\bfrom\s+)["'](?:node:)?([a-z_]+)(?:\/[^"']*)?\s*["']\)?/g;
|
|
5411
|
-
const LEADING_DOT_SLASH_RE = /^\.\//;
|
|
5412
|
-
const DIST_PREFIX_RE = /^dist\//;
|
|
5413
|
-
const MJS_EXT_RE = /\.m?js$/;
|
|
5414
|
-
const BUILD_OUTPUT_EXT_RE = /\.(?:mjs|js|cjs)$/;
|
|
5415
|
-
const TS_TO_TSX_RE = /\.ts$/;
|
|
5416
|
-
/** Node.js built-in modules that shouldn't appear in sandbox code */
|
|
5417
|
-
const NODE_BUILTINS = new Set([
|
|
5418
|
-
"assert",
|
|
5419
|
-
"buffer",
|
|
5420
|
-
"child_process",
|
|
5421
|
-
"cluster",
|
|
5422
|
-
"crypto",
|
|
5423
|
-
"dgram",
|
|
5424
|
-
"dns",
|
|
5425
|
-
"domain",
|
|
5426
|
-
"events",
|
|
5427
|
-
"fs",
|
|
5428
|
-
"http",
|
|
5429
|
-
"http2",
|
|
5430
|
-
"https",
|
|
5431
|
-
"inspector",
|
|
5432
|
-
"module",
|
|
5433
|
-
"net",
|
|
5434
|
-
"os",
|
|
5435
|
-
"path",
|
|
5436
|
-
"perf_hooks",
|
|
5437
|
-
"process",
|
|
5438
|
-
"punycode",
|
|
5439
|
-
"querystring",
|
|
5440
|
-
"readline",
|
|
5441
|
-
"repl",
|
|
5442
|
-
"stream",
|
|
5443
|
-
"string_decoder",
|
|
5444
|
-
"sys",
|
|
5445
|
-
"timers",
|
|
5446
|
-
"tls",
|
|
5447
|
-
"trace_events",
|
|
5448
|
-
"tty",
|
|
5449
|
-
"url",
|
|
5450
|
-
"util",
|
|
5451
|
-
"v8",
|
|
5452
|
-
"vm",
|
|
5453
|
-
"wasi",
|
|
5454
|
-
"worker_threads",
|
|
5455
|
-
"zlib"
|
|
5456
|
-
]);
|
|
5457
|
-
async function fileExists$1(path) {
|
|
5458
|
-
try {
|
|
5459
|
-
await access(path);
|
|
5460
|
-
return true;
|
|
5461
|
-
} catch {
|
|
5462
|
-
return false;
|
|
5463
|
-
}
|
|
5464
|
-
}
|
|
5465
|
-
/**
|
|
5466
|
-
* Read image dimensions from a buffer.
|
|
5467
|
-
* Returns [width, height] or null if the format is unrecognized.
|
|
5468
|
-
*/
|
|
5469
|
-
function readImageDimensions(buf) {
|
|
5470
|
-
try {
|
|
5471
|
-
const result = imageSize(buf);
|
|
5472
|
-
if (result.width != null && result.height != null) return [result.width, result.height];
|
|
5473
|
-
return null;
|
|
5474
|
-
} catch {
|
|
5475
|
-
return null;
|
|
5476
|
-
}
|
|
5477
|
-
}
|
|
5478
|
-
/**
|
|
5479
|
-
* Extract manifest metadata from a ResolvedPlugin.
|
|
5480
|
-
* Strips functions (hooks, route handlers) and keeps only serializable metadata.
|
|
5481
|
-
*/
|
|
5482
|
-
function extractManifest(plugin) {
|
|
5483
|
-
const hooks = [];
|
|
5484
|
-
for (const [name, resolved] of Object.entries(plugin.hooks)) {
|
|
5485
|
-
if (!resolved) continue;
|
|
5486
|
-
if (resolved.exclusive || resolved.priority !== 100 || resolved.timeout !== 5e3) {
|
|
5487
|
-
const entry = { name };
|
|
5488
|
-
if (resolved.exclusive) entry.exclusive = true;
|
|
5489
|
-
if (resolved.priority !== 100) entry.priority = resolved.priority;
|
|
5490
|
-
if (resolved.timeout !== 5e3) entry.timeout = resolved.timeout;
|
|
5491
|
-
hooks.push(entry);
|
|
5492
|
-
} else hooks.push(name);
|
|
5493
|
-
}
|
|
5494
|
-
return {
|
|
5495
|
-
id: plugin.id,
|
|
5496
|
-
version: plugin.version,
|
|
5497
|
-
capabilities: plugin.capabilities,
|
|
5498
|
-
allowedHosts: plugin.allowedHosts,
|
|
5499
|
-
storage: plugin.storage,
|
|
5500
|
-
hooks,
|
|
5501
|
-
routes: Object.keys(plugin.routes),
|
|
5502
|
-
admin: {
|
|
5503
|
-
settingsSchema: plugin.admin.settingsSchema,
|
|
5504
|
-
pages: plugin.admin.pages,
|
|
5505
|
-
widgets: plugin.admin.widgets
|
|
5506
|
-
}
|
|
5507
|
-
};
|
|
5508
|
-
}
|
|
5509
|
-
/**
|
|
5510
|
-
* Scan bundled code for Node.js built-in imports.
|
|
5511
|
-
* Matches require("node:xxx"), require("xxx"), import("node:xxx") — the patterns
|
|
5512
|
-
* that appear in bundled ESM/CJS output (not source-level named imports).
|
|
5513
|
-
* Returns deduplicated array of built-in module names found.
|
|
5514
|
-
*/
|
|
5515
|
-
function findNodeBuiltinImports(code) {
|
|
5516
|
-
const found = [];
|
|
5517
|
-
NODE_BUILTIN_IMPORT_RE.lastIndex = 0;
|
|
5518
|
-
let match;
|
|
5519
|
-
while ((match = NODE_BUILTIN_IMPORT_RE.exec(code)) !== null) {
|
|
5520
|
-
const mod = match[1];
|
|
5521
|
-
if (NODE_BUILTINS.has(mod)) found.push(mod);
|
|
5522
|
-
}
|
|
5523
|
-
return [...new Set(found)];
|
|
5524
|
-
}
|
|
5525
|
-
/**
|
|
5526
|
-
* Find a build output file by base name, checking common extensions.
|
|
5527
|
-
* tsdown may output .mjs, .js, or .cjs depending on format and config.
|
|
5528
|
-
*/
|
|
5529
|
-
async function findBuildOutput(dir, baseName) {
|
|
5530
|
-
const normalizedBaseName = baseName.replace(BUILD_OUTPUT_EXT_RE, "");
|
|
5531
|
-
for (const ext of [
|
|
5532
|
-
".mjs",
|
|
5533
|
-
".js",
|
|
5534
|
-
".cjs"
|
|
5535
|
-
]) {
|
|
5536
|
-
const candidate = join(dir, `${normalizedBaseName}${ext}`);
|
|
5537
|
-
if (await fileExists$1(candidate)) return candidate;
|
|
5538
|
-
}
|
|
5539
|
-
}
|
|
5540
|
-
/**
|
|
5541
|
-
* Resolve a dist/built path back to its source .ts/.tsx equivalent.
|
|
5542
|
-
* E.g., "./dist/index.mjs" → "src/index.ts"
|
|
5543
|
-
*/
|
|
5544
|
-
async function resolveSourceEntry(pluginDir, distPath) {
|
|
5545
|
-
const cleaned = distPath.replace(LEADING_DOT_SLASH_RE, "");
|
|
5546
|
-
const srcPath = cleaned.replace(DIST_PREFIX_RE, "src/").replace(MJS_EXT_RE, ".ts");
|
|
5547
|
-
const srcFull = resolve(pluginDir, srcPath);
|
|
5548
|
-
if (await fileExists$1(srcFull)) return srcFull;
|
|
5549
|
-
const tsxFull = resolve(pluginDir, srcPath.replace(TS_TO_TSX_RE, ".tsx"));
|
|
5550
|
-
if (await fileExists$1(tsxFull)) return tsxFull;
|
|
5551
|
-
const direct = resolve(pluginDir, cleaned);
|
|
5552
|
-
if (await fileExists$1(direct)) return direct;
|
|
5553
|
-
}
|
|
5554
|
-
const TS_SOURCE_EXPORT_RE = /\.(?:ts|tsx|mts|cts|jsx)$/;
|
|
5555
|
-
/**
|
|
5556
|
-
* Find package.json exports that point to source files instead of built output.
|
|
5557
|
-
* Returns an array of `{ exportPath, resolvedPath }` for each offending export.
|
|
5558
|
-
*/
|
|
5559
|
-
function findSourceExports(exports) {
|
|
5560
|
-
const issues = [];
|
|
5561
|
-
for (const [exportPath, exportValue] of Object.entries(exports)) {
|
|
5562
|
-
const resolved = typeof exportValue === "string" ? exportValue : exportValue && typeof exportValue === "object" && "import" in exportValue ? exportValue.import : null;
|
|
5563
|
-
if (resolved && TS_SOURCE_EXPORT_RE.test(resolved)) issues.push({
|
|
5564
|
-
exportPath,
|
|
5565
|
-
resolvedPath: resolved
|
|
5566
|
-
});
|
|
5567
|
-
}
|
|
5568
|
-
return issues;
|
|
5569
|
-
}
|
|
5570
|
-
/**
|
|
5571
|
-
* Recursively walk a staging directory and return all regular files with
|
|
5572
|
-
* tarball-relative names.
|
|
5573
|
-
*/
|
|
5574
|
-
async function collectBundleEntries(dir) {
|
|
5575
|
-
const entries = [];
|
|
5576
|
-
await walkBundle(dir, "", entries);
|
|
5577
|
-
return entries;
|
|
5578
|
-
}
|
|
5579
|
-
async function walkBundle(dir, prefix, into) {
|
|
5580
|
-
const items = await readdir(dir, { withFileTypes: true });
|
|
5581
|
-
for (const item of items) {
|
|
5582
|
-
const fullPath = join(dir, item.name);
|
|
5583
|
-
const relPath = prefix ? `${prefix}/${item.name}` : item.name;
|
|
5584
|
-
if (item.isFile()) {
|
|
5585
|
-
const s = await stat(fullPath);
|
|
5586
|
-
into.push({
|
|
5587
|
-
name: relPath,
|
|
5588
|
-
bytes: s.size
|
|
5589
|
-
});
|
|
5590
|
-
} else if (item.isDirectory()) await walkBundle(fullPath, relPath, into);
|
|
5591
|
-
}
|
|
5592
|
-
}
|
|
5593
|
-
function totalBundleBytes(entries) {
|
|
5594
|
-
let total = 0;
|
|
5595
|
-
for (const entry of entries) total += entry.bytes;
|
|
5596
|
-
return total;
|
|
5597
|
-
}
|
|
5598
|
-
/**
|
|
5599
|
-
* Enforce sandboxed plugin caps against decompressed bundle files:
|
|
5600
|
-
* total size, per-file size, and file count.
|
|
5601
|
-
*/
|
|
5602
|
-
function validateBundleSize(entries) {
|
|
5603
|
-
const violations = [];
|
|
5604
|
-
const total = totalBundleBytes(entries);
|
|
5605
|
-
if (total > MAX_BUNDLE_SIZE) violations.push(`Bundle size ${formatBytes(total)} exceeds maximum of ${formatBytes(MAX_BUNDLE_SIZE)}.`);
|
|
5606
|
-
if (entries.length > MAX_FILE_COUNT) violations.push(`Bundle contains ${entries.length} files, exceeds maximum of ${MAX_FILE_COUNT}.`);
|
|
5607
|
-
const oversized = entries.filter((entry) => entry.bytes > MAX_FILE_SIZE).toSorted((a, b) => a.name.localeCompare(b.name));
|
|
5608
|
-
for (const entry of oversized) violations.push(`File ${entry.name} is ${formatBytes(entry.bytes)}, exceeds per-file maximum of ${formatBytes(MAX_FILE_SIZE)}.`);
|
|
5609
|
-
return violations;
|
|
5610
|
-
}
|
|
5611
|
-
function formatBytes(bytes) {
|
|
5612
|
-
if (bytes < 1024) return `${bytes} B`;
|
|
5613
|
-
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
5614
|
-
return `${(bytes / 1024 / 1024).toFixed(2)} MB`;
|
|
5615
|
-
}
|
|
5616
|
-
/**
|
|
5617
|
-
* Create a gzipped tarball from a directory.
|
|
5618
|
-
*/
|
|
5619
|
-
async function createTarball(sourceDir, outputPath) {
|
|
5620
|
-
const { createGzip } = await import("node:zlib");
|
|
5621
|
-
await pipeline(packTar(sourceDir), createGzip({ level: 9 }), createWriteStream(outputPath));
|
|
5622
|
-
}
|
|
5623
|
-
|
|
5624
|
-
//#endregion
|
|
5625
|
-
//#region src/cli/commands/bundle.ts
|
|
5626
|
-
/**
|
|
5627
|
-
* dineway plugin bundle
|
|
5628
|
-
*
|
|
5629
|
-
* Produces a publishable plugin tarball from a plugin source directory.
|
|
5630
|
-
*
|
|
5631
|
-
* Steps:
|
|
5632
|
-
* 1. Resolve plugin entrypoint (finds definePlugin() export)
|
|
5633
|
-
* 2. Bundle backend code with tsdown → backend.js (single ES module, tree-shaken)
|
|
5634
|
-
* 3. Bundle admin code if present → admin.js
|
|
5635
|
-
* 4. Extract manifest from definePlugin() → manifest.json
|
|
5636
|
-
* 5. Collect assets (README.md, icon.png, screenshots/)
|
|
5637
|
-
* 6. Validate bundle (manifest schema, size limits, no Node.js builtins)
|
|
5638
|
-
* 7. Create tarball ({id}-{version}.tar.gz)
|
|
5639
|
-
*/
|
|
5640
|
-
var bundle_exports = /* @__PURE__ */ __exportAll({ bundleCommand: () => bundleCommand });
|
|
5641
|
-
const TS_EXT_RE = /\.tsx?$/;
|
|
5642
|
-
const SLASH_RE = /\//g;
|
|
5643
|
-
const LEADING_AT_RE = /^@/;
|
|
5644
|
-
const DINEWAY_SCOPE_RE = /^@dineway-ai\//;
|
|
5645
|
-
const bundleCommand = defineCommand({
|
|
5646
|
-
meta: {
|
|
5647
|
-
name: "bundle",
|
|
5648
|
-
description: "Bundle a plugin for marketplace distribution"
|
|
5649
|
-
},
|
|
5650
|
-
args: {
|
|
5651
|
-
dir: {
|
|
5652
|
-
type: "string",
|
|
5653
|
-
description: "Plugin directory (default: current directory)",
|
|
5654
|
-
default: process.cwd()
|
|
5655
|
-
},
|
|
5656
|
-
outDir: {
|
|
5657
|
-
type: "string",
|
|
5658
|
-
alias: "o",
|
|
5659
|
-
description: "Output directory for the tarball (default: ./dist)",
|
|
5660
|
-
default: "dist"
|
|
5661
|
-
},
|
|
5662
|
-
validateOnly: {
|
|
5663
|
-
type: "boolean",
|
|
5664
|
-
description: "Run validation only, skip tarball creation",
|
|
5665
|
-
default: false
|
|
5666
|
-
}
|
|
5667
|
-
},
|
|
5668
|
-
async run({ args }) {
|
|
5669
|
-
const pluginDir = resolve(args.dir);
|
|
5670
|
-
const outDir = resolve(pluginDir, args.outDir);
|
|
5671
|
-
const validateOnly = args.validateOnly;
|
|
5672
|
-
consola.start(validateOnly ? "Validating plugin..." : "Bundling plugin...");
|
|
5673
|
-
const pkgPath = join(pluginDir, "package.json");
|
|
5674
|
-
if (!await fileExists$1(pkgPath)) {
|
|
5675
|
-
consola.error("No package.json found in", pluginDir);
|
|
5676
|
-
process.exit(1);
|
|
5677
|
-
}
|
|
5678
|
-
const pkg = JSON.parse(await readFile(pkgPath, "utf-8"));
|
|
5679
|
-
let backendEntry;
|
|
5680
|
-
let adminEntry;
|
|
5681
|
-
if (pkg.exports) {
|
|
5682
|
-
const sandboxExport = pkg.exports["./sandbox"];
|
|
5683
|
-
if (typeof sandboxExport === "string") backendEntry = await resolveSourceEntry(pluginDir, sandboxExport);
|
|
5684
|
-
else if (sandboxExport && typeof sandboxExport === "object" && "import" in sandboxExport) backendEntry = await resolveSourceEntry(pluginDir, sandboxExport.import);
|
|
5685
|
-
const adminExport = pkg.exports["./admin"];
|
|
5686
|
-
if (typeof adminExport === "string") adminEntry = await resolveSourceEntry(pluginDir, adminExport);
|
|
5687
|
-
else if (adminExport && typeof adminExport === "object" && "import" in adminExport) adminEntry = await resolveSourceEntry(pluginDir, adminExport.import);
|
|
5688
|
-
}
|
|
5689
|
-
if (!backendEntry) {
|
|
5690
|
-
const defaultSandbox = join(pluginDir, "src/sandbox-entry.ts");
|
|
5691
|
-
if (await fileExists$1(defaultSandbox)) backendEntry = defaultSandbox;
|
|
5692
|
-
}
|
|
5693
|
-
let mainEntry;
|
|
5694
|
-
if (pkg.exports?.["."] !== void 0) {
|
|
5695
|
-
const mainExport = pkg.exports["."];
|
|
5696
|
-
if (typeof mainExport === "string") mainEntry = await resolveSourceEntry(pluginDir, mainExport);
|
|
5697
|
-
else if (mainExport && typeof mainExport === "object" && "import" in mainExport) mainEntry = await resolveSourceEntry(pluginDir, mainExport.import);
|
|
5698
|
-
}
|
|
5699
|
-
if (!mainEntry && pkg.main) mainEntry = await resolveSourceEntry(pluginDir, pkg.main);
|
|
5700
|
-
if (!mainEntry) {
|
|
5701
|
-
const defaultMain = join(pluginDir, "src/index.ts");
|
|
5702
|
-
if (await fileExists$1(defaultMain)) mainEntry = defaultMain;
|
|
5703
|
-
}
|
|
5704
|
-
if (!mainEntry) {
|
|
5705
|
-
consola.error("Cannot find plugin entrypoint. Expected src/index.ts or main/exports in package.json");
|
|
5706
|
-
process.exit(1);
|
|
5707
|
-
}
|
|
5708
|
-
consola.info(`Main entry: ${mainEntry}`);
|
|
5709
|
-
if (backendEntry) consola.info(`Backend entry: ${backendEntry}`);
|
|
5710
|
-
if (adminEntry) consola.info(`Admin entry: ${adminEntry}`);
|
|
5711
|
-
consola.start("Extracting plugin manifest...");
|
|
5712
|
-
const { build } = await import("tsdown");
|
|
5713
|
-
const tmpDir = join(pluginDir, ".dineway-bundle-tmp");
|
|
5714
|
-
try {
|
|
5715
|
-
await mkdir(tmpDir, { recursive: true });
|
|
5716
|
-
await copyFile(pkgPath, join(tmpDir, "package.json"));
|
|
5717
|
-
const mainOutDir = join(tmpDir, "main");
|
|
5718
|
-
await build({
|
|
5719
|
-
config: false,
|
|
5720
|
-
entry: [mainEntry],
|
|
5721
|
-
format: "esm",
|
|
5722
|
-
outDir: mainOutDir,
|
|
5723
|
-
dts: false,
|
|
5724
|
-
platform: "node",
|
|
5725
|
-
external: ["dineway", DINEWAY_SCOPE_RE]
|
|
5726
|
-
});
|
|
5727
|
-
const pluginNodeModules = join(pluginDir, "node_modules");
|
|
5728
|
-
const tmpNodeModules = join(mainOutDir, "node_modules");
|
|
5729
|
-
if (await fileExists$1(pluginNodeModules)) await symlink(pluginNodeModules, tmpNodeModules, "junction");
|
|
5730
|
-
const mainOutputPath = await findBuildOutput(mainOutDir, basename(mainEntry).replace(TS_EXT_RE, ""));
|
|
5731
|
-
if (!mainOutputPath) {
|
|
5732
|
-
consola.error("Failed to build main entry — no output found in", mainOutDir);
|
|
5733
|
-
process.exit(1);
|
|
5734
|
-
}
|
|
5735
|
-
const pluginModule = await import(toFileImportSpecifier(mainOutputPath));
|
|
5736
|
-
let resolvedPlugin;
|
|
5737
|
-
if (typeof pluginModule.createPlugin === "function") resolvedPlugin = pluginModule.createPlugin();
|
|
5738
|
-
else if (typeof pluginModule.default === "function") resolvedPlugin = pluginModule.default();
|
|
5739
|
-
else if (typeof pluginModule.default === "object" && pluginModule.default !== null) {
|
|
5740
|
-
const defaultExport = pluginModule.default;
|
|
5741
|
-
if ("id" in defaultExport && "version" in defaultExport) resolvedPlugin = defaultExport;
|
|
5742
|
-
}
|
|
5743
|
-
if (!resolvedPlugin) for (const [key, value] of Object.entries(pluginModule)) {
|
|
5744
|
-
if (key === "default" || typeof value !== "function") continue;
|
|
5745
|
-
try {
|
|
5746
|
-
const result = value();
|
|
5747
|
-
if (result && typeof result === "object" && "id" in result && "version" in result) {
|
|
5748
|
-
resolvedPlugin = {
|
|
5749
|
-
id: result.id,
|
|
5750
|
-
version: result.version,
|
|
5751
|
-
capabilities: result.capabilities ?? [],
|
|
5752
|
-
allowedHosts: result.allowedHosts ?? [],
|
|
5753
|
-
storage: result.storage ?? {},
|
|
5754
|
-
hooks: {},
|
|
5755
|
-
routes: {},
|
|
5756
|
-
admin: {
|
|
5757
|
-
pages: result.adminPages,
|
|
5758
|
-
widgets: result.adminWidgets
|
|
5759
|
-
}
|
|
5760
|
-
};
|
|
5761
|
-
if (backendEntry) {
|
|
5762
|
-
const backendProbeDir = join(tmpDir, "backend-probe");
|
|
5763
|
-
const probeShimDir = join(tmpDir, "probe-shims");
|
|
5764
|
-
await mkdir(probeShimDir, { recursive: true });
|
|
5765
|
-
await writeFile(join(probeShimDir, "dineway.mjs"), "export const definePlugin = (d) => d;\n");
|
|
5766
|
-
await build({
|
|
5767
|
-
config: false,
|
|
5768
|
-
entry: [backendEntry],
|
|
5769
|
-
format: "esm",
|
|
5770
|
-
outDir: backendProbeDir,
|
|
5771
|
-
dts: false,
|
|
5772
|
-
platform: "neutral",
|
|
5773
|
-
external: [],
|
|
5774
|
-
alias: { dineway: join(probeShimDir, "dineway.mjs") },
|
|
5775
|
-
treeshake: true
|
|
5776
|
-
});
|
|
5777
|
-
const backendProbePath = await findBuildOutput(backendProbeDir, basename(backendEntry).replace(TS_EXT_RE, ""));
|
|
5778
|
-
if (backendProbePath) {
|
|
5779
|
-
const standardDef = (await import(toFileImportSpecifier(backendProbePath))).default ?? {};
|
|
5780
|
-
const hooks = standardDef.hooks;
|
|
5781
|
-
const routes = standardDef.routes;
|
|
5782
|
-
if (hooks) for (const hookName of Object.keys(hooks)) {
|
|
5783
|
-
const hookEntry = hooks[hookName];
|
|
5784
|
-
const isConfig = typeof hookEntry === "object" && hookEntry !== null && "handler" in hookEntry;
|
|
5785
|
-
const config = isConfig ? hookEntry : {};
|
|
5786
|
-
resolvedPlugin.hooks[hookName] = {
|
|
5787
|
-
handler: isConfig ? hookEntry.handler : hookEntry,
|
|
5788
|
-
priority: config.priority ?? 100,
|
|
5789
|
-
timeout: config.timeout ?? 5e3,
|
|
5790
|
-
dependencies: config.dependencies ?? [],
|
|
5791
|
-
errorPolicy: config.errorPolicy ?? "abort",
|
|
5792
|
-
exclusive: config.exclusive ?? false,
|
|
5793
|
-
pluginId: result.id
|
|
5794
|
-
};
|
|
5795
|
-
}
|
|
5796
|
-
if (routes) for (const [name, route] of Object.entries(routes)) {
|
|
5797
|
-
const routeObj = route;
|
|
5798
|
-
resolvedPlugin.routes[name] = {
|
|
5799
|
-
handler: routeObj.handler,
|
|
5800
|
-
public: routeObj.public
|
|
5801
|
-
};
|
|
5802
|
-
}
|
|
5803
|
-
}
|
|
5804
|
-
}
|
|
5805
|
-
break;
|
|
5806
|
-
}
|
|
5807
|
-
} catch {}
|
|
5808
|
-
}
|
|
5809
|
-
if (!resolvedPlugin?.id || !resolvedPlugin?.version) {
|
|
5810
|
-
consola.error("Could not extract plugin definition. Expected one of:\n - createPlugin() export (native format)\n - Descriptor factory function returning { id, version, ... } (standard format)");
|
|
5811
|
-
process.exit(1);
|
|
5812
|
-
}
|
|
5813
|
-
const manifest = extractManifest(resolvedPlugin);
|
|
5814
|
-
if (resolvedPlugin.admin?.entry) {
|
|
5815
|
-
consola.error("Plugin declares adminEntry — React admin components require native/trusted mode. Use Block Kit for sandboxed admin pages, or remove adminEntry.");
|
|
5816
|
-
process.exit(1);
|
|
5817
|
-
}
|
|
5818
|
-
if (resolvedPlugin.admin?.portableTextBlocks && resolvedPlugin.admin.portableTextBlocks.length > 0) {
|
|
5819
|
-
consola.error("Plugin declares portableTextBlocks — these require native/trusted mode and cannot be bundled for the marketplace.");
|
|
5820
|
-
process.exit(1);
|
|
5821
|
-
}
|
|
5822
|
-
consola.success(`Plugin: ${manifest.id}@${manifest.version}`);
|
|
5823
|
-
consola.info(` Capabilities: ${manifest.capabilities.length > 0 ? manifest.capabilities.join(", ") : "(none)"}`);
|
|
5824
|
-
consola.info(` Hooks: ${manifest.hooks.length > 0 ? manifest.hooks.map((h) => typeof h === "string" ? h : h.name).join(", ") : "(none)"}`);
|
|
5825
|
-
consola.info(` Routes: ${manifest.routes.length > 0 ? manifest.routes.map((r) => typeof r === "string" ? r : r.name).join(", ") : "(none)"}`);
|
|
5826
|
-
const bundleDir = join(tmpDir, "bundle");
|
|
5827
|
-
await mkdir(bundleDir, { recursive: true });
|
|
5828
|
-
if (backendEntry) {
|
|
5829
|
-
consola.start("Bundling backend...");
|
|
5830
|
-
const shimDir = join(tmpDir, "shims");
|
|
5831
|
-
await mkdir(shimDir, { recursive: true });
|
|
5832
|
-
await writeFile(join(shimDir, "dineway.mjs"), "export const definePlugin = (d) => d;\n");
|
|
5833
|
-
await build({
|
|
5834
|
-
config: false,
|
|
5835
|
-
entry: [backendEntry],
|
|
5836
|
-
format: "esm",
|
|
5837
|
-
outDir: join(tmpDir, "backend"),
|
|
5838
|
-
dts: false,
|
|
5839
|
-
platform: "neutral",
|
|
5840
|
-
external: [],
|
|
5841
|
-
alias: { dineway: join(shimDir, "dineway.mjs") },
|
|
5842
|
-
minify: true,
|
|
5843
|
-
treeshake: true
|
|
5844
|
-
});
|
|
5845
|
-
const backendBaseName = basename(backendEntry).replace(TS_EXT_RE, "");
|
|
5846
|
-
const backendOutputPath = await findBuildOutput(join(tmpDir, "backend"), backendBaseName);
|
|
5847
|
-
if (backendOutputPath) {
|
|
5848
|
-
await copyFile(backendOutputPath, join(bundleDir, "backend.js"));
|
|
5849
|
-
consola.success("Built backend.js");
|
|
5850
|
-
} else {
|
|
5851
|
-
consola.error("Backend build produced no output");
|
|
5852
|
-
process.exit(1);
|
|
5853
|
-
}
|
|
5854
|
-
} else {
|
|
5855
|
-
consola.warn("No sandbox entry found — bundle will have no backend.js");
|
|
5856
|
-
consola.warn(" Add a \"sandbox-entry.ts\" in src/ or a \"./sandbox\" export in package.json");
|
|
5857
|
-
}
|
|
5858
|
-
if (adminEntry) {
|
|
5859
|
-
consola.start("Bundling admin...");
|
|
5860
|
-
await build({
|
|
5861
|
-
config: false,
|
|
5862
|
-
entry: [adminEntry],
|
|
5863
|
-
format: "esm",
|
|
5864
|
-
outDir: join(tmpDir, "admin"),
|
|
5865
|
-
dts: false,
|
|
5866
|
-
platform: "neutral",
|
|
5867
|
-
external: [],
|
|
5868
|
-
minify: true,
|
|
5869
|
-
treeshake: true
|
|
5870
|
-
});
|
|
5871
|
-
const adminBaseName = basename(adminEntry).replace(TS_EXT_RE, "");
|
|
5872
|
-
const adminOutputPath = await findBuildOutput(join(tmpDir, "admin"), adminBaseName);
|
|
5873
|
-
if (adminOutputPath) {
|
|
5874
|
-
await copyFile(adminOutputPath, join(bundleDir, "admin.js"));
|
|
5875
|
-
consola.success("Built admin.js");
|
|
5876
|
-
}
|
|
5877
|
-
}
|
|
5878
|
-
await writeFile(join(bundleDir, "manifest.json"), JSON.stringify(manifest, null, 2));
|
|
5879
|
-
consola.start("Collecting assets...");
|
|
5880
|
-
const readmePath = join(pluginDir, "README.md");
|
|
5881
|
-
if (await fileExists$1(readmePath)) {
|
|
5882
|
-
await copyFile(readmePath, join(bundleDir, "README.md"));
|
|
5883
|
-
consola.success("Included README.md");
|
|
5884
|
-
}
|
|
5885
|
-
const iconPath = join(pluginDir, "icon.png");
|
|
5886
|
-
if (await fileExists$1(iconPath)) {
|
|
5887
|
-
const dims = readImageDimensions(await readFile(iconPath));
|
|
5888
|
-
if (!dims) consola.warn("icon.png is not a valid PNG — skipping");
|
|
5889
|
-
else if (dims[0] !== ICON_SIZE || dims[1] !== ICON_SIZE) {
|
|
5890
|
-
consola.warn(`icon.png is ${dims[0]}x${dims[1]}, expected ${ICON_SIZE}x${ICON_SIZE} — including anyway`);
|
|
5891
|
-
await copyFile(iconPath, join(bundleDir, "icon.png"));
|
|
5892
|
-
} else {
|
|
5893
|
-
await copyFile(iconPath, join(bundleDir, "icon.png"));
|
|
5894
|
-
consola.success("Included icon.png");
|
|
5895
|
-
}
|
|
5896
|
-
}
|
|
5897
|
-
const screenshotsDir = join(pluginDir, "screenshots");
|
|
5898
|
-
if (await fileExists$1(screenshotsDir)) {
|
|
5899
|
-
const screenshotFiles = (await readdir(screenshotsDir)).filter((f) => {
|
|
5900
|
-
const ext = extname(f).toLowerCase();
|
|
5901
|
-
return ext === ".png" || ext === ".jpg" || ext === ".jpeg";
|
|
5902
|
-
}).toSorted().slice(0, MAX_SCREENSHOTS);
|
|
5903
|
-
if (screenshotFiles.length > 0) {
|
|
5904
|
-
await mkdir(join(bundleDir, "screenshots"), { recursive: true });
|
|
5905
|
-
for (const file of screenshotFiles) {
|
|
5906
|
-
const filePath = join(screenshotsDir, file);
|
|
5907
|
-
const dims = readImageDimensions(await readFile(filePath));
|
|
5908
|
-
if (!dims) {
|
|
5909
|
-
consola.warn(`screenshots/${file} — cannot read dimensions, skipping`);
|
|
5910
|
-
continue;
|
|
5911
|
-
}
|
|
5912
|
-
if (dims[0] > MAX_SCREENSHOT_WIDTH || dims[1] > MAX_SCREENSHOT_HEIGHT) consola.warn(`screenshots/${file} is ${dims[0]}x${dims[1]}, max ${MAX_SCREENSHOT_WIDTH}x${MAX_SCREENSHOT_HEIGHT} — including anyway`);
|
|
5913
|
-
await copyFile(filePath, join(bundleDir, "screenshots", file));
|
|
5914
|
-
}
|
|
5915
|
-
consola.success(`Included ${screenshotFiles.length} screenshot(s)`);
|
|
5916
|
-
}
|
|
5917
|
-
}
|
|
5918
|
-
consola.start("Validating bundle...");
|
|
5919
|
-
let hasErrors = false;
|
|
5920
|
-
if (pkg.exports) for (const issue of findSourceExports(pkg.exports)) {
|
|
5921
|
-
consola.error(`Export "${issue.exportPath}" points to source (${issue.resolvedPath}). Package exports must point to built files (e.g. dist/*.mjs). Add a build step and update the exports map.`);
|
|
5922
|
-
hasErrors = true;
|
|
5923
|
-
}
|
|
5924
|
-
const backendPath = join(bundleDir, "backend.js");
|
|
5925
|
-
if (await fileExists$1(backendPath)) {
|
|
5926
|
-
const builtins = findNodeBuiltinImports(await readFile(backendPath, "utf-8"));
|
|
5927
|
-
if (builtins.length > 0) {
|
|
5928
|
-
consola.error(`backend.js imports Node.js built-in modules: ${builtins.join(", ")}`);
|
|
5929
|
-
consola.error("Sandboxed plugins cannot use Node.js APIs");
|
|
5930
|
-
hasErrors = true;
|
|
5931
|
-
}
|
|
5932
|
-
}
|
|
5933
|
-
if (manifest.capabilities.includes("network:request:unrestricted")) consola.warn("Plugin declares unrestricted network access (network:request:unrestricted) — it can make requests to any host");
|
|
5934
|
-
else if (manifest.capabilities.includes("network:request") && manifest.allowedHosts.length === 0) consola.warn("Plugin declares network:request capability but no allowedHosts — all fetch requests will be blocked");
|
|
5935
|
-
if (resolvedPlugin.admin?.portableTextBlocks && resolvedPlugin.admin.portableTextBlocks.length > 0) consola.warn("Plugin declares portableTextBlocks — these require trusted mode and will be ignored in sandboxed plugins");
|
|
5936
|
-
if (resolvedPlugin.admin?.entry) consola.warn("Plugin declares admin.entry — custom React components require trusted mode. Use Block Kit for sandboxed admin pages");
|
|
5937
|
-
if (resolvedPlugin.hooks["page:fragments"]) consola.warn("Plugin declares page:fragments hook — this is trusted-only and will not work in sandboxed mode");
|
|
5938
|
-
const hasAdminPages = (manifest.admin?.pages?.length ?? 0) > 0;
|
|
5939
|
-
const hasAdminWidgets = (manifest.admin?.widgets?.length ?? 0) > 0;
|
|
5940
|
-
if (hasAdminPages || hasAdminWidgets) {
|
|
5941
|
-
if (!manifest.routes.map((r) => typeof r === "string" ? r : r.name).includes("admin")) {
|
|
5942
|
-
consola.error(`Plugin declares ${hasAdminPages ? "adminPages" : ""}${hasAdminPages && hasAdminWidgets ? " and " : ""}${hasAdminWidgets ? "adminWidgets" : ""} but the sandbox entry has no "admin" route. Add an admin route handler to serve Block Kit pages.`);
|
|
5943
|
-
hasErrors = true;
|
|
5944
|
-
}
|
|
5945
|
-
}
|
|
5946
|
-
const bundleEntries = await collectBundleEntries(bundleDir);
|
|
5947
|
-
const sizeViolations = validateBundleSize(bundleEntries);
|
|
5948
|
-
if (sizeViolations.length > 0) {
|
|
5949
|
-
for (const violation of sizeViolations) consola.error(violation);
|
|
5950
|
-
hasErrors = true;
|
|
5951
|
-
} else consola.info(`Bundle size: ${formatBytes(totalBundleBytes(bundleEntries))} across ${bundleEntries.length} file${bundleEntries.length === 1 ? "" : "s"}`);
|
|
5952
|
-
if (hasErrors) {
|
|
5953
|
-
consola.error("Bundle validation failed");
|
|
5954
|
-
process.exit(1);
|
|
5955
|
-
}
|
|
5956
|
-
consola.success("Validation passed");
|
|
5957
|
-
if (validateOnly) return;
|
|
5958
|
-
await mkdir(outDir, { recursive: true });
|
|
5959
|
-
const tarballName = `${manifest.id.replace(SLASH_RE, "-").replace(LEADING_AT_RE, "")}-${manifest.version}.tar.gz`;
|
|
5960
|
-
const tarballPath = join(outDir, tarballName);
|
|
5961
|
-
consola.start("Creating tarball...");
|
|
5962
|
-
await createTarball(bundleDir, tarballPath);
|
|
5963
|
-
const tarballSizeKB = ((await stat(tarballPath)).size / 1024).toFixed(1);
|
|
5964
|
-
const tarballBuf = await readFile(tarballPath);
|
|
5965
|
-
const checksum = createHash("sha256").update(tarballBuf).digest("hex");
|
|
5966
|
-
consola.success(`Created ${tarballName} (${tarballSizeKB}KB)`);
|
|
5967
|
-
consola.info(` SHA-256: ${checksum}`);
|
|
5968
|
-
consola.info(` Path: ${tarballPath}`);
|
|
5969
|
-
} finally {
|
|
5970
|
-
if (tmpDir.endsWith(".dineway-bundle-tmp")) await rm(tmpDir, {
|
|
5971
|
-
recursive: true,
|
|
5972
|
-
force: true
|
|
5973
|
-
});
|
|
5974
|
-
}
|
|
5975
|
-
}
|
|
5976
|
-
});
|
|
5977
|
-
|
|
5978
5399
|
//#endregion
|
|
5979
5400
|
//#region src/cli/commands/plugin-init.ts
|
|
5980
5401
|
/**
|
|
@@ -6050,7 +5471,7 @@ const pluginInitCommand = defineCommand({
|
|
|
6050
5471
|
process.exit(1);
|
|
6051
5472
|
}
|
|
6052
5473
|
const srcDir = join(targetDir, "src");
|
|
6053
|
-
if (await fileExists$
|
|
5474
|
+
if (await fileExists$11(join(targetDir, "package.json"))) {
|
|
6054
5475
|
consola.error(`package.json already exists in ${targetDir}`);
|
|
6055
5476
|
process.exit(1);
|
|
6056
5477
|
}
|
|
@@ -6416,6 +5837,7 @@ async function pollGitHubDeviceFlow(tokenEndpoint, clientId, deviceCode, interva
|
|
|
6416
5837
|
const manifestSummarySchema = pluginManifestSchema.pick({
|
|
6417
5838
|
id: true,
|
|
6418
5839
|
version: true,
|
|
5840
|
+
declaredAccess: true,
|
|
6419
5841
|
capabilities: true,
|
|
6420
5842
|
allowedHosts: true
|
|
6421
5843
|
});
|
|
@@ -6433,7 +5855,20 @@ async function readManifestFromTarball(tarballPath) {
|
|
|
6433
5855
|
const parsed = JSON.parse(content);
|
|
6434
5856
|
const result = manifestSummarySchema.safeParse(parsed);
|
|
6435
5857
|
if (!result.success) throw new Error(`Invalid manifest.json: ${result.error.message}`);
|
|
6436
|
-
|
|
5858
|
+
const reconciled = reconcileManifestAccess({
|
|
5859
|
+
...result.data,
|
|
5860
|
+
storage: {},
|
|
5861
|
+
hooks: [],
|
|
5862
|
+
routes: [],
|
|
5863
|
+
admin: {}
|
|
5864
|
+
});
|
|
5865
|
+
return {
|
|
5866
|
+
id: reconciled.id,
|
|
5867
|
+
version: reconciled.version,
|
|
5868
|
+
declaredAccess: reconciled.declaredAccess,
|
|
5869
|
+
capabilities: reconciled.capabilities,
|
|
5870
|
+
allowedHosts: reconciled.allowedHosts
|
|
5871
|
+
};
|
|
6437
5872
|
}
|
|
6438
5873
|
const POLL_INTERVAL_MS = 3e3;
|
|
6439
5874
|
const POLL_TIMEOUT_MS = 12e4;
|
|
@@ -6518,7 +5953,7 @@ const publishCommand = defineCommand({
|
|
|
6518
5953
|
const pluginDir = resolve(args.dir);
|
|
6519
5954
|
try {
|
|
6520
5955
|
const { runCommand } = await import("citty");
|
|
6521
|
-
const { bundleCommand } = await
|
|
5956
|
+
const { bundleCommand } = await import("../bundle-7C_DpkEq.mjs").then((n) => n.n);
|
|
6522
5957
|
await runCommand(bundleCommand, { rawArgs: ["--dir", pluginDir] });
|
|
6523
5958
|
} catch {
|
|
6524
5959
|
consola.error("Build failed");
|
|
@@ -7182,7 +6617,7 @@ const seedCommand = defineCommand({
|
|
|
7182
6617
|
},
|
|
7183
6618
|
"no-content": {
|
|
7184
6619
|
type: "boolean",
|
|
7185
|
-
description: "Skip sample content",
|
|
6620
|
+
description: "Skip sample data (content entries, bylines, taxonomy terms)",
|
|
7186
6621
|
default: false
|
|
7187
6622
|
},
|
|
7188
6623
|
"on-conflict": {
|