Skip to content

Commit a85c35e

Browse files
Address review: switch browser subtrees to @moss-dev/moss-web
@HarshaNalluru and @yatharthk2 pointed out that the correct npm package for browser / WebAssembly usage is `@moss-dev/moss-web` (not the Node SDK `@moss-dev/moss`). Applied the correction in the two subtrees that run in a browser: - apps/next-js: package.json dep, actions.ts import, actions.test.ts vi.mock, README install command -> @moss-dev/moss-web. Regenerated package-lock.json. Also fixed a pre-existing type mismatch now surfaced by the new SDK: `results.timeTakenInMs` -> `timeTakenMs` (the new SearchResult shape). - packages/vitepress-plugin-moss: package.json dep, Search.vue (static + dynamic imports), README dependency-split prose -> @moss-dev/moss-web. Regenerated pnpm-lock.yaml. - packages/vitepress-plugin-moss/demo-site getting-started.md and index.md JS install commands and imports -> @moss-dev/moss-web. - Generated TypeDoc reference docs under packages/vitepress-plugin-moss/demo-site/documentation/docs/reference/: - js/*: renamed @moss-dev/moss -> @moss-dev/moss-web and dropped the inherited v1.0.0-beta.7 version suffix down to v1.0.0 (moss-web has no betas published) - python/*: dropped the inherited v1.0.0b16 -> v1.0.0 (moss@1.0.0 is the only version on PyPI; same flag from @HarshaNalluru on reference/python/classes/MossClient.md) Verification: - `npm install` + `npx tsc --noEmit` on apps/next-js: clean - `pnpm install --lockfile-only` on packages/vitepress-plugin-moss: clean; lock now has 3 @moss-dev/moss-web entries and zero non-hyphen @moss-dev/moss entries All other @moss-dev/moss references in the repo (SDK source, Node demo apps like moss-bun, docker/javascript, the Vercel SDK, test fixtures, moss-live-labs TypeScript examples, root README code snippet, etc.) are Node contexts and stay on @moss-dev/moss — those are not browser usage.
1 parent ddd84ef commit a85c35e

50 files changed

Lines changed: 341 additions & 221 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/next-js/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ This demo showcases how to use **Server Actions** to securely interact with Moss
4747

4848
To add Moss to your own Next.js app:
4949

50-
1. Install the SDK: `npm install @moss-dev/moss`
50+
1. Install the SDK: `npm install @moss-dev/moss-web`
5151
2. Create a Server Action (see `app/actions.ts`).
5252
3. Call the action from your React components.

apps/next-js/app/actions.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'
33
const mockLoadIndex = vi.fn()
44
const mockQuery = vi.fn()
55

6-
vi.mock('@moss-dev/moss', () => ({
6+
vi.mock('@moss-dev/moss-web', () => ({
77
MossClient: vi.fn().mockImplementation(() => ({
88
loadIndex: mockLoadIndex,
99
query: mockQuery,

apps/next-js/app/actions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use server'
22

3-
import { MossClient } from "@moss-dev/moss";
3+
import { MossClient } from "@moss-dev/moss-web";
44

55
/**
66
* Server Action to perform semantic search using Moss SDK.
@@ -33,7 +33,7 @@ export async function searchMoss(query: string) {
3333
score: doc.score,
3434
metadata: doc.metadata
3535
})),
36-
timeTaken: results.timeTakenInMs
36+
timeTaken: results.timeTakenMs
3737
};
3838
} catch (error) {
3939
console.error("Moss Search Error:", error);

apps/next-js/package-lock.json

Lines changed: 145 additions & 93 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/next-js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"test": "vitest run"
1212
},
1313
"dependencies": {
14-
"@moss-dev/moss": "^1.0.0",
14+
"@moss-dev/moss-web": "^1.0.0",
1515
"lucide-react": "^0.563.0",
1616
"next": "16.2.3",
1717
"react": "19.2.3",

packages/vitepress-plugin-moss/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Index is live on Moss cloud (seamless handoff, no user actio
2727

2828
Two separate npm packages are involved:
2929
- **`@inferedge-rest/moss`** — Node.js REST client used **at build time** (inside `@moss-tools/md-indexer`) to upload documents
30-
- **`@moss-dev/moss`** — WebAssembly browser SDK used **at runtime** to download the index and run local queries
30+
- **`@moss-dev/moss-web`** — WebAssembly browser SDK used **at runtime** to download the index and run local queries
3131

3232
---
3333

@@ -288,7 +288,7 @@ vitepress-plugin-moss
288288
│ ├── @inferedge-rest/moss REST client for uploading to Moss cloud
289289
│ ├── vitepress uses resolveConfig + createMarkdownRenderer
290290
│ └── cheerio / gray-matter HTML parsing, frontmatter
291-
└── @moss-dev/moss ← runtime only (browser WebAssembly)
291+
└── @moss-dev/moss-web ← runtime only (browser WebAssembly)
292292
└── Queries run locally after index is downloaded
293293
```
294294

packages/vitepress-plugin-moss/Search.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { ref, shallowRef, computed, nextTick, watch, onBeforeUnmount, onMounted
33
import { useData, useRouter } from 'vitepress'
44
import { onKeyStroke, useScrollLock, useInfiniteScroll } from '@vueuse/core'
55
import { useFocusTrap } from '@vueuse/integrations/useFocusTrap'
6-
import type { SearchResult, QueryResultDocumentInfo } from '@moss-dev/moss'
6+
import type { SearchResult, QueryResultDocumentInfo } from '@moss-dev/moss-web'
77
import SearchButton from './SearchButton.vue'
88
import mossLogo from './moss-logo.png'
99
@@ -292,7 +292,7 @@ async function initMoss() {
292292
status.value = 'initializing'
293293
initPromise = (async () => {
294294
try {
295-
const { MossClient } = await import(/* @vite-ignore */ '@moss-dev/moss')
295+
const { MossClient } = await import(/* @vite-ignore */ '@moss-dev/moss-web')
296296
const client = new MossClient((options.value as any).projectId, (options.value as any).projectKey)
297297
mossClient.value = client
298298
status.value = 'ready'

0 commit comments

Comments
 (0)