Skip to content

Commit

Permalink
✨ feat(husky): add git hooks
Browse files Browse the repository at this point in the history
add husky
add zhlint
format & lint everything

now we can run `docs:zhlint` to format Chinese docs
also automatically run before commiting changes
  • Loading branch information
bingling-sama committed Oct 20, 2023
1 parent 83be511 commit 79b3cd3
Show file tree
Hide file tree
Showing 23 changed files with 1,306 additions and 13 deletions.
9 changes: 9 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

echo "running docs:eslint"
pnpm run docs:eslint
echo "running docs:zhling"
pnpm run docs:zhlint
echo "running docs:format"
pnpm run docs:format
1 change: 1 addition & 0 deletions .zhlintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docs/.vitepress
6 changes: 6 additions & 0 deletions .zhlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"preset": "markdown",
"rules": {
" unifiedPunctuation": "traditonal"
}
}
2 changes: 2 additions & 0 deletions docs/analyzer.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ import Analyzer from './.vitepress/theme/components/Analyzer.vue'
---

:::tip 帮助

- **分析日志之前请确保你使用的是最新版启动器。**
- 如分析模块长时间未响应请刷新页面重试。
- 如果分析工具提供的解决方案无效,或者本工具还未收录您遇到的错误时,请在页面下方留言。
- 本工具仍在起步阶段,我们会不断优化用户体验。
:::

:::warning 隐私声明

- 所有文件的分析仅会在本地进行,仅会有部分错误信息被上传到云端。
:::

Expand Down
10 changes: 10 additions & 0 deletions docs/basis.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,13 @@ A:要对 `Minecraft` 的游戏错误 / 崩溃进行处理,您首先要对游

**本文档所提供的方案仅供参考,您操作造成的问题由您自行承担!!!**
:::










9 changes: 9 additions & 0 deletions docs/client/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,12 @@ Minecraft 客户端,是 Minecraft 游戏本身一大组成部分。通俗来
得到了崩溃日志,就可以处理崩溃了。在接下来的文档中,有针对于 Mod 问题、系统问题、原版问题的解决方案,您可以对照日志自行参考解决。

最后,希望我们能帮助您成功解决问题,祝您游玩愉快!









13 changes: 11 additions & 2 deletions docs/client/mods.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Unsupported class file major version

