js-routes 2.0.1 → 2.0.6

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: 52b735748b525770a79a5dcb0fe510b50350e3e22541fcb34f39fbc04b9a4f02
4
- data.tar.gz: ca5ec3a0e5adcf943854681413dfc11f4da9cd91c46a3bb817ee85ea6da303a0
3
+ metadata.gz: c6231e8af8fe35121f426ca02a854d242f777262920485ef6e78aa346185f5ce
4
+ data.tar.gz: 1f16118cfcc337e341e1d99b246a8b5ffd50fae4bce76bfce45a4c4093f647aa
5
5
  SHA512:
6
- metadata.gz: 820f89d751dfb532235098abcaf5a26e568d5acd34ab469ccf8d61dfaa4427ac59e8597860ce9cd05728869c401d72e5beb6501aac2ee9713772091db80cc0d5
7
- data.tar.gz: 0ba55b8c600a1ea89737a860b5ca728572972e149900c35fd39ac439dcae0f9af8541649f356c4341b4331a73ede9382ed20b9c75311cb24c27cb7eebd510c29
6
+ metadata.gz: 804edc5773122ac7465c8f29e79708a4097232317dd6a03a4597224d560977894a86c2de041068e6e18b4101b1bc6314bd76f6bd15aaf5aa6662ff4211fd7d7d
7
+ data.tar.gz: f4b0489e92b61ab451cb88baf4fa2990c85b45cdb438e1c423e1b689abe0d8984bc4daad87ab01c323cb7a21929619e26bbc6398fbcd68b6da5dd347151bbaed
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.6
4
+
5
+ * Disable `namespace` option default for all envs [#278](https://github.com/railsware/js-routes/issues/278)
6
+
7
+ ## v2.0.5
8
+
9
+ * Fixed backward compatibility issue [#276](https://github.com/railsware/js-routes/issues/276)
10
+
11
+ ## v2.0.4
12
+
13
+ * Fixed backward compatibility issue [#275](https://github.com/railsware/js-routes/issues/275)
14
+
15
+ ## v2.0.3
16
+
17
+ * Fixed backward compatibility issue [#275](https://github.com/railsware/js-routes/issues/275)
18
+
19
+ ## v2.0.2
20
+
21
+ * Fixed backward compatibility issue [#274](https://github.com/railsware/js-routes/issues/274)
22
+
3
23
  ## v2.0.1
4
24
 
5
25
  * Fixed backward compatibility issue [#272](https://github.com/railsware/js-routes/issues/272)
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/lib/js_routes.rb CHANGED
@@ -12,7 +12,7 @@ class JsRoutes
12
12
  #
13
13
 
14
14
  DEFAULTS = {
15
- namespace: -> { defined?(Webpacker) ? nil : "Routes" },
15
+ namespace: nil,
16
16
  exclude: [],
17
17
  include: //,
18
18
  file: -> do
@@ -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.1"
2
+ VERSION = "2.0.6"
3
3
  end
data/lib/routes.js CHANGED
@@ -124,7 +124,8 @@ RubyVariables.WRAPPER((that) => {
124
124
  extract_options(number_of_params, args) {
125
125
  const last_el = args[args.length - 1];
126
126
  if ((args.length > number_of_params && last_el === 0) ||
127
- (this.is_object(last_el) && !this.looks_like_serialized_model(last_el))) {
127
+ (this.is_object(last_el) &&
128
+ !this.looks_like_serialized_model(last_el))) {
128
129
  if (this.is_object(last_el)) {
129
130
  delete last_el[this.configuration.special_options_key];
130
131
  }
@@ -144,7 +145,7 @@ RubyVariables.WRAPPER((that) => {
144
145
  }
145
146
  path_identifier(object) {
146
147
  const result = this.unwrap_path_identifier(object);
147
- return this.is_nullable(result) ? "" : "" + result;
148
+ return this.is_nullable(result) || result === false ? "" : "" + result;
148
149
  }
149
150
  unwrap_path_identifier(object) {
150
151
  let result = object;
@@ -187,14 +188,14 @@ RubyVariables.WRAPPER((that) => {
187
188
  ...default_options,
188
189
  ...options,
189
190
  };
190
- const url_parameters = {};
191
+ const keyword_parameters = {};
191
192
  const query_parameters = {};
192
193
  for (const key in options) {
193
194
  if (!hasProp(options, key))
194
195
  continue;
195
196
  const value = options[key];
196
197
  if (this.is_reserved_option(key)) {
197
- url_parameters[key] = value;
198
+ keyword_parameters[key] = value;
198
199
  }
199
200
  else {
200
201
  if (!this.is_nullable(value) &&
@@ -207,32 +208,35 @@ RubyVariables.WRAPPER((that) => {
207
208
  let i = 0;
208
209
  for (const part of route_parts) {
209
210
  if (i < args.length) {
211
+ const value = args[i];
210
212
  if (!hasProp(parts_options, part)) {
211
- query_parameters[part] = args[i];
213
+ query_parameters[part] = value;
212
214
  ++i;
213
215
  }
214
216
  }
215
217
  }
216
- return { url_parameters, query_parameters };
218
+ return { keyword_parameters, query_parameters };
217
219
  }
218
- build_route(parts, required_params, default_options, route, full_url, args) {
219
- 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);
220
222
  const missing_params = required_params.filter((param) => !hasProp(query_parameters, param) ||
221
223
  this.is_nullable(query_parameters[param]));
222
224
  if (missing_params.length) {
223
225
  throw new ParametersMissing(...missing_params);
224
226
  }
225
227
  let result = this.get_prefix() + this.visit(route, query_parameters);
226
- if (url_parameters.trailing_slash) {
228
+ if (keyword_parameters.trailing_slash) {
227
229
  result = result.replace(/(.*?)[/]?$/, "$1/");
228
230
  }
229
231
  const url_params = this.serialize(query_parameters);
230
232
  if (url_params.length) {
231
233
  result += "?" + url_params;
232
234
  }
233
- result += url_parameters.anchor ? "#" + url_parameters.anchor : "";
234
- if (full_url) {
235
- 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;
236
240
  }
237
241
  return result;
238
242
  }
@@ -264,12 +268,18 @@ RubyVariables.WRAPPER((that) => {
264
268
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
265
269
  [_type, left, right], parameters, optional) {
266
270
  const left_part = this.visit(left, parameters, optional);
267
- const right_part = this.visit(right, parameters, optional);
271
+ let right_part = this.visit(right, parameters, optional);
268
272
  if (optional &&
269
273
  ((this.is_optional_node(left[0]) && !left_part) ||
270
274
  (this.is_optional_node(right[0]) && !right_part))) {
271
275
  return "";
272
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
+ }
273
283
  return left_part + right_part;
274
284
  }
275
285
  visit_symbol(
@@ -331,8 +341,8 @@ RubyVariables.WRAPPER((that) => {
331
341
  if (this.is_array(value)) {
332
342
  value = value.join("/");
333
343
  }
334
- value = this.path_identifier(value);
335
- return DeprecatedGlobbingBehavior ? "" + value : encodeURI("" + value);
344
+ const result = this.path_identifier(value);
345
+ return DeprecatedGlobbingBehavior ? result : encodeURI(result);
336
346
  }
337
347
  get_prefix() {
338
348
  const prefix = this.configuration.prefix;
@@ -340,7 +350,7 @@ RubyVariables.WRAPPER((that) => {
340
350
  ? prefix.substring(0, prefix.length - 1)
341
351
  : prefix;
342
352
  }
343
- route(parts_table, route_spec, full_url = false) {
353
+ route(parts_table, route_spec, absolute = false) {
344
354
  const required_params = [];
345
355
  const parts = [];
346
356
  const default_options = {};
@@ -354,7 +364,7 @@ RubyVariables.WRAPPER((that) => {
354
364
  }
355
365
  }
356
366
  const result = (...args) => {
357
- 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);
358
368
  };
359
369
  result.requiredParams = () => required_params;
360
370
  result.toString = () => {
@@ -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,uCAAO,CAAA;QACP,6CAAU,CAAA;QACV,qCAAM,CAAA;QACN,yCAAQ,CAAA;QACR,+CAAW,CAAA;QACX,2CAAS,CAAA;QACT,uCAAO,CAAA;IACT,CAAC,EATI,SAAS,KAAT,SAAS,QASb;IAmBD,MAAM,IAAI,GAAG,IAAI,CAAC;IAKlB,MAAM,gBAAgB,GAAyC;QAC7D,GAAG,EAAE;YACH,oEAAoE;YACpE,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC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,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
  };
@@ -648,14 +659,13 @@ RubyVariables.WRAPPER(
648
659
  const Utils = new UtilsClass();
649
660
 
650
661
  // We want this helper name to be short
651
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
652
662
  const __jsr = {
653
663
  r(
654
664
  parts_table: PartsTable,
655
665
  route_spec: RouteTree,
656
- full_url?: boolean
666
+ absolute?: boolean
657
667
  ): RouteHelper {
658
- return Utils.route(parts_table, route_spec, full_url);
668
+ return Utils.route(parts_table, route_spec, absolute);
659
669
  },
660
670
  };
661
671
 
@@ -3,7 +3,7 @@ require "spec_helper"
3
3
  describe JsRoutes, "#serialize" do
4
4
 
5
5
  before(:each) do
6
- evaljs(JsRoutes.generate({module_type: nil}))
6
+ evaljs(JsRoutes.generate({module_type: nil, namespace: 'Routes'}))
7
7
  end
8
8
 
9
9
  it "should provide this method" do
@@ -3,7 +3,11 @@ require 'spec_helper'
3
3
  describe JsRoutes, "options" do
4
4
 
5
5
  let(:generated_js) do
6
- JsRoutes.generate({module_type: nil, **_options})
6
+ JsRoutes.generate({
7
+ module_type: nil,
8
+ namespace: 'Routes',
9
+ **_options
10
+ })
7
11
  end
8
12
 
9
13
  before(:each) do
@@ -91,6 +95,18 @@ describe JsRoutes, "options" do
91
95
  expect(evaljs("Routes.inboxes_path")).to be_nil
92
96
  end
93
97
 
98
+ context "with camel_case option" do
99
+ let(:_options) { {include: /^admin_/, camel_case: true} }
100
+
101
+ it "should exclude specified routes from file" do
102
+ expect(evaljs("Routes.adminUsersPath()")).not_to be_nil
103
+ end
104
+
105
+ it "should not exclude routes not under specified pattern" do
106
+ expect(evaljs("Routes.inboxesPath")).to be_nil
107
+ end
108
+ end
109
+
94
110
  context "for rails engine" do
95
111
  let(:_options) { {:include => /^blog_app_posts/} }
96
112
 
@@ -180,9 +196,9 @@ describe JsRoutes, "options" do
180
196
  end
181
197
 
182
198
  context "is nil" do
183
- let(:_options) { {:namespace => nil} }
199
+ let(:_options) { {:namespace => nil, include: /^inbox$/} }
184
200
  it "should use this namespace for routing" do
185
- evaljs("window.zz = #{JsRoutes.generate(module_type: nil, namespace: nil)}")
201
+ evaljs("window.zz = #{generated_js}")
186
202
  expect(evaljs("window.zz.inbox_path")).not_to be_nil
187
203
  end
188
204
 
@@ -3,7 +3,7 @@ require "spec_helper"
3
3
  describe JsRoutes, "compatibility with Rails" do
4
4
 
5
5
  before(:each) do
6
- evaljs(JsRoutes.generate({module_type: nil}))
6
+ evaljs(JsRoutes.generate({module_type: nil, namespace: 'Routes'}))
7
7
  end
8
8
 
9
9
  it "should generate collection routing" do
@@ -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
@@ -164,12 +169,13 @@ describe JsRoutes, "compatibility with Rails" do
164
169
 
165
170
  context "object without prototype" do
166
171
  before(:each) do
167
- evaljs("let params = Object.create(null); params.q = 'hello'")
172
+ evaljs("let params = Object.create(null); params.q = 'hello';")
173
+ evaljs("let inbox = Object.create(null); inbox.to_param = 1;")
168
174
  end
169
175
 
170
176
  it "should still work correctly" do
171
- expect(evaljs("Routes.inbox_path(1, params)")).to eq(
172
- test_routes.inbox_path(1, :q => "hello")
177
+ expect(evaljs("Routes.inbox_path(inbox, params)")).to eq(
178
+ test_routes.inbox_path(1, q: "hello")
173
179
  )
174
180
  end
175
181
  end
@@ -241,6 +247,15 @@ describe JsRoutes, "compatibility with Rails" do
241
247
  expect(evaljs("Routes.things_path({ q: 'hello' })")).to eq(test_routes.things_path(q: 'hello'))
242
248
  end
243
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
+
244
259
  it "should not require the optional parts as arguments" do
245
260
  expect(evaljs("Routes.thing_path(null, 5)")).to eq(test_routes.thing_path(nil, 5))
246
261
  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.1
4
+ version: 2.0.6
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-21 00:00:00.000000000 Z
11
+ date: 2021-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties