avo 2.14.3.pre.3.jsbundling → 2.14.3.pre.4.tosqlfix

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of avo might be problematic. Click here for more details.

metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avo
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.14.3.pre.3.jsbundling
4
+ version: 2.14.3.pre.4.tosqlfix
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Marin
@@ -1647,7 +1647,7 @@ files:
1647
1647
  - app/helpers/avo/attachments_helper.rb
1648
1648
  - app/helpers/avo/resources_helper.rb
1649
1649
  - app/helpers/avo/url_helpers.rb
1650
- - app/javascript/avo.base.js
1650
+ - app/javascript/avo.js
1651
1651
  - app/javascript/js/active-storage.js
1652
1652
  - app/javascript/js/application.js
1653
1653
  - app/javascript/js/controllers.js
@@ -1887,7 +1887,6 @@ files:
1887
1887
  - lib/generators/avo/field_generator.rb
1888
1888
  - lib/generators/avo/filter_generator.rb
1889
1889
  - lib/generators/avo/install_generator.rb
1890
- - lib/generators/avo/js/install_generator.rb
1891
1890
  - lib/generators/avo/locales_generator.rb
1892
1891
  - lib/generators/avo/named_base_generator.rb
1893
1892
  - lib/generators/avo/resource_generator.rb
@@ -1913,7 +1912,6 @@ files:
1913
1912
  - lib/generators/avo/templates/filters/select_filter.tt
1914
1913
  - lib/generators/avo/templates/filters/text_filter.tt
1915
1914
  - lib/generators/avo/templates/initializer/avo.tt
1916
- - lib/generators/avo/templates/js/avo.custom.js
1917
1915
  - lib/generators/avo/templates/locales/avo.en.yml
1918
1916
  - lib/generators/avo/templates/locales/avo.fr.yml
1919
1917
  - lib/generators/avo/templates/locales/avo.nb-NO.yml
@@ -1930,9 +1928,9 @@ files:
1930
1928
  - lib/generators/avo/tool_generator.rb
1931
1929
  - lib/generators/avo/version_generator.rb
1932
1930
  - lib/tasks/avo_tasks.rake
1933
- - public/avo-assets/avo.base.js
1934
- - public/avo-assets/avo.base.js.map
1935
1931
  - public/avo-assets/avo.css
1932
+ - public/avo-assets/avo.js
1933
+ - public/avo-assets/avo.js.map
1936
1934
  - public/avo-assets/fonts/inter-v7-latin-500.eot
1937
1935
  - public/avo-assets/fonts/inter-v7-latin-500.svg
1938
1936
  - public/avo-assets/fonts/inter-v7-latin-500.ttf
@@ -1,64 +0,0 @@
1
- require_relative "../base_generator"
2
-
3
- module Generators
4
- module Avo
5
- module Js
6
- class InstallGenerator < BaseGenerator
7
- source_root File.expand_path("../templates", __dir__)
8
-
9
- namespace "avo:js:install"
10
- desc "Add custom JavaScript assets to your Avo project."
11
-
12
- # possible values: importmap or esbuild
13
- class_option :bundler, type: :string, default: "importmap"
14
-
15
- def create_files
16
- case options[:bundler].to_s
17
- when "importmap"
18
- install_for_importmap
19
- when "esbuild"
20
- install_for_esbuild
21
- else
22
- say "We don't know how to install Avo JS for this bundler \"#{options[:bundler]}\""
23
- end
24
- end
25
-
26
- no_tasks do
27
- def install_for_importmap
28
- unless Rails.root.join("app", "javascript", "avo.custom.js").exist?
29
- say "Add default app/javascript/avo.custom.js"
30
- copy_file template_path("avo.custom.js"), "app/javascript/avo.custom.js"
31
- end
32
-
33
- say "Ejecting the _head.html.erb partial"
34
- Rails::Generators.invoke("avo:eject", [":head", "--no-avo-version"], {destination_root: Rails.root})
35
-
36
- say "Adding the JS asset to the partial"
37
- append_to_file Rails.root.join("app", "views", "avo", "partials", "_head.html.erb"), "<%= javascript_importmap_tags \"avo.custom\" %>"
38
-
39
- # pin to importmap
40
- say "Pin the new entrypoint to your importmap config"
41
- append_to_file Rails.root.join("config", "importmap.rb"), "\n# Avo custom JS entrypoint\npin \"avo.custom\", preload: true\n"
42
- end
43
-
44
- def install_for_esbuild
45
- unless Rails.root.join("app", "javascript", "avo.custom.js").exist?
46
- say "Add default app/javascript/avo.custom.js"
47
- copy_file template_path("avo.custom.js"), "app/javascript/avo.custom.js"
48
- end
49
-
50
- say "Ejecting the _head.html.erb partial"
51
- Rails::Generators.invoke("avo:eject", [":head", "--no-avo-version"], {destination_root: Rails.root})
52
-
53
- say "Adding the JS asset to the partial"
54
- append_to_file Rails.root.join("app", "views", "avo", "partials", "_head.html.erb"), "<%= javascript_include_tag \"avo.custom\", \"data-turbo-track\": \"reload\", defer: true %>"
55
- end
56
-
57
- def template_path(filename)
58
- Pathname.new(__dir__).join("..", "templates", "js", filename).to_s
59
- end
60
- end
61
- end
62
- end
63
- end
64
- end
@@ -1,2 +0,0 @@
1
- // eslint-disable-next-line no-console
2
- console.log('Hi from Avo custom JS 👋')