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.
Files changed (2) hide show
  1. package/README.md +64 -35
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,64 +1,93 @@
1
1
  # regpick
2
2
 
3
- Lightweight CLI for selecting and installing registry entries from shadcn-compatible registries (v2), with support for local directory-based fat item JSON files.
3
+ [![npm version](https://img.shields.io/npm/v/regpick.svg)](https://www.npmjs.com/package/regpick)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
4
5
 
5
- ## Commands
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
- - `regpick init`
8
- - `regpick list [registry-name-or-url]`
9
- - `regpick add [registry-name-or-url]`
8
+ ## Features
10
9
 
11
- ## Quick start
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
- The easiest way to use `regpick` is via `npx`. You don't need to install it globally.
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
- ## Local development
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
- cd /path/to/project
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
- ## Config (`regpick.json`)
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
- "tebra": "./tebra-icon-registry/registry"
73
+ "ui": "https://ui.shadcn.com/r"
36
74
  },
37
75
  "targetsByType": {
38
- "registry:icon": "src/components/ui/icons",
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
- Optional JSON schema path (if the file is available in your project):
83
+ </details>
50
84
 
51
- ```json
52
- {
53
- "$schema": "./packages/regpick/regpick.config.schema.json"
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
- ## Notes
91
+ ---
58
92
 
59
- - Supports:
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).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "regpick",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "Lightweight CLI for selecting and installing registry entries.",
5
5
  "type": "module",
6
6
  "files": [