-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Import VS Code extension from glideapps/quicktype-vscode (#2559)
* Import VS Code extension from glideapps/quicktype-vscode * Unused * Publish script
- Loading branch information
Showing
13 changed files
with
8,507 additions
and
931 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v18.12.0 | ||
v18.18.0 |
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
**Supports** `C (cJSON)`, `C#`, `C++`, `Crystal`, `Dart`, `Elm`, `Flow`, `Go`, `Haskell`, `JSON Schema`, `Java`, `JavaScript`, `JavaScript PropTypes`, `Kotlin`, `Objective-C`, `PHP`, `Pike`, `Python`, `Ruby`, `Rust`, `Scala3`, `Smithy`, `Swift`, `TypeScript`, `TypeScript Effect Schema` and `TypeScript Zod` | ||
|
||
- Interactively generate types and (de-)serialization code from JSON, JSON Schema, and TypeScript | ||
- Paste JSON/JSON Schema/TypeScript as code | ||
|
||
![](https://raw.githubusercontent.com/quicktype/quicktype-vscode/master/media/demo-interactive.gif) | ||
|
||
`quicktype` infers types from sample JSON data, then outputs strongly typed models and serializers for working with that data in your desired programming language. For more explanation, read [A first look at quicktype](http://blog.quicktype.io/first-look/). | ||
|
||
In any JSON file, use the command "Open quicktype for JSON" to summon quicktype, which will generate types from the JSON. Invoke "Change quicktype's target language" to pick a different language. There are similar "Open quicktype" commands for JSON Schema and TypeScript. | ||
|
||
Another way to use quicktype is to copy JSON into the clipboard and invoke "Paste JSON as code/types": | ||
|
||
![](https://raw.githubusercontent.com/quicktype/quicktype-vscode/master/media/demo.gif) | ||
|
||
For a more powerful experience, including custom options and the ability to generate code from multiple JSON samples, try [quicktype.io](https://app.quicktype.io). | ||
|
||
## Installing | ||
|
||
This extension is available for free in the [Visual Studio Code Marketplace](https://marketplace.visualstudio.com/items/quicktype.quicktype) | ||
|
||
## Customization | ||
|
||
- `quicktype.justTypes`: Generate only types, or also produce (de)serialization code when using "Open quicktype". When using "Paste", you can pick between the commands for "types" and "code", without having to set this option. | ||
|
||
- `quicktype.inferMaps`, `quicktype.inferEnums`, `quicktype.inferDateTimes`, `quicktype.inferUuids`, `quicktype.inferBoolStrings`, `quicktype.inferIntegerStrings`: Tell quicktype whether it should try to infer those types from the input JSON. This is not a precise science, so sometimes the guess will be wrong, which is why you can turn them off through these options. Also, quicktype doesn't support dates, UUIDs and stringified integers/booleans in all target languages yet. | ||
|
||
## Contribute! | ||
|
||
quicktype is an open source project, and we're always happy about contributors. If you can think of a way to improve [this extension](https://github.com/quicktype/quicktype-vscode), or [quicktype](https://github.com/quicktype/quicktype), please consider contributing, especially if you know TypeScript. Code is only one way to contribute, though: we're particularly short on documentation. We'd also love to hear your feedback - come [talk to us on Slack](http://slack.quicktype.io)! | ||
|
||
If you find a bug, please [report it on GitHub](https://github.com/quicktype/quicktype-vscode/issues). |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,169 @@ | ||
{ | ||
"name": "quicktype", | ||
"displayName": "Paste JSON as Code", | ||
"description": "Copy JSON, paste as Go, TypeScript, C#, C++ and more.", | ||
"version": "23.0.105", | ||
"publisher": "quicktype", | ||
"icon": "media/icon.png", | ||
"galleryBanner": { | ||
"color": "#00212b", | ||
"theme": "dark" | ||
}, | ||
"homepage": "https://quicktype.io", | ||
"author": { | ||
"name": "quicktype.io", | ||
"email": "[email protected]" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/quicktype-vscode/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/glideapps/quicktype-vscode" | ||
}, | ||
"engines": { | ||
"vscode": "^1.87.0" | ||
}, | ||
"categories": [ | ||
"Other" | ||
], | ||
"keywords": [ | ||
"json", | ||
"converter" | ||
], | ||
"markdown": "github", | ||
"activationEvents": [ | ||
"onCommand:quicktype.pasteJSONAsTypes", | ||
"onCommand:quicktype.pasteJSONAsTypesAndSerialization", | ||
"onCommand:quicktype.pasteJSONSchemaAsTypes", | ||
"onCommand:quicktype.pasteJSONSchemaAsTypesAndSerialization", | ||
"onCommand:quicktype.pasteTypeScriptAsTypesAndSerialization", | ||
"onCommand:quicktype.openForJSON", | ||
"onCommand:quicktype.openForJSONSchema", | ||
"onCommand:quicktype.openForTypeScript" | ||
], | ||
"main": "./out/src/extension", | ||
"contributes": { | ||
"configuration": { | ||
"type": "object", | ||
"title": "quicktype", | ||
"properties": { | ||
"quicktype.justTypes": { | ||
"type": "boolean", | ||
"default": true, | ||
"description": "Produce only types; no (de-)serialization code" | ||
}, | ||
"quicktype.inferMaps": { | ||
"type": "boolean", | ||
"default": true, | ||
"description": "Infer maps when object keys look like map keys." | ||
}, | ||
"quicktype.inferEnums": { | ||
"type": "boolean", | ||
"default": true, | ||
"description": "Infer enums when there aren't many different string values." | ||
}, | ||
"quicktype.inferDateTimes": { | ||
"type": "boolean", | ||
"default": true, | ||
"description": "Use date-time types for strings that look like date-times." | ||
}, | ||
"quicktype.inferUuids": { | ||
"type": "boolean", | ||
"default": true, | ||
"description": "Use UUID types for strings that look like UUIDs." | ||
}, | ||
"quicktype.inferIntegerStrings": { | ||
"type": "boolean", | ||
"default": true, | ||
"description": "Convert stringified integers into integers, and back." | ||
}, | ||
"quicktype.inferBooleanStrings": { | ||
"type": "boolean", | ||
"default": true, | ||
"description": "Convert stringified booleans into booleans, and back." | ||
} | ||
} | ||
}, | ||
"commands": [ | ||
{ | ||
"command": "quicktype.pasteJSONAsTypes", | ||
"title": "Paste JSON as Types" | ||
}, | ||
{ | ||
"command": "quicktype.pasteJSONAsTypesAndSerialization", | ||
"title": "Paste JSON as Code" | ||
}, | ||
{ | ||
"command": "quicktype.pasteJSONSchemaAsTypes", | ||
"title": "Paste JSON Schema as Types" | ||
}, | ||
{ | ||
"command": "quicktype.pasteJSONSchemaAsTypesAndSerialization", | ||
"title": "Paste JSON Schema as Code" | ||
}, | ||
{ | ||
"command": "quicktype.pasteTypeScriptAsTypesAndSerialization", | ||
"title": "Paste TypeScript as Code" | ||
}, | ||
{ | ||
"command": "quicktype.openForJSON", | ||
"title": "Open quicktype for JSON" | ||
}, | ||
{ | ||
"command": "quicktype.openForJSONSchema", | ||
"title": "Open quicktype for JSON Schema" | ||
}, | ||
{ | ||
"command": "quicktype.openForTypeScript", | ||
"title": "Open quicktype for TypeScript" | ||
}, | ||
{ | ||
"command": "quicktype.changeTargetLanguage", | ||
"title": "Set quicktype target language" | ||
} | ||
], | ||
"keybindings": [ | ||
{ | ||
"command": "quicktype.pasteJSONAsTypesAndSerialization", | ||
"key": "ctrl+shift+V", | ||
"mac": "cmd+shift+V", | ||
"when": "editorTextFocus && editorLangId != 'markdown'" | ||
}, | ||
{ | ||
"command": "quicktype.pasteJSONAsTypes", | ||
"key": "ctrl+shift+alt+V", | ||
"mac": "cmd+shift+alt+V", | ||
"when": "editorTextFocus" | ||
} | ||
] | ||
}, | ||
"scripts": { | ||
"publish": "vsce publish -p $VSCE_TOKEN", | ||
"package": "vsce package", | ||
"vscode:prepublish": "npm run build", | ||
"build": "tsc -p ./", | ||
"watch": "tsc -watch -p ./", | ||
"test": "npm run compile && node ./node_modules/vscode/bin/test" | ||
}, | ||
"devDependencies": { | ||
"@types/mocha": "^10.0.6", | ||
"@types/node": "18.x", | ||
"@types/node-persist": "^3.1.8", | ||
"@types/readable-stream": "^4.0.10", | ||
"@types/vscode": "^1.87.0", | ||
"@typescript-eslint/eslint-plugin": "^7.0.2", | ||
"@typescript-eslint/parser": "^7.0.2", | ||
"@vscode/test-cli": "^0.0.6", | ||
"@vscode/test-electron": "^2.3.9", | ||
"@vscode/vsce": "^2.25.0", | ||
"eslint": "^8.56.0", | ||
"typescript": "^5.3.3" | ||
}, | ||
"dependencies": { | ||
"node-persist": "^4.0.1", | ||
"quicktype-core": "file:../quicktype-core", | ||
"quicktype-typescript-input": "file:../quicktype-typescript-input", | ||
"unicode-properties": "github:quicktype/unicode-properties#dist" | ||
} | ||
} |
Oops, something went wrong.