create-minimal-package 1.1.0 → 1.2.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 CHANGED
@@ -20,40 +20,41 @@ Zero-knowledge ***minimalistic*** template for creating a new npm package.
20
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
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
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)
23
+ - [⚙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
24
  - ✨️Formatting
25
- - [⚠️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) instead of [🐶Husky](https://github.com/typicode/husky) + [Lint Staged](https://github.com/okonet/lint-staged)
25
+ - [⚠️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
26
  - [ESLint](https://eslint.org/): inherits [@antfu/eslint-config](https://www.npmjs.com/package/@antfu/eslint-config)
27
27
  - ⚠️ Testing
28
- - [👢Jest](https://jestjs.io/): 2 lines for supporting Codecov and 2 lines for supporting Node.js `P`
28
+ - [⚡️Vitest](https://vitest.dev/) (⏪️[👢Jest](https://jestjs.io/)): 0 lines
29
29
  - 📖Documentation
30
30
  - [🌐GitHub Pages](https://pages.github.com/)
31
31
  - [📖TypeDoc](https://typedoc.org/): 2 lines for `☆` `P`
32
32
 
33
33
  <details>
34
34
  <summary>Removed Features (to achieve minimalism)</summary>
35
+
35
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).
36
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.
37
- - Removed Prettier due to [@antfu/eslint-config's opinions](https://github.com/antfu/eslint-config?tab=readme-ov-file#prettier).
38
- </details>
38
+ - Removed Prettier due to [@antfu/eslint-config's opinions](https://github.com/antfu/eslint-config?tab=readme-ov-file#prettier) and [mirrors-prettier](https://github.com/pre-commit/mirrors-prettier) being archived.
39
39
 
40
- ## Getting started
40
+ </details>
41
41
 
42
- ### Set up your repository
42
+ ## Quickstart
43
43
 
44
44
  1. **Click the "Use this template" button.**
45
45
  2. Replace `FULL_NAME`, `GITHUB_USER`, and `REPO_NAME` using `sed`:
46
46
  ```bash
47
- FULL_NAME="John Smith"
48
47
  GITHUB_USER="johnsmith"
49
48
  REPO_NAME="my-cool-package"
50
- 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
51
- rm *.mybak
49
+ 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
50
+ sed -i.tmp 's/"version": "[0-9.]*"/"version": "0.0.0"/' package.json
51
+ rm *.tmp
52
+ rm CHANGELOG.md
52
53
  ```
53
54
  3. Add `NPM_TOKEN` to `Settings/Secrets and variables/Actions/Repository secrets`.
54
- 4. Enable [Codecov GitHub App](https://github.com/apps/codecov) and add `CODECOV_TOKEN` to `Settings/Secrets and variables/Actions/Repository secrets`.
55
+ 4. Add `CODECOV_TOKEN` to `Settings/Secrets and variables/Actions/Repository secrets`.
55
56
  5. Install GitHub Apps, [pre-commit.ci lite](https://github.com/apps/pre-commit-ci-lite/installations/select_target) and [Codecov](https://github.com/apps/codecov/installations/select_target).
56
- 6. Install [pre-commit](https://pre-commit.com/) using [`uv`](https://github.com/astral-sh/uv); `uv tool install pre-commit`.
57
+ 6. Install [pre-commit](https://pre-commit.com/) using [`uv`](https://github.com/astral-sh/uv) and install hooks by `uv tool install pre-commit && pre-commit install`.
57
58
  7. Remove everything above `---`.
58
59
 
59
60
  > 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.
@@ -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.1.0",
5
- "description": "Minimalistic npm package template with 📦🚀semantic-release + Commitizen, CodeCov, Renovate, 🐶Husky + pre-commit (Lint Staged + EsLint), 👢Jest, 📖TypeDoc + Github Pages support. Note that this is a generated sample package.",
4
+ "version": "1.2.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
- "vscode",
23
- "jest",
24
- "husky",
22
+ "vitest",
23
+ "pre-commit",
25
24
  "semantic-release",
26
25
  "typedoc"
27
26
  ],
@@ -33,13 +32,13 @@
33
32
  "node": ">=12.0"
34
33
  },
35
34
  "scripts": {
36
- "build:watch": "tsc --watch --project tsconfig.build.json",
37
- "build": "tsc --project tsconfig.build.json",
35
+ "build:watch": "tsc --watch --project tsconfig.json",
36
+ "build": "tsc --project tsconfig.json",
38
37
  "lint": "eslint --fix",
39
38
  "typedoc": "typedoc",
40
39
  "typedoc:watch": "typedoc --watch",
41
- "test:watch": "jest --watch",
42
- "test": "jest --coverage",
40
+ "test:watch": "vitest --watch",
41
+ "test": "vitest --coverage",
43
42
  "watch": "npm-run-all --race --parallel *:watch",
44
43
  "update": "npm-check-updates -u"
45
44
  },
@@ -48,33 +47,23 @@
48
47
  "@semantic-release/changelog": "^6.0.3",
49
48
  "@semantic-release/git": "^10.0.1",
50
49
  "@tsconfig/strictest": "^2.0.5",
51
- "@types/jest": "^29.5.14",
52
50
  "@types/node": "^22.13.10",
53
51
  "@typescript-eslint/eslint-plugin": "^8.26.1",
52
+ "@vitest/coverage-v8": "^3.0.8",
54
53
  "eslint": "^9.22.0",
55
54
  "globals": "^16.0.0",
56
- "jest": "^29.7.0",
57
55
  "npm-check-updates": "^17.1.15",
58
56
  "npm-run-all2": "5.0.0",
59
57
  "semantic-release": "^24.2.3",
60
- "ts-jest": "^29.2.6",
61
58
  "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
- ]
59
+ "typescript": "^5.8.2",
60
+ "vitest": "^3.0.8"
72
61
  },
73
62
  "typedocOptions": {
74
63
  "entryPoints": [
75
64
  "./src"
76
65
  ],
77
- "tsconfig": "./tsconfig.build.json"
66
+ "tsconfig": "./tsconfig.json"
78
67
  },
79
68
  "release": {
80
69
  "plugins": [
File without changes