@icvdeveloper/common-module 0.0.13 → 0.0.15

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.d.ts CHANGED
@@ -3,6 +3,7 @@ import * as _nuxt_schema from '@nuxt/schema';
3
3
  interface ModuleOptions {
4
4
  portalHash?: null | string;
5
5
  apiUrl?: null | string;
6
+ tailwindConfigPath?: null | string;
6
7
  }
7
8
  declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
8
9
 
package/dist/module.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "0.0.13"
7
+ "version": "0.0.15"
8
8
  }
package/dist/module.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { resolve, join } from 'path';
1
+ import { join, resolve } from 'path';
2
2
  import { fileURLToPath } from 'url';
3
3
  import { defineNuxtModule, useLogger, installModule, addPlugin, addAutoImportDir, addComponentsDir } from '@nuxt/kit';
4
4
  import svgLoader from 'vite-svg-loader';
@@ -22,10 +22,12 @@ const module = defineNuxtModule({
22
22
  },
23
23
  defaults: {
24
24
  portalHash: null,
25
- apiUrl: null
25
+ apiUrl: null,
26
+ tailwindConfigPath: null
26
27
  },
27
28
  async setup(options, nuxt) {
28
29
  const logger = useLogger();
30
+ const runtimeDir = fileURLToPath(new URL("./runtime", import.meta.url));
29
31
  if (nuxt.options.ssr) {
30
32
  throw new Error("V3plusCommonModule does not support SSR");
31
33
  }
@@ -49,10 +51,19 @@ const module = defineNuxtModule({
49
51
  }
50
52
  if (!nuxt.options.modules.includes("@nuxtjs/tailwindcss")) {
51
53
  logger.info("Installing TailwindCss");
52
- await installModule("@nuxtjs/tailwindcss", {
53
- configPath: "../tailwind.config.cjs"
54
- });
54
+ const tailwindConfigPath = options.tailwindConfigPath;
55
+ const tailwindConfig = {};
56
+ if (tailwindConfig) {
57
+ tailwindConfig.configPath = tailwindConfigPath;
58
+ }
59
+ tailwindConfig.config = {
60
+ content: [join(runtimeDir, "components/**/*.{vue,js}")]
61
+ };
62
+ console.log(tailwindConfig);
63
+ await installModule("@nuxtjs/tailwindcss", tailwindConfig);
55
64
  logger.success("Tailwindcss installed!");
65
+ } else {
66
+ throw new Error("Remove @nuxtjs/tailwindcss from nuxt.config.js");
56
67
  }
57
68
  logger.info("Installing SVG loader");
58
69
  if (nuxt.options.vite.plugins) {
@@ -61,7 +72,6 @@ const module = defineNuxtModule({
61
72
  nuxt.options.vite.plugins = [svgLoader()];
62
73
  }
63
74
  logger.success("SVG loader installed!");
64
- const runtimeDir = fileURLToPath(new URL("./runtime", import.meta.url));
65
75
  nuxt.options.build.transpile.push(runtimeDir);
66
76
  addPlugin(resolve(runtimeDir, "plugin"));
67
77
  nuxt.options.css.push("nprogress/nprogress.css");
@@ -1,6 +1,5 @@
1
1
  <script lang="ts" setup>
2
2
  import { toRefs, computed } from "vue";
3
- import { storeToRefs } from "pinia";
4
3
  import { Conference } from "../../models/conference";
5
4
  import { useTemplateConfigsStore } from "../../store/templateConfigs";
6
5
  import { useConferencesStore } from "../../store/conferences";
@@ -13,8 +12,9 @@ interface Props {
13
12
 
14
13
  // Component Props
15
14
  const props = withDefaults(defineProps<Props>(), {
16
- useEventText: true,
17
- conference: undefined,
15
+ useEventText: () =>
16
+ useTemplateConfigsStore().pagesConfigValue("main.use_event_text"),
17
+ conference: () => useConferencesStore().currentConference,
18
18
  });
19
19
 
20
20
  // stores
@@ -24,12 +24,6 @@ const { globalConfigValue, pagesConfigValue } = useTemplateConfigsStore();
24
24
  // reactive data
25
25
  const { useEventText, conference } = toRefs(props);
26
26
 
27
- // default to current conference
28
- if (!conference.value) {
29
- conference.value = conferenceStore.currentConference;
30
- useEventText.value = pagesConfigValue("main.use_event_text");
31
- }
32
-
33
27
  // helper functions
34
28
  const {
35
29
  getConferenceDisplayDate,
@@ -1,8 +1,14 @@
1
- import { toRefs } from "vue";
1
+ import { toRefs, ref } from "vue";
2
2
  import { format } from "date-fns";
3
3
  import { get, find } from "lodash-es";
4
4
  import { storeToRefs } from "pinia";
5
+ import { useRoute } from "vue-router";
5
6
  import { ConferenceState } from "../models/conference.mjs";
7
+ import {
8
+ useTemplateConfigsStore,
9
+ useConferencesStore,
10
+ useAuthStore
11
+ } from "../store";
6
12
  import { useDateFormat } from "./useDateFormat.mjs";
7
13
  const getConferenceConfigMainValue = (_conference, _name) => {
8
14
  const configPages = get(_conference, "template_config.config.pages", []);
@@ -0,0 +1,7 @@
1
+ export * from "./affiliates";
2
+ export * from "./auth";
3
+ export * from "./conferences";
4
+ export * from "./navigationConfig";
5
+ export * from "./portal";
6
+ export * from "./support";
7
+ export * from "./templateConfigs";
@@ -0,0 +1,7 @@
1
+ export * from "./affiliates.mjs";
2
+ export * from "./auth.mjs";
3
+ export * from "./conferences.mjs";
4
+ export * from "./navigationConfig.mjs";
5
+ export * from "./portal.mjs";
6
+ export * from "./support.mjs";
7
+ export * from "./templateConfigs.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icvdeveloper/common-module",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {