• Stars
    star
    624
  • Rank 70,545 (Top 2 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 2 years ago
  • Updated 5 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Quickstart-friendly TypeScript template with comprehensive, configurable, opinionated tooling. πŸ’

Template TypeScript Node Package

A quickstart-friendly TypeScript template with comprehensive formatting, linting, releases, testing, and other great tooling built-in. ✨

All Contributors: 21 🀝 Codecov Test Coverage Code of Conduct: Enforced 🀝 License: MIT πŸ“ Sponsor: On GitHub πŸ’Έ Style: Prettier 🧹 TypeScript: Strict πŸ’ͺ

Explainer

This template is available for anybody who wants to set up a basic Node application using TypeScript. It sets up the following tooling for you:

  • All Contributors: Tracks various kinds of contributions and displays them in a nicely formatted table in the README.md.
  • ESLint: Static analysis for JavaScript code, configured with typescript-eslint for TypeScript code and other general-use plugins.
  • Knip: Detects unused files, dependencies, and code exports.
  • Markdownlint: Static analysis for Markdown code.
  • pnpm: Disk-efficient package manager alternative.
  • PR Compliance Action: Checks PRs for compliance such as addressing a linked issue and proper title formatting.
  • Prettier: Opinionated formatting for code, run on file save and as a Git commit hook via husky and lint-staged.
  • release-it: Generates changelogs, bumps the package version, and publishes to GitHub and npm based on conventional commits.
  • Renovate: Keeps dependencies up-to-date with PRs, configured to wait a few days after each update for safety.
  • TypeScript: A typed superset of JavaScript, configured with strict compiler options.
  • Vitest: Fast unit tests, configured with coverage tracking and console-fail-test.

Setup

This package comes with a bootstrap/initialization setup script that fills out your repository's details, installs necessary packages, then removes itself and uninstalls setup dependencies.

First make sure you have the following installed:

To use this template:

  1. Click the Use this template button to create a new repository with the same Git history
  2. Open that repository, such as by cloning it locally or developing in a codespace
  3. Create two tokens in repository secrets:
  4. pnpm install
  5. pnpm run setup to run the setup script
  6. Install the Codecov GitHub App and Renovate GitHub App

The setup script removes the ## Explainer, ## Setup, and ## Repository Hydration sections from this README.md.

Setup Options

The setup script requires four options to fill out repository details. It will interactively prompt for any that are not provided as a string CLI flag:

  1. repository: The kebab-case name of the repository (e.g. template-typescript-node-package)
  2. title: Title Case title for the repository to be used in documentation (e.g. Template TypeScript Node Package)
  3. owner: GitHub organization or user the repository is underneath (e.g. JoshuaKGoldberg)
  4. description: Sentence case description of the repository (e.g. A quickstart-friendly TypeScript package with lots of great repository tooling. ✨)

Additionally, a --skip-api boolean CLI flag may be specified to prevent the setup script from calling to GitHub APIs for repository hydration. The script normally posts to GitHub APIs to set information such as repository description and branch protections on github.com. Specifying --skip-api prevents those API calls, effectively limiting setup changes to local files in Git. Doing so can be useful to preview what running setup does.

For example, pre-populating all values and skipping API calls:

pnpm run setup --repository "testing-repository" --title "Testing Title" --owner "TestingOwner" --description "Test Description" --skip-api

Tip: after running pnpm run setup with --skip-api, you can always git add -A; git reset --hard HEAD to completely reset all changes.

Repository Hydration

Warning
Hydration will override many files in your repository. You'll want to review each of the changes and make sure nothing important is removed.

Alternately, if you have an existing repository that you'd like to give the files from this repository, you can run template-typescript-node-package in a repository to "hydrate" it.

npx template-typescript-node-package

Repository settings will be auto-filled from the repository's files if possible, but can be provided manually as well:

  • author (string): e.g. "Josh Goldberg"
  • description (string): e.g. "A quickstart-friendly TypeScript template with comprehensive formatting, linting, releases, testing, and other great tooling built-in. ✨"
  • email (string): e.g. "[email protected]"
  • funding (string, optional): e.g. "JoshuaKGoldberg"
  • owner (string): e.g. "JoshuaKGoldberg"
  • repository (string): e.g. "template-typescript-node-package"
  • title (string): e.g. "Template TypeScript Node Package"

For example, providing a funding value different from the author:

npx template-typescript-node-package --funding MyOrganization

The hydration script by default will include all the features in this template. You can disable some of them on the command-line:

  • releases (boolean): Whether to include automated package publishing
  • unitTests (boolean): Whether to include unit tests with code coverage tracking
npx template-typescript-node-package --releases false --unitTests false

You can prevent the hydration script from making network-based changes using either or both of the following CLI flags:

  • --skip-install (boolean): Skips installing all the new template packages with pnpm
  • --skip-setup (boolean): Skips running the setup script at the end of hydration
npx template-typescript-node-package --skip-install --skip-setup

Usage

npm i template-typescript-node-package
import { greet } from "template-typescript-node-package";

greet("Hello, world!");

Development

See .github/CONTRIBUTING.md, then .github/DEVELOPMENT.md. Thanks! πŸ’–

Contributors

Anurag
Anurag

πŸ’»
Daniel Roe
Daniel Roe

πŸ’»
Dominik Nowik
Dominik Nowik

πŸ”§ πŸ’»
Emerson
Emerson

πŸ’»
Jeff Wen
Jeff Wen

πŸ’»
Joe Previte
Joe Previte

πŸ› πŸ’»
John Reilly
John Reilly

πŸ’»
Josh Goldberg
Josh Goldberg

πŸ› πŸ’» 🚧 πŸ‘€ πŸ”§ πŸ“– πŸš‡ ⚠️
JoΓ«l Galeran
JoΓ«l Galeran

πŸ’»
Lars Kappert
Lars Kappert

πŸ’»
Navin Moorthy
Navin Moorthy

πŸ› πŸ’»
NazCodeland
NazCodeland

πŸ’»
Orta Therox
Orta Therox

πŸ’»
Paul Esch-Laurent
Paul Esch-Laurent

πŸ’»
Promise Dash
Promise Dash

πŸ’»
Rebecca Stevens
Rebecca Stevens

πŸ’» πŸš‡
Ron Braha
Ron Braha

πŸ’» 🎨 ⚠️
Ron Jean-Francois
Ron Jean-Francois

πŸ’» πŸš‡
Sudhansu
Sudhansu

πŸ’»
Tung Bui (Leo)
Tung Bui (Leo)

πŸ’»
takanomedev
takanomedev

πŸ’»

More Repositories

1

Old-Deleted-FullScreenMario

An HTML5 remake of the original Super Mario Brothers - expanded for wide screens.
2,995
star
2

TypeStat

Converts JavaScript to TypeScript and TypeScript to better TypeScript. 🧫
TypeScript
1,987
star
3

emoji-blast

Blasts emoji like fireworks all up in your HTML page. πŸŽ†
TypeScript
215
star
4

linting-typescript-in-2023

Code samples for linting React and TypeScript in 2023. ✨
TypeScript
106
star
5

eslint-plugin-package-json

Rules for consistent, readable, and valid package.json files. πŸ—‚οΈ
TypeScript
90
star
6

ChooseYourFramework

Choosing a modern JavaScript UI framework, Pokemon-style.
TypeScript
68
star
7

prettier-plugin-curly

Prettier plugin to enforce consistent brace style for all control statements. πŸ₯Œ
TypeScript
46
star
8

ts-api-utils

Utility functions for working with TypeScript's API. Successor to the wonderful tsutils. πŸ› οΈοΈ
TypeScript
46
star
9

temporal-adventure-bot

A sample temporal.io application that posts a daily Discord or Slack message for interactive choose-your-own-adventure stories. ✨
TypeScript
45
star
10

refined-saved-replies

Chrome extension for GitHub's Saved Replies that adds replies from a repository's `.github/replies.yml`. πŸ“¨
TypeScript
29
star
11

dot-com

Personal site for Josh Goldberg. That's me!
MDX
24
star
12

ts-function-inliner

TypeScript transformation that inlines calls to small functions. ⚑️
TypeScript
21
star
13

mock-react-redux

🎭 Mocks out Redux actions and selectors for clean React Jest tests.
TypeScript
19
star
14

next-js-to-ts

Sample repository showing a React app for a JS to TS conversion.
JavaScript
18
star
15

logrocket-eslint-prettier-typescript

Repository for the LogRocket meetup: Configuring ESLint And Prettier For TypeScript. ✨
JavaScript
16
star
16

seven-common-hooks-mistakes

Companion code for my Seven Common Hooks Mistakes talk! ✨
JavaScript
16
star
17

github-username-to-emails

Fetches any public emails associated with a GitHub username. πŸ“§
TypeScript
16
star
18

TSLint.MSBuild

[Deprecated] An MSBuild task for running TSLint.
JavaScript
15
star
19

emojipedia

Unofficial static export of emoji technical information from Emojipedia. πŸ“™
TypeScript
14
star
20

Konamimojisplosion

Connects konami-code-js to emojisplosion for a glorious easter egg. πŸŽ‰ ✨ πŸŽ†
TypeScript
13
star
21

should-semantic-release

Checks whether a semantic release should be run for a repository. πŸ’‚
TypeScript
13
star
22

cached-factory

Creates and caches values under keys. 🏭
JavaScript
12
star
23

all-contributors-auto-action

Fills in missing allcontributors entries for a repository. πŸ‘ͺ
TypeScript
12
star
24

type-system-react

A "fun" implementation of a JSX rendering engine similar to React's ... in the TypeScript type system.
TypeScript
11
star
25

SpeedyPersistentState

Expo app containing code examples for my SWM talk.
JavaScript
10
star
26

use-no-sleep

NoSleep.js, in React Hooks form 😴
TypeScript
10
star
27

Goldblog

Personal blog for Josh Goldberg. Hooray!
JavaScript
10
star
28

sentences-per-line

Contributed markdownlint rule for limiting sentences per line. πŸ“
TypeScript
8
star
29

eslint-plugin-never-disable

ESLint plugin to completely ban disabling specific rules. πŸ™…
TypeScript
8
star
30

Bookswap

A hub for students to buy & sell textbooks on campus.
PHP
8
star
31

emoji-platform-data

Static export of platform-specific metadata for unicode emojis. πŸ—οΈ
TypeScript
8
star
32

are-docs-informative

Checks whether a documentation description introduces any new information. ℹ️
TypeScript
8
star
33

props-mocks-and-context-talk

Companion repository for my Props, Mocks, and Context: Unit Testing Heavy Components talk
JavaScript
7
star
34

tidelift-me-up

Finds your npm packages that are eligible for Tidelift funding. πŸ’Έ
TypeScript
7
star
35

tidelift-me-up-site

Web app to find your npm packages eligible for Tidelift funding. πŸ’Έ
TypeScript
7
star
36

eslint-preset-prettier

The easiest way to use Prettier for linting. Which is what you should do. 🧹
TypeScript
7
star
37

RainbowScratchPaper

Remember those black sheets of paper that let you scratch off to reveal the rainbow background? We do! This project is a single-page web app emulating those old rainbow scratch paper sheets.
JavaScript
7
star
38

jsworld-graphql

Example project showing two areas of code using Apollo GraphQL.
TypeScript
7
star
39

design-systems-workshop

A mock Twitter page implemented without, partially with, and then with a design system.
JavaScript
7
star
40

deep-typescript-tips-and-tricks

Going through fun features in TypeScript!
TypeScript
6
star
41

unit-testing-react-with-rtl

Workshop learning about real-world-like React tests with Jest and RTL.
JavaScript
6
star
42

github-sponsors-to-markdown

Creates a Markdown table summarizing your GitHub sponsors. πŸ’°
TypeScript
5
star
43

type-safe-style-systems

A broad overview of some of the inflection points around CSS theming, culminating in today's style systems. 🎨
HTML
5
star
44

release-it-action

Runs release-it as a GitHub Action, with handling for semantic releases and protected branches. πŸ“€
TypeScript
5
star
45

joshuakgoldberg-dot-com-old

Personal site for Josh Goldberg.
HTML
5
star
46

SquiggleConf

Website for a lovely conference that is definitely real and happening.
Astro
5
star
47

get-github-auth-token

Retrieves the running user's GitHub authentication token. πŸͺ™
JavaScript
5
star
48

jsworld-typedoc

Bare-bones example project showing generation of a docs site using TypeDoc.
TypeScript
5
star
49

sentences-per-line-old

Contributed markdownlint rule for one sentence per line.
JavaScript
5
star
50

standards-compliant-rickroll

https://hi.joshuakgoldberg.com
HTML
5
star
51

speaker-rider

My speaker rider for talking at your event!
5
star
52

github-username-to-emails-site

Web app to fetch any public emails associated with a GitHub username. πŸ“§
JavaScript
5
star
53

prune-github-notifications

Prunes GitHub notifications you don't care about, such as automated dependency bumps. 🧹
TypeScript
5
star
54

tsc-fancy

Snazzy utilities around the TypeScript CLI.
TypeScript
5
star
55

JoshuaKGoldberg

Packaged projects and personal GitHub README for JoshuaKGoldberg. πŸ‘‹
TypeScript
5
star
56

internet-explorer-is-wonderful

Internet Explorer is a Wonderful Browser and an Absolute Pleasure to Work With
HTML
5
star
57

jstseslinttest

Proof that you can run TypeScript ESLint on JavaScript files.
JavaScript
4
star
58

squee

πŸ’¨βœ¨ Super Quick Event Emitters! βœ¨πŸ’¨
TypeScript
4
star
59

fixing-floating-and-sinking-promises

Companion code for my workshop on fixing floating and sinking Promises. ✨
JavaScript
4
star
60

hello-josh-goldberg

A sample package written by me, Josh Goldberg, to practice working in open source software. Hooray!
JavaScript
4
star
61

commit-to-co-authors

Parses co-authors from Git/GitHub-style commit messages. ✍️
JavaScript
4
star
62

repros

Reproductions and larger code snippets I need to reference online.
4
star
63

boston-ts-website

The website for BostonTS. Powered by React, Remix, TypeScript, and Vanilla Extract. ✨
TypeScript
4
star
64

typedoc-plugin-konamimojisplosion

TypeDoc plugin to quickly integrate konamimojisplosion into your docs site. πŸŽ‰ ✨ πŸŽ†
JavaScript
4
star
65

typescript-react-javascriptla

Demo code for our Intro to TypeScript + React talk! ✨
TypeScript
4
star
66

JavaScript-Testing-Intro

Source code for a BellevueJS intro talk on JavaScript testing.
JavaScript
3
star
67

astro-konamimojisplosion

Astro integration to quickly load konamimojisplosion into your site. πŸŽ‰ ✨ πŸŽ†
JavaScript
3
star
68

understanding-floating-and-sinking-promises

Demo code for my talk on understanding floating and sinking Promises. ✨
JavaScript
3
star
69

opensource

TypeScript
3
star
70

verify-istanbul-coverage

Verifies minimum total covered lines in generated Istanbul reports.
TypeScript
3
star
71

co-author-to-username

Fetches the GitHub username for a co-author, if possible. πŸ“‡
TypeScript
3
star
72

design-system-sketch

A companion sketch of how a design system conversion might go.
JavaScript
3
star
73

graphql-galaxy-a-lovely-trio

Companion repository showing Next.js + Apollo + GraphQL
TypeScript
3
star
74

typescript-static-analysis-hidden-gems

Code examples for my TypeScript Static Analysis Hidden Gems talk. πŸ’Ž
TypeScript
3
star
75

vc-npm-resume

A workshop showing making your own `npx`-runnable npm package. 🎁
JavaScript
3
star
76

async-await-generators-typescript-and-jquery

A brief explaration for SeattleJS into async/await, generators, and hacking TypeScript to like jQuery.
3
star
77

stoptalking

Countdown timer to beep speakers out.
TypeScript
3
star
78

docusaurus-plugin-konamimojisplosion

(not yet published to npm) Docusaurus plugin to quickly integrate konamimojisplosion into your docs site. πŸŽ‰ ✨ πŸŽ†
JavaScript
3
star
79

Trumpicorn

Escape the Trumps!
TypeScript
3
star
80

graphql-typings-generation

Demonstrates generating TypeScript types from a GraphQL server. ✨
JavaScript
3
star
81

npm-username-to-packages

Fetches any packages associated with an npm username. πŸ“¨
JavaScript
3
star
82

all-contributors-for-repository

Generates an allcontributors list for an existing repository. 🀝
TypeScript
3
star
83

tecnologico-del-monterrey-react-typescript

Code examples from talking to the class
TypeScript
3
star
84

jquery-2-typescript-async-await-adapter

Replaces TypeScript's generated async/await support code so jQuery 2's JQueryPromise can be used with async/await.
TypeScript
3
star
85

expect-no-axe-violations

Expect matcher for asserting no violations in aXe results.
TypeScript
3
star
86

jsworld-swagger

Bare-bones example project showing generation of a client SDK site using Swagger.
TypeScript
3
star
87

a-lovely-graphql-server

JavaScript
2
star
88

learning-typescript-blog

JavaScript
2
star
89

open-sauced-goals

2
star
90

StarCorn

🌟🌽 Fly through the galaxy! Eat your vegetables! 🌽🌟
TypeScript
2
star
91

props-mocks-and-context-workshop

Companion repository for my Props, Mocks, and Context: Unit Testing Heavy Components workshop.
JavaScript
2
star
92

hello-michael-scott

Sample repository for GGV. Hello everyone!
JavaScript
2
star
93

poop-recipes

Turn your recipes into something... crappy. πŸ’©
JavaScript
2
star
94

eslint-plugin-expect-type-example

Sample repository showing usage of eslint-plugin-expect-type ✨
TypeScript
2
star
95

a-lovely-trio

TypeScript
2
star
96

bellevuejs-linting

A (JS|TS)Lint BellevueJS talk @ Microsoft.
JavaScript
2
star
97

csproj-to-tsconfig

Converts .csproj files with TypeScript includes to their tsconfig.json equivalents.
TypeScript
2
star
98

tidelift-me-up-site-old

Find your npm packages eligible for Tidelift funding. πŸ’Έ
TypeScript
2
star
99

typescript-intro-emergentworks-react

Companion React+TypeScript code for my Intro to TypeScript EmergentWorks workshop, bootstrapped with yarn + create-react-app! ✨
TypeScript
2
star
100

RIPLuckyDiner

A tribute to the former Lucky Diner in Belltown, Seattle.
TypeScript
2
star