Skip to content

Latest commit

 

History

History
137 lines (82 loc) · 3.55 KB

CONTRIBUTING.md

File metadata and controls

137 lines (82 loc) · 3.55 KB

Contribution guide

Welcome! We're excited you're interested in contributing. To ensure a smooth and productive collaboration, follow these guidelines.

Goals of tsx

  1. Enhance Node.js with TypeScript support
  2. Improve ESM ↔ CommonJS interoperability as the ecosystem migrates to ESM
  3. Support the active LTS versions of Node.js

Issues & Discussions

Important

Please be polite, respectful, and considerate of people's time and effort.

This is an open source project relying on community contributions.

Opening a new Issue

Minimal reproduction required

Provide a clear, minimal example of the issue. This helps contributors identify genuine bugs efficiently.

Check the documentation

Review the project documentation for known behaviors or caveats to avoid unnecessary issues.

Commenting on an existing Issue/Discussion

⭐️ Issue objectives

Issues serve as a platform for contributors to:

  1. Verify bugs
  2. Diagnose the causes
  3. Brainstorm solutions
  4. Implement fix

✅ Be constructive

Aim to contribute to the solution with research & PRs (tests + solutions). The goal is to land an improvement in tsx for everyone to benefit.

Be concise to save people's time.

❌ Avoid detractive comments

Keep comments focused on fixing the issue.

Off-topic comments, comments that don't add value (e.g. "updates?", "also happening in ..."), and discussing workarounds will be hidden or deleted.

After an issue is confirmed, the thread may sometimes be locked to direct further conversation & action to PRs.

Tip

⚡️ Get issues addressed faster!

Sponsors can prioritize issues. By helping fund development, you can ensure your needs are addressed quickly!

Sponsor now →

Pull requests

Open an Issue first

Ensure there’s an existing issue related to your PR to facilitate alignment and prevent wasted work.

Include tests

Add minimal tests verifying your changes to maintain behavior and reliability.

Development

Initial setup

After cloning the repo, use nvm (optional) to set the expected Node.js version, and pnpm to install dependencies:

nvm i      # Install or use Node.js version
pnpm i     # Install dependencies

Building

Build the source code with:

pnpm build # Compiles to `dist`

Tip

Temporarily disable minification by removing --minify in package.json#scripts.build for easier debugging.

Linting and type-checking

Ensure code quality with:

pnpm lint           # ESLint
pnpm type-check     # TypeScript type checking

Testing

Run automated tests with:

pnpm test             # Regular test
CI=1 pnpm test        # CI environments

Manual testing

Local testing

Use the absolute path to run ./dist/cli.mjs:

/tsx/dist/cli.mjs <ts file>

Collaborative testing

Use git-publish to publish your changes to your GitHub fork. It can be shared with others and installed from for testing.

Giving back

tsx has outgrown its "hobby project" status to become a tool used and loved by many.

While it made it far without sponsorship, funding will accelerate further development by making it easier for devs to choose tsx over other paid work.

If tsx has helped you, help tsx back! ❤️

Any amount makes a difference.

Sponsor now →