quicktype 23.3.24 → 24.0.0
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/README.md +11 -5
- package/dist/GraphQLIntrospection.js +2 -6
- package/package.json +90 -92
package/README.md
CHANGED
|
@@ -37,6 +37,9 @@ _Missing your favorite language? Please implement it!_
|
|
|
37
37
|
|
|
38
38
|
There are many ways to use `quicktype`. [app.quicktype.io](https://app.quicktype.io) is the most powerful and complete UI. The web app also works offline and doesn't send your sample data over the Internet, so paste away!
|
|
39
39
|
|
|
40
|
+
The quicktype CLI and Node.js packages require Node.js 20 or newer. See
|
|
41
|
+
[Migrating to quicktype 24](MIGRATING.md) for upgrade details.
|
|
42
|
+
|
|
40
43
|
For the best CLI, we recommend installing `quicktype` globally via `npm`:
|
|
41
44
|
|
|
42
45
|
```bash
|
|
@@ -247,13 +250,16 @@ files, URLs, or add other options.
|
|
|
247
250
|
### Test
|
|
248
251
|
|
|
249
252
|
```bash
|
|
250
|
-
# Run full test suite
|
|
251
|
-
npm
|
|
253
|
+
# Run full test suite (unit tests plus all fixtures)
|
|
254
|
+
npm test
|
|
255
|
+
|
|
256
|
+
# Run only the Vitest unit tests
|
|
257
|
+
npm run test:unit
|
|
252
258
|
|
|
253
259
|
# Test a specific language (see test/languages.ts)
|
|
254
|
-
FIXTURE=golang npm test
|
|
260
|
+
FIXTURE=golang npm run test:fixtures
|
|
255
261
|
|
|
256
262
|
# Test a single sample or directory
|
|
257
|
-
FIXTURE=swift npm test -- pokedex.json
|
|
258
|
-
FIXTURE=swift npm test -- test/inputs/json/samples
|
|
263
|
+
FIXTURE=swift npm run test:fixtures -- pokedex.json
|
|
264
|
+
FIXTURE=swift npm run test:fixtures -- test/inputs/json/samples
|
|
259
265
|
```
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.introspectServer = introspectServer;
|
|
7
4
|
const ts_necessities_1 = require("@glideapps/ts-necessities");
|
|
8
|
-
const cross_fetch_1 = __importDefault(require("cross-fetch"));
|
|
9
5
|
const graphql_1 = require("graphql");
|
|
10
6
|
const quicktype_core_1 = require("quicktype-core");
|
|
11
7
|
// https://github.com/apollographql/apollo-codegen/blob/master/src/downloadSchema.ts
|
|
@@ -28,12 +24,12 @@ async function introspectServer(url, method, headerStrings) {
|
|
|
28
24
|
}
|
|
29
25
|
let result;
|
|
30
26
|
try {
|
|
31
|
-
const response = await
|
|
27
|
+
const response = await globalThis.fetch(url, {
|
|
32
28
|
method,
|
|
33
29
|
headers: headers,
|
|
34
30
|
body: JSON.stringify({ query: (0, graphql_1.getIntrospectionQuery)() }),
|
|
35
31
|
});
|
|
36
|
-
result = await response.json();
|
|
32
|
+
result = (await response.json());
|
|
37
33
|
}
|
|
38
34
|
catch (error) {
|
|
39
35
|
return (0, quicktype_core_1.panic)(`Error while fetching introspection query result: ${(0, ts_necessities_1.exceptionToString)(error)}`);
|
package/package.json
CHANGED
|
@@ -1,94 +1,92 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
"
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
"dist"
|
|
92
|
-
],
|
|
93
|
-
"bin": "dist/index.js"
|
|
2
|
+
"name": "quicktype",
|
|
3
|
+
"version": "24.0.0",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"repository": "https://github.com/glideapps/quicktype",
|
|
8
|
+
"engines": {
|
|
9
|
+
"node": ">=20.0.0"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"pub": "script/publish-npm.sh && script/publish-vscode.sh",
|
|
13
|
+
"pub:npm": "script/publish-npm.sh",
|
|
14
|
+
"pub:vscode": "script/publish-vscode.sh",
|
|
15
|
+
"build": "npm run clean && npm run build --workspaces --if-present && node node_modules/typescript/bin/tsc",
|
|
16
|
+
"test": "npm run test:unit && npm run test:fixtures",
|
|
17
|
+
"test:unit": "vitest run",
|
|
18
|
+
"test:unit:watch": "vitest",
|
|
19
|
+
"test:fixtures": "script/test",
|
|
20
|
+
"test:release": "ts-node test/release-version.ts",
|
|
21
|
+
"start": "script/watch",
|
|
22
|
+
"clean": "rm -rf dist *~ packages/*/{dist,out}",
|
|
23
|
+
"debug": "node --inspect-brk --max-old-space-size=4096 ./dist/index.js",
|
|
24
|
+
"lint": "eslint src/** packages/*/src/**",
|
|
25
|
+
"lint:fix": "eslint --fix src/** packages/*/src/**"
|
|
26
|
+
},
|
|
27
|
+
"workspaces": [
|
|
28
|
+
"./packages/quicktype-core",
|
|
29
|
+
"./packages/quicktype-graphql-input",
|
|
30
|
+
"./packages/quicktype-typescript-input",
|
|
31
|
+
"./packages/quicktype-vscode"
|
|
32
|
+
],
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@glideapps/ts-necessities": "^2.2.3",
|
|
35
|
+
"chalk": "^4.1.2",
|
|
36
|
+
"collection-utils": "^1.0.1",
|
|
37
|
+
"command-line-args": "^5.2.1",
|
|
38
|
+
"command-line-usage": "^7.0.1",
|
|
39
|
+
"graphql": "^16.11.0",
|
|
40
|
+
"lodash": "^4.18.1",
|
|
41
|
+
"moment": "^2.30.1",
|
|
42
|
+
"quicktype-core": "24.0.0",
|
|
43
|
+
"quicktype-graphql-input": "24.0.0",
|
|
44
|
+
"quicktype-typescript-input": "24.0.0",
|
|
45
|
+
"readable-stream": "^4.5.2",
|
|
46
|
+
"stream-json": "1.8.0",
|
|
47
|
+
"string-to-stream": "^3.0.1",
|
|
48
|
+
"typescript": "~5.8.3"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@biomejs/biome": "^1.9.4",
|
|
52
|
+
"@tsconfig/node20": "^20.1.6",
|
|
53
|
+
"@types/command-line-args": "^5.2.0",
|
|
54
|
+
"@types/command-line-usage": "^5.0.4",
|
|
55
|
+
"@types/lodash": "^4.17.0",
|
|
56
|
+
"@types/node": "~20.19.0",
|
|
57
|
+
"@types/semver": "^7.5.0",
|
|
58
|
+
"@types/shelljs": "^0.10.0",
|
|
59
|
+
"@types/stream-json": "^1.7.3",
|
|
60
|
+
"@types/urijs": "^1.19.25",
|
|
61
|
+
"@types/wordwrap": "^1.0.3",
|
|
62
|
+
"@typescript-eslint/eslint-plugin": "^6.3.0",
|
|
63
|
+
"@typescript-eslint/parser": "^6.3.0",
|
|
64
|
+
"ajv": "^5.5.2",
|
|
65
|
+
"deep-equal": "^2.2.3",
|
|
66
|
+
"esbuild": "^0.28.1",
|
|
67
|
+
"exit": "^0.1.2",
|
|
68
|
+
"promise-timeout": "^1.3.0",
|
|
69
|
+
"semver": "^7.5.4",
|
|
70
|
+
"shelljs": "^0.10.0",
|
|
71
|
+
"tree-sitter-c": "^0.24.1",
|
|
72
|
+
"tree-sitter-c-sharp": "^0.23.5",
|
|
73
|
+
"tree-sitter-cpp": "^0.23.4",
|
|
74
|
+
"tree-sitter-go": "^0.25.0",
|
|
75
|
+
"tree-sitter-haskell": "^0.23.1",
|
|
76
|
+
"tree-sitter-java": "^0.23.5",
|
|
77
|
+
"tree-sitter-php": "^0.24.2",
|
|
78
|
+
"tree-sitter-python": "^0.25.0",
|
|
79
|
+
"tree-sitter-ruby": "^0.23.1",
|
|
80
|
+
"tree-sitter-rust": "^0.24.0",
|
|
81
|
+
"tree-sitter-scala": "^0.24.0",
|
|
82
|
+
"tree-sitter-typescript": "^0.23.2",
|
|
83
|
+
"ts-node": "^10.9.2",
|
|
84
|
+
"vitest": "^4.1.10",
|
|
85
|
+
"watch": "^1.0.2",
|
|
86
|
+
"web-tree-sitter": "^0.26.9"
|
|
87
|
+
},
|
|
88
|
+
"files": [
|
|
89
|
+
"dist"
|
|
90
|
+
],
|
|
91
|
+
"bin": "dist/index.js"
|
|
94
92
|
}
|