Skip to content

Commit e682bbb

Browse files
petegleesonNoviny
authored andcommitted
upgrades flow-bin to 0.97.0 (#69)
* upgrades flow-bin to 0.97.0 * Bump flowbin@0.98.0, using preconstruct to build cjs, adds @babel/core@7.4.4 and [presets] * WIP - we need to make test pass..... * Convert packages to ES modules and use babel-jest for tests * Revert back to index.test.js * Revert babel-loader and update babel core * Cleaning up after Peter * Require e-r-t for CJS with .default * updates test failing after babel upgrade * adds babel information * adds changeset * ignores flow problems * upgrade preconstruct and add postinstall step that ensure flow types are available between pacakges * drops npx prefix in postinstall * adds src to extract-react-types published files * changes extractReactTypes to be a named export * updates changeset to reflect named export change * Delete TODO.md * replaces comment style type annotations with standard annotations
1 parent b93ffae commit e682bbb

File tree

23 files changed

+2081
-1359
lines changed

23 files changed

+2081
-1359
lines changed

.babelrc

Lines changed: 0 additions & 10 deletions
This file was deleted.

.changeset/49d8c6a2/changes.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"releases": [{ "name": "extract-react-types", "type": "minor" }],
3+
"dependents": [
4+
{
5+
"name": "babel-plugin-extract-react-types",
6+
"type": "patch",
7+
"dependencies": ["extract-react-types"]
8+
},
9+
{
10+
"name": "extract-react-types-loader",
11+
"type": "patch",
12+
"dependencies": ["extract-react-types"]
13+
},
14+
{ "name": "kind2string", "type": "patch", "dependencies": ["extract-react-types"] },
15+
{
16+
"name": "pretty-proptypes",
17+
"type": "patch",
18+
"dependencies": ["kind2string", "extract-react-types"]
19+
}
20+
]
21+
}

.changeset/49d8c6a2/changes.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Changes default export of `extract-react-types` to a named export. See below for changes.
2+
3+
```diff
4+
-import extractReactTypes from 'extract-react-types';
5+
+import { extractReactTypes } from 'extract-react-types';
6+
// or in cjs
7+
-const extractReactTypes = require('extract-react-types');
8+
+const { extractReactTypes } = require('extract-react-types');
9+
```

.flowconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
[ignore]
22
.*/packages/kind2string/.*
3+
.*/node_modules/pretty-format2/.*
4+
.*/node_modules/ast-pretty-print/.*
5+
.*/node_modules/pretty-format-ast/.*
6+
37

48
[include]
59

babel.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = api => {
2+
// Cache the returned value forever and don't call this function again.
3+
api.cache(true);
4+
5+
return {
6+
presets: ['@babel/preset-env', '@babel/preset-react', '@babel/preset-flow'],
7+
plugins: [
8+
'emotion',
9+
'@babel/plugin-proposal-class-properties',
10+
'@babel/plugin-transform-runtime'
11+
]
12+
};
13+
};

jest.config.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

package.json

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"changeset": "bolt build-releases changeset",
88
"version-all": "bolt build-releases version",
99
"publish-changed": "yarn validate && build-releases publish --public",
10+
"postinstall": "preconstruct dev",
1011
"dev:pretty-proptypes": "bolt w pretty-proptypes run dev",
1112
"lint": "yarn eslint \"./**/*.js\"",
1213
"validate": "yarn lint && yarn test && yarn flow",
@@ -22,16 +23,21 @@
2223
},
2324
"preconstruct": {
2425
"packages": [
26+
"packages/extract-react-types",
2527
"packages/kind2string",
2628
"packages/pretty-proptypes"
2729
]
2830
},
31+
"transform": {
32+
"^.+\\.jsx?$": "babel-jest"
33+
},
2934
"dependencies": {
3035
"@atlaskit/build-releases": "^3.0.3",
31-
"@babel/core": "7.0.0-beta.56",
36+
"@babel/core": "^7.4.4",
3237
"@babel/plugin-syntax-flow": "^7.2.0",
3338
"@babel/plugin-syntax-jsx": "^7.2.0",
3439
"@babel/plugin-syntax-typescript": "^7.2.0",
40+
"@babel/runtime": "^7.4.4",
3541
"@babel/types": "^7.0.0-beta.56",
3642
"ast-pretty-print": "^2.0.1",
3743
"babel-errors": "^1.1.1",
@@ -58,10 +64,17 @@
5864
"eslint-plugin-react": "^7.12.4",
5965
"jest-in-case": "^1.0.2",
6066
"react-markings": "^1.2.0",
67+
"resolve": "^1.10.1",
6168
"strip-indent": "^2.0.0"
6269
},
6370
"devDependencies": {
71+
"@babel/plugin-proposal-class-properties": "^7.4.4",
72+
"@babel/plugin-transform-runtime": "^7.4.4",
73+
"@babel/preset-env": "^7.4.4",
74+
"@babel/preset-flow": "^7.0.0",
75+
"@babel/preset-react": "^7.0.0",
6476
"babel-cli": "^6.26.0",
77+
"babel-jest": "^24.7.1",
6578
"babel-plugin-emotion": "^9.1.0",
6679
"babel-plugin-syntax-dynamic-import": "^6.18.0",
6780
"babel-plugin-transform-class-properties": "^6.24.1",
@@ -72,11 +85,11 @@
7285
"babel-preset-react": "^6.24.1",
7386
"enzyme": "^3.3.0",
7487
"enzyme-adapter-react-16": "^1.1.1",
75-
"flow-bin": "^0.69.0",
76-
"jest": "^23.6.0",
88+
"flow-bin": "^0.98.0",
89+
"jest": "^24.7.1",
7790
"jest-in-case": "^1.0.2",
7891
"jsdom": "^11.7.0",
79-
"preconstruct": "^0.0.58",
92+
"preconstruct": "^0.0.64",
8093
"prettier": "^1.13.7",
8194
"react": "^16.3.1",
8295
"react-addons-test-utils": "^15.6.2",

packages/babel-plugin-extract-react-types/index.test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,9 @@ jestInCase(
270270
require.resolve('./index'),
271271
require.resolve('@babel/plugin-syntax-jsx'),
272272
require.resolve('@babel/plugin-syntax-flow')
273-
]
273+
],
274+
babelrc: false,
275+
configFile: false
274276
}).code;
275277
expect(transformedCode).toMatchSnapshot();
276278
},
@@ -300,7 +302,9 @@ jestInCase(
300302
require.resolve('./index'),
301303
require.resolve('@babel/plugin-syntax-jsx'),
302304
require.resolve('@babel/plugin-syntax-typescript')
303-
]
305+
],
306+
babelrc: false,
307+
configFile: false
304308
}).code;
305309
expect(transformedCode).toMatchSnapshot();
306310
},

packages/babel-plugin-extract-react-types/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
"extract-react-types": "^0.16.0"
2121
},
2222
"devDependencies": {
23-
"@babel/core": "7.0.0-beta.56",
23+
"@babel/core": "^7.4.4",
2424
"@babel/plugin-syntax-flow": "^7.2.0",
2525
"@babel/plugin-syntax-jsx": "^7.2.0",
2626
"@babel/plugin-syntax-typescript": "^7.2.0",
2727
"jest-in-case": "^1.0.2"
2828
}
29-
}
29+
}

packages/extract-react-types-loader/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// @flow
22

33
const path = require('path');
4-
const extractReactTypes = require('extract-react-types');
4+
const { extractReactTypes } = require('extract-react-types');
55

66
const devProps = {
77
component: {

0 commit comments

Comments
 (0)