chore: add prettier config

This commit is contained in:
Yang Libin 2023-05-25 01:35:57 +00:00
parent 0d29af96c1
commit 43d8ff7212
9 changed files with 3115 additions and 222 deletions

View File

@ -1,7 +1,7 @@
module.exports = { module.exports = {
contents: ["summary.md"], contents: ['summary.md'],
pathToPublic: "pdf/advanced-java.pdf", pathToPublic: 'pdf/advanced-java.pdf',
pdfOptions: "<options for puppeteer.pdf()>", pdfOptions: '<options for puppeteer.pdf()>',
removeTemp: true, removeTemp: true,
emulateMedia: "screen", emulateMedia: 'screen',
}; };

1
.gitignore vendored
View File

@ -25,7 +25,6 @@ yarn-debug.log*
yarn-error.log* yarn-error.log*
dist dist
package-lock.json
lib lib
node_modules node_modules

3
.prettierignore Normal file
View File

@ -0,0 +1,3 @@
.idea/
.github/
node_modules/

View File

@ -7,4 +7,4 @@
"bracketSpacing": true, "bracketSpacing": true,
"jsxBracketSameLine": false, "jsxBracketSameLine": false,
"arrowParens": "avoid" "arrowParens": "avoid"
} }

View File

@ -288,25 +288,25 @@ public class TokenBucket {
```yaml ```yaml
spring: spring:
cloud: cloud:
gateway: gateway:
routes: routes:
- id: requestratelimiter_route - id: requestratelimiter_route
uri: lb://pigx-upms
order: 10000
predicates:
- Path=/admin/**
filters:
- name: RequestRateLimiter
args:
redis-rate-limiter.replenishRate: 1 # 令牌桶的容积
redis-rate-limiter.burstCapacity: 3 # 流速 每秒
key-resolver: '#{@remoteAddrKeyResolver}' #SPEL表达式去的对应的bean
- StripPrefix=1 uri: lb://pigx-upms
order: 10000
predicates:
- Path=/admin/**
filters:
- name: RequestRateLimiter
args:
redis-rate-limiter.replenishRate: 1 # 令牌桶的容积
redis-rate-limiter.burstCapacity: 3 # 流速 每秒
key-resolver: '#{@remoteAddrKeyResolver}' #SPEL表达式去的对应的bean
- StripPrefix=1
``` ```
```java ```java
@ -329,37 +329,37 @@ KeyResolver remoteAddrKeyResolver() {
```yaml ```yaml
spring: spring:
cloud: cloud:
nacos: nacos:
discovery: discovery:
server-addr: localhost:8848 server-addr: localhost:8848
sentinel: sentinel:
transport: transport:
dashboard: localhost:8080 dashboard: localhost:8080
port: 8720 port: 8720
datasource: datasource:
ds: ds:
nacos: nacos:
server-addr: localhost:8848 server-addr: localhost:8848
dataId: spring-cloud-sentinel-nacos dataId: spring-cloud-sentinel-nacos
groupId: DEFAULT_GROUP groupId: DEFAULT_GROUP
rule-type: flow rule-type: flow
namespace: xxxxxxxx namespace: xxxxxxxx
``` ```
- 配置内容在 nacos 上进行编辑 - 配置内容在 nacos 上进行编辑
```json ```json
[ [
{ {
"resource": "/hello", "resource": "/hello",
"limitApp": "default", "limitApp": "default",
"grade": 1, "grade": 1,
"count": 1, "count": 1,
"strategy": 0, "strategy": 0,
"controlBehavior": 0, "controlBehavior": 0,
"clusterMode": false "clusterMode": false
} }
] ]
``` ```

View File

@ -1,131 +1,160 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head>
<head> <meta charset="UTF-8" />
<meta charset="UTF-8" /> <title>互联网 Java 工程师进阶知识完全扫盲 - Doocs 技术社区</title>
<title>互联网 Java 工程师进阶知识完全扫盲 - Doocs 技术社区</title> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta
<meta name="keywords" content="doc,docs,doocs,documentation,github,gitee,advanced-java,yanglbme" /> name="keywords"
<meta name="description" content="互联网 Java 工程师进阶知识完全扫盲,项目维护者:杨立滨" /> content="doc,docs,doocs,documentation,github,gitee,advanced-java,yanglbme"
<meta name="viewport" />
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" /> <meta
<link rel="stylesheet" href="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify/lib/themes/vue.css" /> name="description"
<link rel="stylesheet" href="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify-darklight-theme@latest/dist/style.min.css"> content="互联网 Java 工程师进阶知识完全扫盲,项目维护者:杨立滨"
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon-32x32.png" /> />
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon-16x16.png" /> <meta
<style> name="viewport"
.markdown-section code { content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
font-weight: 400; />
} <link
rel="stylesheet"
article>p>img { href="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify/lib/themes/vue.css"
background-color: #f4f4f4; />
} <link
</style> rel="stylesheet"
</head> href="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify-darklight-theme@latest/dist/style.min.css"
/>
<body> <link
<nav> rel="icon"
<ul> type="image/png"
<li> sizes="32x32"
分类 href="images/favicon-32x32.png"
<ul> />
<li><a href="#/?id=高并发架构">高并发</a></li> <link
<li><a href="#/?id=分布式系统">分布式</a></li> rel="icon"
<li><a href="#/?id=高可用架构">高可用</a></li> type="image/png"
<li><a href="#/?id=微服务架构">微服务</a></li> sizes="16x16"
<li><a href="#/?id=海量数据处理">海量数据</a></li> href="images/favicon-16x16.png"
</ul> />
</li> <style>
<li> .markdown-section code {
页面 font-weight: 400;
<ul>
<li><a href="#">封面</a></li>
<li><a href="#/README">首页</a></li>
<li><a href="#/docs/extra-page/advanced">进阶</a></li>
<li><a href="#/docs/extra-page/offer">Offer</a></li>
</ul>
</li>
</ul>
</nav>
<div id="app">本系列知识由 Doocs 技术社区总结发布</div>
<script>
window.$docsify = {
name: "advanced-java",
maxLevel: 3,
auto2top: true,
coverpage: true,
coverpage: "docs/extra-page/cover.md",
loadSidebar: "summary.md",
alias: {
"/.*/.*/summary": "summary.md",
"/.*/summary.md": "summary.md",
},
pagination: {
previousText: "上一篇",
nextText: "下一篇",
crossChapter: true,
crossChapterText: true,
},
contributors: {
repo: 'doocs/advanced-java',
ignores: ['/README.md'],
image: {
margin: '0.2em',
isRound: true
}
},
search: {
maxAge: 1800000,
paths: [
"/docs/high-concurrency/",
"/docs/distributed-system/",
"/docs/high-availability/",
"/docs/micro-services/",
"/docs/big-data/",
],
depth: 3,
},
darklightTheme: {
defaultTheme: 'light',
siteFont: 'Source Sans Pro,Helvetica Neue,Arial,sans-serif',
codeFontFamily: 'Roboto Mono, Monaco, courier, monospace',
bodyFontSize: '15px',
dark: {
background: 'rgb(28,32,34)',
highlightColor: '#e96900',
codeBackgroundColor: 'rgb(34,39,46)',
codeTextColor: '#b4b4b4',
},
light: {
highlightColor: '#e96900',
}
},
plugins: [
function (hook, vm) {
hook.beforeEach(function (content) {
const en = vm.route.file.indexOf("README_EN") > -1;
if (/githubusercontent\.com/.test(vm.route.file)) {
url = vm.route.file
.replace("raw.githubusercontent.com", "github.com")
.replace(/\/main/, "/blob/main");
} else {
url =
"https://github.com/doocs/advanced-java/blob/main/" +
vm.route.file;
} }
const github = `[GitHub](${url})`; article > p > img {
const gitee = `[Gitee](${url.replace("github", "gitee")})`; background-color: #f4f4f4;
const editHtml = en
? `:memo: Edit on ${github} / ${gitee}\n`
: `:memo: ${github} / ${gitee} 编辑\n`;
if (vm.route.path == "/") {
return editHtml + content;
} }
const subscription = `--- </style>
</head>
<body>
<nav>
<ul>
<li>
分类
<ul>
<li><a href="#/?id=高并发架构">高并发</a></li>
<li><a href="#/?id=分布式系统">分布式</a></li>
<li><a href="#/?id=高可用架构">高可用</a></li>
<li><a href="#/?id=微服务架构">微服务</a></li>
<li><a href="#/?id=海量数据处理">海量数据</a></li>
</ul>
</li>
<li>
页面
<ul>
<li><a href="#">封面</a></li>
<li><a href="#/README">首页</a></li>
<li><a href="#/docs/extra-page/advanced">进阶</a></li>
<li><a href="#/docs/extra-page/offer">Offer</a></li>
</ul>
</li>
</ul>
</nav>
<div id="app">本系列知识由 Doocs 技术社区总结发布</div>
<script>
window.$docsify = {
name: 'advanced-java',
maxLevel: 3,
auto2top: true,
coverpage: true,
coverpage: 'docs/extra-page/cover.md',
loadSidebar: 'summary.md',
alias: {
'/.*/.*/summary': 'summary.md',
'/.*/summary.md': 'summary.md',
},
pagination: {
previousText: '上一篇',
nextText: '下一篇',
crossChapter: true,
crossChapterText: true,
},
contributors: {
repo: 'doocs/advanced-java',
ignores: ['/README.md'],
image: {
margin: '0.2em',
isRound: true,
},
},
search: {
maxAge: 1800000,
paths: [
'/docs/high-concurrency/',
'/docs/distributed-system/',
'/docs/high-availability/',
'/docs/micro-services/',
'/docs/big-data/',
],
depth: 3,
},
darklightTheme: {
defaultTheme: 'light',
siteFont: 'Source Sans Pro,Helvetica Neue,Arial,sans-serif',
codeFontFamily: 'Roboto Mono, Monaco, courier, monospace',
bodyFontSize: '15px',
dark: {
background: 'rgb(28,32,34)',
highlightColor: '#e96900',
codeBackgroundColor: 'rgb(34,39,46)',
codeTextColor: '#b4b4b4',
},
light: {
highlightColor: '#e96900',
},
},
plugins: [
function (hook, vm) {
hook.beforeEach(function (content) {
const en = vm.route.file.indexOf('README_EN') > -1;
if (/githubusercontent\.com/.test(vm.route.file)) {
url = vm.route.file
.replace(
'raw.githubusercontent.com',
'github.com',
)
.replace(/\/main/, '/blob/main');
} else {
url =
'https://github.com/doocs/advanced-java/blob/main/' +
vm.route.file;
}
const github = `[GitHub](${url})`;
const gitee = `[Gitee](${url.replace(
'github',
'gitee',
)})`;
const editHtml = en
? `:memo: Edit on ${github} / ${gitee}\n`
: `:memo: ${github} / ${gitee} 编辑\n`;
if (vm.route.path == '/') {
return editHtml + content;
}
const subscription = `---
## 公众号 ## 公众号
[Doocs](https://github.com/doocs) 技术社区旗下唯一公众号**Doocs**欢迎扫码关注**专注分享技术领域相关知识及业内最新资讯**当然也可以加我个人微信备注GitHub拉你进技术交流群 [Doocs](https://github.com/doocs) 技术社区旗下唯一公众号**Doocs**欢迎扫码关注**专注分享技术领域相关知识及业内最新资讯**当然也可以加我个人微信备注GitHub拉你进技术交流群
@ -149,34 +178,33 @@
</tr> </tr>
</table> </table>
`; `;
return editHtml + content + `\n` + subscription; return editHtml + content + `\n` + subscription;
}); });
hook.afterEach(function (html) { hook.afterEach(function (html) {
const currentYear = new Date().getFullYear() const currentYear = new Date().getFullYear();
const footer = `<footer><span>Copyright © 2018-${currentYear} <a href="https://github.com/doocs" target="_blank">Doocs</a>. All Rights Reserved.</footer>` const footer = `<footer><span>Copyright © 2018-${currentYear} <a href="https://github.com/doocs" target="_blank">Doocs</a>. All Rights Reserved.</footer>`;
return html + footer; return html + footer;
}); });
}, },
], ],
}; };
</script> </script>
<script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify/lib/docsify.min.js"></script> <script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify/lib/docsify.min.js"></script>
<script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/prismjs/components/prism-java.min.js"></script> <script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/prismjs/components/prism-java.min.js"></script>
<script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify-copy-code@2.1.1/dist/docsify-copy-code.min.js"></script> <script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify-copy-code@2.1.1/dist/docsify-copy-code.min.js"></script>
<script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify/lib/plugins/search.min.js"></script> <script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify/lib/plugins/search.min.js"></script>
<script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify/lib/plugins/zoom-image.min.js"></script> <script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify/lib/plugins/zoom-image.min.js"></script>
<script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify-pagination/dist/docsify-pagination.min.js"></script> <script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify-pagination/dist/docsify-pagination.min.js"></script>
<script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify-darklight-theme@latest/dist/index.min.js"></script> <script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify-darklight-theme@latest/dist/index.min.js"></script>
<script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify-contributors@latest/dist/index.min.js"></script> <script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify-contributors@latest/dist/index.min.js"></script>
</body> </body>
<!-- <!--
cdn.jsdelivr.net cdn.jsdelivr.net
test1.jsdelivr.net test1.jsdelivr.net
testingcf.jsdelivr.net testingcf.jsdelivr.net
fastly.jsdelivr.net fastly.jsdelivr.net
gcore.jsdelivr.net gcore.jsdelivr.net
--> -->
</html>
</html>

