bootstrap 5.1.3 → 5.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +61 -0
  3. data/CHANGELOG.md +9 -0
  4. data/Gemfile +1 -0
  5. data/README.md +35 -14
  6. data/Rakefile +16 -5
  7. data/assets/javascripts/bootstrap/alert.js +22 -167
  8. data/assets/javascripts/bootstrap/base-component.js +34 -133
  9. data/assets/javascripts/bootstrap/button.js +19 -86
  10. data/assets/javascripts/bootstrap/carousel.js +209 -564
  11. data/assets/javascripts/bootstrap/collapse.js +78 -324
  12. data/assets/javascripts/bootstrap/dom/data.js +8 -14
  13. data/assets/javascripts/bootstrap/dom/event-handler.js +89 -174
  14. data/assets/javascripts/bootstrap/dom/manipulator.js +22 -39
  15. data/assets/javascripts/bootstrap/dom/selector-engine.js +47 -71
  16. data/assets/javascripts/bootstrap/dropdown.js +135 -420
  17. data/assets/javascripts/bootstrap/modal.js +115 -837
  18. data/assets/javascripts/bootstrap/offcanvas.js +93 -714
  19. data/assets/javascripts/bootstrap/popover.js +42 -130
  20. data/assets/javascripts/bootstrap/scrollspy.js +180 -296
  21. data/assets/javascripts/bootstrap/tab.js +197 -245
  22. data/assets/javascripts/bootstrap/toast.js +52 -276
  23. data/assets/javascripts/bootstrap/tooltip.js +283 -744
  24. data/assets/javascripts/bootstrap/util/backdrop.js +138 -0
  25. data/assets/javascripts/bootstrap/util/component-functions.js +41 -0
  26. data/assets/javascripts/bootstrap/util/config.js +67 -0
  27. data/assets/javascripts/bootstrap/util/focustrap.js +112 -0
  28. data/assets/javascripts/bootstrap/util/index.js +280 -0
  29. data/assets/javascripts/bootstrap/util/sanitizer.js +113 -0
  30. data/assets/javascripts/bootstrap/util/scrollbar.js +112 -0
  31. data/assets/javascripts/bootstrap/util/swipe.js +134 -0
  32. data/assets/javascripts/bootstrap/util/template-factory.js +150 -0
  33. data/assets/javascripts/bootstrap-global-this-define.js +1 -1
  34. data/assets/javascripts/bootstrap-sprockets.js +15 -6
  35. data/assets/javascripts/bootstrap.js +2278 -2831
  36. data/assets/javascripts/bootstrap.min.js +3 -3
  37. data/assets/stylesheets/_bootstrap-grid.scss +4 -9
  38. data/assets/stylesheets/_bootstrap-reboot.scss +4 -7
  39. data/assets/stylesheets/_bootstrap-utilities.scss +19 -0
  40. data/assets/stylesheets/_bootstrap.scss +5 -6
  41. data/assets/stylesheets/bootstrap/_accordion.scss +68 -33
  42. data/assets/stylesheets/bootstrap/_alert.scss +25 -14
  43. data/assets/stylesheets/bootstrap/_badge.scss +14 -5
  44. data/assets/stylesheets/bootstrap/_breadcrumb.scss +22 -10
  45. data/assets/stylesheets/bootstrap/_button-group.scss +12 -4
  46. data/assets/stylesheets/bootstrap/_buttons.scss +133 -28
  47. data/assets/stylesheets/bootstrap/_card.scss +61 -39
  48. data/assets/stylesheets/bootstrap/_carousel.scss +22 -25
  49. data/assets/stylesheets/bootstrap/_close.scss +36 -10
  50. data/assets/stylesheets/bootstrap/_containers.scss +1 -1
  51. data/assets/stylesheets/bootstrap/_dropdown.scss +86 -76
  52. data/assets/stylesheets/bootstrap/_functions.scss +10 -10
  53. data/assets/stylesheets/bootstrap/_grid.scss +9 -3
  54. data/assets/stylesheets/bootstrap/_helpers.scss +3 -0
  55. data/assets/stylesheets/bootstrap/_list-group.scss +81 -56
  56. data/assets/stylesheets/bootstrap/_maps.scss +174 -0
  57. data/assets/stylesheets/bootstrap/_mixins.scss +1 -2
  58. data/assets/stylesheets/bootstrap/_modal.scss +76 -45
  59. data/assets/stylesheets/bootstrap/_nav.scss +87 -29
  60. data/assets/stylesheets/bootstrap/_navbar.scss +102 -148
  61. data/assets/stylesheets/bootstrap/_offcanvas.scss +125 -61
  62. data/assets/stylesheets/bootstrap/_pagination.scss +66 -21
  63. data/assets/stylesheets/bootstrap/_placeholders.scss +1 -1
  64. data/assets/stylesheets/bootstrap/_popover.scss +90 -52
  65. data/assets/stylesheets/bootstrap/_progress.scss +31 -11
  66. data/assets/stylesheets/bootstrap/_reboot.scss +32 -46
  67. data/assets/stylesheets/bootstrap/_root.scss +155 -22
  68. data/assets/stylesheets/bootstrap/_spinners.scss +38 -22
  69. data/assets/stylesheets/bootstrap/_tables.scss +40 -24
  70. data/assets/stylesheets/bootstrap/_toasts.scss +38 -16
  71. data/assets/stylesheets/bootstrap/_tooltip.scss +60 -56
  72. data/assets/stylesheets/bootstrap/_type.scss +3 -1
  73. data/assets/stylesheets/bootstrap/_utilities.scss +209 -33
  74. data/assets/stylesheets/bootstrap/_variables-dark.scss +102 -0
  75. data/assets/stylesheets/bootstrap/_variables.scss +415 -303
  76. data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +39 -5
  77. data/assets/stylesheets/bootstrap/forms/_form-check.scss +51 -14
  78. data/assets/stylesheets/bootstrap/forms/_form-control.scss +36 -41
  79. data/assets/stylesheets/bootstrap/forms/_form-range.scss +3 -3
  80. data/assets/stylesheets/bootstrap/forms/_form-select.scss +12 -4
  81. data/assets/stylesheets/bootstrap/forms/_input-group.scss +20 -9
  82. data/assets/stylesheets/bootstrap/helpers/_color-bg.scss +7 -0
  83. data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +20 -2
  84. data/assets/stylesheets/bootstrap/helpers/_focus-ring.scss +5 -0
  85. data/assets/stylesheets/bootstrap/helpers/_icon-link.scss +25 -0
  86. data/assets/stylesheets/bootstrap/helpers/_position.scss +7 -1
  87. data/assets/stylesheets/bootstrap/helpers/_ratio.scss +2 -2
  88. data/assets/stylesheets/bootstrap/helpers/_vr.scss +2 -2
  89. data/assets/stylesheets/bootstrap/mixins/_alert.scss +11 -4
  90. data/assets/stylesheets/bootstrap/mixins/_banner.scss +7 -0
  91. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +8 -8
  92. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +32 -95
  93. data/assets/stylesheets/bootstrap/mixins/_caret.scss +30 -25
  94. data/assets/stylesheets/bootstrap/mixins/_color-mode.scss +21 -0
  95. data/assets/stylesheets/bootstrap/mixins/_container.scss +4 -2
  96. data/assets/stylesheets/bootstrap/mixins/_forms.scss +38 -19
  97. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +1 -1
  98. data/assets/stylesheets/bootstrap/mixins/_grid.scss +15 -15
  99. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +2 -0
  100. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +4 -25
  101. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +1 -1
  102. data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +12 -9
  103. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +14 -6
  104. data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +6 -2
  105. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +23 -29
  106. data/bootstrap.gemspec +3 -3
  107. data/lib/bootstrap/engine.rb +17 -2
  108. data/lib/bootstrap/version.rb +2 -2
  109. data/tasks/updater/js.rb +10 -5
  110. data/tasks/updater/network.rb +2 -2
  111. data/tasks/updater/scss.rb +2 -2
  112. data/tasks/updater.rb +2 -2
  113. data/test/dummy_rails/config/application.rb +0 -2
  114. data/test/dummy_rails/public/favicon.ico +0 -0
  115. data/test/gemfiles/rails_4_2.gemfile +2 -1
  116. data/test/gemfiles/rails_5_0.gemfile +1 -2
  117. data/test/gemfiles/rails_5_1.gemfile +1 -2
  118. data/test/gemfiles/rails_5_2.gemfile +7 -0
  119. data/test/gemfiles/rails_6_0.gemfile +1 -1
  120. data/test/gemfiles/rails_6_1.gemfile +1 -1
  121. data/test/gemfiles/rails_7_0_dartsass.gemfile +7 -0
  122. data/test/gemfiles/rails_7_0_sassc.gemfile +7 -0
  123. data/test/rails_test.rb +0 -5
  124. data/test/test_helper.rb +3 -2
  125. metadata +49 -29
  126. data/.travis.yml +0 -32
  127. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +0 -18
@@ -1,6 +1,6 @@
1
1
  // Utility generator
2
2
  // Used to generate utilities & print utilities
3
- @mixin generate-utility($utility, $infix, $is-rfs-media-query: false) {
3
+ @mixin generate-utility($utility, $infix: "", $is-rfs-media-query: false) {
4
4
  $values: map-get($utility, values);
5
5
 
6
6
  // If the values are a list or string, convert it into a map
@@ -20,12 +20,15 @@
20
20
  $property-class: if(map-has-key($utility, class), map-get($utility, class), nth($properties, 1));
21
21
  $property-class: if($property-class == null, "", $property-class);
22
22
 
23
+ // Use custom CSS variable name if present, otherwise default to `class`
24
+ $css-variable-name: if(map-has-key($utility, css-variable-name), map-get($utility, css-variable-name), map-get($utility, class));
25
+
23
26
  // State params to generate pseudo-classes
24
27
  $state: if(map-has-key($utility, state), map-get($utility, state), ());
25
28
 
26
29
  $infix: if($property-class == "" and str-slice($infix, 1, 1) == "-", str-slice($infix, 2), $infix);
27
30
 
28
- // Don't prefix if value key is null (eg. with shadow class)
31
+ // Don't prefix if value key is null (e.g. with shadow class)
29
32
  $property-class-modifier: if($key, if($property-class == "" and $infix == "", "", "-") + $key, "");
30
33
 
31
34
  @if map-get($utility, rfs) {
@@ -52,20 +55,20 @@
52
55
 
53
56
  @if $is-css-var {
54
57
  .#{$property-class + $infix + $property-class-modifier} {
55
- --#{$variable-prefix}#{$property-class}: #{$value};
58
+ --#{$prefix}#{$css-variable-name}: #{$value};
56
59
  }
57
60
 
58
61
  @each $pseudo in $state {
59
62
  .#{$property-class + $infix + $property-class-modifier}-#{$pseudo}:#{$pseudo} {
60
- --#{$variable-prefix}#{$property-class}: #{$value};
63
+ --#{$prefix}#{$css-variable-name}: #{$value};
61
64
  }
62
65
  }
63
66
  } @else {
64
67
  .#{$property-class + $infix + $property-class-modifier} {
65
68
  @each $property in $properties {
66
69
  @if $is-local-vars {
67
- @each $local-var, $value in $is-local-vars {
68
- --#{$variable-prefix}#{$local-var}: #{$value};
70
+ @each $local-var, $variable in $is-local-vars {
71
+ --#{$prefix}#{$local-var}: #{$variable};
69
72
  }
70
73
  }
71
74
  #{$property}: $value if($enable-important-utilities, !important, null);
@@ -75,6 +78,11 @@
75
78
  @each $pseudo in $state {
76
79
  .#{$property-class + $infix + $property-class-modifier}-#{$pseudo}:#{$pseudo} {
77
80
  @each $property in $properties {
81
+ @if $is-local-vars {
82
+ @each $local-var, $variable in $is-local-vars {
83
+ --#{$prefix}#{$local-var}: #{$variable};
84
+ }
85
+ }
78
86
  #{$property}: $value if($enable-important-utilities, !important, null);
79
87
  }
80
88
  }
@@ -6,7 +6,6 @@
6
6
  // See: https://kittygiraudel.com/2016/10/13/css-hide-and-seek/
7
7
 
8
8
  @mixin visually-hidden() {
9
- position: absolute !important;
10
9
  width: 1px !important;
11
10
  height: 1px !important;
12
11
  padding: 0 !important;
@@ -15,12 +14,17 @@
15
14
  clip: rect(0, 0, 0, 0) !important;
16
15
  white-space: nowrap !important;
17
16
  border: 0 !important;
17
+
18
+ // Fix for positioned table caption that could become anonymous cells
19
+ &:not(caption) {
20
+ position: absolute !important;
21
+ }
18
22
  }
19
23
 
20
24
  // Use to only display content when it's focused, or one of its child elements is focused
21
25
  // (i.e. when focus is within the element/container that the class was applied to)
22
26
  //
23
- // Useful for "Skip to main content" links; see https://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1
27
+ // Useful for "Skip to main content" links; see https://www.w3.org/WAI/WCAG22/Techniques/general/G1.html
24
28
 
25
29
  @mixin visually-hidden-focusable() {
26
30
  &:not(:focus):not(:focus-within) {
@@ -1,4 +1,4 @@
1
- // stylelint-disable property-blacklist, scss/dollar-variable-default
1
+ // stylelint-disable scss/dimension-no-non-numeric-values
2
2
 
3
3
  // SCSS RFS mixin
4
4
  //
@@ -154,8 +154,7 @@ $rfs-mq-property-height: if($rfs-mode == max-media-query, max-height, min-height
154
154
  &.enable-rfs {
155
155
  @content;
156
156
  }
157
- }
158
- @else {
157
+ } @else {
159
158
  @content;
160
159
  }
161
160
  }
@@ -168,7 +167,7 @@ $rfs-mq-property-height: if($rfs-mode == max-media-query, max-height, min-height
168
167
  @content;
169
168
  }
170
169
 
171
- @include _rfs-media-query {
170
+ @include _rfs-media-query () {
172
171
  .enable-rfs &,
173
172
  &.enable-rfs {
174
173
  @content;
@@ -182,7 +181,7 @@ $rfs-mq-property-height: if($rfs-mode == max-media-query, max-height, min-height
182
181
  @content;
183
182
  }
184
183
  }
185
- @include _rfs-media-query {
184
+ @include _rfs-media-query () {
186
185
  @content;
187
186
  }
188
187
  }
@@ -193,12 +192,12 @@ $rfs-mq-property-height: if($rfs-mode == max-media-query, max-height, min-height
193
192
  // Convert to list
194
193
  $values: if(type-of($values) != list, ($values,), $values);
195
194
 
196
- $val: '';
195
+ $val: "";
197
196
 
198
197
  // Loop over each value and calculate value
199
198
  @each $value in $values {
200
199
  @if $value == 0 {
201
- $val: $val + ' 0';
200
+ $val: $val + " 0";
202
201
  }
203
202
  @else {
204
203
  // Cache $value unit
@@ -206,15 +205,14 @@ $rfs-mq-property-height: if($rfs-mode == max-media-query, max-height, min-height
206
205
 
207
206
  @if $unit == px {
208
207
  // Convert to rem if needed
209
- $val: $val + ' ' + if($rfs-unit == rem, #{divide($value, $value * 0 + $rfs-rem-value)}rem, $value);
208
+ $val: $val + " " + if($rfs-unit == rem, #{divide($value, $value * 0 + $rfs-rem-value)}rem, $value);
210
209
  }
211
210
  @else if $unit == rem {
212
211
  // Convert to px if needed
213
- $val: $val + ' ' + if($rfs-unit == px, #{divide($value, $value * 0 + 1) * $rfs-rem-value}px, $value);
214
- }
215
- @else {
212
+ $val: $val + " " + if($rfs-unit == px, #{divide($value, $value * 0 + 1) * $rfs-rem-value}px, $value);
213
+ } @else {
216
214
  // If $value isn't a number (like inherit) or $value has a unit (not px or rem, like 1.5em) or $ is 0, just print the value
217
- $val: $val + ' ' + $value;
215
+ $val: $val + " " + $value;
218
216
  }
219
217
  }
220
218
  }
@@ -228,30 +226,26 @@ $rfs-mq-property-height: if($rfs-mode == max-media-query, max-height, min-height
228
226
  // Convert to list
229
227
  $values: if(type-of($values) != list, ($values,), $values);
230
228
 
231
- $val: '';
229
+ $val: "";
232
230
 
233
231
  // Loop over each value and calculate value
234
232
  @each $value in $values {
235
233
  @if $value == 0 {
236
- $val: $val + ' 0';
237
- }
238
-
239
- @else {
234
+ $val: $val + " 0";
235
+ } @else {
240
236
  // Cache $value unit
241
237
  $unit: if(type-of($value) == "number", unit($value), false);
242
238
 
243
239
  // If $value isn't a number (like inherit) or $value has a unit (not px or rem, like 1.5em) or $ is 0, just print the value
244
240
  @if not $unit or $unit != px and $unit != rem {
245
- $val: $val + ' ' + $value;
246
- }
247
-
248
- @else {
241
+ $val: $val + " " + $value;
242
+ } @else {
249
243
  // Remove unit from $value for calculations
250
244
  $value: divide($value, $value * 0 + if($unit == px, 1, divide(1, $rfs-rem-value)));
251
245
 
252
246
  // Only add the media query if the value is greater than the minimum value
253
247
  @if abs($value) <= $rfs-base-value or not $enable-rfs {
254
- $val: $val + ' ' + if($rfs-unit == rem, #{divide($value, $rfs-rem-value)}rem, #{$value}px);
248
+ $val: $val + " " + if($rfs-unit == rem, #{divide($value, $rfs-rem-value)}rem, #{$value}px);
255
249
  }
256
250
  @else {
257
251
  // Calculate the minimum value
@@ -273,7 +267,7 @@ $rfs-mq-property-height: if($rfs-mode == max-media-query, max-height, min-height
273
267
  $variable-width: #{divide($value-diff * 100, $rfs-breakpoint)}#{$variable-unit};
274
268
 
275
269
  // Return the calculated value
276
- $val: $val + ' calc(' + $min-width + if($value < 0, ' - ', ' + ') + $variable-width + ')';
270
+ $val: $val + " calc(" + $min-width + if($value < 0, " - ", " + ") + $variable-width + ")";
277
271
  }
278
272
  }
279
273
  }
@@ -287,22 +281,22 @@ $rfs-mq-property-height: if($rfs-mode == max-media-query, max-height, min-height
287
281
  @mixin rfs($values, $property: font-size) {
288
282
  @if $values != null {
289
283
  $val: rfs-value($values);
290
- $fluidVal: rfs-fluid-value($values);
284
+ $fluid-val: rfs-fluid-value($values);
291
285
 
292
286
  // Do not print the media query if responsive & non-responsive values are the same
293
- @if $val == $fluidVal {
287
+ @if $val == $fluid-val {
294
288
  #{$property}: $val;
295
289
  }
296
290
  @else {
297
- @include _rfs-rule {
298
- #{$property}: if($rfs-mode == max-media-query, $val, $fluidVal);
291
+ @include _rfs-rule () {
292
+ #{$property}: if($rfs-mode == max-media-query, $val, $fluid-val);
299
293
 
300
294
  // Include safari iframe resize fix if needed
301
295
  min-width: if($rfs-safari-iframe-resize-bug-fix, (0 * 1vw), null);
302
296
  }
303
297
 
304
- @include _rfs-media-query-rule {
305
- #{$property}: if($rfs-mode == max-media-query, $fluidVal, $val);
298
+ @include _rfs-media-query-rule () {
299
+ #{$property}: if($rfs-mode == max-media-query, $fluid-val, $val);
306
300
  }
307
301
  }
308
302
  }
data/bootstrap.gemspec CHANGED
@@ -14,10 +14,9 @@ Gem::Specification.new do |s|
14
14
  # SassC requires Ruby 2.3.3. Also specify here to make it obvious.
15
15
  s.required_ruby_version = '>= 2.3.3'
16
16
 
17
- s.add_runtime_dependency 'popper_js', '>= 2.9.3', '< 3'
17
+ s.add_runtime_dependency 'popper_js', '>= 2.11.8', '< 3'
18
18
 
19
- s.add_runtime_dependency 'sassc-rails', '>= 2.0.0'
20
- s.add_runtime_dependency 'autoprefixer-rails', '>= 9.1.0'
19
+ s.add_development_dependency 'rake'
21
20
 
22
21
  # Testing dependencies
23
22
  s.add_development_dependency 'minitest', '~> 5.14.4'
@@ -27,6 +26,7 @@ Gem::Specification.new do |s|
27
26
  s.add_development_dependency 'capybara', '>= 2.6.0'
28
27
  s.add_development_dependency 'cuprite'
29
28
  # Dummy Rails app dependencies
29
+ s.add_development_dependency 'railties'
30
30
  s.add_development_dependency 'actionpack', '>= 4.1.5'
31
31
  s.add_development_dependency 'activesupport', '>= 4.1.5'
32
32
  s.add_development_dependency 'json', '>= 1.8.1'
@@ -1,7 +1,22 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'autoprefixer-rails'
4
- require 'sassc-rails'
3
+ begin
4
+ require 'dartsass-sprockets'
5
+ rescue LoadError
6
+ begin
7
+ require 'sassc-rails'
8
+ rescue LoadError
9
+ begin
10
+ require 'dartsass-rails'
11
+ rescue LoadError
12
+ begin
13
+ require 'cssbundling-rails'
14
+ rescue LoadError
15
+ raise LoadError.new("bootstrap-rubygem requires a Sass engine. Please add dartsass-sprockets, sassc-rails, dartsass-rails or cssbundling-rails to your dependencies.")
16
+ end
17
+ end
18
+ end
19
+ end
5
20
 
6
21
  module Bootstrap
7
22
  module Rails
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bootstrap
4
- VERSION = '5.1.3'
5
- BOOTSTRAP_SHA = '1a6fdfae6be09b09eaced8f0e442ca6f7680a61e'
4
+ VERSION = '5.3.5'
5
+ BOOTSTRAP_SHA = '85f23534bd2de8041354b297516cf21959091b31'
6
6
  end
data/tasks/updater/js.rb CHANGED
@@ -1,8 +1,9 @@
1
+ require 'pathname'
1
2
  require 'tsort'
2
3
 
3
4
  class Updater
4
5
  module Js
5
- INLINED_SRCS = %w[util/backdrop.js util/component-functions.js util/focustrap.js util/index.js util/sanitizer.js util/scrollbar.js].freeze
6
+ INLINED_SRCS = %w[].freeze
6
7
 
7
8
  def update_javascript_assets
8
9
  log_status 'Updating javascripts...'
@@ -24,7 +25,7 @@ class Updater
24
25
  'assets/javascripts/bootstrap-global-this-define.js' => <<~JS,
25
26
  // Set a `globalThis` so that bootstrap components are defined on window.bootstrap instead of window.
26
27
  window['bootstrap'] = {
27
- Popper: window.Popper,
28
+ "@popperjs/core": window.Popper,
28
29
  _originalGlobalThis: window['globalThis']
29
30
  };
30
31
  window['globalThis'] = window['bootstrap'];
@@ -49,7 +50,9 @@ class Updater
49
50
  imports = Deps.new
50
51
  # Get the imports from the ES6 files to order requires correctly.
51
52
  read_files('js/src', src_files).each do |name, content|
52
- file_imports = content.scan(%r{import *(?:[a-zA-Z]*|\{[a-zA-Z ,]*\}) *from '\./([\w/-]+)}).flatten(1).map { |f| "#{f}.js" }.uniq
53
+ file_imports = content.scan(%r{import *(?:[a-zA-Z]*|\{[a-zA-Z ,]*\}) *from '([\w/.-]+)}).flatten(1).map do |f|
54
+ Pathname.new(name).dirname.join(f).cleanpath.to_s
55
+ end.uniq
53
56
  imports.add name, *(file_imports - INLINED_SRCS)
54
57
  end
55
58
  imports.tsort
@@ -68,13 +71,15 @@ class Updater
68
71
  end
69
72
 
70
73
  def add(from, *tos)
71
- (@imports[from] ||= []).push(*tos.sort)
74
+ imports = (@imports[from] ||= [])
75
+ imports.push(*tos)
76
+ imports.sort!
72
77
  end
73
78
 
74
79
  def tsort_each_child(node, &block)
75
80
  node_imports = @imports[node]
76
81
  if node_imports.nil?
77
- raise "No imports found for #{node.inspect}"
82
+ raise "No imports found for #{node.inspect}\nImports:\n#{@imports.inspect}"
78
83
  end
79
84
  node_imports.each(&block)
80
85
  end
@@ -44,7 +44,7 @@ class Updater
44
44
  if File.directory?(full_path)
45
45
  files.each do |name|
46
46
  path = "#{full_path}/#{name}"
47
- contents[name] = File.read(path, mode: 'rb') if File.exists?(path)
47
+ contents[name] = File.read(path, mode: 'rb') if File.exist?(path)
48
48
  end
49
49
  end
50
50
  contents
@@ -63,7 +63,7 @@ class Updater
63
63
  uri = URI(url)
64
64
  cache_path = "./#@cache_path#{uri.path}#{uri.query.tr('?&=', '-') if uri.query}"
65
65
  FileUtils.mkdir_p File.dirname(cache_path)
66
- if File.exists?(cache_path)
66
+ if File.exist?(cache_path)
67
67
  log_http_get_file url, true
68
68
  File.read(cache_path, mode: 'rb')
69
69
  else
@@ -4,7 +4,7 @@ class Updater
4
4
  log_status 'Updating scss...'
5
5
  save_to = @save_to[:scss]
6
6
  contents = {}
7
- bootstrap_scss_files = get_paths_by_type('scss', /\.scss$/)
7
+ bootstrap_scss_files = get_paths_by_type('scss', /\.scss$/).reject { |p| p.start_with?('tests/') }
8
8
  read_files('scss', bootstrap_scss_files).each do |name, file|
9
9
  contents[name] = file
10
10
  save_file("#{save_to}/#{name}", file)
@@ -12,7 +12,7 @@ class Updater
12
12
  log_processed "#{bootstrap_scss_files * ' '}"
13
13
 
14
14
  log_status 'Updating scss main files'
15
- %w(bootstrap bootstrap-grid bootstrap-reboot).each do |name|
15
+ %w(bootstrap bootstrap-grid bootstrap-reboot bootstrap-utilities).each do |name|
16
16
  # Compass treats non-partials as targets to copy into the main project, so make them partials.
17
17
  # Also move them up a level to clearly indicate entry points.
18
18
  from = "#{save_to}/#{name}.scss"
data/tasks/updater.rb CHANGED
@@ -18,10 +18,10 @@ class Updater
18
18
  include Js
19
19
  include Scss
20
20
 
21
- def initialize(repo: 'twbs/bootstrap', branch: 'master', save_to: {}, cache_path: 'tmp/bootstrap-cache')
21
+ def initialize(repo: 'twbs/bootstrap', branch: 'main', save_to: {}, cache_path: 'tmp/bootstrap-cache')
22
22
  @logger = Logger.new
23
23
  @repo = repo
24
- @branch = branch || 'master'
24
+ @branch = branch || 'main'
25
25
  @branch_sha = get_branch_sha
26
26
  @cache_path = cache_path
27
27
  @repo_url = "https://github.com/#@repo"
@@ -10,7 +10,6 @@ require 'rails'
10
10
  require "#{framework}/railtie"
11
11
  end
12
12
 
13
- require 'autoprefixer-rails'
14
13
  require 'uglifier'
15
14
  require 'bootstrap'
16
15
 
@@ -29,4 +28,3 @@ module Dummy
29
28
  end
30
29
  end
31
30
  end
32
-
File without changes
@@ -2,6 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem 'actionpack', '~> 4.2.7'
4
4
  gem 'activesupport', '~> 4.2.7'
5
+ gem 'sassc-rails', '~> 2.0'
6
+ gem 'bigdecimal', '1.3.5'
5
7
 
6
8
  gemspec path: '../../'
7
-
@@ -2,7 +2,6 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem 'actionpack', '~> 5.0.0'
4
4
  gem 'activesupport', '~> 5.0.0'
5
- gem 'autoprefixer-rails', '>= 6.3.6.1'
5
+ gem 'sassc-rails', '~> 2.0'
6
6
 
7
7
  gemspec path: '../../'
8
-
@@ -2,7 +2,6 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem 'actionpack', '~> 5.1.0'
4
4
  gem 'activesupport', '~> 5.1.0'
5
- gem 'autoprefixer-rails', '>= 7.1.1'
5
+ gem 'sassc-rails', '~> 2.0'
6
6
 
7
7
  gemspec path: '../../'
8
-
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'actionpack', '~> 5.2.8'
4
+ gem 'activesupport', '~> 5.2.8'
5
+ gem 'sassc-rails', '~> 2.0'
6
+
7
+ gemspec path: '../../'
@@ -2,6 +2,6 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem 'actionpack', '~> 6.0.3'
4
4
  gem 'activesupport', '~> 6.0.3'
5
- gem 'autoprefixer-rails', '>= 9.7.6'
5
+ gem 'sassc-rails', '~> 2.0'
6
6
 
7
7
  gemspec path: '../../'
@@ -2,6 +2,6 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem 'actionpack', '~> 6.1.3'
4
4
  gem 'activesupport', '~> 6.1.3'
5
- gem 'autoprefixer-rails', '>= 9.7.6'
5
+ gem 'sassc-rails', '~> 2.0'
6
6
 
7
7
  gemspec path: '../../'
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'actionpack', '~> 7.0.4'
4
+ gem 'activesupport', '~> 7.0.4'
5
+ gem 'dartsass-sprockets', '~> 3.0'
6
+
7
+ gemspec path: '../../'
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'actionpack', '~> 7.0.4'
4
+ gem 'activesupport', '~> 7.0.4'
5
+ gem 'sassc-rails', '~> 2.0'
6
+
7
+ gemspec path: '../../'
data/test/rails_test.rb CHANGED
@@ -12,11 +12,6 @@ class RailsTest < ActionDispatch::IntegrationTest
12
12
  screenshot!
13
13
  end
14
14
 
15
- def test_autoprefixer
16
- get ActionController::Base.helpers.stylesheet_path('application.css')
17
- assert_match(/-webkit-(?:transition|transform)/, response.body)
18
- end
19
-
20
15
  def test_precompile
21
16
  Dummy::Application.load_tasks
22
17
  Rake::Task['assets:precompile'].invoke
data/test/test_helper.rb CHANGED
@@ -24,7 +24,9 @@ browser_path = ENV['CHROMIUM_BIN'] || %w[
24
24
 
25
25
  Capybara.register_driver :cuprite do |app|
26
26
  options = {
27
- window_size: [1280, 1024]
27
+ window_size: [1280, 1024],
28
+ timeout: 30,
29
+ process_timeout: 30
28
30
  }
29
31
  options[:browser_path] = browser_path if browser_path
30
32
  Capybara::Cuprite::Driver.new(app, options)
@@ -38,4 +40,3 @@ Capybara.configure do |config|
38
40
  config.server_port = 7000
39
41
  config.default_max_wait_time = 10
40
42
  end
41
-