js-routes 2.0.0 → 2.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 86ed2a6e4f90ea3c7bbc91836148b23121acbb21c59e4b26e55f0925a2d37fce
4
- data.tar.gz: 485241d5aa3e009545a78113c49e2781be677cb4ddfe91286329f325f8a6b9dc
3
+ metadata.gz: c9a63dedd682c2cf4330ffc7c4ce012845e35fae3c315846a2ba5ef52b980ba2
4
+ data.tar.gz: 5e62c6831d3799376fad6a8e6e433488c4674bc7d7ac4917fe9f9e0a0ca9f03d
5
5
  SHA512:
6
- metadata.gz: 75844cdc35fc7cbf506fdd40eb00bc002c8bdc35397607943d28519572ae63f3f374cd249c4f50c218a979ffbbafe3938d5d2de0d1f03505e00549b9483a7ae6
7
- data.tar.gz: ffb6920c23e81c18cc4c6e1476ae61f60801973e93583cd481ef6cd9f45171005de01124cc62aefc7862c2451cdbde31787efeeb8d2fb2e9dab223b1f5964230
6
+ metadata.gz: 2ee773fcb0b7ea746248c06d6fac1365a23ab732ff16620d555bb4d035e9661187d02fb093a127a9d240e0621976cbc6680996c22e065bd70e7c8d2318e37753
7
+ data.tar.gz: 5a7e0d7fc1b1af56c4ee72a3b8cdef0d6b42671425c35b60410ffe2b62e63779deeb733ca5293fc62507b224094686de436d763f7b49ffc29248b1fc2e653d71
data/.gitignore CHANGED
@@ -14,6 +14,7 @@ log
14
14
 
15
15
  # jeweler generated
16
16
  pkg
17
+ tmp
17
18
 
18
19
  node_modules
19
20
 
data/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  ## master
2
2
 
