Skip to content

Commit

Permalink
refactor: add esmodule & use react.createRef & update dev env (#45)
Browse files Browse the repository at this point in the history
* refactor: add esmodule & use react.createRef & update dev env

* update

* update

* update
  • Loading branch information
evenchange4 committed Dec 10, 2018
1 parent 9915339 commit 382119d
Show file tree
Hide file tree
Showing 61 changed files with 8,993 additions and 10,503 deletions.
16 changes: 0 additions & 16 deletions .babelrc

This file was deleted.

18 changes: 18 additions & 0 deletions .eslintignore
@@ -0,0 +1,18 @@
node_modules/

# jest
coverage/

# lib
lib/
es/

# include (negative ignore)
!.storybook/
storybook-static

# flow
flow-typed/

# pkg
pkg/
3 changes: 3 additions & 0 deletions .flowconfig
@@ -1,5 +1,8 @@
[ignore]

<PROJECT_ROOT>/es/.*
<PROJECT_ROOT>/lib/.*

[include]

[libs]
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -8,6 +8,7 @@

# production
/storybook-static
/es
/lib

# misc
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
@@ -1 +1 @@
9.8.0
11.3.0
10 changes: 10 additions & 0 deletions .prettierignore
@@ -0,0 +1,10 @@
# web
lib/
es/
storybook-static

# flow
flow-typed/

# test
coverage/
3 changes: 3 additions & 0 deletions .prettierrc.js
@@ -0,0 +1,3 @@
const config = require('hsu-scripts/prettier.config');

module.exports = config;
26 changes: 15 additions & 11 deletions .storybook/config.js
@@ -1,17 +1,21 @@
// @flow
import { configure, addDecorator, setAddon } from '@storybook/react';
import infoAddon, { setDefaults } from '@storybook/addon-info';
import { setOptions } from '@storybook/addon-options';
import { configure, addDecorator } from '@storybook/react';
import { withInfo } from '@storybook/addon-info';
import { withOptions } from '@storybook/addon-options';
import decorator from './decorator';

setAddon(infoAddon);
setDefaults({ inline: true });
setOptions({
name: 'react-input-files',
url: 'https://github.com/evenchange4/react-input-files',
sortStoriesByKind: true,
});
addDecorator(decorator);
addDecorator(withInfo({ inline: true }));
addDecorator(
withOptions({
name: 'react-input-files',
url: 'https://github.com/evenchange4/react-input-files',
sortStoriesByKind: true,
}),
);

const context = (require: any).context('../src/', true, /\.example\.js$/);
// $FlowFixMe
const context = require.context('../src/', true, /\.example\.js$/);
function loadStories() {
context.keys().forEach(context);
}
Expand Down
8 changes: 8 additions & 0 deletions .storybook/decorator.js
@@ -0,0 +1,8 @@
// @flow
import * as React from 'react';

export default function(
renderStory: () => React.Element<*> | Array<React.Element<*>>,
) {
return <div id="snapshot">{renderStory()}</div>;
}
17 changes: 10 additions & 7 deletions .travis.yml
@@ -1,11 +1,11 @@
sudo: false
language: node_js
node_js:
- "9.8.0"
- '11.3.0'

env:
global:
- YARN_VERSION=1.5.1
- YARN_VERSION=1.12.3

before_install:
- export PATH="$HOME/.yarn/bin:$PATH"
Expand All @@ -14,12 +14,14 @@ before_install:
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version $YARN_VERSION
fi
install:
- yarn install --pure-lockfile

script:
- yarn run eslint
- yarn run test
- yarn run flow
- yarn run flow-coverage
- yarn run build
- yarn run build-storybook

after_success:
- ./node_modules/.bin/codecov
Expand All @@ -28,7 +30,7 @@ deploy:
- provider: npm
email: evenchange4@gmail.com
api_key:
secure: T4mus4TyMhAg7Z4Z2bTmyMzgHtsyU4bmzoxG4F2HgCa9RB6lVZp6E6zukxLQTreCS041JoSxgKzwhJ8fkmQH1vhC9fOBiMyC/oWkEFcNf6pYqbzAAxn6Y3OBSuyxc4CGMCPQjpUCwAo3C3Alwd0w58LjvpiyvU2p46JTV1+zSvpasGRqs5R/ovU/2gHv6XrKXc+60u/+RsyuBGde/gMykcqZwDdrZZ4E11HIUxX8rv7eLDVxSeLRJeu44ruqJzMV7TF8Hjg5dpjLq4mmiylLlLFhsUA36RsCvu+PRv5qZweNrH04LvN6WW+NZx9HpttxBSDsqiHI1VesSJYupMBJZ0Fhn8HJ85BZBd4Nucjwr2C2GgpXqijeFvELV4bsX+Nlid9JgIHP+qvmF+rAgsRB/FRs1EZTHFVKg9eeLdnHROUvuefIwVM/S1w8/ZKcuyKWpUqENytgMLjEgXofYczTfuDQzE0txdGq3iXPpzPpsiQVTNZGIwY6cTm1W+/Nsz/BYI1+qjNsXXpSopEEyG3Bop9D+ygoCr3clGKrEx2K1UKU5pB6dECkx82hImfsONnXysGW0vDxg1E3yGIq39biC1cgSSyiQdBfJAF1C6yvjMGIb8r7OLj19dVOH0H5FLzy6+XPhrWTSKEf3+mEi4nb+GgQoQrxQpkqt8+xc20AQu0=
secure: ''
skip_cleanup: true
on:
tags: true
Expand All @@ -37,8 +39,9 @@ deploy:
cache:
yarn: true
directories:
- "~/.yarn"
- '~/.yarn'
- node_modules

notifications:
email: evenchange4@gmail.com
email:
- evenchange4@gmail.com
6 changes: 3 additions & 3 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,6 @@

### v1.0.0 (2018/01/29 06:08 +00:00)

* [8124be4](https://github.com/evenchange4/react-input-files/commit/8124be4d31c88680367ac7e72aa8a59c77e006da) 1.0.0 (@evenchange4)
* [3645b5a](https://github.com/evenchange4/react-input-files/commit/3645b5a312c5b3f9aec4da0a6037c3a3c8e883a4) fix(test): update snapshot (@evenchange4)
* [6da0567](https://github.com/evenchange4/react-input-files/commit/6da05673cc1d69f1456e26132a6aec0841a0ce45) feat: init (@evenchange4)
- [8124be4](https://github.com/evenchange4/react-input-files/commit/8124be4d31c88680367ac7e72aa8a59c77e006da) 1.0.0 (@evenchange4)
- [3645b5a](https://github.com/evenchange4/react-input-files/commit/3645b5a312c5b3f9aec4da0a6037c3a3c8e883a4) fix(test): update snapshot (@evenchange4)
- [6da0567](https://github.com/evenchange4/react-input-files/commit/6da05673cc1d69f1456e26132a6aec0841a0ce45) feat: init (@evenchange4)
14 changes: 7 additions & 7 deletions README.md
Expand Up @@ -22,7 +22,7 @@ $ yarn add react-input-files

## Demo

* https://react-input-files.netlify.com/
- https://react-input-files.netlify.com/

## Usage

Expand All @@ -39,7 +39,7 @@ import InputFiles from 'react-input-files';
```js
type Props = {
children: React.Node,
onChange: (files: Array<Object>, e: SyntheticEvent<HTMLInputElement>) => void,
onChange: (files: Array<File>, e: SyntheticEvent<HTMLInputElement>) => void,
accept?: string,
style?: Object,
};
Expand All @@ -49,8 +49,8 @@ type Props = {

### Requirements

* node >= 9.8.0
* yarn >= 1.5.1
- node >= 11.3.0
- yarn >= 1.12.3

```sh
$ yarn install --pure-lockfile
Expand All @@ -71,9 +71,9 @@ $ yarn run build

## CONTRIBUTING

* ⇄ Pull requests and ★ Stars are always welcome.
* For bugs and feature requests, please create an issue.
* Pull requests must be accompanied by passing automated tests.
- ⇄ Pull requests and ★ Stars are always welcome.
- For bugs and feature requests, please create an issue.
- Pull requests must be accompanied by passing automated tests.

## [CHANGELOG](CHANGELOG.md)

Expand Down
80 changes: 0 additions & 80 deletions flow-typed/npm/@babel/cli_vx.x.x.js

This file was deleted.

0 comments on commit 382119d

Please sign in to comment.