Skip to content

fix(ui): expose importable JavaScript entrypoint for @freelanceflow/ui#4271

Closed
RanuK12 wants to merge 1 commit into
SecureBananaLabs:mainfrom
RanuK12:bounty-4168
Closed

fix(ui): expose importable JavaScript entrypoint for @freelanceflow/ui#4271
RanuK12 wants to merge 1 commit into
SecureBananaLabs:mainfrom
RanuK12:bounty-4168

Conversation

@RanuK12

@RanuK12 RanuK12 commented Jun 4, 2026

Copy link
Copy Markdown

Summary

  • Add a proper JavaScript entrypoint to @freelanceflow/ui so workspace consumers can import the package at runtime.
  • Update packages/ui/package.json: maindist/index.js, add types, exports, build script, and peerDependencies.
  • Add packages/ui/tsconfig.json with JSX support for compiling React components.
  • Add regression tests proving the package is directly importable and exports Button and Card.

Problem

@freelanceflow/ui declared main as src/index.ts, a TypeScript source file. Node.js cannot resolve TypeScript directly, so import("@freelanceflow/ui") fails at runtime. The component modules (Button, Card) were not reachable as JavaScript.

Fix

Following the same pattern that was applied to @freelanceflow/db (#2775), this PR:

  1. Adds tsconfig.json targeting ES2020/CommonJS with jsx: "react" for TSX compilation.
  2. Updates package.json with proper main, types, and exports fields pointing to dist/.
  3. Adds a build script (tsc) and TypeScript dev dependency.
  4. Adds react as a peer dependency (required by the components).

Validation

  • node --test packages/ui/test/ui-entrypoint.test.js — 4/4 pass
  • node --test apps/api/src/tests/*.test.js — 1/1 pass (no regressions)
  • Manual verification: node -e "import(./packages/ui/dist/index.js).then(m => console.log(Object.keys(m)))"["Button", "Card"]

/claim #743
Closes #4168

- Update package.json: main→dist/index.js, add types, exports, build script
- Add tsconfig.json with JSX support for React component compilation
- Add regression tests proving package is directly importable
- Button and Card components are now resolvable as runtime JavaScript

Fixes #4168
Refs #743
github-actions Bot added a commit that referenced this pull request Jun 4, 2026
@RanuK12 RanuK12 closed this by deleting the head repository Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@freelanceflow/ui package entrypoint should be directly importable

1 participant