From ee1863487bd70a2664ff856c4aacfc34d3a5043d Mon Sep 17 00:00:00 2001 From: axetroy Date: Fri, 27 Nov 2020 00:33:44 +0800 Subject: [PATCH] feat: rename 'changelog' to 'whatchanged' BREAKING CHANGE: repo and binary rename to whatchanged ```diff - $ changelog --help + $ whatchanged --help ``` Closes #6 --- .github/workflows/ci.yml | 2 +- .github/workflows/repl.yml | 2 +- .goreleaser.yml | 2 +- 1_parser/parser.go | 2 +- 2_extractor/extractor.go | 4 +- 3_transformer/transform.go | 6 +- 4_generator/generate.go | 4 +- CHANGELOG.md | 96 +++++++++---------- Procfile | 2 +- README.md | 58 +++++------ .../whatchanged-remote}/main.go | 14 +-- cmd/axetroy/whatchanged-remote/run.sh | 3 + cmd/changelog-remote/run.sh | 3 - go.mod | 2 +- install.sh | 18 ++-- logger/logger.go | 4 +- main.go | 40 ++++---- repl/index.html | 2 +- repl/package.json | 2 +- repl/vite.config.js | 2 +- 20 files changed, 134 insertions(+), 134 deletions(-) rename cmd/{changelog-remote => axetroy/whatchanged-remote}/main.go (87%) create mode 100755 cmd/axetroy/whatchanged-remote/run.sh delete mode 100755 cmd/changelog-remote/run.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 40cb740d..274a2fd9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,7 +52,7 @@ jobs: release: name: Release to Github - if: startsWith(github.ref, 'refs/tags/') && github.repository == 'axetroy/changelog' + if: startsWith(github.ref, 'refs/tags/') && github.repository == 'axetroy/whatchanged' needs: [ci] runs-on: ubuntu-latest steps: diff --git a/.github/workflows/repl.yml b/.github/workflows/repl.yml index d1d3792e..f9be0825 100644 --- a/.github/workflows/repl.yml +++ b/.github/workflows/repl.yml @@ -31,7 +31,7 @@ jobs: release: name: Release to Github - if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/master') && github.repository == 'axetroy/changelog' + if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/master') && github.repository == 'axetroy/whatchanged' needs: [ci] runs-on: ubuntu-latest steps: diff --git a/.goreleaser.yml b/.goreleaser.yml index c2bc029c..f95af649 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,5 +1,5 @@ builds: - - binary: changelog + - binary: whatchanged goos: - windows - darwin diff --git a/1_parser/parser.go b/1_parser/parser.go index 83d35957..9a5728a2 100644 --- a/1_parser/parser.go +++ b/1_parser/parser.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - "github.com/axetroy/changelog/internal/client" + "github.com/axetroy/whatchanged/internal/client" "github.com/go-git/go-git/v5/plumbing/object" "github.com/pkg/errors" ) diff --git a/2_extractor/extractor.go b/2_extractor/extractor.go index f3fb5002..16c4068b 100644 --- a/2_extractor/extractor.go +++ b/2_extractor/extractor.go @@ -3,8 +3,8 @@ package extractor import ( "io" - parser "github.com/axetroy/changelog/1_parser" - "github.com/axetroy/changelog/internal/client" + parser "github.com/axetroy/whatchanged/1_parser" + "github.com/axetroy/whatchanged/internal/client" "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/plumbing/object" diff --git a/3_transformer/transform.go b/3_transformer/transform.go index b7d68c00..853788cf 100644 --- a/3_transformer/transform.go +++ b/3_transformer/transform.go @@ -1,9 +1,9 @@ package transformer import ( - extractor "github.com/axetroy/changelog/2_extractor" - "github.com/axetroy/changelog/internal/client" - "github.com/axetroy/changelog/internal/commit/parser" + extractor "github.com/axetroy/whatchanged/2_extractor" + "github.com/axetroy/whatchanged/internal/client" + "github.com/axetroy/whatchanged/internal/commit/parser" "github.com/go-git/go-git/v5/plumbing/object" ) diff --git a/4_generator/generate.go b/4_generator/generate.go index 10a84280..61be6c13 100644 --- a/4_generator/generate.go +++ b/4_generator/generate.go @@ -8,8 +8,8 @@ import ( "net/url" "strings" - transformer "github.com/axetroy/changelog/3_transformer" - "github.com/axetroy/changelog/internal/client" + transformer "github.com/axetroy/whatchanged/3_transformer" + "github.com/axetroy/whatchanged/internal/client" "github.com/pkg/errors" giturls "github.com/whilp/git-urls" ) diff --git a/CHANGELOG.md b/CHANGELOG.md index 73a66a4d..9d6d42ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,57 +3,57 @@ v0.1.0 ### 🔥 New feature: -- link commit for generation([`b9432db`](https://github.com/axetroy/changelog/commit/b9432db1d1f5afe170296b9e0bfebee1aa62fabb)) (thanks @axetroy) -- add full preset template([`7553570`](https://github.com/axetroy/changelog/commit/7553570590b571bd33e10a4f80ec5639d0613042)) (thanks @axetroy) -- support changelog for git submodule([`ec6a957`](https://github.com/axetroy/changelog/commit/ec6a957752fbca9faa261d8694826779e2cbec1f)) (thanks @axetroy) -- add writer step([`441ad13`](https://github.com/axetroy/changelog/commit/441ad1322b1fecaca89a170ecebaf2955a77d630)) (thanks @axetroy) -- add formatter for markdown output([`8c177e0`](https://github.com/axetroy/changelog/commit/8c177e032e8bdb1b76d135981ea10e7053f3ef34)) (thanks @axetroy) -- add --file flag to generate file([`0e4fb09`](https://github.com/axetroy/changelog/commit/0e4fb09789732fec5b09b247e208d61794c3da0d)) (thanks @axetroy) -- support custom tmeplate and preset([`3aa0aee`](https://github.com/axetroy/changelog/commit/3aa0aee2584036da1c63dea9bb399cb83b48a8db)) (thanks @axetroy) -- support tag ranges([`3d14c9c`](https://github.com/axetroy/changelog/commit/3d14c9cf2dc7d51e348fddc7764d8aba1691fac9)) (thanks @axetroy) -- support version range. eg v2.0.0~v1.0.0([`a65a4a8`](https://github.com/axetroy/changelog/commit/a65a4a8bd0122e41c7b20c98676e9def76e786d3)) (thanks @axetroy) -- parse commit message and generate to template([`7f67e78`](https://github.com/axetroy/changelog/commit/7f67e783926fed647d2ad5414f31448eea106fc3)) (thanks @axetroy) +- link commit for generation([`b9432db`](https://github.com/axetroy/whatchanged/commit/b9432db1d1f5afe170296b9e0bfebee1aa62fabb)) (thanks @axetroy) +- add full preset template([`7553570`](https://github.com/axetroy/whatchanged/commit/7553570590b571bd33e10a4f80ec5639d0613042)) (thanks @axetroy) +- support changelog for git submodule([`ec6a957`](https://github.com/axetroy/whatchanged/commit/ec6a957752fbca9faa261d8694826779e2cbec1f)) (thanks @axetroy) +- add writer step([`441ad13`](https://github.com/axetroy/whatchanged/commit/441ad1322b1fecaca89a170ecebaf2955a77d630)) (thanks @axetroy) +- add formatter for markdown output([`8c177e0`](https://github.com/axetroy/whatchanged/commit/8c177e032e8bdb1b76d135981ea10e7053f3ef34)) (thanks @axetroy) +- add --file flag to generate file([`0e4fb09`](https://github.com/axetroy/whatchanged/commit/0e4fb09789732fec5b09b247e208d61794c3da0d)) (thanks @axetroy) +- support custom tmeplate and preset([`3aa0aee`](https://github.com/axetroy/whatchanged/commit/3aa0aee2584036da1c63dea9bb399cb83b48a8db)) (thanks @axetroy) +- support tag ranges([`3d14c9c`](https://github.com/axetroy/whatchanged/commit/3d14c9cf2dc7d51e348fddc7764d8aba1691fac9)) (thanks @axetroy) +- support version range. eg v2.0.0~v1.0.0([`a65a4a8`](https://github.com/axetroy/whatchanged/commit/a65a4a8bd0122e41c7b20c98676e9def76e786d3)) (thanks @axetroy) +- parse commit message and generate to template([`7f67e78`](https://github.com/axetroy/whatchanged/commit/7f67e783926fed647d2ad5414f31448eea106fc3)) (thanks @axetroy) ### 🐛 Bugs fixed: -- improve ssh git url parser([`9993ee6`](https://github.com/axetroy/changelog/commit/9993ee600c84cf77d3a0c634e8fa83c2580e137f)) (thanks @axetroy) -- commit range not include commit of tag([`f8df0ba`](https://github.com/axetroy/changelog/commit/f8df0ba654c8faf67eccf98262cd55807e53e597)) (thanks @axetroy) -- unescape template([`e118cbf`](https://github.com/axetroy/changelog/commit/e118cbfafd201b945848f15303fdb261e251f058)) (thanks @axetroy) -- if empty argument for command line([`9c79fd9`](https://github.com/axetroy/changelog/commit/9c79fd91bbf88f7861b4aca89ced8384cf2b9bcd)) (thanks @axetroy) -- **ci**: remove unsued code([`66bcf8f`](https://github.com/axetroy/changelog/commit/66bcf8f43db85409e0392c93f2e347ed91699e81)) (thanks @axetroy) +- improve ssh git url parser([`9993ee6`](https://github.com/axetroy/whatchanged/commit/9993ee600c84cf77d3a0c634e8fa83c2580e137f)) (thanks @axetroy) +- commit range not include commit of tag([`f8df0ba`](https://github.com/axetroy/whatchanged/commit/f8df0ba654c8faf67eccf98262cd55807e53e597)) (thanks @axetroy) +- unescape template([`e118cbf`](https://github.com/axetroy/whatchanged/commit/e118cbfafd201b945848f15303fdb261e251f058)) (thanks @axetroy) +- if empty argument for command line([`9c79fd9`](https://github.com/axetroy/whatchanged/commit/9c79fd91bbf88f7861b4aca89ced8384cf2b9bcd)) (thanks @axetroy) +- **ci**: remove unsued code([`66bcf8f`](https://github.com/axetroy/whatchanged/commit/66bcf8f43db85409e0392c93f2e347ed91699e81)) (thanks @axetroy) ### 💪 Commits(33): -- [`7c687f7`](https://github.com/axetroy/changelog/commit/7c687f7d729f199ee295109012cc5a2661f96c54) - ci: increase linter timeout -- [`b61c491`](https://github.com/axetroy/changelog/commit/b61c49171a776045d89e6cbaad82326070e2db78) - refactor: improve default preset -- [`1292dfc`](https://github.com/axetroy/changelog/commit/1292dfc0e39abf24262e94cd9076d91808dd0cc4) - refactor: update template -- [`9993ee6`](https://github.com/axetroy/changelog/commit/9993ee600c84cf77d3a0c634e8fa83c2580e137f) - fix: improve ssh git url parser -- [`b9432db`](https://github.com/axetroy/changelog/commit/b9432db1d1f5afe170296b9e0bfebee1aa62fabb) - feat: link commit for generation -- [`7553570`](https://github.com/axetroy/changelog/commit/7553570590b571bd33e10a4f80ec5639d0613042) - feat: add full preset template -- [`7068672`](https://github.com/axetroy/changelog/commit/706867220fa9ca537855f359d3e04d0c3762b793) - update readme -- [`ec6a957`](https://github.com/axetroy/changelog/commit/ec6a957752fbca9faa261d8694826779e2cbec1f) - feat: support changelog for git submodule -- [`f540d6f`](https://github.com/axetroy/changelog/commit/f540d6f7123334dac558a37c6ac056fed1021cda) - refactor: rename transform to transformer -- [`441ad13`](https://github.com/axetroy/changelog/commit/441ad1322b1fecaca89a170ecebaf2955a77d630) - feat: add writer step -- [`f8df0ba`](https://github.com/axetroy/changelog/commit/f8df0ba654c8faf67eccf98262cd55807e53e597) - fix: commit range not include commit of tag -- [`8c177e0`](https://github.com/axetroy/changelog/commit/8c177e032e8bdb1b76d135981ea10e7053f3ef34) - feat: add formatter for markdown output -- [`a47fe84`](https://github.com/axetroy/changelog/commit/a47fe84d2141635d82c2dc49500bfc2a81c03535) - docs: update how it works -- [`0e4fb09`](https://github.com/axetroy/changelog/commit/0e4fb09789732fec5b09b247e208d61794c3da0d) - feat: add --file flag to generate file -- [`3aa0aee`](https://github.com/axetroy/changelog/commit/3aa0aee2584036da1c63dea9bb399cb83b48a8db) - feat: support custom tmeplate and preset -- [`e118cbf`](https://github.com/axetroy/changelog/commit/e118cbfafd201b945848f15303fdb261e251f058) - fix: unescape template -- [`3d14c9c`](https://github.com/axetroy/changelog/commit/3d14c9cf2dc7d51e348fddc7764d8aba1691fac9) - feat: support tag ranges -- [`44ce3cd`](https://github.com/axetroy/changelog/commit/44ce3cd8d68b786a3aac6b5daba90e7f12b75200) - docs: update readme -- [`9c79fd9`](https://github.com/axetroy/changelog/commit/9c79fd91bbf88f7861b4aca89ced8384cf2b9bcd) - fix: if empty argument for command line -- [`0b6ba0c`](https://github.com/axetroy/changelog/commit/0b6ba0c3fc49139467025eaebbe16c158a0cce65) - refactor: Refactor the software architecture to make it clearer and simpler -- [`66bcf8f`](https://github.com/axetroy/changelog/commit/66bcf8f43db85409e0392c93f2e347ed91699e81) - fix(ci): remove unsued code -- [`89fecf5`](https://github.com/axetroy/changelog/commit/89fecf5588f1133f70a8aaf6db3488184ba2ceb2) - refactor: remove unsued code -- [`a65a4a8`](https://github.com/axetroy/changelog/commit/a65a4a8bd0122e41c7b20c98676e9def76e786d3) - feat: support version range. eg v2.0.0~v1.0.0 -- [`6301c2f`](https://github.com/axetroy/changelog/commit/6301c2f01d881ae861e6c4459a411a5f48c74ba0) - update help information -- [`770ed02`](https://github.com/axetroy/changelog/commit/770ed02d43c4593ab9db8e71a9f93987812d97bc) - update -- [`585445d`](https://github.com/axetroy/changelog/commit/585445d917d4cb74d80b1c385b446f7e09a1606c) - cache tags -- [`b47e49c`](https://github.com/axetroy/changelog/commit/b47e49cf8efac3f5aba9df0149295694424beaf1) - filter tag with semver version -- [`7f67e78`](https://github.com/axetroy/changelog/commit/7f67e783926fed647d2ad5414f31448eea106fc3) - feat: parse commit message and generate to template -- [`b907117`](https://github.com/axetroy/changelog/commit/b907117bca3d6306955070b933361ecb0da0627e) - update ci -- [`ef5b38a`](https://github.com/axetroy/changelog/commit/ef5b38ad50dd150cbdbeff031f6898d9d0aff35a) - update ci linter version -- [`dd55cc8`](https://github.com/axetroy/changelog/commit/dd55cc85d6a3b9c482ba376fa862f20b6de11d5b) - fix lint -- [`26408cc`](https://github.com/axetroy/changelog/commit/26408ccef0f6256ca70edda59e4ab1d1c15fca72) - init -- [`824d351`](https://github.com/axetroy/changelog/commit/824d3511bf90e8fda3d1c7be679274d71ce73f52) - Initial commit +- [`7c687f7`](https://github.com/axetroy/whatchanged/commit/7c687f7d729f199ee295109012cc5a2661f96c54) - ci: increase linter timeout +- [`b61c491`](https://github.com/axetroy/whatchanged/commit/b61c49171a776045d89e6cbaad82326070e2db78) - refactor: improve default preset +- [`1292dfc`](https://github.com/axetroy/whatchanged/commit/1292dfc0e39abf24262e94cd9076d91808dd0cc4) - refactor: update template +- [`9993ee6`](https://github.com/axetroy/whatchanged/commit/9993ee600c84cf77d3a0c634e8fa83c2580e137f) - fix: improve ssh git url parser +- [`b9432db`](https://github.com/axetroy/whatchanged/commit/b9432db1d1f5afe170296b9e0bfebee1aa62fabb) - feat: link commit for generation +- [`7553570`](https://github.com/axetroy/whatchanged/commit/7553570590b571bd33e10a4f80ec5639d0613042) - feat: add full preset template +- [`7068672`](https://github.com/axetroy/whatchanged/commit/706867220fa9ca537855f359d3e04d0c3762b793) - update readme +- [`ec6a957`](https://github.com/axetroy/whatchanged/commit/ec6a957752fbca9faa261d8694826779e2cbec1f) - feat: support changelog for git submodule +- [`f540d6f`](https://github.com/axetroy/whatchanged/commit/f540d6f7123334dac558a37c6ac056fed1021cda) - refactor: rename transform to transformer +- [`441ad13`](https://github.com/axetroy/whatchanged/commit/441ad1322b1fecaca89a170ecebaf2955a77d630) - feat: add writer step +- [`f8df0ba`](https://github.com/axetroy/whatchanged/commit/f8df0ba654c8faf67eccf98262cd55807e53e597) - fix: commit range not include commit of tag +- [`8c177e0`](https://github.com/axetroy/whatchanged/commit/8c177e032e8bdb1b76d135981ea10e7053f3ef34) - feat: add formatter for markdown output +- [`a47fe84`](https://github.com/axetroy/whatchanged/commit/a47fe84d2141635d82c2dc49500bfc2a81c03535) - docs: update how it works +- [`0e4fb09`](https://github.com/axetroy/whatchanged/commit/0e4fb09789732fec5b09b247e208d61794c3da0d) - feat: add --file flag to generate file +- [`3aa0aee`](https://github.com/axetroy/whatchanged/commit/3aa0aee2584036da1c63dea9bb399cb83b48a8db) - feat: support custom tmeplate and preset +- [`e118cbf`](https://github.com/axetroy/whatchanged/commit/e118cbfafd201b945848f15303fdb261e251f058) - fix: unescape template +- [`3d14c9c`](https://github.com/axetroy/whatchanged/commit/3d14c9cf2dc7d51e348fddc7764d8aba1691fac9) - feat: support tag ranges +- [`44ce3cd`](https://github.com/axetroy/whatchanged/commit/44ce3cd8d68b786a3aac6b5daba90e7f12b75200) - docs: update readme +- [`9c79fd9`](https://github.com/axetroy/whatchanged/commit/9c79fd91bbf88f7861b4aca89ced8384cf2b9bcd) - fix: if empty argument for command line +- [`0b6ba0c`](https://github.com/axetroy/whatchanged/commit/0b6ba0c3fc49139467025eaebbe16c158a0cce65) - refactor: Refactor the software architecture to make it clearer and simpler +- [`66bcf8f`](https://github.com/axetroy/whatchanged/commit/66bcf8f43db85409e0392c93f2e347ed91699e81) - fix(ci): remove unsued code +- [`89fecf5`](https://github.com/axetroy/whatchanged/commit/89fecf5588f1133f70a8aaf6db3488184ba2ceb2) - refactor: remove unsued code +- [`a65a4a8`](https://github.com/axetroy/whatchanged/commit/a65a4a8bd0122e41c7b20c98676e9def76e786d3) - feat: support version range. eg v2.0.0~v1.0.0 +- [`6301c2f`](https://github.com/axetroy/whatchanged/commit/6301c2f01d881ae861e6c4459a411a5f48c74ba0) - update help information +- [`770ed02`](https://github.com/axetroy/whatchanged/commit/770ed02d43c4593ab9db8e71a9f93987812d97bc) - update +- [`585445d`](https://github.com/axetroy/whatchanged/commit/585445d917d4cb74d80b1c385b446f7e09a1606c) - cache tags +- [`b47e49c`](https://github.com/axetroy/whatchanged/commit/b47e49cf8efac3f5aba9df0149295694424beaf1) - filter tag with semver version +- [`7f67e78`](https://github.com/axetroy/whatchanged/commit/7f67e783926fed647d2ad5414f31448eea106fc3) - feat: parse commit message and generate to template +- [`b907117`](https://github.com/axetroy/whatchanged/commit/b907117bca3d6306955070b933361ecb0da0627e) - update ci +- [`ef5b38a`](https://github.com/axetroy/whatchanged/commit/ef5b38ad50dd150cbdbeff031f6898d9d0aff35a) - update ci linter version +- [`dd55cc8`](https://github.com/axetroy/whatchanged/commit/dd55cc85d6a3b9c482ba376fa862f20b6de11d5b) - fix lint +- [`26408cc`](https://github.com/axetroy/whatchanged/commit/26408ccef0f6256ca70edda59e4ab1d1c15fca72) - init +- [`824d351`](https://github.com/axetroy/whatchanged/commit/824d3511bf90e8fda3d1c7be679274d71ce73f52) - Initial commit diff --git a/Procfile b/Procfile index bbe89a8e..7ea07e7e 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -web: ./bin/changelog-remote \ No newline at end of file +web: ./bin/whatchanged-remote \ No newline at end of file diff --git a/README.md b/README.md index e6a8f4cb..b372a6d2 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,17 @@ -[![Build Status](https://github.com/axetroy/changelog/workflows/ci/badge.svg)](https://github.com/axetroy/changelog/actions) -[![Build Status](https://github.com/axetroy/changelog/workflows/repl/badge.svg)](https://github.com/axetroy/changelog/actions) -[![Go Report Card](https://goreportcard.com/badge/github.com/axetroy/changelog)](https://goreportcard.com/report/github.com/axetroy/changelog) -![Latest Version](https://img.shields.io/github/v/release/axetroy/changelog.svg) -![License](https://img.shields.io/github/license/axetroy/changelog.svg) -![Repo Size](https://img.shields.io/github/repo-size/axetroy/changelog.svg) +[![Build Status](https://github.com/axetroy/whatchanged/workflows/ci/badge.svg)](https://github.com/axetroy/whatchanged/actions) +[![Build Status](https://github.com/axetroy/whatchanged/workflows/repl/badge.svg)](https://github.com/axetroy/whatchanged/actions) +[![Go Report Card](https://goreportcard.com/badge/github.com/axetroy/whatchanged)](https://goreportcard.com/report/github.com/axetroy/whatchanged) +![Latest Version](https://img.shields.io/github/v/release/axetroy/whatchanged.svg) +![License](https://img.shields.io/github/license/axetroy/whatchanged.svg) +![Repo Size](https://img.shields.io/github/repo-size/axetroy/whatchanged.svg) -## changelog +## whatchanged An elegant changelog generator. Focus on **Elegant**/**Simple**/**Efficient**/**Scalable** -[Feel the magic online](https://axetroy.github.io/changelog/) +[Feel the magic online](https://axetroy.github.io/whatchanged/) Feature: @@ -24,11 +24,11 @@ Feature: ### Usage ```bash -$ changelog --help -changelog - a cli to generate changelog from git project +$ whatchanged --help +whatchanged - a cli to generate changelog from git project USAGE: - changelog [OPTIONS] [version] + whatchanged [OPTIONS] [version] ARGUMENTS: [version] Optional version or version range. @@ -56,35 +56,35 @@ OPTIONS: --tpl Specify the template file for generating. Only available when --fmt=md. EXAMPLES: - # generate changelog from HEAD to . equivalent to 'changelog HEAD~tag:0' - $ changelog + # generate changelog from HEAD to . equivalent to 'whatchanged HEAD~tag:0' + $ whatchanged # generate changelog of the specified version - $ changelog v1.2.0 + $ whatchanged v1.2.0 # generate changelog within the specified range - $ changelog v1.3.0~v1.2.0 + $ whatchanged v1.3.0~v1.2.0 # generate changelog from HEAD to - $ changelog ~tag:0 + $ whatchanged ~tag:0 # generate changelog from <0th tag> to <2th tag> - $ changelog tag:0~tag:2 + $ whatchanged tag:0~tag:2 # generate changelog from HEAD to specified version - $ changelog HEAD~v1.3.0 + $ whatchanged HEAD~v1.3.0 # generate all changelog - $ changelog HEAD~ + $ whatchanged HEAD~ # generate changelog from two commit hashes - $ changelog 770ed02~585445d + $ whatchanged 770ed02~585445d # Generate changelog for the specified project - $ changelog --dir=/path/to/project v1.0.0 + $ whatchanged --dir=/path/to/project v1.0.0 SOURCE CODE: - https://github.com/axetroy/changelog + https://github.com/axetroy/whatchanged ``` ### Installation @@ -93,16 +93,16 @@ If you are using Linux/macOS. you can install it with the following command: ```shell # install latest version -curl -fsSL https://raw.githubusercontent.com/axetroy/changelog/master/install.sh | bash +curl -fsSL https://raw.githubusercontent.com/axetroy/whatchanged/master/install.sh | bash # or install specified version -curl -fsSL https://raw.githubusercontent.com/axetroy/changelog/master/install.sh | bash -s v0.1.0 +curl -fsSL https://raw.githubusercontent.com/axetroy/whatchanged/master/install.sh | bash -s v0.1.0 # or install from gobinaries.com -curl -sf https://gobinaries.com/axetroy/changelog@v0.1.0 | sh +curl -sf https://gobinaries.com/axetroy/whatchanged@v0.1.0 | sh ``` Or -Download the executable file for your platform at [release page](https://github.com/axetroy/changelog/releases) +Download the executable file for your platform at [release page](https://github.com/axetroy/whatchanged/releases) Then set the environment variable. @@ -116,7 +116,7 @@ export PATH="$PATH:$HOME/bin" then, try it out. ```bash -changelog --help +$ whatchanged --help ``` Finally, to use Deno correctly, you also need to set environment variables @@ -131,8 +131,8 @@ export PATH="$PATH:$HOME/.deno/bin" Make sure you have `Golang@v1.15.x` installed. ```shell -$ git clone https://github.com/axetroy/changelog.git $GOPATH/src/github.com/axetroy/changelog -$ cd $GOPATH/src/github.com/axetroy/changelog +$ git clone https://github.com/axetroy/whatchanged.git $GOPATH/src/github.com/axetroy/whatchanged +$ cd $GOPATH/src/github.com/axetroy/whatchanged $ make build ``` diff --git a/cmd/changelog-remote/main.go b/cmd/axetroy/whatchanged-remote/main.go similarity index 87% rename from cmd/changelog-remote/main.go rename to cmd/axetroy/whatchanged-remote/main.go index 7ac9d4b8..de5d2dbe 100644 --- a/cmd/changelog-remote/main.go +++ b/cmd/axetroy/whatchanged-remote/main.go @@ -7,13 +7,13 @@ import ( "net/http" "os" - parser "github.com/axetroy/changelog/1_parser" - extractor "github.com/axetroy/changelog/2_extractor" - transformer "github.com/axetroy/changelog/3_transformer" - generator "github.com/axetroy/changelog/4_generator" - formatter "github.com/axetroy/changelog/5_formatter" - "github.com/axetroy/changelog/internal/client" - "github.com/axetroy/changelog/logger" + parser "github.com/axetroy/whatchanged/1_parser" + extractor "github.com/axetroy/whatchanged/2_extractor" + transformer "github.com/axetroy/whatchanged/3_transformer" + generator "github.com/axetroy/whatchanged/4_generator" + formatter "github.com/axetroy/whatchanged/5_formatter" + "github.com/axetroy/whatchanged/internal/client" + "github.com/axetroy/whatchanged/logger" "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/storage/memory" "github.com/pkg/errors" diff --git a/cmd/axetroy/whatchanged-remote/run.sh b/cmd/axetroy/whatchanged-remote/run.sh new file mode 100755 index 00000000..01292c77 --- /dev/null +++ b/cmd/axetroy/whatchanged-remote/run.sh @@ -0,0 +1,3 @@ +#! /bin/sh +# run main.go +go run -mod=vendor ./cmd/whatchanged-remote/main.go "$@" diff --git a/cmd/changelog-remote/run.sh b/cmd/changelog-remote/run.sh deleted file mode 100755 index e6709398..00000000 --- a/cmd/changelog-remote/run.sh +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/sh -# run main.go -go run -mod=vendor ./cmd/changelog-remote/main.go "$@" diff --git a/go.mod b/go.mod index a6ee8a10..7bce6faa 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/axetroy/changelog +module github.com/axetroy/whatchanged go 1.15 diff --git a/install.sh b/install.sh index b421e6b5..ebec86c9 100644 --- a/install.sh +++ b/install.sh @@ -27,18 +27,18 @@ get_os(){ main() { local os=$(get_os) local arch=$(get_arch) - local dest_file="${downloadFolder}/changelog_${os}_${arch}.tar.gz" + local dest_file="${downloadFolder}/whatchanged_${os}_${arch}.tar.gz" if [[ $# -eq 0 ]]; then asset_path=$( - command curl -sSf https://github.com/axetroy/changelog/releases | - command grep -o "/axetroy/changelog/releases/download/.*/changelog_${os}_${arch}\\.tar.gz" | + command curl -sSf https://github.com/axetroy/whatchanged/releases | + command grep -o "/axetroy/whatchanged/releases/download/.*/whatchanged_${os}_${arch}\\.tar.gz" | command head -n 1 ) if [[ ! "$asset_path" ]]; then exit 1; fi asset_uri="https://github.com${asset_path}" else - asset_uri="https://github.com/axetroy/changelog/releases/download/${1}/changelog_${os}_${arch}\\.tar.gz" + asset_uri="https://github.com/axetroy/whatchanged/releases/download/${1}/whatchanged_${os}_${arch}\\.tar.gz" fi mkdir -p ${downloadFolder} @@ -50,16 +50,16 @@ main() { binDir=/usr/local/bin - echo "[2/3] Install changelog to the ${binDir}" + echo "[2/3] Install whatchanged to the ${binDir}" mkdir -p ${HOME}/bin tar -xz -f ${dest_file} -C ${binDir} - exe=${binDir}/changelog + exe=${binDir}/whatchanged chmod +x ${exe} echo "[3/3] Set environment variables" - echo "changelog was installed successfully to ${exe}" - if command -v changelog --version >/dev/null; then - echo "Run 'changelog --help' to get started" + echo "whatchanged was installed successfully to ${exe}" + if command -v whatchanged --version >/dev/null; then + echo "Run 'whatchanged --help' to get started" else echo "Manually add the directory to your \$HOME/.bash_profile (or similar)" echo " export PATH=${HOME}/bin:\$PATH" diff --git a/logger/logger.go b/logger/logger.go index 140f91c6..f2b71f1a 100644 --- a/logger/logger.go +++ b/logger/logger.go @@ -9,11 +9,11 @@ import ( var printter *log.Logger func init() { - printter = log.New(os.Stderr, "[changelog]: ", log.Ltime) + printter = log.New(os.Stderr, "[whatchanged]: ", log.Ltime) } func New(namespace string) *log.Logger { - return log.New(os.Stderr, fmt.Sprintf("[changelog %s]: ", namespace), log.Ltime) + return log.New(os.Stderr, fmt.Sprintf("[whatchanged %s]: ", namespace), log.Ltime) } func Printf(format string, v ...interface{}) { diff --git a/main.go b/main.go index 0781f5ff..dff07e21 100644 --- a/main.go +++ b/main.go @@ -7,13 +7,13 @@ import ( "os" "path" - parser "github.com/axetroy/changelog/1_parser" - extractor "github.com/axetroy/changelog/2_extractor" - transformer "github.com/axetroy/changelog/3_transformer" - generator "github.com/axetroy/changelog/4_generator" - formatter "github.com/axetroy/changelog/5_formatter" - writer "github.com/axetroy/changelog/6_writer" - "github.com/axetroy/changelog/internal/client" + parser "github.com/axetroy/whatchanged/1_parser" + extractor "github.com/axetroy/whatchanged/2_extractor" + transformer "github.com/axetroy/whatchanged/3_transformer" + generator "github.com/axetroy/whatchanged/4_generator" + formatter "github.com/axetroy/whatchanged/5_formatter" + writer "github.com/axetroy/whatchanged/6_writer" + "github.com/axetroy/whatchanged/internal/client" "github.com/pkg/errors" ) @@ -24,10 +24,10 @@ var ( ) func printHelp() { - fmt.Println(`changelog - a cli to generate changelog from git project + fmt.Println(`whatchanged - a cli to generate changelog from git project USAGE: - changelog [OPTIONS] [version] + whatchanged [OPTIONS] [version] ARGUMENTS: [version] Optional version or version range. @@ -56,35 +56,35 @@ OPTIONS: --tpl Specify the template file for generating. Only available when --fmt=md. EXAMPLES: - # generate changelog from HEAD to . equivalent to 'changelog HEAD~tag:0' - $ changelog + # generate changelog from HEAD to . equivalent to 'whatchanged HEAD~tag:0' + $ whatchanged # generate changelog of the specified version - $ changelog v1.2.0 + $ whatchanged v1.2.0 # generate changelog within the specified range - $ changelog v1.3.0~v1.2.0 + $ whatchanged v1.3.0~v1.2.0 # generate changelog from HEAD to - $ changelog ~tag:0 + $ whatchanged ~tag:0 # generate changelog from <0th tag> to <2th tag> - $ changelog tag:0~tag:2 + $ whatchanged tag:0~tag:2 # generate changelog from HEAD to specified version - $ changelog HEAD~v1.3.0 + $ whatchanged HEAD~v1.3.0 # generate all changelog - $ changelog HEAD~ + $ whatchanged HEAD~ # generate changelog from two commit hashes - $ changelog 770ed02~585445d + $ whatchanged 770ed02~585445d # Generate changelog for the specified project - $ changelog --dir=/path/to/project v1.0.0 + $ whatchanged --dir=/path/to/project v1.0.0 SOURCE CODE: - https://github.com/axetroy/changelog`) + https://github.com/axetroy/whatchanged`) } func run() error { diff --git a/repl/index.html b/repl/index.html index 1530e601..53d57cb0 100644 --- a/repl/index.html +++ b/repl/index.html @@ -4,7 +4,7 @@ - Changelog REPL + whatchanged REPL
diff --git a/repl/package.json b/repl/package.json index eb41cf1a..8da04ff0 100644 --- a/repl/package.json +++ b/repl/package.json @@ -1,5 +1,5 @@ { - "name": "changelog-repl", + "name": "whatchanged-repl", "version": "0.0.0", "scripts": { "dev": "cross-env NODE_ENV=development vite", diff --git a/repl/vite.config.js b/repl/vite.config.js index f48d5c6f..d3c044be 100644 --- a/repl/vite.config.js +++ b/repl/vite.config.js @@ -1,7 +1,7 @@ import httpImport from "import-http/rollup"; export default { - base: process.env.NODE_ENV === "production" ? "/changelog" : "/", + base: process.env.NODE_ENV === "production" ? "/whatchanged" : "/", assetsDir: "./", rollupInputOptions: { plugins: [httpImport()],