-
Notifications
You must be signed in to change notification settings - Fork 920
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into vuepress-rebuild
- Loading branch information
Showing
55 changed files
with
2,684 additions
and
790 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: e2e | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
e2e: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
node: ['18', '20'] | ||
bundler: ['vite', 'webpack'] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
|
||
- name: Use Node.js ${{ matrix.node }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
cache: pnpm | ||
|
||
- name: Install dependencies | ||
run: pnpm install --frozen-lockfile | ||
|
||
- name: Get cypress cache path | ||
working-directory: ./e2e | ||
shell: bash | ||
run: | | ||
echo "CYPRESS_CACHE_PATH=$(pnpm cypress cache path)" >> $GITHUB_ENV | ||
- name: Setup cypress cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.CYPRESS_CACHE_PATH }} | ||
key: cypress-${{ runner.os }}-node-${{ matrix.node }}-${{ hashFiles('pnpm-lock.yaml') }} | ||
restore-keys: | | ||
cypress-${{ runner.os }}-node-${{ matrix.node }}- | ||
cypress-${{ runner.os }}- | ||
- name: Install cypress binary | ||
working-directory: ./e2e | ||
run: pnpm cypress install | ||
|
||
- name: Build source files | ||
run: pnpm build | ||
|
||
- name: E2E dev | ||
working-directory: ./e2e | ||
run: pnpm e2e:ci:dev | ||
env: | ||
E2E_BUNDLER: ${{ matrix.bundler }} | ||
|
||
- name: E2E build | ||
working-directory: ./e2e | ||
run: pnpm e2e:ci:build | ||
env: | ||
E2E_BUNDLER: ${{ matrix.bundler }} | ||
|
||
e2e-result: | ||
if: ${{ always() }} | ||
name: e2e result | ||
runs-on: ubuntu-latest | ||
needs: [e2e] | ||
steps: | ||
- if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} | ||
run: exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
CHANGELOG.md | ||
pnpm-lock.yaml | ||
*.html | ||
*.md |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { defineConfig } from 'cypress' | ||
Check failure on line 1 in e2e/cypress.config.ts GitHub Actions / check (ubuntu-latest, 18)
Check failure on line 1 in e2e/cypress.config.ts GitHub Actions / check (ubuntu-latest, 20)
Check failure on line 1 in e2e/cypress.config.ts GitHub Actions / check (windows-latest, 18)
Check failure on line 1 in e2e/cypress.config.ts GitHub Actions / check (windows-latest, 20)
Check failure on line 1 in e2e/cypress.config.ts GitHub Actions / check (macos-latest, 18)
|
||
|
||
export default defineConfig({ | ||
e2e: { | ||
baseUrl: 'http://localhost:8080', | ||
specPattern: 'tests/**/*.cy.ts', | ||
supportFile: false, | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import process from 'node:process' | ||
import { viteBundler } from '@vuepress/bundler-vite' | ||
import { webpackBundler } from '@vuepress/bundler-webpack' | ||
import { defineUserConfig } from '@vuepress/cli' | ||
import { e2eTheme } from './theme/node/e2eTheme.js' | ||
|
||
export default defineUserConfig({ | ||
base: '/', | ||
|
||
head: [], | ||
|
||
locales: { | ||
'/': { | ||
lang: 'en-US', | ||
title: 'VuePress E2E', | ||
description: 'VuePress E2E Test Site', | ||
head: [], | ||
}, | ||
'/zh/': { | ||
lang: 'zh-CN', | ||
title: 'VuePress E2E', | ||
description: 'VuePress E2E 测试站点', | ||
head: [], | ||
}, | ||
}, | ||
|
||
bundler: | ||
process.env.E2E_BUNDLER === 'webpack' ? webpackBundler() : viteBundler(), | ||
|
||
theme: e2eTheme(), | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { defineClientConfig } from '@vuepress/client' | ||
import CustomLayout from './layouts/CustomLayout.vue' | ||
import Layout from './layouts/Layout.vue' | ||
import NotFound from './layouts/NotFound.vue' | ||
|
||
import './styles/index.scss' | ||
|
||
export default defineClientConfig({ | ||
enhance({ app, router }) { | ||
// ... | ||
}, | ||
|
||
setup() { | ||
// ... | ||
}, | ||
|
||
layouts: { | ||
CustomLayout, | ||
Layout, | ||
NotFound, | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<template> | ||
<div class="e2e-theme-custom-layout"> | ||
<main class="e2e-theme-custom-layout-content"> | ||
<Content /> | ||
</main> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<script setup lang="ts"> | ||
import { Content, useSiteData } from '@vuepress/client' | ||
const siteData = useSiteData() | ||
</script> | ||
|
||
<template> | ||
<div class="e2e-theme"> | ||
<nav class="e2e-theme-nav"> | ||
<div>Languages</div> | ||
<ul> | ||
<li v-for="[key, value] in Object.entries(siteData.locales)" :key="key"> | ||
<RouterLink :to="key">{{ value.lang }}</RouterLink> | ||
</li> | ||
</ul> | ||
</nav> | ||
|
||
<main class="e2e-theme-content"> | ||
<Content /> | ||
</main> | ||
</div> | ||
</template> | ||
|
||
<style lang="scss" scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<template> | ||
<div class="e2e-theme-not-found">404 Not Found</div> | ||
</template> |
Empty file.
Oops, something went wrong.