Merge pull request #30 from Mister-Hope/pnpm

chore: use pnpm
This commit is contained in:
Masterain
2023-04-25 00:07:51 -07:00
committed by GitHub
6 changed files with 6448 additions and 10039 deletions

View File

@@ -1,11 +1,9 @@
name: Deploy Docs name: Deploy Docs
on: on:
push: push:
branches: branches:
# make sure this is the branch you are using - "main"
- 'main'
jobs: jobs:
deploy-gh-pages: deploy-gh-pages:
@@ -15,25 +13,26 @@ jobs:
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
fetch-depth: 0 fetch-depth: 0
# if your docs needs submodules, uncomment the following line
# submodules: true
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
run_install: true
- name: Setup Node.js - name: Setup Node.js
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: 16 node-version: 18
cache: npm cache: pnpm
- name: Install Deps - name: Install Deps
run: npm install run: pnpm install
- name: Build Docs - name: Build Docs
env: env:
NODE_OPTIONS: --max_old_space_size=8192 NODE_OPTIONS: --max_old_space_size=8192
run: |- run: |-
npm run docs:build pnpm run docs:build
> dist/.nojekyll > dist/.nojekyll
- name: Deploy Docs - name: Deploy Docs
@@ -42,4 +41,3 @@ jobs:
# This is the branch where the docs are deployed to # This is the branch where the docs are deployed to
branch: gh-pages branch: gh-pages
folder: dist folder: dist

View File

@@ -1,22 +1,35 @@
import { viteBundler } from "@vuepress/bundler-vite";
import { docsearchPlugin } from "@vuepress/plugin-docsearch";
import { googleAnalyticsPlugin } from "@vuepress/plugin-google-analytics";
import { defineUserConfig } from "vuepress"; import { defineUserConfig } from "vuepress";
import { viteBundler } from '@vuepress/bundler-vite'
import theme from "./theme.js";
import { autoCatalogPlugin } from "vuepress-plugin-auto-catalog";
import { docsearchPlugin } from '@vuepress/plugin-docsearch'
import { googleAnalyticsPlugin } from '@vuepress/plugin-google-analytics'
import { redirectPlugin } from "vuepress-plugin-redirect"; import { redirectPlugin } from "vuepress-plugin-redirect";
import theme from "./theme.js";
export default defineUserConfig({ export default defineUserConfig({
base: "/", base: "/",
dest: "./dist", dest: "./dist",
head:[ head: [
['script', {async:"", defer:"", "data-website-id":"f586534f-1741-450e-a0f4-3c0189f993c9", [
src:"https://umami.irain.in/umami.js"}, ` "script",
`], {
['script', {type: "module", src:"https://get.microsoft.com/badge/ms-store-badge.bundled.js"}], src: "https://umami.irain.in/umami.js",
"data-website-id": "f586534f-1741-450e-a0f4-3c0189f993c9",
async: "",
defer: "",
},
],
[
"script",
{
type: "module",
src: "https://get.microsoft.com/badge/ms-store-badge.bundled.js",
},
],
], ],
locales: { locales: {
"/zh/": { "/zh/": {
lang: "zh-CN", lang: "zh-CN",
@@ -38,8 +51,8 @@ export default defineUserConfig({
locales: { locales: {
"/zh/": { "/zh/": {
placeholder: "搜索文档", placeholder: "搜索文档",
translations:{ translations: {
button:{ button: {
buttonText: "搜索文档", buttonText: "搜索文档",
buttonAriaLabel: "搜索文档", buttonAriaLabel: "搜索文档",
}, },
@@ -75,30 +88,29 @@ export default defineUserConfig({
reportMissingResultsLinkText: "点击反馈", reportMissingResultsLinkText: "点击反馈",
}, },
}, },
} },
}, },
"/en/": { "/en/": {
placeholder: "Search documents", placeholder: "Search documents",
translations:{ translations: {
button:{ button: {
buttonText: "Search documents" buttonText: "Search documents",
} },
} },
} },
} },
}), }),
googleAnalyticsPlugin({ googleAnalyticsPlugin({
id: "G-F3LFJCE3RM" id: "G-F3LFJCE3RM",
}), }),
redirectPlugin({ redirectPlugin({
defaultLocale: "/en/", defaultLocale: "/en/",
defaultBehavior: "defaultLocale",
autoLocale: true, autoLocale: true,
switchLocale: "modal", switchLocale: "modal",
localeConfig: { localeConfig: {
"/en/": ["en-US", "en-UK", "en"], "/en/": ["en-US", "en-UK", "en"],
"/zh/": ["zh-CN", "zh-TW", "zh"], "/zh/": ["zh-CN", "zh-TW", "zh"],
} },
}), }),
], ],
@@ -108,10 +120,9 @@ export default defineUserConfig({
bundler: viteBundler({ bundler: viteBundler({
viteOptions: { viteOptions: {
build:{ build: {
chunkSizeWarningLimit: 1500 chunkSizeWarningLimit: 1500,
} },
}, },
vuePluginOptions: {},
}), }),
}); });

