create-vuetify 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.md +4 -5
  2. package/dist/output.cjs +187 -84
  3. package/package.json +1 -1
  4. package/template/javascript/base/src/components/HelloWorld.vue +1 -1
  5. package/template/javascript/base/vite.config.js +4 -2
  6. package/template/javascript/custom/eslint/_eslintrc.js +10 -0
  7. package/template/javascript/custom/eslint/package.json +9 -0
  8. package/template/javascript/custom/router/package.json +5 -0
  9. package/template/javascript/custom/router/src/App.vue +7 -0
  10. package/template/javascript/custom/router/src/layouts/default/Default.vue +9 -0
  11. package/template/javascript/custom/router/src/layouts/default/View.vue +9 -0
  12. package/template/javascript/custom/router/src/plugins/index.js +17 -0
  13. package/template/javascript/custom/router/src/router/index.js +26 -0
  14. package/template/javascript/custom/router/src/views/Home.vue +7 -0
  15. package/template/javascript/custom/router-pinia/src/plugins/index.js +19 -0
  16. package/template/javascript/custom/store/package.json +5 -0
  17. package/template/javascript/custom/store/src/plugins/index.js +17 -0
  18. package/template/javascript/custom/store/src/store/app.js +8 -0
  19. package/template/javascript/custom/store/src/store/index.js +4 -0
  20. package/template/javascript/default/src/components/HelloWorld.vue +1 -1
  21. package/template/javascript/default/vite.config.js +4 -2
  22. package/template/javascript/essentials/src/components/HelloWorld.vue +1 -1
  23. package/template/javascript/essentials/vite.config.js +4 -2
  24. package/template/typescript/base/src/components/HelloWorld.vue +1 -1
  25. package/template/typescript/base/src/vite-env.d.ts +7 -0
  26. package/template/typescript/base/tsconfig.json +14 -17
  27. package/template/typescript/base/tsconfig.node.json +9 -0
  28. package/template/typescript/base/vite.config.ts +4 -2
  29. package/template/typescript/custom/eslint/_eslintrc.js +14 -0
  30. package/template/typescript/custom/eslint/package.json +10 -0
  31. package/template/typescript/custom/router/package.json +5 -0
  32. package/template/typescript/custom/router/src/layouts/default/Default.vue +9 -0
  33. package/template/typescript/custom/router/src/layouts/default/View.vue +9 -0
  34. package/template/typescript/custom/router/src/plugins/index.ts +20 -0
  35. package/template/typescript/custom/router/src/router/index.ts +26 -0
  36. package/template/typescript/custom/router/src/views/Home.vue +7 -0
  37. package/template/typescript/custom/router-pinia/src/plugins/index.ts +22 -0
  38. package/template/typescript/custom/store/package.json +5 -0
  39. package/template/typescript/custom/store/src/plugins/index.ts +20 -0
  40. package/template/typescript/custom/store/src/store/app.ts +8 -0
  41. package/template/typescript/custom/store/src/store/index.ts +4 -0
  42. package/template/typescript/default/src/components/HelloWorld.vue +1 -1
  43. package/template/typescript/default/src/vite-env.d.ts +7 -0
  44. package/template/typescript/default/tsconfig.json +14 -17
  45. package/template/typescript/default/tsconfig.node.json +9 -0
  46. package/template/typescript/default/vite.config.ts +4 -2
  47. package/template/typescript/essentials/src/components/HelloWorld.vue +1 -1
  48. package/template/typescript/essentials/src/vite-env.d.ts +7 -0
  49. package/template/typescript/essentials/tsconfig.node.json +9 -0
  50. package/template/typescript/essentials/vite.config.ts +4 -2
  51. package/template/typescript/base/env.d.ts +0 -1
  52. package/template/typescript/default/env.d.ts +0 -1
  53. package/template/typescript/essentials/env.d.ts +0 -1
package/README.md CHANGED
@@ -4,11 +4,10 @@
4
4
 
5
5
  `create-vuetify` provides flags that can be passed when using the CLI to generate a new project.
6
6
 
7
- | **Flags** | **Values** | **Example** |
8
- |:---------------|-----------------------------------|-----------------------------------------|
9
- | `preset` | `default, base, essentials` | `--preset="default" or --preset default`|
10
- | `typescript` | `boolean` | `--typescript` |
11
-
7
+ | **Flags** | **Values** | **Example** |
8
+ | :----------- | ----------------------------------------- | ---------------------------------------- |
9
+ | `preset` | `default`, `base`, `essentials`, `custom` | `--preset="default" or --preset default` |
10
+ | `typescript` | `boolean` | `--typescript` |
12
11
 
13
12
  ## 💪 Supporting Vuetify
14
13
 
