js-routes 2.2.9 → 2.2.10
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/CHANGELOG.md +6 -1
- data/lib/js_routes/generators/base.rb +6 -1
- data/lib/js_routes/generators/middleware.rb +3 -2
- data/lib/js_routes/instance.rb +8 -0
- data/lib/js_routes/middleware.rb +4 -2
- data/lib/js_routes/route.rb +4 -2
- data/lib/js_routes/types.rb +10 -0
- data/lib/js_routes/version.rb +1 -1
- data/lib/js_routes.rb +5 -0
- metadata +8 -100
- data/.document +0 -5
- data/.eslintrc.js +0 -15
- data/.github/workflows/ci.yml +0 -36
- data/.gitignore +0 -65
- data/.nvmrc +0 -1
- data/.rspec +0 -1
- data/Appraisals +0 -17
- data/Gemfile +0 -9
- data/Rakefile +0 -37
- data/VERSION_2_UPGRADE.md +0 -66
- data/bin/tapioca +0 -27
- data/gemfiles/rails50_sprockets_3.gemfile +0 -8
- data/gemfiles/rails51_sprockets_3.gemfile +0 -8
- data/gemfiles/rails52_sprockets_3.gemfile +0 -8
- data/gemfiles/rails70_sprockets_4.gemfile +0 -8
- data/js-routes.gemspec +0 -42
- data/package.json +0 -38
- data/sorbet/config +0 -4
- data/sorbet/rbi/annotations/.gitattributes +0 -1
- data/sorbet/rbi/annotations/actionpack.rbi +0 -428
- data/sorbet/rbi/annotations/actionview.rbi +0 -75
- data/sorbet/rbi/annotations/activesupport.rbi +0 -421
- data/sorbet/rbi/annotations/railties.rbi +0 -61
- data/sorbet/rbi/gems/.gitattributes +0 -1
- data/sorbet/rbi/gems/actionpack@7.0.4.1.rbi +0 -303
- data/sorbet/rbi/gems/actionview@7.0.4.1.rbi +0 -8
- data/sorbet/rbi/gems/activesupport@7.0.4.1.rbi +0 -16424
- data/sorbet/rbi/gems/appraisal@2.4.1.rbi +0 -584
- data/sorbet/rbi/gems/builder@3.2.4.rbi +0 -8
- data/sorbet/rbi/gems/bump@0.10.0.rbi +0 -168
- data/sorbet/rbi/gems/byebug@11.1.3.rbi +0 -3606
- data/sorbet/rbi/gems/coderay@1.1.3.rbi +0 -3426
- data/sorbet/rbi/gems/concurrent-ruby@1.2.0.rbi +0 -11570
- data/sorbet/rbi/gems/crass@1.0.6.rbi +0 -8
- data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +0 -1083
- data/sorbet/rbi/gems/erubi@1.12.0.rbi +0 -145
- data/sorbet/rbi/gems/i18n@1.12.0.rbi +0 -2296
- data/sorbet/rbi/gems/libv8-node@16.10.0.0.rbi +0 -8
- data/sorbet/rbi/gems/loofah@2.19.1.rbi +0 -8
- data/sorbet/rbi/gems/method_source@1.0.0.rbi +0 -272
- data/sorbet/rbi/gems/mini_racer@0.6.3.rbi +0 -224
- data/sorbet/rbi/gems/minitest@5.17.0.rbi +0 -1457
- data/sorbet/rbi/gems/netrc@0.11.0.rbi +0 -158
- data/sorbet/rbi/gems/nokogiri@1.14.0.rbi +0 -8
- data/sorbet/rbi/gems/parallel@1.24.0.rbi +0 -280
- data/sorbet/rbi/gems/prettier_print@1.2.1.rbi +0 -951
- data/sorbet/rbi/gems/prism@0.24.0.rbi +0 -29744
- data/sorbet/rbi/gems/pry-byebug@3.10.1.rbi +0 -1150
- data/sorbet/rbi/gems/pry@0.14.2.rbi +0 -10075
- data/sorbet/rbi/gems/racc@1.6.2.rbi +0 -150
- data/sorbet/rbi/gems/rack-test@2.0.2.rbi +0 -8
- data/sorbet/rbi/gems/rack@2.2.6.2.rbi +0 -5585
- data/sorbet/rbi/gems/rails-dom-testing@2.0.3.rbi +0 -8
- data/sorbet/rbi/gems/rails-html-sanitizer@1.5.0.rbi +0 -8
- data/sorbet/rbi/gems/railties@7.0.4.1.rbi +0 -1959
- data/sorbet/rbi/gems/rake@13.0.6.rbi +0 -3072
- data/sorbet/rbi/gems/rbi@0.1.9.rbi +0 -3006
- data/sorbet/rbi/gems/rspec-core@3.12.0.rbi +0 -10868
- data/sorbet/rbi/gems/rspec-expectations@3.12.2.rbi +0 -8100
- data/sorbet/rbi/gems/rspec-mocks@3.12.3.rbi +0 -5299
- data/sorbet/rbi/gems/rspec-support@3.12.0.rbi +0 -1611
- data/sorbet/rbi/gems/rspec@3.12.0.rbi +0 -82
- data/sorbet/rbi/gems/spoom@1.2.4.rbi +0 -3777
- data/sorbet/rbi/gems/sprockets-rails@3.4.2.rbi +0 -14
- data/sorbet/rbi/gems/sprockets@4.2.0.rbi +0 -8
- data/sorbet/rbi/gems/syntax_tree@6.2.0.rbi +0 -23136
- data/sorbet/rbi/gems/tapioca@0.12.0.rbi +0 -3510
- data/sorbet/rbi/gems/thor@1.2.1.rbi +0 -3956
- data/sorbet/rbi/gems/tzinfo@2.0.5.rbi +0 -5914
- data/sorbet/rbi/gems/yard-sorbet@0.8.1.rbi +0 -428
- data/sorbet/rbi/gems/yard@0.9.34.rbi +0 -18332
- data/sorbet/rbi/gems/zeitwerk@2.6.8.rbi +0 -8
- data/sorbet/rbi/todo.rbi +0 -31
- data/sorbet/tapioca/config.yml +0 -13
- data/sorbet/tapioca/require.rb +0 -4
- data/spec/dummy/app/assets/config/manifest.js +0 -2
- data/spec/dummy/app/assets/javascripts/.gitkeep +0 -0
- data/spec/dummy/config/routes.rb +0 -55
- data/spec/js_routes/default_serializer_spec.rb +0 -31
- data/spec/js_routes/module_types/amd_spec.rb +0 -35
- data/spec/js_routes/module_types/cjs_spec.rb +0 -15
- data/spec/js_routes/module_types/dts/routes.spec.d.ts +0 -115
- data/spec/js_routes/module_types/dts/test.spec.ts +0 -56
- data/spec/js_routes/module_types/dts_spec.rb +0 -126
- data/spec/js_routes/module_types/esm_spec.rb +0 -45
- data/spec/js_routes/module_types/nil_spec.rb +0 -87
- data/spec/js_routes/module_types/umd_spec.rb +0 -85
- data/spec/js_routes/options_spec.rb +0 -508
- data/spec/js_routes/rails_routes_compatibility_spec.rb +0 -473
- data/spec/js_routes/route_specification_spec.rb +0 -37
- data/spec/js_routes/zzz_sprockets_spec.rb +0 -152
- data/spec/spec_helper.rb +0 -135
- data/spec/support/routes.rb +0 -81
- data/spec/tsconfig.json +0 -4
- data/tsconfig.json +0 -28
- data/yarn.lock +0 -2457
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f69479723e452f1b4ed09bf940b3150ad45430b5c601f966f05a082bce0a9494
|
|
4
|
+
data.tar.gz: bd47ceb7b1cba241262b8308e913f7d87aef6304d93d9185026e70dd4980487f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4f67b2ccc88195647ea7c694f935848aad52ddd9e46ac1a766df0c29b7e123a147169deb5b8207c8d3a598fcf0c0ba01f98b0d24ee30b326737200f02f2f8235
|
|
7
|
+
data.tar.gz: 9aad6d181099b3fdd7ada0facf1269e08669cd1181f94d3039f0e13f8bf2bc5a44172e13843fec5a8317b4c99e1eee6a2de2343e34fe6c3cddebb7a63f9608fb
|
data/CHANGELOG.md
CHANGED
|
@@ -4,10 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
## v2.2.10
|
|
6
6
|
|
|
7
|
-
*
|
|
7
|
+
* Remove sorbet files from repo
|
|
8
|
+
* Clearly define files included in gem
|
|
9
|
+
* Fix Middleware and Middleware generator bugs [#316](https://github.com/railsware/js-routes/issue/316)
|
|
10
|
+
* Remove empty object linter warning on DTS module
|
|
11
|
+
* Generators: Add `.ts` extension when searching for main JS file of the project
|
|
8
12
|
|
|
9
13
|
## v2.2.9
|
|
10
14
|
|
|
15
|
+
* Fix middleware error for non-modern setup.
|
|
11
16
|
* Added [Sorbet](https://sorbet.org/) method signatures.
|
|
12
17
|
* Always use DTS module type when calling JsRoutes.definitions or .definitions!. [#313](https://github.com/railsware/js-routes/issues/313)
|
|
13
18
|
|
|
@@ -3,13 +3,18 @@ require "rails/generators"
|
|
|
3
3
|
|
|
4
4
|
class JsRoutes::Generators::Base < Rails::Generators::Base
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
def self.inherited(subclass)
|
|
7
|
+
super
|
|
8
|
+
subclass.source_root(File.expand_path(__FILE__ + "/../../../templates"))
|
|
9
|
+
end
|
|
7
10
|
|
|
8
11
|
protected
|
|
9
12
|
|
|
10
13
|
def application_js_path
|
|
11
14
|
[
|
|
15
|
+
"app/javascript/packs/application.ts",
|
|
12
16
|
"app/javascript/packs/application.js",
|
|
17
|
+
"app/javascript/controllers/application.ts",
|
|
13
18
|
"app/javascript/controllers/application.js",
|
|
14
19
|
].find do |path|
|
|
15
20
|
File.exist?(Rails.root.join(path))
|
|
@@ -11,7 +11,7 @@ class JsRoutes::Generators::Middleware < JsRoutes::Generators::Base
|
|
|
11
11
|
inject_into_file path, pack_content
|
|
12
12
|
end
|
|
13
13
|
JsRoutes.generate!
|
|
14
|
-
JsRoutes.definitions!
|
|
14
|
+
JsRoutes.definitions! if JsRoutes.configuration.modern?
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
protected
|
|
@@ -34,9 +34,10 @@ alert(`JsRoutes installed.\\nYour root path is ${root_path()}`)
|
|
|
34
34
|
|
|
35
35
|
def rakefile_content
|
|
36
36
|
enhanced_task = depends_on_js_bundling? ? "javascript:build" : "assets:precompile"
|
|
37
|
+
dependency_task = JsRoutes.configuration.modern? ? "js:routes:typescript" : 'js:routes'
|
|
37
38
|
<<-RB
|
|
38
39
|
# Update js-routes file before javascript build
|
|
39
|
-
task "#{enhanced_task}" => "
|
|
40
|
+
task "#{enhanced_task}" => "#{dependency_task}"
|
|
40
41
|
RB
|
|
41
42
|
end
|
|
42
43
|
|
data/lib/js_routes/instance.rb
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
require "js_routes/configuration"
|
|
3
3
|
require "js_routes/route"
|
|
4
4
|
require "js_routes/types"
|
|
5
|
+
require 'fileutils'
|
|
5
6
|
|
|
6
7
|
module JsRoutes
|
|
7
8
|
class Instance # :nodoc:
|
|
@@ -57,6 +58,13 @@ module JsRoutes
|
|
|
57
58
|
end
|
|
58
59
|
end
|
|
59
60
|
|
|
61
|
+
sig { void }
|
|
62
|
+
def remove!
|
|
63
|
+
path = Rails.root.join(@configuration.output_file)
|
|
64
|
+
FileUtils.rm_rf(path)
|
|
65
|
+
FileUtils.rm_rf(path.sub(%r{\.js\z}, '.d.ts'))
|
|
66
|
+
end
|
|
67
|
+
|
|
60
68
|
protected
|
|
61
69
|
|
|
62
70
|
sig { returns(T::Hash[String, String]) }
|
data/lib/js_routes/middleware.rb
CHANGED
|
@@ -9,16 +9,18 @@ module JsRoutes
|
|
|
9
9
|
# https://github.com/fnando/i18n-js/blob/main/lib/i18n/js/middleware.rb
|
|
10
10
|
class Middleware
|
|
11
11
|
include JsRoutes::Types
|
|
12
|
+
include RackApp
|
|
13
|
+
|
|
12
14
|
extend T::Sig
|
|
13
15
|
|
|
14
|
-
sig { params(app: T.
|
|
16
|
+
sig { params(app: T.untyped).void }
|
|
15
17
|
def initialize(app)
|
|
16
18
|
@app = app
|
|
17
19
|
@routes_file = T.let(Rails.root.join("config/routes.rb"), Pathname)
|
|
18
20
|
@mtime = T.let(nil, T.nilable(Time))
|
|
19
21
|
end
|
|
20
22
|
|
|
21
|
-
sig { params(env: StringHash).returns(UntypedArray) }
|
|
23
|
+
sig { override.params(env: StringHash).returns(UntypedArray) }
|
|
22
24
|
def call(env)
|
|
23
25
|
update_js_routes
|
|
24
26
|
@app.call(env)
|
data/lib/js_routes/route.rb
CHANGED
|
@@ -65,13 +65,15 @@ module JsRoutes
|
|
|
65
65
|
|
|
66
66
|
sig { returns(String) }
|
|
67
67
|
def definition_body
|
|
68
|
+
options_type = optional_parts_type ? "#{optional_parts_type} & RouteOptions" : "RouteOptions"
|
|
68
69
|
args = required_parts.map{|p| "#{apply_case(p)}: RequiredRouteParameter"}
|
|
69
|
-
args << "options?: #{
|
|
70
|
+
args << "options?: #{options_type}"
|
|
70
71
|
"((\n#{args.join(",\n").indent(2)}\n) => string) & RouteHelperExtras"
|
|
71
72
|
end
|
|
72
73
|
|
|
73
|
-
sig { returns(String) }
|
|
74
|
+
sig { returns(T.nilable(String)) }
|
|
74
75
|
def optional_parts_type
|
|
76
|
+
return nil if optional_parts.empty?
|
|
75
77
|
@optional_parts_type ||= T.let(
|
|
76
78
|
"{" + optional_parts.map {|p| "#{p}?: OptionalRouteParameter"}.join(', ') + "}",
|
|
77
79
|
T.nilable(String)
|
data/lib/js_routes/types.rb
CHANGED
|
@@ -24,5 +24,15 @@ module JsRoutes
|
|
|
24
24
|
Prefix = T.type_alias do
|
|
25
25
|
T.any(T.proc.returns(String), String, NilClass)
|
|
26
26
|
end
|
|
27
|
+
|
|
28
|
+
module RackApp
|
|
29
|
+
extend T::Sig
|
|
30
|
+
extend T::Helpers
|
|
31
|
+
|
|
32
|
+
interface!
|
|
33
|
+
|
|
34
|
+
sig { abstract.params(input: StringHash).returns(UntypedArray) }
|
|
35
|
+
def call(input); end
|
|
36
|
+
end
|
|
27
37
|
end
|
|
28
38
|
end
|
data/lib/js_routes/version.rb
CHANGED
data/lib/js_routes.rb
CHANGED
|
@@ -39,6 +39,11 @@ module JsRoutes
|
|
|
39
39
|
Instance.new(file: file_name, **opts).generate!
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
+
sig { params(file_name: FileName, opts: T.untyped).void }
|
|
43
|
+
def remove!(file_name = configuration.file, **opts)
|
|
44
|
+
Instance.new(file: file_name, **opts).remove!
|
|
45
|
+
end
|
|
46
|
+
|
|
42
47
|
sig { params(opts: T.untyped).returns(String) }
|
|
43
48
|
def definitions(**opts)
|
|
44
49
|
generate(**opts, module_type: 'DTS',)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: js-routes
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.2.
|
|
4
|
+
version: 2.2.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bogdan Gusiev
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-10-
|
|
11
|
+
date: 2024-10-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: railties
|
|
@@ -150,34 +150,17 @@ dependencies:
|
|
|
150
150
|
- - ">="
|
|
151
151
|
- !ruby/object:Gem::Version
|
|
152
152
|
version: 0.4.0
|
|
153
|
-
description:
|
|
154
|
-
helpers
|
|
153
|
+
description: Exposes all Rails Routes URL helpers as javascript module
|
|
155
154
|
email: agresso@gmail.com
|
|
156
155
|
executables: []
|
|
157
156
|
extensions: []
|
|
158
157
|
extra_rdoc_files:
|
|
159
158
|
- LICENSE.txt
|
|
160
159
|
files:
|
|
161
|
-
- ".document"
|
|
162
|
-
- ".eslintrc.js"
|
|
163
|
-
- ".github/workflows/ci.yml"
|
|
164
|
-
- ".gitignore"
|
|
165
|
-
- ".nvmrc"
|
|
166
|
-
- ".rspec"
|
|
167
|
-
- Appraisals
|
|
168
160
|
- CHANGELOG.md
|
|
169
|
-
- Gemfile
|
|
170
161
|
- LICENSE.txt
|
|
171
|
-
- Rakefile
|
|
172
162
|
- Readme.md
|
|
173
|
-
- VERSION_2_UPGRADE.md
|
|
174
163
|
- app/assets/javascripts/js-routes.js.erb
|
|
175
|
-
- bin/tapioca
|
|
176
|
-
- gemfiles/rails50_sprockets_3.gemfile
|
|
177
|
-
- gemfiles/rails51_sprockets_3.gemfile
|
|
178
|
-
- gemfiles/rails52_sprockets_3.gemfile
|
|
179
|
-
- gemfiles/rails70_sprockets_4.gemfile
|
|
180
|
-
- js-routes.gemspec
|
|
181
164
|
- lib/js-routes.rb
|
|
182
165
|
- lib/js_routes.rb
|
|
183
166
|
- lib/js_routes/configuration.rb
|
|
@@ -197,90 +180,15 @@ files:
|
|
|
197
180
|
- lib/templates/erb.js
|
|
198
181
|
- lib/templates/initializer.rb
|
|
199
182
|
- lib/templates/routes.js.erb
|
|
200
|
-
- package.json
|
|
201
|
-
- sorbet/config
|
|
202
|
-
- sorbet/rbi/annotations/.gitattributes
|
|
203
|
-
- sorbet/rbi/annotations/actionpack.rbi
|
|
204
|
-
- sorbet/rbi/annotations/actionview.rbi
|
|
205
|
-
- sorbet/rbi/annotations/activesupport.rbi
|
|
206
|
-
- sorbet/rbi/annotations/railties.rbi
|
|
207
|
-
- sorbet/rbi/gems/.gitattributes
|
|
208
|
-
- sorbet/rbi/gems/actionpack@7.0.4.1.rbi
|
|
209
|
-
- sorbet/rbi/gems/actionview@7.0.4.1.rbi
|
|
210
|
-
- sorbet/rbi/gems/activesupport@7.0.4.1.rbi
|
|
211
|
-
- sorbet/rbi/gems/appraisal@2.4.1.rbi
|
|
212
|
-
- sorbet/rbi/gems/builder@3.2.4.rbi
|
|
213
|
-
- sorbet/rbi/gems/bump@0.10.0.rbi
|
|
214
|
-
- sorbet/rbi/gems/byebug@11.1.3.rbi
|
|
215
|
-
- sorbet/rbi/gems/coderay@1.1.3.rbi
|
|
216
|
-
- sorbet/rbi/gems/concurrent-ruby@1.2.0.rbi
|
|
217
|
-
- sorbet/rbi/gems/crass@1.0.6.rbi
|
|
218
|
-
- sorbet/rbi/gems/diff-lcs@1.5.0.rbi
|
|
219
|
-
- sorbet/rbi/gems/erubi@1.12.0.rbi
|
|
220
|
-
- sorbet/rbi/gems/i18n@1.12.0.rbi
|
|
221
|
-
- sorbet/rbi/gems/libv8-node@16.10.0.0.rbi
|
|
222
|
-
- sorbet/rbi/gems/loofah@2.19.1.rbi
|
|
223
|
-
- sorbet/rbi/gems/method_source@1.0.0.rbi
|
|
224
|
-
- sorbet/rbi/gems/mini_racer@0.6.3.rbi
|
|
225
|
-
- sorbet/rbi/gems/minitest@5.17.0.rbi
|
|
226
|
-
- sorbet/rbi/gems/netrc@0.11.0.rbi
|
|
227
|
-
- sorbet/rbi/gems/nokogiri@1.14.0.rbi
|
|
228
|
-
- sorbet/rbi/gems/parallel@1.24.0.rbi
|
|
229
|
-
- sorbet/rbi/gems/prettier_print@1.2.1.rbi
|
|
230
|
-
- sorbet/rbi/gems/prism@0.24.0.rbi
|
|
231
|
-
- sorbet/rbi/gems/pry-byebug@3.10.1.rbi
|
|
232
|
-
- sorbet/rbi/gems/pry@0.14.2.rbi
|
|
233
|
-
- sorbet/rbi/gems/racc@1.6.2.rbi
|
|
234
|
-
- sorbet/rbi/gems/rack-test@2.0.2.rbi
|
|
235
|
-
- sorbet/rbi/gems/rack@2.2.6.2.rbi
|
|
236
|
-
- sorbet/rbi/gems/rails-dom-testing@2.0.3.rbi
|
|
237
|
-
- sorbet/rbi/gems/rails-html-sanitizer@1.5.0.rbi
|
|
238
|
-
- sorbet/rbi/gems/railties@7.0.4.1.rbi
|
|
239
|
-
- sorbet/rbi/gems/rake@13.0.6.rbi
|
|
240
|
-
- sorbet/rbi/gems/rbi@0.1.9.rbi
|
|
241
|
-
- sorbet/rbi/gems/rspec-core@3.12.0.rbi
|
|
242
|
-
- sorbet/rbi/gems/rspec-expectations@3.12.2.rbi
|
|
243
|
-
- sorbet/rbi/gems/rspec-mocks@3.12.3.rbi
|
|
244
|
-
- sorbet/rbi/gems/rspec-support@3.12.0.rbi
|
|
245
|
-
- sorbet/rbi/gems/rspec@3.12.0.rbi
|
|
246
|
-
- sorbet/rbi/gems/spoom@1.2.4.rbi
|
|
247
|
-
- sorbet/rbi/gems/sprockets-rails@3.4.2.rbi
|
|
248
|
-
- sorbet/rbi/gems/sprockets@4.2.0.rbi
|
|
249
|
-
- sorbet/rbi/gems/syntax_tree@6.2.0.rbi
|
|
250
|
-
- sorbet/rbi/gems/tapioca@0.12.0.rbi
|
|
251
|
-
- sorbet/rbi/gems/thor@1.2.1.rbi
|
|
252
|
-
- sorbet/rbi/gems/tzinfo@2.0.5.rbi
|
|
253
|
-
- sorbet/rbi/gems/yard-sorbet@0.8.1.rbi
|
|
254
|
-
- sorbet/rbi/gems/yard@0.9.34.rbi
|
|
255
|
-
- sorbet/rbi/gems/zeitwerk@2.6.8.rbi
|
|
256
|
-
- sorbet/rbi/todo.rbi
|
|
257
|
-
- sorbet/tapioca/config.yml
|
|
258
|
-
- sorbet/tapioca/require.rb
|
|
259
|
-
- spec/dummy/app/assets/config/manifest.js
|
|
260
|
-
- spec/dummy/app/assets/javascripts/.gitkeep
|
|
261
|
-
- spec/dummy/config/routes.rb
|
|
262
|
-
- spec/js_routes/default_serializer_spec.rb
|
|
263
|
-
- spec/js_routes/module_types/amd_spec.rb
|
|
264
|
-
- spec/js_routes/module_types/cjs_spec.rb
|
|
265
|
-
- spec/js_routes/module_types/dts/routes.spec.d.ts
|
|
266
|
-
- spec/js_routes/module_types/dts/test.spec.ts
|
|
267
|
-
- spec/js_routes/module_types/dts_spec.rb
|
|
268
|
-
- spec/js_routes/module_types/esm_spec.rb
|
|
269
|
-
- spec/js_routes/module_types/nil_spec.rb
|
|
270
|
-
- spec/js_routes/module_types/umd_spec.rb
|
|
271
|
-
- spec/js_routes/options_spec.rb
|
|
272
|
-
- spec/js_routes/rails_routes_compatibility_spec.rb
|
|
273
|
-
- spec/js_routes/route_specification_spec.rb
|
|
274
|
-
- spec/js_routes/zzz_sprockets_spec.rb
|
|
275
|
-
- spec/spec_helper.rb
|
|
276
|
-
- spec/support/routes.rb
|
|
277
|
-
- spec/tsconfig.json
|
|
278
|
-
- tsconfig.json
|
|
279
|
-
- yarn.lock
|
|
280
183
|
homepage: http://github.com/railsware/js-routes
|
|
281
184
|
licenses:
|
|
282
185
|
- MIT
|
|
283
186
|
metadata:
|
|
187
|
+
bug_tracker_uri: https://github.com/railsware/js-routes/issues
|
|
188
|
+
changelog_uri: https://github.com/railsware/js-routes/blob/v2.2.10/CHANGELOG.md
|
|
189
|
+
documentation_uri: https://github.com/railsware/js-routes
|
|
190
|
+
source_code_uri: https://github.com/railsware/js-routes/tree/v2.2.10/activerecord
|
|
191
|
+
rubygems_mfa_required: 'true'
|
|
284
192
|
github_repo: ssh://github.com/railsware/js-routes
|
|
285
193
|
post_install_message:
|
|
286
194
|
rdoc_options: []
|
data/.document
DELETED
data/.eslintrc.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
root: true,
|
|
3
|
-
extends: [
|
|
4
|
-
'eslint:recommended',
|
|
5
|
-
'plugin:@typescript-eslint/eslint-recommended',
|
|
6
|
-
'plugin:@typescript-eslint/recommended',
|
|
7
|
-
'prettier',
|
|
8
|
-
],
|
|
9
|
-
parser: '@typescript-eslint/parser',
|
|
10
|
-
plugins: ['@typescript-eslint'],
|
|
11
|
-
rules: {
|
|
12
|
-
'@typescript-eslint/ban-types': 'off',
|
|
13
|
-
'@typescript-eslint/no-explicit-any': 'off'
|
|
14
|
-
},
|
|
15
|
-
};
|
data/.github/workflows/ci.yml
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
name: CI
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- master
|
|
7
|
-
pull_request:
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
build:
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
strategy:
|
|
13
|
-
matrix:
|
|
14
|
-
ruby: ["2.7"]
|
|
15
|
-
gemfile:
|
|
16
|
-
- gemfiles/rails50_sprockets_3.gemfile
|
|
17
|
-
- gemfiles/rails51_sprockets_3.gemfile
|
|
18
|
-
- gemfiles/rails52_sprockets_3.gemfile
|
|
19
|
-
- gemfiles/rails70_sprockets_4.gemfile
|
|
20
|
-
|
|
21
|
-
env:
|
|
22
|
-
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
|
23
|
-
steps:
|
|
24
|
-
- uses: actions/checkout@v2
|
|
25
|
-
- uses: ruby/setup-ruby@v1
|
|
26
|
-
with:
|
|
27
|
-
ruby-version: ${{ matrix.ruby }}
|
|
28
|
-
- uses: actions/setup-node@v3
|
|
29
|
-
with:
|
|
30
|
-
node-version: "16"
|
|
31
|
-
- name: install dependencies
|
|
32
|
-
run: |
|
|
33
|
-
bundle install --jobs 3 --retry 3
|
|
34
|
-
yarn install
|
|
35
|
-
- name: test
|
|
36
|
-
run: bundle exec rake spec
|
data/.gitignore
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
# rcov generated
|
|
2
|
-
coverage
|
|
3
|
-
|
|
4
|
-
# rdoc generated
|
|
5
|
-
rdoc
|
|
6
|
-
|
|
7
|
-
# yard generated
|
|
8
|
-
doc
|
|
9
|
-
.yardoc
|
|
10
|
-
log
|
|
11
|
-
|
|
12
|
-
# bundler
|
|
13
|
-
.bundle
|
|
14
|
-
|
|
15
|
-
# jeweler generated
|
|
16
|
-
pkg
|
|
17
|
-
tmp
|
|
18
|
-
|
|
19
|
-
node_modules
|
|
20
|
-
|
|
21
|
-
# Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
|
|
22
|
-
#
|
|
23
|
-
# * Create a file at ~/.gitignore
|
|
24
|
-
# * Include files you want ignored
|
|
25
|
-
# * Run: git config --global core.excludesfile ~/.gitignore
|
|
26
|
-
#
|
|
27
|
-
# After doing this, these files will be ignored in all your git projects,
|
|
28
|
-
# saving you from having to 'pollute' every project you touch with them
|
|
29
|
-
#
|
|
30
|
-
# Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
|
|
31
|
-
#
|
|
32
|
-
# For MacOS:
|
|
33
|
-
#
|
|
34
|
-
#.DS_Store
|
|
35
|
-
|
|
36
|
-
# For TextMate
|
|
37
|
-
#*.tmproj
|
|
38
|
-
#tmtags
|
|
39
|
-
|
|
40
|
-
# For emacs:
|
|
41
|
-
#*~
|
|
42
|
-
#\#*
|
|
43
|
-
#.\#*
|
|
44
|
-
|
|
45
|
-
# For vim:
|
|
46
|
-
#*.swp
|
|
47
|
-
|
|
48
|
-
# For redcar:
|
|
49
|
-
#.redcar
|
|
50
|
-
|
|
51
|
-
# For rubinius:
|
|
52
|
-
#*.rbc
|
|
53
|
-
.rvmrc
|
|
54
|
-
.ruby-version
|
|
55
|
-
|
|
56
|
-
Gemfile.lock
|
|
57
|
-
gemfiles/*.lock
|
|
58
|
-
|
|
59
|
-
.DS_Store
|
|
60
|
-
|
|
61
|
-
/spec/dummy/app/assets/javascripts/routes.js
|
|
62
|
-
/spec/dummy/logs
|
|
63
|
-
/spec/dummy/tmp
|
|
64
|
-
node_modules
|
|
65
|
-
|
data/.nvmrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
14
|
data/.rspec
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
--color
|
data/Appraisals
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
def define_appraisal(rails, version, sprockets)
|
|
2
|
-
sprockets.each do |sprocket|
|
|
3
|
-
appraise "#{rails}-sprockets-#{sprocket}" do
|
|
4
|
-
gem "railties", "~> #{version}"
|
|
5
|
-
gem "sprockets", "~> #{sprocket}.0"
|
|
6
|
-
end
|
|
7
|
-
end
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
[
|
|
11
|
-
[:rails50, '5.0.5', [3]],
|
|
12
|
-
[:rails51, '5.1.3', [3]],
|
|
13
|
-
[:rails52, '5.2.3', [3]],
|
|
14
|
-
[:rails70, '7.0.3.1', [4]]
|
|
15
|
-
].each do |name, version, sprockets|
|
|
16
|
-
define_appraisal(name, version, sprockets)
|
|
17
|
-
end
|
data/Gemfile
DELETED
data/Rakefile
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
require 'rubygems'
|
|
3
|
-
require 'bundler'
|
|
4
|
-
begin
|
|
5
|
-
Bundler.setup(:default, :development)
|
|
6
|
-
rescue Bundler::BundlerError => e
|
|
7
|
-
$stderr.puts e.message
|
|
8
|
-
$stderr.puts "Run `bundle install` to install missing gems"
|
|
9
|
-
exit e.status_code
|
|
10
|
-
end
|
|
11
|
-
require 'bundler/gem_tasks'
|
|
12
|
-
require 'rspec/core'
|
|
13
|
-
require 'rspec/core/rake_task'
|
|
14
|
-
require 'appraisal'
|
|
15
|
-
require 'rails/version'
|
|
16
|
-
if Rails.version < "6.1"
|
|
17
|
-
load "rails/tasks/routes.rake"
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
RSpec::Core::RakeTask.new(:spec)
|
|
21
|
-
|
|
22
|
-
task :test_all => :appraisal # test all rails
|
|
23
|
-
|
|
24
|
-
task :default => :spec
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
namespace :spec do
|
|
28
|
-
desc "Print all routes defined in test env"
|
|
29
|
-
task :routes do
|
|
30
|
-
require './spec/spec_helper'
|
|
31
|
-
require 'action_dispatch/routing/inspector'
|
|
32
|
-
draw_routes
|
|
33
|
-
all_routes = Rails.application.routes.routes
|
|
34
|
-
inspector = ActionDispatch::Routing::RoutesInspector.new(all_routes)
|
|
35
|
-
puts inspector.format(ActionDispatch::Routing::ConsoleFormatter::Sheet.new)
|
|
36
|
-
end
|
|
37
|
-
end
|
data/VERSION_2_UPGRADE.md
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
## Version 2.0 upgrade notes
|
|
2
|
-
|
|
3
|
-
### Using ESM module by default
|
|
4
|
-
|
|
5
|
-
New version of JsRoutes doesn't try to guess your javascript environment module system because JS has generated a ton of legacy module systems in the past.
|
|
6
|
-
[ESM+Webpacker](/Readme.md#webpacker) upgrade is recommended.
|
|
7
|
-
|
|
8
|
-
However, if you don't want to follow that pass, specify `module_type` configuration option instead based on module system available in your JS environment.
|
|
9
|
-
Here are supported values:
|
|
10
|
-
|
|
11
|
-
* CJS
|
|
12
|
-
* UMD
|
|
13
|
-
* AMD
|
|
14
|
-
* ESM
|
|
15
|
-
* nil
|
|
16
|
-
|
|
17
|
-
[Explaination Article](https://dev.to/iggredible/what-the-heck-are-cjs-amd-umd-and-esm-ikm)
|
|
18
|
-
|
|
19
|
-
If you don't want to use any JS module system and make routes available via a **global variable**, specify `nil` as a `module_type` and use `namespace` option:
|
|
20
|
-
|
|
21
|
-
``` ruby
|
|
22
|
-
JsRoutes.setup do |config|
|
|
23
|
-
config.module_type = nil
|
|
24
|
-
config.namespace = "Routes"
|
|
25
|
-
end
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
### JSDoc comment
|
|
29
|
-
|
|
30
|
-
New version of js-routes generates function comment in the [JSDoc](https://jsdoc.app) format.
|
|
31
|
-
If you have any problems with that, you can disable it like this:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
``` ruby
|
|
35
|
-
JsRoutes.setup do |config|
|
|
36
|
-
config.documentation = false
|
|
37
|
-
end
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### `required_params` renamed
|
|
41
|
-
|
|
42
|
-
In case you are using `required_params` property, it is now renamed and converted to a method:
|
|
43
|
-
|
|
44
|
-
``` javascript
|
|
45
|
-
// Old style
|
|
46
|
-
Routes.post_path.required_params // => ['id']
|
|
47
|
-
// New style
|
|
48
|
-
Routes.post_path.requiredParams() // => ['id']
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### ParameterMissing error rework
|
|
52
|
-
|
|
53
|
-
`ParameterMissing` is renamed to `ParametersMissing` error and now list all missing parameters instead of just first encountered in its message. Missing parameters are now available via `ParametersMissing#keys` property.
|
|
54
|
-
|
|
55
|
-
``` javascript
|
|
56
|
-
try {
|
|
57
|
-
return Routes.inbox_path();
|
|
58
|
-
} catch(error) {
|
|
59
|
-
if (error.name === 'ParametersMissing') {
|
|
60
|
-
console.warn(`Missing route keys ${error.keys.join(', ')}. Ignoring.`);
|
|
61
|
-
return "#";
|
|
62
|
-
} else {
|
|
63
|
-
throw error;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
```
|
data/bin/tapioca
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
# frozen_string_literal: true
|
|
3
|
-
|
|
4
|
-
#
|
|
5
|
-
# This file was generated by Bundler.
|
|
6
|
-
#
|
|
7
|
-
# The application 'tapioca' is installed as part of a gem, and
|
|
8
|
-
# this file is here to facilitate running it.
|
|
9
|
-
#
|
|
10
|
-
|
|
11
|
-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
|
|
12
|
-
|
|
13
|
-
bundle_binstub = File.expand_path("bundle", __dir__)
|
|
14
|
-
|
|
15
|
-
if File.file?(bundle_binstub)
|
|
16
|
-
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
|
|
17
|
-
load(bundle_binstub)
|
|
18
|
-
else
|
|
19
|
-
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
|
20
|
-
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
require "rubygems"
|
|
25
|
-
require "bundler/setup"
|
|
26
|
-
|
|
27
|
-
load Gem.bin_path("tapioca", "tapioca")
|