Skip to content
This repository was archived by the owner on Jul 8, 2025. It is now read-only.

Commit f4774f1

Browse files
RobertHebelpiotr-s-brainhubDevOps Brainhubsemantic-release-bot
authored
Carousel 2.0 introduce plugins (#622)
* 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 <[email protected]> * toEqual(true) -> toBeTruthy(); * Update test/unit/carousel.test.js Co-Authored-By: piotr-s-brainhub <[email protected]> * Update test/unit/carousel.test.js Co-Authored-By: piotr-s-brainhub <[email protected]> * Update test/unit/carousel.test.js Co-Authored-By: piotr-s-brainhub <[email protected]> * Update test/unit/carousel.test.js Co-Authored-By: piotr-s-brainhub <[email protected]> * Update test/unit/carousel.test.js Co-Authored-By: piotr-s-brainhub <[email protected]> * Update test/unit/carousel.test.js Co-Authored-By: piotr-s-brainhub <[email protected]> * Update test/unit/carousel.test.js Co-Authored-By: piotr-s-brainhub <[email protected]> * Update test/unit/carousel.test.js Co-Authored-By: piotr-s-brainhub <[email protected]> * Update test/unit/carousel.test.js Co-Authored-By: piotr-s-brainhub <[email protected]> * Update test/unit/carousel.test.js Co-Authored-By: piotr-s-brainhub <[email protected]> * Update test/unit/carousel.test.js Co-Authored-By: piotr-s-brainhub <[email protected]> * Update test/unit/carousel.test.js Co-Authored-By: piotr-s-brainhub <[email protected]> * Update test/unit/carousel.test.js Co-Authored-By: piotr-s-brainhub <[email protected]> * Update test/unit/carousel.test.js Co-Authored-By: piotr-s-brainhub <[email protected]> * Update test/unit/carousel.test.js Co-Authored-By: piotr-s-brainhub <[email protected]> * Update test/unit/carousel.test.js Co-Authored-By: piotr-s-brainhub <[email protected]> * Update test/unit/carousel.test.js Co-Authored-By: piotr-s-brainhub <[email protected]> * Update test/unit/carousel.test.js Co-authored-by: piotr-s-brainhub <[email protected]> * Update test/unit/carousel.test.js Co-authored-by: piotr-s-brainhub <[email protected]> * Update test/unit/carousel.test.js Co-authored-by: piotr-s-brainhub <[email protected]> * Update test/unit/carousel.test.js Co-authored-by: piotr-s-brainhub <[email protected]> Co-authored-by: piotr-s-brainhub <[email protected]> 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] <[email protected]> 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 <[email protected]> * Update docs/plugins/creatingCustomPlugins.md * PR fixes. Update proptypes for breakpoints * Apply suggestions from code review Co-authored-by: piotr-s-brainhub <[email protected]> * Update docs/plugins/creatingCustomPlugins.md Co-authored-by: piotr-s-brainhub <[email protected]> * More detailed unit infinite test * Fix: page title typo * Update landing subtitle * Update docs/api/carousel.md Co-authored-by: piotr-s-brainhub <[email protected]> * 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 <[email protected]> Co-authored-by: DevOps Brainhub <[email protected]> Co-authored-by: semantic-release-bot <[email protected]>
1 parent 3bba33f commit f4774f1

File tree

131 files changed

+16122
-21255
lines changed

Some content is hidden

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

131 files changed

+16122
-21255
lines changed

.circleci/config.yml

Lines changed: 51 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,6 @@ executors:
66
working_directory: ~/app
77

88
jobs:
9-
check_branch_name:
10-
docker:
11-
- image: circleci/node:12.18.2
12-
working_directory: ~/app
13-
steps:
14-
- run:
15-
name: fail if the branch name does not start with a valid prefix
16-
command: |
17-
branch=$CIRCLE_BRANCH
18-
if [[ "$branch" =~ ^(dependabot|fix|feature|breaking)/ || "$branch" == 'master' ]]
19-
then
20-
echo $branch is a valid name
21-
else
22-
echo $branch is not valid because the branch name must match '^(dependabot|fix|feature|breaking)/' or be master
23-
exit 1
24-
fi
259
deploy_test_environment:
2610
docker:
2711
- image: circleci/node:12.18.2
@@ -48,8 +32,11 @@ jobs:
4832
paths:
4933
- .git
5034
- node_modules
35+
- react-carousel/node_modules
36+
- react-carousel/lib
37+
- docs-www/node_modules
5138
- .coveralls.yml
52-
- coverage
39+
- react-carousel/coverage
5340
test-e2e:
5441
docker:
5542
- image: circleci/node:12.18.2
@@ -61,46 +48,61 @@ jobs:
6148
name: Running E2E tests
6249
command: docker-compose -f ./docker-compose.e2e.yml up --build --exit-code-from e2e-test
6350

