create-soybean 1.3.1 → 1.4.0-beta.2

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 (35) hide show
  1. package/dist/index.js +163 -5
  2. package/package.json +5 -6
  3. package/template-pnpm-monorepo/package.json +8 -8
  4. package/template-pnpm-monorepo/packages/demo-pkg/package.json +3 -3
  5. package/template-tsdown/package.json +11 -11
  6. package/template-vue/package.json +21 -21
  7. package/template-vue-tsdown/package.json +18 -18
  8. package/template-tsup/.github/workflows/release.yml +0 -46
  9. package/template-tsup/.vscode/extensions.json +0 -19
  10. package/template-tsup/.vscode/launch.json +0 -15
  11. package/template-tsup/.vscode/settings.json +0 -9
  12. package/template-tsup/_editorconfig +0 -11
  13. package/template-tsup/_gitattributes +0 -21
  14. package/template-tsup/_gitignore +0 -30
  15. package/template-tsup/_npmrc +0 -2
  16. package/template-tsup/_prettierrc +0 -0
  17. package/template-tsup/eslint.config.js +0 -3
  18. package/template-tsup/package.json +0 -61
  19. package/template-tsup/src/index.ts +0 -3
  20. package/template-tsup/tsconfig.json +0 -24
  21. package/template-tsup/tsup.config.ts +0 -18
  22. package/template-unbuild/.github/workflows/release.yml +0 -46
  23. package/template-unbuild/.vscode/extensions.json +0 -19
  24. package/template-unbuild/.vscode/launch.json +0 -15
  25. package/template-unbuild/.vscode/settings.json +0 -9
  26. package/template-unbuild/_editorconfig +0 -11
  27. package/template-unbuild/_gitattributes +0 -21
  28. package/template-unbuild/_gitignore +0 -30
  29. package/template-unbuild/_npmrc +0 -2
  30. package/template-unbuild/_prettierrc +0 -0
  31. package/template-unbuild/build.config.ts +0 -19
  32. package/template-unbuild/eslint.config.js +0 -3
  33. package/template-unbuild/package.json +0 -60
  34. package/template-unbuild/src/index.ts +0 -3
  35. package/template-unbuild/tsconfig.json +0 -24
package/dist/index.js CHANGED
@@ -1,6 +1,164 @@
1
1
  #!/usr/bin/env node
