@luxkit/cli 1.0.6 → 1.0.7

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 (3) hide show
  1. package/README.md +9 -9
  2. package/dist/index.js +161 -136
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -28,9 +28,9 @@
28
28
 
29
29
  | Feature | Description |
30
30
  | :------------------------- | :----------------------------------------------------------------------------- |
31
- | 🎯 **One Command Setup** | `lux fmt web` generates all linting & formatting configs instantly |
32
- | 🔧 **5 Fmt Presets** | `web` · `electron` · `uniapp` · `node` · `nest` — each with curated rules |
33
- | 🖥️ **6 VSCode Presets** | `web` · `electron` · `uniapp` · `node` · `nest` · `go` — settings + extensions |
31
+ | 🎯 **One Command Setup** | `lux fmt web-vue` generates all linting & formatting configs instantly |
32
+ | 🔧 **5 Fmt Presets** | `web-vue` · `electron-vue` · `uniapp` · `node` · `nest` — each with curated rules |
33
+ | 🖥️ **6 VSCode Presets** | `web-vue` · `electron-vue` · `uniapp` · `node` · `nest` · `go` — settings + extensions |
34
34
  | 🔀 **Smart Merge** | Preset wins for linting keys; user wins for personal preferences |
35
35
  | 🛡️ **Conflict Resolution** | `neverOverwrite` / `forceOverwrite` lists + `--force` flag |
36
36
  | 📦 **Auto Install** | Detects bun / pnpm / yarn / npm and installs devDependencies |
@@ -51,10 +51,10 @@ npm install -g @luxkit/cli
51
51
  bun add -g @luxkit/cli
52
52
 
53
53
  # Initialize formatting configs
54
- lux fmt web # Generate ESLint, Prettier, Stylelint, CSpell, EditorConfig
54
+ lux fmt web-vue # Generate ESLint, Prettier, Stylelint, CSpell, EditorConfig
55
55
 
56
56
  # Initialize VSCode settings
57
- lux vscode web # Generate .vscode/settings.json + extensions.json
57
+ lux vscode web-vue # Generate .vscode/settings.json + extensions.json
58
58
 
59
59
  # List available presets
60
60
  lux fmt list
@@ -86,8 +86,8 @@ lux vscode list
86
86
 
87
87
  | Preset | Fmt | VSCode | Stack |
88
88
  | :--------- | :-: | :----: | :--------------------------- |
89
- | `web` | ✅ | ✅ | Vue / React / TS / CSS |
90
- | `electron` | ✅ | ✅ | Electron + Web stack |
89
+ | `web-vue` | ✅ | ✅ | Vue / React / TS / CSS |
90
+ | `electron-vue` | ✅ | ✅ | Electron + Web stack |
91
91
  | `uniapp` | ✅ | ✅ | UniApp / WeChat Mini Program |
92
92
  | `node` | ✅ | ✅ | Node.js backend |
93
93
  | `nest` | ✅ | ✅ | NestJS backend |
@@ -110,7 +110,7 @@ lux fmt <preset> [options]
110
110
  ### How It Works
111
111
 
112
112
  ```
113
- lux fmt web
113
+ lux fmt web-vue
114
114
 
115
115
 
116
116
  Parse CLI args ──► Resolve preset (fuzzy match on typo)
@@ -154,7 +154,7 @@ cd lux
154
154
  bun install
155
155
 
156
156
  bun link # Register `lux` globally for testing
157
- lux fmt web # Test it on any project
157
+ lux fmt web-vue # Test it on any project
158
158
 
159
159
  bun test # Run tests
160
160
  bun build # Build to dist/
package/dist/index.js CHANGED
@@ -6,9 +6,9 @@ import { program } from "commander";
6
6
  // src/commands/fmt.ts
7
7
  import path4 from "path";
8
8
 
9
- // src/presets/fmt/electron.ts
10
- var electronFmt = {
11
- name: "electron",
9
+ // src/presets/fmt/electron-vue.ts
10
+ var electronVueFmt = {
11
+ name: "electron-vue",
12
12
  description: "Vue 3 + Electron desktop app",
13
13
  eslint: () => `import withVue from '@vue/eslint-config-typescript'
14
14
  import withPrettier from '@vue/eslint-config-prettier/skip-formatting'
@@ -156,7 +156,6 @@ dist/
156
156
  build/
157
157
  coverage/
158
158
  `,
159
- // No stylelint for NestJS
160
159
  cspell: () => JSON.stringify(
161
160
  {
162
161
  $schema: "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
@@ -240,7 +239,7 @@ export default defineConfig(
240
239
  trailingComma: "all",
241
240
  singleQuote: true,
242
241
  printWidth: 100,
243
- tabWidth: 3,
242
+ tabWidth: 2,
244
243
  useTabs: false,
245
244
  quoteProps: "as-needed",
246
245
  jsxSingleQuote: true,
@@ -278,7 +277,7 @@ coverage/
278
277
  [*]
279
278
  charset = utf-8
280
279
  indent_style = space
281
- indent_size = 3
280
+ indent_size = 2
282
281
  end_of_line = lf
283
282
  insert_final_newline = true
284
283
  trim_trailing_whitespace = true
@@ -432,9 +431,9 @@ trim_trailing_whitespace = false
432
431
  }
433
432
  };
434
433
 
435
- // src/presets/fmt/web.ts
436
- var webFmt = {
437
- name: "web",
434
+ // src/presets/fmt/web-vue.ts
435
+ var webVueFmt = {
436
+ name: "web-vue",
438
437
  description: "Vue 3 Web frontend (Vite + Vue + TypeScript)",
439
438
  eslint: () => `import withVue from '@vue/eslint-config-typescript'
