@biglogic/rgs 3.7.3 → 3.7.6

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 (50) hide show
  1. package/COPYRIGHT.md +4 -0
  2. package/FUNDING.yml +12 -0
  3. package/SECURITY.md +13 -0
  4. package/advanced.d.ts +9 -0
  5. package/core/advanced.d.ts +5 -0
  6. package/core/async.d.ts +8 -0
  7. package/core/env.d.ts +4 -0
  8. package/core/hooks.d.ts +17 -0
  9. package/core/minimal.d.ts +8 -0
  10. package/core/minimal.js +19 -0
  11. package/core/persistence.d.ts +23 -0
  12. package/core/plugins.d.ts +8 -0
  13. package/core/reactivity.d.ts +19 -0
  14. package/core/security.d.ts +56 -0
  15. package/core/store.d.ts +7 -0
  16. package/core/sync.d.ts +76 -0
  17. package/core/types.d.ts +164 -0
  18. package/core/utils.d.ts +2 -0
  19. package/docs/README.md +470 -0
  20. package/docs/SUMMARY.md +64 -0
  21. package/docs/_config.yml +1 -0
  22. package/docs/api.md +381 -0
  23. package/docs/chapters/01-philosophy.md +54 -0
  24. package/docs/chapters/02-getting-started.md +68 -0
  25. package/docs/chapters/03-the-magnetar-way.md +69 -0
  26. package/docs/chapters/04-persistence-and-safety.md +125 -0
  27. package/docs/chapters/05-plugin-sdk.md +290 -0
  28. package/docs/chapters/05-plugins-and-extensibility.md +190 -0
  29. package/docs/chapters/06-case-studies.md +69 -0
  30. package/docs/chapters/07-faq.md +53 -0
  31. package/docs/chapters/08-migration-guide.md +284 -0
  32. package/docs/chapters/09-security-architecture.md +50 -0
  33. package/docs/chapters/10-local-first-sync.md +146 -0
  34. package/docs/qa.md +47 -0
  35. package/index.d.ts +41 -0
  36. package/index.js +2100 -0
  37. package/package.json +74 -91
  38. package/plugins/index.d.ts +15 -0
  39. package/plugins/official/analytics.plugin.d.ts +9 -0
  40. package/plugins/official/cloud-sync.plugin.d.ts +22 -0
  41. package/plugins/official/debug.plugin.d.ts +2 -0
  42. package/plugins/official/devtools.plugin.d.ts +4 -0
  43. package/plugins/official/guard.plugin.d.ts +2 -0
  44. package/plugins/official/immer.plugin.d.ts +2 -0
  45. package/plugins/official/indexeddb.plugin.d.ts +7 -0
  46. package/plugins/official/schema.plugin.d.ts +2 -0
  47. package/plugins/official/snapshot.plugin.d.ts +2 -0
  48. package/plugins/official/sync.plugin.d.ts +4 -0
  49. package/plugins/official/undo-redo.plugin.d.ts +4 -0
  50. package/rgs-extension.vsix +0 -0
