@creopse/bridge 0.1.19 → 0.1.21
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/helper-DBW7QA4d.js +26 -0
- 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/vite/helper.d.ts +7 -0
- package/dist/vite/index.d.ts +2 -0
- package/dist/vite/index.js +5 -3
- package/dist/vite/react.d.ts +5 -38
- package/dist/vite/react.js +44 -96
- package/dist/vite/types.d.ts +57 -0
- package/dist/vite/vue.d.ts +3 -37
- package/dist/vite/vue.js +40 -93
- 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 -13
- package/dist/index-C8b1StIO.js +0 -17
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DASHBOARD_MODULE_NAME as c, SETTINGS_MODULE_NAME as d, sanitizeId as u } from "@creopse/utils/helpers";
|
|
2
|
+
import { parse as g } from "comment-json";
|
|
3
|
+
import m from "fs";
|
|
4
|
+
import y from "path";
|
|
5
|
+
function h(f = "./manifest.jsonc") {
|
|
6
|
+
const p = process.cwd(), t = y.resolve(p, f), o = {};
|
|
7
|
+
let s = "creopse-plugin", n = "remoteEntry.js", e;
|
|
8
|
+
try {
|
|
9
|
+
if (m.existsSync(t)) {
|
|
10
|
+
const i = m.readFileSync(t, "utf-8");
|
|
11
|
+
if (e = g(i || "{}"), Array.isArray(e.pages))
|
|
12
|
+
for (const r of e.pages)
|
|
13
|
+
r.name && r.module && (o[`./${r.name}`] = r.module);
|
|
14
|
+
const a = e.dashboard;
|
|
15
|
+
a?.module && (o[`./${c}`] = a.module);
|
|
16
|
+
const l = e.settings;
|
|
17
|
+
l?.module && (o[`./${d}`] = l.module), s = u(String(e.id)) || s, n = e.entry || n;
|
|
18
|
+
}
|
|
19
|
+
} catch (i) {
|
|
20
|
+
console.error(`[Creopse] Failed to parse manifest at ${t}:`, i);
|
|
21
|
+
}
|
|
22
|
+
return { pluginId: s, pluginEntry: n, exposes: o, manifest: e };
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
h as l
|
|
26
|
+
};
|
|
@@ -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,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,8 @@
|
|
|
1
1
|
import { CreopseVuePlugin as r } from "./vue.js";
|
|
2
|
-
import { CreopseReactPlugin as
|
|
2
|
+
import { CreopseReactPlugin as s } from "./react.js";
|
|
3
|
+
import { l as a } from "../helper-DBW7QA4d.js";
|
|
3
4
|
export {
|
|
4
|
-
|
|
5
|
-
r as CreopseVuePlugin
|
|
5
|
+
s as CreopseReactPlugin,
|
|
6
|
+
r as CreopseVuePlugin,
|
|
7
|
+
a as loadCreopseManifest
|
|
6
8
|
};
|
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,138 +1,86 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
import B from "vite-plugin-json5";
|
|
11
|
-
import z from "vite-plugin-top-level-await";
|
|
12
|
-
function X(A = {}) {
|
|
1
|
+
import P from "@vitejs/plugin-basic-ssl";
|
|
2
|
+
import { stringify as h } from "comment-json";
|
|
3
|
+
import o from "path";
|
|
4
|
+
import w from "rollup-plugin-copy";
|
|
5
|
+
import A from "vite-plugin-auto-import-lite";
|
|
6
|
+
import _ from "vite-plugin-json5";
|
|
7
|
+
import I from "vite-plugin-top-level-await";
|
|
8
|
+
import { l as b } from "../helper-DBW7QA4d.js";
|
|
9
|
+
function k(e = {}) {
|
|
13
10
|
const {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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 = {
|
|
11
|
+
srcDir: c = "./src",
|
|
12
|
+
outDir: l = "frontend",
|
|
13
|
+
hooksDirs: m = ["src/hooks"],
|
|
14
|
+
eslintAutoImport: f = !1
|
|
15
|
+
} = e, s = process.cwd(), p = process.env.APP_IS_PREVIEW === "true", u = typeof e.manifest == "object" ? e.manifest : b(e.manifest || "./manifest.jsonc"), { manifest: n } = u, a = n?.development, d = !!a?.ssl, g = {
|
|
48
16
|
name: "creopse-react-plugin",
|
|
49
|
-
config() {
|
|
17
|
+
config(t) {
|
|
18
|
+
const r = t.root || s, i = o.resolve(r, l), v = typeof e.manifest == "string" ? e.manifest : "./manifest.jsonc";
|
|
50
19
|
return {
|
|
51
20
|
envPrefix: "APP_",
|
|
52
21
|
resolve: {
|
|
53
|
-
alias: [
|
|
54
|
-
{
|
|
55
|
-
find: "@",
|
|
56
|
-
replacement: a.resolve(s, f)
|
|
57
|
-
}
|
|
58
|
-
],
|
|
22
|
+
alias: [{ find: "@", replacement: o.resolve(r, c) }],
|
|
59
23
|
dedupe: ["react", "react-dom", "zustand"]
|
|
60
24
|
},
|
|
61
25
|
build: {
|
|
62
26
|
target: "esnext",
|
|
63
|
-
outDir:
|
|
27
|
+
outDir: i,
|
|
64
28
|
assetsInlineLimit: 1 / 0,
|
|
65
29
|
cssCodeSplit: !1,
|
|
66
30
|
rollupOptions: {
|
|
67
31
|
plugins: [
|
|
68
|
-
|
|
32
|
+
w({
|
|
69
33
|
targets: [
|
|
70
34
|
{
|
|
71
|
-
src:
|
|
72
|
-
dest:
|
|
35
|
+
src: o.resolve(s, v),
|
|
36
|
+
dest: i,
|
|
73
37
|
transform() {
|
|
74
|
-
return
|
|
38
|
+
return n?.mode && (n.mode = p ? "development" : "production"), h(n, null, 2).replace(
|
|
39
|
+
/(,)\s*\n/g,
|
|
40
|
+
`,
|
|
75
41
|
|
|
76
|
-
`
|
|
77
|
-
j(e, null, 2)
|
|
42
|
+
`
|
|
78
43
|
);
|
|
79
44
|
}
|
|
80
45
|
}
|
|
81
46
|
],
|
|
82
|
-
hook: "writeBundle"
|
|
83
|
-
verbose: !1,
|
|
84
|
-
flatten: !0
|
|
47
|
+
hook: "writeBundle"
|
|
85
48
|
})
|
|
86
49
|
]
|
|
87
50
|
}
|
|
88
51
|
},
|
|
89
52
|
preview: {
|
|
90
|
-
port:
|
|
53
|
+
port: a?.previewPort || 2160,
|
|
91
54
|
strictPort: !0,
|
|
92
55
|
cors: !0,
|
|
93
|
-
headers: {
|
|
94
|
-
"Access-Control-Allow-Origin": "*"
|
|
95
|
-
}
|
|
56
|
+
headers: { "Access-Control-Allow-Origin": "*" }
|
|
96
57
|
},
|
|
97
58
|
server: {
|
|
98
|
-
port:
|
|
59
|
+
port: a?.serverPort || 2161,
|
|
99
60
|
cors: !0,
|
|
100
|
-
headers: {
|
|
101
|
-
"Access-Control-Allow-Origin": "*"
|
|
102
|
-
}
|
|
61
|
+
headers: { "Access-Control-Allow-Origin": "*" }
|
|
103
62
|
}
|
|
104
63
|
};
|
|
105
64
|
},
|
|
106
|
-
configureServer(
|
|
107
|
-
r.
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
[
|
|
111
|
-
), r.restart());
|
|
65
|
+
configureServer(t) {
|
|
66
|
+
const r = typeof e.manifest == "string" ? o.resolve(s, e.manifest) : o.resolve(s, "./manifest.jsonc");
|
|
67
|
+
t.watcher.add(r), t.watcher.on("change", (i) => {
|
|
68
|
+
i === r && (console.info(`
|
|
69
|
+
[Creopse] Manifest changed, restarting server...`), t.restart());
|
|
112
70
|
});
|
|
113
71
|
}
|
|
114
72
|
};
|
|
115
73
|
return [
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
name: i,
|
|
119
|
-
filename: l,
|
|
120
|
-
exposes: n,
|
|
121
|
-
shared: C
|
|
122
|
-
}),
|
|
123
|
-
z({
|
|
74
|
+
_(),
|
|
75
|
+
I({
|
|
124
76
|
promiseExportName: "__tla",
|
|
125
|
-
promiseImportName: (
|
|
126
|
-
}),
|
|
127
|
-
$({
|
|
128
|
-
paths: [I],
|
|
129
|
-
include: ["**/*.json"]
|
|
77
|
+
promiseImportName: (t) => `__tla_${t}`
|
|
130
78
|
}),
|
|
131
|
-
|
|
132
|
-
dirs:
|
|
79
|
+
A({
|
|
80
|
+
dirs: m,
|
|
133
81
|
imports: ["react"],
|
|
134
82
|
vueTemplate: !1,
|
|
135
|
-
...
|
|
83
|
+
...f ? {
|
|
136
84
|
eslintrc: {
|
|
137
85
|
enabled: !0,
|
|
138
86
|
filepath: "./.eslintrc-auto-import.json",
|
|
@@ -140,10 +88,10 @@ function X(A = {}) {
|
|
|
140
88
|
}
|
|
141
89
|
} : {}
|
|
142
90
|
}),
|
|
143
|
-
...
|
|
144
|
-
|
|
91
|
+
...d ? [P()] : [],
|
|
92
|
+
g
|
|
145
93
|
];
|
|
146
94
|
}
|
|
147
95
|
export {
|
|
148
|
-
|
|
96
|
+
k as CreopseReactPlugin
|
|
149
97
|
};
|
|
@@ -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.d.ts
CHANGED
|
@@ -1,41 +1,7 @@
|
|
|
1
1
|
import { PluginOption } from 'vite';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Path to the manifest.jsonc file, relative to the project root.
|
|
5
|
-
* @default './manifest.jsonc'
|
|
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/composables']
|
|
26
|
-
*/
|
|
27
|
-
composablesDirs?: string[];
|
|
28
|
-
/**
|
|
29
|
-
* Shared modules for Module Federation.
|
|
30
|
-
* The 'vue' and 'pinia' modules are always included.
|
|
31
|
-
* @default []
|
|
32
|
-
*/
|
|
33
|
-
shared?: string[];
|
|
34
|
-
}
|
|
2
|
+
import { CreopseVuePluginOptions } from './types';
|
|
35
3
|
/**
|
|
36
|
-
* Vite plugin for Creopse Vue
|
|
37
|
-
*
|
|
38
|
-
* * @param options - Configuration options for the plugin
|
|
39
|
-
* @returns A flat array of Vite plugins
|
|
4
|
+
* Vite plugin for Creopse Vue plugins.
|
|
5
|
+
* Consolidates configuration, environment setup, and automated asset management.
|
|
40
6
|
*/
|
|
41
7
|
export declare function CreopseVuePlugin(options?: CreopseVuePluginOptions): PluginOption[];
|
package/dist/vite/vue.js
CHANGED
|
@@ -1,142 +1,89 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
import j from "vite-plugin-json5";
|
|
11
|
-
import B from "vite-plugin-top-level-await";
|
|
12
|
-
function k(g) {
|
|
13
|
-
const r = b(g);
|
|
14
|
-
if (r?.resolveId) {
|
|
15
|
-
const l = typeof r.resolveId == "function" ? r.resolveId : r.resolveId.handler, a = function(c, p, v) {
|
|
16
|
-
return p ? l.call(this, c, p, v) : null;
|
|
17
|
-
};
|
|
18
|
-
typeof r.resolveId == "function" ? r.resolveId = a : r.resolveId = { ...r.resolveId, handler: a };
|
|
19
|
-
}
|
|
20
|
-
return r;
|
|
21
|
-
}
|
|
22
|
-
function Q(g = {}) {
|
|
1
|
+
import g from "@vitejs/plugin-basic-ssl";
|
|
2
|
+
import { stringify as P } from "comment-json";
|
|
3
|
+
import o from "path";
|
|
4
|
+
import h from "rollup-plugin-copy";
|
|
5
|
+
import w from "vite-plugin-auto-import-lite";
|
|
6
|
+
import A from "vite-plugin-json5";
|
|
7
|
+
import _ from "vite-plugin-top-level-await";
|
|
8
|
+
import { l as b } from "../helper-DBW7QA4d.js";
|
|
9
|
+
function O(e = {}) {
|
|
23
10
|
const {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
composablesDirs: p = ["src/composables"],
|
|
29
|
-
shared: v = []
|
|
30
|
-
} = g, u = process.cwd(), s = i.resolve(u, r), _ = process.env.APP_IS_PREVIEW === "true";
|
|
31
|
-
let e;
|
|
32
|
-
const d = {};
|
|
33
|
-
let h = "creopse-plugin", P = "remoteEntry.js", I = 2160, A = 2161, w = !1;
|
|
34
|
-
try {
|
|
35
|
-
if (y.existsSync(s)) {
|
|
36
|
-
const o = y.readFileSync(s, "utf-8");
|
|
37
|
-
if (e = M(o || "{}"), e.pages && Array.isArray(e.pages))
|
|
38
|
-
for (const m of e.pages)
|
|
39
|
-
d[`./${m.name}`] = m.module;
|
|
40
|
-
const t = e.dashboard;
|
|
41
|
-
t?.module && (d[`./${D}`] = t.module);
|
|
42
|
-
const n = e.settings;
|
|
43
|
-
n?.module && (d[`./${C}`] = n.module);
|
|
44
|
-
const f = e.development;
|
|
45
|
-
h = L(String(e.id)) || h, P = e.entry || P, I = f?.previewPort || I, A = f?.serverPort || A, w = f?.ssl || w;
|
|
46
|
-
} else
|
|
47
|
-
console.warn(
|
|
48
|
-
`[CreopseVuePlugin] Warning: Manifest not found at ${s}`
|
|
49
|
-
);
|
|
50
|
-
} catch (o) {
|
|
51
|
-
console.error(
|
|
52
|
-
"[CreopseVuePlugin] Fatal error while parsing manifest:",
|
|
53
|
-
o
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
const E = c ? i.resolve(u, c) : i.resolve(u, l, "i18n/locales"), S = {
|
|
11
|
+
srcDir: c = "./src",
|
|
12
|
+
outDir: m = "frontend",
|
|
13
|
+
composablesDirs: l = ["src/composables"]
|
|
14
|
+
} = e, s = process.cwd(), f = process.env.APP_IS_PREVIEW === "true", p = typeof e.manifest == "object" ? e.manifest : b(e.manifest || "./manifest.jsonc"), { manifest: n } = p, a = n?.development, u = !!a?.ssl, d = {
|
|
57
15
|
name: "creopse-vue-plugin",
|
|
58
|
-
config(
|
|
59
|
-
const t =
|
|
16
|
+
config(r) {
|
|
17
|
+
const t = r.root || s, i = o.resolve(t, m), v = typeof e.manifest == "string" ? e.manifest : "./manifest.jsonc";
|
|
60
18
|
return {
|
|
61
19
|
envPrefix: "APP_",
|
|
62
20
|
resolve: {
|
|
63
|
-
alias: [{ find: "@", replacement:
|
|
21
|
+
alias: [{ find: "@", replacement: o.resolve(t, c) }],
|
|
64
22
|
dedupe: ["vue"]
|
|
65
23
|
},
|
|
66
24
|
build: {
|
|
67
25
|
target: "esnext",
|
|
68
|
-
outDir:
|
|
26
|
+
outDir: i,
|
|
69
27
|
assetsInlineLimit: 1 / 0,
|
|
70
28
|
cssCodeSplit: !1,
|
|
71
29
|
rollupOptions: {
|
|
72
30
|
plugins: [
|
|
73
|
-
|
|
31
|
+
h({
|
|
74
32
|
targets: [
|
|
75
33
|
{
|
|
76
|
-
src: s,
|
|
77
|
-
dest:
|
|
34
|
+
src: o.resolve(s, v),
|
|
35
|
+
dest: i,
|
|
78
36
|
transform() {
|
|
79
|
-
return
|
|
37
|
+
return n?.mode && (n.mode = f ? "development" : "production"), P(n, null, 2).replace(
|
|
38
|
+
/(,)\s*\n/g,
|
|
39
|
+
`,
|
|
80
40
|
|
|
81
|
-
`
|
|
82
|
-
O(e, null, 2)
|
|
41
|
+
`
|
|
83
42
|
);
|
|
84
43
|
}
|
|
85
44
|
}
|
|
86
45
|
],
|
|
87
|
-
hook: "writeBundle"
|
|
88
|
-
flatten: !0
|
|
46
|
+
hook: "writeBundle"
|
|
89
47
|
})
|
|
90
48
|
]
|
|
91
49
|
}
|
|
92
50
|
},
|
|
93
51
|
preview: {
|
|
94
|
-
port:
|
|
52
|
+
port: a?.previewPort || 2160,
|
|
95
53
|
strictPort: !0,
|
|
96
54
|
cors: !0,
|
|
97
55
|
headers: { "Access-Control-Allow-Origin": "*" }
|
|
98
56
|
},
|
|
99
57
|
server: {
|
|
100
|
-
port:
|
|
58
|
+
port: a?.serverPort || 2161,
|
|
101
59
|
cors: !0,
|
|
102
60
|
headers: { "Access-Control-Allow-Origin": "*" }
|
|
103
61
|
}
|
|
104
62
|
};
|
|
105
63
|
},
|
|
106
|
-
configureServer(
|
|
107
|
-
o.
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
[
|
|
111
|
-
), o.restart());
|
|
64
|
+
configureServer(r) {
|
|
65
|
+
const t = typeof e.manifest == "string" ? o.resolve(s, e.manifest) : o.resolve(s, "./manifest.jsonc");
|
|
66
|
+
r.watcher.add(t), r.watcher.on("change", (i) => {
|
|
67
|
+
i === t && (console.info(`
|
|
68
|
+
[Creopse] Manifest changed, restarting server...`), r.restart());
|
|
112
69
|
});
|
|
113
70
|
}
|
|
114
71
|
};
|
|
115
72
|
return [
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
name: h,
|
|
119
|
-
filename: P,
|
|
120
|
-
exposes: d,
|
|
121
|
-
shared: ["vue", "pinia", ...v]
|
|
122
|
-
}),
|
|
123
|
-
B({
|
|
73
|
+
A(),
|
|
74
|
+
_({
|
|
124
75
|
promiseExportName: "__tla",
|
|
125
|
-
promiseImportName: (
|
|
126
|
-
}),
|
|
127
|
-
$({
|
|
128
|
-
paths: [E],
|
|
129
|
-
include: ["**/*.json"]
|
|
76
|
+
promiseImportName: (r) => `__tla_${r}`
|
|
130
77
|
}),
|
|
131
|
-
|
|
132
|
-
dirs:
|
|
78
|
+
w({
|
|
79
|
+
dirs: l,
|
|
133
80
|
imports: ["vue", "pinia"],
|
|
134
81
|
vueTemplate: !0
|
|
135
82
|
}),
|
|
136
|
-
...
|
|
137
|
-
|
|
83
|
+
...u ? [g()] : [],
|
|
84
|
+
d
|
|
138
85
|
];
|
|
139
86
|
}
|
|
140
87
|
export {
|
|
141
|
-
|
|
88
|
+
O as CreopseVuePlugin
|
|
142
89
|
};
|
|
@@ -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.21",
|
|
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,15 @@
|
|
|
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
|
-
"@originjs/vite-plugin-federation": "^1.4.1",
|
|
74
66
|
"@vitejs/plugin-basic-ssl": "^2.3.0",
|
|
75
67
|
"@vitejs/plugin-react": "^4.6.0",
|
|
76
68
|
"@vitejs/plugin-vue": "^6.0.5",
|
|
69
|
+
"@vueuse/core": "^14.2.1",
|
|
77
70
|
"comment-json": "^4.6.2",
|
|
71
|
+
"framer-motion": "^12.23.9",
|
|
72
|
+
"naive-ui": "^2.44.1",
|
|
78
73
|
"rollup-plugin-copy": "^3.5.0",
|
|
79
74
|
"vite-plugin-auto-import-lite": "^0.0.2",
|
|
80
|
-
"vite-plugin-i18next-loader": "^3.1.3",
|
|
81
75
|
"vite-plugin-json5": "^1.2.0",
|
|
82
76
|
"vite-plugin-top-level-await": "^1.6.0",
|
|
83
77
|
"@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
|
-
};
|