@asaleh37/ui-base 1.2.11 → 1.2.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asaleh37/ui-base",
3
- "version": "1.2.11",
3
+ "version": "1.2.13",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "author": "Ahmed Saleh Mohamed",
@@ -48,6 +48,7 @@
48
48
  "eslint": "^9.19.0",
49
49
  "eslint-plugin-react-hooks": "^5.0.0",
50
50
  "eslint-plugin-react-refresh": "^0.4.18",
51
+ "global": "^4.4.0",
51
52
  "globals": "^15.14.0",
52
53
  "i18next": "^24.2.2",
53
54
  "i18next-browser-languagedetector": "^8.0.3",
@@ -99,6 +100,7 @@
99
100
  "draft-js": "^0.11.7",
100
101
  "draft-js-import-html": "^1.4.1",
101
102
  "draftjs-to-html": "^0.9.1",
103
+ "global": "^4.4.0",
102
104
  "i18next": "^24.2.2",
103
105
  "i18next-browser-languagedetector": "^8.0.3",
104
106
  "i18next-http-backend": "^3.0.2",
@@ -121,6 +123,6 @@
121
123
  },
122
124
  "dependencies": {
123
125
  "@rollup/plugin-json": "^6.1.0",
124
- "global": "^4.4.0"
126
+ "vite-tsconfig-paths": "^5.1.4"
125
127
  }
126
128
  }
@@ -19,11 +19,6 @@ library.add(fab);
19
19
  library.add(far);
20
20
  library.add(fas);
21
21
 
22
- // Polyfill for global in case it's not defined (for browser/Vite compatibility)
23
- if (typeof global === "undefined") {
24
- global = globalThis;
25
- }
26
-
27
22
  export const BaseApp: React.FC<AppInfo> = (props) => {
28
23
  const systemReducers = {
29
24
  AppLayout: AppLayoutReducer,
@@ -1,3 +1,7 @@
1
+ // Polyfill for global in case it's not defined (for browser/Vite compatibility)
2
+ if (typeof global === "undefined") {
3
+ global = globalThis;
4
+ }
1
5
  export * from "./BaseApp";
2
6
  export * from "@mui/material";
3
7
  export * from "zod";
package/src/index.ts CHANGED
@@ -1,3 +1,7 @@
1
+ // Ensure global is defined before anything else loads draft-js
2
+ if (typeof global === 'undefined') {
3
+ (global as any) = globalThis;
4
+ }
1
5
  export * from "./components";
2
6
  export * from "./hooks";
3
7
  export * from "./util";
package/vite.config.ts CHANGED
@@ -1,24 +1,34 @@
1
1
  import { defineConfig } from "vite";
2
2
  import react from "@vitejs/plugin-react";
3
- import rollupNodePolyFill from 'rollup-plugin-polyfill-node';
4
-
3
+ import rollupNodePolyFill from "rollup-plugin-polyfill-node";
4
+ import tsconfigPaths from "vite-tsconfig-paths";
5
+ import path from "path";
5
6
 
6
7
  // https://vite.dev/config/
7
8
  export default defineConfig({
8
9
  plugins: [react()],
9
10
  define: {
10
- global: 'globalThis', // Fix for global
11
+ global: "globalThis", // Fix for global
11
12
  },
12
13
  optimizeDeps: {
13
- include: ['fbjs'],
14
+ include: ["fbjs"],
14
15
  },
15
16
  build: {
17
+ lib: {
18
+ entry: path.resolve(__dirname, "src/index.ts"),
19
+ },
16
20
  rollupOptions: {
21
+ external: ["react", "react-dom"], // 👈 keep react peer
17
22
  plugins: [rollupNodePolyFill()],
23
+ output: {
24
+ globals: {
25
+ react: "React",
26
+ "react-dom": "ReactDOM",
27
+ },
28
+ },
18
29
  },
19
30
  },
20
31
  server: {
21
32
  port: 3000,
22
33
  },
23
34
  });
24
-