{"_id":"@aero-js/content","_rev":"4-29a495a18815d54696b59d0e47f10f89","name":"@aero-js/content","dist-tags":{"latest":"0.4.0"},"versions":{"0.3.3":{"name":"@aero-js/content","version":"0.3.3","author":{"name":"Jamie Wilson"},"license":"MIT","_id":"@aero-js/content@0.3.3","maintainers":[{"name":"jmwlsn","email":"jamie@jamiewilson.io"}],"homepage":"https://github.com/jamiewilson/aero","bugs":{"url":"https://github.com/jamiewilson/aero/issues"},"dist":{"shasum":"307e6cc8cb35869a5267938d173685c9d0fb3517","tarball":"https://registry.npmjs.org/@aero-js/content/-/content-0.3.3.tgz","fileCount":15,"integrity":"sha512-W/k4BU1GN8oxWVVG7difIlVe3uxwWQLRQje9j3eWFIEkP8xvp77L8DhAxKdCyNnJLrzugXZiVMB/bH8ld0uZgw==","signatures":[{"sig":"MEUCIHfqyIsM/hr9lmwuCR8E7EwJikG2gGdlVHa20Wl7FOvGAiEAqLTs1Cw6wh1NbyZ766x0TzHDcs892TBFPlQ0UA89EQc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23556},"type":"module","_from":"file:aero-js-content-0.3.3.tgz","types":"./dist/index.d.mts","exports":{".":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"./vite":{"types":"./dist/vite.d.mts","default":"./dist/vite.mjs"},"./types":{"types":"./dist/types.d.mts","default":"./dist/types.mjs"},"./render":{"types":"./dist/render.d.mts","default":"./dist/render.mjs"},"./markdown":{"types":"./dist/markdown.d.mts","default":"./dist/markdown.mjs"},"./processor":{"types":"./dist/processor.d.mts","default":"./dist/processor.mjs"}},"private":false,"scripts":{"test":"vitest run","build":"tsdown src/index.ts src/types.ts src/vite.ts src/markdown.ts src/render.ts src/processor.ts --format esm --dts --clean --out-dir dist","typecheck":"tsc --noEmit"},"_npmUser":{"name":"jmwlsn","email":"jamie@jamiewilson.io"},"_resolved":"/private/var/folders/yc/828p39ws2lxgqcb96h4qdbjm0000gn/T/0bda5d759b06abfcdc376330a6843194/aero-js-content-0.3.3.tgz","_integrity":"sha512-W/k4BU1GN8oxWVVG7difIlVe3uxwWQLRQje9j3eWFIEkP8xvp77L8DhAxKdCyNnJLrzugXZiVMB/bH8ld0uZgw==","repository":{"url":"git+https://github.com/jamiewilson/aero.git","type":"git","directory":"packages/content"},"_npmVersion":"10.9.3","description":"Content collections for Aero: load Markdown (and other files) with frontmatter, validate with Zod, and render to HTML. Powers the `aero:content` virtual module and optional content plugin.","directories":{},"_nodeVersion":"22.18.0","dependencies":{"remark":"^15.0.1","unified":"^11.0.0","fast-glob":"^3.3.3","gray-matter":"^4.0.3","remark-rehype":"^11.0.0","rehype-stringify":"^10.0.0"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.3.6","vite":"8.0.0-beta.15","tsdown":"^0.21.0-beta.2","vitest":"^4.0.18","typescript":"^5.9.3","@types/hast":"^3.0.4","@types/node":"^25.3.0","@shikijs/rehype":"^3.0.0","@shikijs/transformers":"^3.0.0"},"peerDependencies":{"zod":"^4.0.0","vite":"^8.0.0-0"},"peerDependenciesMeta":{"zod":{"optional":true},"vite":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/content_0.3.3_1772817328479_0.2925353665126438","host":"s3://npm-registry-packages-npm-production"}},"0.3.4":{"name":"@aero-js/content","version":"0.3.4","author":{"name":"Jamie Wilson"},"license":"MIT","_id":"@aero-js/content@0.3.4","maintainers":[{"name":"jmwlsn","email":"jamie@jamiewilson.io"}],"homepage":"https://github.com/jamiewilson/aero","bugs":{"url":"https://github.com/jamiewilson/aero/issues"},"dist":{"shasum":"ae8694145610903e244a52db04946ade869ab0d2","tarball":"https://registry.npmjs.org/@aero-js/content/-/content-0.3.4.tgz","fileCount":15,"integrity":"sha512-evI5Tv7bQ7NNpsmEq8s2w3dp3ak+WHPzJXGUBgF3AavTbN9PVRVxfG+n9JYD6nID54NH+qm5mYEJYJU067k3Rw==","signatures":[{"sig":"MEUCIQCTKekN3l6iZpoPRhtU/d5BuTYoaiiZL11nVfWPaosBlgIgFVe47qcdODC520k/B5d/8DXvOxuZxxoyMaORwBnIduc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23554},"type":"module","_from":"file:aero-js-content-0.3.4.tgz","types":"./dist/index.d.mts","exports":{".":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"./vite":{"types":"./dist/vite.d.mts","default":"./dist/vite.mjs"},"./types":{"types":"./dist/types.d.mts","default":"./dist/types.mjs"},"./render":{"types":"./dist/render.d.mts","default":"./dist/render.mjs"},"./markdown":{"types":"./dist/markdown.d.mts","default":"./dist/markdown.mjs"},"./processor":{"types":"./dist/processor.d.mts","default":"./dist/processor.mjs"}},"private":false,"scripts":{"test":"vitest run","build":"tsdown src/index.ts src/types.ts src/vite.ts src/markdown.ts src/render.ts src/processor.ts --format esm --dts --clean --out-dir dist","typecheck":"tsc --noEmit"},"_npmUser":{"name":"jmwlsn","email":"jamie@jamiewilson.io"},"_resolved":"/private/var/folders/yc/828p39ws2lxgqcb96h4qdbjm0000gn/T/ac14cb4e572044370b434f1e22dd9b5c/aero-js-content-0.3.4.tgz","_integrity":"sha512-evI5Tv7bQ7NNpsmEq8s2w3dp3ak+WHPzJXGUBgF3AavTbN9PVRVxfG+n9JYD6nID54NH+qm5mYEJYJU067k3Rw==","repository":{"url":"git+https://github.com/jamiewilson/aero.git","type":"git","directory":"packages/content"},"_npmVersion":"10.9.3","description":"Content collections for Aero: load Markdown (and other files) with frontmatter, validate with Zod, and render to HTML. Powers the `aero:content` virtual module and optional content plugin.","directories":{},"_nodeVersion":"22.18.0","dependencies":{"remark":"^15.0.1","unified":"^11.0.0","fast-glob":"^3.3.3","gray-matter":"^4.0.3","remark-rehype":"^11.0.0","rehype-stringify":"^10.0.0"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.3.6","vite":"8.0.0-beta.15","tsdown":"^0.21.0-beta.2","vitest":"^4.0.18","typescript":"^5.9.3","@types/hast":"^3.0.4","@types/node":"^25.3.0","@shikijs/rehype":"^3.0.0","@shikijs/transformers":"^3.0.0"},"peerDependencies":{"zod":"^4.0.0","vite":"^8.0.0-0"},"peerDependenciesMeta":{"zod":{"optional":true},"vite":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/content_0.3.4_1773676587526_0.15767912051250632","host":"s3://npm-registry-packages-npm-production"}},"0.3.5":{"name":"@aero-js/content","version":"0.3.5","author":{"name":"Jamie Wilson"},"license":"MIT","_id":"@aero-js/content@0.3.5","maintainers":[{"name":"jmwlsn","email":"jamie@jamiewilson.io"}],"homepage":"https://github.com/jamiewilson/aero","bugs":{"url":"https://github.com/jamiewilson/aero/issues"},"dist":{"shasum":"d8bb967d6b6982d0f5d5123c87d2a338eb3109bf","tarball":"https://registry.npmjs.org/@aero-js/content/-/content-0.3.5.tgz","fileCount":15,"integrity":"sha512-1ygzhwoWM3ksHQuy6kx4Cd4D9NhGSiztVq1W5ukcmIbcYiH3p6p6Er/DvfgKwXgPDLu9cvDYEVdp2lotkXpupA==","signatures":[{"sig":"MEYCIQCzHDhLSC/Eb5WPURqSXNRaSixZuSM9Lh4ofVsfqR9HsgIhANW1wLl9uiVaHcvpbQ56Es3r/8emwS5lJh9z1jFUeFmK","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":24434},"type":"module","_from":"file:aero-js-content-0.3.5.tgz","types":"./dist/index.d.mts","exports":{".":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"./vite":{"types":"./dist/vite.d.mts","default":"./dist/vite.mjs"},"./types":{"types":"./dist/types.d.mts","default":"./dist/types.mjs"},"./render":{"types":"./dist/render.d.mts","default":"./dist/render.mjs"},"./markdown":{"types":"./dist/markdown.d.mts","default":"./dist/markdown.mjs"},"./processor":{"types":"./dist/processor.d.mts","default":"./dist/processor.mjs"}},"private":false,"scripts":{"test":"vitest run","build":"tsdown src/index.ts src/types.ts src/vite.ts src/markdown.ts src/render.ts src/processor.ts --format esm --dts --clean --out-dir dist","typecheck":"tsc --noEmit"},"_npmUser":{"name":"jmwlsn","email":"jamie@jamiewilson.io"},"_resolved":"/private/var/folders/yc/828p39ws2lxgqcb96h4qdbjm0000gn/T/047a7e38542c9f9603e8752710bfc9fb/aero-js-content-0.3.5.tgz","_integrity":"sha512-1ygzhwoWM3ksHQuy6kx4Cd4D9NhGSiztVq1W5ukcmIbcYiH3p6p6Er/DvfgKwXgPDLu9cvDYEVdp2lotkXpupA==","repository":{"url":"git+https://github.com/jamiewilson/aero.git","type":"git","directory":"packages/content"},"_npmVersion":"10.9.3","description":"Content collections for Aero: load Markdown (and other files) with frontmatter, validate with Standard Schema (Zod, ArkType, Valibot, etc.), and render to HTML. Powers the `aero:content` virtual module and optional content plugin.","directories":{},"_nodeVersion":"22.18.0","dependencies":{"remark":"^15.0.1","unified":"^11.0.0","fast-glob":"^3.3.3","gray-matter":"^4.0.3","remark-rehype":"^11.0.0","rehype-stringify":"^10.0.0","@standard-schema/spec":"^1.1.0"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.3.6","vite":"8.0.0-beta.15","tsdown":"^0.21.0-beta.2","vitest":"^4.0.18","arktype":"^2.0.0","typescript":"^5.9.3","@types/hast":"^3.0.4","@types/node":"^25.3.0","@shikijs/rehype":"^3.0.0","@shikijs/transformers":"^3.0.0"},"peerDependencies":{"zod":"^4.0.0","vite":"^8.0.0-0","arktype":"^2.0.0"},"peerDependenciesMeta":{"zod":{"optional":true},"vite":{"optional":true},"arktype":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/content_0.3.5_1773848976537_0.05955739127075321","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@aero-js/content","version":"0.4.0","private":false,"homepage":"https://github.com/jamiewilson/aero","license":"MIT","author":{"name":"Jamie Wilson"},"repository":{"type":"git","url":"git+https://github.com/jamiewilson/aero.git","directory":"packages/content"},"type":"module","types":"./dist/index.d.mts","exports":{".":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"./vite":{"types":"./dist/vite.d.mts","default":"./dist/vite.mjs"},"./markdown":{"types":"./dist/markdown.d.mts","default":"./dist/markdown.mjs"},"./render":{"types":"./dist/render.d.mts","default":"./dist/render.mjs"},"./processor":{"types":"./dist/processor.d.mts","default":"./dist/processor.mjs"},"./types":{"types":"./dist/types.d.mts","default":"./dist/types.mjs"}},"dependencies":{"@standard-schema/spec":"^1.1.0","effect":"^3.21.0","fast-glob":"^3.3.3","gray-matter":"^4.0.3","jiti":"^2.6.1","rehype-stringify":"^10.0.1","remark":"^15.0.1","remark-rehype":"^11.1.2","unified":"^11.0.5","@aero-js/core":"0.4.0","@aero-js/diagnostics":"0.4.0"},"devDependencies":{"@shikijs/rehype":"^4.0.2","@shikijs/transformers":"^4.0.2","@types/hast":"^3.0.4","@types/node":"^25.5.0","arktype":"^2.2.0","tsdown":"^0.21.7","typescript":"^6.0.2","vite":"8.0.3","vitest":"^4.1.2","zod":"^4.3.6"},"peerDependencies":{"arktype":"^2.0.0","vite":"8.0.3","zod":"^4.0.0"},"peerDependenciesMeta":{"vite":{"optional":true},"zod":{"optional":true},"arktype":{"optional":true}},"scripts":{"build":"tsdown src/index.ts src/types.ts src/vite.ts src/markdown.ts src/render.ts src/processor.ts --format esm --dts --clean --out-dir dist","typecheck":"tsc --noEmit","test":"vitest run"},"_id":"@aero-js/content@0.4.0","description":"Content collections for Aero: load Markdown (and other files) with frontmatter, validate with Standard Schema (Zod, ArkType, Valibot, etc.), and render to HTML. Powers the `aero:content` virtual module and optional content plugin.","bugs":{"url":"https://github.com/jamiewilson/aero/issues"},"_integrity":"sha512-pJYmmpCVPvDdZatmfjDxu6waOyV9LnuhZjYP4u9GCJsqRyB1KXzyrR+uD5NEOWemC1AV7wykv/jpPT92q0k3DA==","_resolved":"/private/var/folders/yc/828p39ws2lxgqcb96h4qdbjm0000gn/T/92942ede598b4111402a393f831feb01/aero-js-content-0.4.0.tgz","_from":"file:aero-js-content-0.4.0.tgz","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-pJYmmpCVPvDdZatmfjDxu6waOyV9LnuhZjYP4u9GCJsqRyB1KXzyrR+uD5NEOWemC1AV7wykv/jpPT92q0k3DA==","shasum":"e700390b2d28979457962bed4ea0d9d8d3353702","tarball":"https://registry.npmjs.org/@aero-js/content/-/content-0.4.0.tgz","fileCount":16,"unpackedSize":46863,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDZtAm5Kqnr1aXhmSpkAGTQqypb5K7uug3gSiqLZRdcFAiEAr9Ahrb6SR+VxdD5RnhoPZKXDtfLKJTUyMKVan7Fntp4="}]},"_npmUser":{"name":"jmwlsn","email":"jamie@jamiewilson.io"},"directories":{},"maintainers":[{"name":"jmwlsn","email":"jamie@jamiewilson.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/content_0.4.0_1777591031801_0.7239155937678301"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-06T17:15:28.414Z","modified":"2026-04-30T23:17:12.108Z","0.3.3":"2026-03-06T17:15:28.629Z","0.3.4":"2026-03-16T15:56:27.689Z","0.3.5":"2026-03-18T15:49:36.729Z","0.4.0":"2026-04-30T23:17:11.959Z"},"bugs":{"url":"https://github.com/jamiewilson/aero/issues"},"author":{"name":"Jamie Wilson"},"license":"MIT","homepage":"https://github.com/jamiewilson/aero","repository":{"type":"git","url":"git+https://github.com/jamiewilson/aero.git","directory":"packages/content"},"description":"Content collections for Aero: load Markdown (and other files) with frontmatter, validate with Standard Schema (Zod, ArkType, Valibot, etc.), and render to HTML. Powers the `aero:content` virtual module and optional content plugin.","maintainers":[{"name":"jmwlsn","email":"jamie@jamiewilson.io"}],"readme":"# @aero-js/content\n\nContent collections for Aero: load Markdown (and other files) with frontmatter, validate with Standard Schema (Zod, ArkType, Valibot, etc.), and render to HTML. Powers the `aero:content` virtual module and optional content plugin.\n\n## Exports\n\n| Export                      | Description                                                                                                                                                                                                                                                                    |\n| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| `@aero-js/content`          | `defineCollection`, `defineConfig`, `render`, `loadAllCollections`, `loadContentConfigFileSync`, `contentSchemaIssuesToAeroDiagnostics`, content error helpers; types `ContentDocument`, `ContentMeta`, `ContentCollectionConfig`, `ContentConfig`, `LoadContentConfigResult`. |\n| `@aero-js/content/vite`     | `aeroContent(options?)` Vite plugin.                                                                                                                                                                                                                                           |\n| `@aero-js/content/markdown` | Markdown/remark utilities (used internally).                                                                                                                                                                                                                                   |\n| `@aero-js/content/render`   | `render(doc)` for markdown-to-HTML.                                                                                                                                                                                                                                            |\n| `@aero-js/content/types`    | TypeScript types.                                                                                                                                                                                                                                                              |\n\n## Usage in apps\n\nEnable content in `aero.config.ts` (`content: true` or `content: { config: 'content.config.ts' }`), then define collections in **content.config.ts** and import from `aero:content` in templates.\n\n**content.config.ts** (Zod example)\n\n```ts\nimport { defineConfig, defineCollection } from '@aero-js/content'\nimport { z } from 'zod'\n\nconst docs = defineCollection({\n\tname: 'docs',\n\tdirectory: 'content/docs',\n\tinclude: '**/*.md',\n\tschema: z.object({ title: z.string(), published: z.boolean().optional() }),\n\ttransform: async doc => ({\n\t\t...doc,\n\t\tdata: { ...doc.data, slug: doc._meta.slug },\n\t}),\n})\n\nexport default defineConfig({ collections: [docs] })\n```\n\nThe `schema` option accepts any [Standard Schema](https://standardschema.dev)-compliant validator. For example, with ArkType:\n\n```ts\nimport { defineConfig, defineCollection } from '@aero-js/content'\nimport { type } from 'arktype'\n\nconst docs = defineCollection({\n\tname: 'docs',\n\tdirectory: 'content/docs',\n\tinclude: '**/*.md',\n\tschema: type({\n\t\ttitle: 'string',\n\t\t'published?': 'boolean',\n\t}),\n})\n```\n\n**In a page (e.g. getStaticPaths + render)**\n\n```html\n<script is:build>\n\timport { getCollection, render } from 'aero:content'\n\n\texport async function getStaticPaths() {\n\t\tconst docs = await getCollection('docs')\n\t\treturn docs.map((doc) => ({ params: { slug: doc._meta.slug }, props: doc }))\n\t}\n\n\tconst doc = Aero.props\n\tconst { html } = await render(doc)\n</script>\n<article data-for=\"{ const doc of [doc] }\">\n\t<h1>{ doc.data.title }</h1>\n\t<div>{ html }</div>\n</article>\n```\n\n## API (from `aero:content`)\n\n- **getCollection(name, filterFn?)** — Returns a promise of documents for the named collection. In production, only documents with `data.published === true` are returned unless overridden. Optional `filterFn(doc)` can filter further.\n- **render(doc)** — Renders a content document’s markdown body to HTML. Returns `{ html: string }`. Use with a document from `getCollection` or props.\n\n## Content document shape\n\nEach document has:\n\n- **id** — Collection-relative path without extension.\n- **data** — Validated frontmatter (from schema).\n- **body** — Raw markdown (after frontmatter).\n- **\\_meta** — `{ path, slug, filename, extension }`.\n\n## Vite plugin\n\n`aeroContent(options?)` resolves the virtual module `aero:content` (and `aero:content/...`) with serialized collections, `getCollection`, and `render`. It loads `content.config.ts` at config resolve/build start and watches collection directories for HMR. On file changes, `handleHotUpdate` returns affected module nodes (including the virtual `aero:content` module) so Vite propagates updates without always forcing a full page reload. Options: `config` (path to config file, default `content.config.ts`).\n\n## File structure\n\n- `src/loader.ts` — Load collections, serialize to virtual module source.\n- `src/markdown.ts` — Parse Markdown and frontmatter (gray-matter, remark).\n- `src/render.ts` — Lazy markdown-to-HTML (remark).\n- `src/types.ts` — `defineCollection`, `defineConfig`, types.\n- `src/vite.ts` — Vite plugin.\n\n## Tests\n\nVitest in `packages/content`: loader, markdown, render, Vite plugin. Run from repo root: `pnpm test`.\n","readmeFilename":"README.md"}