View File

@@ -60,90 +60,46 @@ export default hopeTheme({
}, },
}, },
plugins: { plugins: {
// If you don't need comment feature, you can remove following option
// The following config is for demo ONLY, if you need comment feature, please generate and use your own config, see comment plugin documentation for details.
// To avoid disturbing the theme developer and consuming his resources, please DO NOT use the following config directly in your production environment!!!!!
comment: { comment: {
provider: "Waline", provider: "Waline",
serverURL: "https://comments.snapgenshin.com", serverURL: "https://comments.snapgenshin.com",
emoji: [ emoji: [
'//unpkg.com/@waline/emojis@1.1.0/weibo', "//unpkg.com/@waline/emojis@1.1.0/weibo",
'//unpkg.com/@waline/emojis@1.1.0/bilibili', "//unpkg.com/@waline/emojis@1.1.0/bilibili",
'//unpkg.com/@waline/emojis@1.1.0/bmoji', "//unpkg.com/@waline/emojis@1.1.0/bmoji",
'//unpkg.com/@waline/emojis@1.1.0/qq', "//unpkg.com/@waline/emojis@1.1.0/qq",
'//unpkg.com/@waline/emojis@1.1.0/tieba' "//unpkg.com/@waline/emojis@1.1.0/tieba",
], ],
dark: "auto", requiredMeta: ["mail"],
requiredMeta: ['mail'],
login: 'enable',
reaction: false, reaction: false,
}, },
// Operational Plugins components: {
components: ["Badge", "BiliBili"],
},
feed: { feed: {
rss: true, rss: true,
}, },
seo: true,
sitemap: { sitemap: {
changefreq: "weekly" changefreq: "weekly",
}, },
// Disable features you don't want here
mdEnhance: { mdEnhance: {
align: true,
attrs: true,
chart: true,
codetabs: true,
container: true,
demo: true,
echarts: true,
flowchart: true,
gfm: true, gfm: true,
imgSize: true,
include: true,
katex: true,
imgLazyload: true, imgLazyload: true,
mark: true, include: true,
mermaid: true,
playground: {
presets: ["ts", "vue"],
},
presentation: {
plugins: ["highlight", "math", "search", "notes", "zoom"],
},
stylize: [
{
matcher: "Recommanded",
replacer: ({ tag }) => {
if (tag === "em")
return {
tag: "Badge",
attrs: { type: "tip" },
content: "Recommanded",
};
},
},
],
sub: true,
sup: true,
tabs: true, tabs: true,
vPre: true,
vuePlayground: true,
},
components: {
components: [
"Badge",
"BiliBili",
]
}, },
pwa: { pwa: {
favicon: "/favicon.ico", favicon: "/favicon.ico",
cacheHTML: false, cacheHTML: false,
cachePic: true, cachePic: true,
appendBase: true, appendBase: true,
themeColor: '#f26d6d', themeColor: "#f26d6d",
update: "hint", update: "hint",
apple: { apple: {
icon: "/favicon.ico", icon: "/favicon.ico",
@@ -185,7 +141,7 @@ export default hopeTheme({
sizes: "48x48", sizes: "48x48",
type: "image/png", type: "image/png",
}, },
] ],
}, },
}, },
}, },

9939
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -11,11 +11,19 @@
}, },
"devDependencies": { "devDependencies": {
"@vuepress/client": "2.0.0-beta.61", "@vuepress/client": "2.0.0-beta.61",
"@vuepress/bundler-vite": "2.0.0-beta.61",
"@vuepress/plugin-docsearch": "2.0.0-beta.61", "@vuepress/plugin-docsearch": "2.0.0-beta.61",
"@vuepress/plugin-google-analytics": "2.0.0-beta.61", "@vuepress/plugin-google-analytics": "2.0.0-beta.61",
"vue": "^3.2.47", "vue": "^3.2.47",
"vuepress": "2.0.0-beta.61", "vuepress": "2.0.0-beta.61",
"vuepress-plugin-redirect": "2.0.0-beta.202", "vuepress-plugin-redirect": "2.0.0-beta.206",
"vuepress-theme-hope": "2.0.0-beta.202" "vuepress-theme-hope": "2.0.0-beta.206"
},
"pnpm": {
"ignoreMissing": [
"@algolia/client-search",
"react",
"react-dom"
]
} }
} }

6375
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff