@pronto-tools-and-more/pronto 6.2.1 → 6.4.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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pronto-tools-and-more/pronto",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.4.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "src/main.js",
|
|
6
6
|
"type": "module",
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
"@lvce-editor/ipc": "^10.2.1",
|
|
18
18
|
"@lvce-editor/json-rpc": "^3.0.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.4.0",
|
|
21
|
+
"@pronto-tools-and-more/files": "6.4.0",
|
|
22
|
+
"@pronto-tools-and-more/network-process": "6.4.0",
|
|
23
|
+
"@pronto-tools-and-more/sass-compiler": "6.4.0",
|
|
24
|
+
"@pronto-tools-and-more/components-renderer": "6.4.0",
|
|
25
|
+
"@pronto-tools-and-more/components": "6.4.0",
|
|
26
|
+
"@pronto-tools-and-more/schema-process": "6.4.0",
|
|
27
27
|
"execa": "^9.3.1",
|
|
28
|
-
"express": "^4.
|
|
28
|
+
"express": "^4.21.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/express": "^4.17.21",
|
|
@@ -102,3 +102,5 @@ export const companyUrl = config.companyUrl || "https://sprylab.com";
|
|
|
102
102
|
export const splitViews = config.splitViews || false;
|
|
103
103
|
|
|
104
104
|
export const reactComponents = config.reactComponents || false;
|
|
105
|
+
|
|
106
|
+
export const pushToReleaseOnGitTag = config.pushToReleaseOnGitTag || false;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { VError } from "@lvce-editor/verror";
|
|
2
|
+
|
|
3
|
+
export const getTag = async () => {
|
|
4
|
+
try {
|
|
5
|
+
if (process.env.CI_COMMIT_TAG) {
|
|
6
|
+
return process.env.CI_COMMIT_TAG.trim();
|
|
7
|
+
}
|
|
8
|
+
return "";
|
|
9
|
+
} catch (error) {
|
|
10
|
+
throw new VError(error, "Failed to get git tag");
|
|
11
|
+
}
|
|
12
|
+
};
|
|
@@ -1,68 +1,14 @@
|
|
|
1
|
-
import { VError } from "@lvce-editor/verror";
|
|
2
|
-
import { join } from "node:path";
|
|
3
1
|
import * as Config from "../Config/Config.js";
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
6
|
-
import * as GetSessionId from "../GetSessionId/GetSessionId.js";
|
|
7
|
-
import * as GetZipUploadMessage from "../GetZipUploadMessage/GetZipUploadMessage.js";
|
|
8
|
-
import * as NetworkProcess from "../NetworkProcess/NetworkProcess.js";
|
|
9
|
-
import * as UploadZip from "../UploadZip/UploadZip.js";
|
|
10
|
-
|
|
11
|
-
const getSrc = (mode) => {
|
|
12
|
-
if (mode === "slim") {
|
|
13
|
-
return join(Cwd.cwd, ".tmp", "dist", "src");
|
|
14
|
-
}
|
|
15
|
-
return join(Cwd.cwd, "src");
|
|
16
|
-
};
|
|
2
|
+
import * as PushCodeTo from "../PushCodeTo/PushCodeTo.js";
|
|
3
|
+
import * as GetTag from "../GetTag/GetTag.js";
|
|
17
4
|
|
|
18
5
|
export const pushCode = async () => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
preview,
|
|
27
|
-
uploadTimeout,
|
|
28
|
-
mode,
|
|
29
|
-
} = Config;
|
|
30
|
-
if (!userEmail) {
|
|
31
|
-
throw new Error(`missing user email`);
|
|
32
|
-
}
|
|
33
|
-
if (!userPassword) {
|
|
34
|
-
throw new Error("missing user password");
|
|
35
|
-
}
|
|
36
|
-
const outFile = join(Cwd.cwd, ".tmp", "upload.zip");
|
|
37
|
-
const src = getSrc(mode);
|
|
38
|
-
const sessionId = await GetSessionId.getSessionId({
|
|
39
|
-
loginUrl,
|
|
40
|
-
userEmail,
|
|
41
|
-
userPassword,
|
|
42
|
-
});
|
|
43
|
-
const message = await GetZipUploadMessage.getZipUploadMessage();
|
|
44
|
-
|
|
45
|
-
await CreateZip.createZip({
|
|
46
|
-
inDir: src,
|
|
47
|
-
outFile,
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
const response = await UploadZip.uploadZip({
|
|
51
|
-
file: outFile,
|
|
52
|
-
uploadBaseUrl,
|
|
53
|
-
preview,
|
|
54
|
-
appId,
|
|
55
|
-
sessionId,
|
|
56
|
-
uploadTimeout,
|
|
57
|
-
message,
|
|
58
|
-
maxRetries: 10,
|
|
59
|
-
waitBetweenRetries: 60_000,
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
console.log({ response });
|
|
63
|
-
} catch (error) {
|
|
64
|
-
throw new VError(error, `Failed to push code`);
|
|
65
|
-
} finally {
|
|
66
|
-
NetworkProcess.dispose();
|
|
6
|
+
const { preview } = Config;
|
|
7
|
+
await PushCodeTo.pushCodeTo({ preview });
|
|
8
|
+
const tag = await GetTag.getTag();
|
|
9
|
+
console.log("tag is", tag);
|
|
10
|
+
console.log("config is", Config.pushToReleaseOnGitTag);
|
|
11
|
+
if (tag && Config.pushToReleaseOnGitTag) {
|
|
12
|
+
await PushCodeTo.pushCodeTo({ preview: false });
|
|
67
13
|
}
|
|
68
14
|
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { VError } from "@lvce-editor/verror";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import * as Config from "../Config/Config.js";
|
|
4
|
+
import * as CreateZip from "../CreateZip/CreateZip.js";
|
|
5
|
+
import * as Cwd from "../Cwd/Cwd.js";
|
|
6
|
+
import * as GetSessionId from "../GetSessionId/GetSessionId.js";
|
|
7
|
+
import * as GetZipUploadMessage from "../GetZipUploadMessage/GetZipUploadMessage.js";
|
|
8
|
+
import * as NetworkProcess from "../NetworkProcess/NetworkProcess.js";
|
|
9
|
+
import * as UploadZip from "../UploadZip/UploadZip.js";
|
|
10
|
+
|
|
11
|
+
const getSrc = (mode) => {
|
|
12
|
+
if (mode === "slim") {
|
|
13
|
+
return join(Cwd.cwd, ".tmp", "dist", "src");
|
|
14
|
+
}
|
|
15
|
+
return join(Cwd.cwd, "src");
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const pushCodeTo = async ({ preview }) => {
|
|
19
|
+
try {
|
|
20
|
+
const {
|
|
21
|
+
userEmail,
|
|
22
|
+
userPassword,
|
|
23
|
+
loginUrl,
|
|
24
|
+
appId,
|
|
25
|
+
uploadBaseUrl,
|
|
26
|
+
uploadTimeout,
|
|
27
|
+
mode,
|
|
28
|
+
} = Config;
|
|
29
|
+
if (!userEmail) {
|
|
30
|
+
throw new Error(`missing user email`);
|
|
31
|
+
}
|
|
32
|
+
if (!userPassword) {
|
|
33
|
+
throw new Error("missing user password");
|
|
34
|
+
}
|
|
35
|
+
const outFile = join(Cwd.cwd, ".tmp", "upload.zip");
|
|
36
|
+
const src = getSrc(mode);
|
|
37
|
+
const sessionId = await GetSessionId.getSessionId({
|
|
38
|
+
loginUrl,
|
|
39
|
+
userEmail,
|
|
40
|
+
userPassword,
|
|
41
|
+
});
|
|
42
|
+
const message = await GetZipUploadMessage.getZipUploadMessage();
|
|
43
|
+
|
|
44
|
+
await CreateZip.createZip({
|
|
45
|
+
inDir: src,
|
|
46
|
+
outFile,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const response = await UploadZip.uploadZip({
|
|
50
|
+
file: outFile,
|
|
51
|
+
uploadBaseUrl,
|
|
52
|
+
preview,
|
|
53
|
+
appId,
|
|
54
|
+
sessionId,
|
|
55
|
+
uploadTimeout,
|
|
56
|
+
message,
|
|
57
|
+
maxRetries: 10,
|
|
58
|
+
waitBetweenRetries: 60_000,
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
console.log({ response });
|
|
62
|
+
} catch (error) {
|
|
63
|
+
throw new VError(error, `Failed to push code`);
|
|
64
|
+
} finally {
|
|
65
|
+
NetworkProcess.dispose();
|
|
66
|
+
}
|
|
67
|
+
};
|