@luxkit/cli 1.0.0 → 1.0.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 +82 -86
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -4,45 +4,41 @@
4
4
 
5
5
  **One-click project formatting & VSCode config CLI**
6
6
 
7
- [![npm version](https://img.shields.io/badge/version-1.0.0-blue.svg)](https://github.com/TTT1231/lux)
7
+ [![npm version](https://img.shields.io/npm/v/@luxkit/cli.svg)](https://www.npmjs.com/package/@luxkit/cli)
8
8
  [![Node.js](https://img.shields.io/badge/node-%3E%3D18-green.svg)](https://nodejs.org/)
9
9
  [![License: ISC](https://img.shields.io/badge/license-ISC-purple.svg)](https://opensource.org/licenses/ISC)
10
10
  [![TypeScript](https://img.shields.io/badge/TypeScript-6.0-3178C6.svg)](https://www.typescriptlang.org/)
11
11
  [![ESM Only](https://img.shields.io/badge/ESM-only-F7DF1E.svg)](https://nodejs.org/api/esm.html)
12
12
 
13
- <br />
14
-
15
13
  <a href="#-english">English</a> | <a href="#-中文">中文</a>
16
14
 
17
15
  </div>
18
16
 
19
17
  ---
20
18
 
21
- <br />
22
-
23
19
  ## 🇬🇧 English
24
20
 
25
- <br />
26
-
27
21
  ### What is lux?
28
22
 
29
23
  `lux` is a CLI tool that initializes project formatting configs and VSCode workspace settings with a single command. It generates ESLint, Prettier, Stylelint, CSpell, EditorConfig files and VSCode settings from battle-tested presets — with smart merge and conflict resolution.
30
24
 
31
- <br />
25
+ <div align="center">
26
+ <img src="demo.gif" alt="lux demo" width="640" />
27
+ </div>
32
28
 
33
29
  ### ✨ Key Highlights
34
30
 
35
- | Feature | Description |
36
- |:--------|:------------|
37
- | 🎯 **One Command Setup** | `lux fmt init web` generates all linting & formatting configs instantly |
38
- | 🔧 **5 Fmt Presets** | `web` · `electron` · `uniapp` · `node` · `nest` — each with curated rules |
39
- | 🖥️ **6 VSCode Presets** | `web` · `electron` · `uniapp` · `node` · `nest` · `go` — settings + extensions |
40
- | 🔀 **Smart Merge** | Preset wins for linting keys; user wins for personal preferences |
41
- | 🛡️ **Conflict Resolution** | `neverOverwrite` / `forceOverwrite` lists + `--force` flag |
42
- | 📦 **Auto Install** | Detects bun / pnpm / yarn / npm and installs devDependencies |
43
- | 🔍 **Fuzzy Matching** | Typo a preset name? Levenshtein distance finds the closest match |
44
- | 🧪 **Dry Run** | Preview all changes with `--dry-run` before writing anything |
45
- | 🔗 **Script Injection** | Auto-injects `<pm> lint` / `<pm> format` scripts into package.json |
31
+ | Feature | Description |
32
+ | :------------------------- | :----------------------------------------------------------------------------- |
33
+ | 🎯 **One Command Setup** | `lux fmt init web` generates all linting & formatting configs instantly |
34
+ | 🔧 **5 Fmt Presets** | `web` · `electron` · `uniapp` · `node` · `nest` — each with curated rules |
35
+ | 🖥️ **6 VSCode Presets** | `web` · `electron` · `uniapp` · `node` · `nest` · `go` — settings + extensions |
36
+ | 🔀 **Smart Merge** | Preset wins for linting keys; user wins for personal preferences |
37
+ | 🛡️ **Conflict Resolution** | `neverOverwrite` / `forceOverwrite` lists + `--force` flag |
38
+ | 📦 **Auto Install** | Detects bun / pnpm / yarn / npm and installs devDependencies |
39
+ | 🔍 **Fuzzy Matching** | Typo a preset name? Levenshtein distance finds the closest match |
40
+ | 🧪 **Dry Run** | Preview all changes with `--dry-run` before writing anything |
41
+ | 🔗 **Script Injection** | Auto-injects `<pm> lint` / `<pm> format` scripts into package.json |
46
42
 
47
43
  <br />
48
44
 
@@ -50,9 +46,9 @@
50
46
 
51
47
  ```bash
52
48
  # Install globally (pick your package manager)
53
- npm install -g lux
49
+ npm install -g @luxkit/cli
54
50
  # or
55
- bun add -g lux
51
+ bun add -g @luxkit/cli
56
52
 
57
53
  # Initialize formatting configs
58
54
  lux fmt init web # Generate ESLint, Prettier, Stylelint, CSpell, EditorConfig
@@ -69,27 +65,27 @@ lux vscode list
69
65
 
70
66
  ### CLI Commands
71
67
 
72
- | Command | Description |
73
- |:--------|:------------|
74
- | `lux fmt init <preset>` | Initialize formatting config files |
75
- | `lux fmt list` | List available fmt presets |
76
- | `lux vscode init <preset>` | Initialize VSCode workspace settings |
77
- | `lux vscode list` | List available VSCode presets |
78
- | `lux vpn cmd` | Copy CMD proxy env-vars to clipboard |
79
- | `lux vpn pw` | Copy PowerShell proxy env-vars to clipboard |
68
+ | Command | Description |
69
+ | :------------------------- | :------------------------------------------ |
70
+ | `lux fmt init <preset>` | Initialize formatting config files |
71
+ | `lux fmt list` | List available fmt presets |
72
+ | `lux vscode init <preset>` | Initialize VSCode workspace settings |
73
+ | `lux vscode list` | List available VSCode presets |
74
+ | `lux vpn cmd` | Copy CMD proxy env-vars to clipboard |
75
+ | `lux vpn pw` | Copy PowerShell proxy env-vars to clipboard |
80
76
 
81
77
  <br />
82
78
 
83
79
  ### Available Presets
84
80
 
85
- | Preset | Fmt | VSCode | Stack |
86
- |:-------|:---:|:------:|:------|
87
- | `web` | ✅ | | Vue / React / TS / CSS |
88
- | `electron` | ✅ | | Electron + Web stack |
89
- | `uniapp` | ✅ | | UniApp / WeChat Mini Program |
90
- | `node` | ✅ | | Node.js backend |
91
- | `nest` | ✅ | | NestJS backend |
92
- | `go` | | | Go backend |
81
+ | Preset | Fmt | VSCode | Stack |
82
+ | :--------- | :-: | :----: | :--------------------------- |
83
+ | `web` | ✅ | | Vue / React / TS / CSS |
84
+ | `electron` | ✅ | | Electron + Web stack |
85
+ | `uniapp` | ✅ | | UniApp / WeChat Mini Program |
86
+ | `node` | ✅ | | Node.js backend |
87
+ | `nest` | ✅ | | NestJS backend |
88
+ | `go` | | | Go backend |
93
89
 
94
90
  <br />
95
91
 
@@ -132,15 +128,15 @@ lux fmt init web
132
128
 
133
129
  ### Tech Stack
134
130
 
135
- | Category | Technology |
136
- |:---------|:-----------|
137
- | Language | TypeScript 6.0 (ESM-only) |
138
- | Runtime | Node.js 18+ |
139
- | Build | tsup |
140
- | Test | Vitest (unit + acceptance) |
141
- | CLI | Commander.js |
142
- | Output | Chalk |
143
- | Bundle | Zero runtime deps (chalk + commander only) |
131
+ | Category | Technology |
132
+ | :------- | :----------------------------------------- |
133
+ | Language | TypeScript 6.0 (ESM-only) |
134
+ | Runtime | Node.js 18+ |
135
+ | Build | tsup |
136
+ | Test | Vitest (unit + acceptance) |
137
+ | CLI | Commander.js |
138
+ | Output | Chalk |
139
+ | Bundle | Zero runtime deps (chalk + commander only) |
144
140
 
145
141
  <br />
146
142
 
@@ -175,27 +171,27 @@ bun code:check:all # lint + format + spell check
175
171
 
176
172
  ## 🇨🇳 中文
177
173
 
178
- <br />
179
-
180
174
  ### lux 是什么?
181
175
 
182
176
  `lux` 是一个 CLI 工具,只需一条命令即可初始化项目格式化配置和 VSCode 工作区设置。它从经过实战检验的预设中生成 ESLint、Prettier、Stylelint、CSpell、EditorConfig 配置文件以及 VSCode 设置 —— 并带有智能合并和冲突解决机制。
183
177
 
184
- <br />
178
+ <div align="center">
179
+ <img src="demo.gif" alt="lux 演示" width="640" />
180
+ </div>
185
181
 
186
182
  ### ✨ 核心亮点
187
183
 
188
- | 特性 | 说明 |
189
- |:-----|:-----|
190
- | 🎯 **一键配置** | `lux fmt init web` 即可生成所有 lint 与格式化配置 |
191
- | 🔧 **5 种格式化预设** | `web` · `electron` · `uniapp` · `node` · `nest` — 各配备精选规则 |
184
+ | 特性 | 说明 |
185
+ | :---------------------- | :----------------------------------------------------------------------- |
186
+ | 🎯 **一键配置** | `lux fmt init web` 即可生成所有 lint 与格式化配置 |
187
+ | 🔧 **5 种格式化预设** | `web` · `electron` · `uniapp` · `node` · `nest` — 各配备精选规则 |
192
188
  | 🖥️ **6 种 VSCode 预设** | `web` · `electron` · `uniapp` · `node` · `nest` · `go` — 设置 + 扩展推荐 |
193
- | 🔀 **智能合并** | 预设优先覆盖 linting 相关键;用户配置优先保留个人偏好 |
194
- | 🛡️ **冲突解决** | `neverOverwrite` / `forceOverwrite` 列表 + `--force` 标志 |
195
- | 📦 **自动安装** | 自动检测 bun / pnpm / yarn / npm 并安装 devDependencies |
196
- | 🔍 **模糊匹配** | 预设名拼错了?Levenshtein 距离帮你找到最接近的匹配 |
197
- | 🧪 **Dry Run** | 使用 `--dry-run` 预览所有变更,不写入任何文件 |
198
- | 🔗 **脚本注入** | 自动将 `<pm> lint` / `<pm> format` 脚本注入 package.json |
189
+ | 🔀 **智能合并** | 预设优先覆盖 linting 相关键;用户配置优先保留个人偏好 |
190
+ | 🛡️ **冲突解决** | `neverOverwrite` / `forceOverwrite` 列表 + `--force` 标志 |
191
+ | 📦 **自动安装** | 自动检测 bun / pnpm / yarn / npm 并安装 devDependencies |
192
+ | 🔍 **模糊匹配** | 预设名拼错了?Levenshtein 距离帮你找到最接近的匹配 |
193
+ | 🧪 **Dry Run** | 使用 `--dry-run` 预览所有变更,不写入任何文件 |
194
+ | 🔗 **脚本注入** | 自动将 `<pm> lint` / `<pm> format` 脚本注入 package.json |
199
195
 
200
196
  <br />
201
197
 
@@ -203,9 +199,9 @@ bun code:check:all # lint + format + spell check
203
199
 
204
200
  ```bash
205
201
  # 全局安装(选择你的包管理器)
206
- npm install -g lux
202
+ npm install -g @luxkit/cli
207
203
  # 或
208
- bun add -g lux
204
+ bun add -g @luxkit/cli
209
205
 
210
206
  # 初始化格式化配置
211
207
  lux fmt init web # 生成 ESLint、Prettier、Stylelint、CSpell、EditorConfig
@@ -222,27 +218,27 @@ lux vscode list
222
218
 
223
219
  ### CLI 命令
224
220
 
225
- | 命令 | 说明 |
226
- |:-----|:-----|
227
- | `lux fmt init <preset>` | 初始化格式化配置文件 |
228
- | `lux fmt list` | 列出可用的格式化预设 |
229
- | `lux vscode init <preset>` | 初始化 VSCode 工作区设置 |
230
- | `lux vscode list` | 列出可用的 VSCode 预设 |
231
- | `lux vpn cmd` | 复制 CMD 代理环境变量到剪贴板 |
232
- | `lux vpn pw` | 复制 PowerShell 代理环境变量到剪贴板 |
221
+ | 命令 | 说明 |
222
+ | :------------------------- | :----------------------------------- |
223
+ | `lux fmt init <preset>` | 初始化格式化配置文件 |
224
+ | `lux fmt list` | 列出可用的格式化预设 |
225
+ | `lux vscode init <preset>` | 初始化 VSCode 工作区设置 |
226
+ | `lux vscode list` | 列出可用的 VSCode 预设 |
227
+ | `lux vpn cmd` | 复制 CMD 代理环境变量到剪贴板 |
228
+ | `lux vpn pw` | 复制 PowerShell 代理环境变量到剪贴板 |
233
229
 
234
230
  <br />
235
231
 
236
232
  ### 可用预设
237
233
 
238
- | 预设 | 格式化 | VSCode | 技术栈 |
239
- |:-----|:------:|:------:|:-------|
240
- | `web` | | | Vue / React / TS / CSS |
241
- | `electron` | | | Electron + Web 技术栈 |
242
- | `uniapp` | | | UniApp / 微信小程序 |
243
- | `node` | | | Node.js 后端 |
244
- | `nest` | | | NestJS 后端 |
245
- | `go` | | | Go 后端 |
234
+ | 预设 | 格式化 | VSCode | 技术栈 |
235
+ | :--------- | :----: | :----: | :--------------------- |
236
+ | `web` | | | Vue / React / TS / CSS |
237
+ | `electron` | | | Electron + Web 技术栈 |
238
+ | `uniapp` | | | UniApp / 微信小程序 |
239
+ | `node` | | | Node.js 后端 |
240
+ | `nest` | | | NestJS 后端 |
241
+ | `go` | | | Go 后端 |
246
242
 
247
243
  <br />
248
244
 
@@ -285,15 +281,15 @@ lux fmt init web
285
281
 
286
282
  ### 技术栈
287
283
 
288
- | 分类 | 技术 |
289
- |:-----|:-----|
290
- | 语言 | TypeScript 6.0(纯 ESM) |
291
- | 运行时 | Node.js 18+ |
292
- | 构建 | tsup |
293
- | 测试 | Vitest(单元测试 + 验收测试) |
294
- | CLI | Commander.js |
295
- | 输出 | Chalk |
296
- | 依赖 | 零运行时依赖(仅 chalk + commander) |
284
+ | 分类 | 技术 |
285
+ | :----- | :----------------------------------- |
286
+ | 语言 | TypeScript 6.0(纯 ESM) |
287
+ | 运行时 | Node.js 18+ |
288
+ | 构建 | tsup |
289
+ | 测试 | Vitest(单元测试 + 验收测试) |
290
+ | CLI | Commander.js |
291
+ | 输出 | Chalk |
292
+ | 依赖 | 零运行时依赖(仅 chalk + commander) |
297
293
 
298
294
  <br />
299
295
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luxkit/cli",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "One-click project formatting & VSCode config CLI",
5
5
  "type": "module",
6
6
  "bin": {