DEV Community

Acid Coder
Acid Coder

Posted on

1

TS-Hajime: Effortlessly Bootstrap TypeScript NPM Libraries

I made a library that can easily bootstrap your TypeScript library with better DX tools. It focuses on minimal setup and visual clarity.

GitHub

Features:

  • Sensible defaults.
  • Built with DX tools like pkgroll, tsx, tsup, vitest, and clieye.
  • Preconfigured tsconfig, eslint, vitest, prettier, package.json, and .gitignore files.
  • Ready-to-use GitHub Actions, pre-commit hooks, and npm scripts.
  • Examples and tests included for both library code and npx commands.
  • Write npx commands directly in TypeScript.
  • Outputs both ESM and CJS modules.
  • (VSCode)Pre-configured with file nesting, auto-prettify on save, and a specified TypeScript TSDK path.
  • Exposed configurations allow for complete customization to fit your needs.

To get started:

  1. Run the command below to bootstrap your project:
   npx ts-hajime your-app-name-here
Enter fullscreen mode Exit fullscreen mode

Here’s what your project structure will look like:

project structure

  1. Replace all occurrences of my-app with your app’s name and my-description with a description.

Key commands:

  • Build: npm run build
  • Test: npm test
  • Lint & Fix: npm run lint
  • Type Check: npm run tsc (Note: Type checking is automatically done in GitHub Actions as part of the build step with pkgroll.)
  • Try npx Command Locally: npm run npx something (Modify the npx script in package.json to suit your project requirements.)

Remember to star it if you like it!

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay