@aerobuilt/content 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.
- package/README.md +84 -0
- package/dist/chunk-3IPQCQIC.js +16 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +16 -0
- package/dist/markdown.d.ts +19 -0
- package/dist/markdown.js +11 -0
- package/dist/render.d.ts +21 -0
- package/dist/render.js +6 -0
- package/dist/types-VPBJNne0.d.ts +64 -0
- package/dist/vite.d.ts +16 -0
- package/dist/vite.js +172 -0
- package/package.json +65 -0
package/README.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# @aerobuilt/content
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
## Exports
|
|
6
|
+
|
|
7
|
+
| Export | Description |
|
|
8
|
+
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
9
|
+
| `@aerobuilt/content` | `defineCollection`, `defineConfig`, `render`; types `ContentDocument`, `ContentMeta`, `ContentCollectionConfig`, `ContentConfig`. |
|
|
10
|
+
| `@aerobuilt/content/vite` | `aeroContent(options?)` Vite plugin. |
|
|
11
|
+
| `@aerobuilt/content/markdown` | Markdown/remark utilities (used internally). |
|
|
12
|
+
| `@aerobuilt/content/render` | `render(doc)` for markdown-to-HTML. |
|
|
13
|
+
| `@aerobuilt/content/types` | TypeScript types. |
|
|
14
|
+
|
|
15
|
+
## Usage in apps
|
|
16
|
+
|
|
17
|
+
Enable 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.
|
|
18
|
+
|
|
19
|
+
**content.config.ts**
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { defineConfig, defineCollection } from 'aerobuilt/content'
|
|
23
|
+
import { z } from 'zod'
|
|
24
|
+
|
|
25
|
+
const docs = defineCollection({
|
|
26
|
+
name: 'docs',
|
|
27
|
+
directory: 'content/docs',
|
|
28
|
+
include: '**/*.md',
|
|
29
|
+
schema: z.object({ title: z.string(), published: z.boolean().optional() }),
|
|
30
|
+
transform: async doc => ({ ...doc, data: { ...doc.data, slug: doc._meta.slug } }),
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
export default defineConfig({ collections: [docs] })
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**In a page (e.g. getStaticPaths + render)**
|
|
37
|
+
|
|
38
|
+
```html
|
|
39
|
+
<script is:build>
|
|
40
|
+
import { getCollection, render } from 'aero:content'
|
|
41
|
+
|
|
42
|
+
export async function getStaticPaths() {
|
|
43
|
+
const docs = await getCollection('docs')
|
|
44
|
+
return docs.map((doc) => ({ params: { slug: doc._meta.slug }, props: doc }))
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const doc = aero.props
|
|
48
|
+
const { html } = await render(doc)
|
|
49
|
+
</script>
|
|
50
|
+
<article each="{ doc in [doc] }">
|
|
51
|
+
<h1>{ doc.data.title }</h1>
|
|
52
|
+
<div>{ html }</div>
|
|
53
|
+
</article>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## API (from `aero:content`)
|
|
57
|
+
|
|
58
|
+
- **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.
|
|
59
|
+
- **render(doc)** — Renders a content document’s markdown body to HTML. Returns `{ html: string }`. Use with a document from `getCollection` or props.
|
|
60
|
+
|
|
61
|
+
## Content document shape
|
|
62
|
+
|
|
63
|
+
Each document has:
|
|
64
|
+
|
|
65
|
+
- **id** — Collection-relative path without extension.
|
|
66
|
+
- **data** — Validated frontmatter (from schema).
|
|
67
|
+
- **body** — Raw markdown (after frontmatter).
|
|
68
|
+
- **\_meta** — `{ path, slug, filename, extension }`.
|
|
69
|
+
|
|
70
|
+
## Vite plugin
|
|
71
|
+
|
|
72
|
+
`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. Options: `config` (path to config file, default `content.config.ts`).
|
|
73
|
+
|
|
74
|
+
## File structure
|
|
75
|
+
|
|
76
|
+
- `src/loader.ts` — Load collections, serialize to virtual module source.
|
|
77
|
+
- `src/markdown.ts` — Parse Markdown and frontmatter (gray-matter, remark).
|
|
78
|
+
- `src/render.ts` — Lazy markdown-to-HTML (remark).
|
|
79
|
+
- `src/types.ts` — `defineCollection`, `defineConfig`, types.
|
|
80
|
+
- `src/vite.ts` — Vite plugin.
|
|
81
|
+
|
|
82
|
+
## Tests
|
|
83
|
+
|
|
84
|
+
Vitest in `packages/content`: loader, markdown, render, Vite plugin. Run from repo root: `pnpm test`.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// src/render.ts
|
|
2
|
+
import { remark } from "remark";
|
|
3
|
+
import remarkHtml from "remark-html";
|
|
4
|
+
var processor = remark().use(remarkHtml);
|
|
5
|
+
async function render(doc) {
|
|
6
|
+
if (!doc) {
|
|
7
|
+
console.warn("[aero] render() received null or undefined document. Returning empty HTML.");
|
|
8
|
+
return { html: "" };
|
|
9
|
+
}
|
|
10
|
+
const result = await processor.process(doc.body);
|
|
11
|
+
return { html: String(result) };
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
render
|
|
16
|
+
};
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
render
|
|
3
|
+
} from "./chunk-3IPQCQIC.js";
|
|
4
|
+
|
|
5
|
+
// src/types.ts
|
|
6
|
+
function defineCollection(config) {
|
|
7
|
+
return config;
|
|
8
|
+
}
|
|
9
|
+
function defineConfig(config) {
|
|
10
|
+
return config;
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
defineCollection,
|
|
14
|
+
defineConfig,
|
|
15
|
+
render
|
|
16
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { C as ContentDocument } from './types-VPBJNne0.js';
|
|
2
|
+
import 'zod';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Eager markdown-to-HTML compilation for use in collection transforms.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Uses remark + remark-html. For lazy rendering in pages, use `render()` from `aero:content` instead.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Compile a document's markdown body to HTML. Use in `transform` to attach `html` to each document.
|
|
13
|
+
*
|
|
14
|
+
* @param document - Content document (body is compiled).
|
|
15
|
+
* @returns HTML string.
|
|
16
|
+
*/
|
|
17
|
+
declare function compileMarkdown(document: ContentDocument): Promise<string>;
|
|
18
|
+
|
|
19
|
+
export { compileMarkdown };
|
package/dist/markdown.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// src/markdown.ts
|
|
2
|
+
import { remark } from "remark";
|
|
3
|
+
import remarkHtml from "remark-html";
|
|
4
|
+
var processor = remark().use(remarkHtml);
|
|
5
|
+
async function compileMarkdown(document) {
|
|
6
|
+
const result = await processor.process(document.body);
|
|
7
|
+
return String(result);
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
compileMarkdown
|
|
11
|
+
};
|
package/dist/render.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { C as ContentDocument } from './types-VPBJNne0.js';
|
|
2
|
+
import 'zod';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Lazy markdown-to-HTML for use in pages (import from `aero:content`).
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Uses the same remark pipeline as compileMarkdown. Call from on:build with a document (e.g. from getCollection); returns `{ html }`.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Render a content document's markdown body to HTML. Use in pages with documents from getCollection.
|
|
13
|
+
*
|
|
14
|
+
* @param doc - Content document (or null/undefined; returns empty HTML and logs a warning).
|
|
15
|
+
* @returns `{ html: string }`.
|
|
16
|
+
*/
|
|
17
|
+
declare function render(doc: ContentDocument | null | undefined): Promise<{
|
|
18
|
+
html: string;
|
|
19
|
+
}>;
|
|
20
|
+
|
|
21
|
+
export { render };
|
package/dist/render.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { ZodType } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Content package types: document metadata, collection config, and define helpers.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* Used by the loader (frontmatter + body → ContentDocument), by content.config.ts (defineCollection, defineConfig), and by the Vite plugin.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/** Metadata attached to every content document (path, slug, filename, extension). */
|
|
11
|
+
interface ContentMeta {
|
|
12
|
+
/** Path relative to the collection directory (no extension). */
|
|
13
|
+
path: string;
|
|
14
|
+
/** Slug derived from the filename (no extension). */
|
|
15
|
+
slug: string;
|
|
16
|
+
/** The raw filename including extension. */
|
|
17
|
+
filename: string;
|
|
18
|
+
/** The file extension (e.g. `'.md'`). */
|
|
19
|
+
extension: string;
|
|
20
|
+
}
|
|
21
|
+
/** A content document: id, validated frontmatter (`data`), raw body, and `_meta`. */
|
|
22
|
+
interface ContentDocument<TSchema extends Record<string, any> = Record<string, any>> {
|
|
23
|
+
/** Unique identifier: collection-relative path without extension. */
|
|
24
|
+
id: string;
|
|
25
|
+
/** Validated frontmatter fields. */
|
|
26
|
+
data: TSchema;
|
|
27
|
+
/** Raw body content (everything after frontmatter). */
|
|
28
|
+
body: string;
|
|
29
|
+
/** Auto-generated metadata. */
|
|
30
|
+
_meta: ContentMeta;
|
|
31
|
+
}
|
|
32
|
+
/** Single collection definition: name, directory, glob, optional schema and transform. */
|
|
33
|
+
interface ContentCollectionConfig<TSchema extends Record<string, any> = Record<string, any>, TOutput = ContentDocument<TSchema>> {
|
|
34
|
+
/** Unique collection name (used as the export key, e.g. `allDocs`). */
|
|
35
|
+
name: string;
|
|
36
|
+
/** Directory to scan, relative to project root. */
|
|
37
|
+
directory: string;
|
|
38
|
+
/** Glob pattern for files to include (default: `**\/*.md`). */
|
|
39
|
+
include?: string;
|
|
40
|
+
/** Zod schema for frontmatter validation; `body` is always present. */
|
|
41
|
+
schema?: ZodType<TSchema>;
|
|
42
|
+
/** Optional async transform after validation; receives document, returns final shape. */
|
|
43
|
+
transform?: (document: ContentDocument<TSchema>) => TOutput | Promise<TOutput>;
|
|
44
|
+
}
|
|
45
|
+
/** Top-level content config: array of collection definitions. */
|
|
46
|
+
interface ContentConfig {
|
|
47
|
+
collections: ContentCollectionConfig<any, any>[];
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Define a content collection (typed helper for content.config.ts).
|
|
51
|
+
*
|
|
52
|
+
* @param config - Collection config (name, directory, include, schema, transform).
|
|
53
|
+
* @returns The same config (unchanged).
|
|
54
|
+
*/
|
|
55
|
+
declare function defineCollection<TSchema extends Record<string, any> = Record<string, any>, TOutput = ContentDocument<TSchema>>(config: ContentCollectionConfig<TSchema, TOutput>): ContentCollectionConfig<TSchema, TOutput>;
|
|
56
|
+
/**
|
|
57
|
+
* Define the content config (typed helper for content.config.ts).
|
|
58
|
+
*
|
|
59
|
+
* @param config - Config with `collections` array.
|
|
60
|
+
* @returns The same config (unchanged).
|
|
61
|
+
*/
|
|
62
|
+
declare function defineConfig(config: ContentConfig): ContentConfig;
|
|
63
|
+
|
|
64
|
+
export { type ContentDocument as C, type ContentCollectionConfig as a, type ContentConfig as b, type ContentMeta as c, defineCollection as d, defineConfig as e };
|
package/dist/vite.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
|
|
3
|
+
/** Options for the content plugin (config file path). */
|
|
4
|
+
interface AeroContentOptions {
|
|
5
|
+
/** Path to content config file relative to project root (default: `content.config.ts`). */
|
|
6
|
+
config?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Vite plugin that provides the `aero:content` virtual module (getCollection, render, serialized data).
|
|
10
|
+
*
|
|
11
|
+
* @param options - Optional config file path.
|
|
12
|
+
* @returns Vite plugin.
|
|
13
|
+
*/
|
|
14
|
+
declare function aeroContent(options?: AeroContentOptions): Plugin;
|
|
15
|
+
|
|
16
|
+
export { type AeroContentOptions, aeroContent };
|
package/dist/vite.js
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
// src/loader.ts
|
|
2
|
+
import fg from "fast-glob";
|
|
3
|
+
import matter from "gray-matter";
|
|
4
|
+
import fs from "fs";
|
|
5
|
+
import path from "path";
|
|
6
|
+
async function loadCollection(config, root) {
|
|
7
|
+
const dir = path.resolve(root, config.directory);
|
|
8
|
+
const pattern = config.include || "**/*.md";
|
|
9
|
+
const files = await fg(pattern, { cwd: dir, absolute: true });
|
|
10
|
+
const documents = [];
|
|
11
|
+
for (const file of files) {
|
|
12
|
+
const raw = fs.readFileSync(file, "utf-8");
|
|
13
|
+
const { data: frontmatter, content: body } = matter(raw);
|
|
14
|
+
const relPath = path.relative(dir, file);
|
|
15
|
+
const parsed = path.parse(relPath);
|
|
16
|
+
const id = parsed.dir ? `${parsed.dir}/${parsed.name}` : parsed.name;
|
|
17
|
+
const meta = {
|
|
18
|
+
path: id,
|
|
19
|
+
slug: parsed.name,
|
|
20
|
+
filename: parsed.base,
|
|
21
|
+
extension: parsed.ext
|
|
22
|
+
};
|
|
23
|
+
let validated = frontmatter;
|
|
24
|
+
if (config.schema) {
|
|
25
|
+
const result = config.schema.safeParse(frontmatter);
|
|
26
|
+
if (!result.success) {
|
|
27
|
+
const errors = "error" in result ? result.error?.issues?.map((i) => i.message).join(", ") : "Validation failed";
|
|
28
|
+
console.warn(
|
|
29
|
+
`[aero:content] \u26A0 Skipping "${relPath}" in collection "${config.name}": ${errors}`
|
|
30
|
+
);
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
validated = result.data;
|
|
34
|
+
}
|
|
35
|
+
const doc = {
|
|
36
|
+
id,
|
|
37
|
+
data: validated,
|
|
38
|
+
body,
|
|
39
|
+
_meta: meta
|
|
40
|
+
};
|
|
41
|
+
if (config.transform) {
|
|
42
|
+
documents.push(await config.transform(doc));
|
|
43
|
+
} else {
|
|
44
|
+
documents.push(doc);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return documents;
|
|
48
|
+
}
|
|
49
|
+
async function loadAllCollections(config, root) {
|
|
50
|
+
const result = /* @__PURE__ */ new Map();
|
|
51
|
+
for (const collection of config.collections) {
|
|
52
|
+
const docs = await loadCollection(collection, root);
|
|
53
|
+
result.set(collection.name, docs);
|
|
54
|
+
}
|
|
55
|
+
return result;
|
|
56
|
+
}
|
|
57
|
+
function getWatchedDirs(config, root) {
|
|
58
|
+
return config.collections.map((c) => path.resolve(root, c.directory));
|
|
59
|
+
}
|
|
60
|
+
function serializeContentModule(loaded) {
|
|
61
|
+
const collectionsContent = Array.from(loaded.entries()).map(([name, docs]) => ` ${JSON.stringify(name)}: ${JSON.stringify(docs, null, 2)}`).join(",\n");
|
|
62
|
+
return `
|
|
63
|
+
const __collections = {
|
|
64
|
+
${collectionsContent}
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export function getCollection(name, filterFn) {
|
|
68
|
+
let data = __collections[name];
|
|
69
|
+
if (!data) throw new Error(\`[aero:content] Collection "\${name}" not found. Available: \${Object.keys(__collections).join(", ")}\`);
|
|
70
|
+
|
|
71
|
+
if (import.meta.env.PROD) {
|
|
72
|
+
data = data.filter(item => item.data.published === true);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (typeof filterFn === "function") {
|
|
76
|
+
return data.filter(filterFn);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return data;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export { render } from '@aerobuilt/content/render';
|
|
83
|
+
`;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// src/vite.ts
|
|
87
|
+
import path2 from "path";
|
|
88
|
+
import { pathToFileURL } from "url";
|
|
89
|
+
var CONTENT_MODULE_ID = "aero:content";
|
|
90
|
+
var RESOLVED_CONTENT_MODULE_ID = "\0aero:content";
|
|
91
|
+
var CONFIG_FILE = "content.config.ts";
|
|
92
|
+
function aeroContent(options = {}) {
|
|
93
|
+
let resolvedConfig;
|
|
94
|
+
let contentConfig = null;
|
|
95
|
+
let serialized = null;
|
|
96
|
+
let watchedDirs = [];
|
|
97
|
+
return {
|
|
98
|
+
name: "vite-plugin-aero-content",
|
|
99
|
+
/** Load content.config.ts, set contentConfig and watchedDirs; warn if config missing. */
|
|
100
|
+
async configResolved(config) {
|
|
101
|
+
resolvedConfig = config;
|
|
102
|
+
const root = config.root;
|
|
103
|
+
const configPath = path2.resolve(root, options.config || CONFIG_FILE);
|
|
104
|
+
try {
|
|
105
|
+
const configUrl = pathToFileURL(configPath).href;
|
|
106
|
+
const mod = await import(
|
|
107
|
+
/* @vite-ignore */
|
|
108
|
+
configUrl
|
|
109
|
+
);
|
|
110
|
+
contentConfig = mod.default;
|
|
111
|
+
watchedDirs = getWatchedDirs(contentConfig, root);
|
|
112
|
+
} catch (err) {
|
|
113
|
+
if (err.code === "ERR_MODULE_NOT_FOUND" || err.code === "ENOENT") {
|
|
114
|
+
config.logger.warn(
|
|
115
|
+
`[aero:content] No config found at "${configPath}". Content collections disabled.`
|
|
116
|
+
);
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
throw err;
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
/** Resolve aero:content and aero:content/… to the resolved virtual ID. */
|
|
123
|
+
resolveId(id) {
|
|
124
|
+
if (id === CONTENT_MODULE_ID) {
|
|
125
|
+
return RESOLVED_CONTENT_MODULE_ID;
|
|
126
|
+
}
|
|
127
|
+
if (id.startsWith(CONTENT_MODULE_ID + "/")) {
|
|
128
|
+
return RESOLVED_CONTENT_MODULE_ID;
|
|
129
|
+
}
|
|
130
|
+
return null;
|
|
131
|
+
},
|
|
132
|
+
/** Load virtual module: loadAllCollections, serializeContentModule, return ESM source. */
|
|
133
|
+
async load(id) {
|
|
134
|
+
if (id !== RESOLVED_CONTENT_MODULE_ID) return null;
|
|
135
|
+
if (!contentConfig) {
|
|
136
|
+
return "// aero:content \u2014 no collections configured\n";
|
|
137
|
+
}
|
|
138
|
+
const loaded = await loadAllCollections(contentConfig, resolvedConfig.root);
|
|
139
|
+
serialized = serializeContentModule(loaded);
|
|
140
|
+
return serialized;
|
|
141
|
+
},
|
|
142
|
+
/** Invalidate virtual module and full-reload when a file in a watched content dir changes. */
|
|
143
|
+
handleHotUpdate({ file, server }) {
|
|
144
|
+
const isContent = watchedDirs.some((dir) => file.startsWith(dir));
|
|
145
|
+
if (!isContent) return;
|
|
146
|
+
const mod = server.moduleGraph.getModuleById(RESOLVED_CONTENT_MODULE_ID);
|
|
147
|
+
if (mod) {
|
|
148
|
+
server.moduleGraph.invalidateModule(mod);
|
|
149
|
+
server.hot.send({ type: "full-reload" });
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
/** Fallback: load config in build if not already loaded in configResolved. */
|
|
153
|
+
async buildStart() {
|
|
154
|
+
if (contentConfig) return;
|
|
155
|
+
const root = resolvedConfig.root;
|
|
156
|
+
const configPath = path2.resolve(root, options.config || CONFIG_FILE);
|
|
157
|
+
try {
|
|
158
|
+
const configUrl = pathToFileURL(configPath).href;
|
|
159
|
+
const mod = await import(
|
|
160
|
+
/* @vite-ignore */
|
|
161
|
+
configUrl
|
|
162
|
+
);
|
|
163
|
+
contentConfig = mod.default;
|
|
164
|
+
watchedDirs = getWatchedDirs(contentConfig, root);
|
|
165
|
+
} catch {
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
export {
|
|
171
|
+
aeroContent
|
|
172
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aerobuilt/content",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Jamie Wilson",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/aerobuilt/aero.git",
|
|
10
|
+
"directory": "packages/content"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/aerobuilt/aero",
|
|
13
|
+
"private": false,
|
|
14
|
+
"types": "./dist/types.d.ts",
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/types.d.ts",
|
|
21
|
+
"default": "./dist/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./vite": {
|
|
24
|
+
"types": "./dist/vite.d.ts",
|
|
25
|
+
"default": "./dist/vite.js"
|
|
26
|
+
},
|
|
27
|
+
"./markdown": {
|
|
28
|
+
"types": "./dist/markdown.d.ts",
|
|
29
|
+
"default": "./dist/markdown.js"
|
|
30
|
+
},
|
|
31
|
+
"./render": {
|
|
32
|
+
"types": "./dist/render.d.ts",
|
|
33
|
+
"default": "./dist/render.js"
|
|
34
|
+
},
|
|
35
|
+
"./types": "./dist/types.d.ts"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"fast-glob": "^3.3.3",
|
|
39
|
+
"gray-matter": "^4.0.3",
|
|
40
|
+
"remark": "^15.0.1",
|
|
41
|
+
"remark-html": "^16.0.1"
|
|
42
|
+
},
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"vite": "8.0.0-beta.15",
|
|
45
|
+
"zod": "^4.0.0"
|
|
46
|
+
},
|
|
47
|
+
"peerDependenciesMeta": {
|
|
48
|
+
"zod": {
|
|
49
|
+
"optional": true
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@types/node": "^25.3.0",
|
|
54
|
+
"tsup": "^8.5.1",
|
|
55
|
+
"typescript": "^5.9.3",
|
|
56
|
+
"vite": "8.0.0-beta.15",
|
|
57
|
+
"vitest": "^4.0.18",
|
|
58
|
+
"zod": "^4.3.6"
|
|
59
|
+
},
|
|
60
|
+
"scripts": {
|
|
61
|
+
"build": "tsup src/index.ts src/vite.ts src/markdown.ts src/render.ts --format esm --dts --clean --out-dir dist",
|
|
62
|
+
"typecheck": "tsc --noEmit",
|
|
63
|
+
"test": "vitest run"
|
|
64
|
+
}
|
|
65
|
+
}
|