yz-yuki-plugin 2.0.2-2 → 2.0.3-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # 2.0.3
2
+ * 优化提示信息
3
+
1
4
  # 2.0.2
2
5
  * fix DYNAMIC_TYPE_ARTICLE
3
6
  * 优化Next npm包插件 Task加载
@@ -62,7 +62,7 @@ message.use(async (e) => {
62
62
  }
63
63
  const { has_more, items } = data || {};
64
64
  if ((code === 0) && (has_more === false)) {
65
- e.reply(`订阅校验失败~\nup主uid:${uid} 无效,请核对uid后再试~`);
65
+ e.reply(`校验该up的主页空间动态内容为空\nup主uid:${uid} 可能是无效的,\n请核对uid或让该up发布一条动态后再试~`);
66
66
  return;
67
67
  }
68
68
  let name;
@@ -3,7 +3,7 @@ import chokidar from "chokidar";
3
3
  * Config 类用于管理配置文件的读取和监听
4
4
  */
5
5
  declare class Config {
6
- readonly versionPath: string;
6
+ readonly packageJsonPath: string;
7
7
  readonly defaultConfigPath: string;
8
8
  readonly userConfigPath: string;
9
9
  defaultConfig: Record<string, any>;
@@ -64,7 +64,7 @@ declare class Config {
64
64
  * @param value 配置项的值
65
65
  */
66
66
  updateConfigItem(appDir: string, functionName: string, key: string, value: any): void;
67
- /** 读取CHANGELOG.md文件,获取最新版本号*/
67
+ /** 读取package.json文件,获取最新版本号*/
68
68
  getLatestVersion(): string | null;
69
69
  }
70
70
  declare const _default: Config;
@@ -9,14 +9,14 @@ import { _paths } from './paths.js';
9
9
  * Config 类用于管理配置文件的读取和监听
10
10
  */
11
11
  class Config {
12
- versionPath;
12
+ packageJsonPath;
13
13
  defaultConfigPath;
14
14
  userConfigPath;
15
15
  defaultConfig;
16
16
  userConfig;
17
17
  watcher;
18
18
  constructor() {
19
- this.versionPath = path.join(_paths.pluginPath, 'CHANGELOG.md');
19
+ this.packageJsonPath = path.join(_paths.pluginPath, 'package.json');
20
20
  /** 默认设置 */
21
21
  this.defaultConfigPath = path.join(_paths.pluginPath, 'defaultConfig');
22
22
  this.defaultConfig = {};
@@ -160,13 +160,13 @@ class Config {
160
160
  config[key] = value; // 更新配置项
161
161
  this.saveConfig("config", appDir, functionName, config); // 保存更新后的配置
162
162
  }
163
- /** 读取CHANGELOG.md文件,获取最新版本号*/
163
+ /** 读取package.json文件,获取最新版本号*/
164
164
  getLatestVersion() {
165
- const content = fs.readFileSync(this.versionPath, 'utf-8');
166
- const versionPattern = /#\s(\d+\.\d+\.\d+)/g;
167
- const match = versionPattern.exec(content);
165
+ const content = fs.readFileSync(this.packageJsonPath, 'utf-8');
166
+ const packageJson = JSON.parse(content);
167
+ const match = packageJson.version;
168
168
  if (match) {
169
- return match[1];
169
+ return match;
170
170
  }
171
171
  else {
172
172
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yz-yuki-plugin",
3
- "version": "2.0.2-2",
3
+ "version": "2.0.3-1",
4
4
  "description": "优纪插件,yunzaijs 关于 微博推送、B站推送 等功能的拓展插件",
5
5
  "author": "snowtafir",
6
6
  "type": "module",