{"_id":"@caspian-vega/nano-devtools","_rev":"4-0adddf1e1240d9a338437a27756553d0","name":"@caspian-vega/nano-devtools","dist-tags":{"latest":"0.2.1"},"versions":{"0.1.0":{"name":"@caspian-vega/nano-devtools","version":"0.1.0","keywords":["nanostores","devtools","logger","web-component","custom-element","svelte","state-management","debugging"],"license":"MIT","_id":"@caspian-vega/nano-devtools@0.1.0","maintainers":[{"name":"caspianvega","email":"dom.konstantin@tutanota.com"}],"dist":{"shasum":"f9e617be84a32ad7fcb52020bab098f892f33a27","tarball":"https://registry.npmjs.org/@caspian-vega/nano-devtools/-/nano-devtools-0.1.0.tgz","fileCount":29,"integrity":"sha512-h6D+XWM6wQ4fe1nEwCZtbVaOWjMkNljtZEH1N9pJOls8cnzWNj2Q+yHEA7AQWzVodiIho4jk4lxvUJTA+VKrqw==","signatures":[{"sig":"MEQCIBxEAdfBl2HFAIP2c4We4OmfSM7ArCvl7eyhJjr4tUISAiAwECdqDwhzYXrUU6g5PBQFgArSFDNEoptsZvBpfWeWZQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":124978},"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"},"./host":{"types":"./dist/host.d.ts","import":"./dist/host.js","require":"./dist/host.cjs"},"./logger":{"types":"./dist/logger.d.ts","import":"./dist/logger.js","require":"./dist/logger.cjs"},"./transport":{"types":"./dist/transport.d.ts","import":"./dist/transport.js","require":"./dist/transport.cjs"},"./devtools.html":"./dist/devtools.html"},"scripts":{"build":"pnpm run build:host && pnpm run build:app && pnpm run build:inline","build:app":"vite build --config vite.app.config.ts","typecheck":"tsc --noEmit && svelte-check","build:host":"vite build","build:inline":"node scripts/inline-app.mjs"},"_npmUser":{"name":"caspianvega","email":"dom.konstantin@tutanota.com"},"description":"Framework-agnostic in-memory logger for nanostores plus a Svelte web-component devtools UI that opens in an independent browser window. Capture store state changes/actions and inspect them (search, filter, timestamps) in a separate window.","directories":{},"sideEffects":["./dist/host.js","./dist/host.cjs","./dist/index.js","./dist/index.cjs","**/*.svelte","**/*.css"],"_nodeVersion":"24.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.3.3","svelte":"^5.56.3","nanostores":"^1.3.0","typescript":"^5.4.0","@types/node":"^25.9.1","svelte-check":"^4.4.8","vite-plugin-dts":"^5.0.1","@nanostores/logger":"^1.1.0","@sveltejs/vite-plugin-svelte":"^6.2.4"},"peerDependencies":{"nanostores":">=1.0.0","@nanostores/logger":">=1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/nano-devtools_0.1.0_1786805426715_0.52987248378463","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@caspian-vega/nano-devtools","version":"0.1.1","keywords":["nanostores","devtools","logger","web-component","custom-element","svelte","state-management","debugging"],"license":"MIT","_id":"@caspian-vega/nano-devtools@0.1.1","maintainers":[{"name":"caspianvega","email":"dom.konstantin@tutanota.com"}],"dist":{"shasum":"c90c142a17e7fd770cdd37f9d072d2a5ccd96719","tarball":"https://registry.npmjs.org/@caspian-vega/nano-devtools/-/nano-devtools-0.1.1.tgz","fileCount":29,"integrity":"sha512-iyPOP5IaDJzcC0ahquaK5RZwzoqebQWUuqIUJkqAd51oLnumrbFnXZf5/j/wNav159dfmEs529Hamepczq7AGQ==","signatures":[{"sig":"MEYCIQC2Nw30HJA7re6RjTQw+7toXlkFq5+zw2GbEBZey10qNQIhAN9McclndOACQM2CTuZpItIvNQLnOVR4r6OUCTlUpPDQ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":125793},"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"},"./host":{"types":"./dist/host.d.ts","import":"./dist/host.js","require":"./dist/host.cjs"},"./logger":{"types":"./dist/logger.d.ts","import":"./dist/logger.js","require":"./dist/logger.cjs"},"./transport":{"types":"./dist/transport.d.ts","import":"./dist/transport.js","require":"./dist/transport.cjs"},"./devtools.html":"./dist/devtools.html"},"scripts":{"build":"pnpm run build:host && pnpm run build:app && pnpm run build:inline","build:app":"vite build --config vite.app.config.ts","typecheck":"tsc --noEmit && svelte-check","build:host":"vite build","build:inline":"node scripts/inline-app.mjs"},"_npmUser":{"name":"caspianvega","email":"dom.konstantin@tutanota.com"},"description":"Framework-agnostic in-memory logger for nanostores plus a Svelte web-component devtools UI that opens in an independent browser window. Capture store state changes/actions and inspect them (search, filter, timestamps) in a separate window.","directories":{},"sideEffects":["./dist/host.js","./dist/host.cjs","./dist/index.js","./dist/index.cjs","**/*.svelte","**/*.css"],"_nodeVersion":"24.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.3.3","svelte":"^5.56.3","nanostores":"^1.3.0","typescript":"^5.4.0","@types/node":"^25.9.1","svelte-check":"^4.4.8","vite-plugin-dts":"^5.0.1","@nanostores/logger":"^1.1.0","@sveltejs/vite-plugin-svelte":"^6.2.4"},"peerDependencies":{"nanostores":">=1.0.0","@nanostores/logger":">=1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/nano-devtools_0.1.1_1786888911783_0.7954059175448414","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@caspian-vega/nano-devtools","version":"0.2.0","keywords":["nanostores","devtools","logger","web-component","custom-element","svelte","state-management","debugging"],"license":"MIT","_id":"@caspian-vega/nano-devtools@0.2.0","maintainers":[{"name":"caspianvega","email":"dom.konstantin@tutanota.com"}],"dist":{"shasum":"8f5fee1dbf091e5043c9d75f62041c5c7da5696c","tarball":"https://registry.npmjs.org/@caspian-vega/nano-devtools/-/nano-devtools-0.2.0.tgz","fileCount":27,"integrity":"sha512-N/oMbk+L6sqc639aZX8lO90BdF2qp2evrsPkRpyqWfE+MJX+ESUNEINtb8n2ekHD/RDF6a2wYpQunv/UySUUEg==","signatures":[{"sig":"MEYCIQC3Wac42zrNTkDYgEXAjQT1CeaGdoUPAw+8IxohTl9MjAIhAK+8qF6ROyMWXe9Ad1LGVE7/RmSew8pwiemZVPyxkdzY","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":125552},"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"},"./host":{"types":"./dist/host.d.ts","import":"./dist/host.js","require":"./dist/host.cjs"},"./logger":{"types":"./dist/logger.d.ts","import":"./dist/logger.js","require":"./dist/logger.cjs"},"./transport":{"types":"./dist/transport.d.ts","import":"./dist/transport.js","require":"./dist/transport.cjs"},"./devtools.html":"./dist/devtools.html"},"scripts":{"build":"pnpm run build:host && pnpm run build:app && pnpm run build:inline","build:app":"vite build --config vite.app.config.ts","typecheck":"tsc --noEmit && svelte-check","build:host":"vite build","build:inline":"node scripts/inline-app.mjs"},"_npmUser":{"name":"caspianvega","email":"dom.konstantin@tutanota.com"},"description":"Framework-agnostic in-memory logger for nanostores plus a Svelte web-component devtools UI that opens in an independent browser window. Capture store state changes/actions and inspect them (search, filter, timestamps) in a separate window.","directories":{},"sideEffects":["./dist/host.js","./dist/host.cjs","./dist/index.js","./dist/index.cjs","**/*.svelte","**/*.css"],"_nodeVersion":"24.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^8.2.1","svelte":"^5.56.3","nanostores":"^1.3.0","typescript":"^5.4.0","@types/node":"^25.9.1","svelte-check":"^4.4.8","vite-plugin-dts":"^5.0.3","@nanostores/logger":"^1.1.0","@sveltejs/vite-plugin-svelte":"^7.3.0"},"peerDependencies":{"nanostores":">=1.0.0","@nanostores/logger":">=1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/nano-devtools_0.2.0_1786941844405_0.9703964414294295","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@caspian-vega/nano-devtools","version":"0.2.1","description":"Framework-agnostic in-memory logger for nanostores plus a Svelte web-component devtools UI that opens in an independent browser window. Capture store state changes/actions and inspect them (search, filter, timestamps) in a separate window.","type":"module","license":"MIT","sideEffects":["./dist/host.js","./dist/host.cjs","./dist/index.js","./dist/index.cjs","**/*.svelte","**/*.css"],"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"},"./logger":{"types":"./dist/logger.d.ts","import":"./dist/logger.js","require":"./dist/logger.cjs"},"./host":{"types":"./dist/host.d.ts","import":"./dist/host.js","require":"./dist/host.cjs"},"./transport":{"types":"./dist/transport.d.ts","import":"./dist/transport.js","require":"./dist/transport.cjs"},"./devtools.html":"./dist/devtools.html"},"peerDependencies":{"@nanostores/logger":">=1.0.0","nanostores":">=1.0.0"},"devDependencies":{"@nanostores/logger":"^1.1.0","@sveltejs/vite-plugin-svelte":"^7.3.0","@types/node":"^25.9.1","nanostores":"^1.3.0","svelte":"^5.56.3","svelte-check":"^4.4.8","typescript":"^5.4.0","vite":"^8.2.1","vite-plugin-dts":"^5.0.3"},"keywords":["nanostores","devtools","logger","web-component","custom-element","svelte","state-management","debugging"],"publishConfig":{"access":"public"},"scripts":{"build:host":"vite build","build:app":"vite build --config vite.app.config.ts","build:inline":"node scripts/inline-app.mjs","build":"pnpm run build:host && pnpm run build:app && pnpm run build:inline","typecheck":"tsc --noEmit && svelte-check"},"_nodeVersion":"24.15.0","_id":"@caspian-vega/nano-devtools@0.2.1","dist":{"integrity":"sha512-6UcUhW+fKvkCLpRwPj1ZuCb19KDmys0DiOcaj2b7ujlxL+VJeKoKtKb4O3CFe5Ftbme3NZzpYFChcQpFzPpZpw==","shasum":"6616b2941e7740bdd87d6d64e10f0bdc4cdc30a3","tarball":"https://registry.npmjs.org/@caspian-vega/nano-devtools/-/nano-devtools-0.2.1.tgz","fileCount":27,"unpackedSize":127070,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQChZqgLsWid5BSmsk5xxMthQsIPQXATZCEcfc1aAK7rmQIgCtsQn7wUABminZmKkCGo+59iwit0zT8KO/9PgU806w8="}]},"_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-devtools_0.2.1_1787213033902_0.5118938708846974"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-15T14:50:26.551Z","modified":"2026-08-20T08:03:54.268Z","0.1.0":"2026-08-15T14:50:26.904Z","0.1.1":"2026-08-16T14:01:51.957Z","0.2.0":"2026-08-17T04:44:04.547Z","0.2.1":"2026-08-20T08:03:54.076Z"},"license":"MIT","keywords":["nanostores","devtools","logger","web-component","custom-element","svelte","state-management","debugging"],"description":"Framework-agnostic in-memory logger for nanostores plus a Svelte web-component devtools UI that opens in an independent browser window. Capture store state changes/actions and inspect them (search, filter, timestamps) in a separate window.","maintainers":[{"name":"caspianvega","email":"dom.konstantin@tutanota.com"}],"readme":"# @caspian-vega/nano-devtools\n\nIn-memory log buffer for [nanostores](https://github.com/nanostores/nanostores), plus a separate\nbrowser window that renders it.\n\nPart of [caspian-vega-astro-libs](https://codeberg.org/caspian-vega/caspian-vega-astro-libs).\n\n## Install\n\n```bash\nnpm install --save-dev @caspian-vega/nano-devtools\n# or\npnpm add -D @caspian-vega/nano-devtools\n```\n\nPeer dependencies: `nanostores`, `@nanostores/logger`.\n\n## Usage\n\nCapture events:\n\n```ts\nimport { memoryLogger } from '@caspian-vega/nano-devtools/logger';\n\nconst unbind = memoryLogger({ MyStore: $store });\n```\n\nOpen the window:\n\n```ts\nimport appHtml from '@caspian-vega/nano-devtools/devtools.html?raw';\nimport { configureNanoDevtools } from '@caspian-vega/nano-devtools/host';\n\nconfigureNanoDevtools({ appHtml });\nwindow.nanoDevtools();\n```\n\n## Entry points\n\n| Import            | Contains                                                                   |\n| ----------------- | -------------------------------------------------------------------------- |\n| `.`               | Everything below                                                           |\n| `./logger`        | `memoryLogger`, `logStore`, `clearLogs`, `MAX_LOG_ENTRIES`                 |\n| `./host`          | `configureNanoDevtools`, `openDevtools`, `closeDevtools`, `toggleDevtools` |\n| `./transport`     | `Transport` and the four transport factories                               |\n| `./devtools.html` | Self-contained popup document, import with `?raw`                          |\n\n## API\n\n### memoryLogger(stores, opts?)\n\nBinds stores and appends their events to `logStore`.\n\n- `stores` (`Record<string, AnyStore>`, required): stores to bind, keyed by the name shown in the log.\n- `opts` (object, optional): passed through to `@nanostores/logger`.\n- Returns: `() => void` that unbinds every store passed in.\n\n```ts\nconst unbind = memoryLogger({ Cart: $cart, User: $user });\nunbind();\n```\n\n### logStore\n\n`Atom<LogEntry[]>` holding captured entries, newest last. Capped at `MAX_LOG_ENTRIES`.\n\n```ts\nimport { logStore } from '@caspian-vega/nano-devtools/logger';\n\nlogStore.subscribe((entries) => console.log(entries.length));\n```\n\n### clearLogs()\n\nEmpties the buffer.\n\n- Returns: `void`\n\n### MAX_LOG_ENTRIES\n\n`number`, value `1000`. Entries beyond this are dropped from the front.\n\n### configureNanoDevtools(options)\n\nRegisters the popup document and installs `window.nanoDevtools`.\n\n- `options.appHtml` (string, required): the self-contained popup document.\n- Returns: `void`\n\n```ts\nconfigureNanoDevtools({ appHtml });\n```\n\n### openDevtools()\n\nOpens the popup window and starts streaming entries to it.\n\n- Returns: `void`\n\nCall this from a user gesture or the browser console. Popup blockers stop calls from anywhere else.\n\n### closeDevtools()\n\nCloses the popup and stops streaming.\n\n- Returns: `void`\n\n### toggleDevtools()\n\nCalls `closeDevtools()` when the popup is open, `openDevtools()` otherwise. This is what\n`window.nanoDevtools` is bound to.\n\n- Returns: `void`\n\n### createHostTransport(getPopup)\n\n- `getPopup` (`() => Window | null | undefined`, required): resolved on every send.\n- Returns: `Transport<HostToPopup, PopupToHost>`\n\n### createPopupTransport()\n\n- Returns: `Transport<PopupToHost, HostToPopup>`\n\n### createPostMessageTransport(getTarget, origin?)\n\n- `getTarget` (`() => Window | null | undefined`, required): resolved on every send.\n- Returns: `Transport<TSend, TRecv>`\n\n### createBroadcastTransport(channelName)\n\n- `channelName` (string, required): `BroadcastChannel` name. Same origin only.\n- Returns: `Transport<TSend, TRecv>`\n\n## Types\n\n### LogEntryType\n\n`'change' | 'action-start' | 'action-end' | 'action-error' | 'mount' | 'unmount'`\n\n### LogEntry\n\n- `id` (number): sequence number.\n- `timestamp` (number): epoch milliseconds.\n- `type` (`LogEntryType`)\n- `storeName` (string): key used at bind time.\n- `actionName` (string, optional)\n- `actionId` (number, optional)\n- `changed` (string, optional): key path, map stores only.\n- `oldValue`, `newValue` (unknown, optional)\n- `valueMessage` (string, optional)\n- `args` (unknown[], optional): action arguments.\n- `error` (`{ message: string; stack?: string }`, optional)\n\n### Transport\n\n- `send(msg)`: sends one message.\n- `onMessage(handler)`: returns an unsubscribe function.\n- `close()`: releases the underlying channel.\n\n### ConfigureOptions\n\n- `appHtml` (string): popup document passed to `configureNanoDevtools`.\n\n## Constraints\n\n- Development only. The buffer grows with every event, so guard the wiring with\n  `import.meta.env.DEV`.\n- The popup needs a same-origin `BroadcastChannel`, with `postMessage` as fallback.\n- Logged values are held by reference, so large payloads stay alive as long as the buffer does.\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":""}