mirror of
https://github.com/AIsouler/GKD_subscription.git
synced 2025-12-18 07:45:10 +08:00
chore: sync
This commit is contained in:
1
.npmrc
1
.npmrc
@@ -1,3 +1,4 @@
|
|||||||
strict-peer-dependencies=false
|
strict-peer-dependencies=false
|
||||||
auto-install-peers=false
|
auto-install-peers=false
|
||||||
registry="https://registry.npmjs.org/"
|
registry="https://registry.npmjs.org/"
|
||||||
|
access=public
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ a subscription for gkd
|
|||||||
<details>
|
<details>
|
||||||
<summary> gkd </summary>
|
<summary> gkd </summary>
|
||||||
|
|
||||||
- [gdk](https://raw.gitmirror.com/lisonge/gkd-subscription/main/dist/gkd.json)
|
- [gdk](https://raw.githubusercontent.com/gkd-kit/subscription/main/dist/gkd.json)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
@@ -18,8 +18,8 @@ a subscription for gkd
|
|||||||
<details>
|
<details>
|
||||||
<summary> gkd </summary>
|
<summary> gkd </summary>
|
||||||
|
|
||||||
- [gkd](https://cdn.lisonge.com/gkd.json)
|
- [gkd](https://registry.npmmirror.com/@gkd-kit/subscription/latest/files)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|||||||
11
dist/gkd.json
vendored
11
dist/gkd.json
vendored
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "GKD官方订阅",
|
"name": "GKD官方订阅",
|
||||||
"version": 4,
|
"version": 5,
|
||||||
"author": "lisonge",
|
"author": "lisonge",
|
||||||
"supportUrl": "https://github.com/lisonge/gkd-subscription",
|
"supportUrl": "https://github.com/lisonge/gkd-subscription",
|
||||||
"apps": [
|
"apps": [
|
||||||
@@ -1073,6 +1073,15 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "li.songe.gkd",
|
||||||
|
"groups": [
|
||||||
|
{
|
||||||
|
"key": 0,
|
||||||
|
"name": "GKD-空规则组"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "tv.danmaku.bili",
|
"id": "tv.danmaku.bili",
|
||||||
"groups": [
|
"groups": [
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@gkd-kit/subscription",
|
"name": "@gkd-kit/subscription",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "0.0.0",
|
"version": "0.0.5",
|
||||||
"private": false,
|
"private": false,
|
||||||
"main": "./dist/gkd.json",
|
"main": "./dist/gkd.json",
|
||||||
"files": [
|
"files": [
|
||||||
|
|||||||
7
scripts/sync.ps1
Normal file
7
scripts/sync.ps1
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
pnpm build
|
||||||
|
git add '.'
|
||||||
|
git commit -m 'chore: sync'
|
||||||
|
git push
|
||||||
|
npm publish
|
||||||
|
sleep 1s
|
||||||
|
curl -I 'https://npmmirror.com/sync/@gkd-kit/subscription'
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
pnpm build
|
|
||||||
git add './dist/*.json'
|
|
||||||
git commit -m 'chore: sync json'
|
|
||||||
git push
|
|
||||||
11
src/apps/li.songe.gkd.ts
Normal file
11
src/apps/li.songe.gkd.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import type { AppConfig } from '../types';
|
||||||
|
|
||||||
|
export default <AppConfig>{
|
||||||
|
id: 'li.songe.gkd',
|
||||||
|
groups: [
|
||||||
|
{
|
||||||
|
key: 0,
|
||||||
|
name: `GKD-空规则组`,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
29
src/file.ts
29
src/file.ts
@@ -1,10 +1,10 @@
|
|||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import fs from 'node:fs/promises';
|
import fs from 'node:fs/promises';
|
||||||
import url from 'node:url';
|
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import { SubscriptionConfig } from './types';
|
import url from 'node:url';
|
||||||
import { refreshUrls, uploadFile } from './upload_qiniu';
|
import selfPkg from '../package.json';
|
||||||
|
import type { SubscriptionConfig } from './types';
|
||||||
|
|
||||||
export const relativePath = (p: string) => {
|
export const relativePath = (p: string) => {
|
||||||
return url.fileURLToPath(new URL(p, import.meta.url));
|
return url.fileURLToPath(new URL(p, import.meta.url));
|
||||||
@@ -19,6 +19,7 @@ export const writeConfig = async (fp: string, config: SubscriptionConfig) => {
|
|||||||
|
|
||||||
newConfig.version = oldConfig.version ?? 0;
|
newConfig.version = oldConfig.version ?? 0;
|
||||||
if (_.isEqual(newConfig, oldConfig)) {
|
if (_.isEqual(newConfig, oldConfig)) {
|
||||||
|
console.log([oldConfig.name, `nothing changed, skip`]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
newConfig.version++;
|
newConfig.version++;
|
||||||
@@ -67,17 +68,19 @@ export const writeConfig = async (fp: string, config: SubscriptionConfig) => {
|
|||||||
'utf-8',
|
'utf-8',
|
||||||
);
|
);
|
||||||
await fs.writeFile(filePath, buffer);
|
await fs.writeFile(filePath, buffer);
|
||||||
const { key, hash } = await uploadFile(filePath);
|
|
||||||
await refreshUrls(key);
|
const newPkg = { ...selfPkg, version: `0.0.` + newConfig.version };
|
||||||
console.log(
|
await fs.writeFile(
|
||||||
[
|
relativePath('../package.json'),
|
||||||
dayjs().format(`HH:mm:ss`),
|
JSON.stringify(newPkg, void 0, 2) + `\n`,
|
||||||
(buffer.length / 1024).toFixed(3) + `KB`,
|
|
||||||
newConfig.version,
|
|
||||||
key,
|
|
||||||
hash,
|
|
||||||
].join(` `),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
console.log({
|
||||||
|
mtime: dayjs().format(`HH:mm:ss`),
|
||||||
|
name: newConfig.name,
|
||||||
|
size: (buffer.length / 1024).toFixed(3) + `KB`,
|
||||||
|
version: newConfig.version,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export async function* walk(dirPath: string) {
|
export async function* walk(dirPath: string) {
|
||||||
|
|||||||
Reference in New Issue
Block a user