js-routes 2.2.3 → 2.2.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 (41) hide show
  1. checksums.yaml +4 -4
  2. data/.eslintrc.js +1 -1
  3. data/.github/workflows/ci.yml +36 -0
  4. data/Appraisals +2 -4
  5. data/CHANGELOG.md +7 -0
  6. data/Readme.md +50 -43
  7. data/gemfiles/rails50_sprockets_3.gemfile +1 -1
  8. data/gemfiles/rails51_sprockets_3.gemfile +1 -1
  9. data/gemfiles/rails52_sprockets_3.gemfile +1 -1
  10. data/gemfiles/rails70_sprockets_4.gemfile +8 -0
  11. data/lib/js_routes/engine.rb +6 -1
  12. data/lib/js_routes/generators/middleware.rb +1 -1
  13. data/lib/js_routes/instance.rb +2 -2
  14. data/lib/js_routes/middleware.rb +6 -2
  15. data/lib/js_routes/version.rb +1 -1
  16. data/lib/routes.d.ts +2 -0
  17. data/lib/routes.js +23 -5
  18. data/lib/routes.ts +34 -17
  19. data/package.json +7 -6
  20. data/spec/js_routes/default_serializer_spec.rb +5 -5
  21. data/spec/js_routes/module_types/amd_spec.rb +3 -3
  22. data/spec/js_routes/module_types/cjs_spec.rb +1 -1
  23. data/spec/js_routes/module_types/dts/routes.spec.d.ts +2 -0
  24. data/spec/js_routes/module_types/dts_spec.rb +1 -1
  25. data/spec/js_routes/module_types/esm_spec.rb +2 -2
  26. data/spec/js_routes/module_types/nil_spec.rb +7 -7
  27. data/spec/js_routes/module_types/umd_spec.rb +1 -1
  28. data/spec/js_routes/options_spec.rb +81 -81
  29. data/spec/js_routes/rails_routes_compatibility_spec.rb +127 -138
  30. data/spec/js_routes/route_specification_spec.rb +40 -0
  31. data/spec/js_routes/zzz_last_post_rails_init_spec.rb +8 -2
  32. data/spec/spec_helper.rb +5 -5
  33. data/yarn.lock +760 -448
  34. metadata +6 -10
  35. data/.travis.yml +0 -67
  36. data/gemfiles/rails40_sprockets_2.gemfile +0 -8
  37. data/gemfiles/rails40_sprockets_3.gemfile +0 -8
  38. data/gemfiles/rails41_sprockets_2.gemfile +0 -8
  39. data/gemfiles/rails41_sprockets_3.gemfile +0 -8
  40. data/gemfiles/rails42_sprockets_2.gemfile +0 -8
  41. data/gemfiles/rails42_sprockets_3.gemfile +0 -8
data/spec/spec_helper.rb CHANGED
@@ -7,7 +7,7 @@ require 'rails/all'
7
7
  require 'js-routes'
8
8
  require 'active_support/core_ext/hash/slice'
9
9
 
10
- unless ENV['TRAVIS_CI']
10
+ unless ENV['CI']
11
11
  code = system("yarn build")
12
12
  unless code
13
13
  exit(1)
@@ -70,6 +70,10 @@ def log(string)
70
70
  evaljs("console.log(#{string})")
71
71
  end
72
72
 
73
+ def expectjs(string)
74
+ expect(evaljs(string))
75
+ end
76
+
73
77
  ActiveSupport::Inflector.inflections do |inflect|
74
78
  inflect.irregular "budgie", "budgies"
75
79
  end
@@ -90,10 +94,6 @@ end
90
94
 
91
95
 
92
96
  class ::App < Rails::Application
93
- # Enable the asset pipeline
94
- config.assets.enabled = true
95
- # initialize_on_precompile
96
- config.assets.initialize_on_precompile = true
97
97
  config.paths['config/routes.rb'] << 'spec/config/routes.rb'
98
98
  config.root = File.expand_path('../dummy', __FILE__)
99
99
  end