Skip to content
Public template

About

A template starter repo for modern JavaScript and TypeScript development, designed to ensure high-quality code output.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

@embra/template

Build Status

A template starter repo for modern JavaScript and TypeScript development, designed to ensure high-quality code output.

  • Biome: Fast linter and formatter with TypeScript support.
  • Testing Framework: Utilizes Vitest for seamless testing and coverage reporting.
  • Documentation Generation: Handled by TypeDoc for creating detailed documentation.
  • Build Process: Uses esbuild for ESM bundles (with __DEV__ dev/prod builds) and @hyrious/dts for bundled type declarations.
  • Continuous Integration: Includes GitHub Actions for automated CI testing, versioning and publishing.

Install

After you have cloned the repository generated by this template, run the following command to rename the package and install dependencies:

node scripts/setup.ts

It will update the template with info inferred from git or directory name, and install dependencies.

You can also set the info manually by running:

node scripts/setup.ts --name "package-name" --description "package description" --repo "https://github.com/embrajs/template.git"

Development Mode (__DEV__)

Use __DEV__ to guard development-only checks or diagnostics. Dead __DEV__ branches are automatically stripped from production builds:

if (__DEV__) {
  console.warn("dev-only check");
}

In tests, __DEV__ defaults to true. Use setDevMode to test production behavior (it resets to true after each test):

import { setDevMode } from "../test/setup";

it("runs in production mode", () => {
  setDevMode(false);
  // __DEV__ is false here
});

License

MIT @ embrajs

About

A template starter repo for modern JavaScript and TypeScript development, designed to ensure high-quality code output.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Contributors

Languages