@pronto-tools-and-more/pronto 6.16.0 → 6.18.0
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 +8 -8
- package/src/parts/CommandMap/CommandMap.js +3 -1
- package/src/parts/CreateNewTag/CreateNewTag.js +13 -0
- package/src/parts/EnsureTagUpToDate/EnsureTagUpToDate.js +15 -0
- package/src/parts/GetBranch/GetBranch.js +17 -0
- package/src/parts/GetCommandFromCliArgs/GetCommandFromCliArgs.js +3 -0
- package/src/parts/GetGitTagVersion/GetGitTagVersion.js +24 -0
- package/src/parts/GetZipUploadMessage/GetZipUploadMessage.js +1 -1
- package/src/parts/PushTag/PushTag.js +13 -0
- package/src/parts/Release/Release.js +33 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pronto-tools-and-more/pronto",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.18.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "src/main.js",
|
|
6
6
|
"type": "module",
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
"@lvce-editor/ipc": "^11.0.1",
|
|
18
18
|
"@lvce-editor/json-rpc": "^4.1.0",
|
|
19
19
|
"@lvce-editor/verror": "^1.4.0",
|
|
20
|
-
"@pronto-tools-and-more/file-watcher": "6.
|
|
21
|
-
"@pronto-tools-and-more/files": "6.
|
|
22
|
-
"@pronto-tools-and-more/network-process": "6.
|
|
23
|
-
"@pronto-tools-and-more/sass-compiler": "6.
|
|
24
|
-
"@pronto-tools-and-more/components-renderer": "6.
|
|
25
|
-
"@pronto-tools-and-more/components": "6.
|
|
26
|
-
"@pronto-tools-and-more/schema-process": "6.
|
|
20
|
+
"@pronto-tools-and-more/file-watcher": "6.18.0",
|
|
21
|
+
"@pronto-tools-and-more/files": "6.18.0",
|
|
22
|
+
"@pronto-tools-and-more/network-process": "6.18.0",
|
|
23
|
+
"@pronto-tools-and-more/sass-compiler": "6.18.0",
|
|
24
|
+
"@pronto-tools-and-more/components-renderer": "6.18.0",
|
|
25
|
+
"@pronto-tools-and-more/components": "6.18.0",
|
|
26
|
+
"@pronto-tools-and-more/schema-process": "6.18.0",
|
|
27
27
|
"execa": "^9.4.0",
|
|
28
28
|
"express": "^4.21.0"
|
|
29
29
|
},
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import * as Build from "../Build/Build.js";
|
|
2
2
|
import * as Help from "../Help/Help.js";
|
|
3
3
|
import * as History from "../History/History.js";
|
|
4
|
+
import * as ListExperienceVersionsAndPrint from "../ListExperienceVersionsAndPrint/ListExperienceVersionsAndPrint.js";
|
|
4
5
|
import * as Login from "../Login/Login.js";
|
|
5
6
|
import * as PullCode from "../PullCode/PullCode.js";
|
|
6
7
|
import * as PushCode from "../PushCode/PushCode.js";
|
|
8
|
+
import * as Release from "../Release/Release.js";
|
|
7
9
|
import * as Server from "../Server/Server.js";
|
|
8
10
|
import * as Split from "../Split/Split.js";
|
|
9
11
|
import * as Upgrade from "../Upgrade/Upgrade.js";
|
|
10
12
|
import * as UploadZip from "../UploadZip/UploadZip.js";
|
|
11
13
|
import * as ValidateAllSchemas from "../ValidateAllSchemas/ValidateAllSchemas.js";
|
|
12
|
-
import * as ListExperienceVersionsAndPrint from "../ListExperienceVersionsAndPrint/ListExperienceVersionsAndPrint.js";
|
|
13
14
|
|
|
14
15
|
export const commandMap = {
|
|
15
16
|
"Build.build": Build.build,
|
|
@@ -20,6 +21,7 @@ export const commandMap = {
|
|
|
20
21
|
"PushCode.pushCode": PushCode.pushCode,
|
|
21
22
|
"Server.start": Server.start,
|
|
22
23
|
"Split.split": Split.split,
|
|
24
|
+
"Release.releaseMinor": Release.releaseMinor,
|
|
23
25
|
"Upgrade.upgrade": Upgrade.upgrade,
|
|
24
26
|
"ListExperienceVersionsAndPrint.listExperienceVersionsAndPrint":
|
|
25
27
|
ListExperienceVersionsAndPrint.listExperienceVersionsAndPrint,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { VError } from "@lvce-editor/verror";
|
|
2
|
+
import * as Exec from "../Exec/Exec.js";
|
|
3
|
+
|
|
4
|
+
export const createNewTag = async ({ cwd, newTag }) => {
|
|
5
|
+
try {
|
|
6
|
+
await Exec.exec("git", ["tag", "-a", newTag, "-m", newTag], {
|
|
7
|
+
cwd,
|
|
8
|
+
stdio: "inherit",
|
|
9
|
+
});
|
|
10
|
+
} catch (error) {
|
|
11
|
+
throw new VError(error, `Failed to create tag`);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { VError } from "@lvce-editor/verror";
|
|
2
|
+
import * as Exec from "../Exec/Exec.js";
|
|
3
|
+
|
|
4
|
+
export const ensureTagUpToDate = async ({ cwd }) => {
|
|
5
|
+
try {
|
|
6
|
+
await Exec.exec("git", ["fetch"], {
|
|
7
|
+
cwd,
|
|
8
|
+
});
|
|
9
|
+
await Exec.exec("git", ["pull"], {
|
|
10
|
+
cwd,
|
|
11
|
+
});
|
|
12
|
+
} catch (error) {
|
|
13
|
+
throw new VError(`Failed to ensure that repository is up to date`);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { VError } from "@lvce-editor/verror";
|
|
2
|
+
import * as Exec from "../Exec/Exec.js";
|
|
3
|
+
|
|
4
|
+
export const getBranch = async ({ cwd }) => {
|
|
5
|
+
try {
|
|
6
|
+
const { stdout } = await Exec.exec(
|
|
7
|
+
"git",
|
|
8
|
+
["rev-parse", "--abbrev-ref", "HEAD"],
|
|
9
|
+
{
|
|
10
|
+
cwd,
|
|
11
|
+
}
|
|
12
|
+
);
|
|
13
|
+
return stdout;
|
|
14
|
+
} catch (error) {
|
|
15
|
+
throw new VError(error, `Failed to get branch`);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { VError } from "@lvce-editor/verror";
|
|
2
|
+
import * as Exec from "../Exec/Exec.js";
|
|
3
|
+
|
|
4
|
+
export const getGitTagVersion = async ({ cwd }) => {
|
|
5
|
+
try {
|
|
6
|
+
const { stdout } = await Exec.exec(
|
|
7
|
+
"git",
|
|
8
|
+
["describe", "--abbrev=0", "--tags"],
|
|
9
|
+
{ cwd }
|
|
10
|
+
);
|
|
11
|
+
const parts = stdout.split(".");
|
|
12
|
+
const [part1, part2, part3] = parts;
|
|
13
|
+
const major = parseInt(part1.slice(1));
|
|
14
|
+
const minor = parseInt(part2);
|
|
15
|
+
const patch = parseInt(part3);
|
|
16
|
+
return {
|
|
17
|
+
major,
|
|
18
|
+
minor,
|
|
19
|
+
patch,
|
|
20
|
+
};
|
|
21
|
+
} catch (error) {
|
|
22
|
+
throw new VError(error, `Failed to get git tag`);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
@@ -5,7 +5,7 @@ export const getZipUploadMessage = async () => {
|
|
|
5
5
|
const commitMessage = await CommitMessage.getCommitMessage();
|
|
6
6
|
const commitUser = GetCommitUser.getCommitUser();
|
|
7
7
|
if (commitUser) {
|
|
8
|
-
return `CI ${commitUser} ${commitMessage}`;
|
|
8
|
+
return `CI by ${commitUser}: ${commitMessage}`;
|
|
9
9
|
}
|
|
10
10
|
const message = `CI ${commitMessage}`;
|
|
11
11
|
return message;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { VError } from "@lvce-editor/verror";
|
|
2
|
+
import * as Exec from "../Exec/Exec.js";
|
|
3
|
+
|
|
4
|
+
export const pushTag = async ({ cwd }) => {
|
|
5
|
+
try {
|
|
6
|
+
await Exec.exec("git", ["push", "--tags"], {
|
|
7
|
+
cwd,
|
|
8
|
+
stdio: "inherit",
|
|
9
|
+
});
|
|
10
|
+
} catch (error) {
|
|
11
|
+
throw new VError(error, `Failed to push tag`);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { VError } from "@lvce-editor/verror";
|
|
2
|
+
import * as CreateNewTag from "../CreateNewTag/CreateNewTag.js";
|
|
3
|
+
import * as Cwd from "../Cwd/Cwd.js";
|
|
4
|
+
import * as EnsureTagUpToDate from "../EnsureTagUpToDate/EnsureTagUpToDate.js";
|
|
5
|
+
import * as GetBranch from "../GetBranch/GetBranch.js";
|
|
6
|
+
import * as GetGitTagVersion from "../GetGitTagVersion/GetGitTagVersion.js";
|
|
7
|
+
import * as PushTag from "../PushTag/PushTag.js";
|
|
8
|
+
|
|
9
|
+
export const releaseMinor = async () => {
|
|
10
|
+
try {
|
|
11
|
+
const cwd = Cwd.cwd;
|
|
12
|
+
await EnsureTagUpToDate.ensureTagUpToDate({
|
|
13
|
+
cwd,
|
|
14
|
+
});
|
|
15
|
+
const branch = await GetBranch.getBranch({ cwd });
|
|
16
|
+
if (branch !== "main") {
|
|
17
|
+
throw new Error(`branch is not main`);
|
|
18
|
+
}
|
|
19
|
+
const { major, minor } = await GetGitTagVersion.getGitTagVersion({
|
|
20
|
+
cwd,
|
|
21
|
+
});
|
|
22
|
+
const newTag = `v${major}.${minor + 1}.0`;
|
|
23
|
+
await CreateNewTag.createNewTag({
|
|
24
|
+
cwd,
|
|
25
|
+
newTag,
|
|
26
|
+
});
|
|
27
|
+
await PushTag.pushTag({
|
|
28
|
+
cwd,
|
|
29
|
+
});
|
|
30
|
+
} catch (error) {
|
|
31
|
+
throw new VError(error, `Failed to create release`);
|
|
32
|
+
}
|
|
33
|
+
};
|