This is a bounty to fix a package entrypoint issue in a UI library. The `@freelanceflow/ui` package's `main` entrypoint currently points to a TypeScript source file (`src/index.ts`), which causes resolution errors for consumers importing the package directly as a JavaScript module. The task involves configuring the package to expose a proper JavaScript entrypoint while maintaining TypeScript declarations.
A starter prompt for Claude Code, what you'll need, and how to reach them.
You are a senior TypeScript/JavaScript engineer. The goal is to fix a package entrypoint issue in a monorepo. The specific problem is that the `@freelanceflow/ui` workspace package declares `main` as `src/index.ts`, which is a TypeScript file. This causes runtime errors when Node/ESM consumers try to import the package directly. The task is to configure the package to expose a real JavaScript entrypoint while preserving TypeScript declarations for consumers.
Here's the plan:
1. Start by creating a local fork of `SecureBananaLabs/bug-bounty`.
2. Navigate to the `@freelanceflow/ui` package directory.
3. Identify the current `package.json` configuration and the `src/index.ts` file, which re-exports `./Button` and `./Card`.
4. Propose and implement changes to `package.json` to include `main`, `module` (for ESM compatibility), and `types` fields, all pointing to appropriate output files in a `dist/` directory.
5. Implement a lightweight build script (e.g., using `tsc` for TypeScript compilation and potentially a small `rollup.js` config if more advanced bundling is needed, otherwise `tsc` alone should suffice) that compiles the TypeScript source into JavaScript and generates declaration files into the `dist/` folder.
6. Ensure the `dist/` directory is correctly structured with compiled JS files (e.g., `dist/index.js`, `dist/Button.js`, `dist/Card.js`) and their corresponding `.d.ts` declaration files.
7. Test the fix locally by running `node -e "import('@freelanceflow/ui')"` within the monorepo root to confirm the package imports correctly without errors.
8. Generate a `CHANGELOG.md` entry describing the fix, and update any relevant documentation if necessary.
Use Next.js 16 App Router, React 19, Tailwind v4 are not relevant for this specific task; focus solely on the package configuration and build process within the existing monorepo context. The output should be a PR-ready set of changes. Prioritize a minimal, effective solution using existing monorepo tools if possible.Bounty (amount on the issue). The `@freelanceflow/ui` workspace package currently declares `main` as `src/index.ts`, and that file re-exports `./Button` and `./Card` without emitted JavaScript entrypoints. This makes the package fail when imported directly by a Node/ESM consumer from the workspace: ```sh node -e "import('@freelanceflow/ui')" ``` It currently errors because the package entrypoint points at TypeScript source and the component modules are not resolvable as runtime JavaScript. The package should expose a real JavaScript entrypoint while preserving TypeScript declarations for consumers.
Standard for GitHub bounties
Standard JavaScript development environment
Essential for understanding TypeScript package configuration
Comment on the GitHub issue #2781 on `SecureBananaLabs/bug-bounty`, then open a draft Pull Request to their repository, linking to the issue.
“I've identified the root cause of the `@freelanceflow/ui` package entrypoint issue and have a working solution ready to go. I've configured the package to emit a proper JavaScript entrypoint while preserving TypeScript declarations. I'll submit a draft PR shortly so you can review the proposed changes.”
Open the original ↗