Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"@ant-design/pro-chat": "^1.9.0",
"@ant-design/pro-editor": "^1.3.0",
"@hot-loader/react-dom": "^17.0.2",
"@octokit/rest": "^21.0.2",
"@types/chrome": "^0.0.203",
"@types/dompurify": "^3.0.5",
"@types/react-copy-to-clipboard": "^5.0.7",
Expand All @@ -49,11 +50,12 @@
"moment": "^2.30.1",
"openai": "^4.60.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-chat-widget": "^3.1.4",
"react-dom": "^18.2.0",
"react-hot-loader": "^4.13.0",
"react-i18next": "^14.1.2",
"react-modal": "3.15.1",
"stackedit-js": "^1.0.7",
"stream": "^0.0.3",
"strip-indent": "^4.0.0"
},
Expand Down
1 change: 1 addition & 0 deletions src/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ export const OSS_XLAB_ENDPOINT = 'https://oss.open-digger.cn';
export const HYPERTRONS_CRX_NEW_ISSUE = 'https://github.com/hypertrons/hypertrons-crx/issues/new/choose';

export const HYPERCRX_GITHUB = 'https://github.com/hypertrons/hypertrons-crx';
export const OSS_URL = 'https://hypercrx-fastpr.oss-cn-beijing.aliyuncs.com/fastPR-url-rules.js';
37 changes: 36 additions & 1 deletion src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,40 @@
"gitee_token_error_empty": "Token cannot be empty",
"gitee_token_success_save": "Token saved successfully",
"gitee_token_success_valid": "Token is valid. Username: {{username}}",
"gitee_token_error_invalid": "Invalid token or request failed"
"gitee_token_error_invalid": "Invalid token or request failed",
"fast_pr": "FastPR",
"pr_title_label": "PR Title",
"pr_title_rule": "Please enter the PR title",
"pr_title_placeholder": "Enter PR title",
"pr_content_label": "PR Content",
"pr_content_rule": "Please enter the PR content",
"pr_content_placeholder": "Enter PR content",
"pr_submit": "Submit",
"pr_cancel": "Cancel",
"network_error_load_file": "Network was not able to load the file: {{status}}",
"fetch_error_file": "Failed to fetch file: {{error}}",
"error_fetch_repo_info": "Failed to fetch repository info: {{status}}",
"error_get_or_create_fork": "Failed to get or create fork: {{status}}",
"error_get_latest_sha": "Failed to get the latest SHA submission: {{status}}",
"error_create_branch": "Failed to create a new branch: {{status}}",
"error_get_file_sha": "Failed to get the SHA value of the file: {{status}}",
"error_update_file_content": "Failed to update file content: {{status}}",
"error_create_pr": "Failed to create a new PR: {{status}}",
"status_get_github_token": "Get GitHub token...",
"status_get_gitee_token": "Get Gitee token...",
"error_get_github_token": "Failed to get GitHub token.",
"error_get_gitee_token": "Failed to get Giteeb token.",
"status_check_repo_permission": "Checking repository permission...",
"status_get_or_create_fork": "Get or create fork...",
"status_get_latest_commit_sha": "Get latest commit SHA of the base branch...",
"status_create_branch": "Creating new branch...",
"status_get_file_sha": "Get file SHA...",
"status_update_file_content": "Creating or updating file content...",
"status_create_pr": "Creating PR...",
"success_create_pr": "PR created successfully.\nPR URL: {{url}}",
"error_get_user_info": "Failed to get user info: {{status}}",
"error_get_file": "The path is a directory, not a file.",
"error_match_FastPr_Url": "Error executing URL matching function: {{status}}.",
"github_token_not_found": "GitHub token not found.\nPlease enter the token in the Settings page of the extension.",
"gitee_token_not_found": "Gitee token not found.\nPlease enter the token in the Settings page of the extension."
}
37 changes: 36 additions & 1 deletion src/locales/zh_CN/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,40 @@
"gitee_token_error_empty": "令牌不能为空",
"gitee_token_success_save": "令牌保存成功",
"gitee_token_success_valid": "令牌有效。用户名:{{username}}",
"gitee_token_error_invalid": "令牌无效或请求失败"
"gitee_token_error_invalid": "令牌无效或请求失败",
"fast_pr": "FastPR",
"pr_title_label": "PR 标题",
"pr_title_rule": "请输入 PR 的标题",
"pr_title_placeholder": "输入 PR 的标题",
"pr_content_label": "PR 内容",
"pr_content_rule": "请输入 PR 的内容",
"pr_content_placeholder": "输入 PR 的内容",
"pr_submit": "提交",
"pr_cancel": "取消",
"network_error_load_file": "网络问题无法加载文件:{{status}}",
"fetch_error_file": "获取文件失败:{{error}}",
"error_fetch_repo_info": "获取仓库信息失败:{{status}}",
"error_get_or_create_fork": "获取或创建分叉失败:{{status}}",
"error_get_latest_sha": "获取最新SHA提交失败:{{status}}",
"error_create_branch": "创建新分支失败:{{status}}",
"error_get_file_sha": "获取文件SHA值失败:{{status}}",
"error_update_file_content": "更新文件内容失败:{{status}}",
"error_create_pr": "创建新PR失败:{{status}}",
"status_get_github_token": "获取 GitHub 令牌...",
"error_get_github_token": "获取 GitHub 令牌失败",
"status_get_gitee_token": "获取 Gitee 令牌...",
"error_get_gitee_token": "获取 Gitee 令牌失败",
"status_check_repo_permission": "检查仓库权限...",
"status_get_or_create_fork": "获取或创建分叉...",
"status_get_latest_commit_sha": "获取基准分支的最新提交 SHA ...",
"status_create_branch": "创建新分支...",
"status_get_file_sha": "获取文件 SHA ...",
"status_update_file_content": "创建或更新文件内容...",
"status_create_pr": "创建PR...",
"success_create_pr": "PR创建成功。\nPR 地址为: {{url}}",
"error_get_user_info": "获取用户信息失败:{{status}}",
"error_get_file": "该路径是一个目录,而不是文件",
"error_match_FastPr_Url": "执行URL匹配函数出错",
"github_token_not_found": "GitHub 的 token 没有找到。\n请记得在扩展程序的设置页面输入 GitHub token。",
"gitee_token_not_found": "Gitee 的 token 没有找到。\n请记得在扩展程序的设置页面输入 Gitee token。"
}
12 changes: 11 additions & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,23 @@
],
"web_accessible_resources": [
{
"resources": ["main.png", "osGraphLogo.png", "openDiggerLogo.png", "rocketDarkLogo.png", "rocketLightLogo.png"],
"resources": [
"main.png",
"osGraphLogo.png",
"openDiggerLogo.png",
"rocketDarkLogo.png",
"rocketLightLogo.png",
"sandbox.html"
],
"matches": ["<all_urls>"]
}
],
"permissions": ["storage", "notifications", "alarms", "cookies"],
"host_permissions": ["<all_urls>"],
"content_security_policy": {
"extension_pages": "script-src 'self'; object-src 'self';"
},
"sandbox": {
"pages": ["sandbox.html"]
}
}
6 changes: 6 additions & 0 deletions src/pages/ContentScripts/features/fast-pr/baseContent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export const PR_TITLE = (file: string) => `docs: Update ${file}`;
export const PR_CONTENT = (file: string) => `Update ${file} by [FastPR](https://github.com/hypertrons/hypertrons-crx).`;
export const generateBranchName = () => `fastPR-${new Date().toISOString().replace(/:/g, '-').replace(/\..+/, '')}`;
export const COMMIT_MESSAGE_DOC = (branch: string, userName: string, userEmail: string) =>
`docs: ${branch}\n\nSigned-off-by: ${userName.trim()} <${userEmail.trim()}>`.trim();
export const COMMIT_MESSAGE = (branch: string) => `docs: ${branch}`;
Loading