@creopse/bridge 0.1.14 → 0.1.15

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,7 @@
1
+ import { PluginData } from '@creopse/utils/types';
2
+ export interface Props {
3
+ plugin: PluginData | null;
4
+ modules: Record<string, () => Promise<any>>;
5
+ }
6
+ declare const PluginPages: ({ plugin, modules }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export default PluginPages;
@@ -0,0 +1,78 @@
1
+ import { jsxs as l, jsx as o } from "react/jsx-runtime";
2
+ import { useState as x, Suspense as p, lazy as g } from "react";
3
+ import { useCoreBridge as v } from "../../hooks/core-bridge.js";
4
+ const C = ({ plugin: s, modules: i }) => {
5
+ const {
6
+ i18n: { t: h },
7
+ helpers: { tr: f }
8
+ } = v(), a = (e) => {
9
+ const t = e.split("/");
10
+ return t[t.length - 1]?.split(".")[0] || "";
11
+ }, c = (e) => {
12
+ const t = e.replace("./src/", "./"), n = Object.keys(i).find((d) => d === t);
13
+ return n ? g(i[n]) : (console.warn(`Component not found for ${e} at ${t}`), null);
14
+ }, r = {};
15
+ if (s?.pages?.forEach((e) => {
16
+ const t = a(e.module), n = c(e.module);
17
+ n && (r[t] = n);
18
+ }), s?.dashboard?.module) {
19
+ const e = a(s.dashboard.module), t = c(s.dashboard.module);
20
+ t && (r[e] = t);
21
+ }
22
+ if (s?.settings?.module) {
23
+ const e = a(s.settings.module), t = c(s.settings.module);
24
+ t && (r[e] = t);
25
+ }
26
+ const [u, b] = x(
27
+ s?.pages?.length ? a(s.pages[0].module) : ""
28
+ ), m = (e, t, n) => {
29
+ const d = a(e);
30
+ return /* @__PURE__ */ o(
31
+ "button",
32
+ {
33
+ onClick: () => b(d),
34
+ className: `rounded-lg border border-transparent px-5 py-2 text-base font-medium transition-colors duration-200 cursor-pointer bg-[#f9f9f9] hover:border-[#1E9CD7] focus:outline focus:outline-4 focus:outline-blue-200 ${u === d ? "!bg-[#1E9CD7] text-white" : "text-gray-800"}`,
35
+ children: t
36
+ },
37
+ n
38
+ );
39
+ };
40
+ return /* @__PURE__ */ l("div", { className: "min-h-screen bg-gray-50", children: [
41
+ /* @__PURE__ */ o("nav", { className: "bg-white shadow-sm", children: /* @__PURE__ */ l("div", { className: "max-w-7xl mx-auto px-4 py-4 flex justify-between items-center", children: [
42
+ /* @__PURE__ */ o("h1", { className: "text-xl font-semibold text-gray-800", children: "🧩 Plugin" }),
43
+ /* @__PURE__ */ l("div", { className: "flex space-x-3 h-full", children: [
44
+ /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: s?.pages?.map(
45
+ (e) => m(
46
+ e.module,
47
+ f(e.title) ?? e.name,
48
+ e.name
49
+ )
50
+ ) }),
51
+ /* @__PURE__ */ o("div", { className: "border-[0.25px] border-solid border-gray-300 mx-4 min-h-full" }),
52
+ /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
53
+ s?.dashboard?.module && m(
54
+ s.dashboard.module,
55
+ h("dashboard"),
56
+ "dashboard"
57
+ ),
58
+ s?.settings?.module && m(
59
+ s.settings.module,
60
+ h("settings"),
61
+ "settings"
62
+ )
63
+ ] })
64
+ ] })
65
+ ] }) }),
66
+ /* @__PURE__ */ o("main", { className: "max-w-7xl mx-auto px-4 py-16", children: /* @__PURE__ */ o("div", { className: "bg-white rounded-lg shadow-sm p-6", children: /* @__PURE__ */ o(p, { fallback: /* @__PURE__ */ o("div", { children: "Loading..." }), children: Object.entries(r).map(([e, t]) => /* @__PURE__ */ o(
67
+ "div",
68
+ {
69
+ style: { display: u === e ? "block" : "none" },
70
+ children: /* @__PURE__ */ o(t, {})
71
+ },
72
+ e
73
+ )) }) }) })
74
+ ] });
75
+ };
76
+ export {
77
+ C as default
78
+ };
@@ -0,0 +1 @@
1
+ export { default as PluginPages, type Props as PluginPagesProps, } from './PluginPages';
@@ -6,3 +6,4 @@ export * from './StickyBottom';
6
6
  export * from './CustomTransition';
