From e0f151f06d3b21aec2ff0d83169c84dbef4c43db Mon Sep 17 00:00:00 2001 From: Max Nowack Date: Mon, 17 Jul 2023 11:55:06 +0200 Subject: [PATCH] docs: add example to docs website --- .github/workflows/deploy-docs.yaml | 8 ++++++-- .gitignore | 1 + example/next.config.js | 10 +++++++++- package.json | 2 +- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-docs.yaml b/.github/workflows/deploy-docs.yaml index 692b17b4..71d2324c 100644 --- a/.github/workflows/deploy-docs.yaml +++ b/.github/workflows/deploy-docs.yaml @@ -32,12 +32,16 @@ jobs: timeout-minutes: 5 continue-on-error: true with: - path: node_modules + path: | + node_modules + example/node_modules key: ${{ runner.OS }}-modules-${{ hashFiles('**/package-lock.json') }} restore-keys: | ${{ runner.OS }}-modules- - name: install modules - run: npm install --no-audit --force --loglevel=error --no-update-notifier + run: | + npm install --no-audit --force --loglevel=error --no-update-notifier + cd example && npm install --no-audit --force --loglevel=error --no-update-notifier - name: Build vitepress run: npm run docs:build - name: Upload artifact diff --git a/.gitignore b/.gitignore index c8e65544..1423f466 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ dist node_modules docs/.vitepress/dist docs/.vitepress/cache +docs/public/todo-example .DS_Store diff --git a/example/next.config.js b/example/next.config.js index 767719fc..13b5fa99 100644 --- a/example/next.config.js +++ b/example/next.config.js @@ -1,4 +1,12 @@ /** @type {import('next').NextConfig} */ -const nextConfig = {} +const nextConfig = { + output: 'export', + eslint: { + ignoreDuringBuilds: true, + }, + typescript: { + ignoreBuildErrors: true, + }, +} module.exports = nextConfig diff --git a/package.json b/package.json index 5348b702..037d9616 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "build": "rimraf dist && unbuild", "type-check": "tsc --noEmit", "docs:dev": "vitepress dev docs", - "docs:build": "vitepress build docs", + "docs:build": "(cd example && npm run build) && cp -R example/out docs/public/todo-example && vitepress build docs", "docs:preview": "vitepress preview docs" }, "repository": {