|
2 | 2 | "name": "react-time-picker", |
3 | 3 | "version": "5.2.0", |
4 | 4 | "description": "A time picker for your React app.", |
5 | | - "main": "dist/index.js", |
| 5 | + "main": "dist/cjs/index.js", |
| 6 | + "module": "dist/esm/index.js", |
6 | 7 | "source": "src/index.js", |
| 8 | + "sideEffects": [ |
| 9 | + "*.css" |
| 10 | + ], |
7 | 11 | "scripts": { |
8 | 12 | "build": "yarn build-js && yarn copy-styles", |
9 | | - "build-js": "babel src -d dist --ignore \"**/*.spec.js,**/*.spec.jsx\"", |
| 13 | + "build-js": "yarn build-js-esm && yarn build-js-cjs", |
| 14 | + "build-js-esm": "tsc --project tsconfig.build.json --outDir dist/esm --module esnext", |
| 15 | + "build-js-cjs": "tsc --project tsconfig.build.json --outDir dist/cjs --module commonjs", |
10 | 16 | "clean": "rimraf dist", |
11 | 17 | "copy-styles": "node ./copy-styles.mjs", |
12 | 18 | "jest": "jest", |
13 | | - "lint": "eslint . --ext .js,.jsx", |
| 19 | + "lint": "eslint . --ext .js,.jsx,.ts,.tsx", |
14 | 20 | "postinstall": "husky install", |
15 | 21 | "prepack": "yarn clean && yarn build", |
16 | 22 | "prettier": "prettier --check . --cache", |
17 | | - "test": "yarn lint && yarn prettier && yarn jest" |
| 23 | + "test": "yarn lint && yarn tsc && yarn prettier && yarn jest", |
| 24 | + "tsc": "tsc --noEmit" |
18 | 25 | }, |
19 | 26 | "keywords": [ |
20 | 27 | "react", |
|
37 | 44 | "update-input-width": "^1.2.2" |
38 | 45 | }, |
39 | 46 | "devDependencies": { |
40 | | - "@babel/cli": "^7.15.0", |
41 | 47 | "@babel/core": "^7.15.0", |
42 | 48 | "@babel/preset-env": "^7.15.0", |
43 | 49 | "@babel/preset-react": "^7.14.0", |
| 50 | + "@babel/preset-typescript": "^7.18.6", |
44 | 51 | "@testing-library/jest-dom": "^5.15.0", |
45 | 52 | "@testing-library/react": "^13.4.0", |
46 | 53 | "@testing-library/user-event": "^14.4.0", |
| 54 | + "@types/jest": "^29.0.0", |
| 55 | + "@typescript-eslint/eslint-plugin": "^5.41.0", |
| 56 | + "@typescript-eslint/parser": "^5.44.0", |
47 | 57 | "eslint": "^8.26.0", |
48 | 58 | "eslint-config-wojtekmaj": "^0.7.1", |
49 | 59 | "husky": "^8.0.0", |
|
53 | 63 | "pretty-quick": "^3.1.0", |
54 | 64 | "react": "^18.2.0", |
55 | 65 | "react-dom": "^18.2.0", |
56 | | - "rimraf": "^3.0.0" |
| 66 | + "rimraf": "^3.0.0", |
| 67 | + "typescript": "^4.9.5" |
57 | 68 | }, |
58 | 69 | "peerDependencies": { |
59 | 70 | "react": "^16.8.0 || ^17.0.0 || ^18.0.0", |
|
0 commit comments