vitrify 0.17.15 → 0.17.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/cli.js +1 -3
- package/dist/frameworks/vue/fastify-csr-plugin.js +1 -1
- package/dist/frameworks/vue/fastify-ssr-plugin.js +3 -2
- package/dist/index.js +0 -2
- package/dist/plugins/quasar/unocss/core/typography.unocss.js +3 -1
- package/dist/plugins/quasar/unocss/index.js +0 -4
- package/dist/plugins/quasar/unocss/theme.js +3 -0
- package/dist/plugins/quasar.js +7 -7
- package/dist/types/plugins/quasar/unocss/theme.d.ts +3 -0
- package/package.json +8 -6
- package/src/node/bin/cli.ts +1 -2
- package/src/node/frameworks/vue/fastify-csr-plugin.ts +1 -1
- package/src/node/frameworks/vue/fastify-ssr-plugin.ts +2 -2
- package/src/node/index.ts +1 -2
- package/src/node/plugins/quasar/unocss/core/typography.unocss.ts +3 -1
- package/src/node/plugins/quasar/unocss/index.ts +0 -4
- package/src/node/plugins/quasar/unocss/theme.ts +7 -0
- package/src/node/plugins/quasar.ts +6 -7
- package/src/vite/vue/csr/app.ts +1 -1
- package/src/vite/vue/index.html +1 -1
- package/src/vite/vue/main.ts +5 -4
- package/src/vite/vue/ssr/app.ts +1 -2
- package/src/vite/vue/ssr/entry-server.ts +1 -1
package/dist/bin/cli.js
CHANGED
|
@@ -71,9 +71,7 @@ cli
|
|
|
71
71
|
...args,
|
|
72
72
|
outDir: fileURLToPath(new URL('ssr/server/', baseOutDir))
|
|
73
73
|
});
|
|
74
|
-
({ prerender, onRendered } = await import(
|
|
75
|
-
// @ts-ignore
|
|
76
|
-
new URL('ssr/server/prerender.mjs', baseOutDir)));
|
|
74
|
+
({ prerender, onRendered } = await import(new URL('ssr/server/prerender.mjs', baseOutDir).pathname));
|
|
77
75
|
// ;({ prerender, onRendered } = await import(
|
|
78
76
|
// fileURLToPath(new URL('ssr/server/prerender.mjs', baseOutDir))
|
|
79
77
|
// ))
|
|
@@ -21,7 +21,7 @@ const fastifyCsrPlugin = async (fastify, options) => {
|
|
|
21
21
|
console.log('Dev mode');
|
|
22
22
|
if (!('use' in fastify)) {
|
|
23
23
|
const middie = (await import('@fastify/middie')).default;
|
|
24
|
-
// @ts-
|
|
24
|
+
// @ts-expect-error undefined
|
|
25
25
|
await fastify.register(middie);
|
|
26
26
|
}
|
|
27
27
|
fastify.use(vite.middlewares);
|
|
@@ -24,7 +24,7 @@ const fastifySsrPlugin = async (fastify, options) => {
|
|
|
24
24
|
});
|
|
25
25
|
if (!('use' in fastify)) {
|
|
26
26
|
const middie = (await import('@fastify/middie')).default;
|
|
27
|
-
// @ts-
|
|
27
|
+
// @ts-expect-error undefined
|
|
28
28
|
await fastify.register(middie);
|
|
29
29
|
}
|
|
30
30
|
fastify.use(vite.middlewares);
|
|
@@ -89,7 +89,8 @@ const fastifySsrPlugin = async (fastify, options) => {
|
|
|
89
89
|
}
|
|
90
90
|
catch (e) {
|
|
91
91
|
console.error(e.stack);
|
|
92
|
-
|
|
92
|
+
if (vite)
|
|
93
|
+
vite.ssrFixStacktrace(e);
|
|
93
94
|
res.code(500);
|
|
94
95
|
res.send(e.stack);
|
|
95
96
|
}
|
package/dist/index.js
CHANGED
|
@@ -167,7 +167,6 @@ export const baseConfig = async ({ ssr, appDir, publicDir, base = '/', command =
|
|
|
167
167
|
const configPath = fileURLToPath(new URL('vitrify.config.ts', appDir));
|
|
168
168
|
const bundledConfig = await bundleConfigFile(fileURLToPath(new URL('vitrify.config.ts', appDir)));
|
|
169
169
|
fs.writeFileSync(configPath + '.js', bundledConfig.code);
|
|
170
|
-
// @ts-ignore
|
|
171
170
|
rawVitrifyConfig = (await import('file://' + configPath + '.js')).default;
|
|
172
171
|
// vitrifyConfig = (await import(configPath + '.js')).default
|
|
173
172
|
fs.unlinkSync(configPath + '.js');
|
|
@@ -457,7 +456,6 @@ export const baseConfig = async ({ ssr, appDir, publicDir, base = '/', command =
|
|
|
457
456
|
// }
|
|
458
457
|
// }
|
|
459
458
|
// })
|
|
460
|
-
// @ts-ignore
|
|
461
459
|
if (debug)
|
|
462
460
|
plugins.push(visualizer());
|
|
463
461
|
}
|
|
@@ -4,7 +4,7 @@ const preflights = [
|
|
|
4
4
|
body {
|
|
5
5
|
min-width: 100px;
|
|
6
6
|
min-height: 100%;
|
|
7
|
-
font-family:
|
|
7
|
+
font-family: ${theme.typography.fontFamily};
|
|
8
8
|
-ms-text-size-adjust: 100%;
|
|
9
9
|
-webkit-text-size-adjust: 100%;
|
|
10
10
|
-webkit-font-smoothing: antialiased;
|
|
@@ -12,6 +12,8 @@ body {
|
|
|
12
12
|
font-smoothing: antialiased;
|
|
13
13
|
line-height: 1.5;
|
|
14
14
|
font-size: 14px;
|
|
15
|
+
margin: 0;
|
|
16
|
+
box-sizing: border-box
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
h1 {
|
|
@@ -1772,10 +1772,6 @@ textarea {
|
|
|
1772
1772
|
margin: 0;
|
|
1773
1773
|
}
|
|
1774
1774
|
|
|
1775
|
-
html, body
|
|
1776
|
-
margin: 0
|
|
1777
|
-
box-sizing: border-box
|
|
1778
|
-
|
|
1779
1775
|
/* beasties:include end */`
|
|
1780
1776
|
}
|
|
1781
1777
|
].concat(QBreadcrumbsPreflights, QCheckboxPreflights, QChipPreflights, QCircularProgressPreflights, QDialogPreflights, QFieldPreflights, QLayoutPreflights, QLinearProgressPreflights, QRadioPreflights, QSelectPreflights, QSpinnerPreflights, QSkeletonPreflights, QTablePreflights, QTogglePreflights, QTreePreflights, ColorPreflights, DarkPreflights, HelperPreflights, MousePreflights, TypographyPreflights, VisibilityPreflights, TransitionPreflights, SizePreflights),
|
package/dist/plugins/quasar.js
CHANGED
|
@@ -59,23 +59,23 @@ export const QuasarPlugin = async ({ ssr = false, pwa = false }) => {
|
|
|
59
59
|
})();
|
|
60
60
|
const onMountedHooks = [
|
|
61
61
|
async (instance) => {
|
|
62
|
-
// @ts-ignore
|
|
63
62
|
const { proxy: { $q } } = instance;
|
|
64
|
-
$q.onSSRHydrated !== void 0
|
|
63
|
+
if ($q.onSSRHydrated !== void 0)
|
|
64
|
+
$q.onSSRHydrated();
|
|
65
65
|
}
|
|
66
66
|
];
|
|
67
67
|
const onBootHooks = [
|
|
68
68
|
async ({ app, ssrContext, staticImports }) => {
|
|
69
|
-
// @ts-
|
|
69
|
+
// @ts-expect-error undefined
|
|
70
70
|
const quasarPlugins = await import('virtual:quasar-plugins');
|
|
71
|
-
// @ts-
|
|
71
|
+
// @ts-expect-error undefined
|
|
72
72
|
const directives = await import('virtual:quasar-directives');
|
|
73
|
-
// @ts-
|
|
73
|
+
// @ts-expect-error undefined
|
|
74
74
|
const { default: lang } = await import('virtual:quasar-lang');
|
|
75
|
-
// @ts-
|
|
75
|
+
// @ts-expect-error undefined
|
|
76
76
|
const { default: iconSet } = await import('virtual:quasar-iconSet');
|
|
77
77
|
const { default: iconMapFn } = await import(
|
|
78
|
-
// @ts-
|
|
78
|
+
// @ts-expect-error undefined
|
|
79
79
|
'virtual:quasar-iconMapFn');
|
|
80
80
|
app.use(staticImports?.Quasar, {
|
|
81
81
|
plugins: quasarPlugins,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitrify",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.17",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Stefan van Herwijnen",
|
|
6
6
|
"description": "Vite as your Full Stack development tool",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"homepage": "https://github.com/simsustech/vitrify/tree/main/#readme",
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@fastify/middie": "^9.0.3",
|
|
48
|
-
"@fastify/static": "^8.0
|
|
48
|
+
"@fastify/static": "^8.1.0",
|
|
49
49
|
"@unocss/core": "^65.4.3",
|
|
50
50
|
"@unocss/preset-uno": "^65.4.3",
|
|
51
51
|
"@unocss/preset-wind": "^65.4.3",
|
|
@@ -71,16 +71,18 @@
|
|
|
71
71
|
"vite": "^6.0.11",
|
|
72
72
|
"vite-plugin-pwa": "^0.21.1",
|
|
73
73
|
"vitefu": "^1.0.5",
|
|
74
|
-
"vitest": "^3.0.
|
|
74
|
+
"vitest": "^3.0.5",
|
|
75
75
|
"workbox-window": "^7.3.0"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@iconify-json/mdi": "^1.2.3",
|
|
79
79
|
"@quasar/extras": "^1.16.16",
|
|
80
|
+
"@quasar/quasar-ui-qmarkdown": "^2.0.4",
|
|
81
|
+
"@quasar/quasar-ui-qmediaplayer": "^2.0.0-beta.0",
|
|
80
82
|
"@types/connect": "^3.4.38",
|
|
81
83
|
"@types/glob": "^8.1.0",
|
|
82
84
|
"@types/merge-deep": "^3.0.3",
|
|
83
|
-
"@types/node": "^22.13.
|
|
85
|
+
"@types/node": "^22.13.1",
|
|
84
86
|
"@types/ws": "^8.5.14",
|
|
85
87
|
"@unocss/preset-icons": "^65.4.3",
|
|
86
88
|
"@vue/runtime-core": "^3.5.13",
|
|
@@ -88,13 +90,13 @@
|
|
|
88
90
|
"css": "^3.0.0",
|
|
89
91
|
"css-to-tailwind-translator": "^1.2.8",
|
|
90
92
|
"quasar": "^2.17.7",
|
|
91
|
-
"rollup": "^4.34.
|
|
93
|
+
"rollup": "^4.34.2",
|
|
92
94
|
"typescript": "^5.7.3",
|
|
93
95
|
"vue": "^3.5.13",
|
|
94
96
|
"vue-router": "^4.5.0"
|
|
95
97
|
},
|
|
96
98
|
"peerDependencies": {
|
|
97
|
-
"@fastify/static": "^8.0
|
|
99
|
+
"@fastify/static": "^8.1.0",
|
|
98
100
|
"fastify": "^5.2.1",
|
|
99
101
|
"quasar": "^2.17.7",
|
|
100
102
|
"vue": "^3.5.13",
|
package/src/node/bin/cli.ts
CHANGED
|
@@ -84,8 +84,7 @@ cli
|
|
|
84
84
|
outDir: fileURLToPath(new URL('ssr/server/', baseOutDir))
|
|
85
85
|
})
|
|
86
86
|
;({ prerender, onRendered } = await import(
|
|
87
|
-
|
|
88
|
-
new URL('ssr/server/prerender.mjs', baseOutDir)
|
|
87
|
+
new URL('ssr/server/prerender.mjs', baseOutDir).pathname
|
|
89
88
|
))
|
|
90
89
|
|
|
91
90
|
// ;({ prerender, onRendered } = await import(
|
|
@@ -46,7 +46,7 @@ const fastifyCsrPlugin: FastifyPluginAsync<FastifySsrOptions> = async (
|
|
|
46
46
|
console.log('Dev mode')
|
|
47
47
|
if (!('use' in fastify)) {
|
|
48
48
|
const middie = (await import('@fastify/middie')).default
|
|
49
|
-
// @ts-
|
|
49
|
+
// @ts-expect-error undefined
|
|
50
50
|
await fastify.register(middie)
|
|
51
51
|
}
|
|
52
52
|
fastify.use(vite.middlewares)
|
|
@@ -56,7 +56,7 @@ const fastifySsrPlugin: FastifyPluginAsync<FastifySsrOptions> = async (
|
|
|
56
56
|
|
|
57
57
|
if (!('use' in fastify)) {
|
|
58
58
|
const middie = (await import('@fastify/middie')).default
|
|
59
|
-
// @ts-
|
|
59
|
+
// @ts-expect-error undefined
|
|
60
60
|
await fastify.register(middie)
|
|
61
61
|
}
|
|
62
62
|
fastify.use(vite.middlewares)
|
|
@@ -138,7 +138,7 @@ const fastifySsrPlugin: FastifyPluginAsync<FastifySsrOptions> = async (
|
|
|
138
138
|
// res.status(200).set({ 'Content-Type': 'text/html' }).end(html)
|
|
139
139
|
} catch (e: any) {
|
|
140
140
|
console.error(e.stack)
|
|
141
|
-
vite
|
|
141
|
+
if (vite) vite.ssrFixStacktrace(e)
|
|
142
142
|
res.code(500)
|
|
143
143
|
res.send(e.stack)
|
|
144
144
|
}
|
package/src/node/index.ts
CHANGED
|
@@ -238,7 +238,7 @@ export const baseConfig = async ({
|
|
|
238
238
|
fileURLToPath(new URL('vitrify.config.ts', appDir))
|
|
239
239
|
)
|
|
240
240
|
fs.writeFileSync(configPath + '.js', bundledConfig.code)
|
|
241
|
-
|
|
241
|
+
|
|
242
242
|
rawVitrifyConfig = (await import('file://' + configPath + '.js')).default
|
|
243
243
|
// vitrifyConfig = (await import(configPath + '.js')).default
|
|
244
244
|
fs.unlinkSync(configPath + '.js')
|
|
@@ -561,7 +561,6 @@ export const baseConfig = async ({
|
|
|
561
561
|
// }
|
|
562
562
|
// })
|
|
563
563
|
|
|
564
|
-
// @ts-ignore
|
|
565
564
|
if (debug) plugins.push(visualizer())
|
|
566
565
|
}
|
|
567
566
|
|
|
@@ -7,7 +7,7 @@ const preflights: Preflight<QuasarTheme>[] = [
|
|
|
7
7
|
body {
|
|
8
8
|
min-width: 100px;
|
|
9
9
|
min-height: 100%;
|
|
10
|
-
font-family:
|
|
10
|
+
font-family: ${theme.typography.fontFamily};
|
|
11
11
|
-ms-text-size-adjust: 100%;
|
|
12
12
|
-webkit-text-size-adjust: 100%;
|
|
13
13
|
-webkit-font-smoothing: antialiased;
|
|
@@ -15,6 +15,8 @@ body {
|
|
|
15
15
|
font-smoothing: antialiased;
|
|
16
16
|
line-height: 1.5;
|
|
17
17
|
font-size: 14px;
|
|
18
|
+
margin: 0;
|
|
19
|
+
box-sizing: border-box
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
h1 {
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export interface QuasarTheme {
|
|
2
|
+
typography: {
|
|
3
|
+
fontFamily: string
|
|
4
|
+
}
|
|
2
5
|
breakpoints: {
|
|
3
6
|
xs: string
|
|
4
7
|
sm: string
|
|
@@ -1145,6 +1148,10 @@ export interface QuasarTheme {
|
|
|
1145
1148
|
}
|
|
1146
1149
|
|
|
1147
1150
|
const defaultTheme: QuasarTheme = {
|
|
1151
|
+
typography: {
|
|
1152
|
+
fontFamily:
|
|
1153
|
+
'"Roboto", "-apple-system", "Helvetica Neue", Helvetica, Arial, sans-serif'
|
|
1154
|
+
},
|
|
1148
1155
|
breakpoints: {
|
|
1149
1156
|
xs: '0',
|
|
1150
1157
|
sm: '600px',
|
|
@@ -131,26 +131,25 @@ export const QuasarPlugin: VitrifyPlugin = async ({
|
|
|
131
131
|
|
|
132
132
|
const onMountedHooks: OnMountedHook[] = [
|
|
133
133
|
async (instance) => {
|
|
134
|
-
// @ts-ignore
|
|
135
134
|
const {
|
|
136
135
|
proxy: { $q }
|
|
137
136
|
} = instance
|
|
138
|
-
$q.onSSRHydrated !== void 0
|
|
137
|
+
if ($q.onSSRHydrated !== void 0) $q.onSSRHydrated()
|
|
139
138
|
}
|
|
140
139
|
]
|
|
141
140
|
|
|
142
141
|
const onBootHooks: OnBootHook[] = [
|
|
143
142
|
async ({ app, ssrContext, staticImports }) => {
|
|
144
|
-
// @ts-
|
|
143
|
+
// @ts-expect-error undefined
|
|
145
144
|
const quasarPlugins = await import('virtual:quasar-plugins')
|
|
146
|
-
// @ts-
|
|
145
|
+
// @ts-expect-error undefined
|
|
147
146
|
const directives = await import('virtual:quasar-directives')
|
|
148
|
-
// @ts-
|
|
147
|
+
// @ts-expect-error undefined
|
|
149
148
|
const { default: lang } = await import('virtual:quasar-lang')
|
|
150
|
-
// @ts-
|
|
149
|
+
// @ts-expect-error undefined
|
|
151
150
|
const { default: iconSet } = await import('virtual:quasar-iconSet')
|
|
152
151
|
const { default: iconMapFn } = await import(
|
|
153
|
-
// @ts-
|
|
152
|
+
// @ts-expect-error undefined
|
|
154
153
|
'virtual:quasar-iconMapFn'
|
|
155
154
|
)
|
|
156
155
|
|
package/src/vite/vue/csr/app.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type { ViteDevServer } from 'vite'
|
|
|
7
7
|
|
|
8
8
|
// const appDir = getPkgJsonDir(import.meta.url)
|
|
9
9
|
const getString = (str?: string) => str
|
|
10
|
-
|
|
10
|
+
const baseUrl = getString(__BASE_URL__)
|
|
11
11
|
const appDir = getAppDir()
|
|
12
12
|
|
|
13
13
|
export const setupApp = async () => {
|
package/src/vite/vue/index.html
CHANGED
package/src/vite/vue/main.ts
CHANGED
|
@@ -46,14 +46,14 @@ export async function createApp(
|
|
|
46
46
|
provide = ssrContext?.provide
|
|
47
47
|
}
|
|
48
48
|
} else {
|
|
49
|
-
// @ts-
|
|
49
|
+
// @ts-expect-error undefined
|
|
50
50
|
if (window.__INITIAL_STATE__) {
|
|
51
|
-
// @ts-
|
|
51
|
+
// @ts-expect-error undefined
|
|
52
52
|
initialState = JSON.parse(window.__INITIAL_STATE__)
|
|
53
53
|
provide = initialState.provide
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
for (
|
|
56
|
+
for (const key in provide) {
|
|
57
57
|
if (provide[key]?.value) {
|
|
58
58
|
const refValue = ref(provide[key].value)
|
|
59
59
|
app.provide(key, refValue)
|
|
@@ -66,11 +66,12 @@ export async function createApp(
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
for (
|
|
69
|
+
for (const fn of onBoot) {
|
|
70
70
|
await fn({ app, ssrContext, staticImports })
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
// @vitrify-pwa-only
|
|
74
|
+
// @ts-expect-error undefined
|
|
74
75
|
if (__IS_PWA__) {
|
|
75
76
|
if (typeof window !== 'undefined') {
|
|
76
77
|
const { registerPWA } = await import('./pwa.js')
|
package/src/vite/vue/ssr/app.ts
CHANGED
|
@@ -2,10 +2,9 @@ import { createApp } from '../../../node/frameworks/vue/server.js'
|
|
|
2
2
|
import { getAppDir } from '../../../node/app-urls.js'
|
|
3
3
|
import { onSetup, onRendered } from 'virtual:vitrify-hooks'
|
|
4
4
|
import { fastifySsrPlugin } from './fastify-ssr-plugin.js'
|
|
5
|
-
import type { ViteDevServer } from 'vite'
|
|
6
5
|
|
|
7
6
|
const getString = (str?: string) => str
|
|
8
|
-
|
|
7
|
+
const baseUrl = getString(__BASE_URL__)
|
|
9
8
|
const appDir = getAppDir()
|
|
10
9
|
|
|
11
10
|
export const setupApp = async () => {
|
|
@@ -41,7 +41,7 @@ export async function render(url, manifest, ssrContext, renderToString) {
|
|
|
41
41
|
const ctx = {
|
|
42
42
|
__qMetaList: []
|
|
43
43
|
}
|
|
44
|
-
|
|
44
|
+
const html = await renderToString(app, ctx)
|
|
45
45
|
|
|
46
46
|
const preloadLinks = renderPreloadLinks(ctx.modules, manifest)
|
|
47
47
|
|