{"_id":"@caspian-vega/nano-macro-contracts","_rev":"8-c2aaeb9cda979e4b186bef8df7a14b94","name":"@caspian-vega/nano-macro-contracts","dist-tags":{"latest":"0.4.1"},"versions":{"0.1.0":{"name":"@caspian-vega/nano-macro-contracts","version":"0.1.0","keywords":["nanostores","store","state-management","macro-store","contracts","rxjs-like","operators"],"license":"MIT","_id":"@caspian-vega/nano-macro-contracts@0.1.0","maintainers":[{"name":"caspianvega","email":"dom.konstantin@tutanota.com"}],"dist":{"shasum":"1e2d31bb5cdee6f02eeec4d6d8e27edff50d2fac","tarball":"https://registry.npmjs.org/@caspian-vega/nano-macro-contracts/-/nano-macro-contracts-0.1.0.tgz","fileCount":45,"integrity":"sha512-TiFHEZlsTLhTVgLOMSKtxWoZMlJpkatg32AnvIfquI8El8atBficxeY2mOq+nOg8C6oYsSWFIlFGjkmJ7MOZ8A==","signatures":[{"sig":"MEQCICLFuSw/gbjufRnlNsUaq6upeNU4yN8z05VaBDhP1HexAiAt/PklUQcVABn9JfX28cMxXrlkAsZby//w6UkZQ02dsg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":121245},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./macro-store":{"types":"./dist/macro-store.d.ts","import":"./dist/macro-store.js","require":"./dist/macro-store.cjs"},"./nanostore-lite":{"types":"./dist/nanostore-lite.d.ts","import":"./dist/nanostore-lite.js","require":"./dist/nanostore-lite.cjs"},"./nanostore-ready":{"types":"./dist/nanostore-ready.d.ts","import":"./dist/nanostore-ready.js","require":"./dist/nanostore-ready.cjs"},"./nanostore-utils":{"types":"./dist/nanostore-utils.d.ts","import":"./dist/nanostore-utils.js","require":"./dist/nanostore-utils.cjs"}},"scripts":{"test":"vitest run tests/nanostore-ready.spec.ts tests/macro-store.spec.ts","build":"vite build","typecheck":"tsc --noEmit"},"_npmUser":{"name":"caspianvega","email":"dom.konstantin@tutanota.com"},"description":"Lightweight, opinionated contracts built on top of nanostores: defineStore (chain-composed macro-stores with state, async resources, computes and actions) and a small set of RxJS-like store operators.","directories":{},"sideEffects":false,"_nodeVersion":"24.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.3.3","vitest":"^3.2.4","nanostores":"^1.3.0","typescript":"^5.4.0","@types/node":"^25.9.1","vite-plugin-dts":"^5.0.1","@nanostores/async":"^0.1.0","@nanostores/logger":"^1.1.0"},"peerDependencies":{"nanostores":">=0.10.0","@nanostores/async":">=0.1.0","@nanostores/logger":">=0.3.0"},"_npmOperationalInternal":{"tmp":"tmp/nano-macro-contracts_0.1.0_1786805378335_0.4508514885714965","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@caspian-vega/nano-macro-contracts","version":"0.1.1","keywords":["nanostores","store","state-management","macro-store","contracts","rxjs-like","operators"],"license":"MIT","_id":"@caspian-vega/nano-macro-contracts@0.1.1","maintainers":[{"name":"caspianvega","email":"dom.konstantin@tutanota.com"}],"dist":{"shasum":"c5e87f733019a526244af704c3ba48dfd439f4b6","tarball":"https://registry.npmjs.org/@caspian-vega/nano-macro-contracts/-/nano-macro-contracts-0.1.1.tgz","fileCount":45,"integrity":"sha512-n4jPz1MInoO3hdw3IC+r2aPUamUWaCfXY9bkmAV4e0fKzLcJnWXTRItecDZ16nhDKglrC9QIfJN7fO+qK+UbHA==","signatures":[{"sig":"MEYCIQD9wRs9FU+/Ek2TersEkxeMTVJVLiiXXoUH+0L6wP9yyQIhAPPZK0v//Vjp3ROJjScrabhwwdl0SbbFnf9xn76IBuDf","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":146980},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./macro-store":{"types":"./dist/macro-store.d.ts","import":"./dist/macro-store.js","require":"./dist/macro-store.cjs"},"./nanostore-lite":{"types":"./dist/nanostore-lite.d.ts","import":"./dist/nanostore-lite.js","require":"./dist/nanostore-lite.cjs"},"./nanostore-ready":{"types":"./dist/nanostore-ready.d.ts","import":"./dist/nanostore-ready.js","require":"./dist/nanostore-ready.cjs"},"./nanostore-utils":{"types":"./dist/nanostore-utils.d.ts","import":"./dist/nanostore-utils.js","require":"./dist/nanostore-utils.cjs"}},"scripts":{"test":"vitest run tests/nanostore-ready.spec.ts tests/macro-store.spec.ts","build":"vite build","typecheck":"tsc --noEmit"},"_npmUser":{"name":"caspianvega","email":"dom.konstantin@tutanota.com"},"description":"Lightweight, opinionated contracts built on top of nanostores: defineStore (chain-composed macro-stores with state, async resources, computes and actions) and a small set of RxJS-like store operators.","directories":{},"sideEffects":false,"_nodeVersion":"24.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.3.3","vitest":"^3.2.4","nanostores":"^1.3.0","typescript":"^5.4.0","@types/node":"^25.9.1","vite-plugin-dts":"^5.0.1","@nanostores/async":"^0.1.0","@nanostores/logger":"^1.1.0"},"peerDependencies":{"nanostores":">=0.10.0","@nanostores/async":">=0.1.0","@nanostores/logger":">=0.3.0"},"_npmOperationalInternal":{"tmp":"tmp/nano-macro-contracts_0.1.1_1786826477124_0.2924218801874019","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@caspian-vega/nano-macro-contracts","version":"0.2.0","keywords":["nanostores","store","state-management","macro-store","contracts","rxjs-like","operators"],"license":"MIT","_id":"@caspian-vega/nano-macro-contracts@0.2.0","maintainers":[{"name":"caspianvega","email":"dom.konstantin@tutanota.com"}],"dist":{"shasum":"d96eaab3a0b9aff661f3f6912a884287d9a8b86e","tarball":"https://registry.npmjs.org/@caspian-vega/nano-macro-contracts/-/nano-macro-contracts-0.2.0.tgz","fileCount":45,"integrity":"sha512-4Zjbg75TGd6Qlb+5noh0Ketx3i0c7U0WwXtRelIJRizVfvfFW4KaooeW5Zq2W1oCJo14Tg9ioTZrstH+aag7vw==","signatures":[{"sig":"MEUCICwGp4hmv7TMAoIqcplpDeV4ISHHT0tBdqyb05Uu+nzSAiEApRcHZeIc10sp9sPq9Q5G1hXlP/3pI8GX4UGJFwc842s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":162907},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./macro-store":{"types":"./dist/macro-store.d.ts","import":"./dist/macro-store.js","require":"./dist/macro-store.cjs"},"./nanostore-lite":{"types":"./dist/nanostore-lite.d.ts","import":"./dist/nanostore-lite.js","require":"./dist/nanostore-lite.cjs"},"./nanostore-ready":{"types":"./dist/nanostore-ready.d.ts","import":"./dist/nanostore-ready.js","require":"./dist/nanostore-ready.cjs"},"./nanostore-utils":{"types":"./dist/nanostore-utils.d.ts","import":"./dist/nanostore-utils.js","require":"./dist/nanostore-utils.cjs"}},"scripts":{"test":"vitest run tests/nanostore-ready.spec.ts tests/macro-store.spec.ts","build":"vite build","typecheck":"tsc --noEmit"},"_npmUser":{"name":"caspianvega","email":"dom.konstantin@tutanota.com"},"description":"Lightweight, opinionated contracts built on top of nanostores: defineStore (chain-composed macro-stores with state, async resources, computes and actions) and a small set of RxJS-like store operators.","directories":{},"sideEffects":false,"_nodeVersion":"24.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.3.3","vitest":"^3.2.4","nanostores":"^1.3.0","typescript":"^5.4.0","@types/node":"^25.9.1","vite-plugin-dts":"^5.0.1","@nanostores/async":"^0.1.0","@nanostores/logger":"^1.1.0"},"peerDependencies":{"nanostores":">=0.10.0","@nanostores/async":">=0.1.0","@nanostores/logger":">=0.3.0"},"_npmOperationalInternal":{"tmp":"tmp/nano-macro-contracts_0.2.0_1786844107949_0.8043692002027432","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@caspian-vega/nano-macro-contracts","version":"0.2.1","keywords":["nanostores","store","state-management","macro-store","contracts","rxjs-like","operators"],"license":"MIT","_id":"@caspian-vega/nano-macro-contracts@0.2.1","maintainers":[{"name":"caspianvega","email":"dom.konstantin@tutanota.com"}],"dist":{"shasum":"fccde69c5500d4b9eaa71bba5219def404514ce2","tarball":"https://registry.npmjs.org/@caspian-vega/nano-macro-contracts/-/nano-macro-contracts-0.2.1.tgz","fileCount":45,"integrity":"sha512-87etY3LZ6C4iyFXqauwFoHmf0NjAxyxFJkuClklyvM6Nv3IiCDz6cCspRwmoSKbUIM2DjjTMRhmlfPVoRdSZug==","signatures":[{"sig":"MEYCIQCRMw4pIpueqPTt6b9CPPoA+Bf35qvMu4iW9bZEYsgU3QIhANCWBGRm66nk8+k8K6JtC13DvagNSZdSLVt2E/nJJilV","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":163971},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./macro-store":{"types":"./dist/macro-store.d.ts","import":"./dist/macro-store.js","require":"./dist/macro-store.cjs"},"./nanostore-lite":{"types":"./dist/nanostore-lite.d.ts","import":"./dist/nanostore-lite.js","require":"./dist/nanostore-lite.cjs"},"./nanostore-ready":{"types":"./dist/nanostore-ready.d.ts","import":"./dist/nanostore-ready.js","require":"./dist/nanostore-ready.cjs"},"./nanostore-utils":{"types":"./dist/nanostore-utils.d.ts","import":"./dist/nanostore-utils.js","require":"./dist/nanostore-utils.cjs"}},"scripts":{"test":"vitest run tests/nanostore-ready.spec.ts tests/macro-store.spec.ts","build":"vite build","typecheck":"tsc --noEmit"},"_npmUser":{"name":"caspianvega","email":"dom.konstantin@tutanota.com"},"description":"Lightweight, opinionated contracts built on top of nanostores: defineStore (chain-composed macro-stores with state, async resources, computes and actions) and a small set of RxJS-like store operators.","directories":{},"sideEffects":false,"_nodeVersion":"24.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.3.3","vitest":"^3.2.4","nanostores":"^1.3.0","typescript":"^5.4.0","@types/node":"^25.9.1","vite-plugin-dts":"^5.0.1","@nanostores/async":"^0.1.0","@nanostores/logger":"^1.1.0"},"peerDependencies":{"nanostores":">=0.10.0","@nanostores/async":">=0.1.0","@nanostores/logger":">=0.3.0"},"_npmOperationalInternal":{"tmp":"tmp/nano-macro-contracts_0.2.1_1786888875874_0.9831161118134779","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@caspian-vega/nano-macro-contracts","version":"0.3.0","keywords":["nanostores","store","state-management","macro-store","contracts","rxjs-like","operators"],"license":"MIT","_id":"@caspian-vega/nano-macro-contracts@0.3.0","maintainers":[{"name":"caspianvega","email":"dom.konstantin@tutanota.com"}],"dist":{"shasum":"3b3663438ba860223c14c83e1af20a31172221f2","tarball":"https://registry.npmjs.org/@caspian-vega/nano-macro-contracts/-/nano-macro-contracts-0.3.0.tgz","fileCount":37,"integrity":"sha512-ei8jVglR1IT3uytdPYx7Nashi1u8hg3Fz1/Vu6yIVrR2938yBxhf1nDFOpZjDpjhvL0OGhX9PTfbeabwJPCUrw==","signatures":[{"sig":"MEQCIHnZ3q2y/XXXMf7A+OvivPES88h6s499tX34waUTypkPAiBN5yPMDApD5eLg9FbyGM2Z7r5/oWOeHVynrcs12FJVwQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":166203},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./macro-store":{"types":"./dist/macro-store.d.ts","import":"./dist/macro-store.js","require":"./dist/macro-store.cjs"},"./nanostore-lite":{"types":"./dist/nanostore-lite.d.ts","import":"./dist/nanostore-lite.js","require":"./dist/nanostore-lite.cjs"},"./nanostore-ready":{"types":"./dist/nanostore-ready.d.ts","import":"./dist/nanostore-ready.js","require":"./dist/nanostore-ready.cjs"},"./nanostore-utils":{"types":"./dist/nanostore-utils.d.ts","import":"./dist/nanostore-utils.js","require":"./dist/nanostore-utils.cjs"}},"scripts":{"test":"vitest run tests/nanostore-ready.spec.ts tests/macro-store.spec.ts","build":"vite build","typecheck":"tsc --noEmit"},"_npmUser":{"name":"caspianvega","email":"dom.konstantin@tutanota.com"},"description":"Lightweight, opinionated contracts built on top of nanostores: defineStore (chain-composed macro-stores with state, async resources, computes and actions) and a small set of RxJS-like store operators.","directories":{},"sideEffects":false,"_nodeVersion":"24.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^8.2.1","vitest":"^4.1.10","nanostores":"^1.3.0","typescript":"^5.4.0","@types/node":"^25.9.1","vite-plugin-dts":"^5.0.3","@nanostores/async":"^0.1.0","@nanostores/logger":"^1.1.0"},"peerDependencies":{"nanostores":">=0.10.0","@nanostores/async":">=0.1.0","@nanostores/logger":">=0.3.0"},"_npmOperationalInternal":{"tmp":"tmp/nano-macro-contracts_0.3.0_1786941818560_0.759121236989307","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"@caspian-vega/nano-macro-contracts","version":"0.3.1","keywords":["nanostores","store","state-management","macro-store","contracts","rxjs-like","operators"],"license":"MIT","_id":"@caspian-vega/nano-macro-contracts@0.3.1","maintainers":[{"name":"caspianvega","email":"dom.konstantin@tutanota.com"}],"dist":{"shasum":"88c6d10a4aa7d6fe48eb09f593f18203b984ea3c","tarball":"https://registry.npmjs.org/@caspian-vega/nano-macro-contracts/-/nano-macro-contracts-0.3.1.tgz","fileCount":37,"integrity":"sha512-qNoZS4Tm8fAs3Z8BrAUnZiU3lTg9WaKdidUOoqFtKKiT//fqXbxmcbJevx7tyTJJ4WM5Wp7aBpiBE2QxcyJKCQ==","signatures":[{"sig":"MEQCIGsUYqU1OqzCBXP0AlDA2KFqeOQLa6G/rFZ8AKo93KlkAiBBHGlr9f6GG3cUWEZspxYKyGAcLGgeVhPfhPdQY77FmA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":171271},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./macro-store":{"types":"./dist/macro-store.d.ts","import":"./dist/macro-store.js","require":"./dist/macro-store.cjs"},"./nanostore-lite":{"types":"./dist/nanostore-lite.d.ts","import":"./dist/nanostore-lite.js","require":"./dist/nanostore-lite.cjs"},"./nanostore-ready":{"types":"./dist/nanostore-ready.d.ts","import":"./dist/nanostore-ready.js","require":"./dist/nanostore-ready.cjs"},"./nanostore-utils":{"types":"./dist/nanostore-utils.d.ts","import":"./dist/nanostore-utils.js","require":"./dist/nanostore-utils.cjs"}},"scripts":{"test":"vitest run tests/nanostore-ready.spec.ts tests/macro-store.spec.ts","build":"vite build","typecheck":"tsc --noEmit"},"_npmUser":{"name":"caspianvega","email":"dom.konstantin@tutanota.com"},"description":"Lightweight, opinionated contracts built on top of nanostores: defineStore (chain-composed macro-stores with state, async resources, computes and actions) and a small set of RxJS-like store operators.","directories":{},"sideEffects":false,"_nodeVersion":"24.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^8.2.1","vitest":"^4.1.10","nanostores":"^1.3.0","typescript":"^5.4.0","@types/node":"^25.9.1","vite-plugin-dts":"^5.0.3","@nanostores/async":"^0.1.0","@nanostores/logger":"^1.1.0"},"peerDependencies":{"nanostores":">=0.10.0","@nanostores/async":">=0.1.0","@nanostores/logger":">=0.3.0"},"_npmOperationalInternal":{"tmp":"tmp/nano-macro-contracts_0.3.1_1787003880206_0.7229796864531757","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@caspian-vega/nano-macro-contracts","version":"0.4.0","keywords":["nanostores","store","state-management","macro-store","contracts","rxjs-like","operators"],"license":"MIT","_id":"@caspian-vega/nano-macro-contracts@0.4.0","maintainers":[{"name":"caspianvega","email":"dom.konstantin@tutanota.com"}],"dist":{"shasum":"2305a4853a659b43052b2099382edeff725a5271","tarball":"https://registry.npmjs.org/@caspian-vega/nano-macro-contracts/-/nano-macro-contracts-0.4.0.tgz","fileCount":37,"integrity":"sha512-uksn+B/UcUwxZPt6l3foGqazZC47JuDIslm5ZTqW/G1zGmWvpVYS6svwu8TirczAh4UWWlvbeK3SDl/XDJAAqA==","signatures":[{"sig":"MEYCIQD2iMx/F9DNHgmiRnFxGwhA8y+FXgar8JdyTl2II33wIwIhAN+Q1rkRZZ6lmVz8RU8IIVidOWUkclpJbyZkvz+G8h7r","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":189079},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./macro-store":{"types":"./dist/macro-store.d.ts","import":"./dist/macro-store.js","require":"./dist/macro-store.cjs"},"./nanostore-lite":{"types":"./dist/nanostore-lite.d.ts","import":"./dist/nanostore-lite.js","require":"./dist/nanostore-lite.cjs"},"./nanostore-ready":{"types":"./dist/nanostore-ready.d.ts","import":"./dist/nanostore-ready.js","require":"./dist/nanostore-ready.cjs"},"./nanostore-utils":{"types":"./dist/nanostore-utils.d.ts","import":"./dist/nanostore-utils.js","require":"./dist/nanostore-utils.cjs"}},"scripts":{"test":"vitest run tests/nanostore-ready.spec.ts tests/macro-store.spec.ts","build":"vite build","typecheck":"tsc --noEmit"},"_npmUser":{"name":"caspianvega","email":"dom.konstantin@tutanota.com"},"description":"Lightweight, opinionated contracts built on top of nanostores: defineStore (chain-composed macro-stores with state, async resources, computes and actions) and a small set of RxJS-like store operators.","directories":{},"sideEffects":false,"_nodeVersion":"24.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^8.2.1","vitest":"^4.1.10","nanostores":"^1.3.0","typescript":"^5.4.0","@types/node":"^25.9.1","vite-plugin-dts":"^5.0.3","@nanostores/async":"^0.1.0","@nanostores/logger":"^1.1.0"},"peerDependencies":{"nanostores":">=0.10.0","@nanostores/async":">=0.1.0","@nanostores/logger":">=0.3.0"},"_npmOperationalInternal":{"tmp":"tmp/nano-macro-contracts_0.4.0_1787213004720_0.5831010031375548","host":"s3://npm-registry-packages-npm-production"}},"0.4.1":{"name":"@caspian-vega/nano-macro-contracts","version":"0.4.1","description":"Lightweight, opinionated contracts built on top of nanostores: defineStore (chain-composed macro-stores with state, async resources, computes and actions) and a small set of RxJS-like store operators.","type":"module","license":"MIT","sideEffects":false,"main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./nanostore-lite":{"types":"./dist/nanostore-lite.d.ts","import":"./dist/nanostore-lite.js","require":"./dist/nanostore-lite.cjs"},"./nanostore-utils":{"types":"./dist/nanostore-utils.d.ts","import":"./dist/nanostore-utils.js","require":"./dist/nanostore-utils.cjs"},"./nanostore-ready":{"types":"./dist/nanostore-ready.d.ts","import":"./dist/nanostore-ready.js","require":"./dist/nanostore-ready.cjs"},"./macro-store":{"types":"./dist/macro-store.d.ts","import":"./dist/macro-store.js","require":"./dist/macro-store.cjs"}},"peerDependencies":{"@nanostores/async":">=0.1.0","@nanostores/logger":">=0.3.0","nanostores":">=0.10.0"},"devDependencies":{"@nanostores/async":"^0.1.0","@nanostores/logger":"^1.1.0","@types/node":"^25.9.1","nanostores":"^1.3.0","typescript":"^5.4.0","vite":"^8.2.1","vite-plugin-dts":"^5.0.3","vitest":"^4.1.10"},"keywords":["nanostores","store","state-management","macro-store","contracts","rxjs-like","operators"],"publishConfig":{"access":"public"},"scripts":{"build":"vite build","test":"vitest run tests/nanostore-ready.spec.ts tests/macro-store.spec.ts","typecheck":"tsc --noEmit"},"_nodeVersion":"24.15.0","_id":"@caspian-vega/nano-macro-contracts@0.4.1","dist":{"integrity":"sha512-ZidqR9PJY7E6UT4tz8HMFjWAl+HU/tkNYkYSwYlgXFcgi0fQjpc3t3Bj/lFlIjbvO9h2RueItfZkExcD5j2t0g==","shasum":"fbcbbe690f750924acbfa50cf96198b2c211d37f","tarball":"https://registry.npmjs.org/@caspian-vega/nano-macro-contracts/-/nano-macro-contracts-0.4.1.tgz","fileCount":37,"unpackedSize":197266,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHReLoINO2q3d765ehy2rXFwVgQ3UZVDb1X3RaDL73sbAiBPS9FvfSzjCTFp4IDp6LWDWoK7L9OVx0YsM1kv45g7Mw=="}]},"_npmUser":{"name":"caspianvega","email":"dom.konstantin@tutanota.com"},"directories":{},"maintainers":[{"name":"caspianvega","email":"dom.konstantin@tutanota.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/nano-macro-contracts_0.4.1_1787217510061_0.8397240629516745"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-15T14:49:38.215Z","modified":"2026-08-20T09:18:30.447Z","0.1.0":"2026-08-15T14:49:38.513Z","0.1.1":"2026-08-15T20:41:17.272Z","0.2.0":"2026-08-16T01:35:08.095Z","0.2.1":"2026-08-16T14:01:16.031Z","0.3.0":"2026-08-17T04:43:38.705Z","0.3.1":"2026-08-17T21:58:00.366Z","0.4.0":"2026-08-20T08:03:24.899Z","0.4.1":"2026-08-20T09:18:30.213Z"},"license":"MIT","keywords":["nanostores","store","state-management","macro-store","contracts","rxjs-like","operators"],"description":"Lightweight, opinionated contracts built on top of nanostores: defineStore (chain-composed macro-stores with state, async resources, computes and actions) and a small set of RxJS-like store operators.","maintainers":[{"name":"caspianvega","email":"dom.konstantin@tutanota.com"}],"readme":"# @caspian-vega/nano-macro-contracts\n\nStore contracts on top of [`nanostores`](https://github.com/nanostores/nanostores). `defineStore`\ncomposes state, async resources, derived values, actions and effects into one class where every\nmember is a real nanostore.\n\nPart of [caspian-vega-astro-libs](https://codeberg.org/caspian-vega/caspian-vega-astro-libs).\n\n## Install\n\n```bash\nnpm install @caspian-vega/nano-macro-contracts nanostores @nanostores/async @nanostores/logger\n# or\npnpm add @caspian-vega/nano-macro-contracts nanostores @nanostores/async @nanostores/logger\n```\n\n`nanostores`, `@nanostores/async` and `@nanostores/logger` are peer dependencies.\n\n## Usage\n\n```ts\nimport { browserOnly, debounced_, defineStore } from '@caspian-vega/nano-macro-contracts/macro-store';\nimport { logger } from '@nanostores/logger';\nimport { computed } from 'nanostores';\n\nclass PostStore extends defineStore('PostStore', { query: '', topicId: '' })\n    .resource('posts', {\n        pipe: browserOnly(debounced_(300)),\n        load: async ({ query, topicId }) => fetchPosts({ query, topicId }),\n        initial: [] as Post[],\n    })\n    .derive((s) => ({\n        postCount: computed(s.posts.value, (posts) => posts.length),\n    }))\n    .actions((s) => ({\n        setQuery: (query: string) => s.patch({ query }, 'setQuery'),\n    }))\n    .logger(import.meta.env.DEV ? logger : undefined)\n    .build() {}\n\nconst store = new PostStore();\n\nawait store.posts.ready();\nstore.posts.value.get();\nstore.setQuery('astro');\n```\n\nEach step returns a newly typed builder, so the `store` argument of every later callback is inferred\nfrom what was registered before it.\n\n## Entry points\n\n| Import              | Contains                                                                                          |\n| ------------------- | ------------------------------------------------------------------------------------------------- |\n| `.`                 | Everything below                                                                                  |\n| `./macro-store`     | `defineStore`, `browserOnly`, `createResource`, `assertStoreDefinition`, `RESERVED_STORE_MEMBERS` |\n| `./nanostore-utils` | `pipeLine` and the operators                                                                      |\n| `./nanostore-ready` | `whenReady`                                                                                       |\n| `./nanostore-lite`  | `NanoContract`, `NanoPromise`                                                                     |\n\n## Chain order\n\n```mermaid\nflowchart LR\n  D[\"defineStore(name, initial)\"] --> F[\"from(source)\"]\n  D --> S[\"standalone()\"]\n  D --> R[\"resource(name, def)\"]\n  F --> R\n  S --> R\n  R --> P[\"deps(factory)\"]\n  D --> P\n  P --> V[\"derive(factory)\"]\n  V --> A[\"actions(factory)\"]\n  A --> E[\"effect(factory)\"]\n  E --> L[\"logger(fn, options)\"]\n  L --> X[\"extend(factory)\"]\n  X --> B[\"build()\"]\n```\n\nSteps may repeat and may be ordered freely. A factory only sees members and dependencies declared\nabove it.\n\n## API\n\n### defineStore(name, initialState?)\n\nStarts a chain.\n\n- `name` (string, required): shown in logger output and in collision errors.\n- `initialState` (object, optional): the state shape. Constrained to `object`, so an interface is\n  accepted with `satisfies`, with `as`, or as an annotated constant.\n- Returns: `StoreBuilder`, carrying `state`, `snapshot`, `patch`, `setState`, `reset` and `destroy`.\n\n```ts\ndefineStore('ProductStore', { q: '', category: null } satisfies ProductFilterState);\n```\n\n### Chain steps\n\n| Step                                | Adds                                                      |\n| ----------------------------------- | --------------------------------------------------------- |\n| `.resource(name, def)`              | a `Resource<TData>` driven by the store's state           |\n| `.from(source).resource(name, def)` | a resource driven by a narrower projection                |\n| `.standalone().resource(name, def)` | a resource driven by nothing, refreshed by `reload()`     |\n| `.deps(factory)`                    | private dependencies, not members                         |\n| `.derive(factory)`                  | derived nanostores                                        |\n| `.actions(factory)`                 | methods placed on the instance                            |\n| `.effect(factory)`                  | a side effect, a returned function becomes cleanup        |\n| `.logger(fn, options?)`             | binds `state` to a logger and enables `patch(..., label)` |\n| `.extend(factory)`                  | non-store, non-function members                           |\n| `.build()`                          | the store class                                           |\n\nExtend the built class to get a named, DI-friendly type:\n\n```ts\nclass PostStore extends defineStore('PostStore', {}).build() {}\n```\n\n### Base members\n\n| Member                 | Signature                                                     | Produces                                         |\n| ---------------------- | ------------------------------------------------------------- | ------------------------------------------------ |\n| `state`                | `MapStore<TState>`                                            | the nanostore, usable with `computed(...)`       |\n| `snapshot`             | `TState`                                                      | synchronous read of the current value            |\n| `patch(patch, label?)` | `Partial<TState> \\| ((s: TState) => Partial<TState>), string` | merges a partial, `label` names the action       |\n| `setState(next)`       | `TState`                                                      | replaces the whole state                         |\n| `reset()`              |                                                               | restores a shallow copy of the initial state     |\n| `destroy()`            |                                                               | runs cleanups and unbinds the logger, idempotent |\n\n### .resource(name, def)\n\nAdds an async member driven by the store's state.\n\n- `name` (string, required): member name.\n- `def.load` (`(source, store, deps) => Promise<TData>`, required): `source` is the state, or the\n  `.from` projection.\n- `def.initial` (`TData`, required): value of `resource.value` before the first load.\n- `def.pipe` (`StoreOperator<TSource>[]`, optional): operators applied to the source.\n- `def.enabled` (`(source) => boolean`, optional): return `false` to skip the load and keep the\n  current value.\n- Returns: the builder, with `Resource<TData>` under `name`.\n\n```ts\n.resource('posts', {\n    pipe: browserOnly(debounced_(300)),\n    enabled: ({ query }) => query.length > 2,\n    load: ({ query }) => api.searchPosts(query),\n    initial: [] as Post[],\n})\n```\n\nResources are lazy. The loader runs when something first subscribes, or when `ready()` is awaited,\nnot when the store is constructed. `value` keeps the last successful value while a reload is in\nflight or has failed.\n\nThe source is the whole state map, so every `patch(...)` re-runs the loader. For a parameter-free\nloader such as `getAllGreetings()`, use [`.standalone()`](#standalone) instead.\n\n### .from(source)\n\nNarrows what the next resource reloads on.\n\n- `source` (`(store) => ReadableAtom<TSource>`, required)\n- Returns: `ScopedStoreBuilder`, whose `.resource(...)` receives `TSource` instead of the state.\n\n```ts\ndefineStore('TopicStore', { topicId: '', unrelatedFilter: '' })\n    .from((s) => computed(s.state, ({ topicId }) => topicId))\n    .resource('topic', {\n        load: (topicId) => fetchTopic(topicId),\n        initial: null,\n    });\n```\n\n### .standalone()\n\nDetaches the next resource from the state entirely, for a loader that takes no input.\n\n- Takes no arguments.\n- Returns: `StandaloneStoreBuilder`, whose `.resource(...)` takes a `StandaloneResourceDef`.\n\n```ts\nconst GreetingStore = defineStore('GreetingStore', { filter: '' })\n    .deps(() => ({ api: svInject(GreetingApi) }))\n    .standalone()\n    .resource('greetings', {\n        load: (_store, { api }) => api.getAllGreetings(),\n        initial: [] as Greeting[],\n    })\n    .build();\n\nconst store = new GreetingStore();\n\nawait store.greetings.ready(); // first load\nstore.greetings.reload(); // every later refresh\n```\n\nThe loader drops the dead source argument: it receives the store and the deps bag directly. `pipe`\nand `enabled` are not offered, having nothing to act on.\n\n- Without `.standalone()`, the source is the whole state map, so every `patch(...)` re-runs the\n  loader even when it reads nothing from state. This is the reason the step exists.\n- The resource stays lazy. It loads when something first subscribes or `ready()` is awaited, never\n  at construction.\n- `reload()` before the first subscription does not load early. The pending trigger folds into the\n  first load.\n- While a reload is in flight, `loading` is `true` and `value` still holds the previous result.\n- A failed load leaves `error` set and `value` untouched. The next `reload()` clears the error on\n  success.\n- The constant source is created per instance, so two instances of the same store reload\n  independently.\n\nStandalone and state-reactive resources mix freely in one chain:\n\n```ts\ndefineStore('CatalogStore', { id: '' })\n    .standalone()\n    .resource('catalog', { load: (_s, d) => d.api.getCatalog(), initial: [] })\n    .from((s) => computed(s.state, ({ id }) => id))\n    .resource('item', { load: (id, _s, d) => d.api.getItem(id), initial: null });\n```\n\n### .deps(factory)\n\nRegisters collaborators the store uses but does not expose.\n\n- `factory` (`(deps) => object`, required): runs once per instance, at construction.\n- Returns: the builder. Every later factory receives the bag as its second argument, a resource\n  loader as its third.\n\n```ts\nclass GreetStore extends defineStore('GreetStore', { greeting: 'hello' })\n    .deps(() => ({ userService: svInject(UserService) }))\n    .actions((s, d) => ({ greet: () => d.userService.sendGreeting(s.snapshot.greeting) }))\n    .build() {}\n\nconst store = new GreetStore();\n\nstore.greet();\nObject.keys(store); // ['greet']\n```\n\n- Dependencies are not members. The bag lives in a module-private `WeakMap`, so it is absent from\n  `Object.keys`, spreads, `JSON.stringify` and `snapshot`.\n- Own namespace, so a dependency may share a name with a member. Only a dependency declared twice\n  collides.\n- Several `.deps(...)` steps accumulate. Each bag is frozen.\n- Dependencies are borrowed, not owned. There is no teardown hook. Allocate in `.effect(...)`\n  instead.\n\n### .derive(factory)\n\n- `factory` (`(store, deps) => Record<string, ReadableAtom<any>>`, required)\n- Returns: the builder, with each returned atom as a member.\n\n```ts\n.derive((s) => ({ total: computed(s.state, ({ items }) => sum(items)) }))\n```\n\n### .actions(factory)\n\n- `factory` (`(store, deps) => Record<string, Function>`, required)\n- Returns: the builder, with each returned function as an instance method.\n\n```ts\n.actions((s) => ({ add: (item: Item) => s.patch({ items: [...s.snapshot.items, item] }, 'add') }))\n```\n\n### .effect(factory)\n\n- `factory` (`(store, deps) => void | (() => void)`, required): a returned function is registered as\n  cleanup and runs on `destroy()`.\n- Returns: the builder.\n\n```ts\n.effect((s) => {\n    const off = s.state.listen(persist);\n    return off;\n})\n```\n\n### .logger(fn, options?)\n\nBinds `state` to `@nanostores/logger`, or any drop-in with the same signature.\n\n- `fn` (`StoreLoggerFn | undefined`, required): `undefined` is a no-op.\n- `options` (`LoggerOptions`, optional): defaults suppress mount and unmount noise.\n- Returns: the builder. Once bound, the `label` argument of `patch(...)` appears as a named action.\n\n```ts\n.logger(import.meta.env.DEV ? logger : undefined)\n```\n\n### .extend(factory)\n\nEscape hatch for public members that are neither stores nor functions.\n\n- `factory` (`(store, deps) => object`, required)\n- Returns: the builder.\n\n```ts\n.extend(() => ({ formatter: new Intl.NumberFormat() }))\n```\n\n### .build()\n\n- Returns: `StoreConstructor<TShape>`, a class. It runs no factories. Every factory runs once per\n  instance, at construction.\n\n### assertStoreDefinition(Store)\n\nConstructs the class once and destroys it, so collisions surface in a unit test instead of in a\nrequest.\n\n- `Store` (`new () => StoreLifecycle`, required)\n- Returns: `void`\n- Throws: `Error` listing every collision in the definition.\n\n```ts\nit('is a valid store definition', () => {\n    expect(() => assertStoreDefinition(PostStore)).not.toThrow();\n});\n```\n\n### browserOnly(...operators)\n\n- `operators` (`StoreOperator<T>[]`, required)\n- Returns: the operators on the client, an empty array on the server. Keeps timers out of SSR.\n\n```ts\npipe: browserOnly(debounced_(300));\n```\n\n### createResource(store, source, def, deps)\n\nLow-level constructor behind `.resource(...)`. Use the chain step unless a resource is needed outside\na store.\n\n- Returns: `Resource<TData, TError>`\n\n### RESERVED_STORE_MEMBERS\n\n`ReadonlySet<string>` holding `state`, `snapshot`, `patch`, `setState`, `reset`, `destroy`.\n\n### pipeLine(store, ...operators)\n\nApplies operators left to right.\n\n- `store` (`ReadableAtom<T> | WritableAtom<T>`, required)\n- `operators` (`StoreOperator<T>[]`, required)\n- Returns: the same atom kind that went in.\n\n```ts\nconst query = pipeLine(\n    input,\n    debounced_(250),\n    distinct_(),\n    sideEffect_((v) => console.log(v))\n);\n```\n\n### Operators\n\n| Operator                               | Curried form         | Produces                                  |\n| -------------------------------------- | -------------------- | ----------------------------------------- |\n| `debounced(store, delay = 300)`        | `debounced_(delay)`  | emits after the value stops changing      |\n| `throttled(store, delay = 300)`        | `throttled_(delay)`  | emits at most once per interval           |\n| `delayed(store, delay = 300)`          | `delayed_(delay)`    | emits every value, late                   |\n| `filter(store, predicate)`             | `filter_(predicate)` | emits only values passing the predicate   |\n| `distinct(store, compare = Object.is)` | `distinct_(compare)` | drops consecutive equal values            |\n| `sideEffect(store, fn)`                | `sideEffect_(fn)`    | runs `fn` per value and passes it through |\n\nAll return `WritableAtom<T>`. Subscriptions and timers are allocated only while the derived atom has\nlisteners.\n\n### whenReady(stores, predicate, timeout?)\n\nWaits until one or more stores satisfy a predicate.\n\n- `stores` (`ReadableNanoStore<T>` or an array of them, required): anything with `get` and `listen`.\n- `predicate` (`(...values) => boolean`, required)\n- `timeout` (number, default `3000`): milliseconds.\n- Returns: `Promise<WhenReadyResult>` carrying `ready`, `timedOut` and `values`. Never rejects.\n\n```ts\nawait whenReady(store.posts.value, (posts) => posts.length > 0);\nawait whenReady([userAtom, settingsAtom], (user, settings) => !!user && !!settings, 5000);\n```\n\nSubscribing mounts a lazy store and triggers its work. The subscription is released once the gate\nsettles.\n\n## Types\n\n### Resource\n\n- `async` (`ReadableAtom<AsyncValue<TData>>`): raw lifecycle.\n- `value` (`ReadableAtom<TData>`): last good value, seeded by `initial`.\n- `loading` (`ReadableAtom<boolean>`)\n- `error` (`ReadableAtom<TError | undefined>`)\n- `reload(): void`\n- `ready(timeout?): Promise<ResourceReadyResult<TData, TError>>`: never rejects.\n\n### ResourceReadyResult\n\n- `value` (`TData`, optional)\n- `error` (`TError`, optional)\n- `timedOut` (boolean)\n\n### ResourceDef\n\nDefinition object accepted by `.resource(name, def)`. Fields are listed under `.resource` above.\n\n### StandaloneResourceDef\n\nDefinition object accepted by `.standalone().resource(name, def)`.\n\n- `load` (`(store, deps) => Promise<TData>`, required)\n- `initial` (`TData`, required)\n\n### StoreOperator\n\n`(store: ReadableAtom<T>) => WritableAtom<T>`\n\n### WhenReadyResult\n\n- `ready` (boolean)\n- `timedOut` (boolean)\n- `values` (readonly tuple of the store values)\n\n### MacroStoreDestroyable\n\n- `onMacroStoreDestroyed(): void`\n\nOptional teardown hook for a subclass that owns resources the chain never saw. It is looked up on\nthe instance at teardown and runs before the chain cleanups, so derived atoms, resources and actions\nare still usable inside it. If it throws, the chain cleanups still run and the error propagates out\nof `destroy()`.\n\n```ts\nclass SocketStore extends defineStore('SocketStore', { url: '' }).build() implements MacroStoreDestroyable {\n    private readonly socket = new WebSocket(this.snapshot.url);\n\n    onMacroStoreDestroyed(): void {\n        this.socket.close();\n    }\n}\n```\n\n### NanoContract\n\n`WritableAtom<T> | PreinitializedWritableAtom<T>`, a writable store contract.\n\n### NanoPromise\n\n`ReadableAtom<AsyncValue<T>>`, a read-only async value.\n\n### ReadableNanoStore\n\nMinimal shape accepted by `whenReady`: `get()` plus `listen(cb)`.\n\n### Others\n\n`StoreBuilder`, `ScopedStoreBuilder`, `StoreConstructor`, `StateApi`, `StoreLifecycle`,\n`StoreLoggerFn`, `StoreState`, `StoreDeps`, `AnyAtoms`, `AnyActions`, `StoreMemberConflict`,\n`NoOverlap`, `FreeName`, `NoDepOverlap`, `StoreDepConflict`. These support inference in the chain\nand are rarely written by hand.\n\n## Collisions\n\nMember names share one flat namespace. A collision, against a reserved name or against a member an\nearlier step defined, is caught twice.\n\n1. At compile time, on the offending key:\n\n```ts\n.actions(() => ({ reset: () => {} }))\n// error: Type '() => void' is not assignable to type\n//        '(() => void) & StoreMemberConflict<\"store member \\\"reset\\\" is already defined\">'\n```\n\n2. At the first construction, with the store name, the chain step, and every collision in one error:\n\n```\n[InquiryStore] .actions() cannot define \"reset\": it is a reserved store member\n  (state, snapshot, patch, setState, reset, destroy).\n  Rename it, or call the built-in store.reset().\n```\n\nOnly the six reserved names are taken. `Object.prototype` members such as `toString` are ordinary\nmember names.\n\n## Constraints\n\n- Factories run once per instance, at construction. `build()` runs none of them, so a collision\n  surfaces at first construction. Use `assertStoreDefinition(...)` in a test to force it in CI.\n- A factory that throws fails construction and the original error propagates. Collisions already\n  collected are reported instead, with the throw attached as `cause`. The half-built instance is\n  destroyed either way.\n- Allocating in `.extend(...)` or `.derive(...)` leaks unless teardown is handed to `destroy()`:\n\n```ts\n// leaks\n.extend(() => ({ conn: openConn() }))\n\n// hands over teardown\n.extend(() => {\n    const conn = openConn();\n    return { conn, onMacroStoreDestroyed: () => conn.close() };\n})\n\n// inert holder, effect acquires and releases\n.extend(() => ({ conn: lazyConn() }))\n.effect((s) => { s.conn.open(); return () => s.conn.close(); })\n```\n\n- An `.extend(...)` hook shadows a subclass hook. The extend factory defines an own property during\n  `super()`, a subclass method lives on the prototype, so the own property wins and no collision is\n  reported. Use one or the other, never both.\n- `reset()` restores a shallow copy of the initial state, so nested objects keep their original\n  references. Pass a fresh `structuredClone(INITIAL)` per store when state holds mutated objects.\n- Members are non-writable but configurable, so `vi.spyOn(store, 'submit')` works.\n\n## Synergies\n\nSee [SYNERGIES.md](https://codeberg.org/caspian-vega/caspian-vega-astro-libs/src/branch/master/SYNERGIES.md).\n\n## License\n\nMIT\n","readmeFilename":""}