Files
OneOS1.2/vite-plugins/utils/entriesManifest.ts
王冕 7ef8852919 Initial commit: OneOS prototype workspace baseline.
Include weekly report and other prototype sources with project tooling config.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 15:36:52 +08:00

56 lines
1.6 KiB
TypeScript

import {
getEntriesPath as getEntriesPathCore,
migrateLegacyEntries as migrateLegacyEntriesCore,
readEntriesManifest as readEntriesManifestCore,
scanProjectEntries as scanProjectEntriesCore,
toCompatMaps as toCompatMapsCore,
writeEntriesManifestAtomic as writeEntriesManifestAtomicCore,
} from './entriesManifestCore.js';
export type EntryGroup = 'components' | 'prototypes' | 'themes';
export interface EntriesManifestItem {
group: string;
name: string;
js: string;
html: string;
}
export interface EntriesManifestV2 {
schemaVersion: 2;
generatedAt: string;
items: Record<string, EntriesManifestItem>;
js: Record<string, string>;
html: Record<string, string>;
}
export function toCompatMaps(items: Record<string, EntriesManifestItem>): {
js: Record<string, string>;
html: Record<string, string>;
} {
return toCompatMapsCore(items);
}
export function scanProjectEntries(
projectRoot: string,
groups: EntryGroup[] = ['components', 'prototypes', 'themes'],
): EntriesManifestV2 {
return scanProjectEntriesCore(projectRoot, groups);
}
export function migrateLegacyEntries(raw: unknown, projectRoot: string): EntriesManifestV2 {
return migrateLegacyEntriesCore(raw, projectRoot);
}
export function writeEntriesManifestAtomic(projectRoot: string, manifest: EntriesManifestV2): EntriesManifestV2 {
return writeEntriesManifestAtomicCore(projectRoot, manifest);
}
export function readEntriesManifest(projectRoot: string): EntriesManifestV2 {
return readEntriesManifestCore(projectRoot);
}
export function getEntriesPath(projectRoot: string): string {
return getEntriesPathCore(projectRoot);
}