blodemd 0.0.15 → 0.2.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 +26 -1
- package/dist/cli.mjs +217 -217
- package/dist/cli.mjs.map +1 -1
- package/package.json +3 -36
- package/dev-server/app/[[...slug]]/page.tsx +0 -140
- package/dev-server/app/blodemd-dev/invalidate/route.ts +0 -12
- package/dev-server/app/blodemd-dev/static/[...path]/route.ts +0 -32
- package/dev-server/app/blodemd-dev/version/route.ts +0 -14
- package/dev-server/app/blodemd-internal/proxy/route.ts +0 -86
- package/dev-server/app/error.tsx +0 -24
- package/dev-server/app/favicon.ico +0 -0
- package/dev-server/app/globals.css +0 -4
- package/dev-server/app/layout.tsx +0 -38
- package/dev-server/app/not-found.tsx +0 -18
- package/dev-server/app/search/route.ts +0 -17
- package/dev-server/components/dev-reload-script.tsx +0 -86
- package/dev-server/components/providers.tsx +0 -15
- package/dev-server/lib/dev-state.ts +0 -8
- package/dev-server/lib/local-content-source.ts +0 -103
- package/dev-server/lib/local-runtime.tsx +0 -555
- package/dev-server/next-env.d.ts +0 -5
- package/dev-server/next.config.js +0 -54
- package/dev-server/package.json +0 -61
- package/dev-server/postcss.config.mjs +0 -7
- package/dev-server/public/glide-variable.woff2 +0 -0
- package/dev-server/tsconfig.json +0 -50
- package/docs/app/globals.css +0 -471
- package/docs/components/animate-ui/primitives/buttons/button.tsx +0 -14
- package/docs/components/api/api-playground.tsx +0 -467
- package/docs/components/api/api-reference.tsx +0 -157
- package/docs/components/content/collection-index.tsx +0 -114
- package/docs/components/docs/contextual-menu.tsx +0 -495
- package/docs/components/docs/copy-page-menu.tsx +0 -364
- package/docs/components/docs/doc-header.tsx +0 -223
- package/docs/components/docs/doc-shell.tsx +0 -355
- package/docs/components/docs/doc-sidebar.tsx +0 -256
- package/docs/components/docs/doc-toc.tsx +0 -46
- package/docs/components/docs/mobile-nav.tsx +0 -195
- package/docs/components/docs/sidebar-active-highlight.tsx +0 -34
- package/docs/components/docs/sidebar-scroll-area.tsx +0 -63
- package/docs/components/git/repo-picker.tsx +0 -529
- package/docs/components/icons/doc-icon.tsx +0 -96
- package/docs/components/mdx/accordion.tsx +0 -83
- package/docs/components/mdx/agent-instructions.tsx +0 -17
- package/docs/components/mdx/badge.tsx +0 -79
- package/docs/components/mdx/callout.tsx +0 -88
- package/docs/components/mdx/card.tsx +0 -110
- package/docs/components/mdx/code-block.tsx +0 -80
- package/docs/components/mdx/code-group.tsx +0 -203
- package/docs/components/mdx/color.tsx +0 -87
- package/docs/components/mdx/columns.tsx +0 -25
- package/docs/components/mdx/expandable.tsx +0 -45
- package/docs/components/mdx/field-layout.tsx +0 -77
- package/docs/components/mdx/frame.tsx +0 -23
- package/docs/components/mdx/get-text-content.ts +0 -18
- package/docs/components/mdx/icon.tsx +0 -12
- package/docs/components/mdx/iframe.tsx +0 -62
- package/docs/components/mdx/index.tsx +0 -121
- package/docs/components/mdx/installer.tsx +0 -20
- package/docs/components/mdx/panel.tsx +0 -11
- package/docs/components/mdx/param-field.tsx +0 -56
- package/docs/components/mdx/preview.tsx +0 -36
- package/docs/components/mdx/prompt.tsx +0 -63
- package/docs/components/mdx/request-example.tsx +0 -27
- package/docs/components/mdx/response-field.tsx +0 -42
- package/docs/components/mdx/steps.tsx +0 -92
- package/docs/components/mdx/tabs.tsx +0 -193
- package/docs/components/mdx/tile.tsx +0 -43
- package/docs/components/mdx/tooltip.tsx +0 -71
- package/docs/components/mdx/tree.tsx +0 -120
- package/docs/components/mdx/type-table.tsx +0 -71
- package/docs/components/mdx/update.tsx +0 -44
- package/docs/components/mdx/video.tsx +0 -45
- package/docs/components/mdx/view.tsx +0 -66
- package/docs/components/posthog-provider.tsx +0 -42
- package/docs/components/providers.tsx +0 -15
- package/docs/components/tenant-analytics.tsx +0 -49
- package/docs/components/third-parties.tsx +0 -32
- package/docs/components/ui/badge.tsx +0 -61
- package/docs/components/ui/breadcrumb.tsx +0 -112
- package/docs/components/ui/button-group.tsx +0 -83
- package/docs/components/ui/button.tsx +0 -65
- package/docs/components/ui/card.tsx +0 -92
- package/docs/components/ui/command.tsx +0 -167
- package/docs/components/ui/copy-button.tsx +0 -129
- package/docs/components/ui/dialog.tsx +0 -146
- package/docs/components/ui/field.tsx +0 -237
- package/docs/components/ui/input.tsx +0 -23
- package/docs/components/ui/kbd.tsx +0 -98
- package/docs/components/ui/label.tsx +0 -22
- package/docs/components/ui/morph-icon.tsx +0 -79
- package/docs/components/ui/popover.tsx +0 -267
- package/docs/components/ui/search-dialog.tsx +0 -431
- package/docs/components/ui/search.tsx +0 -101
- package/docs/components/ui/separator.tsx +0 -26
- package/docs/components/ui/sheet.tsx +0 -133
- package/docs/components/ui/sidebar.tsx +0 -758
- package/docs/components/ui/skeleton.tsx +0 -11
- package/docs/components/ui/switch.tsx +0 -32
- package/docs/components/ui/tabs.tsx +0 -138
- package/docs/components/ui/theme-toggle.tsx +0 -62
- package/docs/components/ui/tooltip.tsx +0 -53
- package/docs/components/web-mcp.tsx +0 -115
- package/docs/lib/agent-skills.ts +0 -48
- package/docs/lib/api-client.ts +0 -72
- package/docs/lib/config.ts +0 -6
- package/docs/lib/content-root.ts +0 -33
- package/docs/lib/content-source.ts +0 -70
- package/docs/lib/contextual-options.ts +0 -222
- package/docs/lib/dashboard-session.ts +0 -167
- package/docs/lib/db.ts +0 -13
- package/docs/lib/docs-collection.ts +0 -7
- package/docs/lib/docs-runtime.tsx +0 -745
- package/docs/lib/edge-config.ts +0 -95
- package/docs/lib/env.ts +0 -23
- package/docs/lib/etag.ts +0 -22
- package/docs/lib/github-install.ts +0 -33
- package/docs/lib/llms-full.ts +0 -82
- package/docs/lib/marketing-markdown.ts +0 -79
- package/docs/lib/marketing-site.ts +0 -31
- package/docs/lib/mdx.ts +0 -98
- package/docs/lib/navigation.ts +0 -288
- package/docs/lib/openapi-proxy.ts +0 -88
- package/docs/lib/openapi.ts +0 -158
- package/docs/lib/platform-config.ts +0 -6
- package/docs/lib/project-authz.ts +0 -46
- package/docs/lib/routes.ts +0 -103
- package/docs/lib/server-cache.ts +0 -83
- package/docs/lib/shiki.ts +0 -44
- package/docs/lib/supabase.ts +0 -37
- package/docs/lib/tenancy.ts +0 -364
- package/docs/lib/tenant-headers.ts +0 -43
- package/docs/lib/tenant-static.ts +0 -705
- package/docs/lib/tenant-utility-context.ts +0 -62
- package/docs/lib/tenants.ts +0 -72
- package/docs/lib/theme.ts +0 -29
- package/docs/lib/time-ago.ts +0 -24
- package/docs/lib/toc.ts +0 -2
- package/docs/lib/use-mobile.ts +0 -19
- package/docs/lib/use-tab-observer.ts +0 -71
- package/docs/lib/utils.ts +0 -5
- package/packages/@repo/common/dist/index.d.ts +0 -16
- package/packages/@repo/common/dist/index.d.ts.map +0 -1
- package/packages/@repo/common/dist/index.js +0 -84
- package/packages/@repo/common/package.json +0 -34
- package/packages/@repo/common/src/index.ts +0 -101
- package/packages/@repo/contracts/dist/analytics.d.ts +0 -21
- package/packages/@repo/contracts/dist/analytics.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/analytics.js +0 -18
- package/packages/@repo/contracts/dist/dates.d.ts +0 -4
- package/packages/@repo/contracts/dist/dates.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/dates.js +0 -2
- package/packages/@repo/contracts/dist/deployment.d.ts +0 -71
- package/packages/@repo/contracts/dist/deployment.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/deployment.js +0 -46
- package/packages/@repo/contracts/dist/domain.d.ts +0 -94
- package/packages/@repo/contracts/dist/domain.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/domain.js +0 -36
- package/packages/@repo/contracts/dist/git.d.ts +0 -28
- package/packages/@repo/contracts/dist/git.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/git.js +0 -24
- package/packages/@repo/contracts/dist/ids.d.ts +0 -14
- package/packages/@repo/contracts/dist/ids.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/ids.js +0 -11
- package/packages/@repo/contracts/dist/index.d.ts +0 -11
- package/packages/@repo/contracts/dist/index.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/index.js +0 -12
- package/packages/@repo/contracts/dist/pagination.d.ts +0 -23
- package/packages/@repo/contracts/dist/pagination.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/pagination.js +0 -15
- package/packages/@repo/contracts/dist/project.d.ts +0 -42
- package/packages/@repo/contracts/dist/project.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/project.js +0 -25
- package/packages/@repo/contracts/dist/tenant.d.ts +0 -147
- package/packages/@repo/contracts/dist/tenant.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/tenant.js +0 -58
- package/packages/@repo/contracts/dist/user.d.ts +0 -9
- package/packages/@repo/contracts/dist/user.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/user.js +0 -9
- package/packages/@repo/contracts/package.json +0 -37
- package/packages/@repo/contracts/src/analytics.ts +0 -33
- package/packages/@repo/contracts/src/dates.ts +0 -4
- package/packages/@repo/contracts/src/deployment.ts +0 -73
- package/packages/@repo/contracts/src/domain.ts +0 -51
- package/packages/@repo/contracts/src/git.ts +0 -31
- package/packages/@repo/contracts/src/ids.ts +0 -23
- package/packages/@repo/contracts/src/index.ts +0 -12
- package/packages/@repo/contracts/src/pagination.ts +0 -21
- package/packages/@repo/contracts/src/project.ts +0 -32
- package/packages/@repo/contracts/src/tenant.ts +0 -94
- package/packages/@repo/contracts/src/user.ts +0 -12
- package/packages/@repo/models/dist/docs-config.d.ts +0 -961
- package/packages/@repo/models/dist/docs-config.d.ts.map +0 -1
- package/packages/@repo/models/dist/docs-config.js +0 -531
- package/packages/@repo/models/dist/index.d.ts +0 -3
- package/packages/@repo/models/dist/index.d.ts.map +0 -1
- package/packages/@repo/models/dist/index.js +0 -3
- package/packages/@repo/models/dist/tenant.d.ts +0 -37
- package/packages/@repo/models/dist/tenant.d.ts.map +0 -1
- package/packages/@repo/models/dist/tenant.js +0 -1
- package/packages/@repo/models/package.json +0 -37
- package/packages/@repo/models/src/docs-config.ts +0 -629
- package/packages/@repo/models/src/index.ts +0 -3
- package/packages/@repo/models/src/tenant.ts +0 -44
- package/packages/@repo/prebuild/dist/index.d.ts +0 -2
- package/packages/@repo/prebuild/dist/index.d.ts.map +0 -1
- package/packages/@repo/prebuild/dist/index.js +0 -2
- package/packages/@repo/prebuild/dist/openapi.d.ts +0 -43
- package/packages/@repo/prebuild/dist/openapi.d.ts.map +0 -1
- package/packages/@repo/prebuild/dist/openapi.js +0 -86
- package/packages/@repo/prebuild/package.json +0 -39
- package/packages/@repo/prebuild/src/index.ts +0 -2
- package/packages/@repo/prebuild/src/openapi.ts +0 -154
- package/packages/@repo/previewing/dist/blob-source.d.ts +0 -16
- package/packages/@repo/previewing/dist/blob-source.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/blob-source.js +0 -128
- package/packages/@repo/previewing/dist/config-loader.d.ts +0 -134
- package/packages/@repo/previewing/dist/config-loader.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/config-loader.js +0 -231
- package/packages/@repo/previewing/dist/constants.d.ts +0 -15
- package/packages/@repo/previewing/dist/constants.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/constants.js +0 -14
- package/packages/@repo/previewing/dist/content-index.d.ts +0 -7
- package/packages/@repo/previewing/dist/content-index.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/content-index.js +0 -291
- package/packages/@repo/previewing/dist/content-source.d.ts +0 -12
- package/packages/@repo/previewing/dist/content-source.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/content-source.js +0 -1
- package/packages/@repo/previewing/dist/fs-source.d.ts +0 -11
- package/packages/@repo/previewing/dist/fs-source.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/fs-source.js +0 -71
- package/packages/@repo/previewing/dist/index.d.ts +0 -16
- package/packages/@repo/previewing/dist/index.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/index.js +0 -13
- package/packages/@repo/previewing/dist/markdown/agent-markdown.d.ts +0 -3
- package/packages/@repo/previewing/dist/markdown/agent-markdown.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/markdown/agent-markdown.js +0 -176
- package/packages/@repo/previewing/dist/markdown/format.d.ts +0 -8
- package/packages/@repo/previewing/dist/markdown/format.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/markdown/format.js +0 -43
- package/packages/@repo/previewing/dist/markdown/links.d.ts +0 -3
- package/packages/@repo/previewing/dist/markdown/links.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/markdown/links.js +0 -31
- package/packages/@repo/previewing/dist/openapi-pages.d.ts +0 -7
- package/packages/@repo/previewing/dist/openapi-pages.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/openapi-pages.js +0 -200
- package/packages/@repo/previewing/dist/search-index.d.ts +0 -4
- package/packages/@repo/previewing/dist/search-index.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/search-index.js +0 -23
- package/packages/@repo/previewing/dist/serialization.d.ts +0 -13
- package/packages/@repo/previewing/dist/serialization.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/serialization.js +0 -108
- package/packages/@repo/previewing/dist/toc-index.d.ts +0 -5
- package/packages/@repo/previewing/dist/toc-index.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/toc-index.js +0 -53
- package/packages/@repo/previewing/dist/types.d.ts +0 -92
- package/packages/@repo/previewing/dist/types.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/types.js +0 -1
- package/packages/@repo/previewing/dist/utility-index.d.ts +0 -7
- package/packages/@repo/previewing/dist/utility-index.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/utility-index.js +0 -201
- package/packages/@repo/previewing/package.json +0 -41
- package/packages/@repo/previewing/src/blob-source.ts +0 -185
- package/packages/@repo/previewing/src/config-loader.ts +0 -316
- package/packages/@repo/previewing/src/constants.ts +0 -16
- package/packages/@repo/previewing/src/content-index.ts +0 -384
- package/packages/@repo/previewing/src/content-source.ts +0 -12
- package/packages/@repo/previewing/src/fs-source.ts +0 -103
- package/packages/@repo/previewing/src/index.ts +0 -71
- package/packages/@repo/previewing/src/markdown/agent-markdown.ts +0 -254
- package/packages/@repo/previewing/src/markdown/format.ts +0 -63
- package/packages/@repo/previewing/src/markdown/links.ts +0 -46
- package/packages/@repo/previewing/src/openapi-pages.ts +0 -319
- package/packages/@repo/previewing/src/search-index.ts +0 -38
- package/packages/@repo/previewing/src/serialization.ts +0 -191
- package/packages/@repo/previewing/src/toc-index.ts +0 -72
- package/packages/@repo/previewing/src/types.ts +0 -105
- package/packages/@repo/previewing/src/utility-index.ts +0 -304
- package/packages/@repo/validation/dist/index.d.ts +0 -12
- package/packages/@repo/validation/dist/index.d.ts.map +0 -1
- package/packages/@repo/validation/dist/index.js +0 -30
- package/packages/@repo/validation/package.json +0 -38
- package/packages/@repo/validation/src/blodemd-docs-schema.json +0 -3575
- package/packages/@repo/validation/src/index.ts +0 -59
- package/scripts/prepare-package.mjs +0 -53
- package/scripts/repo-packages.mjs +0 -8
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { PREBUILT_INDEX_PATH, PREBUILT_OPENAPI_INDEX_PATH, PREBUILT_SEARCH_INDEX_PATH, PREBUILT_TOC_INDEX_PATH, PREBUILT_UTILITY_INDEX_PATH, } from "./constants.js";
|
|
2
|
-
export const serializeContentIndex = (index) => JSON.stringify({
|
|
3
|
-
collections: Object.fromEntries(index.byCollection),
|
|
4
|
-
entries: index.entries,
|
|
5
|
-
version: 1,
|
|
6
|
-
});
|
|
7
|
-
export const serializeOpenApiIndex = (entries) => JSON.stringify({
|
|
8
|
-
entries,
|
|
9
|
-
version: 1,
|
|
10
|
-
});
|
|
11
|
-
export const loadPrebuiltContentIndex = async (source) => {
|
|
12
|
-
try {
|
|
13
|
-
const raw = await source.readFile(PREBUILT_INDEX_PATH);
|
|
14
|
-
const data = JSON.parse(raw);
|
|
15
|
-
if (data.version !== 1 || !Array.isArray(data.entries)) {
|
|
16
|
-
return null;
|
|
17
|
-
}
|
|
18
|
-
const bySlug = new Map();
|
|
19
|
-
const byCollection = new Map();
|
|
20
|
-
for (const entry of data.entries) {
|
|
21
|
-
bySlug.set(entry.slug, entry);
|
|
22
|
-
}
|
|
23
|
-
for (const [collectionId, entries] of Object.entries(data.collections ?? {})) {
|
|
24
|
-
byCollection.set(collectionId, entries);
|
|
25
|
-
}
|
|
26
|
-
return {
|
|
27
|
-
byCollection,
|
|
28
|
-
bySlug,
|
|
29
|
-
entries: data.entries,
|
|
30
|
-
errors: [],
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
catch {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
export const loadPrebuiltOpenApiIndex = async (source) => {
|
|
38
|
-
try {
|
|
39
|
-
const raw = await source.readFile(PREBUILT_OPENAPI_INDEX_PATH);
|
|
40
|
-
const data = JSON.parse(raw);
|
|
41
|
-
if (data.version !== 1 || !Array.isArray(data.entries)) {
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
return data.entries;
|
|
45
|
-
}
|
|
46
|
-
catch {
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
export const serializeSearchIndex = (items) => JSON.stringify({
|
|
51
|
-
items,
|
|
52
|
-
version: 1,
|
|
53
|
-
});
|
|
54
|
-
export const loadPrebuiltSearchIndex = async (source) => {
|
|
55
|
-
try {
|
|
56
|
-
const raw = await source.readFile(PREBUILT_SEARCH_INDEX_PATH);
|
|
57
|
-
const data = JSON.parse(raw);
|
|
58
|
-
if (data.version !== 1 || !Array.isArray(data.items)) {
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
return data.items;
|
|
62
|
-
}
|
|
63
|
-
catch {
|
|
64
|
-
return null;
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
export const serializeTocIndex = (itemsBySlug) => JSON.stringify({
|
|
68
|
-
itemsBySlug: Object.fromEntries(itemsBySlug),
|
|
69
|
-
version: 1,
|
|
70
|
-
});
|
|
71
|
-
export const loadPrebuiltTocIndex = async (source) => {
|
|
72
|
-
try {
|
|
73
|
-
const raw = await source.readFile(PREBUILT_TOC_INDEX_PATH);
|
|
74
|
-
const data = JSON.parse(raw);
|
|
75
|
-
if (data.version !== 1 || typeof data.itemsBySlug !== "object") {
|
|
76
|
-
return null;
|
|
77
|
-
}
|
|
78
|
-
return new Map(Object.entries(data.itemsBySlug ?? {}));
|
|
79
|
-
}
|
|
80
|
-
catch {
|
|
81
|
-
return null;
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
export const serializeUtilityIndex = (index) => JSON.stringify({
|
|
85
|
-
...index,
|
|
86
|
-
version: 1,
|
|
87
|
-
});
|
|
88
|
-
export const loadPrebuiltUtilityIndex = async (source) => {
|
|
89
|
-
try {
|
|
90
|
-
const raw = await source.readFile(PREBUILT_UTILITY_INDEX_PATH);
|
|
91
|
-
const data = JSON.parse(raw);
|
|
92
|
-
if (data.version !== 1 ||
|
|
93
|
-
typeof data.name !== "string" ||
|
|
94
|
-
!Array.isArray(data.pages)) {
|
|
95
|
-
return null;
|
|
96
|
-
}
|
|
97
|
-
return {
|
|
98
|
-
description: data.description,
|
|
99
|
-
name: data.name,
|
|
100
|
-
pages: data.pages,
|
|
101
|
-
segments: Array.isArray(data.segments) ? data.segments : undefined,
|
|
102
|
-
slug: data.slug,
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
catch {
|
|
106
|
-
return null;
|
|
107
|
-
}
|
|
108
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { ContentSource } from "./content-source.js";
|
|
2
|
-
import type { ContentIndex, TocItem } from "./types.js";
|
|
3
|
-
export declare const extractToc: (source: string) => TocItem[];
|
|
4
|
-
export declare const buildTocIndex: (index: ContentIndex, source: ContentSource) => Promise<Map<string, TocItem[]>>;
|
|
5
|
-
//# sourceMappingURL=toc-index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"toc-index.d.ts","sourceRoot":"","sources":["../src/toc-index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAMxD,eAAO,MAAM,UAAU,GAAI,QAAQ,MAAM,KAAG,OAAO,EAoClD,CAAC;AAEF,eAAO,MAAM,aAAa,GACxB,OAAO,YAAY,EACnB,QAAQ,aAAa,KACpB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAoBhC,CAAC"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { slugify } from "@repo/common";
|
|
2
|
-
import { NEWLINE_REGEX } from "./constants.js";
|
|
3
|
-
const HEADING_REGEX = /^(#{2,4})\s+(.*)$/;
|
|
4
|
-
// Matches ``` and ~~~ fenced blocks, requiring the same fence to close them.
|
|
5
|
-
const TOC_FENCE_REGEX = /(`{3,}|~{3,})[\s\S]*?\1/g;
|
|
6
|
-
export const extractToc = (source) => {
|
|
7
|
-
const withoutCode = source.replaceAll(TOC_FENCE_REGEX, "");
|
|
8
|
-
const lines = withoutCode.split(NEWLINE_REGEX);
|
|
9
|
-
const toc = [];
|
|
10
|
-
const emitted = new Set();
|
|
11
|
-
for (const line of lines) {
|
|
12
|
-
const match = HEADING_REGEX.exec(line.trim());
|
|
13
|
-
if (!match) {
|
|
14
|
-
continue;
|
|
15
|
-
}
|
|
16
|
-
const [, hashes = "", heading = ""] = match;
|
|
17
|
-
if (!(hashes && heading)) {
|
|
18
|
-
continue;
|
|
19
|
-
}
|
|
20
|
-
const baseId = slugify(heading.trim());
|
|
21
|
-
// Increment until the id is unique among the ids we have already emitted,
|
|
22
|
-
// so a suffixed id never collides with an explicit "foo-1" heading.
|
|
23
|
-
let id = baseId;
|
|
24
|
-
let count = 1;
|
|
25
|
-
while (emitted.has(id)) {
|
|
26
|
-
id = `${baseId}-${count}`;
|
|
27
|
-
count += 1;
|
|
28
|
-
}
|
|
29
|
-
emitted.add(id);
|
|
30
|
-
toc.push({
|
|
31
|
-
id,
|
|
32
|
-
level: hashes.length,
|
|
33
|
-
title: heading.trim(),
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
return toc;
|
|
37
|
-
};
|
|
38
|
-
export const buildTocIndex = async (index, source) => {
|
|
39
|
-
const itemsBySlug = new Map();
|
|
40
|
-
const results = await Promise.all(index.entries.map(async (entry) => {
|
|
41
|
-
if (entry.kind !== "entry") {
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
const rawContent = await source.readFile(entry.relativePath);
|
|
45
|
-
return { slug: entry.slug, toc: extractToc(rawContent) };
|
|
46
|
-
}));
|
|
47
|
-
for (const result of results) {
|
|
48
|
-
if (result) {
|
|
49
|
-
itemsBySlug.set(result.slug, result.toc);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return itemsBySlug;
|
|
53
|
-
};
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import type { ContentType, DocsOpenApiSource, FrontmatterByType, PageMode, SiteConfig } from "@repo/models";
|
|
2
|
-
import type { OpenApiOperation, OpenApiSpec } from "@repo/prebuild";
|
|
3
|
-
export type SiteConfigResult = {
|
|
4
|
-
ok: true;
|
|
5
|
-
config: SiteConfig;
|
|
6
|
-
warnings: string[];
|
|
7
|
-
} | {
|
|
8
|
-
ok: false;
|
|
9
|
-
errors: string[];
|
|
10
|
-
};
|
|
11
|
-
export type ContentEntry = {
|
|
12
|
-
kind: "entry";
|
|
13
|
-
slug: string;
|
|
14
|
-
title: string;
|
|
15
|
-
description?: string;
|
|
16
|
-
hidden?: boolean;
|
|
17
|
-
type: ContentType;
|
|
18
|
-
collectionId: string;
|
|
19
|
-
sourcePath: string;
|
|
20
|
-
relativePath: string;
|
|
21
|
-
frontmatter: FrontmatterByType[ContentType];
|
|
22
|
-
} | {
|
|
23
|
-
kind: "index";
|
|
24
|
-
slug: string;
|
|
25
|
-
title: string;
|
|
26
|
-
description?: string;
|
|
27
|
-
type: ContentType;
|
|
28
|
-
collectionId: string;
|
|
29
|
-
};
|
|
30
|
-
export interface ContentIndex {
|
|
31
|
-
entries: ContentEntry[];
|
|
32
|
-
bySlug: Map<string, ContentEntry>;
|
|
33
|
-
byCollection: Map<string, ContentEntry[]>;
|
|
34
|
-
errors: string[];
|
|
35
|
-
}
|
|
36
|
-
export interface PageMetadata {
|
|
37
|
-
title?: string;
|
|
38
|
-
sidebarTitle?: string;
|
|
39
|
-
icon?: string;
|
|
40
|
-
iconType?: string;
|
|
41
|
-
tag?: string;
|
|
42
|
-
hidden?: boolean;
|
|
43
|
-
deprecated?: boolean;
|
|
44
|
-
url?: string;
|
|
45
|
-
mode?: PageMode;
|
|
46
|
-
noindex?: boolean;
|
|
47
|
-
hideFooterPagination?: boolean;
|
|
48
|
-
hideApiMarker?: boolean;
|
|
49
|
-
keywords?: string[];
|
|
50
|
-
}
|
|
51
|
-
export interface SearchIndexItem {
|
|
52
|
-
href?: string;
|
|
53
|
-
title: string;
|
|
54
|
-
path: string;
|
|
55
|
-
}
|
|
56
|
-
export interface TocItem {
|
|
57
|
-
id: string;
|
|
58
|
-
level: number;
|
|
59
|
-
title: string;
|
|
60
|
-
}
|
|
61
|
-
export interface UtilityPage {
|
|
62
|
-
content: string;
|
|
63
|
-
description?: string;
|
|
64
|
-
slug: string;
|
|
65
|
-
title: string;
|
|
66
|
-
}
|
|
67
|
-
export interface UtilitySegment {
|
|
68
|
-
pageSlugs: string[];
|
|
69
|
-
slug: string;
|
|
70
|
-
title: string;
|
|
71
|
-
}
|
|
72
|
-
export interface UtilityIndex {
|
|
73
|
-
description?: string;
|
|
74
|
-
name: string;
|
|
75
|
-
pages: UtilityPage[];
|
|
76
|
-
segments?: UtilitySegment[];
|
|
77
|
-
slug?: string;
|
|
78
|
-
}
|
|
79
|
-
export interface UtilityArtifact {
|
|
80
|
-
content: string;
|
|
81
|
-
contentType: string;
|
|
82
|
-
path: string;
|
|
83
|
-
}
|
|
84
|
-
export interface PrebuiltOpenApiEntry {
|
|
85
|
-
identifier: string;
|
|
86
|
-
operation: OpenApiOperation;
|
|
87
|
-
slug: string;
|
|
88
|
-
source: DocsOpenApiSource;
|
|
89
|
-
sourceKey: string;
|
|
90
|
-
spec: OpenApiSpec;
|
|
91
|
-
}
|
|
92
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SiteConfig } from "@repo/models";
|
|
2
|
-
import type { ContentSource } from "./content-source.js";
|
|
3
|
-
import type { ContentIndex, UtilityArtifact, UtilityIndex } from "./types.js";
|
|
4
|
-
export declare const buildUtilityIndex: (index: ContentIndex, source: ContentSource, config: SiteConfig) => Promise<UtilityIndex>;
|
|
5
|
-
export declare const getPrebuiltUtilityLlmPagePath: (slug: string) => string;
|
|
6
|
-
export declare const buildUtilityArtifacts: (index: UtilityIndex) => UtilityArtifact[];
|
|
7
|
-
//# sourceMappingURL=utility-index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utility-index.d.ts","sourceRoot":"","sources":["../src/utility-index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAmB/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAWzD,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EACf,YAAY,EAGb,MAAM,YAAY,CAAC;AAoCpB,eAAO,MAAM,iBAAiB,GAC5B,OAAO,YAAY,EACnB,QAAQ,aAAa,EACrB,QAAQ,UAAU,KACjB,OAAO,CAAC,YAAY,CA8CtB,CAAC;AAqBF,eAAO,MAAM,6BAA6B,GAAI,MAAM,MAAM,WAGzD,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAChC,OAAO,YAAY,KAClB,eAAe,EAwJjB,CAAC"}
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
import { normalizePath, slugify } from "@repo/common";
|
|
2
|
-
import { getDocsCollectionWithNavigation, getDocsNavigation, } from "./config-loader.js";
|
|
3
|
-
import { PREBUILT_UTILITY_LLMS_FULL_PATH, PREBUILT_UTILITY_LLMS_PATH, PREBUILT_UTILITY_LLMS_SEGMENT_PREFIX, PREBUILT_UTILITY_SITEMAP_PATH, PREBUILT_UTILITY_SKILLS_INDEX_PATH, PREBUILT_UTILITY_SKILLS_MD_PREFIX, UTILITY_DOCS_ROOT_TOKEN, } from "./constants.js";
|
|
4
|
-
import { buildPageMetadataMap, shouldIncludeSearchEntry, } from "./content-index.js";
|
|
5
|
-
import { prepareLlmsFullContent, toAgentMarkdown, } from "./markdown/agent-markdown.js";
|
|
6
|
-
import { formatMarkdownPage, formatMarkdownPageSection, stripFrontmatter, } from "./markdown/format.js";
|
|
7
|
-
import { buildUtilityOpenApiPages } from "./openapi-pages.js";
|
|
8
|
-
const collectUtilitySegments = (config, pages) => {
|
|
9
|
-
const segments = new Map();
|
|
10
|
-
const addGroup = (group) => {
|
|
11
|
-
if (group.hidden || !group.group) {
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
const pageSlugs = (group.pages ?? []).filter((page) => pages.has(page));
|
|
15
|
-
if (pageSlugs.length === 0) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
const slug = slugify(group.group);
|
|
19
|
-
segments.set(slug, { pageSlugs, slug, title: group.group });
|
|
20
|
-
};
|
|
21
|
-
const navigation = getDocsNavigation(config);
|
|
22
|
-
for (const group of navigation?.groups ?? []) {
|
|
23
|
-
addGroup(group);
|
|
24
|
-
}
|
|
25
|
-
for (const tab of navigation?.tabs ?? []) {
|
|
26
|
-
for (const group of tab.groups ?? []) {
|
|
27
|
-
addGroup(group);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return [...segments.values()];
|
|
31
|
-
};
|
|
32
|
-
export const buildUtilityIndex = async (index, source, config) => {
|
|
33
|
-
const pageMetadataMap = buildPageMetadataMap(index);
|
|
34
|
-
const pages = new Map();
|
|
35
|
-
const contentPages = await Promise.all(index.entries.map(async (entry) => {
|
|
36
|
-
if (entry.kind !== "entry") {
|
|
37
|
-
return null;
|
|
38
|
-
}
|
|
39
|
-
if (!shouldIncludeSearchEntry(entry, pageMetadataMap, config)) {
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
const rawContent = await source.readFile(entry.relativePath);
|
|
43
|
-
return {
|
|
44
|
-
content: stripFrontmatter(rawContent),
|
|
45
|
-
description: entry.description,
|
|
46
|
-
slug: entry.slug,
|
|
47
|
-
title: entry.title,
|
|
48
|
-
};
|
|
49
|
-
}));
|
|
50
|
-
for (const page of contentPages) {
|
|
51
|
-
if (page) {
|
|
52
|
-
pages.set(page.slug, page);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
for (const page of await buildUtilityOpenApiPages(config, getDocsCollectionWithNavigation(config), source)) {
|
|
56
|
-
pages.set(page.slug, page);
|
|
57
|
-
}
|
|
58
|
-
const sortedPages = [...pages.values()];
|
|
59
|
-
// oxlint-disable-next-line eslint-plugin-unicorn/no-array-sort
|
|
60
|
-
sortedPages.sort((left, right) => left.slug.localeCompare(right.slug));
|
|
61
|
-
return {
|
|
62
|
-
description: config.description,
|
|
63
|
-
name: config.name,
|
|
64
|
-
pages: sortedPages,
|
|
65
|
-
segments: collectUtilitySegments(config, pages),
|
|
66
|
-
slug: config.slug,
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
const toUtilityDocPath = (value) => {
|
|
70
|
-
const clean = normalizePath(value);
|
|
71
|
-
if (!clean || clean === "index") {
|
|
72
|
-
return "/";
|
|
73
|
-
}
|
|
74
|
-
return `/${clean}`;
|
|
75
|
-
};
|
|
76
|
-
const toUtilityTemplatedDocUrl = (value) => `${UTILITY_DOCS_ROOT_TOKEN}${toUtilityDocPath(value)}`;
|
|
77
|
-
const toUtilityTemplatedMarkdownDocUrl = (value) => {
|
|
78
|
-
const clean = normalizePath(value);
|
|
79
|
-
if (!clean || clean === "index") {
|
|
80
|
-
return `${UTILITY_DOCS_ROOT_TOKEN}/index.md`;
|
|
81
|
-
}
|
|
82
|
-
return `${UTILITY_DOCS_ROOT_TOKEN}/${clean}.md`;
|
|
83
|
-
};
|
|
84
|
-
export const getPrebuiltUtilityLlmPagePath = (slug) => {
|
|
85
|
-
const normalized = normalizePath(slug);
|
|
86
|
-
return `_utility/llms-pages/${normalized || "index"}.mdx`;
|
|
87
|
-
};
|
|
88
|
-
export const buildUtilityArtifacts = (index) => {
|
|
89
|
-
const segments = index.segments ?? [];
|
|
90
|
-
const segmentLines = segments.length > 0
|
|
91
|
-
? [
|
|
92
|
-
"",
|
|
93
|
-
"## Segments",
|
|
94
|
-
...segments.map((segment) => `- [${segment.title}](${UTILITY_DOCS_ROOT_TOKEN}/llms/${segment.slug}.txt)`),
|
|
95
|
-
]
|
|
96
|
-
: [];
|
|
97
|
-
const llmsLines = [
|
|
98
|
-
`# ${index.name}`,
|
|
99
|
-
index.description ? `> ${index.description}` : null,
|
|
100
|
-
"",
|
|
101
|
-
`Sitemap: ${toUtilityTemplatedDocUrl("sitemap.xml")}`,
|
|
102
|
-
`Full content: ${UTILITY_DOCS_ROOT_TOKEN}/llms-full.txt`,
|
|
103
|
-
`Skills: ${UTILITY_DOCS_ROOT_TOKEN}/.well-known/skills/index.json`,
|
|
104
|
-
...segmentLines,
|
|
105
|
-
"",
|
|
106
|
-
"## Docs",
|
|
107
|
-
...index.pages.map((page) => {
|
|
108
|
-
const description = page.description ? `: ${page.description}` : "";
|
|
109
|
-
return `- [${page.title}](${toUtilityTemplatedMarkdownDocUrl(page.slug)})${description}`;
|
|
110
|
-
}),
|
|
111
|
-
];
|
|
112
|
-
const sitemap = `<?xml version="1.0" encoding="UTF-8"?>
|
|
113
|
-
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
114
|
-
${index.pages
|
|
115
|
-
.map((page) => ` <url><loc>${toUtilityTemplatedDocUrl(page.slug)}</loc></url>`)
|
|
116
|
-
.join("\n")}
|
|
117
|
-
</urlset>`;
|
|
118
|
-
const llmsFull = index.pages
|
|
119
|
-
.map((page) => formatMarkdownPageSection(page.title, toUtilityTemplatedDocUrl(page.slug), prepareLlmsFullContent(page.content, UTILITY_DOCS_ROOT_TOKEN, ""), page.description))
|
|
120
|
-
.join("\n\n");
|
|
121
|
-
const skillSlug = index.slug ?? slugify(index.name);
|
|
122
|
-
const skillDescription = `${index.name} documentation. ${index.description ?? ""}`.trim();
|
|
123
|
-
const skillsIndex = JSON.stringify({
|
|
124
|
-
skills: [
|
|
125
|
-
{
|
|
126
|
-
description: skillDescription,
|
|
127
|
-
files: ["SKILL.md"],
|
|
128
|
-
name: skillSlug,
|
|
129
|
-
},
|
|
130
|
-
],
|
|
131
|
-
}, null, 2);
|
|
132
|
-
const topPages = index.pages.slice(0, 20);
|
|
133
|
-
const skillMdLines = [
|
|
134
|
-
"---",
|
|
135
|
-
`name: ${skillSlug}`,
|
|
136
|
-
`description: ${skillDescription} Use when working with ${index.name}, answering questions about its features, or helping users follow its guides.`,
|
|
137
|
-
"---",
|
|
138
|
-
"",
|
|
139
|
-
`# ${index.name}`,
|
|
140
|
-
"",
|
|
141
|
-
index.description ? `${index.description}\n` : "",
|
|
142
|
-
"## Documentation",
|
|
143
|
-
"",
|
|
144
|
-
`- Full docs index: ${UTILITY_DOCS_ROOT_TOKEN}/llms.txt`,
|
|
145
|
-
`- Complete docs content: ${UTILITY_DOCS_ROOT_TOKEN}/llms-full.txt`,
|
|
146
|
-
"- Append `.md` to any page URL for raw markdown",
|
|
147
|
-
"",
|
|
148
|
-
"## Key Pages",
|
|
149
|
-
"",
|
|
150
|
-
...topPages.map((page) => {
|
|
151
|
-
const desc = page.description ? ` - ${page.description}` : "";
|
|
152
|
-
return `- [${page.title}](${toUtilityTemplatedMarkdownDocUrl(page.slug)})${desc}`;
|
|
153
|
-
}),
|
|
154
|
-
];
|
|
155
|
-
return [
|
|
156
|
-
{
|
|
157
|
-
content: sitemap,
|
|
158
|
-
contentType: "application/xml; charset=utf-8",
|
|
159
|
-
path: PREBUILT_UTILITY_SITEMAP_PATH,
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
content: llmsLines.filter((line) => line !== null).join("\n"),
|
|
163
|
-
contentType: "text/plain; charset=utf-8",
|
|
164
|
-
path: PREBUILT_UTILITY_LLMS_PATH,
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
content: llmsFull,
|
|
168
|
-
contentType: "text/plain; charset=utf-8",
|
|
169
|
-
path: PREBUILT_UTILITY_LLMS_FULL_PATH,
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
content: skillsIndex,
|
|
173
|
-
contentType: "application/json; charset=utf-8",
|
|
174
|
-
path: PREBUILT_UTILITY_SKILLS_INDEX_PATH,
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
content: skillMdLines.filter((line) => line !== null).join("\n"),
|
|
178
|
-
contentType: "text/markdown; charset=utf-8",
|
|
179
|
-
path: `${PREBUILT_UTILITY_SKILLS_MD_PREFIX}${skillSlug}/SKILL.md`,
|
|
180
|
-
},
|
|
181
|
-
...segments.map((segment) => {
|
|
182
|
-
const segmentPages = index.pages.filter((page) => segment.pageSlugs.includes(page.slug));
|
|
183
|
-
const content = [
|
|
184
|
-
`# ${index.name} - ${segment.title}`,
|
|
185
|
-
`> Segment of ${UTILITY_DOCS_ROOT_TOKEN}/llms-full.txt`,
|
|
186
|
-
"",
|
|
187
|
-
...segmentPages.map((page) => formatMarkdownPageSection(page.title, toUtilityTemplatedDocUrl(page.slug), prepareLlmsFullContent(page.content, UTILITY_DOCS_ROOT_TOKEN, ""), page.description)),
|
|
188
|
-
].join("\n\n");
|
|
189
|
-
return {
|
|
190
|
-
content,
|
|
191
|
-
contentType: "text/plain; charset=utf-8",
|
|
192
|
-
path: `${PREBUILT_UTILITY_LLMS_SEGMENT_PREFIX}${segment.slug}.txt`,
|
|
193
|
-
};
|
|
194
|
-
}),
|
|
195
|
-
...index.pages.map((page) => ({
|
|
196
|
-
content: formatMarkdownPage(page.title, toAgentMarkdown(page.content), page.description),
|
|
197
|
-
contentType: "text/markdown; charset=utf-8",
|
|
198
|
-
path: getPrebuiltUtilityLlmPagePath(page.slug),
|
|
199
|
-
})),
|
|
200
|
-
];
|
|
201
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@repo/previewing",
|
|
3
|
-
"version": "0.0.0",
|
|
4
|
-
"private": true,
|
|
5
|
-
"type": "module",
|
|
6
|
-
"exports": {
|
|
7
|
-
".": {
|
|
8
|
-
"types": "./dist/index.d.ts",
|
|
9
|
-
"import": "./dist/index.js",
|
|
10
|
-
"default": "./dist/index.js"
|
|
11
|
-
},
|
|
12
|
-
"./*": {
|
|
13
|
-
"types": "./dist/*.d.ts",
|
|
14
|
-
"import": "./dist/*.js",
|
|
15
|
-
"default": "./dist/*.js"
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
"scripts": {
|
|
19
|
-
"build": "rm -rf dist && tsc",
|
|
20
|
-
"check-types": "tsc --noEmit",
|
|
21
|
-
"lint": "oxlint .",
|
|
22
|
-
"lint:fix": "oxlint --fix .",
|
|
23
|
-
"format": "oxfmt --write .",
|
|
24
|
-
"format:check": "oxfmt ."
|
|
25
|
-
},
|
|
26
|
-
"dependencies": {
|
|
27
|
-
"@repo/common": "*",
|
|
28
|
-
"@repo/models": "*",
|
|
29
|
-
"@repo/prebuild": "*",
|
|
30
|
-
"@repo/validation": "*",
|
|
31
|
-
"yaml": "^2.8.3"
|
|
32
|
-
},
|
|
33
|
-
"devDependencies": {
|
|
34
|
-
"@repo/typescript-config": "*",
|
|
35
|
-
"@types/node": "^24.12.2",
|
|
36
|
-
"oxfmt": "^0.42.0",
|
|
37
|
-
"oxlint": "^1.57.0",
|
|
38
|
-
"typescript": "6.0.2",
|
|
39
|
-
"ultracite": "^7.3.2"
|
|
40
|
-
}
|
|
41
|
-
}
|