iv-npm 1.2.58 → 1.2.62

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.58",
3
+ "version": "1.2.62",
4
4
  "description": "公共通用包",
5
5
  "author": "Mr.Cong",
6
6
  "license": "ISC",
@@ -8,7 +8,11 @@
8
8
  "packageManager": "pnpm@7.9.0",
9
9
  "scripts": {
10
10
  "build": "turbo run build",
11
- "build:pkg": "pnpm run prepare -r"
11
+ "build:pkg": "pnpm run prepare -r",
12
+ "push": "npm run changeVersion & turbo run build & npm publish",
13
+ "changeVersion": "node ./scripts/changeVersion.js",
14
+ "changeVersion1": "node ./scripts/changeVersion.js level1",
15
+ "changeVersion2": "node ./scripts/changeVersion.js level2"
12
16
  },
13
17
  "repository": {
14
18
  "type": "git",
@@ -41,6 +45,7 @@
41
45
  }
42
46
  },
43
47
  "devDependencies": {
48
+ "shelljs": "^0.8.5",
44
49
  "turbo": "^1.4.2"
45
50
  }
46
51
  }
@@ -0,0 +1,31 @@
1
+ /*
2
+ * @Author: Mr.Cong Wei
3
+ * @Date: 2022-08-26 15:21:36
4
+ * @LastEditTime: 2022-08-26 16:12:15
5
+ */
6
+
7
+ const shell = require("shelljs");
8
+ const version = require("../package.json").version;
9
+ writeVersion(version);
10
+
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
17
+ );
18
+ return;
19
+ }
20
+
21
+ function formatVersion(v) {
22
+ const LEVEL_LIST = {
23
+ level3: 2,
24
+ level2: 1,
25
+ level1: 0,
26
+ };
27
+ const level = process.argv[2] ? LEVEL_LIST[process.argv[2]] : 2;
28
+ const versionList = v.split(".");
29
+ versionList[level] = Number(versionList[level]) + 1;
30
+ return versionList.join(".");
31
+ }