chore: rename to @soulcraftlabs/brainy for Open Brainy on The Source
Prepares the repo for its new home at soulcraftlabs/open-brainy ahead of the Forgejo transfer: package name, publish registry, release script, and every install/import reference across docs, src, tests, examples, and integrations now point at @soulcraftlabs/brainy on The Source. The npmjs storefront leg and byte-identity pair verification are stripped from the release script — The Source is now the only publish target. README gains an Open Brainy explainer and a registry note for consumers. @soulcraft/brainy 10.4.2 was the last release under the old name.
This commit is contained in:
parent
1f34fc6ce4
commit
a99b1e83c4
74 changed files with 230 additions and 284 deletions
|
|
@ -8,7 +8,7 @@ Brainy is **framework-friendly** - designed to drop into the server side of any
|
|||
|
||||
Brainy embeds an HNSW vector index, a graph engine, and a filesystem-backed persistence layer. These belong on the server:
|
||||
|
||||
- **Zero configuration**: Just `import { Brainy } from '@soulcraft/brainy'`
|
||||
- **Zero configuration**: Just `import { Brainy } from '@soulcraftlabs/brainy'`
|
||||
- **Auto storage detection**: `new Brainy()` auto-selects filesystem persistence on Node
|
||||
- **Cleaner code**: No browser polyfills, no conditional client/server imports
|
||||
- **Better DX**: One instance shared across your server routes
|
||||
|
|
@ -18,13 +18,13 @@ Brainy embeds an HNSW vector index, a graph engine, and a filesystem-backed pers
|
|||
### Install Brainy
|
||||
|
||||
```bash
|
||||
npm install @soulcraft/brainy
|
||||
npm install @soulcraftlabs/brainy
|
||||
```
|
||||
|
||||
### Basic Integration
|
||||
|
||||
```javascript
|
||||
import { Brainy } from '@soulcraft/brainy'
|
||||
import { Brainy } from '@soulcraftlabs/brainy'
|
||||
|
||||
// Run on the server (API route, server component, backend service)
|
||||
// new Brainy() auto-detects filesystem persistence on Node
|
||||
|
|
@ -105,7 +105,7 @@ On the server, create one Brainy instance and reuse it across requests. This mod
|
|||
|
||||
```javascript
|
||||
// lib/brain.server.js
|
||||
import { Brainy } from '@soulcraft/brainy'
|
||||
import { Brainy } from '@soulcraftlabs/brainy'
|
||||
|
||||
let brainPromise
|
||||
|
||||
|
|
@ -163,7 +163,7 @@ On the server, create one Brainy instance and reuse it across requests:
|
|||
|
||||
```javascript
|
||||
// server/brain.js (server-only module)
|
||||
import { Brainy } from '@soulcraft/brainy'
|
||||
import { Brainy } from '@soulcraftlabs/brainy'
|
||||
|
||||
let brainPromise
|
||||
|
||||
|
|
@ -248,7 +248,7 @@ The matching backend endpoint uses Brainy directly (Node/Bun):
|
|||
|
||||
```typescript
|
||||
// server: api/search
|
||||
import { Brainy } from '@soulcraft/brainy'
|
||||
import { Brainy } from '@soulcraftlabs/brainy'
|
||||
|
||||
const brain = new Brainy() // auto-detects filesystem persistence on Node
|
||||
await brain.init()
|
||||
|
|
@ -266,7 +266,7 @@ In Next.js, Brainy lives in server code only: API routes, server components, or
|
|||
|
||||
```javascript
|
||||
// lib/brain.server.js (imported only by server code)
|
||||
import { Brainy } from '@soulcraft/brainy'
|
||||
import { Brainy } from '@soulcraftlabs/brainy'
|
||||
|
||||
let brainPromise
|
||||
|
||||
|
|
@ -318,7 +318,7 @@ Brainy runs in a server-only module (`*.server.js`); the component fetches resul
|
|||
|
||||
```javascript
|
||||
// src/lib/server/brain.js (server-only — note the .server suffix)
|
||||
import { Brainy } from '@soulcraft/brainy'
|
||||
import { Brainy } from '@soulcraftlabs/brainy'
|
||||
|
||||
let brainPromise
|
||||
|
||||
|
|
@ -432,7 +432,7 @@ import { defineConfig } from 'vite'
|
|||
|
||||
export default defineConfig({
|
||||
ssr: {
|
||||
external: ['@soulcraft/brainy']
|
||||
external: ['@soulcraftlabs/brainy']
|
||||
}
|
||||
})
|
||||
```
|
||||
|
|
@ -440,7 +440,7 @@ export default defineConfig({
|
|||
```javascript
|
||||
// rollup.config.js (server bundle)
|
||||
export default {
|
||||
external: ['@soulcraft/brainy', 'node:fs', 'node:path', 'node:crypto']
|
||||
external: ['@soulcraftlabs/brainy', 'node:fs', 'node:path', 'node:crypto']
|
||||
}
|
||||
```
|
||||
|
||||
|
|
@ -466,7 +466,7 @@ export async function load({ url }) {
|
|||
|
||||
```javascript
|
||||
// For build-time usage (runs in Node during the build)
|
||||
import { Brainy } from '@soulcraft/brainy'
|
||||
import { Brainy } from '@soulcraftlabs/brainy'
|
||||
|
||||
export async function generateStaticProps() {
|
||||
const brain = new Brainy({
|
||||
|
|
@ -513,7 +513,7 @@ export async function generateStaticProps() {
|
|||
|
||||
### Issue: Large client bundle size
|
||||
**Cause**: A client module is pulling in Brainy.
|
||||
**Solution**: Move the `import { Brainy } from '@soulcraft/brainy'` into a server-only module so it never reaches the browser bundle.
|
||||
**Solution**: Move the `import { Brainy } from '@soulcraftlabs/brainy'` into a server-only module so it never reaches the browser bundle.
|
||||
|
||||
### Issue: SSR hydration mismatch
|
||||
**Solution**: Run the search on the server (loader / server action / API route) and pass the results down as props, so server and client render the same markup.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue