quicktype 23.2.4 → 23.2.6

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 +26 -23
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -291,7 +291,7 @@ function makeOptionDefinitions(targetLanguages) {
291
291
  {
292
292
  name: "out",
293
293
  alias: "o",
294
- type: String,
294
+ optionType: "string",
295
295
  typeLabel: "FILE",
296
296
  description: "The output file. Determines --lang and --top-level.",
297
297
  kind: "cli",
@@ -299,7 +299,7 @@ function makeOptionDefinitions(targetLanguages) {
299
299
  {
300
300
  name: "top-level",
301
301
  alias: "t",
302
- type: String,
302
+ optionType: "string",
303
303
  typeLabel: "NAME",
304
304
  description: "The name for the top level type.",
305
305
  kind: "cli",
@@ -311,7 +311,7 @@ function makeOptionDefinitions(targetLanguages) {
311
311
  {
312
312
  name: "lang",
313
313
  alias: "l",
314
- type: String,
314
+ optionType: "string",
315
315
  typeLabel: "LANG",
316
316
  description: "The target language.",
317
317
  kind: "cli",
@@ -321,7 +321,7 @@ function makeOptionDefinitions(targetLanguages) {
321
321
  {
322
322
  name: "src-lang",
323
323
  alias: "s",
324
- type: String,
324
+ optionType: "string",
325
325
  defaultValue: undefined,
326
326
  typeLabel: "SRC_LANG",
327
327
  description: "The source language (default is json).",
@@ -329,16 +329,16 @@ function makeOptionDefinitions(targetLanguages) {
329
329
  },
330
330
  {
331
331
  name: "src",
332
- type: String,
332
+ optionType: "string",
333
333
  multiple: true,
334
- defaultOption: true,
335
334
  typeLabel: "FILE|URL|DIRECTORY",
336
335
  description: "The file, url, or data directory to type.",
337
336
  kind: "cli",
337
+ defaultOption: true,
338
338
  },
339
339
  {
340
340
  name: "src-urls",
341
- type: String,
341
+ optionType: "string",
342
342
  typeLabel: "FILE",
343
343
  description: "Tracery grammar describing URLs to crawl.",
344
344
  kind: "cli",
@@ -347,7 +347,7 @@ function makeOptionDefinitions(targetLanguages) {
347
347
  const inference = Array.from((0, collection_utils_1.mapMap)((0, collection_utils_1.mapFromObject)(quicktype_core_1.inferenceFlags), (flag, name) => {
348
348
  return {
349
349
  name: dashedFromCamelCase(negatedInferenceFlagName(name)),
350
- type: Boolean,
350
+ optionType: "boolean",
351
351
  description: flag.negationDescription + ".",
352
352
  kind: "cli",
353
353
  };
@@ -355,28 +355,28 @@ function makeOptionDefinitions(targetLanguages) {
355
355
  const afterInference = [
356
356
  {
357
357
  name: "graphql-schema",
358
- type: String,
358
+ optionType: "string",
359
359
  typeLabel: "FILE",
360
360
  description: "GraphQL introspection file.",
361
361
  kind: "cli",
362
362
  },
363
363
  {
364
364
  name: "graphql-introspect",
365
- type: String,
365
+ optionType: "string",
366
366
  typeLabel: "URL",
367
367
  description: "Introspect GraphQL schema from a server.",
368
368
  kind: "cli",
369
369
  },
370
370
  {
371
371
  name: "http-method",
372
- type: String,
372
+ optionType: "string",
373
373
  typeLabel: "METHOD",
374
374
  description: "HTTP method to use for the GraphQL introspection query.",
375
375
  kind: "cli",
376
376
  },
377
377
  {
378
378
  name: "http-header",
379
- type: String,
379
+ optionType: "string",
380
380
  multiple: true,
381
381
  typeLabel: "HEADER",
382
382
  description: "Header(s) to attach to all HTTP requests, including the GraphQL introspection query.",
@@ -385,7 +385,7 @@ function makeOptionDefinitions(targetLanguages) {
385
385
  {
386
386
  name: "additional-schema",
387
387
  alias: "S",
388
- type: String,
388
+ optionType: "string",
389
389
  multiple: true,
390
390
  typeLabel: "FILE",
391
391
  description: "Register the $id's of additional JSON Schema files.",
@@ -393,45 +393,45 @@ function makeOptionDefinitions(targetLanguages) {
393
393
  },
394
394
  {
395
395
  name: "no-render",
396
- type: Boolean,
396
+ optionType: "boolean",
397
397
  description: "Don't render output.",
398
398
  kind: "cli",
399
399
  },
400
400
  {
401
401
  name: "alphabetize-properties",
402
- type: Boolean,
402
+ optionType: "boolean",
403
403
  description: "Alphabetize order of class properties.",
404
404
  kind: "cli",
405
405
  },
406
406
  {
407
407
  name: "all-properties-optional",
408
- type: Boolean,
408
+ optionType: "boolean",
409
409
  description: "Make all class properties optional.",
410
410
  kind: "cli",
411
411
  },
412
412
  {
413
413
  name: "build-markov-chain",
414
- type: String,
414
+ optionType: "string",
415
415
  typeLabel: "FILE",
416
416
  description: "Markov chain corpus filename.",
417
417
  kind: "cli",
418
418
  },
419
419
  {
420
420
  name: "quiet",
421
- type: Boolean,
421
+ optionType: "boolean",
422
422
  description: "Don't show issues in the generated code.",
423
423
  kind: "cli",
424
424
  },
425
425
  {
426
426
  name: "debug",
427
- type: String,
427
+ optionType: "string",
428
428
  typeLabel: "OPTIONS or all",
429
429
  description: "Comma separated debug options: print-graph, print-reconstitution, print-gather-names, print-transformations, print-schema-resolving, print-times, provenance",
430
430
  kind: "cli",
431
431
  },
432
432
  {
433
433
  name: "telemetry",
434
- type: String,
434
+ optionType: "string",
435
435
  typeLabel: "enable|disable",
436
436
  description: "Enable anonymous telemetry to help improve quicktype",
437
437
  kind: "cli",
@@ -439,14 +439,14 @@ function makeOptionDefinitions(targetLanguages) {
439
439
  {
440
440
  name: "help",
441
441
  alias: "h",
442
- type: Boolean,
442
+ optionType: "boolean",
443
443
  description: "Get some help.",
444
444
  kind: "cli",
445
445
  },
446
446
  {
447
447
  name: "version",
448
448
  alias: "v",
449
- type: Boolean,
449
+ optionType: "boolean",
450
450
  description: "Display the version of quicktype",
451
451
  kind: "cli",
452
452
  },
@@ -547,7 +547,10 @@ function parseCLIOptions(argv, targetLanguage) {
547
547
  function parseOptions(definitions, argv, partial) {
548
548
  let opts;
549
549
  try {
550
- opts = (0, command_line_args_1.default)(definitions, { argv, partial });
550
+ opts = (0, command_line_args_1.default)(definitions.map((def) => ({
551
+ ...def,
552
+ type: def.optionType === "boolean" ? Boolean : String,
553
+ })), { argv, partial });
551
554
  }
552
555
  catch (e) {
553
556
  (0, quicktype_core_1.assert)(!partial, "Partial option parsing should not have failed");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quicktype",
3
- "version": "23.2.4",
3
+ "version": "23.2.6",
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.2.4",
38
- "quicktype-graphql-input": "23.2.4",
39
- "quicktype-typescript-input": "23.2.4",
37
+ "quicktype-core": "23.2.6",
38
+ "quicktype-graphql-input": "23.2.6",
39
+ "quicktype-typescript-input": "23.2.6",
40
40
  "readable-stream": "^4.5.2",
41
41
  "stream-json": "1.8.0",
42
42
  "string-to-stream": "^3.0.1",