@modern-js/plugin-v2 2.68.2-alpha.0 → 2.68.2
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.
|
@@ -30,9 +30,32 @@ const mergeConfig = (configs) => (0, import_lodash.mergeWith)({}, ...configs, (t
|
|
|
30
30
|
if ((0, import_utils.isOverriddenConfigKey)(key)) {
|
|
31
31
|
return source !== null && source !== void 0 ? source : target;
|
|
32
32
|
}
|
|
33
|
-
if ((
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
if (Array.isArray(target) || Array.isArray(source)) {
|
|
34
|
+
if (target === void 0) {
|
|
35
|
+
return source;
|
|
36
|
+
}
|
|
37
|
+
if (source === void 0) {
|
|
38
|
+
return target;
|
|
39
|
+
}
|
|
40
|
+
const targetArray = (0, import_utils.ensureArray)(target);
|
|
41
|
+
const sourceArray = (0, import_utils.ensureArray)(source);
|
|
42
|
+
const allItems = [
|
|
43
|
+
...targetArray,
|
|
44
|
+
...sourceArray
|
|
45
|
+
];
|
|
46
|
+
const seenNonFunc = [];
|
|
47
|
+
const result = [];
|
|
48
|
+
for (const item of allItems) {
|
|
49
|
+
if ((0, import_lodash.isFunction)(item)) {
|
|
50
|
+
result.push(item);
|
|
51
|
+
} else {
|
|
52
|
+
if (!seenNonFunc.some((seen) => (0, import_lodash.isEqual)(seen, item))) {
|
|
53
|
+
seenNonFunc.push(item);
|
|
54
|
+
result.push(item);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return result;
|
|
36
59
|
}
|
|
37
60
|
if ((0, import_lodash.isFunction)(target) || (0, import_lodash.isFunction)(source)) {
|
|
38
61
|
if (source === void 0) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
|
|
2
2
|
import { _ as _type_of } from "@swc/helpers/_/_type_of";
|
|
3
|
-
import { isOverriddenConfigKey } from "@modern-js/utils";
|
|
4
|
-
import {
|
|
3
|
+
import { ensureArray, isOverriddenConfigKey } from "@modern-js/utils";
|
|
4
|
+
import { isEqual, isFunction, mergeWith } from "@modern-js/utils/lodash";
|
|
5
5
|
var mergeConfig = function(configs) {
|
|
6
6
|
return mergeWith.apply(void 0, [
|
|
7
7
|
{}
|
|
@@ -13,9 +13,50 @@ var mergeConfig = function(configs) {
|
|
|
13
13
|
if (isOverriddenConfigKey(key)) {
|
|
14
14
|
return source !== null && source !== void 0 ? source : target;
|
|
15
15
|
}
|
|
16
|
-
if (isArray(source)) {
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
if (Array.isArray(target) || Array.isArray(source)) {
|
|
17
|
+
if (target === void 0) {
|
|
18
|
+
return source;
|
|
19
|
+
}
|
|
20
|
+
if (source === void 0) {
|
|
21
|
+
return target;
|
|
22
|
+
}
|
|
23
|
+
var targetArray = ensureArray(target);
|
|
24
|
+
var sourceArray = ensureArray(source);
|
|
25
|
+
var allItems = _to_consumable_array(targetArray).concat(_to_consumable_array(sourceArray));
|
|
26
|
+
var seenNonFunc = [];
|
|
27
|
+
var result = [];
|
|
28
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
29
|
+
try {
|
|
30
|
+
var _loop = function() {
|
|
31
|
+
var item = _step.value;
|
|
32
|
+
if (isFunction(item)) {
|
|
33
|
+
result.push(item);
|
|
34
|
+
} else {
|
|
35
|
+
if (!seenNonFunc.some(function(seen) {
|
|
36
|
+
return isEqual(seen, item);
|
|
37
|
+
})) {
|
|
38
|
+
seenNonFunc.push(item);
|
|
39
|
+
result.push(item);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
for (var _iterator = allItems[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)
|
|
44
|
+
_loop();
|
|
45
|
+
} catch (err) {
|
|
46
|
+
_didIteratorError = true;
|
|
47
|
+
_iteratorError = err;
|
|
48
|
+
} finally {
|
|
49
|
+
try {
|
|
50
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
51
|
+
_iterator.return();
|
|
52
|
+
}
|
|
53
|
+
} finally {
|
|
54
|
+
if (_didIteratorError) {
|
|
55
|
+
throw _iteratorError;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return result;
|
|
19
60
|
}
|
|
20
61
|
if (isFunction(target) || isFunction(source)) {
|
|
21
62
|
if (source === void 0) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isOverriddenConfigKey } from "@modern-js/utils";
|
|
2
|
-
import {
|
|
1
|
+
import { ensureArray, isOverriddenConfigKey } from "@modern-js/utils";
|
|
2
|
+
import { isEqual, isFunction, mergeWith } from "@modern-js/utils/lodash";
|
|
3
3
|
const mergeConfig = (configs) => mergeWith({}, ...configs, (target, source, key) => {
|
|
4
4
|
if (key === "designSystem" || key === "tailwindcss" && typeof source === "object") {
|
|
5
5
|
return mergeWith({}, target !== null && target !== void 0 ? target : {}, source !== null && source !== void 0 ? source : {});
|
|
@@ -7,9 +7,32 @@ const mergeConfig = (configs) => mergeWith({}, ...configs, (target, source, key)
|
|
|
7
7
|
if (isOverriddenConfigKey(key)) {
|
|
8
8
|
return source !== null && source !== void 0 ? source : target;
|
|
9
9
|
}
|
|
10
|
-
if (isArray(source)) {
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
if (Array.isArray(target) || Array.isArray(source)) {
|
|
11
|
+
if (target === void 0) {
|
|
12
|
+
return source;
|
|
13
|
+
}
|
|
14
|
+
if (source === void 0) {
|
|
15
|
+
return target;
|
|
16
|
+
}
|
|
17
|
+
const targetArray = ensureArray(target);
|
|
18
|
+
const sourceArray = ensureArray(source);
|
|
19
|
+
const allItems = [
|
|
20
|
+
...targetArray,
|
|
21
|
+
...sourceArray
|
|
22
|
+
];
|
|
23
|
+
const seenNonFunc = [];
|
|
24
|
+
const result = [];
|
|
25
|
+
for (const item of allItems) {
|
|
26
|
+
if (isFunction(item)) {
|
|
27
|
+
result.push(item);
|
|
28
|
+
} else {
|
|
29
|
+
if (!seenNonFunc.some((seen) => isEqual(seen, item))) {
|
|
30
|
+
seenNonFunc.push(item);
|
|
31
|
+
result.push(item);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return result;
|
|
13
36
|
}
|
|
14
37
|
if (isFunction(target) || isFunction(source)) {
|
|
15
38
|
if (source === void 0) {
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.68.2
|
|
18
|
+
"version": "2.68.2",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"types": "./dist/types/index.d.ts",
|
|
21
21
|
"main": "./dist/cjs/index.js",
|
|
@@ -82,9 +82,9 @@
|
|
|
82
82
|
"@swc/helpers": "^0.5.17",
|
|
83
83
|
"jiti": "1.21.7",
|
|
84
84
|
"@rsbuild/core": "1.4.4",
|
|
85
|
-
"@modern-js/
|
|
86
|
-
"@modern-js/
|
|
87
|
-
"@modern-js/
|
|
85
|
+
"@modern-js/runtime-utils": "2.68.2",
|
|
86
|
+
"@modern-js/utils": "2.68.2",
|
|
87
|
+
"@modern-js/types": "2.68.2"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
90
|
"@types/jest": "^29",
|
|
@@ -92,8 +92,8 @@
|
|
|
92
92
|
"@types/react": "^18.3.11",
|
|
93
93
|
"jest": "^29",
|
|
94
94
|
"typescript": "^5",
|
|
95
|
+
"@modern-js/uni-builder": "2.68.2",
|
|
95
96
|
"@scripts/build": "2.66.0",
|
|
96
|
-
"@modern-js/uni-builder": "2.68.1",
|
|
97
97
|
"@scripts/jest-config": "2.66.0"
|
|
98
98
|
},
|
|
99
99
|
"sideEffects": false,
|