regpick 0.2.3 → 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 (47) hide show
  1. package/README.md +70 -33
  2. package/dist/index.mjs +1297 -0
  3. package/package.json +14 -1
  4. package/.github/workflows/release.yml +0 -51
  5. package/.release-it.json +0 -22
  6. package/CHANGELOG.md +0 -12
  7. package/docs/mvp-decisions.md +0 -77
  8. package/examples/README.md +0 -26
  9. package/examples/complex-ui-registry/registry.json +0 -35
  10. package/examples/simple-utils-registry/registry.json +0 -28
  11. package/src/commands/add.ts +0 -261
  12. package/src/commands/init.ts +0 -89
  13. package/src/commands/list.ts +0 -54
  14. package/src/commands/pack.ts +0 -97
  15. package/src/commands/update.ts +0 -139
  16. package/src/core/__tests__/result-errors.test.ts +0 -19
  17. package/src/core/errors.ts +0 -36
  18. package/src/core/result.ts +0 -19
  19. package/src/domain/__tests__/addPlan.test.ts +0 -64
  20. package/src/domain/__tests__/initCore.test.ts +0 -28
  21. package/src/domain/__tests__/listCore.test.ts +0 -29
  22. package/src/domain/__tests__/pathPolicy.test.ts +0 -64
  23. package/src/domain/__tests__/registryModel.test.ts +0 -32
  24. package/src/domain/__tests__/selection.test.ts +0 -58
  25. package/src/domain/addPlan.ts +0 -51
  26. package/src/domain/aliasCore.ts +0 -13
  27. package/src/domain/initCore.ts +0 -15
  28. package/src/domain/listCore.ts +0 -34
  29. package/src/domain/packCore.ts +0 -44
  30. package/src/domain/pathPolicy.ts +0 -61
  31. package/src/domain/registryModel.ts +0 -100
  32. package/src/domain/selection.ts +0 -47
  33. package/src/index.ts +0 -117
  34. package/src/shell/cli/args.ts +0 -37
  35. package/src/shell/config.ts +0 -105
  36. package/src/shell/installer.ts +0 -70
  37. package/src/shell/lockfile.ts +0 -35
  38. package/src/shell/packageManagers/__tests__/resolver.test.ts +0 -61
  39. package/src/shell/packageManagers/__tests__/strategy.test.ts +0 -40
  40. package/src/shell/packageManagers/resolver.ts +0 -27
  41. package/src/shell/packageManagers/strategy.ts +0 -65
  42. package/src/shell/registry.ts +0 -182
  43. package/src/shell/runtime/ports.ts +0 -200
  44. package/src/types.ts +0 -92
  45. package/test-clack.ts +0 -2
  46. package/tsconfig.json +0 -15
  47. package/tsdown.config.ts +0 -8
package/README.md CHANGED
@@ -1,56 +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
 
17
+ ## Quick Start
18
+
19
+ The easiest way to use `regpick` is via `npx` or your preferred package runner.
20
+
21
+ ```bash
22
+ # Initialize configuration in your project
23
+ npx regpick init
24
+ ```
25
+
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.
13
32
  ```bash
14
- cd /path/to/project
15
- cd /path/to/packages/regpick
16
- npm run build
17
- node ./dist/index.mjs init
18
- node ./dist/index.mjs list tebra
19
- node ./dist/index.mjs add tebra
33
+ npx regpick add <registry-url-or-alias>
20
34
  ```
21
35
 
22
- ## Config (`regpick.json`)
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
+ ```
47
+
48
+ ### 4. Create Your Own Registry
49
+ Scan a local directory of components and pack them into a distributable `registry.json`.
50
+ ```bash
51
+ npx regpick pack ./src/components/ui
52
+ ```
53
+
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>
23
69
 
24
70
  ```json
25
71
  {
26
72
  "registries": {
27
- "tebra": "./tebra-icon-registry/registry"
73
+ "ui": "https://ui.shadcn.com/r"
28
74
  },
29
75
  "targetsByType": {
30
- "registry:icon": "src/components/ui/icons",
31
- "registry:component": "src/components/ui",
32
- "registry:file": "src/components/ui"
76
+ "registry:component": "src/components/ui"
33
77
  },
34
78
  "overwritePolicy": "prompt",
35
- "packageManager": "auto",
36
- "preferManifestTarget": true,
37
- "allowOutsideProject": false
79
+ "packageManager": "auto"
38
80
  }
39
81
  ```
40
82
 
41
- Optional JSON schema path (if the file is available in your project):
83
+ </details>
42
84
 
43
- ```json
44
- {
45
- "$schema": "./packages/regpick/regpick.config.schema.json"
46
- }
47
- ```
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.
48
90
 
49
- ## Notes
91
+ ---
50
92
 
51
- - Supports:
52
- - full `registry.json` (with inline item definitions),
53
- - item references (`url` / `href`) in `items[]`,
54
- - single item JSON (`registry:file` style),
55
- - directory source containing many item JSON files.
56
- - 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).