Skip to content

fix(cli): Add bin/webui stub and postinstall binary copy#232

Merged
mohamedmansour merged 1 commit intomainfrom
user/mmansour/cli
Apr 14, 2026
Merged

fix(cli): Add bin/webui stub and postinstall binary copy#232
mohamedmansour merged 1 commit intomainfrom
user/mmansour/cli

Conversation

@mohamedmansour
Copy link
Copy Markdown
Contributor

The package.json declared "bin": { "webui": "bin/webui" } but no bin/ directory or launcher existed, so pnpm could never create the .bin/webui symlink for consumers.

Changes:

  • Add bin/webui as a committed shell stub that prints a helpful error if the native binary hasn't been installed yet. This ensures pnpm can always create bin symlinks without ENOENT warnings.
  • Update install.ts (postinstall) to copy the resolved native binary from the platform-specific package (or cargo build fallback) into bin/webui, replacing the stub with the real executable.
  • Split build script: "build" runs tsc only, "postbuild" runs install.js to copy the native binary for local development.
  • Switch build and test from esbuild to tsc for consistency with webui-framework. Remove esbuild from devDependencies.
  • Add tsconfig.test.json for test compilation (outputs to dist/test/).
  • Update test import to use self-referencing package name instead of relative path to dist/. exclusion.

Fixes #225

The package.json declared "bin": { "webui": "bin/webui" } but no
bin/ directory or launcher existed, so pnpm could never create the
.bin/webui symlink for consumers.

Changes:
- Add bin/webui as a committed shell stub that prints a helpful error
  if the native binary hasn't been installed yet. This ensures pnpm
  can always create bin symlinks without ENOENT warnings.
- Update install.ts (postinstall) to copy the resolved native binary
  from the platform-specific package (or cargo build fallback) into
  bin/webui, replacing the stub with the real executable.
- Split build script: "build" runs tsc only, "postbuild" runs
  install.js to copy the native binary for local development.
- Switch build and test from esbuild to tsc for consistency with
  webui-framework. Remove esbuild from devDependencies.
- Add tsconfig.test.json for test compilation (outputs to dist/test/).
- Update test import to use self-referencing package name instead of
  relative path to dist/.
  exclusion.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mohamedmansour mohamedmansour changed the title Add bin/webui stub and postinstall binary copy fix(cli): Add bin/webui stub and postinstall binary copy Apr 14, 2026
@mohamedmansour mohamedmansour requested a review from a team April 14, 2026 03:23
@mohamedmansour mohamedmansour merged commit 3eecbca into main Apr 14, 2026
21 checks passed
@mohamedmansour mohamedmansour deleted the user/mmansour/cli branch April 14, 2026 03:23
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.

@microsoft/webui@0.0.7: webui cli unavailable after install

2 participants