Skip to content

everettmorgan/base-ts

Base TypeScript Project (base-ts)

standard-readme compliant

A minimal starter for small TypeScript libraries and packages.

This repository uses TypeScript, Vitest, ESLint flat config, Yarn 4, and GitHub Actions to provide a small CommonJS library template. The package name and repository URL intentionally remain placeholders (---name--- and ---repo---) until real package metadata is provided.

Table of Contents

Install

This project requires Node.js 22 or newer. Yarn 4.14.1 is managed through Corepack.

corepack enable
corepack prepare yarn@4.14.1 --activate
yarn install

Usage

Build the CommonJS output and load the root entrypoint:

yarn build
node -e "require('./dist')"

Consumers should import only the published root entrypoint:

const library = require('---name---');

console.log(library);

Deep imports from src/ or internal dist/ paths are not part of the public package contract.

Project Layout

  • src/ - TypeScript source files.
  • test/ - Vitest tests.
  • dist/ - Generated CommonJS output.
  • dist/types/ - Generated declaration files.
  • coverage/ - Generated Vitest coverage reports.
  • tsconfig.base.json - Shared TypeScript strictness and runtime settings.
  • tsconfig.json - Development typecheck project for src/ and test/.
  • tsconfig.build.json - Build-only TypeScript project for published output.
  • eslint.config.cjs - ESLint flat config.
  • vitest.config.ts - Vitest test and coverage configuration.

Development

Run the full local validation suite:

yarn test

Useful scripts:

  • yarn clean - remove generated build and coverage output.
  • yarn lint - lint the project with ESLint.
  • yarn typecheck - typecheck source and tests without emitting files.
  • yarn tests - run Vitest with V8 coverage.
  • yarn build - compile TypeScript to CommonJS in dist/.
  • yarn test-publish - run a package dry-run with the generated output.

Continuous Integration

GitHub Actions runs on pushes, pull requests, merge queues, and manual dispatches.

  • Node.js CI runs on Node.js 22, 24, and 26. Each job installs with Corepack-managed Yarn 4.14.1, then runs linting, typechecking, Vitest coverage, builds, and a package dry-run.
  • The Node.js 24 job also runs yarn npm audit --recursive --all.
  • CodeQL analyzes JavaScript and TypeScript with the extended security and quality query packs after an install and build.
  • Dependabot checks npm and GitHub Actions updates weekly and groups related update pull requests.

Publishing

Before publishing, replace the package identity placeholders in package.json:

{
  "name": "---name---",
  "repository": {
    "type": "git",
    "url": "---repo---"
  }
}

Verify package contents:

yarn test-publish

Publish:

yarn release

API

This starter does not export a library API yet. Add public exports from src/index.ts when real package behavior is introduced.

The published package surface is the root entrypoint only through exports["."].

Maintainers

Contributing

Questions and changes can go through GitHub issues and pull requests. Keep changes focused, run yarn test before submitting, and include tests for behavior changes.

License

MIT (c) Everett Morgan. See LICENSE.

About

A modern TypeScript library starter with Yarn, Vitest, ESLint, and GitHub Actions.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors