@creopse/bridge 0.1.20 → 0.1.22
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/react/components/CustomTransition/CustomTransition.js +1 -1
- package/dist/react/components/PageLayout/PageLayout.js +1 -1
- package/dist/react/hooks/access.js +1 -1
- package/dist/react/hooks/core-bridge.js +1 -1
- package/dist/react/hooks/user-preference.js +2 -2
- package/dist/react-DqofO0Uc.js +118 -0
- package/dist/vite/helper.d.ts +7 -0
- package/dist/vite/index.d.ts +2 -0
- package/dist/vite/index.js +4 -3
- package/dist/vite/react.d.ts +5 -38
- package/dist/vite/react.js +9 -147
- package/dist/vite/types.d.ts +57 -0
- package/dist/vite/vue.js +58 -76
- package/dist/vue/composables/access.js +8 -9
- package/dist/vue/composables/core-bridge.js +1 -1
- package/dist/vue/composables/user-preference.js +9 -13
- package/package.json +7 -12
- package/dist/index-C8b1StIO.js +0 -17
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { AnimatePresence as l, motion as s } from "
|
|
2
|
+
import { AnimatePresence as l, motion as s } from "framer-motion";
|
|
3
3
|
const d = ({
|
|
4
4
|
name: a = "fade",
|
|
5
5
|
mode: n = "wait",
|
|
@@ -12,7 +12,7 @@ const p = () => {
|
|
|
12
12
|
accessGuards: r,
|
|
13
13
|
getAccessGuardLabel: (e) => r.find((s) => s.value === e)?.label,
|
|
14
14
|
getAccessGuardTagType: (e) => r.find((s) => s.value === e)?.tagType || "default",
|
|
15
|
-
getRoleName: (e, s) => e?.find((n) => n.id === s)?.name || window.__creopse__
|
|
15
|
+
getRoleName: (e, s) => e?.find((n) => n.id === s)?.name || window.__creopse__?.i18n.t("undefined"),
|
|
16
16
|
isPermissionNative: l,
|
|
17
17
|
userIsSuperAdmin: u,
|
|
18
18
|
userCan: c,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useStore as r } from "zustand";
|
|
2
2
|
const h = () => {
|
|
3
|
-
const { sharedData: e, api: o, i18n: s, router: a, helpers: n, stores: t } = window.__creopse__, i = r(
|
|
3
|
+
const { sharedData: e, api: o, i18n: s, router: a, helpers: n, stores: t } = window.__creopse__ || {}, i = r(
|
|
4
4
|
t.auth
|
|
5
5
|
), u = r(
|
|
6
6
|
t.server
|
|
@@ -4,12 +4,12 @@ const a = () => {
|
|
|
4
4
|
const [o, t] = l({
|
|
5
5
|
inAppNotifEnabled: e.TRUE,
|
|
6
6
|
emailNotifEnabled: e.TRUE,
|
|
7
|
-
locale: window.__creopse__
|
|
7
|
+
locale: window.__creopse__?.i18n.getLocale()
|
|
8
8
|
});
|
|
9
9
|
return f(() => {
|
|
10
10
|
t((r) => ({
|
|
11
11
|
...r,
|
|
12
|
-
locale: window.__creopse__
|
|
12
|
+
locale: window.__creopse__?.i18n.getLocale()
|
|
13
13
|
}));
|
|
14
14
|
}, []), { defaultPrefs: o };
|
|
15
15
|
};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import h from "@vitejs/plugin-basic-ssl";
|
|
2
|
+
import { parse as A, stringify as y } from "comment-json";
|
|
3
|
+
import c from "path";
|
|
4
|
+
import w from "rollup-plugin-copy";
|
|
5
|
+
import S from "vite-plugin-auto-import-lite";
|
|
6
|
+
import _ from "vite-plugin-json5";
|
|
7
|
+
import E from "vite-plugin-top-level-await";
|
|
8
|
+
import { DASHBOARD_MODULE_NAME as I, SETTINGS_MODULE_NAME as D, sanitizeId as b } from "@creopse/utils/helpers";
|
|
9
|
+
import g from "fs";
|
|
10
|
+
function j(e = "./manifest.jsonc") {
|
|
11
|
+
const d = process.cwd(), l = c.resolve(d, e), n = {};
|
|
12
|
+
let m = "creopse-plugin", r = "remoteEntry.js", t;
|
|
13
|
+
try {
|
|
14
|
+
if (g.existsSync(l)) {
|
|
15
|
+
const f = g.readFileSync(l, "utf-8");
|
|
16
|
+
if (t = A(f || "{}"), Array.isArray(t.pages))
|
|
17
|
+
for (const a of t.pages)
|
|
18
|
+
a.name && a.module && (n[`./${a.name}`] = a.module);
|
|
19
|
+
const o = t.dashboard;
|
|
20
|
+
o?.module && (n[`./${I}`] = o.module);
|
|
21
|
+
const i = t.settings;
|
|
22
|
+
i?.module && (n[`./${D}`] = i.module), m = b(String(t.id)) || m, r = t.entry || r;
|
|
23
|
+
}
|
|
24
|
+
} catch (f) {
|
|
25
|
+
console.error(`[Creopse] Failed to parse manifest at ${l}:`, f);
|
|
26
|
+
}
|
|
27
|
+
return { pluginId: m, pluginEntry: r, exposes: n, manifest: t };
|
|
28
|
+
}
|
|
29
|
+
function T(e = {}) {
|
|
30
|
+
const {
|
|
31
|
+
srcDir: d = "./src",
|
|
32
|
+
outDir: l = "frontend",
|
|
33
|
+
hooksDirs: n = ["src/hooks"],
|
|
34
|
+
eslintAutoImport: m = !1
|
|
35
|
+
} = e, r = process.cwd(), t = process.env.APP_IS_PREVIEW === "true", f = typeof e.manifest == "object" ? e.manifest : j(e.manifest || "./manifest.jsonc"), { manifest: o } = f, i = o?.development, a = !!i?.ssl, v = {
|
|
36
|
+
name: "creopse-react-plugin",
|
|
37
|
+
config(s) {
|
|
38
|
+
const p = s.root || r, u = c.resolve(p, l), P = typeof e.manifest == "string" ? e.manifest : "./manifest.jsonc";
|
|
39
|
+
return {
|
|
40
|
+
envPrefix: "APP_",
|
|
41
|
+
resolve: {
|
|
42
|
+
alias: [{ find: "@", replacement: c.resolve(p, d) }],
|
|
43
|
+
dedupe: ["react", "react-dom", "zustand"]
|
|
44
|
+
},
|
|
45
|
+
build: {
|
|
46
|
+
target: "esnext",
|
|
47
|
+
outDir: u,
|
|
48
|
+
assetsInlineLimit: 1 / 0,
|
|
49
|
+
cssCodeSplit: !1,
|
|
50
|
+
rollupOptions: {
|
|
51
|
+
plugins: [
|
|
52
|
+
w({
|
|
53
|
+
targets: [
|
|
54
|
+
{
|
|
55
|
+
src: c.resolve(r, P),
|
|
56
|
+
dest: u,
|
|
57
|
+
transform() {
|
|
58
|
+
return o?.mode && (o.mode = t ? "development" : "production"), y(o, null, 2).replace(
|
|
59
|
+
/(,)\s*\n/g,
|
|
60
|
+
`,
|
|
61
|
+
|
|
62
|
+
`
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
hook: "writeBundle"
|
|
68
|
+
})
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
preview: {
|
|
73
|
+
port: i?.previewPort || 2160,
|
|
74
|
+
strictPort: !0,
|
|
75
|
+
cors: !0,
|
|
76
|
+
headers: { "Access-Control-Allow-Origin": "*" }
|
|
77
|
+
},
|
|
78
|
+
server: {
|
|
79
|
+
port: i?.serverPort || 2161,
|
|
80
|
+
cors: !0,
|
|
81
|
+
headers: { "Access-Control-Allow-Origin": "*" }
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
},
|
|
85
|
+
configureServer(s) {
|
|
86
|
+
const p = typeof e.manifest == "string" ? c.resolve(r, e.manifest) : c.resolve(r, "./manifest.jsonc");
|
|
87
|
+
s.watcher.add(p), s.watcher.on("change", (u) => {
|
|
88
|
+
u === p && (console.info(`
|
|
89
|
+
[Creopse] Manifest changed, restarting server...`), s.restart());
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
return [
|
|
94
|
+
_(),
|
|
95
|
+
E({
|
|
96
|
+
promiseExportName: "__tla",
|
|
97
|
+
promiseImportName: (s) => `__tla_${s}`
|
|
98
|
+
}),
|
|
99
|
+
S({
|
|
100
|
+
dirs: n,
|
|
101
|
+
imports: ["react"],
|
|
102
|
+
vueTemplate: !1,
|
|
103
|
+
...m ? {
|
|
104
|
+
eslintrc: {
|
|
105
|
+
enabled: !0,
|
|
106
|
+
filepath: "./.eslintrc-auto-import.json",
|
|
107
|
+
globalsPropValue: !0
|
|
108
|
+
}
|
|
109
|
+
} : {}
|
|
110
|
+
}),
|
|
111
|
+
...a ? [h()] : [],
|
|
112
|
+
v
|
|
113
|
+
];
|
|
114
|
+
}
|
|
115
|
+
export {
|
|
116
|
+
T as C,
|
|
117
|
+
j as l
|
|
118
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CreopseManifestData } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Loads and parses the Creopse manifest.jsonc.
|
|
4
|
+
* Centralizing this allows sharing the manifest data between the
|
|
5
|
+
* federation plugin and the Creopse plugin.
|
|
6
|
+
*/
|
|
7
|
+
export declare function loadCreopseManifest(manifestPath?: string): CreopseManifestData;
|
package/dist/vite/index.d.ts
CHANGED
package/dist/vite/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CreopseVuePlugin as r } from "./vue.js";
|
|
2
|
-
import {
|
|
2
|
+
import { C as a, l as p } from "../react-DqofO0Uc.js";
|
|
3
3
|
export {
|
|
4
|
-
|
|
5
|
-
r as CreopseVuePlugin
|
|
4
|
+
a as CreopseReactPlugin,
|
|
5
|
+
r as CreopseVuePlugin,
|
|
6
|
+
p as loadCreopseManifest
|
|
6
7
|
};
|
package/dist/vite/react.d.ts
CHANGED
|
@@ -1,40 +1,7 @@
|
|
|
1
1
|
import { PluginOption } from 'vite';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
manifestPath?: string;
|
|
8
|
-
/**
|
|
9
|
-
* Source directory, relative to the project root.
|
|
10
|
-
* @default './src'
|
|
11
|
-
*/
|
|
12
|
-
srcDir?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Output directory for the build.
|
|
15
|
-
* @default 'frontend'
|
|
16
|
-
*/
|
|
17
|
-
outDir?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Path to the i18n locales directory, relative to the project root.
|
|
20
|
-
* @default './src/i18n/locales'
|
|
21
|
-
*/
|
|
22
|
-
i18nLocalesPath?: string;
|
|
23
|
-
/**
|
|
24
|
-
* Directories to scan for auto-imports, relative to the project root.
|
|
25
|
-
* @default ['src/hooks']
|
|
26
|
-
*/
|
|
27
|
-
hooksDirs?: string[];
|
|
28
|
-
/**
|
|
29
|
-
* Shared modules for Module Federation.
|
|
30
|
-
* 'react', 'react-dom' and 'zustand' are always included.
|
|
31
|
-
* @default []
|
|
32
|
-
*/
|
|
33
|
-
shared?: string[];
|
|
34
|
-
/**
|
|
35
|
-
* Whether to generate an eslint auto-import config file.
|
|
36
|
-
* @default false
|
|
37
|
-
*/
|
|
38
|
-
eslintAutoImport?: boolean;
|
|
39
|
-
}
|
|
2
|
+
import { CreopseReactPluginOptions } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Vite plugin for Creopse React plugins.
|
|
5
|
+
* Consolidates configuration, environment setup, and automated asset management.
|
|
6
|
+
*/
|
|
40
7
|
export declare function CreopseReactPlugin(options?: CreopseReactPluginOptions): PluginOption[];
|
package/dist/vite/react.js
CHANGED
|
@@ -1,149 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import $ from "vite-plugin-i18next-loader";
|
|
10
|
-
import B from "vite-plugin-json5";
|
|
11
|
-
import z from "vite-plugin-top-level-await";
|
|
12
|
-
function X(A = {}) {
|
|
13
|
-
const {
|
|
14
|
-
manifestPath: w = "./manifest.jsonc",
|
|
15
|
-
srcDir: f = "./src",
|
|
16
|
-
outDir: u = "frontend",
|
|
17
|
-
i18nLocalesPath: g,
|
|
18
|
-
hooksDirs: _ = ["src/hooks"],
|
|
19
|
-
shared: y = [],
|
|
20
|
-
eslintAutoImport: E = !1
|
|
21
|
-
} = A, s = process.cwd(), t = a.resolve(s, w), S = process.env.APP_IS_PREVIEW === "true";
|
|
22
|
-
let e;
|
|
23
|
-
const n = {};
|
|
24
|
-
let i = "creopse-plugin", l = "remoteEntry.js", c = 2160, p = 2161, m = !1;
|
|
25
|
-
try {
|
|
26
|
-
if (v.existsSync(t)) {
|
|
27
|
-
const r = v.readFileSync(t, "utf-8");
|
|
28
|
-
if (e = R(r || "{}"), e.pages && Array.isArray(e.pages))
|
|
29
|
-
for (const h of e.pages)
|
|
30
|
-
n[`./${h.name}`] = h.module;
|
|
31
|
-
const o = e.dashboard;
|
|
32
|
-
o?.module && (n[`./${D}`] = o.module);
|
|
33
|
-
const P = e.settings;
|
|
34
|
-
P?.module && (n[`./${L}`] = P.module);
|
|
35
|
-
const d = e.development;
|
|
36
|
-
i = M(String(e.id)) || i, l = e.entry || l, c = d?.previewPort || c, p = d?.serverPort || p, m = d?.ssl || m;
|
|
37
|
-
} else
|
|
38
|
-
console.warn(
|
|
39
|
-
`[CreopseReactPlugin] Warning: Manifest not found at ${t}`
|
|
40
|
-
);
|
|
41
|
-
} catch (r) {
|
|
42
|
-
console.error(
|
|
43
|
-
"[CreopseReactPlugin] Fatal error while parsing manifest:",
|
|
44
|
-
r
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
const I = g ? a.resolve(s, g) : a.resolve(s, f, "i18n/locales"), C = ["react", "react-dom", "zustand", ...y], b = {
|
|
48
|
-
name: "creopse-react-plugin",
|
|
49
|
-
config() {
|
|
50
|
-
return {
|
|
51
|
-
envPrefix: "APP_",
|
|
52
|
-
resolve: {
|
|
53
|
-
alias: [
|
|
54
|
-
{
|
|
55
|
-
find: "@",
|
|
56
|
-
replacement: a.resolve(s, f)
|
|
57
|
-
}
|
|
58
|
-
],
|
|
59
|
-
dedupe: ["react", "react-dom", "zustand"]
|
|
60
|
-
},
|
|
61
|
-
build: {
|
|
62
|
-
target: "esnext",
|
|
63
|
-
outDir: u,
|
|
64
|
-
assetsInlineLimit: 1 / 0,
|
|
65
|
-
cssCodeSplit: !1,
|
|
66
|
-
rollupOptions: {
|
|
67
|
-
plugins: [
|
|
68
|
-
k({
|
|
69
|
-
targets: [
|
|
70
|
-
{
|
|
71
|
-
src: t,
|
|
72
|
-
dest: u,
|
|
73
|
-
transform() {
|
|
74
|
-
return e?.mode && (e.mode = S ? "development" : "production"), ((o) => o.replace(/(,)\s*\n/g, `,
|
|
75
|
-
|
|
76
|
-
`))(
|
|
77
|
-
j(e, null, 2)
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
],
|
|
82
|
-
hook: "writeBundle",
|
|
83
|
-
verbose: !1,
|
|
84
|
-
flatten: !0
|
|
85
|
-
})
|
|
86
|
-
]
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
preview: {
|
|
90
|
-
port: c,
|
|
91
|
-
strictPort: !0,
|
|
92
|
-
cors: !0,
|
|
93
|
-
headers: {
|
|
94
|
-
"Access-Control-Allow-Origin": "*"
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
server: {
|
|
98
|
-
port: p,
|
|
99
|
-
cors: !0,
|
|
100
|
-
headers: {
|
|
101
|
-
"Access-Control-Allow-Origin": "*"
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
},
|
|
106
|
-
configureServer(r) {
|
|
107
|
-
r.watcher.add(t), r.watcher.on("change", (o) => {
|
|
108
|
-
o === t && (console.info(
|
|
109
|
-
`
|
|
110
|
-
[CreopseReactPlugin] Manifest changed, restarting Vite...`
|
|
111
|
-
), r.restart());
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
return [
|
|
116
|
-
B(),
|
|
117
|
-
x({
|
|
118
|
-
name: i,
|
|
119
|
-
filename: l,
|
|
120
|
-
exposes: n,
|
|
121
|
-
shared: C
|
|
122
|
-
}),
|
|
123
|
-
z({
|
|
124
|
-
promiseExportName: "__tla",
|
|
125
|
-
promiseImportName: (r) => `__tla_${r}`
|
|
126
|
-
}),
|
|
127
|
-
$({
|
|
128
|
-
paths: [I],
|
|
129
|
-
include: ["**/*.json"]
|
|
130
|
-
}),
|
|
131
|
-
N({
|
|
132
|
-
dirs: _,
|
|
133
|
-
imports: ["react"],
|
|
134
|
-
vueTemplate: !1,
|
|
135
|
-
...E ? {
|
|
136
|
-
eslintrc: {
|
|
137
|
-
enabled: !0,
|
|
138
|
-
filepath: "./.eslintrc-auto-import.json",
|
|
139
|
-
globalsPropValue: !0
|
|
140
|
-
}
|
|
141
|
-
} : {}
|
|
142
|
-
}),
|
|
143
|
-
...m ? [O()] : [],
|
|
144
|
-
b
|
|
145
|
-
];
|
|
146
|
-
}
|
|
1
|
+
import "@vitejs/plugin-basic-ssl";
|
|
2
|
+
import "comment-json";
|
|
3
|
+
import "path";
|
|
4
|
+
import "rollup-plugin-copy";
|
|
5
|
+
import "vite-plugin-auto-import-lite";
|
|
6
|
+
import "vite-plugin-json5";
|
|
7
|
+
import "vite-plugin-top-level-await";
|
|
8
|
+
import { C } from "../react-DqofO0Uc.js";
|
|
147
9
|
export {
|
|
148
|
-
|
|
10
|
+
C as CreopseReactPlugin
|
|
149
11
|
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { CommentObject } from 'comment-json';
|
|
2
|
+
/**
|
|
3
|
+
* Metadata extracted from the Creopse manifest for build configuration.
|
|
4
|
+
*/
|
|
5
|
+
export interface CreopseManifestData {
|
|
6
|
+
/** Sanitized plugin ID used for Module Federation name */
|
|
7
|
+
pluginId: string;
|
|
8
|
+
/** The output filename for the remote entry */
|
|
9
|
+
pluginEntry: string;
|
|
10
|
+
/** Map of exposed modules for Federation */
|
|
11
|
+
exposes: Record<string, string>;
|
|
12
|
+
/** The full parsed manifest object */
|
|
13
|
+
manifest: CommentObject | undefined;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Options for the CreopseVuePlugin.
|
|
17
|
+
*/
|
|
18
|
+
export interface CreopseVuePluginOptions {
|
|
19
|
+
/** * Path to the manifest file OR already parsed manifest data.
|
|
20
|
+
* Passing parsed data avoids redundant disk I/O.
|
|
21
|
+
* @default './manifest.jsonc'
|
|
22
|
+
*/
|
|
23
|
+
manifest?: string | CreopseManifestData;
|
|
24
|
+
/** @default './src' */
|
|
25
|
+
srcDir?: string;
|
|
26
|
+
/** @default 'frontend' */
|
|
27
|
+
outDir?: string;
|
|
28
|
+
/** @default './src/i18n/locales' */
|
|
29
|
+
i18nLocalesPath?: string;
|
|
30
|
+
/** @default ['src/composables'] */
|
|
31
|
+
composablesDirs?: string[];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Options for the CreopseReactPlugin.
|
|
35
|
+
*/
|
|
36
|
+
export interface CreopseReactPluginOptions {
|
|
37
|
+
/** * Path to the manifest file OR already parsed manifest data.
|
|
38
|
+
* Passing parsed data avoids redundant disk I/O.
|
|
39
|
+
* @default './manifest.jsonc'
|
|
40
|
+
*/
|
|
41
|
+
manifest?: string | CreopseManifestData;
|
|
42
|
+
/** @default './src' */
|
|
43
|
+
srcDir?: string;
|
|
44
|
+
/** @default 'frontend' */
|
|
45
|
+
outDir?: string;
|
|
46
|
+
/** @default './src/i18n/locales' */
|
|
47
|
+
i18nLocalesPath?: string;
|
|
48
|
+
/** * Directories to scan for auto-importing React hooks.
|
|
49
|
+
* @default ['src/hooks']
|
|
50
|
+
*/
|
|
51
|
+
hooksDirs?: string[];
|
|
52
|
+
/**
|
|
53
|
+
* Whether to generate an eslint auto-import config file.
|
|
54
|
+
* @default false
|
|
55
|
+
*/
|
|
56
|
+
eslintAutoImport?: boolean;
|
|
57
|
+
}
|
package/dist/vite/vue.js
CHANGED
|
@@ -1,54 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { parse as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import N from "vite-plugin-
|
|
11
|
-
|
|
12
|
-
function B(g) {
|
|
13
|
-
const e = C(g);
|
|
14
|
-
if (console.debug("federation plugin keys:", Object.keys(e)), console.debug("resolveId type:", typeof e.resolveId), console.debug(
|
|
15
|
-
"resolveId descriptor:",
|
|
16
|
-
Object.getOwnPropertyDescriptor(e, "resolveId")
|
|
17
|
-
), e?.resolveId) {
|
|
18
|
-
const l = typeof e.resolveId == "function" ? e.resolveId : e.resolveId.handler, a = function(c, p, v) {
|
|
19
|
-
return p ? l.call(this, c, p, v) : null;
|
|
20
|
-
};
|
|
21
|
-
typeof e.resolveId == "function" ? e.resolveId = a : e.resolveId = { ...e.resolveId, handler: a };
|
|
22
|
-
}
|
|
23
|
-
return e;
|
|
24
|
-
}
|
|
25
|
-
function Q(g = {}) {
|
|
1
|
+
import { DASHBOARD_MODULE_NAME as S, SETTINGS_MODULE_NAME as C, sanitizeId as D } from "@creopse/utils/helpers";
|
|
2
|
+
import I from "@originjs/vite-plugin-federation";
|
|
3
|
+
import b from "@vitejs/plugin-basic-ssl";
|
|
4
|
+
import { parse as L, stringify as M } from "comment-json";
|
|
5
|
+
import g from "fs";
|
|
6
|
+
import f from "path";
|
|
7
|
+
import O from "rollup-plugin-copy";
|
|
8
|
+
import x from "vite-plugin-auto-import-lite";
|
|
9
|
+
import V from "vite-plugin-json5";
|
|
10
|
+
import N from "vite-plugin-top-level-await";
|
|
11
|
+
function H(v = {}) {
|
|
26
12
|
const {
|
|
27
|
-
manifestPath:
|
|
28
|
-
srcDir:
|
|
29
|
-
outDir:
|
|
30
|
-
i18nLocalesPath:
|
|
31
|
-
composablesDirs:
|
|
32
|
-
shared:
|
|
33
|
-
} =
|
|
34
|
-
let
|
|
35
|
-
const
|
|
36
|
-
let
|
|
13
|
+
manifestPath: P = "./manifest.jsonc",
|
|
14
|
+
srcDir: h = "./src",
|
|
15
|
+
outDir: A = "frontend",
|
|
16
|
+
i18nLocalesPath: $,
|
|
17
|
+
composablesDirs: w = ["src/composables"],
|
|
18
|
+
shared: _ = []
|
|
19
|
+
} = v, d = process.cwd(), t = f.resolve(d, P), y = process.env.APP_IS_PREVIEW === "true";
|
|
20
|
+
let e;
|
|
21
|
+
const n = {};
|
|
22
|
+
let l = "creopse-plugin", p = "remoteEntry.js", c = 2160, m = 2161, u = !1;
|
|
37
23
|
try {
|
|
38
|
-
if (
|
|
39
|
-
const r =
|
|
40
|
-
if (
|
|
41
|
-
for (const
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
|
|
24
|
+
if (g.existsSync(t)) {
|
|
25
|
+
const r = g.readFileSync(t, "utf-8");
|
|
26
|
+
if (e = L(r || "{}"), e.pages && Array.isArray(e.pages))
|
|
27
|
+
for (const a of e.pages)
|
|
28
|
+
n[`./${a.name}`] = a.module;
|
|
29
|
+
const o = e.dashboard;
|
|
30
|
+
o?.module && (n[`./${S}`] = o.module);
|
|
31
|
+
const s = e.settings;
|
|
32
|
+
s?.module && (n[`./${C}`] = s.module);
|
|
33
|
+
const i = e.development;
|
|
34
|
+
l = D(String(e.id)) || l, p = e.entry || p, c = i?.previewPort || c, m = i?.serverPort || m, u = i?.ssl || u;
|
|
49
35
|
} else
|
|
50
36
|
console.warn(
|
|
51
|
-
`[CreopseVuePlugin] Warning: Manifest not found at ${
|
|
37
|
+
`[CreopseVuePlugin] Warning: Manifest not found at ${t}`
|
|
52
38
|
);
|
|
53
39
|
} catch (r) {
|
|
54
40
|
console.error(
|
|
@@ -56,33 +42,33 @@ function Q(g = {}) {
|
|
|
56
42
|
r
|
|
57
43
|
);
|
|
58
44
|
}
|
|
59
|
-
const
|
|
45
|
+
const E = {
|
|
60
46
|
name: "creopse-vue-plugin",
|
|
61
47
|
config(r) {
|
|
62
|
-
const
|
|
48
|
+
const o = r.root || d, s = f.resolve(o, A);
|
|
63
49
|
return {
|
|
64
50
|
envPrefix: "APP_",
|
|
65
51
|
resolve: {
|
|
66
|
-
alias: [{ find: "@", replacement:
|
|
52
|
+
alias: [{ find: "@", replacement: f.resolve(o, h) }],
|
|
67
53
|
dedupe: ["vue"]
|
|
68
54
|
},
|
|
69
55
|
build: {
|
|
70
56
|
target: "esnext",
|
|
71
|
-
outDir:
|
|
57
|
+
outDir: s,
|
|
72
58
|
assetsInlineLimit: 1 / 0,
|
|
73
59
|
cssCodeSplit: !1,
|
|
74
60
|
rollupOptions: {
|
|
75
61
|
plugins: [
|
|
76
|
-
|
|
62
|
+
O({
|
|
77
63
|
targets: [
|
|
78
64
|
{
|
|
79
|
-
src:
|
|
80
|
-
dest:
|
|
65
|
+
src: t,
|
|
66
|
+
dest: s,
|
|
81
67
|
transform() {
|
|
82
|
-
return
|
|
68
|
+
return e?.mode && (e.mode = y ? "development" : "production"), ((a) => a.replace(/(,)\s*\n/g, `,
|
|
83
69
|
|
|
84
70
|
`))(
|
|
85
|
-
M(
|
|
71
|
+
M(e, null, 2)
|
|
86
72
|
);
|
|
87
73
|
}
|
|
88
74
|
}
|
|
@@ -94,21 +80,21 @@ function Q(g = {}) {
|
|
|
94
80
|
}
|
|
95
81
|
},
|
|
96
82
|
preview: {
|
|
97
|
-
port:
|
|
83
|
+
port: c,
|
|
98
84
|
strictPort: !0,
|
|
99
85
|
cors: !0,
|
|
100
86
|
headers: { "Access-Control-Allow-Origin": "*" }
|
|
101
87
|
},
|
|
102
88
|
server: {
|
|
103
|
-
port:
|
|
89
|
+
port: m,
|
|
104
90
|
cors: !0,
|
|
105
91
|
headers: { "Access-Control-Allow-Origin": "*" }
|
|
106
92
|
}
|
|
107
93
|
};
|
|
108
94
|
},
|
|
109
95
|
configureServer(r) {
|
|
110
|
-
r.watcher.add(
|
|
111
|
-
|
|
96
|
+
r.watcher.add(t), r.watcher.on("change", (o) => {
|
|
97
|
+
o === t && (console.info(
|
|
112
98
|
`
|
|
113
99
|
[CreopseVuePlugin] Manifest changed, restarting Vite...`
|
|
114
100
|
), r.restart());
|
|
@@ -116,30 +102,26 @@ function Q(g = {}) {
|
|
|
116
102
|
}
|
|
117
103
|
};
|
|
118
104
|
return [
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
name:
|
|
122
|
-
filename:
|
|
123
|
-
exposes:
|
|
124
|
-
shared: ["vue", "pinia", ...
|
|
105
|
+
V(),
|
|
106
|
+
I({
|
|
107
|
+
name: l,
|
|
108
|
+
filename: p,
|
|
109
|
+
exposes: n,
|
|
110
|
+
shared: ["vue", "pinia", ..._]
|
|
125
111
|
}),
|
|
126
|
-
|
|
112
|
+
N({
|
|
127
113
|
promiseExportName: "__tla",
|
|
128
114
|
promiseImportName: (r) => `__tla_${r}`
|
|
129
115
|
}),
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
include: ["**/*.json"]
|
|
133
|
-
}),
|
|
134
|
-
V({
|
|
135
|
-
dirs: p,
|
|
116
|
+
x({
|
|
117
|
+
dirs: w,
|
|
136
118
|
imports: ["vue", "pinia"],
|
|
137
119
|
vueTemplate: !0
|
|
138
120
|
}),
|
|
139
|
-
...
|
|
140
|
-
|
|
121
|
+
...u ? [b()] : [],
|
|
122
|
+
E
|
|
141
123
|
];
|
|
142
124
|
}
|
|
143
125
|
export {
|
|
144
|
-
|
|
126
|
+
H as CreopseVuePlugin
|
|
145
127
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { AccessGuard as a, UserRole as i, Permission as
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const { t: u } = g(), c = (e, s) => (e?.findIndex(
|
|
1
|
+
import { AccessGuard as a, UserRole as i, Permission as o } from "@creopse/utils/enums";
|
|
2
|
+
const p = () => {
|
|
3
|
+
const c = (e, s) => (e?.findIndex(
|
|
5
4
|
(n) => n.name === s
|
|
6
|
-
) ?? -1) > -1, t = (e, s) => (e?.findIndex((n) => n.name === s) ?? -1) > -1,
|
|
5
|
+
) ?? -1) > -1, t = (e, s) => (e?.findIndex((n) => n.name === s) ?? -1) > -1, u = (e) => t(e, i.SUPER_ADMIN), l = (e) => Object.values(o).includes(e), r = [
|
|
7
6
|
{
|
|
8
7
|
label: "API",
|
|
9
8
|
value: a.API,
|
|
@@ -29,13 +28,13 @@ const I = () => {
|
|
|
29
28
|
accessGuards: r,
|
|
30
29
|
getAccessGuardLabel: (e) => r.find((s) => s.value === e)?.label,
|
|
31
30
|
getAccessGuardTagType: (e) => r.find((s) => s.value === e)?.tagType || "default",
|
|
32
|
-
getRoleName: (e, s) => e?.find((n) => n.id === s)?.name ||
|
|
33
|
-
isPermissionNative:
|
|
34
|
-
userIsSuperAdmin:
|
|
31
|
+
getRoleName: (e, s) => e?.find((n) => n.id === s)?.name || window.__creopse__?.i18n.t("undefined"),
|
|
32
|
+
isPermissionNative: l,
|
|
33
|
+
userIsSuperAdmin: u,
|
|
35
34
|
userCan: c,
|
|
36
35
|
userIs: t
|
|
37
36
|
};
|
|
38
37
|
};
|
|
39
38
|
export {
|
|
40
|
-
|
|
39
|
+
p as useAccess
|
|
41
40
|
};
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { Bool as e } from "@creopse/utils";
|
|
2
|
-
import { ref as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
locale: o.value
|
|
11
|
-
})
|
|
12
|
-
};
|
|
13
|
-
};
|
|
2
|
+
import { ref as o } from "vue";
|
|
3
|
+
const l = () => ({
|
|
4
|
+
defaultPrefs: o({
|
|
5
|
+
inAppNotifEnabled: e.TRUE,
|
|
6
|
+
emailNotifEnabled: e.TRUE,
|
|
7
|
+
locale: window.__creopse__?.i18n.getLocale()
|
|
8
|
+
})
|
|
9
|
+
});
|
|
14
10
|
export {
|
|
15
|
-
|
|
11
|
+
l as useUserPreference
|
|
16
12
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@creopse/bridge",
|
|
3
3
|
"description": "Creopse Bridge Toolkit",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.22",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": "Noé Gnanih <noegnanih@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -33,21 +33,17 @@
|
|
|
33
33
|
"README.md"
|
|
34
34
|
],
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"vue": "^3.5.27",
|
|
37
|
-
"vue-i18n": "^11.3.0",
|
|
38
36
|
"pinia": "^3.0.0",
|
|
39
37
|
"react": "^19.2.4",
|
|
40
38
|
"react-dom": "^19.2.4",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
39
|
+
"vite": "^7.0.5",
|
|
40
|
+
"vue": "^3.5.27",
|
|
41
|
+
"zustand": "^5.0.12"
|
|
43
42
|
},
|
|
44
43
|
"peerDependenciesMeta": {
|
|
45
44
|
"vue": {
|
|
46
45
|
"optional": true
|
|
47
46
|
},
|
|
48
|
-
"vue-i18n": {
|
|
49
|
-
"optional": true
|
|
50
|
-
},
|
|
51
47
|
"pinia": {
|
|
52
48
|
"optional": true
|
|
53
49
|
},
|
|
@@ -67,17 +63,16 @@
|
|
|
67
63
|
"dependencies": {
|
|
68
64
|
"@iconify/react": "^6.0.2",
|
|
69
65
|
"@iconify/vue": "^5.0.0",
|
|
70
|
-
"@vueuse/core": "^14.2.1",
|
|
71
|
-
"naive-ui": "^2.44.1",
|
|
72
|
-
"framer-motion": "^12.23.9",
|
|
73
66
|
"@originjs/vite-plugin-federation": "^1.4.1",
|
|
74
67
|
"@vitejs/plugin-basic-ssl": "^2.3.0",
|
|
75
68
|
"@vitejs/plugin-react": "^4.6.0",
|
|
76
69
|
"@vitejs/plugin-vue": "^6.0.5",
|
|
70
|
+
"@vueuse/core": "^14.2.1",
|
|
77
71
|
"comment-json": "^4.6.2",
|
|
72
|
+
"framer-motion": "^12.23.9",
|
|
73
|
+
"naive-ui": "^2.44.1",
|
|
78
74
|
"rollup-plugin-copy": "^3.5.0",
|
|
79
75
|
"vite-plugin-auto-import-lite": "^0.0.2",
|
|
80
|
-
"vite-plugin-i18next-loader": "^3.1.3",
|
|
81
76
|
"vite-plugin-json5": "^1.2.0",
|
|
82
77
|
"vite-plugin-top-level-await": "^1.6.0",
|
|
83
78
|
"@creopse/utils": "0.1.9"
|
package/dist/index-C8b1StIO.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import "/Users/arkane/Dev/Projects/Web/creopse.proj/creopse.toolkit/node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js";
|
|
2
|
-
import "/Users/arkane/Dev/Projects/Web/creopse.proj/creopse.toolkit/node_modules/.pnpm/browser-image-compression@2.0.2/node_modules/browser-image-compression/dist/browser-image-compression.mjs";
|
|
3
|
-
import r from "/Users/arkane/Dev/Projects/Web/creopse.proj/creopse.toolkit/node_modules/.pnpm/dayjs@1.11.20/node_modules/dayjs/dayjs.min.js";
|
|
4
|
-
import "/Users/arkane/Dev/Projects/Web/creopse.proj/creopse.toolkit/node_modules/.pnpm/dayjs@1.11.20/node_modules/dayjs/locale/fr.js";
|
|
5
|
-
import e from "/Users/arkane/Dev/Projects/Web/creopse.proj/creopse.toolkit/node_modules/.pnpm/dayjs@1.11.20/node_modules/dayjs/plugin/customParseFormat.js";
|
|
6
|
-
import a from "/Users/arkane/Dev/Projects/Web/creopse.proj/creopse.toolkit/node_modules/.pnpm/dayjs@1.11.20/node_modules/dayjs/plugin/relativeTime.js";
|
|
7
|
-
r.extend(e);
|
|
8
|
-
r.extend(a);
|
|
9
|
-
function D(t) {
|
|
10
|
-
return t.replace(/[^a-z0-9\/-]/g, "").replace(/\//g, "-");
|
|
11
|
-
}
|
|
12
|
-
var d = "PluginDashboard", g = "PluginSettings";
|
|
13
|
-
export {
|
|
14
|
-
d as D,
|
|
15
|
-
g as S,
|
|
16
|
-
D as s
|
|
17
|
-
};
|