-
Notifications
You must be signed in to change notification settings - Fork 61
fix: update js script to ts #3543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request migrates JavaScript script files to TypeScript to improve codebase consistency and type safety across multiple packages. The migration follows a "thin wrapper" pattern for CLI entry points and converts build scripts to TypeScript with modern Node.js features.
- Unified CLI entry points across plugin-packer, create-plugin, and customize-uploader to use 3-line wrapper pattern
- Migrated build scripts (generate-dts.js, npm-build.js) to TypeScript with Node.js ESM compatibility features
- Replaced wrapper file (from-manifest.js) with package.json exports field for cleaner module resolution
Reviewed changes
Copilot reviewed 12 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/plugin-packer/bin/cli.js | Reduced to thin 3-line wrapper requiring compiled TypeScript |
| packages/plugin-packer/src/cli.ts | New CLI entry with meow argument parsing, moved from bin/cli.js |
| packages/plugin-packer/src/packer-cli.ts | Renamed from src/cli.ts, contains core packing logic |
| packages/plugin-packer/test/cli.spec.ts | Updated import to reference renamed packer-cli module |
| packages/plugin-packer/package.json | Added exports field for from-manifest, removed wrapper file |
| packages/plugin-packer/from-manifest.js | Removed wrapper file in favor of exports field |
| packages/plugin-manifest-validator/script/generate-dts.ts | Migrated from JS with JSON import type assertion |
| packages/plugin-manifest-validator/script/generate-dts.js | Removed JavaScript version |
| packages/plugin-manifest-validator/package.json | Updated script to run TypeScript file |
| packages/dts-gen/scripts/npm-build.ts | Migrated from JS with ESM syntax (import.meta.url) |
| packages/dts-gen/package.json | Updated script to run TypeScript file |
| packages/customize-uploader/bin/cli.js | Reduced to thin 3-line wrapper requiring compiled TypeScript |
| packages/customize-uploader/src/cli.ts | New CLI entry with all parsing logic migrated from bin |
| packages/create-plugin/bin/cli.js | Reduced to thin 3-line wrapper requiring compiled TypeScript |
| packages/create-plugin/src/cli.ts | New CLI entry with all parsing logic migrated from bin |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Why
Migrate JavaScript script files (bin/cli.js, build scripts, etc.) to TypeScript to improve codebase consistency and type safety.
What
Migrate bin/cli.js to TypeScript
Unified to the plugin-uploader pattern (thin wrapper):
Migrate other JS scripts
with { type: "json" }for Node.js v24 compatibilityimport.meta.urlfor ESM compatibilityHow to test
Checklist
pnpm lintandpnpm teston the root directory.