chore: test

This commit is contained in:
lisonge
2023-08-11 20:19:30 +08:00
parent e63d36f7f5
commit b92e8a7434
6 changed files with 293 additions and 241 deletions

View File

@@ -2,7 +2,7 @@
/**
* @type {import('prettier').Config}
*/
module.exports = {
export default {
tabWidth: 2,
singleQuote: true,
trailingComma: 'all',

7
dist/test.json vendored Normal file
View File

@@ -0,0 +1,7 @@
{
"name": "GKD-我测你们码",
"version": 0,
"author": "lisonge",
"supportUrl": "https://github.com/gkd-kit/subscription",
"apps": []
}

View File

@@ -6,24 +6,25 @@
"unpkg": "./dist/gkd.json",
"jsdelivr": "./dist/gkd.json",
"files": [
"dist"
"./dist"
],
"scripts": {
"build": "tsx ./src/main.ts"
},
"dependencies": {
"@gkd-kit/selector": "0.0.4",
"@types/lodash": "^4.14.194",
"@types/node": "^20",
"devDependencies": {
"@gkd-kit/selector": "0.0.10",
"@types/lodash": "^4.14.195",
"@types/node": "^20.4.2",
"@types/prettier": "2.7.3",
"dayjs": "^1.11.7",
"dotenv": "^16.2.0",
"ajv": "8.12.0",
"dayjs": "^1.11.9",
"dotenv": "^16.3.1",
"lodash": "^4.17.21",
"prettier": "^2.8.8",
"qiniu": "^7.8.0",
"tsx": "^3.12.6",
"typescript": "^5.0.4",
"undici": "^5.22.1"
"prettier": "^3.0.1",
"qiniu": "^7.9.0",
"tsx": "^3.12.7",
"typescript": "^5.1.6",
"undici": "^5.23.0"
},
"author": "lisonge",
"license": "MIT",
@@ -36,6 +37,6 @@
"url": "git+https://github.com/gkd-kit/subscription.git"
},
"volta": {
"node": "20.3.0"
"node": "20.5.0"
}
}

443
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,5 @@
import SelectorKit from '@gkd-kit/selector';
const { CommonSelector } = SelectorKit.li.songe.selector;
export const parseSelector = (source: string) => {
return CommonSelector.Companion.parse(source);
return SelectorKit.CommonSelector.Companion.parse(source);
};

View File

@@ -1,33 +1,25 @@
export type IArray<T> = T | T[];
export type SubscriptionConfig = {
name?: string;
version?: number;
author?: string;
/**
* https url
* android file path
*/
updateUrl?: string;
/**
* https url
* android schema url, qq group
*/
supportUrl?: string;
apps?: AppConfig[];
type NumberFilter = {
minimum?: number;
maximum?: number;
enum?: number[];
};
type StringFilter = {
pattern?: string;
maxLength?: number;
minLength?: number;
enum?: string[];
};
type NumberFilter = {};
type StringFilter = {};
type CommonProps = {
activityIds?: IArray<string>;
excludeActivityIds?: IArray<string>;
cd?: number;
// https://github.com/ajv-validator/ajv
appFilter?: {
versionName: StringFilter;
versionCode: NumberFilter;
name?: StringFilter;
versionName?: StringFilter;
versionCode?: NumberFilter;
};
deviceFilter?: {
device?: StringFilter;
@@ -63,6 +55,23 @@ type RuleConfig = {
preKeys?: IArray<number>;
} & CommonProps;
export type SubscriptionConfig = {
name?: string;
version?: number;
author?: string;
/**
* https url
* android file path
*/
updateUrl?: string;
/**
* https url
* android schema url, qq group
*/
supportUrl?: string;
apps?: AppConfig[];
};
export const defineSubsConfig = (config: SubscriptionConfig) => {
return JSON.stringify(config, undefined, 2);
};