Skip to content

Commit 0da34ff

Browse files
authored
fix: update @asyncapi/specs to 6.11.1 version and others (#1125)
1 parent 6736463 commit 0da34ff

File tree

8 files changed

+132
-39
lines changed

8 files changed

+132
-39
lines changed

.changeset/rich-elephants-applaud.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
"@asyncapi/parser": minor
33
---
44

5-
feat: create the rule `asyncapi3-channel-servers` for the v3 rule core ruleset
5+
- update `@asyncapi/specs` to latest version with new ROS 2 binding
6+
- create the rule `asyncapi3-channel-servers` for the v3 rule core ruleset

.github/workflows/release-with-changesets.yml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,17 @@ jobs:
1919
# "commits" contains an array of objects where one of the properties is the commit "message"
2020
# Release workflow will be skipped if release conventional commits are not used
2121
if: |
22-
startsWith( github.repository, 'asyncapi/' )
22+
startsWith( github.repository, 'asyncapi/' ) &&
23+
(startsWith( github.event.commits[0].message , 'fix:' ) ||
24+
startsWith( github.event.commits[0].message, 'fix!:' ) ||
25+
startsWith( github.event.commits[0].message, 'feat:' ) ||
26+
startsWith( github.event.commits[0].message, 'chore(release):' ) ||
27+
startsWith( github.event.commits[0].message, 'feat!:' ))
2328
name: Test NodeJS release on ${{ matrix.os }}
2429
runs-on: ${{ matrix.os }}
2530
strategy:
2631
matrix:
27-
# Using macos-13 instead of latest (macos-14) due to an issue with Puppeteer and such runner.
28-
# See: https://github.com/puppeteer/puppeteer/issues/12327 and https://github.com/asyncapi/parser-js/issues/1001
29-
os: [ubuntu-latest, macos-13, windows-latest]
32+
os: [ubuntu-latest, macos-latest, windows-latest]
3033
steps:
3134
- name: Set git to use LF # To once and for all finish the never-ending fight between Unix and Windows
3235
run: |
@@ -42,12 +45,15 @@ jobs:
4245
- if: steps.packagejson.outputs.exists == 'true'
4346
name: Check package-lock version
4447
uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master
48+
with:
49+
node-version: ${{ vars.NODE_VERSION }}
4550
id: lockversion
4651
- if: steps.packagejson.outputs.exists == 'true'
4752
name: Setup Node.js
4853
uses: actions/setup-node@v4
4954
with:
5055
node-version: "${{ steps.lockversion.outputs.version }}"
56+
registry-url: "https://registry.npmjs.org"
5157
- if: steps.lockversion.outputs.version == '18' && matrix.os == 'windows-latest'
5258
name: Install npm cli 8
5359
shell: bash
@@ -74,6 +80,10 @@ jobs:
7480
needs: [test-nodejs]
7581
name: Publish to any of NPM, GitHub, or Docker Hub
7682
runs-on: ubuntu-latest
83+
permissions:
84+
contents: write
85+
id-token: write
86+
pull-requests: write
7787
steps:
7888
- name: Set git to use LF # To once and for all finish the never-ending fight between Unix and Windows
7989
run: |
@@ -88,6 +98,8 @@ jobs:
8898
- if: steps.packagejson.outputs.exists == 'true'
8999
name: Check package-lock version
90100
uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master
101+
with:
102+
node-version: ${{ vars.NODE_VERSION }}
91103
id: lockversion
92104
- if: steps.packagejson.outputs.exists == 'true'
93105
name: Setup Node.js
@@ -111,14 +123,13 @@ jobs:
111123
uses: changesets/action@v1
112124
id: release
113125
with:
114-
version: npx -p @changesets/cli changeset version
115-
commit: version packages
116-
title: "chore(release): version packages"
117-
publish: npx -p @changesets/cli changeset publish
126+
version: npx -p @changesets/cli@2.27.7 changeset version
127+
commit: "chore(release): release and bump versions of packages"
128+
title: "chore(release): release and bump versions of packages"
129+
publish: npx -p @changesets/cli@2.27.7 changeset publish
118130
setupGitUser: false
119131
env:
120132
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
121-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
122133
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
123134
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
124135
GIT_AUTHOR_NAME: asyncapi-bot

package-lock.json

Lines changed: 75 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/parser/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"prepublishOnly": "npm run generate:assets"
4444
},
4545
"dependencies": {
46-
"@asyncapi/specs": "^6.8.0",
46+
"@asyncapi/specs": "^6.11.1",
4747
"@openapi-contrib/openapi-schema-to-json-schema": "~3.2.0",
4848
"@stoplight/json": "3.21.0",
4949
"@stoplight/json-ref-readers": "^1.2.2",

packages/parser/test/custom-operations/apply-traits-v3.spec.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ describe('custom operations - apply traits v3', function() {
5050
}
5151
};
5252
const { document, diagnostics } = await parser.parse(documentRaw);
53-
expect(diagnostics).toHaveLength(0);
53+
// Ignore asyncapi-latest-version diagnostic - not relevant to this test and would require updating version each release
54+
const filteredDiagnostics = diagnostics.filter(d => d.code !== 'asyncapi-latest-version');
55+
expect(filteredDiagnostics).toHaveLength(0);
5456

5557
const v3Document = document as AsyncAPIDocumentV3;
5658
expect(v3Document).toBeInstanceOf(AsyncAPIDocumentV3);
@@ -297,7 +299,9 @@ describe('custom operations - apply traits v3', function() {
297299

298300
beforeAll(async () => {
299301
const { document, diagnostics } = await parser.parse(documentRaw);
300-
expect(diagnostics.length).toEqual(0);
302+
// Ignore asyncapi-latest-version diagnostic - not relevant to this test and would require updating version each release
303+
const filteredDiagnostics = diagnostics.filter(d => d.code !== 'asyncapi-latest-version');
304+
expect(filteredDiagnostics.length).toEqual(0);
301305
v3Document = document as AsyncAPIDocumentV3;
302306
});
303307

packages/parser/test/custom-operations/parse-schema-v3.spec.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,11 @@ describe('custom operations for v3 - parse schemas', function() {
6363
}
6464
};
6565
const { document, diagnostics } = await parser.parse(documentRaw);
66+
// Ignore asyncapi-latest-version diagnostic - not relevant to this test and would require updating version each release
67+
const filteredDiagnostics = diagnostics.filter(d => d.code !== 'asyncapi-latest-version');
6668

6769
expect(document).toBeInstanceOf(AsyncAPIDocumentV3);
68-
expect(diagnostics.length === 0).toEqual(true);
70+
expect(filteredDiagnostics.length === 0).toEqual(true);
6971

7072
expect(((document?.json()?.channels?.channel as v3.ChannelObject).messages?.message as v3.MessageObject)?.payload?.schema).toEqual({ type: 'object', 'x-parser-schema-id': '<anonymous-schema-1>' });
7173
expect(((((document?.json() as any).operations?.operation as v3.OperationObject).channel as v3.ChannelObject)?.messages?.message as v3.MessageObject)?.payload?.schema).toEqual({ type: 'object', 'x-parser-schema-id': '<anonymous-schema-1>' });
@@ -97,9 +99,11 @@ describe('custom operations for v3 - parse schemas', function() {
9799
}
98100
};
99101
const { document, diagnostics } = await parser.parse(documentRaw);
100-
102+
// Ignore asyncapi-latest-version diagnostic - not relevant to this test and would require updating version each release
103+
const filteredDiagnostics = diagnostics.filter(d => d.code !== 'asyncapi-latest-version');
104+
101105
expect(document).toBeInstanceOf(AsyncAPIDocumentV3);
102-
expect(diagnostics.length === 0).toEqual(true);
106+
expect(filteredDiagnostics.length === 0).toEqual(true);
103107

104108
expect(((document?.json()?.channels?.channel as v3.ChannelObject).messages?.message as v3.MessageObject)?.payload).toEqual({ type: 'object', 'x-parser-schema-id': '<anonymous-schema-1>' });
105109
});

packages/parser/test/parse.spec.ts

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ describe('parse()', function () {
3636
channels: {},
3737
};
3838
const { document, diagnostics } = await parser.parse(documentRaw);
39+
// Ignore asyncapi-latest-version diagnostic - not relevant to this test and would require updating version each release
40+
const filteredDiagnostics = diagnostics.filter(d => d.code !== 'asyncapi-latest-version');
3941
expect(document).toBeInstanceOf(AsyncAPIDocumentV3);
40-
expect(diagnostics.length === 0).toEqual(true);
42+
expect(filteredDiagnostics.length === 0).toEqual(true);
4143
});
4244