440
439
  import withPrettier from '@vue/eslint-config-prettier/skip-formatting'
@@ -552,7 +551,7 @@ trim_trailing_whitespace = false
552
551
  };
553
552
 
554
553
  // src/presets/fmt/index.ts
555
- var FMT_PRESETS = [webFmt, electronFmt, uniappFmt, nodeFmt, nestFmt];
554
+ var FMT_PRESETS = [webVueFmt, electronVueFmt, uniappFmt, nodeFmt, nestFmt];
556
555
 
557
556
  // src/utils/logger.ts
558
557
  import chalk from "chalk";
@@ -700,6 +699,7 @@ function generateConfigFile(preset, filename, content, opts) {
700
699
  function generateAllFmt(preset, opts) {
701
700
  const result = { created: [], overwritten: [], skipped: [] };
702
701
  for (const { filename, getContent } of CONFIG_FILES) {
702
+ if (opts.noStylelint && filename.includes("stylelint")) continue;
703
703
  const content = getContent(preset);
704
704
  if (content === void 0) continue;
705
705
  const action = generateConfigFile(preset, filename, content, opts);
@@ -783,7 +783,7 @@ async function installDevDeps(packages, cwd, pm) {
783
783
  // src/commands/fmt.ts
784
784
  function registerFmtCommand(program2) {
785
785
  const fmt = program2.command("fmt").description("Initialize formatting config with preset");
786
- fmt.argument("<preset>").option("-F, --force", "Force overwrite existing files").option("--no-install", "Skip dependency installation").option("--dry-run", "Preview without writing files").action(
786
+ fmt.argument("<preset>").option("-F, --force", "Force overwrite existing files").option("--no-install", "Skip dependency installation").option("--dry-run", "Preview without writing files").option("--no-stylelint", "Skip Stylelint config generation").action(
787
787
  async (presetName, options) => {
788
788
  const preset = resolvePreset(FMT_PRESETS, presetName);
789
789
  if (!preset) return;
@@ -793,6 +793,7 @@ function registerFmtCommand(program2) {
793
793
  cwd,
794
794
  force: options.force ?? false,
795
795
  dryRun: options.dryRun ?? false,
796
+ noStylelint: options.stylelint === false,
796
797
  lockfile: pm ? getLockfileName(pm) : void 0
797
798
  };
798
799
  const result = generateAllFmt(preset, opts);
@@ -1063,12 +1064,12 @@ function registerUpdateCommand(program2) {
1063
1064
  });
1064
1065
  }
1065
1066
 
1066
- // src/presets/vscode/web.ts
1067
- var webVscode = {
1068
- name: "web",
1067
+ // src/presets/vscode/web-vue.ts
1068
+ var webVueVscode = {
1069
+ name: "web-vue",
1069
1070
  description: "VSCode config for Vue 3 Web",
1070
1071
  settings: () => ({
1071
- // ===== 编辑器爱好设置 =====
1072
+ // ===== Editor Preferences =====
1072
1073
  "editor.tabSize": 2,
1073
1074
  "editor.detectIndentation": false,
1074
1075
  "editor.insertSpaces": true,
@@ -1081,26 +1082,25 @@ var webVscode = {
1081
1082
  "source.fixAll.stylelint": "explicit",
1082
1083
  "source.organizeImports": "never"
1083
1084
  },
1084
- // 光标与动画
1085
+ // Cursor & Animation
1085
1086
  "editor.cursorBlinking": "expand",
1086
1087
  "editor.cursorSmoothCaretAnimation": "on",
1087
1088
  "editor.largeFileOptimizations": true,
1088
- // 代码辅助
1089
+ // Code Assistance
1089
1090
  "editor.inlineSuggest.enabled": true,
1090
1091
  "editor.suggestSelection": "recentlyUsedByPrefix",
1091
1092
  "editor.acceptSuggestionOnEnter": "smart",
1092
1093
  "editor.bracketPairColorization.enabled": true,
1093
1094
  "editor.autoClosingBrackets": "beforeWhitespace",
1094
1095
  "editor.autoClosingOvertype": "always",
1095
- // ===== TypeScript 专项优化 =====
1096
+ // ===== TypeScript =====
1096
1097
  "js/ts.inlayHints.enumMemberValues.enabled": true,
1097
1098
  "js/ts.preferences.preferTypeOnlyAutoImports": true,
1098
1099
  "js/ts.preferences.includePackageJsonAutoImports": "on",
1099
1100
  "js/ts.preferences.importModuleSpecifier": "relative",
1100
1101
  "js/ts.suggest.autoImports": true,
1101
1102
  "js/ts.tsserver.exclude": ["**/node_modules", "**/dist", "**/.turbo"],
1102
- "js/ts.tsdk.path": "node_modules/typescript/lib",
1103
- // ===== 语言特定格式化 =====
1103
+ // ===== Language-specific Formatting =====
1104
1104
  "[html]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
1105
1105
  "[css]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
1106
1106
  "[scss]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
@@ -1114,18 +1114,22 @@ var webVscode = {
1114
1114
  },
1115
1115
  "[json]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
1116
1116
  "[vue]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
1117
- // ===== 终端配置 =====
1117
+ // ===== Terminal =====
1118
1118
  "terminal.integrated.cursorBlinking": true,
1119
1119
  "terminal.integrated.tabs.enabled": true,
1120
1120
  "terminal.integrated.scrollback": 1e4,
1121
- // ===== 文件排除 =====
1121
+ // ===== File Exclusion =====
1122
1122
  "files.watcherExclude": {
1123
1123
  "**/.git/objects/**": true,
1124
1124
  "**/.git/subtree-cache/**": true,
1125
1125
  "**/.vscode/**": true,
1126
1126
  "**/node_modules/**": true,
1127
1127
  "**/tmp/**": true,
1128
- "**/dist/**": true
1128
+ "**/dist/**": true,
1129
+ "**/pnpm-lock.yaml": true,
1130
+ "**/package-lock.json": true,
1131
+ "**/bun.lock": true,
1132
+ "**/yarn.lock": true
1129
1133
  },
1130
1134
  "search.exclude": {
1131
1135
  "**/node_modules": true,
@@ -1136,13 +1140,16 @@ var webVscode = {
1136
1140
  "**/.vscode": false,
1137
1141
  "**/tmp": true,
1138
1142
  node_modules: true,
1139
- "**/pnpm-lock.yaml": true
1143
+ "**/pnpm-lock.yaml": true,
1144
+ "**/package-lock.json": true,
1145
+ "**/bun.lock": true,
1146
+ "**/yarn.lock": true
1140
1147
  },
1141
- // ===== 文件嵌套(美观优化)=====
1148
+ // ===== File Nesting =====
1142
1149
  "explorer.fileNesting.enabled": true,
1143
1150
  "explorer.fileNesting.expand": false,
1144
1151
  "explorer.fileNesting.patterns": {
1145
- "package.json": "pnpm-lock.yaml, .gitignore, .browserslistrc, .npmrc, cspell.json",
1152
+ "package.json": "pnpm-lock.yaml,yarn.lock,bun.lock, .gitignore, .browserslistrc, .npmrc, cspell.json,README.md, LICENSE*,.editorconfig",
1146
1153
  "eslint.config.mjs": ".prettierignore, .prettierrc, .prettierrc.json, .editorconfig",
1147
1154
  "tsconfig.json": "tsconfig.*.json",
1148
1155
  "tailwind.config.js": "postcss.config.js",
@@ -1164,7 +1171,6 @@ var webVscode = {
1164
1171
  ],
1165
1172
  // ===== Stylelint =====
1166
1173
  "stylelint.enable": true,
1167
- "stylelint.packageManager": "pnpm",
1168
1174
  "stylelint.validate": ["css", "scss", "vue"],
1169
1175
  "stylelint.customSyntax": "postcss-html",
1170
1176
  "stylelint.snippet": ["css", "scss", "vue"],
@@ -1172,9 +1178,7 @@ var webVscode = {
1172
1178
  "less.validate": false,
1173
1179
  "scss.validate": false,
1174
1180
  // ===== CSpell =====
1175
- "cSpell.language": "en",
1176
- // ===== 包管理器 =====
1177
- "npm.packageManager": "pnpm"
1181
+ "cSpell.language": "en"
1178
1182
  }),
1179
1183
  extensions: () => [
1180
1184
  "vue.volar",
@@ -1183,21 +1187,16 @@ var webVscode = {
1183
1187
  "stylelint.vscode-stylelint",
1184
1188
  "mrmlnc.vscode-scss",
1185
1189
  "streetsidesoftware.code-spell-checker",
1186
- "yoavbls.pretty-ts-errors",
1187
- "editorconfig.editorconfig",
1188
- "aaron-bond.better-comments",
1189
- "usernamehw.errorlens",
1190
- "christian-kohler.path-intellisense",
1191
- "vscode-icons-team.vscode-icons"
1190
+ "editorconfig.editorconfig"
1192
1191
  ]
1193
1192
  };
1194
1193
 
1195
1194
  // src/presets/vscode/electron.ts
1196
- var electronVscode = {
1197
- name: "electron",
1195
+ var electronVueVscode = {
1196
+ name: "electron-vue",
1198
1197
  description: "VSCode config for Vue 3 + Electron",
1199
1198
  settings: () => ({
1200
- // ===== 编辑器爱好设置 =====
1199
+ // ===== Editor Preferences =====
1201
1200
  "editor.tabSize": 2,
1202
1201
  "editor.detectIndentation": false,
1203
1202
  "editor.insertSpaces": true,
@@ -1219,7 +1218,7 @@ var electronVscode = {
1219
1218
  "editor.bracketPairColorization.enabled": true,
1220
1219
  "editor.autoClosingBrackets": "beforeWhitespace",
1221
1220
  "editor.autoClosingOvertype": "always",
1222
- // ===== TypeScript 专项优化 =====
1221
+ // ===== TypeScript =====
1223
1222
  "js/ts.inlayHints.enumMemberValues.enabled": true,
1224
1223
  "js/ts.preferences.preferTypeOnlyAutoImports": true,
1225
1224
  "js/ts.preferences.includePackageJsonAutoImports": "on",
@@ -1227,7 +1226,7 @@ var electronVscode = {
1227
1226
  "js/ts.suggest.autoImports": true,
1228
1227
  "js/ts.tsserver.exclude": ["**/node_modules", "**/dist", "**/.turbo"],
1229
1228
  "js/ts.tsdk.path": "node_modules/typescript/lib",
1230
- // ===== 语言特定格式化 =====
1229
+ // ===== Language-specific Formatting =====
1231
1230
  "[html]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
1232
1231
  "[css]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
1233
1232
  "[scss]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
@@ -1241,11 +1240,11 @@ var electronVscode = {
1241
1240
  },
1242
1241
  "[json]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
1243
1242
  "[vue]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
1244
- // ===== 终端配置 =====
1243
+ // ===== Terminal =====
1245
1244
  "terminal.integrated.cursorBlinking": true,
1246
1245
  "terminal.integrated.tabs.enabled": true,
1247
1246
  "terminal.integrated.scrollback": 1e4,
1248
- // ===== 文件排除 =====
1247
+ // ===== File Exclusion =====
1249
1248
  "files.watcherExclude": {
1250
1249
  "**/.git/objects/**": true,
1251
1250
  "**/.git/subtree-cache/**": true,
@@ -1254,7 +1253,11 @@ var electronVscode = {
1254
1253
  "**/tmp/**": true,
1255
1254
  "**/dist/**": true,
1256
1255
  "**/release/**": true,
1257
- "**/out/**": true
1256
+ "**/out/**": true,
1257
+ "**/pnpm-lock.yaml": true,
1258
+ "**/package-lock.json": true,
1259
+ "**/bun.lock": true,
1260
+ "**/yarn.lock": true
1258
1261
  },
1259
1262
  "search.exclude": {
1260
1263
  "**/node_modules": true,
@@ -1267,14 +1270,17 @@ var electronVscode = {
1267
1270
  "**/.vscode": false,
1268
1271
  "**/tmp": true,
1269
1272
  node_modules: true,
1270
- "**/pnpm-lock.yaml": true
1273
+ "**/pnpm-lock.yaml": true,
1274
+ "**/package-lock.json": true,
1275
+ "**/bun.lock": true,
1276
+ "**/yarn.lock": true
1271
1277
  },
1272
- // ===== 文件嵌套 =====
1278
+ // ===== File Nesting =====
1273
1279
  "explorer.fileNesting.enabled": true,
1274
1280
  "explorer.fileNesting.expand": false,
1275
1281
  "explorer.fileNesting.patterns": {
1276
- "package.json": "pnpm-lock.yaml, .gitignore, .browserslistrc, .npmrc, cspell.json",
1277
- "eslint.config.mjs": ".prettierignore, .prettierrc.json, .editorconfig",
1282
+ "package.json": "pnpm-lock.yaml,yarn.lock,bun.lock, .gitignore, .browserslistrc, .npmrc, cspell.json,README.md, LICENSE*,.editorconfig",
1283
+ "eslint.config.mjs": ".prettierignore, .prettierrc, .prettierrc.json, .editorconfig",
1278
1284
  "tsconfig.json": "tsconfig.*.json",
1279
1285
  "tailwind.config.js": "postcss.config.js",
1280
1286
  "vite.config.{js,ts}": "vite.*.{js,ts}",
@@ -1306,7 +1312,7 @@ var electronVscode = {
1306
1312
  "scss.validate": false,
1307
1313
  // ===== CSpell =====
1308
1314
  "cSpell.language": "en",
1309
- // ===== 包管理器 =====
1315
+ // ===== Package Manager =====
1310
1316
  "npm.packageManager": "pnpm"
1311
1317
  }),
1312
1318
  extensions: () => [
@@ -1316,12 +1322,7 @@ var electronVscode = {
1316
1322
  "stylelint.vscode-stylelint",
1317
1323
  "mrmlnc.vscode-scss",
1318
1324
  "streetsidesoftware.code-spell-checker",
1319
- "yoavbls.pretty-ts-errors",
1320
- "editorconfig.editorconfig",
1321
- "aaron-bond.better-comments",
1322
- "usernamehw.errorlens",
1323
- "christian-kohler.path-intellisense",
1324
- "vscode-icons-team.vscode-icons"
1325
+ "editorconfig.editorconfig"
1325
1326
  ]
1326
1327
  };
1327
1328
 
@@ -1330,7 +1331,7 @@ var uniappVscode = {
1330
1331
  name: "uniapp",
1331
1332
  description: "VSCode config for UniApp",
1332
1333
  settings: () => ({
1333
- // ===== 编辑器爱好设置 =====
1334
+ // ===== Editor Preferences =====
1334
1335
  "editor.tabSize": 2,
1335
1336
  "editor.detectIndentation": false,
1336
1337
  "editor.insertSpaces": true,
@@ -1352,7 +1353,7 @@ var uniappVscode = {
1352
1353
  "editor.bracketPairColorization.enabled": true,
1353
1354
  "editor.autoClosingBrackets": "beforeWhitespace",
1354
1355
  "editor.autoClosingOvertype": "always",
1355
- // ===== TypeScript 专项优化 =====
1356
+ // ===== TypeScript =====
1356
1357
  "js/ts.inlayHints.enumMemberValues.enabled": true,
1357
1358
  "js/ts.preferences.preferTypeOnlyAutoImports": true,
1358
1359
  "js/ts.preferences.includePackageJsonAutoImports": "on",
@@ -1360,7 +1361,7 @@ var uniappVscode = {
1360
1361
  "js/ts.suggest.autoImports": true,
1361
1362
  "js/ts.tsserver.exclude": ["**/node_modules", "**/dist", "**/unpackage"],
1362
1363
  "js/ts.tsdk.path": "node_modules/typescript/lib",
1363
- // ===== 语言特定格式化 =====
1364
+ // ===== Language-specific Formatting =====
1364
1365
  "[html]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
1365
1366
  "[css]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
1366
1367
  "[scss]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
@@ -1374,18 +1375,22 @@ var uniappVscode = {
1374
1375
  },
1375
1376
  "[json]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
1376
1377
  "[vue]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
1377
- // ===== 终端配置 =====
1378
+ // ===== Terminal =====
1378
1379
  "terminal.integrated.cursorBlinking": true,
1379
1380
  "terminal.integrated.tabs.enabled": true,
1380
1381
  "terminal.integrated.scrollback": 1e4,
1381
- // ===== 文件排除 =====
1382
+ // ===== File Exclusion =====
1382
1383
  "files.watcherExclude": {
1383
1384
  "**/.git/objects/**": true,
1384
1385
  "**/.git/subtree-cache/**": true,
1385
1386
  "**/node_modules/**": true,
1386
1387
  "**/tmp/**": true,
1387
1388
  "**/dist/**": true,
1388
- "**/unpackage/**": true
1389
+ "**/unpackage/**": true,
1390
+ "**/pnpm-lock.yaml": true,
1391
+ "**/package-lock.json": true,
1392
+ "**/bun.lock": true,
1393
+ "**/yarn.lock": true
1389
1394
  },
1390
1395
  "search.exclude": {
1391
1396
  "**/node_modules": true,
@@ -1394,14 +1399,17 @@ var uniappVscode = {
1394
1399
  "**/unpackage": true,
1395
1400
  "**/.git": true,
1396
1401
  "**/tmp": true,
1397
- "**/pnpm-lock.yaml": true
1402
+ "**/pnpm-lock.yaml": true,
1403
+ "**/package-lock.json": true,
1404
+ "**/bun.lock": true,
1405
+ "**/yarn.lock": true
1398
1406
  },
1399
- // ===== 文件嵌套 =====
1407
+ // ===== File Nesting =====
1400
1408
  "explorer.fileNesting.enabled": true,
1401
1409
  "explorer.fileNesting.expand": false,
1402
1410
  "explorer.fileNesting.patterns": {
1403
- "package.json": "pnpm-lock.yaml, .gitignore, manifest.json, pages.json",
1404
- "eslint.config.mjs": ".prettierignore, .prettierrc.json",
1411
+ "package.json": "pnpm-lock.yaml,yarn.lock,bun.lock, .gitignore, manifest.json, pages.json,cspell.json,README.md, LICENSE*,.editorconfig",
1412
+ "eslint.config.mjs": ".prettierignore, .prettierrc, .prettierrc.json, .editorconfig",
1405
1413
  "tsconfig.json": "tsconfig.*.json",
1406
1414
  ".env": ".env.*"
1407
1415
  },
@@ -1420,7 +1428,6 @@ var uniappVscode = {
1420
1428
  ],
1421
1429
  // ===== Stylelint =====
1422
1430
  "stylelint.enable": true,
1423
- "stylelint.packageManager": "pnpm",
1424
1431
  "stylelint.validate": ["css", "scss", "vue"],
1425
1432
  "stylelint.customSyntax": "postcss-html",
1426
1433
  "stylelint.snippet": ["css", "scss", "vue"],
@@ -1428,9 +1435,7 @@ var uniappVscode = {
1428
1435
  "less.validate": false,
1429
1436
  "scss.validate": false,
1430
1437
  // ===== CSpell =====
1431
- "cSpell.language": "en",
1432
- // ===== 包管理器 =====
1433
- "npm.packageManager": "pnpm"
1438
+ "cSpell.language": "en"
1434
1439
  }),
1435
1440
  extensions: () => [
1436
1441
  "vue.volar",
@@ -1439,12 +1444,7 @@ var uniappVscode = {
1439
1444
  "stylelint.vscode-stylelint",
1440
1445
  "mrmlnc.vscode-scss",
1441
1446
  "streetsidesoftware.code-spell-checker",
1442
- "yoavbls.pretty-ts-errors",
1443
- "editorconfig.editorconfig",
1444
- "aaron-bond.better-comments",
1445
- "usernamehw.errorlens",
1446
- "christian-kohler.path-intellisense",
1447
- "vscode-icons-team.vscode-icons"
1447
+ "editorconfig.editorconfig"
1448
1448
  ]
1449
1449
  };
1450
1450
 
@@ -1453,8 +1453,8 @@ var nodeVscode = {
1453
1453
  name: "node",
1454
1454
  description: "VSCode config for Node.js",
1455
1455
  settings: () => ({
1456
- // ===== 编辑器爱好设置 =====
1457
- "editor.tabSize": 3,
1456
+ // ===== Editor Preferences =====
1457
+ "editor.tabSize": 2,
1458
1458
  "editor.detectIndentation": false,
1459
1459
  "editor.insertSpaces": true,
1460
1460
  "editor.renderWhitespace": "selection",
@@ -1474,15 +1474,14 @@ var nodeVscode = {
1474
1474
  "editor.bracketPairColorization.enabled": true,
1475
1475
  "editor.autoClosingBrackets": "beforeWhitespace",
1476
1476
  "editor.autoClosingOvertype": "always",
1477
- // ===== TypeScript 专项优化 =====
1477
+ // ===== TypeScript =====
1478
1478
  "js/ts.inlayHints.enumMemberValues.enabled": true,
1479
1479
  "js/ts.preferences.preferTypeOnlyAutoImports": true,
1480
1480
  "js/ts.preferences.includePackageJsonAutoImports": "on",
1481
1481
  "js/ts.preferences.importModuleSpecifier": "relative",
1482
1482
  "js/ts.suggest.autoImports": true,
1483
1483
  "js/ts.tsserver.exclude": ["**/node_modules", "**/dist"],
1484
- "js/ts.tsdk.path": "node_modules/typescript/lib",
1485
- // ===== 语言特定格式化 =====
1484
+ // ===== Language-specific Formatting =====
1486
1485
  "[typescript]": {
1487
1486
  "editor.defaultFormatter": "esbenp.prettier-vscode",
1488
1487
  "editor.formatOnSave": true
@@ -1492,17 +1491,21 @@ var nodeVscode = {
1492
1491
  "editor.formatOnSave": true
1493
1492
  },
1494
1493
  "[json]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
1495
- // ===== 终端配置 =====
1494
+ // ===== Terminal =====
1496
1495
  "terminal.integrated.cursorBlinking": true,
1497
1496
  "terminal.integrated.tabs.enabled": true,
1498
1497
  "terminal.integrated.scrollback": 1e4,
1499
- // ===== 文件排除 =====
1498
+ // ===== File Exclusion =====
1500
1499
  "files.watcherExclude": {
1501
1500
  "**/.git/objects/**": true,
1502
1501
  "**/.git/subtree-cache/**": true,
1503
1502
  "**/node_modules/**": true,
1504
1503
  "**/tmp/**": true,
1505
- "**/dist/**": true
1504
+ "**/dist/**": true,
1505
+ "**/pnpm-lock.yaml": true,
1506
+ "**/package-lock.json": true,
1507
+ "**/bun.lock": true,
1508
+ "**/yarn.lock": true
1506
1509
  },
1507
1510
  "search.exclude": {
1508
1511
  "**/node_modules": true,
@@ -1511,13 +1514,16 @@ var nodeVscode = {
1511
1514
  "**/.git": true,
1512
1515
  "**/tmp": true,
1513
1516
  node_modules: true,
1514
- "**/bun.lock": true
1517
+ "**/pnpm-lock.yaml": true,
1518
+ "**/package-lock.json": true,
1519
+ "**/bun.lock": true,
1520
+ "**/yarn.lock": true
1515
1521
  },
1516
- // ===== 文件嵌套 =====
1522
+ // ===== File Nesting =====
1517
1523
  "explorer.fileNesting.enabled": true,
1518
1524
  "explorer.fileNesting.expand": false,
1519
1525
  "explorer.fileNesting.patterns": {
1520
- "package.json": "bun.lock, .gitignore, .npmrc, cspell.json",
1526
+ "package.json": "pnpm-lock.yaml,yarn.lock,bun.lock, .gitignore, .npmrc, cspell.json,README.md,LICENSE*,.editorconfig",
1521
1527
  "eslint.config.mjs": ".prettierignore, .prettierrc.json, .editorconfig,.prettierrc",
1522
1528
  "tsconfig.json": "tsconfig.*.json",
1523
1529
  ".env": ".env.*"
@@ -1525,20 +1531,13 @@ var nodeVscode = {
1525
1531
  // ===== ESLint =====
1526
1532
  "eslint.validate": ["javascript", "typescript", "json", "jsonc", "json5"],
1527
1533
  // ===== CSpell =====
1528
- "cSpell.language": "en",
1529
- // ===== 包管理器 =====
1530
- "npm.packageManager": "bun"
1534
+ "cSpell.language": "en"
1531
1535
  }),
1532
1536
  extensions: () => [
1533
1537
  "dbaeumer.vscode-eslint",
1534
1538
  "esbenp.prettier-vscode",
1535
1539
  "streetsidesoftware.code-spell-checker",
1536
- "yoavbls.pretty-ts-errors",
1537
- "editorconfig.editorconfig",
1538
- "aaron-bond.better-comments",
1539
- "usernamehw.errorlens",
1540
- "christian-kohler.path-intellisense",
1541
- "vscode-icons-team.vscode-icons"
1540
+ "editorconfig.editorconfig"
1542
1541
  ]
1543
1542
  };
1544
1543
 
@@ -1547,7 +1546,7 @@ var nestVscode = {
1547
1546
  name: "nest",
1548
1547
  description: "VSCode config for NestJS",
1549
1548
  settings: () => ({
1550
- // ===== 编辑器爱好设置 =====
1549
+ // ===== Editor Preferences =====
1551
1550
  "editor.tabSize": 2,
1552
1551
  "editor.detectIndentation": false,
1553
1552
  "editor.insertSpaces": true,
@@ -1565,7 +1564,7 @@ var nestVscode = {
1565
1564
  "editor.bracketPairColorization.enabled": true,
1566
1565
  "editor.autoClosingBrackets": "beforeWhitespace",
1567
1566
  "editor.autoClosingOvertype": "always",
1568
- // ===== TypeScript 专项优化 =====
1567
+ // ===== TypeScript =====
1569
1568
  "js/ts.inlayHints.enumMemberValues.enabled": true,
1570
1569
  "js/ts.preferences.preferTypeOnlyAutoImports": true,
1571
1570
  "js/ts.preferences.includePackageJsonAutoImports": "on",
@@ -1573,7 +1572,7 @@ var nestVscode = {
1573
1572
  "js/ts.suggest.autoImports": true,
1574
1573
  "js/ts.tsserver.exclude": ["**/node_modules", "**/dist", "**/.turbo"],
1575
1574
  "js/ts.tsdk.path": "node_modules/typescript/lib",
1576
- // ===== 语言特定格式化 =====
1575
+ // ===== Language-specific Formatting =====
1577
1576
  "[typescript]": {
1578
1577
  "editor.defaultFormatter": "esbenp.prettier-vscode",
1579
1578
  "editor.formatOnSave": true
@@ -1583,17 +1582,21 @@ var nestVscode = {
1583
1582
  "editor.formatOnSave": true
1584
1583
  },
1585
1584
  "[json]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
1586
- // ===== 终端配置 =====
1585
+ // ===== Terminal =====
1587
1586
  "terminal.integrated.cursorBlinking": true,
1588
1587
  "terminal.integrated.tabs.enabled": true,
1589
1588
  "terminal.integrated.scrollback": 1e4,
1590
- // ===== 文件排除 =====
1589
+ // ===== File Exclusion =====
1591
1590
  "files.watcherExclude": {
1592
1591
  "**/.git/objects/**": true,
1593
1592
  "**/.git/subtree-cache/**": true,
1594
1593
  "**/node_modules/**": true,
1595
1594
  "**/tmp/**": true,
1596
- "**/dist/**": true
1595
+ "**/dist/**": true,
1596
+ "**/pnpm-lock.yaml": true,
1597
+ "**/package-lock.json": true,
1598
+ "**/bun.lock": true,
1599
+ "**/yarn.lock": true
1597
1600
  },
1598
1601
  "search.exclude": {
1599
1602
  "**/node_modules": true,
@@ -1601,14 +1604,17 @@ var nestVscode = {
1601
1604
  "**/dist": true,
1602
1605
  "**/.git": true,
1603
1606
  "**/tmp": true,
1604
- "**/pnpm-lock.yaml": true
1607
+ "**/pnpm-lock.yaml": true,
1608
+ "**/package-lock.json": true,
1609
+ "**/bun.lock": true,
1610
+ "**/yarn.lock": true
1605
1611
  },
1606
- // ===== 文件嵌套 =====
1612
+ // ===== File Nesting =====
1607
1613
  "explorer.fileNesting.enabled": true,
1608
1614
  "explorer.fileNesting.expand": false,
1609
1615
  "explorer.fileNesting.patterns": {
1610
- "package.json": "pnpm-lock.yaml, .gitignore, .npmrc, nest-cli.json",
1611
- "eslint.config.mjs": ".prettierignore, .prettierrc.json, .editorconfig",
1616
+ "package.json": "pnpm-lock.yaml,yarn.lock,bun.lock, .gitignore, .npmrc, nest-cli.json,cspell.json,README.md, LICENSE*,.editorconfig",
1617
+ "eslint.config.mjs": ".prettierignore, .prettierrc, .prettierrc.json, .editorconfig",
1612
1618
  "tsconfig.json": "tsconfig.*.json",
1613
1619
  ".env": ".env.*",
1614
1620
  "*.controller.ts": "$(capture).controller.spec.ts",
@@ -1636,13 +1642,7 @@ var nestVscode = {
1636
1642
  "dbaeumer.vscode-eslint",
1637
1643
  "esbenp.prettier-vscode",
1638
1644
  "streetsidesoftware.code-spell-checker",
1639
- "yoavbls.pretty-ts-errors",
1640
- "editorconfig.editorconfig",
1641
- "firsttris.vscode-jest-runner",
1642
- "aaron-bond.better-comments",
1643
- "usernamehw.errorlens",
1644
- "christian-kohler.path-intellisense",
1645
- "vscode-icons-team.vscode-icons"
1645
+ "editorconfig.editorconfig"
1646
1646
  ]
1647
1647
  };
1648
1648
 
@@ -1681,8 +1681,8 @@ var goVscode = {
1681
1681
 
1682
1682
  // src/presets/vscode/index.ts
1683
1683
  var VSCODE_PRESETS = [
1684
- webVscode,
1685
- electronVscode,
1684
+ webVueVscode,
1685
+ electronVueVscode,
1686
1686
  uniappVscode,
1687
1687
  nodeVscode,
1688
1688
  nestVscode,
@@ -1735,13 +1735,21 @@ function isPlainObject(val) {
1735
1735
  }
1736
1736
 
1737
1737
  // src/generators/vscode.ts
1738
+ var STYLELINT_SETTINGS_PREFIXES = [
1739
+ "stylelint.",
1740
+ "css.validate",
1741
+ "less.validate",
1742
+ "scss.validate"
1743
+ ];
1744
+ var STYLELINT_EXTENSION = "stylelint.vscode-stylelint";
1738
1745
  function generateVscodeSettings(preset, opts) {
1739
1746
  const settingsPath = `${opts.cwd}/.vscode/settings.json`;
1740
1747
  if (opts.dryRun) {
1741
1748
  const existingSettings2 = readJson(settingsPath);
1742
1749
  return existingSettings2 ? "overwritten" : "created";
1743
1750
  }
1744
- const presetSettings = preset.settings();
1751
+ const rawSettings = preset.settings();
1752
+ const presetSettings = opts.noStylelint ? filterStylelintSettings(rawSettings) : rawSettings;
1745
1753
  const existingSettings = readJson(settingsPath);
1746
1754
  if (existingSettings) {
1747
1755
  const backupPath = `${settingsPath}.bak`;
@@ -1758,7 +1766,8 @@ function generateVscodeSettings(preset, opts) {
1758
1766
  }
1759
1767
  function generateVscodeExtensions(preset, opts) {
1760
1768
  if (opts.dryRun) return "created";
1761
- writeJson(`${opts.cwd}/.vscode/extensions.json`, { recommendations: preset.extensions() });
1769
+ const extensions = opts.noStylelint ? preset.extensions().filter((ext) => ext !== STYLELINT_EXTENSION) : preset.extensions();
1770
+ writeJson(`${opts.cwd}/.vscode/extensions.json`, { recommendations: extensions });
1762
1771
  return "created";
1763
1772
  }
1764
1773
  function generateAllVscode(preset, opts) {
@@ -1770,31 +1779,47 @@ function generateAllVscode(preset, opts) {
1770
1779
  if (extAction === "created") result.created.push(".vscode/extensions.json");
1771
1780
  return result;
1772
1781
  }
1782
+ function filterStylelintSettings(settings) {
1783
+ const filtered = Object.fromEntries(
1784
+ Object.entries(settings).filter(
1785
+ ([key]) => !STYLELINT_SETTINGS_PREFIXES.some((prefix) => key.startsWith(prefix))
1786
+ )
1787
+ );
1788
+ if (typeof filtered["editor.codeActionsOnSave"] === "object" && filtered["editor.codeActionsOnSave"] !== null) {
1789
+ const actions = { ...filtered["editor.codeActionsOnSave"] };
1790
+ delete actions["source.fixAll.stylelint"];
1791
+ filtered["editor.codeActionsOnSave"] = actions;
1792
+ }
1793
+ return filtered;
1794
+ }
1773
1795
 
1774
1796
  // src/commands/vscode.ts
1775
1797
  function registerVscodeCommand(program2) {
1776
1798
  const vscode = program2.command("vscode").description("Initialize VSCode config with preset");
1777
- vscode.argument("<preset>").option("-F, --force", "Force overwrite existing files").option("--dry-run", "Preview without writing files").action(async (presetName, options) => {
1778
- const preset = resolvePreset(VSCODE_PRESETS, presetName);
1779
- if (!preset) return;
1780
- const cwd = process.cwd();
1781
- const opts = {
1782
- cwd,
1783
- force: options.force ?? false,
1784
- dryRun: options.dryRun ?? false
1785
- };
1786
- const result = generateAllVscode(preset, opts);
1787
- const files = [...result.created, ...result.overwritten];
1788
- if (files.length === 0) {
1789
- logger.warn("No files generated");
1790
- return;
1791
- }
1792
- if (opts.dryRun) {
1793
- logger.log(`[dry-run] Would create ${files.join(", ")}`);
1794
- return;
1799
+ vscode.argument("<preset>").option("-F, --force", "Force overwrite existing files").option("--dry-run", "Preview without writing files").option("--no-stylelint", "Skip Stylelint settings and extension").action(
1800
+ async (presetName, options) => {
1801
+ const preset = resolvePreset(VSCODE_PRESETS, presetName);
1802
+ if (!preset) return;
1803
+ const cwd = process.cwd();
1804
+ const opts = {
1805
+ cwd,
1806
+ force: options.force ?? false,
1807
+ dryRun: options.dryRun ?? false,
1808
+ noStylelint: options.stylelint === false
1809
+ };
1810
+ const result = generateAllVscode(preset, opts);
1811
+ const files = [...result.created, ...result.overwritten];
1812
+ if (files.length === 0) {
1813
+ logger.warn("No files generated");
1814
+ return;
1815
+ }
1816
+ if (opts.dryRun) {
1817
+ logger.log(`[dry-run] Would create ${files.join(", ")}`);
1818
+ return;
1819
+ }
1820
+ logger.log(`Created ${files.join(", ")}`);
1795
1821
  }
1796
- logger.log(`Created ${files.join(", ")}`);
1797
- });
1822
+ );
1798
1823
  vscode.command("list").description("List available vscode presets").action(() => {
1799
1824
  for (const p of VSCODE_PRESETS) {
1800
1825
  console.log(`${p.name.padEnd(12)} ${p.description}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luxkit/cli",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "One-click project formatting & VSCode config CLI",
5
5
  "type": "module",
6
6
  "bin": {