From 06daec8132ef46aa64315b5f0b482e51412474c4 Mon Sep 17 00:00:00 2001 From: Bojan Rajh Date: Mon, 3 Apr 2023 15:42:33 +0200 Subject: [PATCH] Re-embed apis --- .../workflows/checkout-test-build-deploy.yml | 26 +++++++++---------- .vitepress/config.ts | 14 +++++----- .vitepress/navigation.ts | 6 ++--- 3 files changed, 22 insertions(+), 24 deletions(-) diff --git a/.github/workflows/checkout-test-build-deploy.yml b/.github/workflows/checkout-test-build-deploy.yml index 01c8069a..44ea5831 100644 --- a/.github/workflows/checkout-test-build-deploy.yml +++ b/.github/workflows/checkout-test-build-deploy.yml @@ -162,9 +162,9 @@ jobs: export NODE_OPTIONS="--max-old-space-size=8096" pnpm run build - #- name: Zip externals - # run: | - # cd external && zip -r db-external.zip * -i '*.md' + - name: Zip externals + run: | + cd external && zip -r db-external.zip * -i '*.md' - name: Zip folder run: zip -r full-build.zip .vitepress/dist/ @@ -176,12 +176,12 @@ jobs: name: full-build-${{ github.sha }} path: full-build.zip - #- name: Upload external - # uses: actions/upload-artifact@v3 - # with: - # if-no-files-found: error - # name: db-external-${{ github.sha }} - # path: external/db-external.zip + - name: Upload external + uses: actions/upload-artifact@v3 + with: + if-no-files-found: error + name: db-external-${{ github.sha }} + path: external/db-external.zip chromatic: name: Deploy Storybook to Chromatic @@ -263,15 +263,15 @@ jobs: with: name: db-index-${{ github.sha }} - #- uses: actions/download-artifact@v3 - # with: - # name: db-external-${{ github.sha }} + - uses: actions/download-artifact@v3 + with: + name: db-external-${{ github.sha }} - name: Merge base and external sources run: | mkdir merged unzip -o db-index.zip -d merged - true || unzip -o db-external.zip -d merged + unzip -o db-external.zip -d merged zip -r db-merged.zip merged/ - name: Send artifact diff --git a/.vitepress/config.ts b/.vitepress/config.ts index 54834765..50712ee1 100644 --- a/.vitepress/config.ts +++ b/.vitepress/config.ts @@ -272,7 +272,7 @@ export default defineConfigWithTheme({ /** * Fetch Stoplight URLs. */ - /*const stoplightUrls = [ + const stoplightUrls = [ ...await getStoplightUrls({ source: 'https://shopware.stoplight.io/api/v1/projects/cHJqOjEwNjA0NQ/table-of-contents', prefix: '/resources/api/store-api-reference.html#/', @@ -281,31 +281,31 @@ export default defineConfigWithTheme({ source: 'https://shopware.stoplight.io/api/v1/projects/cHJqOjEwNjA0Mw/table-of-contents', prefix: '/resources/api/admin-api-reference.html#/', }), - ];*/ + ]; /** * Create public sitemap.xml. */ - await createSitemap(/*stoplightUrls*/); + await createSitemap(stoplightUrls); /** * Transform Store API JSON reference to Markdown for Knowledge base. */ - /*await generateMarkdownFromStoplight({ + await generateMarkdownFromStoplight({ source: 'https://shopware.stoplight.io/api/v1/projects/cHJqOjEwNjA0NQ/table-of-contents', nodes: 'https://shopware.stoplight.io/api/v1/workspaces/d2s6MzM5MTQ/nodes?project_ids[0]=cHJqOjEwNjA0NQ', reference: 'https://raw.githubusercontent.com/shopware/store-api-reference/main/storeapi.json', as: 'resources/api/admin-api-reference.html', - });*/ + }); /** * Transform Admin API JSON reference to Markdown for Knowledge base. */ - /*await generateMarkdownFromStoplight({ + await generateMarkdownFromStoplight({ source: 'https://shopware.stoplight.io/api/v1/projects/cHJqOjEwNjA0Mw/table-of-contents', nodes: 'https://shopware.stoplight.io/api/v1/workspaces/d2s6MzM5MTQ/nodes?project_ids[0]=cHJqOjEwNjA0Mw', reference: 'https://raw.githubusercontent.com/shopware/admin-api-reference/main/storeapi.json', as: 'resources/api/store-api-reference.html', - }, false);*/ + }, false); } }); diff --git a/.vitepress/navigation.ts b/.vitepress/navigation.ts index 5b033511..9b4b3cca 100644 --- a/.vitepress/navigation.ts +++ b/.vitepress/navigation.ts @@ -31,14 +31,12 @@ const navigation = buildSidebarNav('./src/', [ items: [ { text: "Store API", - // link: "/resources/api/store-api-reference", - link: 'https://shopware.stoplight.io/docs/store-api/', + link: "/resources/api/store-api-reference", repo: 'shopware/store-api-reference', }, { text: "Admin API", - //link: "/resources/api/admin-api-reference", - link: 'https://shopware.stoplight.io/docs/admin-api/', + link: "/resources/api/admin-api-reference", repo: 'shopware/admin-api-reference', } ]