4345
it('should parse invalid document', async function () {
@@ -361,9 +363,11 @@ describe('parse()', function () {
361363
description: Email of the user`;
362364

363365
const { document, diagnostics } = await parser.parse(documentRaw);
366+
// Ignore asyncapi-latest-version diagnostic - not relevant to this test and would require updating version each release
367+
const filteredDiagnostics = diagnostics.filter(d => d.code !== 'asyncapi-latest-version');
364368

365369
expect(document).toBeInstanceOf(AsyncAPIDocumentV3);
366-
expect(diagnostics.length === 0).toEqual(true);
370+
expect(filteredDiagnostics.length === 0).toEqual(true);
367371
});
368372

369373
it('should parse valid v3 JSON document in JSON format', async function () {
@@ -420,19 +424,23 @@ describe('parse()', function () {
420424
};
421425

422426
const { document, diagnostics } = await parser.parse(documentRaw);
427+
// Ignore asyncapi-latest-version diagnostic - not relevant to this test and would require updating version each release
428+
const filteredDiagnostics = diagnostics.filter(d => d.code !== 'asyncapi-latest-version');
423429

424430
expect(document).toBeInstanceOf(AsyncAPIDocumentV3);
425-
expect(diagnostics.length === 0).toEqual(true);
431+
expect(filteredDiagnostics.length === 0).toEqual(true);
426432
});
427433

428434
it('should parse valid v3 JSON document after JSON.stringify()', async function () {
429435
const documentRaw =
430436
'{\n "asyncapi": "3.0.0",\n "info": {\n "title": "Account Service",\n "version": "1.0.0",\n "description": "This service is in charge of processing user signups"\n },\n "channels": {\n "userSignedup": {\n "address": "user/signedup",\n "messages": {\n "UserSignedUp": {\n "$ref": "#/components/messages/UserSignedUp"\n }\n }\n }\n },\n "operations": {\n "sendUserSignedup": {\n "action": "send",\n "channel": {\n "$ref": "#/channels/userSignedup"\n },\n "messages": [\n {\n "$ref": "#/channels/userSignedup/messages/UserSignedUp"\n }\n ]\n }\n },\n "components": {\n "messages": {\n "UserSignedUp": {\n "payload": {\n "type": "object",\n "properties": {\n "displayName": {\n "type": "string",\n "description": "Name of the user"\n },\n "email": {\n "type": "string",\n "format": "email",\n "description": "Email of the user"\n }\n }\n }\n }\n }\n }\n}\n';
431437

432438
const { document, diagnostics } = await parser.parse(documentRaw);
439+
// Ignore asyncapi-latest-version diagnostic - not relevant to this test and would require updating version each release
440+
const filteredDiagnostics = diagnostics.filter(d => d.code !== 'asyncapi-latest-version');
433441

434442
expect(document).toBeInstanceOf(AsyncAPIDocumentV3);
435-
expect(diagnostics.length === 0).toEqual(true);
443+
expect(filteredDiagnostics.length === 0).toEqual(true);
436444
});
437445

438446
it('should not parse invalid v3 YAML document and give error in line 153 (#936)', async function () {
@@ -767,9 +775,11 @@ components:
767775
bindingVersion: '0.3.0'`;
768776

769777
const { document, diagnostics } = await parser.parse(documentRaw);
778+
// Ignore asyncapi-latest-version diagnostic - not relevant to this test and would require updating version each release
779+
const filteredDiagnostics = diagnostics.filter(d => d.code !== 'asyncapi-latest-version');
770780

771781
expect(document).not.toBeInstanceOf(AsyncAPIDocumentV3);
772-
expect(diagnostics[0].range.start.line === 153).toEqual(true);
782+
expect(filteredDiagnostics[0].range.start.line === 153).toEqual(true);
773783
});
774784

775785
it('should not parse invalid v3 JSON document and give error in line 236 (#936)', async function () {
@@ -1269,8 +1279,10 @@ components:
12691279
};
12701280

12711281
const { document, diagnostics } = await parser.parse(documentRaw);
1282+
// Ignore asyncapi-latest-version diagnostic - not relevant to this test and would require updating version each release
1283+
const filteredDiagnostics = diagnostics.filter(d => d.code !== 'asyncapi-latest-version');
12721284

12731285
expect(document).not.toBeInstanceOf(AsyncAPIDocumentV3);
1274-
expect(diagnostics[0].range.start.line === 236).toEqual(true);
1286+
expect(filteredDiagnostics[0].range.start.line === 236).toEqual(true);
12751287
});
12761288
});

packages/parser/test/validate.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ describe('validate()', function() {
9292
}
9393
};
9494
const { document, diagnostics } = await parser.parse(documentRaw, { validateOptions: { allowedSeverity: { warning: false } } });
95-
expect(diagnostics).toHaveLength(0);
95+
// Ignore asyncapi-latest-version diagnostic - not relevant to this test and would require updating version each release
96+
const filteredDiagnostics = diagnostics.filter(d => d.code !== 'asyncapi-latest-version');
97+
expect(filteredDiagnostics).toHaveLength(0);
9698
expect(document).toBeInstanceOf(AsyncAPIDocument);
9799
});
98100
});

0 commit comments

Comments
 (0)