Files
web/packages/sdk-react/package.json
Dan Ditomaso 4fe5d57ae7 feat(sdk): scaffold @meshtastic/sdk + @meshtastic/sdk-react
Adds two new packages laying the foundation for a domain-driven migration
away from @meshtastic/core.

packages/sdk
- DDD feature slices: device, chat, nodes, channels, config, telemetry,
  position, traceroute, files. Each with domain/application/infrastructure/state.
- Shared kernel under core/: MeshClient orchestrator, Transport interface
  (byte-compat with existing transport-* packages), EventBus (typed pub/sub),
  packet codec, Queue, Xmodem, signals helpers, tslog factory.
- Signals via @preact/signals-core. Application use-cases return
  Result<T,E> via better-result; legacy ports keep throwing.
- shim/ re-exports the legacy MeshDevice/Types/Utils API so
  packages/web continues to build unchanged.
- createFakeTransport() under @meshtastic/sdk/testing.
- 16 vitest tests incl. end-to-end fake-transport integration.

packages/sdk-react
- MeshProvider + useSignal/useSignalValue/useClient adapters.
- Hooks: useDevice, useConnection, useChat, useNodes, useNode,
  useChannels, useChannel, useConfig, useModuleConfig, useTelemetry,
  usePosition, useTraceroute, useFileTransfer, useFavoriteNode, useIgnoreNode.
- jsdom-backed hook tests.

Root README rewritten with packages table, architecture, and workflow.
2026-04-23 21:56:03 -04:00

51 lines
1.4 KiB
JSON

{
"name": "@meshtastic/sdk-react",
"version": "0.1.0",
"description": "React hooks + provider for @meshtastic/sdk. Signal-backed reactive state exposed as idiomatic hooks.",
"exports": {
".": "./mod.ts"
},
"type": "module",
"main": "./dist/mod.js",
"module": "./dist/mod.js",
"types": "./dist/mod.d.ts",
"license": "GPL-3.0-only",
"repository": {
"type": "git",
"url": "git+https://github.com/meshtastic/web.git",
"directory": "packages/sdk-react"
},
"tsdown": {
"entry": "mod.ts",
"platform": "neutral",
"dts": true,
"format": ["esm"],
"splitting": false,
"clean": true
},
"jsrInclude": ["mod.ts", "src", "README.md", "LICENSE"],
"jsrExclude": ["src/**/*.test.ts", "src/**/*.test.tsx", "tests"],
"files": ["package.json", "README.md", "LICENSE", "dist"],
"scripts": {
"preinstall": "npx only-allow pnpm",
"prepack": "cp ../../LICENSE ./LICENSE",
"clean": "rm -rf dist LICENSE",
"build:npm": "tsdown",
"publish:npm": "pnpm clean && pnpm build:npm && pnpm publish --access public --no-git-checks",
"test": "vitest run"
},
"dependencies": {
"@meshtastic/sdk": "workspace:*"
},
"peerDependencies": {
"react": "^18 || ^19"
},
"devDependencies": {
"@testing-library/react": "^16.0.0",
"@types/react": "^19.0.0",
"jsdom": "^25.0.0",
"react": "^19.0.0",
"react-dom": "^19.0.0"
}
}