UNPKG

@upstart.gg/sdk

Version:

You can test the CLI without recompiling by running:

58 lines (56 loc) 1.51 kB
import { datasourcesList } from "./datasources/types.js"; import { resolvePageAttributes, resolveSiteAttributes, siteAttributesSchema } from "./attributes.js"; import { pageSchema } from "./page.js"; import { datarecordsList } from "./datarecords/types.js"; import { sitePrompt } from "./prompt.js"; import { sitemapSchema } from "./sitemap.js"; import { defaultTheme, themeSchema } from "./theme.js"; import { Type } from "@sinclair/typebox"; //#region src/shared/site.ts const siteSchema = Type.Object({ id: Type.String(), label: Type.String(), hostname: Type.String(), attributes: siteAttributesSchema, datasources: datasourcesList, datarecords: datarecordsList, themes: Type.Array(themeSchema), theme: themeSchema, sitemap: sitemapSchema, sitePrompt }); Type.Object({ site: siteSchema, pages: Type.Array(pageSchema) }); function createEmptyConfig(sitePrompt$1) { return { site: { id: crypto.randomUUID(), label: `My site ${(/* @__PURE__ */ new Date()).toLocaleString(void 0, { dateStyle: "short", timeStyle: "short" })}`, hostname: "example.com", sitePrompt: sitePrompt$1, theme: defaultTheme, themes: [], sitemap: [], attributes: resolveSiteAttributes(), datarecords: [], datasources: [] }, pages: [{ id: "_default_", label: "Untitled", sections: [], attributes: resolvePageAttributes({ path: "/", isInitialPage: true }) }] }; } //#endregion export { createEmptyConfig, siteSchema }; //# sourceMappingURL=site.js.map