diff --git a/.changeset/loud-windows-admire.md b/.changeset/loud-windows-admire.md new file mode 100644 index 0000000..245ea6f --- /dev/null +++ b/.changeset/loud-windows-admire.md @@ -0,0 +1,5 @@ +--- +"@eventcatalog/generator-openapi": minor +--- + +chore(plugin): fixed issues with windows OS diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5aa89c0..f487412 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,3 @@ -# Make sure the EventCatalog can build OK name: Tests on: @@ -10,15 +9,29 @@ on: - main jobs: - build: - name: Tests + build-ubuntu: + name: Tests on Ubuntu timeout-minutes: 30 runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 with: - version: 8 + version: 9 + - name: Installation + run: pnpm install + - name: Run tests + run: pnpm run test + + build-windows: + name: Tests on Windows + timeout-minutes: 30 + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + with: + version: 9 - name: Installation run: pnpm install - name: Run tests diff --git a/src/utils/services.ts b/src/utils/services.ts index ed18a67..ba87da3 100644 --- a/src/utils/services.ts +++ b/src/utils/services.ts @@ -1,6 +1,7 @@ import { OpenAPI } from 'openapi-types'; import slugify from 'slugify'; import { Service } from '../types'; +import path from 'path'; export const defaultMarkdown = (document: OpenAPI.Document, fileName: string) => { return ` @@ -28,7 +29,7 @@ export const getSummary = (document: OpenAPI.Document) => { }; export const buildService = (serviceOptions: Service, document: OpenAPI.Document) => { - const schemaPath = serviceOptions.path.split('/').pop() || 'openapi.yml'; + const schemaPath = path.basename(serviceOptions.path) || 'openapi.yml'; const documentTags = document.tags || []; const serviceId = serviceOptions.id || slugify(document.info.title, { lower: true, strict: true }); return {