Skip to content

Commit

Permalink
feat: added setup script (#82)
Browse files Browse the repository at this point in the history
* feat: added setup script

* Also remove setup script

* cspell ignore

* Fix a bit of linting
  • Loading branch information
JoshuaKGoldberg committed Dec 6, 2022
1 parent 8df8c35 commit 4986aa2
Show file tree
Hide file tree
Showing 11 changed files with 1,761 additions and 3,512 deletions.
46 changes: 0 additions & 46 deletions .all-contributorsrc

This file was deleted.

42 changes: 42 additions & 0 deletions .all-contributorsrc.json
@@ -0,0 +1,42 @@
{
"commit": false,
"commitConvention": "angular",
"contributors": [
{
"avatar_url": "https://avatars.githubusercontent.com/u/3335181?v=4",
"contributions": [
"bug",
"code",
"content",
"example",
"ideas",
"infra",
"maintenance",
"platform",
"projectManagement",
"review",
"security",
"tool",
"test"
],
"login": "JoshuaKGoldberg",
"name": "Josh Goldberg",
"profile": "http://www.joshuakgoldberg.com"
},
{
"login": "sinchang",
"name": "Jeff Wen",
"avatar_url": "https://avatars.githubusercontent.com/u/3297859?v=4",
"profile": "https://sinchang.me",
"contributions": ["tool"]
}
],
"contributorsPerLine": 7,
"files": ["README.md"],
"imageSize": 100,
"projectName": "template-typescript-node-package",
"projectOwner": "JoshuaKGoldberg",
"repoHost": "https://github.com",
"repoType": "github",
"skipCi": true
}
8 changes: 8 additions & 0 deletions .eslintrc.cjs
@@ -1,4 +1,8 @@
module.exports = {
env: {
es2022: true,
node: true,
},
extends: [
"eslint:recommended",
"plugin:eslint-comments/recommended",
Expand Down Expand Up @@ -52,9 +56,13 @@ module.exports = {
],
root: true,
rules: {
// These off-by-default rules work well for this repo and we like them on.
"deprecation/deprecation": "error",
"no-only-tests/no-only-tests": "error",
"simple-import-sort/exports": "error",
"simple-import-sort/imports": "error",

// These on-by-default rules don't work well for this repo and we like them off.
"no-inner-declarations": "off",
},
};
1 change: 1 addition & 0 deletions .npmignore
Expand Up @@ -2,3 +2,4 @@
.vscode/
*.test.*
coverage/
pnpm-lock.yaml
3 changes: 2 additions & 1 deletion .prettierignore
@@ -1 +1,2 @@
dist/
dist/
pnpm-lock.yaml
30 changes: 30 additions & 0 deletions README.md
Expand Up @@ -24,6 +24,36 @@
<img alt="TypeScript: Strict" src="https://img.shields.io/badge/typescript-strict-21bb42.svg" />
</p>

## 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:

- [**ESLint**](https://eslint.org): Static analysis for JavaScript code, configured with [typescript-eslint](https://typescript-eslint.io) for TypeScript code and other general-use plugins.
- [**Markdownlint**](https://github.com/DavidAnson/markdownlint): Static analysis for Markdown code.
- [**pnpm**](https://pnpm.io): Desk-efficient package manager alternative.
- [**Prettier**](https://prettier.io): Opinionated formatting for code, run on file save and as a Git commit hook via [husky](https://typicode.github.io/husky) and [lint-staged](https://github.com/okonet/lint-staged).
- [**ts-prune**](https://github.com/nadeesha/ts-prune): Unused exports detection for TypeScript code.
- [**TypeScript**](https://typescriptlang.org): A typed superset of JavaScript, configured with strict compiler options.
- [**Vitest**](https://vitest.dev): Fast unit tests, configured with coverage tracking.

## Setup

First make sure you have the following installed:

- [GitHub CLI](https://cli.github.com) _(you'll need to be logged in)_
- [Node.js](https://nodejs.org)
- [pnpm](https://pnpm.io)

To use this template:

1. Click the [_Use this template_](https://github.com/JoshuaKGoldberg/template-typescript-node-package/generate) button to create a new repository with the same Git history
2. Open that repository, such as by [cloning it locally](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) or [developing in a codespace](https://docs.github.com/en/codespaces/developing-in-codespaces/developing-in-a-codespace)
3. `pnpm install`
4. `pnpm run setup`

> The setup script removes the `## Explainer` and `## Setup` from this README.md.
## Usage

```shell
Expand Down
17 changes: 15 additions & 2 deletions cspell.json
@@ -1,5 +1,18 @@
{
"dictionaries": ["typescript"],
"ignorePaths": [".github", "dist", "node_modules", "pnpm-lock.yaml"],
"words": ["Codecov", "commitlint", "lcov"]
"ignorePaths": [
".github",
"dist",
"node_modules",
"pnpm-lock.yaml",
"script/*.json"
],
"words": [
"Codecov",
"codespace",
"commitlint",
"contributorsrc",
"lcov",
"wontfix"
]
}
2 changes: 2 additions & 0 deletions package.json
Expand Up @@ -11,6 +11,7 @@
"@typescript-eslint/eslint-plugin": "^5.38.1",
"@typescript-eslint/parser": "^5.38.1",
"@vitest/coverage-c8": "^0.25.4",
"chalk": "^5.1.2",
"cspell": "^6.12.0",
"eslint": "^8.24.0",
"eslint-config-prettier": "^8.5.0",
Expand Down Expand Up @@ -58,6 +59,7 @@
"lint:prune": "ts-prune",
"lint:spelling": "cspell \"**\" \".github/**/*\"",
"prepare": "husky install",
"setup": "npx --yes zx --quiet script/setup.js",
"test": "vitest"
},
"type": "module",
Expand Down

0 comments on commit 4986aa2

Please sign in to comment.