A streamlined and efficient TypeScript starter kit, supporting both ESM and CJS, for quick and versatile project setups.
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.
Easily set up the project with the following command:
yarn install
This will install all the necessary dependencies to get you started.
To compile your TypeScript code:
yarn build
This command will build your project, preparing it for execution or deployment.
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.
Ensure the reliability of your code by running tests:
yarn test
This helps in maintaining code quality and catching bugs early.
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.
-
Create a new project directory and navigate into it:
mkdir my-new-project cd my-new-project
-
Use
degit
to download the mini-starter template:npx degit jellydn/typescript-mini-starter
-
Install dependencies and get started:
yarn install
For Monorepos (e.g., with Turbo)
-
Navigate to your monorepo's packages directory:
cd path/to/your/monorepo/packages
-
Create a new package folder:
mkdir my-new-package cd my-new-package
-
Download the mini-starter template into the new package:
npx degit jellydn/typescript-mini-starter
-
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.
This project uses Pre-Commit to run checks before committing changes. This ensures that the codebase is clean and consistent, maintaining high quality and readability.
pre-commit install
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
.
This project is licensed under the MIT License - see the LICENSE file for details.
👤 Huynh Duc Dung
- Website: productsway.com
- Twitter: @jellydn
- GitHub: @jellydn
Feel free to reach out if you have any questions or suggestions!
Liked the project? Give it a ⭐️ on GitHub to show your support and appreciation!