@creopse/bridge 0.1.20 → 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.
@@ -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 "/Users/arkane/Dev/Projects/Web/creopse.proj/creopse.toolkit/node_modules/.pnpm/framer-motion@12.23.9_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/framer-motion/dist/es/index.mjs";
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",
@@ -52,7 +52,7 @@ const p = ({
52
52
  }
53
53
  ) : void 0,
54
54
  onBack: () => {
55
- a ? a() : window.__creopse__.router.back();
55
+ a ? a() : window.__creopse__?.router.back();
56
56
  }
57
57
  }
58
58
  ),
@@ -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__.i18n.t("undefined"),
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__.i18n.getLocale()
7
+ locale: window.__creopse__?.i18n.getLocale()
8
8
  });
9
9
  return f(() => {
10
10
  t((r) => ({
11
11
  ...r,
12
- locale: window.__creopse__.i18n.getLocale()
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;
@@ -1,2 +1,4 @@
1
1
  export * from './vue';
2
2
  export * from './react';
3
+ export * from './types';
4
+ export * from './helper';
@@ -1,6 +1,8 @@
1
1
  import { CreopseVuePlugin as r } from "./vue.js";
2
- import { CreopseReactPlugin as t } from "./react.js";
2
+ import { CreopseReactPlugin as s } from "./react.js";
3
+ import { l as a } from "../helper-DBW7QA4d.js";
3
4
  export {
4
- t as CreopseReactPlugin,
5
- r as CreopseVuePlugin
5
+ s as CreopseReactPlugin,
6
+ r as CreopseVuePlugin,
7
+ a as loadCreopseManifest
6
8
  };
@@ -1,40 +1,7 @@
1
1
  import { PluginOption } from 'vite';
2
- export interface CreopseReactPluginOptions {
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/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[];
@@ -1,138 +1,86 @@
1
- import { D, S as L, s as M } from "../index-C8b1StIO.js";
2
- import x from "@originjs/vite-plugin-federation";
3
- import O from "/Users/arkane/Dev/Projects/Web/creopse.proj/creopse.toolkit/node_modules/.pnpm/@vitejs+plugin-basic-ssl@2.3.0_vite@7.0.5_@types+node@24.0.15_jiti@2.6.1_tsx@4.21.0_/node_modules/@vitejs/plugin-basic-ssl/dist/index.mjs";
4
- import { parse as R, stringify as j } from "/Users/arkane/Dev/Projects/Web/creopse.proj/creopse.toolkit/node_modules/.pnpm/comment-json@4.6.2/node_modules/comment-json/src/index.js";
5
- import v from "fs";
6
- import a from "path";
7
- import k from "/Users/arkane/Dev/Projects/Web/creopse.proj/creopse.toolkit/node_modules/.pnpm/rollup-plugin-copy@3.5.0/node_modules/rollup-plugin-copy/dist/index.module.js";
8
- import N from "vite-plugin-auto-import-lite";
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 = {}) {
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
- 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 = {
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: u,
27
+ outDir: i,
64
28
  assetsInlineLimit: 1 / 0,
65
29
  cssCodeSplit: !1,
66
30
  rollupOptions: {
67
31
  plugins: [
68
- k({
32
+ w({
69
33
  targets: [
70
34
  {
71
- src: t,
72
- dest: u,
35
+ src: o.resolve(s, v),
36
+ dest: i,
73
37
  transform() {
74
- return e?.mode && (e.mode = S ? "development" : "production"), ((o) => o.replace(/(,)\s*\n/g, `,
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: c,
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: p,
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(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());
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
- B(),
117
- x({
118
- name: i,
119
- filename: l,
120
- exposes: n,
121
- shared: C
122
- }),
123
- z({
74
+ _(),
75
+ I({
124
76
  promiseExportName: "__tla",
125
- promiseImportName: (r) => `__tla_${r}`
126
- }),
127
- $({
128
- paths: [I],
129
- include: ["**/*.json"]
77
+ promiseImportName: (t) => `__tla_${t}`
130
78
  }),
131
- N({
132
- dirs: _,
79
+ A({
80
+ dirs: m,
133
81
  imports: ["react"],
134
82
  vueTemplate: !1,
135
- ...E ? {
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
- ...m ? [O()] : [],
144
- b
91
+ ...d ? [P()] : [],
92
+ g
145
93
  ];
146
94
  }
147
95
  export {
148
- X as CreopseReactPlugin
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
+ }
@@ -1,41 +1,7 @@
1
1
  import { PluginOption } from 'vite';
2
- export interface CreopseVuePluginOptions {
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 applications.
37
- * Handles manifest parsing, Module Federation, and automatic environment configuration.
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,145 +1,89 @@
1
- import { D as E, S, s as O } from "../index-C8b1StIO.js";
2
- import C from "@originjs/vite-plugin-federation";
3
- import L from "/Users/arkane/Dev/Projects/Web/creopse.proj/creopse.toolkit/node_modules/.pnpm/@vitejs+plugin-basic-ssl@2.3.0_vite@7.0.5_@types+node@24.0.15_jiti@2.6.1_tsx@4.21.0_/node_modules/@vitejs/plugin-basic-ssl/dist/index.mjs";
4
- import { parse as x, stringify as M } from "/Users/arkane/Dev/Projects/Web/creopse.proj/creopse.toolkit/node_modules/.pnpm/comment-json@4.6.2/node_modules/comment-json/src/index.js";
5
- import w from "fs";
6
- import i from "path";
7
- import j from "/Users/arkane/Dev/Projects/Web/creopse.proj/creopse.toolkit/node_modules/.pnpm/rollup-plugin-copy@3.5.0/node_modules/rollup-plugin-copy/dist/index.module.js";
8
- import V from "vite-plugin-auto-import-lite";
9
- import k from "vite-plugin-i18next-loader";
10
- import N from "vite-plugin-json5";
11
- import $ from "vite-plugin-top-level-await";
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 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 = {}) {
26
10
  const {
27
- manifestPath: e = "./manifest.jsonc",
28
- srcDir: l = "./src",
29
- outDir: a = "frontend",
30
- i18nLocalesPath: c,
31
- composablesDirs: p = ["src/composables"],
32
- shared: v = []
33
- } = g, d = process.cwd(), s = i.resolve(d, e), b = process.env.APP_IS_PREVIEW === "true";
34
- let o;
35
- const u = {};
36
- let P = "creopse-plugin", h = "remoteEntry.js", I = 2160, y = 2161, A = !1;
37
- try {
38
- if (w.existsSync(s)) {
39
- const r = w.readFileSync(s, "utf-8");
40
- if (o = x(r || "{}"), o.pages && Array.isArray(o.pages))
41
- for (const m of o.pages)
42
- u[`./${m.name}`] = m.module;
43
- const t = o.dashboard;
44
- t?.module && (u[`./${E}`] = t.module);
45
- const n = o.settings;
46
- n?.module && (u[`./${S}`] = n.module);
47
- const f = o.development;
48
- P = O(String(o.id)) || P, h = o.entry || h, I = f?.previewPort || I, y = f?.serverPort || y, A = f?.ssl || A;
49
- } else
50
- console.warn(
51
- `[CreopseVuePlugin] Warning: Manifest not found at ${s}`
52
- );
53
- } catch (r) {
54
- console.error(
55
- "[CreopseVuePlugin] Fatal error while parsing manifest:",
56
- r
57
- );
58
- }
59
- const _ = c ? i.resolve(d, c) : i.resolve(d, l, "i18n/locales"), D = {
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 = {
60
15
  name: "creopse-vue-plugin",
61
16
  config(r) {
62
- const t = r.root || d, n = i.resolve(t, a);
17
+ const t = r.root || s, i = o.resolve(t, m), v = typeof e.manifest == "string" ? e.manifest : "./manifest.jsonc";
63
18
  return {
64
19
  envPrefix: "APP_",
65
20
  resolve: {
66
- alias: [{ find: "@", replacement: i.resolve(t, l) }],
21
+ alias: [{ find: "@", replacement: o.resolve(t, c) }],
67
22
  dedupe: ["vue"]
68
23
  },
69
24
  build: {
70
25
  target: "esnext",
71
- outDir: n,
26
+ outDir: i,
72
27
  assetsInlineLimit: 1 / 0,
73
28
  cssCodeSplit: !1,
74
29
  rollupOptions: {
75
30
  plugins: [
76
- j({
31
+ h({
77
32
  targets: [
78
33
  {
79
- src: s,
80
- dest: n,
34
+ src: o.resolve(s, v),
35
+ dest: i,
81
36
  transform() {
82
- return o?.mode && (o.mode = b ? "development" : "production"), ((m) => m.replace(/(,)\s*\n/g, `,
37
+ return n?.mode && (n.mode = f ? "development" : "production"), P(n, null, 2).replace(
38
+ /(,)\s*\n/g,
39
+ `,
83
40
 
84
- `))(
85
- M(o, null, 2)
41
+ `
86
42
  );
87
43
  }
88
44
  }
89
45
  ],
90
- hook: "writeBundle",
91
- flatten: !0
46
+ hook: "writeBundle"
92
47
  })
93
48
  ]
94
49
  }
95
50
  },
96
51
  preview: {
97
- port: I,
52
+ port: a?.previewPort || 2160,
98
53
  strictPort: !0,
99
54
  cors: !0,
100
55
  headers: { "Access-Control-Allow-Origin": "*" }
101
56
  },
102
57
  server: {
103
- port: y,
58
+ port: a?.serverPort || 2161,
104
59
  cors: !0,
105
60
  headers: { "Access-Control-Allow-Origin": "*" }
106
61
  }
107
62
  };
108
63
  },
109
64
  configureServer(r) {
110
- r.watcher.add(s), r.watcher.on("change", (t) => {
111
- t === s && (console.info(
112
- `
113
- [CreopseVuePlugin] Manifest changed, restarting Vite...`
114
- ), r.restart());
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());
115
69
  });
116
70
  }
117
71
  };
118
72
  return [
119
- N(),
120
- B({
121
- name: P,
122
- filename: h,
123
- exposes: u,
124
- shared: ["vue", "pinia", ...v]
125
- }),
126
- $({
73
+ A(),
74
+ _({
127
75
  promiseExportName: "__tla",
128
76
  promiseImportName: (r) => `__tla_${r}`
129
77
  }),
130
- k({
131
- paths: [_],
132
- include: ["**/*.json"]
133
- }),
134
- V({
135
- dirs: p,
78
+ w({
79
+ dirs: l,
136
80
  imports: ["vue", "pinia"],
137
81
  vueTemplate: !0
138
82
  }),
139
- ...A ? [L()] : [],
140
- D
83
+ ...u ? [g()] : [],
84
+ d
141
85
  ];
142
86
  }
143
87
  export {
144
- Q as CreopseVuePlugin
88
+ O as CreopseVuePlugin
145
89
  };
@@ -1,9 +1,8 @@
1
- import { AccessGuard as a, UserRole as i, Permission as d } from "@creopse/utils/enums";
2
- import { useI18n as g } from "vue-i18n";
3
- const I = () => {
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, l = (e) => t(e, i.SUPER_ADMIN), o = (e) => Object.values(d).includes(e), r = [
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 || u("undefined"),
33
- isPermissionNative: o,
34
- userIsSuperAdmin: l,
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
- I as useAccess
39
+ p as useAccess
41
40
  };
@@ -1,5 +1,5 @@
1
1
  const t = () => {
2
- const { sharedData: e, api: o, i18n: a, router: s, helpers: n, stores: r } = window.__creopse__;
2
+ const { sharedData: e, api: o, i18n: a, router: s, helpers: n, stores: r } = window.__creopse__ || {};
3
3
  return {
4
4
  locale: e?.locale,
5
5
  env: e?.env,
@@ -1,16 +1,12 @@
1
1
  import { Bool as e } from "@creopse/utils";
2
- import { ref as r } from "vue";
3
- import { useI18n as t } from "vue-i18n";
4
- const s = () => {
5
- const { locale: o } = t();
6
- return {
7
- defaultPrefs: r({
8
- inAppNotifEnabled: e.TRUE,
9
- emailNotifEnabled: e.TRUE,
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
- s as useUserPreference
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.20",
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
- "zustand": "^5.0.12",
42
- "vite": "^7.0.5"
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"
@@ -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
- };