@live-change/frontend-base 0.2.49 → 0.2.51

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 (3) hide show
  1. package/main.js +6 -2
  2. package/package.json +21 -18
  3. package/server-entry.js +22 -17
package/main.js CHANGED
@@ -16,6 +16,7 @@ import Ripple from 'primevue/ripple'
16
16
  import BadgeDirective from 'primevue/badgedirective'
17
17
  import VueLazyLoad from 'vue3-lazyload'
18
18
  import { createI18n } from 'vue-i18n'
19
+ import { createHead } from "@vueuse/head"
19
20
 
20
21
  // SSR requires a fresh app instance per request, therefore we export a function
21
22
  // that creates a fresh app instance. If using Vuex, we'd also be creating a
@@ -73,11 +74,14 @@ export async function createApp(config, api, App, createRouter, host, headers, r
73
74
  // options...
74
75
  })
75
76
 
76
- const meta = createMetaManager({
77
+ const meta = createMetaManager({ // TODO: remove this after switching to unhead
77
78
  isSSR
78
79
  })
79
80
  app.use(meta)
80
81
 
82
+ const head = createHead()
83
+ app.use(head)
84
+
81
85
  app.directive("focus", {
82
86
  mounted: (el) => el.focus(),
83
87
  updated: (el, binding) => app.nextTick(() => el.focus())
@@ -95,5 +99,5 @@ export async function createApp(config, api, App, createRouter, host, headers, r
95
99
  console.log("I18N MESSAGES", config.i18nMessages)
96
100
  app.use(i18n)
97
101
 
98
- return { app, router }
102
+ return { app, router, head }
99
103
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/frontend-base",
3
- "version": "0.2.49",
3
+ "version": "0.2.51",
4
4
  "scripts": {
5
5
  "memDev": "lcli memDev --enableSessions --initScript ./init.js --templatePath ../../base-frontend/index.html",
6
6
  "localDevInit": "rm tmp.db; lcli localDev --enableSessions --initScript ./init.js",
@@ -20,25 +20,27 @@
20
20
  "debug": "node --inspect-brk server"
21
21
  },
22
22
  "dependencies": {
23
- "@live-change/cli": "0.7.25",
24
- "@live-change/dao": "0.5.19",
25
- "@live-change/dao-message": "0.5.19",
26
- "@live-change/dao-sockjs": "0.5.19",
27
- "@live-change/dao-vue3": "0.5.19",
28
- "@live-change/dao-websocket": "0.5.19",
29
- "@live-change/email-service": "0.3.24",
30
- "@live-change/password-authentication-service": "0.3.24",
31
- "@live-change/secret-code-service": "0.3.24",
32
- "@live-change/secret-link-service": "0.3.24",
33
- "@live-change/security-frontend": "^0.2.49",
34
- "@live-change/session-service": "0.3.24",
35
- "@live-change/user-service": "0.3.24",
36
- "@live-change/vue3-components": "0.2.26",
37
- "@live-change/vue3-ssr": "0.2.26",
23
+ "@live-change/cli": "0.7.28",
24
+ "@live-change/dao": "0.5.20",
25
+ "@live-change/dao-message": "0.5.20",
26
+ "@live-change/dao-sockjs": "0.5.20",
27
+ "@live-change/dao-vue3": "0.5.20",
28
+ "@live-change/dao-websocket": "0.5.20",
29
+ "@live-change/email-service": "0.3.28",
30
+ "@live-change/password-authentication-service": "0.3.28",
31
+ "@live-change/secret-code-service": "0.3.28",
32
+ "@live-change/secret-link-service": "0.3.28",
33
+ "@live-change/security-frontend": "^0.2.51",
34
+ "@live-change/session-service": "0.3.28",
35
+ "@live-change/user-service": "0.3.28",
36
+ "@live-change/vue3-components": "0.2.28",
37
+ "@live-change/vue3-ssr": "0.2.28",
38
+ "@unhead/ssr": "^1.1.29",
38
39
  "@vitejs/plugin-vue": "^2.3.1",
39
40
  "@vitejs/plugin-vue-jsx": "^1.3.10",
40
41
  "@vue/compiler-sfc": "^3.2.37",
41
42
  "@vueuse/core": "^9.1.0",
43
+ "@vueuse/head": "^1.1.26",
42
44
  "codeceptjs-assert": "^0.0.5",
43
45
  "compression": "^1.7.4",
44
46
  "cross-env": "^7.0.3",
@@ -50,6 +52,7 @@
50
52
  "rollup-plugin-visualizer": "5.6.0",
51
53
  "serialize-javascript": "^6.0.0",
52
54
  "serve-static": "^1.15.0",
55
+ "unhead": "^1.1.29",
53
56
  "v-shared-element": "3.1.0",
54
57
  "vite-plugin-compression": "0.5.1",
55
58
  "vite-plugin-vue-images": "^0.6.1",
@@ -60,7 +63,7 @@
60
63
  "vue3-scroll-border": "0.1.5"
61
64
  },
62
65
  "devDependencies": {
63
- "@live-change/codeceptjs-helper": "0.7.25",
66
+ "@live-change/codeceptjs-helper": "0.7.28",
64
67
  "@wdio/selenium-standalone-service": "^7.20.8",
65
68
  "codeceptjs": "^3.3.4",
66
69
  "generate-password": "1.7.0",
@@ -72,5 +75,5 @@
72
75
  "author": "",
73
76
  "license": "BSD-3-Clause",
74
77
  "description": "",
75
- "gitHead": "a56fad95df95822fea9932ea0a003f450a31e38e"
78
+ "gitHead": "0fd9d72bb8a5fd8402244756d5ff023028dfcb6d"
76
79
  }
package/server-entry.js CHANGED
@@ -4,7 +4,9 @@ import { renderMetaToString } from 'vue-meta/ssr'
4
4
  import { serverApi } from '@live-change/vue3-ssr/serverApi.js'
5
5
 
6
6
  import { createApp } from "./main.js"
7
- import { setTime } from "./time.js";
7
+ import { setTime } from "./time.js"
8
+
9
+ import { renderHeadToString } from "@vueuse/head"
8
10
 
9
11
  function escapeHtml(unsafe) {
10
12
  return (''+unsafe)
@@ -33,7 +35,7 @@ export function serverEntry(App, createRouter, config = {}) {
33
35
  }
34
36
  }
35
37
 
36
- const { app, router } = await createApp(
38
+ const { app, router, head } = await createApp(
37
39
  config, api, App, createRouter, host, headers, response, url
38
40
  )
39
41
 
@@ -59,20 +61,23 @@ export function serverEntry(App, createRouter, config = {}) {
59
61
  // which we can then use to determine what files need to be preloaded for this
60
62
  // request.
61
63
 
62
- const metaManager = app.config.globalProperties.$metaManager
63
- const activeMeta = metaManager.target.context.active
64
- console.log("ACTIVE META", activeMeta)
65
- await renderMetaToString(app, ctx)
66
- ctx.teleports.head = [
67
- ...(activeMeta.title ? [`<title data-vm-ssr="true">${escapeHtml(activeMeta.title)}</title>`] : []),
68
- ...((activeMeta.meta || []).map(meta => `<meta ${Object.keys(meta).map(
69
- key => `${escapeHtml(key)}="${escapeHtml(meta[key])}"`
70
- ).join(' ')}>`)),
71
- ...((activeMeta.link || []).map(meta => `<link ${Object.keys(meta).map(
72
- key => `${escapeHtml(key)}="${escapeHtml(meta[key])}"`
73
- ).join(' ')}>`))
74
- ].join('\n')
75
-
76
- return {html, data, meta: ctx.teleports, modules: ctx.modules, response}
64
+ const renderedHead = await renderHeadToString(head)
65
+ console.log("HEAD", renderedHead)
66
+
67
+ const hed= {
68
+ headTags: '<title>IPI Swap</title>\n' +
69
+ '<link rel="icon" href="/icon/icon256.png" type="image/png" sizes="256x256">\n' +
70
+ '<link rel="icon" href="/icon/icon128.png" type="image/png" sizes="128x128">\n' +
71
+ '<link rel="icon" href="/icon/icon64.png" type="image/png" sizes="64x64">\n' +
72
+ '<link rel="icon" href="/icon/icon32.png" type="image/png" sizes="32x32">\n' +
73
+ '<link rel="icon" href="/icon/icon16.png" type="image/png" sizes="16x16">',
74
+ bodyTags: '',
75
+ bodyTagsOpen: '',
76
+ htmlAttrs: ' lang="en" amp=""',
77
+ bodyAttrs: ''
78
+ }
79
+
80
+
81
+ return {html, data, meta: renderedHead, modules: ctx.modules, response}
77
82
  }
78
83
  }