diff --git a/.github/workflows/test-action.yml b/.github/workflows/test-action.yml index 49960223be7..97080c47858 100644 --- a/.github/workflows/test-action.yml +++ b/.github/workflows/test-action.yml @@ -45,7 +45,7 @@ jobs: action_version=${BASH_REMATCH[1]}; echo "action_version=$action_version" >> $GITHUB_OUTPUT - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@v4 - name: Build Docker image and export uses: docker/build-push-action@v5 with: @@ -53,11 +53,11 @@ jobs: file: ./github-action/Dockerfile tags: asyncapi/github-action-for-cli:${{ steps.docker_version.outputs.action_version }} outputs: type=docker,dest=/tmp/asyncapi.tar - - name: Upload artifact - uses: actions/upload-artifact@v3 + - name: Cache Docker Image + uses: actions/cache@v3 with: - name: asyncapi path: /tmp/asyncapi.tar + key: ${{ runner.os }}-asyncapi-cache test-defaults: @@ -66,10 +66,10 @@ jobs: needs: [should-workflow-run, build-docker] steps: - name: Download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: - name: asyncapi - path: /tmp + path: /tmp/asyncapi.tar + key: ${{ runner.os }}-asyncapi-cache - name: Load Docker image run: | docker load --input /tmp/asyncapi.tar @@ -98,7 +98,7 @@ jobs: needs: [should-workflow-run, build-docker] steps: - name: Download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: asyncapi path: /tmp @@ -119,7 +119,7 @@ jobs: needs: [should-workflow-run, build-docker] steps: - name: Download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: asyncapi path: /tmp @@ -153,7 +153,7 @@ jobs: needs: [should-workflow-run, build-docker] steps: - name: Download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: asyncapi path: /tmp @@ -186,7 +186,7 @@ jobs: needs: [should-workflow-run, build-docker] steps: - name: Download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: asyncapi path: /tmp @@ -216,7 +216,7 @@ jobs: needs: [should-workflow-run, build-docker] steps: - name: Download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: asyncapi path: /tmp @@ -248,7 +248,7 @@ jobs: needs: [should-workflow-run, build-docker] steps: - name: Download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: asyncapi path: /tmp @@ -282,7 +282,7 @@ jobs: needs: [should-workflow-run, build-docker] steps: - name: Download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: asyncapi path: /tmp @@ -316,7 +316,7 @@ jobs: needs: [should-workflow-run, build-docker] steps: - name: Download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: asyncapi path: /tmp diff --git a/github-action/test/unoptimized_optimized.yml b/github-action/test/unoptimized_optimized.yml new file mode 100644 index 00000000000..111004169b0 --- /dev/null +++ b/github-action/test/unoptimized_optimized.yml @@ -0,0 +1,73 @@ +asyncapi: 2.0.0 +info: + title: Streetlights API + version: 1.0.0 +channels: + smartylighting/event/{streetlightId}/lighting/measured: + $ref: >- + #/components/channels/smartylighting/event/{streetlightId}/lighting/measured + parameters: + streetlightId: + schema: + $ref: '#/components/schemas/schema' + smartylighting/action/{streetlightId}/turn/on: + $ref: '#/components/channels/smartylighting/action/{streetlightId}/turn/on' +components: + schemas: + sentAt: + type: string + format: date-time + lumens: + type: integer + minimum: 0 + payload: + type: object + properties: + sentAt: + $ref: '#/components/schemas/sentAt' + messages: + message: + name: turnOnOff + title: Turn on/off + traits: + - headers: + type: object + properties: + my-app-header: + type: integer + minimum: 0 + maximum: 100 + payload: + $ref: '#/components/schemas/payload' + operations: + subscribe: + operationId: receiveLightMeasurement + traits: + - bindings: + kafka: + clientId: my-app-id + message: + $ref: '#/components/messages/message' + publish: + operationId: turnOn + traits: + - bindings: + kafka: + clientId: my-app-id + message: + $ref: '#/components/messages/message' + channels: + smartylighting/event/{streetlightId}/lighting/measured: + parameters: + streetlightId: + schema: + $ref: '#/components/schemas/schema' + subscribe: + $ref: '#/components/operations/subscribe' + smartylighting/action/{streetlightId}/turn/on: + parameters: + streetlightId: + schema: + $ref: '#/components/schemas/schema' + publish: + $ref: '#/components/operations/publish' diff --git a/package-lock.json b/package-lock.json index 70f3758136c..d76edc616b8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@asyncapi/cli", - "version": "2.13.0", + "version": "2.14.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@asyncapi/cli", - "version": "2.13.0", + "version": "2.14.0", "license": "Apache-2.0", "dependencies": { "@asyncapi/avro-schema-parser": "^3.0.23", diff --git a/test/fixtures/badFormatAsyncapi.json b/test/fixtures/badFormatAsyncapi.json index db8b7cae44c..58f5dd3b483 100644 --- a/test/fixtures/badFormatAsyncapi.json +++ b/test/fixtures/badFormatAsyncapi.json @@ -1,38 +1,37 @@ { - "asyncapi": "2.2.0", - "info": { - "title": "Account Service", - "version": "1.0.0", - "description": - "This service is in charge of processing user signups" - }, - "channels": { - "user/signedup": { - "subscribe": { - "message": { - "$ref": "#/components/messages/UserSignedUp" - } + "asyncapi": "2.2.0", + "info": { + "title": "Account Service", + "version": "1.0.0", + "description": "This service is in charge of processing user signups" + }, + "channels": { + "user/signedup": { + "subscribe": { + "message": { + "$ref": "#/components/messages/UserSignedUp" } } - }, - "components": { - "messages": { - "UserSignedUp": { - "payload": { - "type": "object", - "properties": { - "displayName": { - "type": "string", - "description": "Name of the user" - }, - "email": { - "type": "string", - "format": "email", - "description": "Email of the user" - } + } + }, + "components": { + "messages": { + "UserSignedUp": { + "payload": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "Name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "Email of the user" } } } } } - } \ No newline at end of file + } +} \ No newline at end of file diff --git a/test/fixtures/newtemplate/__transpiled/index.js b/test/fixtures/newtemplate/__transpiled/index.js index 0e6f6e486c0..f0bb7182e1d 100644 --- a/test/fixtures/newtemplate/__transpiled/index.js +++ b/test/fixtures/newtemplate/__transpiled/index.js @@ -2,7 +2,7 @@ require('source-map-support/register'); var generatorReactSdk = require('@asyncapi/generator-react-sdk'); -var jsxRuntime = require('C:/Users/Souvik/Documents/Programs/asyncapi/forks/cli/node_modules/@asyncapi/generator-react-sdk/node_modules/react/cjs/react-jsx-runtime.production.min.js'); +var jsxRuntime = require('/home/jalaj/AsyncAapi/cli/node_modules/@asyncapi/generator-react-sdk/node_modules/react/cjs/react-jsx-runtime.production.min.js'); function index ({ asyncapi,