@biglogic/rgs 3.7.3 → 3.7.8

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.
Files changed (51) hide show
  1. package/COPYRIGHT.md +4 -0
  2. package/FUNDING.yml +12 -0
  3. package/LICENSE.md +9 -9
  4. package/README.md +470 -470
  5. package/SECURITY.md +13 -0
  6. package/advanced.d.ts +9 -0
  7. package/core/advanced.d.ts +5 -0
  8. package/core/async.d.ts +8 -0
  9. package/core/env.d.ts +4 -0
  10. package/core/hooks.d.ts +17 -0
  11. package/core/minimal.d.ts +8 -0
  12. package/core/minimal.js +19 -0
  13. package/core/persistence.d.ts +23 -0
  14. package/core/plugins.d.ts +8 -0
  15. package/core/reactivity.d.ts +19 -0
  16. package/core/security.d.ts +56 -0
  17. package/core/store.d.ts +7 -0
  18. package/core/sync.d.ts +76 -0
  19. package/core/types.d.ts +164 -0
  20. package/core/utils.d.ts +2 -0
  21. package/docs/README.md +470 -0
  22. package/docs/SUMMARY.md +64 -0
  23. package/docs/_config.yml +1 -0
  24. package/docs/api.md +381 -0
  25. package/docs/chapters/01-philosophy.md +54 -0
  26. package/docs/chapters/02-getting-started.md +68 -0
  27. package/docs/chapters/03-the-magnetar-way.md +69 -0
  28. package/docs/chapters/04-persistence-and-safety.md +125 -0
  29. package/docs/chapters/05-plugin-sdk.md +290 -0
  30. package/docs/chapters/05-plugins-and-extensibility.md +190 -0
  31. package/docs/chapters/06-case-studies.md +69 -0
  32. package/docs/chapters/07-faq.md +53 -0
  33. package/docs/chapters/08-migration-guide.md +284 -0
  34. package/docs/chapters/09-security-architecture.md +50 -0
  35. package/docs/chapters/10-local-first-sync.md +146 -0
  36. package/docs/qa.md +47 -0
  37. package/index.d.ts +41 -0
  38. package/index.js +2100 -0
  39. package/package.json +13 -22
  40. package/plugins/index.d.ts +15 -0
  41. package/plugins/official/analytics.plugin.d.ts +9 -0
  42. package/plugins/official/cloud-sync.plugin.d.ts +22 -0
  43. package/plugins/official/debug.plugin.d.ts +2 -0
  44. package/plugins/official/devtools.plugin.d.ts +4 -0
  45. package/plugins/official/guard.plugin.d.ts +2 -0
  46. package/plugins/official/immer.plugin.d.ts +2 -0
  47. package/plugins/official/indexeddb.plugin.d.ts +7 -0
  48. package/plugins/official/schema.plugin.d.ts +2 -0
  49. package/plugins/official/snapshot.plugin.d.ts +2 -0
  50. package/plugins/official/sync.plugin.d.ts +4 -0
  51. package/plugins/official/undo-redo.plugin.d.ts +4 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@biglogic/rgs",
3
- "version": "3.7.3",
3
+ "version": "3.7.8",
4
4
  "description": "Argis (RGS) - Reactive Global State: A react state everywhere made easy",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -21,6 +21,14 @@
21
21
  "bugs": {
22
22
  "url": "https://github.com/BigLogic-ca/rgs/issues"
23
23
  },
24
+ "publishConfig": {
25
+ "access": "public",
26
+ "registry": "https://registry.npmjs.org/",
27
+ "provenance": true
28
+ },
29
+ "files": [
30
+ "**/*"
31
+ ],
24
32
  "license": "MIT",
25
33
  "author": "Dario Passariello <dariopassariello@gmail.com>",
26
34
  "contributors": [
@@ -42,49 +50,32 @@
42
50
  "type": "git",
43
51
  "url": "git+https://github.com/BigLogic-ca/rgs.git"
44
52
  },
45
- "files": [
46
- "dist"
47
- ],
48
53
  "main": "./index.js",
49
54
  "types": "./index.d.ts",
50
- "exports": {
51
- ".": "./dist/index.js",
52
- "./core/minimal": "./dist/core/minimal.js"
53
- },
54
55
  "engines": {
55
56
  "node": ">=16.0.0"
56
57
  },
57
- "publishConfig": {
58
- "access": "public",
59
- "registry": "https://registry.npmjs.org/",
60
- "provenance": false
61
- },
62
58
  "scripts": {
63
59
  "dev": "npm run build:watch",
64
60
  "build": "node -e \"const fs=require('fs');if(fs.existsSync('./dist'))fs.rmSync('./dist',{recursive:true});\" && node ./esbuild.config.mjs && npx tsc -p tsconfig.json --emitDeclarationOnly",
65
61
  "build:watch": "node ./esbuild.config.mjs --watch",
66
62
  "build:extension": "cd vscode-extension && vsce package -o ../dist/rgs-extension.vsix",
63
+ "npm:pack": "npm run build && cd dist && npm pack",
64
+ "npm:publish": "npm run build && npm run build:extension && cd dist && npm publish --access=public",
67
65
  "lint": "cd tests && npm run lint",
68
66
  "tsc": "cd tests && tsc --noEmit",
69
- "test": "cd tests && npm test",
70
- "npm:pack": "npm run build && cd dist && npm pack",
71
- "npm:publish": "npm run build && npm run build:extension && cd dist && npm publish --access=public"
67
+ "test": "cd tests && npm test"
72
68
  },
