Skip to content

jellydn/typescript-mini-starter

Repository files navigation

Welcome to typescript-mini-starter 👋

License: MIT Twitter: jellydn

A streamlined and efficient TypeScript starter kit, supporting both ESM and CJS, for quick and versatile project setups.

IT Man - Seamless Transition: Migrating from #CommonJS to #ESM in JavaScript [Vietnamese]

🚀 Introduction

typescript-mini-starter is designed to be a robust and minimalistic starting point for TypeScript development, catering to the modern JavaScript ecosystem. This starter kit uniquely supports both ECMAScript Modules (ESM) and CommonJS (CJS) formats, ensuring compatibility and flexibility for various use cases and environments. Whether you are building a library, an application, or a service, this starter kit provides a quick and easy setup, enabling developers to jump straight into coding with TypeScript's best practices and the versatility of module systems in mind.

📦 Install

Easily set up the project with the following command:

yarn install

This will install all the necessary dependencies to get you started.

🔨 Usage

To compile your TypeScript code:

yarn build

This command will build your project, preparing it for execution or deployment.

🌟 Example

Run an example to see typescript-mini-starter in action:

yarn example

This is a great way to understand how the project works and can be extended.

🧪 Run tests

Ensure the reliability of your code by running tests:

yarn test

This helps in maintaining code quality and catching bugs early.

🚚 Using npx degit to Scaffold Your Project

Easily scaffold a new TypeScript project with typescript-mini-starter using npx degit. This method is especially handy for integrating the starter into monorepos or initializing a standalone project quickly.

For Standalone Projects

  1. Create a new project directory and navigate into it:

    mkdir my-new-project
    cd my-new-project
  2. Use degit to download the mini-starter template:

    npx degit jellydn/typescript-mini-starter
  3. Install dependencies and get started:

    yarn install

For Monorepos (e.g., with Turbo)

  1. Navigate to your monorepo's packages directory:

    cd path/to/your/monorepo/packages
  2. Create a new package folder:

    mkdir my-new-package
    cd my-new-package
  3. Download the mini-starter template into the new package:

    npx degit jellydn/typescript-mini-starter
  4. Proceed with your monorepo's workflow to integrate the new package.

This approach is efficient and reduces the time to set up a new TypeScript project, allowing you to focus more on development.

🙌 Credits

Special thanks to the following projects and their maintainers for their invaluable contributions:

  • privatenumber/tsx: ⚡️ TypeScript Execute: Node.js enhanced to run TypeScript & ESM.
  • privatenumber/pkgroll: 📦 🍣 Next-gen package bundler for TypeScript & ESM.
    • Alternatively, consider egoist/tsup: The simplest and fastest way to bundle your TypeScript libraries. It offers additional customization options if you're looking for a different approach from pkgroll.

Their tools and libraries have significantly contributed to the development and functionality of typescript-mini-starter.

License

This project is licensed under the MIT License - see the LICENSE file for details.

✍️ Author

👤 Huynh Duc Dung

Feel free to reach out if you have any questions or suggestions!

🌟 Show your support

Liked the project? Give it a ⭐️ on GitHub to show your support and appreciation!

kofi paypal buymeacoffee

About

A streamlined and efficient TypeScript starter kit, supporting both ESM and CJS, for quick and versatile project setups.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published