Files
base/tsup.config.ts
zeekay 5f5fccc682 Open the realtime stream with a grant, and listen for named events
Base serves the stream only to a grant: an authenticated POST to
<prefix>/realtime/token mints one, good once for thirty seconds, and the
EventSource opens <prefix>/realtime?token=<grant>. The client opened the
stream with no grant, so on an org's Base every stream was anonymous and
carried nothing a rule kept from strangers. It now mints a grant on every
connect and reconnect, and opens anonymously only with no token.

Base names each event after the subscription it answers ("people/*"), and
the client listened only to unnamed events, so no record event ever
reached a subscriber. Each subscription now listens for its own name.
collection().unsubscribe() dropped nothing, because it removed a key the
map never held; it now drops that collection's topics and resubmits.

The password, OAuth, verification and reset calls are gone, with
useAuth's signIn and signUp: Base has none of those routes, and sign-in is
Hanzo IAM's.

Declarations are emitted by tsc. TypeScript 7 has no JavaScript API for
tsup's dts bundler, so the build had failed since the move to it.
2026-10-18 20:49:41 -07:00

23 lines
613 B
TypeScript

import { defineConfig } from 'tsup'
export default defineConfig({
entry: {
'core/index': 'src/core/index.ts',
'compat/index': 'src/compat/index.ts',
'react/index': 'src/react/index.ts',
'crdt/index': 'src/crdt/index.ts',
'rest/index': 'src/rest/index.ts',
},
format: ['esm'],
// Declarations come from tsc (`npm run build`): TypeScript 7 is the native
// compiler and has no JavaScript API, which is what tsup's dts bundler drives.
dts: false,
sourcemap: true,
clean: true,
splitting: true,
treeshake: true,
target: 'es2020',
outDir: 'dist',
external: ['react'],
})