7
7
  export * from './ReadMore';
8
8
  export * from './MountedTeleport';
9
+ export * from './PluginPages';
@@ -3,25 +3,27 @@ import { default as f } from "./components/AsyncImg/AsyncImg.js";
3
3
  import { default as m } from "./components/Image/Image.js";
4
4
  import { default as u } from "./components/StickyTop/StickyTop.js";
5
5
  import { default as d } from "./components/StickyBottom/StickyBottom.js";
6
- import { default as c } from "./components/CustomTransition/CustomTransition.js";
6
+ import { default as g } from "./components/CustomTransition/CustomTransition.js";
7
7
  import { default as n } from "./components/ReadMore/ReadMore.js";
8
- import { default as y } from "./components/MountedTeleport/MountedTeleport.js";
9
- import { useAccess as T } from "./hooks/access.js";
10
- import { useResponsive as A } from "./hooks/responsive.js";
11
- import { useCoreBridge as C } from "./hooks/core-bridge.js";
12
- import { useUserPreference as M } from "./hooks/user-preference.js";
8
+ import { default as P } from "./components/MountedTeleport/MountedTeleport.js";
9
+ import { default as T } from "./components/PluginPages/PluginPages.js";
10
+ import { useAccess as A } from "./hooks/access.js";
11
+ import { useResponsive as C } from "./hooks/responsive.js";
12
+ import { useCoreBridge as M } from "./hooks/core-bridge.js";
13
+ import { useUserPreference as S } from "./hooks/user-preference.js";
13
14
  export {
14
15
  f as AsyncImg,
15
- c as CustomTransition,
16
+ g as CustomTransition,
16
17
  m as Image,
17
- y as MountedTeleport,
18
+ P as MountedTeleport,
18
19
  r as PageHeader,
19
20
  t as PageLayout,
21
+ T as PluginPages,
20
22
  n as ReadMore,
21
23
  d as StickyBottom,
22
24
  u as StickyTop,
23
- T as useAccess,
24
- C as useCoreBridge,
25
- A as useResponsive,
26
- M as useUserPreference
25
+ A as useAccess,
26
+ M as useCoreBridge,
27
+ C as useResponsive,
28
+ S as useUserPreference
27
29
  };
