Skip to content

Commit

Permalink
Merge pull request #572 from GrabarzUndPartner/feature/docs-update
Browse files Browse the repository at this point in the history
ci(docs): added docs to next
  • Loading branch information
ThornWalli committed Nov 27, 2023
2 parents 9d7a3a4 + 9ecf44e commit 844a211
Show file tree
Hide file tree
Showing 64 changed files with 8,725 additions and 27,249 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ sw.*

# Plugin
src/runtime/tmpl
docs/.vitepress/dist
docs/.vitepress/cache
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@
"vue/multi-word-component-names": "off",
"@typescript-eslint/no-unused-vars": "off"
}
}
}
68 changes: 62 additions & 6 deletions .github/workflows/beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,22 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node: [19]
node: [20]

steps:
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Checkout Repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
uses: actions/checkout@v4
- name: cache node_modules
uses: actions/cache@v3
id: cache
with:
path: |
node_modules
~/.cache/ms-playwright/
~\AppData\Local\ms-playwright\
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}

- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
Expand Down Expand Up @@ -58,7 +57,7 @@ jobs:
with:
node-version: ${{ matrix.node }}
- name: Checkout Repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
uses: actions/checkout@v4
- name: cache node_modules
uses: actions/cache@v3
id: cache
Expand All @@ -74,4 +73,61 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npx -p pinst -p @nuxt/module-builder -p semantic-release -p @semantic-release/git -p @semantic-release/changelog -p @semantic-release/exec -p @semantic-release/github semantic-release --provider=github
npx -p pinst -p @nuxt/module-builder -p semantic-release -p @semantic-release/git -p @semantic-release/changelog -p @semantic-release/exec -p @semantic-release/github semantic-release --provider=github --debug=true
build-docs:
name: Build (Docs)
needs: semantic-version
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node: [20]

steps:
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Checkout Repo
uses: actions/checkout@v4
- name: cache docs/node_modules
uses: actions/cache@v3
id: cache
with:
path: |
node_modules
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}
- name: Build
run: |
npm run docs:build
touch docs/.vitepress/dist/.nojekyll
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Archive Production Artifact
uses: actions/upload-artifact@master
with:
name: docsArtifact
path: docs/.vitepress/dist

deploy-ghpages:
name: Deploy (GH-Pages)
needs: [build-docs]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node: [20]
steps:
- name: Download Artifact (Docs)
uses: actions/download-artifact@master
with:
name: docsArtifact
path: public/docs
- name: Deploy to GH-Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: public
cname: nuxt-custom-elements.grabarzundpartner.dev
keep_files: true
2 changes: 1 addition & 1 deletion .github/workflows/sonar-cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node: [19]
node: [20]

steps:
- uses: actions/setup-node@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node: [19]
node: [20]

steps:
- uses: actions/setup-node@v4
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@ test/.*
sw.*
.output
eslint-report.json
.env

# docs
docs/.vitepress/dist
docs/.vitepress/cache
2 changes: 1 addition & 1 deletion .prettierrc.json → .prettierrc.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"arrowParens": "avoid",
"bracketSameLine": true,
"trailingComma": "none",
Expand Down
3 changes: 0 additions & 3 deletions docs/.env.example

This file was deleted.

12 changes: 0 additions & 12 deletions docs/.gitignore

This file was deleted.

2 changes: 0 additions & 2 deletions docs/.npmrc

This file was deleted.

1 change: 0 additions & 1 deletion docs/.nvmrc

This file was deleted.

68 changes: 68 additions & 0 deletions docs/.vitepress/config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import { fileURLToPath } from 'url';
import { defineConfig } from 'vitepress';
import markdownItInlineComments from 'markdown-it-inline-comments';
import navigation from './navigation.mjs';

// https://vitepress.dev/reference/site-config
export default defineConfig(() => ({
markdown: {
config: md => {
md.use(markdownItInlineComments);
}
},

base: getBaseUrl(),

vite: {
resolve: {
alias: [
{
find: /^.*\/VPNavBarTitle\.vue$/,
replacement: fileURLToPath(
new URL('../components/VPNavBarTitle.vue', import.meta.url)
)
},
{
find: /^.*\/VPNavBarMenu\.vue$/,
replacement: fileURLToPath(
new URL('../components/VPNavBarMenu.vue', import.meta.url)
)
},
{
find: /^.*\/VPNavScreenMenu\.vue$/,
replacement: fileURLToPath(
new URL('../components/VPNavScreenMenu.vue', import.meta.url)
)
}
]
}
},

srcDir: 'src',

title: 'Nuxt Speedkit',
description:
'Nuxt Speedkit takes over the Lighthouse performance optimization of your generated website.',
themeConfig: {
// https://vitepress.dev/reference/default-theme-config

logoComponent: true,

...navigation,

socialLinks: [
{
icon: 'github',
link: 'https://github.com/GrabarzUndPartner/nuxt-custom-elements'
}
]
},

sitemap: {
hostname: 'https://nuxt-custom-elements.grabarzundpartner.dev'
}
}));

function getBaseUrl() {
return process.env.npm_config_base_url || process.env.BASE_URL || '/';
}
61 changes: 61 additions & 0 deletions docs/.vitepress/navigation.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
export default {
version: [{ version: 2, isDefault: true }, { version: 1 }],

sidebar: {
'/v1/': [
{
text: 'Home',
link: '/v1/'
},
{
text: 'Guide',
collapsed: false,
items: [
{ text: 'Setup', link: '/v1/guide/setup' },
{ text: 'Options', link: '/v1/guide/options' },
{ text: 'Usage', link: '/v1/guide/usage' }
]
},
{
text: 'Plugins',
link: '/v1/plugins'
}
],
'/': {
items: [
{
text: 'Home',
link: '/'
},
{
text: 'Guide',
collapsed: false,
items: [
{ text: 'Setup', link: '/guide/setup' },
{ text: 'Options', link: '/guide/options' },
{ text: 'Usage', link: '/guide/usage' }
]
},
{
text: 'Composables',
collapsed: false,
items: [
{ text: 'useCustomElements', link: '/composable/useCustomElements' }
]
},
{
text: 'Plugins',
link: '/plugins'
},
{
text: 'Migration',
collapsed: true,
items: [
{ text: 'v1.8.x to v1.9.x', link: '/migration/v1-9-x' },
{ text: 'v2', link: '/migration/v2' }
]
}
]
}
}
};
11 changes: 11 additions & 0 deletions docs/.vitepress/theme/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
iframe.embed-sandbox,
iframe.embed-stackblitz {
width: 100%;
height: 480px;
border: none;
}

:root {
--vp-c-brand-1: #51bbaf;
--vp-c-brand-2: #51bbaf;
}
18 changes: 18 additions & 0 deletions docs/.vitepress/theme/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// https://vitepress.dev/guide/custom-theme
import { h } from 'vue';
import DefaultTheme from 'vitepress/theme';
import './style.css';
import './custom.css';

/** @type {import('vitepress').Theme} */
export default {
extends: DefaultTheme,
Layout: () => {
return h(DefaultTheme.Layout, null, {
// https://vitepress.dev/guide/extending-default-theme#layout-slots
});
},
enhanceApp({ app, router, siteData }) {
// ...
}
};
Loading

0 comments on commit 844a211

Please sign in to comment.