quicktype 20.0.6 → 20.0.8
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.
- package/dist/index.js +11 -8
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -23,6 +23,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
__setModuleDefault(result, mod);
|
|
24
24
|
return result;
|
|
25
25
|
};
|
|
26
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
27
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
|
+
};
|
|
26
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
30
|
exports.main = exports.writeOutput = exports.makeQuicktypeOptions = exports.jsonInputForTargetLanguage = exports.parseCLIOptions = void 0;
|
|
28
31
|
const fs = __importStar(require("fs"));
|
|
@@ -39,7 +42,7 @@ const CompressedJSONFromStream_1 = require("./CompressedJSONFromStream");
|
|
|
39
42
|
const stringToStream = require("string-to-stream");
|
|
40
43
|
const commandLineArgs = require("command-line-args");
|
|
41
44
|
const getUsage = require("command-line-usage");
|
|
42
|
-
const
|
|
45
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
43
46
|
const wordWrap = require("wordwrap")(90);
|
|
44
47
|
const packageJSON = require("../package.json");
|
|
45
48
|
const defaultDefaultTargetLanguageName = "go";
|
|
@@ -415,7 +418,7 @@ function makeSectionsBeforeRenderers(targetLanguages) {
|
|
|
415
418
|
{
|
|
416
419
|
header: "Synopsis",
|
|
417
420
|
content: [
|
|
418
|
-
`$ quicktype [${
|
|
421
|
+
`$ quicktype [${chalk_1.default.bold("--lang")} LANG] [${chalk_1.default.bold("--out")} FILE] FILE|URL ...`,
|
|
419
422
|
"",
|
|
420
423
|
` LANG ... ${makeLangTypeLabel(targetLanguages)}`
|
|
421
424
|
]
|
|
@@ -436,24 +439,24 @@ const sectionsAfterRenderers = [
|
|
|
436
439
|
{
|
|
437
440
|
header: "Examples",
|
|
438
441
|
content: [
|
|
439
|
-
|
|
442
|
+
chalk_1.default.dim("Generate C# to parse a Bitcoin API"),
|
|
440
443
|
"$ quicktype -o LatestBlock.cs https://blockchain.info/latestblock",
|
|
441
444
|
"",
|
|
442
|
-
|
|
443
|
-
|
|
445
|
+
chalk_1.default.dim("Generate Go code from a directory of samples containing:"),
|
|
446
|
+
chalk_1.default.dim(` - Foo.json
|
|
444
447
|
+ Bar
|
|
445
448
|
- bar-sample-1.json
|
|
446
449
|
- bar-sample-2.json
|
|
447
450
|
- Baz.url`),
|
|
448
451
|
"$ quicktype -l go samples",
|
|
449
452
|
"",
|
|
450
|
-
|
|
453
|
+
chalk_1.default.dim("Generate JSON Schema, then TypeScript"),
|
|
451
454
|
"$ quicktype -o schema.json https://blockchain.info/latestblock",
|
|
452
455
|
"$ quicktype -o bitcoin.ts --src-lang schema schema.json"
|
|
453
456
|
]
|
|
454
457
|
},
|
|
455
458
|
{
|
|
456
|
-
content: `Learn more at ${
|
|
459
|
+
content: `Learn more at ${chalk_1.default.bold("quicktype.io")}`
|
|
457
460
|
}
|
|
458
461
|
];
|
|
459
462
|
function parseCLIOptions(argv, targetLanguage) {
|
|
@@ -803,7 +806,7 @@ async function main(args) {
|
|
|
803
806
|
case "disable":
|
|
804
807
|
break;
|
|
805
808
|
default:
|
|
806
|
-
console.error(
|
|
809
|
+
console.error(chalk_1.default.red("telemetry must be 'enable' or 'disable'"));
|
|
807
810
|
return;
|
|
808
811
|
}
|
|
809
812
|
if (Array.isArray(args) && args.length === 2) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quicktype",
|
|
3
|
-
"version": "20.0.
|
|
3
|
+
"version": "20.0.8",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -23,16 +23,16 @@
|
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@glideapps/ts-necessities": "^2.1.2",
|
|
26
|
-
"chalk": "^
|
|
26
|
+
"chalk": "^4.1.2",
|
|
27
27
|
"command-line-args": "^4.0.6",
|
|
28
28
|
"command-line-usage": "^5.0.5",
|
|
29
29
|
"graphql": "^0.11.7",
|
|
30
30
|
"lodash": "^4.17.21",
|
|
31
31
|
"moment": "^2.22.1",
|
|
32
32
|
"node-fetch": "^2.6.1",
|
|
33
|
-
"quicktype-core": "20.0.
|
|
34
|
-
"quicktype-graphql-input": "20.0.
|
|
35
|
-
"quicktype-typescript-input": "20.0.
|
|
33
|
+
"quicktype-core": "20.0.8",
|
|
34
|
+
"quicktype-graphql-input": "20.0.8",
|
|
35
|
+
"quicktype-typescript-input": "20.0.8",
|
|
36
36
|
"readable-stream": "^4.3.0",
|
|
37
37
|
"stream-json": "1.1.3",
|
|
38
38
|
"string-to-stream": "^1.1.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@types/lodash": "^4.14.108",
|
|
46
46
|
"@types/semver": "^7.3.13",
|
|
47
47
|
"@types/shelljs": "^0.7.8",
|
|
48
|
-
"@types/urijs": "^1.19.
|
|
48
|
+
"@types/urijs": "^1.19.19",
|
|
49
49
|
"ajv": "^5.5.2",
|
|
50
50
|
"deep-equal": "^2.2.0",
|
|
51
51
|
"exit": "^0.1.2",
|