Skip to content

Conversation

@heyglassy
Copy link
Contributor

Description

This PR improves the bundling configuration and fixes type-related issues in the project. The changes include switching to bunchee for better bundling performance and resolving TypeScript type errors.

Testing

  • All tests pass locally
  • Linted
  • Added tests for new functionality (if applicable)

Docs

Visual Proof

Please provide a screenshot or video demonstrating that your changes work locally:

Related Issue

Fixes [Github issue link]

Additional Notes

  • Migrated to bunchee bundler for improved build performance
  • Fixed TypeScript type errors
  • Updated bundling configuration

@heyglassy heyglassy requested a review from juecd July 9, 2025 23:41
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Package Size Increased by Missing Files Array

The files array was removed from package.json. This causes all files (except those ignored by .gitignore/.npmignore) to be included in the published npm package by default. This unnecessarily increases package size and can expose development files, source code, and other internal details. The files array should be re-added, specifying ["dist/"] to only publish the built output.

package.json#L1-L56

{
"name": "@onkernel/cu-playwright",
"version": "0.1.2",
"type": "module",
"description": "Computer Use x Playwright SDK",
"author": "Kernel",
"license": "MIT",
"keywords": [
"computer-use",
"playwright",
"anthropic",
"automation",
"ai",
"typescript"
],
"repository": {
"type": "git",
"url": ""
},
"scripts": {
"build": "bunchee --clean src/index.ts",
"format": "bun run eslint . --fix",
"lint": "bun run eslint .",
"lint:fix": "bun run eslint . --fix",
"prepublishOnly": "bun run lint && bun run build"
},
"peerDependencies": {
"typescript": "^5",
"playwright": "^1.53.0",
"playwright-core": "^1.53.0"
},
"dependencies": {
"@anthropic-ai/sdk": "0.52.0",
"luxon": "3.6.0",
"zod": "^3.25.0",
"zod-to-json-schema": "^3.23.1"
},
"devDependencies": {
"@eslint/js": "^9.0.0",
"@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.0.0",
"bunchee": "^6.5.4",
"eslint": "^9.0.0",
"eslint-config-prettier": "^9.0.0"
},
"publishConfig": {
"access": "public"
},
"main": "./dist/index.js",
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
}
}
}

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

Copy link

@mesa-dot-dev mesa-dot-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What Changed

This PR overhauls the project's build process and structure. The key change is the migration from bun build to bunchee for bundling, as reflected in package.json. To support this, the source code has been reorganized into a src/ directory, with src/index.ts now serving as the main entry point. Type definitions have also been refactored and moved into the src directory, and the exports field in package.json has been updated accordingly to point to the new build artifacts in dist/.

Risks / Concerns

The files array was removed from package.json. This is a concern because it could lead to publishing unnecessary source files and other artifacts, resulting in a bloated npm package. It's recommended to re-add this field, specifying the build output directory (e.g., ["dist"]) to ensure only essential files are published.

11 files reviewed | 1 comments | Review on Mesa | Edit Reviewer Settings

},
"scripts": {
"build": "bunchee --clean src/index.ts",
"format": "bun run eslint . --fix",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The files array was completely removed from the package.json. This array controls which files are included when the package is published to npm. Without it, npm will include all files by default (except those in .npmignore/.gitignore), which could lead to publishing unwanted files or a bloated package. Consider adding a files array that includes the appropriate files for your new structure, likely something like ["dist/"] since you're building to the dist directory.

Type: Performance | Severity: Medium

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.

2 participants