create-minimal-package 1.1.1 → 1.3.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/README.md +15 -12
- package/dist/test/index.spec.js +13 -0
- package/package.json +13 -23
- /package/dist/{index.js → src/index.js} +0 -0
package/README.md
CHANGED
|
@@ -6,7 +6,9 @@ Zero-knowledge ***minimalistic*** template for creating a new npm package.
|
|
|
6
6
|
|
|
7
7
|
**Docs Demo**: [https://34j.github.io/create-minimal-package/](https://34j.github.io/create-minimal-package/)
|
|
8
8
|
|
|
9
|
-
**Package Demo**: [https://www.npmjs.com/package/create-minimal-package](https://www.npmjs.com/package/create-minimal-package)
|
|
9
|
+
**NPM Package Demo**: [https://www.npmjs.com/package/create-minimal-package](https://www.npmjs.com/package/create-minimal-package)
|
|
10
|
+
|
|
11
|
+
**Source Code**: [https://github.com/34j/create-minimal-package](https://github.com/34j/create-minimal-package)
|
|
10
12
|
|
|
11
13
|
---
|
|
12
14
|
|
|
@@ -20,12 +22,14 @@ Zero-knowledge ***minimalistic*** template for creating a new npm package.
|
|
|
20
22
|
- [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
23
|
- [💨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
24
|
- [🧱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
|
|
25
|
+
- [⚙TypeScript](https://www.typescriptlang.org/):`tsconfig.json`: 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
26
|
- ✨️Formatting
|
|
25
|
-
- [⚠️
|
|
27
|
+
- [⚠️pre-commit](https://pre-commit.com/) and [pre-commit.ci](https://pre-commit.ci/): from [browniebroke/pypackage-template](https://github.com/browniebroke/pypackage-template/tree/main/.github/ISSUE_TEMPLATE) + [mirrors-eslint](https://github.com/pre-commit/mirrors-eslint) (⏪️[🐶Husky](https://github.com/typicode/husky) + [Lint Staged](https://github.com/okonet/lint-staged) for better CI support)
|
|
26
28
|
- [ESLint](https://eslint.org/): inherits [@antfu/eslint-config](https://www.npmjs.com/package/@antfu/eslint-config)
|
|
29
|
+
- 📦Packageing
|
|
30
|
+
- [pnpm](https://pnpm.io/) (⏪️npm)
|
|
27
31
|
- ⚠️ Testing
|
|
28
|
-
- [👢Jest](https://jestjs.io/):
|
|
32
|
+
- [⚡️Vitest](https://vitest.dev/) (⏪️[👢Jest](https://jestjs.io/)): 0 lines
|
|
29
33
|
- 📖Documentation
|
|
30
34
|
- [🌐GitHub Pages](https://pages.github.com/)
|
|
31
35
|
- [📖TypeDoc](https://typedoc.org/): 2 lines for `☆` `P`
|
|
@@ -39,18 +43,17 @@ Zero-knowledge ***minimalistic*** template for creating a new npm package.
|
|
|
39
43
|
|
|
40
44
|
</details>
|
|
41
45
|
|
|
42
|
-
##
|
|
43
|
-
|
|
44
|
-
### Set up your repository
|
|
46
|
+
## Quickstart
|
|
45
47
|
|
|
46
48
|
1. **Click the "Use this template" button.**
|
|
47
49
|
2. Replace `FULL_NAME`, `GITHUB_USER`, and `REPO_NAME` using `sed`:
|
|
48
50
|
```bash
|
|
49
|
-
FULL_NAME="John Smith"
|
|
50
51
|
GITHUB_USER="johnsmith"
|
|
51
52
|
REPO_NAME="my-cool-package"
|
|
52
|
-
sed -i.
|
|
53
|
-
|
|
53
|
+
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
|
|
54
|
+
sed -i.tmp 's/"version": "[0-9.]*"/"version": "0.0.0"/' package.json
|
|
55
|
+
rm *.tmp
|
|
56
|
+
rm CHANGELOG.md
|
|
54
57
|
```
|
|
55
58
|
3. Add `NPM_TOKEN` to `Settings/Secrets and variables/Actions/Repository secrets`.
|
|
56
59
|
4. Add `CODECOV_TOKEN` to `Settings/Secrets and variables/Actions/Repository secrets`.
|
|
@@ -76,9 +79,9 @@ Zero-knowledge ***minimalistic*** template for creating a new npm package.
|
|
|
76
79
|
|
|
77
80
|
**Documentation**: [https://34j.github.io/create-minimal-package/](https://34j.github.io/create-minimal-package/)
|
|
78
81
|
|
|
79
|
-
**
|
|
82
|
+
**NPM Package**: [https://www.npmjs.com/package/create-minimal-package](https://www.npmjs.com/package/create-minimal-package)
|
|
80
83
|
|
|
81
|
-
**
|
|
84
|
+
**Source Code**: [https://github.com/34j/create-minimal-package](https://github.com/34j/create-minimal-package)
|
|
82
85
|
|
|
83
86
|
---
|
|
84
87
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const src_1 = require("../src");
|
|
5
|
+
(0, vitest_1.describe)('index', () => {
|
|
6
|
+
(0, vitest_1.describe)('myPackage', () => {
|
|
7
|
+
(0, vitest_1.it)('should return a string containing the message', () => {
|
|
8
|
+
const message = 'Hello';
|
|
9
|
+
const result = (0, src_1.myPackage)(message);
|
|
10
|
+
(0, vitest_1.expect)(result).toMatch(message);
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
});
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-minimal-package",
|
|
3
3
|
"type": "commonjs",
|
|
4
|
-
"version": "1.
|
|
5
|
-
"description": "Minimalistic npm package template with 📦🚀semantic-release + Commitizen, CodeCov, Renovate, pre-commit + EsLint (✗🐶Husky + Lint Staged),
|
|
4
|
+
"version": "1.3.0",
|
|
5
|
+
"description": "Minimalistic npm package template with 📦🚀semantic-release + Commitizen, CodeCov, Renovate, pre-commit + EsLint (✗🐶Husky + Lint Staged), ⚡️Vitest (✗👢Jest), 📖TypeDoc + Github Pages support. Note that this is a generated sample package.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "34j"
|
|
8
8
|
},
|
|
@@ -19,9 +19,8 @@
|
|
|
19
19
|
"boilerplate",
|
|
20
20
|
"template",
|
|
21
21
|
"typescript",
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"husky",
|
|
22
|
+
"vitest",
|
|
23
|
+
"pre-commit",
|
|
25
24
|
"semantic-release",
|
|
26
25
|
"typedoc"
|
|
27
26
|
],
|
|
@@ -33,13 +32,14 @@
|
|
|
33
32
|
"node": ">=12.0"
|
|
34
33
|
},
|
|
35
34
|
"scripts": {
|
|
36
|
-
"build:watch": "tsc --watch --project tsconfig.
|
|
37
|
-
"
|
|
35
|
+
"build:watch": "tsc --watch --project tsconfig.json",
|
|
36
|
+
"preinstall": "npx only-allow pnpm",
|
|
37
|
+
"build": "tsc --project tsconfig.json",
|
|
38
38
|
"lint": "eslint --fix",
|
|
39
39
|
"typedoc": "typedoc",
|
|
40
40
|
"typedoc:watch": "typedoc --watch",
|
|
41
|
-
"test:watch": "
|
|
42
|
-
"test": "
|
|
41
|
+
"test:watch": "vitest --watch --coverage --coverage.include=src",
|
|
42
|
+
"test": "vitest --coverage --coverage.include=src",
|
|
43
43
|
"watch": "npm-run-all --race --parallel *:watch",
|
|
44
44
|
"update": "npm-check-updates -u"
|
|
45
45
|
},
|
|
@@ -48,33 +48,23 @@
|
|
|
48
48
|
"@semantic-release/changelog": "^6.0.3",
|
|
49
49
|
"@semantic-release/git": "^10.0.1",
|
|
50
50
|
"@tsconfig/strictest": "^2.0.5",
|
|
51
|
-
"@types/jest": "^29.5.14",
|
|
52
51
|
"@types/node": "^22.13.10",
|
|
53
52
|
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
|
53
|
+
"@vitest/coverage-v8": "^3.0.8",
|
|
54
54
|
"eslint": "^9.22.0",
|
|
55
55
|
"globals": "^16.0.0",
|
|
56
|
-
"jest": "^29.7.0",
|
|
57
56
|
"npm-check-updates": "^17.1.15",
|
|
58
57
|
"npm-run-all2": "5.0.0",
|
|
59
58
|
"semantic-release": "^24.2.3",
|
|
60
|
-
"ts-jest": "^29.2.6",
|
|
61
59
|
"typedoc": "^0.27.9",
|
|
62
|
-
"typescript": "^5.8.2"
|
|
63
|
-
|
|
64
|
-
"jest": {
|
|
65
|
-
"preset": "ts-jest",
|
|
66
|
-
"testEnvironment": "node",
|
|
67
|
-
"collectCoverage": true,
|
|
68
|
-
"collectCoverageFrom": [
|
|
69
|
-
"src/**/*.ts",
|
|
70
|
-
"!src/**/*.d.ts"
|
|
71
|
-
]
|
|
60
|
+
"typescript": "^5.8.2",
|
|
61
|
+
"vitest": "^3.0.8"
|
|
72
62
|
},
|
|
73
63
|
"typedocOptions": {
|
|
74
64
|
"entryPoints": [
|
|
75
65
|
"./src"
|
|
76
66
|
],
|
|
77
|
-
"tsconfig": "./tsconfig.
|
|
67
|
+
"tsconfig": "./tsconfig.json"
|
|
78
68
|
},
|
|
79
69
|
"release": {
|
|
80
70
|
"plugins": [
|
|
File without changes
|