quicktype 23.3.25 → 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 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 run test
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 (0, cross_fetch_1.default)(url, {
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
- "name": "quicktype",
3
- "version": "23.3.25",
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": ">=18.12.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 && tsc",
16
- "test": "script/test",
17
- "start": "script/watch",
18
- "clean": "rm -rf dist *~ packages/*/{dist,out}",
19
- "debug": "node --inspect-brk --max-old-space-size=4096 ./dist/index.js",
20
- "lint": "eslint src/** packages/*/src/**",
21
- "lint:fix": "eslint --fix src/** packages/*/src/**"
22
- },
23
- "workspaces": [
24
- "./packages/quicktype-core",
25
- "./packages/quicktype-graphql-input",
26
- "./packages/quicktype-typescript-input",
27
- "./packages/quicktype-vscode"
28
- ],
29
- "dependencies": {
30
- "@glideapps/ts-necessities": "^2.2.3",
31
- "chalk": "^4.1.2",
32
- "collection-utils": "^1.0.1",
33
- "command-line-args": "^5.2.1",
34
- "command-line-usage": "^7.0.1",
35
- "cross-fetch": "^4.0.0",
36
- "graphql": "^16.11.0",
37
- "lodash": "^4.18.1",
38
- "moment": "^2.30.1",
39
- "quicktype-core": "23.3.25",
40
- "quicktype-graphql-input": "23.3.25",
41
- "quicktype-typescript-input": "23.3.25",
42
- "readable-stream": "^4.5.2",
43
- "stream-json": "1.8.0",
44
- "string-to-stream": "^3.0.1",
45
- "typescript": "~5.8.3"
46
- },
47
- "devDependencies": {
48
- "@biomejs/biome": "^1.9.4",
49
- "@tsconfig/node18": "^1.0.1",
50
- "@types/command-line-args": "^5.2.0",
51
- "@types/command-line-usage": "^5.0.4",
52
- "@types/lodash": "^4.17.0",
53
- "@types/semver": "^7.5.0",
54
- "@types/shelljs": "^0.10.0",
55
- "@types/stream-json": "^1.7.3",
56
- "@types/urijs": "^1.19.25",
57
- "@types/wordwrap": "^1.0.3",
58
- "@typescript-eslint/eslint-plugin": "^6.3.0",
59
- "@typescript-eslint/parser": "^6.3.0",
60
- "ajv": "^5.5.2",
61
- "deep-equal": "^2.2.3",
62
- "esbuild": "^0.28.1",
63
- "exit": "^0.1.2",
64
- "promise-timeout": "^1.3.0",
65
- "semver": "^7.5.4",
66
- "shelljs": "^0.10.0",
67
- "tree-sitter-c": "^0.24.1",
68
- "tree-sitter-c-sharp": "^0.23.5",
69
- "tree-sitter-cpp": "^0.23.4",
70
- "tree-sitter-go": "^0.25.0",
71
- "tree-sitter-haskell": "^0.23.1",
72
- "tree-sitter-java": "^0.23.5",
73
- "tree-sitter-php": "^0.24.2",
74
- "tree-sitter-python": "^0.25.0",
75
- "tree-sitter-ruby": "^0.23.1",
76
- "tree-sitter-rust": "^0.24.0",
77
- "tree-sitter-scala": "^0.24.0",
78
- "tree-sitter-typescript": "^0.23.2",
79
- "ts-node": "^10.9.2",
80
- "watch": "^1.0.2",
81
- "web-tree-sitter": "^0.26.9"
82
- },
83
- "overrides": {
84
- "cross-fetch": {
85
- "node-fetch": {
86
- "whatwg-url": "^13.0.0"
87
- }
88
- }
89
- },
90
- "files": [
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
  }