Skip to content

Commit d38d3a3

Browse files
committed
feat: removed rollup, replaced jest with Vitest
1 parent c078a53 commit d38d3a3

File tree

10 files changed

+833
-2524
lines changed

10 files changed

+833
-2524
lines changed

.github/workflows/pre-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,4 @@ jobs:
8181
run: pnpm install --frozen-lockfile
8282

8383
- name: Test
84-
run: pnpm test:ci
84+
run: pnpm test

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@
22

33
Welcome to the **TypeScript Library Starter**! This template is designed to help you kickstart your TypeScript library development with ease. It includes all the necessary tools and configurations to get you up and running quickly.
44

5+
> [!NOTE]
6+
> This is **[ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c)** only
7+
58
## Features ✨
69

710
- **TypeScript** for type-safe code
8-
- **Rollup** for bundling
9-
- **Jest** for testing
11+
- **Vitest** for testing
1012
- **Biome** for linting and formatting
1113
- **Changesets** for versioning and changelogs
1214
- **GitHub Actions** for CI/CD
15+
- **Automated NPM Release** for hassle-free release
16+
- **simple-git-hooks** for better collaboration
1317

1418
## Getting Started 🛠️
1519

@@ -35,7 +39,7 @@ Welcome to the **TypeScript Library Starter**! This template is designed to help
3539

3640
After the installation, you can start using your library in your projects. Here's an example of how to import and use your library:
3741
38-
- Replace `your-library-name` with the actual name of your library as specified in your package.json.
42+
- Replace `typescript-library-starter` with the actual name of your library as specified in your package.json along with other appropriate fields as well.
3943
4044
- Note: If the GitHub Actions workflow is currently disabled, you can enable it by removing any comments or disabling flags in the workflow configuration files located in the `.github/workflows` directory.
4145
@@ -44,6 +48,8 @@ After the installation, you can start using your library in your projects. Here'
4448
pnpm prepare
4549
```
4650
51+
- For **Automated NPM Release**, add NPM token in github repository's secrets with key named `NPM_TOKEN`
52+
4753
## Contributing 🤝
4854

4955
Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request. Follow these steps to contribute:

jest.config.cjs

Lines changed: 0 additions & 18 deletions
This file was deleted.

package.json

Lines changed: 24 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,45 @@
22
"name": "typescript-library-starter",
33
"version": "0.0.0",
44
"description": "A starter template for TypeScript libraries ready to be published to npm.",
5-
"main": "dist/index.cjs",
6-
"module": "dist/index.mjs",
5+
"main": "dist/index.js",
6+
"module": "dist/index.js",
7+
"exports": {
8+
".": {
9+
"import": "./dist/index.js",
10+
"types": "./dist/index.d.ts"
11+
}
12+
},
713
"types": "dist/index.d.ts",
814
"type": "module",
15+
"files": ["dist"],
916
"scripts": {
10-
"build": "pnpm clean && rollup -c --bundleConfigAsCjs",
17+
"build": "pnpm clean && tsc",
1118
"clean": "rimraf dist",
12-
"test": "jest --maxWorkers=50%",
13-
"test:watch": "jest --watch",
14-
"test:ci": "jest --runInBand",
15-
"test:coverage": "jest --coverage",
16-
"test:changed": "jest --onlyChanged",
1719
"format": "biome format --write",
1820
"lint": "biome check --fix",
1921
"lint:staged": "lint-staged",
2022
"changeset": "changeset",
2123
"changeset:version": "changeset version",
2224
"changeset:publish": "pnpm build && changeset publish",
2325
"prepare": "npx simple-git-hooks",
24-
"typecheck": "tsc --noEmit"
26+
"typecheck": "tsc --noEmit",
27+
"test": "vitest",
28+
"test:watch": "vitest --watch",
29+
"test:coverage": "vitest run --coverage"
2530
},
2631
"devDependencies": {
2732
"@biomejs/biome": "1.9.4",
2833
"@changesets/changelog-github": "^0.5.0",
29-
"@changesets/cli": "^2.27.9",
30-
"@rollup/plugin-commonjs": "^28.0.0",
31-
"@rollup/plugin-node-resolve": "^15.3.0",
32-
"@rollup/plugin-terser": "^0.4.4",
33-
"@rollup/plugin-typescript": "^12.1.0",
34-
"@types/jest": "^29.5.13",
35-
"@types/node": "^22.7.5",
36-
"jest": "^29.7.0",
34+
"@changesets/cli": "^2.27.10",
35+
"@types/node": "^22.9.1",
36+
"@vitest/coverage-v8": "2.1.5",
3737
"lint-staged": "^15.2.10",
3838
"rimraf": "^6.0.1",
39-
"rollup": "^4.24.0",
4039
"simple-git-hooks": "^2.11.1",
41-
"ts-jest": "^29.2.5",
4240
"ts-node": "^10.9.2",
43-
"tslib": "^2.7.0",
44-
"typescript": "^5.6.2"
41+
"tslib": "^2.8.1",
42+
"typescript": "^5.6.3",
43+
"vitest": "^2.1.5"
4544
},
4645
"peerDependencies": {
4746
"typescript": ">=5.0.4"
@@ -51,26 +50,7 @@
5150
"optional": true
5251
}
5352
},
54-
"files": ["dist", "src"],
55-
"exports": {
56-
".": {
57-
"import": "./dist/index.mjs",
58-
"require": "./dist/index.cjs",
59-
"types": "./dist/index.d.ts"
60-
}
61-
},
62-
"keywords": [
63-
"typescript",
64-
"library",
65-
"starter",
66-
"template",
67-
"npm",
68-
"publish",
69-
"rollup",
70-
"jest",
71-
"biome",
72-
"terser"
73-
],
53+
"keywords": ["typescript", "library", "starter", "template", "npm", "biome"],
7454
"author": "Sohab Sk",
7555
"license": "MIT",
7656
"repository": {
@@ -83,10 +63,11 @@
8363
"*": ["pnpm lint", "git add"]
8464
},
8565
"simple-git-hooks": {
86-
"pre-commit": "pnpm typecheck && pnpm test:ci && pnpm lint:staged"
66+
"pre-commit": "pnpm typecheck && pnpm test:coverage && pnpm lint:staged"
8767
},
8868
"packageManager": "pnpm@9.12.0",
8969
"engines": {
9070
"node": ">=20.0.0"
91-
}
71+
},
72+
"sideEffects": false
9273
}

0 commit comments

Comments
 (0)