rigjs 3.0.26 → 3.0.31
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/.github/workflows/npm-publish.yml +22 -0
- package/built/index.js +62 -62
- package/lib/tag/index.ts +30 -4
- package/package.json +5 -2
package/lib/tag/index.ts
CHANGED
|
@@ -12,7 +12,15 @@ import json5 from 'json5';
|
|
|
12
12
|
|
|
13
13
|
let red = chalk.red;
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
const exec = (cmd:string)=>{
|
|
16
|
+
shell.exec(`cmd`,(code, stdout, stderr)=>{
|
|
17
|
+
if (stderr){
|
|
18
|
+
print.error(stderr);
|
|
19
|
+
}else{
|
|
20
|
+
print.succeed(`success: ${cmd}`);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
16
24
|
const load = async () => {
|
|
17
25
|
try {
|
|
18
26
|
let pkgJson = JSON.parse(fs.readFileSync('package.json').toString());
|
|
@@ -45,15 +53,33 @@ const load = async () => {
|
|
|
45
53
|
process.exit(1)
|
|
46
54
|
}
|
|
47
55
|
});
|
|
48
|
-
|
|
56
|
+
exec(`git tag ${tagStr}`);
|
|
49
57
|
print.succeed(`tag:${tagStr} created.`);
|
|
50
58
|
}catch(e:any){
|
|
51
59
|
print.error(`create tag failed:${e.message}`);
|
|
52
60
|
process.exit(1)
|
|
53
61
|
}
|
|
62
|
+
}else if (pkgJson&&pkgJson.rig_tag_template){
|
|
63
|
+
let tagStr = `${pkgJson.rig_tag_template}`;
|
|
64
|
+
|
|
65
|
+
try{
|
|
66
|
+
const fields = pkgJson.rig_tag_template.match(/(?<={)[^{}]+(?=})/g)
|
|
67
|
+
fields.forEach((field: string) => {
|
|
68
|
+
const value = pkgJson[field];
|
|
69
|
+
if (value) {
|
|
70
|
+
tagStr = tagStr.replace(`{${field}}`, value)
|
|
71
|
+
} else {
|
|
72
|
+
print.error(`field:${field} not found in package.json`);
|
|
73
|
+
process.exit(1)
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
exec(`git tag ${tagStr}`)
|
|
77
|
+
}catch(e:any){
|
|
78
|
+
print.error(`create tag failed:${e.message}`);
|
|
79
|
+
process.exit(1)
|
|
80
|
+
}
|
|
54
81
|
}else{
|
|
55
|
-
|
|
56
|
-
print.succeed(`tag:${version} created.`);
|
|
82
|
+
exec(`git tag ${version}`)
|
|
57
83
|
}
|
|
58
84
|
} else {
|
|
59
85
|
print.error('please commit your changes before tag');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rigjs",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.31",
|
|
4
4
|
"description": "A multi-repos dev tool based on yarn and git.Rigjs is intended to be the simplest way to develop,share and deliver codes between different developers or different projects.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"modular",
|
|
@@ -13,7 +13,10 @@
|
|
|
13
13
|
"workspaces"
|
|
14
14
|
],
|
|
15
15
|
"main": "index.js",
|
|
16
|
-
"repository":
|
|
16
|
+
"repository":{
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/FlashHand/rig"
|
|
19
|
+
},
|
|
17
20
|
"author": "ralwayne",
|
|
18
21
|
"license": "MIT",
|
|
19
22
|
"bin": {
|