@vixt/react 0.11.2 → 0.12.0
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/node/index.mjs +5 -11
- package/dist/node/modules/components.mjs +38 -1
- package/dist/node/modules/preset-react.mjs +38 -1
- package/dist/node/modules/route-block.mjs +11 -5
- package/dist/node/modules/virtual-root-component.mjs +6 -7
- package/package.json +10 -6
- package/dist/node/chunk-DnnnRqeS.mjs +0 -26
- package/dist/node/components-Dsb3rw2n.mjs +0 -10795
- package/dist/node/detect-acorn-CKsvmz2e.mjs +0 -370
- package/dist/node/dist-CoEoJGXV.mjs +0 -6999
- package/dist/node/lib-BJ7U9lm_.mjs +0 -1930
- package/dist/node/preset-react-BTKKeG54.mjs +0 -65
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { t as components_default } from "./components-Dsb3rw2n.mjs";
|
|
2
|
-
import { extendRoute } from "./modules/route-block.mjs";
|
|
3
|
-
import { defineVixtModule, resolveLayersDirs } from "@vixt/core";
|
|
4
|
-
import React from "@vitejs/plugin-react";
|
|
5
|
-
import Pages from "vite-plugin-pages";
|
|
6
|
-
import Layouts from "vite-plugin-vue-layouts";
|
|
7
|
-
//#region ../../node_modules/.pnpm/defu@6.1.7/node_modules/defu/dist/defu.mjs
|
|
8
|
-
function isPlainObject(value) {
|
|
9
|
-
if (value === null || typeof value !== "object") return false;
|
|
10
|
-
const prototype = Object.getPrototypeOf(value);
|
|
11
|
-
if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) return false;
|
|
12
|
-
if (Symbol.iterator in value) return false;
|
|
13
|
-
if (Symbol.toStringTag in value) return Object.prototype.toString.call(value) === "[object Module]";
|
|
14
|
-
return true;
|
|
15
|
-
}
|
|
16
|
-
function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
17
|
-
if (!isPlainObject(defaults)) return _defu(baseObject, {}, namespace, merger);
|
|
18
|
-
const object = { ...defaults };
|
|
19
|
-
for (const key of Object.keys(baseObject)) {
|
|
20
|
-
if (key === "__proto__" || key === "constructor") continue;
|
|
21
|
-
const value = baseObject[key];
|
|
22
|
-
if (value === null || value === void 0) continue;
|
|
23
|
-
if (merger && merger(object, key, value, namespace)) continue;
|
|
24
|
-
if (Array.isArray(value) && Array.isArray(object[key])) object[key] = [...value, ...object[key]];
|
|
25
|
-
else if (isPlainObject(value) && isPlainObject(object[key])) object[key] = _defu(value, object[key], (namespace ? `${namespace}.` : "") + key.toString(), merger);
|
|
26
|
-
else object[key] = value;
|
|
27
|
-
}
|
|
28
|
-
return object;
|
|
29
|
-
}
|
|
30
|
-
function createDefu(merger) {
|
|
31
|
-
return (...arguments_) => arguments_.reduce((p, c) => _defu(p, c, "", merger), {});
|
|
32
|
-
}
|
|
33
|
-
const defu = createDefu();
|
|
34
|
-
var preset_react_default = defineVixtModule({
|
|
35
|
-
meta: { name: "vixt:preset-react" },
|
|
36
|
-
setup(_, vixt) {
|
|
37
|
-
const { components = [], layouts = [], pages = [] } = resolveLayersDirs([...vixt._layers].reverse());
|
|
38
|
-
const { buildTypesDir } = vixt.options;
|
|
39
|
-
const defaultOptions = {
|
|
40
|
-
react: {},
|
|
41
|
-
pages: {
|
|
42
|
-
dirs: pages,
|
|
43
|
-
extendRoute
|
|
44
|
-
},
|
|
45
|
-
layouts: {
|
|
46
|
-
layoutsDirs: layouts,
|
|
47
|
-
pagesDirs: pages,
|
|
48
|
-
extensions: ["jsx", "tsx"],
|
|
49
|
-
importMode: () => "sync"
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
const options = vixt.options = defu(vixt.options, defaultOptions);
|
|
53
|
-
return [
|
|
54
|
-
React(options.react),
|
|
55
|
-
Pages(options.pages),
|
|
56
|
-
Layouts(options.layouts),
|
|
57
|
-
components_default({
|
|
58
|
-
dirs: components,
|
|
59
|
-
dts: `${buildTypesDir}/components.d.ts`
|
|
60
|
-
})
|
|
61
|
-
];
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
//#endregion
|
|
65
|
-
export { preset_react_default as t };
|