Skip to content

fix: include log-query-engine in package, start MCP server via bin symlink#44

Merged
AlCalzone merged 2 commits into
masterfrom
fix/broken-package
Jul 7, 2026
Merged

fix: include log-query-engine in package, start MCP server via bin symlink#44
AlCalzone merged 2 commits into
masterfrom
fix/broken-package

Conversation

@AlCalzone

Copy link
Copy Markdown
Member

The published v0.1.0 package is broken — both bugs block the gh-aw log analysis workflows in zwave-js/zwave-js#8938.

Bug 1: missing file in the tarball

package.json files lacked dist/lib/log-query-engine.{js,d.ts}. Every entry point (index, CLI, MCP server) fails at import time:

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '.../dist/lib/log-query-engine.js'

Bug 2: MCP server exits immediately via npx

mcp-server.ts guarded startup with an import.meta.url === file://${process.argv[1]} comparison. When started through the bin symlink (npx --package=@zwave-js/log-analyzer zwave-log-analyzer-mcp), argv[1] is the symlink path, the comparison fails, and the process exits 0 without starting the server. The guard is unnecessary for a bin-only entry and was removed.

Verification

Packed the tarball, installed it in a scratch project, and drove node_modules/.bin/zwave-log-analyzer-mcp over stdio: initialize + tools/list now return all 8 tools.

A v0.1.1 release is needed after merging.

AlCalzone and others added 2 commits July 7, 2026 09:57
…mlink

The 0.1.0 release was missing dist/lib/log-query-engine.js because the
files array in package.json did not include it, breaking every entry
point at import time.

Additionally, the import.meta.url guard in mcp-server.ts compared
against the bin symlink path instead of its realpath, so the server
exited immediately when started via npx or node_modules/.bin. The guard
is unnecessary for a bin-only entry point and was removed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Whitelisting individual files already caused a broken release once
(log-query-engine.js was missing in v0.1.0), so include all compiled
lib files instead.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@AlCalzone
AlCalzone merged commit 7617335 into master Jul 7, 2026
4 checks passed
@AlCalzone
AlCalzone deleted the fix/broken-package branch July 7, 2026 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant