@citruslime/create-boilerplate 1.0.0 → 1.0.1-beta.0
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/hooks/post-checkout +1 -1
- package/hooks/post-merge +1 -1
- package/hooks/pre-commit +1 -1
- package/main.mjs +82 -52
- package/package.json +7 -6
- package/template/.vscode/extensions.json +2 -1
- package/template/.vscode/settings.json +16 -12
- package/template/.vscode/template.code-workspace +19 -14
- package/template/_eslintignore +4 -1
- package/template/_eslintrc.cjs +6 -0
- package/template/_gitignore +17 -1
- package/template/_lintstagedrc.json +1 -1
- package/template/_stylelintrc.cjs +3 -0
- package/template/env.d.ts +2 -0
- package/template/index.html +1 -1
- package/template/package.json +3 -2
- package/template/{postcss.config.js → postcss.config.cjs} +0 -0
- package/template/public/favicon.ico +0 -0
- package/template/src/app.vue +0 -2
- package/template/src/main.ts +0 -3
- package/template/src/{views → pages}/dasboard/index.vue +0 -4
- package/template/src/state/{authentication/index.ts → authentication.ts} +0 -2
- package/template/tailwind.config.cjs +7 -0
- package/template/tsconfig.app.json +28 -0
- package/template/tsconfig.config.json +14 -0
- package/template/tsconfig.json +10 -25
- package/template/tsconfig.vitest.json +12 -0
- package/template/vite.config.ts +36 -26
- package/template/_eslintrc.js +0 -3
- package/template/_stylelintrc.js +0 -3
- package/template/src/env.d.ts +0 -9
- package/template/src/state/index.ts +0 -1
- package/template/tailwind.config.js +0 -7
package/hooks/post-checkout
CHANGED
package/hooks/post-merge
CHANGED
package/hooks/pre-commit
CHANGED
package/main.mjs
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { execSync } from 'child_process';
|
|
4
|
-
import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync } from 'fs';
|
|
5
|
-
import {
|
|
6
|
-
import { fileURLToPath } from 'url';
|
|
3
|
+
import { execSync } from 'node:child_process';
|
|
4
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync } from 'node:fs';
|
|
5
|
+
import { join, relative } from 'node:path';
|
|
6
|
+
import { fileURLToPath, URL } from 'node:url';
|
|
7
7
|
|
|
8
|
-
import { lightBlue,
|
|
8
|
+
import { green, lightBlue, lightYellow, red } from 'kolorist';
|
|
9
9
|
import parseArgs from 'minimist';
|
|
10
10
|
import prompts from 'prompts';
|
|
11
11
|
|
|
12
12
|
const argv = parseArgs(process.argv.slice(2));
|
|
13
13
|
const cwd = process.cwd();
|
|
14
|
-
const codeDir = fileURLToPath(
|
|
14
|
+
const codeDir = fileURLToPath(new URL('./', import.meta.url));
|
|
15
15
|
|
|
16
16
|
const placeholdersToReplace = {
|
|
17
17
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
18
18
|
'[[PACKAGE_NAME]]': '',
|
|
19
|
-
'[[
|
|
19
|
+
'[[PACKAGE_DIR]]': '',
|
|
20
|
+
'[[ROOT_DIR]]': '',
|
|
20
21
|
'[[HUSKY_DIR]]': '',
|
|
21
|
-
'[[
|
|
22
|
-
'[[FRONTEND_PORT]]': 0
|
|
23
|
-
'\n // eslint-disable-next-line array-bracket-spacing': ''
|
|
22
|
+
'\'[[PROXY]]\'': '{}',
|
|
23
|
+
'\'[[FRONTEND_PORT]]\'': 0
|
|
24
24
|
/* eslint-enable @typescript-eslint/naming-convention */
|
|
25
25
|
};
|
|
26
26
|
|
|
@@ -29,10 +29,10 @@ const filesToRename = {
|
|
|
29
29
|
_gitignore: '.gitignore',
|
|
30
30
|
_editorconfig: '.editorconfig',
|
|
31
31
|
_eslintignore: '.eslintignore',
|
|
32
|
-
'_eslintrc.
|
|
32
|
+
'_eslintrc.cjs': '.eslintrc.cjs',
|
|
33
33
|
'_lintstagedrc.json': '.lintstagedrc.json',
|
|
34
34
|
_stylelintignore: '.stylelintignore',
|
|
35
|
-
'_stylelintrc.
|
|
35
|
+
'_stylelintrc.cjs': '.stylelintrc.cjs',
|
|
36
36
|
'template.code-workspace': 'citrus-lime.code-workspace'
|
|
37
37
|
/* eslint-enable @typescript-eslint/naming-convention */
|
|
38
38
|
};
|
|
@@ -70,6 +70,10 @@ const dependenciesToInstall = [
|
|
|
70
70
|
name: '@citruslime/theme',
|
|
71
71
|
dev: true
|
|
72
72
|
},
|
|
73
|
+
{
|
|
74
|
+
name: '@iconify/vue',
|
|
75
|
+
dev: true
|
|
76
|
+
},
|
|
73
77
|
{
|
|
74
78
|
name: '@types/node',
|
|
75
79
|
dev: true
|
|
@@ -79,7 +83,7 @@ const dependenciesToInstall = [
|
|
|
79
83
|
dev: true
|
|
80
84
|
},
|
|
81
85
|
{
|
|
82
|
-
name: '@
|
|
86
|
+
name: '@vue/tsconfig',
|
|
83
87
|
dev: true
|
|
84
88
|
},
|
|
85
89
|
{
|
|
@@ -98,6 +102,10 @@ const dependenciesToInstall = [
|
|
|
98
102
|
name: 'typescript',
|
|
99
103
|
dev: true
|
|
100
104
|
},
|
|
105
|
+
{
|
|
106
|
+
name: 'unplugin-auto-import',
|
|
107
|
+
dev: true
|
|
108
|
+
},
|
|
101
109
|
{
|
|
102
110
|
name: 'unplugin-vue-components',
|
|
103
111
|
dev: true
|
|
@@ -125,25 +133,27 @@ const dependenciesToInstall = [
|
|
|
125
133
|
*/
|
|
126
134
|
async function init () {
|
|
127
135
|
let packageDir = argv._[0];
|
|
136
|
+
const rootDir = execSync('git rev-parse --show-toplevel')
|
|
137
|
+
.toString()
|
|
138
|
+
.trim();
|
|
128
139
|
|
|
129
140
|
const {
|
|
130
141
|
packageName,
|
|
131
142
|
empty,
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
frontendPort,
|
|
135
|
-
backendPort
|
|
143
|
+
backendPort,
|
|
144
|
+
packageManager
|
|
136
145
|
} = await prompts([
|
|
137
146
|
{
|
|
138
147
|
type: 'text',
|
|
139
148
|
name: 'packageName',
|
|
140
|
-
message: 'Enter a
|
|
141
|
-
validate: (value) => /^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(value)
|
|
149
|
+
message: 'Enter a name for the project:',
|
|
150
|
+
validate: (value) => /^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(value) || 'Invalid package name'
|
|
142
151
|
},
|
|
143
152
|
{
|
|
144
153
|
type: packageDir ? null : 'text',
|
|
145
154
|
name: 'packageDir',
|
|
146
|
-
message: 'Enter a directory for the
|
|
155
|
+
message: 'Enter a directory for the project:',
|
|
156
|
+
initial: '.',
|
|
147
157
|
onState: (state) => packageDir = state.value
|
|
148
158
|
},
|
|
149
159
|
{
|
|
@@ -161,6 +171,18 @@ async function init () {
|
|
|
161
171
|
},
|
|
162
172
|
name: 'emptyConfirmation'
|
|
163
173
|
},
|
|
174
|
+
{
|
|
175
|
+
type: 'confirm',
|
|
176
|
+
name: 'hasApi',
|
|
177
|
+
message: 'Setup backend proxy?',
|
|
178
|
+
initial: true
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
type: (prev) => prev ? 'text' : null,
|
|
182
|
+
name: 'backendPort',
|
|
183
|
+
message: 'Enter the port that the backend server runs on:',
|
|
184
|
+
initial: 0
|
|
185
|
+
},
|
|
164
186
|
{
|
|
165
187
|
type: 'select',
|
|
166
188
|
name: 'packageManager',
|
|
@@ -170,28 +192,16 @@ async function init () {
|
|
|
170
192
|
title: 'yarn',
|
|
171
193
|
value: 'yarn'
|
|
172
194
|
},
|
|
195
|
+
{
|
|
196
|
+
title: 'pnpm',
|
|
197
|
+
value: 'pnpm'
|
|
198
|
+
},
|
|
173
199
|
{
|
|
174
200
|
title: 'npm',
|
|
175
201
|
value: 'npm'
|
|
176
202
|
}
|
|
177
203
|
],
|
|
178
204
|
initial: 0
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
type: 'text',
|
|
182
|
-
name: 'rootDir',
|
|
183
|
-
message: 'Enter the relative path to the root of the repository:',
|
|
184
|
-
validate: (value) => value && value?.trim() !== ''
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
type: 'number',
|
|
188
|
-
name: 'frontendPort',
|
|
189
|
-
message: 'Enter the port for the dev server to run on:'
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
type: 'text',
|
|
193
|
-
name: 'backendPort',
|
|
194
|
-
message: 'Enter the port that the backend server runs on:'
|
|
195
205
|
}
|
|
196
206
|
], {
|
|
197
207
|
onCancel: () => cancel()
|
|
@@ -201,7 +211,7 @@ async function init () {
|
|
|
201
211
|
|
|
202
212
|
packageDir = packageDir.toString();
|
|
203
213
|
|
|
204
|
-
setReplacements(packageName,
|
|
214
|
+
setReplacements(packageName, packageDir, rootDir, backendPort ?? 0);
|
|
205
215
|
prepareDir(join(cwd, packageDir), empty);
|
|
206
216
|
copyTemplate(packageDir);
|
|
207
217
|
|
|
@@ -209,7 +219,7 @@ async function init () {
|
|
|
209
219
|
installDependencies(packageManager);
|
|
210
220
|
|
|
211
221
|
print(lightBlue('Creating hooks...'), true);
|
|
212
|
-
copyHooks(
|
|
222
|
+
copyHooks(rootDir);
|
|
213
223
|
|
|
214
224
|
print(green(`Package ${packageName} has been successfully initialised in ${packageDir}.`), true);
|
|
215
225
|
}
|
|
@@ -218,18 +228,31 @@ async function init () {
|
|
|
218
228
|
* Set the dynamic values for the file renaming and placeholder replacements.
|
|
219
229
|
*
|
|
220
230
|
* @param {string} packageName The name of the package being created.
|
|
231
|
+
* @param {string} packageDir The directory of the package being created.
|
|
221
232
|
* @param {string} rootDir The relative path of the root of the repository.
|
|
222
|
-
* @param {number} frontendPort The port that the frontend dev server will run on.
|
|
223
233
|
* @param {number} backendPort The port that the backend server runs on.
|
|
224
234
|
*/
|
|
225
|
-
function setReplacements (packageName,
|
|
226
|
-
|
|
235
|
+
function setReplacements (packageName, packageDir, rootDir, backendPort) {
|
|
236
|
+
const husky = relative(join(cwd, packageDir, '.vscode'), join(rootDir, '.husky'));
|
|
237
|
+
const repoRoot = relative(join(cwd, packageDir), rootDir);
|
|
238
|
+
const projDir = relative(rootDir, join(cwd, packageDir));
|
|
227
239
|
|
|
240
|
+
filesToRename['template.code-workspace'] = `${packageName}.code-workspace`;
|
|
228
241
|
placeholdersToReplace['[[PACKAGE_NAME]]'] = packageName;
|
|
229
|
-
placeholdersToReplace['[[
|
|
230
|
-
placeholdersToReplace['[[
|
|
231
|
-
placeholdersToReplace['[[
|
|
232
|
-
placeholdersToReplace['[[
|
|
242
|
+
placeholdersToReplace['[[PACKAGE_DIR]]'] = projDir;
|
|
243
|
+
placeholdersToReplace['[[ROOT_DIR]]'] = repoRoot.replaceAll('\\', '/');
|
|
244
|
+
placeholdersToReplace['[[HUSKY_DIR]]'] = husky.replaceAll('\\', '/');
|
|
245
|
+
placeholdersToReplace['\'[[FRONTEND_PORT]]\''] = Math.floor(Math.random() * 1001) + 4000;
|
|
246
|
+
|
|
247
|
+
if (backendPort !== 0) {
|
|
248
|
+
placeholdersToReplace['\'[[PROXY]]\''] = `{
|
|
249
|
+
'/api': {
|
|
250
|
+
target: 'https://localhost:${backendPort}',
|
|
251
|
+
secure: false,
|
|
252
|
+
rewrite: (path) => path.replace('/api', '')
|
|
253
|
+
}
|
|
254
|
+
}`;
|
|
255
|
+
}
|
|
233
256
|
}
|
|
234
257
|
|
|
235
258
|
/**
|
|
@@ -270,14 +293,18 @@ function copyTemplate (packageDir) {
|
|
|
270
293
|
/**
|
|
271
294
|
* Copies the hooks directory into the husky directory for the repository.
|
|
272
295
|
*
|
|
273
|
-
* @param {string} packageDir The directory of the new package.
|
|
274
296
|
* @param {string} rootDir The relative path from the package directory to the root of the repository.
|
|
275
297
|
*/
|
|
276
|
-
function copyHooks (
|
|
298
|
+
function copyHooks (rootDir) {
|
|
277
299
|
const hooksDir = join(codeDir, 'hooks');
|
|
278
|
-
const huskyDir = join(
|
|
300
|
+
const huskyDir = join(rootDir, '.husky');
|
|
279
301
|
|
|
280
|
-
|
|
302
|
+
if (existsSync(join(huskyDir, 'common.sh'))) {
|
|
303
|
+
print(lightYellow('Git Hooks already installed by another package in this repo. These will need to be edited manually.\n'), true);
|
|
304
|
+
}
|
|
305
|
+
else {
|
|
306
|
+
forEachInDir(hooksDir, (item) => copy(hooksDir, huskyDir, item));
|
|
307
|
+
}
|
|
281
308
|
}
|
|
282
309
|
|
|
283
310
|
/**
|
|
@@ -331,7 +358,7 @@ function copy (source, destination, item) {
|
|
|
331
358
|
* @param {string} packageManager The package manager to use.
|
|
332
359
|
*/
|
|
333
360
|
function installDependencies (packageManager) {
|
|
334
|
-
const prefix = `${packageManager} ${packageManager
|
|
361
|
+
const prefix = `${packageManager} ${packageManager !== 'npm' ? 'add' : 'install'}`;
|
|
335
362
|
|
|
336
363
|
print(lightBlue('Installing dev dependencies...'), true);
|
|
337
364
|
|
|
@@ -367,6 +394,8 @@ function forEachInDir (dir, callback) {
|
|
|
367
394
|
|
|
368
395
|
/**
|
|
369
396
|
* Throws an error to indicate that the current operation has been cancelled.
|
|
397
|
+
*
|
|
398
|
+
* @throws Operation cancelled error.
|
|
370
399
|
*/
|
|
371
400
|
function cancel () {
|
|
372
401
|
throw new Error('Operation was cancelled.');
|
|
@@ -376,11 +405,11 @@ function cancel () {
|
|
|
376
405
|
* Prints a message to the console.
|
|
377
406
|
*
|
|
378
407
|
* @param {string} message The message to display.
|
|
379
|
-
* @param {boolean} clearPrevious Whether to clear
|
|
408
|
+
* @param {boolean} clearPrevious Whether to clear any existing message.
|
|
380
409
|
*/
|
|
381
410
|
function print (message, clearPrevious = false) {
|
|
382
411
|
if (clearPrevious) {
|
|
383
|
-
process.stdout.clearLine();
|
|
412
|
+
process.stdout.clearLine(0);
|
|
384
413
|
process.stdout.cursorTo(0);
|
|
385
414
|
}
|
|
386
415
|
|
|
@@ -392,4 +421,5 @@ try {
|
|
|
392
421
|
}
|
|
393
422
|
catch (e) {
|
|
394
423
|
print(`\n${red(e.message)}`);
|
|
424
|
+
process.exit(1);
|
|
395
425
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@citruslime/create-boilerplate",
|
|
3
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "1.0.1-beta.0",
|
|
4
5
|
"author": {
|
|
5
6
|
"name": "Citrus-Lime Ltd",
|
|
6
7
|
"url": "https://citruslime.com"
|
|
@@ -15,19 +16,19 @@
|
|
|
15
16
|
"template",
|
|
16
17
|
"hooks"
|
|
17
18
|
],
|
|
19
|
+
"maintainers": [
|
|
20
|
+
"Citrus-Lime"
|
|
21
|
+
],
|
|
18
22
|
"main": "main.mjs",
|
|
19
23
|
"bin": {
|
|
20
24
|
"create-boilerplate": "main.mjs"
|
|
21
25
|
},
|
|
22
26
|
"engines": {
|
|
23
|
-
"node": ">=
|
|
27
|
+
"node": ">=16.0.0"
|
|
24
28
|
},
|
|
25
29
|
"dependencies": {
|
|
26
30
|
"kolorist": "^1.5.1",
|
|
27
|
-
"minimist": "^1.2.
|
|
31
|
+
"minimist": "^1.2.6",
|
|
28
32
|
"prompts": "^2.4.2"
|
|
29
|
-
},
|
|
30
|
-
"devDependencies": {
|
|
31
|
-
"@types/prompts": "^2.0.14"
|
|
32
33
|
}
|
|
33
34
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"recommendations": [
|
|
3
|
-
"
|
|
3
|
+
"Vue.volar",
|
|
4
4
|
"dbaeumer.vscode-eslint",
|
|
5
5
|
"stylelint.vscode-stylelint",
|
|
6
6
|
"bradlc.vscode-tailwindcss",
|
|
7
7
|
"eamodio.gitlens",
|
|
8
8
|
"christian-kohler.npm-intellisense",
|
|
9
|
+
"pmneo.tsimporter",
|
|
9
10
|
"editorconfig.editorconfig",
|
|
10
11
|
"cpylua.language-postcss",
|
|
11
12
|
"antfu.iconify"
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"[
|
|
3
|
-
"editor.
|
|
2
|
+
"[json]": {
|
|
3
|
+
"editor.defaultFormatter": "vscode.json-language-features"
|
|
4
|
+
},
|
|
5
|
+
"[jsonc]": {
|
|
6
|
+
"editor.defaultFormatter": "vscode.json-language-features"
|
|
4
7
|
},
|
|
5
|
-
"css.validate": false,
|
|
6
|
-
"diffEditor.ignoreTrimWhitespace": false,
|
|
7
8
|
"editor.codeActionsOnSave": {
|
|
8
9
|
"source.fixAll": true,
|
|
9
10
|
"source.fixAll.eslint": true,
|
|
@@ -11,10 +12,7 @@
|
|
|
11
12
|
"source.organizeImports": false
|
|
12
13
|
},
|
|
13
14
|
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
|
|
14
|
-
"editor.detectIndentation": false,
|
|
15
15
|
"editor.formatOnSave": true,
|
|
16
|
-
"editor.linkedEditing": true,
|
|
17
|
-
"eslint.alwaysShowStatus": true,
|
|
18
16
|
"eslint.validate": [
|
|
19
17
|
"html",
|
|
20
18
|
"javascript",
|
|
@@ -23,15 +21,21 @@
|
|
|
23
21
|
],
|
|
24
22
|
"files.encoding": "utf8",
|
|
25
23
|
"files.eol": "\n",
|
|
26
|
-
"files.
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
"files.exclude": {
|
|
25
|
+
".husky": true,
|
|
26
|
+
"node_modules": true,
|
|
27
|
+
"packages": true,
|
|
28
|
+
"pipelines": true
|
|
29
|
+
},
|
|
29
30
|
"stylelint.validate": [
|
|
30
31
|
"css",
|
|
31
32
|
"postcss",
|
|
32
33
|
"vue"
|
|
33
34
|
],
|
|
34
35
|
"tailwindCSS.includeLanguages": {
|
|
35
|
-
"vue": "html"
|
|
36
|
-
|
|
36
|
+
"vue": "html",
|
|
37
|
+
"vue-html": "html"
|
|
38
|
+
},
|
|
39
|
+
"volar.codeLens.pugTools": false,
|
|
40
|
+
"volar.completion.autoImportComponent": false
|
|
37
41
|
}
|
|
@@ -6,15 +6,16 @@
|
|
|
6
6
|
},
|
|
7
7
|
{
|
|
8
8
|
"name": "Hooks",
|
|
9
|
-
"path": "
|
|
9
|
+
"path": "[[HUSKY_DIR]]"
|
|
10
10
|
}
|
|
11
11
|
],
|
|
12
12
|
"settings": {
|
|
13
|
-
"[
|
|
14
|
-
"editor.
|
|
13
|
+
"[json]": {
|
|
14
|
+
"editor.defaultFormatter": "vscode.json-language-features"
|
|
15
|
+
},
|
|
16
|
+
"[jsonc]": {
|
|
17
|
+
"editor.defaultFormatter": "vscode.json-language-features"
|
|
15
18
|
},
|
|
16
|
-
"css.validate": false,
|
|
17
|
-
"diffEditor.ignoreTrimWhitespace": false,
|
|
18
19
|
"editor.codeActionsOnSave": {
|
|
19
20
|
"source.fixAll": true,
|
|
20
21
|
"source.fixAll.eslint": true,
|
|
@@ -22,10 +23,7 @@
|
|
|
22
23
|
"source.organizeImports": false
|
|
23
24
|
},
|
|
24
25
|
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
|
|
25
|
-
"editor.detectIndentation": false,
|
|
26
26
|
"editor.formatOnSave": true,
|
|
27
|
-
"editor.linkedEditing": true,
|
|
28
|
-
"eslint.alwaysShowStatus": true,
|
|
29
27
|
"eslint.validate": [
|
|
30
28
|
"html",
|
|
31
29
|
"javascript",
|
|
@@ -34,26 +32,33 @@
|
|
|
34
32
|
],
|
|
35
33
|
"files.encoding": "utf8",
|
|
36
34
|
"files.eol": "\n",
|
|
37
|
-
"files.
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
"files.exclude": {
|
|
36
|
+
".husky": true,
|
|
37
|
+
"node_modules": true,
|
|
38
|
+
"packages": true,
|
|
39
|
+
"pipelines": true
|
|
40
|
+
},
|
|
40
41
|
"stylelint.validate": [
|
|
41
42
|
"css",
|
|
42
43
|
"postcss",
|
|
43
44
|
"vue"
|
|
44
45
|
],
|
|
45
46
|
"tailwindCSS.includeLanguages": {
|
|
46
|
-
"vue": "html"
|
|
47
|
-
|
|
47
|
+
"vue": "html",
|
|
48
|
+
"vue-html": "html"
|
|
49
|
+
},
|
|
50
|
+
"volar.codeLens.pugTools": false,
|
|
51
|
+
"volar.completion.autoImportComponent": false
|
|
48
52
|
},
|
|
49
53
|
"extensions": {
|
|
50
54
|
"recommendations": [
|
|
51
|
-
"
|
|
55
|
+
"Vue.volar",
|
|
52
56
|
"dbaeumer.vscode-eslint",
|
|
53
57
|
"stylelint.vscode-stylelint",
|
|
54
58
|
"bradlc.vscode-tailwindcss",
|
|
55
59
|
"eamodio.gitlens",
|
|
56
60
|
"christian-kohler.npm-intellisense",
|
|
61
|
+
"pmneo.tsimporter",
|
|
57
62
|
"editorconfig.editorconfig",
|
|
58
63
|
"cpylua.language-postcss",
|
|
59
64
|
"antfu.iconify"
|
package/template/_eslintignore
CHANGED
package/template/_gitignore
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
|
+
logs
|
|
2
|
+
*.log
|
|
3
|
+
npm-debug.log*
|
|
4
|
+
yarn-debug.log*
|
|
5
|
+
yarn-error.log*
|
|
6
|
+
pnpm-debug.log*
|
|
7
|
+
lerna-debug.log*
|
|
8
|
+
|
|
1
9
|
node_modules
|
|
2
10
|
.DS_Store
|
|
3
11
|
dist
|
|
4
12
|
dist-ssr
|
|
5
13
|
*.local
|
|
6
|
-
|
|
14
|
+
|
|
15
|
+
.vscode/*
|
|
16
|
+
!.vscode/*.code-workspace
|
|
17
|
+
.idea
|
|
18
|
+
*.suo
|
|
19
|
+
*.ntvs*
|
|
20
|
+
*.njsproj
|
|
21
|
+
*.sln
|
|
22
|
+
*.sw?
|
package/template/index.html
CHANGED
package/template/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "[[PACKAGE_NAME]]",
|
|
3
|
+
"type": "module",
|
|
3
4
|
"version": "0.0.0",
|
|
4
5
|
"private": true,
|
|
5
6
|
"scripts": {
|
|
6
7
|
"dev": "vite",
|
|
7
8
|
"build": "vue-tsc --noEmit --skipLibCheck && vite build",
|
|
8
9
|
"serve": "vite preview",
|
|
9
|
-
"lint": "eslint . --ext .js,.ts,.vue --fix && stylelint **/*.{css,vue} --fix",
|
|
10
|
+
"lint": "eslint . --ext .js,.cjs,.mjs,.ts,.vue --fix && stylelint **/*.{css,vue} --fix",
|
|
10
11
|
"pre-commit-lint": "yarn lint-staged",
|
|
11
|
-
"prepare": "cd [[
|
|
12
|
+
"prepare": "cd [[ROOT_DIR]] && husky install"
|
|
12
13
|
}
|
|
13
14
|
}
|
|
File without changes
|
|
Binary file
|
package/template/src/app.vue
CHANGED
package/template/src/main.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import ui from '@citruslime/ui';
|
|
2
|
-
import { createPinia } from 'pinia';
|
|
3
2
|
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';
|
|
4
|
-
import { createApp } from 'vue';
|
|
5
3
|
|
|
6
4
|
import app from './app.vue';
|
|
7
|
-
import router from './router';
|
|
8
5
|
|
|
9
6
|
const pinia = createPinia();
|
|
10
7
|
|
|
@@ -6,10 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
<script setup lang="ts">
|
|
8
8
|
import { setLocaleMessages } from '@citruslime/ui';
|
|
9
|
-
import { storeToRefs } from 'pinia';
|
|
10
|
-
import { useI18n } from 'vue-i18n';
|
|
11
|
-
|
|
12
|
-
import { useAuthStore } from '@/state';
|
|
13
9
|
|
|
14
10
|
const { username } = storeToRefs(useAuthStore());
|
|
15
11
|
const { t } = useI18n();
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "@vue/tsconfig/tsconfig.web.json",
|
|
3
|
+
"include": [
|
|
4
|
+
"auto-imports.d.ts",
|
|
5
|
+
"components.d.ts",
|
|
6
|
+
"env.d.ts",
|
|
7
|
+
"src/**/*.ts",
|
|
8
|
+
"src/**/*.d.ts",
|
|
9
|
+
"src/**/*.vue"
|
|
10
|
+
],
|
|
11
|
+
"exclude": [
|
|
12
|
+
"src/**/__tests__/*"
|
|
13
|
+
],
|
|
14
|
+
"compilerOptions": {
|
|
15
|
+
"composite": true,
|
|
16
|
+
"baseUrl": ".",
|
|
17
|
+
"lib": [
|
|
18
|
+
"ESNext",
|
|
19
|
+
"DOM",
|
|
20
|
+
"DOM.Iterable"
|
|
21
|
+
],
|
|
22
|
+
"paths": {
|
|
23
|
+
"@/*": [
|
|
24
|
+
"./src/*"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
package/template/tsconfig.json
CHANGED
|
@@ -1,29 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"strictNullChecks": true,
|
|
13
|
-
"lib": [
|
|
14
|
-
"esnext",
|
|
15
|
-
"dom"
|
|
16
|
-
],
|
|
17
|
-
"paths": {
|
|
18
|
-
"@/*": [
|
|
19
|
-
"./src/*"
|
|
20
|
-
]
|
|
2
|
+
"files": [],
|
|
3
|
+
"references": [
|
|
4
|
+
{
|
|
5
|
+
"path": "./tsconfig.config.json"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"path": "./tsconfig.app.json"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"path": "./tsconfig.vitest.json"
|
|
21
12
|
}
|
|
22
|
-
},
|
|
23
|
-
"include": [
|
|
24
|
-
"src/**/*.ts",
|
|
25
|
-
"src/**/*.d.ts",
|
|
26
|
-
"src/**/*.vue",
|
|
27
|
-
"./components.d.ts"
|
|
28
13
|
]
|
|
29
14
|
}
|
package/template/vite.config.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { fileURLToPath, URL } from 'node:url';
|
|
2
2
|
|
|
3
3
|
import vue from '@vitejs/plugin-vue';
|
|
4
|
+
import autoImport from 'unplugin-auto-import/vite';
|
|
4
5
|
import { VueUseComponentsResolver } from 'unplugin-vue-components/resolvers';
|
|
5
6
|
import components from 'unplugin-vue-components/vite';
|
|
6
7
|
import { defineConfig } from 'vite';
|
|
@@ -9,19 +10,39 @@ import pages from 'vite-plugin-pages';
|
|
|
9
10
|
|
|
10
11
|
export default defineConfig({
|
|
11
12
|
plugins: [
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
autoImport({
|
|
14
|
+
dts: true,
|
|
15
|
+
dirs: [
|
|
16
|
+
'src/router/**',
|
|
17
|
+
'src/state/**'
|
|
18
|
+
],
|
|
19
|
+
imports: [
|
|
20
|
+
'@vueuse/core',
|
|
21
|
+
'pinia',
|
|
22
|
+
'vue',
|
|
23
|
+
'vue-i18n',
|
|
24
|
+
'vue-router'
|
|
25
|
+
],
|
|
26
|
+
eslintrc: {
|
|
27
|
+
enabled: true,
|
|
28
|
+
filepath: '.eslintrc-auto-import.json',
|
|
29
|
+
globalsPropValue: true
|
|
30
|
+
},
|
|
31
|
+
vueTemplate: true
|
|
16
32
|
}),
|
|
17
33
|
components({
|
|
34
|
+
dts: true,
|
|
18
35
|
dirs: [
|
|
19
36
|
'src/components',
|
|
20
37
|
'src/pages'
|
|
21
38
|
],
|
|
22
|
-
|
|
23
|
-
resolvers: [ VueUseComponentsResolver() ]
|
|
39
|
+
resolvers: [VueUseComponentsResolver()]
|
|
24
40
|
}),
|
|
41
|
+
pages({
|
|
42
|
+
pagesDir: 'src/pages',
|
|
43
|
+
extensions: ['vue']
|
|
44
|
+
}),
|
|
45
|
+
vue(),
|
|
25
46
|
mkcert()
|
|
26
47
|
],
|
|
27
48
|
build: {
|
|
@@ -35,37 +56,26 @@ export default defineConfig({
|
|
|
35
56
|
}
|
|
36
57
|
}
|
|
37
58
|
},
|
|
59
|
+
optimizeDeps: {
|
|
60
|
+
include: ['vue-i18n']
|
|
61
|
+
},
|
|
62
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
38
63
|
define: {
|
|
39
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
40
64
|
__VUE_I18N_FULL_INSTALL__: true,
|
|
41
65
|
__VUE_I18N_LEGACY_API__: false,
|
|
42
66
|
__INTLIFY_PROD_DEVTOOLS__: false
|
|
43
|
-
/* eslint-enable @typescript-eslint/naming-convention */
|
|
44
|
-
},
|
|
45
|
-
optimizeDeps: {
|
|
46
|
-
include: [ 'vue-i18n' ]
|
|
47
67
|
},
|
|
48
68
|
resolve: {
|
|
49
69
|
alias: {
|
|
50
|
-
|
|
51
|
-
'@': path.resolve(__dirname, 'src'),
|
|
70
|
+
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
52
71
|
'vue-i18n': 'vue-i18n/dist/vue-i18n.esm-bundler.js'
|
|
53
|
-
/* eslint-enable @typescript-eslint/naming-convention */
|
|
54
72
|
}
|
|
55
73
|
},
|
|
56
74
|
server: {
|
|
57
75
|
open: true,
|
|
58
76
|
https: true,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
proxy: {
|
|
62
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
63
|
-
'/api': {
|
|
64
|
-
target: 'https://localhost:[[BACKEND_PORT]]',
|
|
65
|
-
secure: false,
|
|
66
|
-
rewrite: (path) => path.replace('/api', '')
|
|
67
|
-
}
|
|
68
|
-
/* eslint-enable @typescript-eslint/naming-convention */
|
|
69
|
-
}
|
|
77
|
+
port: '[[FRONTEND_PORT]]',
|
|
78
|
+
proxy: '[[PROXY]]'
|
|
70
79
|
}
|
|
80
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
71
81
|
});
|
package/template/_eslintrc.js
DELETED
package/template/_stylelintrc.js
DELETED
package/template/src/env.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|
|
2
|
-
/// <reference types="vite-plugin-pages/client" />
|
|
3
|
-
|
|
4
|
-
declare module '*.vue' {
|
|
5
|
-
import type { DefineComponent } from 'vue';
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
|
|
7
|
-
const component: DefineComponent<{}, {}, any>;
|
|
8
|
-
export default component;
|
|
9
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './authentication';
|