@dargmuesli/nuxt-cookie-control 8.2.3 → 8.3.3

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.mts CHANGED
@@ -58,4 +58,10 @@ interface ModuleOptions {
58
58
 
59
59
  declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
60
60
 
61
+ declare module '@nuxt/schema' {
62
+ interface PublicRuntimeConfig {
63
+ cookieControl: ModuleOptions;
64
+ }
65
+ }
66
+
61
67
  export { _default as default };
package/dist/module.d.ts CHANGED
@@ -58,4 +58,10 @@ interface ModuleOptions {
58
58
 
59
59
  declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
60
60
 
61
+ declare module '@nuxt/schema' {
62
+ interface PublicRuntimeConfig {
63
+ cookieControl: ModuleOptions;
64
+ }
65
+ }
66
+
61
67
  export { _default as default };
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dargmuesli/nuxt-cookie-control",
3
- "version": "8.2.3",
3
+ "version": "8.3.3",
4
4
  "configKey": "cookieControl",
5
5
  "compatibility": {
6
6
  "nuxt": "^3.0.0"
package/dist/module.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import { resolve } from 'node:path';
2
2
  import { pathToFileURL } from 'node:url';
3
3
  import { createResolver, defineNuxtModule, addPlugin, addImports, addTypeTemplate, updateTemplates, extendWebpackConfig, extendViteConfig, resolvePath } from '@nuxt/kit';
4
+ import { defu } from 'defu';
4
5
 
5
6
  const CONFIG_KEY = "cookieControl";
6
7
 
@@ -121,7 +122,7 @@ const DEFAULTS = {
121
122
  };
122
123
 
123
124
  const name = "@dargmuesli/nuxt-cookie-control";
124
- const version = "8.2.3";
125
+ const version = "8.3.3";
125
126
 
126
127
  const resolver = createResolver(import.meta.url);
127
128
  const runtimeDir = resolver.resolve("./runtime");
@@ -166,6 +167,12 @@ const module = defineNuxtModule({
166
167
  });
167
168
  }
168
169
  });
170
+ nuxt.hook("modules:done", async () => {
171
+ nuxt.options.runtimeConfig.public.cookieControl = defu(
172
+ nuxt.options.runtimeConfig.public.cookieControl,
173
+ moduleOptions
174
+ );
175
+ });
169
176
  }
170
177
  });
171
178
  const blockIframes = (moduleOptions) => {
@@ -210,10 +217,6 @@ const blockIframes = (moduleOptions) => {
210
217
  };
211
218
  const getTypeTemplate = (data) => `// Generated by ${name}
212
219
 
213
- import type { ModuleOptions } from '#cookie-control/types'
214
-
215
- export default ${JSON.stringify(data.options, void 0, 2)} as ModuleOptions
216
-
217
220
  /**
218
221
  * Union of the cookie ids specified in the Nuxt configuration.
219
222
  */
@@ -1,9 +1,10 @@
1
1
  import { ref } from "vue";
2
- import moduleOptions from "#build/types/cookie-control.d";
3
2
  import { COOKIE_ID_SEPARATOR } from "#cookie-control/constants";
4
3
  import { getAllCookieIdsString } from "#cookie-control/methods";
5
- import { defineNuxtPlugin, useCookie } from "#imports";
4
+ import { defineNuxtPlugin, useCookie, useRuntimeConfig } from "#imports";
6
5
  export default defineNuxtPlugin((_nuxtApp) => {
6
+ const runtimeConfig = useRuntimeConfig();
7
+ const moduleOptions = runtimeConfig.public.cookieControl;
7
8
  const cookieIsConsentGiven = useCookie(
8
9
  moduleOptions.cookieNameIsConsentGiven,
9
10
  moduleOptions.cookieOptions
package/package.json CHANGED
@@ -6,6 +6,7 @@
6
6
  "dependencies": {
7
7
  "@nuxt/kit": "^3.8.0",
8
8
  "css-vars-ponyfill": "^2.4.8",
9
+ "defu": "^6.1.4",
9
10
  "string-replace-loader": "^3.1.0"
10
11
  },
11
12
  "description": "Nuxt Cookie Control Module",
@@ -13,27 +14,27 @@
13
14
  "@commitlint/cli": "19.3.0",
14
15
  "@commitlint/config-conventional": "19.2.2",
15
16
  "@dargmuesli/nuxt-cookie-control": "link:",
16
- "@nuxt/eslint-config": "0.3.10",
17
+ "@nuxt/eslint-config": "0.3.13",
17
18
  "@nuxt/module-builder": "0.6.0",
18
19
  "@nuxt/schema": "3.11.2",
19
20
  "@semantic-release/changelog": "6.0.3",
20
21
  "@semantic-release/commit-analyzer": "12.0.0",
21
22
  "@semantic-release/git": "10.0.1",
22
- "@semantic-release/github": "10.0.3",
23
- "@semantic-release/npm": "12.0.0",
23
+ "@semantic-release/github": "10.0.4",
24
+ "@semantic-release/npm": "12.0.1",
24
25
  "@semantic-release/release-notes-generator": "13.0.0",
25
- "eslint": "9.2.0",
26
+ "eslint": "9.3.0",
26
27
  "eslint-config-prettier": "9.1.0",
27
28
  "eslint-plugin-prettier": "5.1.3",
28
29
  "husky": "9.0.11",
29
30
  "lint-staged": "15.2.2",
30
31
  "nuxt": "3.11.2",
31
32
  "prettier": "3.2.5",
32
- "semantic-release": "23.0.8",
33
+ "semantic-release": "23.1.1",
33
34
  "typescript": "5.4.5",
34
35
  "vite": "5.2.11",
35
36
  "vue": "3.4.27",
36
- "vue-tsc": "2.0.16",
37
+ "vue-tsc": "2.0.19",
37
38
  "webpack": "5.91.0"
38
39
  },
39
40
  "engines": {
@@ -69,7 +70,7 @@
69
70
  "Jonas Thelemann"
70
71
  ],
71
72
  "name": "@dargmuesli/nuxt-cookie-control",
72
- "packageManager": "pnpm@9.1.0",
73
+ "packageManager": "pnpm@9.1.1",
73
74
  "publishConfig": {
74
75
  "access": "public"
75
76
  },
@@ -89,5 +90,5 @@
89
90
  },
90
91
  "type": "module",
91
92
  "types": "./dist/types.d.ts",
92
- "version": "8.2.3"
93
+ "version": "8.3.3"
93
94
  }