@citruslime/create-boilerplate 1.0.0 → 1.0.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.
@@ -8,4 +8,4 @@ if ! command -v "$yarn_directory\yarn" -v; then
8
8
  npm install --global yarn
9
9
  fi
10
10
 
11
- "$yarn_directory\yarn" install -W
11
+ "$yarn_directory\yarn" install --cwd "[[PACKAGE_DIR]]"
package/hooks/post-merge CHANGED
@@ -8,4 +8,4 @@ if ! command -v "$yarn_directory\yarn" -v; then
8
8
  npm install --global yarn
9
9
  fi
10
10
 
11
- "$yarn_directory\yarn" install -W
11
+ "$yarn_directory\yarn" install --cwd "[[PACKAGE_DIR]]"
package/hooks/pre-commit CHANGED
@@ -8,4 +8,4 @@ if ! command -v "$yarn_directory\yarn" -v; then
8
8
  npm install --global yarn
9
9
  fi
10
10
 
11
- "$yarn_directory\yarn" pre-commit-lint
11
+ "$yarn_directory\yarn" --cwd "[[PACKAGE_DIR]]" pre-commit-lint
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 { dirname, join } from 'path';
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, green, red } from 'kolorist';
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(dirname(import.meta.url));
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
- '[[REPOSITORY_ROOT]]': '',
19
+ '[[PACKAGE_DIR]]': '',
20
+ '[[ROOT_DIR]]': '',
20
21
  '[[HUSKY_DIR]]': '',
21
- '[[BACKEND_PORT]]': 0,
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.js': '.eslintrc.js',
32
+ '_eslintrc.cjs': '.eslintrc.cjs',
33
33
  '_lintstagedrc.json': '.lintstagedrc.json',
34
34
  _stylelintignore: '.stylelintignore',
35
- '_stylelintrc.js': '.stylelintrc.js',
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: '@iconify/vue',
86
+ name: '@vue/tsconfig',
83
87
  dev: true
84
88
  },
