shogun-core 6.3.0 → 6.3.2

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.
@@ -1,3 +1,4 @@
1
+ import "./polyfills";
1
2
  import { ShogunCore } from "./core";
2
3
  import { IGunUserInstance, IGunInstance, GunDataEventData, GunPeerEventData, DeriveOptions } from "./gundb/db";
3
4
  import { RxJS, crypto, derive, GunErrors, DataBase } from "./gundb/db";
@@ -16,3 +17,4 @@ export * from "./crypto";
16
17
  export { CryptoIdentityManager } from "./managers/CryptoIdentityManager";
17
18
  export type { CryptoIdentities, IdentityGenerationResult, } from "./managers/CryptoIdentityManager";
18
19
  export { ShogunStorage } from "./storage/storage";
20
+ export { setBufferPolyfill } from "./polyfills";
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Browser polyfills for shogun-core
3
+ *
4
+ * This module sets up Buffer and other Node.js polyfills for browser environments.
5
+ * It must be imported before any other shogun-core modules that use these APIs.
6
+ *
7
+ * IMPORTANT: This polyfill relies on the bundler to provide Buffer.
8
+ *
9
+ * For Vite projects, configure vite.config.ts:
10
+ * ```ts
11
+ * import { defineConfig } from "vite";
12
+ * import { Buffer } from "buffer";
13
+ *
14
+ * export default defineConfig({
15
+ * define: { global: "globalThis" },
16
+ * resolve: { alias: { buffer: "buffer" } },
17
+ * optimizeDeps: { include: ["buffer"] },
18
+ * });
19
+ * ```
20
+ *
21
+ * Then import the polyfill in your main entry file BEFORE importing shogun-core:
22
+ * ```ts
23
+ * import { Buffer } from "buffer";
24
+ * import { setBufferPolyfill } from "shogun-core";
25
+ * setBufferPolyfill(Buffer);
26
+ * ```
27
+ *
28
+ * For Webpack projects, the ProvidePlugin should handle this automatically.
29
+ */
30
+ export declare const setBufferPolyfill: (Buffer: any) => void;
31
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shogun-core",
3
- "version": "6.3.0",
3
+ "version": "6.3.2",
4
4
  "type": "module",
5
5
  "description": "SHOGUN CORE - Core library for Shogun Ecosystem",
6
6
  "main": "./dist/src/index.js",