Skip to content

Commit 24cf9d6

Browse files
committed
[fix] Target File path in Registry configuration
1 parent 755bde1 commit 24cf9d6

File tree

35 files changed

+155
-101
lines changed

35 files changed

+155
-101
lines changed

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,25 @@ A **Pagination Table** & **Scroll List** component suite for [CRUD operation][1]
2828

2929
## Installation
3030

31+
### `components.json`
32+
33+
```json
34+
{
35+
"registries": {
36+
"@mobx-restful-shadcn": "https://mobx-restful-shadcn.idea2.app/r/{name}.json"
37+
}
38+
}
39+
```
40+
41+
### Adding components
42+
3143
```shell
32-
npx shadcn-helper add https://mobx-restful-shadcn.idea2.app/r/rest-table.json
44+
npx shadcn-helper add @mobx-restful-shadcn/rest-table
3345
```
3446

3547
Replace `rest-table` with any component name from the list above.
3648

37-
## Configuration
49+
## Initialization
3850

3951
### Internationalization
4052

@@ -129,7 +141,7 @@ export class RepositoryTable extends Component {
129141
),
130142
},
131143
{ key: "stargazers_count", type: "number", renderHead: "Star Count" },
132-
{ key: "description", renderHead: "Description", rows: 3 },
144+
{ key: "description", renderHead: "Description", contentEditable: true },
133145
];
134146
}
135147

components/example/form.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { GitRepository } from "mobx-github";
22

33
import { i18n, topicStore } from "@/models/example";
4-
import { BadgeBar } from "@/registry/new-york/blocks/badge-bar/badge-bar";
5-
import { Field } from "@/registry/new-york/blocks/rest-form/rest-form";
6-
import { Column } from "@/registry/new-york/blocks/rest-table/rest-table";
7-
import { SearchableInput } from "@/registry/new-york/blocks/searchable-input/searchable-input";
4+
import { BadgeBar } from "@/registry/new-york/blocks/badge-bar";
5+
import { Field } from "@/registry/new-york/blocks/rest-form";
6+
import { Column } from "@/registry/new-york/blocks/rest-table";
7+
import { SearchableInput } from "@/registry/new-york/blocks/searchable-input";
88

