vitrify 0.10.0 → 0.10.2
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/frameworks/vue/server.js +3 -1
- package/dist/index.js +23 -10
- package/package.json +21 -29
- package/src/node/frameworks/vue/server.ts +3 -1
- package/src/node/index.ts +27 -11
- package/src/vite/vue/main.ts +1 -3
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import fastify from 'fastify';
|
|
2
2
|
export const createApp = ({ onSetup, appDir, baseUrl, fastifyPlugin, onRendered, vitrifyDir, mode }) => {
|
|
3
3
|
const app = fastify({
|
|
4
|
-
logger:
|
|
4
|
+
logger: {
|
|
5
|
+
level: process.env.DEBUG ? 'debug' : process.env.PINO_LOG_LEVEL || 'info'
|
|
6
|
+
}
|
|
5
7
|
});
|
|
6
8
|
app.register(fastifyPlugin, {
|
|
7
9
|
baseUrl,
|
package/dist/index.js
CHANGED
|
@@ -214,7 +214,18 @@ export const baseConfig = async ({ ssr, appDir, publicDir, base = '/', command =
|
|
|
214
214
|
sassVariables = config.vitrify?.sass?.variables || {};
|
|
215
215
|
globalSass = config.vitrify?.sass?.global || [];
|
|
216
216
|
additionalData = config.vitrify?.sass?.additionalData || [];
|
|
217
|
-
return
|
|
217
|
+
return {
|
|
218
|
+
css: {
|
|
219
|
+
preprocessorOptions: {
|
|
220
|
+
sass: {
|
|
221
|
+
additionalData: [
|
|
222
|
+
...Object.entries(sassVariables).map(([key, value]) => `${key}: ${value}`),
|
|
223
|
+
...globalSass.map((sass) => `@import '${sass}'`)
|
|
224
|
+
].join('\n')
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
};
|
|
218
229
|
},
|
|
219
230
|
configureServer(server) {
|
|
220
231
|
server.middlewares.use('/', (req, res, next) => {
|
|
@@ -270,15 +281,17 @@ export const baseConfig = async ({ ssr, appDir, publicDir, base = '/', command =
|
|
|
270
281
|
})
|
|
271
282
|
.join('\n')}`;
|
|
272
283
|
}
|
|
273
|
-
else if (id === 'vitrify.sass') {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
284
|
+
// else if (id === 'vitrify.sass') {
|
|
285
|
+
// return [
|
|
286
|
+
// ...Object.entries(sassVariables).map(
|
|
287
|
+
// ([key, value]) => `${key}: ${value}`
|
|
288
|
+
// ),
|
|
289
|
+
// ...globalSass.map((sass) => `@import '${sass}'`)
|
|
290
|
+
// ].join('\n')
|
|
291
|
+
// }
|
|
292
|
+
// else if (id === 'vitrify.css') {
|
|
293
|
+
// return `${globalCss.map((css) => `@import '${css}'`).join('\n')}`
|
|
294
|
+
// }
|
|
282
295
|
else if (id === 'virtual:vitrify-config') {
|
|
283
296
|
return `export default ${JSON.stringify(vitrifyConfig)}`;
|
|
284
297
|
}
|
package/package.json
CHANGED
|
@@ -1,42 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitrify",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Stefan van Herwijnen",
|
|
6
6
|
"description": "Vite as your Full Stack development tool",
|
|
7
7
|
"type": "module",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
8
9
|
"bin": {
|
|
9
10
|
"vitrify": "./dist/bin/cli.js"
|
|
10
11
|
},
|
|
11
12
|
"exports": {
|
|
12
|
-
".":
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"./
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./build": {
|
|
18
|
+
"types": "./dist/types/bin/build.d.ts",
|
|
19
|
+
"import": "./dist/bin/build.js"
|
|
20
|
+
},
|
|
21
|
+
"./dev": {
|
|
22
|
+
"types": "./dist/types/bin/dev.d.ts",
|
|
23
|
+
"import": "./dist/bin/dev.js"
|
|
24
|
+
},
|
|
25
|
+
"./prerender": {
|
|
26
|
+
"types": "./dist/types/bin/prerender.d.ts",
|
|
27
|
+
"import": "./dist/bin/prerender.js"
|
|
28
|
+
},
|
|
17
29
|
"./helpers/*": "./dist/helpers/*.js",
|
|
18
|
-
"./
|
|
19
|
-
|
|
20
|
-
"typesVersions": {
|
|
21
|
-
"*": {
|
|
22
|
-
"*": [
|
|
23
|
-
"./dist/types/index.d.ts"
|
|
24
|
-
],
|
|
25
|
-
"helpers/*": [
|
|
26
|
-
"./dist/types/helpers/*.d.ts"
|
|
27
|
-
],
|
|
28
|
-
"build": [
|
|
29
|
-
"./dist/types/bin/build.d.ts"
|
|
30
|
-
],
|
|
31
|
-
"dev": [
|
|
32
|
-
"./dist/types/bin/dev.d.ts"
|
|
33
|
-
],
|
|
34
|
-
"prerender": [
|
|
35
|
-
"./dist/types/prerender.d.ts"
|
|
36
|
-
],
|
|
37
|
-
"help": [
|
|
38
|
-
"./dist/types/bin/help.d.ts"
|
|
39
|
-
]
|
|
30
|
+
"./client": {
|
|
31
|
+
"types": "./client.d.ts"
|
|
40
32
|
}
|
|
41
33
|
},
|
|
42
34
|
"engines": {
|
|
@@ -60,7 +52,7 @@
|
|
|
60
52
|
"@fastify/static": "^6.5.0",
|
|
61
53
|
"@quasar/extras": "^1.15.2",
|
|
62
54
|
"@vitejs/plugin-vue": "^3.1.0",
|
|
63
|
-
"@vitrify/plugin-env": "^0.1.
|
|
55
|
+
"@vitrify/plugin-env": "^0.1.1",
|
|
64
56
|
"builtin-modules": "^3.3.0",
|
|
65
57
|
"cac": "^6.7.14",
|
|
66
58
|
"chalk": "^5.0.1",
|
package/src/node/index.ts
CHANGED
|
@@ -286,7 +286,20 @@ export const baseConfig = async ({
|
|
|
286
286
|
sassVariables = config.vitrify?.sass?.variables || {}
|
|
287
287
|
globalSass = config.vitrify?.sass?.global || []
|
|
288
288
|
additionalData = config.vitrify?.sass?.additionalData || []
|
|
289
|
-
return
|
|
289
|
+
return {
|
|
290
|
+
css: {
|
|
291
|
+
preprocessorOptions: {
|
|
292
|
+
sass: {
|
|
293
|
+
additionalData: [
|
|
294
|
+
...Object.entries(sassVariables).map(
|
|
295
|
+
([key, value]) => `${key}: ${value}`
|
|
296
|
+
),
|
|
297
|
+
...globalSass.map((sass) => `@import '${sass}'`)
|
|
298
|
+
].join('\n')
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
290
303
|
},
|
|
291
304
|
configureServer(server) {
|
|
292
305
|
server.middlewares.use('/', (req, res, next) => {
|
|
@@ -338,16 +351,19 @@ export const baseConfig = async ({
|
|
|
338
351
|
return `export { ${deduped.join(',')} } from '${key}';`
|
|
339
352
|
})
|
|
340
353
|
.join('\n')}`
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
354
|
+
}
|
|
355
|
+
// else if (id === 'vitrify.sass') {
|
|
356
|
+
// return [
|
|
357
|
+
// ...Object.entries(sassVariables).map(
|
|
358
|
+
// ([key, value]) => `${key}: ${value}`
|
|
359
|
+
// ),
|
|
360
|
+
// ...globalSass.map((sass) => `@import '${sass}'`)
|
|
361
|
+
// ].join('\n')
|
|
362
|
+
// }
|
|
363
|
+
// else if (id === 'vitrify.css') {
|
|
364
|
+
// return `${globalCss.map((css) => `@import '${css}'`).join('\n')}`
|
|
365
|
+
// }
|
|
366
|
+
else if (id === 'virtual:vitrify-config') {
|
|
351
367
|
return `export default ${JSON.stringify(vitrifyConfig)}`
|
|
352
368
|
}
|
|
353
369
|
return null
|
package/src/vite/vue/main.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
// import 'vitrify.css'
|
|
2
|
-
import 'vitrify.sass'
|
|
3
|
-
import App from 'src/App.vue'
|
|
4
1
|
import createRouter from 'src/router'
|
|
5
2
|
import {
|
|
6
3
|
createSSRApp,
|
|
@@ -13,6 +10,7 @@ import {
|
|
|
13
10
|
import { onBoot, onMounted } from 'virtual:vitrify-hooks'
|
|
14
11
|
import routes from 'src/router/routes'
|
|
15
12
|
import * as staticImports from 'virtual:static-imports'
|
|
13
|
+
import App from 'src/App.vue'
|
|
16
14
|
|
|
17
15
|
interface ssrContext {
|
|
18
16
|
ssr: boolean
|