73
69
  "devDependencies": {
74
- "@types/node": "^25.3.2",
70
+ "@types/node": "^25.3.3",
75
71
  "@types/react": "^19.2.14",
76
72
  "@types/react-dom": "^19.2.3",
77
73
  "esbuild": "0.27.3",
78
74
  "esbuild-node-externals": "1.20.1",
79
- "esbuild-plugin-alias": "0.2.1",
80
75
  "esbuild-plugin-copy": "2.1.1",
81
- "esbuild-sass-plugin": "3.6.0",
82
- "esbuild-scss-modules-plugin": "1.1.1",
83
76
  "immer": "11.1.4",
84
- "memorio": "2.5.0",
85
77
  "react": "^19.2.4",
86
78
  "react-dom": "^19.2.4",
87
- "ts-jest": "29.2.5",
88
79
  "tslib": "^2.8.1",
89
80
  "typescript": "^5.9.3"
90
81
  }
@@ -0,0 +1,15 @@
1
+ export { immerPlugin } from "./official/immer.plugin";
2
+ export { undoRedoPlugin } from "./official/undo-redo.plugin";
3
+ export { schemaPlugin } from "./official/schema.plugin";
4
+ export { devToolsPlugin } from "./official/devtools.plugin";
5
+ export { snapshotPlugin } from "./official/snapshot.plugin";
6
+ export { guardPlugin } from "./official/guard.plugin";
7
+ export { analyticsPlugin } from "./official/analytics.plugin";
8
+ export { syncPlugin } from "./official/sync.plugin";
9
+ export { debugPlugin } from "./official/debug.plugin";
10
+ export { indexedDBPlugin } from "./official/indexeddb.plugin";
11
+ export { cloudSyncPlugin, createMongoAdapter, createFirestoreAdapter, createSqlRestAdapter } from "./official/cloud-sync.plugin";
12
+ import type { IPlugin } from "../core/types";
13
+ export declare const loggerPlugin: <S extends Record<string, unknown>>(options?: {
14
+ collapsed?: boolean;
15
+ }) => IPlugin<S>;
@@ -0,0 +1,9 @@
1
+ import type { IPlugin } from '../../core/types';
2
+ export declare const analyticsPlugin: (options: {
3
+ provider: (event: {
4
+ key: string;
5
+ value: unknown;
6
+ action: string;
7
+ }) => void;
8
+ keys?: string[];
9
+ }) => IPlugin;
@@ -0,0 +1,22 @@
1
+ import type { IPlugin } from '../../core/types';
2
+ export interface SyncStats {
3
+ lastSyncTimestamp: number | null;
4
+ totalKeysSynced: number;
5
+ totalBytesSynced: number;
6
+ syncCount: number;
7
+ lastDuration: number;
8
+ errors: number;
9
+ }
10
+ export interface CloudSyncAdapter {
11
+ name: string;
12
+ save: (data: Record<string, unknown>) => Promise<boolean>;
13
+ }
14
+ export interface CloudSyncOptions {
15
+ adapter: CloudSyncAdapter;
16
+ autoSyncInterval?: number;
17
+ onSync?: (stats: SyncStats) => void;
18
+ }
19
+ export declare const cloudSyncPlugin: <S extends Record<string, unknown>>(options: CloudSyncOptions) => IPlugin<S>;
20
+ export declare const createMongoAdapter: (apiUrl: string, apiKey: string) => CloudSyncAdapter;
21
+ export declare const createFirestoreAdapter: (db: unknown, docPath: string) => CloudSyncAdapter;
22
+ export declare const createSqlRestAdapter: (endpoint: string, getAuthToken: () => string | null) => CloudSyncAdapter;
@@ -0,0 +1,2 @@
1
+ import type { IPlugin } from '../../core/types';
2
+ export declare const debugPlugin: () => IPlugin;
@@ -0,0 +1,4 @@
1
+ import type { IPlugin } from '../../core/types';
2
+ export declare const devToolsPlugin: (options?: {
3
+ name?: string;
4
+ }) => IPlugin;
@@ -0,0 +1,2 @@
1
+ import type { IPlugin } from '../../core/types';
2
+ export declare const guardPlugin: (guards: Record<string, (val: unknown) => unknown>) => IPlugin;
@@ -0,0 +1,2 @@
1
+ import type { IPlugin } from '../../core/types';
2
+ export declare const immerPlugin: <S extends Record<string, unknown>>() => IPlugin<S>;
@@ -0,0 +1,7 @@
1
+ import type { IPlugin } from '../../core/types';
2
+ export interface IndexedDBOptions {
3
+ dbName?: string;
4
+ storeName?: string;
5
+ version?: number;
6
+ }
7
+ export declare const indexedDBPlugin: <S extends Record<string, unknown>>(options?: IndexedDBOptions) => IPlugin<S>;
@@ -0,0 +1,2 @@
1
+ import type { IPlugin } from '../../core/types';
2
+ export declare const schemaPlugin: (schemas: Record<string, (val: unknown) => boolean | string>) => IPlugin;
@@ -0,0 +1,2 @@
1
+ import type { IPlugin } from '../../core/types';
2
+ export declare const snapshotPlugin: () => IPlugin;
@@ -0,0 +1,4 @@
1
+ import type { IPlugin } from '../../core/types';
2
+ export declare const syncPlugin: (options?: {
3
+ channelName?: string;
4
+ }) => IPlugin;
@@ -0,0 +1,4 @@
1
+ import type { IPlugin } from '../../core/types';
2
+ export declare const undoRedoPlugin: <S extends Record<string, unknown>>(options?: {
3
+ limit?: number;
4
+ }) => IPlugin<S>;