Skip to content

Commit d2b8d62

Browse files
committed
feat: preserve SDK compatibility after regen
Restore the projects.keys.create compatibility patch and legacy CreateKeyV1RequestOne alias, and keep generated browser artifacts out of lint while cleaning hand-maintained examples so the regenerated branch remains source-compatible and releasable.
1 parent 6645925 commit d2b8d62

44 files changed

Lines changed: 1196 additions & 315 deletions

Some content is hidden

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

.agents/skills/deepgram-js-maintaining-sdk/SKILL.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,16 @@ How to identify:
5454

5555
Current temporarily frozen entries:
5656

57-
- **None right now.** `AGENTS.md` explicitly says all current `.fernignore` entries are permanently frozen.
57+
- `package.json` — Fern's generator produces a minimal `devDependencies` set; we add the following:
58+
- `@commitlint/cli`, `@commitlint/config-conventional` — used by `.github/workflows/pr-title-check.yml`
59+
- `tsx` — used by `make examples` / `make example-N`
60+
- `playwright` — used by `make browser`
61+
- `vite`, `terser` — pinned not because we use them directly, but because `.npmrc` sets `minimum-release-age=14400` (10 days) + `strict-peer-dependencies=true`. Without an explicit pin, pnpm tries to satisfy `vitest`'s and `webpack`'s wide peer ranges by picking the latest, which is often too new and the install fails. Pinning forces mature versions. Update the pins (and bump comments below) when you want to move forward.
62+
- `@types/node` pinned forward to `^20.17.57` to match the Node features the SDK uses (relax this if Fern's default ever advances past Node 20).
63+
64+
`pnpm-lock.yaml` is **not** frozen — let Fern regenerate it, then run `pnpm install` after re-applying the `package.json` patch and the lockfile rebuilds correctly.
65+
- `src/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.ts` — keep `manage.v1.projects.keys.create(projectId, request?)` source-compatible with older callers that omit the request body, while still allowing the regenerated request form.
66+
- `src/api/types/CreateKeyV1Request.ts` — preserve the old exported `CreateKeyV1RequestOne` alias alongside `CreateKeyV1Request` so existing type imports keep compiling.
5867

5968
If you patch a generated file in the future, add it to `.fernignore` with a comment explaining the patch and update this skill plus `AGENTS.md`.
6069

@@ -109,6 +118,7 @@ Relevant underlying commands today:
109118
3. **The repo ships both CJS and ESM.** Validate both outputs after generator changes.
110119
4. **Browser behavior matters.** The wrapper intentionally diverges for browser WebSocket auth because browsers cannot send arbitrary socket headers.
111120
5. **`.agents/` is permanently frozen in `.fernignore`.** Treat these skills as hand-written documentation during regeneration; Fern will not touch the folder. Keep this note aligned with `AGENTS.md` whenever the frozen-file list changes.
121+
6. **`biome.json` should honor `.gitignore`.** Generated browser artifacts like `examples/browser/deepgram.js` are produced by `make browser-serve`; keep them gitignored and let Biome's VCS ignore integration exclude them from linting.
112122

113123
## Source-of-truth note
114124

.fernignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,21 @@ AGENTS.md
5252
.claude
5353
.agents
5454
.mcp.json
55+
56+
# Unfreeze for regen (temporarily frozen — see AGENTS.md)
57+
# package.json: Fern's generator produces a minimal devDependencies set; we add
58+
# @commitlint/cli, @commitlint/config-conventional (PR title workflow), tsx (make
59+
# examples), playwright (make browser), vite + terser (pinned for the .npmrc
60+
# minimum-release-age + strict-peer-deps policy, not used directly), and bump
61+
# @types/node forward to ^20. Swap to package.json.bak before regen.
62+
package.json
63+
64+
# src/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.ts:
65+
# keep manage.v1.projects.keys.create(request?) source-compatible with older
66+
# callers that omit the request body. Swap to .bak before regen.
67+
src/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.ts
68+
69+
# src/api/types/CreateKeyV1Request.ts: preserve the old exported
70+
# CreateKeyV1RequestOne alias alongside CreateKeyV1Request. Swap to .bak before
71+
# regen.
72+
src/api/types/CreateKeyV1Request.ts

AGENTS.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,16 @@ How to identify:
5151
- Our version is a **modified copy** of what Fern generates (e.g., fixed types, added optional defaults, broadened a union type)
5252

5353
Current temporarily frozen files:
54-
- _(none currently — all `.fernignore` entries are permanently frozen)_
54+
- `package.json` — Fern's generator produces a minimal `devDependencies` set; we add the following:
55+
- `@commitlint/cli`, `@commitlint/config-conventional` — used by `.github/workflows/pr-title-check.yml`
56+
- `tsx` — used by `make examples` / `make example-N`
57+
- `playwright` — used by `make browser`
58+
- `vite`, `terser` — pinned not because we use them directly, but because `.npmrc` sets `minimum-release-age=14400` (10 days) + `strict-peer-dependencies=true`. Without an explicit pin, pnpm tries to satisfy `vitest`'s and `webpack`'s wide peer ranges by picking the latest, which is often too new and the install fails. Pinning forces mature versions. Update the pins (and bump comments below) when you want to move forward.
59+
- `@types/node` pinned forward to `^20.17.57` to match the Node features the SDK uses (relax this if Fern's default ever advances past Node 20).
60+
61+
`pnpm-lock.yaml` is **not** frozen — let Fern regenerate it, then run `pnpm install` after re-applying the `package.json` patch and the lockfile rebuilds correctly.
62+
- `src/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.ts` — keep `manage.v1.projects.keys.create(projectId, request?)` source-compatible with older callers that omit the request body, while still allowing the regenerated request form.
63+
- `src/api/types/CreateKeyV1Request.ts` — preserve the old exported `CreateKeyV1RequestOne` alias alongside `CreateKeyV1Request` so existing type imports keep compiling.
5564

5665
**Note:** If you need to patch a Fern-generated file, add it to `.fernignore` with a comment describing the patch, and add it to the "temporarily frozen" list above.
5766

biome.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
"$schema": "https://biomejs.dev/schemas/2.4.10/schema.json",
33
"root": true,
44
"vcs": {
5-
"enabled": false
5+
"clientKind": "git",
6+
"enabled": true,
7+
"useIgnoreFile": true
68
},
79
"files": {
810
"ignoreUnknown": true,

examples/09-voice-agent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ async function voiceAgent() {
5353
console.error("Error:", error);
5454
});
5555

56-
let keepAliveInterval;
56+
let keepAliveInterval: ReturnType<typeof setInterval> | undefined;
5757
deepgramConnection.on("close", () => {
5858
console.log("Connection closed");
5959
if (keepAliveInterval) {

examples/36-agent-inject-message.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ async function agentInjectMessage() {
7878
console.error("Error:", error);
7979
});
8080

81-
let keepAliveInterval;
81+
let keepAliveInterval: ReturnType<typeof setInterval> | undefined;
8282
deepgramConnection.on("close", () => {
8383
console.log("Connection closed");
8484
if (keepAliveInterval) {

examples/browser/01-authentication-api-key.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ <h1>Authentication with API Key</h1>
6565
<p>This example demonstrates authentication through the proxy server. The API key is configured via the DEEPGRAM_API_KEY environment variable on the proxy server.</p>
6666

6767
<div class="container">
68-
<button id="runExample">Run Example</button>
68+
<button type="button" id="runExample">Run Example</button>
6969
</div>
7070

7171
<div id="output"></div>
@@ -121,4 +121,3 @@ <h1>Authentication with API Key</h1>
121121
</script>
122122
</body>
123123
</html>
124-

examples/browser/02-authentication-access-token.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ <h1>Authentication with Access Token</h1>
6565
<p>Access tokens are temporary (30-second TTL) and must be obtained using an API key. The API key is configured via the DEEPGRAM_API_KEY environment variable on the proxy server. Uses Bearer scheme in Authorization header.</p>
6666

6767
<div class="container">
68-
<button id="runExample">Run Example</button>
68+
<button type="button" id="runExample">Run Example</button>
6969
</div>
7070

7171
<div id="output"></div>
@@ -165,4 +165,3 @@ <h1>Authentication with Access Token</h1>
165165
</script>
166166
</body>
167167
</html>
168-

examples/browser/03-authentication-proxy.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ <h1>Proxy Authentication</h1>
6969
<p class="warning"><strong>Important:</strong> The proxy server sets the Authorization header and forwards requests to Deepgram's API.</p>
7070

7171
<div class="container">
72-
<button id="runExample">Run Example</button>
72+
<button type="button" id="runExample">Run Example</button>
7373
</div>
7474

7575
<div id="output"></div>
@@ -120,4 +120,3 @@ <h1>Proxy Authentication</h1>
120120
</script>
121121
</body>
122122
</html>
123-

examples/browser/04-transcription-prerecorded-url.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ <h1>Transcribe Audio from URL</h1>
6767
<div class="container">
6868
<label for="audioUrl">Audio URL:</label>
6969
<input type="text" id="audioUrl" placeholder="https://dpgr.am/spacewalk.wav" value="https://dpgr.am/spacewalk.wav">
70-
<button id="runExample">Transcribe</button>
70+
<button type="button" id="runExample">Transcribe</button>
7171
</div>
7272

7373
<div id="output"></div>
@@ -139,4 +139,3 @@ <h1>Transcribe Audio from URL</h1>
139139
</script>
140140
</body>
141141
</html>
142-

0 commit comments

Comments
 (0)