create-minimal-package 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +112 -0
- package/dist/index.js +11 -0
- package/package.json +105 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 34j
|
|
4
|
+
Copyright (c) 2023 Ryan Sonshine
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# create-minimal-package
|
|
2
|
+
|
|
3
|
+
Zero-knowledge ***minimalistic*** template for creating a new npm package.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**Docs Demo**: [https://34j.github.io/create-minimal-package/](https://34j.github.io/create-minimal-package/)
|
|
8
|
+
|
|
9
|
+
**Package Demo**: [https://www.npmjs.com/package/create-minimal-package](https://www.npmjs.com/package/create-minimal-package)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
- The **proof** that the config is ***minimalistic*** is shown below.
|
|
16
|
+
- The main reason (`☆`) of the slight complexity is the need to specify the project structure (`src`, `dist`, `test`).
|
|
17
|
+
|
|
18
|
+
- 👾Github
|
|
19
|
+
- [📦🚀semantic-release](https://github.com/semantic-release/semantic-release) & [Commitizen](https://github.com/search?q=commitizen): from [this article](https://zenn.dev/wakamsha/articles/learn-semantic-release)
|
|
20
|
+
- [New Issue Templates](https://github.com/34j/create-minimal-package/tree/main/.github/ISSUE_TEMPLATE): from [browniebroke/pypackage-template](https://github.com/browniebroke/pypackage-template/tree/main/.github/ISSUE_TEMPLATE)
|
|
21
|
+
- [💨GitHub Actions](https://github.com/34j/create-minimal-package/tree/main/.github/workflows) + [📊Codecov](https://about.codecov.io/): npm version of [browniebroke/pypackage-template](https://github.com/browniebroke/pypackage-template/blob/main/.github/workflows/ci.yml)
|
|
22
|
+
- [🧱Renovate](https://docs.renovatebot.com/): inherits [config:best-practices](https://docs.renovatebot.com/presets-config/#configbest-practices)
|
|
23
|
+
- [⚙TypeScript](https://www.typescriptlang.org/):`tsconfig.json`,`tsconfig.build.json`(w/o tests): inherits [@tsconfig/strictest](https://www.npmjs.com/package/@tsconfig/strictest): 4 lines for `☆`, [3 lines for ES types](https://youtu.be/H91aqUHn8sE?t=148)
|
|
24
|
+
- ✨️Formatting
|
|
25
|
+
- [🐶Husky](https://github.com/typicode/husky): runs Lint Staged and typedoc
|
|
26
|
+
- [Lint Staged](https://github.com/okonet/lint-staged): calls ESLint
|
|
27
|
+
- [ESLint](https://eslint.org/): inherits [@antfu/eslint-config](https://www.npmjs.com/package/@antfu/eslint-config)
|
|
28
|
+
- ⚠️ Testing
|
|
29
|
+
- [👢Jest](https://jestjs.io/): 2 lines for supporting Codecov and 2 lines for supporting Node.js `P`
|
|
30
|
+
- 📖Documentation
|
|
31
|
+
- [🌐GitHub Pages](https://pages.github.com/)
|
|
32
|
+
- [📖TypeDoc](https://typedoc.org/): 2 lines for `☆` `P`
|
|
33
|
+
|
|
34
|
+
<details>
|
|
35
|
+
<summary>Removed Features (to achieve minimalism)</summary>
|
|
36
|
+
- Removed Commitizen integration and VS Code stuff (from [ryansonshine/typescript-npm-package-template](https://github.com/ryansonshine/typescript-npm-package-template)) because it's not maintained and complex. Commitizen can be still used (Semantic Release supports it natively).
|
|
37
|
+
- Removed Nix stuff and typedoc-plugin-markdown (from [typescript-npm-package-template](https://github.com/Atry/typescript-npm-package-template/tree/main)) because it's not necessary.
|
|
38
|
+
- Removed Prettier due to [@antfu/eslint-config's opinions](https://github.com/antfu/eslint-config?tab=readme-ov-file#prettier).
|
|
39
|
+
</details>
|
|
40
|
+
|
|
41
|
+
## Getting started
|
|
42
|
+
|
|
43
|
+
### Set up your repository
|
|
44
|
+
|
|
45
|
+
1. **Click the "Use this template" button.**
|
|
46
|
+
2. Replace `FULL_NAME`, `GITHUB_USER`, and `REPO_NAME` using `sed`:
|
|
47
|
+
```bash
|
|
48
|
+
FULL_NAME="John Smith"
|
|
49
|
+
GITHUB_USER="johnsmith"
|
|
50
|
+
REPO_NAME="my-cool-package"
|
|
51
|
+
sed -i.mybak "s/\([^@]\)34j/\1$GITHUB_USER/g; s/create-minimal-package\|my-package-name/$REPO_NAME/g; s/Ryan Sonshine/$FULL_NAME/g" package.json package-lock.json src/index.ts
|
|
52
|
+
rm *.mybak
|
|
53
|
+
```
|
|
54
|
+
3. Add `NPM_TOKEN` to `Settings/Secrets and variables/Actions/Repository secrets`.
|
|
55
|
+
4. Enable [Codecov GitHub App](https://github.com/apps/codecov) and add `CODECOV_TOKEN` to `Settings/Secrets and variables/Actions/Repository secrets`.
|
|
56
|
+
5. Remove everything above `---`.
|
|
57
|
+
|
|
58
|
+
> Inspired by [node-module-boilerplate](https://github.com/sindresorhus/node-module-boilerplate) and [typescript-npm-package-template](https://github.com/Atry/typescript-npm-package-template/tree/main), which is great but unnecessarily complex and poorly maintained.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
# create-minimal-package
|
|
63
|
+
|
|
64
|
+
[![npm package][npm-img]][npm-url]
|
|
65
|
+
[![Build Status][build-img]][build-url]
|
|
66
|
+
[![Downloads][downloads-img]][downloads-url]
|
|
67
|
+
[![Issues][issues-img]][issues-url]
|
|
68
|
+
[![Code Coverage][codecov-img]][codecov-url]
|
|
69
|
+
[![Commitizen Friendly][commitizen-img]][commitizen-url]
|
|
70
|
+
[![Semantic Release][semantic-release-img]][semantic-release-url]
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
**Documentation**: [https://34j.github.io/create-minimal-package/](https://34j.github.io/create-minimal-package/)
|
|
75
|
+
|
|
76
|
+
**Source Code**: [https://github.com/34j/create-minimal-package](https://github.com/34j/create-minimal-package)
|
|
77
|
+
|
|
78
|
+
**Package**: [https://www.npmjs.com/package/create-minimal-package](https://www.npmjs.com/package/create-minimal-package)
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
TODO: Project Description.
|
|
83
|
+
|
|
84
|
+
## Installation
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
npm install create-minimal-package
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Usage
|
|
91
|
+
|
|
92
|
+
```ts
|
|
93
|
+
import { myPackage } from 'create-minimal-package'
|
|
94
|
+
|
|
95
|
+
myPackage('hello')
|
|
96
|
+
// => 'hello from my package'
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
[build-img]:https://github.com/34j/create-minimal-package/actions/workflows/release.yml/badge.svg
|
|
100
|
+
[build-url]:https://github.com/34j/create-minimal-package/actions/workflows/release.yml
|
|
101
|
+
[downloads-img]:https://img.shields.io/npm/dt/create-minimal-package
|
|
102
|
+
[downloads-url]:https://www.npmtrends.com/create-minimal-package
|
|
103
|
+
[npm-img]:https://img.shields.io/npm/v/create-minimal-package
|
|
104
|
+
[npm-url]:https://www.npmjs.com/package/create-minimal-package
|
|
105
|
+
[issues-img]:https://img.shields.io/github/issues/34j/create-minimal-package
|
|
106
|
+
[issues-url]:https://github.com/34j/create-minimal-package/issues
|
|
107
|
+
[codecov-img]:https://codecov.io/gh/34j/create-minimal-package/branch/main/graph/badge.svg
|
|
108
|
+
[codecov-url]:https://codecov.io/gh/34j/create-minimal-package
|
|
109
|
+
[semantic-release-img]:https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
|
|
110
|
+
[semantic-release-url]:https://github.com/semantic-release/semantic-release
|
|
111
|
+
[commitizen-img]:https://img.shields.io/badge/commitizen-friendly-brightgreen.svg
|
|
112
|
+
[commitizen-url]:http://commitizen.github.io/cz-cli/
|
package/dist/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-minimal-package",
|
|
3
|
+
"type": "commonjs",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"description": "Minimalistic npm package template with 📦🚀semantic-release + Commitizen, CodeCov, Renovate, 🐶Husky + Lint Staged + EsLint, 👢Jest, 📖TypeDoc + Github Pages support. Note that this is a generated sample package.",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "34j"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"homepage": "https://github.com/34j/create-minimal-package",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/34j/create-minimal-package.git"
|
|
14
|
+
},
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/34j/create-minimal-package/issues"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"boilerplate",
|
|
20
|
+
"template",
|
|
21
|
+
"typescript",
|
|
22
|
+
"vscode",
|
|
23
|
+
"jest",
|
|
24
|
+
"husky",
|
|
25
|
+
"semantic-release",
|
|
26
|
+
"typedoc"
|
|
27
|
+
],
|
|
28
|
+
"main": "./dist/index.js",
|
|
29
|
+
"files": [
|
|
30
|
+
"dist/**/*"
|
|
31
|
+
],
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": ">=12.0"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build:watch": "tsc --watch --project tsconfig.build.json",
|
|
37
|
+
"build": "tsc --project tsconfig.build.json",
|
|
38
|
+
"lint": "eslint --fix",
|
|
39
|
+
"prepare": "husky",
|
|
40
|
+
"typedoc": "typedoc",
|
|
41
|
+
"typedoc:watch": "typedoc --watch",
|
|
42
|
+
"test:watch": "jest --watch",
|
|
43
|
+
"test": "jest --coverage",
|
|
44
|
+
"watch": "npm-run-all --race --parallel *:watch",
|
|
45
|
+
"update": "npm-check-updates -u"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@antfu/eslint-config": "^4.8.1",
|
|
49
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
50
|
+
"@semantic-release/git": "^10.0.1",
|
|
51
|
+
"@tsconfig/strictest": "^2.0.5",
|
|
52
|
+
"@types/jest": "^29.5.14",
|
|
53
|
+
"@types/node": "^22.13.10",
|
|
54
|
+
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
|
55
|
+
"eslint": "^9.22.0",
|
|
56
|
+
"globals": "^16.0.0",
|
|
57
|
+
"husky": "^9.1.7",
|
|
58
|
+
"jest": "^29.7.0",
|
|
59
|
+
"lint-staged": "^15.4.3",
|
|
60
|
+
"npm-check-updates": "^17.1.15",
|
|
61
|
+
"npm-run-all2": "5.0.0",
|
|
62
|
+
"semantic-release": "^24.2.3",
|
|
63
|
+
"ts-jest": "^29.2.6",
|
|
64
|
+
"typedoc": "^0.27.9",
|
|
65
|
+
"typescript": "^5.8.2"
|
|
66
|
+
},
|
|
67
|
+
"lint-staged": {
|
|
68
|
+
"*": "eslint --fix"
|
|
69
|
+
},
|
|
70
|
+
"jest": {
|
|
71
|
+
"preset": "ts-jest",
|
|
72
|
+
"testEnvironment": "node",
|
|
73
|
+
"collectCoverage": true,
|
|
74
|
+
"collectCoverageFrom": [
|
|
75
|
+
"src/**/*.ts",
|
|
76
|
+
"!src/**/*.d.ts"
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
"typedocOptions": {
|
|
80
|
+
"entryPoints": [
|
|
81
|
+
"./src"
|
|
82
|
+
],
|
|
83
|
+
"tsconfig": "./tsconfig.build.json"
|
|
84
|
+
},
|
|
85
|
+
"release": {
|
|
86
|
+
"plugins": [
|
|
87
|
+
"@semantic-release/commit-analyzer",
|
|
88
|
+
"@semantic-release/release-notes-generator",
|
|
89
|
+
"@semantic-release/changelog",
|
|
90
|
+
"@semantic-release/npm",
|
|
91
|
+
[
|
|
92
|
+
"@semantic-release/git",
|
|
93
|
+
{
|
|
94
|
+
"assets": [
|
|
95
|
+
"CHANGELOG.md",
|
|
96
|
+
"README.md",
|
|
97
|
+
"package.json",
|
|
98
|
+
"package-lock.json"
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
"@semantic-release/github"
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
}
|