emdash 0.5.0 → 0.7.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-C2BzVy0p.d.mts → adapters-Di31kZ28.d.mts} +16 -1
- package/dist/adapters-Di31kZ28.d.mts.map +1 -0
- package/dist/{apply-Cma_PiF6.mjs → apply-5uslYdUu.mjs} +197 -25
- package/dist/apply-5uslYdUu.mjs.map +1 -0
- package/dist/astro/index.d.mts +6 -6
- package/dist/astro/index.d.mts.map +1 -1
- package/dist/astro/index.mjs +203 -33
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +5 -5
- package/dist/astro/middleware/auth.d.mts.map +1 -1
- package/dist/astro/middleware/auth.mjs +30 -4
- package/dist/astro/middleware/auth.mjs.map +1 -1
- package/dist/astro/middleware/redirect.mjs +2 -2
- package/dist/astro/middleware/request-context.d.mts.map +1 -1
- package/dist/astro/middleware/request-context.mjs +11 -4
- package/dist/astro/middleware/request-context.mjs.map +1 -1
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.d.mts.map +1 -1
- package/dist/astro/middleware.mjs +467 -186
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/types.d.mts +17 -9
- package/dist/astro/types.d.mts.map +1 -1
- package/dist/{byline-WuOq9MFJ.mjs → byline-C4OVd8b3.mjs} +3 -19
- package/dist/byline-C4OVd8b3.mjs.map +1 -0
- package/dist/{bylines-C_Wsnz4L.mjs → bylines-hPTW79hw.mjs} +20 -33
- package/dist/bylines-hPTW79hw.mjs.map +1 -0
- package/dist/{cache-E3Dts-yT.mjs → cache-BkKBuIvS.mjs} +1 -1
- package/dist/{cache-E3Dts-yT.mjs.map → cache-BkKBuIvS.mjs.map} +1 -1
- package/dist/chunks-HGz06Soa.mjs +19 -0
- package/dist/chunks-HGz06Soa.mjs.map +1 -0
- package/dist/cli/index.mjs +12 -11
- package/dist/cli/index.mjs.map +1 -1
- package/dist/client/cf-access.d.mts +1 -1
- package/dist/client/index.d.mts +1 -1
- package/dist/client/index.mjs +1 -1
- package/dist/{config-DkxPrM9l.mjs → config-BXwuX8Bx.mjs} +1 -1
- package/dist/{config-DkxPrM9l.mjs.map → config-BXwuX8Bx.mjs.map} +1 -1
- package/dist/{connection-B4zVnQIa.mjs → connection-2igzM-AT.mjs} +19 -2
- package/dist/connection-2igzM-AT.mjs.map +1 -0
- package/dist/{content-BsBoyj8G.mjs → content-D7J5y73J.mjs} +27 -1
- package/dist/{content-BsBoyj8G.mjs.map → content-D7J5y73J.mjs.map} +1 -1
- package/dist/database/instrumentation.d.mts +45 -0
- package/dist/database/instrumentation.d.mts.map +1 -0
- package/dist/database/instrumentation.mjs +61 -0
- package/dist/database/instrumentation.mjs.map +1 -0
- package/dist/db/index.d.mts +3 -3
- package/dist/db/index.mjs +1 -1
- 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-D0UT85nC.mjs +41 -0
- package/dist/db-errors-D0UT85nC.mjs.map +1 -0
- package/dist/{default-PUx9RK6u.mjs → default-CME5YdZ3.mjs} +1 -1
- package/dist/{default-PUx9RK6u.mjs.map → default-CME5YdZ3.mjs.map} +1 -1
- package/dist/{error-HBeQbVhV.mjs → error-CiYn9yDu.mjs} +1 -1
- package/dist/{error-HBeQbVhV.mjs.map → error-CiYn9yDu.mjs.map} +1 -1
- package/dist/{index-CCWzlriB.d.mts → index-De6_Xv3v.d.mts} +209 -19
- package/dist/index-De6_Xv3v.d.mts.map +1 -0
- package/dist/index.d.mts +11 -11
- package/dist/index.mjs +23 -21
- package/dist/{load-BhSSm-TS.mjs → load-CBcmDIot.mjs} +1 -1
- package/dist/{load-BhSSm-TS.mjs.map → load-CBcmDIot.mjs.map} +1 -1
- package/dist/{loader-BYzwzORf.mjs → loader-DeiBJEMe.mjs} +18 -12
- package/dist/loader-DeiBJEMe.mjs.map +1 -0
- package/dist/{manifest-schema-BsXINkQD.mjs → manifest-schema-V30qsMft.mjs} +1 -1
- package/dist/{manifest-schema-BsXINkQD.mjs.map → manifest-schema-V30qsMft.mjs.map} +1 -1
- package/dist/media/index.d.mts +1 -1
- package/dist/media/index.mjs +1 -1
- package/dist/media/local-runtime.d.mts +7 -7
- package/dist/{mode-CyPLdO3C.mjs → mode-CpNnGkPz.mjs} +1 -1
- package/dist/{mode-CyPLdO3C.mjs.map → mode-CpNnGkPz.mjs.map} +1 -1
- package/dist/page/index.d.mts +11 -2
- package/dist/page/index.d.mts.map +1 -1
- package/dist/page/index.mjs +23 -1
- package/dist/page/index.mjs.map +1 -1
- package/dist/{placeholder-DntBEQo7.mjs → placeholder-C-fk5hYI.mjs} +1 -1
- package/dist/{placeholder-DntBEQo7.mjs.map → placeholder-C-fk5hYI.mjs.map} +1 -1
- package/dist/{placeholder-BBCtpTES.d.mts → placeholder-tzpqGWII.d.mts} +1 -1
- package/dist/{placeholder-BBCtpTES.d.mts.map → placeholder-tzpqGWII.d.mts.map} +1 -1
- package/dist/plugins/adapt-sandbox-entry.d.mts +5 -5
- package/dist/plugins/adapt-sandbox-entry.mjs +1 -1
- package/dist/{query-B6Vu0d2i.mjs → query-g4Ug-9j9.mjs} +79 -12
- package/dist/query-g4Ug-9j9.mjs.map +1 -0
- package/dist/{redirect-7lGhLBNZ.mjs → redirect-CN0Rt9Ob.mjs} +66 -10
- package/dist/redirect-CN0Rt9Ob.mjs.map +1 -0
- package/dist/{registry-BgnP3ysR.mjs → registry-Ci3WxVAr.mjs} +133 -97
- package/dist/registry-Ci3WxVAr.mjs.map +1 -0
- package/dist/request-cache-DiR961CV.mjs +79 -0
- package/dist/request-cache-DiR961CV.mjs.map +1 -0
- package/dist/request-context.d.mts +19 -16
- package/dist/request-context.d.mts.map +1 -1
- package/dist/request-context.mjs.map +1 -1
- package/dist/{runner-DYv3rX8P.d.mts → runner-BR2xKwhn.d.mts} +2 -2
- package/dist/{runner-DYv3rX8P.d.mts.map → runner-BR2xKwhn.d.mts.map} +1 -1
- package/dist/{runner-Cd-_WyDo.mjs → runner-tQ7BJ4T7.mjs} +211 -134
- package/dist/runner-tQ7BJ4T7.mjs.map +1 -0
- package/dist/runtime.d.mts +6 -6
- package/dist/runtime.mjs +1 -1
- package/dist/{search-Cn1SYvYF.mjs → search-B0effn3j.mjs} +210 -226
- package/dist/search-B0effn3j.mjs.map +1 -0
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +10 -9
- package/dist/seo/index.d.mts +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-K2z0Uhnj.mjs +308 -0
- package/dist/taxonomies-K2z0Uhnj.mjs.map +1 -0
- package/dist/{tokens-DKHiCYCB.mjs → tokens-BFPFx3CA.mjs} +1 -1
- package/dist/{tokens-DKHiCYCB.mjs.map → tokens-BFPFx3CA.mjs.map} +1 -1
- package/dist/{transport-BtcQ-Z7T.mjs → transport-BykRfpyy.mjs} +1 -1
- package/dist/{transport-BtcQ-Z7T.mjs.map → transport-BykRfpyy.mjs.map} +1 -1
- package/dist/{transport-CKQA_G44.d.mts → transport-H4Iwx7tC.d.mts} +1 -1
- package/dist/{transport-CKQA_G44.d.mts.map → transport-H4Iwx7tC.d.mts.map} +1 -1
- package/dist/{types-BmkQR1En.d.mts → types-6CUZRrZP.d.mts} +1 -1
- package/dist/{types-BmkQR1En.d.mts.map → types-6CUZRrZP.d.mts.map} +1 -1
- package/dist/{types-Dz9_WMS6.mjs → types-BH2L167P.mjs} +1 -1
- package/dist/{types-Dz9_WMS6.mjs.map → types-BH2L167P.mjs.map} +1 -1
- package/dist/{types-B6BzlZxx.d.mts → types-C2v0c34j.d.mts} +10 -1
- package/dist/{types-B6BzlZxx.d.mts.map → types-C2v0c34j.d.mts.map} +1 -1
- package/dist/{types-DNZpaCBk.d.mts → types-CFWjXmus.d.mts} +1 -1
- package/dist/{types-DNZpaCBk.d.mts.map → types-CFWjXmus.d.mts.map} +1 -1
- package/dist/{types-DeG21anB.d.mts → types-CnZYHyLW.d.mts} +55 -5
- package/dist/types-CnZYHyLW.d.mts.map +1 -0
- package/dist/{types-xxCWI3j0.mjs → types-DDS4MxsT.mjs} +11 -3
- package/dist/types-DDS4MxsT.mjs.map +1 -0
- package/dist/{types-C3ronwXb.d.mts → types-DgrIP0tF.d.mts} +102 -4
- package/dist/types-DgrIP0tF.d.mts.map +1 -0
- package/dist/{validate-DuZDIxfy.mjs → validate-CqsNItbt.mjs} +2 -2
- package/dist/{validate-DuZDIxfy.mjs.map → validate-CqsNItbt.mjs.map} +1 -1
- package/dist/{validate-Db1yNL3i.d.mts → validate-kM8Pjuf7.d.mts} +5 -52
- package/dist/validate-kM8Pjuf7.d.mts.map +1 -0
- package/dist/version-BnTKdfam.mjs +7 -0
- package/dist/{version-CMMjTuqu.mjs.map → version-BnTKdfam.mjs.map} +1 -1
- package/package.json +10 -5
- package/src/after.ts +62 -0
- package/src/api/handlers/content.ts +2 -0
- package/src/api/handlers/oauth-authorization.ts +2 -32
- package/src/api/handlers/oauth-clients.ts +40 -4
- package/src/api/handlers/taxonomies.ts +13 -0
- package/src/api/oauth/redirect-uri.ts +34 -0
- package/src/api/openapi/document.ts +126 -118
- package/src/api/schemas/content.ts +8 -0
- package/src/api/schemas/media.ts +26 -15
- package/src/api/schemas/schema.ts +1 -0
- package/src/astro/integration/font-provider.ts +178 -0
- package/src/astro/integration/index.ts +44 -0
- package/src/astro/integration/routes.ts +6 -0
- package/src/astro/integration/runtime.ts +117 -0
- package/src/astro/integration/virtual-modules.ts +41 -39
- package/src/astro/integration/vite-config.ts +16 -5
- package/src/astro/middleware/auth.ts +33 -1
- package/src/astro/middleware/request-context.ts +15 -3
- package/src/astro/middleware.ts +340 -263
- package/src/astro/routes/admin.astro +21 -10
- package/src/astro/routes/api/auth/magic-link/send.ts +2 -1
- package/src/astro/routes/api/auth/passkey/options.ts +2 -1
- package/src/astro/routes/api/auth/passkey/verify.ts +5 -1
- package/src/astro/routes/api/auth/signup/request.ts +26 -8
- package/src/astro/routes/api/comments/[collection]/[contentId]/index.ts +10 -6
- package/src/astro/routes/api/content/[collection]/[id]/compare.ts +1 -1
- package/src/astro/routes/api/content/[collection]/[id]/preview-url.ts +1 -1
- package/src/astro/routes/api/content/[collection]/[id]/revisions.ts +1 -1
- package/src/astro/routes/api/content/[collection]/[id]/terms/[taxonomy].ts +5 -0
- package/src/astro/routes/api/content/[collection]/[id]/translations.ts +26 -0
- package/src/astro/routes/api/content/[collection]/[id].ts +30 -2
- package/src/astro/routes/api/content/[collection]/index.ts +19 -1
- package/src/astro/routes/api/content/[collection]/trash.ts +1 -1
- package/src/astro/routes/api/import/wordpress/execute.ts +1 -1
- package/src/astro/routes/api/import/wordpress-plugin/analyze.ts +4 -3
- package/src/astro/routes/api/import/wordpress-plugin/execute.ts +5 -4
- package/src/astro/routes/api/manifest.ts +7 -0
- package/src/astro/routes/api/media/upload-url.ts +10 -2
- package/src/astro/routes/api/media.ts +10 -7
- package/src/astro/routes/api/oauth/device/code.ts +2 -1
- package/src/astro/routes/api/oauth/device/token.ts +2 -1
- package/src/astro/routes/api/oauth/register.ts +178 -0
- package/src/astro/routes/api/oauth/token.ts +15 -0
- package/src/astro/routes/api/openapi.json.ts +15 -5
- package/src/astro/routes/api/schema/collections/[slug]/fields/[fieldSlug].ts +2 -0
- package/src/astro/routes/api/schema/collections/[slug]/fields/index.ts +1 -0
- package/src/astro/routes/api/schema/collections/[slug]/fields/reorder.ts +1 -0
- package/src/astro/routes/api/search/index.ts +5 -0
- package/src/astro/routes/api/search/suggest.ts +3 -0
- package/src/astro/routes/api/setup/admin-verify.ts +30 -5
- package/src/astro/routes/api/setup/admin.ts +32 -8
- package/src/astro/routes/api/setup/index.ts +5 -2
- package/src/astro/routes/api/taxonomies/index.ts +1 -0
- package/src/astro/routes/api/well-known/oauth-authorization-server.ts +1 -1
- package/src/astro/types.ts +9 -0
- package/src/auth/rate-limit.ts +50 -22
- package/src/auth/setup-nonce.ts +22 -0
- package/src/auth/trusted-proxy.ts +92 -0
- package/src/bylines/index.ts +22 -45
- package/src/components/EmDashHead.astro +23 -7
- package/src/database/connection.ts +23 -1
- package/src/database/instrumentation.ts +98 -0
- package/src/database/migrations/035_bounded_404_log.ts +112 -0
- package/src/database/migrations/runner.ts +2 -0
- package/src/database/repositories/content.ts +39 -0
- package/src/database/repositories/options.ts +25 -0
- package/src/database/repositories/redirect.ts +111 -8
- package/src/database/types.ts +9 -0
- package/src/db/adapters.ts +15 -0
- package/src/emdash-runtime.ts +312 -92
- package/src/import/registry.ts +4 -3
- package/src/import/ssrf.ts +253 -12
- package/src/index.ts +6 -0
- package/src/loader.ts +19 -24
- package/src/mcp/server.ts +76 -3
- package/src/menus/index.ts +6 -3
- package/src/page/index.ts +1 -1
- package/src/page/seo-contributions.ts +36 -0
- package/src/plugins/context.ts +15 -3
- package/src/plugins/manager.ts +6 -0
- package/src/plugins/request-meta.ts +66 -15
- package/src/plugins/routes.ts +3 -1
- package/src/query.ts +104 -7
- package/src/request-cache.ts +106 -0
- package/src/request-context.ts +19 -0
- package/src/schema/query.ts +5 -2
- package/src/schema/registry.ts +243 -166
- package/src/schema/types.ts +13 -2
- package/src/schema/zod-generator.ts +4 -0
- package/src/search/fts-manager.ts +19 -5
- package/src/search/query.ts +4 -3
- package/src/seed/apply.ts +41 -1
- package/src/settings/index.ts +24 -5
- package/src/taxonomies/index.ts +324 -124
- package/src/utils/db-errors.ts +46 -0
- package/src/virtual-modules.d.ts +31 -10
- package/src/visual-editing/toolbar.ts +6 -1
- package/src/widgets/index.ts +54 -25
- package/dist/adapters-C2BzVy0p.d.mts.map +0 -1
- package/dist/apply-Cma_PiF6.mjs.map +0 -1
- package/dist/byline-WuOq9MFJ.mjs.map +0 -1
- package/dist/bylines-C_Wsnz4L.mjs.map +0 -1
- package/dist/connection-B4zVnQIa.mjs.map +0 -1
- package/dist/index-CCWzlriB.d.mts.map +0 -1
- package/dist/loader-BYzwzORf.mjs.map +0 -1
- package/dist/query-B6Vu0d2i.mjs.map +0 -1
- package/dist/redirect-7lGhLBNZ.mjs.map +0 -1
- package/dist/registry-BgnP3ysR.mjs.map +0 -1
- package/dist/runner-Cd-_WyDo.mjs.map +0 -1
- package/dist/search-Cn1SYvYF.mjs.map +0 -1
- package/dist/types-C3ronwXb.d.mts.map +0 -1
- package/dist/types-DeG21anB.d.mts.map +0 -1
- package/dist/types-xxCWI3j0.mjs.map +0 -1
- package/dist/validate-Db1yNL3i.d.mts.map +0 -1
- package/dist/version-CMMjTuqu.mjs +0 -7
package/dist/astro/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "../types-
|
|
2
|
-
import {
|
|
3
|
-
import "../runner-
|
|
4
|
-
import { r as ContentItem } from "../types-
|
|
5
|
-
import { X as ResolvedPlugin } from "../types-
|
|
6
|
-
import "../validate-
|
|
1
|
+
import "../types-C2v0c34j.mjs";
|
|
2
|
+
import { Ri as MediaItem, _n as S3StorageConfig, gn as LocalStorageConfig, hn as getStoredConfig, pn as EmDashConfig, vn as StorageDescriptor } from "../index-De6_Xv3v.mjs";
|
|
3
|
+
import "../runner-BR2xKwhn.mjs";
|
|
4
|
+
import { r as ContentItem } from "../types-6CUZRrZP.mjs";
|
|
5
|
+
import { X as ResolvedPlugin } from "../types-DgrIP0tF.mjs";
|
|
6
|
+
import "../validate-kM8Pjuf7.mjs";
|
|
7
7
|
import { EmDashHandlers, EmDashManifest, ManifestCollection } from "./types.mjs";
|
|
8
8
|
import { AstroIntegration } from "astro";
|
|
9
9
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/astro/storage/adapters.ts","../../src/astro/integration/index.ts"],"mappings":";;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/astro/storage/adapters.ts","../../src/astro/integration/index.ts"],"mappings":";;;;;;;;;;;;;;;;;AC4DA;;;;;;;;;;;;;;;;;;;;;;;iBDCgB,EAAA,CAAG,MAAA,GAAQ,OAAA,CAAQ,eAAA,IAAwB,iBAAA;;;;;;;;;;;;;;;iBAqB3C,KAAA,CAAM,MAAA,EAAQ,kBAAA,GAAqB,iBAAA;;;;;;iBCtBnC,MAAA,CAAO,MAAA,GAAQ,YAAA,GAAoB,gBAAA"}
|
package/dist/astro/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { t as defaultSeed } from "../default-
|
|
2
|
-
import { n as VERSION, t as COMMIT } from "../version-
|
|
1
|
+
import { t as defaultSeed } from "../default-CME5YdZ3.mjs";
|
|
2
|
+
import { n as VERSION, t as COMMIT } from "../version-BnTKdfam.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
|
+
import { fontProviders } from "astro/config";
|
|
4
5
|
import { dirname, resolve } from "node:path";
|
|
5
6
|
import { fileURLToPath } from "node:url";
|
|
6
7
|
import { existsSync, readFileSync } from "node:fs";
|
|
@@ -63,6 +64,130 @@ function local(config) {
|
|
|
63
64
|
};
|
|
64
65
|
}
|
|
65
66
|
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/astro/integration/font-provider.ts
|
|
69
|
+
/**
|
|
70
|
+
* EmDash Noto Sans font provider
|
|
71
|
+
*
|
|
72
|
+
* A custom Astro font provider that wraps Google Fonts to resolve
|
|
73
|
+
* multiple Noto Sans families (Latin, Arabic, JP, etc.) under a
|
|
74
|
+
* single logical font entry. This lets all @font-face blocks share
|
|
75
|
+
* the same font-family name, so the browser picks the right file
|
|
76
|
+
* per character via unicode-range.
|
|
77
|
+
*
|
|
78
|
+
* Without this, registering "Noto Sans" and "Noto Sans Arabic" as
|
|
79
|
+
* separate font entries on the same cssVariable triggers an Astro
|
|
80
|
+
* warning and the last entry overwrites the first.
|
|
81
|
+
*/
|
|
82
|
+
/**
|
|
83
|
+
* All subset names used by Google Fonts CSS responses.
|
|
84
|
+
* Passed when resolving extra script families so the unifont
|
|
85
|
+
* provider doesn't filter out any faces.
|
|
86
|
+
*/
|
|
87
|
+
const ALL_GOOGLE_SUBSETS = [
|
|
88
|
+
"arabic",
|
|
89
|
+
"armenian",
|
|
90
|
+
"bengali",
|
|
91
|
+
"chinese-simplified",
|
|
92
|
+
"chinese-traditional",
|
|
93
|
+
"chinese-hongkong",
|
|
94
|
+
"cyrillic",
|
|
95
|
+
"cyrillic-ext",
|
|
96
|
+
"devanagari",
|
|
97
|
+
"ethiopic",
|
|
98
|
+
"farsi",
|
|
99
|
+
"georgian",
|
|
100
|
+
"greek",
|
|
101
|
+
"greek-ext",
|
|
102
|
+
"gujarati",
|
|
103
|
+
"gurmukhi",
|
|
104
|
+
"hebrew",
|
|
105
|
+
"japanese",
|
|
106
|
+
"kannada",
|
|
107
|
+
"khmer",
|
|
108
|
+
"korean",
|
|
109
|
+
"lao",
|
|
110
|
+
"latin",
|
|
111
|
+
"latin-ext",
|
|
112
|
+
"malayalam",
|
|
113
|
+
"math",
|
|
114
|
+
"myanmar",
|
|
115
|
+
"oriya",
|
|
116
|
+
"sinhala",
|
|
117
|
+
"symbols",
|
|
118
|
+
"tamil",
|
|
119
|
+
"telugu",
|
|
120
|
+
"thai",
|
|
121
|
+
"tibetan",
|
|
122
|
+
"vietnamese"
|
|
123
|
+
];
|
|
124
|
+
/**
|
|
125
|
+
* Known Noto Sans and Sans script families on Google Fonts.
|
|
126
|
+
* Maps user-friendly script names to Google Fonts family names.
|
|
127
|
+
*/
|
|
128
|
+
const NOTO_SCRIPT_FAMILIES = {
|
|
129
|
+
arabic: "Noto Sans Arabic",
|
|
130
|
+
armenian: "Noto Sans Armenian",
|
|
131
|
+
bengali: "Noto Sans Bengali",
|
|
132
|
+
"chinese-simplified": "Noto Sans SC",
|
|
133
|
+
"chinese-traditional": "Noto Sans TC",
|
|
134
|
+
"chinese-hongkong": "Noto Sans HK",
|
|
135
|
+
devanagari: "Noto Sans Devanagari",
|
|
136
|
+
ethiopic: "Noto Sans Ethiopic",
|
|
137
|
+
farsi: "Vazirmatn",
|
|
138
|
+
georgian: "Noto Sans Georgian",
|
|
139
|
+
gujarati: "Noto Sans Gujarati",
|
|
140
|
+
gurmukhi: "Noto Sans Gurmukhi",
|
|
141
|
+
hebrew: "Noto Sans Hebrew",
|
|
142
|
+
japanese: "Noto Sans JP",
|
|
143
|
+
kannada: "Noto Sans Kannada",
|
|
144
|
+
khmer: "Noto Sans Khmer",
|
|
145
|
+
korean: "Noto Sans KR",
|
|
146
|
+
lao: "Noto Sans Lao",
|
|
147
|
+
malayalam: "Noto Sans Malayalam",
|
|
148
|
+
myanmar: "Noto Sans Myanmar",
|
|
149
|
+
oriya: "Noto Sans Oriya",
|
|
150
|
+
sinhala: "Noto Sans Sinhala",
|
|
151
|
+
tamil: "Noto Sans Tamil",
|
|
152
|
+
telugu: "Noto Sans Telugu",
|
|
153
|
+
thai: "Noto Sans Thai",
|
|
154
|
+
tibetan: "Noto Sans Tibetan"
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* Create a font provider that resolves Noto Sans plus additional
|
|
158
|
+
* script-specific Noto families from Google Fonts, all under one
|
|
159
|
+
* font-family name.
|
|
160
|
+
*/
|
|
161
|
+
function notoSans(options) {
|
|
162
|
+
const googleProvider = fontProviders.google();
|
|
163
|
+
return {
|
|
164
|
+
name: "emdash-noto",
|
|
165
|
+
async init(context) {
|
|
166
|
+
await googleProvider.init?.(context);
|
|
167
|
+
},
|
|
168
|
+
async resolveFont(resolveFontOptions) {
|
|
169
|
+
const base = await googleProvider.resolveFont(resolveFontOptions);
|
|
170
|
+
const baseFonts = base?.fonts ?? [];
|
|
171
|
+
if (!options?.scripts?.length) return base;
|
|
172
|
+
const baseSubsets = new Set(baseFonts.map((f) => f.meta?.subset).filter(Boolean));
|
|
173
|
+
const extraFaces = (await Promise.all(options.scripts.map(async (script) => {
|
|
174
|
+
const family = NOTO_SCRIPT_FAMILIES[script];
|
|
175
|
+
if (!family) {
|
|
176
|
+
if (ALL_GOOGLE_SUBSETS.includes(script)) return;
|
|
177
|
+
console.warn(`[emdash] Unknown Noto Sans script "${script}". Available: ${Object.keys(NOTO_SCRIPT_FAMILIES).join(", ")}`);
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
return googleProvider.resolveFont({
|
|
181
|
+
...resolveFontOptions,
|
|
182
|
+
familyName: family,
|
|
183
|
+
subsets: ALL_GOOGLE_SUBSETS
|
|
184
|
+
});
|
|
185
|
+
}))).flatMap((r) => (r?.fonts ?? []).filter((f) => !f.meta?.subset || !baseSubsets.has(f.meta.subset)));
|
|
186
|
+
return { fonts: [...baseFonts, ...extraFaces] };
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
|
|
66
191
|
//#endregion
|
|
67
192
|
//#region src/astro/integration/routes.ts
|
|
68
193
|
/**
|
|
@@ -447,6 +572,10 @@ function injectCoreRoutes(injectRoute) {
|
|
|
447
572
|
pattern: "/.well-known/oauth-authorization-server/_emdash",
|
|
448
573
|
entrypoint: resolveRoute("api/well-known/oauth-authorization-server.ts")
|
|
449
574
|
});
|
|
575
|
+
injectRoute({
|
|
576
|
+
pattern: "/_emdash/api/oauth/register",
|
|
577
|
+
entrypoint: resolveRoute("api/oauth/register.ts")
|
|
578
|
+
});
|
|
450
579
|
injectRoute({
|
|
451
580
|
pattern: "/_emdash/api/plugins/[pluginId]/[...path]",
|
|
452
581
|
entrypoint: resolveRoute("api/plugins/[pluginId]/[...path].ts")
|
|
@@ -741,6 +870,8 @@ const VIRTUAL_BLOCK_COMPONENTS_ID = "virtual:emdash/block-components";
|
|
|
741
870
|
const RESOLVED_VIRTUAL_BLOCK_COMPONENTS_ID = "\0" + VIRTUAL_BLOCK_COMPONENTS_ID;
|
|
742
871
|
const VIRTUAL_SEED_ID = "virtual:emdash/seed";
|
|
743
872
|
const RESOLVED_VIRTUAL_SEED_ID = "\0" + VIRTUAL_SEED_ID;
|
|
873
|
+
const VIRTUAL_WAIT_UNTIL_ID = "virtual:emdash/wait-until";
|
|
874
|
+
const RESOLVED_VIRTUAL_WAIT_UNTIL_ID = "\0" + VIRTUAL_WAIT_UNTIL_ID;
|
|
744
875
|
/**
|
|
745
876
|
* Generates the config virtual module.
|
|
746
877
|
*/
|
|
@@ -749,42 +880,32 @@ function generateConfigModule(serializableConfig) {
|
|
|
749
880
|
}
|
|
750
881
|
/**
|
|
751
882
|
* Generates the dialect virtual module.
|
|
752
|
-
* Statically imports the configured database dialect and exports the dialect type.
|
|
753
883
|
*
|
|
754
|
-
*
|
|
755
|
-
*
|
|
756
|
-
* middleware for per-request
|
|
757
|
-
*
|
|
758
|
-
*
|
|
884
|
+
* Adapters that set `supportsRequestScope: true` on their descriptor are
|
|
885
|
+
* expected to export `createRequestScopedDb` from their runtime entrypoint;
|
|
886
|
+
* the generator re-exports it so middleware can ask for a per-request Kysely
|
|
887
|
+
* (used for D1 Sessions API, bookmark cookies, read-replica routing). Other
|
|
888
|
+
* adapters get a stub that returns null.
|
|
759
889
|
*/
|
|
760
|
-
function generateDialectModule(
|
|
761
|
-
|
|
890
|
+
function generateDialectModule(opts) {
|
|
891
|
+
const { entrypoint, supportsRequestScope } = opts;
|
|
892
|
+
if (!entrypoint) return [
|
|
762
893
|
`export const createDialect = undefined;`,
|
|
763
894
|
`export const dialectType = "sqlite";`,
|
|
764
|
-
`export const
|
|
765
|
-
`export const getD1Binding = () => null;`,
|
|
766
|
-
`export const getDefaultConstraint = () => "first-unconstrained";`,
|
|
767
|
-
`export const getBookmarkCookieName = () => "";`,
|
|
768
|
-
`export const createSessionDialect = undefined;`
|
|
895
|
+
`export const createRequestScopedDb = (_opts) => null;`
|
|
769
896
|
].join("\n");
|
|
770
|
-
const type =
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
import { createDialect as _createDialect } from "${dbEntrypoint}";
|
|
775
|
-
export { isSessionEnabled, getD1Binding, getDefaultConstraint, getBookmarkCookieName, createSessionDialect } from "${dbEntrypoint}";
|
|
897
|
+
const type = opts.type ?? "sqlite";
|
|
898
|
+
if (supportsRequestScope) return `
|
|
899
|
+
import { createDialect as _createDialect } from "${entrypoint}";
|
|
900
|
+
export { createRequestScopedDb } from "${entrypoint}";
|
|
776
901
|
export const createDialect = _createDialect;
|
|
777
902
|
export const dialectType = ${JSON.stringify(type)};
|
|
778
903
|
`;
|
|
779
904
|
return `
|
|
780
|
-
import { createDialect as _createDialect } from "${
|
|
905
|
+
import { createDialect as _createDialect } from "${entrypoint}";
|
|
781
906
|
export const createDialect = _createDialect;
|
|
782
907
|
export const dialectType = ${JSON.stringify(type)};
|
|
783
|
-
export const
|
|
784
|
-
export const getD1Binding = () => null;
|
|
785
|
-
export const getDefaultConstraint = () => "first-unconstrained";
|
|
786
|
-
export const getBookmarkCookieName = () => "";
|
|
787
|
-
export const createSessionDialect = undefined;
|
|
908
|
+
export const createRequestScopedDb = (_opts) => null;
|
|
788
909
|
`;
|
|
789
910
|
}
|
|
790
911
|
/**
|
|
@@ -960,6 +1081,22 @@ function generateBlockComponentsModule(descriptors) {
|
|
|
960
1081
|
return `${imports.join("\n")}\nexport const pluginBlockComponents = { ${spreads.join(", ")} };`;
|
|
961
1082
|
}
|
|
962
1083
|
/**
|
|
1084
|
+
* Generates the wait-until virtual module.
|
|
1085
|
+
*
|
|
1086
|
+
* Under @astrojs/cloudflare, re-exports `waitUntil` from `cloudflare:workers`
|
|
1087
|
+
* so `after(fn)` in core can extend the worker's lifetime past the response
|
|
1088
|
+
* for deferred bookkeeping. For any other adapter, exports `undefined` —
|
|
1089
|
+
* Node's long-lived event loop keeps deferred promises running without a
|
|
1090
|
+
* lifetime extender.
|
|
1091
|
+
*
|
|
1092
|
+
* Keeping the adapter check here — rather than in core — means core itself
|
|
1093
|
+
* has no Cloudflare-specific imports or code paths.
|
|
1094
|
+
*/
|
|
1095
|
+
function generateWaitUntilModule(adapterName) {
|
|
1096
|
+
if (adapterName === "@astrojs/cloudflare") return `export { waitUntil } from "cloudflare:workers";`;
|
|
1097
|
+
return `export const waitUntil = undefined;`;
|
|
1098
|
+
}
|
|
1099
|
+
/**
|
|
963
1100
|
* Generates the seed virtual module.
|
|
964
1101
|
* Reads the user's seed file at build time (in Node context) and embeds it,
|
|
965
1102
|
* so the runtime doesn't need filesystem access (required for workerd).
|
|
@@ -1117,10 +1254,15 @@ function createVirtualModulesPlugin(options) {
|
|
|
1117
1254
|
if (id === VIRTUAL_MEDIA_PROVIDERS_ID) return RESOLVED_VIRTUAL_MEDIA_PROVIDERS_ID;
|
|
1118
1255
|
if (id === VIRTUAL_BLOCK_COMPONENTS_ID) return RESOLVED_VIRTUAL_BLOCK_COMPONENTS_ID;
|
|
1119
1256
|
if (id === VIRTUAL_SEED_ID) return RESOLVED_VIRTUAL_SEED_ID;
|
|
1257
|
+
if (id === VIRTUAL_WAIT_UNTIL_ID) return RESOLVED_VIRTUAL_WAIT_UNTIL_ID;
|
|
1120
1258
|
},
|
|
1121
1259
|
load(id) {
|
|
1122
1260
|
if (id === RESOLVED_VIRTUAL_CONFIG_ID) return generateConfigModule(serializableConfig);
|
|
1123
|
-
if (id === RESOLVED_VIRTUAL_DIALECT_ID) return generateDialectModule(
|
|
1261
|
+
if (id === RESOLVED_VIRTUAL_DIALECT_ID) return generateDialectModule({
|
|
1262
|
+
entrypoint: resolvedConfig.database?.entrypoint,
|
|
1263
|
+
type: resolvedConfig.database?.type,
|
|
1264
|
+
supportsRequestScope: resolvedConfig.database?.supportsRequestScope ?? false
|
|
1265
|
+
});
|
|
1124
1266
|
if (id === RESOLVED_VIRTUAL_STORAGE_ID) return generateStorageModule(resolvedConfig.storage?.entrypoint);
|
|
1125
1267
|
if (id === RESOLVED_VIRTUAL_PLUGINS_ID) return generatePluginsModule(pluginDescriptors);
|
|
1126
1268
|
if (id === RESOLVED_VIRTUAL_ADMIN_REGISTRY_ID) return generateAdminRegistryModule([...pluginDescriptors, ...resolvedConfig.sandboxed ?? []]);
|
|
@@ -1137,6 +1279,7 @@ function createVirtualModulesPlugin(options) {
|
|
|
1137
1279
|
if (id === RESOLVED_VIRTUAL_MEDIA_PROVIDERS_ID) return generateMediaProvidersModule(resolvedConfig.mediaProviders ?? []);
|
|
1138
1280
|
if (id === RESOLVED_VIRTUAL_BLOCK_COMPONENTS_ID) return generateBlockComponentsModule(pluginDescriptors);
|
|
1139
1281
|
if (id === RESOLVED_VIRTUAL_SEED_ID) return generateSeedModule(fileURLToPath(astroConfig.root));
|
|
1282
|
+
if (id === RESOLVED_VIRTUAL_WAIT_UNTIL_ID) return generateWaitUntilModule(astroConfig.adapter?.name);
|
|
1140
1283
|
}
|
|
1141
1284
|
};
|
|
1142
1285
|
}
|
|
@@ -1320,7 +1463,10 @@ function emdash(config = {}) {
|
|
|
1320
1463
|
storage: resolvedConfig.storage,
|
|
1321
1464
|
auth: resolvedConfig.auth,
|
|
1322
1465
|
marketplace: resolvedConfig.marketplace,
|
|
1323
|
-
siteUrl: resolvedConfig.siteUrl
|
|
1466
|
+
siteUrl: resolvedConfig.siteUrl,
|
|
1467
|
+
trustedProxyHeaders: resolvedConfig.trustedProxyHeaders,
|
|
1468
|
+
maxUploadSize: resolvedConfig.maxUploadSize,
|
|
1469
|
+
admin: resolvedConfig.admin
|
|
1324
1470
|
};
|
|
1325
1471
|
const useExternalAuth = !!(resolvedConfig.auth && "entrypoint" in resolvedConfig.auth);
|
|
1326
1472
|
return {
|
|
@@ -1337,11 +1483,35 @@ function emdash(config = {}) {
|
|
|
1337
1483
|
prefixDefaultLocale: typeof routing === "object" ? routing.prefixDefaultLocale ?? false : false
|
|
1338
1484
|
};
|
|
1339
1485
|
}
|
|
1486
|
+
const securityConfig = {
|
|
1487
|
+
checkOrigin: false,
|
|
1488
|
+
...resolvedConfig.siteUrl ? { allowedDomains: [{ hostname: new URL(resolvedConfig.siteUrl).hostname }] } : {}
|
|
1489
|
+
};
|
|
1490
|
+
const fontsConfig = resolvedConfig.fonts;
|
|
1340
1491
|
updateConfig({
|
|
1341
|
-
security:
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1492
|
+
security: securityConfig,
|
|
1493
|
+
fonts: fontsConfig === false ? [] : [{
|
|
1494
|
+
provider: notoSans({ scripts: fontsConfig?.scripts }),
|
|
1495
|
+
name: "Noto Sans",
|
|
1496
|
+
cssVariable: "--font-emdash",
|
|
1497
|
+
weights: ["100 900"],
|
|
1498
|
+
styles: ["normal", "italic"],
|
|
1499
|
+
subsets: [
|
|
1500
|
+
"latin",
|
|
1501
|
+
"latin-ext",
|
|
1502
|
+
"cyrillic",
|
|
1503
|
+
"cyrillic-ext",
|
|
1504
|
+
"devanagari",
|
|
1505
|
+
"greek",
|
|
1506
|
+
"greek-ext",
|
|
1507
|
+
"vietnamese"
|
|
1508
|
+
],
|
|
1509
|
+
fallbacks: [
|
|
1510
|
+
"ui-sans-serif",
|
|
1511
|
+
"system-ui",
|
|
1512
|
+
"sans-serif"
|
|
1513
|
+
]
|
|
1514
|
+
}],
|
|
1345
1515
|
vite: createViteConfig({
|
|
1346
1516
|
serializableConfig,
|
|
1347
1517
|
resolvedConfig,
|