3
+ ## v2.0.5
4
+
5
+ * Fixed backward compatibility issue [#276](https://github.com/railsware/js-routes/issues/276)
6
+
7
+ ## v2.0.4
8
+
9
+ * Fixed backward compatibility issue [#275](https://github.com/railsware/js-routes/issues/275)
10
+
11
+ ## v2.0.3
12
+
13
+ * Fixed backward compatibility issue [#275](https://github.com/railsware/js-routes/issues/275)
14
+
15
+ ## v2.0.2
16
+
17
+ * Fixed backward compatibility issue [#274](https://github.com/railsware/js-routes/issues/274)
18
+
19
+ ## v2.0.1
20
+
21
+ * Fixed backward compatibility issue [#272](https://github.com/railsware/js-routes/issues/272)
22
+
3
23
  ## v2.0.0
4
24
 
5
25
  Version 2.0 has some breaking changes.
data/Rakefile CHANGED
@@ -12,7 +12,10 @@ require 'bundler/gem_tasks'
12
12
  require 'rspec/core'
13
13
  require 'rspec/core/rake_task'
14
14
  require 'appraisal'
15
- load "rails/tasks/routes.rake"
15
+ require 'rails/version'
16
+ if Rails.version < "6.1"
17
+ load "rails/tasks/routes.rake"
18
+ end
16
19
 
17
20
  RSpec::Core::RakeTask.new(:spec)
18
21
 
@@ -29,6 +32,6 @@ namespace :spec do
29
32
  draw_routes
30
33
  all_routes = Rails.application.routes.routes
31
34
  inspector = ActionDispatch::Routing::RoutesInspector.new(all_routes)
32
- puts inspector.format(ActionDispatch::Routing::ConsoleFormatter.new, ENV['CONTROLLER'])
35
+ puts inspector.format(ActionDispatch::Routing::ConsoleFormatter::Sheet.new)
33
36
  end
34
37
  end
data/Readme.md CHANGED
@@ -71,7 +71,7 @@ module.exports = {
71
71
  }
72
72
  ```
73
73
 
74
- Enable `erb` extension in `config/webpacker/environment.js`:
74
+ Enable `erb` extension in `config/webpack/environment.js`:
75
75
 
76
76
  ``` javascript
77
77
  const erb = require('./loaders/erb')
@@ -198,13 +198,13 @@ Options to configure routes formatting. These options are available both in Ruby
198
198
  In case you need multiple route files for different parts of your application, you have to create the files manually.
199
199
  If your application has an `admin` and an `application` namespace for example:
200
200
 
201
- ```
202
- # app/javascript/admin/routes.js.erb
201
+ ``` erb
202
+ // app/javascript/admin/routes.js.erb
203
203
  <%= JsRoutes.generate(include: /admin/) %>
204
204
  ```
205
205
 
206
- ```
207
- # app/javascript/customer/routes.js.erb
206
+ ``` erb
207
+ // app/javascript/customer/routes.js.erb
208
208
  <%= JsRoutes.generate(exclude: /admin/) %>
209
209
  ```
210
210
 
data/lib/js_routes.rb CHANGED
@@ -45,7 +45,6 @@ class JsRoutes
45
45
  DOT: 8
46
46
  } #:nodoc:
47
47
 
48
- LAST_OPTIONS_KEY = "options".freeze #:nodoc:
49
48
  FILTERED_DEFAULT_PARTS = [:controller, :action] #:nodoc:
50
49
  URL_OPTIONS = [:protocol, :domain, :host, :port, :subdomain] #:nodoc:
51
50
 
@@ -170,6 +169,10 @@ class JsRoutes
170
169
  @configuration.application
171
170
  end
172
171
 
172
+ def json(string)
173
+ self.class.json(string)
174
+ end
175
+
173
176
  def named_routes
174
177
  application.routes.named_routes.to_a
175
178
  end
@@ -195,7 +198,7 @@ class JsRoutes
195
198
 
196
199
  def routes_list
197
200
  named_routes.sort_by(&:first).flat_map do |_, route|
198
- build_routes_if_match(route) + mounted_app_routes(route)
201
+ route_helpers_if_match(route) + mounted_app_routes(route)
199
202
  end.compact
200
203
  end
201
204
 
@@ -204,7 +207,7 @@ class JsRoutes
204
207
  if rails_engine_app.respond_to?(:superclass) &&
205
208
  rails_engine_app.superclass == Rails::Engine && !route.path.anchored
206
209
  rails_engine_app.routes.named_routes.flat_map do |_, engine_route|
207
- build_routes_if_match(engine_route, route)
210
+ route_helpers_if_match(engine_route, route)
208
211
  end
209
212
  else
210
213
  []
@@ -221,122 +224,150 @@ class JsRoutes
221
224
  end
222
225
  end
223
226
 
224
- def build_routes_if_match(route, parent_route = nil)
225
- if any_match?(route, parent_route, @configuration[:exclude]) ||
226
- !any_match?(route, parent_route, @configuration[:include])
227
- []
228
- else
229
- name = [parent_route.try(:name), route.name].compact
230
- parent_spec = parent_route.try(:path).try(:spec)
231
- route_arguments = route_js_arguments(route, parent_spec)
232
- return [false, true].map do |absolute|
233
- route_js(name, parent_spec, route, route_arguments, absolute)
227
+ def route_helpers_if_match(route, parent_route = nil)
228
+ JsRoute.new(@configuration, route, parent_route).helpers
229
+ end
230
+
231
+ class JsRoute #:nodoc:
232
+ attr_reader :configuration, :route, :parent_route
233
+
234
+ def initialize(configuration, route, parent_route = nil)
235
+ @configuration = configuration
236
+ @route = route
237
+ @parent_route = parent_route
238
+ end
239
+
240
+ def helpers
241
+ unless match_configuration?
242
+ []
243
+ else
244
+ [false, true].map do |absolute|
245
+ absolute && !@configuration[:url_links] ?
246
+ nil : [ documentation, helper_name(absolute), body(absolute) ]
247
+ end
234
248
  end
235
249
  end
236
- end
237
250
 
238
- def any_match?(route, parent_route, matchers)
239
- full_route = [parent_route.try(:name), route.name].compact.join('_')
251
+ def body(absolute)
252
+ "__jsr.r(#{arguments(absolute).join(', ')})"
253
+ end
240
254
 
241
- matchers = Array(matchers)
242
- matchers.any? { |regex| full_route =~ regex }
243
- end
255
+ def arguments(absolute)
256
+ absolute ? base_arguments + [json(true)] : base_arguments
257
+ end
244
258
 
245
- def route_js(name_parts, parent_spec, route, route_arguments, absolute)
246
- if absolute
247
- return nil unless @configuration[:url_links]
248
- route_arguments = route_arguments + [json(true)]
259
+ def match_configuration?
260
+ !match?(@configuration[:exclude]) && match?(@configuration[:include])
261
+ end
262
+
263
+ def base_name
264
+ @base_name ||= parent_route ?
265
+ [parent_route.name, route.name].join('_') : route.name
266
+ end
267
+
268
+ def parent_spec
269
+ parent_route&.path&.spec
270
+ end
271
+
272
+ def spec
273
+ route.path.spec
249
274
  end
250
- name_suffix = absolute ? :url : @configuration[:compact] ? nil : :path
251
- name = generate_route_name(name_parts, name_suffix)
252
- body = "__jsr.r(#{route_arguments.join(', ')})"
253
- comment = documentation(route, parent_spec)
254
- [ comment, name, body ]
255
- end
256
275
 
257
- def documentation(route, parent_spec)
258
- return nil unless @configuration[:documentation]
259
- <<-JS
276
+ def json(value)
277
+ JsRoutes.json(value)
278
+ end
279
+
280
+ def helper_name(absolute)
281
+ suffix = absolute ? :url : @configuration[:compact] ? nil : :path
282
+ apply_case(base_name, suffix)
283
+ end
284
+
285
+ def documentation
286
+ return nil unless @configuration[:documentation]
287
+ <<-JS
260
288
  /**
261
289
  * Generates rails route to
262
- * #{parent_spec}#{route.path.spec}#{build_params(route.required_parts)}
290
+ * #{parent_spec}#{spec}#{documentation_params}
263
291
  * @param {object | undefined} options
264
292
  * @returns {string} route path
265
293
  */
266
294
  JS
267
- end
295
+ end
268
296
 
269
- def route_js_arguments(route, parent_spec)
270
- required_parts = route.required_parts
271
- parts_table = {}
272
- route.parts.each do |part, hash|
273
- parts_table[part] ||= {}
274
- if required_parts.include?(part)
275
- # Using shortened keys to reduce js file size
276
- parts_table[part][:r] = true
277
- end
297
+ def required_parts
298
+ route.required_parts
278
299
  end
279
- route.defaults.each do |part, value|
280
- if FILTERED_DEFAULT_PARTS.exclude?(part) &&
281
- URL_OPTIONS.include?(part) || parts_table[part]
300
+
301
+ protected
302
+
303
+ def base_arguments
304
+ return @base_arguments if defined?(@base_arguments)
305
+ parts_table = {}
306
+ route.parts.each do |part, hash|
282
307
  parts_table[part] ||= {}
283
- # Using shortened keys to reduce js file size
284
- parts_table[part][:d] = value
308
+ if required_parts.include?(part)
309
+ # Using shortened keys to reduce js file size
310
+ parts_table[part][:r] = true
311
+ end
312
+ end
313
+ route.defaults.each do |part, value|
314
+ if FILTERED_DEFAULT_PARTS.exclude?(part) &&
315
+ URL_OPTIONS.include?(part) || parts_table[part]
316
+ parts_table[part] ||= {}
317
+ # Using shortened keys to reduce js file size
318
+ parts_table[part][:d] = value
319
+ end
320
+ end
321
+ @base_arguments = [
322
+ parts_table, serialize(spec, parent_spec)
323
+ ].map do |argument|
324
+ json(argument)
285
325
  end
286
326
  end
287
- [
288
- parts_table,
289
- serialize(route.path.spec, parent_spec)
290
- ].map do |argument|
291
- json(argument)
292
- end
293
- end
294
-
295
- def generate_route_name(*parts)
296
- apply_case(parts.compact.join('_'))
297
- end
298
327
 
299
- def json(string)
300
- self.class.json(string)
301
- end
328
+ def documentation_params
329
+ required_parts.map do |param|
330
+ "\n * @param {any} #{apply_case(param)}"
331
+ end.join
332
+ end
302
333
 
303
- def apply_case(value)
304
- @configuration[:camel_case] ? value.to_s.camelize(:lower) : value
305
- end
334
+ def match?(matchers)
335
+ Array(matchers).any? { |regex| base_name =~ regex }
336
+ end
306
337
 
307
- def build_params(required_parts)
308
- required_parts.map do |param|
309
- "\n * @param {any} #{apply_case(param)}"
310
- end.join
311
- end
338
+ def apply_case(*values)
339
+ value = values.compact.map(&:to_s).join('_')
340
+ @configuration[:camel_case] ? value.camelize(:lower) : value
341
+ end
312
342
 
313
- # This function serializes Journey route into JSON structure
314
- # We do not use Hash for human readable serialization
315
- # And preffer Array serialization because it is shorter.
316
- # Routes.js file will be smaller.
317
- def serialize(spec, parent_spec=nil)
318
- return nil unless spec
319
- # Rails 4 globbing requires * removal
320
- return spec.tr(':*', '') if spec.is_a?(String)
321
-
322
- result = serialize_spec(spec, parent_spec)
323
- if parent_spec && result[1].is_a?(String)
324
- result = [
325
- # We encode node symbols as integer
326
- # to reduce the routes.js file size
327
- NODE_TYPES[:CAT],
328
- serialize_spec(parent_spec),
329
- result
330
- ]
331
- end
332
- result
333
- end
343
+ # This function serializes Journey route into JSON structure
344
+ # We do not use Hash for human readable serialization
345
+ # And preffer Array serialization because it is shorter.
346
+ # Routes.js file will be smaller.
347
+ def serialize(spec, parent_spec=nil)
348
+ return nil unless spec
349
+ # Rails 4 globbing requires * removal
350
+ return spec.tr(':*', '') if spec.is_a?(String)
351
+
352
+ result = serialize_spec(spec, parent_spec)
353
+ if parent_spec && result[1].is_a?(String) && parent_spec.type != :SLASH
354
+ result = [
355
+ # We encode node symbols as integer
356
+ # to reduce the routes.js file size
357
+ NODE_TYPES[:CAT],
358
+ serialize_spec(parent_spec),
359
+ result
360
+ ]
361
+ end
362
+ result
363
+ end
334
364
 
335
- def serialize_spec(spec, parent_spec = nil)
336
- [
337
- NODE_TYPES[spec.type],
338
- serialize(spec.left, parent_spec),
339
- spec.respond_to?(:right) ? serialize(spec.right) : nil
340
- ].compact
365
+ def serialize_spec(spec, parent_spec = nil)
366
+ [
367
+ NODE_TYPES[spec.type],
368
+ serialize(spec.left, parent_spec),
369
+ spec.respond_to?(:right) ? serialize(spec.right) : nil
370
+ ].compact
371
+ end
341
372
  end
342
373
  end
@@ -1,3 +1,3 @@
1
1
  class JsRoutes
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.5"
3
3
  end
data/lib/routes.js CHANGED
@@ -145,7 +145,7 @@ RubyVariables.WRAPPER((that) => {
145
145
  }
146
146
  path_identifier(object) {
147
147
  const result = this.unwrap_path_identifier(object);
148
- return this.is_nullable(result) ? "" : "" + result;
148
+ return this.is_nullable(result) || result === false ? "" : "" + result;
149
149
  }
150
150
  unwrap_path_identifier(object) {
151
151
  let result = object;
@@ -188,14 +188,14 @@ RubyVariables.WRAPPER((that) => {
188
188
  ...default_options,
189
189
  ...options,
190
190
  };
191
- const url_parameters = {};
191
+ const keyword_parameters = {};
192
192
  const query_parameters = {};
193
193
  for (const key in options) {
194
194
  if (!hasProp(options, key))
195
195
  continue;
196
196
  const value = options[key];
197
197
  if (this.is_reserved_option(key)) {
198
- url_parameters[key] = value;
198
+ keyword_parameters[key] = value;
199
199
  }
200
200
  else {
201
201
  if (!this.is_nullable(value) &&
@@ -208,32 +208,35 @@ RubyVariables.WRAPPER((that) => {
208
208
  let i = 0;
209
209
  for (const part of route_parts) {
210
210
  if (i < args.length) {
211
+ const value = args[i];
211
212
  if (!hasProp(parts_options, part)) {
212
- query_parameters[part] = args[i];
213
+ query_parameters[part] = value;
213
214
  ++i;
214
215
  }
215
216
  }
216
217
  }
217
- return { url_parameters, query_parameters };
218
+ return { keyword_parameters, query_parameters };
218
219
  }
219
- build_route(parts, required_params, default_options, route, full_url, args) {
220
- const { url_parameters, query_parameters } = this.partition_parameters(parts, required_params, default_options, args);
220
+ build_route(parts, required_params, default_options, route, absolute, args) {
221
+ const { keyword_parameters, query_parameters, } = this.partition_parameters(parts, required_params, default_options, args);
221
222
  const missing_params = required_params.filter((param) => !hasProp(query_parameters, param) ||
222
223
  this.is_nullable(query_parameters[param]));
223
224
  if (missing_params.length) {
224
225
  throw new ParametersMissing(...missing_params);
225
226
  }
226
227
  let result = this.get_prefix() + this.visit(route, query_parameters);
227
- if (url_parameters.trailing_slash) {
228
+ if (keyword_parameters.trailing_slash) {
228
229
  result = result.replace(/(.*?)[/]?$/, "$1/");
229
230
  }
230
231
  const url_params = this.serialize(query_parameters);
231
232
  if (url_params.length) {
232
233
  result += "?" + url_params;
233
234
  }
234
- result += url_parameters.anchor ? "#" + url_parameters.anchor : "";
235
- if (full_url) {
236
- result = this.route_url(url_parameters) + result;
235
+ result += keyword_parameters.anchor
236
+ ? "#" + keyword_parameters.anchor
237
+ : "";
238
+ if (absolute) {
239
+ result = this.route_url(keyword_parameters) + result;
237
240
  }
238
241
  return result;
239
242
  }
@@ -265,12 +268,18 @@ RubyVariables.WRAPPER((that) => {
265
268
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
266
269
  [_type, left, right], parameters, optional) {
267
270
  const left_part = this.visit(left, parameters, optional);
268
- const right_part = this.visit(right, parameters, optional);
271
+ let right_part = this.visit(right, parameters, optional);
269
272
  if (optional &&
270
273
  ((this.is_optional_node(left[0]) && !left_part) ||
271
274
  (this.is_optional_node(right[0]) && !right_part))) {
272
275
  return "";
273
276
  }
277
+ // if left_part ends on '/' and right_part starts on '/'
278
+ if (left_part[left_part.length - 1] === "/" && right_part[0] === "/") {
279
+ // strip slash from right_part
280
+ // to prevent double slash
281
+ right_part = right_part.substring(1);
282
+ }
274
283
  return left_part + right_part;
275
284
  }
276
285
  visit_symbol(
@@ -332,8 +341,8 @@ RubyVariables.WRAPPER((that) => {
332
341
  if (this.is_array(value)) {
333
342
  value = value.join("/");
334
343
  }
335
- value = this.path_identifier(value);
336
- return DeprecatedGlobbingBehavior ? "" + value : encodeURI("" + value);
344
+ const result = this.path_identifier(value);
345
+ return DeprecatedGlobbingBehavior ? result : encodeURI(result);
337
346
  }
338
347
  get_prefix() {
339
348
  const prefix = this.configuration.prefix;
@@ -341,7 +350,7 @@ RubyVariables.WRAPPER((that) => {
341
350
  ? prefix.substring(0, prefix.length - 1)
342
351
  : prefix;
343
352
  }
344
- route(parts_table, route_spec, full_url = false) {
353
+ route(parts_table, route_spec, absolute = false) {
345
354
  const required_params = [];
346
355
  const parts = [];
347
356
  const default_options = {};
@@ -355,7 +364,7 @@ RubyVariables.WRAPPER((that) => {
355
364
  }
356
365
  }
357
366
  const result = (...args) => {
358
- return this.build_route(parts, required_params, default_options, route_spec, full_url, args);
367
+ return this.build_route(parts, required_params, default_options, route_spec, absolute, args);
359
368
  };
360
369
  result.requiredParams = () => required_params;
361
370
  result.toString = () => {
@@ -405,7 +414,8 @@ RubyVariables.WRAPPER((that) => {
405
414
  }
406
415
  }
407
416
  is_object(value) {
408
- return typeof value === "object" && "" + value === "[object Object]";
417
+ return (typeof value === "object" &&
418
+ Object.prototype.toString.call(value) === "[object Object]");
409
419
  }
410
420
  is_array(object) {
411
421
  return object instanceof Array;
@@ -456,10 +466,9 @@ RubyVariables.WRAPPER((that) => {
456
466
  }
457
467
  const Utils = new UtilsClass();
458
468
  // We want this helper name to be short
459
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
460
469
  const __jsr = {
461
- r(parts_table, route_spec, full_url) {
462
- return Utils.route(parts_table, route_spec, full_url);
470
+ r(parts_table, route_spec, absolute) {
471
+ return Utils.route(parts_table, route_spec, absolute);
463
472
  },
464
473
  };
465
474
  const result = {
data/lib/routes.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"routes.js","sourceRoot":"","sources":["routes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA0DH,aAAa,CAAC,OAAO,CACnB,CAAC,IAAa,EAAwB,EAAE;IACtC,MAAM,OAAO,GAAG,CAAC,KAAc,EAAE,GAAW,EAAE,EAAE,CAC9C,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACnD,IAAK,SASJ;IATD,WAAK,SAAS;QACZ,2CAAS,CAAA;QACT,uCAA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;IACvC,MAAM,KAAK,GAAG;QACZ,CAAC,CACC,WAAuB,EACvB,UAAqB,EACrB,QAAkB;YAElB,OAAO,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;QACxD,CAAC;KACF,CAAC;IAEF,MAAM,MAAM,GAAG;QACb,GAAG,KAAK;QACR,SAAS,EAAE,CAAC,MAA8B,EAAE,EAAE;YAC5C,OAAO,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACjC,CAAC;QACD,MAAM,EAAE,GAAkB,EAAE;YAC1B,OAAO,KAAK,CAAC,MAAM,EAAE,CAAC;QACxB,CAAC;QACD,SAAS,EAAE,CAAC,MAAe,EAAU,EAAE;YACrC,OAAO,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACjC,CAAC;QACD,GAAG,aAAa,CAAC,aAAa;KAC/B,CAAC;IAEF,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,aAAa,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAEvD,IAAI,aAAa,CAAC,WAAW,EAAE;QAC7B,KAAK,CAAC,aAAa,CAAC,aAAa,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;KACxD;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CACF,CAAC,IAAI,CAAC,CAAC"}
data/lib/routes.ts CHANGED
@@ -248,7 +248,7 @@ RubyVariables.WRAPPER(
248
248
 
249
249
  path_identifier(object: unknown): string {
250
250
  const result = this.unwrap_path_identifier(object);
251
- return this.is_nullable(result) ? "" : "" + result;
251
+ return this.is_nullable(result) || result === false ? "" : "" + result;
252
252
  }
253
253
 
254
254
  unwrap_path_identifier(object: any): unknown {
@@ -274,7 +274,7 @@ RubyVariables.WRAPPER(
274
274
  default_options: RouteParameters,
275
275
  call_arguments: RouteParameter[]
276
276
  ): {
277
- url_parameters: KeywordUrlOptions;
277
+ keyword_parameters: KeywordUrlOptions;
278
278
  query_parameters: RouteParameters;
279
279
  } {
280
280
  // eslint-disable-next-line prefer-const
@@ -301,13 +301,13 @@ RubyVariables.WRAPPER(
301
301
  ...options,
302
302
  };
303
303
 
304
- const url_parameters: KeywordUrlOptions = {};
304
+ const keyword_parameters: KeywordUrlOptions = {};
305
305
  const query_parameters: RouteParameters = {};
306
306
  for (const key in options) {
307
307
  if (!hasProp(options, key)) continue;
308
308
  const value = options[key];
309
309
  if (this.is_reserved_option(key)) {
310
- url_parameters[key] = value as any;
310
+ keyword_parameters[key] = value as any;
311
311
  } else {
312
312
  if (
313
313
  !this.is_nullable(value) &&
@@ -321,23 +321,27 @@ RubyVariables.WRAPPER(
321
321
  let i = 0;
322
322
  for (const part of route_parts) {
323
323
  if (i < args.length) {
324
+ const value = args[i];
324
325
  if (!hasProp(parts_options, part)) {
325
- query_parameters[part] = args[i];
326
+ query_parameters[part] = value;
326
327
  ++i;
327
328
  }
328
329
  }
329
330
  }
330
- return { url_parameters, query_parameters };
331
+ return { keyword_parameters, query_parameters };
331
332
  }
332
333
  build_route(
333
334
  parts: string[],
334
335
  required_params: string[],
335
336
  default_options: RouteParameters,
336
337
  route: RouteTree,
337
- full_url: boolean,
338
+ absolute: boolean,
338
339
  args: RouteParameter[]
339
340
  ): string {
340
- const { url_parameters, query_parameters } = this.partition_parameters(
341
+ const {
342
+ keyword_parameters,
343
+ query_parameters,
344
+ } = this.partition_parameters(
341
345
  parts,
342
346
  required_params,
343
347
  default_options,
@@ -352,16 +356,18 @@ RubyVariables.WRAPPER(
352
356
  throw new ParametersMissing(...missing_params);
353
357
  }
354
358
  let result = this.get_prefix() + this.visit(route, query_parameters);
355
- if (url_parameters.trailing_slash) {
359
+ if (keyword_parameters.trailing_slash) {
356
360
  result = result.replace(/(.*?)[/]?$/, "$1/");
357
361
  }
358
362
  const url_params = this.serialize(query_parameters);
359
363
  if (url_params.length) {
360
364
  result += "?" + url_params;
361
365
  }
362
- result += url_parameters.anchor ? "#" + url_parameters.anchor : "";
363
- if (full_url) {
364
- result = this.route_url(url_parameters) + result;
366
+ result += keyword_parameters.anchor
367
+ ? "#" + keyword_parameters.anchor
368
+ : "";
369
+ if (absolute) {
370
+ result = this.route_url(keyword_parameters) + result;
365
371
  }
366
372
  return result;
367
373
  }
@@ -404,7 +410,7 @@ RubyVariables.WRAPPER(
404
410
  optional: boolean
405
411
  ): string {
406
412
  const left_part = this.visit(left, parameters, optional);
407
- const right_part = this.visit(right, parameters, optional);
413
+ let right_part = this.visit(right, parameters, optional);
408
414
  if (
409
415
  optional &&
410
416
  ((this.is_optional_node(left[0]) && !left_part) ||
@@ -412,6 +418,12 @@ RubyVariables.WRAPPER(
412
418
  ) {
413
419
  return "";
414
420
  }
421
+ // if left_part ends on '/' and right_part starts on '/'
422
+ if (left_part[left_part.length - 1] === "/" && right_part[0] === "/") {
423
+ // strip slash from right_part
424
+ // to prevent double slash
425
+ right_part = right_part.substring(1);
426
+ }
415
427
  return left_part + right_part;
416
428
  }
417
429
 
@@ -485,9 +497,8 @@ RubyVariables.WRAPPER(
485
497
  if (this.is_array(value)) {
486
498
  value = value.join("/");
487
499
  }
488
- value = this.path_identifier(value as any);
489
-
490
- return DeprecatedGlobbingBehavior ? "" + value : encodeURI("" + value);
500
+ const result = this.path_identifier(value as any);
501
+ return DeprecatedGlobbingBehavior ? result : encodeURI(result);
491
502
  }
492
503
 
493
504
  get_prefix(): string {
@@ -500,7 +511,7 @@ RubyVariables.WRAPPER(
500
511
  route(
501
512
  parts_table: PartsTable,
502
513
  route_spec: RouteTree,
503
- full_url = false
514
+ absolute = false
504
515
  ): RouteHelper {
505
516
  const required_params: string[] = [];
506
517
  const parts: string[] = [];
@@ -522,7 +533,7 @@ RubyVariables.WRAPPER(
522
533
  required_params,
523
534
  default_options,
524
535
  route_spec,
525
- full_url,
536
+ absolute,
526
537
  args
527
538
  );
528
539
  };
@@ -577,7 +588,10 @@ RubyVariables.WRAPPER(
577
588
  }
578
589
 
579
590
  is_object(value: unknown): value is Record<string, unknown> {
580
- return typeof value === "object" && "" + value === "[object Object]";
591
+ return (
592
+ typeof value === "object" &&
593
+ Object.prototype.toString.call(value) === "[object Object]"
594
+ );
581
595
  }
582
596
 
583
597
  is_array<T>(object: unknown | T[]): object is T[] {
@@ -645,14 +659,13 @@ RubyVariables.WRAPPER(
645
659
  const Utils = new UtilsClass();
646
660
 
647
661
  // We want this helper name to be short
648
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
649
662
  const __jsr = {
650
663
  r(
651
664
  parts_table: PartsTable,
652
665
  route_spec: RouteTree,
653
- full_url?: boolean
666
+ absolute?: boolean
654
667
  ): RouteHelper {
655
- return Utils.route(parts_table, route_spec, full_url);
668
+ return Utils.route(parts_table, route_spec, absolute);
656
669
  },
657
670
  };
658
671
 
@@ -17,4 +17,15 @@ describe JsRoutes, "#serialize" do
17
17
  "a=1&b%5B%5D=2&b%5B%5D=3&c%5Bd%5D=4&c%5Be%5D=5&f="
18
18
  )
19
19
  end
20
+
21
+ it "works with JS suckiness" do
22
+ expect(evaljs(
23
+ [
24
+ "const query = Object.create(null);",
25
+ "query.a = 1;",
26
+ "query.b = 2;",
27
+ "Routes.serialize(query);",
28
+ ].join("\n")
29
+ )).to eq("a=1&b=2")
30
+ end
20
31
  end
@@ -91,6 +91,18 @@ describe JsRoutes, "options" do
91
91
  expect(evaljs("Routes.inboxes_path")).to be_nil
92
92
  end
93
93
 
94
+ context "with camel_case option" do
95
+ let(:_options) { {include: /^admin_/, camel_case: true} }
96
+
97
+ it "should exclude specified routes from file" do
98
+ expect(evaljs("Routes.adminUsersPath()")).not_to be_nil
99
+ end
100
+
101
+ it "should not exclude routes not under specified pattern" do
102
+ expect(evaljs("Routes.inboxesPath")).to be_nil
103
+ end
104
+ end
105
+
94
106
  context "for rails engine" do
95
107
  let(:_options) { {:include => /^blog_app_posts/} }
96
108
 
@@ -180,9 +192,9 @@ describe JsRoutes, "options" do
180
192
  end
181
193
 
182
194
  context "is nil" do
183
- let(:_options) { {:namespace => nil} }
195
+ let(:_options) { {:namespace => nil, include: /^inbox$/} }
184
196
  it "should use this namespace for routing" do
185
- evaljs("window.zz = #{JsRoutes.generate(module_type: nil, namespace: nil)}")
197
+ evaljs("window.zz = #{generated_js}")
186
198
  expect(evaljs("window.zz.inbox_path")).not_to be_nil
187
199
  end
188
200
 
@@ -73,7 +73,7 @@ describe JsRoutes, "compatibility with Rails" do
73
73
  expect(evaljs("Routes.inbox_path(1, {expanded: true, anchor: 'hello'})")).to eq(test_routes.inbox_path(1, :expanded => true, :anchor => "hello"))
74
74
  end
75
75
 
76
- it "should support required paramters given as options hash" do
76
+ it "should support required parameters given as options hash" do
77
77
  expect(evaljs("Routes.search_path({q: 'hello'})")).to eq(test_routes.search_path(:q => 'hello'))
78
78
  end
79
79
 
@@ -135,6 +135,11 @@ describe JsRoutes, "compatibility with Rails" do
135
135
  it "should support single route mapping" do
136
136
  expect(evaljs("Routes.support_path({page: 3})")).to eq(test_routes.support_path(:page => 3))
137
137
  end
138
+
139
+ it 'works' do
140
+ expect(evaljs("Routes.planner_manage_path({locale: 'ua'})")).to eq(planner_routes.manage_path(locale: 'ua'))
141
+ expect(evaljs("Routes.planner_manage_path()")).to eq(planner_routes.manage_path)
142
+ end
138
143
  end
139
144
 
140
145
  it "shouldn't require the format" do
@@ -153,7 +158,7 @@ describe JsRoutes, "compatibility with Rails" do
153
158
  expect(evaljs("Routes.root_path()")).to eq(test_routes.root_path)
154
159
  end
155
160
 
156
- describe "get paramters" do
161
+ describe "get parameters" do
157
162
  it "should support simple get parameters" do
158
163
  expect(evaljs("Routes.inbox_path(1, {format: 'json', lang: 'ua', q: 'hello'})")).to eq(test_routes.inbox_path(1, :lang => "ua", :q => "hello", :format => "json"))
159
164
  end
@@ -162,6 +167,19 @@ describe JsRoutes, "compatibility with Rails" do
162
167
  expect(evaljs("Routes.inbox_path(1, {hello: ['world', 'mars']})")).to eq(test_routes.inbox_path(1, :hello => [:world, :mars]))
163
168
  end
164
169
 
170
+ context "object without prototype" do
171
+ before(:each) do
172
+ evaljs("let params = Object.create(null); params.q = 'hello';")
173
+ evaljs("let inbox = Object.create(null); inbox.to_param = 1;")
174
+ end
175
+
176
+ it "should still work correctly" do
177
+ expect(evaljs("Routes.inbox_path(inbox, params)")).to eq(
178
+ test_routes.inbox_path(1, q: "hello")
179
+ )
180
+ end
181
+ end
182
+
165
183
  it "should support nested get parameters" do
166
184
  expect(evaljs("Routes.inbox_path(1, {format: 'json', env: 'test', search: { category_ids: [2,5], q: 'hello'}})")).to eq(
167
185
  test_routes.inbox_path(1, :env => 'test', :search => {:category_ids => [2,5], :q => "hello"}, :format => "json")
@@ -229,6 +247,15 @@ describe JsRoutes, "compatibility with Rails" do
229
247
  expect(evaljs("Routes.things_path({ q: 'hello' })")).to eq(test_routes.things_path(q: 'hello'))
230
248
  end
231
249
 
250
+ it "treats false as absent optional part" do
251
+ pending("https://github.com/rails/rails/issues/42280")
252
+ expect(evaljs("Routes.things_path(false)")).to eq(test_routes.things_path(false))
253
+ end
254
+
255
+ it "treats false as absent optional part when default is specified" do
256
+ expect(evaljs("Routes.campaigns_path(false)")).to eq(test_routes.campaigns_path(false))
257
+ end
258
+
232
259
  it "should not require the optional parts as arguments" do
233
260
  expect(evaljs("Routes.thing_path(null, 5)")).to eq(test_routes.thing_path(nil, 5))
234
261
  end
@@ -446,6 +473,4 @@ describe JsRoutes, "compatibility with Rails" do
446
473
  expect(evaljs("Routes.inbox_message_path.requiredParams()").to_a).to eq(["inbox_id", "id"])
447
474
  end
448
475
  end
449
-
450
-
451
476
  end
data/spec/spec_helper.rb CHANGED
@@ -58,11 +58,21 @@ def blog_routes
58
58
  BlogEngine::Engine.routes.url_helpers
59
59
  end
60
60
 
61
+ def planner_routes
62
+ Planner::Engine.routes.url_helpers
63
+ end
64
+
61
65
  ActiveSupport::Inflector.inflections do |inflect|
62
66
  inflect.irregular "budgie", "budgies"
63
67
  end
64
68
 
65
69
 
70
+ module Planner
71
+ class Engine < Rails::Engine
72
+ isolate_namespace Planner
73
+ end
74
+ end
75
+
66
76
  module BlogEngine
67
77
  class Engine < Rails::Engine
68
78
  isolate_namespace BlogEngine
@@ -1,11 +1,17 @@
1
1
  def draw_routes
2
+ Planner::Engine.routes.draw do
3
+ get "/manage" => 'foo#foo', as: :manage
4
+ end
2
5
 
3
6
  BlogEngine::Engine.routes.draw do
4
7
  root to: "application#index"
5
- resources :posts
8
+ resources :posts, only: [:show, :index]
6
9
  end
7
10
  App.routes.draw do
8
11
 
12
+ mount Planner::Engine, at: "/(locale/:locale)", as: :planner
13
+
14
+ mount BlogEngine::Engine => "/blog", as: :blog_app
9
15
  get 'support(/page/:page)', to: BlogEngine::Engine, as: 'support'
10
16
 
11
17
  resources :inboxes, only: [:index, :show] do
@@ -14,6 +20,8 @@ def draw_routes
14
20
  end
15
21
  end
16
22
 
23
+ get "(/:space)/campaigns" => "foo#foo", as: :campaigns, defaults: {space: nil}
24
+
17
25
  root :to => "inboxes#index"
18
26
 
19
27
  namespace :admin do
@@ -41,8 +49,6 @@ def draw_routes
41
49
  get 'books/*section/:title' => 'books#show', :as => :book
42
50
  get 'books/:title/*section' => 'books#show', :as => :book_title
43
51
 
44
- mount BlogEngine::Engine => "/blog", :as => :blog_app
45
-
46
52
  get '/no_format' => "foo#foo", :format => false, :as => :no_format
47
53
 
48
54
  get '/json_only' => "foo#foo", :format => true, :constraints => {:format => /json/}, :as => :json_only
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.0.0
4
+ version: 2.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bogdan Gusiev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-14 00:00:00.000000000 Z
11
+ date: 2021-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties