smart-registry 0.6.2 → 0.6.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 +12 -19
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -71,7 +71,7 @@ Simplify your `registry.json` by removing properties like `registryDependencies`
|
|
|
71
71
|
|
|
72
72
|
<br/>
|
|
73
73
|
|
|
74
|
-
Manual maintenance of `registry.json` files can lead to errors due to missing dependencies or files, or wrongful addition of unnecessary ones. `Smart Registry` reduces these risks by automating the detection and generation of the
|
|
74
|
+
Manual maintenance of `registry.json` files can lead to errors due to missing dependencies or files, or wrongful addition of unnecessary ones. `Smart Registry` reduces these risks by automating the detection and generation of the all-in-one `r/registry.json` and `r/<registry-item>.json` entries, making registry management more efficient.
|
|
75
75
|
|
|
76
76
|
## Table of Contents
|
|
77
77
|
|
|
@@ -101,20 +101,12 @@ npx smart-registry
|
|
|
101
101
|
|
|
102
102
|

|
|
103
103
|
|
|
104
|
-
### From Specific Files
|
|
104
|
+
### From Specific Files or Directories
|
|
105
105
|
|
|
106
|
-
If you want to generate the registry from specific files, you can
|
|
106
|
+
If you want to generate the registry from specific files or directories, you can pass them as arguments.
|
|
107
107
|
|
|
108
108
|
```bash
|
|
109
|
-
npx smart-registry
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
### From Specific Directories
|
|
113
|
-
|
|
114
|
-
To generate the registry from specific directories, use the `-d` flag to specify the directories.
|
|
115
|
-
|
|
116
|
-
```bash
|
|
117
|
-
npx smart-registry -d <directory1> -d <directory2> -d <directory3> ...
|
|
109
|
+
npx smart-registry path/to/file.ts path/to/directory ...
|
|
118
110
|
```
|
|
119
111
|
|
|
120
112
|
## How it Works
|
|
@@ -131,17 +123,18 @@ registry/
|
|
|
131
123
|
└── dialog.tsx
|
|
132
124
|
```
|
|
133
125
|
|
|
134
|
-
1. `Smart Registry` will scan the `registry` directory
|
|
126
|
+
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.
|
|
135
127
|
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.
|
|
136
128
|
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`.
|
|
137
129
|
|
|
138
130
|
```plaintext
|
|
139
131
|
public/
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
└──
|
|
132
|
+
└── r/
|
|
133
|
+
├── button.json
|
|
134
|
+
├── dialog.json
|
|
135
|
+
├── registry.json
|
|
136
|
+
└── utils.json
|
|
137
|
+
|
|
145
138
|
```
|
|
146
139
|
|
|
147
140
|
## Extending Properties
|
|
@@ -510,7 +503,7 @@ Generates the following items in `public/r` directory.
|
|
|
510
503
|
```plaintext
|
|
511
504
|
public/
|
|
512
505
|
└── r/
|
|
513
|
-
|
|
506
|
+
└── new-york/
|
|
514
507
|
├── toasty.json name: new-york/toasty target: blocks/new-york/toasty.tsx
|
|
515
508
|
├── toaster.json name: new-york/toaster target: components/new-york/toaster.tsx
|
|
516
509
|
├── use-toast.json name: new-york/use-toast target: hooks/new-york/use-toast.ts
|