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

fix: fix fast-pr-url-rules.js #913

Merged
merged 8 commits into from
Nov 11, 2024
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// remote-code.js
export const urlRules = [
const urlRules = [
{
domains: ['open-digger.cn', 'open-digger'],
ruleFunction: (url) => {
Expand Down Expand Up @@ -159,4 +158,6 @@ function matchFastPrUrl(url) {
// Make the function globally available if needed
if (typeof window !== 'undefined' && typeof window.document !== 'undefined') {
window.matchFastPrUrl = matchFastPrUrl;
} else {
module.exports = { urlRules };
}
3 changes: 1 addition & 2 deletions scripts/test_configs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { urlRules } from '../public_configs/fast-pr-url-rules.js';

(async () => {
const { urlRules } = await import('../public_configs/fast-pr-url-rules.cjs');
let hasError = false;
for (const rule of urlRules) {
const tests = rule.tests;
Expand Down
2 changes: 1 addition & 1 deletion src/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +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';
export const OSS_URL = 'https://hypercrx-fastpr.oss-cn-beijing.aliyuncs.com/fast-pr-url-rules.cjs';
Loading