@asyncapi/cli 0.54.8 → 0.55.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
@@ -83,6 +83,7 @@ Thanks go to these wonderful people ([emoji key](https://allcontributors.org/doc
83
83
  </tr>
84
84
  <tr>
85
85
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/mhmohona"><img src="https://avatars.githubusercontent.com/u/14244685?v=4?s=100" width="100px;" alt="Mahfuza Humayra Mohona"/><br /><sub><b>Mahfuza Humayra Mohona</b></sub></a><br /><a href="https://github.com/asyncapi/cli/commits?author=mhmohona" title="Documentation">📖</a></td>
86
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/GreenRover"><img src="https://avatars.githubusercontent.com/u/512850?v=4?s=100" width="100px;" alt="Heiko Henning"/><br /><sub><b>Heiko Henning</b></sub></a><br /><a href="https://github.com/asyncapi/cli/commits?author=GreenRover" title="Code">💻</a></td>
86
87
  </tr>
87
88
  </tbody>
88
89
  </table>
@@ -3404,7 +3404,7 @@
3404
3404
  "version": "1.1.2",
3405
3405
  "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz",
3406
3406
  "integrity": "sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==",
3407
- "deprecated": "This functionality has been moved to @npmcli/fs",
3407
+ "deprecated": "This integration has been moved to @npmcli/fs",
3408
3408
  "dependencies": {
3409
3409
  "mkdirp": "^1.0.4",
3410
3410
  "rimraf": "^3.0.2"
@@ -9835,7 +9835,7 @@
9835
9835
  "version": "1.1.0",
9836
9836
  "resolved": "https://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.1.0.tgz",
9837
9837
  "integrity": "sha512-asaikDeqAQg7JifRsZn1NJZXo9E+VwlyCfbkZhwyISinqk5zNS6266HS5kah6P0SaQKGF6SkNnZVHUzHFYxYDw==",
9838
- "deprecated": "This functionality has been moved to @npmcli/fs",
9838
+ "deprecated": "This integration has been moved to @npmcli/fs",
9839
9839
  "dependencies": {
9840
9840
  "debuglog": "^1.0.1",
9841
9841
  "dezalgo": "^1.0.0",
@@ -115,8 +115,20 @@ class NewFile extends base_1.default {
115
115
  createAsyncapiFile(fileName, selectedTemplate) {
116
116
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
117
117
  const asyncApiFile = yield readFile((0, path_1.resolve)(__dirname, '../../../assets/examples/', selectedTemplate), { encoding: 'utf8' });
118
- const fileNameHasFileExtension = fileName.includes('.');
119
- const fileNameToWriteToDisk = fileNameHasFileExtension ? fileName : `${fileName}.yaml`;
118
+ let fileNameToWriteToDisk;
119
+ if (!fileName.includes('.')) {
120
+ fileNameToWriteToDisk = `${fileName}.yaml`;
121
+ }
122
+ else {
123
+ const extension = fileName.split('.')[1];
124
+ if (extension === 'yml' || extension === 'yaml' || extension === 'json') {
125
+ fileNameToWriteToDisk = fileName;
126
+ }
127
+ else {
128
+ console.log('CLI Support only yml, yaml and json extension for file');
129
+ return;
130
+ }
131
+ }
120
132
  try {
121
133
  const content = yield readFile(fileNameToWriteToDisk, { encoding: 'utf8' });
122
134
  if (content !== undefined) {
package/lib/parser.js CHANGED
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "convertToOldAPI", { enumerable: true, get: funct
8
8
  const avro_schema_parser_1 = require("@asyncapi/avro-schema-parser");
9
9
  const openapi_schema_parser_1 = require("@asyncapi/openapi-schema-parser");
10
10
  const raml_dt_schema_parser_1 = require("@asyncapi/raml-dt-schema-parser");
11
+ const protobuf_schema_parser_1 = require("@asyncapi/protobuf-schema-parser");
11
12
  const spectral_core_1 = require("@stoplight/spectral-core");
12
13
  const formatters_1 = require("@stoplight/spectral-cli/dist/formatters");
13
14
  const config_1 = require("@stoplight/spectral-cli/dist/services/config");
@@ -21,6 +22,7 @@ const parser = new cjs_1.Parser({
21
22
  parser.registerSchemaParser((0, avro_schema_parser_1.AvroSchemaParser)());
22
23
  parser.registerSchemaParser((0, openapi_schema_parser_1.OpenAPISchemaParser)());
23
24
  parser.registerSchemaParser((0, raml_dt_schema_parser_1.RamlDTSchemaParser)());
25
+ parser.registerSchemaParser((0, protobuf_schema_parser_1.ProtoBuffSchemaParser)());
24
26
  function validationFlags({ logDiagnostics = true } = {}) {
25
27
  return {
26
28
  'log-diagnostics': core_1.Flags.boolean({
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.54.8",
2
+ "version": "0.55.0",
3
3
  "commands": {
4
4
  "bundle": {
5
5
  "id": "bundle",
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.54.8",
4
+ "version": "0.55.0",
5
5
  "author": "@asyncapi",
6
6
  "bin": {
7
7
  "asyncapi": "./bin/run"
@@ -17,6 +17,7 @@
17
17
  "@asyncapi/openapi-schema-parser": "^3.0.3",
18
18
  "@asyncapi/optimizer": "^0.2.1",
19
19
  "@asyncapi/parser": "^2.1.0",
20
+ "@asyncapi/protobuf-schema-parser": "3.0.0",
20
21
  "@asyncapi/raml-dt-schema-parser": "^4.0.3",
21
22
  "@asyncapi/studio": "^0.17.3",
22
23
  "@oclif/core": "^1.26.2",
@@ -43,7 +44,7 @@
43
44
  "ws": "^8.2.3"
44
45
  },
45
46
  "devDependencies": {
46
- "@asyncapi/minimaltemplate": "./test/minimaltemplate",
47
+ "@asyncapi/minimaltemplate": "./test/fixtures/minimaltemplate",
47
48
  "@babel/core": "^7.19.3",
48
49
  "@jest/types": "^29.1.0",
49
50
  "@oclif/test": "^2",