regpick 0.2.4 → 0.2.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.
- package/README.md +64 -35
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,64 +1,93 @@
|
|
|
1
1
|
# regpick
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/regpick)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
Lightweight CLI for selecting and installing registry entries from shadcn-compatible registries (v2). It supports local directory-based item JSON files, remote registries, and interactive component management.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
- `regpick list [registry-name-or-url]`
|
|
9
|
-
- `regpick add [registry-name-or-url]`
|
|
8
|
+
## Features
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
- **Interactive CLI**: Beautiful prompts using `@clack/prompts`.
|
|
11
|
+
- **shadcn/ui compatible**: Works seamlessly with v2 registries.
|
|
12
|
+
- **Smart Updates**: Keep track of installed components via `regpick-lock.json` and update them interactively with built-in diff viewing.
|
|
13
|
+
- **Dependency Management**: Automatically detects and prompts to install missing `dependencies` and `devDependencies`.
|
|
14
|
+
- **Registry Aliases**: Configure shortcuts for your frequently used registries.
|
|
15
|
+
- **Component Packing**: Easily turn your local components into a distributable `registry.json`.
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
The easiest way to use `regpick` is via `npx` or your preferred package runner.
|
|
14
20
|
|
|
15
21
|
```bash
|
|
22
|
+
# Initialize configuration in your project
|
|
16
23
|
npx regpick init
|
|
17
|
-
npx regpick list tebra
|
|
18
|
-
npx regpick add tebra
|
|
19
24
|
```
|
|
20
25
|
|
|
21
|
-
##
|
|
26
|
+
## Use Cases
|
|
27
|
+
|
|
28
|
+
`regpick` adapts to your workflow, whether you are exploring components manually or automating your CI/CD.
|
|
29
|
+
|
|
30
|
+
### 1. Interactive Component Addition
|
|
31
|
+
Browse and select components to install interactively.
|
|
32
|
+
```bash
|
|
33
|
+
npx regpick add <registry-url-or-alias>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### 2. Check Available Components
|
|
37
|
+
List all items available in a registry before adding them.
|
|
38
|
+
```bash
|
|
39
|
+
npx regpick list <registry-url-or-alias>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### 3. Keep Components Up-to-Date
|
|
43
|
+
Check for upstream updates to your installed components and review code diffs before applying changes.
|
|
44
|
+
```bash
|
|
45
|
+
npx regpick update
|
|
46
|
+
```
|
|
22
47
|
|
|
48
|
+
### 4. Create Your Own Registry
|
|
49
|
+
Scan a local directory of components and pack them into a distributable `registry.json`.
|
|
23
50
|
```bash
|
|
24
|
-
|
|
25
|
-
cd /path/to/packages/regpick
|
|
26
|
-
npm run build
|
|
27
|
-
node ./dist/index.mjs init
|
|
51
|
+
npx regpick pack ./src/components/ui
|
|
28
52
|
```
|
|
29
53
|
|
|
30
|
-
##
|
|
54
|
+
## CLI Flags & Automation
|
|
55
|
+
|
|
56
|
+
You can run `regpick` in a non-interactive or scriptable way using CLI flags:
|
|
57
|
+
|
|
58
|
+
- `--cwd=<path>`: Change the working directory (useful in monorepos).
|
|
59
|
+
- `--yes`: Skip confirmation prompts (e.g., dependency installation, overwrite confirmation). Assumes "yes" or default configuration.
|
|
60
|
+
- `--all`: Select all items available in the registry during the `add` command.
|
|
61
|
+
- `--select=a,b,c`: Comma-separated list of items to explicitly select without showing the interactive menu.
|
|
62
|
+
|
|
63
|
+
## Configuration
|
|
64
|
+
|
|
65
|
+
`regpick` uses a configuration file (e.g., `regpick.config.json` or `regpick.json`) at the root of your project. You can generate this by running `regpick init`.
|
|
66
|
+
|
|
67
|
+
<details>
|
|
68
|
+
<summary>Click to view a basic configuration example</summary>
|
|
31
69
|
|
|
32
70
|
```json
|
|
33
71
|
{
|
|
34
72
|
"registries": {
|
|
35
|
-
"
|
|
73
|
+
"ui": "https://ui.shadcn.com/r"
|
|
36
74
|
},
|
|
37
75
|
"targetsByType": {
|
|
38
|
-
"registry:
|
|
39
|
-
"registry:component": "src/components/ui",
|
|
40
|
-
"registry:file": "src/components/ui"
|
|
76
|
+
"registry:component": "src/components/ui"
|
|
41
77
|
},
|
|
42
78
|
"overwritePolicy": "prompt",
|
|
43
|
-
"packageManager": "auto"
|
|
44
|
-
"preferManifestTarget": true,
|
|
45
|
-
"allowOutsideProject": false
|
|
79
|
+
"packageManager": "auto"
|
|
46
80
|
}
|
|
47
81
|
```
|
|
48
82
|
|
|
49
|
-
|
|
83
|
+
</details>
|
|
50
84
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
85
|
+
For a full list of configuration options, including advanced settings like import aliases (`aliases`) and security policies (`allowOutsideProject`), please see the [Configuration Reference](./docs/CONFIGURATION_REFERENCE.md).
|
|
86
|
+
|
|
87
|
+
## Lockfile (`regpick-lock.json`)
|
|
88
|
+
|
|
89
|
+
When you install components, `regpick` generates a lockfile to track the source and content hash of each installed item. This allows the `update` command to detect upstream changes and offer interactive updates with diff viewing.
|
|
56
90
|
|
|
57
|
-
|
|
91
|
+
---
|
|
58
92
|
|
|
59
|
-
|
|
60
|
-
- full `registry.json` (with inline item definitions),
|
|
61
|
-
- item references (`url` / `href`) in `items[]`,
|
|
62
|
-
- single item JSON (`registry:file` style),
|
|
63
|
-
- directory source containing many item JSON files.
|
|
64
|
-
- For safety, path traversal writes outside project root are blocked by default.
|
|
93
|
+
For a detailed behavioral breakdown of every command (Success & Error stories), see the [Command Stories Documentation](./docs/COMMANDS_STORIES.md).
|