milestoner 17.7.0 → 17.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/README.adoc +6 -6
- data/lib/milestoner/cli/actions/build/layout.rb +2 -2
- data/lib/milestoner/cli/actions/build/root.rb +2 -1
- data/lib/milestoner/cli/actions/next.rb +22 -0
- data/lib/milestoner/cli/commands/build.rb +2 -2
- data/lib/milestoner/cli/shell.rb +1 -0
- data/lib/milestoner/commits/categorizer.rb +23 -22
- data/lib/milestoner/commits/collector.rb +15 -3
- data/lib/milestoner/commits/enricher.rb +3 -5
- data/lib/milestoner/configuration/contract.rb +1 -0
- data/lib/milestoner/configuration/model.rb +1 -0
- data/lib/milestoner/container.rb +3 -2
- data/lib/milestoner/views/parts/commit.rb +1 -1
- data/milestoner.gemspec +2 -2
- data.tar.gz.sig +0 -0
- metadata +6 -5
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 986c8952d2cb94c4ec9ed74b3dd4c973f8052e7330225157b375c7fdd6da6fcb
|
4
|
+
data.tar.gz: 191fb431069d48a29a9b44b161da73af27e84bad35c79fba5e8b4878f8d4ef22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bf70ca9ea15f208610b9220c5b01321f2b5db73cce12de7c7adbd7093ad2dbad9644362ac36639ab3ecab0ee549767873aa9062f6834ab54a511dff95c9f5e0
|
7
|
+
data.tar.gz: f35474567d0502711541f80dc1409b85f2e65801dc06b1b224003cfb44c307013ed0db5b97ef0a6072cda9bb3f7b9a063cbac31ac8982ebfc7bb49e09b714b56
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.adoc
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
:git_link: link:https://git-scm.com[Git]
|
12
12
|
:git_lint_link: link:https://alchemists.io/projects/git-lint[Git Lint]
|
13
13
|
:hanami_link: link:https://hanamirb.org[Hanami]
|
14
|
-
:hanami_views_link: link:https://alchemists.io/articles/hanami_views[Hanami
|
14
|
+
:hanami_views_link: link:https://alchemists.io/articles/hanami_views[Hanami Views]
|
15
15
|
:hanamismith_link: link:https://alchemists.io/projects/hanamismith[Hanamismith]
|
16
16
|
:lode_link: link:https://alchemists.io/projects/lode[Lode]
|
17
17
|
:markdown_link: link:https://daringfireball.net/projects/markdown[Markdown]
|
@@ -73,7 +73,7 @@ image:https://alchemists.io/images/projects/milestoner/screenshots/build-web-exp
|
|
73
73
|
** image:https://alchemists.io/images/projects/milestoner/icons/commits/refactored.png[Refactored] Refactored
|
74
74
|
* Ensures {git_link} commit messages are alphabetically sorted for release note categorization and readability.
|
75
75
|
* Provides automatic versioning based on last {git_link} tag and current commit trailers. See {git_commit_anatomy_link} for details.
|
76
|
-
* Supports multiple release note build formats: {ascii_doc_link}, {markdown_link}, Stream (console), and Web (HTML). Each are fully customizable via your personal {xdg_link} configuration and {hanami_views_link}
|
76
|
+
* Supports multiple release note build formats: {ascii_doc_link}, {markdown_link}, Stream (console), and Web (HTML). Each are fully customizable via your personal {xdg_link} configuration and {hanami_views_link}.
|
77
77
|
|
78
78
|
== Requirements
|
79
79
|
|
@@ -105,7 +105,7 @@ gem install milestoner
|
|
105
105
|
|
106
106
|
From the command line, type: `milestoner --help`
|
107
107
|
|
108
|
-
image:https://alchemists.io/images/projects/milestoner/screenshots/usage.png[Usage,width=
|
108
|
+
image:https://alchemists.io/images/projects/milestoner/screenshots/usage.png[Usage,width=670,height=412,role=focal_point]
|
109
109
|
|
110
110
|
=== Customization
|
111
111
|
|
@@ -174,7 +174,7 @@ The above can be customized as follows:
|
|
174
174
|
** `uri`: Required. The URI format for linking to avatars as formatted using {string_formats_link}. Default: GitHub. The `id` is dynamically calculated via the `external_id` of the user stored in the {lode_link} cache.
|
175
175
|
* `build`: Manages release note builds.
|
176
176
|
** `format`: Required. The build output format. Multiple formats are supported. Default: web.
|
177
|
-
** `layout`: Required. The layout used by
|
177
|
+
** `layout`: Required. The layout used by {hanami_views_link} when building release notes. Default: page.
|
178
178
|
** `root`: Required. The output location. This can be a relative or absolute path. Defaults to the `tmp` directory of your current project. The path is automatically created if missing.
|
179
179
|
* `commit`: Manages commit categories, emojis, and hyperlinks.
|
180
180
|
** `categories`: Required. By default, only five categories are supported which pairs well with the {git_lint_link} gem. Category order is important with the first taking precedence over the second and so forth. Special characters are allowed for prefixes but should be enclosed in quotes. To disable categories, use an empty array. Example: `categories: []`.
|
@@ -339,7 +339,7 @@ Given the above, the resulting version would be: 2.0.0. This is because the high
|
|
339
339
|
|
340
340
|
==== Templates
|
341
341
|
|
342
|
-
Build template functionality is powered by
|
342
|
+
Build template functionality is powered by {hanami_views_link} which means you can customize the HTML structure, CSS style, and more. The quickest way to get started is to copy the `templates` folder structure -- included with this gem -- to your preferred {runcom_link} configuration. For example, this gem's template structure is:
|
343
343
|
|
344
344
|
....
|
345
345
|
lib/milestoner/templates
|
@@ -371,7 +371,7 @@ This means you could, for example, copy all of this gem's templates to your own
|
|
371
371
|
cp -r <milestoner_gem_root>/lib/milestoner/templates $HOME/.config/milestoner/templates
|
372
372
|
----
|
373
373
|
|
374
|
-
Milestoner searches your {runcom_link} configuration first and, if templates are detected, will be used instead. Otherwise, Milestoner
|
374
|
+
Milestoner searches your {runcom_link} configuration first and, if templates are detected, will be used instead. Otherwise, Milestoner falls back to it's own templates. Once {runcom_link} has calculated all possible template locations, {hanami_views_link} handle the final loading and evaluation of your templates.
|
375
375
|
|
376
376
|
==== Web Format
|
377
377
|
|
@@ -10,11 +10,11 @@ module Milestoner
|
|
10
10
|
class Layout < Sod::Action
|
11
11
|
include Import[:input]
|
12
12
|
|
13
|
-
description "Set layout."
|
13
|
+
description "Set view template layout."
|
14
14
|
|
15
15
|
ancillary "Use false to disable."
|
16
16
|
|
17
|
-
on %w[-L --layout], argument: "[
|
17
|
+
on %w[-L --layout], argument: "[NAME]"
|
18
18
|
|
19
19
|
default { Container[:configuration].build_layout }
|
20
20
|
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "pathname"
|
3
4
|
require "sod"
|
4
5
|
|
5
6
|
module Milestoner
|
@@ -16,7 +17,7 @@ module Milestoner
|
|
16
17
|
|
17
18
|
default { Container[:configuration].build_root }
|
18
19
|
|
19
|
-
def call(path = nil) = input.build_root = (path || default).expand_path
|
20
|
+
def call(path = nil) = input.build_root = Pathname(path || default).expand_path
|
20
21
|
end
|
21
22
|
end
|
22
23
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "sod"
|
4
|
+
|
5
|
+
module Milestoner
|
6
|
+
module CLI
|
7
|
+
module Actions
|
8
|
+
# Handles calculation of next version.
|
9
|
+
class Next < Sod::Action
|
10
|
+
include Import[:configuration, :kernel]
|
11
|
+
|
12
|
+
description "Show next version."
|
13
|
+
|
14
|
+
ancillary "Calculated from commit trailers."
|
15
|
+
|
16
|
+
on %w[-n --next]
|
17
|
+
|
18
|
+
def call(*) = kernel.puts configuration.project_version
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -22,10 +22,10 @@ module Milestoner
|
|
22
22
|
|
23
23
|
# :reek:TooManyStatements
|
24
24
|
def call
|
25
|
-
log_info "Building milestone..."
|
26
|
-
|
27
25
|
format = input.build_format
|
28
26
|
|
27
|
+
log_info "Building #{input.project_label} milestone (#{format})..."
|
28
|
+
|
29
29
|
case format
|
30
30
|
when "ascii_doc" then build_ascii_doc
|
31
31
|
when "markdown" then build_markdown
|
data/lib/milestoner/cli/shell.rb
CHANGED
@@ -7,41 +7,42 @@ module Milestoner
|
|
7
7
|
module Commits
|
8
8
|
# Retrieves and categorizes Git repository commit tagged or untagged history.
|
9
9
|
class Categorizer
|
10
|
-
include Import[:git]
|
10
|
+
include Import[:git, :input]
|
11
11
|
|
12
12
|
using Refinements::Array
|
13
13
|
|
14
|
-
def initialize(collector: Collector.new,
|
14
|
+
def initialize(collector: Collector.new, **)
|
15
15
|
@collector = collector
|
16
|
-
@expression = expression
|
17
16
|
super(**)
|
18
|
-
end
|
19
17
|
|
20
|
-
|
21
|
-
|
18
|
+
@labels = input.commit_categories.pluck :label
|
19
|
+
@pattern = labels.empty? ? // : Regexp.union(labels)
|
20
|
+
end
|
22
21
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
.values
|
28
|
-
.flatten
|
22
|
+
def call min: Collector::MIN, max: Collector::MAX
|
23
|
+
collect(min, max).each_value { |commits| commits.sort_by!(&:subject) }
|
24
|
+
.values
|
25
|
+
.flatten
|
29
26
|
end
|
30
27
|
|
31
28
|
private
|
32
29
|
|
33
|
-
attr_reader :collector, :
|
34
|
-
|
35
|
-
def
|
36
|
-
collector.call
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
30
|
+
attr_reader :collector, :labels, :pattern
|
31
|
+
|
32
|
+
def collect min, max
|
33
|
+
collector.call(min:, max:)
|
34
|
+
.value_or(Core::EMPTY_ARRAY)
|
35
|
+
.each
|
36
|
+
.with_object categories do |commit, collection|
|
37
|
+
category = commit.subject[pattern]
|
38
|
+
key = collection.key?(category) ? category : "Unknown"
|
39
|
+
collection[key] << commit
|
40
|
+
end
|
41
41
|
end
|
42
42
|
|
43
|
-
def
|
44
|
-
|
43
|
+
def categories
|
44
|
+
labels.reduce({}) { |group, prefix| group.merge prefix => [] }
|
45
|
+
.merge! "Unknown" => []
|
45
46
|
end
|
46
47
|
end
|
47
48
|
end
|
@@ -1,16 +1,28 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "dry/monads"
|
4
|
+
|
3
5
|
module Milestoner
|
4
6
|
module Commits
|
5
|
-
# Collects commits since last tag or all commits if untagged.
|
7
|
+
# Collects commits since last tag, a specific range, or all commits if untagged.
|
6
8
|
class Collector
|
9
|
+
include Dry::Monads[:result]
|
7
10
|
include Import[:git]
|
8
11
|
|
9
|
-
|
12
|
+
MIN = :last
|
13
|
+
MAX = :HEAD
|
14
|
+
|
15
|
+
def call(min: MIN, max: MAX) = git.tagged? ? slice(min, max) : all
|
10
16
|
|
11
17
|
private
|
12
18
|
|
13
|
-
def
|
19
|
+
def slice min, max
|
20
|
+
case [min, max]
|
21
|
+
in MIN, MAX then git.tag_last.bind { |tag| git.commits "#{tag}..#{max}" }
|
22
|
+
in String, String then git.commits "#{min}..#{max}"
|
23
|
+
else Failure "Invalid minimum and/or maximum range: #{min}..#{max}."
|
24
|
+
end
|
25
|
+
end
|
14
26
|
|
15
27
|
def all = git.commits
|
16
28
|
end
|
@@ -29,9 +29,9 @@ module Milestoner
|
|
29
29
|
super(**)
|
30
30
|
end
|
31
31
|
|
32
|
-
def call
|
33
|
-
categorizer.call
|
34
|
-
.map { |commit|
|
32
|
+
def call min: Collector::MIN, max: Collector::MAX
|
33
|
+
categorizer.call(min:, max:)
|
34
|
+
.map { |commit| model.for(commit, **build_attributes(commit)) }
|
35
35
|
.then { |commits| Success commits }
|
36
36
|
end
|
37
37
|
|
@@ -39,8 +39,6 @@ module Milestoner
|
|
39
39
|
|
40
40
|
attr_reader :categorizer, :model
|
41
41
|
|
42
|
-
def record_for(commit) = model.for(commit, **build_attributes(commit))
|
43
|
-
|
44
42
|
def build_attributes commit
|
45
43
|
infused_keys.each.with_object({}) do |command, attributes|
|
46
44
|
attributes[command] = __send__(command).call commit
|
@@ -26,6 +26,7 @@ module Milestoner
|
|
26
26
|
required(:generator_label).filled :string
|
27
27
|
required(:generator_uri).filled :string
|
28
28
|
required(:generator_version).filled Etcher::Types::Version
|
29
|
+
required(:loaded_at).filled :time
|
29
30
|
required(:profile_domain).filled :string
|
30
31
|
required(:profile_uri).filled :string
|
31
32
|
required(:project_author).filled :string
|
data/lib/milestoner/container.rb
CHANGED
@@ -29,13 +29,13 @@ module Milestoner
|
|
29
29
|
end
|
30
30
|
|
31
31
|
register :configuration do
|
32
|
-
self[:defaults].add_loader(
|
32
|
+
self[:defaults].add_loader(:yaml, self["xdg.config"].active)
|
33
33
|
.then { |registry| Etcher.call registry }
|
34
34
|
end
|
35
35
|
|
36
36
|
register :defaults do
|
37
37
|
Etcher::Registry.new(contract: Configuration::Contract, model: Configuration::Model)
|
38
|
-
.add_loader(
|
38
|
+
.add_loader(:yaml, self[:defaults_path])
|
39
39
|
.add_transformer(Configuration::Transformers::Build::Root)
|
40
40
|
.add_transformer(Configuration::Transformers::Build::TemplatePaths.new)
|
41
41
|
.add_transformer(Configuration::Transformers::Gems::Label.new)
|
@@ -56,6 +56,7 @@ module Milestoner
|
|
56
56
|
.add_transformer(Configuration::Transformers::URI::Profile)
|
57
57
|
.add_transformer(Configuration::Transformers::URI::Review)
|
58
58
|
.add_transformer(Configuration::Transformers::URI::Tracker)
|
59
|
+
.add_transformer(:time)
|
59
60
|
end
|
60
61
|
|
61
62
|
register(:specification) { self[:spec_loader].call "#{__dir__}/../../milestoner.gemspec" }
|
data/milestoner.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = "milestoner"
|
5
|
-
spec.version = "17.
|
5
|
+
spec.version = "17.9.0"
|
6
6
|
spec.authors = ["Brooke Kuhlmann"]
|
7
7
|
spec.email = ["brooke@alchemists.io"]
|
8
8
|
spec.homepage = "https://alchemists.io/projects/milestoner"
|
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.add_dependency "core", "~> 1.3"
|
31
31
|
spec.add_dependency "dry-monads", "~> 1.6"
|
32
32
|
spec.add_dependency "dry-schema", "~> 1.13"
|
33
|
-
spec.add_dependency "etcher", "~> 1.
|
33
|
+
spec.add_dependency "etcher", "~> 1.6"
|
34
34
|
spec.add_dependency "gitt", "~> 3.2"
|
35
35
|
spec.add_dependency "hanami-view", "~> 2.1"
|
36
36
|
spec.add_dependency "infusible", "~> 3.5"
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: milestoner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 17.
|
4
|
+
version: 17.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
3n5C8/6Zh9DYTkpcwPSuIfAga6wf4nXc9m6JAw8AuMLaiWN/r/2s4zJsUHYERJEu
|
36
36
|
gZGm4JqtuSg8pYjPeIJxS960owq+SfuC+jxqmRA54BisFCv/0VOJi7tiJVY=
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2024-
|
38
|
+
date: 2024-06-01 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: asciidoctor
|
@@ -141,14 +141,14 @@ dependencies:
|
|
141
141
|
requirements:
|
142
142
|
- - "~>"
|
143
143
|
- !ruby/object:Gem::Version
|
144
|
-
version: '1.
|
144
|
+
version: '1.6'
|
145
145
|
type: :runtime
|
146
146
|
prerelease: false
|
147
147
|
version_requirements: !ruby/object:Gem::Requirement
|
148
148
|
requirements:
|
149
149
|
- - "~>"
|
150
150
|
- !ruby/object:Gem::Version
|
151
|
-
version: '1.
|
151
|
+
version: '1.6'
|
152
152
|
- !ruby/object:Gem::Dependency
|
153
153
|
name: gitt
|
154
154
|
requirement: !ruby/object:Gem::Requirement
|
@@ -347,6 +347,7 @@ files:
|
|
347
347
|
- lib/milestoner/cli/actions/cache/find.rb
|
348
348
|
- lib/milestoner/cli/actions/cache/info.rb
|
349
349
|
- lib/milestoner/cli/actions/cache/list.rb
|
350
|
+
- lib/milestoner/cli/actions/next.rb
|
350
351
|
- lib/milestoner/cli/actions/publish.rb
|
351
352
|
- lib/milestoner/cli/commands/build.rb
|
352
353
|
- lib/milestoner/cli/commands/cache.rb
|
@@ -448,7 +449,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
448
449
|
- !ruby/object:Gem::Version
|
449
450
|
version: '0'
|
450
451
|
requirements: []
|
451
|
-
rubygems_version: 3.5.
|
452
|
+
rubygems_version: 3.5.11
|
452
453
|
signing_key:
|
453
454
|
specification_version: 4
|
454
455
|
summary: A command line interface for automated Git repository milestones.
|
metadata.gz.sig
CHANGED
Binary file
|