Skip to content

Commit

Permalink
Carousel 2.0 introduce plugins (#622)
Browse files Browse the repository at this point in the history
* Temporarily remove infinite dots and thumbnails

* Remove ClickToChange prop

* Remove autoplay

* Remove RTL

* Remove slides per page

* Remove slides per scroll

* Remove arrows

* Remove centered

* Remove keepDirectionWhenDragging & minDraggableOffset

* Remove unused imports

* Rewrite carousel to use hooks
* Rewrite carousel to use hooks
* Remove old unit tests
* introduce jest
* introduce yarn workspaces
* remove .npmrc
* update node version in .nvmrc
* update README.md

Update peerDependencies

Fix some linting errors

* Fix all linting errors
* Move simulateEvent function to separate file

Fix CI test & publish commands

Revert previous .bablerc config

Fix publish step

Remove not used startMessage.js

Remove not used .istanbul.yml

Use hook for all event listeners

Move onResize logic to separate hook

Remove not used interval constant

Move function from carousel component to hooks/tools

Create POF of carouselSlidesPerPage plugin

Add POF for infinite plugin

Fix controlled component

Add missing propTypes

Fix resizing carousel

Introduce strategies

Add ClickToChange plugin

Use Recoil for state management

Move plugins to their own directory

Move changing slide behavior logic to recoil state

Add autoplay plugin

Add rtl plugin

Add centered plugin

Add slidesPerScroll plugin

Add arrowsPlugin

Add keepDirectionWhenDragging plugin

Fix controlled component

Remove simple dots from docs

Add plugin resolver

Allow to pass builtin plugins as strings

Rewrite CarouselItem to func component

Add arrows plugin to rtl docs example

Fix RTL plugin with arrows

Add support for responsive carousel

Fix: controlled component with clickToChange and arrows plugins

Fix: dont enable transition on component mount

Fix fast changing slides in infinite plugin

* Fix autoplay with infinite race condition when autoplay and animationSpeed values are the same
* Refactor infinite plugin

Fix RTL with infinite plugin

fix typos and linting errors

Enable e2e tests

Fix swiping left in infinite mode

Add custom class support for dots

Add resize observer

Add support for flex container

Add support for resizing carousel

Add contributors guide

Fix slides flickering when carousel loads

[renovate] Update NPM dependencies

[189] test skip and unskip scripts

fix: only add drag event listeners when dragging is enabled

1.13.12

[renovate] Update dependency html-webpack-plugin to v4

[renovate] Update NPM dependencies

[renovate] Update NPM dependencies

[renovate] Update gatsby

1.13.16

[renovate] Update NPM dependencies

[renovate] Update gatsby

1.13.18

[renovate] Update dependency gatsby to v2.20.7

[renovate] Update NPM dependencies

[renovate] Update dependency gatsby to v2.20.8

[renovate] Update NPM dependencies

Revert "fix: only add drag event listeners when dragging is enabled"

This reverts commit 923fe44.

[392] fix click to change

[392] improve formatting

Revert "Revert "fix: only add drag event listeners when dragging is enabled""

This reverts commit b8f8156.

[392] fix selecting text

[renovate] Update cypress/included Docker tag to v4.3.0

[renovate] Update dependency gatsby to v2.20.10

[renovate] Update NPM dependencies

[renovate] Update dependency chalk to v4

docs-www/reduxcache* in .gitignore

add className support for Dots

bump version

1.13.22

revert react-carousel version on docs-www

change back patch version

add more to readME

fix className retrieval

remove default value

1.13.23

1.13.24

remove unneeded code

remove unused files

require node>=12

1.13.25

Revert "remove unneeded code"

1.13.26

Add badges

Add coverage info

Change order of badges

Add badges, change color and order

Replace links for badges

Change link for activity badge

fix: pass null instead of boolean to drag event listener if disabled

fail for invalid branch name

fix CI

better workflow

update workflow

eat error

check

add origin

remove origin

ci skip

no diff

clean up

sleep

fix CI message

allow master

1.13.27 [ci skip]

update @brainhubeu/react-carousel in docs-www

test/cypress/screenshots/ in .gitignore

ci skip when updating itself in docs

update pull-request-template

update renovate branch

1.13.28 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

1.13.29 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

1.13.30 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

1.13.31 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

[renovate] Update circleci/node Docker tag to v12.16.2

1.13.32 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

more error-prone publishing to NPM

skip checkout in check_branch_name

1.13.33 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

1.13.34 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

[renovate] Update NPM dependencies

1.13.36 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

[renovate] Update cypress/included Docker tag to v4.4.0

1.13.37 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

1.13.38 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

Add carousel gif

Add link for the demo gif

Replace carousel gif with smoother version

1.13.39 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

1.13.40 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

Increase test coverage (#451)

* Migrate to jest and increase test coverage

* Remove not used methods from Carousel

* Generate lcov report

* Add coverage badge

* Fix CI config

* Update yarn.lock

* Update test/unit/carousel.test.js

Co-Authored-By: piotr-s-brainhub <piotr.sroczkowski@brainhub.pl>

* toEqual(true) -> toBeTruthy();

* Update test/unit/carousel.test.js

Co-Authored-By: piotr-s-brainhub <piotr.sroczkowski@brainhub.pl>

* Update test/unit/carousel.test.js

Co-Authored-By: piotr-s-brainhub <piotr.sroczkowski@brainhub.pl>

* Update test/unit/carousel.test.js

Co-Authored-By: piotr-s-brainhub <piotr.sroczkowski@brainhub.pl>

* Update test/unit/carousel.test.js

Co-Authored-By: piotr-s-brainhub <piotr.sroczkowski@brainhub.pl>

* Update test/unit/carousel.test.js

Co-Authored-By: piotr-s-brainhub <piotr.sroczkowski@brainhub.pl>

* Update test/unit/carousel.test.js

Co-Authored-By: piotr-s-brainhub <piotr.sroczkowski@brainhub.pl>

* Update test/unit/carousel.test.js

Co-Authored-By: piotr-s-brainhub <piotr.sroczkowski@brainhub.pl>

* Update test/unit/carousel.test.js

Co-Authored-By: piotr-s-brainhub <piotr.sroczkowski@brainhub.pl>

* Update test/unit/carousel.test.js

Co-Authored-By: piotr-s-brainhub <piotr.sroczkowski@brainhub.pl>

* Update test/unit/carousel.test.js

Co-Authored-By: piotr-s-brainhub <piotr.sroczkowski@brainhub.pl>

* Update test/unit/carousel.test.js

Co-Authored-By: piotr-s-brainhub <piotr.sroczkowski@brainhub.pl>

* Update test/unit/carousel.test.js

Co-Authored-By: piotr-s-brainhub <piotr.sroczkowski@brainhub.pl>

* Update test/unit/carousel.test.js

Co-Authored-By: piotr-s-brainhub <piotr.sroczkowski@brainhub.pl>

* Update test/unit/carousel.test.js

Co-Authored-By: piotr-s-brainhub <piotr.sroczkowski@brainhub.pl>

* Update test/unit/carousel.test.js

Co-Authored-By: piotr-s-brainhub <piotr.sroczkowski@brainhub.pl>

* Update test/unit/carousel.test.js

Co-Authored-By: piotr-s-brainhub <piotr.sroczkowski@brainhub.pl>

* Update test/unit/carousel.test.js

Co-Authored-By: piotr-s-brainhub <piotr.sroczkowski@brainhub.pl>

* Update test/unit/carousel.test.js

Co-authored-by: piotr-s-brainhub <piotr.sroczkowski@brainhub.pl>

* Update test/unit/carousel.test.js

Co-authored-by: piotr-s-brainhub <piotr.sroczkowski@brainhub.pl>

* Update test/unit/carousel.test.js

Co-authored-by: piotr-s-brainhub <piotr.sroczkowski@brainhub.pl>

* Update test/unit/carousel.test.js

Co-authored-by: piotr-s-brainhub <piotr.sroczkowski@brainhub.pl>

Co-authored-by: piotr-s-brainhub <piotr.sroczkowski@brainhub.pl>

1.13.41 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

Using react-resize-observer to observe carousel width

Update yarn lockfile

Readme update

Fix typos, add default props values

Removed unnecessary sign in README.md

Fixed image path to display logo.gif properly, fixed gifs link (now they are directing to the demo)

1.13.42 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

Erase cursor from carousel logo

1.13.43 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

1.13.44 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

fix deployment of testing environment

fix auto push

[renovate] Update circleci/node Docker tag to v12.16.3

1.13.45 [ci skip]

1.13.46 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

[FIX] Add itemWidth to list of responsive props

1.13.47 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

fix tests

Adds width to the carousel container, adds example in docs

[FIX] Add itemWidth to list of responsive props

1.13.47 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

Adds width to the carousel container, adds example in docs

Addressed PR feedback with flex row

update envinfo info

1.13.48 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

add the remaining decisions to decision log

fix a typo

[renovate] Update cypress/included Docker tag to v4.5.0

1.13.49 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

move labels to contributing

renovate monthly

1.14.0 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

1.15.0 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

Changed divs to button tags in dots components for proper HTML validation

1.15.1 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

1.15.2 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

README - move running local demo to Contributing

update contributing

add local URL

1.15.3 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

refactoring example

simplify container example

Revert "simplify container example"

This reverts commit 4244942.

fix: Adding 'rtl' to breakpoints prop-type shape

1.15.4 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

Usage container wrapper example

Update docs/examples/container.md

1.15.5 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

severity labels

1.16.0 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

add workflow to readme

move contribution guide to docs

[renovate] Update cypress/included Docker tag to v4.7.0

1.16.1 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

[renovate] Update circleci/node Docker tag to v12.17.0

1.16.2 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

[renovate] Update NPM dependencies

fix lint

1.16.3 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

branch prefixes

1.17.0 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

update description

1.18.0 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

[renovate] Update NPM dependencies

1.18.2 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

allow dependabot/ branch prefix

1.18.3 [ci skip]

Bump websocket-extensions from 0.1.3 to 0.1.4 in /docs-www

Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-node) from 0.1.3 to 0.1.4.
- [Release notes](https://github.com/faye/websocket-extensions-node/releases)
- [Changelog](https://github.com/faye/websocket-extensions-node/blob/master/CHANGELOG.md)
- [Commits](faye/websocket-extensions-node@0.1.3...0.1.4)

Signed-off-by: dependabot[bot] <support@github.com>

update @brainhubeu/react-carousel in docs-www [ci skip]

1.18.4 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

fix ci message

1.18.5 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

check uploading coverage

1.18.6 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

update table of contents in README

missing space

1.18.7 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

fix wording in workflow

[FIX] Allow onChange callback when carousel is not controlled

fix lint

1.18.8 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

1.18.9 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

add license-auditor

license directory

add @angular/forms to check license-auditor

blacklist MIT

non-empty dangerfile.js

add to whitelist

Fixes miss justification on iOS

Fix: iOS safari doesn't shrunk images

Fix: animation when loading initial carousel

Observe width when loading webpage from scratch

Avoid jumping on iOS safari

Update yarn lockfile

Fixed blinking for iOS 12

Fixed blinking on iOS 12

Fixed fast scroll issue

Remove unnecessary id for carousel item

1.18.10 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

add CC-BY-4.0 to whitelist

add CC0-1.0 to whitelist

add (MIT OR CC0-1.0) to whitelist

add CC-BY-3.0 to whitelist

add others to whitelist and sort

add MIT,Apache2 to whitelist

add AFLv2.1 to whitelist

add Apache2 to whitelist

add all other licences to blacklist

allow Unlicense

check no-license-example

upgrade no-license-example

upgrade no-license-example..

upgrade no-license-example...

blacklist UNKNOWN

clean up

fix click to change tests

1.18.11 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

show version in docs

show version for master

modify PR title after finished deployment

fix API PR URL

keep the same place

fix choosing page

remove bug break

last free

fix finding free page

fix first free

fix no place condition

fix or

exit 1

skipping deploy to a testing environment on master

1.18.12 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

1.19.0 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

update @brainhubeu/license-auditor

1.19.1 [ci skip]

1.19.1 [ci skip]

1.19.2 [ci skip]

1.19.1 [ci skip]

1.19.3 [ci skip]

1.19.2 [ci skip]

1.19.4 [ci skip]

1.19.3 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

1.19.5 [ci skip]

1.19.4 [ci skip]

1.19.4 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

1.19.6 [ci skip]

1.19.5 [ci skip]

1.19.5 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

1.19.7 [ci skip]

1.19.6 [ci skip]

1.19.6 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

1.19.8 [ci skip]

1.19.7 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

1.19.9 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

[renovate] Update cypress/included Docker tag to v4.9.0

1.19.10 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

[renovate] Update circleci/node Docker tag to v12.18.2

1.19.11 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

[renovate] Update NPM dependencies

1.19.13 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

Fix error: Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element' (#584)

1.19.14 [ci skip]

update @brainhubeu/react-carousel in docs-www [ci skip]

Fixes after merging changes from carousel 1.0

* Add license auditor

* Fix deploying carousel 2.0

* Fix lint command

* don't remove bablerc file

* Fix build command

* Fix build command

* Move licenses

* Add yarn.lock

* Fix lint

* Fix an issue with jumping carousel

* Add tests fix slidesPerScroll plugin bug when used in non infinite mode

* Add husky hooks

* Increase wait time so the test won't fail on the CI

* Add prettier, move eslint to global package

* Refactor carousel state

* Rename script, remove unused scripts

* * Refactor carousel plugins names
* Refactor carousel plugin key name: carouselProps -> carouselCustomProps
* change default option in infnitePlugin for numberOfInfiniteClones: 3 -> 1

* Use local carousel in docs until the v2 will be released

* Update docs and README

* Update slidesToScroll page name

* Export atoms, selectors and strategy names

* Plugins refactor

* Add more detailed docs regarding plugins feature

* Change version to beta

* Add minDraggableOffset prop

* Update docs and README

* Fix:
* custom arrow slide changing
* centered plugin offset calculation
* dispatch onMouseMove only if user clicked a slide first
* passing an stopAutoPlayOnHover to autoplay plugin

Refactor:
* refs names
* pass clickDragThreshold from config instead of props

* Fix missing transition animation in clickToChange plugin when a user was clicking fast on slides

* Add possibility to change direction in autoplay plugin

* Fix swiping issues on desktop

* Fix dots and thumbnails changing

* Fix moving slides in RTL mode

* PR fixes

* Change test name to more accurate

* * Add more ways to customize carousel
* fix changing slides in infinite mode
* fix RTL swiping slides

* Change peedDeps versions

* PR fixes

* Apply suggestions from code review

Co-authored-by: piotr-s-brainhub <piotr.sroczkowski@brainhub.pl>

* Update docs/plugins/creatingCustomPlugins.md

* PR fixes. Update proptypes for breakpoints

* Apply suggestions from code review

Co-authored-by: piotr-s-brainhub <piotr.sroczkowski@brainhub.pl>

* Update docs/plugins/creatingCustomPlugins.md

Co-authored-by: piotr-s-brainhub <piotr.sroczkowski@brainhub.pl>

* More detailed unit infinite test

* Fix: page title typo

* Update landing subtitle

* Update docs/api/carousel.md

Co-authored-by: piotr-s-brainhub <piotr.sroczkowski@brainhub.pl>

* Add _ to lodash imports

* publish v2-beta

* skip deploy_test_environment for main branches

* fix uploading coverage

* fix uploading coverage..

* fix persisting node_modules

* fix uploading coverage...

* remove cdn

* update @brainhubeu/react-carousel in docs-www [ci skip]

* fix deploying gh pages

* 2.0.0-beta.2

* update @brainhubeu/react-carousel in docs-www [ci skip]

* debug

* update @brainhubeu/react-carousel in docs-www [ci skip]

* fix building docs

* 2.0.0-beta.4

* update @brainhubeu/react-carousel in docs-www [ci skip]

* v2-beta info

* update @brainhubeu/react-carousel in docs-www [ci skip]

* Fix: set event listeners to be passive for the lighthouse audit (#613)

* ci: automate releasing, publishing release notes, unify commit messages (#614)

* ci: introduce automatic semantic versioning

* ci: fix deploying to gh pages

* ci: change mail address

* fix: add artistic-2.0 license to whitelist

* ci: fix missing , in .releaserc

* update @brainhubeu/react-carousel in docs-www [ci skip]

* fix: carousel breaks when one of the carousel children is an array of nodes

* fix: pkgRoot path

BREAKING CHANGE: Introduce a new way of releasing react-carousel

* chore(release): 2.0.0-v2-beta.1 [skip ci]

# [2.0.0-v2-beta.1](v1.0.1...v2.0.0-v2-beta.1) (2020-07-22)

### Bug Fixes

* Adding 'rtl' to breakpoints prop-type shape ([6de56a9](6de56a9))
* carousel breaks when one of the carousel children is an array of nodes ([88a6e0f](88a6e0f))
* pass null instead of boolean to drag event listener if disabled ([2a884bf](2a884bf))
* pkgRoot path ([1ce7ffd](1ce7ffd))
* Setting offset breaks "centered" ([#394](#394)) ([5f69446](5f69446))
* **active thumbnail:** Active index fixed for thumbnails. Only the active element has the active style applied ([8c9a050](8c9a050))
* **arrow left right:** code review changes for calculating lastIndex in renderArrowRight function ([2223ae8](2223ae8))
* **arrow-left-right:** left and right arrows are disabled instead of being hidden. left arrow is disabled in the 0th index and right arrow is disabled in the nth - 1 index ([7ab5693](7ab5693))
* **carousel arrows:** left arrow isnt shown at 0 index and right arrow isnt shown on the last index ([f33a35c](f33a35c))
* **carousel-arrows:** right arrow disabled on rendering last slide ([a2f6e80](a2f6e80))
* **dragging:** Pooled events to reuse inside setState. ([60729c6](60729c6))
* disable scroll on carousel swipe ([6a1505b](6a1505b))
* Dots component does not account for large values in case of infinite carousel ([ae2ece4](ae2ece4))

### Reverts

* Revert "Revert "fix: only add drag event listeners when dragging is enabled"" ([45e3d57](45e3d57))

### BREAKING CHANGES

* Introduce a new way of releasing react-carousel

* fix: creating npm package

* chore(release): 2.0.0-v2-beta.2 [skip ci]

* ci: remove 'update itself in docs' step

* build: fix publishing a package

* ci: publish docs for rc

* chore(release): 2.0.0-rc.1 [skip ci]

# [2.0.0-rc.1](v1.0.1...v2.0.0-rc.1) (2020-07-24)

### Bug Fixes

* Adding 'rtl' to breakpoints prop-type shape ([6de56a9](6de56a9))
* carousel breaks when one of the carousel children is an array of nodes ([88a6e0f](88a6e0f))
* creating npm package ([76e6e51](76e6e51))
* pass null instead of boolean to drag event listener if disabled ([2a884bf](2a884bf))
* pkgRoot path ([1ce7ffd](1ce7ffd))
* Setting offset breaks "centered" ([#394](#394)) ([5f69446](5f69446))
* **active thumbnail:** Active index fixed for thumbnails. Only the active element has the active style applied ([8c9a050](8c9a050))
* **arrow left right:** code review changes for calculating lastIndex in renderArrowRight function ([2223ae8](2223ae8))
* **arrow-left-right:** left and right arrows are disabled instead of being hidden. left arrow is disabled in the 0th index and right arrow is disabled in the nth - 1 index ([7ab5693](7ab5693))
* **carousel arrows:** left arrow isnt shown at 0 index and right arrow isnt shown on the last index ([f33a35c](f33a35c))
* **carousel-arrows:** right arrow disabled on rendering last slide ([a2f6e80](a2f6e80))
* **dragging:** Pooled events to reuse inside setState. ([60729c6](60729c6))
* disable scroll on carousel swipe ([6a1505b](6a1505b))
* Dots component does not account for large values in case of infinite carousel ([ae2ece4](ae2ece4))

### Reverts

* Revert "Revert "fix: only add drag event listeners when dragging is enabled"" ([45e3d57](45e3d57))

### BREAKING CHANGES

* Introduce a new way of releasing react-carousel

* build: add license, readme and changelog to lib

* fix: setting offset breaks "centered" plugin #394 (#618)

* change padding to margin to avoid spacing issues with box sizing: border-box

* chore(release): 2.0.0-rc.2 [skip ci]

# [2.0.0-rc.2](v2.0.0-rc.1...v2.0.0-rc.2) (2020-07-24)

### Bug Fixes

* setting offset breaks "centered" plugin [#394](#394) ([#618](#618)) ([cfae59f](cfae59f))

* fix: publish package with CHANGELOG.md LICENSE.md and README.md

* chore(release): 2.0.0-rc.3 [skip ci]

# [2.0.0-rc.3](v2.0.0-rc.2...v2.0.0-rc.3) (2020-07-27)

### Bug Fixes

* publish package with CHANGELOG.md LICENSE.md and README.md ([29f2016](29f2016))

Co-authored-by: piotr-s-brainhub <piotr.sroczkowski@brainhub.pl>
Co-authored-by: DevOps Brainhub <devops@brainhub.pl>
Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net>
  • Loading branch information
4 people committed Jul 27, 2020
1 parent 3bba33f commit f4774f1
Show file tree
Hide file tree
Showing 131 changed files with 16,122 additions and 21,255 deletions.
107 changes: 51 additions & 56 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,6 @@ executors:
working_directory: ~/app

jobs:
check_branch_name:
docker:
- image: circleci/node:12.18.2
working_directory: ~/app
steps:
- run:
name: fail if the branch name does not start with a valid prefix
command: |
branch=$CIRCLE_BRANCH
if [[ "$branch" =~ ^(dependabot|fix|feature|breaking)/ || "$branch" == 'master' ]]
then
echo $branch is a valid name
else
echo $branch is not valid because the branch name must match '^(dependabot|fix|feature|breaking)/' or be master
exit 1
fi
deploy_test_environment:
docker:
- image: circleci/node:12.18.2
Expand All @@ -48,8 +32,11 @@ jobs:
paths:
- .git
- node_modules
- react-carousel/node_modules
- react-carousel/lib
- docs-www/node_modules
- .coveralls.yml
- coverage
- react-carousel/coverage
test-e2e:
docker:
- image: circleci/node:12.18.2
Expand All @@ -61,46 +48,61 @@ jobs:
name: Running E2E tests
command: docker-compose -f ./docker-compose.e2e.yml up --build --exit-code-from e2e-test

publish_package:
publish_package_v2_beta:
executor: node-executor
steps:
- attach_workspace:
at: ~/app
- run: git checkout .
- run:
name: Upload coverage to coveralls
command: cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
command: cat ./react-carousel/coverage/lcov.info | ./react-carousel/node_modules/.bin/coveralls
- run:
name: configure GitHub user
command: |
git config --global user.email "devops@brainhub.pl"
git config --global user.email "robert@brainhub.pl"
git config --global user.name "DevOps Brainhub"
git remote -v
git remote remove origin
git remote add origin https://$GIT_TOKEN@github.com/brainhubeu/react-carousel
git remote -v
- run:
name: bump NPM version
name: npm publish
command: npx semantic-release
- run: sleep 10
- run: git pull --no-edit origin $CIRCLE_BRANCH
- run: git push origin $CIRCLE_BRANCH
- run:
name: publish gh pages
command: ./tools/deploy-gh-pages.sh

publish_package:
executor: node-executor
steps:
- attach_workspace:
at: ~/app
- run: git checkout .
- run:
name: Upload coverage to coveralls
command: cat ./react-carousel/coverage/lcov.info | ./react-carousel/node_modules/.bin/coveralls
- run:
name: configure GitHub user
command: |
branch=`git log --oneline | grep '[0-9a-f]\{6,40\} Merge pull request #[0-9]\+ from brainhubeu/' | head -1 | sed 's@.* from brainhubeu/@@g' || true`
echo branch=$branch
if [[ "$branch" =~ ^(dependabot)/ ]]; then
npm version patch -m "%s [ci skip]"
elif [[ "$branch" =~ ^(fix)/ ]]; then
npm version patch -m "%s [ci skip]"
elif [[ "$branch" =~ ^(feature)/ ]]; then
npm version minor -m "%s [ci skip]"
elif [[ "$branch" =~ ^(breaking)/ ]]; then
npm version major -m "%s [ci skip]"
else
echo $branch is not valid because the branch name must match '^(dependabot|fix|feature|breaking)/'
exit 1
fi
git config --global user.email "robert@brainhub.pl"
git config --global user.name "DevOps Brainhub"
git remote -v
git remote remove origin
git remote add origin https://$GIT_TOKEN@github.com/brainhubeu/react-carousel
git remote -v
- run: git pull --no-edit origin $CIRCLE_BRANCH
- run: git push origin $CIRCLE_BRANCH
- run:
name: npm publish
command: npx semantic-release
- run:
name: npm publish CDN version
command: |
cd react-carousel
sed -i 's/export default Carousel;/global.BrainhubeuReactCarousel = Carousel; export default Carousel;/g' src/components/Carousel.js
sed -i 's/export default CarouselDots;/global.BrainhubeuReactCarouselDots = CarouselDots; export default CarouselDots;/g' src/components/CarouselDots.js
sed -i 's/export default CarouselItem;/global.BrainhubeuReactCarouselItem = CarouselItem; export default CarouselItem;/g' src/components/CarouselItem.js
Expand All @@ -111,20 +113,7 @@ jobs:
npm publish
git add .
git stash
- run:
name: npm publish
command: |
yarn build
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
npm publish
- run: sleep 10
- run:
name: update itself in docs
command: |
cd docs-www
yarn add @brainhubeu/react-carousel --non-interactive
git add .
git commit -m 'update @brainhubeu/react-carousel in docs-www [ci skip]'
- run: git pull --no-edit origin $CIRCLE_BRANCH
- run: git push origin $CIRCLE_BRANCH
- run:
Expand All @@ -135,16 +124,22 @@ workflows:
version: 2
test_and_deploy:
jobs:
- check_branch_name
- test:
requires:
- check_branch_name
- test-e2e:
requires:
- check_branch_name
- test
- test-e2e
- deploy_test_environment:
filters:
branches:
ignore:
- master
- rc
- publish_package_v2_beta:
requires:
- check_branch_name
- test
- test-e2e
filters:
branches:
only:
- rc
- publish_package:
requires:
- test
Expand Down
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.gitignore
.editorconfig
node_modules
react-carousel/node_modules
docs-www/node_modules
*.DS_Store
*.md
Expand Down
9 changes: 8 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
/lib/**/*.js
docs-www/.cache
docs-www/public
react-carousel/coverage
react-carousel/lib
node_modules
react-carousel/node_modules
docs-www/node_modules

9 changes: 5 additions & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"root": true,
"extends": [
"brainhub"
"brainhub",
"prettier"
],
"plugins": [
"cypress"
"cypress",
"prettier"
],
"env": {
"jest": true,
Expand All @@ -17,7 +19,6 @@
}
},
"rules": {
"no-invalid-this": 0,
"react/no-deprecated": 0
"prettier/prettier": "error"
}
}
5 changes: 0 additions & 5 deletions .istanbul.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .npmignore

This file was deleted.

2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9
12
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
docs-www/.cache
docs-www/public
react-carousel/coverage
react-carousel/lib
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"jsxBracketSameLine": false
}
18 changes: 18 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"branches": ["v1-legacy", master, { name: 'v2-beta', prerelease: true }, { name: 'rc', prerelease: true }],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
["@semantic-release/changelog", {
"changelogFile": "docs/CHANGELOG.md",
}],
["@semantic-release/npm", {
"pkgRoot": "react-carousel"
}],
["@semantic-release/git", {
"assets": ["react-carousel/package.json", "docs/CHANGELOG.md"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}],
"@semantic-release/github"
]
}
1 change: 0 additions & 1 deletion Dockerfile.e2e
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ COPY . /e2e
# https://github.com/cypress-io/cypress/issues/1243
ENV CI=true
RUN yarn install --frozen-lockfile && \
yarn --cwd docs-www install --frozen-lockfile && \
npx cypress verify
Loading

0 comments on commit f4774f1

Please sign in to comment.