Skip to content

Commit cc5bb53

Browse files
cellogtimdorr
authored andcommitted
fully move away from index.d.ts (reduxjs#3561)
* fully move away from index.d.ts * build types into the types/ directory * remove autogenerated types dir * ignore auto-generated types * better type building, also clean old definitions * use types instead of typings Co-Authored-By: Jed Mao <[email protected]> * Don't build declaration maps Former-commit-id: 20c995c
1 parent 6de326a commit cc5bb53

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ dist
55
lib
66
es
77
coverage
8+
types
89

910
website/translated_docs
1011
website/build/

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,27 @@
2626
"main": "lib/redux.js",
2727
"unpkg": "dist/redux.js",
2828
"module": "es/redux.js",
29-
"typings": "./index.d.ts",
29+
"types": "types/index.d.ts",
3030
"files": [
3131
"dist",
3232
"lib",
3333
"es",
3434
"src",
35-
"index.d.ts"
35+
"types"
3636
],
3737
"scripts": {
38-
"clean": "rimraf lib dist es coverage",
38+
"clean": "rimraf lib dist es coverage types",
3939
"format": "prettier --write \"{src,test}/**/*.{js,ts}\" index.d.ts \"**/*.md\"",
4040
"format:check": "prettier --list-different \"{src,test}/**/*.{js,ts}\" index.d.ts \"**/*.md\"",
4141
"lint": "eslint --ext js,ts src test",
4242
"pretest": "npm run build",
4343
"test": "jest",
4444
"test:watch": "npm test -- --watch",
4545
"test:cov": "npm test -- --coverage",
46-
"build": "rollup -c",
46+
"build": "npm run build-types && rollup -c",
4747
"prepare": "npm run clean && npm run check-types && npm run format:check && npm run lint && npm test",
48-
"check-types": "tsc",
48+
"build-types": "tsc --emitDeclarationOnly",
49+
"check-types": "tsc --noEmit",
4950
"examples:lint": "eslint --ext js,ts examples",
5051
"examples:test": "cross-env CI=true babel-node examples/testAll.js"
5152
},

test/typescript/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"strict": true,
55
"baseUrl": "../..",
66
"paths": {
7-
"redux": ["index.d.ts"]
7+
"redux": ["types/index.d.ts"]
88
}
99
}
1010
}

tsconfig.json.REMOVED.git-id

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0abee9b5c3a10031fe5f1a563af699c66cbe8307
1+
1ef2e9f083e0338a4cf39a2cd6a11df70b0c3abc

0 commit comments

Comments
 (0)