Skip to content

Commit 7214b8e

Browse files
author
jedmao
committed
Defer to rollup TS plugin to build types
1 parent 291c263 commit 7214b8e

File tree

7 files changed

+12
-15
lines changed

7 files changed

+12
-15
lines changed

.gitignore

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

109
website/translated_docs
1110
website/build/

package.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,24 @@
2626
"main": "lib/redux.js",
2727
"unpkg": "dist/redux.js",
2828
"module": "es/redux.js",
29-
"types": "types/index.d.ts",
29+
"types": "lib/redux.d.ts",
3030
"files": [
3131
"dist",
3232
"lib",
3333
"es",
34-
"src",
35-
"types"
34+
"src"
3635
],
3736
"scripts": {
38-
"clean": "rimraf lib dist es coverage types",
37+
"clean": "rimraf lib dist es coverage",
3938
"format": "prettier --write \"{src,test}/**/*.{js,ts}\" index.d.ts \"**/*.md\"",
4039
"format:check": "prettier --list-different \"{src,test}/**/*.{js,ts}\" index.d.ts \"**/*.md\"",
4140
"lint": "eslint --ext js,ts src test",
4241
"pretest": "npm run build",
4342
"test": "jest",
4443
"test:watch": "npm test -- --watch",
4544
"test:cov": "npm test -- --coverage",
46-
"build": "npm run build-types && rollup -c",
45+
"build": "rollup -c",
4746
"prepare": "npm run clean && npm run check-types && npm run format:check && npm run lint && npm test",
48-
"build-types": "tsc --emitDeclarationOnly",
4947
"check-types": "tsc --noEmit",
5048
"examples:lint": "eslint --ext js,ts examples",
5149
"examples:test": "cross-env CI=true babel-node examples/testAll.js"

rollup.config.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import pkg from './package.json'
99
export default [
1010
// CommonJS
1111
{
12-
input: 'src/index.ts',
12+
input: 'src/redux.ts',
1313
output: { file: 'lib/redux.js', format: 'cjs', indent: false },
1414
external: [
1515
...Object.keys(pkg.dependencies || {}),
@@ -26,7 +26,7 @@ export default [
2626

2727
// ES
2828
{
29-
input: 'src/index.ts',
29+
input: 'src/redux.ts',
3030
output: { file: 'es/redux.js', format: 'es', indent: false },
3131
external: [
3232
...Object.keys(pkg.dependencies || {}),
@@ -43,7 +43,7 @@ export default [
4343

4444
// ES for Browsers
4545
{
46-
input: 'src/index.ts',
46+
input: 'src/redux.ts',
4747
output: { file: 'es/redux.mjs', format: 'es', indent: false },
4848
plugins: [
4949
nodeResolve({
@@ -69,7 +69,7 @@ export default [
6969

7070
// UMD Development
7171
{
72-
input: 'src/index.ts',
72+
input: 'src/redux.ts',
7373
output: {
7474
file: 'dist/redux.js',
7575
format: 'umd',
@@ -92,7 +92,7 @@ export default [
9292

9393
// UMD Production
9494
{
95-
input: 'src/index.ts',
95+
input: 'src/redux.ts',
9696
output: {
9797
file: 'dist/redux.min.js',
9898
format: 'umd',
File renamed without changes.

test/typescript.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { checkDirectory } from 'typings-tester'
22

33
describe('TypeScript definitions', function() {
4-
it('should compile against index.d.ts', () => {
4+
it('should compile against redux.d.ts', () => {
55
checkDirectory(__dirname + '/typescript')
66
})
77
})

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": ["types/index.d.ts"]
7+
"redux": ["lib/redux.d.ts"]
88
}
99
}
1010
}

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"jsx": "react" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */,
1313
"declaration": true /* Generates corresponding '.d.ts' file. */,
1414
"declarationMap": true /* Generates a sourcemap for each corresponding '.d.ts' file. */,
15-
"declarationDir": "./types" /* Output directory for generated declaration files. */,
15+
// "declarationDir": "./types" /* Output directory for generated declaration files. */,
1616
// "emitDeclarationOnly": true /* Only emit ‘.d.ts’ declaration files. */,
1717
"sourceMap": true /* Generates corresponding '.map' file. */,
1818
// "outFile": "./", /* Concatenate and emit output to single file. */

0 commit comments

Comments
 (0)