Skip to content
Permalink
Browse files

typescript model generation update (output enums with interfaces as t…

…ypescript classes)
  • Loading branch information...
richturner committed Apr 15, 2019
1 parent 756e3c2 commit 64e623e5485f80c3cc5343e9a160274385d524c5
@@ -0,0 +1 @@
src/index.ts
@@ -7,13 +7,13 @@ buildscript {
jcenter()
}
dependencies {
classpath 'cz.habarta.typescript-generator:typescript-generator-gradle-plugin:2.10.466'
classpath 'cz.habarta.typescript-generator:typescript-generator-gradle-plugin:2.13.489'
}
}

dependencies {
compile resolveProject(":model")
compile 'cz.habarta.typescript-generator:typescript-generator-core:2.9.456'
compile 'cz.habarta.typescript-generator:typescript-generator-core:2.13.489'
}

generateTypeScript {
@@ -43,8 +43,20 @@ generateTypeScript {
]
optionalProperties = "all" // TODO: cleanup model to be more explicit about optional params
mapEnum = cz.habarta.typescript.generator.EnumMapping.asEnum
outputFile = "dist/index.d.ts"
outputFile = "src/index.ts"
outputFileType = "implementationFile"
outputKind = "module"
extensionsWithConfiguration = [
new cz.habarta.typescript.generator.Settings.ConfiguredExtension(
className: "EnumWithInterfacesExtension",
// configuration: [
// enumPattern1: "**AssetType**",
// enumPattern2: "**AttributeType**",
// enumPattern3: "**AttributeValueType**",
// enumPattern4: "**MetaItemType**",
// ]
)
]
}

clean {
@@ -3,7 +3,7 @@
"version": "1.0.1",
"main": "",
"description": "OpenRemote 3.x Model Types",
"types": "dist/index.d.ts",
"types": "src/index.ts",
"scripts": {
"build": "exit 0",
"test": "echo \"No tests\" && exit 0"

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,10 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "./dist/",
"rootDir": "src"
},
"include": [
"./src"
]
}
@@ -7,13 +7,13 @@ buildscript {
jcenter()
}
dependencies {
classpath 'cz.habarta.typescript-generator:typescript-generator-gradle-plugin:2.10.466'
classpath 'cz.habarta.typescript-generator:typescript-generator-gradle-plugin:2.13.489'
}
}

dependencies {
compile resolveProject(":model")
compile 'cz.habarta.typescript-generator:typescript-generator-core:2.9.456'
compile 'cz.habarta.typescript-generator:typescript-generator-core:2.13.489'
}

generateTypeScript {
@@ -38,12 +38,9 @@ generateTypeScript {
importDeclarations = [
"import * as Model from \"@openremote/model\""
]

extensionClasses = [
"AggregatedApiClient"
]
extensions = [
"cz.habarta.typescript.generator.ext.AxiosClientExtension"
"AggregatedApiClient",
"cz.habarta.typescript.generator.ext.AxiosClientExtension"
]
}

@@ -6,5 +6,8 @@
},
"include": [
"./src"
],
"references": [
{ "path": "../model" }
]
}
@@ -30,5 +30,5 @@ const gradleModelWatch = spawnSync((process.platform === "win32" ? "gradlew" : "
cwd: cwd,
shell: true
});
console.log("gradlew modelWatch finished!");
console.log("gradlew modelWatch finished! Status = " + gradleModelWatch.status);
process.exit(gradleModelWatch.status);

0 comments on commit 64e623e

Please sign in to comment.
You can’t perform that action at this time.