Skip to content

Commit 657fa8e

Browse files
fix: updated the method of importing the parser (#1045)
Co-authored-by: asyncapi-bot <[email protected]>
1 parent 0676ea0 commit 657fa8e

File tree

8 files changed

+581
-872
lines changed

8 files changed

+581
-872
lines changed

.changeset/bubble-beach.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@asyncapi/multi-parser": patch
3+
---
4+
5+
Updated the method of importing the parser in the Nunjucks filter. Standardized the import of different parser functions.

package-lock.json

+567-863
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/multi-parser/jest.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const config: Config.InitialOptions = {
2222
'src/**'
2323
],
2424
moduleNameMapper: {
25-
'^parserapiv3$': path.resolve(__dirname, '../parser')
25+
'^@asyncapi/parser$': path.resolve(__dirname, '../parser')
2626
}
2727
};
2828

packages/multi-parser/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"@asyncapi/raml-dt-schema-parser": "^4.0.4",
4646
"parserapiv1": "npm:@asyncapi/parser@^2.1.0",
4747
"parserapiv2": "npm:@asyncapi/[email protected]",
48-
"parserapiv3": "file:../parser"
48+
"@asyncapi/parser": "*"
4949
},
5050
"devDependencies": {
5151
"@jest/types": "^29.0.2",

packages/multi-parser/src/convert.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { createAsyncAPIDocument as createAsyncAPIDocumentParserV1 } from 'parserapiv1';
22
import { createAsyncAPIDocument as createAsyncAPIDocumentParserV2 } from 'parserapiv2';
3-
import { createAsyncAPIDocument as createAsyncAPIDocumentParserV3 } from 'parserapiv3/esm/index';
3+
import { createAsyncAPIDocument as createAsyncAPIDocumentParserV3 } from '@asyncapi/parser';
44

55
import type { AsyncAPIDocumentInterface as AsyncAPIDocumentInterfaceParserV1 } from 'parserapiv1';
66
import type { AsyncAPIDocumentInterface as AsyncAPIDocumentInterfaceParserV2 } from 'parserapiv2';
7-
import type { AsyncAPIDocumentInterface as AsyncAPIDocumentInterfaceParserV3 } from 'parserapiv3/esm/index';
7+
import type { AsyncAPIDocumentInterface as AsyncAPIDocumentInterfaceParserV3 } from '@asyncapi/parser';
88

99
import type { DetailedAsyncAPI as DetailedAsyncAPIParserV1 } from 'parserapiv1/esm/types';
1010
import type { DetailedAsyncAPI as DetailedAsyncAPIParserV2 } from 'parserapiv2/esm/types';
11-
import type { DetailedAsyncAPI as DetailedAsyncAPIParserV3 } from 'parserapiv3/esm/types';
11+
import type { DetailedAsyncAPI as DetailedAsyncAPIParserV3 } from '@asyncapi/parser/esm/types';
1212

1313
export type AsyncAPIDocument = AsyncAPIDocumentInterfaceParserV1 | AsyncAPIDocumentInterfaceParserV2 | AsyncAPIDocumentInterfaceParserV3;
1414

packages/multi-parser/src/parse.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Parser as ParserV1 } from 'parserapiv1';
22
import { Parser as ParserV2 } from 'parserapiv2';
3-
import { Parser as ParserV3 } from 'parserapiv3/esm/index';
3+
import { Parser as ParserV3 } from '@asyncapi/parser';
44

55
import { AvroSchemaParser } from '@asyncapi/avro-schema-parser';
66
import { OpenAPISchemaParser } from '@asyncapi/openapi-schema-parser';
@@ -9,7 +9,7 @@ import { ProtoBuffSchemaParser } from '@asyncapi/protobuf-schema-parser';
99

1010
import type { ParserOptions as ParserOptionsParserV1 } from 'parserapiv1/esm/parser';
1111
import type { ParserOptions as ParserOptionsParserV2 } from 'parserapiv2/esm/parser';
12-
import type { ParserOptions as ParserOptionsParserV3 } from 'parserapiv3/esm/parser';
12+
import type { ParserOptions as ParserOptionsParserV3 } from '@asyncapi/parser/esm/parser';
1313

1414
export type ParserOptions = ParserOptionsParserV1 | ParserOptionsParserV2 | ParserOptionsParserV3;
1515
export type Options = {

packages/multi-parser/test/convert.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
import { Parser as ParserV1 } from 'parserapiv1';
33
import { Parser as ParserV2 } from 'parserapiv2';
4-
import { Parser as ParserV3 } from 'parserapiv3/esm/index';
4+
import { Parser as ParserV3 } from '@asyncapi/parser';
55

66
import { AsyncAPIDocument, ConvertDocumentParserAPIVersion } from '../src/convert';
77

packages/multi-parser/test/parse.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
import { Parser as ParserV1 } from 'parserapiv1';
33
import { Parser as ParserV2 } from 'parserapiv2';
4-
import { Parser as ParserV3 } from 'parserapiv3/esm/index';
4+
import { Parser as ParserV3 } from '@asyncapi/parser';
55

66
import { AvroSchemaParser } from '@asyncapi/avro-schema-parser';
77
import { OpenAPISchemaParser } from '@asyncapi/openapi-schema-parser';

0 commit comments

Comments
 (0)