@asyncapi/cli 0.50.2 → 0.51.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.
|
@@ -28,6 +28,7 @@ export default class Models extends Command {
|
|
|
28
28
|
tsExportType: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
29
29
|
tsJsonBinPack: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
30
30
|
tsMarshalling: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
31
|
+
tsExampleInstance: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
31
32
|
/**
|
|
32
33
|
* Go and Java specific package name to use for the generated models
|
|
33
34
|
*/
|
|
@@ -26,7 +26,7 @@ class Models extends base_1.default {
|
|
|
26
26
|
run() {
|
|
27
27
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
28
28
|
const { args, flags } = yield this.parse(Models);
|
|
29
|
-
const { tsModelType, tsEnumType, tsIncludeComments, tsModuleSystem, tsExportType, tsJsonBinPack, tsMarshalling, namespace, csharpAutoImplement, csharpArrayType, csharpNewtonsoft, csharpHashcode, csharpEqual, csharpSystemJson, packageName, output } = flags;
|
|
29
|
+
const { tsModelType, tsEnumType, tsIncludeComments, tsModuleSystem, tsExportType, tsJsonBinPack, tsMarshalling, tsExampleInstance, namespace, csharpAutoImplement, csharpArrayType, csharpNewtonsoft, csharpHashcode, csharpEqual, csharpSystemJson, packageName, output } = flags;
|
|
30
30
|
const { language, file } = args;
|
|
31
31
|
const inputFile = (yield (0, SpecificationFile_1.load)(file)) || (yield (0, SpecificationFile_1.load)());
|
|
32
32
|
const { document, diagnostics, status } = yield (0, parser_1.parse)(this, inputFile, flags);
|
|
@@ -52,27 +52,25 @@ class Models extends base_1.default {
|
|
|
52
52
|
let fileGenerator;
|
|
53
53
|
let fileOptions = {};
|
|
54
54
|
const presets = [];
|
|
55
|
+
const options = {
|
|
56
|
+
marshalling: tsMarshalling,
|
|
57
|
+
example: tsExampleInstance,
|
|
58
|
+
};
|
|
55
59
|
switch (language) {
|
|
56
60
|
case Languages.typescript:
|
|
61
|
+
presets.push({
|
|
62
|
+
preset: modelina_1.TS_COMMON_PRESET,
|
|
63
|
+
options
|
|
64
|
+
});
|
|
57
65
|
if (tsIncludeComments) {
|
|
58
66
|
presets.push(modelina_1.TS_DESCRIPTION_PRESET);
|
|
59
67
|
}
|
|
60
68
|
if (tsJsonBinPack) {
|
|
61
69
|
presets.push({
|
|
62
70
|
preset: modelina_1.TS_COMMON_PRESET,
|
|
63
|
-
options
|
|
64
|
-
marshalling: true
|
|
65
|
-
}
|
|
71
|
+
options
|
|
66
72
|
}, modelina_1.TS_JSONBINPACK_PRESET);
|
|
67
73
|
}
|
|
68
|
-
if (tsMarshalling) {
|
|
69
|
-
presets.push({
|
|
70
|
-
preset: modelina_1.TS_COMMON_PRESET,
|
|
71
|
-
options: {
|
|
72
|
-
marshalling: true
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
74
|
fileGenerator = new modelina_1.TypeScriptFileGenerator({
|
|
77
75
|
modelType: tsModelType,
|
|
78
76
|
enumType: tsEnumType,
|
|
@@ -255,6 +253,10 @@ Models.flags = Object.assign({ help: core_1.Flags.help({ char: 'h' }), output: c
|
|
|
255
253
|
description: 'TypeScript specific, generate the models with marshalling functions.',
|
|
256
254
|
required: false,
|
|
257
255
|
default: false,
|
|
256
|
+
}), tsExampleInstance: core_1.Flags.boolean({
|
|
257
|
+
description: 'Typescript specific, generate example of the model',
|
|
258
|
+
required: false,
|
|
259
|
+
default: false,
|
|
258
260
|
}),
|
|
259
261
|
/**
|
|
260
262
|
* Go and Java specific package name to use for the generated models
|
package/oclif.manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.51.0",
|
|
3
3
|
"commands": {
|
|
4
4
|
"bundle": {
|
|
5
5
|
"id": "bundle",
|
|
@@ -576,6 +576,13 @@
|
|
|
576
576
|
"required": false,
|
|
577
577
|
"allowNo": false
|
|
578
578
|
},
|
|
579
|
+
"tsExampleInstance": {
|
|
580
|
+
"name": "tsExampleInstance",
|
|
581
|
+
"type": "boolean",
|
|
582
|
+
"description": "Typescript specific, generate example of the model",
|
|
583
|
+
"required": false,
|
|
584
|
+
"allowNo": false
|
|
585
|
+
},
|
|
579
586
|
"packageName": {
|
|
580
587
|
"name": "packageName",
|
|
581
588
|
"type": "option",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asyncapi/cli",
|
|
3
3
|
"description": "All in one CLI for all AsyncAPI tools",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.51.0",
|
|
5
5
|
"author": "@asyncapi",
|
|
6
6
|
"bin": {
|
|
7
7
|
"asyncapi": "./bin/run"
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"@asyncapi/bundler": "^0.3.8",
|
|
13
13
|
"@asyncapi/converter": "^1.2.1",
|
|
14
14
|
"@asyncapi/diff": "^0.4.1",
|
|
15
|
-
"@asyncapi/generator": "^1.10.
|
|
15
|
+
"@asyncapi/generator": "^1.10.10",
|
|
16
16
|
"@asyncapi/modelina": "^1.8.6",
|
|
17
17
|
"@asyncapi/openapi-schema-parser": "^3.0.3",
|
|
18
18
|
"@asyncapi/optimizer": "^0.1.18",
|
|
@@ -46,10 +46,6 @@
|
|
|
46
46
|
"@babel/core": "^7.19.3",
|
|
47
47
|
"@jest/types": "^29.1.0",
|
|
48
48
|
"@oclif/test": "^2",
|
|
49
|
-
"@semantic-release/commit-analyzer": "^8.0.1",
|
|
50
|
-
"@semantic-release/github": "^7.2.3",
|
|
51
|
-
"@semantic-release/npm": "^7.1.3",
|
|
52
|
-
"@semantic-release/release-notes-generator": "^9.0.2",
|
|
53
49
|
"@swc/core": "^1.3.2",
|
|
54
50
|
"@swc/jest": "^0.2.22",
|
|
55
51
|
"@types/chai": "^4.3.3",
|
|
@@ -67,7 +63,7 @@
|
|
|
67
63
|
"@typescript-eslint/parser": "^5.38.1",
|
|
68
64
|
"acorn": "^8.5.0",
|
|
69
65
|
"chai": "^4.3.6",
|
|
70
|
-
"conventional-changelog-conventionalcommits": "^
|
|
66
|
+
"conventional-changelog-conventionalcommits": "^5.0.0",
|
|
71
67
|
"cross-env": "^7.0.3",
|
|
72
68
|
"eslint": "^8.24.0",
|
|
73
69
|
"eslint-config-oclif": "^4",
|
|
@@ -81,7 +77,6 @@
|
|
|
81
77
|
"react": "^16.14.0",
|
|
82
78
|
"react-dom": "^16.14.0",
|
|
83
79
|
"rimraf": "^3.0.2",
|
|
84
|
-
"semantic-release": "^17.4.3",
|
|
85
80
|
"simple-git": "^2.48.0",
|
|
86
81
|
"ts-node": "^10.9.1",
|
|
87
82
|
"tslib": "^2.3.1",
|
|
@@ -126,27 +121,6 @@
|
|
|
126
121
|
"publishConfig": {
|
|
127
122
|
"access": "public"
|
|
128
123
|
},
|
|
129
|
-
"release": {
|
|
130
|
-
"branches": [
|
|
131
|
-
"master"
|
|
132
|
-
],
|
|
133
|
-
"plugins": [
|
|
134
|
-
[
|
|
135
|
-
"@semantic-release/commit-analyzer",
|
|
136
|
-
{
|
|
137
|
-
"preset": "conventionalcommits"
|
|
138
|
-
}
|
|
139
|
-
],
|
|
140
|
-
[
|
|
141
|
-
"@semantic-release/release-notes-generator",
|
|
142
|
-
{
|
|
143
|
-
"preset": "conventionalcommits"
|
|
144
|
-
}
|
|
145
|
-
],
|
|
146
|
-
"@semantic-release/npm",
|
|
147
|
-
"@semantic-release/github"
|
|
148
|
-
]
|
|
149
|
-
},
|
|
150
124
|
"optionalDependencies": {
|
|
151
125
|
"fsevents": "^2.3.2"
|
|
152
126
|
},
|