Skip to content

Commit 043be94

Browse files
authored
fix: build script (#8250)
* fix: registries.json * fix: chart * fix: build script
1 parent 4eb257b commit 043be94

File tree

10 files changed

+4444
-5474
lines changed

10 files changed

+4444
-5474
lines changed

apps/v4/public/r/styles/default/registry.json

Lines changed: 1571 additions & 422 deletions
Large diffs are not rendered by default.

apps/v4/public/r/styles/new-york-v4/registry.json

Lines changed: 414 additions & 1542 deletions
Large diffs are not rendered by default.

apps/v4/public/r/styles/new-york/registry.json

Lines changed: 1571 additions & 422 deletions
Large diffs are not rendered by default.

apps/v4/registry.json

Lines changed: 414 additions & 1542 deletions
Large diffs are not rendered by default.

apps/v4/scripts/build-registry.mts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { exec } from "child_process"
2-
import { promises as fs } from "fs"
2+
import { existsSync, promises as fs } from "fs"
33
import path from "path"
44
import { rimraf } from "rimraf"
55

@@ -94,6 +94,9 @@ async function buildRegistryJsonFile() {
9494
JSON.stringify(fixedRegistry, null, 2)
9595
)
9696

97+
// 3. Format the registry.json file.
98+
await exec(`prettier --write registry.json`)
99+
97100
// 3. Copy the registry.json to the www/public/r/styles/new-york-v4 directory.
98101
await fs.cp(
99102
path.join(process.cwd(), "registry.json"),
@@ -138,6 +141,20 @@ async function syncRegistry() {
138141
// File might not exist yet, that's ok
139142
}
140143

144+
// 0. Copy registries.json from v4 to www before building www registry.
145+
const v4RegistriesPath = path.join(process.cwd(), "public/r/registries.json")
146+
const wwwRegistriesPath = path.resolve(
147+
process.cwd(),
148+
"../www/public/r/registries.json"
149+
)
150+
151+
if (existsSync(v4RegistriesPath)) {
152+
// Ensure the www/public/r directory exists.
153+
await fs.mkdir(path.dirname(wwwRegistriesPath), { recursive: true })
154+
// Copy registries.json to www.
155+
await fs.cp(v4RegistriesPath, wwwRegistriesPath)
156+
}
157+
141158
// 1. Call pnpm registry:build for www.
142159
await exec("pnpm --filter=www registry:build")
143160

@@ -169,6 +186,8 @@ async function buildBlocksIndex() {
169186
path.join(process.cwd(), "registry/__blocks__.json"),
170187
JSON.stringify(payload, null, 2)
171188
)
189+
190+
await exec(`prettier --write registry/__blocks__.json`)
172191
}
173192

174193
try {

apps/www/public/r/registries.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"@aceternity": "https://ui.aceternity.com/registry/{name}.json",
3+
"@ai-elements": "https://registry.ai-sdk.dev/{name}.json",
4+
"@alexcarpenter": "https://ui.alexcarpenter.me/r/{name}.json",
5+
"@alpine": "https://alpine-registry.vercel.app/r/{name}.json",
6+
"@animate-ui": "https://animate-ui.com/r/{name}.json",
7+
"@blocks": "https://blocks.so/r/{name}.json",
8+
"@clerk": "https://clerk.com/r/{name}.json",
9+
"@cult-ui": "https://cult-ui.com/r/{name}.json",
10+
"@kibo-ui": "https://www.kibo-ui.com/r/{name}.json",
11+
"@kokonutui": "https://kokonutui.com/r/{name}.json",
12+
"@magicui": "https://magicui.design/r/{name}.json",
13+
"@motion-primitives": "https://motion-primitives.com/c/{name}.json",
14+
"@originui": "https://originui.com/r/{name}.json",
15+
"@prompt-kit": "https://prompt-kit.com/c/{name}.json",
16+
"@tailark": "https://tailark.com/r/{name}.json",
17+
"@tweakcn": "https://tweakcn.com/r/themes/{name}.json",
18+
"@react-bits": "https://reactbits.dev/r/{name}.json",
19+
"@reui": "https://reui.io/r/{name}.json",
20+
"@heseui": "https://www.heseui.com/r/{name}.json",
21+
"@paceui-ui": "https://ui.paceui.com/r/{name}.json",
22+
"@basecn": "https://basecn.dev/r/{name}.json",
23+
"@ncdai": "https://chanhdai.com/r/{name}.json",
24+
"@8bitcn": "https://8bitcn.com/r/{name}.json",
25+
"@billingsdk": "https://billingsdk.com/r/{name}.json",
26+
"@elements": "https://tryelements.dev/r/{name}.json",
27+
"@nativeui": "https://nativeui.io/registry/{name}.json",
28+
"@smoothui": "https://smoothui.dev/r/{name}.json",
29+
"@formcn": "https://formcn.dev/r/{name}.json",
30+
"@limeplay": "https://limeplay.winoffrg.dev/r/{name}.json",
31+
"@skiper-ui": "https://skiper-ui.com/registry/{name}.json",
32+
"@shadcn-editor": "https://shadcn-editor.vercel.app/r/{name}.json",
33+
"@rigidui": "https://rigidui.com/r/{name}.json",
34+
"@retroui": "https://retroui.dev/r/{name}.json",
35+
"@wds": "https://wds-shadcn-registry.netlify.app/r/{name}.json",
36+
"@97cn": "https://97cn.itzik.co/r/{name}.json"
37+
}

apps/www/public/r/styles/default/chart.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

apps/www/public/r/styles/new-york-v4/chart.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)