Skip to content

Commit a91da03

Browse files
committed
feat: init project
0 parents  commit a91da03

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+8992
-0
lines changed

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

.eslintignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules
2+
dist
3+
coverage
4+
**/*.d.ts
5+
tests
6+
**/lib/*
7+
8+
packages/studio-schemas/src/fst

.eslintrc.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
module.exports = {
2+
root: true,
3+
extends: ['@hai-platform'],
4+
overrides: [
5+
{
6+
files: ['*.js', '*.mjs', '*.cjs'],
7+
rules: {
8+
'no-console': [
9+
'warn',
10+
{
11+
allow: ['info', 'warn', 'error'],
12+
},
13+
],
14+
},
15+
},
16+
{
17+
files: ['*.ts', '*.tsx'],
18+
extends: ['@hai-platform/react'],
19+
parserOptions: {
20+
project: ['./apps/**/tsconfig.json'],
21+
tsconfigRootDir: __dirname,
22+
},
23+
rules: {
24+
'react/prop-types': [2, { ignore: ['children'] }],
25+
'require-await': 'error',
26+
'import/no-extraneous-dependencies': 'off',
27+
'react/require-default-props': 'off',
28+
'react/button-has-type': 'off',
29+
'no-underscore-dangle': 'off',
30+
'@typescript-eslint/explicit-function-return-type': 'off',
31+
'class-methods-use-this': 'off',
32+
'prefer-template': 'off',
33+
'import/prefer-default-export': 'off',
34+
'no-console': [
35+
'warn',
36+
{
37+
allow: ['info', 'warn', 'error'],
38+
},
39+
],
40+
},
41+
},
42+
],
43+
}

.eslintrc.tools.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const path = require('path')
2+
const options = require('./.eslintrc')
3+
4+
module.exports = {
5+
// 这样拆分出来,给 typescript-eslint 减小一些压力,通常能节省 50%+ 的时间
6+
getModuleEslintConfig: (dirname) => {
7+
const parserOptions = {
8+
project: [path.resolve(dirname, './tsconfig.json')],
9+
tsconfigRootDir: dirname,
10+
}
11+
12+
options.overrides.forEach((overrideConfig) => {
13+
overrideConfig.parserOptions = parserOptions
14+
})
15+
return options
16+
},
17+
}

.gitignore

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# System
2+
.DS_Store
3+
4+
# IDE or eidtor
5+
.idea/
6+
.code/
7+
8+
# Dependency directories
9+
node_modules/
10+
11+
# Logs
12+
logs
13+
*.log
14+
npm-debug.log*
15+
yarn-debug.log*
16+
yarn-error.log*
17+
18+
# Runtime data
19+
pids
20+
*.pid
21+
*.seed
22+
*.pid.lock
23+
24+
# Package tool
25+
.happypack
26+
27+
# Directory for instrumented libs generated by jscoverage/JSCover
28+
lib-cov
29+
30+
# Coverage directory used by tools like istanbul
31+
coverage
32+
33+
# nyc test coverage
34+
.nyc_output
35+
36+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
37+
.grunt
38+
39+
# node-waf configuration
40+
.lock-wscript
41+
42+
# Typescript v1 declaration files
43+
typings/
44+
45+
# Optional npm cache directory
46+
.npm
47+
48+
# Optional eslint cache
49+
.eslintcache
50+
51+
# Optional REPL history
52+
.node_repl_history
53+
54+
# Output of 'npm pack'
55+
*.tgz
56+
57+
# Yarn Integrity file
58+
.yarn-integrity
59+
60+
# dotenv environment variables file
61+
.env
62+
63+
notes
64+
65+
sync-to-github-*.zip
66+
67+
tsconfig.tsbuildinfo
68+
69+
dist

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# sync-to-github
2+
3+
这是一个 Chrome 插件,可以将你的网页内容同步到 github 仓库中,例如与 ChatGPT 的对话。
4+
5+
![preview](./docs/preview.gif)
6+
7+
## 安装和使用
8+
9+
[releases](https://github.com/aircloud/sync-to-github/releases) 中下载最新的 zip 包,解压缩,通过在 `设置 - 插件 - Load unpacked` 加载对应的文件夹完成安装。
10+
11+
初次使用前,请点击右上角“设置”,设置你的 AccessToken、仓库和目录信息。
12+
13+
当前支持列表:
14+
15+
- [ChatGPT](https://chat.openai.com/)
16+
- [ShareGPT](https://sharegpt.com)
17+
18+
## 新增一个网站
19+
20+
- 你可以在 issue 中新增一个 issue,记得添加 `add-a-website` Tag。
21+
- 如果你是开发者,欢迎你 fork 代码,参考下文"贡献内容",并且通过 `Pull Request` 的方式合并到本项目中。
22+
23+
## 贡献内容
24+
25+
你可以很方便地新增一个网站支持。
26+
27+
1.[converters](apps/chrome-ext/src/converters) 中参考现有项目,新增一个文件夹,用于实现 `BaseConverter`
28+
2.[content_script](apps/chrome-ext/src/content_script.ts) 中引入它,新增一个实例。
29+
3.[manifest.jso](apps/chrome-ext/public/manifest.json) 中的 `content_scripts.matches` 中新增相应的正则匹配。
30+
31+
## 潜在的功能
32+
33+
这是一个刚刚开启的项目,更多的功能仍然需要完善,包括但不限于:
34+
35+
- 只在通过检测的网站中显示彩色图标
36+
- 自动发布版本
37+
- 同步到插件商店

apps/chrome-ext/.eslintrc.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('../../.eslintrc.tools').getModuleEslintConfig(__dirname)

apps/chrome-ext/package.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"name": "chrome-ext",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "vite",
7+
"start": "vite",
8+
"build": "tsc && vite build",
9+
"preview": "vite preview"
10+
},
11+
"type": "module",
12+
"keywords": [
13+
"chatgpt"
14+
],
15+
"author": "aircloud",
16+
"license": "ISC",
17+
"dependencies": {
18+
"@blueprintjs/colors": "^4.1.15",
19+
"@blueprintjs/core": "^4.16.3",
20+
"@blueprintjs/popover2": "^1.13.3",
21+
"@emotion/react": "^11.10.6",
22+
"@emotion/styled": "^11.10.6",
23+
"@fontsource/roboto": "^4.5.8",
24+
"@mui/icons-material": "^5.11.11",
25+
"@mui/lab": "5.0.0-alpha.123",
26+
"@mui/material": "^5.11.13",
27+
"@octokit-next/core": "^2.7.0",
28+
"@octokit/core": "^4.2.0",
29+
"@types/chrome": "^0.0.224",
30+
"@types/node": "^18.15.3",
31+
"axios": "^1.3.3",
32+
"classnames": "^2.3.2",
33+
"dayjs": "^1.11.7",
34+
"octokit-next": "^1.2.1",
35+
"react": "^18.2.0",
36+
"react-dom": "^18.2.0",
37+
"react-use": "^17.4.0",
38+
"sass": "^1.58.3",
39+
"turndown": "^7.1.1",
40+
"unocss": "^0.50.6"
41+
},
42+
"devDependencies": {
43+
"@octokit/types": "^9.0.0",
44+
"@types/react": "^18.0.27",
45+
"@types/react-dom": "^18.0.10",
46+
"@vitejs/plugin-react": "^3.1.0",
47+
"typescript": "^4.9.3",
48+
"vite": "^4.1.0"
49+
}
50+
}

0 commit comments

Comments
 (0)