@creopse/bridge 0.1.14 → 0.1.16

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,80 @@
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";
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 { 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";
8
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";
9
8
  import N 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-i18next-loader";
10
+ import B from "vite-plugin-json5";
12
11
  import z from "vite-plugin-top-level-await";
13
12
  function X(A = {}) {
14
13
  const {
15
- manifestPath: p = "./manifest.jsonc",
16
- srcDir: c = "./src",
17
- outDir: d = "frontend",
18
- i18nLocalesPath: f,
14
+ manifestPath: w = "./manifest.jsonc",
15
+ srcDir: f = "./src",
16
+ outDir: u = "frontend",
17
+ i18nLocalesPath: g,
19
18
  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;
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
+ );
35
46
  }
36
- const y = {
47
+ const I = g ? a.resolve(s, g) : a.resolve(s, f, "i18n/locales"), C = ["react", "react-dom", "zustand", ...y], b = {
37
48
  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];
49
+ config() {
41
50
  return {
42
51
  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
52
  resolve: {
75
53
  alias: [
76
54
  {
77
55
  find: "@",
78
- replacement: s.resolve(r, c)
56
+ replacement: a.resolve(s, f)
79
57
  }
80
58
  ],
81
59
  dedupe: ["react", "react-dom", "zustand"]
82
60
  },
83
61
  build: {
84
62
  target: "esnext",
85
- outDir: d,
63
+ outDir: u,
64
+ assetsInlineLimit: 1 / 0,
65
+ cssCodeSplit: !1,
86
66
  rollupOptions: {
87
67
  plugins: [
88
68
  k({
89
69
  targets: [
90
70
  {
91
- src: s.resolve(r, p),
92
- dest: d,
71
+ src: t,
72
+ dest: u,
93
73
  transform() {
94
- return e?.mode && (e.mode = m ? "development" : "production"), ((a) => a.replace(/(,)\s*\n/g, `,
74
+ return e?.mode && (e.mode = S ? "development" : "production"), ((o) => o.replace(/(,)\s*\n/g, `,
95
75
 
96
76
  `))(
97
- M(e, null, 2)
77
+ j(e, null, 2)
98
78
  );
99
79
  }
100
80
  }
@@ -104,12 +84,10 @@ function X(A = {}) {
104
84
  flatten: !0
105
85
  })
106
86
  ]
107
- },
108
- assetsInlineLimit: 1 / 0,
109
- cssCodeSplit: !1
87
+ }
110
88
  },
111
89
  preview: {
112
- port: v,
90
+ port: c,
113
91
  strictPort: !0,
114
92
  cors: !0,
115
93
  headers: {
@@ -117,16 +95,54 @@ function X(A = {}) {
117
95
  }
118
96
  },
119
97
  server: {
120
- port: P,
98
+ port: p,
121
99
  cors: !0,
122
100
  headers: {
123
101
  "Access-Control-Allow-Origin": "*"
124
102
  }
125
103
  }
126
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
+ });
127
113
  }
128
114
  };
129
- return [$(), y];
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
+ ];
130
146
  }
131
147
  export {
132
148
  X as CreopseReactPlugin
@@ -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,132 @@
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";
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";
12
- import k from "vite-plugin-top-level-await";
13
- function Q(h = {}) {
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 { parse as M, stringify 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";
5
+ import P from "fs";
6
+ import n from "path";
7
+ import V 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 j from "vite-plugin-json5";
11
+ import B from "vite-plugin-top-level-await";
12
+ function K(h = {}) {
14
13
  const {
15
- manifestPath: m = "./manifest.jsonc",
16
- srcDir: c = "./src",
17
- outDir: u = "frontend",
18
- i18nLocalesPath: d,
14
+ manifestPath: A = "./manifest.jsonc",
15
+ srcDir: g = "./src",
16
+ outDir: w = "frontend",
17
+ i18nLocalesPath: v,
19
18
  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;
19
+ shared: y = []
20
+ } = h, i = process.cwd(), t = n.resolve(i, A), E = process.env.APP_IS_PREVIEW === "true";
21
+ let e;
22
+ const a = {};
23
+ let c = "creopse-plugin", m = "remoteEntry.js", u = 2160, f = 2161, d = !1;
24
+ try {
25
+ if (P.existsSync(t)) {
26
+ const r = P.readFileSync(t, "utf-8");
27
+ if (e = M(r || "{}"), e.pages && Array.isArray(e.pages))
28
+ for (const p of e.pages)
29
+ a[`./${p.name}`] = p.module;
30
+ const o = e.dashboard;
31
+ o?.module && (a[`./${C}`] = o.module);
32
+ const s = e.settings;
33
+ s?.module && (a[`./${I}`] = s.module);
34
+ const l = e.development;
35
+ c = L(String(e.id)) || c, m = e.entry || m, u = l?.previewPort || u, f = l?.serverPort || f, d = l?.ssl || d;
36
+ } else
37
+ console.warn(
38
+ `[CreopseVuePlugin] Warning: Manifest not found at ${t}`
39
+ );
40
+ } catch (r) {
41
+ console.error(
42
+ "[CreopseVuePlugin] Fatal error while parsing manifest:",
43
+ r
44
+ );
34
45
  }
35
- const y = {
46
+ const S = v ? n.resolve(i, v) : n.resolve(i, g, "i18n/locales"), D = {
36
47
  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];
48
+ config(r) {
49
+ const o = r.root || i, s = n.resolve(o, w);
40
50
  return {
41
51
  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
52
  resolve: {
67
- alias: [
68
- {
69
- find: "@",
70
- replacement: t.resolve(r, c)
71
- }
72
- ],
53
+ alias: [{ find: "@", replacement: n.resolve(o, g) }],
73
54
  dedupe: ["vue"]
74
55
  },
75
56
  build: {
76
57
  target: "esnext",
77
- outDir: u,
58
+ outDir: s,
59
+ assetsInlineLimit: 1 / 0,
60
+ cssCodeSplit: !1,
78
61
  rollupOptions: {
79
62
  plugins: [
80
- N({
63
+ V({
81
64
  targets: [
82
65
  {
83
- src: t.resolve(r, m),
84
- dest: u,
66
+ src: t,
67
+ dest: s,
85
68
  transform() {
86
- return e?.mode && (e.mode = p ? "development" : "production"), ((l) => l.replace(/(,)\s*\n/g, `,
69
+ return e?.mode && (e.mode = E ? "development" : "production"), ((p) => p.replace(/(,)\s*\n/g, `,
87
70
 
88
71
  `))(
89
- C(e, null, 2)
72
+ O(e, null, 2)
90
73
  );
91
74
  }
92
75
  }
93
76
  ],
94
77
  hook: "writeBundle",
95
- verbose: !1,
96
78
  flatten: !0
97
79
  })
98
80
  ]
99
- },
100
- assetsInlineLimit: 1 / 0,
101
- cssCodeSplit: !1
81
+ }
102
82
  },
103
83
  preview: {
104
- port: g,
84
+ port: u,
105
85
  strictPort: !0,
106
86
  cors: !0,
107
- headers: {
108
- "Access-Control-Allow-Origin": "*"
109
- }
87
+ headers: { "Access-Control-Allow-Origin": "*" }
110
88
  },
111
89
  server: {
112
- port: P,
90
+ port: f,
113
91
  cors: !0,
114
- headers: {
115
- "Access-Control-Allow-Origin": "*"
116
- }
92
+ headers: { "Access-Control-Allow-Origin": "*" }
117
93
  }
118
94
  };
95
+ },
96
+ configureServer(r) {
97
+ r.watcher.add(t), r.watcher.on("change", (o) => {
98
+ o === t && (console.info(
99
+ `
100
+ [CreopseVuePlugin] Manifest changed, restarting Vite...`
101
+ ), r.restart());
102
+ });
119
103
  }
120
104
  };
121
- return [$(), y];
105
+ return [
106
+ j(),
107
+ b({
108
+ name: c,
109
+ filename: m,
110
+ exposes: a,
111
+ shared: ["vue", "pinia", ...y]
112
+ }),
113
+ B({
114
+ promiseExportName: "__tla",
115
+ promiseImportName: (r) => `__tla_${r}`
116
+ }),
117
+ $({
118
+ paths: [S],
119
+ include: ["**/*.json"]
120
+ }),
121
+ N({
122
+ dirs: _,
123
+ imports: ["vue", "pinia"],
124
+ vueTemplate: !0
125
+ }),
126
+ ...d ? [x()] : [],
127
+ D
128
+ ];
122
129
  }
123
130
  export {
124
- Q as CreopseVuePlugin
131
+ K as CreopseVuePlugin
125
132
  };
@@ -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.16",
5
5
  "private": false,
6
6
  "author": "Noé Gnanih <noegnanih@gmail.com>",
7
7
  "license": "MIT",