iv-npm 1.2.59 → 1.2.61

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": "iv-npm",
3
- "version": "1.2.59",
3
+ "version": "1.2.61",
4
4
  "description": "公共通用包",
5
5
  "author": "Mr.Cong",
6
6
  "license": "ISC",
@@ -9,9 +9,10 @@
9
9
  "scripts": {
10
10
  "build": "turbo run build",
11
11
  "build:pkg": "pnpm run prepare -r",
12
- "push": "node ../scripts/changeVersion.js & turbo run build & npm publish",
13
- "push2": " node ../scripts/changeVersion.js 2 & turbo run build & npm publish",
14
- "push1": "node ../scripts/changeVersion.js 1 & turbo run build & npm publish"
12
+ "push": "npm run changeVersion & turbo run build & npm publish",
13
+ "changeVersion": "node ./scripts/changeVersion.js",
14
+ "changeVersion1": "node ./scripts/changeVersion.js 1",
15
+ "changeVersion2": "node ./scripts/changeVersion.js 2"
15
16
  },
16
17
  "repository": {
17
18
  "type": "git",
@@ -44,6 +45,7 @@
44
45
  }
45
46
  },
46
47
  "devDependencies": {
48
+ "shelljs": "^0.8.5",
47
49
  "turbo": "^1.4.2"
48
50
  }
49
51
  }
@@ -1,28 +1,21 @@
1
1
  /*
2
2
  * @Author: Mr.Cong Wei
3
3
  * @Date: 2022-08-26 15:21:36
4
- * @LastEditTime: 2022-08-26 15:46:46
4
+ * @LastEditTime: 2022-08-26 16:03:42
5
5
  */
6
- const fs = require("fs");
7
6
 
8
- const package = require("../package.json");
9
- const version = package.version;
7
+ const shell = require("shelljs");
8
+ const version = require("../package.json").version;
9
+ writeVersion(version);
10
10
 
11
- writeVersion(package, version);
12
-
13
- function writeVersion(cbDataPackage, wholeVersion) {
14
- cbDataPackage.version = formatVersion(wholeVersion);
15
- fs.writeFile(
16
- "../package.json",
17
- JSON.stringify(cbDataPackage),
18
- function (err) {
19
- if (err) console.error(err);
20
- console.log(
21
- "----------------------修改package.json文件完毕,version修改为:",
22
- cbDataPackage.version
23
- );
24
- }
11
+ function writeVersion(wholeVersion) {
12
+ wholeVersion = formatVersion(wholeVersion);
13
+ shell.exec(`npm --no-git-tag-version version ${wholeVersion}`);
14
+ console.log(
15
+ "----------------------修改package.json文件完毕,version修改为:",
16
+ wholeVersion
25
17
  );
18
+ return;
26
19
  }
27
20
 
28
21
  function formatVersion(v) {