@tnxdmn/ts-project
v1.6.5
Published
This is a template for a Node.js/TypeScript project which can be used for the creating following:
Readme
Node.js/TypeScript Template Project
This is a template for a Node.js/TypeScript project which can be used for the creating following:
- Scripts
- Servers
- CLI Apps
Project Structure
Follow the below project structure:
Source code is under src and code related to each domain is under itsown directory.
Business logic, types, tests, fixtures, etc. are in a flat format under that domain (tests are not in their own directory).
Files co-located, but segregated by domain
.
├── .changeset
│ ├── README.md
│ └── config.json
├── .github
│ └── workflows
│ ├── ci.yml
│ ├── publish.yml
│ └── release.yml
├── src
│ ├── utils
│ │ ├── helper.test.ts
│ │ └── helper.ts
│ └── index.ts
├── .editorconfig
├── .gitignore
├── .npmignore
├── .nvmrc
├── .prettierignore
├── .prettierrc
├── CHANGELOG.md
├── README.md
├── esbuild.js
├── eslint.config.js
├── package.json
├── pnpm-lock.yaml
├── pnpm-workspace.yaml
└── tsconfig.jsonSetup
Install Node
Install pnpm
npm install -g pnpm - Install dependencies
pnpm install- Initiate changesets
pnpm changeset init- On your GitHub repository add
NPM_TOKENas a secret for GitHub Actions with permission to publish packages - On your GitHub repository make sure your GitHub Workflow has Read & Write permissions from the settings page of the repo
Dependencies
- TypeScript
- ESBuild
- ESLint
- Prettier
- TSX
- Changesets
- Husky
Development Process
- Branch off of
main - Make your changes
- When ready run
pnpm changeset - Push your changes and create a Pull Request
- When merged to
mainthepublish.ymlworkflow will create a Pull Request tomainwith changesets - Add a version to that Pull Request in the
v{major}.{minor}.{patch}format (same as the currect package version) - Merge that Pull Request to
mainwhich should create a Release & Publish the packages
