-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig.ts
More file actions
28 lines (26 loc) · 780 Bytes
/
config.ts
File metadata and controls
28 lines (26 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { cli, field, object, program } from "configliere";
import z from "zod";
import denoJSON from "./deno.json" with { type: "json" };
const url = () =>
z.string().refine((str) => str.match(/^http/), {
message: `must be a hypertext (http) url`,
});
export const config = program({
name: "staticalize",
version: denoJSON.version,
config: object({
site: {
description:
"URL of the website to staticalize. E.g. http://localhost:8000",
...field(url(), cli.argument()),
},
output: {
description: "Directory to place the downloaded site",
...field(z.string(), field.default("dist")),
},
base: {
description: "Base URL of the public website. E.g. http://frontside.com",
...field(url()),
},
}),
});