@signaldb/maverickjs 1.0.0

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/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # @signaldb/maverickjs
2
+
3
+ This is the [Maverick.js signals](https://github.com/maverick-js/signals) plugin for [SignalDB](https://github.com/maxnowack/signaldb). SignalDB is a local-first JavaScript database with real-time sync, enabling optimistic UI with signal-based reactivity across multiple frameworks.
4
+
5
+ See https://signaldb.js.org/reference/maverickjs/ for more information.
@@ -0,0 +1,8 @@
1
+ {
2
+ "src/index.ts": {
3
+ "file": "index.umd.js",
4
+ "name": "index",
5
+ "src": "src/index.ts",
6
+ "isEntry": true
7
+ }
8
+ }
@@ -0,0 +1,5 @@
1
+ declare const maverickjsReactivityAdapter: import("@signaldb/core").ReactivityAdapter<{
2
+ depend: () => void;
3
+ notify: () => void;
4
+ }>;
5
+ export default maverickjsReactivityAdapter;
package/dist/index.mjs ADDED
@@ -0,0 +1,21 @@
1
+ import { signal as t, peek as o, getScope as i, onDispose as p } from "@maverick-js/signals";
2
+ import { createReactivityAdapter as r } from "@signaldb/core";
3
+ const c = r({
4
+ create: () => {
5
+ const e = t(0);
6
+ return {
7
+ depend: () => {
8
+ e();
9
+ },
10
+ notify: () => {
11
+ e.set(o(() => e() + 1));
12
+ }
13
+ };
14
+ },
15
+ isInScope: () => !!i(),
16
+ onDispose: (e) => p(e)
17
+ });
18
+ export {
19
+ c as default
20
+ };
21
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":["import { signal, peek, getScope, onDispose, } from '@maverick-js/signals';\nimport { createReactivityAdapter } from '@signaldb/core';\nconst maverickjsReactivityAdapter = createReactivityAdapter({\n create: () => {\n const dep = signal(0);\n return {\n depend: () => {\n dep();\n },\n notify: () => {\n dep.set(peek(() => dep() + 1));\n },\n };\n },\n isInScope: () => !!getScope(),\n onDispose: callback => onDispose(callback),\n});\nexport default maverickjsReactivityAdapter;\n"],"names":["maverickjsReactivityAdapter","createReactivityAdapter","dep","signal","peek","getScope","callback","onDispose"],"mappings":";;AAEA,MAAMA,IAA8BC,EAAwB;AAAA,EACxD,QAAQ,MAAM;AACJ,UAAAC,IAAMC,EAAO,CAAC;AACb,WAAA;AAAA,MACH,QAAQ,MAAM;AACN,QAAAD,EAAA;AAAA,MACR;AAAA,MACA,QAAQ,MAAM;AACV,QAAAA,EAAI,IAAIE,EAAK,MAAMF,EAAI,IAAI,CAAC,CAAC;AAAA,MAAA;AAAA,IAErC;AAAA,EACJ;AAAA,EACA,WAAW,MAAM,CAAC,CAACG,EAAS;AAAA,EAC5B,WAAW,CAAYC,MAAAC,EAAUD,CAAQ;AAC7C,CAAC;"}
@@ -0,0 +1,2 @@
1
+ (function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i(require("@maverick-js/signals"),require("@signaldb/core")):typeof define=="function"&&define.amd?define(["@maverick-js/signals","@signaldb/core"],i):(e=typeof globalThis<"u"?globalThis:e||self,e.SignalDB=i(e.signals,e.core))})(this,function(e,i){"use strict";return i.createReactivityAdapter({create:()=>{const t=e.signal(0);return{depend:()=>{t()},notify:()=>{t.set(e.peek(()=>t()+1))}}},isInScope:()=>!!e.getScope(),onDispose:t=>e.onDispose(t)})});
2
+ //# sourceMappingURL=index.umd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.umd.js","sources":["../src/index.ts"],"sourcesContent":["import { signal, peek, getScope, onDispose, } from '@maverick-js/signals';\nimport { createReactivityAdapter } from '@signaldb/core';\nconst maverickjsReactivityAdapter = createReactivityAdapter({\n create: () => {\n const dep = signal(0);\n return {\n depend: () => {\n dep();\n },\n notify: () => {\n dep.set(peek(() => dep() + 1));\n },\n };\n },\n isInScope: () => !!getScope(),\n onDispose: callback => onDispose(callback),\n});\nexport default maverickjsReactivityAdapter;\n"],"names":["createReactivityAdapter","dep","signal","peek","getScope","callback","onDispose"],"mappings":"sVAEoCA,EAAAA,wBAAwB,CACxD,OAAQ,IAAM,CACJ,MAAAC,EAAMC,SAAO,CAAC,EACb,MAAA,CACH,OAAQ,IAAM,CACND,EAAA,CACR,EACA,OAAQ,IAAM,CACVA,EAAI,IAAIE,EAAK,KAAA,IAAMF,EAAI,EAAI,CAAC,CAAC,CAAA,CAErC,CACJ,EACA,UAAW,IAAM,CAAC,CAACG,WAAS,EAC5B,UAAuBC,GAAAC,EAAAA,UAAUD,CAAQ,CAC7C,CAAC"}
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@signaldb/maverickjs",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "scripts": {
6
+ "build": "rimraf dist && vite build"
7
+ },
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/maxnowack/signaldb.git"
11
+ },
12
+ "homepage": "https://signaldb.js.org",
13
+ "keywords": [
14
+ "client-database",
15
+ "client",
16
+ "database",
17
+ "local-database",
18
+ "maverickjs",
19
+ "offline-first",
20
+ "optimistic-ui",
21
+ "reactive",
22
+ "reactivity",
23
+ "plugin",
24
+ "synchronization",
25
+ "typescript"
26
+ ],
27
+ "author": "Max Nowack <max.nowack@gmail.com>",
28
+ "license": "MIT",
29
+ "sideEffects": false,
30
+ "exports": {
31
+ ".": {
32
+ "types": "./dist/index.d.ts",
33
+ "import": "./dist/index.mjs",
34
+ "require": "./dist/index.umd.js",
35
+ "default": "./dist/index.umd.js"
36
+ }
37
+ },
38
+ "main": "./dist/index.umd.js",
39
+ "module": "./dist/index.mjs",
40
+ "types": "./dist/index.d.ts",
41
+ "typesVersions": {
42
+ "*": {
43
+ "*": [
44
+ "./dist/*",
45
+ "./dist/index.d.ts"
46
+ ]
47
+ }
48
+ },
49
+ "files": [
50
+ "dist"
51
+ ],
52
+ "peerDependencies": {
53
+ "@signaldb/core": "1.x",
54
+ "@maverick-js/signals": "5.x.x || 6.x"
55
+ }
56
+ }