Git Product home page Git Product logo

node-typescript-starter's Introduction

Node Typescript Starter

CI build Documentation Maintenance License: MIT

Starter for nodejs typescript projects.
Based on the project created with the online CLI.
Refactored according my preferences (the project structure and organization, tools, ci/cd, e.t.c.)

The project file system tree:

.
├── .cspell.json
├── .editorconfig
├── .eslintrc.json
├── .github
│   ├── ISSUE*TEMPLATE.md
│   └── PULL_REQUEST_TEMPLATE.md
├── .gitignore
├── .husky
│   ├── *
│   ├── pre-commit
│   └── pre-push
├── .prettierignore
├── .vscode
├── LICENSE
├── README.md
├── jest.config.js
├── package-lock.json
├── package.json
├── src
│   ├── index.ts
│   └── types
│   └── example.d.ts
└── tsconfig.json

The project infrastructure

Typescript,
cspell - A CLI tool and library for spell checking code,
npm-run-all - A CLI tool to run multiple npm-scripts in parallel or sequential,
rimraf - a deep deletion module for node.
ESLint - a static code analysis tool,
eslint-config-prettier - Turns off all rules that are unnecessary or might conflict with Prettier,
eslint-plugin-eslint-comments - Additional ESLint rules for ESLint directive comments (e.g. //eslint-disable-line),
eslint-plugin-functional - An ESLint plugin to disable mutation and promote functional programming in JavaScript and TypeScript,
eslint-plugin-import - A plugin to support linting of ES2015+ (ES6+) import/export syntax, and prevent issues with misspelling of file paths and import names,
prettier - A code formatter,
jest - A testing framework,
ts-jest - A Jest transformer with source map support that lets to use Jest to test projects written in TypeScript,
husky - a tool that allows to use Git hooks.

Prepare a project

Create a folder:

mkdir <new-package-name>
cd <new-package-name>

Clone the repository, remove git folder, init the new local git repo and rename the branch from master to main:

git clone https://github.com/ekarpovs/node-typescript-starter.git .
rm -r .git
git init
git branch -m master main

Install:

npm install

Activate Git hooks:

npm run prepare
Note: After the command is executed once, the Git hooks will run automatically before each commit and push.

Create a project

Put your code under the src folder.
Put you tests under the test folder.

Usage the commands from the command line during the development:

Linting:

npm run lint

Fix the linting issues:

npm run fix

Testing:

npm test

Clean build output:

npm run clean

Build:

npm run build

Prepare:

npm run prepare

Git client hooks:

.husky/pre-commit
.husky/pre-push

node-typescript-starter's People

Contributors

ekarpovs avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.