Default to using Bun instead of Node.js.
- Use
bun <file>instead ofnode <file>orts-node <file> - Use
bun installinstead ofnpm installoryarn installorpnpm install - Use
bun run <script>instead ofnpm run <script>oryarn run <script>orpnpm run <script> - Bun automatically loads .env, so don't use dotenv.
Tests use vitest, not bun:test. Import from vitest and run with bun run test.
import { test, expect } from 'vitest'
test('example', () => {
expect(1).toBe(1)
})- Entry point:
src/index.tsx - Zustand store slices:
src/store/slices/ - Actions (Ctrl+K menu):
src/actions/ - IRC event handlers:
src/store/slices/ircSlice.ts - Custom TCP IRC client:
src/utils/ircClient.ts
The IRC base library (ObsidianIRC/) is a git submodule aliased as @irc/*. After cloning:
git submodule update --initSASL PLAIN/EXTERNAL is wired in ircSlice.ts via CAP ACK and AUTHENTICATE event handlers on the IRC client.
set value() on InputRenderable fires onInput, which creates an infinite loop for controlled inputs. For password / secret fields: use a ref and call setText() directly instead of setting value. See FormModal.tsx and src/utils/formMasking.ts.
- Package name:
tobby - Bin shim:
bin/tobby.js(Node ESM, delegates tobun dist/index.js) - Always run
bun run buildbefore publishing — this bundles everything including the submodule intodist/index.js