create-soybean 1.3.1 → 1.4.0-beta.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/dist/index.js +162 -5
- package/package.json +4 -5
- package/template-pnpm-monorepo/package.json +6 -6
- package/template-pnpm-monorepo/packages/demo-pkg/package.json +2 -2
- package/template-tsdown/package.json +8 -8
- package/template-vue/package.json +19 -19
- package/template-vue-tsdown/package.json +15 -15
- package/template-tsup/.github/workflows/release.yml +0 -46
- package/template-tsup/.vscode/extensions.json +0 -19
- package/template-tsup/.vscode/launch.json +0 -15
- package/template-tsup/.vscode/settings.json +0 -9
- package/template-tsup/_editorconfig +0 -11
- package/template-tsup/_gitattributes +0 -21
- package/template-tsup/_gitignore +0 -30
- package/template-tsup/_npmrc +0 -2
- package/template-tsup/_prettierrc +0 -0
- package/template-tsup/eslint.config.js +0 -3
- package/template-tsup/package.json +0 -61
- package/template-tsup/src/index.ts +0 -3
- package/template-tsup/tsconfig.json +0 -24
- package/template-tsup/tsup.config.ts +0 -18
- package/template-unbuild/.github/workflows/release.yml +0 -46
- package/template-unbuild/.vscode/extensions.json +0 -19
- package/template-unbuild/.vscode/launch.json +0 -15
- package/template-unbuild/.vscode/settings.json +0 -9
- package/template-unbuild/_editorconfig +0 -11
- package/template-unbuild/_gitattributes +0 -21
- package/template-unbuild/_gitignore +0 -30
- package/template-unbuild/_npmrc +0 -2
- package/template-unbuild/_prettierrc +0 -0
- package/template-unbuild/build.config.ts +0 -19
- package/template-unbuild/eslint.config.js +0 -3
- package/template-unbuild/package.json +0 -60
- package/template-unbuild/src/index.ts +0 -3
- package/template-unbuild/tsconfig.json +0 -24
package/dist/index.js
CHANGED
|
@@ -1,6 +1,163 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import process from "node:process";
|
|
3
|
+
import { copyFileSync, existsSync, mkdirSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
import { cyan, green, red, reset, yellow } from "kolorist";
|
|
7
|
+
import minimist from "minimist";
|
|
8
|
+
import prompts from "prompts";
|
|
9
|
+
import { consola } from "consola";
|
|
10
|
+
|
|
11
|
+
//#region src/shared.ts
|
|
12
|
+
function formatTargetDir(targetDir) {
|
|
13
|
+
return targetDir?.trim()?.replace(/\/+$/g, "");
|
|
14
|
+
}
|
|
15
|
+
function isPathEmpty($path) {
|
|
16
|
+
const files = readdirSync($path);
|
|
17
|
+
return files.length === 0 || files.length === 1 && files[0] === ".git";
|
|
18
|
+
}
|
|
19
|
+
function isValidPackageName(projectName) {
|
|
20
|
+
return /^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(projectName);
|
|
21
|
+
}
|
|
22
|
+
function toValidPackageName(projectName) {
|
|
23
|
+
return projectName.trim().toLowerCase().replace(/\s+/g, "-").replace(/^[._]/, "").replace(/[^a-z\d\-~]+/g, "-");
|
|
24
|
+
}
|
|
25
|
+
function emptyDir(dir) {
|
|
26
|
+
const isExist = existsSync(dir);
|
|
27
|
+
if (!isExist) return;
|
|
28
|
+
const files = readdirSync(dir);
|
|
29
|
+
for (const file of files) if (file !== ".git") {
|
|
30
|
+
const filePath = path.resolve(dir, file);
|
|
31
|
+
rmSync(filePath, {
|
|
32
|
+
recursive: true,
|
|
33
|
+
force: true
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function copyDir(srcDir, destDir) {
|
|
38
|
+
mkdirSync(destDir, { recursive: true });
|
|
39
|
+
const files = readdirSync(srcDir);
|
|
40
|
+
for (const file of files) {
|
|
41
|
+
const srcFile = path.resolve(srcDir, file);
|
|
42
|
+
const destFile = path.resolve(destDir, file);
|
|
43
|
+
copy(srcFile, destFile);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function copy(src, dest) {
|
|
47
|
+
const stat = statSync(src);
|
|
48
|
+
if (stat.isDirectory()) copyDir(src, dest);
|
|
49
|
+
else copyFileSync(src, dest);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/index.ts
|
|
54
|
+
const templates = [
|
|
55
|
+
{
|
|
56
|
+
type: "pnpm-monorepo",
|
|
57
|
+
name: "Pnpm monorepo",
|
|
58
|
+
color: yellow
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
type: "tsdown",
|
|
62
|
+
name: "TypeScript library by tsdown",
|
|
63
|
+
color: cyan
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
type: "vue",
|
|
67
|
+
name: "Vue 3",
|
|
68
|
+
color: green
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
type: "vue-tsdown",
|
|
72
|
+
name: "Vue 3 + TypeScript library by tsdown",
|
|
73
|
+
color: green
|
|
74
|
+
}
|
|
75
|
+
];
|
|
76
|
+
const TEMPLATES = templates.map((t) => t.type);
|
|
77
|
+
const renameFiles = {
|
|
78
|
+
_editorconfig: ".editorconfig",
|
|
79
|
+
_gitattributes: ".gitattributes",
|
|
80
|
+
_gitignore: ".gitignore",
|
|
81
|
+
_npmrc: ".npmrc",
|
|
82
|
+
_prettierrc: ".prettierrc"
|
|
83
|
+
};
|
|
84
|
+
const defaultTargetDir = "create-soybean-project";
|
|
85
|
+
async function setupCli() {
|
|
86
|
+
const cwd = process.cwd();
|
|
87
|
+
const argv = minimist(process.argv.slice(2), { string: ["_"] });
|
|
88
|
+
const argTargetDir = formatTargetDir(argv._[0]);
|
|
89
|
+
const argTemplate = argv.template || argv.t;
|
|
90
|
+
let targetDir = argTargetDir || defaultTargetDir;
|
|
91
|
+
function getProjectName() {
|
|
92
|
+
return targetDir === "." ? path.basename(path.resolve()) : targetDir;
|
|
93
|
+
}
|
|
94
|
+
let result = null;
|
|
95
|
+
try {
|
|
96
|
+
result = await prompts([
|
|
97
|
+
{
|
|
98
|
+
type: argTargetDir ? null : "text",
|
|
99
|
+
name: "projectName",
|
|
100
|
+
message: reset("Project name:"),
|
|
101
|
+
initial: defaultTargetDir,
|
|
102
|
+
onState: (state) => {
|
|
103
|
+
targetDir = formatTargetDir(state.value) || defaultTargetDir;
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
type: () => !existsSync(targetDir) || isPathEmpty(targetDir) ? null : "confirm",
|
|
108
|
+
name: "overwrite",
|
|
109
|
+
message: () => `${targetDir === "." ? "Current directory" : `Target directory "${targetDir}"`} is not empty. Remove existing files and continue?`
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
type: (_, { overwrite: overwrite$1 }) => {
|
|
113
|
+
if (overwrite$1 === false) throw new Error(`${red("✖")} Operation cancelled`);
|
|
114
|
+
return null;
|
|
115
|
+
},
|
|
116
|
+
name: "overwriteChecker"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
type: () => isValidPackageName(getProjectName()) ? null : "text",
|
|
120
|
+
name: "packageName",
|
|
121
|
+
message: reset("Package name:"),
|
|
122
|
+
initial: () => toValidPackageName(getProjectName()),
|
|
123
|
+
validate: (dir) => isValidPackageName(dir) || "Invalid package.json name"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
type: argTemplate && TEMPLATES.includes(argTemplate) ? null : "select",
|
|
127
|
+
name: "template",
|
|
128
|
+
message: typeof argTemplate === "string" && !TEMPLATES.includes(argTemplate) ? reset(`"${argTemplate}" isn't a valid template. Please choose from below: `) : reset("Select a template:"),
|
|
129
|
+
initial: 0,
|
|
130
|
+
choices: templates.map(({ type, name, color }) => ({
|
|
131
|
+
title: color(name),
|
|
132
|
+
value: type
|
|
133
|
+
}))
|
|
134
|
+
}
|
|
135
|
+
]);
|
|
136
|
+
} catch (error) {
|
|
137
|
+
consola.error(error);
|
|
138
|
+
}
|
|
139
|
+
if (!result) return;
|
|
140
|
+
const { template, overwrite, packageName } = result;
|
|
141
|
+
const root = path.join(cwd, targetDir);
|
|
142
|
+
if (overwrite) emptyDir(root);
|
|
143
|
+
else if (!existsSync(root)) mkdirSync(root, { recursive: true });
|
|
144
|
+
const $template = template || argTemplate;
|
|
145
|
+
consola.info(`\nScaffolding project in ${root}...`);
|
|
146
|
+
const templateDir = path.resolve(fileURLToPath(import.meta.url), "../..", `template-${$template}`);
|
|
147
|
+
const write = (file, content) => {
|
|
148
|
+
const targetPath = path.join(root, renameFiles[file] ?? file);
|
|
149
|
+
if (content) writeFileSync(targetPath, content);
|
|
150
|
+
else copy(path.join(templateDir, file), targetPath);
|
|
151
|
+
};
|
|
152
|
+
const files = readdirSync(templateDir);
|
|
153
|
+
for (const file of files.filter((f) => f !== "package.json")) write(file);
|
|
154
|
+
const pkg = JSON.parse(readFileSync(path.join(templateDir, `package.json`), "utf-8"));
|
|
155
|
+
pkg.name = packageName || getProjectName();
|
|
156
|
+
write("package.json", `${JSON.stringify(pkg, null, 2)}\n`);
|
|
157
|
+
const cdProjectName = path.relative(cwd, root);
|
|
158
|
+
consola.info(`\nDone. Now run:\n`);
|
|
159
|
+
if (root !== cwd) consola.info(` cd ${cdProjectName.includes(" ") ? `"${cdProjectName}"` : cdProjectName}`);
|
|
160
|
+
}
|
|
161
|
+
setupCli();
|
|
162
|
+
|
|
163
|
+
//#endregion
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-soybean",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.4.0-beta.1",
|
|
5
5
|
"description": "SoybeanJS's command line to create different project templates",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Soybean",
|
|
@@ -20,8 +20,7 @@
|
|
|
20
20
|
"registry": "https://registry.npmjs.org/"
|
|
21
21
|
},
|
|
22
22
|
"bin": {
|
|
23
|
-
"create-soybean": "dist/index.js"
|
|
24
|
-
"create-soy": "dist/index.js"
|
|
23
|
+
"create-soybean": "dist/index.js"
|
|
25
24
|
},
|
|
26
25
|
"files": [
|
|
27
26
|
"dist",
|
|
@@ -36,12 +35,12 @@
|
|
|
36
35
|
"devDependencies": {
|
|
37
36
|
"@types/minimist": "1.2.5",
|
|
38
37
|
"@types/prompts": "2.4.9",
|
|
39
|
-
"
|
|
38
|
+
"tsdown": "0.12.9",
|
|
40
39
|
"typescript": "5.8.3"
|
|
41
40
|
},
|
|
42
41
|
"scripts": {
|
|
43
42
|
"build": "pnpm typecheck && pnpm build-only",
|
|
44
|
-
"build-only": "
|
|
43
|
+
"build-only": "tsdown",
|
|
45
44
|
"publish-pkg": "pnpm publish --access public --no-git-checks",
|
|
46
45
|
"typecheck": "tsc --noEmit --skipLibCheck"
|
|
47
46
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"type": "module",
|
|
4
4
|
"version": "0.0.0",
|
|
5
5
|
"private": true,
|
|
6
|
-
"packageManager": "pnpm@10.
|
|
6
|
+
"packageManager": "pnpm@10.13.0",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"cleanup": "soy cleanup",
|
|
9
9
|
"commit": "soy git-commit",
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@soybeanjs/cli": "1.
|
|
19
|
-
"@soybeanjs/eslint-config": "1.
|
|
20
|
-
"eslint": "9.
|
|
21
|
-
"lint-staged": "16.1.
|
|
18
|
+
"@soybeanjs/cli": "1.4.0-beta.1",
|
|
19
|
+
"@soybeanjs/eslint-config": "1.7.1",
|
|
20
|
+
"eslint": "9.31.0",
|
|
21
|
+
"lint-staged": "16.1.2",
|
|
22
22
|
"simple-git-hooks": "2.13.0",
|
|
23
|
-
"tsx": "4.
|
|
23
|
+
"tsx": "4.20.3",
|
|
24
24
|
"typescript": "5.8.3"
|
|
25
25
|
},
|
|
26
26
|
"simple-git-hooks": {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"type": "module",
|
|
4
4
|
"version": "0.0.0",
|
|
5
5
|
"private": true,
|
|
6
|
-
"packageManager": "pnpm@10.
|
|
6
|
+
"packageManager": "pnpm@10.13.0",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"registry": "https://registry.npmjs.org/"
|
|
9
9
|
},
|
|
@@ -40,15 +40,15 @@
|
|
|
40
40
|
"ofetch": "1.4.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@soybeanjs/cli": "1.
|
|
44
|
-
"@soybeanjs/eslint-config": "1.
|
|
43
|
+
"@soybeanjs/cli": "1.4.0-beta.1",
|
|
44
|
+
"@soybeanjs/eslint-config": "1.7.1",
|
|
45
45
|
"@types/cli-progress": "3.11.6",
|
|
46
|
-
"@types/node": "
|
|
47
|
-
"eslint": "9.
|
|
48
|
-
"lint-staged": "16.1.
|
|
46
|
+
"@types/node": "24.0.13",
|
|
47
|
+
"eslint": "9.31.0",
|
|
48
|
+
"lint-staged": "16.1.2",
|
|
49
49
|
"simple-git-hooks": "2.13.0",
|
|
50
|
-
"tsdown": "0.12.
|
|
51
|
-
"tsx": "4.
|
|
50
|
+
"tsdown": "0.12.9",
|
|
51
|
+
"tsx": "4.20.3",
|
|
52
52
|
"typescript": "5.8.3"
|
|
53
53
|
},
|
|
54
54
|
"simple-git-hooks": {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"type": "module",
|
|
4
4
|
"version": "0.0.0",
|
|
5
5
|
"private": true,
|
|
6
|
-
"packageManager": "pnpm@10.
|
|
6
|
+
"packageManager": "pnpm@10.13.0",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "pnpm typecheck && pnpm build-only",
|
|
9
9
|
"build-only": "vite build",
|
|
@@ -17,33 +17,33 @@
|
|
|
17
17
|
"update-pkg": "soy ncu"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@unocss/reset": "66.
|
|
20
|
+
"@unocss/reset": "66.3.3",
|
|
21
21
|
"klona": "2.0.6",
|
|
22
22
|
"pinia": "3.0.3",
|
|
23
23
|
"soy-ui": "0.0.2-beta.5",
|
|
24
|
-
"vue": "3.5.
|
|
24
|
+
"vue": "3.5.17",
|
|
25
25
|
"vue-router": "4.5.1"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@soybean-ui/unocss-preset": "0.0.2-beta.5",
|
|
29
|
-
"@soybeanjs/cli": "1.
|
|
30
|
-
"@soybeanjs/eslint-config": "1.
|
|
31
|
-
"@types/node": "
|
|
32
|
-
"@unocss/eslint-config": "66.
|
|
33
|
-
"@vitejs/plugin-vue": "
|
|
34
|
-
"@vitejs/plugin-vue-jsx": "
|
|
35
|
-
"elegant-router": "1.0.
|
|
36
|
-
"eslint": "9.
|
|
37
|
-
"eslint-plugin-vue": "10.
|
|
38
|
-
"lint-staged": "16.1.
|
|
29
|
+
"@soybeanjs/cli": "1.4.0-beta.1",
|
|
30
|
+
"@soybeanjs/eslint-config": "1.7.1",
|
|
31
|
+
"@types/node": "24.0.13",
|
|
32
|
+
"@unocss/eslint-config": "66.3.3",
|
|
33
|
+
"@vitejs/plugin-vue": "6.0.0",
|
|
34
|
+
"@vitejs/plugin-vue-jsx": "5.0.1",
|
|
35
|
+
"elegant-router": "1.0.3",
|
|
36
|
+
"eslint": "9.31.0",
|
|
37
|
+
"eslint-plugin-vue": "10.3.0",
|
|
38
|
+
"lint-staged": "16.1.2",
|
|
39
39
|
"simple-git-hooks": "2.13.0",
|
|
40
40
|
"typescript": "5.8.3",
|
|
41
|
-
"unocss": "66.
|
|
42
|
-
"unplugin-vue-components": "28.
|
|
43
|
-
"vite": "
|
|
44
|
-
"vite-plugin-vue-devtools": "7.7.
|
|
45
|
-
"vue-eslint-parser": "10.
|
|
46
|
-
"vue-tsc": "
|
|
41
|
+
"unocss": "66.3.3",
|
|
42
|
+
"unplugin-vue-components": "28.8.0",
|
|
43
|
+
"vite": "7.0.4",
|
|
44
|
+
"vite-plugin-vue-devtools": "7.7.7",
|
|
45
|
+
"vue-eslint-parser": "10.2.0",
|
|
46
|
+
"vue-tsc": "3.0.1"
|
|
47
47
|
},
|
|
48
48
|
"simple-git-hooks": {
|
|
49
49
|
"commit-msg": "pnpm soy git-commit-verify",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"type": "module",
|
|
4
4
|
"version": "0.0.0",
|
|
5
5
|
"private": true,
|
|
6
|
-
"packageManager": "pnpm@10.
|
|
6
|
+
"packageManager": "pnpm@10.13.0",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"registry": "https://registry.npmjs.org/"
|
|
9
9
|
},
|
|
@@ -35,25 +35,25 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@soybeanjs/cli": "1.
|
|
39
|
-
"@soybeanjs/eslint-config": "1.
|
|
40
|
-
"@types/node": "
|
|
38
|
+
"@soybeanjs/cli": "1.4.0-beta.1",
|
|
39
|
+
"@soybeanjs/eslint-config": "1.7.1",
|
|
40
|
+
"@types/node": "24.0.13",
|
|
41
41
|
"@vue/test-utils": "2.4.6",
|
|
42
|
-
"eslint": "9.
|
|
43
|
-
"eslint-plugin-vue": "10.
|
|
44
|
-
"happy-dom": "
|
|
45
|
-
"lint-staged": "16.1.
|
|
42
|
+
"eslint": "9.31.0",
|
|
43
|
+
"eslint-plugin-vue": "10.3.0",
|
|
44
|
+
"happy-dom": "18.0.1",
|
|
45
|
+
"lint-staged": "16.1.2",
|
|
46
46
|
"simple-git-hooks": "2.13.0",
|
|
47
|
-
"tsdown": "0.12.
|
|
48
|
-
"tsx": "4.
|
|
47
|
+
"tsdown": "0.12.9",
|
|
48
|
+
"tsx": "4.20.3",
|
|
49
49
|
"typescript": "5.8.3",
|
|
50
50
|
"unplugin-vue": "6.2.0",
|
|
51
51
|
"unplugin-vue-jsx": "0.6.1",
|
|
52
|
-
"vite": "
|
|
53
|
-
"vitest": "3.2.
|
|
54
|
-
"vue": "3.5.
|
|
55
|
-
"vue-eslint-parser": "10.
|
|
56
|
-
"vue-tsc": "
|
|
52
|
+
"vite": "7.0.4",
|
|
53
|
+
"vitest": "3.2.4",
|
|
54
|
+
"vue": "3.5.17",
|
|
55
|
+
"vue-eslint-parser": "10.2.0",
|
|
56
|
+
"vue-tsc": "3.0.1"
|
|
57
57
|
},
|
|
58
58
|
"simple-git-hooks": {
|
|
59
59
|
"commit-msg": "pnpm soy git-commit-verify",
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
name: Release
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
tags:
|
|
6
|
-
- "v*"
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
release:
|
|
10
|
-
permissions:
|
|
11
|
-
id-token: write
|
|
12
|
-
contents: write
|
|
13
|
-
runs-on: ubuntu-latest
|
|
14
|
-
steps:
|
|
15
|
-
- uses: actions/checkout@v3
|
|
16
|
-
with:
|
|
17
|
-
fetch-depth: 0
|
|
18
|
-
|
|
19
|
-
- name: Install pnpm
|
|
20
|
-
uses: pnpm/action-setup@v2
|
|
21
|
-
|
|
22
|
-
- name: Set node
|
|
23
|
-
uses: actions/setup-node@v3
|
|
24
|
-
with:
|
|
25
|
-
node-version: lts/*
|
|
26
|
-
cache: pnpm
|
|
27
|
-
registry-url: "https://registry.npmjs.org"
|
|
28
|
-
|
|
29
|
-
- run: npx githublogen
|
|
30
|
-
env:
|
|
31
|
-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
|
32
|
-
|
|
33
|
-
- name: Install Dependencies
|
|
34
|
-
run: pnpm install --no-frozen-lockfile
|
|
35
|
-
|
|
36
|
-
- name: PNPM build
|
|
37
|
-
run: pnpm run build
|
|
38
|
-
|
|
39
|
-
- name: Publish to NPM
|
|
40
|
-
run: pnpm -r publish --access public --no-git-checks
|
|
41
|
-
env:
|
|
42
|
-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
|
43
|
-
NPM_CONFIG_PROVENANCE: true
|
|
44
|
-
|
|
45
|
-
- name: Sync Npmmirror
|
|
46
|
-
run: npx syncmirror
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"recommendations": [
|
|
3
|
-
"afzalsayed96.icones",
|
|
4
|
-
"antfu.iconify",
|
|
5
|
-
"antfu.unocss",
|
|
6
|
-
"dbaeumer.vscode-eslint",
|
|
7
|
-
"editorconfig.editorconfig",
|
|
8
|
-
"esbenp.prettier-vscode",
|
|
9
|
-
"lokalise.i18n-ally",
|
|
10
|
-
"mhutchie.git-graph",
|
|
11
|
-
"mikestead.dotenv",
|
|
12
|
-
"naumovs.color-highlight",
|
|
13
|
-
"pkief.material-icon-theme",
|
|
14
|
-
"sdras.vue-vscode-snippets",
|
|
15
|
-
"vue.volar",
|
|
16
|
-
"whtouche.vscode-js-console-utils",
|
|
17
|
-
"zhuangtongfa.material-theme"
|
|
18
|
-
]
|
|
19
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "1.0.0",
|
|
3
|
-
"configurations": [
|
|
4
|
-
{
|
|
5
|
-
"name": "TS Debugger tsx",
|
|
6
|
-
"type": "node",
|
|
7
|
-
"request": "launch",
|
|
8
|
-
"program": "${file}",
|
|
9
|
-
"runtimeExecutable": "tsx",
|
|
10
|
-
"console": "integratedTerminal",
|
|
11
|
-
"internalConsoleOptions": "neverOpen",
|
|
12
|
-
"skipFiles": ["<node_internals>/**", "${workspaceFolder}/node_modules/**"]
|
|
13
|
-
}
|
|
14
|
-
]
|
|
15
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"*.js" eol=lf
|
|
2
|
-
"*.ts" eol=lf
|
|
3
|
-
"*.jsx" eol=lf
|
|
4
|
-
"*.tsx" eol=lf
|
|
5
|
-
"*.cjs" eol=lf
|
|
6
|
-
"*.cts" eol=lf
|
|
7
|
-
"*.mjs" eol=lf
|
|
8
|
-
"*.mts" eol=lf
|
|
9
|
-
"*.html" eol=lf
|
|
10
|
-
"*.css" eol=lf
|
|
11
|
-
"*.vue" eol=lf
|
|
12
|
-
"*.json" eol=lf
|
|
13
|
-
"*.less" eol=lf
|
|
14
|
-
"*.scss" eol=lf
|
|
15
|
-
"*.sass" eol=lf
|
|
16
|
-
"*.styl" eol=lf
|
|
17
|
-
"*.svelte" eol=lf
|
|
18
|
-
"*.md" eol=lf
|
|
19
|
-
"*.yml" eol=lf
|
|
20
|
-
"*.astro" eol=lf
|
|
21
|
-
"*.mdx" eol=lf
|
package/template-tsup/_gitignore
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
# Logs
|
|
2
|
-
logs
|
|
3
|
-
*.log
|
|
4
|
-
npm-debug.log*
|
|
5
|
-
yarn-debug.log*
|
|
6
|
-
yarn-error.log*
|
|
7
|
-
pnpm-debug.log*
|
|
8
|
-
lerna-debug.log*
|
|
9
|
-
|
|
10
|
-
node_modules
|
|
11
|
-
.DS_Store
|
|
12
|
-
dist
|
|
13
|
-
dist-ssr
|
|
14
|
-
coverage
|
|
15
|
-
*.local
|
|
16
|
-
|
|
17
|
-
/cypress/videos/
|
|
18
|
-
/cypress/screenshots/
|
|
19
|
-
|
|
20
|
-
# Editor directories and files
|
|
21
|
-
.vscode/*
|
|
22
|
-
!.vscode/extensions.json
|
|
23
|
-
!.vscode/settings.json
|
|
24
|
-
!.vscode/launch.json
|
|
25
|
-
.idea
|
|
26
|
-
*.suo
|
|
27
|
-
*.ntvs*
|
|
28
|
-
*.njsproj
|
|
29
|
-
*.sln
|
|
30
|
-
*.sw?
|
package/template-tsup/_npmrc
DELETED
|
File without changes
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "template-tsup",
|
|
3
|
-
"type": "module",
|
|
4
|
-
"version": "0.0.0",
|
|
5
|
-
"private": true,
|
|
6
|
-
"packageManager": "pnpm@10.12.1",
|
|
7
|
-
"publishConfig": {
|
|
8
|
-
"registry": "https://registry.npmjs.org/"
|
|
9
|
-
},
|
|
10
|
-
"sideEffects": false,
|
|
11
|
-
"exports": {
|
|
12
|
-
".": {
|
|
13
|
-
"types": "./dist/index.d.ts",
|
|
14
|
-
"import": "./dist/index.mjs",
|
|
15
|
-
"require": "./dist/index.cjs"
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
"main": "./dist/index.cjs",
|
|
19
|
-
"module": "./dist/index.mjs",
|
|
20
|
-
"types": "./dist/index.d.ts",
|
|
21
|
-
"files": ["dist"],
|
|
22
|
-
"scripts": {
|
|
23
|
-
"build": "tsup",
|
|
24
|
-
"cleanup": "soy cleanup",
|
|
25
|
-
"commit": "soy git-commit",
|
|
26
|
-
"dev": "tsup --watch",
|
|
27
|
-
"lint": "eslint . --fix",
|
|
28
|
-
"prepare": "simple-git-hooks",
|
|
29
|
-
"publish-pkg": "pnpm publish --access public",
|
|
30
|
-
"release": "soy release",
|
|
31
|
-
"typecheck": "tsc --noEmit --skipLibCheck",
|
|
32
|
-
"update-pkg": "soy ncu"
|
|
33
|
-
},
|
|
34
|
-
"dependencies": {
|
|
35
|
-
"cli-progress": "3.12.0",
|
|
36
|
-
"consola": "3.4.2",
|
|
37
|
-
"dayjs": "1.11.13",
|
|
38
|
-
"execa": "9.6.0",
|
|
39
|
-
"kolorist": "1.8.0",
|
|
40
|
-
"ofetch": "1.4.1"
|
|
41
|
-
},
|
|
42
|
-
"devDependencies": {
|
|
43
|
-
"@soybeanjs/cli": "1.3.1",
|
|
44
|
-
"@soybeanjs/eslint-config": "1.6.1",
|
|
45
|
-
"@types/cli-progress": "3.11.6",
|
|
46
|
-
"@types/node": "22.15.30",
|
|
47
|
-
"eslint": "9.28.0",
|
|
48
|
-
"lint-staged": "16.1.0",
|
|
49
|
-
"simple-git-hooks": "2.13.0",
|
|
50
|
-
"tsup": "8.5.0",
|
|
51
|
-
"tsx": "4.19.4",
|
|
52
|
-
"typescript": "5.8.3"
|
|
53
|
-
},
|
|
54
|
-
"simple-git-hooks": {
|
|
55
|
-
"commit-msg": "pnpm soy git-commit-verify",
|
|
56
|
-
"pre-commit": "pnpm typecheck && pnpm lint-staged"
|
|
57
|
-
},
|
|
58
|
-
"lint-staged": {
|
|
59
|
-
"*": "eslint --fix"
|
|
60
|
-
}
|
|
61
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ESNext",
|
|
4
|
-
"jsx": "preserve",
|
|
5
|
-
"lib": ["DOM", "ESNext"],
|
|
6
|
-
"baseUrl": ".",
|
|
7
|
-
"module": "ESNext",
|
|
8
|
-
"moduleResolution": "node",
|
|
9
|
-
"paths": {
|
|
10
|
-
"@/*": ["./src/*"]
|
|
11
|
-
},
|
|
12
|
-
"resolveJsonModule": true,
|
|
13
|
-
"types": ["node"],
|
|
14
|
-
"strict": true,
|
|
15
|
-
"strictNullChecks": true,
|
|
16
|
-
"noUnusedLocals": true,
|
|
17
|
-
"outDir": "./dist",
|
|
18
|
-
"allowSyntheticDefaultImports": true,
|
|
19
|
-
"esModuleInterop": true,
|
|
20
|
-
"forceConsistentCasingInFileNames": true
|
|
21
|
-
},
|
|
22
|
-
"include": ["src/**/*"],
|
|
23
|
-
"exclude": ["node_modules", "dist"]
|
|
24
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'tsup';
|
|
2
|
-
|
|
3
|
-
export default defineConfig({
|
|
4
|
-
entry: ['src/index.ts'],
|
|
5
|
-
clean: true,
|
|
6
|
-
dts: true,
|
|
7
|
-
format: ['cjs', 'esm'],
|
|
8
|
-
outExtension: ctx => {
|
|
9
|
-
return {
|
|
10
|
-
js: ctx.format === 'cjs' ? '.cjs' : '.mjs'
|
|
11
|
-
};
|
|
12
|
-
},
|
|
13
|
-
external: [],
|
|
14
|
-
shims: true,
|
|
15
|
-
cjsInterop: true,
|
|
16
|
-
sourcemap: false,
|
|
17
|
-
minify: true
|
|
18
|
-
});
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
name: Release
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
tags:
|
|
6
|
-
- "v*"
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
release:
|
|
10
|
-
permissions:
|
|
11
|
-
id-token: write
|
|
12
|
-
contents: write
|
|
13
|
-
runs-on: ubuntu-latest
|
|
14
|
-
steps:
|
|
15
|
-
- uses: actions/checkout@v3
|
|
16
|
-
with:
|
|
17
|
-
fetch-depth: 0
|
|
18
|
-
|
|
19
|
-
- name: Install pnpm
|
|
20
|
-
uses: pnpm/action-setup@v2
|
|
21
|
-
|
|
22
|
-
- name: Set node
|
|
23
|
-
uses: actions/setup-node@v3
|
|
24
|
-
with:
|
|
25
|
-
node-version: lts/*
|
|
26
|
-
cache: pnpm
|
|
27
|
-
registry-url: "https://registry.npmjs.org"
|
|
28
|
-
|
|
29
|
-
- run: npx githublogen
|
|
30
|
-
env:
|
|
31
|
-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
|
32
|
-
|
|
33
|
-
- name: Install Dependencies
|
|
34
|
-
run: pnpm install --no-frozen-lockfile
|
|
35
|
-
|
|
36
|
-
- name: PNPM build
|
|
37
|
-
run: pnpm run build
|
|
38
|
-
|
|
39
|
-
- name: Publish to NPM
|
|
40
|
-
run: pnpm -r publish --access public --no-git-checks
|
|
41
|
-
env:
|
|
42
|
-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
|
43
|
-
NPM_CONFIG_PROVENANCE: true
|
|
44
|
-
|
|
45
|
-
- name: Sync Npmmirror
|
|
46
|
-
run: npx syncmirror
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"recommendations": [
|
|
3
|
-
"afzalsayed96.icones",
|
|
4
|
-
"antfu.iconify",
|
|
5
|
-
"antfu.unocss",
|
|
6
|
-
"dbaeumer.vscode-eslint",
|
|
7
|
-
"editorconfig.editorconfig",
|
|
8
|
-
"esbenp.prettier-vscode",
|
|
9
|
-
"lokalise.i18n-ally",
|
|
10
|
-
"mhutchie.git-graph",
|
|
11
|
-
"mikestead.dotenv",
|
|
12
|
-
"naumovs.color-highlight",
|
|
13
|
-
"pkief.material-icon-theme",
|
|
14
|
-
"sdras.vue-vscode-snippets",
|
|
15
|
-
"vue.volar",
|
|
16
|
-
"whtouche.vscode-js-console-utils",
|
|
17
|
-
"zhuangtongfa.material-theme"
|
|
18
|
-
]
|
|
19
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "1.0.0",
|
|
3
|
-
"configurations": [
|
|
4
|
-
{
|
|
5
|
-
"name": "TS Debugger tsx",
|
|
6
|
-
"type": "node",
|
|
7
|
-
"request": "launch",
|
|
8
|
-
"program": "${file}",
|
|
9
|
-
"runtimeExecutable": "tsx",
|
|
10
|
-
"console": "integratedTerminal",
|
|
11
|
-
"internalConsoleOptions": "neverOpen",
|
|
12
|
-
"skipFiles": ["<node_internals>/**", "${workspaceFolder}/node_modules/**"]
|
|
13
|
-
}
|
|
14
|
-
]
|
|
15
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"*.js" eol=lf
|
|
2
|
-
"*.ts" eol=lf
|
|
3
|
-
"*.jsx" eol=lf
|
|
4
|
-
"*.tsx" eol=lf
|
|
5
|
-
"*.cjs" eol=lf
|
|
6
|
-
"*.cts" eol=lf
|
|
7
|
-
"*.mjs" eol=lf
|
|
8
|
-
"*.mts" eol=lf
|
|
9
|
-
"*.html" eol=lf
|
|
10
|
-
"*.css" eol=lf
|
|
11
|
-
"*.vue" eol=lf
|
|
12
|
-
"*.json" eol=lf
|
|
13
|
-
"*.less" eol=lf
|
|
14
|
-
"*.scss" eol=lf
|
|
15
|
-
"*.sass" eol=lf
|
|
16
|
-
"*.styl" eol=lf
|
|
17
|
-
"*.svelte" eol=lf
|
|
18
|
-
"*.md" eol=lf
|
|
19
|
-
"*.yml" eol=lf
|
|
20
|
-
"*.astro" eol=lf
|
|
21
|
-
"*.mdx" eol=lf
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
# Logs
|
|
2
|
-
logs
|
|
3
|
-
*.log
|
|
4
|
-
npm-debug.log*
|
|
5
|
-
yarn-debug.log*
|
|
6
|
-
yarn-error.log*
|
|
7
|
-
pnpm-debug.log*
|
|
8
|
-
lerna-debug.log*
|
|
9
|
-
|
|
10
|
-
node_modules
|
|
11
|
-
.DS_Store
|
|
12
|
-
dist
|
|
13
|
-
dist-ssr
|
|
14
|
-
coverage
|
|
15
|
-
*.local
|
|
16
|
-
|
|
17
|
-
/cypress/videos/
|
|
18
|
-
/cypress/screenshots/
|
|
19
|
-
|
|
20
|
-
# Editor directories and files
|
|
21
|
-
.vscode/*
|
|
22
|
-
!.vscode/extensions.json
|
|
23
|
-
!.vscode/settings.json
|
|
24
|
-
!.vscode/launch.json
|
|
25
|
-
.idea
|
|
26
|
-
*.suo
|
|
27
|
-
*.ntvs*
|
|
28
|
-
*.njsproj
|
|
29
|
-
*.sln
|
|
30
|
-
*.sw?
|
package/template-unbuild/_npmrc
DELETED
|
File without changes
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { URL, fileURLToPath } from 'node:url';
|
|
2
|
-
import { defineBuildConfig } from 'unbuild';
|
|
3
|
-
|
|
4
|
-
export default defineBuildConfig({
|
|
5
|
-
alias: {
|
|
6
|
-
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
7
|
-
},
|
|
8
|
-
entries: ['src/index'],
|
|
9
|
-
clean: true,
|
|
10
|
-
declaration: true,
|
|
11
|
-
rollup: {
|
|
12
|
-
emitCJS: true,
|
|
13
|
-
inlineDependencies: true,
|
|
14
|
-
esbuild: {
|
|
15
|
-
minify: true
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
sourcemap: false
|
|
19
|
-
});
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "template-unbuild",
|
|
3
|
-
"type": "module",
|
|
4
|
-
"version": "0.0.0",
|
|
5
|
-
"private": true,
|
|
6
|
-
"packageManager": "pnpm@10.12.1",
|
|
7
|
-
"publishConfig": {
|
|
8
|
-
"registry": "https://registry.npmjs.org/"
|
|
9
|
-
},
|
|
10
|
-
"sideEffects": false,
|
|
11
|
-
"exports": {
|
|
12
|
-
".": {
|
|
13
|
-
"types": "./dist/index.d.ts",
|
|
14
|
-
"import": "./dist/index.mjs",
|
|
15
|
-
"require": "./dist/index.cjs"
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
"main": "dist/index.cjs",
|
|
19
|
-
"module": "dist/index.mjs",
|
|
20
|
-
"types": "dist/index.d.ts",
|
|
21
|
-
"files": ["dist"],
|
|
22
|
-
"scripts": {
|
|
23
|
-
"build": "unbuild",
|
|
24
|
-
"cleanup": "soy cleanup",
|
|
25
|
-
"commit": "soy git-commit",
|
|
26
|
-
"lint": "eslint . --fix",
|
|
27
|
-
"prepare": "simple-git-hooks",
|
|
28
|
-
"publish-pkg": "pnpm publish --access public",
|
|
29
|
-
"release": "soy release",
|
|
30
|
-
"typecheck": "tsc --noEmit --skipLibCheck",
|
|
31
|
-
"update-pkg": "soy ncu"
|
|
32
|
-
},
|
|
33
|
-
"dependencies": {
|
|
34
|
-
"cli-progress": "3.12.0",
|
|
35
|
-
"consola": "3.4.2",
|
|
36
|
-
"dayjs": "1.11.13",
|
|
37
|
-
"execa": "9.6.0",
|
|
38
|
-
"kolorist": "1.8.0",
|
|
39
|
-
"ofetch": "1.4.1"
|
|
40
|
-
},
|
|
41
|
-
"devDependencies": {
|
|
42
|
-
"@soybeanjs/cli": "1.3.1",
|
|
43
|
-
"@soybeanjs/eslint-config": "1.6.1",
|
|
44
|
-
"@types/cli-progress": "3.11.6",
|
|
45
|
-
"@types/node": "22.15.30",
|
|
46
|
-
"eslint": "9.28.0",
|
|
47
|
-
"lint-staged": "16.1.0",
|
|
48
|
-
"simple-git-hooks": "2.13.0",
|
|
49
|
-
"tsx": "4.19.4",
|
|
50
|
-
"typescript": "5.8.3",
|
|
51
|
-
"unbuild": "3.5.0"
|
|
52
|
-
},
|
|
53
|
-
"simple-git-hooks": {
|
|
54
|
-
"commit-msg": "pnpm soy git-commit-verify",
|
|
55
|
-
"pre-commit": "pnpm typecheck && pnpm lint-staged"
|
|
56
|
-
},
|
|
57
|
-
"lint-staged": {
|
|
58
|
-
"*": "eslint --fix"
|
|
59
|
-
}
|
|
60
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ESNext",
|
|
4
|
-
"jsx": "preserve",
|
|
5
|
-
"lib": ["DOM", "ESNext"],
|
|
6
|
-
"baseUrl": ".",
|
|
7
|
-
"module": "ESNext",
|
|
8
|
-
"moduleResolution": "node",
|
|
9
|
-
"paths": {
|
|
10
|
-
"@/*": ["./src/*"]
|
|
11
|
-
},
|
|
12
|
-
"resolveJsonModule": true,
|
|
13
|
-
"types": ["node"],
|
|
14
|
-
"strict": true,
|
|
15
|
-
"strictNullChecks": true,
|
|
16
|
-
"noUnusedLocals": true,
|
|
17
|
-
"outDir": "./dist",
|
|
18
|
-
"allowSyntheticDefaultImports": true,
|
|
19
|
-
"esModuleInterop": true,
|
|
20
|
-
"forceConsistentCasingInFileNames": true
|
|
21
|
-
},
|
|
22
|
-
"include": ["src/**/*"],
|
|
23
|
-
"exclude": ["node_modules", "dist"]
|
|
24
|
-
}
|