smart-registry 0.7.2 → 0.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -26
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
[](https://www.npmjs.com/package/smart-registry)
|
|
6
6
|
[](https://github.com/nrjdalal/smart-registry)
|
|
7
7
|
|
|
8
|
-
A zero-configuration (no registry.json required), [shadcn add](https://ui.shadcn.com/docs/cli#add) / [open in v0](https://ui.shadcn.com/docs/registry/open-in-v0) compatible registry builder.
|
|
8
|
+
A `zero-configuration` (no registry.json required), [shadcn add](https://ui.shadcn.com/docs/cli#add) / [open in v0](https://ui.shadcn.com/docs/registry/open-in-v0) compatible registry builder. With amazing visual feedback like how many dependencies and files are being added to a file/component and much more.
|
|
9
9
|
|
|
10
|
-
> The best configuration is no configuration. Focus on developing building blocks, components,
|
|
10
|
+
> The best configuration is no configuration. Focus on developing building blocks, components, pages, etc rather than spending time configuring the registry.
|
|
11
|
+
|
|
12
|
+

|
|
11
13
|
|
|
12
14
|
## What is Zero-Configuration?
|
|
13
15
|
|
|
@@ -36,6 +38,12 @@ Simplify your `registry.json` by removing properties like `registryDependencies`
|
|
|
36
38
|
}
|
|
37
39
|
```
|
|
38
40
|
|
|
41
|
+
Or delete the `registry.json` file entirely. No changes will be made to the generated `public/r/dialog.json` file. Smart, right?
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
rm registry.json
|
|
45
|
+
```
|
|
46
|
+
|
|
39
47
|
<details><summary>Generated public/r/dialog.json</summary><br/>
|
|
40
48
|
|
|
41
49
|
```json
|
|
@@ -80,16 +88,16 @@ Manual maintenance of `registry.json` files can lead to errors due to missing de
|
|
|
80
88
|
- [Advanced Usage](#advanced-usage)
|
|
81
89
|
- [How it Works](#how-it-works)
|
|
82
90
|
- [Extending Properties](#extending-properties)
|
|
83
|
-
- [With
|
|
84
|
-
- [Add
|
|
85
|
-
- [Additional
|
|
86
|
-
- [External
|
|
87
|
-
- [Specify
|
|
91
|
+
- [With Zero-Configuration](#with-zero-configuration)
|
|
92
|
+
- [Add Custom Properties](#add-custom-properties)
|
|
93
|
+
- [Additional Files to Include](#additional-files-to-include)
|
|
94
|
+
- [External Registry Dependencies](#external-registry-dependencies)
|
|
95
|
+
- [Specify Dependency Version](#specify-dependency-version)
|
|
88
96
|
- [Directory Structure](#directory-structure)
|
|
89
|
-
- [For `registry`
|
|
90
|
-
- [For `registry`
|
|
91
|
-
- [For `components`
|
|
92
|
-
- [For `components`
|
|
97
|
+
- [For `registry` Directory](#for-registry-directory)
|
|
98
|
+
- [For `registry` Directory with Multiple Registries](#for-registry-directory-with-multiple-registries)
|
|
99
|
+
- [For `components` Directory](#for-components-directory)
|
|
100
|
+
- [For `components` Directory with Multiple Registries](#for-components-directory-with-multiple-registries)
|
|
93
101
|
|
|
94
102
|
## Usage
|
|
95
103
|
|
|
@@ -101,11 +109,11 @@ If your project contains a `registry`, `components`, or `src/components` directo
|
|
|
101
109
|
npx smart-registry
|
|
102
110
|
```
|
|
103
111
|
|
|
104
|
-
!
|
|
112
|
+
Yeah, that's it! You don't need to do anything else. `Smart Registry` has the word `smart` in it for a reason.
|
|
105
113
|
|
|
106
114
|
### Advanced Usage
|
|
107
115
|
|
|
108
|
-
|
|
116
|
+
If you want, you can customize the output directory, working directory, and provide files or directories to build the registry from.
|
|
109
117
|
|
|
110
118
|
```plaintext
|
|
111
119
|
Version:
|
|
@@ -127,13 +135,13 @@ Author:
|
|
|
127
135
|
${author.name} <${author.email}> (${author.url})
|
|
128
136
|
```
|
|
129
137
|
|
|
130
|
-
e.g.
|
|
138
|
+
e.g. to generate the registry in the `json` directory from some file and directory at the working directory (`apps/www`).
|
|
131
139
|
|
|
132
140
|
```bash
|
|
133
141
|
npx smart-registry path/to/file.ext path/to/directory ... --output json --cwd apps/www
|
|
134
142
|
```
|
|
135
143
|
|
|
136
|
-
- cwd is useful when working with monorepos or multiple projects.
|
|
144
|
+
- `cwd` is useful when working with monorepos or multiple projects.
|
|
137
145
|
|
|
138
146
|
## How it Works
|
|
139
147
|
|
|
@@ -151,7 +159,7 @@ registry/
|
|
|
151
159
|
|
|
152
160
|
1. `Smart Registry` will scan the `registry` directory and its sub-directories to find all the files (if no `registry` directory is found, it will scan the `components` or `src/components` directory).
|
|
153
161
|
2. For each file, it will generate a `<registry-item>.json` file by reading the file's content and extracting the imports for registry dependencies, dependencies, and files recursively.
|
|
154
|
-
3. It will then generate a `registry.json` file by combining all the `<registry-item>.json` files
|
|
162
|
+
3. It will then generate a `registry.json` file by combining all the `<registry-item>.json` files with all the properties required for `shadcn add` or `open in v0`.
|
|
155
163
|
|
|
156
164
|
```plaintext
|
|
157
165
|
public/
|
|
@@ -160,7 +168,6 @@ public/
|
|
|
160
168
|
├── dialog.json
|
|
161
169
|
├── registry.json
|
|
162
170
|
└── utils.json
|
|
163
|
-
|
|
164
171
|
```
|
|
165
172
|
|
|
166
173
|
## Extending Properties
|
|
@@ -178,7 +185,7 @@ registry/
|
|
|
178
185
|
└── dialog.tsx
|
|
179
186
|
```
|
|
180
187
|
|
|
181
|
-
|
|
188
|
+
### With Zero-Configuration
|
|
182
189
|
|
|
183
190
|
<details><summary>Generated public/r/dialog.json</summary><br/>
|
|
184
191
|
|
|
@@ -207,7 +214,7 @@ registry/
|
|
|
207
214
|
|
|
208
215
|
</details>
|
|
209
216
|
|
|
210
|
-
|
|
217
|
+
### Add Custom Properties
|
|
211
218
|
|
|
212
219
|
```diff
|
|
213
220
|
{
|
|
@@ -253,7 +260,7 @@ registry/
|
|
|
253
260
|
|
|
254
261
|
</details>
|
|
255
262
|
|
|
256
|
-
|
|
263
|
+
### Additional Files to Include
|
|
257
264
|
|
|
258
265
|
```diff
|
|
259
266
|
{
|
|
@@ -305,7 +312,7 @@ registry/
|
|
|
305
312
|
|
|
306
313
|
</details>
|
|
307
314
|
|
|
308
|
-
|
|
315
|
+
### External Registry Dependencies
|
|
309
316
|
|
|
310
317
|
```diff
|
|
311
318
|
{
|
|
@@ -347,7 +354,7 @@ registry/
|
|
|
347
354
|
|
|
348
355
|
</details>
|
|
349
356
|
|
|
350
|
-
|
|
357
|
+
### Specify Dependency Version
|
|
351
358
|
|
|
352
359
|
Note: Only add the dependency that you want to specify the version for. The rest of the dependencies will be automatically added.
|
|
353
360
|
|
|
@@ -393,7 +400,7 @@ Note: Only add the dependency that you want to specify the version for. The rest
|
|
|
393
400
|
|
|
394
401
|
## Directory Structure
|
|
395
402
|
|
|
396
|
-
### For `registry`
|
|
403
|
+
### For `registry` Directory
|
|
397
404
|
|
|
398
405
|
- Use direct name for default registry.
|
|
399
406
|
|
|
@@ -440,7 +447,7 @@ public/
|
|
|
440
447
|
└── toast.json name: toast target: components/ui/toast.tsx
|
|
441
448
|
```
|
|
442
449
|
|
|
443
|
-
### For `registry`
|
|
450
|
+
### For `registry` Directory with Multiple Registries
|
|
444
451
|
|
|
445
452
|
- Use `<registry-name>` sub-directory for named registry.
|
|
446
453
|
|
|
@@ -474,7 +481,7 @@ public/
|
|
|
474
481
|
└── toast.json name: new-york/toast target: components/ui/new-york/toast.tsx
|
|
475
482
|
```
|
|
476
483
|
|
|
477
|
-
### For `components`
|
|
484
|
+
### For `components` Directory
|
|
478
485
|
|
|
479
486
|
- Use direct name for default registry.
|
|
480
487
|
|
|
@@ -504,7 +511,7 @@ public/
|
|
|
504
511
|
└── toast.json name: toast target: components/ui/toast.tsx
|
|
505
512
|
```
|
|
506
513
|
|
|
507
|
-
### For `components`
|
|
514
|
+
### For `components` Directory with Multiple Registries
|
|
508
515
|
|
|
509
516
|
- Use `<registry-name>` sub-directory for named registry.
|
|
510
517
|
|