primer_view_components 0.0.37 → 0.0.42

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +260 -24
  3. data/app/assets/javascripts/primer_view_components.js +1 -1
  4. data/app/assets/javascripts/primer_view_components.js.map +1 -1
  5. data/app/components/primer/auto_complete.rb +4 -2
  6. data/app/components/primer/auto_complete/item.rb +1 -1
  7. data/app/components/primer/avatar_component.rb +22 -3
  8. data/app/components/primer/avatar_stack_component.rb +8 -5
  9. data/app/components/primer/base_button.rb +47 -0
  10. data/app/components/primer/base_component.rb +19 -12
  11. data/app/components/primer/blankslate_component.rb +10 -7
  12. data/app/components/primer/border_box_component.rb +1 -1
  13. data/app/components/primer/box_component.rb +1 -1
  14. data/app/components/primer/breadcrumb_component.rb +1 -1
  15. data/app/components/primer/button_component.html.erb +9 -0
  16. data/app/components/primer/button_component.rb +39 -21
  17. data/app/components/primer/{button_group_component.html.erb → button_group.html.erb} +0 -0
  18. data/app/components/primer/button_group.rb +61 -0
  19. data/app/components/primer/button_marketing_component.rb +4 -9
  20. data/app/components/primer/clipboard_copy.html.erb +8 -0
  21. data/app/components/primer/clipboard_copy.rb +26 -0
  22. data/app/components/primer/clipboard_copy_component.d.ts +1 -0
  23. data/app/components/primer/clipboard_copy_component.js +34 -0
  24. data/app/components/primer/clipboard_copy_component.ts +39 -0
  25. data/app/components/primer/close_button.rb +11 -2
  26. data/app/components/primer/component.rb +22 -3
  27. data/app/components/primer/counter_component.rb +6 -1
  28. data/app/components/primer/details_component.rb +1 -1
  29. data/app/components/primer/dropdown/menu_component.rb +1 -1
  30. data/app/components/primer/dropdown_component.rb +1 -1
  31. data/app/components/primer/flash_component.rb +3 -3
  32. data/app/components/primer/flex_component.rb +28 -1
  33. data/app/components/primer/flex_item_component.rb +20 -1
  34. data/app/components/primer/heading_component.rb +25 -4
  35. data/app/components/primer/hidden_text_expander.rb +4 -6
  36. data/app/components/primer/icon_button.rb +65 -0
  37. data/app/components/primer/image.rb +46 -0
  38. data/app/components/primer/image_crop.d.ts +1 -0
  39. data/app/components/primer/image_crop.html.erb +12 -0
  40. data/app/components/primer/image_crop.js +1 -0
  41. data/app/components/primer/image_crop.rb +36 -0
  42. data/app/components/primer/image_crop.ts +1 -0
  43. data/app/components/primer/label_component.rb +7 -3
  44. data/app/components/primer/layout_component.rb +1 -1
  45. data/app/components/primer/link_component.rb +1 -1
  46. data/app/components/primer/local_time.d.ts +1 -0
  47. data/app/components/primer/local_time.js +1 -0
  48. data/app/components/primer/local_time.rb +59 -0
  49. data/app/components/primer/local_time.ts +1 -0
  50. data/app/components/primer/{markdown_component.rb → markdown.rb} +12 -7
  51. data/app/components/primer/menu_component.rb +1 -1
  52. data/app/components/primer/navigation/tab_component.rb +8 -1
  53. data/app/components/primer/octicon_component.html.erb +7 -0
  54. data/app/components/primer/octicon_component.rb +53 -19
  55. data/app/components/primer/octicon_symbols_component.html.erb +3 -0
  56. data/app/components/primer/octicon_symbols_component.rb +61 -0
  57. data/app/components/primer/popover_component.rb +1 -1
  58. data/app/components/primer/primer.d.ts +3 -0
  59. data/app/components/primer/primer.js +3 -0
  60. data/app/components/primer/primer.ts +3 -0
  61. data/app/components/primer/progress_bar_component.rb +1 -1
  62. data/app/components/primer/spinner_component.rb +3 -3
  63. data/app/components/primer/state_component.rb +2 -2
  64. data/app/components/primer/subhead_component.rb +34 -4
  65. data/app/components/primer/tab_container_component.rb +1 -1
  66. data/app/components/primer/tab_nav_component.html.erb +4 -0
  67. data/app/components/primer/tab_nav_component.rb +45 -10
  68. data/app/components/primer/text_component.rb +6 -3
  69. data/app/components/primer/time_ago_component.rb +1 -1
  70. data/app/components/primer/timeline_item_component.rb +1 -1
  71. data/app/components/primer/{tooltip_component.rb → tooltip.rb} +11 -9
  72. data/app/components/primer/truncate.rb +7 -3
  73. data/app/components/primer/underline_nav_component.rb +1 -1
  74. data/app/lib/primer/classify.rb +21 -38
  75. data/app/lib/primer/classify/cache.rb +20 -15
  76. data/app/lib/primer/classify/flex.rb +111 -0
  77. data/app/lib/primer/classify/functional_border_colors.rb +1 -2
  78. data/app/lib/primer/fetch_or_fallback_helper.rb +2 -2
  79. data/app/lib/primer/octicon/cache.rb +42 -0
  80. data/app/lib/primer/view_helper.rb +2 -1
  81. data/lib/primer/view_components.rb +1 -1
  82. data/lib/primer/view_components/engine.rb +2 -0
  83. data/lib/primer/view_components/version.rb +1 -1
  84. data/lib/tasks/coverage.rake +14 -0
  85. data/lib/tasks/docs.rake +350 -0
  86. data/lib/tasks/statuses.rake +12 -0
  87. data/lib/yard/docs_helper.rb +57 -0
  88. data/static/statuses.json +54 -1
  89. metadata +51 -12
  90. data/app/components/primer/button_group_component.rb +0 -35
  91. data/app/components/primer/foo_bar.d.ts +0 -1
  92. data/app/components/primer/foo_bar.js +0 -1
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Primer
4
- # Use the UnderlineNav component to style navigation with a minimal
4
+ # Use `UnderlineNav` to style navigation with a minimal
5
5
  # underlined selected state, typically used for navigation placed at the top
