diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..f1eb4bf --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "cfn-resource-actions.stackName": "serverlessrepo-evb-local" +} \ No newline at end of file diff --git a/src/commands/code-binding/languages/csharp.js b/src/commands/code-binding/languages/csharp.js new file mode 100644 index 0000000..59ad694 --- /dev/null +++ b/src/commands/code-binding/languages/csharp.js @@ -0,0 +1,24 @@ +const { CSharpTargetLanguage } = require("quicktype-core"); +const { + StringOption, + EnumOption, + } = require("quicktype-core/dist/RendererOptions"); + +const cSharpOptions = require("quicktype-core/dist/language/CSharp"); +const languages = require("quicktype-core/dist/language/All"); +languages.all.splice(languages.all.findIndex(v => v.displayName === "C#"), 1) +languages.all.unshift(new CSharpTargetLanguage("C#", ["csharp"], "cs")); +cSharpOptions.cSharpOptions.namespace = new StringOption( + "Namespace", + null, + null, + "AutoGenerated" +); +cSharpOptions.cSharpOptions.useList = new EnumOption( + "array-type", + "Use T[] or List", + [ + ["array", true], + ["list", false], + ] +); diff --git a/src/commands/code-binding/languages/java.js b/src/commands/code-binding/languages/java.js new file mode 100644 index 0000000..263938c --- /dev/null +++ b/src/commands/code-binding/languages/java.js @@ -0,0 +1,16 @@ +const { + BooleanOption, + } = require("quicktype-core/dist/RendererOptions"); + +const options = require("quicktype-core/dist/language/Java"); + +options.javaOptions.justTypes = new BooleanOption( + "JustTypes", + null, + true +); +options.javaOptions.useList = new BooleanOption( + "UseList", + null, + true +); diff --git a/src/commands/code-binding/languages/python.js b/src/commands/code-binding/languages/python.js new file mode 100644 index 0000000..c0490f9 --- /dev/null +++ b/src/commands/code-binding/languages/python.js @@ -0,0 +1,12 @@ +const { + BooleanOption, + } = require("quicktype-core/dist/RendererOptions"); + +const pythonOptions = require("quicktype-core/dist/language/Python"); + +pythonOptions.pythonOptions.justTypes = new BooleanOption( + "JustTypes", + null, + true + ); + \ No newline at end of file diff --git a/src/commands/code-binding/languages/swift.js b/src/commands/code-binding/languages/swift.js new file mode 100644 index 0000000..8df7ca1 --- /dev/null +++ b/src/commands/code-binding/languages/swift.js @@ -0,0 +1,11 @@ +const { + BooleanOption, + } = require("quicktype-core/dist/RendererOptions"); + +const options = require("quicktype-core/dist/language/Swift"); + +options.swiftOptions.justTypes = new BooleanOption( + "JustTypes", + null, + true +); diff --git a/src/commands/code-binding/languages/typescript.js b/src/commands/code-binding/languages/typescript.js new file mode 100644 index 0000000..1f26fcd --- /dev/null +++ b/src/commands/code-binding/languages/typescript.js @@ -0,0 +1,12 @@ +const { + BooleanOption, + } = require("quicktype-core/dist/RendererOptions"); + +const typeScriptOptions = require("quicktype-core/dist/language/TypeScriptFlow"); + +typeScriptOptions.tsFlowOptions.justTypes = new BooleanOption( + "JustTypes", + null, + true + ); + \ No newline at end of file