99
export const columns: Column<GitRepository>[] = [
1010
{

registry.json

Lines changed: 84 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@
88
"type": "registry:component",
99
"title": "Badge Bar",
1010
"description": "A component for displaying a list of badges with optional click and delete handlers.",
11-
"registryDependencies": ["badge", "@mobx-restful-shadcn/badge-bar"],
11+
"registryDependencies": ["badge"],
1212
"dependencies": ["lucide-react", "web-utility"],
1313
"files": [
1414
{
15-
"path": "registry/new-york/blocks/badge-bar/badge-bar.tsx",
16-
"type": "registry:component"
15+
"type": "registry:component",
16+
"path": "registry/new-york/blocks/badge-bar/index.tsx",
17+
"target": "components/ui/mobx-restful-shadcn/badge-bar/index.tsx"
1718
}
1819
]
1920
},
@@ -26,8 +27,9 @@
2627
"dependencies": ["lucide-react", "mobx-restful", "web-utility"],
2728
"files": [
2829
{
29-
"path": "registry/new-york/blocks/pager/pager.tsx",
30-
"type": "registry:component"
30+
"type": "registry:component",
31+
"path": "registry/new-york/blocks/pager/index.tsx",
32+
"target": "components/ui/mobx-restful-shadcn/pager/index.tsx"
3133
}
3234
]
3335
},
@@ -45,8 +47,9 @@
4547
],
4648
"files": [
4749
{
48-
"path": "registry/new-york/blocks/image-preview/image-preview.tsx",
49-
"type": "registry:component"
50+
"type": "registry:component",
51+
"path": "registry/new-york/blocks/image-preview/index.tsx",
52+
"target": "components/ui/mobx-restful-shadcn/image-preview/index.tsx"
5053
}
5154
]
5255
},
@@ -59,8 +62,9 @@
5962
"dependencies": ["lucide-react"],
6063
"files": [
6164
{
62-
"path": "registry/new-york/blocks/file-preview/file-preview.tsx",
63-
"type": "registry:component"
65+
"type": "registry:component",
66+
"path": "registry/new-york/blocks/file-preview/index.tsx",
67+
"target": "components/ui/mobx-restful-shadcn/file-preview/index.tsx"
6468
}
6569
]
6670
},
@@ -71,8 +75,9 @@
7175
"description": "A component that detects when scroll reaches edges using IntersectionObserver.",
7276
"files": [
7377
{
74-
"path": "registry/new-york/blocks/scroll-boundary/scroll-boundary.tsx",
75-
"type": "registry:component"
78+
"type": "registry:component",
79+
"path": "registry/new-york/blocks/scroll-boundary/index.tsx",
80+
"target": "components/ui/mobx-restful-shadcn/scroll-boundary/index.tsx"
7681
}
7782
]
7883
},
@@ -91,8 +96,9 @@
9196
"registryDependencies": ["@mobx-restful-shadcn/scroll-boundary"],
9297
"files": [
9398
{
94-
"path": "registry/new-york/blocks/scroll-list/scroll-list.tsx",
95-
"type": "registry:component"
99+
"type": "registry:component",
100+
"path": "registry/new-york/blocks/scroll-list/index.tsx",
101+
"target": "components/ui/mobx-restful-shadcn/scroll-list/index.tsx"
96102
}
97103
]
98104
},
@@ -112,8 +118,9 @@
112118
],
113119
"files": [
114120
{
115-
"path": "registry/new-york/blocks/array-field/array-field.tsx",
116-
"type": "registry:component"
121+
"type": "registry:component",
122+
"path": "registry/new-york/blocks/array-field/index.tsx",
123+
"target": "components/ui/mobx-restful-shadcn/array-field/index.tsx"
117124
}
118125
]
119126
},
@@ -126,8 +133,9 @@
126133
"dependencies": ["mobx-react", "mobx-react-helper", "web-utility"],
127134
"files": [
128135
{
129-
"path": "registry/new-york/blocks/badge-input/badge-input.tsx",
130-
"type": "registry:component"
136+
"type": "registry:component",
137+
"path": "registry/new-york/blocks/badge-input/index.tsx",
138+
"target": "components/ui/mobx-restful-shadcn/badge-input/index.tsx"
131139
}
132140
]
133141
},
@@ -139,8 +147,9 @@
139147
"dependencies": ["mobx-react", "mobx-react-helper"],
140148
"files": [
141149
{
142-
"path": "registry/new-york/blocks/range-input/range-input.tsx",
143-
"type": "registry:component"
150+
"type": "registry:component",
151+
"path": "registry/new-york/blocks/range-input/index.tsx",
152+
"target": "components/ui/mobx-restful-shadcn/range-input/index.tsx"
144153
}
145154
]
146155
},
@@ -159,8 +168,9 @@
159168
],
160169
"files": [
161170
{
162-
"path": "registry/new-york/blocks/file-picker/file-picker.tsx",
163-
"type": "registry:component"
171+
"type": "registry:component",
172+
"path": "registry/new-york/blocks/file-picker/index.tsx",
173+
"target": "components/ui/mobx-restful-shadcn/file-picker/index.tsx"
164174
}
165175
]
166176
},
@@ -173,8 +183,9 @@
173183
"dependencies": ["web-utility"],
174184
"files": [
175185
{
176-
"path": "registry/new-york/blocks/form-field/form-field.tsx",
177-
"type": "registry:component"
186+
"type": "registry:component",
187+
"path": "registry/new-york/blocks/form-field/index.tsx",
188+
"target": "components/ui/mobx-restful-shadcn/form-field/index.tsx"
178189
}
179190
]
180191
},
@@ -192,8 +203,9 @@
192203
],
193204
"files": [
194205
{
195-
"path": "registry/new-york/blocks/file-uploader/file-uploader.tsx",
196-
"type": "registry:component"
206+
"type": "registry:component",
207+
"path": "registry/new-york/blocks/file-uploader/index.tsx",
208+
"target": "components/ui/mobx-restful-shadcn/file-uploader/index.tsx"
197209
}
198210
]
199211
},
@@ -205,10 +217,11 @@
205217
"registryDependencies": [
206218
"button",
207219
"label",
208-
"badge-input",
209-
"file-preview",
210-
"file-uploader",
211-
"form-field"
220+
"@mobx-restful-shadcn/badge-input",
221+
"@mobx-restful-shadcn/editor",
222+
"@mobx-restful-shadcn/file-preview",
223+
"@mobx-restful-shadcn/file-uploader",
224+
"@mobx-restful-shadcn/form-field"
212225
],
213226
"dependencies": [
214227
"mobx",
@@ -220,8 +233,9 @@
220233
],
221234
"files": [
222235
{
223-
"path": "registry/new-york/blocks/rest-form/rest-form.tsx",
224-
"type": "registry:component"
236+
"type": "registry:component",
237+
"path": "registry/new-york/blocks/rest-form/index.tsx",
238+
"target": "components/ui/mobx-restful-shadcn/rest-form/index.tsx"
225239
}
226240
]
227241
},
@@ -230,12 +244,13 @@
230244
"type": "registry:component",
231245
"title": "REST Form Modal",
232246
"description": "A modal wrapper for REST Form component, displaying forms in a dialog for editing data.",
233-
"registryDependencies": ["dialog", "rest-form"],
247+
"registryDependencies": ["dialog", "@mobx-restful-shadcn/rest-form"],
234248
"dependencies": ["mobx-react", "mobx-restful", "web-utility"],
235249
"files": [
236250
{
237-
"path": "registry/new-york/blocks/rest-form-modal/rest-form-modal.tsx",
238-
"type": "registry:component"
251+
"type": "registry:component",
252+
"path": "registry/new-york/blocks/rest-form-modal/index.tsx",
253+
"target": "components/ui/mobx-restful-shadcn/rest-form-modal/index.tsx"
239254
}
240255
]
241256
},
@@ -247,10 +262,10 @@
247262
"registryDependencies": [
248263
"button",
249264
"input",
250-
"badge-bar",
251-
"badge-input",
252-
"rest-form-modal",
253-
"scroll-list"
265+
"@mobx-restful-shadcn/badge-bar",
266+
"@mobx-restful-shadcn/badge-input",
267+
"@mobx-restful-shadcn/rest-form-modal",
268+
"@mobx-restful-shadcn/scroll-list"
254269
],
255270
"dependencies": [
256271
"lodash.debounce",
@@ -262,8 +277,9 @@
262277
],
263278
"files": [
264279
{
265-
"path": "registry/new-york/blocks/searchable-input/searchable-input.tsx",
266-
"type": "registry:component"
280+
"type": "registry:component",
281+
"path": "registry/new-york/blocks/searchable-input/index.tsx",
282+
"target": "components/ui/mobx-restful-shadcn/searchable-input/index.tsx"
267283
}
268284
]
269285
},
@@ -276,11 +292,11 @@
276292
"button",
277293
"checkbox",
278294
"table",
279-
"badge-bar",
280-
"file-preview",
281-
"pager",
282-
"rest-form",
283-
"rest-form-modal"
295+
"@mobx-restful-shadcn/badge-bar",
296+
"@mobx-restful-shadcn/file-preview",
297+
"@mobx-restful-shadcn/pager",
298+
"@mobx-restful-shadcn/rest-form",
299+
"@mobx-restful-shadcn/rest-form-modal"
284300
],
285301
"dependencies": [
286302
"lodash.debounce",
@@ -293,8 +309,9 @@
293309
],
294310
"files": [
295311
{
296-
"path": "registry/new-york/blocks/rest-table/rest-table.tsx",
297-
"type": "registry:component"
312+
"type": "registry:component",
313+
"path": "registry/new-york/blocks/rest-table/index.tsx",
314+
"target": "components/ui/mobx-restful-shadcn/rest-table/index.tsx"
298315
}
299316
]
300317
},
@@ -314,44 +331,54 @@
314331
],
315332
"files": [
316333
{
334+
"type": "registry:component",
317335
"path": "registry/new-york/blocks/editor/index.ts",
318-
"type": "registry:component"
336+
"target": "components/ui/mobx-restful-shadcn/editor/index.ts"
319337
},
320338
{
339+
"type": "registry:component",
321340
"path": "registry/new-york/blocks/editor/editor.tsx",
322-
"type": "registry:component"
341+
"target": "components/ui/mobx-restful-shadcn/editor/editor.tsx"
323342
},
324343
{
344+
"type": "registry:component",
325345
"path": "registry/new-york/blocks/editor/tool.tsx",
326-
"type": "registry:component"
346+
"target": "components/ui/mobx-restful-shadcn/editor/tool.tsx"
327347
},
328348
{
349+
"type": "registry:component",
329350
"path": "registry/new-york/blocks/editor/tools/index.ts",
330-
"type": "registry:component"
351+
"target": "components/ui/mobx-restful-shadcn/editor/tools/index.ts"
331352
},
332353
{
354+
"type": "registry:component",
333355
"path": "registry/new-york/blocks/editor/tools/text.ts",
334-
"type": "registry:component"
356+
"target": "components/ui/mobx-restful-shadcn/editor/tools/text.ts"
335357
},
336358
{
359+
"type": "registry:component",
337360
"path": "registry/new-york/blocks/editor/tools/layout.ts",
338-
"type": "registry:component"
361+
"target": "components/ui/mobx-restful-shadcn/editor/tools/layout.ts"
339362
},
340363
{
364+
"type": "registry:component",
341365
"path": "registry/new-york/blocks/editor/tools/control.ts",
342-
"type": "registry:component"
366+
"target": "components/ui/mobx-restful-shadcn/editor/tools/control.ts"
343367
},
344368
{
369+
"type": "registry:component",
345370
"path": "registry/new-york/blocks/editor/tools/media.ts",
346-
"type": "registry:component"
371+
"target": "components/ui/mobx-restful-shadcn/editor/tools/media.ts"
347372
},
348373
{
374+
"type": "registry:component",
349375
"path": "registry/new-york/blocks/editor/tools/color.tsx",
350-
"type": "registry:component"
376+
"target": "components/ui/mobx-restful-shadcn/editor/tools/color.tsx"
351377
},
352378
{
379+
"type": "registry:component",
353380
"path": "registry/new-york/blocks/editor/tools/extra.ts",
354-
"type": "registry:component"
381+
"target": "components/ui/mobx-restful-shadcn/editor/tools/extra.ts"
355382
}
356383
]
357384
}

registry/new-york/blocks/array-field/example.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { DataObject } from "mobx-restful";
44

55
import { Input } from "@/components/ui/input";
6-
import { ArrayField } from "./array-field";
6+
import { ArrayField } from "./index";
77

88
interface TodoItem extends DataObject {
99
title: string;
File renamed without changes.

registry/new-york/blocks/badge-bar/example.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { useState } from "react";
44

5-
import { BadgeBar, BadgeItem } from "./badge-bar";
5+
import { BadgeBar, BadgeItem } from "./index";
66

77
export const BadgeBarExample = () => {
88
const [items, setItems] = useState<BadgeItem[]>([
File renamed without changes.

registry/new-york/blocks/badge-input/example.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { useState } from "react";
44

5-
import { BadgeInput } from "./badge-input";
5+
import { BadgeInput } from "./index";
66

77
export const BadgeInputExample = () => {
88
const [tags, setTags] = useState<string[]>(["React", "TypeScript", "Next.js"]);

0 commit comments

Comments
 (0)