From e95da031d160e3c0fdacfc0902a722e156ae0506 Mon Sep 17 00:00:00 2001 From: hmol233 <82594500+hmol233@users.noreply.github.com> Date: Sat, 11 Sep 2021 18:37:02 +0800 Subject: [PATCH] fix: build action --- .github/workflows/build.yml | 3 +++ docs/.vuepress/config.ts | 12 ------------ docs/.vuepress/theme/plugin/mermaidPlugin.ts | 3 ++- package.json | 1 + tsconfig.json | 10 ++++++++++ yarn.lock | 5 +++++ 6 files changed, 21 insertions(+), 13 deletions(-) create mode 100644 tsconfig.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 67055ad0f..38ef41c07 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,6 +11,9 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 + - uses: actions/setup-node@v2 + with: + node-version: '16' - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn cache dir)" diff --git a/docs/.vuepress/config.ts b/docs/.vuepress/config.ts index ee48d906c..5d0056afe 100644 --- a/docs/.vuepress/config.ts +++ b/docs/.vuepress/config.ts @@ -131,16 +131,4 @@ export default defineUserConfig({ md.use(require("markdown-it-footnote")); }, bundler: isProduction ? "@vuepress/webpack" : "@vuepress/vite", - bundlerConfig: { - chainWebpack: (config) => { - config.module - .rule("webp") - .test(/\.(webp)(\?.*)?$/) - .use("file-loader") - .loader("file-loader") - .options({ - name: `assets/img/[name].[hash:8].[ext]`, - }); - }, - }, }); diff --git a/docs/.vuepress/theme/plugin/mermaidPlugin.ts b/docs/.vuepress/theme/plugin/mermaidPlugin.ts index 2cecf8d20..535a907de 100644 --- a/docs/.vuepress/theme/plugin/mermaidPlugin.ts +++ b/docs/.vuepress/theme/plugin/mermaidPlugin.ts @@ -8,13 +8,14 @@ const MermaidPlugin: PluginSimple = function (md) { md.renderer.rules.fence = (...args) => { const [tokens, idx] = args; const { info } = tokens[idx]; - if (info.trim(" ") === "mermaid") { + if (info.trim() === "mermaid") { const token = tokens[idx]; const key = `mermaid_${hash(idx)}`; let { content } = token; content = content.replaceAll(";\n", ";"); content = content.replaceAll("\n\n", ";"); content = content.replaceAll("\n", ";"); + content = content.replaceAll('"', "'"); return ``; } const rawCode = fence(...args); diff --git a/package.json b/package.json index 92a451780..18385b7f1 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "@types/bootstrap": "^5.1.4", "@types/jquery": "^3.5.6", "@types/mermaid": "^8.2.7", + "@types/node": "^16.9.1", "@vuepress/bundler-vite": "^2.0.0-beta.25", "@vuepress/plugin-back-to-top": "^2.0.0-beta.25", "@vuepress/plugin-debug": "^2.0.0-beta.25", diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 000000000..83a351b01 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "esnext", + "sourceMap": true + }, + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 9add9cc2a..c662da9a8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -237,6 +237,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-16.0.0.tgz#067a6c49dc7a5c2412a505628e26902ae967bf6f" integrity sha512-TmCW5HoZ2o2/z2EYi109jLqIaPIi9y/lc2LmDCWzuCi35bcaQ+OtUh6nwBiFK7SOu25FAU5+YKdqFZUwtqGSdg== +"@types/node@^16.9.1": + version "16.9.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.9.1.tgz#0611b37db4246c937feef529ddcc018cf8e35708" + integrity sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g== + "@types/parse-json@^4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0"