@luxkit/cli 1.1.0 → 1.1.2

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.
@@ -0,0 +1,67 @@
1
+ # Custom Preset Configuration
2
+
3
+ > ⚠️ **Always use `lux init --preset` to initialize presets.** Running `lux fmt` / `lux vscode` directly generates config files in cwd and requires `package.json` — only use in real project directories.
4
+
5
+ ## Quick Start
6
+
7
+ ```bash
8
+ lux init --preset # materialize all built-in presets to ~/.lux/preset/
9
+ ```
10
+
11
+ After materialization, edit files under `~/.lux/preset/<type>/<preset-name>/` to customize. Changes take effect on the next `lux fmt` / `lux vscode` run.
12
+
13
+ `lux init --preset` can be run repeatedly — each run overwrites with built-in defaults. To reset a single preset, use `lux fmt <name> --reset` or `lux vscode <name> --reset` (deletes local preset dir only; re-generated from built-in on next run).
14
+
15
+ ## Storage Location
16
+
17
+ `~/.lux/preset/` (i.e. `os.homedir()/.lux/preset/`). Override with `LUX_HOME` env var.
18
+
19
+ ```
20
+ ~/.lux/preset/
21
+ ├── fmt/ # fmt presets (web-vue, web-react, electron-vue, uniapp, node, nest)
22
+ └── vscode/ # vscode presets (same + go)
23
+ ```
24
+
25
+ ## File Reference
26
+
27
+ ### fmt preset
28
+
29
+ | File | Description |
30
+ | :--------------------- | :--------------------------------------------- |
31
+ | `eslint.config.mjs` | ESLint flat config |
32
+ | `.prettierrc` | Prettier JSON config |
33
+ | `.prettierignore` | Prettier ignore rules |
34
+ | `stylelint.config.mjs` | Stylelint config |
35
+ | `.stylelintignore` | Stylelint ignore rules |
36
+ | `cspell.json` | CSpell dictionary config |
37
+ | `.editorconfig` | EditorConfig config |
38
+ | `package.json` | Template with `devDependencies` and `scripts` |
39
+
40
+ ### vscode preset
41
+
42
+ | File | Description |
43
+ | :---------------- | :-------------------------- |
44
+ | `settings.json` | VSCode workspace settings |
45
+ | `extensions.json` | VSCode extension recommendations |
46
+
47
+ ## Template Placeholders (fmt preset)
48
+
49
+ | Placeholder | Replaced with |
50
+ | :---------- | :------------ |
51
+ | `<pm>` | Package manager prefix (`bun run` / `pnpm run` / `npm run`) |
52
+ | `<lockfile>` | Project lockfile name (`bun.lock` / `pnpm-lock.yaml` etc.) |
53
+ | `"<latest>"` | Resolved to latest version at install time, or pin like `"3.3.0"` |
54
+
55
+ ## Workflow
56
+
57
+ ```
58
+ lux init --preset
59
+ → materialize all built-in presets to ~/.lux/preset/ (no cwd writes)
60
+
61
+ lux fmt web-vue (in target project)
62
+ → local preset exists → use local version (with custom edits)
63
+ → local preset missing → generate from built-in + materialize (also writes to cwd)
64
+
65
+ lux vscode web-vue (in target project)
66
+ → same as above
67
+ ```
@@ -13,6 +13,7 @@ lux fmt list
13
13
  - `--force` — overwrite existing config files (default: skip)
14
14
  - `--dry-run` — preview what would be generated, write nothing
15
15
  - `--no-install` — write deps to package.json but skip install
16
+ - `--reset` — reset local preset, re-materialize from built-in defaults
16
17
 
17
18
  Presets: `web-vue` `web-react` `electron-vue` `uniapp` `node` `nest`
18
19
 
@@ -23,12 +24,17 @@ lux vscode <preset> [--dry-run]
23
24
  lux vscode list
24
25
  ```
25
26
 
27
+ - `--force` — overwrite existing settings (default: skip)
28
+ - `--dry-run` — preview what would be generated, write nothing
29
+ - `--reset` — reset local preset, re-materialize from built-in defaults
30
+
26
31
  Presets: `web-vue` `web-react` `electron-vue` `uniapp` `node` `nest` `go`
27
32
 
28
- ## init — lux skill(human interaction)
33
+ ## init — initialize skills or presets
29
34
 
30
35
  ```bash
31
- lux init
36
+ lux init # interactively select AI tool, copy skill files to project
37
+ lux init --preset # materialize all built-in presets to ~/.lux/preset/ (no cwd writes, no package.json required)
32
38
  ```
33
39
 
34
40
  ## vpn — proxy clipboard helper
@@ -53,3 +59,7 @@ lux show env # show stored proxy env
53
59
  lux update # update to latest
54
60
  lux update --check
55
61
  ```
62
+
63
+ ## Custom presets
64
+
65
+ To customize preset rules, see `references/custom-preset-setting.md`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luxkit/cli",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "One-click project formatting & VSCode config CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -15,16 +15,9 @@
15
15
  "scripts": {
16
16
  "build": "tsup && node scripts/copy-assets.mjs",
17
17
  "dev": "tsup --watch",
18
- "lint": "eslint .",
18
+ "lint": "eslint . --cache --cache-location node_modules/.cache/eslint && cspell --cache --cache-location node_modules/.cache/cspell --gitignore \"src/**/*\" && tsc --noEmit",
19
+ "lint:fix": "eslint . --cache --cache-location node_modules/.cache/eslint --fix",
19
20
  "format": "prettier --write \"src/**/*.{ts,js,json}\"",
20
- "cspell": "cspell --gitignore \"src/**/*\"",
21
- "format:check": "prettier --check \"src/**/*.{ts,js,json}\"",
22
- "type:check": "tsc --noEmit",
23
- "code:check": "bun run lint && bun run format:check",
24
- "code:check:all": "bun run lint && bun run format:check && bun run cspell",
25
- "lint:fix": "eslint \"src/**/*.{js,ts}\" --fix",
26
- "code:fix": "bun run lint:fix && bun run format",
27
- "code:fix:all": "bun run lint:fix && bun run format",
28
21
  "prepublishOnly": "cross-env NODE_ENV=production bun run build",
29
22
  "test": "vitest run",
30
23
  "test:watch": "vitest",