Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add pre-commit and run prettier in it #386

Merged
merged 7 commits into from
Jun 27, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Related issues:

- [ ] I have read the [CONTRIBUTING](https://github.com/hypertrons/hypertrons-crx/blob/master/CONTRIBUTING.md) doc
- [ ] I have signed the [CLA](https://cla-assistant.io/hypertrons/hypertrons-crx)
- [ ] I have run `yarn run prettier` before creating this PR

## Others
<!-- Other information you want to share. -->
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn run prettier
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,12 @@ Please read [CONTRIBUTING](./CONTRIBUTING.md) if you are new here or not familia
2. cd hypertrons-crx

3. yarn install

4. yarn run prepare
tyn1998 marked this conversation as resolved.
Show resolved Hide resolved

5. yarn run start

4. yarn run start

5. Load the freshly built unpacked extension on Chrome following:
6. Load the freshly built unpacked extension on Chrome following:

1. Access chrome://extensions/

Expand All @@ -105,7 +107,7 @@ Please read [CONTRIBUTING](./CONTRIBUTING.md) if you are new here or not familia

![](./assets/keep-service-worker-devtools-open.jpeg)

6. Happy hacking!
7. Happy hacking!

### HMR & auto-reload

Expand Down
8 changes: 5 additions & 3 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,12 @@ Hypertrons 浏览器插件项目旨在通过直接往 GitHub 页面中插入各
2. cd hypertrons-crx

3. yarn install

4. yarn run prepare
tyn1998 marked this conversation as resolved.
Show resolved Hide resolved

4. yarn run start
5. yarn run start

5. 在 chrome 中加载新鲜出炉的插件:
6. 在 chrome 中加载新鲜出炉的插件:

1. 在浏览器地址栏访问 chrome://extensions/

Expand All @@ -108,7 +110,7 @@ Hypertrons 浏览器插件项目旨在通过直接往 GitHub 页面中插入各

![](./assets/keep-service-worker-devtools-open.jpeg)

6. Happy hacking!
7. Happy hacking!

### HMR & auto-reload

Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"start": "node utils/server.js",
"deploy": "node scripts/deploy.js",
"prettier": "prettier --write \"**/*.{js,jsx,ts,tsx,json,css,scss}\"",
"prettier:check": "prettier --check \"**/*.{js,jsx,ts,tsx,json,css,scss}\""
"prettier:check": "prettier --check \"**/*.{js,jsx,ts,tsx,json,css,scss}\"",
"prepare": "husky install"
},
"dependencies": {
"@antv/g6": "^4.6.4",
Expand Down Expand Up @@ -50,6 +51,7 @@
"fs-extra": "^10.0.0",
"html-loader": "^3.1.0",
"html-webpack-plugin": "^5.5.0",
"husky": "^8.0.1",
"mkdirp": "^1.0.4",
"prettier": "^2.6.2",
"querystring": "^0.2.1",
Expand Down
Loading