package/package.json CHANGED
@@ -1,91 +1,74 @@
1
- {
2
- "name": "@biglogic/rgs",
3
- "version": "3.7.3",
4
- "description": "Argis (RGS) - Reactive Global State: A react state everywhere made easy",
5
- "type": "module",
6
- "keywords": [
7
- "rgs",
8
- "gstate",
9
- "state-management",
10
- "react",
11
- "enterprise",
12
- "hooks",
13
- "global-state",
14
- "immer",
15
- "biglogic",
16
- "persistence",
17
- "react-globo-state",
18
- "argis"
19
- ],
20
- "homepage": "https://github.com/BigLogic-ca/rgs",
21
- "bugs": {
22
- "url": "https://github.com/BigLogic-ca/rgs/issues"
23
- },
24
- "license": "MIT",
25
- "author": "Dario Passariello <dariopassariello@gmail.com>",
26
- "contributors": [
27
- {
28
- "name": "Dario Passariello",
29
- "email": "dariopassariello@gmail.com",
30
- "url": "https://dario.passariello.ca/"
31
- },
32
- {
33
- "name": "Valeria Cala Scaglitta",
34
- "email": "valeriacalascaglitta@gmail.com"
35
- }
36
- ],
37
- "funding": {
38
- "type": "github",
39
- "url": "https://github.com/BigLogic-ca/rgs"
40
- },
41
- "repository": {
42
- "type": "git",
43
- "url": "git+https://github.com/BigLogic-ca/rgs.git"
44
- },
45
- "files": [
46
- "dist"
47
- ],
48
- "main": "./index.js",
49
- "types": "./index.d.ts",
50
- "exports": {
51
- ".": "./dist/index.js",
52
- "./core/minimal": "./dist/core/minimal.js"
53
- },
54
- "engines": {
55
- "node": ">=16.0.0"
56
- },
57
- "publishConfig": {
58
- "access": "public",
59
- "registry": "https://registry.npmjs.org/",
60
- "provenance": false
61
- },
62
- "scripts": {
63
- "dev": "npm run build:watch",
64
- "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
- "build:watch": "node ./esbuild.config.mjs --watch",
66
- "build:extension": "cd vscode-extension && vsce package -o ../dist/rgs-extension.vsix",
67
- "lint": "cd tests && npm run lint",
68
- "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"
72
- },
73
- "devDependencies": {
74
- "@types/node": "^25.3.2",
75
- "@types/react": "^19.2.14",
76
- "@types/react-dom": "^19.2.3",
77
- "esbuild": "0.27.3",
78
- "esbuild-node-externals": "1.20.1",
79
- "esbuild-plugin-alias": "0.2.1",
80
- "esbuild-plugin-copy": "2.1.1",
81
- "esbuild-sass-plugin": "3.6.0",
82
- "esbuild-scss-modules-plugin": "1.1.1",
83
- "immer": "11.1.4",
84
- "memorio": "2.5.0",
85
- "react": "^19.2.4",
86
- "react-dom": "^19.2.4",
87
- "ts-jest": "29.2.5",
88
- "tslib": "^2.8.1",
89
- "typescript": "^5.9.3"
90
- }
91
- }
1
+ {
2
+ "name": "@biglogic/rgs",
3
+ "version": "3.7.6",
4
+ "description": "Argis (RGS) - Reactive Global State: A react state everywhere made easy",
5
+ "type": "module",
6
+ "keywords": [
7
+ "rgs",
8
+ "gstate",
9
+ "state-management",
10
+ "react",
11
+ "enterprise",
12
+ "hooks",
13
+ "global-state",
14
+ "immer",
15
+ "biglogic",
16
+ "persistence",
17
+ "react-globo-state",
18
+ "argis"
19
+ ],
20
+ "homepage": "https://github.com/BigLogic-ca/rgs",
21
+ "bugs": {
22
+ "url": "https://github.com/BigLogic-ca/rgs/issues"
23
+ },
24
+ "license": "MIT",
25
+ "author": "Dario Passariello <dariopassariello@gmail.com>",
26
+ "contributors": [
27
+ {
28
+ "name": "Dario Passariello",
29
+ "email": "dariopassariello@gmail.com",
30
+ "url": "https://dario.passariello.ca/"
31
+ },
32
+ {
33
+ "name": "Valeria Cala Scaglitta",
34
+ "email": "valeriacalascaglitta@gmail.com"
35
+ }
36
+ ],
37
+ "funding": {
38
+ "type": "github",
39
+ "url": "https://github.com/BigLogic-ca/rgs"
40
+ },
41
+ "repository": {
42
+ "type": "git",
43
+ "url": "git+https://github.com/BigLogic-ca/rgs.git"
44
+ },
45
+ "main": "./index.js",
46
+ "types": "./index.d.ts",
47
+ "engines": {
48
+ "node": ">=16.0.0"
49
+ },
50
+ "scripts": {
51
+ "dev": "npm run build:watch",
52
+ "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",
53
+ "build:watch": "node ./esbuild.config.mjs --watch",
54
+ "build:extension": "cd vscode-extension && vsce package -o ../dist/rgs-extension.vsix",
55
+ "npm:pack": "npm run build && cd dist && npm pack",
56
+ "npm:publish": "npm run build && npm run build:extension && cd dist && npm publish --access=public",
57
+ "lint": "cd tests && npm run lint",
58
+ "tsc": "cd tests && tsc --noEmit",
59
+ "test": "cd tests && npm test"
60
+ },
61
+ "devDependencies": {
62
+ "@types/node": "^25.3.2",
63
+ "@types/react": "^19.2.14",
64
+ "@types/react-dom": "^19.2.3",
65
+ "esbuild": "0.27.3",
66
+ "esbuild-node-externals": "1.20.1",
67
+ "esbuild-plugin-copy": "2.1.1",
68
+ "immer": "11.1.4",
69
+ "react": "^19.2.4",
70
+ "react-dom": "^19.2.4",
71
+ "tslib": "^2.8.1",
72
+ "typescript": "^5.9.3"
73
+ }
74
+ }
@@ -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>;
Binary file