Skip to content

Commit 7d705b3

Browse files
committed
chore: upgrade 'babel' to version 7, 'ava' to version 1, 'react' and other modules
- change `prop-types` dependency as suggested by Dan Abramov [here](facebook/prop-types#44). Fixes #110. - upgrade babel to version 7 by using [babel-upgrade](https://github.com/babel/babel-upgrade). - upgrade ava to version 1 and adjust the configuration. - update `ava` test snapshots to version 2. - rework the test scripts to have: "test:ci", "test" and "watch:test". - install [esm](https://github.com/standard-things/esm) to load ES6 modules in `ava` tests. - upgrade `eslint` and other modules excluding `flag-icon-css` to the latest versions. - pin `postcss-custom-properties` to version 7 because the next version is async and `css-modules-require-hook`only supports sync modules. - update lock files. test: add 'test.js' extension to test files chore: bump 'flag-icon-css' to '3.2.1', tweak 'prebuild' scripts docs: add reference to 'TypeScript' definitions for this module chore: run 'flow-typed update' and exclude 'react-test-renderer' (errors, needs work)
1 parent 8cfce57 commit 7d705b3

File tree

68 files changed

+8556
-9806
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+8556
-9806
lines changed

.babelrc

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,40 @@
11
{
22
"presets": [
3-
"react"
3+
"@babel/preset-react",
4+
"@babel/preset-flow"
45
],
56
"plugins": [
6-
"transform-object-rest-spread",
7-
"transform-export-extensions"
7+
"@babel/plugin-proposal-object-rest-spread",
8+
"@babel/plugin-proposal-export-default-from",
9+
"@babel/plugin-proposal-export-namespace-from"
810
],
911
"comments": false,
1012
"env": {
1113
"build": {
12-
"presets": ["es2015"],
13-
"ignore": ["**/__tests__/"]
14+
"presets": [
15+
"@babel/preset-env"
16+
],
17+
"ignore": [
18+
"**/__tests__/"
19+
]
1420
},
1521
"module": {
1622
"presets": [
17-
["es2015", {
18-
"modules": false
19-
}]
23+
[
24+
"@babel/preset-env",
25+
{
26+
"modules": false
27+
}
28+
]
2029
],
21-
"ignore": ["**/__tests__/"]
30+
"ignore": [
31+
"**/__tests__/"
32+
]
2233
},
2334
"testing": {
24-
"presets": ["es2015"],
25-
"plugins": ["babel-plugin-istanbul"]
35+
"plugins": [
36+
"babel-plugin-istanbul"
37+
]
2638
}
2739
}
2840
}

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,11 @@ const FlagIcon = CustomFlagIconFactory(React, options)
231231

232232
**Runtime type checking**: in development mode (`process.env.NODE_ENV !== 'production'`), when using unsupported props or prop values, you are warned at runtime by *Failed prop type* errors in the browser console. Feature powered by [`prop-types`](https://github.com/reactjs/prop-types).
233233

234-
**Static type checking**: if you use Facebook's [`flow`](https://github.com/facebook/flow) in your app (otherwise you can skip this section, unless you want to submit a pull request), it should automatically pick up this package's definitions from the `.js.flow` files that are distributed with it, checking your code accordingly when you run `yarn flow`. Using the latest `Flow` version or the version in `./package.json` is recommended. We also recommend using a `Flow`-aware editor such as [`Nuclide`](https://nuclide.io/) for [`Atom`](https://atom.io/).
234+
**Static type checking**:
235+
236+
If you use Facebook's [`flow`](https://github.com/facebook/flow) in your app (otherwise you can skip this section, unless you want to submit a pull request), it should automatically pick up this package's definitions from the `.js.flow` files that are distributed with it, checking your code accordingly when you run `yarn flow`. Using the latest `Flow` version or the version in `./package.json` is recommended. We also recommend using a `Flow`-aware editor such as [`Nuclide`](https://nuclide.io/) for [`Atom`](https://atom.io/).
237+
238+
If you use Microsoft's [`TypeScript`](https://www.typescriptlang.org/) in your app (otherwise you can skip this section, unless you want to submit a pull request), the package that contains the type definitions for this module is: [@types/react-flag-icon-css](https://www.npmjs.com/package/@types/react-flag-icon-css).
235239

236240
## Contributing
237241

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
// flow-typed signature: 1b3886eca11e35f7cf8fe31aa44c0d13
2+
// flow-typed version: <<STUB>>/@babel/cli_v^7.2.3/flow_v0.77.0
3+
4+
/**
5+
* This is an autogenerated libdef stub for:
6+
*
7+
* '@babel/cli'
8+
*
9+
* Fill this stub out by replacing all the `any` types.
10+
*
11+
* Once filled out, we encourage you to share your work with the
12+
* community by sending a pull request to:
13+
* https://github.com/flowtype/flow-typed
14+
*/
15+
16+
declare module '@babel/cli' {
17+
declare module.exports: any;
18+
}
19+
20+
/**
21+
* We include stubs for each file inside this npm package in case you need to
22+
* require those files directly. Feel free to delete any files that aren't
23+
* needed.
24+
*/
25+
declare module '@babel/cli/bin/babel-external-helpers' {
26+
declare module.exports: any;
27+
}
28+
29+
declare module '@babel/cli/bin/babel' {
30+
declare module.exports: any;
31+
}
32+
33+
declare module '@babel/cli/lib/babel-external-helpers' {
34+
declare module.exports: any;
35+
}
36+
37+
declare module '@babel/cli/lib/babel/dir' {
38+
declare module.exports: any;
39+
}
40+
41+
declare module '@babel/cli/lib/babel/file' {
42+
declare module.exports: any;
43+
}
44+
45+
declare module '@babel/cli/lib/babel/index' {
46+
declare module.exports: any;
47+
}
48+
49+
declare module '@babel/cli/lib/babel/options' {
50+
declare module.exports: any;
51+
}
52+
53+
declare module '@babel/cli/lib/babel/util' {
54+
declare module.exports: any;
55+
}
56+
57+
// Filename aliases
58+
declare module '@babel/cli/bin/babel-external-helpers.js' {
59+
declare module.exports: $Exports<'@babel/cli/bin/babel-external-helpers'>;
60+
}
61+
declare module '@babel/cli/bin/babel.js' {
62+
declare module.exports: $Exports<'@babel/cli/bin/babel'>;
63+
}
64+
declare module '@babel/cli/index' {
65+
declare module.exports: $Exports<'@babel/cli'>;
66+
}
67+
declare module '@babel/cli/index.js' {
68+
declare module.exports: $Exports<'@babel/cli'>;
69+
}
70+
declare module '@babel/cli/lib/babel-external-helpers.js' {
71+
declare module.exports: $Exports<'@babel/cli/lib/babel-external-helpers'>;
72+
}
73+
declare module '@babel/cli/lib/babel/dir.js' {
74+
declare module.exports: $Exports<'@babel/cli/lib/babel/dir'>;
75+
}
76+
declare module '@babel/cli/lib/babel/file.js' {
77+
declare module.exports: $Exports<'@babel/cli/lib/babel/file'>;
78+
}
79+
declare module '@babel/cli/lib/babel/index.js' {
80+
declare module.exports: $Exports<'@babel/cli/lib/babel/index'>;
81+
}
82+
declare module '@babel/cli/lib/babel/options.js' {
83+
declare module.exports: $Exports<'@babel/cli/lib/babel/options'>;
84+
}
85+
declare module '@babel/cli/lib/babel/util.js' {
86+
declare module.exports: $Exports<'@babel/cli/lib/babel/util'>;
87+
}

0 commit comments

Comments
 (0)