@@ -1,100 +1,81 @@
1
- import { D as S, S as b, s as D } from "../index-C8b1StIO.js";
2
- import L from "/Users/arkane/Dev/Projects/Web/creopse.proj/creopse.toolkit/node_modules/.pnpm/@originjs+vite-plugin-federation@1.4.1/node_modules/@originjs/vite-plugin-federation/dist/index.mjs";
3
- import x 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 C from "/Users/arkane/Dev/Projects/Web/creopse.proj/creopse.toolkit/node_modules/.pnpm/@vitejs+plugin-react@4.6.0_vite@7.0.5_@types+node@24.0.15_jiti@2.6.1_tsx@4.21.0_/node_modules/@vitejs/plugin-react/dist/index.mjs";
5
- import { stringify as M, parse as O } 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";
6
- import j from "fs";
7
- import s from "path";
8
- 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";
9
- import N from "vite-plugin-auto-import-lite";
1
+ import { D, S as L, s as M } from "../index-C8b1StIO.js";
2
+ import x from "/Users/arkane/Dev/Projects/Web/creopse.proj/creopse.toolkit/node_modules/.pnpm/@originjs+vite-plugin-federation@1.4.1/node_modules/@originjs/vite-plugin-federation/dist/index.mjs";
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 R from "/Users/arkane/Dev/Projects/Web/creopse.proj/creopse.toolkit/node_modules/.pnpm/@vitejs+plugin-react@4.6.0_vite@7.0.5_@types+node@24.0.15_jiti@2.6.1_tsx@4.21.0_/node_modules/@vitejs/plugin-react/dist/index.mjs";
5
+ import { parse as j, stringify as k } 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";
6
+ import v from "fs";
7
+ import a from "path";
8
+ import N 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";
9
+ import $ from "vite-plugin-auto-import-lite";
10
10
  import B from "vite-plugin-i18next-loader";
