quicktype 23.1.2 → 23.1.3

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 (2) hide show
  1. package/dist/index.js +47 -27
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -265,14 +265,16 @@ function makeOptionDefinitions(targetLanguages) {
265
265
  alias: "o",
266
266
  type: String,
267
267
  typeLabel: "FILE",
268
- description: "The output file. Determines --lang and --top-level."
268
+ description: "The output file. Determines --lang and --top-level.",
269
+ kind: "cli"
269
270
  },
270
271
  {
271
272
  name: "top-level",
272
273
  alias: "t",
273
274
  type: String,
274
275
  typeLabel: "NAME",
275
- description: "The name for the top level type."
276
+ description: "The name for the top level type.",
277
+ kind: "cli"
276
278
  }
277
279
  ];
278
280
  const lang = targetLanguages.length < 2
@@ -283,7 +285,8 @@ function makeOptionDefinitions(targetLanguages) {
283
285
  alias: "l",
284
286
  type: String,
285
287
  typeLabel: "LANG",
286
- description: "The target language."
288
+ description: "The target language.",
289
+ kind: "cli"
287
290
  }
288
291
  ];
289
292
  const afterLang = [
@@ -293,7 +296,8 @@ function makeOptionDefinitions(targetLanguages) {
293
296
  type: String,
294
297
  defaultValue: undefined,
295
298
  typeLabel: "SRC_LANG",
296
- description: "The source language (default is json)."
299
+ description: "The source language (default is json).",
300
+ kind: "cli"
297
301
  },
298
302
  {
299
303
  name: "src",
@@ -301,20 +305,23 @@ function makeOptionDefinitions(targetLanguages) {
301
305
  multiple: true,
302
306
  defaultOption: true,
303
307
  typeLabel: "FILE|URL|DIRECTORY",
304
- description: "The file, url, or data directory to type."
308
+ description: "The file, url, or data directory to type.",
309
+ kind: "cli"
305
310
  },
306
311
  {
307
312
  name: "src-urls",
308
313
  type: String,
309
314
  typeLabel: "FILE",
310
- description: "Tracery grammar describing URLs to crawl."
315
+ description: "Tracery grammar describing URLs to crawl.",
316
+ kind: "cli"
311
317
  }
312
318
  ];
313
319
  const inference = Array.from((0, collection_utils_1.mapMap)((0, collection_utils_1.mapFromObject)(quicktype_core_1.inferenceFlags), (flag, name) => {
314
320
  return {
315
321
  name: dashedFromCamelCase(negatedInferenceFlagName(name)),
316
322
  type: Boolean,
317
- description: flag.negationDescription + "."
323
+ description: flag.negationDescription + ".",
324
+ kind: "cli"
318
325
  };
319
326
  }).values());
320
327
  const afterInference = [
@@ -322,26 +329,30 @@ function makeOptionDefinitions(targetLanguages) {
322
329
  name: "graphql-schema",
323
330
  type: String,
324
331
  typeLabel: "FILE",
325
- description: "GraphQL introspection file."
332
+ description: "GraphQL introspection file.",
333
+ kind: "cli"
326
334
  },
327
335
  {
328
336
  name: "graphql-introspect",
329
337
  type: String,
330
338
  typeLabel: "URL",
331
- description: "Introspect GraphQL schema from a server."
339
+ description: "Introspect GraphQL schema from a server.",
340
+ kind: "cli"
332
341
  },
333
342
  {
334
343
  name: "http-method",
335
344
  type: String,
336
345
  typeLabel: "METHOD",
337
- description: "HTTP method to use for the GraphQL introspection query."
346
+ description: "HTTP method to use for the GraphQL introspection query.",
347
+ kind: "cli"
338
348
  },
339
349
  {
340
350
  name: "http-header",
341
351
  type: String,
342
352
  multiple: true,
343
353
  typeLabel: "HEADER",
344
- description: "Header(s) to attach to all HTTP requests, including the GraphQL introspection query."
354
+ description: "Header(s) to attach to all HTTP requests, including the GraphQL introspection query.",
355
+ kind: "cli"
345
356
  },
346
357
  {
347
358
  name: "additional-schema",
@@ -349,57 +360,67 @@ function makeOptionDefinitions(targetLanguages) {
349
360
  type: String,
350
361
  multiple: true,
351
362
  typeLabel: "FILE",
352
- description: "Register the $id's of additional JSON Schema files."
363
+ description: "Register the $id's of additional JSON Schema files.",
364
+ kind: "cli"
353
365
  },
354
366
  {
355
367
  name: "no-render",
356
368
  type: Boolean,
357
- description: "Don't render output."
369
+ description: "Don't render output.",
370
+ kind: "cli"
358
371
  },
359
372
  {
360
373
  name: "alphabetize-properties",
361
374
  type: Boolean,
362
- description: "Alphabetize order of class properties."
375
+ description: "Alphabetize order of class properties.",
376
+ kind: "cli"
363
377
  },
364
378
  {
365
379
  name: "all-properties-optional",
366
380
  type: Boolean,
367
- description: "Make all class properties optional."
381
+ description: "Make all class properties optional.",
382
+ kind: "cli"
368
383
  },
369
384
  {
370
385
  name: "build-markov-chain",
371
386
  type: String,
372
387
  typeLabel: "FILE",
373
- description: "Markov chain corpus filename."
388
+ description: "Markov chain corpus filename.",
389
+ kind: "cli"
374
390
  },
375
391
  {
376
392
  name: "quiet",
377
393
  type: Boolean,
378
- description: "Don't show issues in the generated code."
394
+ description: "Don't show issues in the generated code.",
395
+ kind: "cli"
379
396
  },
380
397
  {
381
398
  name: "debug",
382
399
  type: String,
383
400
  typeLabel: "OPTIONS or all",
384
- description: "Comma separated debug options: print-graph, print-reconstitution, print-gather-names, print-transformations, print-schema-resolving, print-times, provenance"
401
+ description: "Comma separated debug options: print-graph, print-reconstitution, print-gather-names, print-transformations, print-schema-resolving, print-times, provenance",
402
+ kind: "cli"
385
403
  },
386
404
  {
387
405
  name: "telemetry",
388
406
  type: String,
389
407
  typeLabel: "enable|disable",
390
- description: "Enable anonymous telemetry to help improve quicktype"
408
+ description: "Enable anonymous telemetry to help improve quicktype",
409
+ kind: "cli"
391
410
  },
392
411
  {
393
412
  name: "help",
394
413
  alias: "h",
395
414
  type: Boolean,
396
- description: "Get some help."
415
+ description: "Get some help.",
416
+ kind: "cli"
397
417
  },
398
418
  {
399
419
  name: "version",
400
420
  alias: "v",
401
421
  type: Boolean,
402
- description: "Display the version of quicktype"
422
+ description: "Display the version of quicktype",
423
+ kind: "cli"
403
424
  }
404
425
  ];
405
426
  return beforeLang.concat(lang, afterLang, inference, afterInference);
@@ -491,8 +512,6 @@ exports.parseCLIOptions = parseCLIOptions;
491
512
  // according to each option definition's `renderer` field. If `partial` is false this
492
513
  // will throw if it encounters an unknown option.
493
514
  function parseOptions(definitions, argv, partial) {
494
- // FIXME: update this when options strongly typed
495
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
496
515
  let opts;
497
516
  try {
498
517
  opts = (0, command_line_args_1.default)(definitions, { argv, partial });
@@ -513,13 +532,14 @@ function parseOptions(definitions, argv, partial) {
513
532
  if (!(0, collection_utils_1.hasOwnProperty)(opts, optionDefinition.name)) {
514
533
  continue;
515
534
  }
516
- const v = opts[optionDefinition.name];
517
- if (optionDefinition.name in options.rendererOptions) {
518
- options.rendererOptions[optionDefinition.name] = v;
535
+ const optionValue = opts[optionDefinition.name];
536
+ if (optionDefinition.kind !== "cli") {
537
+ options.rendererOptions[optionDefinition.name] =
538
+ optionValue;
519
539
  }
520
540
  else {
521
541
  const k = _.lowerFirst(optionDefinition.name.split("-").map(_.upperFirst).join(""));
522
- options[k] = v;
542
+ options[k] = optionValue;
523
543
  }
524
544
  }
525
545
  return options;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quicktype",
3
- "version": "23.1.2",
3
+ "version": "23.1.3",
4
4
  "license": "Apache-2.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -34,9 +34,9 @@
34
34
  "graphql": "^0.11.7",
35
35
  "lodash": "^4.17.21",
36
36
  "moment": "^2.30.1",
37
- "quicktype-core": "23.1.2",
38
- "quicktype-graphql-input": "23.1.2",
39
- "quicktype-typescript-input": "23.1.2",
37
+ "quicktype-core": "23.1.3",
38
+ "quicktype-graphql-input": "23.1.3",
39
+ "quicktype-typescript-input": "23.1.3",
40
40
  "readable-stream": "^4.5.2",
41
41
  "stream-json": "1.8.0",
42
42
  "string-to-stream": "^3.0.1",