Skip to content
This repository was archived by the owner on Jan 15, 2024. It is now read-only.

Commit ff5b385

Browse files
committed
Drop support for CommonJS modules
1 parent 61bd0c2 commit ff5b385

File tree

5 files changed

+18
-22
lines changed

5 files changed

+18
-22
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
node_modules/
2-
es/
32
lib/
43
coverage/

package-lock.json

Lines changed: 1 addition & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,23 @@
22
"name": "@amsterdam/use-promise",
33
"version": "2.1.0",
44
"description": "Making Promises in your components a breeze 🌬️",
5-
"main": "lib/usePromise.js",
6-
"module": "es/usePromise.js",
5+
"type": "module",
76
"sideEffects": false,
87
"files": [
9-
"es",
10-
"lib"
8+
"lib",
9+
"guides"
1110
],
11+
"exports": {
12+
".": "./lib/usePromise.js"
13+
},
1214
"publishConfig": {
1315
"access": "public"
1416
},
1517
"scripts": {
16-
"build": "npm run build:lib && npm run build:es",
17-
"build:lib": "rimraf lib && tsc",
18-
"build:es": "rimraf es && tsc --project tsconfig.es.json",
18+
"build": "rimraf lib && tsc",
1919
"lint": "eslint . --ext .ts,.tsx",
20-
"test": "jest --coverage"
20+
"test": "jest --coverage",
21+
"prepublishOnly": "npm run build"
2122
},
2223
"repository": {
2324
"type": "git",
@@ -40,6 +41,7 @@
4041
"devDependencies": {
4142
"@jest/types": "^27.0.2",
4243
"@testing-library/react-hooks": "^7.0.0",
44+
"@types/jest": "^27.0.1",
4345
"@typescript-eslint/eslint-plugin": "^4.17.0",
4446
"eslint": "^7.22.0",
4547
"eslint-config-airbnb-typescript": "^12.3.1",

tsconfig.es.json

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

tsconfig.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"outDir": "./lib",
55
"target": "ES2020",
66
"lib": ["ES2020", "DOM"],
7-
"module": "CommonJS",
7+
"module": "ES2020",
88
"moduleResolution": "Node",
99
"declaration": true,
1010
"strict": true
@@ -14,5 +14,10 @@
1414
],
1515
"exclude": [
1616
"**/*.test.*",
17-
]
17+
],
18+
"ts-node": {
19+
"moduleTypes": {
20+
"jest.config.ts": "cjs"
21+
}
22+
}
1823
}

0 commit comments

Comments
 (0)