6
6
  # of the page.
7
7
  class UnderlineNavComponent < Primer::Component
@@ -3,35 +3,29 @@
3
3
  module Primer
4
4
  # :nodoc:
5
5
  class Classify
6
- DIRECTION_KEY = :direction
7
- JUSTIFY_CONTENT_KEY = :justify_content
8
- ALIGN_ITEMS_KEY = :align_items
9
6
  DISPLAY_KEY = :display
10
7
  SPACING_KEYS = Primer::Classify::Spacing::KEYS
11
- RESPONSIVE_KEYS = ([DISPLAY_KEY, DIRECTION_KEY, JUSTIFY_CONTENT_KEY, ALIGN_ITEMS_KEY, :col, :float] + SPACING_KEYS).freeze
12
- BREAKPOINTS = ["", "-sm", "-md", "-lg", "-xl"].freeze
13
8
 
14
9
  # Keys where we can simply translate { key: value } into ".key-value"
15
10
  CONCAT_KEYS = SPACING_KEYS + %i[hide position v float col text box_shadow].freeze
16
11
 
17
12
  INVALID_CLASS_NAME_PREFIXES =
18
- (["bg-", "color-", "text-", "d-", "v-align-", "wb-", "text-", "box-shadow-"] + CONCAT_KEYS.map { |k| "#{k}-" }).freeze
13
+ (["bg-", "color-", "text-", "d-", "v-align-", "wb-", "box-shadow-"] + CONCAT_KEYS.map { |k| "#{k}-" }).freeze
19
14
 
20
15
  COLOR_KEY = :color
21
16
  BG_KEY = :bg
22
17
  VERTICAL_ALIGN_KEY = :vertical_align
23
18
  WORD_BREAK_KEY = :word_break
24
- TEXT_KEYS = %i[text_align font_weight].freeze
25
- FLEX_KEY = :flex
26
- FLEX_GROW_KEY = :flex_grow
27
- FLEX_SHRINK_KEY = :flex_shrink
28
- ALIGN_SELF_KEY = :align_self
19
+ TEXT_KEYS = %i[font_family font_style font_weight text_align text_transform].freeze
29
20
  WIDTH_KEY = :width
30
21
  HEIGHT_KEY = :height
31
22
  BOX_SHADOW_KEY = :box_shadow
32
23
  VISIBILITY_KEY = :visibility
33
24
  ANIMATION_KEY = :animation
34
25
 
