emdash 0.32.0 → 0.34.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/{adapters-C0ONzkUP.d.mts → adapters-34EN2eXO.d.mts} +34 -2
- package/dist/adapters-34EN2eXO.d.mts.map +1 -0
- package/dist/after-CBU2vkoO.mjs +96 -0
- package/dist/after-CBU2vkoO.mjs.map +1 -0
- package/dist/{allowed-origins-CCEi9bPI.mjs → allowed-origins-DW7sYyqg.mjs} +2 -2
- package/dist/{allowed-origins-CCEi9bPI.mjs.map → allowed-origins-DW7sYyqg.mjs.map} +1 -1
- package/dist/api/route-utils.d.mts +3 -4
- package/dist/api/route-utils.d.mts.map +1 -1
- package/dist/api/route-utils.mjs +26 -25
- package/dist/api/route-utils.mjs.map +1 -1
- package/dist/api/schemas/index.d.mts +2 -2
- package/dist/api/schemas/index.mjs +6 -5
- package/dist/{api-DgPbMlng.mjs → api-DdAsirBe.mjs} +321 -428
- package/dist/api-DdAsirBe.mjs.map +1 -0
- package/dist/{api-tokens-p-iMzvXR.mjs → api-tokens-CFXu8F_2.mjs} +2 -2
- package/dist/{api-tokens-p-iMzvXR.mjs.map → api-tokens-CFXu8F_2.mjs.map} +1 -1
- package/dist/{apply-1_6ra7NP.mjs → apply-D5zfeD09.mjs} +139 -102
- package/dist/apply-D5zfeD09.mjs.map +1 -0
- package/dist/astro/index.d.mts +12 -12
- package/dist/astro/index.d.mts.map +1 -1
- package/dist/astro/index.mjs +103 -35
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +10 -10
- package/dist/astro/middleware/auth.mjs +9 -9
- package/dist/astro/middleware/media-usage-write-fence.d.mts +7 -0
- package/dist/astro/middleware/media-usage-write-fence.d.mts.map +1 -0
- package/dist/astro/middleware/media-usage-write-fence.mjs +35 -0
- package/dist/astro/middleware/media-usage-write-fence.mjs.map +1 -0
- package/dist/astro/middleware/redirect.d.mts.map +1 -1
- package/dist/astro/middleware/redirect.mjs +13 -10
- package/dist/astro/middleware/redirect.mjs.map +1 -1
- package/dist/astro/middleware/request-context.mjs +5 -5
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.d.mts +12 -11
- package/dist/astro/middleware.d.mts.map +1 -1
- package/dist/astro/middleware.mjs +1915 -223
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +9 -8
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +9 -8
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +5 -5
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +6 -6
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +6 -6
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +12 -11
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +12 -11
- package/dist/astro/routes/api/admin/byline-fields/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +12 -11
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +20 -20
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +20 -20
- package/dist/astro/routes/api/admin/bylines/index.mjs +20 -20
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +18 -17
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_.mjs +8 -8
- package/dist/astro/routes/api/admin/comments/bulk.mjs +14 -13
- package/dist/astro/routes/api/admin/comments/bulk.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/counts.mjs +8 -8
- package/dist/astro/routes/api/admin/comments/index.mjs +14 -13
- package/dist/astro/routes/api/admin/comments/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +6 -6
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +5 -5
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs +36 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.d.mts +8 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs +36 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/repair.mjs +15 -14
- package/dist/astro/routes/api/admin/media-usage/repair.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/work/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/media-usage/work/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/work/index.mjs +37 -0
- package/dist/astro/routes/api/admin/media-usage/work/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/work/retry.d.mts +8 -0
- package/dist/astro/routes/api/admin/media-usage/work/retry.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/work/retry.mjs +37 -0
- package/dist/astro/routes/api/admin/media-usage/work/retry.mjs.map +1 -0
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +5 -5
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +5 -5
- package/dist/astro/routes/api/admin/plugins/_id_/disable.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +56 -47
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/enable.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +56 -47
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +52 -46
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +6 -6
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +52 -46
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +55 -46
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +55 -46
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/index.mjs +52 -46
- package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +4 -4
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +52 -46
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +55 -46
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +52 -46
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +55 -46
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +56 -47
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +52 -46
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +56 -47
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.mjs +52 -46
- package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +52 -46
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +4 -4
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +52 -46
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +4 -4
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +3 -3
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +10 -9
- package/dist/astro/routes/api/admin/users/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +6 -6
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/index.mjs +9 -8
- package/dist/astro/routes/api/admin/users/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/dev-bypass.mjs +8 -8
- package/dist/astro/routes/api/auth/invite/accept.mjs +3 -3
- package/dist/astro/routes/api/auth/invite/complete.mjs +14 -13
- package/dist/astro/routes/api/auth/invite/complete.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/index.mjs +12 -11
- package/dist/astro/routes/api/auth/invite/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/register-options.mjs +13 -12
- package/dist/astro/routes/api/auth/invite/register-options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/logout.mjs +4 -4
- package/dist/astro/routes/api/auth/magic-link/send.mjs +14 -13
- package/dist/astro/routes/api/auth/magic-link/send.mjs.map +1 -1
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +4 -4
- package/dist/astro/routes/api/auth/me.mjs +10 -9
- package/dist/astro/routes/api/auth/me.mjs.map +1 -1
- package/dist/astro/routes/api/auth/mode.mjs +4 -4
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +4 -4
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +9 -8
- package/dist/astro/routes/api/auth/passkey/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/index.mjs +3 -3
- package/dist/astro/routes/api/auth/passkey/options.mjs +15 -14
- package/dist/astro/routes/api/auth/passkey/options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +13 -12
- package/dist/astro/routes/api/auth/passkey/register/options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +14 -13
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/verify.mjs +14 -13
- package/dist/astro/routes/api/auth/passkey/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/complete.mjs +14 -13
- package/dist/astro/routes/api/auth/signup/complete.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/request.mjs +14 -13
- package/dist/astro/routes/api/auth/signup/request.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/verify.mjs +3 -3
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +20 -19
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs.map +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +17 -16
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +4 -4
- 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 +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +15 -15
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +11 -10
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs +21 -20
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs +21 -20
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +11 -10
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +47 -34
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +11 -10
- package/dist/astro/routes/api/content/_collection_/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/authors.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/index.mjs +11 -10
- package/dist/astro/routes/api/content/_collection_/index.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/trash.mjs +10 -9
- package/dist/astro/routes/api/content/_collection_/trash.mjs.map +1 -1
- package/dist/astro/routes/api/dashboard.mjs +12 -10
- package/dist/astro/routes/api/dashboard.mjs.map +1 -1
- package/dist/astro/routes/api/dev/emails.mjs +4 -4
- package/dist/astro/routes/api/import/probe.d.mts +3 -3
- package/dist/astro/routes/api/import/probe.mjs +22 -20
- package/dist/astro/routes/api/import/probe.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +5 -5
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress/execute.mjs +18 -18
- package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/media.d.mts +10 -10
- package/dist/astro/routes/api/import/wordpress/media.mjs +14 -12
- package/dist/astro/routes/api/import/wordpress/media.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +13 -12
- package/dist/astro/routes/api/import/wordpress/prepare.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +15 -15
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +22 -20
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +32 -31
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -1
- package/dist/astro/routes/api/manifest.mjs +6 -6
- package/dist/astro/routes/api/mcp.d.mts.map +1 -1
- package/dist/astro/routes/api/mcp.mjs +174 -72
- package/dist/astro/routes/api/mcp.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/confirm.mjs +14 -12
- package/dist/astro/routes/api/media/_id_/confirm.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/upload.mjs +7 -7
- package/dist/astro/routes/api/media/_id_/usage.mjs +17 -16
- package/dist/astro/routes/api/media/_id_/usage.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_.mjs +16 -15
- package/dist/astro/routes/api/media/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/media/file/_...key_.mjs +3 -3
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +4 -4
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +4 -4
- package/dist/astro/routes/api/media/providers/index.mjs +4 -4
- package/dist/astro/routes/api/media/upload-url.mjs +11 -10
- package/dist/astro/routes/api/media/upload-url.mjs.map +1 -1
- package/dist/astro/routes/api/media.mjs +19 -16
- package/dist/astro/routes/api/media.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +13 -13
- package/dist/astro/routes/api/menus/_name_/items.mjs +13 -13
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +13 -13
- package/dist/astro/routes/api/menus/_name_/translations.mjs +13 -13
- package/dist/astro/routes/api/menus/_name_.mjs +13 -13
- package/dist/astro/routes/api/menus/index.mjs +13 -13
- package/dist/astro/routes/api/oauth/authorize.mjs +6 -6
- package/dist/astro/routes/api/oauth/device/authorize.mjs +7 -7
- package/dist/astro/routes/api/oauth/device/code.mjs +10 -10
- package/dist/astro/routes/api/oauth/device/token.mjs +9 -9
- package/dist/astro/routes/api/oauth/register.mjs +4 -4
- package/dist/astro/routes/api/oauth/token/refresh.mjs +7 -7
- package/dist/astro/routes/api/oauth/token/revoke.mjs +7 -7
- package/dist/astro/routes/api/oauth/token.mjs +7 -7
- package/dist/astro/routes/api/openapi.json.mjs +183 -6
- package/dist/astro/routes/api/openapi.json.mjs.map +1 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.d.mts.map +1 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +8 -7
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/404s/index.mjs +14 -13
- package/dist/astro/routes/api/redirects/404s/index.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/404s/summary.mjs +14 -13
- package/dist/astro/routes/api/redirects/404s/summary.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/_id_.mjs +16 -14
- package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/index.mjs +16 -14
- package/dist/astro/routes/api/redirects/index.mjs.map +1 -1
- package/dist/astro/routes/api/relations/_id_/index.mjs +21 -20
- package/dist/astro/routes/api/relations/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/relations/_id_/translations.mjs +16 -15
- package/dist/astro/routes/api/relations/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/relations/index.mjs +21 -20
- package/dist/astro/routes/api/relations/index.mjs.map +1 -1
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +4 -4
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +5 -5
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +52 -46
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +52 -46
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +52 -46
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/index.d.mts.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +52 -46
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/index.mjs +52 -46
- package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/reorder.d.mts +8 -0
- package/dist/astro/routes/api/schema/collections/reorder.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/collections/reorder.mjs +71 -0
- package/dist/astro/routes/api/schema/collections/reorder.mjs.map +1 -0
- package/dist/astro/routes/api/schema/index.mjs +14 -11
- package/dist/astro/routes/api/schema/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +52 -46
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/index.mjs +52 -46
- package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/enable.d.mts +1 -0
- package/dist/astro/routes/api/search/enable.d.mts.map +1 -1
- package/dist/astro/routes/api/search/enable.mjs +19 -15
- package/dist/astro/routes/api/search/enable.mjs.map +1 -1
- package/dist/astro/routes/api/search/index.mjs +13 -13
- package/dist/astro/routes/api/search/rebuild.mjs +15 -15
- package/dist/astro/routes/api/search/rebuild.mjs.map +1 -1
- package/dist/astro/routes/api/search/stats.mjs +9 -9
- package/dist/astro/routes/api/search/suggest.mjs +13 -13
- package/dist/astro/routes/api/sections/_slug_.mjs +13 -12
- package/dist/astro/routes/api/sections/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/sections/index.mjs +13 -12
- package/dist/astro/routes/api/sections/index.mjs.map +1 -1
- package/dist/astro/routes/api/settings/backups/archives/_name_.mjs +8 -8
- package/dist/astro/routes/api/settings/backups/archives/index.mjs +7 -7
- package/dist/astro/routes/api/settings/backups/export.mjs +8 -8
- package/dist/astro/routes/api/settings/backups/index.mjs +9 -9
- package/dist/astro/routes/api/settings/email.mjs +6 -6
- package/dist/astro/routes/api/settings.mjs +18 -17
- package/dist/astro/routes/api/settings.mjs.map +1 -1
- package/dist/astro/routes/api/setup/admin-verify.mjs +15 -14
- package/dist/astro/routes/api/setup/admin-verify.mjs.map +1 -1
- package/dist/astro/routes/api/setup/admin.mjs +14 -13
- package/dist/astro/routes/api/setup/admin.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-bypass.mjs +34 -32
- package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-reset.mjs +4 -4
- package/dist/astro/routes/api/setup/index.mjs +36 -34
- package/dist/astro/routes/api/setup/index.mjs.map +1 -1
- package/dist/astro/routes/api/setup/status.mjs +5 -5
- package/dist/astro/routes/api/snapshot.mjs +10 -10
- package/dist/astro/routes/api/taxonomies/_name_/reorder.d.mts +8 -0
- package/dist/astro/routes/api/taxonomies/_name_/reorder.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +44 -0
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +19 -18
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +19 -18
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.d.mts.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +21 -19
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/translations.d.mts +8 -0
- package/dist/astro/routes/api/taxonomies/_name_/translations.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/translations.mjs +46 -0
- package/dist/astro/routes/api/taxonomies/_name_/translations.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_.d.mts +19 -0
- package/dist/astro/routes/api/taxonomies/_name_.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_.mjs +88 -0
- package/dist/astro/routes/api/taxonomies/_name_.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/index.mjs +19 -18
- package/dist/astro/routes/api/taxonomies/index.mjs.map +1 -1
- package/dist/astro/routes/api/themes/preview.mjs +8 -8
- package/dist/astro/routes/api/typegen.mjs +6 -6
- package/dist/astro/routes/api/well-known/auth.mjs +2 -2
- package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +2 -2
- package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +2 -2
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +10 -9
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +13 -12
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +13 -12
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_.mjs +8 -7
- package/dist/astro/routes/api/widget-areas/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/index.mjs +13 -12
- package/dist/astro/routes/api/widget-areas/index.mjs.map +1 -1
- package/dist/astro/routes/api/widget-components.mjs +4 -4
- package/dist/astro/routes/robots.txt.mjs +11 -10
- package/dist/astro/routes/robots.txt.mjs.map +1 -1
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +14 -14
- package/dist/astro/routes/sitemap.xml.mjs +12 -11
- package/dist/astro/routes/sitemap.xml.mjs.map +1 -1
- package/dist/astro/types.d.mts +41 -17
- package/dist/astro/types.d.mts.map +1 -1
- package/dist/auth/providers/github.d.mts +1 -1
- package/dist/auth/providers/google.d.mts +1 -1
- package/dist/{authorize-R5iYYrpa.mjs → authorize-1iFJzPaZ.mjs} +2 -2
- package/dist/{authorize-R5iYYrpa.mjs.map → authorize-1iFJzPaZ.mjs.map} +1 -1
- package/dist/{backup-LpQ1V_sR.mjs → backup-LHjIAVNP.mjs} +5 -5
- package/dist/{backup-LpQ1V_sR.mjs.map → backup-LHjIAVNP.mjs.map} +1 -1
- package/dist/{base64-B-PsqheR.mjs → base64-CvLhUKQv.mjs} +1 -1
- package/dist/{base64-B-PsqheR.mjs.map → base64-CvLhUKQv.mjs.map} +1 -1
- package/dist/bundle-CBEXrBnb.mjs +663 -0
- package/dist/bundle-CBEXrBnb.mjs.map +1 -0
- package/dist/{byline-fields-T9ZLZMxJ.mjs → byline-fields-C5S8wygO.mjs} +2 -2
- package/dist/{byline-fields-T9ZLZMxJ.mjs.map → byline-fields-C5S8wygO.mjs.map} +1 -1
- package/dist/{byline-C5TAqs8N.mjs → byline-pEcoDps8.mjs} +9 -9
- package/dist/{byline-C5TAqs8N.mjs.map → byline-pEcoDps8.mjs.map} +1 -1
- package/dist/{byline-registry-BCuOp4UF.mjs → byline-registry-DDun8sxh.mjs} +4 -4
- package/dist/{byline-registry-BCuOp4UF.mjs.map → byline-registry-DDun8sxh.mjs.map} +1 -1
- package/dist/{bylines-B8-WGdja.mjs → bylines-BWemdX2k.mjs} +8 -8
- package/dist/{bylines-B8-WGdja.mjs.map → bylines-BWemdX2k.mjs.map} +1 -1
- package/dist/{bylines-DGuqBLjV.mjs → bylines-DJfSfXCL.mjs} +5 -5
- package/dist/{bylines-DGuqBLjV.mjs.map → bylines-DJfSfXCL.mjs.map} +1 -1
- package/dist/cache-CBJaDy_E.mjs +108 -0
- package/dist/cache-CBJaDy_E.mjs.map +1 -0
- package/dist/{challenge-store-BFzgFRog.mjs → challenge-store-CZyFVaad.mjs} +1 -1
- package/dist/{challenge-store-BFzgFRog.mjs.map → challenge-store-CZyFVaad.mjs.map} +1 -1
- package/dist/{chunks-D5dlPeRb.mjs → chunks-DfPax1I0.mjs} +2 -2
- package/dist/{chunks-D5dlPeRb.mjs.map → chunks-DfPax1I0.mjs.map} +1 -1
- package/dist/cli/index.mjs +193 -707
- package/dist/cli/index.mjs.map +1 -1
- package/dist/client/cf-access.d.mts +1 -1
- package/dist/client/index.d.mts +74 -4
- package/dist/client/index.d.mts.map +1 -1
- package/dist/client/index.mjs +25 -2
- package/dist/client/index.mjs.map +1 -1
- package/dist/collection-deletion-C8BugSGz.mjs +779 -0
- package/dist/collection-deletion-C8BugSGz.mjs.map +1 -0
- package/dist/{comment-DnTxxVHv.mjs → comment-Dxlep6cE.mjs} +3 -3
- package/dist/{comment-DnTxxVHv.mjs.map → comment-Dxlep6cE.mjs.map} +1 -1
- package/dist/{comment-reaction-BUlUz2bh.mjs → comment-reaction-D6qfHKBc.mjs} +2 -2
- package/dist/{comment-reaction-BUlUz2bh.mjs.map → comment-reaction-D6qfHKBc.mjs.map} +1 -1
- package/dist/{comments-QPKgK3nk.mjs → comments-CTOuhTSX.mjs} +3 -3
- package/dist/{comments-QPKgK3nk.mjs.map → comments-CTOuhTSX.mjs.map} +1 -1
- package/dist/{components-DZkL4Fx0.mjs → components-CQy3lh9x.mjs} +1 -1
- package/dist/{components-DZkL4Fx0.mjs.map → components-CQy3lh9x.mjs.map} +1 -1
- package/dist/{config-DyF3OKg_.mjs → config-C3EBstHi.mjs} +18 -2
- package/dist/config-C3EBstHi.mjs.map +1 -0
- package/dist/{content-CpfKV9QE.mjs → content-BNfwh7xX.mjs} +667 -183
- package/dist/content-BNfwh7xX.mjs.map +1 -0
- package/dist/content-list-query-DhQ84eVV.d.mts +26 -0
- package/dist/content-list-query-DhQ84eVV.d.mts.map +1 -0
- package/dist/content-refresh-DNERP4-f.mjs +2560 -0
- package/dist/content-refresh-DNERP4-f.mjs.map +1 -0
- package/dist/{context-kO4YZB03.mjs → context-DRgOvSnW.mjs} +28 -20
- package/dist/context-DRgOvSnW.mjs.map +1 -0
- package/dist/{cron-BlKIMD_e.mjs → cron-Y9aLtgrA.mjs} +1 -1
- package/dist/{cron-BlKIMD_e.mjs.map → cron-Y9aLtgrA.mjs.map} +1 -1
- package/dist/{dashboard-DoBwPnON.mjs → dashboard-CB8J89rJ.mjs} +45 -11
- package/dist/dashboard-CB8J89rJ.mjs.map +1 -0
- package/dist/db/index.d.mts +4 -4
- package/dist/db/index.mjs +3 -3
- package/dist/db/index.mjs.map +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/{db-errors-CcWLaRiR.mjs → db-errors-Cl-sKYTm.mjs} +1 -1
- package/dist/{db-errors-CcWLaRiR.mjs.map → db-errors-Cl-sKYTm.mjs.map} +1 -1
- package/dist/{default-C4v9KP56.mjs → default-DdDl3fxv.mjs} +1 -1
- package/dist/{default-C4v9KP56.mjs.map → default-DdDl3fxv.mjs.map} +1 -1
- package/dist/deferred-tasks-BMsa9F64.d.mts +9 -0
- package/dist/deferred-tasks-BMsa9F64.d.mts.map +1 -0
- package/dist/{device-flow-DhUsyJU6.mjs → device-flow-CaioYGK3.mjs} +5 -5
- package/dist/{device-flow-DhUsyJU6.mjs.map → device-flow-CaioYGK3.mjs.map} +1 -1
- package/dist/{dialect-helpers-DFwyWjTM.mjs → dialect-helpers-BSbfaO3F.mjs} +24 -16
- package/dist/dialect-helpers-BSbfaO3F.mjs.map +1 -0
- package/dist/dist-D_6CKR8z.mjs +810 -0
- package/dist/dist-D_6CKR8z.mjs.map +1 -0
- package/dist/{email-console-C-9Ng8DM.mjs → email-console-BHNjIwiB.mjs} +1 -1
- package/dist/{email-console-C-9Ng8DM.mjs.map → email-console-BHNjIwiB.mjs.map} +1 -1
- package/dist/{enrich-CFJJgxs_.mjs → enrich-_ySMEvEE.mjs} +2 -2
- package/dist/{enrich-CFJJgxs_.mjs.map → enrich-_ySMEvEE.mjs.map} +1 -1
- package/dist/{error-DmmN74gW.mjs → error-DupyJZE2.mjs} +3 -3
- package/dist/{error-DmmN74gW.mjs.map → error-DupyJZE2.mjs.map} +1 -1
- package/dist/{errors-DtEXIQQV.mjs → errors-CLUPm7aD.mjs} +15 -2
- package/dist/errors-CLUPm7aD.mjs.map +1 -0
- package/dist/{escape-CdW31WsG.mjs → escape-C_aLKP3H.mjs} +1 -1
- package/dist/{escape-CdW31WsG.mjs.map → escape-C_aLKP3H.mjs.map} +1 -1
- package/dist/{field-defs-cache-QMVnzTH6.mjs → field-defs-cache-hg6QkjV9.mjs} +5 -5
- package/dist/{field-defs-cache-QMVnzTH6.mjs.map → field-defs-cache-hg6QkjV9.mjs.map} +1 -1
- package/dist/{fts-manager-vncsZIJm.mjs → fts-manager-CZ-5dVwJ.mjs} +111 -61
- package/dist/fts-manager-CZ-5dVwJ.mjs.map +1 -0
- package/dist/{hash-Cb7U1b5M.mjs → hash-Cg0TXJPV.mjs} +1 -1
- package/dist/{hash-Cb7U1b5M.mjs.map → hash-Cg0TXJPV.mjs.map} +1 -1
- package/dist/{hreflang-CZbSx6Bg.d.mts → hreflang-D3Uehfv2.d.mts} +2 -2
- package/dist/{hreflang-CZbSx6Bg.d.mts.map → hreflang-D3Uehfv2.d.mts.map} +1 -1
- package/dist/{hreflang-Bg-zMpkr.mjs → hreflang-DNswoYsi.mjs} +7 -7
- package/dist/{hreflang-Bg-zMpkr.mjs.map → hreflang-DNswoYsi.mjs.map} +1 -1
- package/dist/{import-PKhLeXvn.mjs → import-B41u8Rot.mjs} +7 -7
- package/dist/{import-PKhLeXvn.mjs.map → import-B41u8Rot.mjs.map} +1 -1
- package/dist/{index-j9rTh3cp.d.mts → index-C3Y-rsyN.d.mts} +286 -93
- package/dist/index-C3Y-rsyN.d.mts.map +1 -0
- package/dist/{index-BeNto_Vs.d.mts → index-Cof4-Fab.d.mts} +5 -10
- package/dist/index-Cof4-Fab.d.mts.map +1 -0
- package/dist/index.d.mts +20 -19
- package/dist/index.mjs +79 -71
- package/dist/{init-lock-DJkX6Hto.mjs → init-lock-6b309ZrF.mjs} +1 -1
- package/dist/{init-lock-DJkX6Hto.mjs.map → init-lock-6b309ZrF.mjs.map} +1 -1
- package/dist/{load-BwTdWE8B.mjs → load-DmvJrtxS.mjs} +2 -2
- package/dist/{load-BwTdWE8B.mjs.map → load-DmvJrtxS.mjs.map} +1 -1
- package/dist/{loader-C1XOLV5b.mjs → loader-DLBqRiGP.mjs} +120 -64
- package/dist/loader-DLBqRiGP.mjs.map +1 -0
- package/dist/{manifest-schema-bCq54i7F.mjs → manifest-schema-BXbUAHod.mjs} +1 -1
- package/dist/{manifest-schema-bCq54i7F.mjs.map → manifest-schema-BXbUAHod.mjs.map} +1 -1
- package/dist/media/image-endpoint.mjs +1 -1
- package/dist/media/index.d.mts +1 -1
- package/dist/media/index.mjs +3 -2
- package/dist/media/index.mjs.map +1 -1
- package/dist/media/local-runtime.d.mts +12 -12
- package/dist/media/local-runtime.mjs +10 -9
- package/dist/media/local-runtime.mjs.map +1 -1
- package/dist/{media-DWIzoVFL.mjs → media-BWWWb8kg.mjs} +92 -3
- package/dist/media-BWWWb8kg.mjs.map +1 -0
- package/dist/{media-tQDZEdu7.mjs → media-CzhAn2--.mjs} +2 -2
- package/dist/{media-tQDZEdu7.mjs.map → media-CzhAn2--.mjs.map} +1 -1
- package/dist/{media-allowlist-B7TPD6aq.mjs → media-allowlist-BD6HhgXA.mjs} +14 -3
- package/dist/media-allowlist-BD6HhgXA.mjs.map +1 -0
- package/dist/{media-upload-Bc9Nc5Zf.mjs → media-upload-9yas9zGH.mjs} +11 -9
- package/dist/{media-upload-Bc9Nc5Zf.mjs.map → media-upload-9yas9zGH.mjs.map} +1 -1
- package/dist/{media-url-BCm5vBn6.mjs → media-url-BvoX88FA.mjs} +1 -1
- package/dist/{media-url-BCm5vBn6.mjs.map → media-url-BvoX88FA.mjs.map} +1 -1
- package/dist/{media-usage-DPJcNaAq.mjs → media-usage-De3qvwjc.mjs} +138 -61
- package/dist/media-usage-De3qvwjc.mjs.map +1 -0
- package/dist/media-usage-work-B9Bksh_b.mjs +152 -0
- package/dist/media-usage-work-B9Bksh_b.mjs.map +1 -0
- package/dist/media-usage-work-DrCbqBcl.mjs +424 -0
- package/dist/media-usage-work-DrCbqBcl.mjs.map +1 -0
- package/dist/media-usage-write-fence-aHEgN1zB.mjs +42 -0
- package/dist/media-usage-write-fence-aHEgN1zB.mjs.map +1 -0
- package/dist/{menus-C6qhqP4X.mjs → menus-CC-yn1F9.mjs} +554 -121
- package/dist/menus-CC-yn1F9.mjs.map +1 -0
- package/dist/{menus-BxPLFfIc.mjs → menus-fxvEDYE6.mjs} +5 -5
- package/dist/{menus-BxPLFfIc.mjs.map → menus-fxvEDYE6.mjs.map} +1 -1
- package/dist/{mode-fiXRMfeA.mjs → mode-Bpe-tNNy.mjs} +1 -1
- package/dist/{mode-fiXRMfeA.mjs.map → mode-Bpe-tNNy.mjs.map} +1 -1
- package/dist/{normalize-C-SHXmra.mjs → normalize-Bc-s_r-a.mjs} +1 -1
- package/dist/{normalize-C-SHXmra.mjs.map → normalize-Bc-s_r-a.mjs.map} +1 -1
- package/dist/{oauth-authorization-C9tFinly.mjs → oauth-authorization-BXO1MKej.mjs} +5 -5
- package/dist/{oauth-authorization-C9tFinly.mjs.map → oauth-authorization-BXO1MKej.mjs.map} +1 -1
- package/dist/{oauth-clients-BwTxE1aE.mjs → oauth-clients-C_DNqtRu.mjs} +1 -1
- package/dist/{oauth-clients-BwTxE1aE.mjs.map → oauth-clients-C_DNqtRu.mjs.map} +1 -1
- package/dist/{oauth-state-store-DaRUwPWO.mjs → oauth-state-store-DwAxMtk4.mjs} +1 -1
- package/dist/{oauth-state-store-DaRUwPWO.mjs.map → oauth-state-store-DwAxMtk4.mjs.map} +1 -1
- package/dist/{oauth-user-lookup-CzuzOSlF.mjs → oauth-user-lookup-BxfZizdk.mjs} +1 -1
- package/dist/{oauth-user-lookup-CzuzOSlF.mjs.map → oauth-user-lookup-BxfZizdk.mjs.map} +1 -1
- package/dist/object-cache/memory.d.mts +1 -1
- package/dist/{object-cache-Bok5j2ae.mjs → object-cache-71tPfV4A.mjs} +106 -5
- package/dist/object-cache-71tPfV4A.mjs.map +1 -0
- package/dist/{options-BlmBHTvX.mjs → options-CBXIHUoT.mjs} +1 -1
- package/dist/{options-BlmBHTvX.mjs.map → options-CBXIHUoT.mjs.map} +1 -1
- package/dist/{options-aeIs8WFu.d.mts → options-DRe1pIBL.d.mts} +4 -3
- package/dist/options-DRe1pIBL.d.mts.map +1 -0
- package/dist/page/index.d.mts +2 -2
- package/dist/{parse-BL49yb9D.mjs → parse-DFbuc-Fh.mjs} +2 -2
- package/dist/{parse-BL49yb9D.mjs.map → parse-DFbuc-Fh.mjs.map} +1 -1
- package/dist/{passkey-config-KMhgFjdQ.mjs → passkey-config-_2GOwwK8.mjs} +1 -1
- package/dist/{passkey-config-KMhgFjdQ.mjs.map → passkey-config-_2GOwwK8.mjs.map} +1 -1
- package/dist/{placeholder-Dxo5Zt58.d.mts → placeholder-CzW7Lshs.d.mts} +1 -1
- package/dist/{placeholder-Dxo5Zt58.d.mts.map → placeholder-CzW7Lshs.d.mts.map} +1 -1
- package/dist/plugin-types.d.mts +8 -1
- package/dist/plugin-types.d.mts.map +1 -1
- package/dist/plugin-utils.d.mts +10 -10
- package/dist/plugins/adapt-sandbox-entry.d.mts +10 -10
- package/dist/plugins/adapt-sandbox-entry.mjs +7 -4
- package/dist/plugins/adapt-sandbox-entry.mjs.map +1 -1
- package/dist/{portable-text-CNahFfj6.mjs → portable-text-DhKbDAGr.mjs} +1 -1
- package/dist/{portable-text-CNahFfj6.mjs.map → portable-text-DhKbDAGr.mjs.map} +1 -1
- package/dist/{preview-D4Jnbfx7.mjs → preview-PW-nOnq4.mjs} +2 -2
- package/dist/{preview-D4Jnbfx7.mjs.map → preview-PW-nOnq4.mjs.map} +1 -1
- package/dist/{public-url-DSGTnJFw.mjs → public-url-CWoFhQT8.mjs} +14 -3
- package/dist/public-url-CWoFhQT8.mjs.map +1 -0
- package/dist/{query-DCiXI7OZ.mjs → query-BgjfiLUQ.mjs} +38 -77
- package/dist/query-BgjfiLUQ.mjs.map +1 -0
- package/dist/{query-1xOcEy18.mjs → query-vgZNwIhh.mjs} +4 -4
- package/dist/{query-1xOcEy18.mjs.map → query-vgZNwIhh.mjs.map} +1 -1
- package/dist/{rate-limit-Vkp9gQ1Y.mjs → rate-limit-L5anykgo.mjs} +2 -2
- package/dist/{rate-limit-Vkp9gQ1Y.mjs.map → rate-limit-L5anykgo.mjs.map} +1 -1
- package/dist/{redirect-BJ6d1yHh.mjs → redirect-COsS6SWJ.mjs} +3 -3
- package/dist/{redirect-BJ6d1yHh.mjs.map → redirect-COsS6SWJ.mjs.map} +1 -1
- package/dist/{redirect-CDgfv9vh.mjs → redirect-KBNE3UEs.mjs} +1 -1
- package/dist/{redirect-CDgfv9vh.mjs.map → redirect-KBNE3UEs.mjs.map} +1 -1
- package/dist/{redirects-Cwkq2H-G.mjs → redirects-CufRQt0Q.mjs} +5 -5
- package/dist/{redirects-Cwkq2H-G.mjs.map → redirects-CufRQt0Q.mjs.map} +1 -1
- package/dist/{redirects-BOn2DIUs.mjs → redirects-cV9g7V-0.mjs} +149 -16
- package/dist/redirects-cV9g7V-0.mjs.map +1 -0
- package/dist/registry-C581V4TP.mjs +1275 -0
- package/dist/registry-C581V4TP.mjs.map +1 -0
- package/dist/{relation-DJ5DZh7B.mjs → relation-DtmAQH7s.mjs} +3 -3
- package/dist/{relation-DJ5DZh7B.mjs.map → relation-DtmAQH7s.mjs.map} +1 -1
- package/dist/{relations-C4duJnwI.mjs → relations-BBApI4e2.mjs} +3 -3
- package/dist/{relations-C4duJnwI.mjs.map → relations-BBApI4e2.mjs.map} +1 -1
- package/dist/{relations-DpTjftCl.mjs → relations-DICSyfsh.mjs} +6 -6
- package/dist/{relations-DpTjftCl.mjs.map → relations-DICSyfsh.mjs.map} +1 -1
- package/dist/{relations-DHFQGX0h.d.mts → relations-DItI3MN9.d.mts} +401 -40
- package/dist/relations-DItI3MN9.d.mts.map +1 -0
- package/dist/request-context.d.mts +3 -0
- package/dist/request-context.d.mts.map +1 -1
- package/dist/request-context.mjs.map +1 -1
- package/dist/{request-meta-DzXYYI-n.mjs → request-meta-DgZJh3zG.mjs} +2 -2
- package/dist/{request-meta-DzXYYI-n.mjs.map → request-meta-DgZJh3zG.mjs.map} +1 -1
- package/dist/{resolve-BUvFE0Lr.mjs → resolve-DOhVEvty.mjs} +2 -2
- package/dist/{resolve-BUvFE0Lr.mjs.map → resolve-DOhVEvty.mjs.map} +1 -1
- package/dist/{runner-BsI18UgP.mjs → runner-BiDvq5dv.mjs} +1404 -235
- package/dist/runner-BiDvq5dv.mjs.map +1 -0
- package/dist/{runner-CHdkERbt.d.mts → runner-CgQbELYC.d.mts} +2 -2
- package/dist/{runner-CHdkERbt.d.mts.map → runner-CgQbELYC.d.mts.map} +1 -1
- package/dist/runtime.d.mts +11 -11
- package/dist/runtime.mjs +5 -4
- package/dist/runtime.mjs.map +1 -1
- package/dist/{schema-eqZhkR0S.mjs → schema-BFyTg38T.mjs} +3 -3
- package/dist/{schema-eqZhkR0S.mjs.map → schema-BFyTg38T.mjs.map} +1 -1
- package/dist/schema-CeQSNwB3.mjs +390 -0
- package/dist/schema-CeQSNwB3.mjs.map +1 -0
- package/dist/{scopes-Be2d8bSb.mjs → scopes-BVeuhGBE.mjs} +3 -3
- package/dist/{scopes-Be2d8bSb.mjs.map → scopes-BVeuhGBE.mjs.map} +1 -1
- package/dist/{search-CeO678cp.mjs → search-BpuPKZb0.mjs} +26 -16
- package/dist/search-BpuPKZb0.mjs.map +1 -0
- package/dist/{secrets-870d-7yA.mjs → secrets-dtYs2hDo.mjs} +5 -5
- package/dist/{secrets-870d-7yA.mjs.map → secrets-dtYs2hDo.mjs.map} +1 -1
- package/dist/{sections-DSuEfirn.mjs → sections-COctk6hf.mjs} +3 -3
- package/dist/{sections-DSuEfirn.mjs.map → sections-COctk6hf.mjs.map} +1 -1
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +28 -26
- package/dist/seo/index.d.mts +3 -3
- package/dist/seo/index.mjs +20 -19
- package/dist/seo/index.mjs.map +1 -1
- package/dist/{seo-C3GDfT0V.mjs → seo-AFpVvTqr.mjs} +6 -4
- package/dist/seo-AFpVvTqr.mjs.map +1 -0
- package/dist/{seo-BAPKiED8.mjs → seo-CvDxfvFb.mjs} +3 -3
- package/dist/{seo-BAPKiED8.mjs.map → seo-CvDxfvFb.mjs.map} +1 -1
- package/dist/{service-DyFT-k-R.mjs → service-xMiMSTsR.mjs} +4 -4
- package/dist/{service-DyFT-k-R.mjs.map → service-xMiMSTsR.mjs.map} +1 -1
- package/dist/{session-user-BrK2zz7S.mjs → session-user-BzVemLkw.mjs} +2 -2
- package/dist/{session-user-BrK2zz7S.mjs.map → session-user-BzVemLkw.mjs.map} +1 -1
- package/dist/{settings-DgKouY2S.mjs → settings-B372MV0p.mjs} +7 -7
- package/dist/{settings-DgKouY2S.mjs.map → settings-B372MV0p.mjs.map} +1 -1
- package/dist/{settings-CREKyj8I.mjs → settings-BE9aqn_9.mjs} +3 -3
- package/dist/{settings-CREKyj8I.mjs.map → settings-BE9aqn_9.mjs.map} +1 -1
- package/dist/{setup-complete-L7bMK2VI.mjs → setup-complete-DF7TAfD5.mjs} +2 -2
- package/dist/{setup-complete-L7bMK2VI.mjs.map → setup-complete-DF7TAfD5.mjs.map} +1 -1
- package/dist/{setup-nonce-Ct5tjWcq.mjs → setup-nonce-Do-U_cg9.mjs} +1 -1
- package/dist/{setup-nonce-Ct5tjWcq.mjs.map → setup-nonce-Do-U_cg9.mjs.map} +1 -1
- package/dist/{single-flight-cache-C2exrGAi.mjs → single-flight-cache-B0eLKS6K.mjs} +2 -2
- package/dist/{single-flight-cache-C2exrGAi.mjs.map → single-flight-cache-B0eLKS6K.mjs.map} +1 -1
- package/dist/site-url-Bowsi9T-.mjs +16 -0
- package/dist/site-url-Bowsi9T-.mjs.map +1 -0
- package/dist/slugify-B994zkXC.mjs +17 -0
- package/dist/slugify-B994zkXC.mjs.map +1 -0
- package/dist/{snapshot-BdpUJKD-.mjs → snapshot-B5h6aPMh.mjs} +2 -2
- package/dist/{snapshot-BdpUJKD-.mjs.map → snapshot-B5h6aPMh.mjs.map} +1 -1
- package/dist/{ssrf-CviKqWmq.mjs → ssrf-Cpvg_n3A.mjs} +1 -1
- package/dist/{ssrf-CviKqWmq.mjs.map → ssrf-Cpvg_n3A.mjs.map} +1 -1
- package/dist/{state-xxv6ZTMv.mjs → state-DYwPue40.mjs} +1 -1
- package/dist/{state-xxv6ZTMv.mjs.map → state-DYwPue40.mjs.map} +1 -1
- package/dist/{status-COfycGIU.mjs → status-CWVYpbD8.mjs} +1 -1
- package/dist/{status-COfycGIU.mjs.map → status-CWVYpbD8.mjs.map} +1 -1
- 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-B61CRSha.mjs → taxonomies-B0o9ExNV.mjs} +85 -75
- package/dist/taxonomies-B0o9ExNV.mjs.map +1 -0
- package/dist/{taxonomies-Dbdki3Un.mjs → taxonomies-Dk3MAklL.mjs} +360 -56
- package/dist/taxonomies-Dk3MAklL.mjs.map +1 -0
- package/dist/taxonomy-CPeM8d2o.mjs +484 -0
- package/dist/taxonomy-CPeM8d2o.mjs.map +1 -0
- package/dist/{tokens-DVltpO2D.mjs → tokens-C39klX8R.mjs} +2 -2
- package/dist/{tokens-DVltpO2D.mjs.map → tokens-C39klX8R.mjs.map} +1 -1
- package/dist/{transaction-D0FOsb3X.mjs → transaction-NQj4VJ7Z.mjs} +1 -1
- package/dist/{transaction-D0FOsb3X.mjs.map → transaction-NQj4VJ7Z.mjs.map} +1 -1
- package/dist/{transport-BWQo0Foy.mjs → transport--CfOflrp.mjs} +1 -1
- package/dist/{transport-BWQo0Foy.mjs.map → transport--CfOflrp.mjs.map} +1 -1
- package/dist/{transport-DokJOScS.d.mts → transport-B_rfeU-a.d.mts} +1 -1
- package/dist/{transport-DokJOScS.d.mts.map → transport-B_rfeU-a.d.mts.map} +1 -1
- package/dist/{trusted-proxy-CwjQj0YG.mjs → trusted-proxy-CEVekpby.mjs} +1 -1
- package/dist/{trusted-proxy-CwjQj0YG.mjs.map → trusted-proxy-CEVekpby.mjs.map} +1 -1
- package/dist/{types-o7xo7VgH.mjs → types-75KIqzL9.mjs} +20 -3
- package/dist/types-75KIqzL9.mjs.map +1 -0
- package/dist/{types-C9P3ysxq.d.mts → types-BPuloofb.d.mts} +1 -1
- package/dist/{types-C9P3ysxq.d.mts.map → types-BPuloofb.d.mts.map} +1 -1
- package/dist/{types-BD40g7zz.mjs → types-BW1syrlw.mjs} +1 -1
- package/dist/{types-BD40g7zz.mjs.map → types-BW1syrlw.mjs.map} +1 -1
- package/dist/{types-jISEalTX.d.mts → types-C3_AbkDP.d.mts} +53 -10
- package/dist/types-C3_AbkDP.d.mts.map +1 -0
- package/dist/{types-84Bque3-.d.mts → types-CAGdePf3.d.mts} +133 -1
- package/dist/types-CAGdePf3.d.mts.map +1 -0
- package/dist/{types-CcSZCcF1.d.mts → types-CFUfyt1s.d.mts} +1 -1
- package/dist/{types-CcSZCcF1.d.mts.map → types-CFUfyt1s.d.mts.map} +1 -1
- package/dist/{types-DQLZ58GV.d.mts → types-CPx2lIGo.d.mts} +1 -1
- package/dist/{types-DQLZ58GV.d.mts.map → types-CPx2lIGo.d.mts.map} +1 -1
- package/dist/{types-XrQQ-Aex.mjs → types-CQPWhPxE.mjs} +15 -11
- package/dist/types-CQPWhPxE.mjs.map +1 -0
- package/dist/{types-BQY7VYw6.d.mts → types-Cs-TFLNf.d.mts} +28 -8
- package/dist/types-Cs-TFLNf.d.mts.map +1 -0
- package/dist/types-CtzytVXn.mjs +18 -0
- package/dist/types-CtzytVXn.mjs.map +1 -0
- package/dist/{types-DqZVPILm.d.mts → types-D4_1Ga4L.d.mts} +44 -5
- package/dist/types-D4_1Ga4L.d.mts.map +1 -0
- package/dist/{types-Dr2GLlwu.d.mts → types-DefV3OiO.d.mts} +1 -1
- package/dist/{types-Dr2GLlwu.d.mts.map → types-DefV3OiO.d.mts.map} +1 -1
- package/dist/{types-DsAMyD_o.d.mts → types-X0MThr7x.d.mts} +1 -1
- package/dist/{types-DsAMyD_o.d.mts.map → types-X0MThr7x.d.mts.map} +1 -1
- package/dist/{upload-attempts-C5yd6Gae.mjs → upload-attempts-hlne3iA1.mjs} +1 -1
- package/dist/{upload-attempts-C5yd6Gae.mjs.map → upload-attempts-hlne3iA1.mjs.map} +1 -1
- package/dist/url-pattern-BHS0V5Ng.mjs +33 -0
- package/dist/url-pattern-BHS0V5Ng.mjs.map +1 -0
- package/dist/{user-BAumEmpA.mjs → user-sHgJ62SP.mjs} +3 -3
- package/dist/{user-BAumEmpA.mjs.map → user-sHgJ62SP.mjs.map} +1 -1
- package/dist/{utils-BbUgmeZG.mjs → utils-D4vD_Y98.mjs} +3 -3
- package/dist/{utils-BbUgmeZG.mjs.map → utils-D4vD_Y98.mjs.map} +1 -1
- package/dist/{validate-Bs_wT2ul.mjs → validate-BkqIG_Uj.mjs} +24 -5
- package/dist/validate-BkqIG_Uj.mjs.map +1 -0
- package/dist/{validate-VPnKoIzW.mjs → validate-BpwoDOgt.mjs} +25 -2
- package/dist/validate-BpwoDOgt.mjs.map +1 -0
- package/dist/{validate-CdYcY-Ln.d.mts → validate-DeGtBN84.d.mts} +25 -7
- package/dist/validate-DeGtBN84.d.mts.map +1 -0
- package/dist/{validation-BngR0nit.mjs → validation-CiJb_X5o.mjs} +14 -13
- package/dist/{validation-BngR0nit.mjs.map → validation-CiJb_X5o.mjs.map} +1 -1
- package/dist/version-x0NjTScG.mjs +7 -0
- package/dist/{version-Bdfb34kk.mjs.map → version-x0NjTScG.mjs.map} +1 -1
- package/dist/{widgets-L-VndTKD.mjs → widgets-Cwzvww0W.mjs} +3 -3
- package/dist/{widgets-L-VndTKD.mjs.map → widgets-Cwzvww0W.mjs.map} +1 -1
- package/dist/{wxr-taxonomies-DueaLFd9.d.mts → wxr-taxonomies-CmC0ZsDr.d.mts} +1 -1
- package/dist/{wxr-taxonomies-DueaLFd9.d.mts.map → wxr-taxonomies-CmC0ZsDr.d.mts.map} +1 -1
- package/dist/{wxr-taxonomies-BexjtNid.mjs → wxr-taxonomies-QZjWxjyk.mjs} +13 -32
- package/dist/{wxr-taxonomies-BexjtNid.mjs.map → wxr-taxonomies-QZjWxjyk.mjs.map} +1 -1
- package/dist/{zod-generator-DMzfga3g.mjs → zod-generator-D11MhxG4.mjs} +53 -6
- package/dist/zod-generator-D11MhxG4.mjs.map +1 -0
- package/package.json +18 -7
- package/src/after.ts +6 -1
- package/src/api/errors.ts +13 -0
- package/src/api/handlers/content.ts +172 -33
- package/src/api/handlers/dashboard.ts +12 -2
- package/src/api/handlers/index.ts +16 -0
- package/src/api/handlers/manifest.ts +2 -0
- package/src/api/handlers/marketplace.ts +14 -0
- package/src/api/handlers/media-allowlist.ts +13 -2
- package/src/api/handlers/media-usage-work.ts +188 -0
- package/src/api/handlers/media-usage.ts +5 -3
- package/src/api/handlers/registry.ts +14 -0
- package/src/api/handlers/revision.ts +19 -5
- package/src/api/handlers/schema.ts +46 -3
- package/src/api/handlers/seo.ts +5 -2
- package/src/api/handlers/snapshot.ts +1 -1
- package/src/api/handlers/taxonomies.ts +446 -83
- package/src/api/media-usage-write-fence.ts +64 -0
- package/src/api/openapi/document.ts +247 -0
- package/src/api/public-url.ts +14 -2
- package/src/api/schemas/common.ts +3 -1
- package/src/api/schemas/content.ts +122 -1
- package/src/api/schemas/media-usage.ts +133 -0
- package/src/api/schemas/schema.ts +91 -3
- package/src/api/schemas/search.ts +2 -0
- package/src/api/schemas/taxonomies.ts +58 -8
- package/src/api/site-url.ts +16 -6
- package/src/api/types.ts +1 -0
- package/src/astro/integration/index.ts +55 -42
- package/src/astro/integration/routes.ts +48 -4
- package/src/astro/integration/runtime.ts +28 -0
- package/src/astro/integration/virtual-modules.ts +27 -1
- package/src/astro/integration/vite-config.ts +16 -1
- package/src/astro/middleware/media-usage-write-fence.ts +30 -0
- package/src/astro/middleware/redirect.ts +14 -12
- package/src/astro/middleware/scoped-db.ts +35 -4
- package/src/astro/middleware.ts +131 -30
- package/src/astro/routes/api/admin/comments/[id]/status.ts +1 -1
- package/src/astro/routes/api/admin/media-usage/collection-deletions/index.ts +22 -0
- package/src/astro/routes/api/admin/media-usage/collection-deletions/retry.ts +22 -0
- package/src/astro/routes/api/admin/media-usage/work/index.ts +26 -0
- package/src/astro/routes/api/admin/media-usage/work/retry.ts +26 -0
- package/src/astro/routes/api/admin/plugins/[id]/disable.ts +4 -0
- package/src/astro/routes/api/admin/plugins/[id]/enable.ts +4 -0
- package/src/astro/routes/api/admin/plugins/[id]/uninstall.ts +4 -0
- package/src/astro/routes/api/admin/plugins/[id]/update.ts +4 -0
- package/src/astro/routes/api/admin/plugins/marketplace/[id]/install.ts +4 -0
- package/src/astro/routes/api/admin/plugins/registry/[id]/uninstall.ts +4 -0
- package/src/astro/routes/api/admin/plugins/registry/[id]/update.ts +4 -0
- package/src/astro/routes/api/admin/plugins/registry/install.ts +4 -0
- package/src/astro/routes/api/admin/users/[id]/send-recovery.ts +2 -2
- package/src/astro/routes/api/auth/invite/index.ts +2 -2
- package/src/astro/routes/api/auth/magic-link/send.ts +2 -2
- package/src/astro/routes/api/auth/signup/request.ts +2 -2
- package/src/astro/routes/api/comments/[collection]/[contentId]/index.ts +1 -1
- package/src/astro/routes/api/content/[collection]/[id]/terms/[taxonomy].ts +67 -31
- package/src/astro/routes/api/import/wordpress/execute.ts +3 -10
- package/src/astro/routes/api/mcp.ts +1 -0
- package/src/astro/routes/api/plugins/[pluginId]/[...path].ts +7 -1
- package/src/astro/routes/api/schema/collections/[slug]/index.ts +1 -7
- package/src/astro/routes/api/schema/collections/reorder.ts +31 -0
- package/src/astro/routes/api/schema/index.ts +2 -0
- package/src/astro/routes/api/search/enable.ts +5 -1
- package/src/astro/routes/api/search/rebuild.ts +6 -1
- package/src/astro/routes/api/taxonomies/[name]/reorder.ts +41 -0
- package/src/astro/routes/api/taxonomies/[name]/terms/index.ts +1 -0
- package/src/astro/routes/api/taxonomies/[name]/translations.ts +48 -0
- package/src/astro/routes/api/taxonomies/[name].ts +102 -0
- package/src/astro/types.ts +31 -4
- package/src/cleanup.ts +25 -26
- package/src/cli/commands/dev.ts +13 -3
- package/src/cli/commands/doctor.ts +193 -6
- package/src/cli/commands/export-seed.ts +6 -1
- package/src/cli/index.ts +1 -1
- package/src/client/index.ts +119 -0
- package/src/components/Block.astro +12 -0
- package/src/components/CommentForm.astro +1 -1
- package/src/components/Comments.astro +1 -1
- package/src/components/InlinePortableTextEditor.tsx +260 -32
- package/src/components/OrderedList.astro +14 -0
- package/src/components/PortableText.astro +26 -4
- package/src/components/index.ts +12 -1
- package/src/components/ordered-list.ts +549 -0
- package/src/content/converters/mark-safety.ts +120 -0
- package/src/content/converters/numbered-list.ts +148 -0
- package/src/content/converters/portable-text-to-prosemirror.ts +84 -25
- package/src/content/converters/prosemirror-to-portable-text.ts +35 -14
- package/src/content/converters/types.ts +2 -0
- package/src/content/portable-text-lists.ts +205 -0
- package/src/content-list-query.ts +29 -0
- package/src/database/dialect-helpers.ts +3 -22
- package/src/database/migrations/055_content_translation_group_locale_index.ts +67 -0
- package/src/database/migrations/056_taxonomy_term_sort_order.ts +189 -0
- package/src/database/migrations/057_collection_hidden.ts +24 -0
- package/src/database/migrations/058_collection_sort_order.ts +20 -0
- package/src/database/migrations/059_revision_prune_queue.ts +36 -0
- package/src/database/migrations/060_collection_admin_config.ts +16 -0
- package/src/database/migrations/061_media_usage_cleanup.ts +77 -0
- package/src/database/migrations/062_media_usage_cleanup_fence.ts +295 -0
- package/src/database/migrations/063_media_usage_incremental_work.ts +397 -0
- package/src/database/migrations/064_fts_plain_text.ts +253 -0
- package/src/database/migrations/065_media_usage_collection_deletion.ts +85 -0
- package/src/database/migrations/066_media_usage_reconciliation.ts +115 -0
- package/src/database/migrations/067_indexed_content_fields.ts +39 -0
- package/src/database/migrations/068_content_taxonomy_entry_groups.ts +61 -0
- package/src/database/migrations/069_collection_title_date_fields.ts +45 -0
- package/src/database/migrations/070_collection_routable.ts +18 -0
- package/src/database/migrations/runner.ts +32 -0
- package/src/database/repositories/content.ts +1051 -273
- package/src/database/repositories/media-usage-work.ts +848 -0
- package/src/database/repositories/media-usage.ts +1502 -138
- package/src/database/repositories/revision.ts +98 -22
- package/src/database/repositories/taxonomy.ts +429 -103
- package/src/database/repositories/types.ts +58 -2
- package/src/database/types.ts +147 -17
- package/src/database/validate.ts +39 -0
- package/src/db/adapters.ts +36 -0
- package/src/db/index.ts +3 -0
- package/src/deferred-tasks.ts +71 -0
- package/src/emdash-runtime.ts +493 -110
- package/src/fields/file.ts +7 -4
- package/src/fields/image.ts +8 -1
- package/src/fields/types.ts +18 -5
- package/src/i18n/config.ts +32 -0
- package/src/i18n/repair-locale-casing.ts +0 -14
- package/src/i18n/taxonomy-locale-diagnostic.ts +47 -0
- package/src/import/wxr-taxonomies.ts +7 -47
- package/src/index.ts +27 -2
- package/src/loader.ts +165 -89
- package/src/mcp/server.ts +242 -34
- package/src/media/usage/activation.ts +626 -0
- package/src/media/usage/capture-triggers.ts +543 -0
- package/src/media/usage/cleanup.ts +305 -0
- package/src/media/usage/collection-deletion-processor.ts +356 -0
- package/src/media/usage/collection-deletion.ts +836 -0
- package/src/media/usage/content-fields.ts +40 -3
- package/src/media/usage/content-refresh.ts +356 -47
- package/src/media/usage/content-repair.ts +180 -61
- package/src/media/usage/content-snapshots.ts +85 -105
- package/src/media/usage/gc.ts +50 -0
- package/src/media/usage/projection-fingerprint.ts +129 -0
- package/src/media/usage/reconciliation-processor.ts +372 -0
- package/src/media/usage/reconciliation.ts +1117 -0
- package/src/media/usage/source-key.ts +4 -0
- package/src/media/usage/types.ts +2 -0
- package/src/media/usage/work-processor.ts +248 -0
- package/src/menus/index.ts +246 -141
- package/src/object-cache/index.ts +160 -3
- package/src/plugin-types.ts +8 -0
- package/src/plugins/adapt-sandbox-entry.ts +24 -5
- package/src/plugins/context.ts +24 -7
- package/src/plugins/index.ts +9 -0
- package/src/plugins/routes.ts +77 -1
- package/src/plugins/sandbox/index.ts +10 -1
- package/src/plugins/sandbox/types.ts +78 -1
- package/src/plugins/scheduler/node.ts +13 -1
- package/src/plugins/scheduler/types.ts +2 -0
- package/src/plugins/storage-indexes.ts +50 -11
- package/src/plugins/types.ts +39 -2
- package/src/query.ts +50 -79
- package/src/redirects/cache.ts +79 -19
- package/src/request-context.ts +3 -0
- package/src/scheduled-publish.ts +6 -1
- package/src/scheduler-health.ts +46 -0
- package/src/schema/registry.ts +863 -249
- package/src/schema/types.ts +74 -8
- package/src/schema/url-pattern.ts +33 -0
- package/src/schema/zod-generator.ts +77 -5
- package/src/search/fts-manager.ts +167 -86
- package/src/search/index.ts +2 -0
- package/src/search/query.ts +32 -11
- package/src/search/types.ts +8 -0
- package/src/seed/apply.ts +89 -16
- package/src/seed/types.ts +21 -3
- package/src/seed/validate.ts +52 -2
- package/src/taxonomies/index.ts +88 -82
- package/src/taxonomies/term-counts.ts +23 -12
- package/src/ui-comments.ts +19 -0
- package/src/ui.ts +11 -3
- package/src/utils/slugify.ts +1 -29
- package/src/virtual-modules.d.ts +24 -0
- package/dist/adapters-C0ONzkUP.d.mts.map +0 -1
- package/dist/after-B1IIdH3Y.mjs +0 -29
- package/dist/after-B1IIdH3Y.mjs.map +0 -1
- package/dist/api-DgPbMlng.mjs.map +0 -1
- package/dist/apply-1_6ra7NP.mjs.map +0 -1
- package/dist/cache-B26cufFd.mjs +0 -65
- package/dist/cache-B26cufFd.mjs.map +0 -1
- package/dist/config-DyF3OKg_.mjs.map +0 -1
- package/dist/content-CpfKV9QE.mjs.map +0 -1
- package/dist/content-refresh-DgqUBeTv.mjs +0 -1629
- package/dist/content-refresh-DgqUBeTv.mjs.map +0 -1
- package/dist/context-kO4YZB03.mjs.map +0 -1
- package/dist/dashboard-DoBwPnON.mjs.map +0 -1
- package/dist/dialect-helpers-DFwyWjTM.mjs.map +0 -1
- package/dist/errors-DtEXIQQV.mjs.map +0 -1
- package/dist/fts-manager-vncsZIJm.mjs.map +0 -1
- package/dist/index-BeNto_Vs.d.mts.map +0 -1
- package/dist/index-j9rTh3cp.d.mts.map +0 -1
- package/dist/loader-C1XOLV5b.mjs.map +0 -1
- package/dist/media-DWIzoVFL.mjs.map +0 -1
- package/dist/media-allowlist-B7TPD6aq.mjs.map +0 -1
- package/dist/media-usage-DPJcNaAq.mjs.map +0 -1
- package/dist/menus-C6qhqP4X.mjs.map +0 -1
- package/dist/object-cache-Bok5j2ae.mjs.map +0 -1
- package/dist/options-aeIs8WFu.d.mts.map +0 -1
- package/dist/public-url-DSGTnJFw.mjs.map +0 -1
- package/dist/query-DCiXI7OZ.mjs.map +0 -1
- package/dist/redirects-BOn2DIUs.mjs.map +0 -1
- package/dist/registry-BP1JK2xh.mjs +0 -795
- package/dist/registry-BP1JK2xh.mjs.map +0 -1
- package/dist/relations-DHFQGX0h.d.mts.map +0 -1
- package/dist/runner-BsI18UgP.mjs.map +0 -1
- package/dist/search-CeO678cp.mjs.map +0 -1
- package/dist/seo-C3GDfT0V.mjs.map +0 -1
- package/dist/site-url-8N3kSyVZ.mjs +0 -13
- package/dist/site-url-8N3kSyVZ.mjs.map +0 -1
- package/dist/slugify-C_tqlU4G.mjs +0 -30
- package/dist/slugify-C_tqlU4G.mjs.map +0 -1
- package/dist/taxonomies-B61CRSha.mjs.map +0 -1
- package/dist/taxonomies-Dbdki3Un.mjs.map +0 -1
- package/dist/taxonomy-DvwWAPvA.mjs +0 -304
- package/dist/taxonomy-DvwWAPvA.mjs.map +0 -1
- package/dist/types-84Bque3-.d.mts.map +0 -1
- package/dist/types-BQY7VYw6.d.mts.map +0 -1
- package/dist/types-DqZVPILm.d.mts.map +0 -1
- package/dist/types-XrQQ-Aex.mjs.map +0 -1
- package/dist/types-jISEalTX.d.mts.map +0 -1
- package/dist/types-o7xo7VgH.mjs.map +0 -1
- package/dist/validate-Bs_wT2ul.mjs.map +0 -1
- package/dist/validate-CdYcY-Ln.d.mts.map +0 -1
- package/dist/validate-VPnKoIzW.mjs.map +0 -1
- package/dist/version-Bdfb34kk.mjs +0 -7
- package/dist/zod-generator-DMzfga3g.mjs.map +0 -1
- /package/dist/{api-tokens-CEsW_jCg.mjs → api-tokens-CyTsLszZ.mjs} +0 -0
- /package/dist/{ssrf-BB__xfNM.mjs → ssrf-DpXgKsna.mjs} +0 -0
- /package/dist/{types-CK0LxPUQ.mjs → types-CP1CflWf.mjs} +0 -0
package/dist/cli/index.mjs
CHANGED
|
@@ -1,59 +1,57 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as runMigrations, o as __exportAll, r as getMigrationStatus } from "../runner-
|
|
2
|
+
import { a as runMigrations, o as __exportAll, r as getMigrationStatus } from "../runner-BiDvq5dv.mjs";
|
|
3
3
|
import { t as EmDashDatabaseError } from "../errors-9P_FDrJ_.mjs";
|
|
4
|
-
import { t as validateIdentifier } from "../validate-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import "../after-
|
|
8
|
-
import "../object-cache-
|
|
9
|
-
import { t as ContentRepository } from "../content-
|
|
10
|
-
import { n as isMissingTableError } from "../db-errors-
|
|
11
|
-
import { n as slugify } from "../slugify-
|
|
12
|
-
import { a as encodeBase64url } from "../base64-
|
|
13
|
-
import "../types-
|
|
14
|
-
import { t as MediaRepository } from "../media-
|
|
15
|
-
import { t as TaxonomyRepository } from "../taxonomy-
|
|
16
|
-
import { t as OptionsRepository } from "../options-
|
|
17
|
-
import "../redirect-
|
|
4
|
+
import { t as validateIdentifier } from "../validate-BpwoDOgt.mjs";
|
|
5
|
+
import { u as listTablesLike } from "../dialect-helpers-BSbfaO3F.mjs";
|
|
6
|
+
import { i as isI18nEnabled, r as getI18nConfig } from "../config-C3EBstHi.mjs";
|
|
7
|
+
import "../after-CBU2vkoO.mjs";
|
|
8
|
+
import "../object-cache-71tPfV4A.mjs";
|
|
9
|
+
import { t as ContentRepository } from "../content-BNfwh7xX.mjs";
|
|
10
|
+
import { n as isMissingTableError } from "../db-errors-Cl-sKYTm.mjs";
|
|
11
|
+
import { n as slugify } from "../slugify-B994zkXC.mjs";
|
|
12
|
+
import { a as encodeBase64url } from "../base64-CvLhUKQv.mjs";
|
|
13
|
+
import "../types-CQPWhPxE.mjs";
|
|
14
|
+
import { t as MediaRepository } from "../media-CzhAn2--.mjs";
|
|
15
|
+
import { t as TaxonomyRepository } from "../taxonomy-CPeM8d2o.mjs";
|
|
16
|
+
import { t as OptionsRepository } from "../options-CBXIHUoT.mjs";
|
|
17
|
+
import "../redirect-COsS6SWJ.mjs";
|
|
18
18
|
import "../request-cache-BSUptuJR.mjs";
|
|
19
|
-
import "../byline-registry-
|
|
20
|
-
import "../field-defs-cache-
|
|
21
|
-
import { t as BylineRepository } from "../byline-
|
|
22
|
-
import "../
|
|
19
|
+
import "../byline-registry-DDun8sxh.mjs";
|
|
20
|
+
import "../field-defs-cache-hg6QkjV9.mjs";
|
|
21
|
+
import { t as BylineRepository } from "../byline-pEcoDps8.mjs";
|
|
22
|
+
import "../dist-D_6CKR8z.mjs";
|
|
23
|
+
import "../fts-manager-CZ-5dVwJ.mjs";
|
|
23
24
|
import { kyselyLogOption } from "../database/instrumentation.mjs";
|
|
24
|
-
import "../loader-
|
|
25
|
-
import "../
|
|
26
|
-
import "../
|
|
27
|
-
import { n as SchemaRegistry } from "../registry-
|
|
28
|
-
import "../settings-
|
|
29
|
-
import { i as pluginManifestSchema } from "../manifest-schema-
|
|
30
|
-
import { i as isDeprecatedCapability,
|
|
31
|
-
import "../ssrf-
|
|
32
|
-
import "../ssrf-
|
|
33
|
-
import { t as validateSeed } from "../validate-
|
|
34
|
-
import { t as applySeed } from "../apply-
|
|
35
|
-
import { n as fingerprintKey, r as generateEncryptionKey, t as EmDashSecretsError } from "../secrets-
|
|
25
|
+
import "../loader-DLBqRiGP.mjs";
|
|
26
|
+
import "../content-refresh-DNERP4-f.mjs";
|
|
27
|
+
import "../collection-deletion-C8BugSGz.mjs";
|
|
28
|
+
import { n as SchemaRegistry } from "../registry-C581V4TP.mjs";
|
|
29
|
+
import "../settings-B372MV0p.mjs";
|
|
30
|
+
import { i as pluginManifestSchema } from "../manifest-schema-BXbUAHod.mjs";
|
|
31
|
+
import { i as isDeprecatedCapability, t as CAPABILITY_RENAMES } from "../types-CP1CflWf.mjs";
|
|
32
|
+
import "../ssrf-Cpvg_n3A.mjs";
|
|
33
|
+
import "../ssrf-DpXgKsna.mjs";
|
|
34
|
+
import { t as validateSeed } from "../validate-BkqIG_Uj.mjs";
|
|
35
|
+
import { t as applySeed } from "../apply-D5zfeD09.mjs";
|
|
36
|
+
import { n as fingerprintKey, r as generateEncryptionKey, t as EmDashSecretsError } from "../secrets-dtYs2hDo.mjs";
|
|
36
37
|
import { LocalStorage } from "../storage/local.mjs";
|
|
37
|
-
import { t as convertDataForRead } from "../portable-text-
|
|
38
|
+
import { t as convertDataForRead } from "../portable-text-DhKbDAGr.mjs";
|
|
38
39
|
import { createHeaderAwareFetch, customHeadersInterceptor, getCachedAccessToken, isAccessRedirect, resolveCustomHeaders, runCloudflaredLogin } from "../client/cf-access.mjs";
|
|
39
40
|
import { EmDashClient } from "../client/index.mjs";
|
|
41
|
+
import { r as fileExists$4, t as bundleCommand } from "../bundle-CBEXrBnb.mjs";
|
|
40
42
|
import { Kysely, SqliteDialect, sql } from "kysely";
|
|
41
|
-
import { imageSize } from "image-size";
|
|
42
|
-
import { z } from "zod";
|
|
43
43
|
import { createGzipDecoder, unpackTar } from "modern-tar";
|
|
44
|
-
import {
|
|
45
|
-
import { basename, dirname,
|
|
46
|
-
import { pathToFileURL } from "node:url";
|
|
44
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
45
|
+
import { basename, dirname, join, resolve } from "node:path";
|
|
47
46
|
import BetterSqlite3 from "better-sqlite3";
|
|
48
|
-
import { access,
|
|
47
|
+
import { access, mkdir, readFile, stat, writeFile } from "node:fs/promises";
|
|
49
48
|
import { defineCommand, runCommand, runMain } from "citty";
|
|
50
49
|
import consola, { consola as consola$1 } from "consola";
|
|
51
50
|
import pc from "picocolors";
|
|
52
51
|
import { spawn } from "node:child_process";
|
|
53
52
|
import { homedir } from "node:os";
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import { packTar } from "modern-tar/fs";
|
|
53
|
+
import { parse, printParseErrorCode } from "jsonc-parser";
|
|
54
|
+
import { parse as parse$1 } from "smol-toml";
|
|
57
55
|
|
|
58
56
|
//#region src/cli/commands/auth.ts
|
|
59
57
|
/**
|
|
@@ -919,7 +917,7 @@ async function readPackageJson$2(cwd) {
|
|
|
919
917
|
return null;
|
|
920
918
|
}
|
|
921
919
|
}
|
|
922
|
-
async function fileExists$
|
|
920
|
+
async function fileExists$3(path) {
|
|
923
921
|
try {
|
|
924
922
|
await access(path);
|
|
925
923
|
return true;
|
|
@@ -927,10 +925,12 @@ async function fileExists$4(path) {
|
|
|
927
925
|
return false;
|
|
928
926
|
}
|
|
929
927
|
}
|
|
928
|
+
const DEV_DEPRECATION_MESSAGE = "`emdash dev` is deprecated and will be removed in a future release.\n\nUse your project's dev script instead (for example, `pnpm dev`), or run `astro dev` directly.";
|
|
930
929
|
const devCommand = defineCommand({
|
|
931
930
|
meta: {
|
|
932
931
|
name: "dev",
|
|
933
|
-
description: "Start dev server with local database"
|
|
932
|
+
description: "Start dev server with local database",
|
|
933
|
+
hidden: true
|
|
934
934
|
},
|
|
935
935
|
args: {
|
|
936
936
|
database: {
|
|
@@ -958,6 +958,10 @@ const devCommand = defineCommand({
|
|
|
958
958
|
}
|
|
959
959
|
},
|
|
960
960
|
async run({ args }) {
|
|
961
|
+
consola.box({
|
|
962
|
+
title: "DEPRECATED COMMAND",
|
|
963
|
+
message: DEV_DEPRECATION_MESSAGE
|
|
964
|
+
});
|
|
961
965
|
const cwd = resolve(args.cwd);
|
|
962
966
|
const pkg = await readPackageJson$2(cwd);
|
|
963
967
|
if (!pkg) {
|
|
@@ -965,7 +969,7 @@ const devCommand = defineCommand({
|
|
|
965
969
|
process.exit(1);
|
|
966
970
|
}
|
|
967
971
|
const dbPath = resolve(cwd, args.database);
|
|
968
|
-
if (!await fileExists$
|
|
972
|
+
if (!await fileExists$3(dbPath)) consola.start("Database not found, initializing...");
|
|
969
973
|
const db = createDatabase({ url: `file:${dbPath}` });
|
|
970
974
|
try {
|
|
971
975
|
consola.start("Checking database migrations...");
|
|
@@ -986,8 +990,8 @@ const devCommand = defineCommand({
|
|
|
986
990
|
const client = createClientFromArgs({ url: remoteUrl });
|
|
987
991
|
const schema = await client.schemaExport();
|
|
988
992
|
const types = await client.schemaTypes();
|
|
989
|
-
const {
|
|
990
|
-
const { resolve: resolvePath
|
|
993
|
+
const { mkdir, writeFile } = await import("node:fs/promises");
|
|
994
|
+
const { dirname, resolve: resolvePath } = await import("node:path");
|
|
991
995
|
const outputPath = resolvePath(cwd, ".emdash/types.ts");
|
|
992
996
|
await mkdir(dirname(outputPath), { recursive: true });
|
|
993
997
|
await writeFile(outputPath, types, "utf-8");
|
|
@@ -1004,8 +1008,8 @@ const devCommand = defineCommand({
|
|
|
1004
1008
|
"--port",
|
|
1005
1009
|
args.port
|
|
1006
1010
|
];
|
|
1007
|
-
const pnpmLockExists = await fileExists$
|
|
1008
|
-
const yarnLockExists = await fileExists$
|
|
1011
|
+
const pnpmLockExists = await fileExists$3(resolve(cwd, "pnpm-lock.yaml"));
|
|
1012
|
+
const yarnLockExists = await fileExists$3(resolve(cwd, "yarn.lock"));
|
|
1009
1013
|
let cmd;
|
|
1010
1014
|
let cmdArgs;
|
|
1011
1015
|
if (pnpmLockExists) {
|
|
@@ -1047,9 +1051,28 @@ const devCommand = defineCommand({
|
|
|
1047
1051
|
/**
|
|
1048
1052
|
* emdash doctor
|
|
1049
1053
|
*
|
|
1050
|
-
* Diagnose database health
|
|
1054
|
+
* Diagnose database health (connection, migrations, schema integrity) and
|
|
1055
|
+
* Cloudflare Worker scheduler wiring (Cron Trigger + scheduled() handler).
|
|
1051
1056
|
*/
|
|
1052
|
-
|
|
1057
|
+
const WRANGLER_CONFIG_FILES = [
|
|
1058
|
+
"wrangler.jsonc",
|
|
1059
|
+
"wrangler.json",
|
|
1060
|
+
"wrangler.toml"
|
|
1061
|
+
];
|
|
1062
|
+
const CLOUDFLARE_WORKER_MODULE = "@emdash-cms/cloudflare/worker";
|
|
1063
|
+
const WORKER_FIX = `export { default, PluginBridge } from "${CLOUDFLARE_WORKER_MODULE}";`;
|
|
1064
|
+
const MAIN_FIX_JSONC = `"main": "./src/worker.ts"`;
|
|
1065
|
+
const MAIN_FIX_TOML = `main = "./src/worker.ts"`;
|
|
1066
|
+
const TRIGGER_FIX_JSONC = `"triggers": { "crons": ["* * * * *"] }`;
|
|
1067
|
+
const TRIGGER_FIX_TOML = `[triggers]\ncrons = ["* * * * *"]`;
|
|
1068
|
+
const SCHEDULED_HANDLER_PATTERN = /\bscheduled\s*:\s*createScheduledHandler\s*\(/m;
|
|
1069
|
+
function triggerFix(configPath) {
|
|
1070
|
+
return configPath.endsWith(".toml") ? TRIGGER_FIX_TOML : TRIGGER_FIX_JSONC;
|
|
1071
|
+
}
|
|
1072
|
+
function mainFix(configPath) {
|
|
1073
|
+
return configPath.endsWith(".toml") ? MAIN_FIX_TOML : MAIN_FIX_JSONC;
|
|
1074
|
+
}
|
|
1075
|
+
async function fileExists$2(path) {
|
|
1053
1076
|
try {
|
|
1054
1077
|
await access(path);
|
|
1055
1078
|
return true;
|
|
@@ -1057,12 +1080,115 @@ async function fileExists$3(path) {
|
|
|
1057
1080
|
return false;
|
|
1058
1081
|
}
|
|
1059
1082
|
}
|
|
1083
|
+
function isRecord(value) {
|
|
1084
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1085
|
+
}
|
|
1086
|
+
function sourcePosition(source, offset) {
|
|
1087
|
+
const prefix = source.slice(0, offset);
|
|
1088
|
+
return {
|
|
1089
|
+
line: prefix.split("\n").length,
|
|
1090
|
+
column: offset - prefix.lastIndexOf("\n")
|
|
1091
|
+
};
|
|
1092
|
+
}
|
|
1093
|
+
async function findWranglerConfig(cwd) {
|
|
1094
|
+
for (const filename of WRANGLER_CONFIG_FILES) {
|
|
1095
|
+
const path = resolve(cwd, filename);
|
|
1096
|
+
if (await fileExists$2(path)) return path;
|
|
1097
|
+
}
|
|
1098
|
+
return null;
|
|
1099
|
+
}
|
|
1100
|
+
function workerExportsScheduledMaintenance(source) {
|
|
1101
|
+
const modulePattern = CLOUDFLARE_WORKER_MODULE.replaceAll("/", "\\/");
|
|
1102
|
+
const reExportsWorker = new RegExp(`export\\s*\\{[^}]*\\bdefault\\b[^}]*\\}\\s*from\\s*["']${modulePattern}["']`, "m");
|
|
1103
|
+
const importsFactory = new RegExp(`import\\s+[^;]*\\{[^}]*\\bcreateScheduledHandler\\b[^}]*\\}\\s*from\\s*["']${modulePattern}["']`, "m");
|
|
1104
|
+
return reExportsWorker.test(source) || importsFactory.test(source) && SCHEDULED_HANDLER_PATTERN.test(source);
|
|
1105
|
+
}
|
|
1106
|
+
async function checkSchedulerWiringAtPath(cwd, configPath) {
|
|
1107
|
+
const configSource = await readFile(configPath, "utf8");
|
|
1108
|
+
let parsed;
|
|
1109
|
+
if (configPath.endsWith(".toml")) try {
|
|
1110
|
+
parsed = parse$1(configSource);
|
|
1111
|
+
} catch (error) {
|
|
1112
|
+
return [{
|
|
1113
|
+
name: "scheduler config",
|
|
1114
|
+
status: "fail",
|
|
1115
|
+
message: `could not parse ${configPath}: ${error instanceof Error ? error.message : "invalid TOML"} — fix the Wrangler configuration syntax`
|
|
1116
|
+
}];
|
|
1117
|
+
}
|
|
1118
|
+
else {
|
|
1119
|
+
const parseErrors = [];
|
|
1120
|
+
parsed = parse(configSource, parseErrors, {
|
|
1121
|
+
allowTrailingComma: true,
|
|
1122
|
+
disallowComments: false
|
|
1123
|
+
});
|
|
1124
|
+
if (parseErrors.length > 0) {
|
|
1125
|
+
const error = parseErrors[0];
|
|
1126
|
+
const { line, column } = sourcePosition(configSource, error.offset);
|
|
1127
|
+
return [{
|
|
1128
|
+
name: "scheduler config",
|
|
1129
|
+
status: "fail",
|
|
1130
|
+
message: `could not parse ${configPath}: ${printParseErrorCode(error.error)} at line ${line}, column ${column} — fix the Wrangler configuration syntax`
|
|
1131
|
+
}];
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
if (!isRecord(parsed)) return [{
|
|
1135
|
+
name: "scheduler config",
|
|
1136
|
+
status: "fail",
|
|
1137
|
+
message: `could not parse ${configPath}: expected an object — fix the Wrangler configuration syntax`
|
|
1138
|
+
}];
|
|
1139
|
+
const triggers = isRecord(parsed.triggers) ? parsed.triggers : null;
|
|
1140
|
+
const hasCronTrigger = Array.isArray(triggers?.crons) && triggers.crons.some((cron) => typeof cron === "string" && cron.trim().length > 0);
|
|
1141
|
+
const main = typeof parsed.main === "string" && parsed.main.trim() ? parsed.main : null;
|
|
1142
|
+
if (!main) return [{
|
|
1143
|
+
name: "scheduler handler",
|
|
1144
|
+
status: "fail",
|
|
1145
|
+
message: `Wrangler configuration has no Worker entry to inspect — add ${mainFix(configPath)}, then export: ${WORKER_FIX}`
|
|
1146
|
+
}];
|
|
1147
|
+
const workerPath = resolve(cwd, main);
|
|
1148
|
+
let hasScheduledHandler = false;
|
|
1149
|
+
try {
|
|
1150
|
+
hasScheduledHandler = workerExportsScheduledMaintenance(await readFile(workerPath, "utf8"));
|
|
1151
|
+
} catch (error) {
|
|
1152
|
+
if ((isRecord(error) && typeof error.code === "string" ? error.code : null) !== "ENOENT") return [{
|
|
1153
|
+
name: "scheduler handler",
|
|
1154
|
+
status: "fail",
|
|
1155
|
+
message: `could not read Worker entry ${workerPath}: ${error instanceof Error ? error.message : "unknown I/O error"} — check the file path and permissions`
|
|
1156
|
+
}];
|
|
1157
|
+
return [{
|
|
1158
|
+
name: "scheduler handler",
|
|
1159
|
+
status: "fail",
|
|
1160
|
+
message: `Worker entry not found at ${workerPath} — create it with: ${WORKER_FIX}`
|
|
1161
|
+
}];
|
|
1162
|
+
}
|
|
1163
|
+
if (hasCronTrigger && !hasScheduledHandler) return [{
|
|
1164
|
+
name: "scheduler handler",
|
|
1165
|
+
status: "fail",
|
|
1166
|
+
message: `Cron Trigger is configured, but ${main} does not export EmDash scheduled() maintenance — replace its Worker export with: ${WORKER_FIX}`
|
|
1167
|
+
}];
|
|
1168
|
+
if (hasScheduledHandler && !hasCronTrigger) return [{
|
|
1169
|
+
name: "scheduler trigger",
|
|
1170
|
+
status: "fail",
|
|
1171
|
+
message: `EmDash scheduled() handler is exported, but no Cron Trigger is configured — add this to ${configPath}: ${triggerFix(configPath)}`
|
|
1172
|
+
}];
|
|
1173
|
+
if (!hasCronTrigger && !hasScheduledHandler) return [];
|
|
1174
|
+
return [{
|
|
1175
|
+
name: "scheduler wiring",
|
|
1176
|
+
status: "pass",
|
|
1177
|
+
message: `Cron Trigger and scheduled() handler found (${main})`
|
|
1178
|
+
}];
|
|
1179
|
+
}
|
|
1180
|
+
async function checkDoctor(cwd, dbPath) {
|
|
1181
|
+
const results = await checkDatabase(dbPath);
|
|
1182
|
+
const configPath = await findWranglerConfig(cwd);
|
|
1183
|
+
if (configPath) results.push(...await checkSchedulerWiringAtPath(cwd, configPath));
|
|
1184
|
+
return results;
|
|
1185
|
+
}
|
|
1060
1186
|
function printResult(result) {
|
|
1061
1187
|
(result.status === "pass" ? consola.success : result.status === "warn" ? consola.warn : consola.error)(`${result.name}: ${result.message}`);
|
|
1062
1188
|
}
|
|
1063
1189
|
async function checkDatabase(dbPath) {
|
|
1064
1190
|
const results = [];
|
|
1065
|
-
if (!await fileExists$
|
|
1191
|
+
if (!await fileExists$2(dbPath)) {
|
|
1066
1192
|
results.push({
|
|
1067
1193
|
name: "database",
|
|
1068
1194
|
status: "fail",
|
|
@@ -1143,7 +1269,7 @@ async function checkDatabase(dbPath) {
|
|
|
1143
1269
|
const doctorCommand = defineCommand({
|
|
1144
1270
|
meta: {
|
|
1145
1271
|
name: "doctor",
|
|
1146
|
-
description: "Check database health and diagnose issues"
|
|
1272
|
+
description: "Check database health, scheduler wiring, and diagnose issues"
|
|
1147
1273
|
},
|
|
1148
1274
|
args: {
|
|
1149
1275
|
database: {
|
|
@@ -1164,14 +1290,16 @@ const doctorCommand = defineCommand({
|
|
|
1164
1290
|
}
|
|
1165
1291
|
},
|
|
1166
1292
|
async run({ args }) {
|
|
1167
|
-
const
|
|
1293
|
+
const cwd = resolve(args.cwd);
|
|
1294
|
+
const results = await checkDoctor(cwd, resolve(cwd, args.database));
|
|
1295
|
+
const fails = results.filter((result) => result.status === "fail");
|
|
1168
1296
|
if (args.json) {
|
|
1169
1297
|
process.stdout.write(JSON.stringify(results, null, 2) + "\n");
|
|
1298
|
+
if (fails.length > 0) process.exitCode = 1;
|
|
1170
1299
|
return;
|
|
1171
1300
|
}
|
|
1172
1301
|
consola.start("EmDash Doctor\n");
|
|
1173
1302
|
for (const result of results) printResult(result);
|
|
1174
|
-
const fails = results.filter((r) => r.status === "fail");
|
|
1175
1303
|
const warns = results.filter((r) => r.status === "warn");
|
|
1176
1304
|
consola.log("");
|
|
1177
1305
|
if (fails.length === 0 && warns.length === 0) consola.success("All checks passed");
|
|
@@ -1386,8 +1514,12 @@ async function exportCollections(db) {
|
|
|
1386
1514
|
labelSingular: collection.labelSingular || void 0,
|
|
1387
1515
|
description: collection.description || void 0,
|
|
1388
1516
|
icon: collection.icon || void 0,
|
|
1517
|
+
admin: collection.admin,
|
|
1389
1518
|
supports: collection.supports.length > 0 ? collection.supports : void 0,
|
|
1390
1519
|
urlPattern: collection.urlPattern || void 0,
|
|
1520
|
+
routable: collection.routable === false ? false : void 0,
|
|
1521
|
+
hidden: collection.hidden || void 0,
|
|
1522
|
+
sortOrder: collection.sortOrder,
|
|
1391
1523
|
fields: fields.map((field) => ({
|
|
1392
1524
|
slug: field.slug,
|
|
1393
1525
|
label: field.label,
|
|
@@ -1395,6 +1527,7 @@ async function exportCollections(db) {
|
|
|
1395
1527
|
required: field.required || void 0,
|
|
1396
1528
|
unique: field.unique || void 0,
|
|
1397
1529
|
searchable: field.searchable || void 0,
|
|
1530
|
+
indexed: field.indexed || void 0,
|
|
1398
1531
|
defaultValue: field.defaultValue,
|
|
1399
1532
|
validation: field.validation ? { ...field.validation } : void 0,
|
|
1400
1533
|
widget: field.widget || void 0,
|
|
@@ -1625,7 +1758,7 @@ async function exportContent(db, collections, includeCollections, bylineGroupToS
|
|
|
1625
1758
|
const processedData = processDataForExport(item.data, collection.fields, mediaMap);
|
|
1626
1759
|
const entry = {
|
|
1627
1760
|
id: seedId,
|
|
1628
|
-
slug: item.slug
|
|
1761
|
+
slug: item.slug?.trim() ? item.slug : collection.routable === false ? void 0 : item.id,
|
|
1629
1762
|
status: item.status === "published" || item.status === "draft" ? item.status : void 0,
|
|
1630
1763
|
data: processedData
|
|
1631
1764
|
};
|
|
@@ -1727,7 +1860,7 @@ async function getTaxonomyAssignments(taxonomyRepo, collection, entryId) {
|
|
|
1727
1860
|
*
|
|
1728
1861
|
* Initialize database from template config in package.json
|
|
1729
1862
|
*/
|
|
1730
|
-
async function fileExists$
|
|
1863
|
+
async function fileExists$1(path) {
|
|
1731
1864
|
try {
|
|
1732
1865
|
await access(path);
|
|
1733
1866
|
return true;
|
|
@@ -1818,7 +1951,7 @@ const initCommand = defineCommand({
|
|
|
1818
1951
|
if (alreadyInitialized && args.force) consola.warn("Re-initializing (--force)...");
|
|
1819
1952
|
if (config?.schema) {
|
|
1820
1953
|
const schemaPath = resolve(cwd, config.schema);
|
|
1821
|
-
if (await fileExists$
|
|
1954
|
+
if (await fileExists$1(schemaPath)) {
|
|
1822
1955
|
consola.start(`Running schema: ${config.schema}`);
|
|
1823
1956
|
try {
|
|
1824
1957
|
await runSqlFile(db, schemaPath);
|
|
@@ -2466,653 +2599,6 @@ const menuCommand = defineCommand({
|
|
|
2466
2599
|
}
|
|
2467
2600
|
});
|
|
2468
2601
|
|
|
2469
|
-
//#endregion
|
|
2470
|
-
//#region src/cli/commands/bundle-utils.ts
|
|
2471
|
-
/**
|
|
2472
|
-
* Bundle utility functions
|
|
2473
|
-
*
|
|
2474
|
-
* Shared logic extracted from the bundle command so it can be tested
|
|
2475
|
-
* without the CLI harness and tsdown dependency.
|
|
2476
|
-
*/
|
|
2477
|
-
const MAX_BUNDLE_SIZE = 256 * 1024;
|
|
2478
|
-
const MAX_FILE_SIZE = 128 * 1024;
|
|
2479
|
-
const MAX_FILE_COUNT = 20;
|
|
2480
|
-
const MAX_SCREENSHOTS = 5;
|
|
2481
|
-
const MAX_SCREENSHOT_WIDTH = 1920;
|
|
2482
|
-
const MAX_SCREENSHOT_HEIGHT = 1080;
|
|
2483
|
-
const ICON_SIZE = 256;
|
|
2484
|
-
const MCP_TOOL_NAME_PATTERN = /^[a-zA-Z0-9_-]+$/;
|
|
2485
|
-
/**
|
|
2486
|
-
* Matches Node.js built-in imports in bundled output:
|
|
2487
|
-
* - require("node:xxx") / require("xxx")
|
|
2488
|
-
* - import("node:xxx") / import("xxx")
|
|
2489
|
-
* - import X from "node:xxx" / import { X } from "node:xxx"
|
|
2490
|
-
* - import * as X from "node:xxx"
|
|
2491
|
-
* - export { X } from "node:xxx"
|
|
2492
|
-
* Captures the base module name (e.g. "fs" from "node:fs/promises").
|
|
2493
|
-
*/
|
|
2494
|
-
const NODE_BUILTIN_IMPORT_RE = /(?:import|export|require)\s*(?:\(|[^(]*?\bfrom\s+)["'](?:node:)?([a-z_]+)(?:\/[^"']*)?\s*["']\)?/g;
|
|
2495
|
-
const LEADING_DOT_SLASH_RE = /^\.\//;
|
|
2496
|
-
const DIST_PREFIX_RE = /^dist\//;
|
|
2497
|
-
const MJS_EXT_RE = /\.m?js$/;
|
|
2498
|
-
const TS_TO_TSX_RE = /\.ts$/;
|
|
2499
|
-
/** Node.js built-in modules that shouldn't appear in sandbox code */
|
|
2500
|
-
const NODE_BUILTINS = new Set([
|
|
2501
|
-
"assert",
|
|
2502
|
-
"buffer",
|
|
2503
|
-
"child_process",
|
|
2504
|
-
"cluster",
|
|
2505
|
-
"crypto",
|
|
2506
|
-
"dgram",
|
|
2507
|
-
"dns",
|
|
2508
|
-
"domain",
|
|
2509
|
-
"events",
|
|
2510
|
-
"fs",
|
|
2511
|
-
"http",
|
|
2512
|
-
"http2",
|
|
2513
|
-
"https",
|
|
2514
|
-
"inspector",
|
|
2515
|
-
"module",
|
|
2516
|
-
"net",
|
|
2517
|
-
"os",
|
|
2518
|
-
"path",
|
|
2519
|
-
"perf_hooks",
|
|
2520
|
-
"process",
|
|
2521
|
-
"punycode",
|
|
2522
|
-
"querystring",
|
|
2523
|
-
"readline",
|
|
2524
|
-
"repl",
|
|
2525
|
-
"stream",
|
|
2526
|
-
"string_decoder",
|
|
2527
|
-
"sys",
|
|
2528
|
-
"timers",
|
|
2529
|
-
"tls",
|
|
2530
|
-
"trace_events",
|
|
2531
|
-
"tty",
|
|
2532
|
-
"url",
|
|
2533
|
-
"util",
|
|
2534
|
-
"v8",
|
|
2535
|
-
"vm",
|
|
2536
|
-
"wasi",
|
|
2537
|
-
"worker_threads",
|
|
2538
|
-
"zlib"
|
|
2539
|
-
]);
|
|
2540
|
-
async function fileExists$1(path) {
|
|
2541
|
-
try {
|
|
2542
|
-
await access(path);
|
|
2543
|
-
return true;
|
|
2544
|
-
} catch {
|
|
2545
|
-
return false;
|
|
2546
|
-
}
|
|
2547
|
-
}
|
|
2548
|
-
/** Convert an absolute build artifact path into a portable ESM import specifier. */
|
|
2549
|
-
function toFileImportSpecifier(path) {
|
|
2550
|
-
return pathToFileURL(path).href;
|
|
2551
|
-
}
|
|
2552
|
-
/**
|
|
2553
|
-
* Read image dimensions from a buffer.
|
|
2554
|
-
* Returns [width, height] or null if the format is unrecognized.
|
|
2555
|
-
*/
|
|
2556
|
-
function readImageDimensions(buf) {
|
|
2557
|
-
try {
|
|
2558
|
-
const result = imageSize(buf);
|
|
2559
|
-
if (result.width != null && result.height != null) return [result.width, result.height];
|
|
2560
|
-
return null;
|
|
2561
|
-
} catch {
|
|
2562
|
-
return null;
|
|
2563
|
-
}
|
|
2564
|
-
}
|
|
2565
|
-
/**
|
|
2566
|
-
* Extract manifest metadata from a ResolvedPlugin.
|
|
2567
|
-
* Strips functions (hooks, route handlers) and keeps only serializable metadata.
|
|
2568
|
-
*/
|
|
2569
|
-
function extractManifest(plugin) {
|
|
2570
|
-
const hooks = [];
|
|
2571
|
-
for (const [name, resolved] of Object.entries(plugin.hooks)) {
|
|
2572
|
-
if (!resolved) continue;
|
|
2573
|
-
if (resolved.exclusive || resolved.priority !== 100 || resolved.timeout !== 5e3) {
|
|
2574
|
-
const entry = { name };
|
|
2575
|
-
if (resolved.exclusive) entry.exclusive = true;
|
|
2576
|
-
if (resolved.priority !== 100) entry.priority = resolved.priority;
|
|
2577
|
-
if (resolved.timeout !== 5e3) entry.timeout = resolved.timeout;
|
|
2578
|
-
hooks.push(entry);
|
|
2579
|
-
} else hooks.push(name);
|
|
2580
|
-
}
|
|
2581
|
-
const routes = Object.entries(plugin.routes).map(([name, route]) => {
|
|
2582
|
-
if (route.public === void 0 && route.permission === void 0 && route.cacheControl === void 0) return name;
|
|
2583
|
-
const entry = { name };
|
|
2584
|
-
if (route.public !== void 0) entry.public = route.public;
|
|
2585
|
-
if (route.permission !== void 0) entry.permission = route.permission;
|
|
2586
|
-
if (route.cacheControl !== void 0) entry.cacheControl = route.cacheControl;
|
|
2587
|
-
return entry;
|
|
2588
|
-
});
|
|
2589
|
-
const tools = Object.entries(plugin.mcp?.tools ?? {}).map(([name, tool]) => {
|
|
2590
|
-
if (!MCP_TOOL_NAME_PATTERN.test(name)) throw new Error(`Invalid MCP tool name "${name}"`);
|
|
2591
|
-
const route = plugin.routes[tool.route];
|
|
2592
|
-
if (!route?.permission || route.public) throw new Error(`MCP tool "${name}" must reference a private route with a permission`);
|
|
2593
|
-
return {
|
|
2594
|
-
name,
|
|
2595
|
-
description: tool.description,
|
|
2596
|
-
route: tool.route,
|
|
2597
|
-
permission: route.permission,
|
|
2598
|
-
destructive: tool.destructive ?? false,
|
|
2599
|
-
inputSchema: z.toJSONSchema(tool.input, { target: "draft-7" }),
|
|
2600
|
-
...tool.output ? { outputSchema: z.toJSONSchema(tool.output, { target: "draft-7" }) } : {}
|
|
2601
|
-
};
|
|
2602
|
-
});
|
|
2603
|
-
return {
|
|
2604
|
-
id: plugin.id,
|
|
2605
|
-
version: plugin.version,
|
|
2606
|
-
declaredAccess: capabilitiesToDeclaredAccess(plugin.capabilities, plugin.allowedHosts),
|
|
2607
|
-
capabilities: plugin.capabilities,
|
|
2608
|
-
allowedHosts: plugin.allowedHosts,
|
|
2609
|
-
storage: plugin.storage,
|
|
2610
|
-
hooks,
|
|
2611
|
-
routes,
|
|
2612
|
-
...tools.length > 0 ? { mcp: { tools } } : {},
|
|
2613
|
-
admin: {
|
|
2614
|
-
settingsSchema: plugin.admin.settingsSchema,
|
|
2615
|
-
pages: plugin.admin.pages,
|
|
2616
|
-
widgets: plugin.admin.widgets
|
|
2617
|
-
}
|
|
2618
|
-
};
|
|
2619
|
-
}
|
|
2620
|
-
/**
|
|
2621
|
-
* Scan bundled code for Node.js built-in imports.
|
|
2622
|
-
* Matches require("node:xxx"), require("xxx"), import("node:xxx") — the patterns
|
|
2623
|
-
* that appear in bundled ESM/CJS output (not source-level named imports).
|
|
2624
|
-
* Returns deduplicated array of built-in module names found.
|
|
2625
|
-
*/
|
|
2626
|
-
function findNodeBuiltinImports(code) {
|
|
2627
|
-
const found = [];
|
|
2628
|
-
NODE_BUILTIN_IMPORT_RE.lastIndex = 0;
|
|
2629
|
-
let match;
|
|
2630
|
-
while ((match = NODE_BUILTIN_IMPORT_RE.exec(code)) !== null) {
|
|
2631
|
-
const mod = match[1];
|
|
2632
|
-
if (NODE_BUILTINS.has(mod)) found.push(mod);
|
|
2633
|
-
}
|
|
2634
|
-
return [...new Set(found)];
|
|
2635
|
-
}
|
|
2636
|
-
/**
|
|
2637
|
-
* Find a build output file by base name, checking common extensions.
|
|
2638
|
-
* tsdown may output .mjs, .js, or .cjs depending on format and config.
|
|
2639
|
-
*/
|
|
2640
|
-
async function findBuildOutput(dir, baseName) {
|
|
2641
|
-
for (const ext of [
|
|
2642
|
-
".mjs",
|
|
2643
|
-
".js",
|
|
2644
|
-
".cjs"
|
|
2645
|
-
]) {
|
|
2646
|
-
const candidate = join(dir, `${baseName}${ext}`);
|
|
2647
|
-
if (await fileExists$1(candidate)) return candidate;
|
|
2648
|
-
}
|
|
2649
|
-
}
|
|
2650
|
-
/**
|
|
2651
|
-
* Resolve a dist/built path back to its source .ts/.tsx equivalent.
|
|
2652
|
-
* E.g., "./dist/index.mjs" → "src/index.ts"
|
|
2653
|
-
*/
|
|
2654
|
-
async function resolveSourceEntry(pluginDir, distPath) {
|
|
2655
|
-
const cleaned = distPath.replace(LEADING_DOT_SLASH_RE, "");
|
|
2656
|
-
const srcPath = cleaned.replace(DIST_PREFIX_RE, "src/").replace(MJS_EXT_RE, ".ts");
|
|
2657
|
-
const srcFull = resolve(pluginDir, srcPath);
|
|
2658
|
-
if (await fileExists$1(srcFull)) return srcFull;
|
|
2659
|
-
const tsxFull = resolve(pluginDir, srcPath.replace(TS_TO_TSX_RE, ".tsx"));
|
|
2660
|
-
if (await fileExists$1(tsxFull)) return tsxFull;
|
|
2661
|
-
const direct = resolve(pluginDir, cleaned);
|
|
2662
|
-
if (await fileExists$1(direct)) return direct;
|
|
2663
|
-
}
|
|
2664
|
-
const TS_SOURCE_EXPORT_RE = /\.(?:ts|tsx|mts|cts|jsx)$/;
|
|
2665
|
-
/**
|
|
2666
|
-
* Find package.json exports that point to source files instead of built output.
|
|
2667
|
-
* Returns an array of `{ exportPath, resolvedPath }` for each offending export.
|
|
2668
|
-
*/
|
|
2669
|
-
function findSourceExports(exports) {
|
|
2670
|
-
const issues = [];
|
|
2671
|
-
for (const [exportPath, exportValue] of Object.entries(exports)) {
|
|
2672
|
-
const resolved = typeof exportValue === "string" ? exportValue : exportValue && typeof exportValue === "object" && "import" in exportValue ? exportValue.import : null;
|
|
2673
|
-
if (resolved && TS_SOURCE_EXPORT_RE.test(resolved)) issues.push({
|
|
2674
|
-
exportPath,
|
|
2675
|
-
resolvedPath: resolved
|
|
2676
|
-
});
|
|
2677
|
-
}
|
|
2678
|
-
return issues;
|
|
2679
|
-
}
|
|
2680
|
-
/**
|
|
2681
|
-
* Recursively walk a staging directory and return a flat list of all files
|
|
2682
|
-
* with sizes. Names are relative to `dir` so they match what would appear
|
|
2683
|
-
* as the tarball entry name.
|
|
2684
|
-
*/
|
|
2685
|
-
async function collectBundleEntries(dir) {
|
|
2686
|
-
const entries = [];
|
|
2687
|
-
await walkBundle(dir, "", entries);
|
|
2688
|
-
return entries;
|
|
2689
|
-
}
|
|
2690
|
-
async function walkBundle(dir, prefix, into) {
|
|
2691
|
-
const items = await readdir(dir, { withFileTypes: true });
|
|
2692
|
-
for (const item of items) {
|
|
2693
|
-
const fullPath = join(dir, item.name);
|
|
2694
|
-
const relPath = prefix ? `${prefix}/${item.name}` : item.name;
|
|
2695
|
-
if (item.isFile()) {
|
|
2696
|
-
const s = await stat(fullPath);
|
|
2697
|
-
into.push({
|
|
2698
|
-
name: relPath,
|
|
2699
|
-
bytes: s.size
|
|
2700
|
-
});
|
|
2701
|
-
} else if (item.isDirectory()) await walkBundle(fullPath, relPath, into);
|
|
2702
|
-
}
|
|
2703
|
-
}
|
|
2704
|
-
/**
|
|
2705
|
-
* Sum the byte sizes of all entries.
|
|
2706
|
-
*/
|
|
2707
|
-
function totalBundleBytes(entries) {
|
|
2708
|
-
let total = 0;
|
|
2709
|
-
for (const e of entries) total += e.bytes;
|
|
2710
|
-
return total;
|
|
2711
|
-
}
|
|
2712
|
-
/**
|
|
2713
|
-
* Check a bundle against the three size caps from RFC 0001:
|
|
2714
|
-
* - total decompressed ≤ MAX_BUNDLE_SIZE
|
|
2715
|
-
* - per-file decompressed ≤ MAX_FILE_SIZE
|
|
2716
|
-
* - file count ≤ MAX_FILE_COUNT
|
|
2717
|
-
*
|
|
2718
|
-
* Returns a list of violation messages (empty if the bundle is within all
|
|
2719
|
-
* caps). Messages are deterministic per input — the total/count violations
|
|
2720
|
-
* come first, then oversized files in alphabetical order — so the same
|
|
2721
|
-
* bundle always produces the same error text.
|
|
2722
|
-
*/
|
|
2723
|
-
function validateBundleSize(entries) {
|
|
2724
|
-
const violations = [];
|
|
2725
|
-
const total = totalBundleBytes(entries);
|
|
2726
|
-
if (total > MAX_BUNDLE_SIZE) violations.push(`Bundle size ${formatBytes(total)} exceeds maximum of ${formatBytes(MAX_BUNDLE_SIZE)}.`);
|
|
2727
|
-
if (entries.length > MAX_FILE_COUNT) violations.push(`Bundle contains ${entries.length} files, exceeds maximum of ${MAX_FILE_COUNT}.`);
|
|
2728
|
-
const oversized = entries.filter((e) => e.bytes > MAX_FILE_SIZE).toSorted((a, b) => a.name.localeCompare(b.name));
|
|
2729
|
-
for (const e of oversized) violations.push(`File ${e.name} is ${formatBytes(e.bytes)}, exceeds per-file maximum of ${formatBytes(MAX_FILE_SIZE)}.`);
|
|
2730
|
-
return violations;
|
|
2731
|
-
}
|
|
2732
|
-
/**
|
|
2733
|
-
* Render a byte count as a human-friendly string (e.g. "256.0 KB").
|
|
2734
|
-
*/
|
|
2735
|
-
function formatBytes(n) {
|
|
2736
|
-
if (n < 1024) return `${n} B`;
|
|
2737
|
-
if (n < 1024 * 1024) return `${(n / 1024).toFixed(1)} KB`;
|
|
2738
|
-
return `${(n / 1024 / 1024).toFixed(2)} MB`;
|
|
2739
|
-
}
|
|
2740
|
-
/**
|
|
2741
|
-
* Create a gzipped tarball from a directory.
|
|
2742
|
-
*/
|
|
2743
|
-
async function createTarball(sourceDir, outputPath) {
|
|
2744
|
-
const { createGzip } = await import("node:zlib");
|
|
2745
|
-
await pipeline(packTar(sourceDir), createGzip({ level: 9 }), createWriteStream(outputPath));
|
|
2746
|
-
}
|
|
2747
|
-
|
|
2748
|
-
//#endregion
|
|
2749
|
-
//#region src/cli/commands/bundle.ts
|
|
2750
|
-
/**
|
|
2751
|
-
* emdash plugin bundle
|
|
2752
|
-
*
|
|
2753
|
-
* Produces a publishable plugin tarball from a plugin source directory.
|
|
2754
|
-
*
|
|
2755
|
-
* Steps:
|
|
2756
|
-
* 1. Resolve plugin entrypoint (finds definePlugin() export)
|
|
2757
|
-
* 2. Bundle backend code with tsdown → backend.js (single ES module, tree-shaken)
|
|
2758
|
-
* 3. Bundle admin code if present → admin.js
|
|
2759
|
-
* 4. Extract manifest from definePlugin() → manifest.json
|
|
2760
|
-
* 5. Collect assets (README.md, icon.png, screenshots/)
|
|
2761
|
-
* 6. Validate bundle (manifest schema, size limits, no Node.js builtins)
|
|
2762
|
-
* 7. Create tarball ({id}-{version}.tar.gz)
|
|
2763
|
-
*/
|
|
2764
|
-
var bundle_exports = /* @__PURE__ */ __exportAll({ bundleCommand: () => bundleCommand });
|
|
2765
|
-
const TS_EXT_RE = /\.(tsx?|[mc]?js)$/;
|
|
2766
|
-
const SLASH_RE = /\//g;
|
|
2767
|
-
const LEADING_AT_RE = /^@/;
|
|
2768
|
-
const emdash_SCOPE_RE = /^@emdash-cms\//;
|
|
2769
|
-
const bundleCommand = defineCommand({
|
|
2770
|
-
meta: {
|
|
2771
|
-
name: "bundle",
|
|
2772
|
-
description: "Bundle a plugin for marketplace distribution"
|
|
2773
|
-
},
|
|
2774
|
-
args: {
|
|
2775
|
-
dir: {
|
|
2776
|
-
type: "string",
|
|
2777
|
-
description: "Plugin directory (default: current directory)",
|
|
2778
|
-
default: process.cwd()
|
|
2779
|
-
},
|
|
2780
|
-
outDir: {
|
|
2781
|
-
type: "string",
|
|
2782
|
-
alias: "o",
|
|
2783
|
-
description: "Output directory for the tarball (default: ./dist)",
|
|
2784
|
-
default: "dist"
|
|
2785
|
-
},
|
|
2786
|
-
validateOnly: {
|
|
2787
|
-
type: "boolean",
|
|
2788
|
-
description: "Run validation only, skip tarball creation",
|
|
2789
|
-
default: false
|
|
2790
|
-
}
|
|
2791
|
-
},
|
|
2792
|
-
async run({ args }) {
|
|
2793
|
-
const pluginDir = resolve(args.dir);
|
|
2794
|
-
const outDir = resolve(pluginDir, args.outDir);
|
|
2795
|
-
const validateOnly = args.validateOnly;
|
|
2796
|
-
consola.start(validateOnly ? "Validating plugin..." : "Bundling plugin...");
|
|
2797
|
-
const pkgPath = join(pluginDir, "package.json");
|
|
2798
|
-
if (!await fileExists$1(pkgPath)) {
|
|
2799
|
-
consola.error("No package.json found in", pluginDir);
|
|
2800
|
-
process.exit(1);
|
|
2801
|
-
}
|
|
2802
|
-
const pkg = JSON.parse(await readFile(pkgPath, "utf-8"));
|
|
2803
|
-
let backendEntry;
|
|
2804
|
-
let adminEntry;
|
|
2805
|
-
if (pkg.exports) {
|
|
2806
|
-
const sandboxExport = pkg.exports["./sandbox"];
|
|
2807
|
-
if (typeof sandboxExport === "string") backendEntry = await resolveSourceEntry(pluginDir, sandboxExport);
|
|
2808
|
-
else if (sandboxExport && typeof sandboxExport === "object" && "import" in sandboxExport) backendEntry = await resolveSourceEntry(pluginDir, sandboxExport.import);
|
|
2809
|
-
const adminExport = pkg.exports["./admin"];
|
|
2810
|
-
if (typeof adminExport === "string") adminEntry = await resolveSourceEntry(pluginDir, adminExport);
|
|
2811
|
-
else if (adminExport && typeof adminExport === "object" && "import" in adminExport) adminEntry = await resolveSourceEntry(pluginDir, adminExport.import);
|
|
2812
|
-
}
|
|
2813
|
-
if (!backendEntry) {
|
|
2814
|
-
const defaultSandbox = join(pluginDir, "src/sandbox-entry.ts");
|
|
2815
|
-
if (await fileExists$1(defaultSandbox)) backendEntry = defaultSandbox;
|
|
2816
|
-
}
|
|
2817
|
-
let mainEntry;
|
|
2818
|
-
if (pkg.exports?.["."] !== void 0) {
|
|
2819
|
-
const mainExport = pkg.exports["."];
|
|
2820
|
-
if (typeof mainExport === "string") mainEntry = await resolveSourceEntry(pluginDir, mainExport);
|
|
2821
|
-
else if (mainExport && typeof mainExport === "object" && "import" in mainExport) mainEntry = await resolveSourceEntry(pluginDir, mainExport.import);
|
|
2822
|
-
}
|
|
2823
|
-
if (!mainEntry && pkg.main) mainEntry = await resolveSourceEntry(pluginDir, pkg.main);
|
|
2824
|
-
if (!mainEntry) {
|
|
2825
|
-
const defaultMain = join(pluginDir, "src/index.ts");
|
|
2826
|
-
if (await fileExists$1(defaultMain)) mainEntry = defaultMain;
|
|
2827
|
-
}
|
|
2828
|
-
if (!mainEntry) {
|
|
2829
|
-
consola.error("Cannot find plugin entrypoint. Expected src/index.ts or main/exports in package.json");
|
|
2830
|
-
process.exit(1);
|
|
2831
|
-
}
|
|
2832
|
-
consola.info(`Main entry: ${mainEntry}`);
|
|
2833
|
-
if (backendEntry) consola.info(`Backend entry: ${backendEntry}`);
|
|
2834
|
-
if (adminEntry) consola.info(`Admin entry: ${adminEntry}`);
|
|
2835
|
-
consola.start("Extracting plugin manifest...");
|
|
2836
|
-
const { build } = await import("tsdown");
|
|
2837
|
-
const tmpDir = join(pluginDir, ".emdash-bundle-tmp");
|
|
2838
|
-
try {
|
|
2839
|
-
await rm(tmpDir, {
|
|
2840
|
-
recursive: true,
|
|
2841
|
-
force: true
|
|
2842
|
-
});
|
|
2843
|
-
await mkdir(tmpDir, { recursive: true });
|
|
2844
|
-
const mainOutDir = join(tmpDir, "main");
|
|
2845
|
-
await build({
|
|
2846
|
-
config: false,
|
|
2847
|
-
entry: [mainEntry],
|
|
2848
|
-
format: "esm",
|
|
2849
|
-
outDir: mainOutDir,
|
|
2850
|
-
dts: false,
|
|
2851
|
-
platform: "node",
|
|
2852
|
-
external: ["emdash", emdash_SCOPE_RE]
|
|
2853
|
-
});
|
|
2854
|
-
const pluginNodeModules = join(pluginDir, "node_modules");
|
|
2855
|
-
const tmpNodeModules = join(mainOutDir, "node_modules");
|
|
2856
|
-
if (await fileExists$1(pluginNodeModules)) await symlink(pluginNodeModules, tmpNodeModules, "junction");
|
|
2857
|
-
const mainOutputPath = await findBuildOutput(mainOutDir, basename(mainEntry).replace(TS_EXT_RE, ""));
|
|
2858
|
-
if (!mainOutputPath) {
|
|
2859
|
-
consola.error("Failed to build main entry — no output found in", mainOutDir);
|
|
2860
|
-
process.exit(1);
|
|
2861
|
-
}
|
|
2862
|
-
const pluginModule = await import(toFileImportSpecifier(mainOutputPath));
|
|
2863
|
-
let resolvedPlugin;
|
|
2864
|
-
if (typeof pluginModule.createPlugin === "function") resolvedPlugin = pluginModule.createPlugin();
|
|
2865
|
-
else if (typeof pluginModule.default === "function") resolvedPlugin = pluginModule.default();
|
|
2866
|
-
else if (typeof pluginModule.default === "object" && pluginModule.default !== null) {
|
|
2867
|
-
const defaultExport = pluginModule.default;
|
|
2868
|
-
if ("id" in defaultExport && "version" in defaultExport) resolvedPlugin = defaultExport;
|
|
2869
|
-
}
|
|
2870
|
-
if (!resolvedPlugin) for (const [key, value] of Object.entries(pluginModule)) {
|
|
2871
|
-
if (key === "default" || typeof value !== "function") continue;
|
|
2872
|
-
try {
|
|
2873
|
-
const result = value();
|
|
2874
|
-
if (result && typeof result === "object" && "id" in result && "version" in result) {
|
|
2875
|
-
resolvedPlugin = {
|
|
2876
|
-
id: result.id,
|
|
2877
|
-
version: result.version,
|
|
2878
|
-
capabilities: result.capabilities ?? [],
|
|
2879
|
-
allowedHosts: result.allowedHosts ?? [],
|
|
2880
|
-
storage: result.storage ?? {},
|
|
2881
|
-
hooks: {},
|
|
2882
|
-
routes: {},
|
|
2883
|
-
admin: {
|
|
2884
|
-
pages: result.adminPages,
|
|
2885
|
-
widgets: result.adminWidgets
|
|
2886
|
-
}
|
|
2887
|
-
};
|
|
2888
|
-
if (backendEntry) {
|
|
2889
|
-
const backendProbeDir = join(tmpDir, "backend-probe");
|
|
2890
|
-
const probeShimDir = join(tmpDir, "probe-shims");
|
|
2891
|
-
await mkdir(probeShimDir, { recursive: true });
|
|
2892
|
-
await writeFile(join(probeShimDir, "emdash.mjs"), "export const definePlugin = (d) => d;\n");
|
|
2893
|
-
await build({
|
|
2894
|
-
config: false,
|
|
2895
|
-
entry: [backendEntry],
|
|
2896
|
-
format: "esm",
|
|
2897
|
-
outDir: backendProbeDir,
|
|
2898
|
-
dts: false,
|
|
2899
|
-
platform: "neutral",
|
|
2900
|
-
external: [],
|
|
2901
|
-
alias: { emdash: join(probeShimDir, "emdash.mjs") },
|
|
2902
|
-
treeshake: true
|
|
2903
|
-
});
|
|
2904
|
-
const backendProbePath = await findBuildOutput(backendProbeDir, basename(backendEntry).replace(TS_EXT_RE, ""));
|
|
2905
|
-
if (backendProbePath) {
|
|
2906
|
-
const standardDef = (await import(toFileImportSpecifier(backendProbePath))).default ?? {};
|
|
2907
|
-
const hooks = standardDef.hooks;
|
|
2908
|
-
const routes = standardDef.routes;
|
|
2909
|
-
if (hooks) for (const hookName of Object.keys(hooks)) {
|
|
2910
|
-
const hookEntry = hooks[hookName];
|
|
2911
|
-
const isConfig = typeof hookEntry === "object" && hookEntry !== null && "handler" in hookEntry;
|
|
2912
|
-
const config = isConfig ? hookEntry : {};
|
|
2913
|
-
resolvedPlugin.hooks[hookName] = {
|
|
2914
|
-
handler: isConfig ? hookEntry.handler : hookEntry,
|
|
2915
|
-
priority: config.priority ?? 100,
|
|
2916
|
-
timeout: config.timeout ?? 5e3,
|
|
2917
|
-
dependencies: config.dependencies ?? [],
|
|
2918
|
-
errorPolicy: config.errorPolicy ?? "abort",
|
|
2919
|
-
exclusive: config.exclusive ?? false,
|
|
2920
|
-
pluginId: result.id
|
|
2921
|
-
};
|
|
2922
|
-
}
|
|
2923
|
-
if (routes) for (const [name, route] of Object.entries(routes)) {
|
|
2924
|
-
const routeObj = route;
|
|
2925
|
-
resolvedPlugin.routes[name] = {
|
|
2926
|
-
handler: routeObj.handler,
|
|
2927
|
-
public: routeObj.public,
|
|
2928
|
-
cacheControl: routeObj.cacheControl
|
|
2929
|
-
};
|
|
2930
|
-
}
|
|
2931
|
-
}
|
|
2932
|
-
}
|
|
2933
|
-
break;
|
|
2934
|
-
}
|
|
2935
|
-
} catch {}
|
|
2936
|
-
}
|
|
2937
|
-
if (!resolvedPlugin?.id || !resolvedPlugin?.version) {
|
|
2938
|
-
consola.error("Could not extract plugin definition. Expected one of:\n - createPlugin() export (native format)\n - Descriptor factory function returning { id, version, ... } (standard format)");
|
|
2939
|
-
process.exit(1);
|
|
2940
|
-
}
|
|
2941
|
-
const manifest = extractManifest(resolvedPlugin);
|
|
2942
|
-
if (resolvedPlugin.admin?.entry) {
|
|
2943
|
-
consola.error("Plugin declares adminEntry — React admin components require native/trusted mode. Use Block Kit for sandboxed admin pages, or remove adminEntry.");
|
|
2944
|
-
process.exit(1);
|
|
2945
|
-
}
|
|
2946
|
-
if (resolvedPlugin.admin?.portableTextBlocks && resolvedPlugin.admin.portableTextBlocks.length > 0) {
|
|
2947
|
-
consola.error("Plugin declares portableTextBlocks — these require native/trusted mode and cannot be bundled for the marketplace.");
|
|
2948
|
-
process.exit(1);
|
|
2949
|
-
}
|
|
2950
|
-
consola.success(`Plugin: ${manifest.id}@${manifest.version}`);
|
|
2951
|
-
consola.info(` Capabilities: ${manifest.capabilities.length > 0 ? manifest.capabilities.join(", ") : "(none)"}`);
|
|
2952
|
-
consola.info(` Hooks: ${manifest.hooks.length > 0 ? manifest.hooks.map((h) => typeof h === "string" ? h : h.name).join(", ") : "(none)"}`);
|
|
2953
|
-
consola.info(` Routes: ${manifest.routes.length > 0 ? manifest.routes.map((r) => typeof r === "string" ? r : r.name).join(", ") : "(none)"}`);
|
|
2954
|
-
const bundleDir = join(tmpDir, "bundle");
|
|
2955
|
-
await mkdir(bundleDir, { recursive: true });
|
|
2956
|
-
if (backendEntry) {
|
|
2957
|
-
consola.start("Bundling backend...");
|
|
2958
|
-
const shimDir = join(tmpDir, "shims");
|
|
2959
|
-
await mkdir(shimDir, { recursive: true });
|
|
2960
|
-
await writeFile(join(shimDir, "emdash.mjs"), "export const definePlugin = (d) => d;\n");
|
|
2961
|
-
await build({
|
|
2962
|
-
config: false,
|
|
2963
|
-
entry: [backendEntry],
|
|
2964
|
-
format: "esm",
|
|
2965
|
-
outDir: join(tmpDir, "backend"),
|
|
2966
|
-
dts: false,
|
|
2967
|
-
platform: "neutral",
|
|
2968
|
-
external: [],
|
|
2969
|
-
alias: { emdash: join(shimDir, "emdash.mjs") },
|
|
2970
|
-
minify: true,
|
|
2971
|
-
treeshake: true
|
|
2972
|
-
});
|
|
2973
|
-
const backendBaseName = basename(backendEntry).replace(TS_EXT_RE, "");
|
|
2974
|
-
const backendOutputPath = await findBuildOutput(join(tmpDir, "backend"), backendBaseName);
|
|
2975
|
-
if (backendOutputPath) {
|
|
2976
|
-
await copyFile(backendOutputPath, join(bundleDir, "backend.js"));
|
|
2977
|
-
consola.success("Built backend.js");
|
|
2978
|
-
} else {
|
|
2979
|
-
consola.error("Backend build produced no output");
|
|
2980
|
-
process.exit(1);
|
|
2981
|
-
}
|
|
2982
|
-
} else {
|
|
2983
|
-
consola.warn("No sandbox entry found — bundle will have no backend.js");
|
|
2984
|
-
consola.warn(" Add a \"sandbox-entry.ts\" in src/ or a \"./sandbox\" export in package.json");
|
|
2985
|
-
}
|
|
2986
|
-
if (adminEntry) {
|
|
2987
|
-
consola.start("Bundling admin...");
|
|
2988
|
-
await build({
|
|
2989
|
-
config: false,
|
|
2990
|
-
entry: [adminEntry],
|
|
2991
|
-
format: "esm",
|
|
2992
|
-
outDir: join(tmpDir, "admin"),
|
|
2993
|
-
dts: false,
|
|
2994
|
-
platform: "neutral",
|
|
2995
|
-
external: [],
|
|
2996
|
-
minify: true,
|
|
2997
|
-
treeshake: true
|
|
2998
|
-
});
|
|
2999
|
-
const adminBaseName = basename(adminEntry).replace(TS_EXT_RE, "");
|
|
3000
|
-
const adminOutputPath = await findBuildOutput(join(tmpDir, "admin"), adminBaseName);
|
|
3001
|
-
if (adminOutputPath) {
|
|
3002
|
-
await copyFile(adminOutputPath, join(bundleDir, "admin.js"));
|
|
3003
|
-
consola.success("Built admin.js");
|
|
3004
|
-
}
|
|
3005
|
-
}
|
|
3006
|
-
await writeFile(join(bundleDir, "manifest.json"), JSON.stringify(manifest, null, 2));
|
|
3007
|
-
consola.start("Collecting assets...");
|
|
3008
|
-
const readmePath = join(pluginDir, "README.md");
|
|
3009
|
-
if (await fileExists$1(readmePath)) {
|
|
3010
|
-
await copyFile(readmePath, join(bundleDir, "README.md"));
|
|
3011
|
-
consola.success("Included README.md");
|
|
3012
|
-
}
|
|
3013
|
-
const iconPath = join(pluginDir, "icon.png");
|
|
3014
|
-
if (await fileExists$1(iconPath)) {
|
|
3015
|
-
const dims = readImageDimensions(await readFile(iconPath));
|
|
3016
|
-
if (!dims) consola.warn("icon.png is not a valid PNG — skipping");
|
|
3017
|
-
else if (dims[0] !== ICON_SIZE || dims[1] !== ICON_SIZE) {
|
|
3018
|
-
consola.warn(`icon.png is ${dims[0]}x${dims[1]}, expected ${ICON_SIZE}x${ICON_SIZE} — including anyway`);
|
|
3019
|
-
await copyFile(iconPath, join(bundleDir, "icon.png"));
|
|
3020
|
-
} else {
|
|
3021
|
-
await copyFile(iconPath, join(bundleDir, "icon.png"));
|
|
3022
|
-
consola.success("Included icon.png");
|
|
3023
|
-
}
|
|
3024
|
-
}
|
|
3025
|
-
const screenshotsDir = join(pluginDir, "screenshots");
|
|
3026
|
-
if (await fileExists$1(screenshotsDir)) {
|
|
3027
|
-
const screenshotFiles = (await readdir(screenshotsDir)).filter((f) => {
|
|
3028
|
-
const ext = extname(f).toLowerCase();
|
|
3029
|
-
return ext === ".png" || ext === ".jpg" || ext === ".jpeg";
|
|
3030
|
-
}).toSorted().slice(0, MAX_SCREENSHOTS);
|
|
3031
|
-
if (screenshotFiles.length > 0) {
|
|
3032
|
-
await mkdir(join(bundleDir, "screenshots"), { recursive: true });
|
|
3033
|
-
for (const file of screenshotFiles) {
|
|
3034
|
-
const filePath = join(screenshotsDir, file);
|
|
3035
|
-
const dims = readImageDimensions(await readFile(filePath));
|
|
3036
|
-
if (!dims) {
|
|
3037
|
-
consola.warn(`screenshots/${file} — cannot read dimensions, skipping`);
|
|
3038
|
-
continue;
|
|
3039
|
-
}
|
|
3040
|
-
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`);
|
|
3041
|
-
await copyFile(filePath, join(bundleDir, "screenshots", file));
|
|
3042
|
-
}
|
|
3043
|
-
consola.success(`Included ${screenshotFiles.length} screenshot(s)`);
|
|
3044
|
-
}
|
|
3045
|
-
}
|
|
3046
|
-
consola.start("Validating bundle...");
|
|
3047
|
-
let hasErrors = false;
|
|
3048
|
-
if (pkg.exports) for (const issue of findSourceExports(pkg.exports)) {
|
|
3049
|
-
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.`);
|
|
3050
|
-
hasErrors = true;
|
|
3051
|
-
}
|
|
3052
|
-
const backendPath = join(bundleDir, "backend.js");
|
|
3053
|
-
if (await fileExists$1(backendPath)) {
|
|
3054
|
-
const builtins = findNodeBuiltinImports(await readFile(backendPath, "utf-8"));
|
|
3055
|
-
if (builtins.length > 0) {
|
|
3056
|
-
consola.error(`backend.js imports Node.js built-in modules: ${builtins.join(", ")}`);
|
|
3057
|
-
consola.error("Sandboxed plugins cannot use Node.js APIs");
|
|
3058
|
-
hasErrors = true;
|
|
3059
|
-
}
|
|
3060
|
-
}
|
|
3061
|
-
const declaresUnrestricted = manifest.capabilities.includes("network:request:unrestricted") || manifest.capabilities.includes("network:fetch:any");
|
|
3062
|
-
const declaresHostRestricted = manifest.capabilities.includes("network:request") || manifest.capabilities.includes("network:fetch");
|
|
3063
|
-
if (declaresUnrestricted) consola.warn("Plugin declares unrestricted network access (network:request:unrestricted) — it can make requests to any host");
|
|
3064
|
-
else if (declaresHostRestricted && manifest.allowedHosts.length === 0) consola.warn("Plugin declares network:request capability but no allowedHosts — all requests will be blocked");
|
|
3065
|
-
const deprecatedCaps = manifest.capabilities.filter(isDeprecatedCapability);
|
|
3066
|
-
if (deprecatedCaps.length > 0) {
|
|
3067
|
-
consola.warn("Plugin uses deprecated capability names. Rename them before publishing:");
|
|
3068
|
-
for (const cap of deprecatedCaps) {
|
|
3069
|
-
const replacement = CAPABILITY_RENAMES[cap];
|
|
3070
|
-
consola.warn(` ${cap} → ${replacement}`);
|
|
3071
|
-
}
|
|
3072
|
-
}
|
|
3073
|
-
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");
|
|
3074
|
-
if (resolvedPlugin.admin?.entry) consola.warn("Plugin declares admin.entry — custom React components require trusted mode. Use Block Kit for sandboxed admin pages");
|
|
3075
|
-
if (resolvedPlugin.hooks["page:fragments"]) consola.warn("Plugin declares page:fragments hook — this is trusted-only and will not work in sandboxed mode");
|
|
3076
|
-
const hasAdminPages = (manifest.admin?.pages?.length ?? 0) > 0;
|
|
3077
|
-
const hasAdminWidgets = (manifest.admin?.widgets?.length ?? 0) > 0;
|
|
3078
|
-
if (hasAdminPages || hasAdminWidgets) {
|
|
3079
|
-
if (!manifest.routes.map((r) => typeof r === "string" ? r : r.name).includes("admin")) {
|
|
3080
|
-
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.`);
|
|
3081
|
-
hasErrors = true;
|
|
3082
|
-
}
|
|
3083
|
-
}
|
|
3084
|
-
const bundleEntries = await collectBundleEntries(bundleDir);
|
|
3085
|
-
const sizeViolations = validateBundleSize(bundleEntries);
|
|
3086
|
-
if (sizeViolations.length > 0) {
|
|
3087
|
-
for (const v of sizeViolations) consola.error(v);
|
|
3088
|
-
hasErrors = true;
|
|
3089
|
-
} else consola.info(`Bundle size: ${formatBytes(totalBundleBytes(bundleEntries))} across ${bundleEntries.length} file${bundleEntries.length === 1 ? "" : "s"}`);
|
|
3090
|
-
if (hasErrors) {
|
|
3091
|
-
consola.error("Bundle validation failed");
|
|
3092
|
-
process.exit(1);
|
|
3093
|
-
}
|
|
3094
|
-
consola.success("Validation passed");
|
|
3095
|
-
if (validateOnly) return;
|
|
3096
|
-
await mkdir(outDir, { recursive: true });
|
|
3097
|
-
const tarballName = `${manifest.id.replace(SLASH_RE, "-").replace(LEADING_AT_RE, "")}-${manifest.version}.tar.gz`;
|
|
3098
|
-
const tarballPath = join(outDir, tarballName);
|
|
3099
|
-
consola.start("Creating tarball...");
|
|
3100
|
-
await createTarball(bundleDir, tarballPath);
|
|
3101
|
-
const tarballSizeKB = ((await stat(tarballPath)).size / 1024).toFixed(1);
|
|
3102
|
-
const tarballBuf = await readFile(tarballPath);
|
|
3103
|
-
const checksum = createHash("sha256").update(tarballBuf).digest("hex");
|
|
3104
|
-
consola.success(`Created ${tarballName} (${tarballSizeKB}KB)`);
|
|
3105
|
-
consola.info(` SHA-256: ${checksum}`);
|
|
3106
|
-
consola.info(` Path: ${tarballPath}`);
|
|
3107
|
-
} finally {
|
|
3108
|
-
if (tmpDir.endsWith(".emdash-bundle-tmp")) await rm(tmpDir, {
|
|
3109
|
-
recursive: true,
|
|
3110
|
-
force: true
|
|
3111
|
-
});
|
|
3112
|
-
}
|
|
3113
|
-
}
|
|
3114
|
-
});
|
|
3115
|
-
|
|
3116
2602
|
//#endregion
|
|
3117
2603
|
//#region src/cli/commands/plugin-init.ts
|
|
3118
2604
|
/**
|
|
@@ -3173,7 +2659,7 @@ const pluginInitCommand = defineCommand({
|
|
|
3173
2659
|
process.exit(1);
|
|
3174
2660
|
}
|
|
3175
2661
|
const srcDir = join(targetDir, "src");
|
|
3176
|
-
if (await fileExists$
|
|
2662
|
+
if (await fileExists$4(join(targetDir, "package.json"))) {
|
|
3177
2663
|
consola.error(`package.json already exists in ${targetDir}`);
|
|
3178
2664
|
process.exit(1);
|
|
3179
2665
|
}
|
|
@@ -3655,7 +3141,7 @@ const publishCommand = defineCommand({
|
|
|
3655
3141
|
const pluginDir = resolve(args.dir);
|
|
3656
3142
|
try {
|
|
3657
3143
|
const { runCommand } = await import("citty");
|
|
3658
|
-
const { bundleCommand } = await
|
|
3144
|
+
const { bundleCommand } = await import("../bundle-CBEXrBnb.mjs").then((n) => n.n);
|
|
3659
3145
|
await runCommand(bundleCommand, { rawArgs: ["--dir", pluginDir] });
|
|
3660
3146
|
} catch {
|
|
3661
3147
|
consola.error("Build failed");
|
|
@@ -4647,7 +4133,7 @@ const typesCommand = defineCommand({
|
|
|
4647
4133
|
* Commands:
|
|
4648
4134
|
* - init: Bootstrap database from template config, or interactive setup
|
|
4649
4135
|
* - types: Generate TypeScript types from schema
|
|
4650
|
-
* - dev: Run dev server with local
|
|
4136
|
+
* - dev: [DEPRECATED, hidden] Run dev server with a local SQLite database
|
|
4651
4137
|
* - seed: Apply a seed file to the database
|
|
4652
4138
|
* - export-seed: Export database schema and content as a seed file
|
|
4653
4139
|
* - secrets: Generate and inspect EmDash secrets (encryption keys, etc.)
|