2
- import $ from"process";import{existsSync as _,mkdirSync as q,readFileSync as B,readdirSync as G,writeFileSync as H}from"fs";import a from"path";import{fileURLToPath as K}from"url";import{cyan as b,green as D,red as Q,reset as m,yellow as W}from"kolorist";import X from"minimist";import Y from"prompts";import{consola as g}from"consola";import{copyFileSync as O,existsSync as R,mkdirSync as J,readdirSync as v,rmSync as I,statSync as M}from"fs";import d from"path";function w(e){return e?.trim()?.replace(/\/+$/g,"")}function h(e){let t=v(e);return t.length===0||t.length===1&&t[0]===".git"}function S(e){return/^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(e)}function N(e){return e.trim().toLowerCase().replace(/\s+/g,"-").replace(/^[._]/,"").replace(/[^a-z\d\-~]+/g,"-")}function x(e){if(!R(e))return;let s=v(e);for(let n of s)if(n!==".git"){let o=d.resolve(e,n);I(o,{recursive:!0,force:!0})}}function U(e,t){J(t,{recursive:!0});let s=v(e);for(let n of s){let o=d.resolve(e,n),l=d.resolve(t,n);T(o,l)}}function T(e,t){M(e).isDirectory()?U(e,t):O(e,t)}var F=[{type:"pnpm-monorepo",name:"Pnpm monorepo",color:W},{type:"tsdown",name:"TypeScript library by tsdown",color:b},{type:"tsup",name:"TypeScript library by tsup",color:b},{type:"unbuild",name:"TypeScript library by unbuild",color:b},{type:"vue",name:"Vue 3",color:D},{type:"vue-tsdown",name:"Vue 3 + TypeScript library by tsdown",color:D}],C=F.map(e=>e.type),Z={_editorconfig:".editorconfig",_gitattributes:".gitattributes",_gitignore:".gitignore",_npmrc:".npmrc",_prettierrc:".prettierrc"},k="create-soybean-project";async function ee(){let e=$.cwd(),t=X($.argv.slice(2),{string:["_"]}),s=w(t._[0]),n=t.template||t.t,o=s||k;function l(){return o==="."?a.basename(a.resolve()):o}let u=null;try{u=await Y([{type:s?null:"text",name:"projectName",message:m("Project name:"),initial:k,onState:r=>{o=w(r.value)||k}},{type:()=>!_(o)||h(o)?null:"confirm",name:"overwrite",message:()=>`${o==="."?"Current directory":`Target directory "${o}"`} is not empty. Remove existing files and continue?`},{type:(r,{overwrite:i})=>{if(i===!1)throw new Error(`${Q("\u2716")} Operation cancelled`);return null},name:"overwriteChecker"},{type:()=>S(l())?null:"text",name:"packageName",message:m("Package name:"),initial:()=>N(l()),validate:r=>S(r)||"Invalid package.json name"},{type:n&&C.includes(n)?null:"select",name:"template",message:typeof n=="string"&&!C.includes(n)?m(`"${n}" isn't a valid template. Please choose from below: `):m("Select a template:"),initial:0,choices:F.map(({type:r,name:i,color:p})=>({title:p(i),value:r}))}])}catch(r){g.error(r)}if(!u)return;let{template:E,overwrite:V,packageName:z}=u,c=a.join(e,o);V?x(c):_(c)||q(c,{recursive:!0});let A=E||n;g.info(`
3
- Scaffolding project in ${c}...`);let f=a.resolve(K(import.meta.url),"../..",`template-${A}`),P=(r,i)=>{let p=a.join(c,Z[r]??r);i?H(p,i):T(a.join(f,r),p)},L=G(f);for(let r of L.filter(i=>i!=="package.json"))P(r);let j=JSON.parse(B(a.join(f,"package.json"),"utf-8"));j.name=z||l(),P("package.json",`${JSON.stringify(j,null,2)}
4
- `);let y=a.relative(e,c);g.info(`
5
- Done. Now run:
6
- `),c!==e&&g.info(` cd ${y.includes(" ")?`"${y}"`:y}`)}ee();
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
164
+ export { };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-soybean",
3
3
  "type": "module",
4
- "version": "1.3.1",
4
+ "version": "1.4.0-beta.2",
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
- "tsup": "8.5.0",
40
- "typescript": "5.8.3"
38
+ "tsdown": "0.14.2",
39
+ "typescript": "5.9.2"
41
40
  },