26
+ BREAKPOINTS = ["", "-sm", "-md", "-lg", "-xl"].freeze
27
+ RESPONSIVE_KEYS = ([DISPLAY_KEY, :col, :float] + SPACING_KEYS + Primer::Classify::Flex::RESPONSIVE_KEYS).freeze
28
+
35
29
  BOOLEAN_MAPPINGS = {
36
30
  underline: {
37
31
  mappings: [
@@ -89,6 +83,7 @@ module Primer
89
83
  BORDER_MARGIN_KEYS +
90
84
  TYPOGRAPHY_KEYS +
91
85
  TEXT_KEYS +
86
+ Primer::Classify::Flex::KEYS +
92
87
  [
93
88
  BORDER_KEY,
94
89
  BORDER_COLOR_KEY,
@@ -98,13 +93,6 @@ module Primer
98
93
  DISPLAY_KEY,
99
94
  VERTICAL_ALIGN_KEY,
100
95
  WORD_BREAK_KEY,
101
- DIRECTION_KEY,
102
- JUSTIFY_CONTENT_KEY,
103
- ALIGN_ITEMS_KEY,
104
- FLEX_KEY,
105
- FLEX_GROW_KEY,
106
- FLEX_SHRINK_KEY,
107
- ALIGN_SELF_KEY,
108
96
  WIDTH_KEY,
109
97
  HEIGHT_KEY,
110
98
  BOX_SHADOW_KEY,
@@ -120,7 +108,7 @@ module Primer
120
108
  extracted_results[:class] = [
121
109
  validated_class_names(classes),
122
110
  extracted_results.delete(:classes)
123
- ].compact.join(" ").presence
111
+ ].compact.join(" ").strip.presence
124
112
 
125
113
  extracted_results[:style] = [
126
114
  extracted_results.delete(:styles),
@@ -135,13 +123,13 @@ module Primer
135
123
  def validated_class_names(classes)
136
124
  return if classes.blank?
137
125
 
138
- if ENV["RAILS_ENV"] == "development"
126
+ if force_system_arguments? && !ENV["PRIMER_WARNINGS_DISABLED"]
139
127
  invalid_class_names =
140
128
  classes.split(" ").each_with_object([]) do |class_name, memo|
141
129
  memo << class_name if INVALID_CLASS_NAME_PREFIXES.any? { |prefix| class_name.start_with?(prefix) }
142
130
  end
143
131
 
144
- raise ArgumentError, "Use System Arguments (https://primer.style/view-components/system-arguments) instead of Primer CSS class #{'name'.pluralize(invalid_class_names.length)} #{invalid_class_names.to_sentence}. This warning will not be raised in production." if invalid_class_names.any?
132
+ raise ArgumentError, "Use System Arguments (https://primer.style/view-components/system-arguments) instead of Primer CSS class #{'name'.pluralize(invalid_class_names.length)} #{invalid_class_names.to_sentence}. This warning will not be raised in production. Set PRIMER_WARNINGS_DISABLED=1 to disable this warning." if invalid_class_names.any?
145
133
  end
146
134
 
147
135
  classes
@@ -216,23 +204,10 @@ module Primer
216
204
  memo[:classes] << "#{key.to_s.dasherize}-#{val}"
217
205
  elsif key == BORDER_RADIUS_KEY
218
206
  memo[:classes] << "rounded-#{val}"
219
- elsif key == DIRECTION_KEY
220
- memo[:classes] << "flex#{breakpoint}-#{val.to_s.dasherize}"
221
- elsif key == JUSTIFY_CONTENT_KEY
222
- formatted_value = val.to_s.gsub(/(flex\_|space\_)/, "")
223
- memo[:classes] << "flex#{breakpoint}-justify-#{formatted_value}"
224
- elsif key == ALIGN_ITEMS_KEY
225
- memo[:classes] << "flex#{breakpoint}-items-#{val.to_s.gsub('flex_', '')}"
226
- elsif key == FLEX_KEY
227
- memo[:classes] << "flex-#{val}"
228
- elsif key == FLEX_GROW_KEY
229
- memo[:classes] << "flex-grow-#{val}"
230
- elsif key == FLEX_SHRINK_KEY
231
- memo[:classes] << "flex-shrink-#{val}"
232
- elsif key == ALIGN_SELF_KEY
233
- memo[:classes] << "flex-self-#{val}"
207
+ elsif Primer::Classify::Flex::KEYS.include?(key)
208
+ memo[:classes] << Primer::Classify::Flex.classes(key, val, breakpoint)
234
209
  elsif key == WIDTH_KEY || key == HEIGHT_KEY
235
- if val == :fit || val == :fill
210
+ if val == :fit
236
211
  memo[:classes] << "#{key}-#{val}"
237
212
  else
238
213
  memo[key] = val
@@ -240,7 +215,11 @@ module Primer
240
215
  elsif TEXT_KEYS.include?(key)
241
216
  memo[:classes] << "text-#{val.to_s.dasherize}"
242
217
  elsif TYPOGRAPHY_KEYS.include?(key)
243
- memo[:classes] << "f#{val.to_s.dasherize}"
218
+ memo[:classes] << if val == :small || val == :normal
219
+ "text-#{val.to_s.dasherize}"
220
+ else
221
+ "f#{val.to_s.dasherize}"
222
+ end
244
223
  elsif key == BOX_SHADOW_KEY
245
224
  memo[:classes] << if val == true
246
225
  "color-shadow-small"
@@ -261,6 +240,10 @@ module Primer
261
240
  memo[:classes] << "#{key.to_s.dasherize}#{breakpoint}-#{val.to_s.dasherize}"
262
241
  end
263
242
  end
243
+
244
+ def force_system_arguments?
245
+ Rails.application.config.primer_view_components.force_system_arguments
246
+ end
264
247
  end
265
248
 
266
249
  Cache.preload!
@@ -40,18 +40,18 @@ module Primer
40
40
  )
41
41
 
42
42
  preload(
43
- keys: Primer::Classify::DIRECTION_KEY,
44
- values: [:row, :column]
43
+ keys: Primer::Classify::Flex::DIRECTION_KEY,
44
+ values: Primer::Classify::Flex::DIRECTION_VALUES
45
45
  )
46
46
 
47
47
  preload(
48
- keys: Primer::Classify::JUSTIFY_CONTENT_KEY,
49
- values: [:flex_start, :flex_end, :center, :space_between, :space_around]
48
+ keys: Primer::Classify::Flex::JUSTIFY_CONTENT_KEY,
49
+ values: Primer::Classify::Flex::JUSTIFY_CONTENT_VALUES
50
50
  )
51
51
 
52
52
  preload(
53
- keys: Primer::Classify::ALIGN_ITEMS_KEY,
54
- values: [:flex_start, :flex_end, :center, :baseline, :stretch]
53
+ keys: Primer::Classify::Flex::ALIGN_ITEMS_KEY,
54
+ values: Primer::Classify::Flex::ALIGN_ITEMS_VALUES
55
55
  )
56
56
 
57
57
  preload(
@@ -61,12 +61,12 @@ module Primer
61
61
 
62
62
  preload(
63
63
  keys: [Primer::Classify::COLOR_KEY],
64
- values: [*Primer::Classify::FunctionalTextColors::OPTIONS, *Primer::Classify::FunctionalTextColors::DEPRECATED_OPTIONS]
64
+ values: Primer::Classify::FunctionalTextColors::OPTIONS
65
65
  )
66
66
 
67
67
  preload(
68
68
  keys: [Primer::Classify::BG_KEY],
69
- values: [*Primer::Classify::FunctionalBackgroundColors::OPTIONS, *Primer::Classify::FunctionalBackgroundColors::DEPRECATED_OPTIONS]
69
+ values: Primer::Classify::FunctionalBackgroundColors::OPTIONS
70
70
  )
71
71
 
72
72
  preload(
@@ -90,23 +90,28 @@ module Primer
90
90
  )
91
91
 
92
92
  preload(
93
- keys: Primer::Classify::FLEX_KEY,
94
- values: [1, :auto]
93
+ keys: Primer::Classify::Flex::FLEX_KEY,
94
+ values: Primer::Classify::Flex::FLEX_VALUES
95
95
  )
96
96
 
97
97
  preload(
98
- keys: [Primer::Classify::FLEX_GROW_KEY, Primer::Classify::FLEX_SHRINK_KEY],
99
- values: [0]
98
+ keys: Primer::Classify::Flex::GROW_KEY,
99
+ values: Primer::Classify::Flex::GROW_VALUES
100
100
  )
101
101
 
102
102
  preload(
103
- keys: [Primer::Classify::ALIGN_SELF_KEY],
104
- values: [:auto, :start, :end, :center, :baseline, :stretch]
103
+ keys: Primer::Classify::Flex::SHRINK_KEY,
104
+ values: Primer::Classify::Flex::SHRINK_VALUES
105
+ )
106
+
107
+ preload(
108
+ keys: Primer::Classify::Flex::ALIGN_SELF_KEY,
109
+ values: Primer::Classify::Flex::ALIGN_SELF_VALUES
105
110
  )
106
111
 
107
112
  preload(
108
113
  keys: [Primer::Classify::WIDTH_KEY, Primer::Classify::HEIGHT_KEY],
109
- values: [:fit, :fill]
114
+ values: [:fit]
110
115
  )
111
116
 
112
117
  preload(
@@ -0,0 +1,111 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Primer
4
+ class Classify
5
+ # Handler for PrimerCSS flex classes.
6
+ class Flex
7
+ extend Primer::FetchOrFallbackHelper
8
+
9
+ FLEX_KEY = :flex
10
+ FLEX_VALUES = [1, :auto].freeze
11
+
12
+ WRAP_KEY = :flex_wrap
13
+ WRAP_MAPPINGS = {
14
+ wrap: "flex-wrap",
15
+ nowrap: "flex-nowrap",
16
+ reverse: "flex-wrap-reverse"
17
+ }.freeze
18
+
19
+ SHRINK_KEY = :flex_shrink
20
+ SHRINK_VALUES = [0].freeze
21
+
22
+ GROW_KEY = :flex_grow
23
+ GROW_VALUES = [0].freeze
24
+
25
+ ALIGN_SELF_KEY = :align_self
26
+ ALIGN_SELF_VALUES = [:auto, :start, :end, :center, :baseline, :stretch].freeze
27
+
28
+ DIRECTION_KEY = :direction
29
+ DIRECTION_VALUES = [:column, :column_reverse, :row, :row_reverse].freeze
30
+
31
+ JUSTIFY_CONTENT_KEY = :justify_content
32
+ JUSTIFY_CONTENT_VALUES = [:flex_start, :flex_end, :center, :space_between, :space_around].freeze
33
+
34
+ ALIGN_ITEMS_KEY = :align_items
35
+ ALIGN_ITEMS_VALUES = [:flex_start, :flex_end, :center, :baseline, :stretch].freeze
36
+
37
+ KEYS = [FLEX_KEY, WRAP_KEY, SHRINK_KEY, GROW_KEY, ALIGN_SELF_KEY, DIRECTION_KEY, JUSTIFY_CONTENT_KEY, ALIGN_ITEMS_KEY].freeze
38
+ RESPONSIVE_KEYS = [DIRECTION_KEY, JUSTIFY_CONTENT_KEY, ALIGN_ITEMS_KEY].freeze
39
+
40
+ class << self
41
+ def classes(key, value, breakpoint)
42
+ send(key, value, breakpoint)
43
+ end
44
+
45
+ private
46
+
47
+ def flex(value, _breakpoint)
48
+ generate(
49
+ value: value,
50
+ allowed_values: FLEX_VALUES,
51
+ prefix: "flex"
52
+ )
53
+ end
54
+
55
+ def flex_shrink(value, _breakpoint)
56
+ generate(
57
+ value: value,
58
+ allowed_values: SHRINK_VALUES,
59
+ prefix: "flex-shrink"
60
+ )
61
+ end
62
+
63
+ def flex_grow(value, _breakpoint)
64
+ generate(
65
+ value: value,
66
+ allowed_values: GROW_VALUES,
67
+ prefix: "flex-grow"
68
+ )
69
+ end
70
+
71
+ def align_self(value, _breakpoint)
72
+ generate(
73
+ value: value,
74
+ allowed_values: ALIGN_SELF_VALUES,
75
+ prefix: "flex-self"
76
+ )
77
+ end
78
+
79
+ def flex_wrap(value, _breakpoint)
80
+ WRAP_MAPPINGS[fetch_or_fallback(WRAP_MAPPINGS.keys, value)]
81
+ end
82
+
83
+ def direction(value, breakpoint)
84
+ val = fetch_or_fallback(DIRECTION_VALUES, value)
85
+
86
+ "flex#{breakpoint}-#{val.to_s.dasherize}"
87
+ end
88
+
89
+ def justify_content(value, breakpoint)
90
+ val = fetch_or_fallback(JUSTIFY_CONTENT_VALUES, value)
91
+
92
+ formatted_value = val.to_s.gsub(/(flex\_|space\_)/, "")
93
+ "flex#{breakpoint}-justify-#{formatted_value}"
94
+ end
95
+
96
+ def align_items(value, breakpoint)
97
+ val = fetch_or_fallback(ALIGN_ITEMS_VALUES, value)
98
+
99
+ formatted_value = val.to_s.gsub("flex_", "")
100
+ "flex#{breakpoint}-items-#{formatted_value}"
101
+ end
102
+
103
+ def generate(value:, allowed_values:, prefix:)
104
+ val = fetch_or_fallback(allowed_values, value)
105
+
106
+ "#{prefix}-#{val}"
107
+ end
108
+ end
109
+ end
110
+ end
111
+ end
@@ -13,8 +13,7 @@ module Primer
13
13
  success: :success,
14
14
  warning: :warning,
15
15
  danger: :danger,
16
- inverse: :inverse,
17
- overlay: :overlay
16
+ inverse: :inverse
18
17
  }.freeze
19
18
 
20
19
  MAPPINGS = {
@@ -25,10 +25,10 @@ module Primer
25
25
 
26
26
  InvalidValueError = Class.new(StandardError)
27
27
 
28
- def fetch_or_fallback(allowed_values, given_value, fallback = nil, deprecated_values: [])
28
+ def fetch_or_fallback(allowed_values, given_value, fallback = nil, deprecated_values: nil)
29
29
  if allowed_values.include?(given_value)
30
30
  given_value
31
- elsif deprecated_values.include?(given_value)
31
+ elsif deprecated_values&.include?(given_value)
32
32
  ActiveSupport::Deprecation.warn("#{given_value} is deprecated and will be removed in a future version.") unless Rails.env.production? || silence_deprecations?
33
33
 
34
34
  given_value
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Primer
4
+ module Octicon
5
+ # :nodoc:
6
+ class Cache
7
+ LOOKUP = {} # rubocop:disable Style/MutableConstant
8
+ # Preload the top 20 used icons.
9
+ PRELOADED_ICONS = [:alert, :check, :"chevron-down", :clippy, :clock, :"dot-fill", :info, :"kebab-horizontal", :link, :lock, :mail, :pencil, :plus, :question, :repo, :search, :"shield-lock", :star, :trash, :x].freeze
10
+
11
+ class << self
12
+ def get_key(symbol:, size:, width: nil, height: nil)
13
+ [symbol, size, width, height].join("_")
14
+ end
15
+
16
+ def read(key)
17
+ LOOKUP[key]
18
+ end
19
+
20
+ # Cache size limit.
21
+ def limit
22
+ 500
23
+ end
24
+
25
+ def set(key, value)
26
+ LOOKUP[key] = value
27
+
28
+ # Remove first item when the cache is too large.
29
+ LOOKUP.shift if LOOKUP.size > limit
30
+ end
31
+
32
+ def clear!
33
+ LOOKUP.clear
34
+ end
35
+
36
+ def preload!
37
+ PRELOADED_ICONS.each { |icon| Primer::OcticonComponent.new(icon: icon) }
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -8,7 +8,8 @@ module Primer
8
8
  HELPERS = {
9
9
  octicon: "Primer::OcticonComponent",
10
10
  heading: "Primer::HeadingComponent",
11
- time_ago: "Primer::TimeAgoComponent"
11
+ time_ago: "Primer::TimeAgoComponent",
12
+ image: "Primer::Image"
12
13
  }.freeze
13
14
 
14
15
  HELPERS.each do |name, component|
@@ -27,7 +27,7 @@ module Primer
27
27
  statuses = generate_statuses
28
28
 
29
29
  File.open(File.join(path, DEFAULT_STATUS_FILE_NAME), "w") do |f|
30
- f.write(statuses.to_json)
30
+ f.write(JSON.pretty_generate(statuses))
31
31
  f.write($INPUT_RECORD_SEPARATOR)
32
32
  end
33
33
  end
@@ -13,7 +13,9 @@ module Primer
13
13
  ]
14
14
 
15
15
  config.primer_view_components = ActiveSupport::OrderedOptions.new
16
+
16
17
  config.primer_view_components.force_functional_colors = true
18
+ config.primer_view_components.force_system_arguments = false
17
19
  config.primer_view_components.silence_deprecations = false
18
20
 
19
21
  initializer "primer_view_components.assets" do |app|
@@ -5,7 +5,7 @@ module Primer
5
5
  module VERSION
6
6
  MAJOR = 0
7
7
  MINOR = 0
8
- PATCH = 37
8
+ PATCH = 42
9
9
 
10
10
  STRING = [MAJOR, MINOR, PATCH].join(".")
11
11
  end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ namespace :coverage do
4
+ task :report do
5
+ require "simplecov"
6
+ require "simplecov-console"
7
+
8
+ SimpleCov.minimum_coverage 100
9
+
10
+ SimpleCov.collate Dir["simplecov-resultset-*/.resultset.json"], "rails" do
11
+ formatter SimpleCov::Formatter::Console
12
+ end
13
+ end
14
+ end