Skip to content

fix: ship compiled dist/ instead of TypeScript source#16

Open
kostyun wants to merge 1 commit intogustavodiasdev:mainfrom
kostyun:fix/ship-compiled-js
Open

fix: ship compiled dist/ instead of TypeScript source#16
kostyun wants to merge 1 commit intogustavodiasdev:mainfrom
kostyun:fix/ship-compiled-js

Conversation

@kostyun
Copy link
Copy Markdown

@kostyun kostyun commented Apr 29, 2026

Problem

The published npm package (opencode-qwencode-auth@1.3.0) contains only TypeScript source files (.ts), but OpenCode's ESM plugin loader resolves imports with .js extensions. This causes the plugin to fail loading with:

ENOENT: no such file or directory, open '.../src/constants.js'
failed to load plugin

Changes

  • module: Changed from index.ts to dist/index.js (compiled output)
  • scripts.prepublishOnly: Added bun run build to auto-build dist/ before every npm publish
  • files: Updated to ship dist/ + README.md instead of raw TypeScript source

Verification

  • bun run build produces dist/index.js and dist/cli.js
  • npm pack includes dist/ in tarball
  • Tested in OpenCode v1.14.29 — plugin loads successfully
  • opencode auth login shows "Qwen Code" provider
  • OAuth flow completes, models available

Related Issues

The npm package was shipping raw TypeScript source files (.ts), but
OpenCode's ESM plugin loader resolves imports with .js extensions.
This caused ENOENT errors and complete plugin failure.

Changes:
- module: points to dist/index.js (compiled output)
- prepublishOnly: auto-builds dist/ before npm publish
- files: ships dist/ + README.md instead of raw TypeScript source
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.

npm package ships TypeScript source instead of compiled JavaScript — plugin fails to load

1 participant