64-
publish_package:
51+
publish_package_v2_beta:
6552
executor: node-executor
6653
steps:
6754
- attach_workspace:
6855
at: ~/app
6956
- run: git checkout .
7057
- run:
7158
name: Upload coverage to coveralls
72-
command: cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
59+
command: cat ./react-carousel/coverage/lcov.info | ./react-carousel/node_modules/.bin/coveralls
7360
- run:
7461
name: configure GitHub user
7562
command: |
76-
git config --global user.email "devops@brainhub.pl"
63+
git config --global user.email "robert@brainhub.pl"
7764
git config --global user.name "DevOps Brainhub"
7865
git remote -v
7966
git remote remove origin
8067
git remote add origin https://[email protected]/brainhubeu/react-carousel
8168
git remote -v
8269
- run:
83-
name: bump NPM version
70+
name: npm publish
71+
command: npx semantic-release
72+
- run: sleep 10
73+
- run: git pull --no-edit origin $CIRCLE_BRANCH
74+
- run: git push origin $CIRCLE_BRANCH
75+
- run:
76+
name: publish gh pages
77+
command: ./tools/deploy-gh-pages.sh
78+
79+
publish_package:
80+
executor: node-executor
81+
steps:
82+
- attach_workspace:
83+
at: ~/app
84+
- run: git checkout .
85+
- run:
86+
name: Upload coverage to coveralls
87+
command: cat ./react-carousel/coverage/lcov.info | ./react-carousel/node_modules/.bin/coveralls
88+
- run:
89+
name: configure GitHub user
8490
command: |
85-
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`
86-
echo branch=$branch
87-
if [[ "$branch" =~ ^(dependabot)/ ]]; then
88-
npm version patch -m "%s [ci skip]"
89-
elif [[ "$branch" =~ ^(fix)/ ]]; then
90-
npm version patch -m "%s [ci skip]"
91-
elif [[ "$branch" =~ ^(feature)/ ]]; then
92-
npm version minor -m "%s [ci skip]"
93-
elif [[ "$branch" =~ ^(breaking)/ ]]; then
94-
npm version major -m "%s [ci skip]"
95-
else
96-
echo $branch is not valid because the branch name must match '^(dependabot|fix|feature|breaking)/'
97-
exit 1
98-
fi
91+
git config --global user.email "[email protected]"
92+
git config --global user.name "DevOps Brainhub"
93+
git remote -v
94+
git remote remove origin
95+
git remote add origin https://[email protected]/brainhubeu/react-carousel
96+
git remote -v
9997
- run: git pull --no-edit origin $CIRCLE_BRANCH
10098
- run: git push origin $CIRCLE_BRANCH
99+
- run:
100+
name: npm publish
101+
command: npx semantic-release
101102
- run:
102103
name: npm publish CDN version
103104
command: |
105+
cd react-carousel
104106
sed -i 's/export default Carousel;/global.BrainhubeuReactCarousel = Carousel; export default Carousel;/g' src/components/Carousel.js
105107
sed -i 's/export default CarouselDots;/global.BrainhubeuReactCarouselDots = CarouselDots; export default CarouselDots;/g' src/components/CarouselDots.js
106108
sed -i 's/export default CarouselItem;/global.BrainhubeuReactCarouselItem = CarouselItem; export default CarouselItem;/g' src/components/CarouselItem.js
@@ -111,20 +113,7 @@ jobs:
111113
npm publish
112114
git add .
113115
git stash
114-
- run:
115-
name: npm publish
116-
command: |
117-
yarn build
118-
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
119-
npm publish
120116
- run: sleep 10
121-
- run:
122-
name: update itself in docs
123-
command: |
124-
cd docs-www
125-
yarn add @brainhubeu/react-carousel --non-interactive
126-
git add .
127-
git commit -m 'update @brainhubeu/react-carousel in docs-www [ci skip]'
128117
- run: git pull --no-edit origin $CIRCLE_BRANCH
129118
- run: git push origin $CIRCLE_BRANCH
130119
- run:
@@ -135,16 +124,22 @@ workflows:
135124
version: 2
136125
test_and_deploy:
137126
jobs:
138-
- check_branch_name
139-
- test:
140-
requires:
141-
- check_branch_name
142-
- test-e2e:
143-
requires:
144-
- check_branch_name
127+
- test
128+
- test-e2e
145129
- deploy_test_environment:
130+
filters:
131+
branches:
132+
ignore:
133+
- master
134+
- rc
135+
- publish_package_v2_beta:
146136
requires:
147-
- check_branch_name
137+
- test
138+
- test-e2e
139+
filters:
140+
branches:
141+
only:
142+
- rc
148143
- publish_package:
149144
requires:
150145
- test

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
.gitignore
33
.editorconfig
44
node_modules
5+
react-carousel/node_modules
56
docs-www/node_modules
67
*.DS_Store
78
*.md

.eslintignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
/lib/**/*.js
1+
docs-www/.cache
2+
docs-www/public
3+
react-carousel/coverage
4+
react-carousel/lib
5+
node_modules
6+
react-carousel/node_modules
7+
docs-www/node_modules
8+

.eslintrc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
{
22
"root": true,
33
"extends": [
4-
"brainhub"
4+
"brainhub",
5+
"prettier"
56
],
67
"plugins": [
7-
"cypress"
8+
"cypress",
9+
"prettier"
810
],
911
"env": {
1012
"jest": true,
@@ -17,7 +19,6 @@
1719
}
1820
},
1921
"rules": {
20-
"no-invalid-this": 0,
21-
"react/no-deprecated": 0
22+
"prettier/prettier": "error"
2223
}
2324
}

.istanbul.yml

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

.npmignore

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

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9
1+
12

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
docs-www/.cache
2+
docs-www/public
3+
react-carousel/coverage
4+
react-carousel/lib

.prettierrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"printWidth": 80,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"semi": true,
6+
"singleQuote": true,
7+
"trailingComma": "all",
8+
"jsxBracketSameLine": false
9+
}

.releaserc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"branches": ["v1-legacy", master, { name: 'v2-beta', prerelease: true }, { name: 'rc', prerelease: true }],
3+
"plugins": [
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
["@semantic-release/changelog", {
7+
"changelogFile": "docs/CHANGELOG.md",
8+
}],
9+
["@semantic-release/npm", {
10+
"pkgRoot": "react-carousel"
11+
}],
12+
["@semantic-release/git", {
13+
"assets": ["react-carousel/package.json", "docs/CHANGELOG.md"],
14+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
15+
}],
16+
"@semantic-release/github"
17+
]
18+
}

0 commit comments

Comments
 (0)