1.3.2 • Published 4 months ago
create-minimal-package v1.3.2
create-minimal-package
Zero-knowledge minimalistic template for creating a new npm package.
Docs Demo: https://34j.github.io/create-minimal-package/
NPM Package Demo: https://www.npmjs.com/package/create-minimal-package
Source Code: https://github.com/34j/create-minimal-package
Features
- The proof that the config is minimalistic is shown below.
The main reason (
☆
) of the slight complexity is the need to specify the project structure (src
,dist
,test
).👾Github
- 📦🚀semantic-release & Commitizen: from this article
- New Issue Templates: from browniebroke/pypackage-template
- 💨GitHub Actions + 📊Codecov: npm version of browniebroke/pypackage-template
- 🧱Renovate: inherits config:best-practices
- ⚙TypeScript:
tsconfig.json
: inherits @tsconfig/strictest: 4 lines for☆
, 3 lines for ES types - ✨️Formatting
- ⚠️pre-commit and pre-commit.ci: from browniebroke/pypackage-template + mirrors-eslint (⏪️🐶Husky + Lint Staged for better CI support)
- ESLint: inherits @antfu/eslint-config
- 📦Packageing
- pnpm (⏪️npm)
- ⚠️ Testing
- 📖Documentation
- 🌐GitHub Pages
- 📖TypeDoc: 2 lines for
☆
P
- Removed Commitizen integration and VS Code stuff (from ryansonshine/typescript-npm-package-template) because it's not maintained and complex. Commitizen can be still used (Semantic Release supports it natively).
- Removed Nix stuff and typedoc-plugin-markdown (from typescript-npm-package-template) because it's not necessary.
- Removed Prettier due to @antfu/eslint-config's opinions and mirrors-prettier being archived.
Quickstart
- Click the "Use this template" button.
- Replace
GITHUB_USER
andREPO_NAME
usingsed
:GITHUB_USER="johnsmith" REPO_NAME="my-cool-package" sed -i.tmp "s/\([^@]\)34j/\1$GITHUB_USER/g; s/create-minimal-package\|my-package-name/$REPO_NAME/g; package.json package-lock.json src/index.ts sed -i.tmp 's/"version": "[0-9.]*"/"version": "0.0.0"/' package.json rm *.tmp rm CHANGELOG.md
- Create and add
NPM_TOKEN
toSettings/Secrets and variables/Actions/Repository secrets
. - Create and add
CODECOV_TOKEN
toSettings/Secrets and variables/Actions/Repository secrets
. - Install GitHub Apps, pre-commit.ci lite and Codecov.
- Install pre-commit using
uv
byuv tool install pre-commit
and install hooks bypre-commit install
. - Remove everything above
---
.
Inspired by node-module-boilerplate and typescript-npm-package-template, which is great but unnecessarily complex and poorly maintained.
create-minimal-package
Documentation: https://34j.github.io/create-minimal-package/
NPM Package: https://www.npmjs.com/package/create-minimal-package
Source Code: https://github.com/34j/create-minimal-package
TODO: Project Description.
Installation
npm install create-minimal-package
Usage
import { myPackage } from 'create-minimal-package'
myPackage('hello')
// => 'hello from my package'