@xybplugins/xyb-agent 0.0.25 → 0.0.27

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xybplugins/xyb-agent",
3
- "version": "0.0.25",
3
+ "version": "0.0.27",
4
4
  "description": "湘易办功能集成JSSDK",
5
5
  "scripts": {
6
6
  "build": "rm -rf dist && NODE_ENV=production rollup -c",
package/publish.sh DELETED
@@ -1,33 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -e
4
-
5
- echo "🏝️ 更新xybAgent版本到npm包管理器"
6
-
7
- if ! git diff --quiet || ! git diff --cached --quiet; then
8
- echo "👻 请先提交或 stash 所有更改。"
9
- exit 1
10
- fi
11
-
12
- echo "👹 执行 npm version patch..."
13
- npm version patch
14
-
15
- echo "👹 执行代码编译.."
16
-
17
- npm run build:test
18
-
19
- NEW_VERSION=$(node -p "require('./package.json').version")
20
-
21
- echo "🏝️ 当前xybAgent的版本号: $NEW_VERSION"
22
-
23
- read -p "🤔 当前版本号 $NEW_VERSION ,确定要发布吗到npm?(y/N): " -n 1 -r
24
-
25
- echo
26
- if [[ ! $REPLY =~ ^[Yy]$ ]]; then
27
- echo "👻 取消发布。"
28
- exit 1
29
- fi
30
-
31
- npm publish
32
-
33
- echo "🏝️ xybAgent-$NEW_VERSION 已发布成功!"
@@ -1,31 +0,0 @@
1
- import fs from 'fs/promises';
2
- import path from 'path';
3
- import { fileURLToPath } from 'url';
4
- const __filename = fileURLToPath(import.meta.url);
5
- const __dirname = path.dirname(__filename);
6
- const VERSION_FILE_PATH = path.resolve(__dirname, './../config/index.js');
7
-
8
- async function updateVersionInFile() {
9
- try {
10
- console.log(`👹 同步xybAgent的版本号`)
11
- const pkg = JSON.parse(await fs.readFile(path.resolve(__dirname, './../package.json'), 'utf8'));
12
- const newV = pkg.version;
13
- if (!newV) {
14
- throw new Error('👻 读取版本号失败');
15
- }
16
- let content = await fs.readFile(VERSION_FILE_PATH, 'utf8');
17
- const versionRegex = /const\s+VERSION\s*=\s*["'](?:[^"']*)["']\s*;/;
18
- const newVLine = `const VERSION = "${newV}";`;
19
- if (!versionRegex.test(content)) {
20
- throw new Error(`👻 在 config/index 中寻找版本号字段失败`);
21
- }
22
- content = content.replace(versionRegex, newVLine);
23
- await fs.writeFile(VERSION_FILE_PATH, content, 'utf8');
24
- console.log(`🏝️ 已更新版本号为:${newV}`);
25
- } catch (err) {
26
- console.error('👻 更新版本号失败:', err.message);
27
- process.exit(1);
28
- }
29
- }
30
-
31
- await updateVersionInFile();