11
- import $ from "vite-plugin-json5";
12
- import z from "vite-plugin-top-level-await";
13
- function X(A = {}) {
11
+ import z from "vite-plugin-json5";
12
+ import T from "vite-plugin-top-level-await";
13
+ function Z(A = {}) {
14
14
  const {
15
- manifestPath: p = "./manifest.jsonc",
16
- srcDir: c = "./src",
17
- outDir: d = "frontend",
18
- i18nLocalesPath: f,
15
+ manifestPath: w = "./manifest.jsonc",
16
+ srcDir: d = "./src",
17
+ outDir: u = "frontend",
18
+ i18nLocalesPath: g,
19
19
  hooksDirs: _ = ["src/hooks"],
20
- shared: E = [],
21
- eslintAutoImport: w = !1
22
- } = A;
23
- let r, e, u, g, o, v, P, h;
24
- function I() {
25
- const l = s.resolve(r, p), m = j.readFileSync(l, "utf-8");
26
- if (e = O(m || "{}"), o = {}, e.pages && Array.isArray(e.pages))
27
- for (const a of e.pages)
28
- o[`./${a.name}`] = a.module;
29
- const n = e.dashboard;
30
- n?.module && (o[`./${S}`] = n.module);
31
- const i = e.settings;
32
- i?.module && (o[`./${b}`] = i.module);
33
- const t = e.development;
34
- u = D(String(e.id)) || "creopse-plugin", g = e.entry || "remoteEntry.js", v = t?.previewPort || 2160, P = t?.serverPort || 2161, h = t?.ssl || !1;
20
+ shared: y = [],
21
+ eslintAutoImport: E = !1
22
+ } = A, s = process.cwd(), t = a.resolve(s, w), S = process.env.APP_IS_PREVIEW === "true";
23
+ let e;
24
+ const n = {};
25
+ let i = "creopse-plugin", l = "remoteEntry.js", c = 2160, p = 2161, m = !1;
26
+ try {
27
+ if (v.existsSync(t)) {
28
+ const r = v.readFileSync(t, "utf-8");
29
+ if (e = j(r || "{}"), e.pages && Array.isArray(e.pages))
30
+ for (const h of e.pages)
31
+ n[`./${h.name}`] = h.module;
32
+ const o = e.dashboard;
33
+ o?.module && (n[`./${D}`] = o.module);
34
+ const P = e.settings;
35
+ P?.module && (n[`./${L}`] = P.module);
36
+ const f = e.development;
37
+ i = M(String(e.id)) || i, l = e.entry || l, c = f?.previewPort || c, p = f?.serverPort || p, m = f?.ssl || m;
38
+ } else
39
+ console.warn(
40
+ `[CreopseReactPlugin] Warning: Manifest not found at ${t}`
41
+ );
42
+ } catch (r) {
43
+ console.error(
44
+ "[CreopseReactPlugin] Fatal error while parsing manifest:",
45
+ r
46
+ );
35
47
  }
36
- const y = {
48
+ const I = g ? a.resolve(s, g) : a.resolve(s, d, "i18n/locales"), C = ["react", "react-dom", "zustand", ...y], b = {
37
49
  name: "creopse-react-plugin",
38
- config(l) {
39
- r = l.root || process.cwd(), I();
40
- const m = process.env.APP_IS_PREVIEW === "true", n = f ? s.resolve(r, f) : s.resolve(r, c, "i18n/locales"), i = ["react", "react-dom", "zustand", ...E];
50
+ config() {
41
51
  return {
42
52
  envPrefix: "APP_",
43
- plugins: [
44
- C(),
45
- L({
46
- name: u,
47
- filename: g,
48
- exposes: o,
49
- shared: i
50
- }),
51
- z({
52
- promiseExportName: "__tla",
53
- promiseImportName: (t) => `__tla_${t}`
54
- }),
55
- // json5Plugin(),
56
- B({
57
- paths: [n],
58
- include: ["**/*.json"]
59
- }),
60
- N({
61
- dirs: _,
62
- imports: ["react"],
63
- vueTemplate: !1,
64
- ...w ? {
65
- eslintrc: {
66
- enabled: !0,
67
- filepath: "./.eslintrc-auto-import.json",
68
- globalsPropValue: !0
69
- }
70
- } : {}
71
- }),
72
- ...h ? [x()] : []
73
- ],
74
53
  resolve: {
75
54
  alias: [
76
55
  {
77
56
  find: "@",
78
- replacement: s.resolve(r, c)
57
+ replacement: a.resolve(s, d)
79
58
  }
80
59
  ],
81
60
  dedupe: ["react", "react-dom", "zustand"]
82
61
  },
83
62
  build: {
84
63
  target: "esnext",
85
- outDir: d,
64
+ outDir: u,
65
+ assetsInlineLimit: 1 / 0,
66
+ cssCodeSplit: !1,
86
67
  rollupOptions: {
87
68
  plugins: [
88
- k({
69
+ N({
89
70
  targets: [
90
71
  {
91
- src: s.resolve(r, p),
92
- dest: d,
72
+ src: t,
73
+ dest: u,
93
74
  transform() {
94
- return e?.mode && (e.mode = m ? "development" : "production"), ((a) => a.replace(/(,)\s*\n/g, `,
75
+ return e?.mode && (e.mode = S ? "development" : "production"), ((o) => o.replace(/(,)\s*\n/g, `,
95
76
 
96
77
  `))(
97
- M(e, null, 2)
78
+ k(e, null, 2)
98
79
  );
99
80
  }
100
81
  }
@@ -104,12 +85,10 @@ function X(A = {}) {
104
85
  flatten: !0
105
86
  })
106
87
  ]
107
- },
108
- assetsInlineLimit: 1 / 0,
109
- cssCodeSplit: !1
88
+ }
110
89
  },
111
90
  preview: {
112
- port: v,
91
+ port: c,
113
92
  strictPort: !0,
114
93
  cors: !0,
115
94
  headers: {
@@ -117,17 +96,56 @@ function X(A = {}) {
117
96
  }
118
97
  },
119
98
  server: {
120
- port: P,
99
+ port: p,
121
100
  cors: !0,
122
101
  headers: {
123
102
  "Access-Control-Allow-Origin": "*"
124
103
  }
125
104
  }
126
105
  };
106
+ },
107
+ configureServer(r) {
108
+ r.watcher.add(t), r.watcher.on("change", (o) => {
109
+ o === t && (console.info(
110
+ `
111
+ [CreopseReactPlugin] Manifest changed, restarting Vite...`
112
+ ), r.restart());
113
+ });
127
114
  }
128
115
  };
129
- return [$(), y];
116
+ return [
117
+ z(),
118
+ R(),
119
+ x({
120
+ name: i,
121
+ filename: l,
122
+ exposes: n,
123
+ shared: C
124
+ }),
125
+ T({
126
+ promiseExportName: "__tla",
127
+ promiseImportName: (r) => `__tla_${r}`
128
+ }),
129
+ B({
130
+ paths: [I],
131
+ include: ["**/*.json"]
132
+ }),
133
+ $({
134
+ dirs: _,
135
+ imports: ["react"],
136
+ vueTemplate: !1,
137
+ ...E ? {
138
+ eslintrc: {
139
+ enabled: !0,
140
+ filepath: "./.eslintrc-auto-import.json",
141
+ globalsPropValue: !0
142
+ }
143
+ } : {}
144
+ }),
145
+ ...m ? [O()] : [],
146
+ b
147
+ ];
130
148
  }
131
149
  export {
132
- X as CreopseReactPlugin
150
+ Z as CreopseReactPlugin
133
151
  };
@@ -27,9 +27,15 @@ export interface CreopseVuePluginOptions {
27
27
  composablesDirs?: string[];
28
28
  /**
29
29
  * Shared modules for Module Federation.
30
- * The 'vue' and 'pinia' are always included.
30
+ * The 'vue' and 'pinia' modules are always included.
31
31
  * @default []
32
32
  */
33
33
  shared?: string[];
34
34
  }
35
+ /**
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
40
+ */
35
41
  export declare function CreopseVuePlugin(options?: CreopseVuePluginOptions): PluginOption[];
package/dist/vite/vue.js CHANGED
@@ -1,125 +1,134 @@
1
- import { D as I, S, s as b } from "../index-C8b1StIO.js";
2
- import D from "/Users/arkane/Dev/Projects/Web/creopse.proj/creopse.toolkit/node_modules/.pnpm/@originjs+vite-plugin-federation@1.4.1/node_modules/@originjs/vite-plugin-federation/dist/index.mjs";
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 x from "/Users/arkane/Dev/Projects/Web/creopse.proj/creopse.toolkit/node_modules/.pnpm/@vitejs+plugin-vue@6.0.5_vite@7.0.5_@types+node@24.0.15_jiti@2.6.1_tsx@4.21.0__vue@3.5.32_typescript@5.8.3_/node_modules/@vitejs/plugin-vue/dist/index.mjs";
5
- import { stringify as C, parse 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";
6
- import O from "fs";
7
- import t from "path";
1
+ import { D as C, S as I, s as L } from "../index-C8b1StIO.js";
2
+ import b from "/Users/arkane/Dev/Projects/Web/creopse.proj/creopse.toolkit/node_modules/.pnpm/@originjs+vite-plugin-federation@1.4.1/node_modules/@originjs/vite-plugin-federation/dist/index.mjs";
3
+ import x 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 M from "/Users/arkane/Dev/Projects/Web/creopse.proj/creopse.toolkit/node_modules/.pnpm/@vitejs+plugin-vue@6.0.5_vite@7.0.5_@types+node@24.0.15_jiti@2.6.1_tsx@4.21.0__vue@3.5.32_typescript@5.8.3_/node_modules/@vitejs/plugin-vue/dist/index.mjs";
5
+ import { parse as O, stringify as V } 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";
6
+ import P from "fs";
7
+ import n from "path";
8
8
  import N 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";
9
- import j from "vite-plugin-auto-import-lite";
10
- import B from "vite-plugin-i18next-loader";
11
- import $ from "vite-plugin-json5";
9
+ import $ from "vite-plugin-auto-import-lite";
10
+ import j from "vite-plugin-i18next-loader";
11
+ import B from "vite-plugin-json5";
12
12
  import k from "vite-plugin-top-level-await";
13
- function Q(h = {}) {
13
+ function X(h = {}) {
14
14
  const {
15
- manifestPath: m = "./manifest.jsonc",
16
- srcDir: c = "./src",
17
- outDir: u = "frontend",
18
- i18nLocalesPath: d,
15
+ manifestPath: A = "./manifest.jsonc",
16
+ srcDir: g = "./src",
17
+ outDir: w = "frontend",
18
+ i18nLocalesPath: v,
19
19
  composablesDirs: _ = ["src/composables"],
20
- shared: E = []
21
- } = h;
22
- let r, e, f, v, s, g, P, A;
23
- function w() {
24
- const a = t.resolve(r, m), p = O.readFileSync(a, "utf-8");
25
- if (e = M(p || "{}"), s = {}, e.pages && Array.isArray(e.pages))
26
- for (const l of e.pages)
27
- s[`./${l.name}`] = l.module;
28
- const n = e.dashboard;
29
- n?.module && (s[`./${I}`] = n.module);
30
- const i = e.settings;
31
- i?.module && (s[`./${S}`] = i.module);
32
- const o = e.development;
33
- f = b(String(e.id)) || "creopse-plugin", v = e.entry || "remoteEntry.js", g = o?.previewPort || 2160, P = o?.serverPort || 2161, A = o?.ssl || !1;
20
+ shared: y = []
21
+ } = h, i = process.cwd(), t = n.resolve(i, A), E = process.env.APP_IS_PREVIEW === "true";
22
+ let e;
23
+ const a = {};
24
+ let c = "creopse-plugin", m = "remoteEntry.js", u = 2160, f = 2161, d = !1;
25
+ try {
26
+ if (P.existsSync(t)) {
27
+ const r = P.readFileSync(t, "utf-8");
28
+ if (e = O(r || "{}"), e.pages && Array.isArray(e.pages))
29
+ for (const p of e.pages)
30
+ a[`./${p.name}`] = p.module;
31
+ const o = e.dashboard;
32
+ o?.module && (a[`./${C}`] = o.module);
33
+ const s = e.settings;
34
+ s?.module && (a[`./${I}`] = s.module);
35
+ const l = e.development;
36
+ c = L(String(e.id)) || c, m = e.entry || m, u = l?.previewPort || u, f = l?.serverPort || f, d = l?.ssl || d;
37
+ } else
38
+ console.warn(
39
+ `[CreopseVuePlugin] Warning: Manifest not found at ${t}`
40
+ );
41
+ } catch (r) {
42
+ console.error(
43
+ "[CreopseVuePlugin] Fatal error while parsing manifest:",
44
+ r
45
+ );
34
46
  }
35
- const y = {
47
+ const S = v ? n.resolve(i, v) : n.resolve(i, g, "i18n/locales"), D = {
36
48
  name: "creopse-vue-plugin",
37
- config(a) {
38
- r = a.root || process.cwd(), w();
39
- const p = process.env.APP_IS_PREVIEW === "true", n = d ? t.resolve(r, d) : t.resolve(r, c, "i18n/locales"), i = ["vue", "pinia", ...E];
49
+ config(r) {
50
+ const o = r.root || i, s = n.resolve(o, w);
40
51
  return {
41
52
  envPrefix: "APP_",
42
- plugins: [
43
- x(),
44
- D({
45
- name: f,
46
- filename: v,
47
- exposes: s,
48
- shared: i
49
- }),
50
- k({
51
- promiseExportName: "__tla",
52
- promiseImportName: (o) => `__tla_${o}`
53
- }),
54
- // json5Plugin(),
55
- B({
56
- paths: [n],
57
- include: ["**/*.json"]
58
- }),
59
- j({
60
- dirs: _,
61
- imports: ["vue", "pinia"],
62
- vueTemplate: !0
63
- }),
64
- ...A ? [L()] : []
65
- ],
66
53
  resolve: {
67
- alias: [
68
- {
69
- find: "@",
70
- replacement: t.resolve(r, c)
71
- }
72
- ],
54
+ alias: [{ find: "@", replacement: n.resolve(o, g) }],
73
55
  dedupe: ["vue"]
74
56
  },
75
57
  build: {
76
58
  target: "esnext",
77
- outDir: u,
59
+ outDir: s,
60
+ assetsInlineLimit: 1 / 0,
61
+ cssCodeSplit: !1,
78
62
  rollupOptions: {
79
63
  plugins: [
80
64
  N({
81
65
  targets: [
82
66
  {
83
- src: t.resolve(r, m),
84
- dest: u,
67
+ src: t,
68
+ dest: s,
85
69
  transform() {
86
- return e?.mode && (e.mode = p ? "development" : "production"), ((l) => l.replace(/(,)\s*\n/g, `,
70
+ return e?.mode && (e.mode = E ? "development" : "production"), ((p) => p.replace(/(,)\s*\n/g, `,
87
71
 
88
72
  `))(
89
- C(e, null, 2)
73
+ V(e, null, 2)
90
74
  );
91
75
  }
92
76
  }
93
77
  ],
94
78
  hook: "writeBundle",
95
- verbose: !1,
96
79
  flatten: !0
97
80
  })
98
81
  ]
99
- },
100
- assetsInlineLimit: 1 / 0,
101
- cssCodeSplit: !1
82
+ }
102
83
  },
103
84
  preview: {
104
- port: g,
85
+ port: u,
105
86
  strictPort: !0,
106
87
  cors: !0,
107
- headers: {
108
- "Access-Control-Allow-Origin": "*"
109
- }
88
+ headers: { "Access-Control-Allow-Origin": "*" }
110
89
  },
111
90
  server: {
112
- port: P,
91
+ port: f,
113
92
  cors: !0,
114
- headers: {
115
- "Access-Control-Allow-Origin": "*"
116
- }
93
+ headers: { "Access-Control-Allow-Origin": "*" }
117
94
  }
118
95
  };
96
+ },
97
+ configureServer(r) {
98
+ r.watcher.add(t), r.watcher.on("change", (o) => {
99
+ o === t && (console.info(
100
+ `
101
+ [CreopseVuePlugin] Manifest changed, restarting Vite...`
102
+ ), r.restart());
103
+ });
119
104
  }
120
105
  };
121
- return [$(), y];
106
+ return [
107
+ B(),
108
+ M(),
109
+ b({
110
+ name: c,
111
+ filename: m,
112
+ exposes: a,
113
+ shared: ["vue", "pinia", ...y]
114
+ }),
115
+ k({
116
+ promiseExportName: "__tla",
117
+ promiseImportName: (r) => `__tla_${r}`
118
+ }),
119
+ j({
120
+ paths: [S],
121
+ include: ["**/*.json"]
122
+ }),
123
+ $({
124
+ dirs: _,
125
+ imports: ["vue", "pinia"],
126
+ vueTemplate: !0
127
+ }),
128
+ ...d ? [x()] : [],
129
+ D
130
+ ];
122
131
  }
123
132
  export {
124
- Q as CreopseVuePlugin
133
+ X as CreopseVuePlugin
125
134
  };
@@ -0,0 +1,10 @@
1
+ import { PluginData } from '@creopse/utils/types';
2
+ interface Props {
3
+ plugin: PluginData | null;
4
+ modules: Record<string, () => Promise<any>>;
5
+ }
6
+ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
7
+ plugin: PluginData | null;
8
+ modules: Record<string, () => Promise<any>>;
9
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
10
+ export default _default;
@@ -6,3 +6,4 @@ export * from './StickyBottom.vue';
6
6
  export * from './CustomTransition.vue';
7
7
  export * from './ReadMore.vue';
8
8
  export * from './MountedTeleport.vue';
9
+ export * from './PluginPages.vue';
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.14",
4
+ "version": "0.1.15",
5
5
  "private": false,
6
6
  "author": "Noé Gnanih <noegnanih@gmail.com>",
7
7
  "license": "MIT",