@icvdeveloper/common-module 0.0.5 → 0.0.7

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/module.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "0.0.5"
7
+ "version": "0.0.7"
8
8
  }
package/dist/module.mjs CHANGED
@@ -66,6 +66,13 @@ const module = defineNuxtModule({
66
66
  addPlugin(resolve(runtimeDir, "plugin"));
67
67
  nuxt.options.css.push("nprogress/nprogress.css");
68
68
  nuxt.options.css.push(join(runtimeDir, "assets/scss/index.scss"));
69
+ if (nuxt.options.vite.optimizeDeps) {
70
+ nuxt.options.vite.optimizeDeps.include = ["nprogress"];
71
+ } else {
72
+ nuxt.options.vite.optimizeDeps = {
73
+ include: ["nprogress"]
74
+ };
75
+ }
69
76
  addAutoImportDir(join(runtimeDir, "store"));
70
77
  addComponentsDir({
71
78
  path: join(runtimeDir, "components/core"),
@@ -1,8 +1,10 @@
1
1
  import { defineNuxtPlugin } from "#app";
2
2
  import { computed } from "vue";
3
3
  import { storeToRefs } from "pinia";
4
+ import NProgress from "nprogress";
4
5
  import { createV3plusCommonPlugin } from "./v3plusCommonPlugin.mjs";
5
6
  import { usePortalStore } from "./store/portal.mjs";
7
+ import { useConferencesStore } from "./store/conferences.mjs";
6
8
  export default defineNuxtPlugin((nuxtApp) => {
7
9
  const { version, portalHash, apiUrl } = nuxtApp.payload.config.public.v3plusCommonModule;
8
10
  const v3plusCommonModule = createV3plusCommonPlugin({
@@ -10,6 +12,24 @@ export default defineNuxtPlugin((nuxtApp) => {
10
12
  portalHash,
11
13
  apiUrl
12
14
  });
15
+ nuxtApp.$router.beforeEach(async (to, from) => {
16
+ NProgress.start();
17
+ const portalStore = usePortalStore();
18
+ const conferencesStore = useConferencesStore();
19
+ const { data: portal, errors: portalErrors } = storeToRefs(
20
+ usePortalStore()
21
+ );
22
+ if (portal.value === null) {
23
+ Promise.all([
24
+ await portalStore.getPortal().then(() => NProgress.inc()),
25
+ await conferencesStore.getConferences().then(() => NProgress.inc()),
26
+ await conferencesStore.getCurrentConference().then(() => NProgress.inc())
27
+ ]);
28
+ }
29
+ });
30
+ nuxtApp.$router.afterEach(() => {
31
+ NProgress.done();
32
+ });
13
33
  nuxtApp.hook("app:created", (app) => {
14
34
  const { data } = storeToRefs(usePortalStore());
15
35
  if (data.value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icvdeveloper/common-module",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {