@slidev/cli 0.48.0-beta.0 → 0.48.0-beta.10
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/{build-M6ETMXB4.mjs → build-3Z2FXQKW.mjs} +29 -29
- package/dist/{chunk-RECJU74U.mjs → chunk-7HOZGSL4.mjs} +199 -2778
- package/dist/{chunk-CTBVOVLQ.mjs → chunk-O6TYYGU6.mjs} +4 -16
- package/dist/chunk-VRC67DBV.mjs +4320 -0
- package/dist/chunk-W4YOBANG.mjs +155 -0
- package/dist/cli.mjs +69 -73
- package/dist/{export-MLH55TH5.mjs → export-SM2ZATWB.mjs} +20 -12
- package/dist/index.d.mts +21 -25
- package/dist/index.mjs +4 -18
- package/dist/{unocss-6IVIFJMZ.mjs → unocss-XALM635U.mjs} +3 -3
- package/package.json +13 -13
- package/template.md +133 -26
- package/dist/chunk-DWXI5WEO.mjs +0 -72
- package/dist/chunk-JHZKCONU.mjs +0 -1866
|
@@ -2,29 +2,17 @@
|
|
|
2
2
|
import { resolve } from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import fs from "fs-extra";
|
|
5
|
-
import {
|
|
5
|
+
import { deepMergeWithArray } from "@antfu/utils";
|
|
6
6
|
import jiti from "jiti";
|
|
7
|
-
function
|
|
8
|
-
a = { ...a };
|
|
9
|
-
Object.keys(b).forEach((key) => {
|
|
10
|
-
if (isObject(a[key]))
|
|
11
|
-
a[key] = deepMerge(a[key], b[key], rootPath ? `${rootPath}.${key}` : key);
|
|
12
|
-
else if (Array.isArray(a[key]))
|
|
13
|
-
a[key] = [...a[key], ...b[key]];
|
|
14
|
-
else
|
|
15
|
-
a[key] = b[key];
|
|
16
|
-
});
|
|
17
|
-
return a;
|
|
18
|
-
}
|
|
19
|
-
async function loadSetups(roots, name, arg, initial, merge = true) {
|
|
7
|
+
async function loadSetups(clientRoot, roots, name, arg, initial, merge = true) {
|
|
20
8
|
let returns = initial;
|
|
21
|
-
for (const root of roots) {
|
|
9
|
+
for (const root of [clientRoot, ...roots].reverse()) {
|
|
22
10
|
const path = resolve(root, "setup", name);
|
|
23
11
|
if (fs.existsSync(path)) {
|
|
24
12
|
const { default: setup } = jiti(fileURLToPath(import.meta.url))(path);
|
|
25
13
|
const result = await setup(arg);
|
|
26
14
|
if (result !== null) {
|
|
27
|
-
returns = typeof merge === "function" ? merge(returns, result) : merge ?
|
|
15
|
+
returns = typeof merge === "function" ? merge(returns, result) : merge ? deepMergeWithArray(returns, result) : result;
|
|
28
16
|
}
|
|
29
17
|
}
|
|
30
18
|
}
|