@lsst/pik-plugin-select 0.4.2 → 0.5.1

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 +53 -6
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,11 +1,58 @@
1
- # plugin-select
1
+ # @lsst/pik-plugin-select
2
2
 
3
- This library was generated with [Nx](https://nx.dev).
3
+ Select plugin for pik - switch config options in source files using `@pik` markers.
4
4
 
5
- ## Building
5
+ ## Installation
6
6
 
7
- Run `nx build plugin-select` to build the library.
7
+ This plugin is included with `@lsst/pik` by default.
8
8
 
9
- ## Running unit tests
9
+ ```bash
10
+ npm install -g @lsst/pik
11
+ ```
10
12
 
11
- Run `nx test plugin-select` to execute the unit tests via [Vitest](https://vitest.dev/).
13
+ ## Usage
14
+
15
+ ### 1. Add markers to your files
16
+
17
+ ```typescript
18
+ // @pik:select Environment
19
+ const API_URL = "https://dev.example.com"; // @pik:option DEV
20
+ // const API_URL = "https://example.com"; // @pik:option PROD
21
+ ```
22
+
23
+ ### 2. Configure in `pik.config.ts`
24
+
25
+ ```typescript
26
+ import { defineConfig } from '@lsst/pik';
27
+
28
+ export default defineConfig({
29
+ select: {
30
+ include: ['src/**/*.ts', '.env'],
31
+ },
32
+ });
33
+ ```
34
+
35
+ ### 3. Run commands
36
+
37
+ ```bash
38
+ pik select # Interactive mode
39
+ pik select list # List all selectors
40
+ pik select set <name> <option> # Set directly
41
+ ```
42
+
43
+ ## Marker Syntax
44
+
45
+ - `@pik:select <name>` - Defines a selector group
46
+ - `@pik:option <name>` - Marks an option within a selector
47
+
48
+ ## Supported File Types
49
+
50
+ | Extensions | Comment Style |
51
+ |------------|---------------|
52
+ | `.ts`, `.js`, `.tsx`, `.jsx`, `.mts`, `.mjs` | `//` |
53
+ | `.html`, `.htm` | `<!-- -->` |
54
+ | `.sh`, `.bash`, `.zsh`, `.py`, `.yaml`, `.yml`, `.env` | `#` |
55
+
56
+ ## License
57
+
58
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lsst/pik-plugin-select",
3
- "version": "0.4.2",
3
+ "version": "0.5.1",
4
4
  "description": "Config selector plugin for pik CLI",
5
5
  "type": "module",
6
6
  "license": "MIT",