Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NEXT] DX-336 - Re-embed Stoplight APIs #39

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions .github/workflows/checkout-test-build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions .vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ export default defineConfigWithTheme<ThemeConfig>({
/**
* 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#/',
Expand All @@ -281,31 +281,31 @@ export default defineConfigWithTheme<ThemeConfig>({
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);
}
});
6 changes: 2 additions & 4 deletions .vitepress/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}
]
Expand Down