42
41
  "scripts": {
43
42
  "build": "pnpm typecheck && pnpm build-only",
44
- "build-only": "tsup",
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.12.1",
6
+ "packageManager": "pnpm@10.15.0",
7
7
  "scripts": {
8
8
  "cleanup": "soy cleanup",
9
9
  "commit": "soy git-commit",
@@ -15,13 +15,13 @@
15
15
  },
16
16
  "dependencies": {},
17
17
  "devDependencies": {
18
- "@soybeanjs/cli": "1.3.1",
19
- "@soybeanjs/eslint-config": "1.6.1",
20
- "eslint": "9.28.0",
21
- "lint-staged": "16.1.0",
22
- "simple-git-hooks": "2.13.0",
23
- "tsx": "4.19.4",
24
- "typescript": "5.8.3"
18
+ "@soybeanjs/cli": "1.4.0-beta.2",
19
+ "@soybeanjs/eslint-config": "1.7.1",
20
+ "eslint": "9.34.0",
21
+ "lint-staged": "16.1.5",
22
+ "simple-git-hooks": "2.13.1",
23
+ "tsx": "4.20.5",
24
+ "typescript": "5.9.2"
25
25
  },
26
26
  "simple-git-hooks": {
27
27
  "commit-msg": "pnpm soy git-commit-verify",
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "demo-pkg",
3
3
  "type": "module",
4
- "version": "1.3.1",
4
+ "version": "1.4.0-beta.2",
5
5
  "private": true,
6
- "packageManager": "pnpm@10.12.1",
6
+ "packageManager": "pnpm@10.15.0",
7
7
  "scripts": {
8
8
  "typecheck": "tsc --noEmit --skipLibCheck"
9
9
  },
10
10
  "dependencies": {},
11
11
  "devDependencies": {
12
- "typescript": "5.8.3"
12
+ "typescript": "5.9.2"
13
13
  }
14
14
  }
@@ -3,7 +3,7 @@
3
3
  "type": "module",
4
4
  "version": "0.0.0",
5
5
  "private": true,
6
- "packageManager": "pnpm@10.12.1",
6
+ "packageManager": "pnpm@10.15.0",
7
7
  "publishConfig": {
8
8
  "registry": "https://registry.npmjs.org/"
9
9
  },
@@ -34,22 +34,22 @@
34
34
  "dependencies": {
35
35
  "cli-progress": "3.12.0",
36
36
  "consola": "3.4.2",
37
- "dayjs": "1.11.13",
37
+ "dayjs": "1.11.14",
38
38
  "execa": "9.6.0",
39
39
  "kolorist": "1.8.0",
40
40
  "ofetch": "1.4.1"
41
41
  },
42
42
  "devDependencies": {
43
- "@soybeanjs/cli": "1.3.1",
44
- "@soybeanjs/eslint-config": "1.6.1",
43
+ "@soybeanjs/cli": "1.4.0-beta.2",
44
+ "@soybeanjs/eslint-config": "1.7.1",
45
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
- "tsdown": "0.12.7",
51
- "tsx": "4.19.4",
52
- "typescript": "5.8.3"
46
+ "@types/node": "24.3.0",
47
+ "eslint": "9.34.0",
48
+ "lint-staged": "16.1.5",
49
+ "simple-git-hooks": "2.13.1",
50
+ "tsdown": "0.14.2",
51
+ "tsx": "4.20.5",
52
+ "typescript": "5.9.2"
53
53
  },
54
54
  "simple-git-hooks": {
55
55
  "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.12.1",
6
+ "packageManager": "pnpm@10.15.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.1.4",
20
+ "@unocss/reset": "66.4.2",
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.16",
24
+ "vue": "3.5.20",
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.3.1",
30
- "@soybeanjs/eslint-config": "1.6.1",
31
- "@types/node": "22.15.30",
32
- "@unocss/eslint-config": "66.1.4",
33
- "@vitejs/plugin-vue": "5.2.4",
34
- "@vitejs/plugin-vue-jsx": "4.2.0",
35
- "elegant-router": "1.0.2",
36
- "eslint": "9.28.0",
37
- "eslint-plugin-vue": "10.2.0",
38
- "lint-staged": "16.1.0",
39
- "simple-git-hooks": "2.13.0",
40
- "typescript": "5.8.3",
41
- "unocss": "66.1.4",
42
- "unplugin-vue-components": "28.7.0",
43
- "vite": "6.3.5",
44
- "vite-plugin-vue-devtools": "7.7.6",
45
- "vue-eslint-parser": "10.1.3",
46
- "vue-tsc": "2.2.10"
29
+ "@soybeanjs/cli": "1.4.0-beta.2",
30
+ "@soybeanjs/eslint-config": "1.7.1",
31
+ "@types/node": "24.3.0",
32
+ "@unocss/eslint-config": "66.4.2",
33
+ "@vitejs/plugin-vue": "6.0.1",
34
+ "@vitejs/plugin-vue-jsx": "5.1.0",
35
+ "elegant-router": "1.0.3",
36
+ "eslint": "9.34.0",
37
+ "eslint-plugin-vue": "10.4.0",
38
+ "lint-staged": "16.1.5",
39
+ "simple-git-hooks": "2.13.1",
40
+ "typescript": "5.9.2",
41
+ "unocss": "66.4.2",
42
+ "unplugin-vue-components": "29.0.0",
43
+ "vite": "7.1.3",
44
+ "vite-plugin-vue-devtools": "8.0.1",
45
+ "vue-eslint-parser": "10.2.0",
46
+ "vue-tsc": "3.0.6"
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.12.1",
6
+ "packageManager": "pnpm@10.15.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.3.1",
39
- "@soybeanjs/eslint-config": "1.6.1",
40
- "@types/node": "22.15.30",
38
+ "@soybeanjs/cli": "1.4.0-beta.2",
39
+ "@soybeanjs/eslint-config": "1.7.1",
40
+ "@types/node": "24.3.0",
41
41
  "@vue/test-utils": "2.4.6",
42
- "eslint": "9.28.0",
43
- "eslint-plugin-vue": "10.2.0",
44
- "happy-dom": "17.6.3",
45
- "lint-staged": "16.1.0",
46
- "simple-git-hooks": "2.13.0",
47
- "tsdown": "0.12.7",
48
- "tsx": "4.19.4",
49
- "typescript": "5.8.3",
50
- "unplugin-vue": "6.2.0",
42
+ "eslint": "9.34.0",
43
+ "eslint-plugin-vue": "10.4.0",
44
+ "happy-dom": "18.0.1",
45
+ "lint-staged": "16.1.5",
46
+ "simple-git-hooks": "2.13.1",
47
+ "tsdown": "0.14.2",
48
+ "tsx": "4.20.5",
49
+ "typescript": "5.9.2",
50
+ "unplugin-vue": "7.0.1",
51
51
  "unplugin-vue-jsx": "0.6.1",
52
- "vite": "6.3.5",
53
- "vitest": "3.2.3",
54
- "vue": "3.5.16",
55
- "vue-eslint-parser": "10.1.3",
56
- "vue-tsc": "2.2.10"
52
+ "vite": "7.1.3",
53
+ "vitest": "3.2.4",
54
+ "vue": "3.5.20",
55
+ "vue-eslint-parser": "10.2.0",
56
+ "vue-tsc": "3.0.6"
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,9 +0,0 @@
1
- {
2
- "editor.codeActionsOnSave": {
3
- "source.fixAll.eslint": "explicit",
4
- "source.organizeImports": "never"
5
- },
6
- "editor.formatOnSave": false,
7
- "eslint.validate": ["json", "jsonc"],
8
- "prettier.enable": false
9
- }
@@ -1,11 +0,0 @@
1
- # Editor configuration, see http://editorconfig.org
2
-
3
- root = true
4
-
5
- [*]
6
- charset = utf-8
7
- indent_style = space
8
- indent_size = 2
9
- end_of_line = lf
10
- trim_trailing_whitespace = true
11
- insert_final_newline = true
@@ -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?
@@ -1,2 +0,0 @@
1
- registry=https://registry.npmmirror.com/
2
- shamefully-hoist=true
File without changes
@@ -1,3 +0,0 @@
1
- import { defineConfig } from '@soybeanjs/eslint-config';
2
-
3
- export default defineConfig();
@@ -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,3 +0,0 @@
1
- export function fn() {
2
- return '';
3
- }
@@ -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,9 +0,0 @@
1
- {
2
- "editor.codeActionsOnSave": {
3
- "source.fixAll.eslint": "explicit",
4
- "source.organizeImports": "never"
5
- },
6
- "editor.formatOnSave": false,
7
- "eslint.validate": ["json", "jsonc"],
8
- "prettier.enable": false
9
- }
@@ -1,11 +0,0 @@
1
- # Editor configuration, see http://editorconfig.org
2
-
3
- root = true
4
-
5
- [*]
6
- charset = utf-8
7
- indent_style = space
8
- indent_size = 2
9
- end_of_line = lf
10
- trim_trailing_whitespace = true
11
- insert_final_newline = true
@@ -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?
@@ -1,2 +0,0 @@
1
- registry=https://registry.npmmirror.com/
2
- shamefully-hoist=true
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,3 +0,0 @@
1
- import { defineConfig } from '@soybeanjs/eslint-config';
2
-
3
- export default defineConfig();
@@ -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,3 +0,0 @@
1
- export function fn() {
2
- return 1;
3
- }
@@ -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
- }