create-soybean 1.4.4 → 1.5.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 +5 -9
- package/package.json +11 -11
- package/template-tsdown/.github/workflows/release.yml +2 -2
- package/template-tsdown/.vscode/extensions.json +0 -6
- package/template-tsdown/.vscode/settings.json +3 -5
- package/template-tsdown/_gitattributes +0 -1
- package/template-tsdown/_npmrc +0 -1
- package/template-tsdown/_oxfmtrc.json +7 -0
- package/template-tsdown/_oxlintrc.json +16 -0
- package/template-tsdown/package.json +24 -31
- package/template-tsdown/tsconfig.json +4 -10
- package/template-tsdown/tsdown.config.ts +0 -7
- package/template-vue/.vscode/extensions.json +0 -3
- package/template-vue/.vscode/settings.json +3 -17
- package/template-vue/_gitattributes +0 -1
- package/template-vue/_oxfmtrc.json +7 -0
- package/template-vue/_oxlintrc.json +17 -0
- package/template-vue/package.json +24 -28
- package/template-vue/src/store/_plugin.ts +17 -0
- package/template-vue/src/store/{modules/counter → counter}/index.ts +1 -2
- package/template-vue/src/store/index.ts +1 -1
- package/template-vue/src/styles/app.css +42 -1
- package/template-vue/src/typings/components.d.ts +1 -1
- package/template-vue/tsconfig.base.json +4 -6
- package/template-vue/tsconfig.json +2 -2
- package/template-vue/uno.config.ts +3 -3
- package/template-vue/vite.config.ts +7 -2
- package/template-vue-tsdown/.github/workflows/release.yml +2 -2
- package/template-vue-tsdown/.vscode/extensions.json +0 -2
- package/template-vue-tsdown/.vscode/settings.json +3 -5
- package/template-vue-tsdown/_gitattributes +0 -1
- package/template-vue-tsdown/_npmrc +0 -1
- package/template-vue-tsdown/_oxfmtrc.json +7 -0
- package/template-vue-tsdown/_oxlintrc.json +17 -0
- package/template-vue-tsdown/package.json +27 -27
- package/template-vue-tsdown/tsconfig.json +4 -8
- package/template-vue-tsdown/tsdown.config.ts +4 -5
- package/template-pnpm-monorepo/.vscode/extensions.json +0 -19
- package/template-pnpm-monorepo/.vscode/launch.json +0 -15
- package/template-pnpm-monorepo/.vscode/settings.json +0 -10
- package/template-pnpm-monorepo/_editorconfig +0 -11
- package/template-pnpm-monorepo/_gitattributes +0 -21
- package/template-pnpm-monorepo/_gitignore +0 -30
- package/template-pnpm-monorepo/_npmrc +0 -3
- package/template-pnpm-monorepo/_prettierrc +0 -0
- package/template-pnpm-monorepo/eslint.config.js +0 -3
- package/template-pnpm-monorepo/package.json +0 -33
- package/template-pnpm-monorepo/packages/demo-pkg/package.json +0 -14
- package/template-pnpm-monorepo/packages/demo-pkg/tsconfig.json +0 -4
- package/template-pnpm-monorepo/pnpm-workspace.yaml +0 -2
- package/template-pnpm-monorepo/src/index.ts +0 -3
- package/template-pnpm-monorepo/tsconfig.base.json +0 -30
- package/template-pnpm-monorepo/tsconfig.json +0 -4
- package/template-tsdown/_prettierrc +0 -0
- package/template-tsdown/eslint.config.js +0 -3
- package/template-vue/eslint.config.js +0 -24
- package/template-vue/src/store/id.ts +0 -3
- package/template-vue/src/store/plugins/index.ts +0 -22
- package/template-vue-tsdown/_prettierrc +0 -0
- package/template-vue-tsdown/eslint.config.js +0 -5
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import process from "node:process";
|
|
|
3
3
|
import { copyFileSync, existsSync, mkdirSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
|
-
import { cyan, green, red, reset
|
|
6
|
+
import { cyan, green, red, reset } from "kolorist";
|
|
7
7
|
import minimist from "minimist";
|
|
8
8
|
import prompts from "prompts";
|
|
9
9
|
import { consola } from "consola";
|
|
@@ -43,11 +43,6 @@ function copy(src, dest) {
|
|
|
43
43
|
//#endregion
|
|
44
44
|
//#region src/index.ts
|
|
45
45
|
const templates = [
|
|
46
|
-
{
|
|
47
|
-
type: "pnpm-monorepo",
|
|
48
|
-
name: "Pnpm monorepo",
|
|
49
|
-
color: yellow
|
|
50
|
-
},
|
|
51
46
|
{
|
|
52
47
|
type: "tsdown",
|
|
53
48
|
name: "TypeScript library by tsdown",
|
|
@@ -70,7 +65,8 @@ const renameFiles = {
|
|
|
70
65
|
_gitattributes: ".gitattributes",
|
|
71
66
|
_gitignore: ".gitignore",
|
|
72
67
|
_npmrc: ".npmrc",
|
|
73
|
-
|
|
68
|
+
"_oxlintrc.json": ".oxlintrc.json",
|
|
69
|
+
"_oxfmtrc.json": ".oxfmtrc.json"
|
|
74
70
|
};
|
|
75
71
|
const defaultTargetDir = "create-soybean-project";
|
|
76
72
|
async function setupCli() {
|
|
@@ -100,8 +96,8 @@ async function setupCli() {
|
|
|
100
96
|
message: () => `${targetDir === "." ? "Current directory" : `Target directory "${targetDir}"`} is not empty. Remove existing files and continue?`
|
|
101
97
|
},
|
|
102
98
|
{
|
|
103
|
-
type: (_, { overwrite
|
|
104
|
-
if (overwrite
|
|
99
|
+
type: (_, { overwrite }) => {
|
|
100
|
+
if (overwrite === false) throw new Error(`${red("✖")} Operation cancelled`);
|
|
105
101
|
return null;
|
|
106
102
|
},
|
|
107
103
|
name: "overwriteChecker"
|
package/package.json
CHANGED
|
@@ -1,24 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-soybean",
|
|
3
|
-
"
|
|
4
|
-
"version": "1.4.4",
|
|
3
|
+
"version": "1.5.0-beta.1",
|
|
5
4
|
"description": "SoybeanJS's command line to create different project templates",
|
|
5
|
+
"homepage": "https://github.com/soybeanjs/cli/tree/main/packages/create-soybean",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/soybeanjs/cli/issues"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
6
10
|
"author": {
|
|
7
11
|
"name": "Soybean",
|
|
8
12
|
"email": "soybeanjs@outlook.com",
|
|
9
13
|
"url": "https://github.com/soybeanjs"
|
|
10
14
|
},
|
|
11
|
-
"license": "MIT",
|
|
12
|
-
"homepage": "https://github.com/soybeanjs/cli/tree/main/packages/create-soybean",
|
|
13
15
|
"repository": {
|
|
14
16
|
"url": "https://github.com/soybeanjs/cli.git"
|
|
15
17
|
},
|
|
16
|
-
"bugs": {
|
|
17
|
-
"url": "https://github.com/soybeanjs/cli/issues"
|
|
18
|
-
},
|
|
19
|
-
"publishConfig": {
|
|
20
|
-
"registry": "https://registry.npmjs.org/"
|
|
21
|
-
},
|
|
22
18
|
"bin": {
|
|
23
19
|
"create-soybean": "dist/index.js"
|
|
24
20
|
},
|
|
@@ -26,6 +22,10 @@
|
|
|
26
22
|
"dist",
|
|
27
23
|
"template-*"
|
|
28
24
|
],
|
|
25
|
+
"type": "module",
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"registry": "https://registry.npmjs.org/"
|
|
28
|
+
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"consola": "3.4.2",
|
|
31
31
|
"kolorist": "1.8.0",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/minimist": "1.2.5",
|
|
37
37
|
"@types/prompts": "2.4.9",
|
|
38
|
-
"tsdown": "0.
|
|
38
|
+
"tsdown": "0.20.3",
|
|
39
39
|
"typescript": "5.9.3"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
@@ -3,7 +3,7 @@ name: Release
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
5
|
tags:
|
|
6
|
-
-
|
|
6
|
+
- 'v*'
|
|
7
7
|
|
|
8
8
|
jobs:
|
|
9
9
|
release:
|
|
@@ -24,7 +24,7 @@ jobs:
|
|
|
24
24
|
with:
|
|
25
25
|
node-version: lts/*
|
|
26
26
|
cache: pnpm
|
|
27
|
-
registry-url:
|
|
27
|
+
registry-url: 'https://registry.npmjs.org'
|
|
28
28
|
|
|
29
29
|
- run: npx githublogen
|
|
30
30
|
env:
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"recommendations": [
|
|
3
|
-
"afzalsayed96.icones",
|
|
4
|
-
"antfu.iconify",
|
|
5
|
-
"antfu.unocss",
|
|
6
|
-
"dbaeumer.vscode-eslint",
|
|
7
3
|
"editorconfig.editorconfig",
|
|
8
|
-
"esbenp.prettier-vscode",
|
|
9
|
-
"lokalise.i18n-ally",
|
|
10
4
|
"mhutchie.git-graph",
|
|
11
5
|
"mikestead.dotenv",
|
|
12
6
|
"naumovs.color-highlight",
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"editor.codeActionsOnSave": {
|
|
3
|
-
"source.fixAll.
|
|
4
|
-
"source.organizeImports": "never"
|
|
3
|
+
"source.fixAll.oxc": "explicit"
|
|
5
4
|
},
|
|
6
|
-
"editor.
|
|
7
|
-
"
|
|
8
|
-
"prettier.enable": false
|
|
5
|
+
"editor.defaultFormatter": "oxc.oxc-vscode",
|
|
6
|
+
"editor.formatOnSave": true
|
|
9
7
|
}
|
package/template-tsdown/_npmrc
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
|
3
|
+
"categories": {
|
|
4
|
+
"correctness": "error",
|
|
5
|
+
"suspicious": "error"
|
|
6
|
+
},
|
|
7
|
+
"plugins": ["eslint", "typescript", "unicorn", "oxc", "import"],
|
|
8
|
+
"rules": {
|
|
9
|
+
"unicorn/consistent-function-scoping": "off",
|
|
10
|
+
"unicorn/no-array-reverse": "off",
|
|
11
|
+
"unicorn/no-array-sort": "off",
|
|
12
|
+
"unicorn/no-empty-file": "off",
|
|
13
|
+
"import/no-unassigned-import": "off",
|
|
14
|
+
"unicorn/require-module-specifiers": "off"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -1,53 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "template-tsdown",
|
|
3
|
-
"type": "module",
|
|
4
3
|
"version": "0.0.0",
|
|
5
4
|
"private": true,
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
5
|
+
"files": [
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
8
|
+
"type": "module",
|
|
9
|
+
"main": "./dist/index.js",
|
|
10
|
+
"module": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
11
12
|
"exports": {
|
|
12
13
|
".": {
|
|
13
14
|
"types": "./dist/index.d.ts",
|
|
14
|
-
"import": "./dist/index.
|
|
15
|
-
"require": "./dist/index.
|
|
15
|
+
"import": "./dist/index.js",
|
|
16
|
+
"require": "./dist/index.js"
|
|
16
17
|
}
|
|
17
18
|
},
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"files": ["dist"],
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"registry": "https://registry.npmjs.org/"
|
|
21
|
+
},
|
|
22
22
|
"scripts": {
|
|
23
23
|
"build": "tsdown",
|
|
24
24
|
"cleanup": "soy cleanup",
|
|
25
25
|
"commit": "soy git-commit",
|
|
26
|
-
"
|
|
27
|
-
"
|
|
26
|
+
"lint": "oxlint --fix && oxfmt",
|
|
27
|
+
"fmt": "oxfmt",
|
|
28
28
|
"prepare": "simple-git-hooks",
|
|
29
29
|
"publish-pkg": "pnpm publish --access public",
|
|
30
30
|
"release": "soy release",
|
|
31
31
|
"typecheck": "tsc --noEmit --skipLibCheck",
|
|
32
|
-
"
|
|
33
|
-
},
|
|
34
|
-
"dependencies": {
|
|
35
|
-
"cli-progress": "3.12.0",
|
|
36
|
-
"consola": "3.4.2",
|
|
37
|
-
"dayjs": "1.11.19",
|
|
38
|
-
"execa": "9.6.1",
|
|
39
|
-
"kolorist": "1.8.0",
|
|
40
|
-
"ofetch": "1.5.1"
|
|
32
|
+
"upkg": "soy update-pkg"
|
|
41
33
|
},
|
|
34
|
+
"dependencies": {},
|
|
42
35
|
"devDependencies": {
|
|
43
|
-
"@soybeanjs/cli": "1.
|
|
44
|
-
"@
|
|
45
|
-
"@types/cli-progress": "3.11.6",
|
|
46
|
-
"@types/node": "25.0.3",
|
|
47
|
-
"eslint": "9.39.2",
|
|
36
|
+
"@soybeanjs/cli": "1.5.0-beta.1",
|
|
37
|
+
"@types/node": "25.2.0",
|
|
48
38
|
"lint-staged": "16.2.7",
|
|
39
|
+
"oxfmt": "^0.28.0",
|
|
40
|
+
"oxlint": "^1.43.0",
|
|
49
41
|
"simple-git-hooks": "2.13.1",
|
|
50
|
-
"tsdown": "0.
|
|
42
|
+
"tsdown": "0.20.3",
|
|
51
43
|
"tsx": "4.21.0",
|
|
52
44
|
"typescript": "5.9.3"
|
|
53
45
|
},
|
|
@@ -56,6 +48,7 @@
|
|
|
56
48
|
"pre-commit": "pnpm typecheck && pnpm lint-staged"
|
|
57
49
|
},
|
|
58
50
|
"lint-staged": {
|
|
59
|
-
"*": "
|
|
60
|
-
}
|
|
51
|
+
"*": "oxlint --fix && oxfmt"
|
|
52
|
+
},
|
|
53
|
+
"packageManager": "pnpm@10.28.2"
|
|
61
54
|
}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"target": "ESNext",
|
|
4
|
-
"jsx": "preserve",
|
|
5
|
-
"jsxImportSource": "vue",
|
|
6
4
|
"lib": ["DOM", "ESNext"],
|
|
7
|
-
"baseUrl": ".",
|
|
8
5
|
"module": "ESNext",
|
|
9
|
-
"moduleResolution": "
|
|
6
|
+
"moduleResolution": "Bundler",
|
|
10
7
|
"paths": {
|
|
11
8
|
"@/*": ["./src/*"]
|
|
12
9
|
},
|
|
@@ -14,16 +11,13 @@
|
|
|
14
11
|
"types": ["node"],
|
|
15
12
|
"strict": true,
|
|
16
13
|
"strictNullChecks": true,
|
|
14
|
+
"noImplicitThis": true,
|
|
15
|
+
"noUncheckedIndexedAccess": false,
|
|
17
16
|
"noUnusedLocals": true,
|
|
18
|
-
"declaration": true,
|
|
19
|
-
"emitDeclarationOnly": true,
|
|
20
|
-
"outDir": "./dist",
|
|
21
17
|
"allowSyntheticDefaultImports": true,
|
|
22
18
|
"esModuleInterop": true,
|
|
23
19
|
"forceConsistentCasingInFileNames": true,
|
|
24
|
-
"isolatedModules": true
|
|
25
|
-
"verbatimModuleSyntax": true,
|
|
26
|
-
"skipLibCheck": true
|
|
20
|
+
"isolatedModules": true
|
|
27
21
|
},
|
|
28
22
|
"include": ["src/**/*"],
|
|
29
23
|
"exclude": ["node_modules", "dist"]
|
|
@@ -5,13 +5,6 @@ export default defineConfig({
|
|
|
5
5
|
platform: 'neutral',
|
|
6
6
|
clean: true,
|
|
7
7
|
dts: true,
|
|
8
|
-
format: ['esm', 'cjs'],
|
|
9
|
-
outExtensions: ctx => {
|
|
10
|
-
return {
|
|
11
|
-
js: ctx.format === 'cjs' ? '.cjs' : '.mjs'
|
|
12
|
-
};
|
|
13
|
-
},
|
|
14
|
-
shims: true,
|
|
15
8
|
sourcemap: false,
|
|
16
9
|
minify: false
|
|
17
10
|
});
|
|
@@ -1,21 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"editor.codeActionsOnSave": {
|
|
3
|
-
"source.fixAll.
|
|
4
|
-
"source.organizeImports": "never"
|
|
3
|
+
"source.fixAll.oxc": "explicit"
|
|
5
4
|
},
|
|
6
|
-
"editor.
|
|
7
|
-
"
|
|
8
|
-
"html",
|
|
9
|
-
"css",
|
|
10
|
-
"scss",
|
|
11
|
-
"json",
|
|
12
|
-
"jsonc",
|
|
13
|
-
"javascript",
|
|
14
|
-
"javascriptreact",
|
|
15
|
-
"typescript",
|
|
16
|
-
"typescriptreact",
|
|
17
|
-
"vue",
|
|
18
|
-
"markdown"
|
|
19
|
-
],
|
|
20
|
-
"prettier.enable": false
|
|
5
|
+
"editor.defaultFormatter": "oxc.oxc-vscode",
|
|
6
|
+
"editor.formatOnSave": true
|
|
21
7
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
|
3
|
+
"categories": {
|
|
4
|
+
"correctness": "error",
|
|
5
|
+
"suspicious": "error"
|
|
6
|
+
},
|
|
7
|
+
"plugins": ["eslint", "typescript", "unicorn", "oxc", "import", "vue"],
|
|
8
|
+
"rules": {
|
|
9
|
+
"unicorn/consistent-function-scoping": "off",
|
|
10
|
+
"unicorn/no-array-reverse": "off",
|
|
11
|
+
"unicorn/no-array-sort": "off",
|
|
12
|
+
"unicorn/no-empty-file": "off",
|
|
13
|
+
"import/no-unassigned-import": "off",
|
|
14
|
+
"unicorn/require-module-specifiers": "off",
|
|
15
|
+
"vue/prefer-import-from-vue": "off"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -1,55 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "template-vue",
|
|
3
|
-
"type": "module",
|
|
4
3
|
"version": "0.0.0",
|
|
5
4
|
"private": true,
|
|
6
|
-
"
|
|
5
|
+
"type": "module",
|
|
7
6
|
"scripts": {
|
|
8
|
-
"build": "
|
|
9
|
-
"build-only": "vite build",
|
|
7
|
+
"build": "vite build",
|
|
10
8
|
"cleanup": "soy cleanup",
|
|
11
9
|
"commit": "soy git-commit",
|
|
12
10
|
"dev": "vite",
|
|
13
|
-
"lint": "
|
|
11
|
+
"lint": "oxlint --fix",
|
|
12
|
+
"fmt": "oxfmt",
|
|
14
13
|
"prepare": "simple-git-hooks",
|
|
15
14
|
"preview": "vite preview",
|
|
16
15
|
"typecheck": "vue-tsc --noEmit --skipLibCheck",
|
|
17
|
-
"
|
|
16
|
+
"upkg": "soy ncu"
|
|
18
17
|
},
|
|
19
18
|
"dependencies": {
|
|
20
|
-
"@soybeanjs/ui": "0.
|
|
21
|
-
"@unocss/reset": "66.
|
|
19
|
+
"@soybeanjs/ui": "0.5.3",
|
|
20
|
+
"@unocss/reset": "66.6.0",
|
|
22
21
|
"klona": "2.0.6",
|
|
23
22
|
"pinia": "3.0.4",
|
|
24
|
-
"vue": "3.5.
|
|
25
|
-
"vue-router": "
|
|
23
|
+
"vue": "3.5.27",
|
|
24
|
+
"vue-router": "5.0.2"
|
|
26
25
|
},
|
|
27
26
|
"devDependencies": {
|
|
28
|
-
"@soybeanjs/cli": "1.
|
|
29
|
-
"@soybeanjs/
|
|
30
|
-
"@
|
|
31
|
-
"@
|
|
32
|
-
"@
|
|
33
|
-
"
|
|
34
|
-
"@vitejs/plugin-vue-jsx": "5.1.2",
|
|
35
|
-
"elegant-router": "1.1.0",
|
|
36
|
-
"eslint": "9.39.2",
|
|
37
|
-
"eslint-plugin-vue": "10.6.2",
|
|
27
|
+
"@soybeanjs/cli": "1.5.0-beta.1",
|
|
28
|
+
"@soybeanjs/unocss-preset": "0.2.0",
|
|
29
|
+
"@types/node": "25.2.0",
|
|
30
|
+
"@vitejs/plugin-vue": "6.0.4",
|
|
31
|
+
"@vitejs/plugin-vue-jsx": "5.1.4",
|
|
32
|
+
"elegant-router": "1.1.2",
|
|
38
33
|
"lint-staged": "16.2.7",
|
|
34
|
+
"oxfmt": "^0.28.0",
|
|
35
|
+
"oxlint": "^1.43.0",
|
|
39
36
|
"simple-git-hooks": "2.13.1",
|
|
40
37
|
"typescript": "5.9.3",
|
|
41
|
-
"unocss": "66.
|
|
42
|
-
"unplugin-vue-components": "
|
|
43
|
-
"vite": "7.3.
|
|
44
|
-
"
|
|
45
|
-
"vue-eslint-parser": "10.2.0",
|
|
46
|
-
"vue-tsc": "3.2.1"
|
|
38
|
+
"unocss": "66.6.0",
|
|
39
|
+
"unplugin-vue-components": "31.0.0",
|
|
40
|
+
"vite": "7.3.1",
|
|
41
|
+
"vue-tsc": "3.2.4"
|
|
47
42
|
},
|
|
48
43
|
"simple-git-hooks": {
|
|
49
44
|
"commit-msg": "pnpm soy git-commit-verify",
|
|
50
45
|
"pre-commit": "pnpm typecheck && pnpm lint-staged"
|
|
51
46
|
},
|
|
52
47
|
"lint-staged": {
|
|
53
|
-
"*": "
|
|
54
|
-
}
|
|
48
|
+
"*": "oxlint --fix && oxfmt"
|
|
49
|
+
},
|
|
50
|
+
"packageManager": "pnpm@10.28.2"
|
|
55
51
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { PiniaPluginContext } from 'pinia';
|
|
2
|
+
import { klona } from 'klona/full';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The plugin reset the state of the store which is written by setup syntax
|
|
6
|
+
*
|
|
7
|
+
* @param context
|
|
8
|
+
*/
|
|
9
|
+
export function resetSetupStore(context: PiniaPluginContext) {
|
|
10
|
+
const { $state } = context.store;
|
|
11
|
+
|
|
12
|
+
const defaultStore = klona($state);
|
|
13
|
+
|
|
14
|
+
context.store.$reset = () => {
|
|
15
|
+
context.store.$patch(defaultStore);
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { computed, ref } from 'vue';
|
|
2
2
|
import { defineStore } from 'pinia';
|
|
3
|
-
import { storeIdRecord } from '../../id';
|
|
4
3
|
|
|
5
|
-
export const useCounterStore = defineStore(
|
|
4
|
+
export const useCounterStore = defineStore('Counter', () => {
|
|
6
5
|
const count = ref(0);
|
|
7
6
|
|
|
8
7
|
const doubleCount = computed(() => count.value * 2);
|
|
@@ -5,4 +5,45 @@ body,
|
|
|
5
5
|
}
|
|
6
6
|
html {
|
|
7
7
|
overflow-x: hidden;
|
|
8
|
-
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
html {
|
|
11
|
+
--scrollbar-color-light: rgba(0, 0, 0, 0.5);
|
|
12
|
+
--scrollbar-color-dark: rgba(255, 255, 255, 0.5);
|
|
13
|
+
--scrollbar-size: 8px;
|
|
14
|
+
--scrollbar-color: var(--scrollbar-color-light);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
html.dark {
|
|
18
|
+
--scrollbar-color: var(--scrollbar-color-dark);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
* {
|
|
22
|
+
scrollbar-width: thin;
|
|
23
|
+
scrollbar-color: var(--scrollbar-color) transparent;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* for safari */
|
|
27
|
+
.dark * {
|
|
28
|
+
color-scheme: dark;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
*::-webkit-scrollbar-thumb {
|
|
32
|
+
background-color: var(--scrollbar-color);
|
|
33
|
+
border-radius: var(--scrollbar-size);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
*::-webkit-scrollbar-thumb:hover {
|
|
37
|
+
background-color: var(--scrollbar-color);
|
|
38
|
+
border-radius: var(--scrollbar-size);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
*::-webkit-scrollbar {
|
|
42
|
+
width: var(--scrollbar-size);
|
|
43
|
+
height: var(--scrollbar-size);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
*::-webkit-scrollbar-track-piece {
|
|
47
|
+
background-color: transparent;
|
|
48
|
+
border-radius: 0;
|
|
49
|
+
}
|
|
@@ -5,16 +5,14 @@
|
|
|
5
5
|
"jsxImportSource": "vue",
|
|
6
6
|
"lib": ["DOM", "ESNext"],
|
|
7
7
|
"module": "ESNext",
|
|
8
|
-
"moduleResolution": "
|
|
9
|
-
"paths": {
|
|
10
|
-
"@/*": ["./src/*"]
|
|
11
|
-
},
|
|
8
|
+
"moduleResolution": "Bundler",
|
|
12
9
|
"resolveJsonModule": true,
|
|
13
10
|
"types": ["node", "vite/client"],
|
|
14
11
|
"strict": true,
|
|
15
12
|
"strictNullChecks": true,
|
|
16
|
-
"
|
|
17
|
-
"
|
|
13
|
+
"noImplicitThis": true,
|
|
14
|
+
"noUncheckedIndexedAccess": false,
|
|
15
|
+
"noUnusedLocals": false,
|
|
18
16
|
"allowSyntheticDefaultImports": true,
|
|
19
17
|
"esModuleInterop": true,
|
|
20
18
|
"forceConsistentCasingInFileNames": true,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
+
"extends": "./tsconfig.base.json",
|
|
2
3
|
"compilerOptions": {
|
|
3
|
-
"types": ["node", "vite/client","@soybeanjs/ui"]
|
|
4
|
+
"types": ["node", "vite/client", "@soybeanjs/ui"]
|
|
4
5
|
},
|
|
5
|
-
"extends": "./tsconfig.base.json",
|
|
6
6
|
"include": ["./**/*.ts", "./**/*.tsx", "./**/*.vue"]
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineConfig,
|
|
2
|
-
import {
|
|
1
|
+
import { defineConfig, presetWind3, transformerDirectives, transformerVariantGroup } from 'unocss';
|
|
2
|
+
import { presetSoybean } from '@soybeanjs/unocss-preset';
|
|
3
3
|
|
|
4
4
|
export default defineConfig({
|
|
5
5
|
content: {
|
|
@@ -8,5 +8,5 @@ export default defineConfig({
|
|
|
8
8
|
}
|
|
9
9
|
},
|
|
10
10
|
transformers: [transformerDirectives(), transformerVariantGroup()],
|
|
11
|
-
presets: [presetWind3({ dark: 'class' }),
|
|
11
|
+
presets: [presetWind3({ dark: 'class' }), presetSoybean()]
|
|
12
12
|
});
|
|
@@ -22,6 +22,11 @@ export default defineConfig({
|
|
|
22
22
|
types: [{ from: 'vue-router', names: ['RouterLink', 'RouterView'] }],
|
|
23
23
|
resolvers: [UiResolver()]
|
|
24
24
|
}),
|
|
25
|
-
ElegantRouter()
|
|
26
|
-
]
|
|
25
|
+
ElegantRouter()
|
|
26
|
+
],
|
|
27
|
+
server: {
|
|
28
|
+
host: '0.0.0.0',
|
|
29
|
+
port: 9527,
|
|
30
|
+
open: true
|
|
31
|
+
}
|
|
27
32
|
});
|
|
@@ -3,7 +3,7 @@ name: Release
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
5
|
tags:
|
|
6
|
-
-
|
|
6
|
+
- 'v*'
|
|
7
7
|
|
|
8
8
|
jobs:
|
|
9
9
|
release:
|
|
@@ -24,7 +24,7 @@ jobs:
|
|
|
24
24
|
with:
|
|
25
25
|
node-version: lts/*
|
|
26
26
|
cache: pnpm
|
|
27
|
-
registry-url:
|
|
27
|
+
registry-url: 'https://registry.npmjs.org'
|
|
28
28
|
|
|
29
29
|
- run: npx githublogen
|
|
30
30
|
env:
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"editor.codeActionsOnSave": {
|
|
3
|
-
"source.fixAll.
|
|
4
|
-
"source.organizeImports": "never"
|
|
3
|
+
"source.fixAll.oxc": "explicit"
|
|
5
4
|
},
|
|
6
|
-
"editor.
|
|
7
|
-
"
|
|
8
|
-
"prettier.enable": false
|
|
5
|
+
"editor.defaultFormatter": "oxc.oxc-vscode",
|
|
6
|
+
"editor.formatOnSave": true
|
|
9
7
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
|
3
|
+
"categories": {
|
|
4
|
+
"correctness": "error",
|
|
5
|
+
"suspicious": "error"
|
|
6
|
+
},
|
|
7
|
+
"plugins": ["eslint", "typescript", "unicorn", "oxc", "import", "vue"],
|
|
8
|
+
"rules": {
|
|
9
|
+
"unicorn/consistent-function-scoping": "off",
|
|
10
|
+
"unicorn/no-array-reverse": "off",
|
|
11
|
+
"unicorn/no-array-sort": "off",
|
|
12
|
+
"unicorn/no-empty-file": "off",
|
|
13
|
+
"import/no-unassigned-import": "off",
|
|
14
|
+
"unicorn/require-module-specifiers": "off",
|
|
15
|
+
"vue/prefer-import-from-vue": "off"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "template-vue-tsdown",
|
|
3
|
-
"type": "module",
|
|
4
3
|
"version": "0.0.0",
|
|
5
4
|
"private": true,
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
5
|
+
"files": [
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
8
|
+
"type": "module",
|
|
9
|
+
"main": "./dist/index.js",
|
|
10
|
+
"module": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
11
12
|
"exports": {
|
|
12
13
|
".": {
|
|
13
14
|
"types": "./dist/index.d.ts",
|
|
@@ -15,51 +16,50 @@
|
|
|
15
16
|
"require": "./dist/index.js"
|
|
16
17
|
}
|
|
17
18
|
},
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"files": ["dist"],
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"registry": "https://registry.npmjs.org/"
|
|
21
|
+
},
|
|
22
22
|
"scripts": {
|
|
23
23
|
"build": "tsdown",
|
|
24
24
|
"cleanup": "soy cleanup",
|
|
25
25
|
"commit": "soy git-commit",
|
|
26
26
|
"dev": "tsdown --watch",
|
|
27
|
-
"lint": "
|
|
27
|
+
"lint": "oxlint --fix",
|
|
28
|
+
"fmt": "oxfmt",
|
|
28
29
|
"play": "vite",
|
|
29
30
|
"prepare": "simple-git-hooks",
|
|
30
31
|
"publish-pkg": "pnpm publish --access public",
|
|
31
32
|
"release": "soy release",
|
|
32
33
|
"test": "vitest",
|
|
33
34
|
"typecheck": "tsc --noEmit --skipLibCheck",
|
|
34
|
-
"
|
|
35
|
+
"upkg": "soy update-pkg"
|
|
35
36
|
},
|
|
36
37
|
"dependencies": {},
|
|
37
38
|
"devDependencies": {
|
|
38
|
-
"@soybeanjs/cli": "1.
|
|
39
|
-
"@
|
|
40
|
-
"@types/node": "25.0.3",
|
|
39
|
+
"@soybeanjs/cli": "1.5.0-beta.1",
|
|
40
|
+
"@types/node": "25.2.0",
|
|
41
41
|
"@vue/test-utils": "2.4.6",
|
|
42
|
-
"
|
|
43
|
-
"eslint-plugin-vue": "10.6.2",
|
|
44
|
-
"happy-dom": "20.0.11",
|
|
42
|
+
"happy-dom": "20.5.0",
|
|
45
43
|
"lint-staged": "16.2.7",
|
|
44
|
+
"oxfmt": "^0.28.0",
|
|
45
|
+
"oxlint": "^1.43.0",
|
|
46
46
|
"simple-git-hooks": "2.13.1",
|
|
47
|
-
"tsdown": "0.
|
|
47
|
+
"tsdown": "0.20.3",
|
|
48
48
|
"tsx": "4.21.0",
|
|
49
49
|
"typescript": "5.9.3",
|
|
50
|
-
"unplugin-vue": "7.1.
|
|
50
|
+
"unplugin-vue": "7.1.1",
|
|
51
51
|
"unplugin-vue-jsx": "0.8.1",
|
|
52
|
-
"vite": "7.3.
|
|
53
|
-
"vitest": "4.0.
|
|
54
|
-
"vue": "3.5.
|
|
55
|
-
"vue-
|
|
56
|
-
"vue-tsc": "3.2.1"
|
|
52
|
+
"vite": "7.3.1",
|
|
53
|
+
"vitest": "4.0.18",
|
|
54
|
+
"vue": "3.5.27",
|
|
55
|
+
"vue-tsc": "3.2.4"
|
|
57
56
|
},
|
|
58
57
|
"simple-git-hooks": {
|
|
59
58
|
"commit-msg": "pnpm soy git-commit-verify",
|
|
60
59
|
"pre-commit": "pnpm typecheck && pnpm lint-staged"
|
|
61
60
|
},
|
|
62
61
|
"lint-staged": {
|
|
63
|
-
"*": "
|
|
64
|
-
}
|
|
62
|
+
"*": "oxlint --fix && oxfmt"
|
|
63
|
+
},
|
|
64
|
+
"packageManager": "pnpm@10.28.2"
|
|
65
65
|
}
|
|
@@ -4,9 +4,8 @@
|
|
|
4
4
|
"jsx": "preserve",
|
|
5
5
|
"jsxImportSource": "vue",
|
|
6
6
|
"lib": ["DOM", "ESNext"],
|
|
7
|
-
"baseUrl": ".",
|
|
8
7
|
"module": "ESNext",
|
|
9
|
-
"moduleResolution": "
|
|
8
|
+
"moduleResolution": "Bundler",
|
|
10
9
|
"paths": {
|
|
11
10
|
"@/*": ["./src/*"]
|
|
12
11
|
},
|
|
@@ -14,16 +13,13 @@
|
|
|
14
13
|
"types": ["node"],
|
|
15
14
|
"strict": true,
|
|
16
15
|
"strictNullChecks": true,
|
|
16
|
+
"noImplicitThis": true,
|
|
17
|
+
"noUncheckedIndexedAccess": false,
|
|
17
18
|
"noUnusedLocals": true,
|
|
18
|
-
"declaration": true,
|
|
19
|
-
"emitDeclarationOnly": true,
|
|
20
|
-
"outDir": "./dist",
|
|
21
19
|
"allowSyntheticDefaultImports": true,
|
|
22
20
|
"esModuleInterop": true,
|
|
23
21
|
"forceConsistentCasingInFileNames": true,
|
|
24
|
-
"isolatedModules": true
|
|
25
|
-
"verbatimModuleSyntax": true,
|
|
26
|
-
"skipLibCheck": true
|
|
22
|
+
"isolatedModules": true
|
|
27
23
|
},
|
|
28
24
|
"include": ["src/**/*"],
|
|
29
25
|
"exclude": ["node_modules", "dist"]
|
|
@@ -5,13 +5,12 @@ import unpluginVueJsx from 'unplugin-vue-jsx/rolldown';
|
|
|
5
5
|
export default defineConfig({
|
|
6
6
|
entry: ['src/index.ts'],
|
|
7
7
|
platform: 'neutral',
|
|
8
|
-
|
|
8
|
+
external: ['vue'],
|
|
9
|
+
clean: true,
|
|
9
10
|
dts: {
|
|
10
11
|
vue: true
|
|
11
12
|
},
|
|
12
|
-
|
|
13
|
-
external: ['vue'],
|
|
13
|
+
plugins: [unpluginVue({ isProduction: true }), unpluginVueJsx()],
|
|
14
14
|
sourcemap: false,
|
|
15
|
-
minify: false
|
|
16
|
-
fixedExtension: false
|
|
15
|
+
minify: false
|
|
17
16
|
});
|
|
@@ -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?
|
|
File without changes
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "template-pnpm-monorepo",
|
|
3
|
-
"type": "module",
|
|
4
|
-
"version": "0.0.0",
|
|
5
|
-
"private": true,
|
|
6
|
-
"packageManager": "pnpm@10.26.2",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"cleanup": "soy cleanup",
|
|
9
|
-
"commit": "soy git-commit",
|
|
10
|
-
"lint": "eslint . --fix",
|
|
11
|
-
"prepare": "simple-git-hooks",
|
|
12
|
-
"release": "soy release",
|
|
13
|
-
"typecheck": "tsc --noEmit --skipLibCheck",
|
|
14
|
-
"update-pkg": "soy ncu"
|
|
15
|
-
},
|
|
16
|
-
"dependencies": {},
|
|
17
|
-
"devDependencies": {
|
|
18
|
-
"@soybeanjs/cli": "1.4.4",
|
|
19
|
-
"@soybeanjs/eslint-config": "1.7.5",
|
|
20
|
-
"eslint": "9.39.2",
|
|
21
|
-
"lint-staged": "16.2.7",
|
|
22
|
-
"simple-git-hooks": "2.13.1",
|
|
23
|
-
"tsx": "4.21.0",
|
|
24
|
-
"typescript": "5.9.3"
|
|
25
|
-
},
|
|
26
|
-
"simple-git-hooks": {
|
|
27
|
-
"commit-msg": "pnpm soy git-commit-verify",
|
|
28
|
-
"pre-commit": "pnpm typecheck && pnpm lint-staged"
|
|
29
|
-
},
|
|
30
|
-
"lint-staged": {
|
|
31
|
-
"*": "eslint --fix"
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "demo-pkg",
|
|
3
|
-
"type": "module",
|
|
4
|
-
"version": "1.4.4",
|
|
5
|
-
"private": true,
|
|
6
|
-
"packageManager": "pnpm@10.26.2",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"typecheck": "tsc --noEmit --skipLibCheck"
|
|
9
|
-
},
|
|
10
|
-
"dependencies": {},
|
|
11
|
-
"devDependencies": {
|
|
12
|
-
"typescript": "5.9.3"
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ESNext",
|
|
4
|
-
"jsx": "preserve",
|
|
5
|
-
"jsxImportSource": "vue",
|
|
6
|
-
"lib": ["DOM", "ESNext"],
|
|
7
|
-
"baseUrl": ".",
|
|
8
|
-
"module": "ESNext",
|
|
9
|
-
"moduleResolution": "bundler",
|
|
10
|
-
"paths": {
|
|
11
|
-
"@/*": ["./src/*"]
|
|
12
|
-
},
|
|
13
|
-
"resolveJsonModule": true,
|
|
14
|
-
"types": ["node"],
|
|
15
|
-
"strict": true,
|
|
16
|
-
"strictNullChecks": true,
|
|
17
|
-
"noUnusedLocals": true,
|
|
18
|
-
"declaration": true,
|
|
19
|
-
"emitDeclarationOnly": true,
|
|
20
|
-
"outDir": "./dist",
|
|
21
|
-
"allowSyntheticDefaultImports": true,
|
|
22
|
-
"esModuleInterop": true,
|
|
23
|
-
"forceConsistentCasingInFileNames": true,
|
|
24
|
-
"isolatedModules": true,
|
|
25
|
-
"verbatimModuleSyntax": true,
|
|
26
|
-
"skipLibCheck": true
|
|
27
|
-
},
|
|
28
|
-
"include": ["src/**/*"],
|
|
29
|
-
"exclude": ["node_modules", "dist"]
|
|
30
|
-
}
|
|
File without changes
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from '@soybeanjs/eslint-config';
|
|
2
|
-
|
|
3
|
-
export default defineConfig(
|
|
4
|
-
{ vue: true, unocss: true },
|
|
5
|
-
{
|
|
6
|
-
rules: {
|
|
7
|
-
'vue/multi-word-component-names': [
|
|
8
|
-
'warn',
|
|
9
|
-
{
|
|
10
|
-
ignores: ['index', 'App']
|
|
11
|
-
}
|
|
12
|
-
],
|
|
13
|
-
'vue/component-name-in-template-casing': [
|
|
14
|
-
'warn',
|
|
15
|
-
'PascalCase',
|
|
16
|
-
{
|
|
17
|
-
registeredComponentsOnly: false,
|
|
18
|
-
ignores: ['/^icon-/']
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
'unocss/order-attributify': 'off'
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
);
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { PiniaPluginContext } from 'pinia';
|
|
2
|
-
import { klona } from 'klona/json';
|
|
3
|
-
import { storeIdRecord } from '../id';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* The plugin reset the state of the store which is written by setup syntax
|
|
7
|
-
*
|
|
8
|
-
* @param context
|
|
9
|
-
*/
|
|
10
|
-
export function resetSetupStore(context: PiniaPluginContext) {
|
|
11
|
-
const setupSyntaxIds = Object.values(storeIdRecord);
|
|
12
|
-
|
|
13
|
-
if (setupSyntaxIds.includes(context.store.$id)) {
|
|
14
|
-
const { $state } = context.store;
|
|
15
|
-
|
|
16
|
-
const defaultStore = klona($state);
|
|
17
|
-
|
|
18
|
-
context.store.$reset = () => {
|
|
19
|
-
context.store.$patch(defaultStore);
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
}
|
|
File without changes
|