|
3 | 3 | "version": "0.0.0-0",
|
4 | 4 | "description": "React.useRef with an immediate setter and read-only value.",
|
5 | 5 | "files": [
|
6 |
| - "./lib/*" |
| 6 | + "./lib/" |
7 | 7 | ],
|
8 | 8 | "exports": {
|
9 | 9 | ".": {
|
10 |
| - "import": "./lib/esmodules/index.js", |
11 |
| - "require": "./lib/commonjs/index.js", |
12 |
| - "types": "./lib/types/index.d.ts" |
| 10 | + "import": { |
| 11 | + "types": "./lib/esmodules-types/index.d.ts", |
| 12 | + "default": "./lib/esmodules/index.js" |
| 13 | + }, |
| 14 | + "require": { |
| 15 | + "types": "./lib/commonjs-types/index.d.ts", |
| 16 | + "default": "./lib/commonjs/index.js" |
| 17 | + } |
13 | 18 | },
|
14 | 19 | "./useRefFrom": {
|
15 |
| - "import": "./lib/esmodules/useRefFrom.js", |
16 |
| - "require": "./lib/commonjs/useRefFrom.js", |
17 |
| - "types": "./lib/types/useRefFrom.d.ts" |
| 20 | + "import": { |
| 21 | + "types": "./lib/esmodules-types/useRefFrom.d.ts", |
| 22 | + "default": "./lib/esmodules/useRefFrom.js" |
| 23 | + }, |
| 24 | + "require": { |
| 25 | + "types": "./lib/commonjs-types/useRefFrom.d.ts", |
| 26 | + "default": "./lib/commonjs/useRefFrom.js" |
| 27 | + } |
18 | 28 | }
|
19 | 29 | },
|
20 | 30 | "main": "./lib/commonjs/index.js",
|
21 |
| - "typings": "./lib/types/index.d.ts", |
| 31 | + "typings": "./lib/commonjs-types/index.d.ts", |
22 | 32 | "scripts": {
|
23 |
| - "build": "npm run build:babel && npm run build:typescript", |
24 |
| - "build:babel": "npm run build:babel:commonjs && npm run build:babel:esmodules", |
| 33 | + "build": "npm run build:babel:commonjs && npm run build:babel:esmodules && npm run build:typescript:commonjs && npm run build:typescript:esmodules", |
25 | 34 | "build:babel:commonjs": "babel src --config-file ./babel.commonjs.config.json --extensions .ts,.tsx --out-dir ./lib/commonjs/",
|
26 | 35 | "build:babel:esmodules": "babel src --config-file ./babel.esmodules.config.json --extensions .ts,.tsx --out-dir ./lib/esmodules/",
|
27 |
| - "build:typescript": "tsc --project ./src/tsconfig.declaration.json", |
| 36 | + "build:typescript:commonjs": "tsc --project ./src/tsconfig.declaration.commonjs.json", |
| 37 | + "build:typescript:esmodules": "tsc --project ./src/tsconfig.declaration.esmodules.json", |
28 | 38 | "bump": "npm run bump:prod && npm run bump:dev && npm run bump:auditfix && npm run bump:babel",
|
29 | 39 | "bump:auditfix": "npm audit fix || exit 0",
|
30 | 40 | "bump:babel": "npm run bump:babel:commonjs && npm run bump:babel:esmodules",
|
|
34 | 44 | "bump:prod": "if [ `cat package.json | jq -r '(.dependencies // {}) | length'` -ne 0 ]; then npm install --save-exact $(cat package.json | jq -r '(.pinDependencies // {}) as $p | ((.dependencies // {}) | keys) | map(. + \"@\" + ($p[.] // [\"latest\"])[0]) | .[]'); fi",
|
35 | 45 | "postbump": "cat package.json | jq '. + (.dependencies = (((.dependencies // {}) + (.localPeerDependencies // {})) | to_entries | sort_by(.key) | from_entries)) | (.devDependencies = (((.devDependencies // {}) + (.localPeerDevDependencies // {})) | to_entries | sort_by(.key) | from_entries))' > package-temp.json && mv package-temp.json package.json",
|
36 | 46 | "prebump": "cat package.json | jq '(((.localPeerDependencies // {}) | keys | map([\"dependencies\", .])) + ((.localPeerDevDependencies // {}) | keys | map([\"devDependencies\", .]))) as $localPeerPaths | delpaths($localPeerPaths)' > package-temp.json && mv package-temp.json package.json",
|
37 |
| - "precommit": "eslint ./src/", |
| 47 | + "precommit": "npm run precommit:eslint && npm run precommit:typescript", |
| 48 | + "precommit:eslint": "eslint ./src/", |
| 49 | + "precommit:typescript": "tsc --noEmit --project ./src/tsconfig.json", |
38 | 50 | "prepack": "cp ../../CHANGELOG.md . && cp ../../LICENSE . && cp ../../README.md .",
|
39 | 51 | "test": "jest"
|
40 | 52 | },
|
|
0 commit comments