85
89
  {
@@ -94,10 +98,18 @@ const dependenciesToInstall = [
94
98
  name: 'postcss',
95
99
  dev: true
96
100
  },
101
+ {
102
+ name: 'npm-run-all',
103
+ dev: true
104
+ },
97
105
  {
98
106
  name: 'typescript',
99
107
  dev: true
100
108
  },
109
+ {
110
+ name: 'unplugin-auto-import',
111
+ dev: true
112
+ },
101
113
  {
102
114
  name: 'unplugin-vue-components',
103
115
  dev: true
@@ -125,25 +137,27 @@ const dependenciesToInstall = [
125
137
  */
126
138
  async function init () {
127
139
  let packageDir = argv._[0];
140
+ const rootDir = execSync('git rev-parse --show-toplevel')
141
+ .toString()
142
+ .trim();
128
143
 
129
144
  const {
130
145
  packageName,
131
146
  empty,
132
- packageManager,
133
- rootDir,
134
- frontendPort,
135
- backendPort
147
+ backendPort,
148
+ packageManager
136
149
  } = await prompts([
137
150
  {
138
151
  type: 'text',
139
152
  name: 'packageName',
140
- message: 'Enter a package name:',
141
- validate: (value) => /^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(value)
153
+ message: 'Enter a name for the project:',
154
+ validate: (value) => /^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(value) || 'Invalid package name'
142
155
  },
143
156
  {
144
157
  type: packageDir ? null : 'text',
145
158
  name: 'packageDir',
146
- message: 'Enter a directory for the package:',
159
+ message: 'Enter a directory for the project:',
160
+ initial: '.',
147
161
  onState: (state) => packageDir = state.value
148
162
  },
149
163
  {
@@ -161,6 +175,18 @@ async function init () {
161
175
  },
162
176
  name: 'emptyConfirmation'
163
177
  },
178
+ {
179
+ type: 'confirm',
180
+ name: 'hasApi',
181
+ message: 'Setup backend proxy?',
182
+ initial: true
183
+ },
184
+ {
185
+ type: (prev) => prev ? 'text' : null,
186
+ name: 'backendPort',
187
+ message: 'Enter the port that the backend server runs on:',
188
+ initial: 0
189
+ },
164
190
  {
165
191
  type: 'select',
166
192
  name: 'packageManager',
@@ -170,28 +196,16 @@ async function init () {
170
196
  title: 'yarn',
171
197
  value: 'yarn'
172
198
  },
199
+ {
200
+ title: 'pnpm',
201
+ value: 'pnpm'
202
+ },
173
203
  {
174
204
  title: 'npm',
175
205
  value: 'npm'
176
206
  }
177
207
  ],
178
208
  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
209
  }
196
210
  ], {
197
211
  onCancel: () => cancel()
@@ -201,7 +215,7 @@ async function init () {
201
215
 
202
216
  packageDir = packageDir.toString();
203
217
 
204
- setReplacements(packageName, rootDir, frontendPort, backendPort);
218
+ setReplacements(packageName, packageDir, rootDir, backendPort ?? 0);
205
219
  prepareDir(join(cwd, packageDir), empty);
206
220
  copyTemplate(packageDir);
207
221
 
@@ -209,7 +223,7 @@ async function init () {
209
223
  installDependencies(packageManager);
210
224
 
211
225
  print(lightBlue('Creating hooks...'), true);
212
- copyHooks(packageDir, rootDir);
226
+ copyHooks(rootDir);
213
227
 
214
228
  print(green(`Package ${packageName} has been successfully initialised in ${packageDir}.`), true);
215
229
  }
@@ -218,18 +232,31 @@ async function init () {
218
232
  * Set the dynamic values for the file renaming and placeholder replacements.
219
233
  *
220
234
  * @param {string} packageName The name of the package being created.
235
+ * @param {string} packageDir The directory of the package being created.
221
236
  * @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
237
  * @param {number} backendPort The port that the backend server runs on.
224
238
  */
225
- function setReplacements (packageName, rootDir, frontendPort, backendPort) {
226
- filesToRename['template.code-workspace'] = `${packageName}.code-workspace`;
239
+ function setReplacements (packageName, packageDir, rootDir, backendPort) {
240
+ const husky = relative(join(cwd, packageDir, '.vscode'), join(rootDir, '.husky'));
241
+ const repoRoot = relative(join(cwd, packageDir), rootDir);
242
+ const projDir = relative(rootDir, join(cwd, packageDir));
227
243
 
244
+ filesToRename['template.code-workspace'] = `${packageName}.code-workspace`;
228
245
  placeholdersToReplace['[[PACKAGE_NAME]]'] = packageName;
229
- placeholdersToReplace['[[REPOSITORY_ROOT]]'] = rootDir;
230
- placeholdersToReplace['[[HUSKY_DIR]]'] = join(rootDir, '.husky').replace('\\', '/');
231
- placeholdersToReplace['[[FRONTEND_PORT]]'] = frontendPort;
232
- placeholdersToReplace['[[BACKEND_PORT]]'] = backendPort;
246
+ placeholdersToReplace['[[PACKAGE_DIR]]'] = projDir;
247
+ placeholdersToReplace['[[ROOT_DIR]]'] = repoRoot.replaceAll('\\', '/');
248
+ placeholdersToReplace['[[HUSKY_DIR]]'] = husky.replaceAll('\\', '/');
249
+ placeholdersToReplace['\'[[FRONTEND_PORT]]\''] = Math.floor(Math.random() * 1001) + 4000;
250
+
251
+ if (backendPort !== 0) {
252
+ placeholdersToReplace['\'[[PROXY]]\''] = `{
253
+ '/api': {
254
+ target: 'https://localhost:${backendPort}',
255
+ secure: false,
256
+ rewrite: (path) => path.replace('/api', '')
257
+ }
258
+ }`;
259
+ }
233
260
  }
234
261
 
235
262
  /**
@@ -270,14 +297,18 @@ function copyTemplate (packageDir) {
270
297
  /**
271
298
  * Copies the hooks directory into the husky directory for the repository.
272
299
  *
273
- * @param {string} packageDir The directory of the new package.
274
300
  * @param {string} rootDir The relative path from the package directory to the root of the repository.
275
301
  */
276
- function copyHooks (packageDir, rootDir) {
302
+ function copyHooks (rootDir) {
277
303
  const hooksDir = join(codeDir, 'hooks');
278
- const huskyDir = join(cwd, packageDir, rootDir, '.husky');
304
+ const huskyDir = join(rootDir, '.husky');
279
305
 
280
- forEachInDir(hooksDir, (item) => copy(hooksDir, huskyDir, item));
306
+ if (existsSync(join(huskyDir, 'common.sh'))) {
307
+ print(lightYellow('Git Hooks already installed by another package in this repo. These will need to be edited manually.\n'), true);
308
+ }
309
+ else {
310
+ forEachInDir(hooksDir, (item) => copy(hooksDir, huskyDir, item));
311
+ }
281
312
  }
282
313
 
283
314
  /**
@@ -331,7 +362,7 @@ function copy (source, destination, item) {
331
362
  * @param {string} packageManager The package manager to use.
332
363
  */
333
364
  function installDependencies (packageManager) {
334
- const prefix = `${packageManager} ${packageManager === 'yarn' ? 'add' : 'install'}`;
365
+ const prefix = `${packageManager} ${packageManager !== 'npm' ? 'add' : 'install'}`;
335
366
 
336
367
  print(lightBlue('Installing dev dependencies...'), true);
337
368
 
@@ -367,6 +398,8 @@ function forEachInDir (dir, callback) {
367
398
 
368
399
  /**
369
400
  * Throws an error to indicate that the current operation has been cancelled.
401
+ *
402
+ * @throws Operation cancelled error.
370
403
  */
371
404
  function cancel () {
372
405
  throw new Error('Operation was cancelled.');
@@ -376,11 +409,11 @@ function cancel () {
376
409
  * Prints a message to the console.
377
410
  *
378
411
  * @param {string} message The message to display.
379
- * @param {boolean} clearPrevious Whether to clear the previous line before displaying the new one.
412
+ * @param {boolean} clearPrevious Whether to clear any existing message.
380
413
  */
381
414
  function print (message, clearPrevious = false) {
382
415
  if (clearPrevious) {
383
- process.stdout.clearLine();
416
+ process.stdout.clearLine(0);
384
417
  process.stdout.cursorTo(0);
385
418
  }
386
419
 
@@ -392,4 +425,5 @@ try {
392
425
  }
393
426
  catch (e) {
394
427
  print(`\n${red(e.message)}`);
428
+ process.exit(1);
395
429
  }
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@citruslime/create-boilerplate",
3
- "version": "1.0.0",
3
+ "type": "module",
4
+ "version": "1.0.1",
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": ">=14.0.0"
27
+ "node": ">=16.0.0"
24
28
  },
25
29
  "dependencies": {
26
30
  "kolorist": "^1.5.1",
27
- "minimist": "^1.2.5",
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
- "johnsoncodehk.volar",
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
- "[css]": {
3
- "editor.insertSpaces": false
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.trimTrailingWhitespace": true,
27
- "npm-intellisense.scanDevDependencies": true,
28
- "npm-intellisense.showBuildInLibs": true,
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": "../[[HUSKY_DIR]]"
9
+ "path": "[[HUSKY_DIR]]"
10
10
  }
11
11
  ],
12
12
  "settings": {
13
- "[css]": {
14
- "editor.insertSpaces": false
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.trimTrailingWhitespace": true,
38
- "npm-intellisense.scanDevDependencies": true,
39
- "npm-intellisense.showBuildInLibs": true,
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
- "johnsoncodehk.volar",
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"
@@ -1,3 +1,6 @@
1
1
  dist
2
2
  node_modules
3
- index.html
3
+ auto-imports.d.ts
4
+ components.d.ts
5
+ **/*.html
6
+
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ extends: [
3
+ require.resolve('@citruslime/config/eslint'),
4
+ './.eslintrc-auto-import.json'
5
+ ]
6
+ };
@@ -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
- *.log
14
+
15
+ .vscode/*
16
+ !.vscode/*.code-workspace
17
+ .idea
18
+ *.suo
19
+ *.ntvs*
20
+ *.njsproj
21
+ *.sln
22
+ *.sw?
@@ -1,5 +1,5 @@
1
1
  {
2
- "./**/*.+(js|ts|vue)": [
2
+ "./**/*.+(js|cjs|mjs|ts|vue)": [
3
3
  "eslint --fix"
4
4
  ],
5
5
  "./**/*.(css|vue)": [
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ extends: [require.resolve('@citruslime/config/stylelint')]
3
+ };
@@ -0,0 +1,2 @@
1
+ /// <reference types="vite/client" />
2
+ /// <reference types="vite-plugin-pages/client" />
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8" />
5
5
  <link rel="icon" href="/favicon.ico" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>Citrus-Lime</title>
7
+ <title>[[PACKAGE_NAME]]</title>
8
8
  </head>
9
9
  <body>
10
10
  <div id="app"></div>
@@ -1,13 +1,16 @@
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
- "build": "vue-tsc --noEmit --skipLibCheck && vite build",
8
+ "build": "run-p type-check build-only",
9
+ "build-only": "vite build",
10
+ "type-check": "vue-tsc --noEmit",
8
11
  "serve": "vite preview",
9
- "lint": "eslint . --ext .js,.ts,.vue --fix && stylelint **/*.{css,vue} --fix",
12
+ "lint": "eslint . --ext .js,.cjs,.mjs,.ts,.vue --fix && stylelint **/*.{css,vue} --fix",
10
13
  "pre-commit-lint": "yarn lint-staged",
11
- "prepare": "cd [[REPOSITORY_ROOT]] && husky install"
14
+ "prepare": "cd [[ROOT_DIR]] && husky install"
12
15
  }
13
16
  }
Binary file
@@ -1,6 +1,4 @@
1
1
  <script setup lang="ts">
2
- import { useRoute } from 'vue-router';
3
-
4
2
  const route = useRoute();
5
3
  </script>
6
4
 
@@ -1,10 +1,8 @@
1
1
  import ui from '@citruslime/ui';
2
- import { createPinia } from 'pinia';
2
+ import '@citruslime/utils';
3
3
  import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';
4
- import { createApp } from 'vue';
5
4
 
6
5
  import app from './app.vue';
7
- import router from './router';
8
6
 
9
7
  const pinia = createPinia();
10
8
 
@@ -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();
@@ -1,5 +1,3 @@
1
- import { defineStore } from 'pinia';
2
-
3
1
  export const useAuthStore = defineStore('auth', {
4
2
  state: () => ({
5
3
  username: 'Nobody',
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ presets: [require('@citruslime/theme')],
3
+ content: [
4
+ './index.html',
5
+ './src/**/*.{vue,js,cjs,mjs,ts}'
6
+ ]
7
+ };
@@ -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
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "extends": "@vue/tsconfig/tsconfig.node.json",
3
+ "include": [
4
+ "vite.config.*",
5
+ "vitest.config.*",
6
+ "cypress.config.*"
7
+ ],
8
+ "compilerOptions": {
9
+ "composite": true,
10
+ "types": [
11
+ "node"
12
+ ]
13
+ }
14
+ }
@@ -1,29 +1,14 @@
1
1
  {
2
- "compilerOptions": {
3
- "target": "esnext",
4
- "useDefineForClassFields": true,
5
- "module": "esnext",
6
- "moduleResolution": "node",
7
- "strict": true,
8
- "jsx": "preserve",
9
- "sourceMap": true,
10
- "resolveJsonModule": true,
11
- "esModuleInterop": true,
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
  }
@@ -0,0 +1,12 @@
1
+ {
2
+ "extends": "./tsconfig.app.json",
3
+ "exclude": [],
4
+ "compilerOptions": {
5
+ "composite": true,
6
+ "lib": [],
7
+ "types": [
8
+ "node",
9
+ "jsdom"
10
+ ]
11
+ }
12
+ }
@@ -1,6 +1,7 @@
1
- import path from 'path';
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
- vue(),
13
- pages({
14
- pagesDir: 'src/views',
15
- extensions: [ 'vue' ]
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
- dts: true,
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
- /* eslint-disable @typescript-eslint/naming-convention */
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
- // eslint-disable-next-line array-bracket-spacing
60
- port: [[FRONTEND_PORT]],
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
  });
@@ -1,3 +0,0 @@
1
- module.exports = {
2
- extends: [ require.resolve('@citruslime/config/eslint') ]
3
- };
@@ -1,3 +0,0 @@
1
- module.exports = {
2
- extends: [ require.resolve('@citruslime/config/stylelint') ]
3
- };
@@ -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';
@@ -1,7 +0,0 @@
1
- module.exports = {
2
- presets: [ require('@citruslime/theme') ],
3
- content: [
4
- './index.html',
5
- './src/**/*.{vue,js,ts,jsx,tsx}'
6
- ]
7
- };