From 24ec1b45665c835fbf72ab41b41692060b57ba70 Mon Sep 17 00:00:00 2001 From: Matthieu Morin Date: Thu, 6 Jun 2024 14:08:30 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=20Beginning=20documentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit how to use, names, includes, etc, TODO: more detailed dependency description, usage descriptions etc --- .czrc | 3 --- README.md | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++-- package.json | 16 +++++++++++--- 3 files changed, 73 insertions(+), 8 deletions(-) delete mode 100644 .czrc diff --git a/.czrc b/.czrc deleted file mode 100644 index 17fa2ac..0000000 --- a/.czrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "path": "./node_modules/cz-conventional-changelog" -} diff --git a/README.md b/README.md index 1f4f696..f5dc14f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,61 @@ -# TS-Lib-tsup +# TypeScript NPM Package Template -typescript package bundler with tsup \ No newline at end of file +This is a boilerplate to jumpstart one's next TypeScript npm package development. It utilizes various tools to streamline development, testing, and publishing processes. + +## Features + +**TypeScript**: For powerful type safety and improved code maintainability. +**tsup**: A fast and efficient TypeScript bundler for streamlined development. +**pnpm**: A package manager with features like workspaces and faster install times. (Optional, can be replaced with npm or yarn) +**Commitizen**: Standardizes commit messages following the Conventional Commits specification. +**ESLint**(_New flat config!_) & **Prettier**: Enforces code style and formatting consistency. +**Jest**: A popular testing framework for unit and integration tests. +**Husky**: Executes pre-commit hooks to ensure code quality and formatting before commits. +**Semantic Release**: Automates versioning and changelog generation based on commit messages. + +## Getting Started + +### Clone it via bash or in git\* web ui + +```sh +git clone https://git.mattmor.in/Madmin/ts-npm-package-template.git $name +cd $name +sudo rm -rf .git +git init +``` + +### Install dependencies: + +```sh +pnpm install # (or npm install or yarn install if you wish) +pnpm i -g commitizen cz-gitmoji + + +``` + +### initialize your project to use the cz-conventional-changelog adapter by typing: + +```sh +# pnpm otherwise go here for more pms https://github.com/commitizen/cz-cli +commitizen init cz-conventional-changelog --pnpm --save-dev --save-exact +``` + +### set Landish/cz-gitmoji as default adapter globally + +```sh +echo '{ "path": "cz-gitmoji" }' > ~/.czrc +``` + +## Usage + +### Building: + +```sh +pnpm run build # (or npm run build or yarn build) +``` + +This creates a production-ready build of your package. + +### Committing: + +Use `git commit` to generate standardized commit messages with cz thanks to this config: diff --git a/package.json b/package.json index 6c34e33..5ca7a9f 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "templ8-lib-tsup", + "name": "ts-npm-package-template", "version": "0.0.1", "type": "module", "description": "", @@ -35,8 +35,18 @@ "./dist/**/*" ], "keywords": [ - "template", - "yo" + "tsup", + "typescript", + "commitizen", + "pnpm", + "prettier", + "eslint", + "jest", + "scripts", + "husky", + "CI/CD", + "boilerplate", + "template" ], "scripts": { "build": "run-s lint clean build:start",