vome-core 0.2.1 → 0.2.3
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/admin/api/client.js +9 -0
- package/dist/admin/components/ui/avatar/index.js +1 -1
- package/dist/admin/components/ui/button/index.d.ts +1 -1
- package/dist/admin/components/ui/checkbox/index.js +1 -1
- package/dist/admin/components/ui/dialog/index.js +1 -1
- package/dist/admin/components/ui/dropdown-menu/index.js +1 -1
- package/dist/admin/components/ui/input/index.js +1 -1
- package/dist/admin/components/ui/label/index.js +1 -1
- package/dist/admin/components/ui/scroll-area/index.js +1 -1
- package/dist/admin/components/ui/select/index.js +1 -1
- package/dist/admin/components/ui/separator/index.js +1 -1
- package/dist/admin/components/ui/sheet/index.js +1 -1
- package/dist/admin/components/ui/sonner/index.js +1 -1
- package/dist/admin/components/ui/table/index.js +1 -1
- package/dist/admin/components/ui/tabs/index.js +1 -1
- package/dist/admin/components/ui/tooltip/index.js +1 -1
- package/dist/admin/components/vm-empty.vue +3 -12
- package/dist/admin/crud/components/vm-dict-tag.vue +6 -3
- package/dist/admin/crud/components/vm-richtext-extensions.js +1 -1
- package/dist/admin/crud/config.js +1 -1
- package/dist/admin/crud/confirm.js +1 -1
- package/dist/admin/crud/crud-page-request.js +1 -1
- package/dist/admin/crud/data-i18n.js +1 -1
- package/dist/admin/crud/dict.js +1 -1
- package/dist/admin/crud/export-fetch.js +1 -1
- package/dist/admin/crud/key.js +1 -1
- package/dist/admin/crud/plugins.js +1 -1
- package/dist/admin/crud/span.js +1 -1
- package/dist/admin/crud/style.js +1 -1
- package/dist/admin/crud/validate.js +1 -1
- package/dist/admin/directives/perm.js +1 -1
- package/dist/admin/hooks/useUpload.js +1 -1
- package/dist/admin/hooks/useVome.d.ts +2 -2
- package/dist/admin/index.d.ts +4 -4
- package/dist/admin/index.js +2 -7
- package/dist/admin/lib/browser.js +1 -1
- package/dist/admin/lib/cn.js +1 -1
- package/dist/admin/lib/dialog-float.js +1 -1
- package/dist/admin/lib/export-excel.js +1 -1
- package/dist/admin/lib/import-excel.js +1 -1
- package/dist/admin/lib/json.js +1 -1
- package/dist/admin/lib/menu.js +1 -1
- package/dist/admin/lib/micro-locale.js +1 -1
- package/dist/admin/lib/micro-theme.js +1 -1
- package/dist/admin/lib/scarce-assets.d.ts +5 -0
- package/dist/admin/lib/scarce-assets.js +16 -0
- package/dist/admin/lib/shell.d.ts +2 -7
- package/dist/admin/lib/shell.js +1 -1
- package/dist/admin/lib/theme-color-options.js +1 -1
- package/dist/admin/lib/tree.js +1 -1
- package/dist/admin/lib/upload.js +1 -1
- package/dist/admin/lib/video-frame.js +1 -1
- package/dist/admin/router/create.js +1 -1
- package/dist/admin/router/guards.js +1 -1
- package/dist/admin/stores/app.d.ts +13 -1
- package/dist/admin/stores/tags.d.ts +14 -1
- package/dist/admin/stores/user.d.ts +48 -1
- package/dist/admin/stores/user.js +2 -0
- package/dist/agent/index.js +1 -64
- package/dist/ai/adapters/index.d.ts +0 -1
- package/dist/ai/index.d.ts +1 -1
- package/dist/ai/index.js +1 -29188
- package/dist/client/ai-model-registry.d.ts +16 -0
- package/dist/client/ai-model-registry.js +1 -0
- package/dist/client/base.js +1 -107
- package/dist/client/configure.js +1 -39
- package/dist/client/dict.d.ts +1 -2
- package/dist/client/dict.js +1 -53
- package/dist/client/eps-payload.js +1 -20
- package/dist/client/eps.js +1 -122
- package/dist/client/index.d.ts +3 -2
- package/dist/client/index.js +1 -35
- package/dist/client/locale-store.d.ts +40 -1
- package/dist/client/locale-store.js +1 -164
- package/dist/client/service.js +1 -289
- package/dist/client/vite-admin.js +1 -70
- package/dist/client/vite-auto-import.js +1 -127
- package/dist/client/vite-micro-proxy.js +1 -59
- package/dist/client/vite-plugin-eps.js +1 -308
- package/dist/client/vite-resolve.js +1 -205
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.js +1 -118
- package/dist/core/host-infra.d.ts +0 -2
- package/dist/core/index.d.ts +1 -1
- package/dist/i18n/data-i18n.d.ts +0 -1
- package/dist/index.js +1 -1
- package/dist/ioc/index.d.ts +1 -1
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +1 -1
- package/dist/shared/datetime-picker.js +1 -1
- package/dist/shared/excel.js +1 -1
- package/dist/shared/index.js +1 -1
- package/dist/shared/locale-json.js +1 -1
- package/dist/shared/tree.js +1 -1
- package/package.json +4 -2
- package/typings/admin/comm/crud.ts +10 -4
- package/typings/admin/comm/request.ts +3 -1
- package/dist/admin/lib/setup-crud-defaults.d.ts +0 -2
- package/dist/admin/lib/setup-crud-defaults.js +0 -1
- package/dist/admin/themes/dark.d.ts +0 -2
- package/dist/admin/themes/dark.js +0 -1
- package/dist/admin/themes/index.d.ts +0 -9
- package/dist/admin/themes/index.js +0 -1
- package/dist/admin/themes/light.d.ts +0 -2
- package/dist/admin/themes/light.js +0 -1
|
@@ -1,205 +1 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { createRequire } from "node:module";
|
|
4
|
-
function resolveFile(base) {
|
|
5
|
-
const candidates = [
|
|
6
|
-
base,
|
|
7
|
-
`${base}.js`,
|
|
8
|
-
`${base}.ts`,
|
|
9
|
-
`${base}.vue`,
|
|
10
|
-
`${base}.css`,
|
|
11
|
-
`${base}.json`,
|
|
12
|
-
path.join(base, "index.js"),
|
|
13
|
-
path.join(base, "index.ts"),
|
|
14
|
-
path.join(base, "index.vue")
|
|
15
|
-
];
|
|
16
|
-
for (const c of candidates) {
|
|
17
|
-
if (fs.existsSync(c) && fs.statSync(c).isFile())
|
|
18
|
-
return c;
|
|
19
|
-
}
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
function stripQuery(id) {
|
|
23
|
-
return id.split("?")[0].split("#")[0];
|
|
24
|
-
}
|
|
25
|
-
function querySuffix(id) {
|
|
26
|
-
const i = id.indexOf("?");
|
|
27
|
-
if (i === -1)
|
|
28
|
-
return "";
|
|
29
|
-
const q = id.slice(i);
|
|
30
|
-
return q.startsWith("?vue") ? q : "";
|
|
31
|
-
}
|
|
32
|
-
function withVueQuery(file, id) {
|
|
33
|
-
const q = querySuffix(id);
|
|
34
|
-
return q ? `${file}${q}` : file;
|
|
35
|
-
}
|
|
36
|
-
function normalizeAdminId(id) {
|
|
37
|
-
const raw = stripQuery(id);
|
|
38
|
-
if (raw === "/@" || raw === "/@/")
|
|
39
|
-
return "vome-core/admin";
|
|
40
|
-
if (raw.startsWith("/@/"))
|
|
41
|
-
return `vome-core/admin/${raw.slice("/@/".length)}`;
|
|
42
|
-
if (raw === "@core/admin" || raw.startsWith("@core/admin/")) {
|
|
43
|
-
return raw.replace(/^@core\//, "vome-core/");
|
|
44
|
-
}
|
|
45
|
-
if (raw === "vome-core/admin" || raw.startsWith("vome-core/admin/"))
|
|
46
|
-
return raw;
|
|
47
|
-
return raw;
|
|
48
|
-
}
|
|
49
|
-
function isAdminSpec(id) {
|
|
50
|
-
const n = normalizeAdminId(id);
|
|
51
|
-
return n === "vome-core/admin" || n.startsWith("vome-core/admin/");
|
|
52
|
-
}
|
|
53
|
-
export function vomePeerDepsPlugin(appRoot) {
|
|
54
|
-
const require = createRequire(path.join(appRoot, "package.json"));
|
|
55
|
-
const nm = path.join(appRoot, "node_modules");
|
|
56
|
-
const pinned = {
|
|
57
|
-
clsx: path.join(nm, "clsx/dist/clsx.mjs"),
|
|
58
|
-
"tailwind-merge": path.join(nm, "tailwind-merge/dist/bundle-mjs.mjs"),
|
|
59
|
-
dompurify: path.join(nm, "dompurify/dist/purify.es.mjs"),
|
|
60
|
-
marked: path.join(nm, "marked/lib/marked.esm.js"),
|
|
61
|
-
"vue-sonner": path.join(nm, "vue-sonner/lib/index.js"),
|
|
62
|
-
pinia: path.join(nm, "pinia/dist/pinia.mjs"),
|
|
63
|
-
"reka-ui": path.join(nm, "reka-ui/dist/index.js"),
|
|
64
|
-
"@lucide/vue": path.join(nm, "@lucide/vue/dist/esm/lucide-vue.mjs"),
|
|
65
|
-
"lucide-vue-next": path.join(nm, "lucide-vue-next/dist/esm/lucide-vue-next.js"),
|
|
66
|
-
"class-variance-authority": path.join(nm, "class-variance-authority/dist/index.mjs"),
|
|
67
|
-
xlsx: path.join(nm, "xlsx/xlsx.mjs")
|
|
68
|
-
};
|
|
69
|
-
function isCjsArtifact(file) {
|
|
70
|
-
const n = file.replace(/\\/g, "/");
|
|
71
|
-
return n.endsWith(".cjs") || n.endsWith(".cjs.js") || n.includes("/dist/cjs/") || n.includes("/cjs/");
|
|
72
|
-
}
|
|
73
|
-
function resolvePeerPkg(pkg) {
|
|
74
|
-
const file = pinned[pkg];
|
|
75
|
-
if (file && fs.existsSync(file))
|
|
76
|
-
return file;
|
|
77
|
-
try {
|
|
78
|
-
const resolved = require.resolve(pkg);
|
|
79
|
-
if (isCjsArtifact(resolved))
|
|
80
|
-
return;
|
|
81
|
-
return resolved;
|
|
82
|
-
} catch {
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
function isCoreImporter(importer) {
|
|
87
|
-
if (!importer)
|
|
88
|
-
return false;
|
|
89
|
-
const norm = importer.replace(/\\/g, "/");
|
|
90
|
-
return norm.includes("/node_modules/vome-core/") || norm.includes("/vome-core/dist/");
|
|
91
|
-
}
|
|
92
|
-
const leaveToVite = new Set(["vue", "vue-router", "@vueuse/core", "wujie"]);
|
|
93
|
-
return {
|
|
94
|
-
name: "vome-peer-deps",
|
|
95
|
-
enforce: "pre",
|
|
96
|
-
resolveId(source, importer) {
|
|
97
|
-
const normalized = source.replace(/^\0/, "");
|
|
98
|
-
if (normalized.startsWith("__vite-optional-peer-dep:")) {
|
|
99
|
-
const pkg = normalized.slice("__vite-optional-peer-dep:".length).replace(/:vome-core$/, "");
|
|
100
|
-
return resolvePeerPkg(pkg);
|
|
101
|
-
}
|
|
102
|
-
if (isCoreImporter(importer)) {
|
|
103
|
-
if (pinned[source])
|
|
104
|
-
return resolvePeerPkg(source);
|
|
105
|
-
if (leaveToVite.has(source) || source.startsWith("@tiptap/")) {
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
try {
|
|
109
|
-
const resolved = require.resolve(source);
|
|
110
|
-
if (isCjsArtifact(resolved))
|
|
111
|
-
return;
|
|
112
|
-
return resolved;
|
|
113
|
-
} catch {
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
export function vomeResolvePlugin(root) {
|
|
122
|
-
const coreAdmin = path.resolve(root, "node_modules/vome-core/dist/admin");
|
|
123
|
-
const serviceEntry = path.resolve(coreAdmin, "service/index.js");
|
|
124
|
-
function resolveServiceId(id, importer) {
|
|
125
|
-
const clean = normalizeAdminId(id);
|
|
126
|
-
if (clean === "vome-core/admin/service" || clean === "vome-core/admin/service/index" || clean === "vome-core/admin/service/index.js") {
|
|
127
|
-
return serviceEntry;
|
|
128
|
-
}
|
|
129
|
-
const norm = path.normalize(clean);
|
|
130
|
-
if (norm === path.normalize(serviceEntry))
|
|
131
|
-
return serviceEntry;
|
|
132
|
-
if (importer) {
|
|
133
|
-
const impDir = path.dirname(stripQuery(importer));
|
|
134
|
-
if (/vome-core[/\\]dist[/\\]admin/.test(impDir)) {
|
|
135
|
-
const abs = path.normalize(path.resolve(impDir, clean));
|
|
136
|
-
if (abs === path.normalize(serviceEntry) || abs === path.normalize(path.join(coreAdmin, "service")) || abs === path.normalize(path.join(coreAdmin, "service/index")) || abs === path.normalize(path.join(coreAdmin, "service/index.js"))) {
|
|
137
|
-
return serviceEntry;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
return {
|
|
144
|
-
name: "vome-resolve",
|
|
145
|
-
enforce: "pre",
|
|
146
|
-
resolveId(id, importer) {
|
|
147
|
-
const serviceId = resolveServiceId(id, importer);
|
|
148
|
-
if (serviceId)
|
|
149
|
-
return withVueQuery(serviceId, id);
|
|
150
|
-
if (importer) {
|
|
151
|
-
const imp = stripQuery(importer).replace(/\\/g, "/");
|
|
152
|
-
if (imp.includes("/vome-core/dist/admin/")) {
|
|
153
|
-
const clean = stripQuery(id);
|
|
154
|
-
if (clean.startsWith(".") || path.isAbsolute(clean)) {
|
|
155
|
-
const abs = path.normalize(path.isAbsolute(clean) ? clean : path.resolve(path.dirname(stripQuery(importer)), clean));
|
|
156
|
-
const hit = resolveFile(abs) ?? (fs.existsSync(abs) && fs.statSync(abs).isFile() ? abs : null);
|
|
157
|
-
if (hit)
|
|
158
|
-
return withVueQuery(hit, id);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
if (!isAdminSpec(id))
|
|
163
|
-
return;
|
|
164
|
-
const adminId = normalizeAdminId(id);
|
|
165
|
-
const sub = adminId === "vome-core/admin" ? "" : adminId.slice("vome-core/admin/".length);
|
|
166
|
-
const file = resolveFile(path.resolve(coreAdmin, sub));
|
|
167
|
-
return file ? withVueQuery(file, id) : undefined;
|
|
168
|
-
}
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
export function vomeAdminNoOptimizePlugin() {
|
|
172
|
-
return {
|
|
173
|
-
name: "vome-admin-no-optimize",
|
|
174
|
-
enforce: "pre",
|
|
175
|
-
config() {
|
|
176
|
-
return {
|
|
177
|
-
optimizeDeps: {
|
|
178
|
-
exclude: ["vome-core"]
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
|
-
},
|
|
182
|
-
resolveId(id) {
|
|
183
|
-
if (id === "@core" || id.startsWith("@core/"))
|
|
184
|
-
return;
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
export function vomeHostEsbuildPlugin(appRoot) {
|
|
190
|
-
const root = appRoot || process.cwd();
|
|
191
|
-
const coreAdmin = path.resolve(root, "node_modules/vome-core/dist/admin");
|
|
192
|
-
return {
|
|
193
|
-
name: "vome-host-esbuild",
|
|
194
|
-
setup(build) {
|
|
195
|
-
build.onResolve({ filter: /^@core\/admin(\/|$)|^\/@(\/|$)/ }, (args) => {
|
|
196
|
-
const adminId = normalizeAdminId(args.path);
|
|
197
|
-
const sub = adminId === "vome-core/admin" ? "" : adminId.slice("vome-core/admin/".length);
|
|
198
|
-
const resolved = resolveFile(path.resolve(coreAdmin, sub));
|
|
199
|
-
if (!resolved)
|
|
200
|
-
return { path: args.path, external: true };
|
|
201
|
-
return { path: resolved, external: true };
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
};
|
|
205
|
-
}
|
|
1
|
+
(function(_0x1b9c10,_0x4ae2e3){const _0x13e970=_0x5553,_0x574cf1=_0x1b9c10();while(!![]){try{const _0x11f94f=parseInt(_0x13e970(0x170))/0x1*(parseInt(_0x13e970(0x153))/0x2)+-parseInt(_0x13e970(0x187))/0x3+parseInt(_0x13e970(0x180))/0x4*(parseInt(_0x13e970(0x14c))/0x5)+parseInt(_0x13e970(0x145))/0x6*(-parseInt(_0x13e970(0x186))/0x7)+parseInt(_0x13e970(0x154))/0x8*(-parseInt(_0x13e970(0x16d))/0x9)+parseInt(_0x13e970(0x15d))/0xa+parseInt(_0x13e970(0x166))/0xb*(parseInt(_0x13e970(0x171))/0xc);if(_0x11f94f===_0x4ae2e3)break;else _0x574cf1['push'](_0x574cf1['shift']());}catch(_0x4db7da){_0x574cf1['push'](_0x574cf1['shift']());}}}(_0xeb0b,0x5868a));import _0x89abd6 from'node:fs';import _0x471c20 from'node:path';import{createRequire}from'node:module';function resolveFile(_0x20eabb){const _0x33928e=_0x5553,_0x3603ba=[_0x20eabb,_0x20eabb+_0x33928e(0x143),_0x20eabb+_0x33928e(0x16a),_0x20eabb+_0x33928e(0x16c),_0x20eabb+_0x33928e(0x161),_0x20eabb+'.json',_0x471c20['join'](_0x20eabb,_0x33928e(0x16f)),_0x471c20['join'](_0x20eabb,_0x33928e(0x144)),_0x471c20[_0x33928e(0x172)](_0x20eabb,_0x33928e(0x178))];for(const _0x12e4e0 of _0x3603ba){if(_0x89abd6[_0x33928e(0x158)](_0x12e4e0)&&_0x89abd6['statSync'](_0x12e4e0)['isFile']())return _0x12e4e0;}return null;}function stripQuery(_0x307cf5){const _0x40468d=_0x5553;return _0x307cf5[_0x40468d(0x15a)]('?')[0x0][_0x40468d(0x15a)]('#')[0x0];}function querySuffix(_0x595b80){const _0x49bd18=_0x5553,_0x10fdeb=_0x595b80['indexOf']('?');if(_0x10fdeb===-0x1)return'';const _0x2ba7f7=_0x595b80[_0x49bd18(0x167)](_0x10fdeb);return _0x2ba7f7[_0x49bd18(0x163)](_0x49bd18(0x151))?_0x2ba7f7:'';}function withVueQuery(_0x4e328f,_0x285d9d){const _0x4e33bf=querySuffix(_0x285d9d);return _0x4e33bf?''+_0x4e328f+_0x4e33bf:_0x4e328f;}function normalizeAdminId(_0x500704){const _0x266cd1=_0x5553,_0x4f4c7b=stripQuery(_0x500704);if(_0x4f4c7b==='/@'||_0x4f4c7b===_0x266cd1(0x14f))return _0x266cd1(0x17c);if(_0x4f4c7b[_0x266cd1(0x163)](_0x266cd1(0x14f)))return'vome-core/admin/'+_0x4f4c7b['slice'](_0x266cd1(0x14f)[_0x266cd1(0x18b)]);if(_0x4f4c7b==='@core/admin'||_0x4f4c7b[_0x266cd1(0x163)](_0x266cd1(0x14d)))return _0x4f4c7b[_0x266cd1(0x14a)](/^@core\//,_0x266cd1(0x14b));if(_0x4f4c7b===_0x266cd1(0x17c)||_0x4f4c7b[_0x266cd1(0x163)](_0x266cd1(0x183)))return _0x4f4c7b;return _0x4f4c7b;}function isAdminSpec(_0x1471b1){const _0x34d45f=_0x5553,_0xae3ac=normalizeAdminId(_0x1471b1);return _0xae3ac===_0x34d45f(0x17c)||_0xae3ac[_0x34d45f(0x163)](_0x34d45f(0x183));}export function vomePeerDepsPlugin(_0xa5cc56){const _0x25a095=_0x5553,_0x3cbe73=createRequire(_0x471c20[_0x25a095(0x172)](_0xa5cc56,_0x25a095(0x185))),_0x11d2ee=_0x471c20[_0x25a095(0x172)](_0xa5cc56,'node_modules'),_0x206d5a={'clsx':_0x471c20[_0x25a095(0x172)](_0x11d2ee,'clsx/dist/clsx.mjs'),'tailwind-merge':_0x471c20['join'](_0x11d2ee,_0x25a095(0x175)),'dompurify':_0x471c20[_0x25a095(0x172)](_0x11d2ee,_0x25a095(0x15e)),'marked':_0x471c20[_0x25a095(0x172)](_0x11d2ee,'marked/lib/marked.esm.js'),'vue-sonner':_0x471c20[_0x25a095(0x172)](_0x11d2ee,_0x25a095(0x17b)),'pinia':_0x471c20[_0x25a095(0x172)](_0x11d2ee,_0x25a095(0x164)),'reka-ui':_0x471c20[_0x25a095(0x172)](_0x11d2ee,_0x25a095(0x147)),'@lucide/vue':_0x471c20[_0x25a095(0x172)](_0x11d2ee,_0x25a095(0x150)),'lucide-vue-next':_0x471c20[_0x25a095(0x172)](_0x11d2ee,'lucide-vue-next/dist/esm/lucide-vue-next.js'),'class-variance-authority':_0x471c20[_0x25a095(0x172)](_0x11d2ee,_0x25a095(0x15c)),'xlsx':_0x471c20[_0x25a095(0x172)](_0x11d2ee,_0x25a095(0x188))};function _0x56f6ca(_0x3737bd){const _0x58cfa2=_0x25a095,_0x886647=_0x3737bd[_0x58cfa2(0x14a)](/\\/g,'/');return _0x886647[_0x58cfa2(0x15b)](_0x58cfa2(0x16b))||_0x886647['endsWith'](_0x58cfa2(0x184))||_0x886647[_0x58cfa2(0x18c)](_0x58cfa2(0x156))||_0x886647['includes'](_0x58cfa2(0x17d));}function _0x35bf71(_0x36abc3){const _0x48a30a=_0x25a095,_0x55a486=_0x206d5a[_0x36abc3];if(_0x55a486&&_0x89abd6[_0x48a30a(0x158)](_0x55a486))return _0x55a486;try{const _0x48825c=_0x3cbe73[_0x48a30a(0x15f)](_0x36abc3);if(_0x56f6ca(_0x48825c))return;return _0x48825c;}catch{return;}}function _0x2815c2(_0x42f83f){const _0x577839=_0x25a095;if(!_0x42f83f)return![];const _0x33ee3c=_0x42f83f[_0x577839(0x14a)](/\\/g,'/');return _0x33ee3c['includes'](_0x577839(0x169))||_0x33ee3c[_0x577839(0x18c)](_0x577839(0x177));}const _0x37d06a=new Set(['vue',_0x25a095(0x173),_0x25a095(0x176),_0x25a095(0x189)]);return{'name':_0x25a095(0x155),'enforce':'pre','resolveId'(_0xbdfe80,_0x262909){const _0x491248=_0x25a095,_0x21f838=_0xbdfe80[_0x491248(0x14a)](/^\0/,'');if(_0x21f838[_0x491248(0x163)](_0x491248(0x174))){const _0x799669=_0x21f838[_0x491248(0x167)](_0x491248(0x174)[_0x491248(0x18b)])[_0x491248(0x14a)](/:vome-core$/,'');return _0x35bf71(_0x799669);}if(_0x2815c2(_0x262909)){if(_0x206d5a[_0xbdfe80])return _0x35bf71(_0xbdfe80);if(_0x37d06a['has'](_0xbdfe80)||_0xbdfe80[_0x491248(0x163)](_0x491248(0x16e)))return;try{const _0x2ac4c8=_0x3cbe73['resolve'](_0xbdfe80);if(_0x56f6ca(_0x2ac4c8))return;return _0x2ac4c8;}catch{return;}}return;}};}function _0xeb0b(){const _0x33567e=['Aw5KzxGUDhm','nZG1nda2DMHUrMHb','y3DK','CMvRys11As9KAxn0l2LUzgv4lMPZ','DM9Tzs1JB3jLl2fKBwLUl3nLCNzPy2uVAw5KzxG','Cgf0Aa','CMvWBgfJzq','DM9Tzs1JB3jLlW','ntbhC1z3vwe','qgnVCMuVywrTAw4V','BM9Kzv9TB2r1BgvZl3zVBwuTy29Yzs9KAxn0l2fKBwLU','l0aV','qgX1y2LKzs92DwuVzgLZDc9LC20VBhvJAwrLlxz1zs5TANm','p3z1zq','DM9Tzs1OB3n0lwvZyNvPBgq','mZe4vxPzz25y','odmXmtjjsfDkAgW','DM9Tzs1WzwvYlwrLChm','l2rPC3qVy2PZlW','DgvZDa','zxHPC3rZu3LUyW','BM9YBwfSAxPL','C3bSAxq','zw5KC1DPDgG','y2XHC3mTDMfYAwfUy2uTyxv0Ag9YAxr5l2rPC3qVAw5KzxGUBwPZ','ndC3ndu1mhPjywPlAq','zg9TChvYAwz5l2rPC3qVChvYAwz5lMvZlM1QCW','CMvZB2X2zq','C2vYDMLJzs9PBMrLEa','lMnZCW','C2vYDMLJzs9PBMrLEc5QCW','C3rHCNrZv2L0Aa','CgLUAweVzgLZDc9WAw5Pys5TANm','DM9Tzs1Hzg1PBI1UBY1VChrPBwL6zq','mteZm2vKuNroAq','C2XPy2u','zgLYBMfTzq','l25VzgvFBw9KDwXLCY92B21LlwnVCMuV','lNrZ','lMnQCW','lNz1zq','nJnyzfnbALq','qhrPChrHCc8','Aw5KzxGUANm','mZmYm1jTq0HHqW','ndK2mdHArKjyv0i','AM9PBG','DNvLlxjVDxrLCG','x192AxrLlw9WDgLVBMfSlxbLzxiTzgvWoG','DgfPBhDPBMqTBwvYz2uVzgLZDc9IDw5KBguTBwPZlM1QCW','qhz1zxvZzs9JB3jL','l3zVBwuTy29Yzs9KAxn0lW','Aw5KzxGUDNvL','l3zVBwuTy29Yzs9KAxn0l2fKBwLUlW','C3rHDfn5BMm','DNvLlxnVBM5LCI9SAwiVAw5KzxGUANm','DM9Tzs1JB3jLl2fKBwLU','l2nQCY8','qgnVCMuV','B25szxnVBhzL','ndCXmZzOAeXrEwG','DM9Tzs1YzxnVBhzL','AxnbyNnVBhv0zq','DM9Tzs1JB3jLl2fKBwLUlW','lMnQCY5QCW','CgfJA2fNzs5QC29U','mJfLsuT5weq','mJe2ntCXogrez2jsrq','EgXZEc94Bhn4lM1QCW','D3vQAwu','qgnVCMu','BgvUz3rO','Aw5JBhvKzxm','lMPZ'];_0xeb0b=function(){return _0x33567e;};return _0xeb0b();}export function vomeResolvePlugin(_0x4661d2){const _0x4e5dc7=_0x5553,_0x112449=_0x471c20[_0x4e5dc7(0x15f)](_0x4661d2,_0x4e5dc7(0x14e)),_0x1bf20b=_0x471c20[_0x4e5dc7(0x15f)](_0x112449,_0x4e5dc7(0x162));function _0x183af3(_0x19fb7b,_0x3e7986){const _0x18379c=_0x4e5dc7,_0x2f0edd=normalizeAdminId(_0x19fb7b);if(_0x2f0edd==='vome-core/admin/service'||_0x2f0edd===_0x18379c(0x148)||_0x2f0edd==='vome-core/admin/service/index.js')return _0x1bf20b;const _0x30e13c=_0x471c20[_0x18379c(0x159)](_0x2f0edd);if(_0x30e13c===_0x471c20['normalize'](_0x1bf20b))return _0x1bf20b;if(_0x3e7986){const _0x583664=_0x471c20['dirname'](stripQuery(_0x3e7986));if(/vome-core[/\\]dist[/\\]admin/[_0x18379c(0x157)](_0x583664)){const _0x37ba81=_0x471c20['normalize'](_0x471c20[_0x18379c(0x15f)](_0x583664,_0x2f0edd));if(_0x37ba81===_0x471c20[_0x18379c(0x159)](_0x1bf20b)||_0x37ba81===_0x471c20[_0x18379c(0x159)](_0x471c20[_0x18379c(0x172)](_0x112449,'service'))||_0x37ba81===_0x471c20[_0x18379c(0x159)](_0x471c20[_0x18379c(0x172)](_0x112449,_0x18379c(0x160)))||_0x37ba81===_0x471c20[_0x18379c(0x159)](_0x471c20[_0x18379c(0x172)](_0x112449,'service/index.js')))return _0x1bf20b;}}return;}return{'name':_0x4e5dc7(0x181),'enforce':'pre','resolveId'(_0x43a301,_0x50eb82){const _0x577cd5=_0x4e5dc7,_0x455cfa=_0x183af3(_0x43a301,_0x50eb82);if(_0x455cfa)return withVueQuery(_0x455cfa,_0x43a301);if(_0x50eb82){const _0x273ab2=stripQuery(_0x50eb82)[_0x577cd5(0x14a)](/\\/g,'/');if(_0x273ab2[_0x577cd5(0x18c)](_0x577cd5(0x179))){const _0x45d045=stripQuery(_0x43a301);if(_0x45d045[_0x577cd5(0x163)]('.')||_0x471c20[_0x577cd5(0x182)](_0x45d045)){const _0x3467cd=_0x471c20[_0x577cd5(0x159)](_0x471c20[_0x577cd5(0x182)](_0x45d045)?_0x45d045:_0x471c20['resolve'](_0x471c20[_0x577cd5(0x168)](stripQuery(_0x50eb82)),_0x45d045)),_0x379772=resolveFile(_0x3467cd)??(_0x89abd6['existsSync'](_0x3467cd)&&_0x89abd6[_0x577cd5(0x17a)](_0x3467cd)['isFile']()?_0x3467cd:null);if(_0x379772)return withVueQuery(_0x379772,_0x43a301);}}}if(!isAdminSpec(_0x43a301))return;const _0x2cff58=normalizeAdminId(_0x43a301),_0xa70325=_0x2cff58===_0x577cd5(0x17c)?'':_0x2cff58['slice'](_0x577cd5(0x183)[_0x577cd5(0x18b)]),_0x1d057b=resolveFile(_0x471c20['resolve'](_0x112449,_0xa70325));return _0x1d057b?withVueQuery(_0x1d057b,_0x43a301):undefined;}};}function _0x5553(_0x31332d,_0xb5d576){_0x31332d=_0x31332d-0x143;const _0xeb0b42=_0xeb0b();let _0x555382=_0xeb0b42[_0x31332d];if(_0x5553['MdODBM']===undefined){var _0x1ad968=function(_0x49f1b6){const _0x5733ea='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x89abd6='',_0x471c20='';for(let _0x20eabb=0x0,_0x3603ba,_0x12e4e0,_0x307cf5=0x0;_0x12e4e0=_0x49f1b6['charAt'](_0x307cf5++);~_0x12e4e0&&(_0x3603ba=_0x20eabb%0x4?_0x3603ba*0x40+_0x12e4e0:_0x12e4e0,_0x20eabb++%0x4)?_0x89abd6+=String['fromCharCode'](0xff&_0x3603ba>>(-0x2*_0x20eabb&0x6)):0x0){_0x12e4e0=_0x5733ea['indexOf'](_0x12e4e0);}for(let _0x595b80=0x0,_0x10fdeb=_0x89abd6['length'];_0x595b80<_0x10fdeb;_0x595b80++){_0x471c20+='%'+('00'+_0x89abd6['charCodeAt'](_0x595b80)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x471c20);};_0x5553['XsLEzM']=_0x1ad968,_0x5553['qbZdHe']={},_0x5553['MdODBM']=!![];}const _0x3cb263=_0xeb0b42[0x0],_0x369b97=_0x31332d+_0x3cb263,_0x5068dd=_0x5553['qbZdHe'][_0x369b97];return!_0x5068dd?(_0x555382=_0x5553['XsLEzM'](_0x555382),_0x5553['qbZdHe'][_0x369b97]=_0x555382):_0x555382=_0x5068dd,_0x555382;}export function vomeAdminNoOptimizePlugin(){const _0xb8bc0d=_0x5553;return{'name':_0xb8bc0d(0x165),'enforce':'pre','config'(){return{'optimizeDeps':{'exclude':['vome-core']}};},'resolveId'(_0x1d3f17){const _0x283f6b=_0xb8bc0d;if(_0x1d3f17===_0x283f6b(0x18a)||_0x1d3f17['startsWith'](_0x283f6b(0x17e)))return;return;}};}export function vomeHostEsbuildPlugin(_0xf8dec6){const _0xcc0ad5=_0x5553,_0x1b97c5=_0xf8dec6||process[_0xcc0ad5(0x146)](),_0x5debd3=_0x471c20[_0xcc0ad5(0x15f)](_0x1b97c5,_0xcc0ad5(0x14e));return{'name':_0xcc0ad5(0x152),'setup'(_0x27518b){const _0x1f1ad0=_0xcc0ad5;_0x27518b[_0x1f1ad0(0x17f)]({'filter':/^@core\/admin(\/|$)|^\/@(\/|$)/},_0x3cb32a=>{const _0x1e2290=_0x1f1ad0,_0xa97016=normalizeAdminId(_0x3cb32a[_0x1e2290(0x149)]),_0x1efc54=_0xa97016===_0x1e2290(0x17c)?'':_0xa97016[_0x1e2290(0x167)](_0x1e2290(0x183)['length']),_0x56af7b=resolveFile(_0x471c20['resolve'](_0x5debd3,_0x1efc54));if(!_0x56af7b)return{'path':_0x3cb32a[_0x1e2290(0x149)],'external':!![]};return{'path':_0x56af7b,'external':!![]};});}};}
|
package/dist/config/index.d.ts
CHANGED
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
* import { provideHostConfig, merge, getEnv } from 'vome-core/config'
|
|
6
6
|
* provideHostConfig(merge(defaultConfig, envConfig))
|
|
7
7
|
*/
|
|
8
|
-
export { provideHostConfig
|
|
8
|
+
export { provideHostConfig } from '../core/config';
|
|
9
9
|
export { merge } from '../comm/merge';
|
|
10
10
|
export { getEnv } from '../comm/env';
|
package/dist/config/index.js
CHANGED
|
@@ -1,118 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
function __accessProp(key) {
|
|
8
|
-
return this[key];
|
|
9
|
-
}
|
|
10
|
-
var __toESMCache_node;
|
|
11
|
-
var __toESMCache_esm;
|
|
12
|
-
var __toESM = (mod, isNodeMode, target) => {
|
|
13
|
-
var canCache = mod != null && typeof mod === "object";
|
|
14
|
-
if (canCache) {
|
|
15
|
-
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
16
|
-
var cached = cache.get(mod);
|
|
17
|
-
if (cached)
|
|
18
|
-
return cached;
|
|
19
|
-
}
|
|
20
|
-
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
21
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
22
|
-
if (mod && typeof mod === "object" || typeof mod === "function") {
|
|
23
|
-
for (let key of __getOwnPropNames(mod))
|
|
24
|
-
if (!__hasOwnProp.call(to, key))
|
|
25
|
-
__defProp(to, key, {
|
|
26
|
-
get: __accessProp.bind(mod, key),
|
|
27
|
-
enumerable: true
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
if (canCache)
|
|
31
|
-
cache.set(mod, to);
|
|
32
|
-
return to;
|
|
33
|
-
};
|
|
34
|
-
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
35
|
-
var __returnValue = (v) => v;
|
|
36
|
-
function __exportSetter(name, newValue) {
|
|
37
|
-
this[name] = __returnValue.bind(null, newValue);
|
|
38
|
-
}
|
|
39
|
-
var __export = (target, all) => {
|
|
40
|
-
for (var name in all)
|
|
41
|
-
__defProp(target, name, {
|
|
42
|
-
get: all[name],
|
|
43
|
-
enumerable: true,
|
|
44
|
-
configurable: true,
|
|
45
|
-
set: __exportSetter.bind(all, name)
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
49
|
-
var __promiseAll = (args) => Promise.all(args);
|
|
50
|
-
var __require = import.meta.require;
|
|
51
|
-
|
|
52
|
-
// src/comm/env.ts
|
|
53
|
-
function getEnv() {
|
|
54
|
-
return Bun.env.NODE_ENV === "dev" ? "dev" : "prod";
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// src/core/config.ts
|
|
58
|
-
function deepFreeze(value) {
|
|
59
|
-
if (!value || typeof value !== "object")
|
|
60
|
-
return value;
|
|
61
|
-
Object.freeze(value);
|
|
62
|
-
if (Array.isArray(value)) {
|
|
63
|
-
for (const item of value)
|
|
64
|
-
deepFreeze(item);
|
|
65
|
-
} else {
|
|
66
|
-
for (const key of Object.keys(value)) {
|
|
67
|
-
deepFreeze(value[key]);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return value;
|
|
71
|
-
}
|
|
72
|
-
function provideHostConfig(config) {
|
|
73
|
-
if (g[HOST_CONFIG_KEY]) {
|
|
74
|
-
throw new Error("[vome-core] provideHostConfig \u53EA\u80FD\u8C03\u7528\u4E00\u6B21");
|
|
75
|
-
}
|
|
76
|
-
if (!config || typeof config !== "object" || Array.isArray(config)) {
|
|
77
|
-
throw new Error("[vome-core] provideHostConfig \u9700\u8981\u666E\u901A\u5BF9\u8C61\u914D\u7F6E");
|
|
78
|
-
}
|
|
79
|
-
g[HOST_CONFIG_KEY] = deepFreeze(structuredClone(config));
|
|
80
|
-
}
|
|
81
|
-
function hasHostConfig() {
|
|
82
|
-
return g[HOST_CONFIG_KEY] != null;
|
|
83
|
-
}
|
|
84
|
-
async function loadConfig() {
|
|
85
|
-
const provided = g[HOST_CONFIG_KEY];
|
|
86
|
-
if (provided)
|
|
87
|
-
return provided;
|
|
88
|
-
throw new Error(`[vome-core] \u672A\u8C03\u7528 provideHostConfig\uFF08env=${getEnv()}\uFF09\u3002` + `\u8BF7\u5728 src/index.ts \u6700\u524D import './config/provide'\uFF0C\u7981\u6B62\u4ECE\u78C1\u76D8\u52A0\u8F7D src/config\u3002`);
|
|
89
|
-
}
|
|
90
|
-
var HOST_CONFIG_KEY, g;
|
|
91
|
-
var init_config = __esm(() => {
|
|
92
|
-
HOST_CONFIG_KEY = Symbol.for("vome.hostConfig");
|
|
93
|
-
g = globalThis;
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
// src/config/index.ts
|
|
97
|
-
init_config();
|
|
98
|
-
|
|
99
|
-
// src/comm/merge.ts
|
|
100
|
-
function merge(base, override) {
|
|
101
|
-
const result = { ...base };
|
|
102
|
-
for (const key of Object.keys(override)) {
|
|
103
|
-
const baseVal = result[key];
|
|
104
|
-
const overrideVal = override[key];
|
|
105
|
-
if (baseVal && overrideVal && typeof baseVal === "object" && typeof overrideVal === "object" && !Array.isArray(baseVal) && !Array.isArray(overrideVal)) {
|
|
106
|
-
result[key] = merge(baseVal, overrideVal);
|
|
107
|
-
continue;
|
|
108
|
-
}
|
|
109
|
-
result[key] = overrideVal;
|
|
110
|
-
}
|
|
111
|
-
return result;
|
|
112
|
-
}
|
|
113
|
-
export {
|
|
114
|
-
getEnv,
|
|
115
|
-
hasHostConfig,
|
|
116
|
-
merge,
|
|
117
|
-
provideHostConfig
|
|
118
|
-
};
|
|
1
|
+
var _0x57fa3a=_0x15e0;(function(_0x3072b8,_0x235617){var _0x184027=_0x15e0,_0x3d519b=_0x3072b8();while(!![]){try{var _0x143849=parseInt(_0x184027(0x1f5))/0x1+parseInt(_0x184027(0x20c))/0x2+-parseInt(_0x184027(0x1f3))/0x3+-parseInt(_0x184027(0x1fe))/0x4+-parseInt(_0x184027(0x20a))/0x5*(-parseInt(_0x184027(0x208))/0x6)+-parseInt(_0x184027(0x20e))/0x7*(-parseInt(_0x184027(0x203))/0x8)+parseInt(_0x184027(0x209))/0x9;if(_0x143849===_0x235617)break;else _0x3d519b['push'](_0x3d519b['shift']());}catch(_0x41f2df){_0x3d519b['push'](_0x3d519b['shift']());}}}(_0x4b81,0xe3f03));var __create=Object[_0x57fa3a(0x1f9)],__getProtoOf=Object[_0x57fa3a(0x204)],__defProp=Object['defineProperty'],__getOwnPropNames=Object[_0x57fa3a(0x202)],__hasOwnProp=Object[_0x57fa3a(0x1ff)][_0x57fa3a(0x200)];function _0x4b81(){var _0x118694=['z2v0uhjVDg90ExbLt2y','zNvUy3rPB24','w3zVBwuTy29Yzv0GChjVDMLKzuHVC3rdB25MAwCG6zYa6kAb5PMU6ycA5A+56lgH6ywn572U','zxHWB3j0CW','ote5nJi2q1HsqvD2','ndq4odu3qMHmufH5','nw9ZAK9SzW','zNjLzxPL','mZu2odCZmhjuBNnrza','6k+35zYOihnYyY9PBMrLEc50CYdMNidLIy0GAw1WB3j0icCUl2nVBMzPzY9WCM92AwrLj++8JoEMGEATOUs7JUEJGEEBMowkOoI9VsbZCMmVy29UzMLN44cc','nta0ndm4oxPbAwjkwq','AxnbCNjHEq','A2v5CW','tK9erv9ftLy','z2v0','otG4mZC0teT5r2jl','C2v0','mZu4mZC0C2nszu1V','y2fSBa','w3zVBwuTy29Yzv0G5PYQ6lcd55sOihbYB3zPzgviB3n0q29UzMLN77Yizw52pq','zw52','y3jLyxrL','ywXS','yMLUza','zgv2','B2jQzwn0','nZiXmZy2ofjrDMnUua','ChjVDg90ExbL','AgfZt3DUuhjVCgvYDhK','ChjVza','z2v0t3DUuhjVCgvYDhLoyw1LCW','ogTPv1DYzG'];_0x4b81=function(){return _0x118694;};return _0x4b81();}function __accessProp(_0x35d83f){return this[_0x35d83f];}var __toESMCache_node,__toESMCache_esm,__toESM=(_0xec837a,_0x3d7552,_0xcf1ec9)=>{var _0x32fbcd=_0x57fa3a,_0x521e90=_0xec837a!=null&&typeof _0xec837a===_0x32fbcd(0x1fd);if(_0x521e90){var _0x38a930=_0x3d7552?__toESMCache_node??=new WeakMap():__toESMCache_esm??=new WeakMap(),_0x26602f=_0x38a930[_0x32fbcd(0x212)](_0xec837a);if(_0x26602f)return _0x26602f;}_0xcf1ec9=_0xec837a!=null?__create(__getProtoOf(_0xec837a)):{};const _0x4e5f67=_0x3d7552||!_0xec837a||!_0xec837a['__esModule']?__defProp(_0xcf1ec9,'default',{'value':_0xec837a,'enumerable':!![]}):_0xcf1ec9;if(_0xec837a&&typeof _0xec837a==='object'||typeof _0xec837a===_0x32fbcd(0x205)){for(let _0x41bd34 of __getOwnPropNames(_0xec837a))if(!__hasOwnProp[_0x32fbcd(0x1f6)](_0x4e5f67,_0x41bd34))__defProp(_0x4e5f67,_0x41bd34,{'get':__accessProp[_0x32fbcd(0x1fb)](_0xec837a,_0x41bd34),'enumerable':!![]});}if(_0x521e90)_0x38a930[_0x32fbcd(0x1f4)](_0xec837a,_0x4e5f67);return _0x4e5f67;},__commonJS=(_0x3599a6,_0xbe6b70)=>()=>(_0xbe6b70||_0x3599a6((_0xbe6b70={'exports':{}})[_0x57fa3a(0x207)],_0xbe6b70),_0xbe6b70[_0x57fa3a(0x207)]),__returnValue=_0x583a4f=>_0x583a4f;function __exportSetter(_0x9bd90f,_0xb4d0f0){this[_0x9bd90f]=__returnValue['bind'](null,_0xb4d0f0);}var __export=(_0x53a471,_0x5be94b)=>{var _0x33b46d=_0x57fa3a;for(var _0x148be0 in _0x5be94b)__defProp(_0x53a471,_0x148be0,{'get':_0x5be94b[_0x148be0],'enumerable':!![],'configurable':!![],'set':__exportSetter[_0x33b46d(0x1fb)](_0x5be94b,_0x148be0)});},__esm=(_0x144ab0,_0x2c0189)=>()=>(_0x144ab0&&(_0x2c0189=_0x144ab0(_0x144ab0=0x0)),_0x2c0189),__promiseAll=_0x54becf=>Promise[_0x57fa3a(0x1fa)](_0x54becf),__require=import.meta.require;function getEnv(){var _0xf5adc5=_0x57fa3a;return Bun[_0xf5adc5(0x1f8)][_0xf5adc5(0x211)]===_0xf5adc5(0x1fc)?'dev':_0xf5adc5(0x201);}function deepFreeze(_0x264a61){var _0x4debce=_0x57fa3a;if(!_0x264a61||typeof _0x264a61!==_0x4debce(0x1fd))return _0x264a61;Object[_0x4debce(0x20b)](_0x264a61);if(Array['isArray'](_0x264a61)){for(const _0x129f12 of _0x264a61)deepFreeze(_0x129f12);}else for(const _0x33f668 of Object[_0x4debce(0x210)](_0x264a61)){deepFreeze(_0x264a61[_0x33f668]);}return _0x264a61;}function provideHostConfig(_0x61f9ca){var _0x48b090=_0x57fa3a;if(g[HOST_CONFIG_KEY])throw new Error('[vome-core]\x20provideHostConfig\x20\u53EA\u80FD\u8C03\u7528\u4E00\u6B21');if(!_0x61f9ca||typeof _0x61f9ca!==_0x48b090(0x1fd)||Array[_0x48b090(0x20f)](_0x61f9ca))throw new Error(_0x48b090(0x206));g[HOST_CONFIG_KEY]=deepFreeze(structuredClone(_0x61f9ca));}async function loadConfig(){var _0x58b68c=_0x57fa3a;const _0x26e0d3=g[HOST_CONFIG_KEY];if(_0x26e0d3)return _0x26e0d3;throw new Error(_0x58b68c(0x1f7)+getEnv()+')。'+_0x58b68c(0x20d));}var HOST_CONFIG_KEY,g,init_config=__esm(()=>{HOST_CONFIG_KEY=Symbol['for']('vome.hostConfig'),g=globalThis;});init_config();function merge(_0xe84375,_0x38a904){var _0x50f4d4=_0x57fa3a;const _0x55440d={..._0xe84375};for(const _0xc544a7 of Object[_0x50f4d4(0x210)](_0x38a904)){const _0xc9c2b2=_0x55440d[_0xc544a7],_0x5dbaaf=_0x38a904[_0xc544a7];if(_0xc9c2b2&&_0x5dbaaf&&typeof _0xc9c2b2===_0x50f4d4(0x1fd)&&typeof _0x5dbaaf===_0x50f4d4(0x1fd)&&!Array['isArray'](_0xc9c2b2)&&!Array['isArray'](_0x5dbaaf)){_0x55440d[_0xc544a7]=merge(_0xc9c2b2,_0x5dbaaf);continue;}_0x55440d[_0xc544a7]=_0x5dbaaf;}return _0x55440d;}function _0x15e0(_0x22f96b,_0x26a09f){_0x22f96b=_0x22f96b-0x1f3;var _0x4b8196=_0x4b81();var _0x15e0da=_0x4b8196[_0x22f96b];if(_0x15e0['rnrdDG']===undefined){var _0x126c3f=function(_0x848482){var _0x7cb4af='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x35d83f='',_0xec837a='';for(var _0x3d7552=0x0,_0xcf1ec9,_0x521e90,_0x38a930=0x0;_0x521e90=_0x848482['charAt'](_0x38a930++);~_0x521e90&&(_0xcf1ec9=_0x3d7552%0x4?_0xcf1ec9*0x40+_0x521e90:_0x521e90,_0x3d7552++%0x4)?_0x35d83f+=String['fromCharCode'](0xff&_0xcf1ec9>>(-0x2*_0x3d7552&0x6)):0x0){_0x521e90=_0x7cb4af['indexOf'](_0x521e90);}for(var _0x26602f=0x0,_0x4e5f67=_0x35d83f['length'];_0x26602f<_0x4e5f67;_0x26602f++){_0xec837a+='%'+('00'+_0x35d83f['charCodeAt'](_0x26602f)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xec837a);};_0x15e0['wdhRvy']=_0x126c3f,_0x15e0['XHchzX']={},_0x15e0['rnrdDG']=!![];}var _0x23b363=_0x4b8196[0x0],_0xe86aec=_0x22f96b+_0x23b363,_0x448a39=_0x15e0['XHchzX'][_0xe86aec];return!_0x448a39?(_0x15e0da=_0x15e0['wdhRvy'](_0x15e0da),_0x15e0['XHchzX'][_0xe86aec]=_0x15e0da):_0x15e0da=_0x448a39,_0x15e0da;}export{getEnv,merge,provideHostConfig};
|
|
@@ -36,8 +36,6 @@ export type HostBindings = {
|
|
|
36
36
|
/** 宿主入口在 vome() 之前调用;可多次合并 */
|
|
37
37
|
export declare function registerHost(next: HostBindings): void;
|
|
38
38
|
export declare function getHostBindings(): HostBindings;
|
|
39
|
-
/** @internal App.stop 时清空,便于测试重复 start */
|
|
40
|
-
export declare function resetHostBindings(): void;
|
|
41
39
|
/**
|
|
42
40
|
* 内置基建:Db → Cache → Queue → Auth
|
|
43
41
|
*/
|
package/dist/core/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export { VomeConfig } from './vome-config';
|
|
5
5
|
export { App, vome } from './app';
|
|
6
|
-
export { registerHost, getHostBindings,
|
|
6
|
+
export { registerHost, getHostBindings, } from './host-infra';
|
|
7
7
|
export type { HostBindings, HostLifecycle, HostMiddleware, HostSocket, } from './host-infra';
|
|
8
8
|
export { Context } from './context';
|
|
9
9
|
export type { ContextData } from './context';
|
package/dist/i18n/data-i18n.d.ts
CHANGED
|
@@ -38,7 +38,6 @@ export type DataI18nApplier = (rows: unknown, ctx: {
|
|
|
38
38
|
}) => Promise<unknown>;
|
|
39
39
|
export declare function registerDataI18nApplier(fn: DataI18nApplier | null): void;
|
|
40
40
|
export declare function registerDataI18nFieldLoader(fn: ((tableName: string) => Promise<DataI18nFieldConfig[]>) | null): void;
|
|
41
|
-
export declare function resolveLangCode(request?: Request, fallback?: string): string;
|
|
42
41
|
export declare function shouldApplyDataI18n(langCode?: string): boolean;
|
|
43
42
|
/** 默认内存替换(宿主可 registerDataI18nApplier 覆盖) */
|
|
44
43
|
export declare function applyDataI18nDefault(rows: unknown, ctx: DataI18nApplyContext): Promise<unknown>;
|