create-soybean 0.6.3 → 0.6.5
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.mjs +182 -0
- package/package.json +13 -3
- package/template-react/_eslintrc +3 -0
- package/template-react/_gitignore +33 -0
- package/template-react/_npmrc +2 -0
- package/template-react/package.json +5 -0
- package/template-react-native/_eslintrc +3 -0
- package/template-react-native/_gitignore +33 -0
- package/template-react-native/_npmrc +2 -0
- package/template-react-native/package.json +5 -0
- package/template-solid/_eslintrc +3 -0
- package/template-solid/_gitignore +33 -0
- package/template-solid/_npmrc +2 -0
- package/template-solid/package.json +5 -0
- package/template-ts-lib/.vscode/extensions.json +17 -0
- package/template-ts-lib/.vscode/launch.json +13 -0
- package/template-ts-lib/.vscode/settings.json +23 -0
- package/template-ts-lib/_eslintrc +3 -0
- package/template-ts-lib/_gitignore +33 -0
- package/template-ts-lib/_npmrc +2 -0
- package/template-ts-lib/build.config.ts +11 -0
- package/template-ts-lib/package.json +28 -0
- package/template-ts-lib/src/index.ts +3 -0
- package/template-ts-lib/tsconfig.json +23 -0
- package/template-vue/.vscode/extensions.json +17 -0
- package/template-vue/.vscode/launch.json +13 -0
- package/template-vue/.vscode/settings.json +23 -0
- package/template-vue/README.md +40 -0
- package/template-vue/_eslintrc +11 -0
- package/template-vue/_gitignore +33 -0
- package/template-vue/_npmrc +2 -0
- package/template-vue/index.html +13 -0
- package/template-vue/package.json +30 -0
- package/template-vue/public/favicon.ico +0 -0
- package/template-vue/src/App.vue +82 -0
- package/template-vue/src/assets/base.css +73 -0
- package/template-vue/src/assets/logo.svg +1 -0
- package/template-vue/src/assets/main.css +35 -0
- package/template-vue/src/components/HelloWorld.vue +43 -0
- package/template-vue/src/components/TheWelcome.vue +93 -0
- package/template-vue/src/components/WelcomeItem.vue +87 -0
- package/template-vue/src/components/icons/IconCommunity.vue +7 -0
- package/template-vue/src/components/icons/IconDocumentation.vue +7 -0
- package/template-vue/src/components/icons/IconEcosystem.vue +7 -0
- package/template-vue/src/components/icons/IconSupport.vue +7 -0
- package/template-vue/src/components/icons/IconTooling.vue +19 -0
- package/template-vue/src/main.ts +14 -0
- package/template-vue/src/router/index.ts +23 -0
- package/template-vue/src/stores/counter.ts +12 -0
- package/template-vue/src/views/AboutView.vue +15 -0
- package/template-vue/src/views/HomeView.vue +9 -0
- package/template-vue/tsconfig.json +24 -0
- package/template-vue/vite.config.ts +13 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import { green, blue, cyan, lightBlue, reset, red } from 'kolorist';
|
|
6
|
+
import minimist from 'minimist';
|
|
7
|
+
import prompts from 'prompts';
|
|
8
|
+
import { consola } from 'consola';
|
|
9
|
+
|
|
10
|
+
function formatTargetDir(targetDir) {
|
|
11
|
+
return targetDir?.trim()?.replace(/\/+$/g, "");
|
|
12
|
+
}
|
|
13
|
+
function isPathEmpty($path) {
|
|
14
|
+
const files = fs.readdirSync($path);
|
|
15
|
+
return files.length === 0 || files.length === 1 && files[0] === ".git";
|
|
16
|
+
}
|
|
17
|
+
function isValidPackageName(projectName) {
|
|
18
|
+
return /^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(projectName);
|
|
19
|
+
}
|
|
20
|
+
function toValidPackageName(projectName) {
|
|
21
|
+
return projectName.trim().toLowerCase().replace(/\s+/g, "-").replace(/^[._]/, "").replace(/[^a-z\d\-~]+/g, "-");
|
|
22
|
+
}
|
|
23
|
+
function emptyDir(dir) {
|
|
24
|
+
const isExist = fs.existsSync(dir);
|
|
25
|
+
if (!isExist) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const files = fs.readdirSync(dir);
|
|
29
|
+
for (const file of files) {
|
|
30
|
+
if (file !== ".git") {
|
|
31
|
+
const filePath = path.resolve(dir, file);
|
|
32
|
+
fs.rmSync(filePath, { recursive: true, force: true });
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function copyDir(srcDir, destDir) {
|
|
37
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
38
|
+
const files = fs.readdirSync(srcDir);
|
|
39
|
+
for (const file of files) {
|
|
40
|
+
const srcFile = path.resolve(srcDir, file);
|
|
41
|
+
const destFile = path.resolve(destDir, file);
|
|
42
|
+
copy(srcFile, destFile);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function copy(src, dest) {
|
|
46
|
+
const stat = fs.statSync(src);
|
|
47
|
+
if (stat.isDirectory()) {
|
|
48
|
+
copyDir(src, dest);
|
|
49
|
+
} else {
|
|
50
|
+
fs.copyFileSync(src, dest);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const templates = [
|
|
55
|
+
{
|
|
56
|
+
type: "vue",
|
|
57
|
+
name: "Vue 3",
|
|
58
|
+
color: green
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
type: "ts-lib",
|
|
62
|
+
name: "TypeScript library",
|
|
63
|
+
color: blue
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
type: "react",
|
|
67
|
+
name: "React",
|
|
68
|
+
color: cyan
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
type: "react-native",
|
|
72
|
+
name: "React Native",
|
|
73
|
+
color: cyan
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
type: "solid",
|
|
77
|
+
name: "Solid",
|
|
78
|
+
color: lightBlue
|
|
79
|
+
}
|
|
80
|
+
];
|
|
81
|
+
const TEMPLATES = templates.map((t) => t.type);
|
|
82
|
+
const renameFiles = {
|
|
83
|
+
_gitignore: ".gitignore",
|
|
84
|
+
_eslintrc: ".eslintrc",
|
|
85
|
+
_npmrc: ".npmrc"
|
|
86
|
+
};
|
|
87
|
+
const defaultTargetDir = "create-soybean-project";
|
|
88
|
+
async function setupCli() {
|
|
89
|
+
const cwd = process.cwd();
|
|
90
|
+
const argv = minimist(process.argv.slice(2), { string: ["_"] });
|
|
91
|
+
const argTargetDir = formatTargetDir(argv._[0]);
|
|
92
|
+
const argTemplate = argv.template || argv.t;
|
|
93
|
+
let targetDir = argTargetDir || defaultTargetDir;
|
|
94
|
+
function getProjectName() {
|
|
95
|
+
return targetDir === "." ? path.basename(path.resolve()) : targetDir;
|
|
96
|
+
}
|
|
97
|
+
let result = null;
|
|
98
|
+
try {
|
|
99
|
+
result = await prompts([
|
|
100
|
+
{
|
|
101
|
+
type: argTargetDir ? null : "text",
|
|
102
|
+
name: "projectName",
|
|
103
|
+
message: reset("Project name:"),
|
|
104
|
+
initial: defaultTargetDir,
|
|
105
|
+
onState: (state) => {
|
|
106
|
+
targetDir = formatTargetDir(state.value) || defaultTargetDir;
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
type: () => !fs.existsSync(targetDir) || isPathEmpty(targetDir) ? null : "confirm",
|
|
111
|
+
name: "overwrite",
|
|
112
|
+
message: () => `${targetDir === "." ? "Current directory" : `Target directory "${targetDir}"`} is not empty. Remove existing files and continue?`
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
type: (_, { overwrite: overwrite2 }) => {
|
|
116
|
+
if (overwrite2 === false) {
|
|
117
|
+
throw new Error(`${red("\u2716")} Operation cancelled`);
|
|
118
|
+
}
|
|
119
|
+
return null;
|
|
120
|
+
},
|
|
121
|
+
name: "overwriteChecker"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
type: () => isValidPackageName(getProjectName()) ? null : "text",
|
|
125
|
+
name: "packageName",
|
|
126
|
+
message: reset("Package name:"),
|
|
127
|
+
initial: () => toValidPackageName(getProjectName()),
|
|
128
|
+
validate: (dir) => isValidPackageName(dir) || "Invalid package.json name"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
type: argTemplate && TEMPLATES.includes(argTemplate) ? null : "select",
|
|
132
|
+
name: "template",
|
|
133
|
+
message: typeof argTemplate === "string" && !TEMPLATES.includes(argTemplate) ? reset(`"${argTemplate}" isn't a valid template. Please choose from below: `) : reset("Select a template:"),
|
|
134
|
+
initial: 0,
|
|
135
|
+
choices: templates.map(({ type, name, color }) => ({
|
|
136
|
+
title: color(name),
|
|
137
|
+
value: type
|
|
138
|
+
}))
|
|
139
|
+
}
|
|
140
|
+
]);
|
|
141
|
+
} catch (error) {
|
|
142
|
+
consola.error(error);
|
|
143
|
+
}
|
|
144
|
+
if (!result) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
const { template, overwrite, packageName } = result;
|
|
148
|
+
const root = path.join(cwd, targetDir);
|
|
149
|
+
if (overwrite) {
|
|
150
|
+
emptyDir(root);
|
|
151
|
+
} else if (!fs.existsSync(root)) {
|
|
152
|
+
fs.mkdirSync(root, { recursive: true });
|
|
153
|
+
}
|
|
154
|
+
const $template = template || argTemplate;
|
|
155
|
+
consola.info(`
|
|
156
|
+
Scaffolding project in ${root}...`);
|
|
157
|
+
const templateDir = path.resolve(fileURLToPath(import.meta.url), "../..", `template-${$template}`);
|
|
158
|
+
const write = (file, content) => {
|
|
159
|
+
const targetPath = path.join(root, renameFiles[file] ?? file);
|
|
160
|
+
if (content) {
|
|
161
|
+
fs.writeFileSync(targetPath, content);
|
|
162
|
+
} else {
|
|
163
|
+
copy(path.join(templateDir, file), targetPath);
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
const files = fs.readdirSync(templateDir);
|
|
167
|
+
for (const file of files.filter((f) => f !== "package.json")) {
|
|
168
|
+
write(file);
|
|
169
|
+
}
|
|
170
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(templateDir, `package.json`), "utf-8"));
|
|
171
|
+
pkg.name = packageName || getProjectName();
|
|
172
|
+
write("package.json", `${JSON.stringify(pkg, null, 2)}
|
|
173
|
+
`);
|
|
174
|
+
const cdProjectName = path.relative(cwd, root);
|
|
175
|
+
consola.info(`
|
|
176
|
+
Done. Now run:
|
|
177
|
+
`);
|
|
178
|
+
if (root !== cwd) {
|
|
179
|
+
consola.info(` cd ${cdProjectName.includes(" ") ? `"${cdProjectName}"` : cdProjectName}`);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
setupCli();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-soybean",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5",
|
|
4
4
|
"description": "SoybeanJS's command line to create different project templates",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Soybean",
|
|
@@ -12,12 +12,22 @@
|
|
|
12
12
|
"registry": "https://registry.npmjs.org/"
|
|
13
13
|
},
|
|
14
14
|
"bin": {
|
|
15
|
-
"create-soybean": "dist/index.mjs"
|
|
15
|
+
"create-soybean": "dist/index.mjs",
|
|
16
|
+
"create-soy": "dist/index.mjs"
|
|
16
17
|
},
|
|
17
18
|
"files": [
|
|
18
|
-
"dist"
|
|
19
|
+
"dist",
|
|
20
|
+
"template-*"
|
|
19
21
|
],
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"consola": "^3.2.3",
|
|
24
|
+
"kolorist": "1.8.0",
|
|
25
|
+
"minimist": "1.2.8",
|
|
26
|
+
"prompts": "^2.4.2"
|
|
27
|
+
},
|
|
20
28
|
"devDependencies": {
|
|
29
|
+
"@types/minimist": "^1.2.2",
|
|
30
|
+
"@types/prompts": "^2.4.4",
|
|
21
31
|
"typescript": "5.1.6",
|
|
22
32
|
"unbuild": "1.2.1"
|
|
23
33
|
},
|
|
@@ -0,0 +1,33 @@
|
|
|
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?
|
|
31
|
+
|
|
32
|
+
package-lock.json
|
|
33
|
+
yarn.lock
|
|
@@ -0,0 +1,33 @@
|
|
|
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?
|
|
31
|
+
|
|
32
|
+
package-lock.json
|
|
33
|
+
yarn.lock
|
|
@@ -0,0 +1,33 @@
|
|
|
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?
|
|
31
|
+
|
|
32
|
+
package-lock.json
|
|
33
|
+
yarn.lock
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"recommendations": [
|
|
3
|
+
"antfu.unocss",
|
|
4
|
+
"dbaeumer.vscode-eslint",
|
|
5
|
+
"editorconfig.editorconfig",
|
|
6
|
+
"esbenp.prettier-vscode",
|
|
7
|
+
"formulahendry.auto-complete-tag",
|
|
8
|
+
"formulahendry.auto-close-tag",
|
|
9
|
+
"formulahendry.auto-rename-tag",
|
|
10
|
+
"kisstkondoros.vscode-gutter-preview",
|
|
11
|
+
"mariusalchimavicius.json-to-ts",
|
|
12
|
+
"mhutchie.git-graph",
|
|
13
|
+
"sdras.vue-vscode-snippets",
|
|
14
|
+
"vue.volar",
|
|
15
|
+
"vue.vscode-typescript-vue-plugin"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cSpell.words": ["consola", "kolorist"],
|
|
3
|
+
"editor.codeActionsOnSave": {
|
|
4
|
+
"source.fixAll.eslint": true
|
|
5
|
+
},
|
|
6
|
+
"editor.fontLigatures": true,
|
|
7
|
+
"editor.formatOnSave": false,
|
|
8
|
+
"editor.quickSuggestions": {
|
|
9
|
+
"strings": true
|
|
10
|
+
},
|
|
11
|
+
"editor.tabSize": 2,
|
|
12
|
+
"eslint.validate": ["json"],
|
|
13
|
+
"files.associations": {
|
|
14
|
+
"*.env.*": "dotenv",
|
|
15
|
+
"*.svg": "html",
|
|
16
|
+
".*rc": "json"
|
|
17
|
+
},
|
|
18
|
+
"files.eol": "\n",
|
|
19
|
+
"[html][css][less][scss][sass][markdown][yaml][yml][jsonc]": {
|
|
20
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
21
|
+
"editor.formatOnSave": true
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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?
|
|
31
|
+
|
|
32
|
+
package-lock.json
|
|
33
|
+
yarn.lock
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ts-lib-starter",
|
|
3
|
+
"version": "0.6.5",
|
|
4
|
+
"exports": {
|
|
5
|
+
".": {
|
|
6
|
+
"import": "./dist/index.mjs",
|
|
7
|
+
"require": "./dist/index.cjs",
|
|
8
|
+
"types": "./dist/index.d.ts"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"main": "dist/index.cjs",
|
|
12
|
+
"module": "dist/index.mjs",
|
|
13
|
+
"types": "dist/index.d.ts",
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "pnpm typecheck && unbuild",
|
|
19
|
+
"typecheck": "tsc --noEmit"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/node": "20.4.5",
|
|
23
|
+
"eslint": "8.45.0",
|
|
24
|
+
"eslint-config-soybeanjs": "0.5.3",
|
|
25
|
+
"typescript": "5.1.6",
|
|
26
|
+
"unbuild": "1.2.1"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"baseUrl": ".",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"target": "ESNext",
|
|
6
|
+
"lib": ["DOM", "ESNext"],
|
|
7
|
+
"strict": true,
|
|
8
|
+
"esModuleInterop": true,
|
|
9
|
+
"allowSyntheticDefaultImports": true,
|
|
10
|
+
"jsx": "preserve",
|
|
11
|
+
"moduleResolution": "node",
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"noUnusedLocals": true,
|
|
14
|
+
"strictNullChecks": true,
|
|
15
|
+
"skipLibCheck": true,
|
|
16
|
+
"forceConsistentCasingInFileNames": true,
|
|
17
|
+
"types": ["node"],
|
|
18
|
+
"paths": {
|
|
19
|
+
"@/*": ["./src/*"]
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"exclude": ["node_modules", "dist"]
|
|
23
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"recommendations": [
|
|
3
|
+
"antfu.unocss",
|
|
4
|
+
"dbaeumer.vscode-eslint",
|
|
5
|
+
"editorconfig.editorconfig",
|
|
6
|
+
"esbenp.prettier-vscode",
|
|
7
|
+
"formulahendry.auto-complete-tag",
|
|
8
|
+
"formulahendry.auto-close-tag",
|
|
9
|
+
"formulahendry.auto-rename-tag",
|
|
10
|
+
"kisstkondoros.vscode-gutter-preview",
|
|
11
|
+
"mariusalchimavicius.json-to-ts",
|
|
12
|
+
"mhutchie.git-graph",
|
|
13
|
+
"sdras.vue-vscode-snippets",
|
|
14
|
+
"vue.volar",
|
|
15
|
+
"vue.vscode-typescript-vue-plugin"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cSpell.words": ["consola", "kolorist"],
|
|
3
|
+
"editor.codeActionsOnSave": {
|
|
4
|
+
"source.fixAll.eslint": true
|
|
5
|
+
},
|
|
6
|
+
"editor.fontLigatures": true,
|
|
7
|
+
"editor.formatOnSave": false,
|
|
8
|
+
"editor.quickSuggestions": {
|
|
9
|
+
"strings": true
|
|
10
|
+
},
|
|
11
|
+
"editor.tabSize": 2,
|
|
12
|
+
"eslint.validate": ["json"],
|
|
13
|
+
"files.associations": {
|
|
14
|
+
"*.env.*": "dotenv",
|
|
15
|
+
"*.svg": "html",
|
|
16
|
+
".*rc": "json"
|
|
17
|
+
},
|
|
18
|
+
"files.eol": "\n",
|
|
19
|
+
"[html][css][less][scss][sass][markdown][yaml][yml][jsonc]": {
|
|
20
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
21
|
+
"editor.formatOnSave": true
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# template-vue
|
|
2
|
+
|
|
3
|
+
This template should help get you started developing with Vue 3 in Vite.
|
|
4
|
+
|
|
5
|
+
## Recommended IDE Setup
|
|
6
|
+
|
|
7
|
+
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
|
|
8
|
+
|
|
9
|
+
## Type Support for `.vue` Imports in TS
|
|
10
|
+
|
|
11
|
+
TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.
|
|
12
|
+
|
|
13
|
+
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:
|
|
14
|
+
|
|
15
|
+
1. Disable the built-in TypeScript Extension
|
|
16
|
+
1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette
|
|
17
|
+
2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
|
|
18
|
+
2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
|
|
19
|
+
|
|
20
|
+
## Customize configuration
|
|
21
|
+
|
|
22
|
+
See [Vite Configuration Reference](https://vitejs.dev/config/).
|
|
23
|
+
|
|
24
|
+
## Project Setup
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
pnpm install
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Compile and Hot-Reload for Development
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
pnpm dev
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Type-Check, Compile and Minify for Production
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
pnpm build
|
|
40
|
+
```
|
|
@@ -0,0 +1,33 @@
|
|
|
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?
|
|
31
|
+
|
|
32
|
+
package-lock.json
|
|
33
|
+
yarn.lock
|