Skip to content

Commit c60aca9

Browse files
committed
fix: types again
1 parent 112151b commit c60aca9

File tree

7 files changed

+4536
-3908
lines changed

7 files changed

+4536
-3908
lines changed

.travis.yml

+12-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
sudo: false
22

33
language: node_js
4+
45
node_js:
5-
- '9'
6-
- '8'
7-
after_script:
8-
- yarn codecov
6+
- "10"
7+
- "8"
98

109
after_success:
11-
- yarn run build
12-
- yarn travis-deploy-once "yarn semantic-release"
10+
- yarn codecov
1311

1412
cache: yarn
1513
branches:
1614
only:
1715
- master
16+
17+
jobs:
18+
include:
19+
- stage: release
20+
node_js: "10"
21+
script:
22+
- yarn run build
23+
- yarn semantic-release

package.json

+26-26
Original file line numberDiff line numberDiff line change
@@ -54,35 +54,35 @@
5454
"pkgRoot": "lib"
5555
},
5656
"devDependencies": {
57-
"@4c/babel-preset-4catalyzer": "^1.0.0",
58-
"@4c/semantic-release-config": "^1.0.2",
59-
"@babel/cli": "^7.0.0-beta.39",
60-
"@babel/core": "^7.0.0-beta.39",
61-
"@types/react": "^16.7.8",
57+
"@4c/babel-preset-4catalyzer": "^4.1.1",
58+
"@4c/semantic-release-config": "^1.0.3",
59+
"@babel/cli": "^7.2.3",
60+
"@babel/core": "^7.3.4",
61+
"@types/react": "^16.8.5",
6262
"babel-core": "bridge",
63-
"babel-eslint": "^8.2.1",
64-
"babel-jest": "^22.4.3",
65-
"codecov": "^3.0.2",
63+
"babel-eslint": "^10.0.1",
64+
"babel-jest": "^24.1.0",
65+
"codecov": "^3.2.0",
6666
"cpy-cli": "^2.0.0",
6767
"dtslint": "^0.3.0",
68-
"enzyme": "^3.7.0",
69-
"enzyme-adapter-react-16": "^1.6.0",
70-
"eslint": "^4.16.0",
71-
"eslint-config-4catalyzer-react": "^0.4.1",
72-
"eslint-config-prettier": "^2.9.0",
73-
"eslint-plugin-import": "^2.8.0",
74-
"eslint-plugin-jest": "^21.7.0",
75-
"eslint-plugin-jsx-a11y": "^6.0.3",
76-
"eslint-plugin-prettier": "^2.5.0",
77-
"eslint-plugin-react": "^7.5.1",
78-
"husky": "^0.14.3",
79-
"jest": "^22.4.3",
80-
"lint-staged": "^7.1.0",
81-
"prettier": "^1.10.2",
82-
"react": "^16.6.0",
83-
"react-dom": "^16.6.0",
84-
"semantic-release": "^15.4.0",
85-
"travis-deploy-once": "^5.0.0"
68+
"enzyme": "^3.9.0",
69+
"enzyme-adapter-react-16": "^1.10.0",
70+
"eslint": "^5.14.1",
71+
"eslint-config-4catalyzer-react": "^0.9.0",
72+
"eslint-config-prettier": "^4.0.0",
73+
"eslint-plugin-import": "^2.16.0",
74+
"eslint-plugin-jest": "^22.3.0",
75+
"eslint-plugin-jsx-a11y": "^6.2.1",
76+
"eslint-plugin-prettier": "^3.0.1",
77+
"eslint-plugin-react": "^7.12.4",
78+
"husky": "^1.3.1",
79+
"jest": "^24.1.0",
80+
"lint-staged": "^8.1.4",
81+
"prettier": "^1.16.4",
82+
"react": "^16.8.3",
83+
"react-dom": "^16.8.3",
84+
"semantic-release": "^15.13.3",
85+
"travis-deploy-once": "^5.0.11"
8686
},
8787
"peerDependencies": {
8888
"react": ">=16.3.2"

types/forwardRef.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// TypeScript Version: 3.0
22

3-
declare module 'react-context-toolbox/forwardRef' {
3+
declare module '@restart/context/forwardRef' {
44
import * as React from 'react';
55

66
interface ForwardRefOptions<TProps> {

types/index.d.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// TypeScript Version: 3.0
22

3-
declare module 'react-context-toolbox' {
4-
import mapContextToProps from 'react-context-toolbox/mapContextToProps';
5-
import forwardRef from 'react-context-toolbox/forwardRef';
3+
declare module '@restart/context' {
4+
import mapContextToProps from '@restart/context/mapContextToProps';
5+
import forwardRef from '@restart/context/forwardRef';
66

77
export { mapContextToProps, forwardRef };
88
}

types/mapContextToProps.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// TypeScript Version: 3.0
22

3-
declare module 'react-context-toolbox/mapContextToProps' {
3+
declare module '@restart/context/mapContextToProps' {
44
import * as React from 'react';
55

66
type Omit<T, U> = Pick<T, Exclude<keyof T, keyof U>>;

types/test.tsx

+14-14
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import * as React from 'react';
44

5-
import { forwardRef, mapContextToProps } from 'react-context-toolbox';
5+
import { forwardRef, mapContextToProps } from '@restart/context';
66

77
const Foo = (props: {
88
bar: boolean;
@@ -15,11 +15,11 @@ const ForwardedFoo = forwardRef(
1515
),
1616
);
1717

18-
<ForwardedFoo bar={false} />;
19-
<ForwardedFoo bar={false} ref={React.createRef()} />;
18+
<ForwardedFoo bar={false} />;
19+
<ForwardedFoo bar={false} ref={React.createRef()} />;
2020

2121
// $ExpectError
22-
<Foo bar={false} ref={React.createRef()} />;
22+
<Foo bar={false} ref={React.createRef()} />;
2323

2424
const Context1 = React.createContext<boolean>(false);
2525

@@ -31,10 +31,10 @@ const MappedFoo1 = mapContextToProps(
3131
Foo,
3232
);
3333

34-
<MappedFoo1 />;
34+
<MappedFoo1 />;
3535

3636
// $ExpectError
37-
<MappedFoo1 bar={false} />;
37+
<MappedFoo1 bar={false} />;
3838

3939
const MappedFoo2 = mapContextToProps(
4040
Context1,
@@ -44,12 +44,12 @@ const MappedFoo2 = mapContextToProps(
4444
Foo,
4545
);
4646

47-
<MappedFoo2 />;
47+
<MappedFoo2 />;
4848

49-
<MappedFoo2 bar={false} />;
49+
<MappedFoo2 bar={false} />;
5050

5151
// $ExpectError
52-
<MappedFoo2 bar="foo" />;
52+
<MappedFoo2 bar="foo" />;
5353

5454
const Curried = mapContextToProps(
5555
Context1,
@@ -60,9 +60,9 @@ const Curried = mapContextToProps(
6060

6161
const MappedFoo3 = Curried(Foo);
6262

63-
<MappedFoo3 />;
63+
<MappedFoo3 />;
6464

65-
<MappedFoo3 bar={false} />;
65+
<MappedFoo3 bar={false} />;
6666

6767
const Context2 = React.createContext<string>('baz');
6868
const Context3 = React.createContext<string>('baz');
@@ -83,20 +83,20 @@ const Foo2Context = mapContextToProps(
8383
MultiFoo,
8484
);
8585

86-
<Foo2Context />;
86+
<Foo2Context />;
8787

8888
const Foo3Context = mapContextToProps(
8989
[Context1, Context2, Context3],
9090
(v1, v2, v3) => ({ v1, v2, v3 }),
9191
MultiFoo,
9292
);
9393

94-
<Foo3Context />;
94+
<Foo3Context />;
9595

9696
const Foo4Context = mapContextToProps(
9797
[Context1, Context2, Context3, Context4],
9898
(v1, v2, v3, v4) => ({ v1, v2, v3, v4 }),
9999
MultiFoo,
100100
);
101101

102-
<Foo4Context />;
102+
<Foo4Context />;

0 commit comments

Comments
 (0)