2862
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,26 +1,27 @@
{ {
"scripts": { "scripts": {
"dev": "docsify serve --open", "dev": "docsify serve --open",
"convert": "docsify-pdf-converter" "convert": "docsify-pdf-converter"
}, },
"name": "advanced-java", "name": "advanced-java",
"description": "互联网 Java 工程师进阶知识完全扫盲@doocshttps://github.com/doocs/advanced-java", "description": "互联网 Java 工程师进阶知识完全扫盲@doocshttps://github.com/doocs/advanced-java",
"version": "1.0.0", "version": "1.0.0",
"main": ".docsifytopdfrc.js", "main": ".docsifytopdfrc.js",
"directories": { "directories": {
"doc": "docs" "doc": "docs"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/doocs/advanced-java.git" "url": "https://github.com/doocs/advanced-java.git"
}, },
"author": "yanglbme", "author": "yanglbme",
"license": "CC-BY-SA-4.0", "license": "CC-BY-SA-4.0",
"bugs": { "bugs": {
"url": "https://github.com/doocs/advanced-java/issues" "url": "https://github.com/doocs/advanced-java/issues"
}, },
"homepage": "https://github.com/doocs/advanced-java#readme", "homepage": "https://github.com/doocs/advanced-java#readme",
"devDependencies": { "devDependencies": {
"docsify-pdf-converter": "^2.0.7" "docsify-pdf-converter": "^2.0.7",
} "prettier": "2.8.8"
} }
}

View File

@ -2,4 +2,4 @@
"github": { "github": {
"silent": true "silent": true
} }
} }