@merkaly/nuxt 0.1.7 → 0.1.8
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 +1 -1
- package/dist/module.mjs +56 -1
- package/package.json +5 -7
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,7 +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';
|
|
4
3
|
|
|
4
|
+
function isPlainObject(value) {
|
|
5
|
+
if (value === null || typeof value !== "object") {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
const prototype = Object.getPrototypeOf(value);
|
|
9
|
+
if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
if (Symbol.iterator in value) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
if (Symbol.toStringTag in value) {
|
|
16
|
+
return Object.prototype.toString.call(value) === "[object Module]";
|
|
17
|
+
}
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
22
|
+
if (!isPlainObject(defaults)) {
|
|
23
|
+
return _defu(baseObject, {}, namespace, merger);
|
|
24
|
+
}
|
|
25
|
+
const object = Object.assign({}, defaults);
|
|
26
|
+
for (const key in baseObject) {
|
|
27
|
+
if (key === "__proto__" || key === "constructor") {
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
const value = baseObject[key];
|
|
31
|
+
if (value === null || value === void 0) {
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
if (merger && merger(object, key, value, namespace)) {
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
if (Array.isArray(value) && Array.isArray(object[key])) {
|
|
38
|
+
object[key] = [...value, ...object[key]];
|
|
39
|
+
} else if (isPlainObject(value) && isPlainObject(object[key])) {
|
|
40
|
+
object[key] = _defu(
|
|
41
|
+
value,
|
|
42
|
+
object[key],
|
|
43
|
+
(namespace ? `${namespace}.` : "") + key.toString(),
|
|
44
|
+
merger
|
|
45
|
+
);
|
|
46
|
+
} else {
|
|
47
|
+
object[key] = value;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return object;
|
|
51
|
+
}
|
|
52
|
+
function createDefu(merger) {
|
|
53
|
+
return (...arguments_) => (
|
|
54
|
+
// eslint-disable-next-line unicorn/no-array-reduce
|
|
55
|
+
arguments_.reduce((p, c) => _defu(p, c, "", merger), {})
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
const defu = createDefu();
|
|
59
|
+
|
|
5
60
|
const module = defineNuxtModule({
|
|
6
61
|
defaults: {
|
|
7
62
|
auth0: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@merkaly/nuxt",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
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:
|
|
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 &&
|
|
35
|
+
"dev:prepare": "pnpm build:stub && nuxi prepare playground",
|
|
36
36
|
"lint": "eslint .",
|
|
37
|
-
"prepack": "pnpm
|
|
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",
|