@merkaly/nuxt 0.1.7 → 0.1.9

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,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.0.0"
6
6
  },
7
- "version": "0.1.7",
7
+ "version": "0.1.9",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -1,6 +1,62 @@
1
1
  import { defineNuxtModule, createResolver, addPlugin, addRouteMiddleware, addImportsDir, addComponentsDir } from '@nuxt/kit';
2
- import { defu } from 'defu';
3
2
  import { existsSync } from 'node:fs';
3
+ import svgLoader from 'vite-svg-loader';
4
+
5
+ function isPlainObject(value) {
6
+ if (value === null || typeof value !== "object") {
7
+ return false;
8
+ }
9
+ const prototype = Object.getPrototypeOf(value);
10
+ if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
11
+ return false;
12
+ }
13
+ if (Symbol.iterator in value) {
14
+ return false;
15
+ }
16
+ if (Symbol.toStringTag in value) {
17
+ return Object.prototype.toString.call(value) === "[object Module]";
18
+ }
19
+ return true;
20
+ }
21
+
22
+ function _defu(baseObject, defaults, namespace = ".", merger) {
23
+ if (!isPlainObject(defaults)) {
24
+ return _defu(baseObject, {}, namespace, merger);
25
+ }
26
+ const object = Object.assign({}, defaults);
27
+ for (const key in baseObject) {
28
+ if (key === "__proto__" || key === "constructor") {
29
+ continue;
30
+ }
31
+ const value = baseObject[key];
32
+ if (value === null || value === void 0) {
33
+ continue;
34
+ }
35
+ if (merger && merger(object, key, value, namespace)) {
36
+ continue;
37
+ }
38
+ if (Array.isArray(value) && Array.isArray(object[key])) {
39
+ object[key] = [...value, ...object[key]];
40
+ } else if (isPlainObject(value) && isPlainObject(object[key])) {
41
+ object[key] = _defu(
42
+ value,
43
+ object[key],
44
+ (namespace ? `${namespace}.` : "") + key.toString(),
45
+ merger
46
+ );
47
+ } else {
48
+ object[key] = value;
49
+ }
50
+ }
51
+ return object;
52
+ }
53
+ function createDefu(merger) {
54
+ return (...arguments_) => (
55
+ // eslint-disable-next-line unicorn/no-array-reduce
56
+ arguments_.reduce((p, c) => _defu(p, c, "", merger), {})
57
+ );
58
+ }
59
+ const defu = createDefu();
4
60
 
5
61
  const module = defineNuxtModule({
6
62
  defaults: {
@@ -66,7 +122,7 @@ const module = defineNuxtModule({
66
122
  path: moduleResolver.resolve("./runtime/components"),
67
123
  prefix: "MK"
68
124
  });
69
- nuxt.options["vite"] = defu(nuxt.options["vite"] || {}, { plugins: [require("vite-svg-loader")()] });
125
+ nuxt.options["vite"] = defu(nuxt.options["vite"] || {}, { plugins: [svgLoader()] });
70
126
  }
71
127
  });
72
128
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@merkaly/nuxt",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/merkaly-io/nuxt.git"
@@ -29,12 +29,12 @@
29
29
  ],
30
30
  "scripts": {
31
31
  "build": "nuxt-module-build build",
32
- "build:dev": "pnpm build --stub",
33
- "dev": "pnpm dev:prepare && cd playground",
32
+ "build:stub": "nuxt-module-build build --stub",
33
+ "dev": "pnpm dev:prepare && cd playground && pnpm storybook",
34
34
  "dev:build": "nuxi build playground",
35
- "dev:prepare": "pnpm build && pnpm -C playground install && nuxi prepare playground",
35
+ "dev:prepare": "pnpm build:stub && nuxi prepare playground",
36
36
  "lint": "eslint .",
37
- "prepack": "pnpm dev:prepare",
37
+ "prepack": "pnpm build",
38
38
  "prepare": "nuxt-module-build prepare",
39
39
  "release": "pnpm lint && pnpm test && pnpm build && changelogen --release && npm publish --access public && git push --follow-tags",
40
40
  "test": "vitest run",
@@ -59,7 +59,6 @@
59
59
  "@vueuse/nuxt": "^14.1.0",
60
60
  "bootstrap": "^5.3.8",
61
61
  "bootstrap-vue-next": "^0.42.0",
62
- "defu": "^6.1.4",
63
62
  "eslint": "^9.39.1",
64
63
  "nuxt": "^4.2.0",
65
64
  "sass": "^1.97.0",
@@ -74,7 +73,6 @@
74
73
  "@nuxt/module-builder": "^1.0.2",
75
74
  "@nuxt/schema": "^4.2.0",
76
75
  "@nuxt/test-utils": "^3.23.0",
77
- "baseline-browser-mapping": "^2.9.14",
78
76
  "changelogen": "^0.6.2",
79
77
  "eslint-plugin-storybook": "^10.1.11",
80
78
  "vitest": "^4.0.6",