Skip to content

Conversation

@nameless-mc
Copy link
Contributor

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):

  • plugin-packer: Reduced bin/cli.js to a 3-line wrapper, moved meow parsing to src/cli.ts
  • create-plugin: Reduced bin/cli.js to a 3-line wrapper, created new src/cli.ts
  • customize-uploader: Reduced bin/cli.js to a 3-line wrapper, created new src/cli.ts

Migrate other JS scripts

  • plugin-manifest-validator: script/generate-dts.js → script/generate-dts.ts
    • Added with { type: "json" } for Node.js v24 compatibility
  • plugin-packer: Removed from-manifest.js, using package.json exports field instead
  • dts-gen: bin/npm-build.js → scripts/npm-build.ts
    • Using import.meta.url for ESM compatibility

How to test

Checklist

  • Read CONTRIBUTING.md
  • Updated documentation if it is required.
  • Added tests if it is required.
  • Passed pnpm lint and pnpm test on the root directory.

@nameless-mc nameless-mc self-assigned this Dec 25, 2025
Copilot AI review requested due to automatic review settings December 25, 2025 05:59
@nameless-mc nameless-mc requested a review from a team as a code owner December 25, 2025 05:59
@nameless-mc nameless-mc requested review from chihiro-adachi and tasshi-me and removed request for a team December 25, 2025 05:59
@github-actions github-actions bot added pkg: customize-uploader @kintone/customize-uploader pkg: plugin-manifest-validator @kintone/plugin-manifest-validator pkg: dts-gen @kintone/dts-gen pkg: create-plugin @kintone/create-plugin pkg: plugin-packer @kintone/plugin-packer labels Dec 25, 2025
Copy link
Contributor

Copilot AI left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: create-plugin @kintone/create-plugin pkg: customize-uploader @kintone/customize-uploader pkg: dts-gen @kintone/dts-gen pkg: plugin-manifest-validator @kintone/plugin-manifest-validator pkg: plugin-packer @kintone/plugin-packer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants