inline_forms_installer 8.1.65 → 8.1.66
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.
- checksums.yaml +4 -4
- data/lib/inline_forms_installer/version.rb +1 -1
- data/lib/installer_templates/dartsass/devise_main.scss +3 -2
- data/lib/installer_templates/dartsass/inline_forms_dartsass_builds.rb +11 -25
- data/lib/installer_templates/dartsass/inline_forms_main.scss +3 -2
- data/lib/installer_templates/example_app_tests/test/integration/example_app_dartsass_build_test.rb +18 -14
- data/lib/installer_templates/example_app_tests/test/integration/example_app_layout_title_test.rb +1 -1
- data/lib/installer_templates/example_app_tests/test/integration/example_app_stylesheet_test.rb +31 -0
- data/lib/installer_templates/example_app_tests/test/integration/example_app_user_locale_test.rb +3 -3
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 189ba5e71c9aee58f109af59c1ee01054b3055f88991c1bbc1a9d2e56e710435
|
|
4
|
+
data.tar.gz: e587e52585904ff80d026fced739045a7fc6b1258e3050b65bf5913c740a3508
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 630596a0231449683d571153e2764c8678868a76646730d977d8efc322c450ec9d2765c5feafb94bd61c46d486ebe5f620720e2e83148c70aba831f13ce821e2
|
|
7
|
+
data.tar.gz: c2329bc07c4804ac8e45ad70a8ac7951d969ef1a8f8dfd48bcf8787bea1d0815212d6c7b7057f7ce8847b7a1721d122d9288230baf1d00fa930b13da5c9e0246
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
// Entry for dartsass (see config/initializers/inline_forms_dartsass_builds.rb
|
|
2
|
-
|
|
1
|
+
// Entry for dartsass (see config/initializers/inline_forms_dartsass_builds.rb,
|
|
2
|
+
// also for why the extension is written out).
|
|
3
|
+
@use "inline_forms/devise.scss" as *;
|
|
@@ -13,28 +13,14 @@ Rails.application.config.dartsass.builds = {
|
|
|
13
13
|
"inline_forms_install/devise_main.scss" => "inline_forms/devise.css"
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
# SELF-IMPORT GUARD:
|
|
17
|
-
#
|
|
18
|
-
#
|
|
19
|
-
#
|
|
20
|
-
#
|
|
21
|
-
#
|
|
22
|
-
#
|
|
23
|
-
#
|
|
24
|
-
#
|
|
25
|
-
# .
|
|
26
|
-
#
|
|
27
|
-
#
|
|
28
|
-
# The gem dir goes in front of the runner's own --load-path list, as a
|
|
29
|
-
# separate argument: not in build_options (the runner splits every entry there
|
|
30
|
-
# on whitespace, which breaks a gem path with a space in it) and not first on
|
|
31
|
-
# config.assets.paths (Sprockets would then resolve inline_forms/*.css to the
|
|
32
|
-
# gem's .scss instead of the compiled build).
|
|
33
|
-
require "dartsass/runner"
|
|
34
|
-
|
|
35
|
-
module InlineFormsDartsassLoadPath
|
|
36
|
-
def dartsass_load_paths
|
|
37
|
-
[ "--load-path", InlineForms::Engine.root.join("app/assets/stylesheets").to_s ] + super
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
Dartsass::Runner.singleton_class.prepend(InlineFormsDartsassLoadPath)
|
|
16
|
+
# SELF-IMPORT GUARD: the two inline_forms_install/*_main.scss entries `@use`
|
|
17
|
+
# the gem's stylesheets WITH their .scss extension. dartsass-rails passes
|
|
18
|
+
# app/assets/stylesheets and then every config.assets.paths entry as a
|
|
19
|
+
# --load-path, app/assets/builds comes before the gem, and a plain .css file
|
|
20
|
+
# is importable by Sass: a bare `@use "inline_forms/inline_forms"` resolved to
|
|
21
|
+
# the PREVIOUS OUTPUT app/assets/builds/inline_forms/inline_forms.css, so from
|
|
22
|
+
# the second build on each build re-imported its own stale result and gem
|
|
23
|
+
# stylesheet changes never reached the app. With the extension Dart Sass only
|
|
24
|
+
# takes a .scss file (the gem's), and the build fails loudly if the gem ever
|
|
25
|
+
# renames it. (Until 8.1.66 this file prepended the gem dir to
|
|
26
|
+
# Dartsass::Runner.dartsass_load_paths, an internal of dartsass-rails.)
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
// Entry for dartsass (see config/initializers/inline_forms_dartsass_builds.rb
|
|
2
|
-
|
|
1
|
+
// Entry for dartsass (see config/initializers/inline_forms_dartsass_builds.rb,
|
|
2
|
+
// also for why the extension is written out).
|
|
3
|
+
@use "inline_forms/inline_forms.scss" as *;
|
data/lib/installer_templates/example_app_tests/test/integration/example_app_dartsass_build_test.rb
CHANGED
|
@@ -1,27 +1,31 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "test_helper"
|
|
4
|
-
require "dartsass/runner"
|
|
5
4
|
require "sass-embedded"
|
|
6
5
|
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
# app/assets/builds (ahead of the
|
|
10
|
-
# gem's .scss:
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
#
|
|
14
|
-
#
|
|
6
|
+
# The inline_forms_install/*_main.scss entries `@use` the gem's stylesheets
|
|
7
|
+
# with an explicit .scss extension (config/initializers/
|
|
8
|
+
# inline_forms_dartsass_builds.rb). Without it app/assets/builds (ahead of the
|
|
9
|
+
# gem on the Sass load path) shadows the gem's .scss: a bare
|
|
10
|
+
# `@use "inline_forms/inline_forms"` re-imports the app's previous compiled
|
|
11
|
+
# CSS, and gem stylesheet changes never reach the app after its first build.
|
|
12
|
+
# test_helper runs dartsass:build, so by now builds/ already held a previous
|
|
13
|
+
# build when this run's one ran.
|
|
15
14
|
class ExampleAppDartsassBuildTest < ActiveSupport::TestCase
|
|
16
|
-
test "the
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
test "the initializer no longer patches dartsass-rails' load paths" do
|
|
16
|
+
code = Rails.root.join("config/initializers/inline_forms_dartsass_builds.rb").readlines
|
|
17
|
+
.reject { |line| line.lstrip.start_with?("#") }.join
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
assert_equal [ "--load-path", gem_stylesheets ], command[first_load_path, 2]
|
|
19
|
+
refute_includes code, "Dartsass::Runner"
|
|
22
20
|
end
|
|
23
21
|
|
|
24
22
|
%w[inline_forms devise].each do |entry|
|
|
23
|
+
test "inline_forms_install/#{entry}_main.scss uses the gem's #{entry}.scss with its extension" do
|
|
24
|
+
main = Rails.root.join("app/assets/stylesheets/inline_forms_install/#{entry}_main.scss").read
|
|
25
|
+
|
|
26
|
+
assert_includes main, %(@use "inline_forms/#{entry}.scss" as *;)
|
|
27
|
+
end
|
|
28
|
+
|
|
25
29
|
test "builds/inline_forms/#{entry}.css is compiled from the gem's #{entry}.scss" do
|
|
26
30
|
built = Rails.root.join("app/assets/builds/inline_forms/#{entry}.css")
|
|
27
31
|
assert built.file?, "#{built} missing; dartsass:build did not run"
|
data/lib/installer_templates/example_app_tests/test/integration/example_app_layout_title_test.rb
CHANGED
|
@@ -43,7 +43,7 @@ class ExampleAppLayoutTitleTest < ExampleAppIntegrationTestCase
|
|
|
43
43
|
get apartments_path
|
|
44
44
|
|
|
45
45
|
assert_response :success
|
|
46
|
-
assert_includes @response.body, %(<html lang="nl">)
|
|
46
|
+
assert_includes @response.body, %(<html lang="nl" class="no-js">)
|
|
47
47
|
assert_equal expected_title, page_title
|
|
48
48
|
ensure
|
|
49
49
|
en = Locale.find_by(name: "en")
|
data/lib/installer_templates/example_app_tests/test/integration/example_app_stylesheet_test.rb
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "test_helper"
|
|
4
|
+
|
|
5
|
+
# The compiled admin and devise stylesheets (test_helper runs dartsass:build).
|
|
6
|
+
# Tippy's CSS was a plain CSS `@import '…/tippy.css'` that the browser
|
|
7
|
+
# resolved to /vendor/assets/stylesheets/tippy.css, a 404 on every page; the
|
|
8
|
+
# gem now inlines it. And the top-bar submenus stay hidden until Foundation
|
|
9
|
+
# initialises them, also after a Turbo Drive visit (html.no-js is gone then).
|
|
10
|
+
class ExampleAppStylesheetTest < ActiveSupport::TestCase
|
|
11
|
+
%w[inline_forms devise].each do |entry|
|
|
12
|
+
test "builds/inline_forms/#{entry}.css inlines tippy and has no CSS @import" do
|
|
13
|
+
css = built(entry)
|
|
14
|
+
|
|
15
|
+
assert_empty css.scan(/@import[^;]*;/), "#{entry}.css: the browser would fetch these"
|
|
16
|
+
assert_includes css, ".tippy-box{position:relative"
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
test "uninitialised top-bar submenus are hidden" do
|
|
21
|
+
assert_includes built("inline_forms"), ".dropdown.menu>li>ul.menu:not(.is-dropdown-submenu){display:none}"
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
private
|
|
25
|
+
|
|
26
|
+
def built(entry)
|
|
27
|
+
path = Rails.root.join("app/assets/builds/inline_forms/#{entry}.css")
|
|
28
|
+
assert path.file?, "#{path} missing; dartsass:build did not run"
|
|
29
|
+
path.read
|
|
30
|
+
end
|
|
31
|
+
end
|
data/lib/installer_templates/example_app_tests/test/integration/example_app_user_locale_test.rb
CHANGED
|
@@ -11,7 +11,7 @@ class ExampleAppUserLocaleTest < ExampleAppIntegrationTestCase
|
|
|
11
11
|
get apartments_path
|
|
12
12
|
|
|
13
13
|
assert_response :success
|
|
14
|
-
assert_includes @response.body, %(<html lang="en">)
|
|
14
|
+
assert_includes @response.body, %(<html lang="en" class="no-js">)
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
test "user locale preference switches I18n for the request" do
|
|
@@ -23,7 +23,7 @@ class ExampleAppUserLocaleTest < ExampleAppIntegrationTestCase
|
|
|
23
23
|
get apartments_path
|
|
24
24
|
|
|
25
25
|
assert_response :success
|
|
26
|
-
assert_includes @response.body, %(<html lang="nl">)
|
|
26
|
+
assert_includes @response.body, %(<html lang="nl" class="no-js">)
|
|
27
27
|
ensure
|
|
28
28
|
en = Locale.find_by(name: "en")
|
|
29
29
|
admin&.update!(locale: en) if en
|
|
@@ -38,7 +38,7 @@ class ExampleAppUserLocaleTest < ExampleAppIntegrationTestCase
|
|
|
38
38
|
get apartments_path
|
|
39
39
|
|
|
40
40
|
assert_response :success
|
|
41
|
-
assert_includes @response.body, %(<html lang="en">)
|
|
41
|
+
assert_includes @response.body, %(<html lang="en" class="no-js">)
|
|
42
42
|
ensure
|
|
43
43
|
en = Locale.find_by(name: "en")
|
|
44
44
|
admin&.update!(locale: en) if en
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: inline_forms_installer
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 8.1.
|
|
4
|
+
version: 8.1.66
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ace Suares
|
|
@@ -125,6 +125,7 @@ files:
|
|
|
125
125
|
- lib/installer_templates/example_app_tests/test/integration/example_app_showcase_row_turbo_test.rb
|
|
126
126
|
- lib/installer_templates/example_app_tests/test/integration/example_app_showcase_text_fields_test.rb
|
|
127
127
|
- lib/installer_templates/example_app_tests/test/integration/example_app_showcase_validation_hints_test.rb
|
|
128
|
+
- lib/installer_templates/example_app_tests/test/integration/example_app_stylesheet_test.rb
|
|
128
129
|
- lib/installer_templates/example_app_tests/test/integration/example_app_turbo_layout_test.rb
|
|
129
130
|
- lib/installer_templates/example_app_tests/test/integration/example_app_user_locale_test.rb
|
|
130
131
|
- lib/installer_templates/example_app_tests/test/integration/example_app_user_theme_test.rb
|