farvex 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +144 -0
- package/dist/core/index.cjs +8 -0
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.d.cts +3 -0
- package/dist/core/index.d.ts +3 -0
- package/dist/core/index.js +6 -0
- package/dist/core/index.js.map +1 -0
- package/dist/index.cjs +8 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/react/index.cjs +9 -0
- package/dist/react/index.cjs.map +1 -0
- package/dist/react/index.d.cts +3 -0
- package/dist/react/index.d.ts +3 -0
- package/dist/react/index.js +7 -0
- package/dist/react/index.js.map +1 -0
- package/package.json +101 -0
package/CHANGELOG.md
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# farvex
|
|
2
|
+
|
|
3
|
+
Web SDK for Callpad sessions — a thin, React-friendly wrapper over LiveKit and the Callpad Pulse realtime layer for managing WebRTC and SIP sessions.
|
|
4
|
+
|
|
5
|
+
> Scaffold state. No SDK surface is exposed yet beyond placeholder exports that prove the build pipeline. The first published version will be `0.1.0`; the real SDK surface lands in the next iteration.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm i farvex
|
|
11
|
+
# or
|
|
12
|
+
pnpm add farvex
|
|
13
|
+
# or
|
|
14
|
+
bun add farvex
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
React and react-dom are optional peer dependencies (only needed when you import from `farvex/react`):
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
pnpm add react react-dom
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Subpath exports
|
|
24
|
+
|
|
25
|
+
| Entry | Use when |
|
|
26
|
+
| -------------- | -------------------------------------------------------------- |
|
|
27
|
+
| `farvex` | Curated top-level exports (ships placeholder during scaffold). |
|
|
28
|
+
| `farvex/core` | Framework-agnostic client (browser-safe at module load). |
|
|
29
|
+
| `farvex/react` | React hooks and providers. Carries `"use client"` for Next.js. |
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import { version } from "farvex";
|
|
33
|
+
import { corePlaceholder } from "farvex/core";
|
|
34
|
+
import { reactPlaceholder } from "farvex/react";
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Both ESM and CJS builds ship. Types resolve correctly for bundlers, Node 16+ ESM, and Node 16+ CJS.
|
|
38
|
+
|
|
39
|
+
## Next.js
|
|
40
|
+
|
|
41
|
+
- Import from `farvex/react` directly inside client components — the build preserves the `"use client"` directive, so no transpile hack is needed.
|
|
42
|
+
- Import from `farvex/core` from server components (no DOM access at module load).
|
|
43
|
+
- No `next.config.js` `transpilePackages` changes required.
|
|
44
|
+
|
|
45
|
+
## Vite
|
|
46
|
+
|
|
47
|
+
- Works out of the box. Vite consumes the ESM output.
|
|
48
|
+
- `react` and `react-dom` are `external` at build time; your app supplies them.
|
|
49
|
+
|
|
50
|
+
## Local development
|
|
51
|
+
|
|
52
|
+
From `websdk/`:
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
bun install
|
|
56
|
+
bun run dev # tsup watch mode; rebuilds dist/ on change
|
|
57
|
+
bun run test # vitest smoke tests
|
|
58
|
+
bun run check # lint + format + typecheck
|
|
59
|
+
bun run build # one-off production build
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Linking into a consumer app (goagentfe, customer app, etc.)
|
|
63
|
+
|
|
64
|
+
We recommend [`yalc`](https://github.com/wclr/yalc) over `pnpm link` / `bun link` because it survives Vite and Next.js module caches.
|
|
65
|
+
|
|
66
|
+
One-time setup:
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
# inside websdk/
|
|
70
|
+
bun run dev # keep running; watches src/ and rebuilds dist/
|
|
71
|
+
npx yalc publish --push # in another shell, first time
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
In the consumer app (e.g. `goagentfe`):
|
|
75
|
+
|
|
76
|
+
```sh
|
|
77
|
+
npx yalc add farvex
|
|
78
|
+
pnpm install
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Each change in `websdk/`:
|
|
82
|
+
|
|
83
|
+
```sh
|
|
84
|
+
# inside websdk/
|
|
85
|
+
npx yalc push # push built dist/ to subscribers
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Before committing in the consumer app, undo the local link so `package.json` doesn't point at `file:.yalc/farvex`:
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
npx yalc remove --all
|
|
92
|
+
pnpm install
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Release flow
|
|
96
|
+
|
|
97
|
+
See `sdk-scaffold.md` at the repo root for the full plan. Short version (manual, no CI yet):
|
|
98
|
+
|
|
99
|
+
```sh
|
|
100
|
+
# while working on a change (from repo root or websdk/):
|
|
101
|
+
bun run changeset
|
|
102
|
+
|
|
103
|
+
# when ready to publish (from websdk/), on clean main:
|
|
104
|
+
bun run version # applies pending changesets, writes CHANGELOG.md
|
|
105
|
+
git commit -am "chore: release farvex@x.y.z"
|
|
106
|
+
bun run release # builds, runs changeset publish
|
|
107
|
+
git push --follow-tags
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Before the first real publish:
|
|
111
|
+
|
|
112
|
+
```sh
|
|
113
|
+
npm login # as the publisher account
|
|
114
|
+
npm view farvex # must return 404
|
|
115
|
+
bun run build
|
|
116
|
+
bunx publint
|
|
117
|
+
bun pm pack # inspect the tarball contents
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Pre-1.0: every feature ships as a `minor` bump; breaking changes allowed without a major.
|
|
121
|
+
|
|
122
|
+
## Package conventions
|
|
123
|
+
|
|
124
|
+
- Side-effect free — `"sideEffects": false` in `package.json`. Tree-shakes cleanly.
|
|
125
|
+
- No top-level access to `window`, `document`, `navigator`, `RTCPeerConnection`, or `localStorage`. Any such access happens inside methods or effects.
|
|
126
|
+
- `typescript/no-explicit-any` is enforced by oxlint; we avoid `unknown` in exported types by convention.
|
|
127
|
+
- `engines.node >= 18`.
|
|
128
|
+
|
|
129
|
+
## Layout
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
websdk/
|
|
133
|
+
src/
|
|
134
|
+
index.ts public entry (curated re-exports later)
|
|
135
|
+
core/index.ts framework-agnostic client
|
|
136
|
+
react/index.ts React hooks + providers
|
|
137
|
+
test/ vitest + jsdom smoke tests
|
|
138
|
+
dist/ build output (gitignored)
|
|
139
|
+
tsup.config.ts build config (ESM + CJS + dts, use-client preserved)
|
|
140
|
+
tsconfig.json strict TS, bundler resolution
|
|
141
|
+
vitest.config.ts jsdom test env
|
|
142
|
+
.oxlintrc.json lint rules (matches apps/main)
|
|
143
|
+
.oxfmtrc.json format rules (matches apps/main)
|
|
144
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/index.ts"],"names":[],"mappings":";;;AAAO,IAAM,eAAA,GAAkB","file":"index.cjs","sourcesContent":["export const corePlaceholder = \"farvex/core\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/index.ts"],"names":[],"mappings":";AAAO,IAAM,eAAA,GAAkB","file":"index.js","sourcesContent":["export const corePlaceholder = \"farvex/core\";\n"]}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;AAAO,IAAM,OAAA,GAAU","file":"index.cjs","sourcesContent":["export const version = \"0.0.0\";\n"]}
|
package/dist/index.d.cts
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";AAAO,IAAM,OAAA,GAAU","file":"index.js","sourcesContent":["export const version = \"0.0.0\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/react/index.ts"],"names":[],"mappings":";;;AAAO,IAAM,gBAAA,GAAmB","file":"index.cjs","sourcesContent":["export const reactPlaceholder = \"farvex/react\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/react/index.ts"],"names":[],"mappings":";AAAO,IAAM,gBAAA,GAAmB","file":"index.js","sourcesContent":["export const reactPlaceholder = \"farvex/react\";\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "farvex",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Web SDK for Callpad sessions (LiveKit + Pulse)",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"README.md",
|
|
11
|
+
"CHANGELOG.md"
|
|
12
|
+
],
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"import": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"default": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"require": {
|
|
20
|
+
"types": "./dist/index.d.cts",
|
|
21
|
+
"default": "./dist/index.cjs"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"./core": {
|
|
25
|
+
"import": {
|
|
26
|
+
"types": "./dist/core/index.d.ts",
|
|
27
|
+
"default": "./dist/core/index.js"
|
|
28
|
+
},
|
|
29
|
+
"require": {
|
|
30
|
+
"types": "./dist/core/index.d.cts",
|
|
31
|
+
"default": "./dist/core/index.cjs"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"./react": {
|
|
35
|
+
"import": {
|
|
36
|
+
"types": "./dist/react/index.d.ts",
|
|
37
|
+
"default": "./dist/react/index.js"
|
|
38
|
+
},
|
|
39
|
+
"require": {
|
|
40
|
+
"types": "./dist/react/index.d.cts",
|
|
41
|
+
"default": "./dist/react/index.cjs"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"./package.json": "./package.json"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"react": "^18 || ^19",
|
|
48
|
+
"react-dom": "^18 || ^19"
|
|
49
|
+
},
|
|
50
|
+
"peerDependenciesMeta": {
|
|
51
|
+
"react": {
|
|
52
|
+
"optional": true
|
|
53
|
+
},
|
|
54
|
+
"react-dom": {
|
|
55
|
+
"optional": true
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"@testing-library/jest-dom": "^6.5.0",
|
|
60
|
+
"@types/react": "^18.3.0",
|
|
61
|
+
"@types/react-dom": "^18.3.0",
|
|
62
|
+
"jsdom": "^25.0.0",
|
|
63
|
+
"oxfmt": "^0.38.0",
|
|
64
|
+
"oxlint": "^1.53.0",
|
|
65
|
+
"react": "^18.3.0",
|
|
66
|
+
"react-dom": "^18.3.0",
|
|
67
|
+
"tsup": "^8.3.0",
|
|
68
|
+
"typescript": "5.8.3",
|
|
69
|
+
"vitest": "^2.1.0"
|
|
70
|
+
},
|
|
71
|
+
"scripts": {
|
|
72
|
+
"build": "tsup",
|
|
73
|
+
"dev": "tsup --watch",
|
|
74
|
+
"typecheck": "tsc --noEmit",
|
|
75
|
+
"test": "vitest run",
|
|
76
|
+
"test:watch": "vitest",
|
|
77
|
+
"lint": "oxlint .",
|
|
78
|
+
"format": "oxfmt .",
|
|
79
|
+
"format:check": "oxfmt --check .",
|
|
80
|
+
"check": "bun run lint && bun run format:check && bun run typecheck",
|
|
81
|
+
"changeset": "changeset",
|
|
82
|
+
"version": "changeset version",
|
|
83
|
+
"release": "bun run build && changeset publish",
|
|
84
|
+
"prepublishOnly": "bun run check && bun run test && bun run build"
|
|
85
|
+
},
|
|
86
|
+
"publishConfig": {
|
|
87
|
+
"access": "public"
|
|
88
|
+
},
|
|
89
|
+
"engines": {
|
|
90
|
+
"node": ">=18"
|
|
91
|
+
},
|
|
92
|
+
"keywords": [
|
|
93
|
+
"callpad",
|
|
94
|
+
"sessions",
|
|
95
|
+
"livekit",
|
|
96
|
+
"webrtc",
|
|
97
|
+
"sip",
|
|
98
|
+
"realtime",
|
|
99
|
+
"react"
|
|
100
|
+
]
|
|
101
|
+
}
|