Skip to content

Commit

Permalink
Merge branch 'master' into fix-remove-forceful-normalization-of-yaml-…
Browse files Browse the repository at this point in the history
…to-json
  • Loading branch information
smoya authored Aug 2, 2024
2 parents 22bd2e5 + 657fa8e commit 09207d8
Show file tree
Hide file tree
Showing 8 changed files with 581 additions and 872 deletions.
5 changes: 5 additions & 0 deletions .changeset/bubble-beach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@asyncapi/multi-parser": patch
---

Updated the method of importing the parser in the Nunjucks filter. Standardized the import of different parser functions.
1,430 changes: 567 additions & 863 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/multi-parser/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const config: Config.InitialOptions = {
'src/**'
],
moduleNameMapper: {
'^parserapiv3$': path.resolve(__dirname, '../parser')
'^@asyncapi/parser$': path.resolve(__dirname, '../parser')
}
};

Expand Down
2 changes: 1 addition & 1 deletion packages/multi-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@asyncapi/raml-dt-schema-parser": "^4.0.4",
"parserapiv1": "npm:@asyncapi/parser@^2.1.0",
"parserapiv2": "npm:@asyncapi/[email protected]",
"parserapiv3": "file:../parser"
"@asyncapi/parser": "*"
},
"devDependencies": {
"@jest/types": "^29.0.2",
Expand Down
6 changes: 3 additions & 3 deletions packages/multi-parser/src/convert.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { createAsyncAPIDocument as createAsyncAPIDocumentParserV1 } from 'parserapiv1';
import { createAsyncAPIDocument as createAsyncAPIDocumentParserV2 } from 'parserapiv2';
import { createAsyncAPIDocument as createAsyncAPIDocumentParserV3 } from 'parserapiv3/esm/index';
import { createAsyncAPIDocument as createAsyncAPIDocumentParserV3 } from '@asyncapi/parser';

import type { AsyncAPIDocumentInterface as AsyncAPIDocumentInterfaceParserV1 } from 'parserapiv1';
import type { AsyncAPIDocumentInterface as AsyncAPIDocumentInterfaceParserV2 } from 'parserapiv2';
import type { AsyncAPIDocumentInterface as AsyncAPIDocumentInterfaceParserV3 } from 'parserapiv3/esm/index';
import type { AsyncAPIDocumentInterface as AsyncAPIDocumentInterfaceParserV3 } from '@asyncapi/parser';

import type { DetailedAsyncAPI as DetailedAsyncAPIParserV1 } from 'parserapiv1/esm/types';
import type { DetailedAsyncAPI as DetailedAsyncAPIParserV2 } from 'parserapiv2/esm/types';
import type { DetailedAsyncAPI as DetailedAsyncAPIParserV3 } from 'parserapiv3/esm/types';
import type { DetailedAsyncAPI as DetailedAsyncAPIParserV3 } from '@asyncapi/parser/esm/types';

export type AsyncAPIDocument = AsyncAPIDocumentInterfaceParserV1 | AsyncAPIDocumentInterfaceParserV2 | AsyncAPIDocumentInterfaceParserV3;

Expand Down
4 changes: 2 additions & 2 deletions packages/multi-parser/src/parse.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Parser as ParserV1 } from 'parserapiv1';
import { Parser as ParserV2 } from 'parserapiv2';
import { Parser as ParserV3 } from 'parserapiv3/esm/index';
import { Parser as ParserV3 } from '@asyncapi/parser';

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

import type { ParserOptions as ParserOptionsParserV1 } from 'parserapiv1/esm/parser';
import type { ParserOptions as ParserOptionsParserV2 } from 'parserapiv2/esm/parser';
import type { ParserOptions as ParserOptionsParserV3 } from 'parserapiv3/esm/parser';
import type { ParserOptions as ParserOptionsParserV3 } from '@asyncapi/parser/esm/parser';

export type ParserOptions = ParserOptionsParserV1 | ParserOptionsParserV2 | ParserOptionsParserV3;
export type Options = {
Expand Down
2 changes: 1 addition & 1 deletion packages/multi-parser/test/convert.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import { Parser as ParserV1 } from 'parserapiv1';
import { Parser as ParserV2 } from 'parserapiv2';
import { Parser as ParserV3 } from 'parserapiv3/esm/index';
import { Parser as ParserV3 } from '@asyncapi/parser';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/multi-parser/test/parse.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import { Parser as ParserV1 } from 'parserapiv1';
import { Parser as ParserV2 } from 'parserapiv2';
import { Parser as ParserV3 } from 'parserapiv3/esm/index';
import { Parser as ParserV3 } from '@asyncapi/parser';

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

0 comments on commit 09207d8

Please sign in to comment.