smart-registry 0.6.3 → 0.6.5

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.
Files changed (2) hide show
  1. package/README.md +42 -28
  2. 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 necessary `registry.json` and `r/<registry-item>.json` entries, making registry management more efficient.
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
 
@@ -99,22 +99,32 @@ If your project contains a `registry`, `components`, or `src/components` directo
99
99
  npx smart-registry
100
100
  ```
101
101
 
102
- ![Demo Image](https://github-production-user-asset-6210df.s3.amazonaws.com/58145505/418180611-fd6070a5-6a89-4582-8ad0-df125c222883.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20250302%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250302T212923Z&X-Amz-Expires=300&X-Amz-Signature=81a0324e67c77ab068c96e9f666e1b930cf32d497f8aa0a39c28caa0b902c7d3&X-Amz-SignedHeaders=host)
102
+ ```plaintext
103
+ Version:
104
+ ${name}@${version}
103
105
 
104
- ### From Specific Files
106
+ Usage:
107
+ $ ${name} [options] [files/directories] ...
105
108
 
106
- If you want to generate the registry from specific files, you can use the `-f` flag to specify the files.
109
+ Arguments:
110
+ files/directories files or directories to build the registry from (optional)
107
111
 
108
- ```bash
109
- npx smart-registry -f <file1> -f <file2> -f <file3> ...
112
+ Options:
113
+ -o, --output <path> destination directory for json files (default: "./public/r")
114
+ -c, --cwd <cwd> the working directory (default: "./")
115
+ -v, --version display version
116
+ -h, --help display help
117
+
118
+ Author:
119
+ ${author.name} <${author.email}> (${author.url})
110
120
  ```
111
121
 
112
- ### From Specific Directories
122
+ ### From Specific Files or Directories
113
123
 
114
- To generate the registry from specific directories, use the `-d` flag to specify the directories.
124
+ If you want to generate the registry from specific files or directories, you can pass them as arguments.
115
125
 
116
126
  ```bash
117
- npx smart-registry -d <directory1> -d <directory2> -d <directory3> ...
127
+ npx smart-registry path/to/file.ts path/to/directory ...
118
128
  ```
119
129
 
120
130
  ## How it Works
@@ -131,17 +141,18 @@ registry/
131
141
  └── dialog.tsx
132
142
  ```
133
143
 
134
- 1. `Smart Registry` will scan the `registry` directory for files.
144
+ 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
145
  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
- 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`.
146
+ 3. It will then generate a `registry.json` file by combining all the `<registry-item>.json` files and `<registry-item>.json` files with all the properties required for `shadcn add` or `open in v0`.
137
147
 
138
148
  ```plaintext
139
149
  public/
140
- ├── r/
141
- ├── button.json
142
- ├── dialog.json
143
- │ └── utils.json
144
- └── registry.json
150
+ └── r/
151
+ ├── button.json
152
+ ├── dialog.json
153
+ ├── registry.json
154
+ └── utils.json
155
+
145
156
  ```
146
157
 
147
158
  ## Extending Properties
@@ -446,12 +457,13 @@ Generates the following items in `public/r` directory.
446
457
  ```plaintext
447
458
  public/
448
459
  └── r/
449
- ├── new-york/
450
- ├── toasty.json name: new-york/toasty target: blocks/new-york/toasty.tsx
451
- ├── toaster.json name: new-york/toaster target: components/new-york/toaster.tsx
452
- ├── use-toast.json name: new-york/use-toast target: hooks/new-york/use-toast.ts
453
- ├── utils.json name: new-york/utils target: lib/new-york/utils.ts
454
- └── toast.json name: new-york/toast target: components/ui/new-york/toast.tsx
460
+ ├── registry.json
461
+ └── new-york/
462
+ ├── toasty.json name: new-york/toasty target: blocks/new-york/toasty.tsx
463
+ ├── toaster.json name: new-york/toaster target: components/new-york/toaster.tsx
464
+ ├── use-toast.json name: new-york/use-toast target: hooks/new-york/use-toast.ts
465
+ ├── utils.json name: new-york/utils target: lib/new-york/utils.ts
466
+ └── toast.json name: new-york/toast target: components/ui/new-york/toast.tsx
455
467
  ```
456
468
 
457
469
  ### For `components` directory.
@@ -476,6 +488,7 @@ Generates the following items in `public/r` directory.
476
488
  ```plaintext
477
489
  public/
478
490
  └── r/
491
+ ├── registry.json
479
492
  ├── toasty.json name: toasty target: blocks/toasty.tsx
480
493
  ├── component.json name: toaster target: components/toaster.tsx
481
494
  ├── use-toast.json name: use-toast target: hooks/use-toast.ts
@@ -510,10 +523,11 @@ Generates the following items in `public/r` directory.
510
523
  ```plaintext
511
524
  public/
512
525
  └── r/
513
- ├── new-york/
514
- ├── toasty.json name: new-york/toasty target: blocks/new-york/toasty.tsx
515
- ├── toaster.json name: new-york/toaster target: components/new-york/toaster.tsx
516
- ├── use-toast.json name: new-york/use-toast target: hooks/new-york/use-toast.ts
517
- ├── utils.json name: new-york/utils target: lib/new-york/utils.ts
518
- └── toast.json name: new-york/toast target: components/ui/new-york/toast.tsx
526
+ ├── registry.json
527
+ └── new-york/
528
+ ├── toasty.json name: new-york/toasty target: blocks/new-york/toasty.tsx
529
+ ├── toaster.json name: new-york/toaster target: components/new-york/toaster.tsx
530
+ ├── use-toast.json name: new-york/use-toast target: hooks/new-york/use-toast.ts
531
+ ├── utils.json name: new-york/utils target: lib/new-york/utils.ts
532
+ └── toast.json name: new-york/toast target: components/ui/new-york/toast.tsx
519
533
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smart-registry",
3
- "version": "0.6.3",
3
+ "version": "0.6.5",
4
4
  "description": "A zero-configuration (no registry.json required), shadcn add / open in v0 compatible registry builder.",
5
5
  "keywords": [
6
6
  "smart-registry"