chore(release): restore widget + examples to workspaces, consume react/ui from npm, force 0.1.0#36
Merged
lukeocodes merged 6 commits intomainfrom Apr 30, 2026
Merged
Conversation
…t/ui from npm, force 0.1.0 phase 4 of the soft-launch sequence. now that @deepgram/react@0.1.0 and @deepgram/ui@0.1.0 are on npm, @deepgram/agents-widget can consume them from the registry. widget + examples come back into the root workspaces array so CI and publish run end-to-end. changes: - root package.json: workspaces back to packages/sdk + packages/widget + examples. scripts widen to include @deepgram/agents-widget. - packages/widget/package.json: file: deps for @deepgram/react and @deepgram/ui swapped to ^0.1.0 from npm. @deepgram/agents stays at workspace:* (same monorepo). repository/homepage/bugs added upfront. - packages/widget/vite.config.ts: drops the file-system path aliases for @deepgram/agents/react/ui — npm-installed packages resolve normally now. preact aliases for react/react-dom kept (those are string-id redirects, not deepgram packages). - packages/widget/tsconfig.json: same treatment, drops the deepgram path mappings and the cross-repo project references. preact paths kept. - examples/package.json: file: deps -> ^0.1.0 from npm. - npm-publish.yml: publish-widget no longer checks out sibling repos or builds them. just bun install + build + publish. the file-pointer swap step is now a single-line pin of @deepgram/agents to the SDK version being released in the same workflow run. - ci.yml: setup-node@v6 added (astro-style mismatches avoided ahead of time). the existing publish.yml (CDN upload of the widget UMD bundle to cdn.deepgram.com/widgets/) is left as-is. it will not fire because the release-event-from-GITHUB_TOKEN-doesn't-propagate guard, and there is no widget CDN bucket yet anyway. revisit when the bucket exists. verified locally: typecheck clean for both packages, build clean (SDK 11.58 kB cjs, widget 388.58 kB es / 384.30 kB umd, both gzipped ~90 kB), 107/107 tests passing (78 SDK + 29 widget).
widget's typecheck (`tsc --noEmit`) needs SDK's emitted .d.ts files to resolve `@deepgram/agents`. running typecheck before build leaves the SDK's dist empty and widget fails with TS2307. flipping the order makes the SDK's vite build (which writes dist/index.d.ts via vite-plugin-dts) run first, so widget's typecheck sees the types.
bun 1.3.10's test runner had a regression where `mock.module()` calls followed by an `await import()` of a module that uses those mocks returned an empty exports object. that broke the widget integration tests which mock @deepgram/react / @deepgram/ui / @deepgram/agents before importing widget.js to test buildSessionConfig. confirmed locally on bun 1.3.13: 78 SDK tests + 29 widget tests all pass. CI was on 1.3.10 and was hitting 13 failures all on 'buildSessionConfig is not a function'.
init.test.ts uses `mock.module("../widget.js", ...)` to swap out
the render layer with preact stubs. that mock leaks across test files
(known bun issue oven-sh/bun#13925), so widget.test.ts and the
integration test were getting the empty stub instead of the real
widget.js exports. all the buildSessionConfig assertions failed with
`buildSessionConfig is not a function` in CI.
local on macOS happens to clear the mock between files. CI on Linux
does not. cross-platform fix is an explicit `mock.restore()` at the
top of the affected files.
mock.restore() does not unwind module mocks in bun, so the previous attempt at fixing the cross-file leak from init.test.ts didn't help. proper fix: don't mock the relative path. mock the same @deepgram/* specifiers the other widget tests already mock. with all three test files agreeing on the same package mocks, there's no leak to fix. still local-clean (29/29) and now should be CI-clean too.
there is no `cdn.deepgram.com/agent-widget/` bucket yet, so quick-start docs that show `<script src="https://cdn...">` lead users to a 404. swap them out for the npm install path. UMD usage stays documented but as a self-hosted bundle (the npm package ships dist/widget.umd.js). - README.md: widget quick-start now uses `npm install` + ESM import. brief note that the UMD bundle is in the npm package for self-hosting. - packages/widget/README.md: drops the 'CDN (UMD)' install section. ESM is the primary path, UMD is a secondary 'self-host this file' pattern. - packages/widget/src/index.ts: JSDoc `@example` swapped from CDN-script-tag to ESM. - examples/2[0-3]-umd-*/index.html: displayed code snippets show `/widget.umd.js` with a 'host from your own server' comment instead of the CDN URL. the actual local-dev script tag is unchanged. - examples/2[0-3]-umd-*/README.md: 'CDN script tag' descriptions rewritten as 'self-hosted UMD bundle'. - .github/workflows/publish.yml: deleted. it triggered on `release: published` to upload widget.umd.js to a CDN that does not exist. delete now, re-add when the bucket is set up.
5 tasks
lukeocodes
added a commit
that referenced
this pull request
May 1, 2026
…ve (#40) ## Summary `@deepgram/agents-widget@0.1.1` was tagged after #38 + #39 merged, but the publish-widget job failed with [TS2307](https://github.com/deepgram/agent/actions/runs/25228923931/job/73979383520): ``` src/types.ts(7,8): error TS2307: Cannot find module '@deepgram/agents' or its corresponding type declarations. src/widget.tsx(2,59): error TS2307: Cannot find module '@deepgram/agents' or its corresponding type declarations. ``` ## Root cause widget's `build` script runs `tsc --noEmit && vite build`. `tsc --noEmit` needs SDK's emitted `dist/index.d.ts` to resolve `@deepgram/agents`. `publish-widget` was running `bun run --filter '@deepgram/agents-widget' build` which only builds the widget package and skips the SDK build that emits those types. `ci.yml` already fixed this back in #36 by running the root `bun run build` script, which builds packages in topological order (SDK first, widget second). `publish-widget` was missed in that pass. `publish-sdk` happens to dodge the bug because it also runs the root `bun run build`. ## Fix `publish-widget` now runs `bun run build` (same root script). builds SDK first, emits dist files, then widget builds and types resolve. ## Side fixes bundled in because release-please needs a path-based touch on `packages/widget` to bump the patch version: - `description`: drops the now-misleading "CDN widget" framing. Says what the package actually is. - `keywords`: adds `preact` (the widget bundles preact internally, makes the package findable on npm). ## State on main - `agents-widget-v0.1.1` GitHub release exists ✅ - `@deepgram/agents-widget@0.1.1` is **not** on npm ❌ - after this PR merges, release-please opens `release agents-widget 0.1.2`. merging that runs the (now fixed) publish-widget and `@deepgram/agents-widget@0.1.2` lands on npm with provenance. ## Why skip 0.1.1 on npm rather than republish same reasoning as the 0.1.0 -> 0.1.1 bump: republishing the same tag would need either `workflow_dispatch` (the workflow doesn't have it) or a local `npm publish` (forfeits provenance). cleanest path is to let release-please cut a fresh patch through the green pipeline. ## Test plan - [x] clean working dir, fresh `bun install`, `bun run build` from clean state — both packages build, no TS2307 - [x] widget tests still pass (29/29) - [ ] CI green on this PR - [ ] release-please opens `release agents-widget 0.1.2` after merge - [ ] merge that PR -> `@deepgram/agents-widget@0.1.2` on npm with provenance ## Follow-up once `@deepgram/agents-widget@0.1.2` is live: - `deepgram/deepgram-docs#777` (Browser Agent docs) drops the `Do Not Merge 🙅` label - soft launch closed across all four packages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
phase 4 (final) of the soft-launch sequence. with
@deepgram/agents@0.1.1,@deepgram/react@0.1.0, and@deepgram/ui@0.1.0on npm,@deepgram/agents-widgetcan install everything from the registry and ship as a self-contained CDN-style UMD bundle.Release plan recap
@deepgram/agents-> npm ✅ (0.1.1)@deepgram/react-> npm ✅ (0.1.0)@deepgram/ui-> npm ✅ (0.1.0)@deepgram/agents-widget-> npm ← this PRChanges
Workspaces
package.json(root): widget + examples back in theworkspacesarray (they were temporarily pulled in phase 1 so the SDK could publish first). scripts widen to filter both@deepgram/agentsand@deepgram/agents-widget.Widget package
packages/widget/package.json:@deepgram/reactand@deepgram/uiswitched fromfile:pointers to^0.1.0npm versions.@deepgram/agentsstays atworkspace:*(same monorepo).repository(withdirectory: packages/widget),homepage, andbugsadded upfront — npm provenance won't reject the publish.packages/widget/vite.config.ts: drops the file-system path aliases for@deepgram/agents/@deepgram/react/@deepgram/ui. node_modules resolution handles them normally now. preact aliases kept (those are string-id redirects, not deepgram packages).packages/widget/tsconfig.json: drops the deepgram path mappings and the cross-repo project references. preact paths kept.Examples
examples/package.json:@deepgram/reactand@deepgram/uiswitched to^0.1.0from npm.@deepgram/agentsand@deepgram/agents-widgetstay atworkspace:*.Workflows
.github/workflows/npm-publish.yml:publish-widgetno longer checks out sibling repos or builds them. Justbun install+bun run build+npm publish. the file-pointer-swap step shrank to a single-line pin of@deepgram/agentsto whatever SDK version is being released in the same workflow run..github/workflows/ci.yml:actions/setup-node@v6added before bun (avoids astro-style runtime mismatches that bit phase 3).What this does NOT include
publish.yml(CDN upload of widget UMD tocdn.deepgram.com/widgets/) is unchanged. it triggers onrelease: publishedwhich doesn't fire for releases created by GITHUB_TOKEN-backed release-please-action (same guard that bit ui phase 3). there's also no widget CDN bucket yet, so this is moot for now. revisit when the bucket exists, at which point thecdn-syncjob pattern from ui can be applied here too.Test plan
bun installclean (resolves@deepgram/react@0.1.0and@deepgram/ui@0.1.0from npm)bun run typecheckclean for SDK and widgetbun run test107/107 passing (78 SDK + 29 widget)bun run buildclean. SDKdist/index.js11.06 kB / 3.67 kB gzipped. widgetdist/widget.es.js388.58 kB / 90.02 kB gzipped,dist/widget.umd.js384.30 kB / 90.06 kB gzipped.release agents-widget 0.1.0after merge@deepgram/agents-widget@0.1.0on npmRelated
@deepgram/react@0.1.0and@deepgram/ui@0.1.0on npm (verified)