| 关键词 | 解决方案 |
| ------------------------------------------------------ | --------------------------------------- |
| `no such method: sun.misc.Unsafe.defineAnonymousClass` | Java 版本过高,降低 Java 版本至 [Java 8u312](https://ghproxy.com/https://github.com/bell-sw/Liberica/releases/download/8u312%2B7/bellsoft-jre8u312+7-windows-amd64-full.msi) 或者 [Java 11.0.13](https://ghproxy.com/https://github.com/bell-sw/Liberica/releases/download/11.0.13%2B8/bellsoft-jre11.0.13+8-windows-amd64-full.msi) |
| `no such method: sun.misc.Unsafe.defineAnonymousClass` | Java 版本过高,降低 Java 版本至 [Java 8u312](https://cdn.crashmc.com/https://github.com/bell-sw/Liberica/releases/download/8u312%2B7/bellsoft-jre8u312+7-windows-amd64-full.msi) 或者 [Java 11.0.13](https://cdn.crashmc.com/https://github.com/bell-sw/Liberica/releases/download/11.0.13%2B8/bellsoft-jre11.0.13+8-windows-amd64-full.msi) |

附 Java 版本查询列表

Expand Down Expand Up @@ -65,7 +65,7 @@ Unsupported class file major version
:::

:::details 其他 Java 获取方法
从官网下载并手动安装 Java: [Java 8](https://ghproxy.com/https://github.com/bell-sw/Liberica/releases/download/8u312%2B7/bellsoft-jre8u312+7-windows-amd64-full.msi) | [JDK 17+](https://ghproxy.com/https://github.com/bell-sw/Liberica/releases/download/17.0.1%2B12/bellsoft-jdk17.0.1+12-windows-amd64.msi)
从官网下载并手动安装 Java: [Java 8](https://cdn.crashmc.com/https://github.com/bell-sw/Liberica/releases/download/8u312%2B7/bellsoft-jre8u312+7-windows-amd64-full.msi) | [JDK 17+](https://cdn.crashmc.com/https://github.com/bell-sw/Liberica/releases/download/17.0.1%2B12/bellsoft-jdk17.0.1+12-windows-amd64.msi)

获取 (Java 9+) 且已存档的 JDK 包: <https://bell-sw.com/pages/downloads/#downloads>
:::
Expand Down Expand Up @@ -497,3 +497,12 @@ java.lang.NoSuchMethodError: net.minecraft.launchwrapper.ITweaker.injectIntoClas
TRANSFORMER/net.optifine/net.optifine.reflect.Reflector.<clinit>(Reflector.java
```









9 changes: 9 additions & 0 deletions docs/client/shared.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,12 @@
```
Manually triggered debug crash
```









13 changes: 11 additions & 2 deletions docs/client/system.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Could not reserve enough space
:::

:::details 其他 Java 获取方法
从官网下载并手动安装 Java: [Java 8](https://ghproxy.com/https://github.com/bell-sw/Liberica/releases/download/8u312%2B7/bellsoft-jre8u312+7-windows-amd64-full.msi) | [JDK 17+](https://ghproxy.com/https://github.com/bell-sw/Liberica/releases/download/17.0.1%2B12/bellsoft-jdk17.0.1+12-windows-amd64.msi)
从官网下载并手动安装 Java: [Java 8](https://cdn.crashmc.com/https://github.com/bell-sw/Liberica/releases/download/8u312%2B7/bellsoft-jre8u312+7-windows-amd64-full.msi) | [JDK 17+](https://cdn.crashmc.com/https://github.com/bell-sw/Liberica/releases/download/17.0.1%2B12/bellsoft-jdk17.0.1+12-windows-amd64.msi)

获取 (Java 9+) 且已存档的 JDK 包: <https://bell-sw.com/pages/downloads/#downloads)>
:::
Expand Down Expand Up @@ -122,7 +122,7 @@ OpenJ9 is incompatible
:::

:::details 其他 Java 获取方法
从官网下载并手动安装 Java: [Java 8](https://ghproxy.com/https://github.com/bell-sw/Liberica/releases/download/8u312%2B7/bellsoft-jre8u312+7-windows-amd64-full.msi | [JDK 17+](https://ghproxy.com/https://github.com/bell-sw/Liberica/releases/download/17.0.1%2B12/bellsoft-jdk17.0.1+12-windows-amd64.msi)
从官网下载并手动安装 Java: [Java 8](https://cdn.crashmc.com/https://github.com/bell-sw/Liberica/releases/download/8u312%2B7/bellsoft-jre8u312+7-windows-amd64-full.msi | [JDK 17+](https://cdn.crashmc.com/https://github.com/bell-sw/Liberica/releases/download/17.0.1%2B12/bellsoft-jdk17.0.1+12-windows-amd64.msi)

获取 (Java 9+) 且已存档的 JDK 包: <https://bell-sw.com/pages/downloads/#downloads>
:::
Expand Down Expand Up @@ -219,3 +219,12 @@ class io.github.reserveword.imblocker.IMBlocker$RegistryEvents
```

解决方案:将游戏路径中的非 ASCII 字符去掉









4 changes: 2 additions & 2 deletions docs/client/vanilla.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ java.lang.IllegalStateException: failed to create a child event loop
2. 如您安装了 McAfee(及其衍生产品)或 Outpost Security,尝试卸载该软件并再次重新启动游戏。
3. 如您没有防病毒安全软件,尝试在 Microsoft Defender 中的 “防火墙和网络保护” 中关闭 “专用网络保护”。
4. 关闭您的加速器或 VPN。
5. 前往 Oracle 官网下载最新版 Java,并将该 Java 设置为游戏 Java。
5. 前往 Bellsoft 官网下载最新版 Java,并将该 Java 设置为游戏 Java。

:::details 常见的第三方启动器设置版本 Java 功能位置

Expand Down Expand Up @@ -163,4 +163,4 @@ netsh int ipv6 reset reset.log
请注意,重复此办法打开存档数次后,存档将愈加难以成功进入。
:::

进入游戏后,重复尝试进入存档,通常会有很大概率在第二次成功打开存档。
进入游戏后,重复尝试进入存档,通常会有很大概率在第二次成功打开存档。。。。。。。。。。
9 changes: 9 additions & 0 deletions docs/contribute/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,12 @@ contributors: [用户名, 用户名, 用户名]
- 请一定要使用 GitHub 用户名署名,否则我们无法获取您的头像。
- 上述代码中所使用的均为英文半角逗号!
:::









9 changes: 9 additions & 0 deletions docs/contribute/contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,12 @@ GlobeMC 河豚分析是一个 2023 年 7 月底成立的崩溃日志分析组织
此处列出了本文档的所有贡献者,感谢他们为文档作出的贡献。

<VPTeamMembers size="small" :members="members" />









9 changes: 9 additions & 0 deletions docs/contribute/crash-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,12 @@ contributors: [bingling-sama]
:::info 注意
在提交崩溃报告时,您首先要在 [GitHub](https://github.com) 网站注册一个帐号,以便我们对问题的后续跟踪。
:::









10 changes: 10 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,13 @@ features:
title: CrashMC
titleTemplate: 为一般玩家编写的 Minecraft 崩溃分析指南
---










10 changes: 10 additions & 0 deletions docs/mixin.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,13 @@ org.spongepowered.asm.mixin.injection.throwables.InvalidInjectionException: @At(
删除掉其中任意一个模组

### Mod 版本 / Mod 所适用的 Minecraft 版本错误










9 changes: 9 additions & 0 deletions docs/server/hybrid.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,12 @@
## Bukkit & Forge

## Bukkit & Fabric









9 changes: 9 additions & 0 deletions docs/server/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,12 @@
一般而言,最新的日志文件在 `logs\latest.log`,而崩溃报告在 `crash-reports` 目录下。

得到日志文件后,就可以根据后续的文档处理崩溃了。您也可以使用[崩溃分析工具](https://crashmc.com/analyzer.html),将日志文件打包成 zip 并上传尝试分析。祝您成功解决问题!









9 changes: 9 additions & 0 deletions docs/server/mods.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,12 @@ Failed to load class net.coderbot.iris.Iris
## NeoForge

待补充









9 changes: 9 additions & 0 deletions docs/server/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,12 @@ java.lang.RuntimeException: Server attempted to load chunk saved with newer vers
### BungeeCord 及其衍生服务端

### Velocity 及其衍生服务端









9 changes: 9 additions & 0 deletions docs/server/shared.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,12 @@ You need to agree to the EULA in order to run the server. Go to eula.txt for mor
```
Perhaps a server is already running on that port?
```









9 changes: 9 additions & 0 deletions docs/server/vanilla.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,12 @@
:::info WIP
即将到来
:::









10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
"docs:build": "vitepress build docs",
"docs:preview": "vitepress preview docs",
"docs:format": "prettier --write .",
"docs:lint": "eslint --ignore-path .gitignore --ext .ts,.vue \"docs/.vitepress/**/*.{ts,vue}\"",
"docs:tsc": "tsc --noEmit --module es2022 --skipDefaultLibCheck"
"docs:eslint": "eslint --ignore-path .gitignore --ext .ts,.vue \"docs/.vitepress/**/*.{ts,vue}\" --fix",
"docs:zhlint": "zhlint docs/**/*.md --fix",
"docs:tsc": "tsc --noEmit --module es2022 --skipDefaultLibCheck",
"prepare": "husky install"
},
"name": "mccrash-docs",
"version": "0.0.0",
Expand All @@ -21,14 +23,16 @@
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier-vue": "^4.2.0",
"eslint-plugin-vue": "^9.17.0",
"husky": "^8.0.3",
"prettier": "^3.0.2",
"sass": "^1.68.0",
"tslib": "^2.6.1",
"vite-plugin-pwa": "^0.16.4",
"vitepress": "1.0.0-rc.20",
"vue": "^3.3.4",
"vue-eslint-parser": "^9.3.1",
"workbox-window": "^7.0.0"
"workbox-window": "^7.0.0",
"zhlint": "^0.7.1"
},
"keywords": [
"Minecraft",
Expand Down

0 comments on commit 79b3cd3

Please sign in to comment.