fix: js 执行崩溃
Some checks failed
continuous-integration/drone/push Build is failing

- deps and types.
- use pnpm instead of npm.
- fix cpu 100%.
This commit is contained in:
Ivan Li 2022-10-08 22:45:31 +08:00
parent 85fa2ae57f
commit 2ed23c4327
9 changed files with 8033 additions and 55 deletions

View File

@ -1,16 +1,25 @@
{
"cSpell.words": [
"alpn",
"appleboy",
"blackhole",
"BUTTONDOWN",
"Commento",
"CONVERTKIT",
"Cusdis",
"Disqus",
"dokodemo",
"EMAILOCTOPUS",
"fullchain",
"Giscus",
"KLAVIYO",
"lastmod",
"MAILCHIMP",
"nextjs",
"outbounds",
"rprx",
"unist",
"vfile",
"VLESS",
"vmess",
"xtls"

View File

@ -2,13 +2,15 @@ FROM node:16-alpine as base
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package-lock.json package.json ./
RUN npm ci --no-audit --legacy-peer-deps
RUN curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm@7 &&\
pnpm i &&\
pnpm build
COPY . .
FROM node:16-alpine as release
WORKDIR /app
COPY --from=base /app ./
RUN npm run build &&\
npm prune --omit dev --legacy-peer-deps
RUN pnpm build &&\
pnpm prune --prod
EXPOSE 80
CMD npm run serve -- --port 80
CMD pnpm serve -p 80

View File

@ -62,7 +62,7 @@ export async function getFileBySlug<T>(type: 'authors' | 'blog', slug: string |
source,
// mdx imports can be automatically source from the components directory
cwd: path.join(root, 'components'),
mdxOptions(options, frontmatter) {
xdmOptions(options, frontmatter) {
// this is the recommended way to add custom remark/rehype plugins:
// The syntax might look weird, but it protects you in case we add/remove
// plugins in the future.

View File

@ -1,5 +1,4 @@
import { Parent } from 'unist'
import { visit } from 'unist-util-visit'
import { visit, Parent } from 'unist-util-visit'
export default function remarkCodeTitles() {
return (tree: Parent & { lang?: string }) =>

View File

@ -1,6 +1,5 @@
import { Parent } from 'unist'
import { VFile } from 'vfile'
import { visit } from 'unist-util-visit'
import { visit, Parent } from 'unist-util-visit'
import { load } from 'js-yaml'
export default function extractFrontmatter() {

View File

@ -1,5 +1,5 @@
import { Parent, Node, Literal } from 'unist'
import { visit } from 'unist-util-visit'
import { Literal } from 'unist'
import { visit, Parent, Node } from 'unist-util-visit'
import sizeOf from 'image-size'
import fs from 'fs'

BIN
package-lock.json generated

Binary file not shown.

View File

@ -12,63 +12,66 @@
"prepare": "husky install"
},
"dependencies": {
"@fontsource/inter": "4.5.13",
"@mailchimp/mailchimp_marketing": "^3.0.78",
"@next/bundle-analyzer": "12.3.1",
"@tailwindcss/forms": "^0.5.3",
"@tailwindcss/typography": "^0.5.7",
"autoprefixer": "^10.4.12",
"esbuild": "^0.14.0",
"github-slugger": "^1.4.0",
"gray-matter": "^4.0.3",
"image-size": "1.0.2",
"mdx-bundler": "^9.0.1",
"next": "12.3.1",
"next-themes": "^0.2.1",
"postcss": "^8.4.17",
"preact": "^10.11.1",
"react": "18.2.0",
"@fontsource/inter": "4.5.2",
"@mailchimp/mailchimp_marketing": "^3.0.58",
"@next/bundle-analyzer": "12.0.9",
"@tailwindcss/forms": "^0.4.0",
"@tailwindcss/typography": "^0.5.0",
"autoprefixer": "^10.4.0",
"esbuild": "^0.13.13",
"github-slugger": "^1.3.0",
"gray-matter": "^4.0.2",
"image-size": "1.0.0",
"js-yaml": "^4.1.0",
"mdx-bundler": "^8.0.0",
"next": "^12.2.0",
"next-themes": "^0.0.14",
"postcss": "^8.4.5",
"preact": "^10.6.2",
"react": "17.0.2",
"react-commento": "^1.0.0",
"react-cusdis": "^2.1.3",
"react-dom": "18.2.0",
"reading-time": "1.5.0",
"rehype-autolink-headings": "^6.1.1",
"rehype-citation": "^0.4.0",
"react-dom": "17.0.2",
"reading-time": "1.3.0",
"rehype-autolink-headings": "^6.1.0",
"rehype-citation": "^0.2.0",
"rehype-katex": "^6.0.2",
"rehype-preset-minify": "6.0.0",
"rehype-prism-plus": "^1.5.0",
"rehype-slug": "^5.0.1",
"rehype-prism-plus": "^1.1.3",
"rehype-slug": "^5.0.0",
"remark-footnotes": "^4.0.1",
"remark-gfm": "^3.0.1",
"remark-math": "^5.1.1",
"sharp": "^0.31.1",
"sharp": "^0.28.3",
"smoothscroll-polyfill": "^0.4.4",
"tailwindcss": "^3.1.8",
"unist-util-visit": "^4.1.1"
"tailwindcss": "^3.0.18",
"unist-util-visit": "^4.0.0",
"vfile": "^5.3.5"
},
"devDependencies": {
"@svgr/webpack": "^6.4.0",
"@types/react": "^18.0.21",
"@types/tailwindcss": "^3.0.11",
"@typescript-eslint/eslint-plugin": "^5.39.0",
"@typescript-eslint/parser": "^5.39.0",
"@svgr/webpack": "^6.1.2",
"@types/react": "^17.0.50",
"@types/tailwindcss": "^2.2.0",
"@types/unist": "^2.0.6",
"@typescript-eslint/eslint-plugin": "^4.28.1",
"@typescript-eslint/parser": "^4.28.1",
"cross-env": "^7.0.3",
"dedent": "^0.7.0",
"eslint": "^8.24.0",
"eslint-config-next": "12.3.1",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"file-loader": "^6.2.0",
"eslint": "^7.29.0",
"eslint-config-next": "12.0.9",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.3.1",
"file-loader": "^6.0.0",
"globby": "11.0.3",
"husky": "^8.0.1",
"inquirer": "^9.1.3",
"lint-staged": "^13.0.3",
"next-remote-watch": "^2.0.0",
"prettier": "^2.7.1",
"prettier-plugin-tailwindcss": "^0.1.13",
"socket.io": "^4.5.2",
"socket.io-client": "^4.5.2",
"typescript": "^4.8.4"
"husky": "^6.0.0",
"inquirer": "^8.1.1",
"lint-staged": "^11.0.0",
"next-remote-watch": "^1.0.0",
"prettier": "^2.5.1",
"prettier-plugin-tailwindcss": "^0.1.4",
"socket.io": "^4.4.0",
"socket.io-client": "^4.4.0",
"typescript": "^4.6.1-rc"
},
"lint-staged": {
"*.+(js|jsx|ts|tsx)": [

7966
pnpm-lock.yaml Normal file

File diff suppressed because it is too large Load Diff