Skip to content

Minimal TypeScript project base with a custom builder, ESLint setup, structured logging, and auto-handling of build outputs.

License

Notifications You must be signed in to change notification settings

ressiws/typescript-template-pnpm

Repository files navigation

⚙️ TypeScript PNPM Base

Node.js Made with PNPM TypeScript Custom Builder Logger License Last Commit Open Issues Stars

A simple and generic TypeScript starter powered by PNPM, with a custom builder and a clean logging system.

🚀 About

This is a basic template for any TypeScript project. It's not tied to a specific use — you can use it to build bots, APIs, scripts, or anything else you want.

It includes a custom builder that compiles your code and handles everything for you, so you can focus on building your project.

✨ Features

  • 📦 Uses PNPM as the package manager
  • ⚙️ Custom builder:
    • Organizes output structure
    • Automatically copies assets
    • Replaces string patterns
    • Fixes TypeScript import paths after build
    • Clean and colorful logs with emojis
    • Optional --debug mode to show what's going on under the hood
  • 🖥️ Developer mode with pnpm run dev — auto-restarts and watches for changes
  • 📋 Custom logger with log levels (debug, info, warn, error, critical) and emojis
  • 🔍 ESLint for code quality
  • 🧱 Minimal and clean project structure

📁 Project Structure

├── .build/ # Builder settings and internal state
├── scripts/ # Scripts used by the builder
├── src/ # Your TypeScript source code
├── src/config.ts # Project configuration file
└── types/ # Types used internally

📦 Getting Started

  1. Install dependencies:
pnpm install
  1. Run in development mode (auto compile & start):
pnpm run dev

No need to manually build or restart. It watches for changes and runs the latest code.

  1. Build your project manually (optional):
pnpm run build

Optional build flags:

  • --debug: Shows detailed builder logs

Example:

pnpm run build --debug

📜 Scripts

Command Description
pnpm run dev Starts in dev mode with file watching. Reloads on Save.
pnpm run build Builds the project using the custom builder.
pnpm run build --debug Shows detailed builder logs (useful for debugging build issues.)
pnpm run lint Lints the code using ESLint to catch errors and enforce style.
pnpm run backup <msg> Creates a .zip backup of the current state.

Tip

Run pnpm run lint before build to avoid dumb mistakes in production.

Caution

Don't use debug mode in production. The config system will automatically warn you if it's enabled while in a production environment.

✅ Requirements

  • Node.js 18+
  • PNPM

🧠 Tips

  • All your code goes in the src/ folder.
  • You can change settings in config.ts.
  • Use the loader to initialize and organize your boot sequence — helpful for loading services, components, or other logic in a clean way.
  • The builder takes care of everything — you don't need to configure anything else.

🧾 License

This project is licensed under the Creative Commons Attribution 4.0 International (CC BY 4.0) — Use freely with credit. See LICENSE.md.

You can use it for whatever you want — commercial or not — as long as you give credit. Don’t worry, we won't sue you for becoming a millionaire off this… probably.

🙌 Credits

Built with ❤️ by DarkenLM and swisser, just two devs who believe semicolons are optional but clean code isn't.

They log with emojis, debug with sarcasm, and write better README files than code (allegedly).

About

Minimal TypeScript project base with a custom builder, ESLint setup, structured logging, and auto-handling of build outputs.

Topics

Resources

License

Stars

Watchers

Forks