meno-astro 0.1.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.
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../lib/runtime/localeMiddleware.ts"],
4
+ "sourcesContent": ["/**\n * meno-astro \u2014 the injected locale-middleware entrypoint.\n *\n * This is the module the `meno()` integration points Astro at via\n * `addMiddleware({ entrypoint: 'meno-astro/runtime/localeMiddleware', order: 'pre' })`.\n * Astro imports it once and calls its `onRequest` export around every page render\n * (request for SSR, prerender for static), so the `runWithLocale(...)` context it opens\n * is in scope for the whole page + all its components \u2014 see `runtime/middleware.ts` for\n * the architecture rationale.\n *\n * Config is loaded **once at module load** from the project root (`process.cwd()`, which\n * Astro sets to the project directory during build/dev) via `loadI18nConfig`, then the\n * pure `createLocaleMiddleware` factory is bound to it. Loading once (not per request) is\n * correct: the project's i18n config is static for the lifetime of a build/server.\n *\n * `onRequest` is the name Astro's `addMiddleware`/`defineMiddleware` contract expects for\n * a middleware module's handler export.\n */\n\nimport { createLocaleMiddleware } from './middleware';\nimport { loadI18nConfig } from '../server/loadI18nConfig';\n\n// Resolve config from the project root once. `process.cwd()` is the Astro project dir\n// during `astro build` / `astro dev`; a missing/legacy config degrades to defaults inside\n// `loadI18nConfig`, so this never throws at import time.\nconst config = loadI18nConfig(process.cwd());\n\n/** Astro middleware handler \u2014 establishes the per-render locale context. */\nexport const onRequest = createLocaleMiddleware(config);\n"],
5
+ "mappings": ";;;;;;;;;;AAyBA,IAAM,SAAS,eAAe,QAAQ,IAAI,CAAC;AAGpC,IAAM,YAAY,uBAAuB,MAAM;",
6
+ "names": []
7
+ }
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "meno-astro",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "Meno-Astro: runtime helpers + the round-trippable .astro dialect (emit/parse) that lets Meno use Astro files as a source-of-truth format.",
6
+ "license": "MIT",
7
+ "exports": {
8
+ ".": "./dist/lib/index.js",
9
+ "./dialect": "./dist/lib/dialect/index.js",
10
+ "./integration": "./dist/lib/integration/index.js",
11
+ "./components": "./dist/lib/components/index.js",
12
+ "./runtime/localeMiddleware": "./dist/lib/runtime/localeMiddleware.js"
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "README.md"
17
+ ],
18
+ "scripts": {
19
+ "test": "bun test",
20
+ "typecheck": "tsc --noEmit",
21
+ "build": "node scripts/build-for-publish.mjs",
22
+ "prepublishOnly": "node scripts/build-for-publish.mjs",
23
+ "postpublish": "node scripts/restore-package.mjs"
24
+ },
25
+ "peerDependencies": {
26
+ "astro": ">=4.0.0"
27
+ },
28
+ "dependencies": {
29
+ "meno-core": "^1.0.52"
30
+ },
31
+ "devDependencies": {
32
+ "bun-types": "^1.0.0",
33
+ "esbuild": "^0.25.0",
34
+ "typescript": "^5.3.0"
35
+ }
36
+ }