@linter-spec/cli 1.0.0

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 (105) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +114 -0
  3. package/dist/actions/init/index.d.ts +2 -0
  4. package/dist/actions/init/index.js +67 -0
  5. package/dist/actions/init/install-deps.d.ts +9 -0
  6. package/dist/actions/init/install-deps.js +36 -0
  7. package/dist/actions/init/prompts.d.ts +4 -0
  8. package/dist/actions/init/prompts.js +10 -0
  9. package/dist/actions/init/setup-husky.d.ts +7 -0
  10. package/dist/actions/init/setup-husky.js +18 -0
  11. package/dist/actions/init/write-vscode.d.ts +4 -0
  12. package/dist/actions/init/write-vscode.js +7 -0
  13. package/dist/actions/scan/index.d.ts +5 -0
  14. package/dist/actions/scan/index.js +20 -0
  15. package/dist/actions/scan/orchestrate.d.ts +6 -0
  16. package/dist/actions/scan/orchestrate.js +49 -0
  17. package/dist/actions/update.d.ts +5 -0
  18. package/dist/actions/update.js +61 -0
  19. package/dist/cli.d.ts +2 -0
  20. package/dist/cli.js +9 -0
  21. package/dist/commands/commit-file-scan.d.ts +2 -0
  22. package/dist/commands/commit-file-scan.js +35 -0
  23. package/dist/commands/commit-msg-scan.d.ts +2 -0
  24. package/dist/commands/commit-msg-scan.js +24 -0
  25. package/dist/commands/fix.d.ts +2 -0
  26. package/dist/commands/fix.js +26 -0
  27. package/dist/commands/index.d.ts +3 -0
  28. package/dist/commands/index.js +15 -0
  29. package/dist/commands/init.d.ts +2 -0
  30. package/dist/commands/init.js +31 -0
  31. package/dist/commands/scan.d.ts +2 -0
  32. package/dist/commands/scan.js +36 -0
  33. package/dist/commands/update.d.ts +2 -0
  34. package/dist/commands/update.js +8 -0
  35. package/dist/config/_editorconfig.ejs +13 -0
  36. package/dist/config/_markdownlint-cli2.cjs.ejs +13 -0
  37. package/dist/config/_stylelintignore.ejs +5 -0
  38. package/dist/config/_vscode/extensions.json.ejs +9 -0
  39. package/dist/config/_vscode/settings.json.ejs +26 -0
  40. package/dist/config/commitlint.config.mjs.ejs +3 -0
  41. package/dist/config/eslint.config.mjs.ejs +16 -0
  42. package/dist/config/linter-spec.config.mjs.ejs +6 -0
  43. package/dist/config/prettier.config.mjs.ejs +10 -0
  44. package/dist/config/stylelint.config.mjs.ejs +5 -0
  45. package/dist/index.d.ts +6 -0
  46. package/dist/index.js +23 -0
  47. package/dist/lints/eslint/do-eslint.d.ts +7 -0
  48. package/dist/lints/eslint/do-eslint.js +31 -0
  49. package/dist/lints/eslint/format-results.d.ts +6 -0
  50. package/dist/lints/eslint/format-results.js +25 -0
  51. package/dist/lints/eslint/get-config-type.d.ts +12 -0
  52. package/dist/lints/eslint/get-config-type.js +30 -0
  53. package/dist/lints/eslint/get-config.d.ts +10 -0
  54. package/dist/lints/eslint/get-config.js +39 -0
  55. package/dist/lints/eslint/index.d.ts +4 -0
  56. package/dist/lints/eslint/index.js +4 -0
  57. package/dist/lints/index.d.ts +4 -0
  58. package/dist/lints/index.js +4 -0
  59. package/dist/lints/markdownlint/do-markdownlint.d.ts +7 -0
  60. package/dist/lints/markdownlint/do-markdownlint.js +33 -0
  61. package/dist/lints/markdownlint/format-results.d.ts +7 -0
  62. package/dist/lints/markdownlint/format-results.js +38 -0
  63. package/dist/lints/markdownlint/get-config.d.ts +10 -0
  64. package/dist/lints/markdownlint/get-config.js +31 -0
  65. package/dist/lints/markdownlint/index.d.ts +3 -0
  66. package/dist/lints/markdownlint/index.js +3 -0
  67. package/dist/lints/prettier/do-prettier.d.ts +2 -0
  68. package/dist/lints/prettier/do-prettier.js +31 -0
  69. package/dist/lints/prettier/index.d.ts +1 -0
  70. package/dist/lints/prettier/index.js +1 -0
  71. package/dist/lints/resolve-files.d.ts +10 -0
  72. package/dist/lints/resolve-files.js +20 -0
  73. package/dist/lints/stylelint/do-stylelint.d.ts +7 -0
  74. package/dist/lints/stylelint/do-stylelint.js +15 -0
  75. package/dist/lints/stylelint/format-results.d.ts +6 -0
  76. package/dist/lints/stylelint/format-results.js +39 -0
  77. package/dist/lints/stylelint/get-config.d.ts +7 -0
  78. package/dist/lints/stylelint/get-config.js +33 -0
  79. package/dist/lints/stylelint/get-doc-url.d.ts +4 -0
  80. package/dist/lints/stylelint/get-doc-url.js +18 -0
  81. package/dist/lints/stylelint/index.d.ts +4 -0
  82. package/dist/lints/stylelint/index.js +4 -0
  83. package/dist/types.d.ts +85 -0
  84. package/dist/types.js +1 -0
  85. package/dist/utils/conflict-resolve.d.ts +2 -0
  86. package/dist/utils/conflict-resolve.js +103 -0
  87. package/dist/utils/constants.d.ts +43 -0
  88. package/dist/utils/constants.js +91 -0
  89. package/dist/utils/errors.d.ts +9 -0
  90. package/dist/utils/errors.js +12 -0
  91. package/dist/utils/generate-template.d.ts +7 -0
  92. package/dist/utils/generate-template.js +67 -0
  93. package/dist/utils/git.d.ts +9 -0
  94. package/dist/utils/git.js +28 -0
  95. package/dist/utils/log.d.ts +8 -0
  96. package/dist/utils/log.js +23 -0
  97. package/dist/utils/messages.d.ts +47 -0
  98. package/dist/utils/messages.js +54 -0
  99. package/dist/utils/npm.d.ts +20 -0
  100. package/dist/utils/npm.js +76 -0
  101. package/dist/utils/print-report.d.ts +5 -0
  102. package/dist/utils/print-report.js +63 -0
  103. package/dist/utils/read-config.d.ts +3 -0
  104. package/dist/utils/read-config.js +15 -0
  105. package/package.json +88 -0
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Centralised user-facing strings (Chinese), parameterised by the CLI name so
3
+ * renames stay in one place.
4
+ */
5
+ export declare const messages: {
6
+ readonly description: "linter-spec 是配套 linter-spec 前端编码规范的 Lint 工具,提供简单的 CLI 和 Node.js API,让项目一键接入、一键扫描、一键修复、一键升级,并配置 git commit 卡点。";
7
+ readonly initDescription: "一键接入:为项目初始化规范工具和配置,可根据项目类型和需求定制";
8
+ readonly scanDescription: "一键扫描:对项目进行代码规范问题扫描";
9
+ readonly fixDescription: "一键修复:自动修复项目的代码规范扫描问题";
10
+ readonly updateDescription: `\u66F4\u65B0 ${string} \u81F3\u6700\u65B0\u7248\u672C`;
11
+ readonly commitMsgScanDescription: "commit message 检查:git commit 时对 commit message 进行检查";
12
+ readonly commitFileScanDescription: "代码提交检查:git commit 时对提交代码进行规范问题扫描";
13
+ readonly optVscode: "写入 .vscode/settings.json 配置";
14
+ readonly optQuiet: "仅报告错误信息 - 默认: false";
15
+ readonly optOutputReport: "输出扫描出的规范问题日志";
16
+ readonly optInclude: "指定要进行规范扫描的目录";
17
+ readonly optNoIgnore: "忽略 eslint 的 ignore 配置文件和 ignore 规则";
18
+ readonly optStrict: "严格模式,对 warn 和 error 问题都卡口,默认仅对 error 问题卡口";
19
+ readonly runChecking: "执行 linter-spec 代码检查";
20
+ readonly runFixing: "执行 linter-spec 代码修复";
21
+ readonly runCommitChecking: "执行 linter-spec 代码提交检查";
22
+ readonly installingDeps: (npm: string) => string;
23
+ readonly notStaged: (files: string) => string;
24
+ readonly stepChooseType: (step: number) => string;
25
+ readonly stepEnableStylelint: (step: number) => string;
26
+ readonly stepEnableMarkdownlint: (step: number) => string;
27
+ readonly stepEnablePrettier: (step: number) => string;
28
+ readonly stepConflict: (step: number) => string;
29
+ readonly stepConflictDone: (step: number) => string;
30
+ readonly stepInstall: (step: number) => string;
31
+ readonly stepInstallDone: (step: number) => string;
32
+ readonly stepHusky: (step: number) => string;
33
+ readonly stepHuskyDone: (step: number) => string;
34
+ readonly stepWrite: (step: number) => string;
35
+ readonly stepWriteDone: (step: number) => string;
36
+ readonly initDone: "linter-spec 初始化完成 :D";
37
+ readonly conflictDetected: "检测到项目中存在可能与 linter-spec 冲突的依赖和配置,为保证正常运行将";
38
+ readonly conflictRemoveDeps: "删除以下依赖:";
39
+ readonly conflictRemoveConfig: "删除以下配置文件:";
40
+ readonly conflictRewriteConfig: "覆盖以下配置文件:";
41
+ readonly conflictConfirm: "请确认是否继续:";
42
+ readonly conflictCancelled: "已取消,未修改任何文件。";
43
+ readonly updateChecking: `[${string}] \u6B63\u5728\u68C0\u67E5\u6700\u65B0\u7248\u672C...`;
44
+ readonly updateFound: (v: string) => string;
45
+ readonly updateHint: (latest: string, current: string, command: string) => string;
46
+ readonly updateNone: "当前没有可用的更新";
47
+ };
@@ -0,0 +1,54 @@
1
+ import { CLI_NAME, PKG_NAME } from './constants.js';
2
+ /**
3
+ * Centralised user-facing strings (Chinese), parameterised by the CLI name so
4
+ * renames stay in one place.
5
+ */
6
+ export const messages = {
7
+ description: `${CLI_NAME} 是配套 linter-spec 前端编码规范的 Lint 工具,提供简单的 CLI 和 Node.js API,让项目一键接入、一键扫描、一键修复、一键升级,并配置 git commit 卡点。`,
8
+ // command descriptions
9
+ initDescription: '一键接入:为项目初始化规范工具和配置,可根据项目类型和需求定制',
10
+ scanDescription: '一键扫描:对项目进行代码规范问题扫描',
11
+ fixDescription: '一键修复:自动修复项目的代码规范扫描问题',
12
+ updateDescription: `更新 ${PKG_NAME} 至最新版本`,
13
+ commitMsgScanDescription: 'commit message 检查:git commit 时对 commit message 进行检查',
14
+ commitFileScanDescription: '代码提交检查:git commit 时对提交代码进行规范问题扫描',
15
+ // option descriptions
16
+ optVscode: '写入 .vscode/settings.json 配置',
17
+ optQuiet: '仅报告错误信息 - 默认: false',
18
+ optOutputReport: '输出扫描出的规范问题日志',
19
+ optInclude: '指定要进行规范扫描的目录',
20
+ optNoIgnore: '忽略 eslint 的 ignore 配置文件和 ignore 规则',
21
+ optStrict: '严格模式,对 warn 和 error 问题都卡口,默认仅对 error 问题卡口',
22
+ // runtime
23
+ runChecking: `执行 ${CLI_NAME} 代码检查`,
24
+ runFixing: `执行 ${CLI_NAME} 代码修复`,
25
+ runCommitChecking: `执行 ${CLI_NAME} 代码提交检查`,
26
+ installingDeps: (npm) => `使用项目 Lint 配置,检测到项目未安装依赖,将进行安装(执行 ${npm} install)`,
27
+ notStaged: (files) => `[${CLI_NAME}] changes not staged for commit: \n${files}\n`,
28
+ // init steps
29
+ stepChooseType: (step) => `Step ${step}. 请选择项目的语言(JS/TS)和框架(React/Vue)类型:`,
30
+ stepEnableStylelint: (step) => `Step ${step}. 是否需要使用 stylelint(若没有样式文件则不需要):`,
31
+ stepEnableMarkdownlint: (step) => `Step ${step}. 是否需要使用 markdownlint(若没有 Markdown 文件则不需要):`,
32
+ stepEnablePrettier: (step) => `Step ${step}. 是否需要使用 Prettier 格式化代码:`,
33
+ stepConflict: (step) => `Step ${step}. 检查并处理项目中可能存在的依赖和配置冲突`,
34
+ stepConflictDone: (step) => `Step ${step}. 已完成项目依赖和配置冲突检查处理 :D`,
35
+ stepInstall: (step) => `Step ${step}. 安装依赖`,
36
+ stepInstallDone: (step) => `Step ${step}. 安装依赖成功 :D`,
37
+ stepHusky: (step) => `Step ${step}. 配置 git commit 卡点`,
38
+ stepHuskyDone: (step) => `Step ${step}. 配置 git commit 卡点成功 :D`,
39
+ stepWrite: (step) => `Step ${step}. 写入配置文件`,
40
+ stepWriteDone: (step) => `Step ${step}. 写入配置文件成功 :D`,
41
+ initDone: `${CLI_NAME} 初始化完成 :D`,
42
+ // conflict resolve
43
+ conflictDetected: `检测到项目中存在可能与 ${CLI_NAME} 冲突的依赖和配置,为保证正常运行将`,
44
+ conflictRemoveDeps: '删除以下依赖:',
45
+ conflictRemoveConfig: '删除以下配置文件:',
46
+ conflictRewriteConfig: '覆盖以下配置文件:',
47
+ conflictConfirm: '请确认是否继续:',
48
+ conflictCancelled: '已取消,未修改任何文件。',
49
+ // update
50
+ updateChecking: `[${PKG_NAME}] 正在检查最新版本...`,
51
+ updateFound: (v) => `[${PKG_NAME}] 存在新版本,将升级至 ${v}`,
52
+ updateHint: (latest, current, command) => `最新版本为 ${latest},本地版本为 ${current},请尽快升级到最新版本。\n你可以执行 ${command} 来安装此版本\n`,
53
+ updateNone: '当前没有可用的更新',
54
+ };
@@ -0,0 +1,20 @@
1
+ export type PackageManager = 'npm' | 'pnpm' | 'yarn' | 'bun' | 'cnpm';
2
+ /**
3
+ * Detect the package manager a project uses, by decreasing reliability:
4
+ *
5
+ * 1. `npm_config_user_agent` — the PM that actually invoked this process
6
+ * (npm/pnpm/yarn/bun/cnpm all set it; first segment is `<tool>/<version>`).
7
+ * 2. `package.json` `"packageManager"` (Corepack) — the project's declared PM.
8
+ * 3. A lockfile present in `cwd`.
9
+ * 4. `npm` as the final fallback.
10
+ *
11
+ * Replaces the old `command-exists`-based guess, which only checked whether
12
+ * `pnpm` happened to be on PATH and so polluted lockfiles in yarn/bun projects.
13
+ */
14
+ export declare function detectPackageManager(cwd?: string): PackageManager;
15
+ /** `[command, args]` to add a dev dependency, per package manager. */
16
+ export declare function addDevCommand(pm: PackageManager, pkg: string): [string, string[]];
17
+ /** `[command, args]` to add a global package, per package manager. */
18
+ export declare function addGlobalCommand(pm: PackageManager, pkg: string): [string, string[]];
19
+ /** `[command, args]` to install all dependencies — `<pm> install` works for all. */
20
+ export declare function installAllCommand(pm: PackageManager): [string, string[]];
@@ -0,0 +1,76 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ const KNOWN = ['npm', 'pnpm', 'yarn', 'bun', 'cnpm'];
4
+ /**
5
+ * Detect the package manager a project uses, by decreasing reliability:
6
+ *
7
+ * 1. `npm_config_user_agent` — the PM that actually invoked this process
8
+ * (npm/pnpm/yarn/bun/cnpm all set it; first segment is `<tool>/<version>`).
9
+ * 2. `package.json` `"packageManager"` (Corepack) — the project's declared PM.
10
+ * 3. A lockfile present in `cwd`.
11
+ * 4. `npm` as the final fallback.
12
+ *
13
+ * Replaces the old `command-exists`-based guess, which only checked whether
14
+ * `pnpm` happened to be on PATH and so polluted lockfiles in yarn/bun projects.
15
+ */
16
+ export function detectPackageManager(cwd = process.cwd()) {
17
+ // 1. The PM that launched us.
18
+ const ua = process.env.npm_config_user_agent;
19
+ if (ua) {
20
+ const name = ua.split('/')[0];
21
+ if (KNOWN.includes(name))
22
+ return name;
23
+ }
24
+ // 2. The project's declared PM.
25
+ try {
26
+ const pkg = JSON.parse(fs.readFileSync(path.join(cwd, 'package.json'), 'utf8'));
27
+ if (typeof pkg.packageManager === 'string') {
28
+ const name = pkg.packageManager.split('@')[0];
29
+ if (KNOWN.includes(name))
30
+ return name;
31
+ }
32
+ }
33
+ catch {
34
+ /* no / unreadable package.json */
35
+ }
36
+ // 3. Lockfile in cwd.
37
+ if (fs.existsSync(path.join(cwd, 'pnpm-lock.yaml')))
38
+ return 'pnpm';
39
+ if (fs.existsSync(path.join(cwd, 'yarn.lock')))
40
+ return 'yarn';
41
+ if (fs.existsSync(path.join(cwd, 'bun.lockb')) || fs.existsSync(path.join(cwd, 'bun.lock'))) {
42
+ return 'bun';
43
+ }
44
+ if (fs.existsSync(path.join(cwd, 'package-lock.json')))
45
+ return 'npm';
46
+ if (fs.existsSync(path.join(cwd, 'npm-shrinkwrap.json')))
47
+ return 'npm';
48
+ // 4. Fallback.
49
+ return 'npm';
50
+ }
51
+ /** `[command, args]` to add a dev dependency, per package manager. */
52
+ export function addDevCommand(pm, pkg) {
53
+ switch (pm) {
54
+ case 'yarn':
55
+ return ['yarn', ['add', '-D', pkg]];
56
+ case 'bun':
57
+ return ['bun', ['add', '-d', pkg]];
58
+ default: // npm / pnpm / cnpm
59
+ return [pm, ['i', '-D', pkg]];
60
+ }
61
+ }
62
+ /** `[command, args]` to add a global package, per package manager. */
63
+ export function addGlobalCommand(pm, pkg) {
64
+ switch (pm) {
65
+ case 'yarn':
66
+ return ['yarn', ['global', 'add', pkg]];
67
+ case 'bun':
68
+ return ['bun', ['add', '-g', pkg]];
69
+ default: // npm / pnpm / cnpm
70
+ return [pm, ['i', '-g', pkg]];
71
+ }
72
+ }
73
+ /** `[command, args]` to install all dependencies — `<pm> install` works for all. */
74
+ export function installAllCommand(pm) {
75
+ return [pm, ['install']];
76
+ }
@@ -0,0 +1,5 @@
1
+ import type { ScanResult } from '../types.js';
2
+ /**
3
+ * Print the scan report to the console.
4
+ */
5
+ export default function printReport(results: ScanResult[], fix: boolean): void;
@@ -0,0 +1,63 @@
1
+ import chalk from 'chalk';
2
+ import table from 'text-table';
3
+ import terminalLink from 'terminal-link';
4
+ import isDocker from 'is-docker';
5
+ import stripAnsi from 'strip-ansi';
6
+ import { CLI_NAME, UNICODE } from './constants.js';
7
+ /**
8
+ * Print the scan report to the console.
9
+ */
10
+ export default function printReport(results, fix) {
11
+ let output = '\n';
12
+ let errorCount = 0;
13
+ let warningCount = 0;
14
+ let fixableErrorCount = 0;
15
+ let fixableWarningCount = 0;
16
+ let summaryColor = 'yellow';
17
+ const transformMessage = ({ line, column, rule, url, message, errored }) => {
18
+ if (errored)
19
+ summaryColor = 'red';
20
+ let text = '';
21
+ if (rule && url) {
22
+ text = terminalLink(chalk.blue(rule), chalk.dim(` ${url} `), { fallback: !isDocker() });
23
+ }
24
+ else if (rule) {
25
+ text = chalk.blue(rule);
26
+ }
27
+ return [
28
+ '',
29
+ chalk.dim(`${line}:${column}`),
30
+ errored ? chalk.red('error') : chalk.yellow('warning'),
31
+ message,
32
+ text,
33
+ ];
34
+ };
35
+ for (const result of results) {
36
+ if (result.messages.length === 0)
37
+ continue;
38
+ errorCount += result.errorCount;
39
+ warningCount += result.warningCount;
40
+ fixableErrorCount += result.fixableErrorCount;
41
+ fixableWarningCount += result.fixableWarningCount;
42
+ output += `${chalk.underline(result.filePath)}\n`;
43
+ output += `${table(result.messages.map(transformMessage), {
44
+ align: ['.', 'r', 'l'],
45
+ stringLength: (str) => stripAnsi(str).length,
46
+ })}\n\n`;
47
+ }
48
+ const total = errorCount + warningCount;
49
+ if (fix)
50
+ output += chalk.green('代码规范问题自动修复完成,请通过 git diff 确认修复效果 :D\n');
51
+ if (fix && total > 0) {
52
+ output += chalk.green('ps. 以上显示的是无法被自动修复的问题,需要手动进行修复\n');
53
+ }
54
+ if (!fix && total > 0) {
55
+ output += chalk[summaryColor].bold(`${UNICODE.failure} 共 ${total} 个问题(${errorCount} 个错误,${warningCount} 个警告)\n`);
56
+ if (fixableErrorCount > 0 || fixableWarningCount > 0) {
57
+ output += chalk[summaryColor].bold(` 其中 ${fixableErrorCount} 个错误、${fixableWarningCount} 个警告可通过 \`${CLI_NAME} fix\` 自动修复`);
58
+ }
59
+ }
60
+ if (!fix && total === 0)
61
+ output = chalk.green.bold(`${UNICODE.success} 没有发现问题`);
62
+ console.log(chalk.reset(output));
63
+ }
@@ -0,0 +1,3 @@
1
+ import type { Config } from '../types.js';
2
+ /** Read `<cli>.config.{mjs,cjs,js}` from the project, if present. */
3
+ export declare function readLinterSpecConfig(cwd: string): Promise<Config>;
@@ -0,0 +1,15 @@
1
+ import path from 'node:path';
2
+ import { pathToFileURL } from 'node:url';
3
+ import fs from 'fs-extra';
4
+ import { CLI_NAME } from './constants.js';
5
+ /** Read `<cli>.config.{mjs,cjs,js}` from the project, if present. */
6
+ export async function readLinterSpecConfig(cwd) {
7
+ for (const ext of ['mjs', 'cjs', 'js']) {
8
+ const configPath = path.resolve(cwd, `${CLI_NAME}.config.${ext}`);
9
+ if (fs.existsSync(configPath)) {
10
+ const mod = await import(pathToFileURL(configPath).href);
11
+ return (mod.default ?? mod);
12
+ }
13
+ }
14
+ return {};
15
+ }
package/package.json ADDED
@@ -0,0 +1,88 @@
1
+ {
2
+ "name": "@linter-spec/cli",
3
+ "version": "1.0.0",
4
+ "description": "One-command lint toolchain (ESLint / Stylelint / markdownlint / Prettier / commitlint) for the linter-spec spec.",
5
+ "type": "module",
6
+ "author": "SotherWind",
7
+ "license": "MIT",
8
+ "homepage": "https://github.com/SotherWind/linter-spec/tree/main/packages/cli",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/SotherWind/linter-spec.git",
12
+ "directory": "packages/cli"
13
+ },
14
+ "bugs": {
15
+ "url": "https://github.com/SotherWind/linter-spec/issues"
16
+ },
17
+ "keywords": [
18
+ "lint",
19
+ "cli",
20
+ "eslint",
21
+ "stylelint",
22
+ "prettier",
23
+ "linter-spec"
24
+ ],
25
+ "bin": {
26
+ "linter-spec": "./dist/cli.js"
27
+ },
28
+ "main": "./dist/index.js",
29
+ "types": "./dist/index.d.ts",
30
+ "exports": {
31
+ ".": {
32
+ "types": "./dist/index.d.ts",
33
+ "default": "./dist/index.js"
34
+ }
35
+ },
36
+ "files": [
37
+ "dist",
38
+ "README.md"
39
+ ],
40
+ "publishConfig": {
41
+ "access": "public"
42
+ },
43
+ "dependencies": {
44
+ "@commitlint/cli": "^19.5.0",
45
+ "@inquirer/prompts": "^8.5.2",
46
+ "chalk": "^5.6.2",
47
+ "commander": "^14.0.3",
48
+ "cross-spawn": "^7.0.6",
49
+ "ejs": "^6.0.1",
50
+ "eslint": "^9.39.4",
51
+ "execa": "^9.6.1",
52
+ "fast-glob": "^3.3.3",
53
+ "fs-extra": "^11.3.5",
54
+ "is-docker": "^4.0.0",
55
+ "markdownlint": "^0.34.0",
56
+ "markdownlint-cli2": "^0.14.0",
57
+ "markdownlint-rule-helpers": "^0.25.0",
58
+ "ora": "^9.4.0",
59
+ "prettier": "^3.8.3",
60
+ "strip-ansi": "^7.2.0",
61
+ "stylelint": "^17.13.0",
62
+ "terminal-link": "^5.0.0",
63
+ "text-table": "^0.2.0",
64
+ "@linter-spec/commitlint-config": "^1.0.0",
65
+ "@linter-spec/eslint-config": "^1.0.0",
66
+ "@linter-spec/markdownlint-config": "^1.0.0",
67
+ "@linter-spec/stylelint-config": "^1.0.0"
68
+ },
69
+ "devDependencies": {
70
+ "@types/cross-spawn": "^6.0.6",
71
+ "@types/ejs": "^3.1.5",
72
+ "@types/fs-extra": "^11.0.4",
73
+ "@types/node": "^22.7.0",
74
+ "@types/text-table": "^0.2.5",
75
+ "rimraf": "^6.0.1",
76
+ "typescript": "^5.6.2",
77
+ "vitest": "^2.1.1"
78
+ },
79
+ "engines": {
80
+ "node": "^20.19.0 || >=22.12.0"
81
+ },
82
+ "scripts": {
83
+ "build": "rimraf dist && tsc && node scripts/copy-templates.mjs",
84
+ "dev": "tsc -w",
85
+ "pretest": "pnpm build",
86
+ "test": "vitest run"
87
+ }
88
+ }