Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions js/hang-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
"@kixelated/hang": "workspace:^"
},
"devDependencies": {
"@tailwindcss/postcss": "^4.1.10",
"@tailwindcss/postcss": "^4.1.12",
"@tailwindcss/typography": "^0.5.16",
"@tailwindcss/vite": "^4.1.10",
"@tailwindcss/vite": "^4.1.12",
"highlight.js": "^11.11.1",
"tailwindcss": "^4.1.10",
"typescript": "^5.8.3",
"tailwindcss": "^4.1.12",
"typescript": "^5.9.2",
"vite": "^6.3.5",
"vite-plugin-html": "^3.2.2"
}
Expand Down
8 changes: 4 additions & 4 deletions js/hang/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@
"release": "tsx ../scripts/release.ts"
},
"dependencies": {
"@huggingface/transformers": "^3.7.0",
"@kixelated/moq": "workspace:^",
"@kixelated/signals": "workspace:^",
"@huggingface/transformers": "^3.7.2",
"@kixelated/moq": "link:../moq",
"@kixelated/signals": "link:../signals",
Comment on lines +41 to +43
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Using link: for local workspaces can break publish/install; consider peer+dev split or publish-time rewrite.

link: is great locally but is not publishable to npm and will break external consumers if it escapes packaging. Prefer:

  • Declare @kixelated/moq and @kixelated/signals as peerDependencies (runtime contract).
  • Keep local development via devDependencies (can stay link:) or workspace:*.
  • Ensure your ../scripts/package.ts rewrites these to proper semver ranges before publish.

To verify, after your packaging step, inspect the tarball’s package.json has no link::


🏁 Script executed:

#!/bin/bash
set -euo pipefail
# from repo root
pnpm -w -r build || true
# produce tarball for this package (adjust if your packaging script already emits one)
tarball=$(cd js/hang && npm pack --json | jq -r '.[0].filename')
tmpdir=$(mktemp -d)
tar -xzf "js/hang/$tarball" -C "$tmpdir"
jq '.dependencies' "$tmpdir/package/package.json"
if jq -e 'to_entries[] | select(.value|tostring|test("^link:"))' "$tmpdir/package/package.json" >/dev/null; then
  echo "Error: link: deps leaked into published manifest"
  exit 1
fi
echo "OK: No link: deps in publish manifest"

Length of output: 751


Fix leaking link: dependencies in published package

Manual inspection of the js/hang tarball (kixelated-hang-0.3.12.tgz) shows that its bundled package.json still contains local link: entries under .dependencies:

  • @kixelated/moq: "link:../moq"
  • @kixelated/signals: "link:../signals"

This will break installs for external consumers, since npm cannot resolve link: specifiers in published packages. To resolve:

• Move these to peerDependencies with proper semver ranges (e.g. "^X.Y.Z").
• Keep the local link: specifiers (or workspace:*) in devDependencies for local development.
• Enhance your scripts/package.ts (or packaging pipeline) to rewrite all link:/workspace: specifiers to actual version ranges before publishing.

Update your post-pack verification script to correctly test the .dependencies field, for example:

#!/usr/bin/env bash
set -euo pipefail
cd js/hang
# Pack the module
tarball=$(npm pack --json | jq -r '.[0].filename')
tmpdir=$(mktemp -d)
tar -xzf "$tarball" -C "$tmpdir"
# Fail if any dependency still uses link:
if jq -e '.dependencies 
            | to_entries[] 
            | select(.value | test("^link:"))' \
         "$tmpdir/package/package.json" >/dev/null; then
  echo "Error: link: deps leaked into dependencies"
  exit 1
fi
echo "OK: No link: deps in dependencies"
🤖 Prompt for AI Agents
In js/hang/package.json around lines 41-43, the packaged package.json still
contains local "link:../moq" and "link:../signals" entries in dependencies; move
these two entries from dependencies into peerDependencies with appropriate
semver ranges (e.g. "^X.Y.Z") and keep local link: or workspace:* entries in
devDependencies for local development; update scripts/package.ts (or the
packaging pipeline) to rewrite any "link:"/"workspace:" specifiers to real
version ranges when creating the published tarball, and add/update the post-pack
verification script to extract the generated tarball and assert that
package/package.json .dependencies contains no "link:" or "workspace:"
specifiers (failing the pack if any are found).

"async-mutex": "^0.5.0",
"comlink": "^4.4.2",
"zod": "^4.0.0"
"zod": "^4.1.3"
},
"devDependencies": {
"@types/audioworklet": "^0.0.77",
Expand Down
3 changes: 2 additions & 1 deletion js/hang/src/catalog/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { z } from "zod";
import { TrackSchema } from "./track";

export const ChatSchema = z.object({
track: TrackSchema,
message: TrackSchema.optional(),
typing: TrackSchema.optional(),
});

export type Chat = z.infer<typeof ChatSchema>;
4 changes: 2 additions & 2 deletions js/hang/src/catalog/root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function decode(raw: Uint8Array): Root {
}

export async function fetch(track: Moq.TrackConsumer): Promise<Root | undefined> {
const frame = await track.nextFrame();
const frame = await track.readFrame();
if (!frame) return undefined;
return decode(frame.data);
return decode(frame);
}
70 changes: 0 additions & 70 deletions js/hang/src/container/bool.ts

This file was deleted.

69 changes: 0 additions & 69 deletions js/hang/src/container/frame.ts

This file was deleted.

2 changes: 0 additions & 2 deletions js/hang/src/container/index.ts

This file was deleted.

51 changes: 0 additions & 51 deletions js/hang/src/container/position.ts

This file was deleted.

56 changes: 0 additions & 56 deletions js/hang/src/container/vint.ts

This file was deleted.

Loading
Loading