@lonewolfyx/setup 0.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Lonewolfyx's Templates
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # setup
2
+
3
+ Instant project boilerplate setup
4
+
5
+ ## License
6
+
7
+ [MIT](./LICENSE) License © [lonewolfyx](https://github.com/lonewolfyx)
package/bin/cli.js ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import('../dist/cli.mjs')
package/dist/cli.d.mts ADDED
@@ -0,0 +1 @@
1
+ export { };
package/dist/cli.mjs ADDED
@@ -0,0 +1,239 @@
1
+ import { access, mkdir, readdir, rm, writeFile } from "node:fs/promises";
2
+ import path from "node:path";
3
+ import { confirm, intro, isCancel, outro, spinner } from "@clack/prompts";
4
+ import { createMain, defineCommand } from "citty";
5
+ import { readPackageJSON, writePackageJSON, writeTSConfig } from "pkg-types";
6
+ import { x } from "tinyexec";
7
+ //#region package.json
8
+ var name = "@lonewolfyx/setup";
9
+ var version = "0.0.1";
10
+ var description = "Instant project boilerplate setup";
11
+ //#endregion
12
+ //#region src/task/addGitHooksConfig.ts
13
+ /**
14
+ * 添加 git hooks 配置到 package.json
15
+ * @param cwd 当前工作目录
16
+ * @param packageJsonPath package.json 文件路径
17
+ */
18
+ async function addGitHooksConfig(cwd, packageJsonPath) {
19
+ const newPackageJson = await readPackageJSON(cwd);
20
+ newPackageJson.simpleGitHooks = {
21
+ "pre-commit": "npx lint-staged",
22
+ "commit-msg": "node scripts/verify-commit.js"
23
+ };
24
+ newPackageJson.lintStaged = { "*": "eslint --fix" };
25
+ await writePackageJSON(packageJsonPath, newPackageJson);
26
+ }
27
+ //#endregion
28
+ //#region src/task/clearDirectory.ts
29
+ /**
30
+ * 清空目录内容,保留 .git 目录
31
+ * @param dirPath 目录路径
32
+ */
33
+ async function clearDirectory(dirPath) {
34
+ const entries = await readdir(dirPath, { withFileTypes: true });
35
+ for (const entry of entries) {
36
+ if (entry.name === ".git") continue;
37
+ const fullPath = path.join(dirPath, entry.name);
38
+ if (entry.isDirectory()) await rm(fullPath, {
39
+ recursive: true,
40
+ force: true
41
+ });
42
+ else await rm(fullPath, { force: true });
43
+ }
44
+ }
45
+ //#endregion
46
+ //#region src/task/configPackageJson.ts
47
+ /**
48
+ * 配置 package.json,添加 "type": "module"
49
+ * @param cwd 当前工作目录
50
+ * @param packageJsonPath package.json 文件路径
51
+ */
52
+ async function configPackageJson(cwd, packageJsonPath) {
53
+ const packageJson = await readPackageJSON(cwd);
54
+ packageJson.type = "module";
55
+ await writePackageJSON(packageJsonPath, packageJson);
56
+ }
57
+ //#endregion
58
+ //#region src/task/createEslintConfig.ts
59
+ /**
60
+ * 创建 ESLint 配置文件
61
+ * @param cwd 当前工作目录
62
+ */
63
+ async function createEslintConfig(cwd) {
64
+ await writeFile(path.join(cwd, "eslint.config.ts"), `import type { Linter } from 'eslint'
65
+ import antfu from '@antfu/eslint-config'
66
+
67
+ const config = antfu({
68
+ type: 'lib',
69
+ stylistic: {
70
+ indent: 4,
71
+ quotes: 'single',
72
+ },
73
+ rules: {
74
+ 'no-console': 'off',
75
+ 'node/prefer-global/process': 'off',
76
+ 'antfu/top-level-function': 'off',
77
+ 'regexp/no-unused-capturing-group': 'off',
78
+ },
79
+ yaml: {
80
+ overrides: {
81
+ 'yaml/indent': ['error', 2],
82
+ },
83
+ },
84
+ }) as Linter.Config
85
+
86
+ export default config`);
87
+ }
88
+ //#endregion
89
+ //#region src/task/createGitHooks.ts
90
+ /**
91
+ * 创建 git hooks 配置文件
92
+ * @param cwd 当前工作目录
93
+ */
94
+ async function createGitHooks(cwd) {
95
+ const scriptsDir = path.join(cwd, "scripts");
96
+ await mkdir(scriptsDir, { recursive: true });
97
+ await writeFile(path.join(scriptsDir, "verify-commit.js"), "import { readFileSync } from 'node:fs'\nimport path from 'node:path'\n// @ts-check\nimport pico from 'picocolors'\n\nconst msgPath = path.resolve('.git/COMMIT_EDITMSG')\nconst msg = readFileSync(msgPath, 'utf-8').trim()\n\nconst commitRE\n = /^(revert: )?(feat|fix|docs|dx|style|refactor|perf|test|workflow|build|ci|chore|types|wip|release)(\\(.+\\))?: .{1,50}/\n\nif (!commitRE.test(msg)) {\n console.log()\n console.error(\n ` ${pico.white(pico.bgRed(' ERROR '))} ${pico.red(\n `invalid commit message format.`,\n )}\\n\\n${\n pico.red(\n ` Proper commit message format is required for automated changelog generation. Examples:\\n\\n`,\n )\n } ${pico.green(`feat(compiler): add 'comments' option`)}\\n`\n + ` ${pico.green(\n `fix(v-model): handle events on blur (close #28)`,\n )}\\n\\n${\n pico.red(` See .github/commit-convention.md for more details.\\n`)}`,\n )\n process.exit(1)\n}\n");
98
+ }
99
+ //#endregion
100
+ //#region src/task/utils.ts
101
+ /**
102
+ * 检测包管理器是否存在
103
+ * @param command 包管理器命令名称
104
+ */
105
+ async function hasPackageManager(command) {
106
+ try {
107
+ await x(command, ["--version"], { throwOnError: true });
108
+ return true;
109
+ } catch {
110
+ return false;
111
+ }
112
+ }
113
+ //#endregion
114
+ //#region src/task/createPackageJson.ts
115
+ /**
116
+ * 创建 package.json 文件
117
+ * @param cwd 当前工作目录
118
+ */
119
+ async function createPackageJson(cwd) {
120
+ const hasPnpm = await hasPackageManager("pnpm");
121
+ await x(hasPnpm ? "pnpm" : "npm", hasPnpm ? ["init"] : ["init", "-y"], { nodeOptions: { cwd } });
122
+ }
123
+ //#endregion
124
+ //#region src/task/createTsConfig.ts
125
+ /**
126
+ * 创建 tsconfig.json 文件
127
+ * @param cwd 当前工作目录
128
+ */
129
+ async function createTsConfig(cwd) {
130
+ await writeTSConfig(path.resolve(cwd, "tsconfig.json"), {
131
+ extends: "@lonewolfyx/tsconfig/tsconfig.lib.json",
132
+ compilerOptions: {
133
+ baseUrl: "./",
134
+ paths: {
135
+ "@/*": ["./src/*"],
136
+ "#/*": ["./src/types/*", "./types/*"]
137
+ },
138
+ resolveJsonModule: true,
139
+ types: ["node"],
140
+ noUnusedLocals: false,
141
+ noUnusedParameters: false,
142
+ declarationMap: false
143
+ }
144
+ });
145
+ }
146
+ //#endregion
147
+ //#region src/task/installDevDeps.ts
148
+ /**
149
+ * 安装开发依赖
150
+ * @param cwd 当前工作目录
151
+ */
152
+ async function installDevDeps(cwd) {
153
+ const devDeps = [
154
+ "eslint",
155
+ "@antfu/eslint-config",
156
+ "typescript",
157
+ "@lonewolfyx/tsconfig",
158
+ "@types/node",
159
+ "lint-staged",
160
+ "simple-git-hooks",
161
+ "picocolors",
162
+ "tsx",
163
+ "tsdown"
164
+ ];
165
+ const hasPnpm = await hasPackageManager("pnpm");
166
+ await x(hasPnpm ? "pnpm" : "npm", hasPnpm ? [
167
+ "add",
168
+ "-D",
169
+ ...devDeps
170
+ ] : [
171
+ "install",
172
+ "-D",
173
+ ...devDeps
174
+ ], { nodeOptions: { cwd } });
175
+ }
176
+ //#endregion
177
+ //#region src/cli.ts
178
+ createMain(defineCommand({
179
+ meta: {
180
+ name,
181
+ version,
182
+ description
183
+ },
184
+ setup() {
185
+ intro("项目初始化");
186
+ },
187
+ cleanup() {
188
+ outro("Done. 项目初始化完成");
189
+ },
190
+ args: { cwd: {
191
+ type: "string",
192
+ description: "Current working directory",
193
+ alias: "c",
194
+ default: process.cwd()
195
+ } },
196
+ async run({ args }) {
197
+ const cwd = args.cwd;
198
+ const packageJsonPath = path.join(cwd, "package.json");
199
+ const packageJsonExists = await access(packageJsonPath).then(() => true).catch(() => false);
200
+ const progress = spinner();
201
+ if (packageJsonExists) {
202
+ const shouldOverwrite = await confirm({ message: "检测到当前目录已存在项目,是否覆盖创建新项目?(将清空当前目录下所有文件)" });
203
+ if (isCancel(shouldOverwrite) || !shouldOverwrite) {
204
+ outro("已取消操作");
205
+ return;
206
+ }
207
+ progress.start("正在清空目录...");
208
+ await clearDirectory(cwd);
209
+ progress.stop("目录已清空");
210
+ }
211
+ progress.start("正在检测包管理器...");
212
+ await hasPackageManager("pnpm");
213
+ progress.message("项目初始化...");
214
+ await createPackageJson(cwd);
215
+ progress.stop("package.json 创建完成");
216
+ progress.start("正在配置 package.json...");
217
+ await configPackageJson(cwd, packageJsonPath);
218
+ progress.stop("package.json 配置完成");
219
+ progress.start("正在安装开发依赖...");
220
+ await installDevDeps(cwd);
221
+ progress.stop("开发依赖安装完成");
222
+ progress.start("正在创建 git hooks 配置文件...");
223
+ await createGitHooks(cwd);
224
+ progress.stop("git hooks 配置文件创建完成");
225
+ progress.start("正在创建 tsconfig.json...");
226
+ await createTsConfig(cwd);
227
+ progress.stop("tsconfig.json 创建完成");
228
+ progress.start("正在添加 git hooks 配置...");
229
+ await addGitHooksConfig(cwd, packageJsonPath);
230
+ progress.stop("git hooks 配置添加完成");
231
+ progress.start("正在创建 ESLint 配置文件...");
232
+ await createEslintConfig(cwd);
233
+ progress.stop("ESLint 配置文件创建完成");
234
+ }
235
+ }))({});
236
+ //#endregion
237
+ export {};
238
+
239
+ //# sourceMappingURL=cli.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.mjs","names":[],"sources":["../package.json","../src/task/addGitHooksConfig.ts","../src/task/clearDirectory.ts","../src/task/configPackageJson.ts","../src/task/createEslintConfig.ts","../src/task/createGitHooks.ts","../src/task/utils.ts","../src/task/createPackageJson.ts","../src/task/createTsConfig.ts","../src/task/installDevDeps.ts","../src/cli.ts"],"sourcesContent":["","import { readPackageJSON, writePackageJSON } from 'pkg-types'\n\n/**\n * 添加 git hooks 配置到 package.json\n * @param cwd 当前工作目录\n * @param packageJsonPath package.json 文件路径\n */\nexport async function addGitHooksConfig(cwd: string, packageJsonPath: string): Promise<void> {\n const newPackageJson = await readPackageJSON(cwd)\n newPackageJson.simpleGitHooks = {\n 'pre-commit': 'npx lint-staged',\n 'commit-msg': 'node scripts/verify-commit.js',\n }\n newPackageJson.lintStaged = {\n '*': 'eslint --fix',\n }\n\n await writePackageJSON(packageJsonPath, newPackageJson)\n}\n","import { readdir, rm } from 'node:fs/promises'\nimport path from 'node:path'\n\n/**\n * 清空目录内容,保留 .git 目录\n * @param dirPath 目录路径\n */\nexport async function clearDirectory(dirPath: string): Promise<void> {\n const entries = await readdir(dirPath, { withFileTypes: true })\n\n for (const entry of entries) {\n // 保留 .git 目录\n if (entry.name === '.git') {\n continue\n }\n\n const fullPath = path.join(dirPath, entry.name)\n\n if (entry.isDirectory()) {\n await rm(fullPath, { recursive: true, force: true })\n }\n else {\n await rm(fullPath, { force: true })\n }\n }\n}\n","import { readPackageJSON, writePackageJSON } from 'pkg-types'\n\n/**\n * 配置 package.json,添加 \"type\": \"module\"\n * @param cwd 当前工作目录\n * @param packageJsonPath package.json 文件路径\n */\nexport async function configPackageJson(cwd: string, packageJsonPath: string): Promise<void> {\n const packageJson = await readPackageJSON(cwd)\n packageJson.type = 'module'\n await writePackageJSON(packageJsonPath, packageJson)\n}\n","import { writeFile } from 'node:fs/promises'\nimport path from 'node:path'\n\n/**\n * 创建 ESLint 配置文件\n * @param cwd 当前工作目录\n */\nexport async function createEslintConfig(cwd: string): Promise<void> {\n const eslintConfigContent = `import type { Linter } from 'eslint'\nimport antfu from '@antfu/eslint-config'\n\nconst config = antfu({\n type: 'lib',\n stylistic: {\n indent: 4,\n quotes: 'single',\n },\n rules: {\n 'no-console': 'off',\n 'node/prefer-global/process': 'off',\n 'antfu/top-level-function': 'off',\n 'regexp/no-unused-capturing-group': 'off',\n },\n yaml: {\n overrides: {\n 'yaml/indent': ['error', 2],\n },\n },\n}) as Linter.Config\n\nexport default config`\n\n const eslintConfigPath = path.join(cwd, 'eslint.config.ts')\n await writeFile(eslintConfigPath, eslintConfigContent)\n}\n","import { mkdir, writeFile } from 'node:fs/promises'\nimport path from 'node:path'\n\n/**\n * 创建 git hooks 配置文件\n * @param cwd 当前工作目录\n */\nexport async function createGitHooks(cwd: string): Promise<void> {\n const scriptsDir = path.join(cwd, 'scripts')\n await mkdir(scriptsDir, { recursive: true })\n\n const verifyCommitPath = path.join(scriptsDir, 'verify-commit.js')\n const verifyCommitContent = 'import { readFileSync } from \\'node:fs\\'\\n'\n + 'import path from \\'node:path\\'\\n'\n + '// @ts-check\\n'\n + 'import pico from \\'picocolors\\'\\n'\n + '\\n'\n + 'const msgPath = path.resolve(\\'.git/COMMIT_EDITMSG\\')\\n'\n + 'const msg = readFileSync(msgPath, \\'utf-8\\').trim()\\n'\n + '\\n'\n + 'const commitRE\\n'\n + ' = /^(revert: )?(feat|fix|docs|dx|style|refactor|perf|test|workflow|build|ci|chore|types|wip|release)(\\\\(.+\\\\))?: .{1,50}/\\n'\n + '\\n'\n + 'if (!commitRE.test(msg)) {\\n'\n + ' console.log()\\n'\n + ' console.error(\\n'\n // eslint-disable-next-line no-template-curly-in-string\n + ' ` ${pico.white(pico.bgRed(\\' ERROR \\'))} ${pico.red(\\n'\n + ' `invalid commit message format.`,\\n'\n + ' )}\\\\n\\\\n${\\n'\n + ' pico.red(\\n'\n + ' ` Proper commit message format is required for automated changelog generation. Examples:\\\\n\\\\n`,\\n'\n + ' )\\n'\n // eslint-disable-next-line no-template-curly-in-string\n + ' } ${pico.green(`feat(compiler): add \\'comments\\' option`)}\\\\n`\\n'\n + ' + ` ${pico.green(\\n'\n + ' `fix(v-model): handle events on blur (close #28)`,\\n'\n + ' )}\\\\n\\\\n${\\n'\n + ' pico.red(` See .github/commit-convention.md for more details.\\\\n`)}`,\\n'\n + ' )\\n'\n + ' process.exit(1)\\n'\n + '}\\n'\n\n await writeFile(verifyCommitPath, verifyCommitContent)\n}\n","import { x } from 'tinyexec'\n\n/**\n * 检测包管理器是否存在\n * @param command 包管理器命令名称\n */\nexport async function hasPackageManager(command: string): Promise<boolean> {\n try {\n await x(command, ['--version'], { throwOnError: true })\n return true\n }\n catch {\n return false\n }\n}\n","import { x } from 'tinyexec'\nimport { hasPackageManager } from './utils'\n\n/**\n * 创建 package.json 文件\n * @param cwd 当前工作目录\n */\nexport async function createPackageJson(cwd: string): Promise<void> {\n const hasPnpm = await hasPackageManager('pnpm')\n\n await x(hasPnpm ? 'pnpm' : 'npm', hasPnpm ? ['init'] : ['init', '-y'], { nodeOptions: { cwd } })\n}\n","import path from 'node:path'\nimport { writeTSConfig } from 'pkg-types'\n\n/**\n * 创建 tsconfig.json 文件\n * @param cwd 当前工作目录\n */\nexport async function createTsConfig(cwd: string): Promise<void> {\n const tsconfigConfig = {\n extends: '@lonewolfyx/tsconfig/tsconfig.lib.json',\n compilerOptions: {\n baseUrl: './',\n paths: {\n '@/*': [\n './src/*',\n ],\n '#/*': [\n './src/types/*',\n './types/*',\n ],\n },\n resolveJsonModule: true,\n types: [\n 'node',\n ],\n noUnusedLocals: false,\n noUnusedParameters: false,\n declarationMap: false,\n },\n }\n\n await writeTSConfig(path.resolve(cwd, 'tsconfig.json'), tsconfigConfig)\n}\n","import { x } from 'tinyexec'\nimport { hasPackageManager } from './utils'\n\n/**\n * 安装开发依赖\n * @param cwd 当前工作目录\n */\nexport async function installDevDeps(cwd: string): Promise<void> {\n const devDeps = [\n 'eslint',\n '@antfu/eslint-config',\n 'typescript',\n '@lonewolfyx/tsconfig',\n '@types/node',\n 'lint-staged',\n 'simple-git-hooks',\n 'picocolors',\n 'tsx',\n 'tsdown',\n ]\n\n const hasPnpm = await hasPackageManager('pnpm')\n const addCmd = hasPnpm ? 'pnpm' : 'npm'\n const addArgs = hasPnpm\n ? ['add', '-D', ...devDeps]\n : ['install', '-D', ...devDeps]\n\n await x(addCmd, addArgs, { nodeOptions: { cwd } })\n}\n","import { access } from 'node:fs/promises'\nimport path from 'node:path'\nimport { confirm, intro, isCancel, outro, spinner } from '@clack/prompts'\nimport { createMain, defineCommand } from 'citty'\nimport { description, name, version } from '../package.json'\nimport { addGitHooksConfig } from './task/addGitHooksConfig'\nimport { clearDirectory } from './task/clearDirectory'\nimport { configPackageJson } from './task/configPackageJson'\nimport { createEslintConfig } from './task/createEslintConfig'\nimport { createGitHooks } from './task/createGitHooks'\nimport { createPackageJson } from './task/createPackageJson'\nimport { createTsConfig } from './task/createTsConfig'\nimport { installDevDeps } from './task/installDevDeps'\nimport { hasPackageManager } from './task/utils'\n\nconst command = defineCommand({\n meta: {\n name,\n version,\n description,\n },\n setup() {\n intro('项目初始化')\n },\n cleanup() {\n outro('Done. 项目初始化完成')\n },\n args: {\n cwd: {\n type: 'string',\n description: 'Current working directory',\n alias: 'c',\n default: process.cwd(),\n },\n },\n async run({ args }) {\n const cwd = args.cwd as string\n const packageJsonPath = path.join(cwd, 'package.json')\n\n // 检测 package.json 是否存在\n const packageJsonExists = await access(packageJsonPath)\n .then(() => true)\n .catch(() => false)\n\n const progress = spinner()\n\n if (packageJsonExists) {\n const shouldOverwrite = await confirm({\n message: '检测到当前目录已存在项目,是否覆盖创建新项目?(将清空当前目录下所有文件)',\n })\n\n if (isCancel(shouldOverwrite) || !shouldOverwrite) {\n outro('已取消操作')\n return\n }\n\n // 清空目录内容\n progress.start('正在清空目录...')\n await clearDirectory(cwd)\n progress.stop('目录已清空')\n }\n\n // 创建 package.json 文件\n progress.start('正在检测包管理器...')\n\n const hasPnpm = await hasPackageManager('pnpm')\n progress.message('项目初始化...')\n\n await createPackageJson(cwd)\n\n progress.stop('package.json 创建完成')\n\n // 添加 \"type\": \"module\" 配置\n progress.start('正在配置 package.json...')\n\n await configPackageJson(cwd, packageJsonPath)\n\n progress.stop('package.json 配置完成')\n\n // 安装开发依赖\n progress.start('正在安装开发依赖...')\n\n await installDevDeps(cwd)\n\n progress.stop('开发依赖安装完成')\n\n // 创建 scripts/verify-commit.js 文件\n progress.start('正在创建 git hooks 配置文件...')\n\n await createGitHooks(cwd)\n\n progress.stop('git hooks 配置文件创建完成')\n\n // 创建 tsconfig.json 文件\n progress.start('正在创建 tsconfig.json...')\n\n await createTsConfig(cwd)\n\n progress.stop('tsconfig.json 创建完成')\n\n // 添加 git hooks 配置到 package.json\n progress.start('正在添加 git hooks 配置...')\n\n await addGitHooksConfig(cwd, packageJsonPath)\n\n progress.stop('git hooks 配置添加完成')\n\n // 创建 eslint.config.ts 文件\n progress.start('正在创建 ESLint 配置文件...')\n\n await createEslintConfig(cwd)\n\n progress.stop('ESLint 配置文件创建完成')\n },\n})\n\ncreateMain(command)({})\n"],"mappings":";;;;;;;;;;;;;;;;;ACOA,eAAsB,kBAAkB,KAAa,iBAAwC;CACzF,MAAM,iBAAiB,MAAM,gBAAgB,IAAI;AACjD,gBAAe,iBAAiB;EAC5B,cAAc;EACd,cAAc;EACjB;AACD,gBAAe,aAAa,EACxB,KAAK,gBACR;AAED,OAAM,iBAAiB,iBAAiB,eAAe;;;;;;;;ACV3D,eAAsB,eAAe,SAAgC;CACjE,MAAM,UAAU,MAAM,QAAQ,SAAS,EAAE,eAAe,MAAM,CAAC;AAE/D,MAAK,MAAM,SAAS,SAAS;AAEzB,MAAI,MAAM,SAAS,OACf;EAGJ,MAAM,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E7B,QAAM,eAAe,IAAI;AAEzB,WAAS,KAAK,WAAW;AAGzB,WAAS,MAAM,yBAAyB;AAExC,QAAM,eAAe,IAAI;AAEzB,WAAS,KAAK,qBAAqB;AAGnC,WAAS,MAAM,wBAAwB;AAEvC,QAAM,eAAe,IAAI;AAEzB,WAAS,KAAK,qBAAqB;AAGnC,WAAS,MAAM,uBAAuB;AAEtC,QAAM,kBAAkB,KAAK,gBAAgB;AAE7C,WAAS,KAAK,mBAAmB;AAGjC,WAAS,MAAM,sBAAsB;AAErC,QAAM,mBAAmB,IAAI;AAE7B,WAAS,KAAK,kBAAkB;;CAEvC,CAEiB,CAAC,CAAC,EAAE,CAAC"}
package/package.json ADDED
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "@lonewolfyx/setup",
3
+ "type": "module",
4
+ "version": "0.0.1",
5
+ "packageManager": "pnpm@10.33.2",
6
+ "description": "Instant project boilerplate setup",
7
+ "author": "lonewolfyx <olddrivero.king@qq.com>",
8
+ "license": "MIT",
9
+ "homepage": "https://github.com/lonewolfyx/setup",
10
+ "bugs": {
11
+ "url": "https://github.com/lonewolfyx/setup/issues"
12
+ },
13
+ "keywords": [],
14
+ "exports": {
15
+ ".": "./dist/cli.mjs",
16
+ "./package.json": "./package.json"
17
+ },
18
+ "types": "./dist/cli.d.mts",
19
+ "bin": {
20
+ "setup": "./bin/cli.js"
21
+ },
22
+ "files": [
23
+ "dist"
24
+ ],
25
+ "scripts": {
26
+ "dev": "tsdown --watch",
27
+ "build": "tsdown",
28
+ "lint": "eslint",
29
+ "lint:fix": "eslint --fix",
30
+ "prepublishOnly": "pnpm build",
31
+ "prepare": "simple-git-hooks"
32
+ },
33
+ "publishConfig": {
34
+ "registry": "https://registry.npmjs.org",
35
+ "access": "public"
36
+ },
37
+ "dependencies": {
38
+ "@clack/prompts": "^1.0.0",
39
+ "citty": "^0.2.2",
40
+ "defu": "^6.1.7",
41
+ "find-up": "^8.0.0",
42
+ "glob": "^13.0.6",
43
+ "jiti": "^2.6.1",
44
+ "pkg-types": "^2.3.1",
45
+ "tinyexec": "^1.1.2"
46
+ },
47
+ "devDependencies": {
48
+ "@antfu/eslint-config": "^8.2.0",
49
+ "@lonewolfyx/tsconfig": "^0.0.6",
50
+ "@types/node": "^25.6.0",
51
+ "eslint": "^10.3.0",
52
+ "lint-staged": "^16.4.0",
53
+ "picocolors": "^1.1.1",
54
+ "simple-git-hooks": "^2.13.1",
55
+ "tsdown": "^0.21.10",
56
+ "tsdown-preset": "^1.0.6",
57
+ "tsx": "^4.21.0",
58
+ "typescript": "^6.0.3"
59
+ },
60
+ "simple-git-hooks": {
61
+ "pre-commit": "npx lint-staged",
62
+ "commit-msg": "node scripts/verify-commit.js"
63
+ },
64
+ "lint-staged": {
65
+ "*": "eslint --fix"
66
+ }
67
+ }