@dargmuesli/nuxt-cookie-control 2.0.0-beta.3 → 2.0.0-beta.5

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dargmuesli/nuxt-cookie-control",
3
- "version": "2.0.0-beta.3",
3
+ "version": "2.0.0-beta.5",
4
4
  "configKey": "cookieControl",
5
5
  "compatibility": {
6
6
  "nuxt": "^3.0.0"
package/dist/module.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { resolve } from 'path';
2
- import { createResolver, defineNuxtModule, addPlugin, addImports, addTemplate, isNuxt2, extendWebpackConfig } from '@nuxt/kit';
1
+ import { resolve } from 'node:path';
2
+ import { createResolver, defineNuxtModule, addPlugin, addImports, addTemplate, isNuxt2, extendWebpackConfig, resolvePath } from '@nuxt/kit';
3
3
 
4
4
 
5
5
 
@@ -11,7 +11,7 @@ const __filename = __cjs_url__.fileURLToPath(import.meta.url);
11
11
  const __dirname = __cjs_path__.dirname(__filename);
12
12
  const require = __cjs_mod__.createRequire(import.meta.url);
13
13
  const name = "@dargmuesli/nuxt-cookie-control";
14
- const version = "2.0.0-beta.3";
14
+ const version = "2.0.0-beta.5";
15
15
 
16
16
  const en = {
17
17
  acceptAll: "Accept all",
@@ -171,7 +171,7 @@ const loadLocales = async (moduleOptions) => {
171
171
  const locales = moduleOptions.locales;
172
172
  moduleOptions.locales = [];
173
173
  for (const locale of locales) {
174
- const text = await import(resolve(runtimeDir, "locale", `${locale}.ts`));
174
+ const text = await import(await resolvePath(resolve(runtimeDir, "locale", locale))).then((r) => r.default || r);
175
175
  if (!text)
176
176
  throw new Error(`Could not import text for locale ${locale}`);
177
177
  moduleOptions.locales.push(locale);
@@ -141,6 +141,7 @@
141
141
 
142
142
  <script setup lang="ts">
143
143
  import Cookies from 'js-cookie'
144
+ import { ref, computed, onBeforeMount } from 'vue'
144
145
 
145
146
  import { Cookie, CookieType, Locale, Translatable } from '../types'
146
147
  import {
@@ -150,6 +151,8 @@ import {
150
151
  useResolveTranslatable,
151
152
  } from '../methods'
152
153
 
154
+ import { useCookieControl } from '#imports'
155
+
153
156
  export interface Props {
154
157
  locale?: Locale
155
158
  }
@@ -15,9 +15,13 @@
15
15
  </template>
16
16
 
17
17
  <script setup lang="ts">
18
+ import { computed } from 'vue'
19
+
18
20
  import { LOCALE_DEFAULT } from '../constants'
19
21
  import { Locale } from '../types'
20
22
 
23
+ import { useCookieControl } from '#imports'
24
+
21
25
  export interface Props {
22
26
  locale?: Locale
23
27
  }
@@ -1 +1,2 @@
1
+ import { useNuxtApp } from "#imports";
1
2
  export const useCookieControl = () => useNuxtApp().$cookies;
@@ -1,4 +1,6 @@
1
+ import { ref } from "vue";
1
2
  import { setConsent } from "./methods.mjs";
3
+ import { defineNuxtPlugin } from "#imports";
2
4
  import moduleOptions from "#build/cookie-control-options";
3
5
  export default defineNuxtPlugin((_nuxtApp) => {
4
6
  const isConsentGiven = ref();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dargmuesli/nuxt-cookie-control",
3
- "version": "2.0.0-beta.3",
3
+ "version": "2.0.0-beta.5",
4
4
  "description": "Nuxt Cookies Control Module",
5
5
  "author": "Dario Ferderber <dario.ferderber@broj42.com>",
6
6
  "maintainers": [
@@ -29,9 +29,9 @@
29
29
  "src/locale"
30
30
  ],
31
31
  "scripts": {
32
- "prepack": "nuxt-module-build",
32
+ "prepack": "nuxt-module-build --stub && nuxi prepare playground && nuxt-module-build",
33
33
  "dev": "nuxi dev playground",
34
- "prepare": "nuxi prepare playground",
34
+ "dev:prepare": "nuxt-module-build --stub && nuxi prepare playground",
35
35
  "dev:build": "nuxi build playground",
36
36
  "lint": "eslint --ext .js,.ts,.vue . && nuxi typecheck playground"
37
37
  },