create-vitrify 0.6.4 → 0.7.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.
Files changed (56) hide show
  1. package/dist/templates.js +272 -46
  2. package/package.json +7 -7
  3. package/templates/fastify/_gitignore +3 -0
  4. package/templates/fastify/_prettierignore +3 -0
  5. package/templates/fastify/_prettierrc.json +22 -0
  6. package/templates/fastify/eslint.config.js +27 -0
  7. package/templates/fastify/src/setup.ts +12 -0
  8. package/templates/fastify/vitrify.config.ts +21 -0
  9. package/templates/quasar/eslint.config.js +27 -0
  10. package/templates/quasar/src/pages/IndexPage.vue +1 -1
  11. package/templates/quasar/src/router/routes.ts +3 -3
  12. package/templates/quasar/src/setup.ts +2 -1
  13. package/templates/quasar/vitrify.config.ts +9 -14
  14. package/templates/quasarmd3/.vscode/extensions.json +3 -0
  15. package/templates/quasarmd3/_gitignore +3 -0
  16. package/templates/quasarmd3/_prettierignore +3 -0
  17. package/templates/quasarmd3/_prettierrc.json +22 -0
  18. package/templates/quasarmd3/eslint.config.js +27 -0
  19. package/templates/quasarmd3/index.html +14 -0
  20. package/templates/quasarmd3/src/App.test.js +3 -0
  21. package/templates/quasarmd3/src/App.vue +35 -0
  22. package/templates/quasarmd3/src/assets/quasar-logo-vertical.svg +15 -0
  23. package/templates/quasarmd3/src/components/HelloWorld.vue +21 -0
  24. package/templates/quasarmd3/src/lang/en-US.ts +8 -0
  25. package/templates/quasarmd3/src/lang/index.ts +40 -0
  26. package/templates/quasarmd3/src/lang/nl.ts +8 -0
  27. package/templates/quasarmd3/src/layouts/MainLayout.vue +115 -0
  28. package/templates/quasarmd3/src/layouts/NavigationTabs.vue +7 -0
  29. package/templates/quasarmd3/src/pages/Error404Page.vue +29 -0
  30. package/templates/quasarmd3/src/pages/IndexPage/IndexPage.vue +15 -0
  31. package/templates/quasarmd3/src/pages/IndexPage/IndexPageFabs.vue +21 -0
  32. package/templates/quasarmd3/src/pwa.ts +21 -0
  33. package/templates/quasarmd3/src/router/index.ts +17 -0
  34. package/templates/quasarmd3/src/router/routes.ts +27 -0
  35. package/templates/quasarmd3/src/setup.ts +9 -0
  36. package/templates/quasarmd3/src/shims-vue.d.ts +6 -0
  37. package/templates/quasarmd3/vitrify.config.ts +204 -0
  38. package/templates/vue/.vscode/extensions.json +3 -0
  39. package/templates/vue/_gitignore +3 -0
  40. package/templates/vue/_prettierignore +3 -0
  41. package/templates/vue/_prettierrc.json +22 -0
  42. package/templates/vue/eslint.config.js +27 -0
  43. package/templates/vue/index.html +14 -0
  44. package/templates/vue/src/App.test.js +3 -0
  45. package/templates/vue/src/App.vue +20 -0
  46. package/templates/vue/src/components/HelloWorld.vue +9 -0
  47. package/templates/vue/src/layouts/MainLayout.vue +5 -0
  48. package/templates/vue/src/pages/Error404Page.vue +9 -0
  49. package/templates/vue/src/pages/IndexPage.vue +13 -0
  50. package/templates/vue/src/router/index.ts +17 -0
  51. package/templates/vue/src/router/routes.ts +19 -0
  52. package/templates/vue/src/setup.ts +9 -0
  53. package/templates/vue/src/shims-vue.d.ts +6 -0
  54. package/templates/vue/vitrify.config.ts +21 -0
  55. package/templates/quasar/_eslint.config.ts +0 -0
  56. package/templates/quasar/_eslintrc.cjs +0 -19
@@ -0,0 +1,204 @@
1
+ import type { VitrifyConfig } from 'vitrify'
2
+ import { QuasarPlugin, type QuasarPluginOptions } from 'vitrify/plugins'
3
+ import { certificateFor } from 'devcert'
4
+ import QuasarComponentsPlugin from '@simsustech/quasar-components/vite-plugin'
5
+ import { QuasarPreset } from 'unocss-preset-quasar'
6
+ import { MaterialDesign3 } from 'unocss-preset-quasar/styles'
7
+ import { loadEnv } from 'vite'
8
+
9
+ const iconifyJsonIconSet = {
10
+ name: 'iconify-json-mdi',
11
+ type: {
12
+ positive: 'i-mdi-check-circle',
13
+ negative: 'i-mdi-alert',
14
+ info: 'i-mdi-information',
15
+ warning: 'i-mdi-exclamation'
16
+ },
17
+ arrow: {
18
+ up: 'i-mdi-arrow-up',
19
+ right: 'i-mdi-arrow-right',
20
+ down: 'i-mdi-arrow-down',
21
+ left: 'i-mdi-arrow-left',
22
+ dropdown: 'i-mdi-menu-down'
23
+ },
24
+ chevron: {
25
+ left: 'i-mdi-chevron-left',
26
+ right: 'i-mdi-chevron-right'
27
+ },
28
+ colorPicker: {
29
+ spectrum: 'i-mdi-gradient-vertical',
30
+ tune: 'i-mdi-tune',
31
+ palette: 'i-mdi-palette-swatch'
32
+ },
33
+ pullToRefresh: {
34
+ icon: 'i-mdi-refresh'
35
+ },
36
+ carousel: {
37
+ left: 'i-mdi-chevron-left',
38
+ right: 'i-mdi-chevron-right',
39
+ up: 'i-mdi-chevron-up',
40
+ down: 'i-mdi-chevron-down',
41
+ navigationIcon: 'i-mdi-circle'
42
+ },
43
+ chip: {
44
+ remove: 'i-mdi-close-circle',
45
+ selected: 'i-mdi-check'
46
+ },
47
+ datetime: {
48
+ arrowLeft: 'i-mdi-chevron-left',
49
+ arrowRight: 'i-mdi-chevron-right',
50
+ now: 'i-mdi-clock-outline',
51
+ today: 'i-mdi-calendar-today'
52
+ },
53
+ editor: {
54
+ bold: 'i-mdi-format-bold',
55
+ italic: 'i-mdi-format-italic',
56
+ strikethrough: 'i-mdi-format-strikethrough-variant',
57
+ underline: 'i-mdi-format-underline',
58
+ unorderedList: 'i-mdi-format-list-bulleted',
59
+ orderedList: 'i-mdi-format-list-numbered',
60
+ subscript: 'i-mdi-format-subscript',
61
+ superscript: 'i-mdi-format-superscript',
62
+ hyperlink: 'i-mdi-link',
63
+ toggleFullscreen: 'i-mdi-fullscreen',
64
+ quote: 'i-mdi-format-quote-close',
65
+ left: 'i-mdi-format-align-left',
66
+ center: 'i-mdi-format-align-center',
67
+ right: 'i-mdi-format-align-right',
68
+ justify: 'i-mdi-format-align-justify',
69
+ print: 'i-mdi-printer',
70
+ outdent: 'i-mdi-format-indent-decrease',
71
+ indent: 'i-mdi-format-indent-increase',
72
+ removeFormat: 'i-mdi-format-clear',
73
+ formatting: 'i-mdi-format-color-text',
74
+ fontSize: 'i-mdi-format-size',
75
+ align: 'i-mdi-format-align-left',
76
+ hr: 'i-mdi-minus',
77
+ undo: 'i-mdi-undo',
78
+ redo: 'i-mdi-redo',
79
+ heading: 'i-mdi-format-size',
80
+ heading1: 'i-mdi-format-header-1',
81
+ heading2: 'i-mdi-format-header-2',
82
+ heading3: 'i-mdi-format-header-3',
83
+ heading4: 'i-mdi-format-header-4',
84
+ heading5: 'i-mdi-format-header-5',
85
+ heading6: 'i-mdi-format-header-6',
86
+ code: 'i-mdi-code-tags',
87
+ size: 'i-mdi-format-size',
88
+ size1: 'i-mdi-numeric-1-box',
89
+ size2: 'i-mdi-numeric-2-box',
90
+ size3: 'i-mdi-numeric-3-box',
91
+ size4: 'i-mdi-numeric-4-box',
92
+ size5: 'i-mdi-numeric-5-box',
93
+ size6: 'i-mdi-numeric-6-box',
94
+ size7: 'i-mdi-numeric-7-box',
95
+ font: 'i-mdi-format-font',
96
+ viewSource: 'i-mdi-code-tags'
97
+ },
98
+ expansionItem: {
99
+ icon: 'i-mdi-chevron-down',
100
+ denseIcon: 'i-mdi-menu-down'
101
+ },
102
+ fab: {
103
+ icon: 'i-mdi-plus',
104
+ activeIcon: 'i-mdi-close'
105
+ },
106
+ field: {
107
+ clear: 'i-mdi-close-circle',
108
+ error: 'i-mdi-alert-circle'
109
+ },
110
+ pagination: {
111
+ first: 'i-mdi-chevron-double-left',
112
+ prev: 'i-mdi-chevron-left',
113
+ next: 'i-mdi-chevron-right',
114
+ last: 'i-mdi-chevron-double-right'
115
+ },
116
+ rating: {
117
+ icon: 'i-mdi-star'
118
+ },
119
+ stepper: {
120
+ done: 'i-mdi-check',
121
+ active: 'i-mdi-pencil',
122
+ error: 'i-mdi-alert'
123
+ },
124
+ tabs: {
125
+ left: 'i-mdi-chevron-left',
126
+ right: 'i-mdi-chevron-right',
127
+ up: 'i-mdi-chevron-up',
128
+ down: 'i-mdi-chevron-down'
129
+ },
130
+ table: {
131
+ arrowUp: 'i-mdi-arrow-up',
132
+ warning: 'i-mdi-alert',
133
+ firstPage: 'i-mdi-chevron-double-left',
134
+ prevPage: 'i-mdi-chevron-left',
135
+ nextPage: 'i-mdi-chevron-right',
136
+ lastPage: 'i-mdi-chevron-double-right'
137
+ },
138
+ tree: {
139
+ icon: 'i-mdi-play'
140
+ },
141
+ uploader: {
142
+ done: 'i-mdi-check',
143
+ clear: 'i-mdi-close',
144
+ add: 'i-mdi-plus-box',
145
+ upload: 'i-mdi-cloud-upload',
146
+ removeQueue: 'i-mdi-notification-clear-all',
147
+ removeUploaded: 'i-mdi-check-all'
148
+ }
149
+ }
150
+
151
+ const quasarConf: QuasarPluginOptions = {
152
+ framework: {
153
+ plugins: ['Dialog', 'Notify', 'Loading', 'Meta'],
154
+ iconSet: iconifyJsonIconSet
155
+ },
156
+ /*
157
+ * Disable SASS if you use UnoCSS
158
+ */
159
+ disableSass: true
160
+ }
161
+
162
+ export default async function ({ mode, command }): Promise<VitrifyConfig> {
163
+ const env = loadEnv(mode, process.cwd(), '')
164
+ const config: VitrifyConfig = {
165
+ plugins: [QuasarComponentsPlugin()],
166
+ vitrify: {
167
+ plugins: [
168
+ {
169
+ plugin: QuasarPlugin,
170
+ options: quasarConf
171
+ }
172
+ ],
173
+ lang: env.VITE_LANG,
174
+ productName: 'Quasar MD3',
175
+ hooks: {
176
+ onSetup: []
177
+ },
178
+ ssr: {
179
+ serverModules: []
180
+ },
181
+ unocss: {
182
+ presets: [
183
+ QuasarPreset({
184
+ style: MaterialDesign3,
185
+ sourceColor: env.VITE_SOURCE_COLOR,
186
+ plugins: quasarConf['framework']['plugins'],
187
+ iconSet: quasarConf['framework']['iconSet']
188
+ })
189
+ ],
190
+ content: {
191
+ pipeline: {
192
+ include: [/@simsustech\/quasar-components/]
193
+ }
194
+ }
195
+ }
196
+ }
197
+ }
198
+ if (mode === 'development') {
199
+ config.server = {
200
+ https: await certificateFor('vitrify.local')
201
+ }
202
+ }
203
+ return config
204
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "recommendations": ["vue.volar", "dbaeumer.vscode-eslint"]
3
+ }
@@ -0,0 +1,3 @@
1
+ node_modules
2
+ dist
3
+ *.local
@@ -0,0 +1,3 @@
1
+ dist/
2
+ node_modules/
3
+ pnpm-lock.yaml
@@ -0,0 +1,22 @@
1
+ {
2
+ "semi": false,
3
+ "tabWidth": 2,
4
+ "singleQuote": true,
5
+ "printWidth": 80,
6
+ "trailingComma": "none",
7
+ "overrides": [
8
+ {
9
+ "files": ["*.json5"],
10
+ "options": {
11
+ "singleQuote": false,
12
+ "quoteProps": "preserve"
13
+ }
14
+ },
15
+ {
16
+ "files": ["*.yml"],
17
+ "options": {
18
+ "singleQuote": false
19
+ }
20
+ }
21
+ ]
22
+ }
@@ -0,0 +1,27 @@
1
+ import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
2
+ import pluginVue from 'eslint-plugin-vue'
3
+ import typescriptEslint from 'typescript-eslint'
4
+ import vueParser from 'vue-eslint-parser'
5
+
6
+ export default typescriptEslint.config(
7
+ ...typescriptEslint.configs.recommended,
8
+ ...pluginVue.configs['flat/recommended'],
9
+
10
+ {
11
+ files: ['**/*.vue'],
12
+ languageOptions: {
13
+ parser: vueParser,
14
+ parserOptions: {
15
+ sourceType: 'module',
16
+ parser: {
17
+ ts: typescriptEslint.parser
18
+ }
19
+ }
20
+ }
21
+ },
22
+
23
+ /**
24
+ * end
25
+ */
26
+ eslintPluginPrettierRecommended
27
+ )
@@ -0,0 +1,14 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <link rel="icon" href="/favicon.ico" />
7
+ <title></title>
8
+ </head>
9
+
10
+ <body>
11
+ <!-- A body opening and closing tag is sufficient for Vitrify -->
12
+ <div id="app"></div>
13
+ </body>
14
+ </html>
@@ -0,0 +1,3 @@
1
+ test('App', async () => {
2
+ expect(true).toBeTruthy()
3
+ })
@@ -0,0 +1,20 @@
1
+ <template>
2
+ <router-view v-slot="{ Component }">
3
+ <Suspense>
4
+ <template #default>
5
+ <component :is="Component" />
6
+ </template>
7
+ <template #fallback>
8
+ <div>Loading...</div>
9
+ </template>
10
+ </Suspense>
11
+ </router-view>
12
+ </template>
13
+
14
+ <script lang="ts">
15
+ export default {
16
+ name: 'App'
17
+ }
18
+ </script>
19
+
20
+ <script setup lang="ts"></script>
@@ -0,0 +1,9 @@
1
+ <template>Hello world!</template>
2
+
3
+ <script lang="ts">
4
+ export default {
5
+ name: 'HelloWorldComponent'
6
+ }
7
+ </script>
8
+
9
+ <script lang="ts" setup></script>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <router-view />
3
+ </template>
4
+
5
+ <script setup lang="ts"></script>
@@ -0,0 +1,9 @@
1
+ <template>404</template>
2
+
3
+ <scirpt lang="ts">
4
+ export default {
5
+ name: 'Error404Page'
6
+ }
7
+ </scirpt>
8
+
9
+ <script setup lang="ts"></script>
@@ -0,0 +1,13 @@
1
+ <template>
2
+ <hello-world> </hello-world>
3
+ </template>
4
+
5
+ <scirpt lang="ts">
6
+ export default {
7
+ name: 'IndexPage'
8
+ }
9
+ </scirpt>
10
+
11
+ <script setup lang="ts">
12
+ import HelloWorld from '../components/HelloWorld.vue'
13
+ </script>
@@ -0,0 +1,17 @@
1
+ import {
2
+ createMemoryHistory,
3
+ createRouter as _createRouter,
4
+ createWebHistory
5
+ } from 'vue-router'
6
+ import routes from './routes'
7
+
8
+ export default function createRouter() {
9
+ return _createRouter({
10
+ // use appropriate history implementation for server/client
11
+ // import.meta.env.SSR is injected by Vite.
12
+ history: import.meta.env.SSR
13
+ ? createMemoryHistory(__BASE_URL__)
14
+ : createWebHistory(__BASE_URL__),
15
+ routes
16
+ })
17
+ }
@@ -0,0 +1,19 @@
1
+ import { RouteRecordRaw } from 'vue-router'
2
+
3
+ const routes: RouteRecordRaw[] = [
4
+ {
5
+ path: '/',
6
+ component: () => import('../layouts/MainLayout.vue'),
7
+ children: [{ path: '', component: () => import('../pages/IndexPage.vue') }]
8
+ },
9
+
10
+ // Always leave this as last one,
11
+ // but you can also remove it
12
+ {
13
+ path: '/404',
14
+ alias: '/:catchAll(.*)*',
15
+ component: () => import('../pages/Error404Page.vue')
16
+ }
17
+ ]
18
+
19
+ export default routes
@@ -0,0 +1,9 @@
1
+ import type { FastifyInstance } from 'fastify'
2
+
3
+ /**
4
+ * Only used in SSR/SSG
5
+ */
6
+ export default async function (fastify: FastifyInstance) {
7
+ fastify.log('Running setup function...')
8
+ console.log('Running setup function...')
9
+ }
@@ -0,0 +1,6 @@
1
+ // Mocks all files ending in `.vue` showing them as plain Vue instances
2
+ declare module '*.vue' {
3
+ import type { ComponentOptions } from 'vue'
4
+ const component: ComponentOptions
5
+ export default component
6
+ }
@@ -0,0 +1,21 @@
1
+ import type { VitrifyConfig } from 'vitrify'
2
+ import { certificateFor } from 'devcert'
3
+
4
+ export default async function ({ mode, command }): Promise<VitrifyConfig> {
5
+ const config: VitrifyConfig = {
6
+ vitrify: {
7
+ hooks: {
8
+ onSetup: [new URL('src/setup.ts', import.meta.url)]
9
+ },
10
+ ssr: {
11
+ serverModules: []
12
+ }
13
+ }
14
+ }
15
+ if (mode === 'development') {
16
+ config.server = {
17
+ https: await certificateFor('vitrify.test')
18
+ }
19
+ }
20
+ return config
21
+ }
File without changes
@@ -1,19 +0,0 @@
1
- module.exports = {
2
- ignorePatterns: ['.eslintrc.cjs'],
3
- extends: [
4
- 'eslint:recommended',
5
- 'plugin:@typescript-eslint/recommended',
6
- 'plugin:vue/vue3-recommended',
7
- 'plugin:prettier-vue/recommended'
8
- ],
9
- parser: 'vue-eslint-parser',
10
- parserOptions: {
11
- parser: '@typescript-eslint/parser',
12
- sourceType: 'module'
13
- },
14
- rules: {
15
- '@typescript-eslint/ban-ts-comment': 0
16
- },
17
- plugins: ['@typescript-eslint'],
18
- root: true
19
- }