File tree Expand file tree Collapse file tree
website/public/registry/theme/colors Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -79,6 +79,8 @@ const resolveRecipe = async (fileName: string) => {
7979const generateColors = async ( ) => {
8080 const glob = new Glob ( './packages/preset/src/colors/*.ts' )
8181
82+ const index : { id : string } [ ] = [ ]
83+
8284 for await ( const path of glob . scan ( '.' ) ) {
8385 const file = Bun . file ( path )
8486 if ( ! file . name ) continue
@@ -95,6 +97,10 @@ const generateColors = async () => {
9597 } ,
9698 ]
9799
100+ index . push ( {
101+ id,
102+ } )
103+
98104 Bun . write (
99105 `./website/public/registry/theme/colors/${ id } .json` ,
100106 JSON . stringify (
@@ -129,6 +135,15 @@ const generateColors = async () => {
129135 ) ,
130136 )
131137 }
138+
139+ Bun . write (
140+ `./website/public/registry/theme/colors/index.json` ,
141+ JSON . stringify (
142+ index . sort ( ( a , b ) => a . id . localeCompare ( b . id ) ) ,
143+ null ,
144+ 2 ,
145+ ) ,
146+ )
132147}
133148
134149const main = async ( ) => {
Original file line number Diff line number Diff line change 1+ [
2+ {
3+ "id" : " amber"
4+ },
5+ {
6+ "id" : " blue"
7+ },
8+ {
9+ "id" : " bronze"
10+ },
11+ {
12+ "id" : " brown"
13+ },
14+ {
15+ "id" : " crimson"
16+ },
17+ {
18+ "id" : " cyan"
19+ },
20+ {
21+ "id" : " gold"
22+ },
23+ {
24+ "id" : " grass"
25+ },
26+ {
27+ "id" : " green"
28+ },
29+ {
30+ "id" : " indigo"
31+ },
32+ {
33+ "id" : " iris"
34+ },
35+ {
36+ "id" : " jade"
37+ },
38+ {
39+ "id" : " lime"
40+ },
41+ {
42+ "id" : " mauve"
43+ },
44+ {
45+ "id" : " mint"
46+ },
47+ {
48+ "id" : " neutral"
49+ },
50+ {
51+ "id" : " olive"
52+ },
53+ {
54+ "id" : " orange"
55+ },
56+ {
57+ "id" : " pink"
58+ },
59+ {
60+ "id" : " plum"
61+ },
62+ {
63+ "id" : " purple"
64+ },
65+ {
66+ "id" : " red"
67+ },
68+ {
69+ "id" : " ruby"
70+ },
71+ {
72+ "id" : " sage"
73+ },
74+ {
75+ "id" : " sand"
76+ },
77+ {
78+ "id" : " sky"
79+ },
80+ {
81+ "id" : " slate"
82+ },
83+ {
84+ "id" : " teal"
85+ },
86+ {
87+ "id" : " tomato"
88+ },
89+ {
90+ "id" : " violet"
91+ },
92+ {
93+ "id" : " yellow"
94+ }
95+ ]
You can’t perform that action at this time.
0 commit comments