In this video, I will explain in detail all the features of a modern template for npm packages. We are using TypeScript, ESM modules and a series of tools to improve software quality and team collaboration. We go from creating the repository to publishing the package into a private npm registry and creating a GitHub release. There are dozens of templates for that and my goal here is not to sell this as one of the best but to help you to have a better grip on all things we are doing here. I'm sure you already know some of what I'm about to tell you, but I challenge you to stay until the end and say you haven't learned anything new.
This is a boilerplate template for creating a npm package using TypeScript. It provides a solid foundation for building reusable TypeScript libraries (ESM) that can be easily published and consumed by others. With this template, you can kickstart the development of a TypeScript npm package, focusing on the core functionality of your library while leveraging the benefits of TypeScript and the npm ecosystem.
★ If you want to write any comments, you can do it in English or Portuguese. I'll keep the replies in Portuguese and translate them to English.
► TypeScript npm package template repo: github.com/marcellothiry/ts-esm-npm-package-templa…
► tsup (bundler powered by esbuild): tsup.egoist.dev/
► ESLint for TypeScript (static code analysis): typescript-eslint.io/
► Prettier (code formatting): prettier.io/
► Husky (git hooks): typicode.github.io/husky/
► lint-staged (pre-commit): www.npmjs.com/package/lint-staged
► dotenv-cli (environment variables): www.npmjs.com/package/dotenv-cli
► Vitest (test framework): vitest.dev/
► Vitest/C8 (test coverage): vitest.dev/guide/coverage.html
► semantic-release (versioning, publishing and releasing): vitest.dev/guide/coverage.html
► Verdaccio (npm proxy registry): verdaccio.org/
► Software licenses: license.md/
► Conventional commits spec: www.conventionalcommits.org/en/v1.0.0/
► LinkedIn: www.linkedin.com/in/marcello-thiry-b29216a/
#marcellothiry #fromdev2dev #typescript #npm #package #template
► Timestamps:
0:02 Intro.
0:52 Creating a new repository from the template.
1:17 Installing dependencies and environment file.
1:41 How to create a GitHub personal access token.
2:27 Reviewing the license and other docs.
3:13 Detailed explanation about each dev dependency and related runtime configurations.
10:28 Detailed explanation about each npm script (include git hooks).
13:16 Complete the information in package.json.
14:28 Looking into source folder.
15:41 Commit, conventional commits, and versioning.
16:40 Publishing and releasing the package.
コメント