diff --git a/CHANGELOG.md b/CHANGELOG.md index d50fb867..95d96a41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ -v3.11.1 - Fri, 25 Oct 2019 21:02:09 UTC ---------------------------------------- +3.11.1 - Fri, 25 Oct 2019 21:02:39 UTC +-------------------------------------- - [ee1a363](../../commit/ee1a363) chore: update webpack* versions. - [4ac3ff4](../../commit/4ac3ff4) [added]: pass overlay and content element references to onAfterOpen fn (#741) @@ -7,9 +7,8 @@ v3.11.1 - Fri, 25 Oct 2019 21:02:09 UTC - [4dd25ac](../../commit/4dd25ac) chore: changed xvfb to a service. - [2d4f231](../../commit/2d4f231) chore: changed xvfb to a service. - -v3.10.1 - Wed, 21 Aug 2019 20:49:53 UTC ---------------------------------------- +3.10.1 - Wed, 21 Aug 2019 20:50:38 UTC +-------------------------------------- - [8a71f71](../../commit/8a71f71) [fixed] onAfterClose prop falsly called on unmount - [1b80146](../../commit/1b80146) Revert "Merge pull request #766 from reactjs/dependabot/npm_and_yarn/webpack-dev-server-3.1.11" @@ -20,15 +19,13 @@ v3.10.1 - Wed, 21 Aug 2019 20:49:53 UTC - [9a6edf9](../../commit/9a6edf9) Merge pull request #766 from reactjs/dependabot/npm_and_yarn/webpack-dev-server-3.1.11 - [8f4ea54](../../commit/8f4ea54) Bump webpack-dev-server from 2.11.5 to 3.1.11 - -v3.9.1 - Sun, 14 Jul 2019 16:52:30 UTC --------------------------------------- +3.9.1 - Sun, 14 Jul 2019 16:53:00 UTC +------------------------------------- - [c747c24](../../commit/c747c24) [added] Added an id prop, applied to the modal dialog (content) (#765) - -v3.8.2 - Sun, 30 Jun 2019 20:48:21 UTC --------------------------------------- +3.8.2 - Sun, 30 Jun 2019 20:48:49 UTC +------------------------------------- - [9fe84df](../../commit/9fe84df) Update `warning` to v4 - [6ff8d85](../../commit/6ff8d85) [fixed] Local development environment (#754) @@ -36,15 +33,13 @@ v3.8.2 - Sun, 30 Jun 2019 20:48:21 UTC - [ec3f749](../../commit/ec3f749) fix item index - [d56e295](../../commit/d56e295) fix can't close Modal B - -v3.8.1 - Wed, 19 Dec 2018 00:57:16 UTC --------------------------------------- +3.8.1 - Wed, 19 Dec 2018 00:57:38 UTC +------------------------------------- - [988f55a](../../commit/988f55a) [added] Introduce onAfterClose callback prop (#724) - -v3.7.1 - Mon, 10 Dec 2018 13:12:33 UTC --------------------------------------- +3.7.1 - Mon, 10 Dec 2018 13:13:29 UTC +------------------------------------- - [2ae092a](../../commit/2ae092a) [fixed] Allow empty classNames for body (#720) - [8d8f476](../../commit/8d8f476) React-Modal: chromeHeadless use @@ -53,48 +48,47 @@ v3.7.1 - Mon, 10 Dec 2018 13:12:33 UTC - [1b561fc](../../commit/1b561fc) [fixed] if tabbable element is undefined, focus head or tail based on shiftKey - [86632aa](../../commit/86632aa) [fixed] check if element exists before focusing in scopeTab helper - -v3.6.1 - Tue, 25 Sep 2018 11:47:45 UTC --------------------------------------- +3.6.1 - Tue, 25 Sep 2018 11:53:39 UTC +------------------------------------- - [a2c38cc](../../commit/a2c38cc) [fixed] set default role for accessibility - [921358e](../../commit/921358e) Add explicit comments as suggested in PR review - [3d74c1b](../../commit/3d74c1b) Update doc to inform v3 users about close transition - [1e349c0](../../commit/1e349c0) [fixed] remove aria-modal attr to prevent browser bugs - -v3.5.1 - Wed, 04 Jul 2018 10:22:38 UTC --------------------------------------- +3.5.1 - Wed, 04 Jul 2018 10:23:09 UTC +------------------------------------- - [c3e06ab](../../commit/c3e06ab) [added] additional data attributes. - [e5a80d6](../../commit/e5a80d6) [fixed] portal node will be reparented if necessary on props change - -v3.4.5 - Fri, 01 Jun 2018 11:11:21 UTC --------------------------------------- +3.4.5 - Fri, 01 Jun 2018 11:11:50 UTC +------------------------------------- - [2bf2dd2](../../commit/2bf2dd2) chore: update Makefile. - [73893a2](../../commit/73893a2) [fixed] Safety check for SSR (#668) - [5f92df7](../../commit/5f92df7) very small spelling correction in comment - [92cae36](../../commit/92cae36) [chore] don't allow publish if branch is not master. +3.4.4 - Mon, 23 Apr 2018 23:09:20 UTC +------------------------------------- -v3.4.4 - Mon, 23 Apr 2018 23:08:59 UTC --------------------------------------- +- [2e619b9](../../commit/2e619b9) [chore] fix incorrect path for module in package.json. -- +3.4.3 - Mon, 23 Apr 2018 23:07:56 UTC +------------------------------------- +- [35c56e6](../../commit/35c56e6) [chore] fix incorrect path for module in package.json. -v3.4.2 - Thu, 19 Apr 2018 09:16:47 UTC --------------------------------------- +3.4.2 - Thu, 19 Apr 2018 09:17:14 UTC +------------------------------------- - [529ca33](../../commit/529ca33) Add `testId` prop for use as a test hook - [e294dc7](../../commit/e294dc7) [added] Add module field to package json - [d8fe0dd](../../commit/d8fe0dd) Added default prop for defaultStyles property - -v3.4.1 - Tue, 17 Apr 2018 09:49:06 UTC --------------------------------------- +3.4.1 - Tue, 17 Apr 2018 09:50:04 UTC +------------------------------------- - [2132488](../../commit/2132488) Add eslint rule to disallow importing devDependencies in lib sources - [4887c69](../../commit/4887c69) Move react-lifecycles-compat to `dependencies` and upgrade it to v3 @@ -106,17 +100,15 @@ v3.4.1 - Tue, 17 Apr 2018 09:49:06 UTC - [d6f3463](../../commit/d6f3463) [chore] Update transitions.md (#635) - [fa87046](../../commit/fa87046) [Chore] update README.md: added description for setting app element - -v3.3.2 - Mon, 12 Mar 2018 22:16:32 UTC --------------------------------------- +3.3.2 - Mon, 12 Mar 2018 22:16:58 UTC +------------------------------------- - [eb1ac25](../../commit/eb1ac25) [chore] update list of files that shouldn't be packed. - [d8051f9](../../commit/d8051f9) [chore] improve documentation for shouldCloseOnOverlayClick. - [9012d81](../../commit/9012d81) [chore] add to docs the default value of the html class option. - -v3.3.1 - Wed, 21 Feb 2018 09:53:44 UTC --------------------------------------- +3.3.1 - Wed, 21 Feb 2018 09:54:52 UTC +------------------------------------- - [0c6d966](../../commit/0c6d966) [added] htmlOpenClassName will follow the same rules like... bodyOpenClassName. - [088e68e](../../commit/088e68e) [added] add class to html when modal is open @@ -124,22 +116,19 @@ v3.3.1 - Wed, 21 Feb 2018 09:53:44 UTC - [241b8a6](../../commit/241b8a6) [chore] Move API documentation from README to gitbook - [4c1e590](../../commit/4c1e590) Expand documentation - -v3.2.1 - Thu, 15 Feb 2018 09:07:28 UTC --------------------------------------- +3.2.1 - Thu, 15 Feb 2018 09:07:59 UTC +------------------------------------- - [0809958](../../commit/0809958) [added] ref for overlay and content - [61b141d](../../commit/61b141d) Fix minor typos in spec - -v3.1.13 - Fri, 09 Feb 2018 10:27:15 UTC ---------------------------------------- +3.1.13 - Fri, 09 Feb 2018 10:28:38 UTC +-------------------------------------- - [700a28a](../../commit/700a28a) [fixed] Tab focus escapes modal on shift + tab after opening - -v3.1.12 - Mon, 05 Feb 2018 08:34:57 UTC ---------------------------------------- +3.1.12 - Mon, 05 Feb 2018 08:35:24 UTC +-------------------------------------- - [6c4d4ad](../../commit/6c4d4ad) [fixed] management of aria-hidden attribute decoupled from the management of the body open class - [93b2c05](../../commit/93b2c05) [chore] Bump bootstrap example to use 4.0 release @@ -147,93 +136,85 @@ v3.1.12 - Mon, 05 Feb 2018 08:34:57 UTC - [c7c928c](../../commit/c7c928c) [chore] updates style page - [f5b9c11](../../commit/f5b9c11) [chore] updates README - styles - -v3.1.11 - Tue, 16 Jan 2018 12:45:05 UTC ---------------------------------------- +3.1.11 - Tue, 16 Jan 2018 12:45:23 UTC +-------------------------------------- - [3256671](../../commit/3256671) [fixed] when ModalPortal is clicked, shouldClose is true if shouldCloseOnOverlayClick is true. - -v3.1.10 - Tue, 19 Dec 2017 17:42:03 UTC ---------------------------------------- +3.1.10 - Tue, 19 Dec 2017 17:42:30 UTC +-------------------------------------- - [9a3542a](../../commit/9a3542a) [fixed] stop propagating ESC key event. +3.1.9 - Tue, 19 Dec 2017 17:36:51 UTC +------------------------------------- -v3.1.8 - Tue, 12 Dec 2017 20:43:25 UTC --------------------------------------- +- [b2c347b](../../commit/b2c347b) [fixed] stop propagating ESC key event. -- +3.1.8 - Tue, 12 Dec 2017 20:45:35 UTC +------------------------------------- +- [eb5ea07](../../commit/eb5ea07) [fixed] check if focusLaterElements is empty before popping -v3.1.7 - Mon, 04 Dec 2017 14:22:29 UTC --------------------------------------- +3.1.7 - Mon, 04 Dec 2017 14:23:04 UTC +------------------------------------- - [22e8b23](../../commit/22e8b23) [fixed] ignore .babelrc when publishing to npm. - [5693a40](../../commit/5693a40) [chore] typo on word (#574) - -v3.1.6 - Thu, 30 Nov 2017 10:24:00 UTC --------------------------------------- +3.1.6 - Thu, 30 Nov 2017 10:25:02 UTC +------------------------------------- - [0122238](../../commit/0122238) [chore] added badge to react-modal gitter channel. - [c925763](../../commit/c925763) remove code climate badge from readme. - [38dc8f9](../../commit/38dc8f9) [fixes] don't set aria-hidden if appElement is not defined. - -v3.1.5 - Mon, 27 Nov 2017 19:56:19 UTC --------------------------------------- +3.1.5 - Mon, 27 Nov 2017 19:57:33 UTC +------------------------------------- - [cae99d9](../../commit/cae99d9) [fixed] shouldCloseOnOverlayClick conflict with text inputs. - -v3.1.4 - Fri, 24 Nov 2017 14:26:59 UTC --------------------------------------- +3.1.4 - Fri, 24 Nov 2017 14:27:40 UTC +------------------------------------- - [c1e535f](../../commit/c1e535f) [chore] changelog writer. - [a296627](../../commit/a296627) fix: prevent mouse event when shouldCloseOnOverlayClick = false. - [cba31dd](../../commit/cba31dd) Update on_request_close.md - -v3.1.3 - Wed, 22 Nov 2017 16:38:06 UTC --------------------------------------- +3.1.3 - Wed, 22 Nov 2017 16:38:06 UTC +------------------------------------- - [c434e84](../../commit/c434e84) [fixed] Respect overflow css property when determining whether or not a tabbable node is hidden - -v3.1.2 - Mon, 06 Nov 2017 19:56:00 UTC --------------------------------------- +3.1.2 - Mon, 06 Nov 2017 19:56:00 UTC +------------------------------------- - [3c86e2d](../../commit/3c86e2d) [fixed] shouldFocusAfterRender and shouldReturnFocusAfterClose flags. - [0f2bf9e](../../commit/0f2bf9e) [fixed] corretly walk when using TAB. - [5cf9326](../../commit/5cf9326) Update README.md - [cdcc1cb](../../commit/cdcc1cb) [chore]: fixed changelog generator. - -v3.1.0 - Wed, 25 Oct 2017 14:26:17 UTC --------------------------------------- +3.1.0 - Wed, 25 Oct 2017 14:26:17 UTC +------------------------------------- - [42d724c](../../commit/42d724c) [added] shouldReturnFocusAfterClose to control focus. - [400ac13](../../commit/400ac13) [chore] make sure all tests meet line-length requirement. - [18a15eb](../../commit/18a15eb) [fixed] correct property name shouldFocusAfterRender. - -v3.0.4 - Wed, 18 Oct 2017 19:55:15 UTC --------------------------------------- +3.0.4 - Wed, 18 Oct 2017 19:55:15 UTC +------------------------------------- - [5ec0f7f](../../commit/5ec0f7f) [fixed] Removes body classNames after the modal is closed. - [1fb33d9](../../commit/1fb33d9) [chore] run tests only on node 8. - [59fbdb3](../../commit/59fbdb3) [chore] specifiy the object when overriding class names. - -v3.0.3 - Sat, 14 Oct 2017 17:38:38 UTC --------------------------------------- +3.0.3 - Sat, 14 Oct 2017 17:38:38 UTC +------------------------------------- - [32441c3](../../commit/32441c3) [fixed] Issue #526 Import PropTypes as default import. - -v3.0.2 - Sat, 14 Oct 2017 12:04:40 UTC --------------------------------------- +3.0.2 - Sat, 14 Oct 2017 12:04:40 UTC +------------------------------------- - [1d495a6](../../commit/1d495a6) [fixed] Add shouldCloseOnEsc prop - [d98f091](../../commit/d98f091) [chore] update CHANGELOG.md @@ -243,30 +224,41 @@ v3.0.2 - Sat, 14 Oct 2017 12:04:40 UTC - [2a05bd8](../../commit/2a05bd8) [chore] Updated eslint and a few related deps - [b3701f6](../../commit/b3701f6) [fixed] Issue #526 Import PropTypes as default import. - -v3.0.0 - Fri, 06 Oct 2017 13:29:20 UTC --------------------------------------- +3.0.0 - Fri, 06 Oct 2017 13:29:20 UTC +------------------------------------- - [d0f242b](../../commit/d0f242b) Merged next into master. - [de3c039](../../commit/de3c039) [chore] remove warning about injectCSS. - [f77b53e](../../commit/f77b53e) [chore] use canUseDOM from exenv. -- [cc4577c](../../commit/cc4577c) Release 3.0.0-rc2. +- [4fa5628](../../commit/4fa5628) [fixed] Drag stop (mouseup) on Overlay closes Modal +- [a712d88](../../commit/a712d88) [chore] update README.md installation for react 16 support. +- [f9a2f3f](../../commit/f9a2f3f) [chore] update README.md. + +3.0.0-rc2 - Wed, 04 Oct 2017 13:30:44 UTC +----------------------------------------- + - [1260850](../../commit/1260850) [fixed] backward compatibility with previous react versions. + +3.0.0-rc1 - Wed, 04 Oct 2017 10:34:47 UTC +----------------------------------------- + - [d25563c](../../commit/d25563c) [fixed] check for both window and document.createElement. - [2b835d6](../../commit/2b835d6) [fixed] typeof returns a string (canUseDOM). -- [b942504](../../commit/b942504) [feature] initial support for react 16. +3.0.0-alpha - Wed, 04 Oct 2017 03:58:27 UTC +------------------------------------------- -v2.4.1 - Fri, 06 Oct 2017 12:09:11 UTC --------------------------------------- +- [b942504](../../commit/b942504) [feature] initial support for react 16. + +2.4.1 - Fri, 06 Oct 2017 12:09:11 UTC +------------------------------------- - [4fa5628](../../commit/4fa5628) [fixed] Drag stop (mouseup) on Overlay closes Modal - [a712d88](../../commit/a712d88) [chore] update README.md installation for react 16 support. - [f9a2f3f](../../commit/f9a2f3f) [chore] update README.md. - -v2.3.3 - Wed, 04 Oct 2017 01:59:57 UTC --------------------------------------- +2.3.3 - Wed, 04 Oct 2017 01:59:57 UTC +------------------------------------- - [ace2bf0](../../commit/ace2bf0) [chore] added babel-cli to compile and fix dist configuration. - [876972b](../../commit/876972b) [chore] removed depencendy 'react-dom-factory'. @@ -279,67 +271,58 @@ v2.3.3 - Wed, 04 Oct 2017 01:59:57 UTC - [ba81894](../../commit/ba81894) Remove required flag from contentLabel propType in Modal - [f007aeb](../../commit/f007aeb) [chore] Update description for onRequestClose. - -v2.3.2 - Wed, 06 Sep 2017 16:10:27 UTC --------------------------------------- +2.3.2 - Wed, 06 Sep 2017 16:10:27 UTC +------------------------------------- - [54c59c5](../../commit/54c59c5) Export default property in CommonJS and global object - [ba526cf](../../commit/ba526cf) [chore] fix changelog generator. - -v2.3.1 - Tue, 05 Sep 2017 16:18:41 UTC --------------------------------------- +2.3.1 - Tue, 05 Sep 2017 16:18:41 UTC +------------------------------------- - [93256e9](../../commit/93256e9) [added] Don't focus after render if we don't want to - [2adb45d](../../commit/2adb45d) [chore] update readme syntax flavour to jsx - -v2.2.4 - Mon, 14 Aug 2017 09:41:39 UTC --------------------------------------- +2.2.4 - Mon, 14 Aug 2017 09:41:39 UTC +------------------------------------- - [fafa127](../../commit/fafa127) typo fix - [fe1983b](../../commit/fe1983b) fix #466: Dragging inside modal and release outside of modal closes the modal - -v2.2.3 - Thu, 10 Aug 2017 19:27:47 UTC --------------------------------------- +2.2.3 - Thu, 10 Aug 2017 19:27:47 UTC +------------------------------------- - [1caabed](../../commit/1caabed) [fixed] `Uncaught TypeError: Cannot read property 'state' of null` when unmouting - [92c23b5](../../commit/92c23b5) [chore] Mention shouldCloseOnOverlayClick dependency - [a2d5c4e](../../commit/a2d5c4e) [chore] allow latest version for exenv dependency - -v2.2.2 - Tue, 11 Jul 2017 14:20:29 UTC --------------------------------------- +2.2.2 - Tue, 11 Jul 2017 14:20:29 UTC +------------------------------------- - [9076eb7](../../commit/9076eb7) [added] Support using multiple document.body classes - [581be77](../../commit/581be77) [chore] added test for default parentSelector. - [e56c414](../../commit/e56c414) [chore] Return null for portal when modal is closed - -v2.2.1 - Fri, 30 Jun 2017 09:22:10 UTC --------------------------------------- +2.2.1 - Fri, 30 Jun 2017 09:22:10 UTC +------------------------------------- - [7301aa7](../../commit/7301aa7) [chore] Change 'a11y' to 'accessibility' in README.md - [f47e79d](../../commit/f47e79d) [fixed] Modal.removePortal not called when using closeTimeoutMS - [f386aa4](../../commit/f386aa4) [chore] added more examples. - -v2.2.0 - Wed, 28 Jun 2017 18:56:24 UTC --------------------------------------- +2.2.0 - Wed, 28 Jun 2017 18:56:24 UTC +------------------------------------- - [67ee9f5](../../commit/67ee9f5) [added] allow users to pass aria-* attribute. - [6f73764](../../commit/6f73764) [chore] update installation documentation. - -v2.1.0 - Mon, 26 Jun 2017 22:11:54 UTC --------------------------------------- +2.1.0 - Mon, 26 Jun 2017 22:11:54 UTC +------------------------------------- - [1baebf4](../../commit/1baebf4) [change] Track open body className appropriately - -v2.0.7 - Sun, 25 Jun 2017 17:44:29 UTC --------------------------------------- +2.0.7 - Sun, 25 Jun 2017 17:44:29 UTC +------------------------------------- - [d1fe05e](../../commit/d1fe05e) [chore] use local babel instead of requiring a global installation. - [bb69a91](../../commit/bb69a91) [chore] improvements on readme testing section. @@ -349,9 +332,8 @@ v2.0.7 - Sun, 25 Jun 2017 17:44:29 UTC - [ae258ec](../../commit/ae258ec) [chore] removing active development section. - [f5d95e2](../../commit/f5d95e2) Add codesandbox link to the ISSUE_TEMPLATE - -v2.0.6 - Tue, 20 Jun 2017 11:23:30 UTC --------------------------------------- +2.0.6 - Tue, 20 Jun 2017 11:23:30 UTC +------------------------------------- - [1676259](../../commit/1676259) removing trailing space. (#2) - [07a2753](../../commit/07a2753) [fixed] check if the modal content is available when async update... (#1) @@ -370,15 +352,13 @@ v2.0.6 - Tue, 20 Jun 2017 11:23:30 UTC - [21dc212](../../commit/21dc212) [chore] ask before publishing... - [2af9b89](../../commit/2af9b89) chore] improve publish docs commands. - -v2.0.2 - Fri, 16 Jun 2017 13:10:06 UTC --------------------------------------- +2.0.2 - Fri, 16 Jun 2017 13:10:06 UTC +------------------------------------- - [c1dc7fd](../../commit/c1dc7fd) change PropTypes.String to PropTypes.string - -v2.0.1 - Fri, 16 Jun 2017 11:30:58 UTC --------------------------------------- +2.0.1 - Fri, 16 Jun 2017 11:30:58 UTC +------------------------------------- - [435ab91](../../commit/435ab91) Update eslint config so it should pass - [b1a28a4](../../commit/b1a28a4) remove yarn.lock per comment @@ -395,9 +375,8 @@ v2.0.1 - Fri, 16 Jun 2017 11:30:58 UTC - [a6422f6](../../commit/a6422f6) Use ES module for top level export - [c05e88d](../../commit/c05e88d) Move lib to src so we can use lib for build output - -v2.0.0 - Thu, 15 Jun 2017 18:16:21 UTC --------------------------------------- +2.0.0 - Thu, 15 Jun 2017 18:16:21 UTC +------------------------------------- - [0374b6b](../../commit/0374b6b) [chore] update makefile to run coverage. - [ba2c124](../../commit/ba2c124) [chore] passing lint... @@ -408,148 +387,125 @@ v2.0.0 - Thu, 15 Jun 2017 18:16:21 UTC - [1c326a1](../../commit/1c326a1) Add Linting (#293) - [d2fbe55](../../commit/d2fbe55) [chore] added babel stage-2 preset. - -v1.9.7 - Thu, 15 Jun 2017 13:28:17 UTC --------------------------------------- +1.9.7 - Thu, 15 Jun 2017 13:28:17 UTC +------------------------------------- - [df14528](../../commit/df14528) Added cross-env to run tests on windows - -v1.9.6 - Thu, 15 Jun 2017 00:57:18 UTC --------------------------------------- +1.9.6 - Thu, 15 Jun 2017 00:57:18 UTC +------------------------------------- - [91e1a67](../../commit/91e1a67) Remove deprecation warning in react 15.6.0 about React.DOM.noscript - [937f835](../../commit/937f835) [chore] removing unnecessary file. - -v1.9.5 - Wed, 14 Jun 2017 22:57:03 UTC --------------------------------------- +1.9.5 - Wed, 14 Jun 2017 22:57:03 UTC +------------------------------------- - [3139e85](../../commit/3139e85) [added] refresh portalClassName on componentWillUpdate - -v1.9.4 - Tue, 13 Jun 2017 10:12:34 UTC --------------------------------------- +1.9.4 - Tue, 13 Jun 2017 10:12:34 UTC +------------------------------------- - [0510f62](../../commit/0510f62) Add gzip size badge - -v1.9.3 - Tue, 13 Jun 2017 09:21:26 UTC --------------------------------------- +1.9.3 - Tue, 13 Jun 2017 09:21:26 UTC +------------------------------------- - [28ecc0b](../../commit/28ecc0b) [fixed] compatibility with unstable_handleError. - -v1.9.2 - Mon, 12 Jun 2017 21:05:11 UTC --------------------------------------- +1.9.2 - Mon, 12 Jun 2017 21:05:11 UTC +------------------------------------- - [a61f73c](../../commit/a61f73c) fix react proptypes warning - -v1.9.1 - Mon, 12 Jun 2017 16:27:34 UTC --------------------------------------- +1.9.1 - Mon, 12 Jun 2017 16:27:34 UTC +------------------------------------- - [a12246e](../../commit/a12246e) [changed] use object className and overlayClassName prop to override... - -v1.8.1 - Mon, 12 Jun 2017 12:37:12 UTC --------------------------------------- +1.8.1 - Mon, 12 Jun 2017 12:37:12 UTC +------------------------------------- - [e5bb415](../../commit/e5bb415) [change] allow to customize the react-modal document.body open class. - -v1.7.13 - Mon, 12 Jun 2017 10:26:34 UTC ---------------------------------------- +1.7.13 - Mon, 12 Jun 2017 10:26:34 UTC +-------------------------------------- - [3bc4719](../../commit/3bc4719) [chore] refactoring tests... - -v1.7.12 - Fri, 09 Jun 2017 22:27:37 UTC ---------------------------------------- +1.7.12 - Fri, 09 Jun 2017 22:27:37 UTC +-------------------------------------- - [4b69478](../../commit/4b69478) [chore] clean publish resources before start... - [00ea6fe](../../commit/00ea6fe) [chore] refactor and clean up build system. - -v1.7.11 - Thu, 08 Jun 2017 16:47:56 UTC ---------------------------------------- +1.7.11 - Thu, 08 Jun 2017 16:47:56 UTC +-------------------------------------- - [a3f69d5](../../commit/a3f69d5) [chore] add travis ci build status on README.md. - -v1.7.10 - Thu, 08 Jun 2017 16:43:41 UTC ---------------------------------------- +1.7.10 - Thu, 08 Jun 2017 16:43:41 UTC +-------------------------------------- - [651ce99](../../commit/651ce99) [chore] prevent publish if an error occur. - -v1.7.9 - Thu, 08 Jun 2017 12:59:39 UTC --------------------------------------- +1.7.9 - Thu, 08 Jun 2017 12:59:39 UTC +------------------------------------- - [99c7e32](../../commit/99c7e32) [fixed] use Object.assign for now. - -v1.7.8 - Thu, 08 Jun 2017 01:45:46 UTC --------------------------------------- +1.7.8 - Thu, 08 Jun 2017 01:45:46 UTC +------------------------------------- - [14a2fd0](../../commit/14a2fd0) [chore] improving build and publish pipeline. - -v1.7.7 - Tue, 18 Apr 2017 07:40:29 UTC --------------------------------------- +1.7.7 - Tue, 18 Apr 2017 07:40:29 UTC +------------------------------------- - [889ffde](../../commit/889ffde) [fixed] Removed additional es2015 causing problems - -v1.7.6 - Thu, 13 Apr 2017 08:41:16 UTC --------------------------------------- +1.7.6 - Thu, 13 Apr 2017 08:41:16 UTC +------------------------------------- - [048ef2d](../../commit/048ef2d) [fixed] remove additional es2015 from refCount - -v1.7.5 - Thu, 13 Apr 2017 08:20:34 UTC --------------------------------------- +1.7.5 - Thu, 13 Apr 2017 08:20:34 UTC +------------------------------------- - [1db0ee1](../../commit/1db0ee1) [fixed] remove es2015 from v1 branch - -v1.7.4 - Thu, 13 Apr 2017 07:37:19 UTC --------------------------------------- +1.7.4 - Thu, 13 Apr 2017 07:37:19 UTC +------------------------------------- - [86987d5](../../commit/86987d5) Use create-react-class to avoid React.createClass deprecations - [16efd72](../../commit/16efd72) Use prop-types - [e579a0d](../../commit/e579a0d) [fix] keep references of modals. - -v1.7.3 - Mon, 13 Mar 2017 19:22:00 UTC --------------------------------------- +1.7.3 - Mon, 13 Mar 2017 19:22:00 UTC +------------------------------------- - [e1df119](../../commit/e1df119) [fixed] remove portal context in timeout (#353) - -v1.7.2 - Wed, 08 Mar 2017 20:59:52 UTC --------------------------------------- +1.7.2 - Wed, 08 Mar 2017 20:59:52 UTC +------------------------------------- - [185f2b0](../../commit/185f2b0) Remove .bind(this) from removePortal call - -v1.7.1 - Thu, 02 Mar 2017 07:49:30 UTC --------------------------------------- +1.7.1 - Thu, 02 Mar 2017 07:49:30 UTC +------------------------------------- - [a1d29c6](../../commit/a1d29c6) [fixed] rewrite removePortal as es5 function - -v1.7.0 - Wed, 01 Mar 2017 20:54:08 UTC --------------------------------------- +1.7.0 - Wed, 01 Mar 2017 20:54:08 UTC +------------------------------------- - [fb3eb5e](../../commit/fb3eb5e) [chore] use afterEach to cleanup modals automatically. - [ea4f37a](../../commit/ea4f37a) [fixed] respect closeTimeoutMS during unmount - [f6768b7](../../commit/f6768b7) [change] improve reliability on focus management. - [4232477](../../commit/4232477) [fixed] Enable click to close in iOS (#301) (#304) (#313) - -v1.6.5 - Sat, 31 Dec 2016 10:14:28 UTC --------------------------------------- +1.6.5 - Sat, 31 Dec 2016 10:14:28 UTC +------------------------------------- - [c50f19a](../../commit/c50f19a) [fixed] Add file extention to entry point (#294) - [f22c206](../../commit/f22c206) Add v2 development info @@ -559,59 +515,55 @@ v1.6.5 - Sat, 31 Dec 2016 10:14:28 UTC - [08bf920](../../commit/08bf920) [fixed] closeTimeoutMS doesn't work without onRequestClose (#278) - [6c68e95](../../commit/6c68e95) Update CHANGELOG.md - -v1.6.4 - Wed, 14 Dec 2016 22:48:59 UTC --------------------------------------- +1.6.4 - Wed, 14 Dec 2016 22:48:59 UTC +------------------------------------- - [ad0b071](../../commit/ad0b071) Bumps lodash.assign to 4.2.0 (#277) - [694cb87](../../commit/694cb87) [fixed] updated references from rackt to reactjs. (#244) - [1dea51d](../../commit/1dea51d) Update travis build matrix - [e50dc70](../../commit/e50dc70) Update CHANGELOG.md - -v1.6.3 - Mon, 12 Dec 2016 07:03:43 UTC --------------------------------------- +1.6.3 - Mon, 12 Dec 2016 07:03:43 UTC +------------------------------------- - [a2e5952](../../commit/a2e5952) [docs] added required props info to README (#274) - [f460c10](../../commit/f460c10) Update CHANGELOG.md - -v1.6.2 - Sun, 11 Dec 2016 10:32:03 UTC --------------------------------------- +1.6.2 - Sun, 11 Dec 2016 10:32:03 UTC +------------------------------------- - -v1.6.1 - Tue, 06 Dec 2016 10:16:10 UTC --------------------------------------- -- [62d87e1](../../commit/62d87e1) [fixed] Remove arrow function from ES5 source +1.6.1 - Tue, 06 Dec 2016 10:16:10 UTC +------------------------------------- +- [62d87e1](../../commit/62d87e1) [fixed] Remove arrow function from ES5 source -v1.6.0 - Tue, 06 Dec 2016 08:09:25 UTC --------------------------------------- +1.6.0 - Tue, 06 Dec 2016 08:09:25 UTC +------------------------------------- - [de14816](../../commit/de14816) [added] Ability for modal to be appended to arbitrary elements (#183) - [3fdc672](../../commit/3fdc672) Ensure aria-hidden on appElement is reset on unmount - [e9fd43d](../../commit/e9fd43d) Document ReactModal__Body--open so people dare to use it - [3d8e5a0](../../commit/3d8e5a0) [added] Add contentLabel prop to put aria-label on modal content - -v1.5.2 - Sat, 08 Oct 2016 08:29:09 UTC --------------------------------------- +1.5.2 - Sat, 08 Oct 2016 08:29:09 UTC +------------------------------------- - [d78428b](../../commit/d78428b) [fixed] Remove remaining reference to role dialog - [b09cdf9](../../commit/b09cdf9) Update CHANGELOG.md - -v1.5.1 - Fri, 07 Oct 2016 22:11:39 UTC --------------------------------------- +1.5.1 - Fri, 07 Oct 2016 22:11:39 UTC +------------------------------------- - -v1.5.0 - Fri, 07 Oct 2016 20:18:52 UTC --------------------------------------- + +1.5.0 - Fri, 07 Oct 2016 20:18:52 UTC +------------------------------------- - [919daa3](../../commit/919daa3) [fixed] Remove the default aria role dialog - [c8106f2](../../commit/c8106f2) Update ModalPortal.js (#228) @@ -627,59 +579,51 @@ v1.5.0 - Fri, 07 Oct 2016 20:18:52 UTC - [d347547](../../commit/d347547) [fixed] Updates webpack distribution config to reference the correct externals (#210) - [f0933fd](../../commit/f0933fd) [doc] fix onRequestClose callback in Usage (#195) - -v1.4.0 - Thu, 30 Jun 2016 13:12:02 UTC --------------------------------------- +1.4.0 - Thu, 30 Jun 2016 13:12:02 UTC +------------------------------------- - [13bd46e](../../commit/13bd46e) [fixed] clear the delayed close timer when modal opens again. (#189) - [70d91eb](../../commit/70d91eb) [fixed] Add missing envify npm dependency. Closes #193 (#194) - -v1.3.0 - Tue, 17 May 2016 10:04:50 UTC --------------------------------------- +1.3.0 - Tue, 17 May 2016 10:04:50 UTC +------------------------------------- - [9089a2d](../../commit/9089a2d) [fixed] Make the modal portal render into body again (#176) - [e9aff7a](../../commit/e9aff7a) Update PULL_REQUEST_TEMPLATE.md - -v1.2.1 - Sat, 23 Apr 2016 13:09:46 UTC --------------------------------------- +1.2.1 - Sat, 23 Apr 2016 13:09:46 UTC +------------------------------------- - [aa66819](../../commit/aa66819) [fixed] Removes unneeded sanitizeProps function (#169) - -v1.2.0 - Thu, 21 Apr 2016 16:02:02 UTC --------------------------------------- +1.2.0 - Thu, 21 Apr 2016 16:02:02 UTC +------------------------------------- - [18f5eae](../../commit/18f5eae) fix typo in README :memo: (#168) - [a10683a](../../commit/a10683a) [fixed] Make the non-minified dist build present again (#164) - [04db149](../../commit/04db149) [added] Propagate event on close request (#91) - -v1.1.2 - Mon, 18 Apr 2016 20:36:05 UTC --------------------------------------- +1.1.2 - Mon, 18 Apr 2016 20:36:05 UTC +------------------------------------- - [4509133](../../commit/4509133) [fixed] moved sanitizeProps out of the render calls. (#162) - [25c1dad](../../commit/25c1dad) Update changelog for 1.1.1 - -v1.1.1 - Thu, 14 Apr 2016 23:30:45 UTC --------------------------------------- +1.1.1 - Thu, 14 Apr 2016 23:30:45 UTC +------------------------------------- - [f1555d9](../../commit/f1555d9) Merge branch 'development-improvements' - [9823bc5](../../commit/9823bc5) Use -p flag in webpack for minification and exclude externals react and react-dom (#159) - [72c8498](../../commit/72c8498) Move to using webpack for building the library - -v1.1.0 - Tue, 12 Apr 2016 07:03:08 UTC --------------------------------------- +1.1.0 - Tue, 12 Apr 2016 07:03:08 UTC +------------------------------------- - [6c03d17](../../commit/6c03d17) [added] trigger onAfterOpen callback when available. (#154) - [7cf8463](../../commit/7cf8463) [doc] Update docs to include details about CSS classes - -v1.0.0 - Fri, 08 Apr 2016 23:03:25 UTC --------------------------------------- +1.0.0 - Fri, 08 Apr 2016 23:03:25 UTC +------------------------------------- - [7af8ee5](../../commit/7af8ee5) Update README.md to include testing gotchas (#136) - [e4be332](../../commit/e4be332) Add extra information for contributors (#143) @@ -708,16 +652,14 @@ v1.0.0 - Fri, 08 Apr 2016 23:03:25 UTC - [3e89412](../../commit/3e89412) dev server listens on all interfaces - [63bee72](../../commit/63bee72) [fixed] Custom classnames override default styles - -v0.6.1 - Fri, 23 Oct 2015 12:03:54 UTC --------------------------------------- +0.6.1 - Fri, 23 Oct 2015 12:03:54 UTC +------------------------------------- - [e20595e](../../commit/e20595e) Merge pull request #87 from flskif/master - [5705b85](../../commit/5705b85) Ignore react-dom in build - -v0.6.0 - Wed, 21 Oct 2015 15:39:48 UTC --------------------------------------- +0.6.0 - Wed, 21 Oct 2015 15:39:48 UTC +------------------------------------- - [cd4dd21](../../commit/cd4dd21) Merge pull request #85 from miracle2k/master - [5c59b9f](../../commit/5c59b9f) Use renderSubtreeIntoContainer to keep context. @@ -732,9 +674,8 @@ v0.6.0 - Wed, 21 Oct 2015 15:39:48 UTC - [4c8ed91](../../commit/4c8ed91) imporved env check - [33d47db](../../commit/33d47db) added suport for isomorphic rendering - -v0.5.0 - Tue, 22 Sep 2015 13:19:44 UTC --------------------------------------- +0.5.0 - Tue, 22 Sep 2015 13:19:44 UTC +------------------------------------- - [408329f](../../commit/408329f) Updating dependencies - [b24bc4b](../../commit/b24bc4b) Merge pull request #65 from web2style/master @@ -749,9 +690,8 @@ v0.5.0 - Tue, 22 Sep 2015 13:19:44 UTC - [85a13b8](../../commit/85a13b8) Returning noscript tag instead of null - [0d5e76a](../../commit/0d5e76a) Updating README - -v0.3.0 - Wed, 15 Jul 2015 00:17:24 UTC --------------------------------------- +0.3.0 - Wed, 15 Jul 2015 00:17:24 UTC +------------------------------------- - [adecf62](../../commit/adecf62) [added] Class name on body when modal is open - [0e94233](../../commit/0e94233) Updating dependencies @@ -760,9 +700,8 @@ v0.3.0 - Wed, 15 Jul 2015 00:17:24 UTC - [fbb07d4](../../commit/fbb07d4) Moves classnames to dependencies - [278b9ba](../../commit/278b9ba) fixed 'unknow runtime error' ie IE8 - -v0.2.0 - Fri, 08 May 2015 23:16:40 UTC --------------------------------------- +0.2.0 - Fri, 08 May 2015 23:16:40 UTC +------------------------------------- - [1a51bf8](../../commit/1a51bf8) Merge pull request #31 from maisano/patch-1 - [494d7d2](../../commit/494d7d2) Merge pull request #28 from peterjmag/use-classnames-module @@ -773,9 +712,8 @@ v0.2.0 - Fri, 08 May 2015 23:16:40 UTC - [f5fe537](../../commit/f5fe537) [added] Ability to specify style for the modal contents - [6887b00](../../commit/6887b00) Shim the possibly-absent HTMLElement - -v0.1.1 - Tue, 31 Mar 2015 09:56:47 UTC --------------------------------------- +0.1.1 - Tue, 31 Mar 2015 09:56:47 UTC +------------------------------------- - [bb57045](../../commit/bb57045) Merge pull request #19 from amccloud/patch-2 - [10e9582](../../commit/10e9582) Merge pull request #18 from amccloud/patch-1 @@ -784,16 +722,14 @@ v0.1.1 - Tue, 31 Mar 2015 09:56:47 UTC - [c464368](../../commit/c464368) Check for addEventListener before tying to use to support IE 8 - [63b6828](../../commit/63b6828) Remove trailing commas for IE8 support - -v0.1.0 - Thu, 26 Feb 2015 10:14:27 UTC --------------------------------------- +0.1.0 - Thu, 26 Feb 2015 10:14:27 UTC +------------------------------------- - [db8b725](../../commit/db8b725) Merge pull request #16 from arasmussen/master - [1b8e2d0](../../commit/1b8e2d0) [fixed] ModalPortal's componentWillReceiveProps - -v0.0.7 - Fri, 02 Jan 2015 23:44:47 UTC --------------------------------------- +0.0.7 - Fri, 02 Jan 2015 23:44:47 UTC +------------------------------------- - [ea31beb](../../commit/ea31beb) Using shared stylesheet - [8e01b27](../../commit/8e01b27) Renaming example @@ -803,18 +739,16 @@ v0.0.7 - Fri, 02 Jan 2015 23:44:47 UTC - [2d62f51](../../commit/2d62f51) Adding default example - [4a85cd2](../../commit/4a85cd2) Update to React 0.12. Fix warnings. - -v0.0.6 - Wed, 03 Dec 2014 14:24:45 UTC --------------------------------------- +0.0.6 - Wed, 03 Dec 2014 14:24:45 UTC +------------------------------------- - [2f1973b](../../commit/2f1973b) Merge branch 'master' of https://github.com/rackt/react-modal - [28dbc63](../../commit/28dbc63) [added] Supporting custom overlay className closes #14 - [1038e3b](../../commit/1038e3b) Merge pull request #13 from knomedia/kill-extra-alias-in-build - [6626dae](../../commit/6626dae) [fixed] erroneous alias in webpack build - -v0.0.5 - Thu, 13 Nov 2014 11:55:47 UTC --------------------------------------- +0.0.5 - Thu, 13 Nov 2014 11:55:47 UTC +------------------------------------- - [edd0dc7](../../commit/edd0dc7) Merge pull request #12 from cavneb/example-bootstrap - [e5cb4e2](../../commit/e5cb4e2) Bootstrap-style modal example @@ -822,9 +756,8 @@ v0.0.5 - Thu, 13 Nov 2014 11:55:47 UTC - [b7a38de](../../commit/b7a38de) [fixed] Warning caused by trying to focus null element closes #11 - [2ac5290](../../commit/2ac5290) Better solution for applying focus - -v0.0.4 - Tue, 11 Nov 2014 09:08:14 UTC --------------------------------------- +0.0.4 - Tue, 11 Nov 2014 09:08:14 UTC +------------------------------------- - [ebcc11f](../../commit/ebcc11f) s/script/scripts/ - [278cfbc](../../commit/278cfbc) Merge pull request #10 from rackt/bug-9 @@ -833,9 +766,8 @@ v0.0.4 - Tue, 11 Nov 2014 09:08:14 UTC - [07541b3](../../commit/07541b3) example displaying bug - [31c160d](../../commit/31c160d) switch to web pack dev server for examples - -v0.0.3 - Fri, 31 Oct 2014 13:25:20 UTC --------------------------------------- +0.0.3 - Fri, 31 Oct 2014 13:25:20 UTC +------------------------------------- - [cf3e57a](../../commit/cf3e57a) Merge pull request #5 from leoasis/fix_main_package_json - [5ea6651](../../commit/5ea6651) Fix main entry point in package.json @@ -844,17 +776,15 @@ v0.0.3 - Fri, 31 Oct 2014 13:25:20 UTC - [de0b661](../../commit/de0b661) slightly less junky README - [cde1572](../../commit/cde1572) hang on people, just hang on. - -v0.0.2 - Wed, 24 Sep 2014 20:36:47 UTC --------------------------------------- +0.0.2 - Wed, 24 Sep 2014 20:36:47 UTC +------------------------------------- - -v0.0.1 - Wed, 24 Sep 2014 16:26:40 UTC --------------------------------------- - -- [f0727db](../../commit/f0727db) add built files +0.0.1 - Wed, 24 Sep 2014 16:26:40 UTC +------------------------------------- +- [f0727db](../../commit/f0727db) add built files diff --git a/Makefile b/Makefile index b293eca9..e0c421d5 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ COVERAGE?=true BRANCH=$(shell git rev-parse --abbrev-ref HEAD) CURRENT_VERSION:=$(shell jq ".version" package.json) -VERSION:=$(if $(RELEASE),$(shell read -p "Release $(CURRENT_VERSION) -> " V && echo $$V),$(subst /,-,$(BRANCH))) +VERSION:=$(if $(RELEASE),$(shell read -p "Release $(CURRENT_VERSION) -> " V && echo $$V),"HEAD") help: info @echo @@ -79,10 +79,8 @@ check-working-tree: exit 1 changelog: - @echo "[Updating CHANGELOG.md $(CURRENT_VERSION)]" - @python3 ./scripts/changelog.py v$(CURRENT_VERSION) v$(VERSION) > .changelog_update - @cat .changelog_update CHANGELOG.md > tmp && mv tmp CHANGELOG.md - @rm .changelog_update + @echo "[Updating CHANGELOG.md $(CURRENT_VERSION) > $(VERSION)]" + python ./scripts/changelog.py -a $(VERSION) > CHANGELOG.md compile: @echo "[Compiling source]" @@ -98,7 +96,7 @@ release-commit: @git commit --amend -m "`git log -1 --format=%s`" release-tag: - git tag "v$(VERSION)" + git tag "v$(VERSION)" -m "`python ./scripts/changelog.py -c $(VERSION)`" publish-version: release-commit release-tag @echo "[Publishing]" @@ -120,7 +118,7 @@ init-docs-repo: build-docs: @echo "[Building documentation]" @rm -rf _book - @mkdocs build + @mkdocs build pre-publish-docs: clean-docs init-docs-repo deps-docs @@ -150,6 +148,6 @@ clean-coverage: @rm -rf ./coverage/* clean-build: - @rm -rf .version .branch lib/* + @rm -rf lib/* clean: clean-build clean-docs clean-coverage diff --git a/scripts/changelog.py b/scripts/changelog.py index b58102da..76823e0f 100644 --- a/scripts/changelog.py +++ b/scripts/changelog.py @@ -1,105 +1,79 @@ # Requires python3 to work since, python 3< does not implement %z. import sys -import os -import re -import json from datetime import datetime -import pytz -from subprocess import Popen, PIPE, STDOUT +from subprocess import Popen, PIPE +import semver +import functools -class Version(object): - def __init__(self, version): - fix = re.search('[v]?(\d+)\.(\d+).(\d+).*', version).groups() - self.major = int(fix[0]) - self.minor = int(fix[1]) - self.patch = int(fix[2]) - self.build = None - self.tip = False +# 1: version, 2: date, 3: dashes, 4: entries +LOG_ENTRY = """{} +{} - def __str__(self): - return self.__repr__() +{} +""" - def __repr__(self): - return "v" + str(self.major) + "." + str(self.minor) + "." + str(self.patch) +head_version = "HEAD" -class Changelog(object): - def __init__(self, info): - a, b, log = info - self.log = log - self.a = a - self.b = b - def denyReleases(self, log): - return not ('release v' in log or 'Release v' in log) - - def log_in_between_versions(self): - hash = self.log.split(' ')[0] +def git_exec(args): + p = Popen(" ".join(["git"] + args), shell=True, stdout=PIPE, stderr=PIPE) + out, err = p.communicate() + return out.decode('utf-8') - if zeroversion(self.a): - return "" - date_time = git_log([str(self.a), "-1", '--format="%ad"']).split('\n')[0] +def git_log(args): + return git_exec(["log"] + args) - if date_time is not '': - dt = datetime.strptime(date_time, '%a %b %d %H:%M:%S %Y %z') - else: - dt = datetime.now() - dt = dt.strftime('%a, %d %b %Y %H:%M:%S') - log = str(self.a) + " - " + dt + " UTC\n" - log = log + ("-" * (len(log) - 1)) + "\n\n" +def log_entry(entry): + log = entry.split(' ') + hash = log[0] + log = ' '.join(log[1:]) - actual_log = list(filter(self.denyReleases, self.log.splitlines())) + return "- [%s](../../commit/%s) %s" % (hash, hash, log) - if len(actual_log) == 0: - entries = '-\n\n' - else: - entries = "\n".join(map(url_entry, actual_log)) + "\n\n" - log = log + entries +def get_tags_date(tag): + args = [tag, "-1", '--format="%ad"'] + date_time = git_log(args).split('\n')[0] - return log + if date_time != '': + dt = datetime.strptime(date_time, '%a %b %d %H:%M:%S %Y %z') + else: + dt = datetime.now() + dt = dt.strftime('%a, %d %b %Y %H:%M:%S') + return dt - def __str__(self): - return self.__repr__(self) - def __repr__(self): - return "Changelog: " + self.log +def log_in_between_versions(t): + (a, b, logs) = t + v = b and to_version(b) or head_version + dt = get_tags_date(v) -def url_entry(entry): - log = entry.split(' ') - hash = log[0] - log = ' '.join(log[1:]) + header = "{} - {} UTC".format(b or head_version, dt) + dashes = ("-" * len(header)) - return "- [%s](../../commit/%s) %s" % (hash, hash, log) + def write_log(acc, log): + if log[8:8+7] == 'Release' or log[8:8+7] == 'release': + return acc + acc.append(log_entry(log)) + return acc -def zeroversion(v): - return v.major == 0 and v.minor == 0 and v.patch == 0 + actual_log = list(functools.reduce(write_log, + logs.splitlines(), + [])) -class compareversions(object): - def __init__(self, obj, *args): - self.obj = obj - - def __lt__(self, other): - if self.obj.major < other.obj.major: - return True - if self.obj.minor < other.obj.minor: - return True - if self.obj.patch < other.obj.patch: - return True - return False + if len(actual_log) == 0: + entries = '-\n\n' + else: + entries = "\n".join(actual_log) -def git_exec(args): - p = Popen(" ".join(["git"] + args), shell=True, stdout=PIPE, stderr=PIPE) - out, err = p.communicate() - return out.decode('utf-8') + return LOG_ENTRY.format(header, dashes, entries) -def git_log(args): - return git_exec(["log"] + args) def adjacents(ls, f, res): if len(ls) == 0: @@ -114,48 +88,60 @@ def adjacents(ls, f, res): res.append(f(first, next)) return adjacents(ls[1:], f, res) -def logs_between(a, b): - v = a - if b is None: - _ = str(a) - else: - if a.tip: - a = "HEAD" - else: - a = str(a) - _ = str(b) + ".." + a - return (v, b, git_log(["--format='%h %s'", _])) -def changelog(with_versions): - process = with_versions - versions = [] +def to_version(tag): + if not tag: + return "HEAD" + if tag.prerelease: + return str(tag) + return "v{}".format(tag) - generate_all = len(with_versions) == 0 - if generate_all: - lines = git_exec(["tag", "-l"]) - process = lines.splitlines() +def logs_between(base, b): + to = to_version(b) + between = "{}..{}".format(to_version(base), to) + logs = git_log([between, "--format='%h %s'"]) + return (base, b, logs) - for item in process: - if not ('rc' in item or 'alpha' in item): - versions.append(Version(item)) - versions = sorted(versions, key=compareversions, reverse=True) +def parse_version(version): + if version == 'HEAD': + return version + if version[0] == 'v': + version = version[1:] + return semver.parse_version_info(version) + + +def get_all_tags(): + lines = git_exec(["tag", "-l"]) + versions = map(parse_version, lines.splitlines()) + return sorted(versions) - if generate_all: - vs = map(Changelog, adjacents(versions, logs_between, [])) - else: - versions[0].tip = True - vs = map(Changelog, [logs_between(versions[0], versions[1])]) - return [v.log_in_between_versions() for v in vs] +def generate_current(): + versions = get_all_tags() + base = versions[-1] + logs = logs_between(base, None) + return [log_in_between_versions(logs)] + + +def generate_all(): + versions = get_all_tags() + log_versions = adjacents(versions, logs_between, []) + vs = map(log_in_between_versions, log_versions) + return list(vs) if __name__ == "__main__": - args = sys.argv[1:] - for_version=[] + argc = len(sys.argv) + + if sys.argv[1] == '-a': # all + head_version = sys.argv[2] if argc > 2 else "HEAD" + log = generate_all() + log.reverse() - if len(args) > 0: - for_version = list(args) + elif sys.argv[1] == '-c': # current + head_version = sys.argv[2] + log = generate_current() - print("\n".join(changelog(for_version))) + print("\n".join(log))