create-minimal-package 1.5.0 → 1.5.2

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
@@ -4,11 +4,9 @@ Zero-knowledge ***minimalistic*** template for creating a new npm package.
4
4
 
5
5
  ---
6
6
 
7
- **Docs Demo**: [https://34j.github.io/create-minimal-package/](https://34j.github.io/create-minimal-package/)
7
+ **📘Docs Demo**: [https://34j.github.io/create-minimal-package/](https://34j.github.io/create-minimal-package/)
8
8
 
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)
9
+ **📦️NPM Package Demo**: [https://www.npmjs.com/package/create-minimal-package](https://www.npmjs.com/package/create-minimal-package)
12
10
 
13
11
  ---
14
12
 
@@ -28,6 +26,7 @@ Zero-knowledge ***minimalistic*** template for creating a new npm package.
28
26
  - [ESLint](https://eslint.org/): inherits [@antfu/eslint-config](https://www.npmjs.com/package/@antfu/eslint-config)
29
27
  - 📦Packageing
30
28
  - [pnpm](https://pnpm.io/) (⏪️npm)
29
+ - [🛡️Trusted Publishing](https://docs.npmjs.com/trusted-publishers)
31
30
  - ⚠️ Testing
32
31
  - [⚡️Vitest](https://vitest.dev/) (⏪️[👢Jest](https://jestjs.io/)): several lines for browser testing (optional, can be removed if Node.js only)
33
32
  - 📖Documentation
@@ -44,8 +43,19 @@ Zero-knowledge ***minimalistic*** template for creating a new npm package.
44
43
 
45
44
  </details>
46
45
 
47
- ## Quickstart
46
+ ## Quickstart (Copier)
47
+
48
+ ```shell
49
+ uvx copier copy --trust "gh:34j/create-minimal-package" --vcs-ref main my-cool-package
50
+ 🎤 What is your project name?
51
+ my-cool-package
52
+ 🎤 What is your GitHub username?
53
+ 34j
54
+ ```
55
+
56
+ ## Quickstart (GitHub Template)
48
57
 
58
+ 0. Run `npx setup-npm-trusted-publish my-cool-package` to reserve the package name and allow trusted publishing.
49
59
  1. Click the "Use this template" button.
50
60
  2. Replace `GITHUB_USER` and `REPO_NAME` using `sed`:
51
61
  ```bash
@@ -56,16 +66,18 @@ Zero-knowledge ***minimalistic*** template for creating a new npm package.
56
66
  rm *.tmp
57
67
  rm src/*.tmp
58
68
  rm CHANGELOG.md
69
+ rm *.jinja
59
70
  ```
60
- 3. [Create](https://www.npmjs.com/settings/34j/tokens/) and add `NPM_TOKEN` to [`Settings/Secrets and variables/Actions/Repository secrets`](https://github.com/34j/create-minimal-package/settings/secrets/actions).
61
- 4. [Create][codecov-url] and add `CODECOV_TOKEN` to [`Settings/Secrets and variables/Actions/Repository secrets`](https://github.com/34j/create-minimal-package/settings/secrets/actions).
62
- 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).
63
- 6. Install [pre-commit](https://pre-commit.com/) using [`uv`](https://github.com/astral-sh/uv) by `uv tool install pre-commit` and install hooks by `pre-commit install`.
64
- 7. Enable Github Pages and set `Source` to `GitHub Actions` from [`Settings/Pages/Build and deployment`](https://github.com/34j/create-minimal-package/settings/pages)
65
- 8. Remove everything above `---`.
71
+ 3. 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).
72
+ 4. Install [pre-commit](https://pre-commit.com/) using [`uv`](https://github.com/astral-sh/uv) by `uv tool install pre-commit` and install hooks by `pre-commit install`.
73
+ 5. Enable Github Pages and set `Source` to `GitHub Actions` from [`Settings/Pages/Build and deployment`](https://github.com/34j/create-minimal-package/settings/pages)
74
+ 6. Remove everything above `---`.
66
75
 
67
76
  > 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.
68
77
 
78
+ - Enable [Token authentication for public repositories](https://docs.codecov.com/docs/codecov-tokens#uploading-without-a-token) to upload coverage reports without a token.
79
+
80
+ ---
69
81
  ---
70
82
 
71
83
  # create-minimal-package
@@ -80,11 +92,9 @@ Zero-knowledge ***minimalistic*** template for creating a new npm package.
80
92
 
81
93
  ---
82
94
 
83
- **Documentation**: [https://34j.github.io/create-minimal-package/](https://34j.github.io/create-minimal-package/)
84
-
85
- **NPM Package**: [https://www.npmjs.com/package/create-minimal-package](https://www.npmjs.com/package/create-minimal-package)
95
+ **📘Documentation**: [https://34j.github.io/create-minimal-package/](https://34j.github.io/create-minimal-package/)
86
96
 
87
- **Source Code**: [https://github.com/34j/create-minimal-package](https://github.com/34j/create-minimal-package)
97
+ **📦️NPM Package**: [https://www.npmjs.com/package/create-minimal-package](https://www.npmjs.com/package/create-minimal-package)
88
98
 
89
99
  ---
90
100
 
@@ -0,0 +1,9 @@
1
+ /**
2
+ @module
3
+ */
4
+ import { mySubmodule } from './submodule';
5
+ /**
6
+ * Lorem ipsum.
7
+ */
8
+ export declare const myPackage: (taco?: string) => string;
9
+ export { mySubmodule };
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Lorem ipsum.
3
+ */
4
+ export declare const mySubmodule: (taco?: string) => string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-minimal-package",
3
3
  "type": "commonjs",
4
- "version": "1.5.0",
4
+ "version": "1.5.2",
5
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"
@@ -24,9 +24,10 @@
24
24
  "semantic-release",
25
25
  "typedoc"
26
26
  ],
27
- "main": "./dist/index.js",
27
+ "main": "dist/src/index.js",
28
+ "types": "dist/src/index.d.ts",
28
29
  "files": [
29
- "dist/**/*"
30
+ "dist/src/**/*"
30
31
  ],
31
32
  "scripts": {
32
33
  "build:watch": "tsc --watch --project tsconfig.json",
@@ -41,27 +42,28 @@
41
42
  "update": "npm-check-updates -u"
42
43
  },
43
44
  "devDependencies": {
44
- "@antfu/eslint-config": "4.12.0",
45
+ "@antfu/eslint-config": "6.0.0",
45
46
  "@semantic-release/changelog": "6.0.3",
46
47
  "@semantic-release/git": "10.0.1",
47
- "@tsconfig/strictest": "2.0.5",
48
- "@types/node": "22.14.1",
49
- "@typescript-eslint/eslint-plugin": "8.29.1",
50
- "@vitest/browser": "3.1.1",
51
- "@vitest/coverage-v8": "3.1.1",
52
- "eslint": "9.24.0",
53
- "npm-run-all2": "7.0.2",
54
- "playwright": "1.51.1",
55
- "semantic-release": "24.2.3",
56
- "typedoc": "0.28.2",
57
- "typescript": "5.8.3",
58
- "vitest": "3.1.1"
48
+ "@tsconfig/strictest": "2.0.6",
49
+ "@types/node": "22.18.12",
50
+ "@typescript-eslint/eslint-plugin": "8.46.2",
51
+ "@vitest/browser": "3.2.4",
52
+ "@vitest/coverage-v8": "3.2.4",
53
+ "eslint": "9.38.0",
54
+ "npm-run-all2": "8.0.4",
55
+ "playwright": "1.56.1",
56
+ "semantic-release": "25.0.1",
57
+ "typedoc": "0.28.14",
58
+ "typescript": "5.9.3",
59
+ "vitest": "3.2.4"
59
60
  },
60
61
  "typedocOptions": {
61
62
  "entryPoints": [
62
- "./src"
63
+ "src"
63
64
  ],
64
- "tsconfig": "./tsconfig.json"
65
+ "tsconfig": "tsconfig.json",
66
+ "headings": false
65
67
  },
66
68
  "release": {
67
69
  "plugins": [
@@ -1,20 +0,0 @@
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
- (0, vitest_1.describe)('mySubmodule', () => {
14
- (0, vitest_1.it)('should return a string containing the message', () => {
15
- const message = 'Hello';
16
- const result = (0, src_1.mySubmodule)(message);
17
- (0, vitest_1.expect)(result).toMatch(message);
18
- });
19
- });
20
- });