Skip to content

Commit 26ea4eb

Browse files
committed
cjs + esm
1 parent 9a02e9a commit 26ea4eb

8 files changed

+25
-20
lines changed

Diff for: .eslintrc.js renamed to .eslintrc.cjs

File renamed without changes.

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Creates http error which can be catched and converted to error responses.
3030
Through [NPM](https://www.npmjs.com) as [@chubbyts/chubbyts-http-error][1].
3131

3232
```ts
33-
npm i @chubbyts/chubbyts-http-error@^2.2.1
33+
npm i @chubbyts/chubbyts-http-error@^2.3.0
3434
```
3535

3636
## Usage

Diff for: package.json

+19-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "@chubbyts/chubbyts-http-error",
3-
"version": "2.2.1",
3+
"type": "module",
4+
"version": "2.3.0",
45
"description": "Creates http error which can be catched and converted to error responses.",
56
"keywords": [
67
"chubbyts",
@@ -11,14 +12,14 @@
1112
"license": "MIT",
1213
"repository": "chubbyts/chubbyts-http-error",
1314
"scripts": {
15+
"build": "rm -rf ./dist && tsc -b ./tsconfig.types.json ./tsconfig.esm.json ./tsconfig.cjs.json && node ./rename-commonjs.js",
1416
"cs-fix": "prettier --write src tests",
1517
"cs": "prettier --check src tests",
18+
"infection": "stryker run",
1619
"lint-fix": "eslint src tests --fix",
1720
"lint": "eslint src tests",
18-
"test": "jest",
19-
"infection": "stryker run",
20-
"build": "rm -Rf dist && tsc",
21-
"prepare": "npm run build"
21+
"prepare": "npm run build",
22+
"test": "jest"
2223
},
2324
"jest": {
2425
"preset": "ts-jest",
@@ -41,16 +42,25 @@
4142
"files": [
4243
"dist"
4344
],
45+
"exports": {
46+
"./*": {
47+
"types": "./*.d.ts",
48+
"require": "./*.cjs",
49+
"import": "./*.js",
50+
"default": "./*.js"
51+
}
52+
},
4453
"engines": {
4554
"node": ">=16"
4655
},
4756
"dependencies": {},
4857
"devDependencies": {
49-
"@chubbyts/chubbyts-eslint": "^1.1.2",
50-
"@stryker-mutator/core": "^7.1.0",
51-
"@stryker-mutator/jest-runner": "^7.1.0",
58+
"@chubbyts/chubbyts-eslint": "^2.0.2",
59+
"@chubbyts/chubbyts-packaging": "^1.0.3",
60+
"@stryker-mutator/core": "^7.1.1",
61+
"@stryker-mutator/jest-runner": "^7.1.1",
5262
"@types/jest": "^29.5.3",
53-
"@types/node": "^20.4.1",
63+
"@types/node": "^20.4.5",
5464
"jest": "^29.6.1",
5565
"prettier": "^3.0.0",
5666
"ts-jest": "^29.1.1",

Diff for: rename-commonjs.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/@chubbyts/chubbyts-packaging/rename-commonjs.js

Diff for: tsconfig.cjs.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/@chubbyts/chubbyts-packaging/tsconfig.cjs.json

Diff for: tsconfig.esm.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/@chubbyts/chubbyts-packaging/tsconfig.esm.json

Diff for: tsconfig.json

-10
This file was deleted.

Diff for: tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/@chubbyts/chubbyts-packaging/tsconfig.json

Diff for: tsconfig.types.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/@chubbyts/chubbyts-packaging/tsconfig.types.json

0 commit comments

Comments
 (0)