vitrify 0.3.0 → 0.4.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 (36) hide show
  1. package/dist/app-urls.js +1 -1
  2. package/dist/bin/cli.js +26 -4
  3. package/dist/bin/dev.js +59 -27
  4. package/dist/frameworks/vue/fastify-ssr-plugin.js +67 -16
  5. package/dist/frameworks/vue/server.js +9 -4
  6. package/dist/helpers/collect-css-ssr.js +57 -0
  7. package/dist/index.js +255 -69
  8. package/dist/plugins/quasar.js +9 -4
  9. package/dist/types/bin/build.d.ts +2 -2
  10. package/dist/types/bin/dev.d.ts +39 -3
  11. package/dist/types/frameworks/vue/fastify-ssr-plugin.d.ts +6 -3
  12. package/dist/types/frameworks/vue/server.d.ts +9 -5
  13. package/dist/types/helpers/collect-css-ssr.d.ts +10 -0
  14. package/dist/types/helpers/routes.d.ts +1 -1
  15. package/dist/types/index.d.ts +1 -1
  16. package/dist/types/plugins/index.d.ts +1 -1
  17. package/dist/types/vitrify-config.d.ts +3 -4
  18. package/package.json +32 -32
  19. package/src/node/app-urls.ts +1 -1
  20. package/src/node/bin/build.ts +2 -2
  21. package/src/node/bin/cli.ts +33 -5
  22. package/src/node/bin/dev.ts +92 -34
  23. package/src/node/frameworks/vue/fastify-ssr-plugin.ts +80 -18
  24. package/src/node/frameworks/vue/server.ts +22 -8
  25. package/src/node/helpers/collect-css-ssr.ts +77 -0
  26. package/src/node/index.ts +285 -81
  27. package/src/node/plugins/index.ts +1 -1
  28. package/src/node/plugins/quasar.ts +9 -4
  29. package/src/node/vitrify-config.ts +7 -4
  30. package/src/vite/fastify/entry.ts +11 -0
  31. package/src/vite/fastify/server.ts +10 -0
  32. package/src/vite/vue/index.html +1 -0
  33. package/src/vite/vue/main.ts +0 -1
  34. package/src/vite/vue/ssr/app.ts +25 -0
  35. package/src/vite/vue/ssr/entry-server.ts +13 -1
  36. package/src/vite/vue/ssr/server.ts +23 -14
@@ -1,18 +1,27 @@
1
- import { createApp } from '../../../node/frameworks/vue/server.js'
2
- import { getAppDir } from '../../../node/app-urls.js'
1
+ // import { createApp } from '../../../node/frameworks/vue/server.js'
2
+ // import { getAppDir } from '../../../node/app-urls.js'
3
3
  // import { setup } from 'virtual:fastify-setup'
4
- import { onRendered, setup } from 'virtual:vitrify-hooks'
5
-
4
+ // import { onRendered, onSetup } from 'virtual:vitrify-hooks'
5
+ // import { fastifySsrPlugin } from './fastify-ssr-plugin.js'
6
+ import { setupApp } from './app.js'
7
+ // import * as staticImports from 'virtual:static-imports'
6
8
  // const appDir = getPkgJsonDir(import.meta.url)
7
- const getString = (str?: string) => str
8
- let baseUrl = getString(__BASE_URL__)
9
- const appDir = getAppDir()
9
+ // const getString = (str?: string) => str
10
+ // let baseUrl = getString(__BASE_URL__)
11
+ // const appDir = getAppDir()
10
12
 
11
- const app = createApp({
12
- setup,
13
- appDir,
14
- baseUrl,
15
- onRendered
16
- })
13
+ // const app = createApp({
14
+ // onSetup,
15
+ // appDir,
16
+ // baseUrl,
17
+ // onRendered,
18
+ // fastifySsrPlugin,
19
+ // mode: import.meta.env.MODE
20
+ // })
17
21
 
18
- app.listen(process.env.PORT || 3000, process.env.HOST || '127.0.0.1')
22
+ const app = await setupApp()
23
+
24
+ app.listen({
25
+ port: Number(process.env.PORT || 3000),
26
+ host: process.env.HOST || '127.0.0.1'
27
+ })