mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-28 17:41:54 +08:00
Chore: improve trace output
This commit is contained in:
@@ -4,6 +4,8 @@ import { noop } from 'foxts/noop';
|
||||
import { notSupported } from '../misc';
|
||||
|
||||
export class AdGuardHome extends BaseWriteStrategy {
|
||||
public readonly name = 'adguardhome';
|
||||
|
||||
// readonly type = 'domainset';
|
||||
readonly fileExtension = 'txt';
|
||||
readonly type = '';
|
||||
|
||||
@@ -6,6 +6,8 @@ import { compareAndWriteFile } from '../create-file';
|
||||
* date is written to a file.
|
||||
*/
|
||||
export abstract class BaseWriteStrategy {
|
||||
public abstract readonly name: string;
|
||||
|
||||
/**
|
||||
* Sometimes a ruleset will create extra files (e.g. reject-url-regex w/ mitm.sgmodule),
|
||||
* and doesn't share the same filename and id. This property is used to overwrite the filename.
|
||||
|
||||
@@ -6,6 +6,8 @@ import { OUTPUT_CLASH_DIR } from '../../constants/dir';
|
||||
import { appendArrayInPlace } from '../append-array-in-place';
|
||||
|
||||
export class ClashDomainSet extends BaseWriteStrategy {
|
||||
public readonly name = 'clash domainset';
|
||||
|
||||
// readonly type = 'domainset';
|
||||
readonly fileExtension = 'txt';
|
||||
readonly type = 'domainset';
|
||||
@@ -43,6 +45,8 @@ export class ClashDomainSet extends BaseWriteStrategy {
|
||||
}
|
||||
|
||||
export class ClashIPSet extends BaseWriteStrategy {
|
||||
public readonly name = 'clash ipcidr';
|
||||
|
||||
// readonly type = 'domainset';
|
||||
readonly fileExtension = 'txt';
|
||||
readonly type = 'ip';
|
||||
@@ -80,6 +84,8 @@ export class ClashIPSet extends BaseWriteStrategy {
|
||||
}
|
||||
|
||||
export class ClashClassicRuleSet extends BaseWriteStrategy {
|
||||
public readonly name = 'clash classic ruleset';
|
||||
|
||||
readonly fileExtension = 'txt';
|
||||
|
||||
protected result: string[] = ['DOMAIN,this_ruleset_is_made_by_sukkaw.ruleset.skk.moe'];
|
||||
|
||||
@@ -26,6 +26,8 @@ export interface SingboxSourceFormat {
|
||||
}
|
||||
|
||||
export class SingboxSource extends BaseWriteStrategy {
|
||||
public readonly name = 'singbox';
|
||||
|
||||
readonly fileExtension = 'json';
|
||||
|
||||
static readonly jsonToLines = (json: unknown): string[] => stringify(json).split('\n');
|
||||
|
||||
@@ -9,6 +9,8 @@ import { OUTPUT_MODULES_DIR, OUTPUT_SURGE_DIR } from '../../constants/dir';
|
||||
import { withBannerArray, withIdentityContent } from '../misc';
|
||||
|
||||
export class SurgeDomainSet extends BaseWriteStrategy {
|
||||
public readonly name = 'surge domainset';
|
||||
|
||||
// readonly type = 'domainset';
|
||||
readonly fileExtension = 'conf';
|
||||
type = 'domainset';
|
||||
@@ -46,6 +48,8 @@ export class SurgeDomainSet extends BaseWriteStrategy {
|
||||
}
|
||||
|
||||
export class SurgeRuleSet extends BaseWriteStrategy {
|
||||
public readonly name = 'surge ruleset';
|
||||
|
||||
readonly fileExtension = 'conf';
|
||||
|
||||
protected result: string[] = ['DOMAIN,this_ruleset_is_made_by_sukkaw.ruleset.skk.moe'];
|
||||
@@ -132,6 +136,8 @@ export class SurgeRuleSet extends BaseWriteStrategy {
|
||||
}
|
||||
|
||||
export class SurgeMitmSgmodule extends BaseWriteStrategy {
|
||||
public readonly name = 'surge sgmodule';
|
||||
|
||||
// readonly type = 'domainset';
|
||||
readonly fileExtension = 'sgmodule';
|
||||
readonly type = '';
|
||||
|
||||
Reference in New Issue
Block a user