forked from Convertiv/handoff-0-6-0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tailwind.ts
45 lines (42 loc) · 1.12 KB
/
tailwind.ts
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import Handoff from "handoff-app";
import { DocumentationObject, HookReturn } from "handoff-app/dist/types";
// To use the hook, uncomment this
(async function () {
try {
const integration = {
name: "tailwind",
version: "3.3",
};
console.log(
`Running Handoff fetch and build for ${integration.name} ${integration.version}`
);
const handoff = new Handoff({
title: "Handoff Bootstrap",
integration,
});
handoff.configureExportables((exportables) => {
exportables.push("components/badge");
return exportables;
});
handoff.postIntegration(
(documentationObject: DocumentationObject, data: HookReturn[]) => {
const colors = documentationObject.design.color.map((color) => {
return {
name: color.name,
value: color.value,
};
});
data.push({
filename: "colors.json",
data: JSON.stringify(colors, null, 2),
});
return data;
}
);
await handoff.fetch();
await handoff.build();
} catch (e) {
console.log(e);
process.exit(0);
}
})();