package/dist/output.cjs CHANGED
@@ -17,12 +17,139 @@ var __copyProps = (to, from, except, desc) => {
17
17
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
18
18
 
19
19
  // src/index.ts
20
- var import_path2 = require("path");
21
- var import_fs2 = require("fs");
20
+ var import_path3 = require("path");
21
+ var import_fs3 = require("fs");
22
+
23
+ // src/utils/prompts.ts
24
+ var import_path = require("path");
25
+ var import_fs = require("fs");
26
+
27
+ // src/utils/presets.ts
28
+ var defaultContext = {
29
+ useEslint: false,
30
+ useRouter: false,
31
+ useStore: false
32
+ };
33
+ var baseContext = {
34
+ ...defaultContext,
35
+ useEslint: true,
36
+ useRouter: true
37
+ };
38
+ var essentialsContext = {
39
+ ...baseContext,
40
+ useStore: true
41
+ };
42
+ var presets = {
43
+ base: baseContext,
44
+ default: defaultContext,
45
+ essentials: essentialsContext
46
+ };
47
+
48
+ // src/utils/prompts.ts
22
49
  var import_kolorist = require("kolorist");
23
- var import_minimist = __toESM(require("minimist"), 1);
24
50
  var import_prompts = __toESM(require("prompts"), 1);
25
51
  var import_validate_npm_package_name = __toESM(require("validate-npm-package-name"), 1);
52
+ var promptQuestions = (context) => [
53
+ {
54
+ name: "projectName",
55
+ type: "text",
56
+ message: "Project name:",
57
+ initial: "vuetify-project",
58
+ validate: (v) => {
59
+ const { errors } = (0, import_validate_npm_package_name.default)(String(v).trim());
60
+ return !(errors && errors.length) || `Package ${errors[0]}`;
61
+ }
62
+ },
63
+ {
64
+ name: "canOverwrite",
65
+ active: "Yes",
66
+ inactive: "No",
67
+ initial: false,
68
+ type: (_, { projectName }) => {
69
+ const projectPath = (0, import_path.join)(context.cwd, projectName);
70
+ return !(0, import_fs.existsSync)(projectPath) || (0, import_fs.readdirSync)(projectPath).length === 0 ? null : "toggle";
71
+ },
72
+ message: (prev) => `The project path: ${(0, import_path.resolve)(context.cwd, prev)} already exists, would you like to overwrite this directory?`
73
+ },
74
+ {
75
+ name: "usePreset",
76
+ type: context.usePreset ? null : "select",
77
+ message: "Which preset would you like to install?",
78
+ initial: 1,
79
+ choices: [
80
+ { title: "Default (Vuetify)", value: "default" },
81
+ { title: "Base (Vuetify, VueRouter)", value: "base" },
82
+ { title: "Essentials (Vuetify, VueRouter, Pinia)", value: "essentials" },
83
+ { title: "Custom (Choose your features)", value: "custom" }
84
+ ]
85
+ },
86
+ {
87
+ name: "useTypeScript",
88
+ type: context.useTypeScript ? null : "toggle",
89
+ message: "Use TypeScript?",
90
+ active: "Yes",
91
+ inactive: "No",
92
+ initial: false
93
+ },
94
+ {
95
+ name: "useRouter",
96
+ type: (_, { usePreset }) => usePreset !== "custom" && context.usePreset !== "custom" ? null : "toggle",
97
+ message: "Use Vue Router?",
98
+ active: "Yes",
99
+ inactive: "No",
100
+ initial: false
101
+ },
102
+ {
103
+ name: "useStore",
104
+ type: (_, { usePreset }) => usePreset !== "custom" && context.usePreset !== "custom" ? null : "toggle",
105
+ message: "Use Pinia?",
106
+ active: "Yes",
107
+ inactive: "No",
108
+ initial: false
109
+ },
110
+ {
111
+ name: "useEslint",
112
+ type: (_, { usePreset }) => usePreset !== "custom" && context.usePreset !== "custom" ? null : "toggle",
113
+ message: "Use ESLint?",
114
+ active: "Yes",
115
+ inactive: "No",
116
+ initial: false
117
+ },
118
+ {
119
+ name: "usePackageManager",
120
+ type: "select",
121
+ message: "Would you like to install dependencies with yarn, npm, or pnpm?",
122
+ initial: 0,
123
+ choices: [
124
+ { title: "yarn", value: "yarn" },
125
+ { title: "npm", value: "npm" },
126
+ { title: "pnpm", value: "pnpm" },
127
+ { title: "none", value: null }
128
+ ]
129
+ }
130
+ ];
131
+ var promptOptions = {
132
+ onCancel: () => {
133
+ throw new Error((0, import_kolorist.red)("\u2716") + " Operation cancelled");
134
+ }
135
+ };
136
+ var initPrompts = async (context) => {
137
+ if (context.usePreset && context.usePreset !== "custom") {
138
+ context = {
139
+ ...context,
140
+ ...presets[context.usePreset]
141
+ };
142
+ }
143
+ const answers = await (0, import_prompts.default)(promptQuestions(context), promptOptions);
144
+ return {
145
+ ...context,
146
+ ...answers
147
+ };
148
+ };
149
+
150
+ // src/index.ts
151
+ var import_kolorist2 = require("kolorist");
152
+ var import_minimist = __toESM(require("minimist"), 1);
26
153
 
27
154
  // src/utils/installDependencies.ts
28
155
  var import_child_process = require("child_process");
@@ -39,8 +166,8 @@ function installDependencies(projectRoot, packageManager) {
39
166
  }
40
167
 
41
168
  // src/utils/renderTemplate.ts
42
- var import_fs = require("fs");
43
- var import_path = require("path");
169
+ var import_fs2 = require("fs");
170
+ var import_path2 = require("path");
44
171
 
45
172
  // src/utils/deepMerge.ts
46
173
  var isObject = (v) => {
@@ -61,26 +188,30 @@ var deepMerge = (...sources) => sources.reduce((acc, curr) => {
61
188
 
62
189
  // src/utils/renderTemplate.ts
63
190
  function mergePkg(source, destination) {
64
- const target = JSON.parse((0, import_fs.readFileSync)(destination, "utf8"));
65
- const src = JSON.parse((0, import_fs.readFileSync)(source, "utf8"));
191
+ const target = JSON.parse((0, import_fs2.readFileSync)(destination, "utf8"));
192
+ const src = JSON.parse((0, import_fs2.readFileSync)(source, "utf8"));
66
193
  const mergedPkg = deepMerge(target, src);
67
- (0, import_fs.writeFileSync)(destination, JSON.stringify(mergedPkg, null, 2) + "\n");
194
+ const keysToSort = ["devDependencies", "dependencies"];
195
+ keysToSort.forEach((k) => {
196
+ mergedPkg[k] = Object.keys(mergedPkg[k]).sort().reduce((a, c) => (a[c] = mergedPkg[k][c], a), {});
197
+ });
198
+ (0, import_fs2.writeFileSync)(destination, JSON.stringify(mergedPkg, null, 2) + "\n");
68
199
  }
69
200
  function renderDirectory(source, destination) {
70
- (0, import_fs.mkdirSync)(destination, { recursive: true });
71
- (0, import_fs.readdirSync)(source).forEach((path) => renderTemplate((0, import_path.resolve)(source, path), (0, import_path.resolve)(destination, path)));
201
+ (0, import_fs2.mkdirSync)(destination, { recursive: true });
202
+ (0, import_fs2.readdirSync)(source).forEach((path) => renderTemplate((0, import_path2.resolve)(source, path), (0, import_path2.resolve)(destination, path)));
72
203
  }
73
204
  function renderFile(source, destination) {
74
- const filename = (0, import_path.basename)(source);
205
+ const filename = (0, import_path2.basename)(source);
75
206
  if (filename.startsWith("_"))
76
- destination = (0, import_path.resolve)((0, import_path.dirname)(destination), filename.replace("_", "."));
207
+ destination = (0, import_path2.resolve)((0, import_path2.dirname)(destination), filename.replace("_", "."));
77
208
  if (filename === "package.json")
78
209
  mergePkg(source, destination);
79
210
  else
80
- (0, import_fs.copyFileSync)(source, destination);
211
+ (0, import_fs2.copyFileSync)(source, destination);
81
212
  }
82
213
  function renderTemplate(source, destination) {
83
- if ((0, import_fs.statSync)(source).isDirectory()) {
214
+ if ((0, import_fs2.statSync)(source).isDirectory()) {
84
215
  renderDirectory(source, destination);
85
216
  } else {
86
217
  renderFile(source, destination);
@@ -88,96 +219,68 @@ function renderTemplate(source, destination) {
88
219
  }
89
220
 
90
221
  // src/index.ts
91
- var validPresets = ["base", "default", "essentials"];
222
+ var validPresets = ["base", "custom", "default", "essentials"];
92
223
  async function run() {
93
- const cwd = process.cwd();
94
224
  const argv = (0, import_minimist.default)(process.argv.slice(2), {
95
225
  alias: {
96
226
  "typescript": ["ts"]
97
227
  }
98
228
  });
99
229
  if (argv.preset && !validPresets.includes(argv.preset)) {
100
- throw new Error(`'${argv.preset}' is not a valid preset. Valid presets are: 'default', 'base', 'essentials'.`);
230
+ throw new Error(`'${argv.preset}' is not a valid preset. Valid presets are: ${validPresets.join(", ")}.`);
101
231
  }
102
232
  const banner = "\x1B[38;2;22;151;246mV\x1B[39m\x1B[38;2;22;147;242mu\x1B[39m\x1B[38;2;22;144;238me\x1B[39m\x1B[38;2;22;140;234mt\x1B[39m\x1B[38;2;23;136;229mi\x1B[39m\x1B[38;2;23;133;225mf\x1B[39m\x1B[38;2;23;129;221my\x1B[39m\x1B[38;2;23;125;217m.\x1B[39m\x1B[38;2;23;121;213mj\x1B[39m\x1B[38;2;23;118;209ms\x1B[39m \x1B[38;2;24;114;204m-\x1B[39m \x1B[38;2;24;110;200mM\x1B[39m\x1B[38;2;24;107;196ma\x1B[39m\x1B[38;2;24;103;192mt\x1B[39m\x1B[38;2;32;110;197me\x1B[39m\x1B[38;2;39;118;202mr\x1B[39m\x1B[38;2;47;125;207mi\x1B[39m\x1B[38;2;54;132;211ma\x1B[39m\x1B[38;2;62;140;216ml\x1B[39m \x1B[38;2;70;147;221mC\x1B[39m\x1B[38;2;77;154;226mo\x1B[39m\x1B[38;2;85;161;231mm\x1B[39m\x1B[38;2;93;169;236mp\x1B[39m\x1B[38;2;100;176;240mo\x1B[39m\x1B[38;2;108;183;245mn\x1B[39m\x1B[38;2;115;191;250me\x1B[39m\x1B[38;2;123;198;255mn\x1B[39m\x1B[38;2;126;199;255mt\x1B[39m \x1B[38;2;129;201;255mF\x1B[39m\x1B[38;2;133;202;255mr\x1B[39m\x1B[38;2;136;204;255ma\x1B[39m\x1B[38;2;139;205;255mm\x1B[39m\x1B[38;2;142;207;255me\x1B[39m\x1B[38;2;145;208;255mw\x1B[39m\x1B[38;2;149;210;255mo\x1B[39m\x1B[38;2;152;211;255mr\x1B[39m\x1B[38;2;155;212;255mk\x1B[39m \x1B[38;2;158;214;255mf\x1B[39m\x1B[38;2;161;215;255mo\x1B[39m\x1B[38;2;164;217;255mr\x1B[39m \x1B[38;2;168;218;255mV\x1B[39m\x1B[38;2;171;220;255mu\x1B[39m\x1B[38;2;174;221;255me\x1B[39m";
103
233
  console.log(`
104
234
  ${banner}
105
235
  `);
106
- let context = {
107
- projectName: void 0,
108
- canOverwrite: void 0,
236
+ const context = {
237
+ canOverwrite: false,
238
+ cwd: process.cwd(),
239
+ projectName: "vuetify-project",
240
+ useRouter: false,
109
241
  useTypeScript: argv.typescript,
242
+ usePreset: argv.preset,
243
+ useStore: void 0,
110
244
  usePackageManager: void 0
111
245
  };
112
- try {
113
- context = await (0, import_prompts.default)([
114
- {
115
- name: "projectName",
116
- type: "text",
117
- message: "Project name:",
118
- initial: "vuetify-project",
119
- validate: (v) => {
120
- const { errors } = (0, import_validate_npm_package_name.default)(String(v).trim());
121
- return !(errors && errors.length) || `Package ${errors[0]}`;
122
- }
123
- },
124
- {
125
- name: "canOverwrite",
126
- active: "Yes",
127
- inactive: "No",
128
- initial: false,
129
- type: (_, { projectName: projectName2 }) => {
130
- const projectPath = (0, import_path2.join)(cwd, projectName2);
131
- return !(0, import_fs2.existsSync)(projectPath) || (0, import_fs2.readdirSync)(projectPath).length === 0 ? null : "toggle";
132
- },
133
- message: (prev) => `The project path: ${(0, import_path2.resolve)(cwd, prev)} already exists, would you like to overwrite this directory?`
134
- },
135
- {
136
- name: "useTypeScript",
137
- type: context.useTypeScript ? null : "toggle",
138
- message: "Use TypeScript?",
139
- active: "Yes",
140
- inactive: "No",
141
- initial: false
142
- },
143
- {
144
- name: "usePackageManager",
145
- type: "select",
146
- message: "Would you like to install dependencies with yarn, npm, or pnpm?",
147
- initial: 0,
148
- choices: [
149
- { title: "yarn", value: "yarn" },
150
- { title: "npm", value: "npm" },
151
- { title: "pnpm", value: "pnpm" },
152
- { title: "none", value: null }
153
- ]
154
- }
155
- ], {
156
- onCancel: () => {
157
- throw new Error((0, import_kolorist.red)("\u2716") + " Operation cancelled");
158
- }
159
- });
160
- } catch (err) {
161
- throw err;
162
- }
163
246
  const {
164
247
  canOverwrite,
248
+ cwd,
165
249
  projectName,
166
250
  useTypeScript,
167
- usePackageManager
168
- } = context;
169
- const projectRoot = (0, import_path2.join)(cwd, projectName);
251
+ usePackageManager,
252
+ usePreset,
253
+ useStore,
254
+ useEslint,
255
+ useRouter
256
+ } = await initPrompts(context);
257
+ const projectRoot = (0, import_path3.join)(cwd, projectName);
170
258
  if (canOverwrite) {
171
- (0, import_fs2.rmSync)(projectRoot, { recursive: true });
259
+ (0, import_fs3.rmSync)(projectRoot, { recursive: true });
172
260
  }
173
- (0, import_fs2.mkdirSync)(projectRoot);
174
- const rootPkg = { name: projectName };
175
- (0, import_fs2.writeFileSync)((0, import_path2.resolve)(projectRoot, "package.json"), JSON.stringify(rootPkg, null, 2));
176
- const rootTemplatePath = (0, import_path2.resolve)(__dirname, "../template");
177
- const jsOrTs = useTypeScript || argv.typescript ? "typescript" : "javascript";
178
- const preset = !!argv.preset ? argv.preset : "default";
261
+ (0, import_fs3.mkdirSync)(projectRoot);
262
+ (0, import_fs3.writeFileSync)((0, import_path3.resolve)(projectRoot, "package.json"), JSON.stringify({ name: projectName }, null, 2));
263
+ const jsOrTs = useTypeScript ? "typescript" : "javascript";
264
+ let templatePath = (0, import_path3.resolve)(__dirname, "../template", jsOrTs);
179
265
  console.log("\n\u25CC Generating scaffold...");
180
- renderTemplate((0, import_path2.resolve)(rootTemplatePath, jsOrTs, preset), projectRoot);
266
+ if (usePreset !== "custom") {
267
+ renderTemplate((0, import_path3.resolve)(templatePath, usePreset), projectRoot);
268
+ } else {
269
+ renderTemplate((0, import_path3.resolve)(templatePath, "default"), projectRoot);
270
+ templatePath = (0, import_path3.resolve)(templatePath, usePreset);
271
+ if (useEslint) {
272
+ renderTemplate((0, import_path3.resolve)(templatePath, "eslint"), projectRoot);
273
+ }
274
+ if (useRouter) {
275
+ renderTemplate((0, import_path3.resolve)(templatePath, "router"), projectRoot);
276
+ }
277
+ if (useStore) {
278
+ renderTemplate((0, import_path3.resolve)(templatePath, "store"), projectRoot);
279
+ if (useRouter) {
280
+ renderTemplate((0, import_path3.resolve)(templatePath, "router-pinia"), projectRoot);
281
+ }
282
+ }
283
+ }
181
284
  if (usePackageManager) {
182
285
  console.log(`\u25CC Installing dependencies with ${usePackageManager}...
183
286
  `);
@@ -193,7 +296,7 @@ run().then(() => {
193
296
  console.log("Support Vuetify: https://github.com/sponsors/johnleider");
194
297
  }).catch((err) => {
195
298
  console.error(`
196
- ${(0, import_kolorist.red)("\u2716")} ${err}
299
+ ${(0, import_kolorist2.red)("\u2716")} ${err}
197
300
  `);
198
- process.exit();
301
+ process.exit(1);
199
302
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-vuetify",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "main": "dist/output.cjs",
5
5
  "author": "Elijah Kotyluk <elijah@elijahkotyluk.com>",
6
6
  "license": "MIT",
@@ -4,7 +4,7 @@
4
4
  <v-img
5
5
  contain
6
6
  height="300"
7
- src="src/assets/logo.svg"
7
+ src="@/assets/logo.svg"
8
8
  />
9
9
 
10
10
  <div class="text-body-2 font-weight-light mb-n1">Welcome to</div>
@@ -1,6 +1,6 @@
1
1
  // Plugins
2
2
  import vue from '@vitejs/plugin-vue'
3
- import vuetify from 'vite-plugin-vuetify'
3
+ import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'
4
4
 
5
5
  // Utilities
6
6
  import { defineConfig } from 'vite'
@@ -9,7 +9,9 @@ import { fileURLToPath, URL } from 'node:url'
9
9
  // https://vitejs.dev/config/
10
10
  export default defineConfig({
11
11
  plugins: [
12
- vue(),
12
+ vue({
13
+ template: { transformAssetUrls }
14
+ }),
13
15
  // https://github.com/vuetifyjs/vuetify-loader/tree/next/packages/vite-plugin
14
16
  vuetify({
15
17
  autoImport: true,
@@ -0,0 +1,10 @@
1
+ module.exports = {
2
+ root: true,
3
+ env: {
4
+ node: true,
5
+ },
6
+ extends: [
7
+ 'plugin:vue/vue3-essential',
8
+ 'eslint:recommended',
9
+ ],
10
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "scripts": {
3
+ "lint": "eslint . --fix --ignore-path .gitignore"
4
+ },
5
+ "devDependencies": {
6
+ "eslint": "^8.22.0",
7
+ "eslint-plugin-vue": "^9.3.0"
8
+ }
9
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "dependencies": {
3
+ "vue-router": "^4.0.0"
4
+ }
5
+ }
@@ -0,0 +1,7 @@
1
+ <template>
2
+ <router-view />
3
+ </template>
4
+
5
+ <script setup>
6
+ //
7
+ </script>
@@ -0,0 +1,9 @@
1
+ <template>
2
+ <v-app>
3
+ <default-view />
4
+ </v-app>
5
+ </template>
6
+
7
+ <script setup>
8
+ import DefaultView from './View.vue'
9
+ </script>
@@ -0,0 +1,9 @@
1
+ <template>
2
+ <v-main>
3
+ <router-view />
4
+ </v-main>
5
+ </template>
6
+
7
+ <script setup>
8
+ //
9
+ </script>
@@ -0,0 +1,17 @@
1
+ /**
2
+ * plugins/index.js
3
+ *
4
+ * Automatically included in `./src/main.js`
5
+ */
6
+
7
+ // Plugins
8
+ import { loadFonts } from './webfontloader'
9
+ import vuetify from './vuetify'
10
+ import router from '../router'
11
+
12
+ export function registerPlugins (app) {
13
+ loadFonts()
14
+ app
15
+ .use(vuetify)
16
+ .use(router)
17
+ }
@@ -0,0 +1,26 @@
1
+ // Composables
2
+ import { createRouter, createWebHistory } from 'vue-router'
3
+
4
+ const routes = [
5
+ {
6
+ path: '/',
7
+ component: () => import('@/layouts/default/Default.vue'),
8
+ children: [
9
+ {
10
+ path: '',
11
+ name: 'Home',
12
+ // route level code-splitting
13
+ // this generates a separate chunk (about.[hash].js) for this route
14
+ // which is lazy-loaded when the route is visited.
15
+ component: () => import(/* webpackChunkName: "home" */ '@/views/Home.vue'),
16
+ },
17
+ ],
18
+ },
19
+ ]
20
+
21
+ const router = createRouter({
22
+ history: createWebHistory(process.env.BASE_URL),
23
+ routes,
24
+ })
25
+
26
+ export default router
@@ -0,0 +1,7 @@
1
+ <template>
2
+ <HelloWorld />
3
+ </template>
4
+
5
+ <script setup>
6
+ import HelloWorld from '@/components/HelloWorld.vue'
7
+ </script>
@@ -0,0 +1,19 @@
1
+ /**
2
+ * plugins/index.js
3
+ *
4
+ * Automatically included in `./src/main.js`
5
+ */
6
+
7
+ // Plugins
8
+ import { loadFonts } from './webfontloader'
9
+ import vuetify from './vuetify'
10
+ import pinia from '../store'
11
+ import router from '../router'
12
+
13
+ export function registerPlugins (app) {
14
+ loadFonts()
15
+ app
16
+ .use(vuetify)
17
+ .use(pinia)
18
+ .use(router)
19
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "dependencies": {
3
+ "pinia": "^2.0.23"
4
+ }
5
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * plugins/index.js
3
+ *
4
+ * Automatically included in `./src/main.js`
5
+ */
6
+
7
+ // Plugins
8
+ import { loadFonts } from './webfontloader'
9
+ import vuetify from './vuetify'
10
+ import pinia from '../store'
11
+
12
+ export function registerPlugins (app) {
13
+ loadFonts()
14
+ app
15
+ .use(vuetify)
16
+ .use(pinia)
17
+ }
@@ -0,0 +1,8 @@
1
+ // Utilities
2
+ import { defineStore } from 'pinia'
3
+
4
+ export const useAppStore = defineStore('app', {
5
+ state: () => ({
6
+ //
7
+ }),
8
+ })
@@ -0,0 +1,4 @@
1
+ // Utilities
2
+ import { createPinia } from 'pinia'
3
+
4
+ export default createPinia()
@@ -4,7 +4,7 @@
4
4
  <v-img
5
5
  contain
6
6
  height="300"
7
- src="src/assets/logo.svg"
7
+ src="@/assets/logo.svg"
8
8
  />
9
9
 
10
10
  <div class="text-body-2 font-weight-light mb-n1">Welcome to</div>
@@ -1,6 +1,6 @@
1
1
  // Plugins
2
2
  import vue from '@vitejs/plugin-vue'
3
- import vuetify from 'vite-plugin-vuetify'
3
+ import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'
4
4
 
5
5
  // Utilities
6
6
  import { defineConfig } from 'vite'
@@ -9,7 +9,9 @@ import { fileURLToPath, URL } from 'node:url'
9
9
  // https://vitejs.dev/config/
10
10
  export default defineConfig({
11
11
  plugins: [
12
- vue(),
12
+ vue({
13
+ template: { transformAssetUrls }
14
+ }),
13
15
  // https://github.com/vuetifyjs/vuetify-loader/tree/next/packages/vite-plugin
14
16
  vuetify({
15
17
  autoImport: true,
@@ -4,7 +4,7 @@
4
4
  <v-img
5
5
  contain
6
6
  height="300"
7
- src="src/assets/logo.svg"
7
+ src="@/assets/logo.svg"
8
8
  />
9
9
 
10
10
  <div class="text-body-2 font-weight-light mb-n1">Welcome to</div>
@@ -1,6 +1,6 @@
1
1
  // Plugins
2
2
  import vue from '@vitejs/plugin-vue'
3
- import vuetify from 'vite-plugin-vuetify'
3
+ import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'
4
4
 
5
5
  // Utilities
6
6
  import { defineConfig } from 'vite'
@@ -9,7 +9,9 @@ import { fileURLToPath, URL } from 'node:url'
9
9
  // https://vitejs.dev/config/
10
10
  export default defineConfig({
11
11
  plugins: [
12
- vue(),
12
+ vue({
13
+ template: { transformAssetUrls }
14
+ }),
13
15
  // https://github.com/vuetifyjs/vuetify-loader/tree/next/packages/vite-plugin
14
16
  vuetify({
15
17
  autoImport: true,
@@ -4,7 +4,7 @@
4
4
  <v-img
5
5
  contain
6
6
  height="300"
7
- src="src/assets/logo.svg"
7
+ src="@/assets/logo.svg"
8
8
  />
9
9
 
10
10
  <div class="text-body-2 font-weight-light mb-n1">Welcome to</div>
@@ -0,0 +1,7 @@
1
+ /// <reference types="vite/client" />
2
+
3
+ declare module '*.vue' {
4
+ import type { DefineComponent } from 'vue'
5
+ const component: DefineComponent<{}, {}, any>
6
+ export default component
7
+ }
@@ -1,28 +1,25 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "baseUrl": ".",
4
- "target": "esnext",
4
+ "target": "ESNext",
5
5
  "useDefineForClassFields": true,
6
- "allowSyntheticDefaultImports": true,
7
- "composite": true,
8
- "module": "esnext",
9
- "moduleResolution": "node",
6
+ "module": "ESNext",
7
+ "moduleResolution": "Node",
10
8
  "strict": true,
11
9
  "jsx": "preserve",
12
- "sourceMap": false,
13
10
  "resolveJsonModule": true,
11
+ "isolatedModules": true,
14
12
  "esModuleInterop": true,
15
- "lib": ["esnext", "dom"],
16
- "types": ["vuetify"],
13
+ "lib": ["ESNext", "DOM"],
14
+ "skipLibCheck": true,
15
+ "noEmit": true,
17
16
  "paths": {
18
- "@/*": ["src/*"]
19
- },
17
+ "@/*": [
18
+ "src/*"
19
+ ]
20
+ }
20
21
  },
21
- "include": [
22
- "src/**/*.ts",
23
- "src/**/*.d.ts",
24
- "src/**/*.tsx",
25
- "src/**/*.vue",
26
- "vite.config.ts"
27
- ]
22
+ "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
23
+ "references": [{ "path": "./tsconfig.node.json" }],
24
+ "exclude": ["node_modules"]
28
25
  }
@@ -0,0 +1,9 @@
1
+ {
2
+ "compilerOptions": {
3
+ "composite": true,
4
+ "module": "ESNext",
5
+ "moduleResolution": "Node",
6
+ "allowSyntheticDefaultImports": true
7
+ },
8
+ "include": ["vite.config.ts"]
9
+ }
@@ -1,6 +1,6 @@
1
1
  // Plugins
2
2
  import vue from '@vitejs/plugin-vue'
3
- import vuetify from 'vite-plugin-vuetify'
3
+ import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'
4
4
 
5
5
  // Utilities
6
6
  import { defineConfig } from 'vite'
@@ -9,7 +9,9 @@ import { fileURLToPath, URL } from 'node:url'
9
9
  // https://vitejs.dev/config/
10
10
  export default defineConfig({
11
11
  plugins: [
12
- vue(),
12
+ vue({
13
+ template: { transformAssetUrls }
14
+ }),
13
15
  // https://github.com/vuetifyjs/vuetify-loader/tree/next/packages/vite-plugin
14
16
  vuetify({
15
17
  autoImport: true,
@@ -0,0 +1,14 @@
1
+ module.exports = {
2
+ root: true,
3
+ env: {
4
+ node: true,
5
+ },
6
+ extends: [
7
+ 'plugin:vue/vue3-essential',
8
+ 'eslint:recommended',
9
+ '@vue/eslint-config-typescript',
10
+ ],
11
+ rules: {
12
+ 'vue/multi-word-component-names': 'off',
13
+ },
14
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "scripts": {
3
+ "lint": "eslint . --fix --ignore-path .gitignore"
4
+ },
5
+ "devDependencies": {
6
+ "@vue/eslint-config-typescript": "^11.0.0",
7
+ "eslint": "^8.22.0",
8
+ "eslint-plugin-vue": "^9.3.0"
9
+ }
10
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "dependencies": {
3
+ "vue-router": "^4.0.0"
4
+ }
5
+ }
@@ -0,0 +1,9 @@
1
+ <template>
2
+ <v-app>
3
+ <default-view />
4
+ </v-app>
5
+ </template>
6
+
7
+ <script lang="ts" setup>
8
+ import DefaultView from './View.vue'
9
+ </script>
@@ -0,0 +1,9 @@
1
+ <template>
2
+ <v-main>
3
+ <router-view />
4
+ </v-main>
5
+ </template>
6
+
7
+ <script lang="ts" setup>
8
+ //
9
+ </script>
@@ -0,0 +1,20 @@
1
+ /**
2
+ * plugins/index.ts
3
+ *
4
+ * Automatically included in `./src/main.ts`
5
+ */
6
+
7
+ // Plugins
8
+ import { loadFonts } from './webfontloader'
9
+ import vuetify from './vuetify'
10
+ import router from '../router'
11
+
12
+ // Types
13
+ import type { App } from 'vue'
14
+
15
+ export function registerPlugins (app: App) {
16
+ loadFonts()
17
+ app
18
+ .use(vuetify)
19
+ .use(router)
20
+ }
@@ -0,0 +1,26 @@
1
+ // Composables
2
+ import { createRouter, createWebHistory } from 'vue-router'
3
+
4
+ const routes = [
5
+ {
6
+ path: '/',
7
+ component: () => import('@/layouts/default/Default.vue'),
8
+ children: [
9
+ {
10
+ path: '',
11
+ name: 'Home',
12
+ // route level code-splitting
13
+ // this generates a separate chunk (about.[hash].js) for this route
14
+ // which is lazy-loaded when the route is visited.
15
+ component: () => import(/* webpackChunkName: "home" */ '@/views/Home.vue'),
16
+ },
17
+ ],
18
+ },
19
+ ]
20
+
21
+ const router = createRouter({
22
+ history: createWebHistory(process.env.BASE_URL),
23
+ routes,
24
+ })
25
+
26
+ export default router
@@ -0,0 +1,7 @@
1
+ <template>
2
+ <HelloWorld />
3
+ </template>
4
+
5
+ <script lang="ts" setup>
6
+ import HelloWorld from '@/components/HelloWorld.vue'
7
+ </script>
@@ -0,0 +1,22 @@
1
+ /**
2
+ * plugins/index.ts
3
+ *
4
+ * Automatically included in `./src/main.ts`
5
+ */
6
+
7
+ // Plugins
8
+ import { loadFonts } from './webfontloader'
9
+ import vuetify from './vuetify'
10
+ import pinia from '../store'
11
+ import router from '../router'
12
+
13
+ // Types
14
+ import type { App } from 'vue'
15
+
16
+ export function registerPlugins (app: App) {
17
+ loadFonts()
18
+ app
19
+ .use(vuetify)
20
+ .use(router)
21
+ .use(pinia)
22
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "dependencies": {
3
+ "pinia": "^2.0.23"
4
+ }
5
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * plugins/index.ts
3
+ *
4
+ * Automatically included in `./src/main.ts`
5
+ */
6
+
7
+ // Plugins
8
+ import { loadFonts } from './webfontloader'
9
+ import vuetify from './vuetify'
10
+ import pinia from '../store'
11
+
12
+ // Types
13
+ import type { App } from 'vue'
14
+
15
+ export function registerPlugins (app: App) {
16
+ loadFonts()
17
+ app
18
+ .use(vuetify)
19
+ .use(pinia)
20
+ }
@@ -0,0 +1,8 @@
1
+ // Utilities
2
+ import { defineStore } from 'pinia'
3
+
4
+ export const useAppStore = defineStore('app', {
5
+ state: () => ({
6
+ //
7
+ }),
8
+ })
@@ -0,0 +1,4 @@
1
+ // Utilities
2
+ import { createPinia } from 'pinia'
3
+
4
+ export default createPinia()
@@ -4,7 +4,7 @@
4
4
  <v-img
5
5
  contain
6
6
  height="300"
7
- src="src/assets/logo.svg"
7
+ src="@/assets/logo.svg"
8
8
  />
9
9
 
10
10
  <div class="text-body-2 font-weight-light mb-n1">Welcome to</div>
@@ -0,0 +1,7 @@
1
+ /// <reference types="vite/client" />
2
+
3
+ declare module '*.vue' {
4
+ import type { DefineComponent } from 'vue'
5
+ const component: DefineComponent<{}, {}, any>
6
+ export default component
7
+ }
@@ -1,28 +1,25 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "baseUrl": ".",
4
- "target": "esnext",
4
+ "target": "ESNext",
5
5
  "useDefineForClassFields": true,
6
- "allowSyntheticDefaultImports": true,
7
- "composite": true,
8
- "module": "esnext",
9
- "moduleResolution": "node",
6
+ "module": "ESNext",
7
+ "moduleResolution": "Node",
10
8
  "strict": true,
11
9
  "jsx": "preserve",
12
- "sourceMap": false,
13
10
  "resolveJsonModule": true,
11
+ "isolatedModules": true,
14
12
  "esModuleInterop": true,
15
- "lib": ["esnext", "dom"],
16
- "types": ["vuetify"],
13
+ "lib": ["ESNext", "DOM"],
14
+ "skipLibCheck": true,
15
+ "noEmit": true,
17
16
  "paths": {
18
- "@/*": ["src/*"]
19
- },
17
+ "@/*": [
18
+ "src/*"
19
+ ]
20
+ }
20
21
  },
21
- "include": [
22
- "src/**/*.ts",
23
- "src/**/*.d.ts",
24
- "src/**/*.tsx",
25
- "src/**/*.vue",
26
- "vite.config.ts"
27
- ]
22
+ "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
23
+ "references": [{ "path": "./tsconfig.node.json" }],
24
+ "exclude": ["node_modules"]
28
25
  }
@@ -0,0 +1,9 @@
1
+ {
2
+ "compilerOptions": {
3
+ "composite": true,
4
+ "module": "ESNext",
5
+ "moduleResolution": "Node",
6
+ "allowSyntheticDefaultImports": true
7
+ },
8
+ "include": ["vite.config.ts"]
9
+ }
@@ -1,6 +1,6 @@
1
1
  // Plugins
2
2
  import vue from '@vitejs/plugin-vue'
3
- import vuetify from 'vite-plugin-vuetify'
3
+ import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'
4
4
 
5
5
  // Utilities
6
6
  import { defineConfig } from 'vite'
@@ -9,7 +9,9 @@ import { fileURLToPath, URL } from 'node:url'
9
9
  // https://vitejs.dev/config/
10
10
  export default defineConfig({
11
11
  plugins: [
12
- vue(),
12
+ vue({
13
+ template: { transformAssetUrls }
14
+ }),
13
15
  // https://github.com/vuetifyjs/vuetify-loader/tree/next/packages/vite-plugin
14
16
  vuetify({
15
17
  autoImport: true,
@@ -4,7 +4,7 @@
4
4
  <v-img
5
5
  contain
6
6
  height="300"
7
- src="src/assets/logo.svg"
7
+ src="@/assets/logo.svg"
8
8
  />
9
9
 
10
10
  <div class="text-body-2 font-weight-light mb-n1">Welcome to</div>
@@ -0,0 +1,7 @@
1
+ /// <reference types="vite/client" />
2
+
3
+ declare module '*.vue' {
4
+ import type { DefineComponent } from 'vue'
5
+ const component: DefineComponent<{}, {}, any>
6
+ export default component
7
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "compilerOptions": {
3
+ "composite": true,
4
+ "module": "ESNext",
5
+ "moduleResolution": "Node",
6
+ "allowSyntheticDefaultImports": true
7
+ },
8
+ "include": ["vite.config.ts"]
9
+ }
@@ -1,6 +1,6 @@
1
1
  // Plugins
2
2
  import vue from '@vitejs/plugin-vue'
3
- import vuetify from 'vite-plugin-vuetify'
3
+ import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'
4
4
 
5
5
  // Utilities
6
6
  import { defineConfig } from 'vite'
@@ -9,7 +9,9 @@ import { fileURLToPath, URL } from 'node:url'
9
9
  // https://vitejs.dev/config/
10
10
  export default defineConfig({
11
11
  plugins: [
12
- vue(),
12
+ vue({
13
+ template: { transformAssetUrls }
14
+ }),
13
15
  // https://github.com/vuetifyjs/vuetify-loader/tree/next/packages/vite-plugin
14
16
  vuetify({
15
17
  autoImport: true,
@@ -1 +0,0 @@
1
- /// <reference types="vite/client" />
@@ -1 +0,0 @@
1
- /// <reference types="vite/client" />
@@ -1 +0,0 @@
1
- /// <reference types="vite/client" />