Skip to content

Commit

Permalink
Make build great again
Browse files Browse the repository at this point in the history
  • Loading branch information
nkbt committed Aug 6, 2017
1 parent 6d401fd commit 8b220a4
Show file tree
Hide file tree
Showing 48 changed files with 1,270 additions and 1,472 deletions.
38 changes: 38 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
version: 2


jobs:
build:
working_directory: ~/react-collapse
docker:
- image: circleci/node:8
- image: selenium/standalone-firefox:3.4.0

steps:
- checkout


- restore_cache:
key: deps-{{ checksum "yarn.lock" }}


- run: yarn install --pure-lockfile


- save_cache:
key: deps-{{ checksum "yarn.lock" }}
paths:
- node_modules


- run: yarn lint


- run: yarn test


- run:
name: yarn e2e
command: |
export DOCKER_IP=$(ifconfig | grep "inet addr:" | grep "Bcast:0.0.0.0" | cut -d: -f2 | awk '{ print $1}')
yarn e2e
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# editorconfig.org
root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2
4 changes: 2 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/example/
/lib/
/node_modules/
/build/
/lib/
/pub/
/reports/
333 changes: 31 additions & 302 deletions .eslintrc

Large diffs are not rendered by default.

8 changes: 2 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,13 @@ pids
*.pid
*.seed

/build/

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
/node_modules/

/build/
/lib/
/example/
/.coveralls.yml
/pub/
/reports/

/.eslintcache

.idea/
1 change: 0 additions & 1 deletion .npmignore

This file was deleted.

15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
[![Gitter](https://img.shields.io/gitter/room/nkbt/help.svg?style=flat-square)](https://gitter.im/nkbt/help)

[![CircleCI](https://img.shields.io/circleci/project/nkbt/react-collapse.svg?style=flat-square&label=nix-build)](https://circleci.com/gh/nkbt/react-collapse)
[![AppVeyor](https://img.shields.io/appveyor/ci/nkbt/react-collapse.svg?style=flat-square&label=win-build)](https://ci.appveyor.com/project/nkbt/react-collapse)
[![Coverage](https://img.shields.io/codecov/c/github/nkbt/react-collapse.svg?style=flat-square)](https://codecov.io/github/nkbt/react-collapse?branch=master)
[![Dependencies](https://img.shields.io/david/nkbt/react-collapse.svg?style=flat-square)](https://david-dm.org/nkbt/react-collapse)
[![Dev Dependencies](https://img.shields.io/david/dev/nkbt/react-collapse.svg?style=flat-square)](https://david-dm.org/nkbt/react-collapse#info=devDependencies)

Expand Down Expand Up @@ -36,7 +34,7 @@ Don't forget to manually install peer dependencies (`react`, `react-motion`) if

## Demo

[http://nkbt.github.io/react-collapse/example](http://nkbt.github.io/react-collapse/example)
[http://nkbt.github.io/react-collapse](http://nkbt.github.io/react-collapse)

## Codepen demo

Expand Down Expand Up @@ -289,7 +287,7 @@ All other props are applied to a container that is being resized. So it is possi

Currently is being developed and tested with the latest stable `Node 8` on `OSX`.

To run example covering all `ReactCollapse` features, use `yarn start`, which will compile `src/example/Example.js`
To run example covering all `ReactCollapse` features, use `yarn start`, which will compile `example/Example.js`

```bash
git clone [email protected]:nkbt/react-collapse.git
Expand All @@ -304,12 +302,13 @@ open http://localhost:8080
## Tests

```bash
yarn test
# to run ESLint check
yarn lint

# to generate test coverage (./reports/coverage)
yarn cov
# to run tests
yarn test

# to run end-to-end smoketest
# to run end-to-end tests
yarn e2e
```

Expand Down
16 changes: 0 additions & 16 deletions circle.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import {UnmountClosed} from '../..';
import {UnmountClosed} from '../../src';


class Test extends React.PureComponent {
Expand Down
21 changes: 15 additions & 6 deletions src/example/App/FixedHeight.js → example/App/FixedHeight.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import {Collapse} from '../..';
import {Collapse} from '../../src';


export class FixedHeight extends React.PureComponent {
Expand All @@ -17,26 +17,35 @@ export class FixedHeight extends React.PureComponent {
<div className="config">
<label className="label">
Opened:
<input className="input"
<input
className="input"
type="checkbox"
checked={isOpened}
onChange={({target: {checked}}) => this.setState({isOpened: checked})} />
</label>

<label className="label">
Content height:
<input className="input"
<input
className="input"
type="range"
value={height} step={50} min={0} max={500}
value={height}
step={50}
min={0}
max={500}
onChange={({target: {value}}) => this.setState({height: parseInt(value, 10)})} />
{height}
</label>

<label className="label">
Collapse height:
<input className="input"
<input
className="input"
type="range"
value={fixedHeight} step={50} min={0} max={500}
value={fixedHeight}
step={50}
min={0}
max={500}
onChange={({target: {value}}) => this.setState({fixedHeight: parseInt(value, 10)})} />
{fixedHeight}
</label>
Expand Down
13 changes: 9 additions & 4 deletions src/example/App/Hooks.js → example/App/Hooks.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import {Collapse} from '../..';
import {Collapse} from '../../src';
import text from './text.json';


Expand Down Expand Up @@ -46,7 +46,8 @@ export class Hooks extends React.PureComponent {
<div className="config">
<label className="label">
Opened:
<input className="input"
<input
className="input"
type="checkbox"
checked={isOpened}
onChange={({target: {checked}}) => this.setState({
Expand All @@ -57,9 +58,13 @@ export class Hooks extends React.PureComponent {

<label className="label">
Paragraphs:
<input className="input"
<input
className="input"
type="range"
value={paragraphs} step={1} min={0} max={4}
value={paragraphs}
step={1}
min={0}
max={4}
onChange={({target: {value}}) => this.setState({
paragraphs: parseInt(value, 10),
isResting: false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import {Collapse} from '../..';
import {Collapse} from '../../src';


export class InitiallyOpened extends React.PureComponent {
Expand All @@ -17,7 +17,8 @@ export class InitiallyOpened extends React.PureComponent {
<div className="config">
<label className="label">
Opened:
<input className="input"
<input
className="input"
type="checkbox"
checked={isOpened}
onChange={({target: {checked}}) => this.setState({isOpened: checked})} />
Expand Down
2 changes: 1 addition & 1 deletion src/example/App/Issue163.js → example/App/Issue163.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import {Collapse} from '../..';
import {Collapse} from '../../src';


export class Issue163 extends React.PureComponent {
Expand Down
4 changes: 2 additions & 2 deletions src/example/App/Issue40.js → example/App/Issue40.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import {Collapse} from '../..';
import {Collapse} from '../../src';
import {VariableHeight} from './VariableHeight';


Expand All @@ -26,7 +26,7 @@ export class Issue40 extends React.PureComponent {
</label>
</div>

<Collapse isOpened={isOpened} hasNestedCollapse={true}>
<Collapse isOpened={isOpened} hasNestedCollapse>
<VariableHeight className="subCollapse" />
</Collapse>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/example/App/Issue59.js → example/App/Issue59.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import {Collapse} from '../..';
import {Collapse} from '../../src';


const styles = {
Expand Down
2 changes: 1 addition & 1 deletion src/example/App/Issue66.js → example/App/Issue66.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import {Collapse} from '../..';
import {Collapse} from '../../src';


class Test extends React.Component {
Expand Down
7 changes: 4 additions & 3 deletions src/example/App/Nested.js → example/App/Nested.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import {Collapse} from '../..';
import {Collapse} from '../../src';
import {VariableHeight} from './VariableHeight';


Expand All @@ -18,14 +18,15 @@ export class Nested extends React.PureComponent {
<div className="config">
<label className="label">
Opened:
<input className="input"
<input
className="input"
type="checkbox"
checked={isOpened}
onChange={({target: {checked}}) => this.setState({isOpened: checked})} />
</label>
</div>

<Collapse isOpened={isOpened} hasNestedCollapse={true}>
<Collapse isOpened={isOpened} hasNestedCollapse>
<VariableHeight className="subCollapse" />
<VariableHeight className="subCollapse" />
<VariableHeight className="subCollapse" />
Expand Down
37 changes: 27 additions & 10 deletions src/example/App/SpringConfig.js → example/App/SpringConfig.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import {presets} from 'react-motion';
import {Collapse} from '../..';
import {Collapse} from '../../src';


export class SpringConfig extends React.PureComponent {
Expand Down Expand Up @@ -29,44 +29,61 @@ export class SpringConfig extends React.PureComponent {
<div className="config">
<label className="label">
Opened:
<input className="input"
<input
className="input"
type="checkbox"
checked={isOpened}
onChange={({target: {checked}}) => this.setState({isOpened: checked})} />
</label>

<label className="label">
Content height:
<input className="input"
<input
className="input"
type="range"
value={height} step={50} min={0} max={500}
value={height}
step={50}
min={0}
max={500}
onChange={({target: {value}}) => this.setState({height: parseInt(value, 10)})} />
{height}
</label>

<label className="label">
Preset:
<select className="input"
value={preset} step={10} min={0} max={300}
<select
className="input"
value={preset}
step={10}
min={0}
max={300}
onChange={this.onChangePreset}>
{Object.keys(presets).map(p => <option key={p} value={p}>{p}</option>)}
</select>
</label>

<label className="label">
Stiffness:
<input className="input"
<input
className="input"
type="range"
value={stiffness} step={10} min={0} max={300}
value={stiffness}
step={10}
min={0}
max={300}
onChange={({target: {value}}) => this.setState({stiffness: parseInt(value, 10)})} />
{stiffness}
</label>

<label className="label">
Damping:
<input className="input"
<input
className="input"
type="range"
value={damping} step={5} min={0} max={40}
value={damping}
step={5}
min={0}
max={40}
onChange={({target: {value}}) => this.setState({damping: parseInt(value, 10)})} />
{damping}
</label>
Expand Down
Loading

0 comments on commit 8b220a4

Please sign in to comment.