@speedkit/cli 3.31.0 → 3.31.1
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/CHANGELOG.md +7 -0
- package/README.md +1 -1
- package/dist/commands/generate-pop-config.js +2 -1
- package/dist/services/deploy/handler/install-resource-handler.js +3 -1
- package/dist/services/deploy/handler/module-handler.js +1 -1
- package/dist/services/deploy/handler/server-config-handler.js +1 -1
- package/dist/services/diff/diff-service.d.ts +4 -4
- package/dist/services/diff/diff-service.js +19 -19
- package/dist/services/onboarding/dashboard/diff-against-current-page.js +1 -1
- package/dist/services/onboarding/dashboard/request-diff-service.d.ts +0 -1
- package/dist/services/onboarding/dashboard/request-diff-service.js +0 -6
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [3.31.1](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v3.31.0...v3.31.1) (2026-03-09)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* order of parameters for diffs ([d70e4fe](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/d70e4fe5ddf67b1a08670fe61dd5edb1c0e87f66))
|
|
7
|
+
|
|
1
8
|
# [3.31.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v3.30.0...v3.31.0) (2026-03-03)
|
|
2
9
|
|
|
3
10
|
|
package/README.md
CHANGED
|
@@ -136,7 +136,8 @@ class GeneratePopConfig extends core_1.Command {
|
|
|
136
136
|
// new DiffService(cliService);
|
|
137
137
|
const popPrewarmingCode = await this.createPopPrewarmingCode(config);
|
|
138
138
|
const remoteConfig = await configService.getRemoteModule(moduleName);
|
|
139
|
-
const result = await diffService.diffContent(moduleName,
|
|
139
|
+
const result = await diffService.diffContent(moduleName, remoteConfig, // remoteContent
|
|
140
|
+
popPrewarmingCode);
|
|
140
141
|
const content = result.changedOrigins;
|
|
141
142
|
const isEqual = result.diff;
|
|
142
143
|
if (isEqual) {
|
|
@@ -94,7 +94,9 @@ class InstallResourceHandler {
|
|
|
94
94
|
await this.confirm(file, true);
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
97
|
-
const { changedOrigins, diff } = await this.diffService.diffContent(file.name,
|
|
97
|
+
const { changedOrigins, diff } = await this.diffService.diffContent(file.name, // fileName
|
|
98
|
+
installResource[file.remoteKey], // remote file content
|
|
99
|
+
file.getContent());
|
|
98
100
|
file.setContent(changedOrigins);
|
|
99
101
|
if (diff) {
|
|
100
102
|
this.cli.writeWarning(`skipped ${file.name} (identical with remote)`);
|
|
@@ -32,7 +32,7 @@ class ModuleHandler {
|
|
|
32
32
|
await this.confirm(file, true);
|
|
33
33
|
continue;
|
|
34
34
|
}
|
|
35
|
-
const { changedOrigins, diff } = await this.diffService.diffContent(file.name, file.getContent()
|
|
35
|
+
const { changedOrigins, diff } = await this.diffService.diffContent(file.name, remote, file.getContent());
|
|
36
36
|
file.setContent(changedOrigins);
|
|
37
37
|
if (diff) {
|
|
38
38
|
this.cli.writeWarning(`skipped ${file.name} (identical with remote)`);
|
|
@@ -27,7 +27,7 @@ class ServerConfigHandler {
|
|
|
27
27
|
const remoteConfig = JSON.parse(remote);
|
|
28
28
|
// @ts-expect-error revision is unknown
|
|
29
29
|
file.config.revision.version = remoteConfig.revision.version;
|
|
30
|
-
const { changedOrigins, diff } = await this.diffService.diffContent(file.name, file.getContent()
|
|
30
|
+
const { changedOrigins, diff } = await this.diffService.diffContent(file.name, remote, file.getContent());
|
|
31
31
|
file.setContent(changedOrigins);
|
|
32
32
|
if (diff) {
|
|
33
33
|
this.cli.writeWarning(`skipped ${file.name} (identical with remote)`);
|
|
@@ -6,7 +6,7 @@ export declare class DiffService {
|
|
|
6
6
|
private tempPath;
|
|
7
7
|
constructor(cli: CliService, diffExecutablePath?: string, diffExecutableTemplate?: string);
|
|
8
8
|
diff(localPath: string, fileName: string, temporaryContent: string): Promise<boolean>;
|
|
9
|
-
diffContent(fileName: string,
|
|
9
|
+
diffContent(fileName: string, firstContent: string, secondContent: string, diffSuffix?: string[]): Promise<{
|
|
10
10
|
changedOrigins: string;
|
|
11
11
|
diff: boolean;
|
|
12
12
|
}>;
|
|
@@ -26,9 +26,9 @@ export declare class DiffService {
|
|
|
26
26
|
*
|
|
27
27
|
* check if content of two files are equal
|
|
28
28
|
*
|
|
29
|
-
* @param
|
|
30
|
-
* @param
|
|
29
|
+
* @param firstPath
|
|
30
|
+
* @param secondPath
|
|
31
31
|
* @param skipDiffExecution
|
|
32
32
|
*/
|
|
33
|
-
executeDiff(
|
|
33
|
+
executeDiff(firstPath: string, secondPath: string, skipDiffExecution?: boolean): Promise<boolean>;
|
|
34
34
|
}
|
|
@@ -22,11 +22,11 @@ class DiffService {
|
|
|
22
22
|
const temporaryFilePath = await this.writeContentToTemporalFile(fileName, temporaryContent);
|
|
23
23
|
return await this.executeDiff(temporaryFilePath, localPath);
|
|
24
24
|
}
|
|
25
|
-
async diffContent(fileName,
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const diff = await this.executeDiff(
|
|
29
|
-
const changedFile = await (0, promises_1.readFile)(
|
|
25
|
+
async diffContent(fileName, firstContent, secondContent, diffSuffix = ["remote", "local"]) {
|
|
26
|
+
const temporaryFirstFilePath = await this.writeContentToTemporalFile(`${fileName}-${diffSuffix[0]}`, firstContent);
|
|
27
|
+
const temporarySecondFilePath = await this.writeContentToTemporalFile(`${fileName}-${diffSuffix[1]}`, secondContent);
|
|
28
|
+
const diff = await this.executeDiff(temporaryFirstFilePath, temporarySecondFilePath);
|
|
29
|
+
const changedFile = await (0, promises_1.readFile)(temporaryFirstFilePath, "utf-8");
|
|
30
30
|
return { changedOrigins: changedFile, diff };
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
@@ -66,15 +66,15 @@ class DiffService {
|
|
|
66
66
|
*
|
|
67
67
|
* check if content of two files are equal
|
|
68
68
|
*
|
|
69
|
-
* @param
|
|
70
|
-
* @param
|
|
69
|
+
* @param firstPath
|
|
70
|
+
* @param secondPath
|
|
71
71
|
* @param skipDiffExecution
|
|
72
72
|
*/
|
|
73
|
-
async executeDiff(
|
|
74
|
-
let
|
|
75
|
-
let
|
|
73
|
+
async executeDiff(firstPath, secondPath, skipDiffExecution = false) {
|
|
74
|
+
let firstContent;
|
|
75
|
+
let secondContent;
|
|
76
76
|
try {
|
|
77
|
-
|
|
77
|
+
firstContent = await promises_1.default.readFile(firstPath, {
|
|
78
78
|
encoding: "utf8",
|
|
79
79
|
flag: "r",
|
|
80
80
|
});
|
|
@@ -83,17 +83,17 @@ class DiffService {
|
|
|
83
83
|
return false;
|
|
84
84
|
}
|
|
85
85
|
try {
|
|
86
|
-
|
|
86
|
+
secondContent = await promises_1.default.readFile(secondPath, {
|
|
87
87
|
encoding: "utf8",
|
|
88
88
|
flag: "r",
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
catch (error) {
|
|
92
|
-
this.cli.writeError(`Error reading remote file ${
|
|
92
|
+
this.cli.writeError(`Error reading remote file ${secondContent}: ${error.message}`);
|
|
93
93
|
return false;
|
|
94
94
|
}
|
|
95
95
|
// Returning if no difference
|
|
96
|
-
if (this.isContentEqual(
|
|
96
|
+
if (this.isContentEqual(firstContent, secondContent)) {
|
|
97
97
|
return true;
|
|
98
98
|
}
|
|
99
99
|
if (skipDiffExecution) {
|
|
@@ -106,8 +106,8 @@ class DiffService {
|
|
|
106
106
|
try {
|
|
107
107
|
const command = this.diffExecutableTemplate
|
|
108
108
|
.replace("$exec", this.diffExecutablePath)
|
|
109
|
-
.replace("$file1",
|
|
110
|
-
.replace("$file2",
|
|
109
|
+
.replace("$file1", firstPath)
|
|
110
|
+
.replace("$file2", secondPath);
|
|
111
111
|
(0, node_child_process_1.execSync)(command, { stdio: "pipe" });
|
|
112
112
|
}
|
|
113
113
|
catch (error) {
|
|
@@ -117,7 +117,7 @@ class DiffService {
|
|
|
117
117
|
}
|
|
118
118
|
let ideaCommandAvailable;
|
|
119
119
|
try {
|
|
120
|
-
(0, node_child_process_1.execSync)(`idea diff "${
|
|
120
|
+
(0, node_child_process_1.execSync)(`idea diff "${firstPath}" "${secondPath}"`, {
|
|
121
121
|
stdio: ["pipe", "ignore", "pipe"], // prevent output of "/bin/sh: idea: command not found"
|
|
122
122
|
});
|
|
123
123
|
ideaCommandAvailable = true;
|
|
@@ -129,12 +129,12 @@ class DiffService {
|
|
|
129
129
|
if (!ideaCommandAvailable) {
|
|
130
130
|
const isWindows = process.platform.startsWith("win");
|
|
131
131
|
if (isWindows) {
|
|
132
|
-
(0, node_child_process_1.execSync)(`"%IDEA_INITIAL_DIRECTORY%\\idea" diff ${
|
|
132
|
+
(0, node_child_process_1.execSync)(`"%IDEA_INITIAL_DIRECTORY%\\idea" diff ${firstPath} ${secondPath}`, { stdio: "pipe" });
|
|
133
133
|
}
|
|
134
134
|
else {
|
|
135
135
|
const ideaInitialDirectory = (0, normalize_1.unescapeSpaces)(process.env.IDEA_INITIAL_DIRECTORY ||
|
|
136
136
|
os_1.DEFAULT_INTELLIJ_IDEA_PATH_MACOS);
|
|
137
|
-
(0, node_child_process_1.execSync)(`"${ideaInitialDirectory}/idea" diff ${
|
|
137
|
+
(0, node_child_process_1.execSync)(`"${ideaInitialDirectory}/idea" diff ${firstPath} ${secondPath}`, { stdio: "pipe" });
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
return false;
|
|
@@ -44,7 +44,7 @@ class DiffAgainstCurrentPage {
|
|
|
44
44
|
this.cli.endAction(cli_1.CliActionStatus.COMPLETED);
|
|
45
45
|
const remoteFilePath = await this.diffService.writeContentToTemporalFile(`remote-${variant}.html`, originHtml);
|
|
46
46
|
const localFilePath = await this.diffService.writeContentToTemporalFile("current.html", currentHtml);
|
|
47
|
-
return await this.diffService.executeDiff(
|
|
47
|
+
return await this.diffService.executeDiff(remoteFilePath, localFilePath);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
exports.DiffAgainstCurrentPage = DiffAgainstCurrentPage;
|
|
@@ -7,7 +7,6 @@ export declare class RequestDiffService {
|
|
|
7
7
|
constructor(diffService: DiffService, documentHandlerRuntime: DocumentHandlerServer);
|
|
8
8
|
postDiff(requestOrigin: string, url: string, parametersString: string, autoCheck?: boolean): Promise<BaqendResponse>;
|
|
9
9
|
private diffLocal;
|
|
10
|
-
private doOriginVsContentDiff;
|
|
11
10
|
private fetchHtml;
|
|
12
11
|
private createUrlsForDiff;
|
|
13
12
|
private createBaqendResponse;
|
|
@@ -63,12 +63,6 @@ class RequestDiffService {
|
|
|
63
63
|
const pureFilePath = await this.diffService.writeContentToTemporalFile("pure", transformedHtmlWithoutParameter);
|
|
64
64
|
return await this.diffService.executeDiff(parametersFilePath, pureFilePath);
|
|
65
65
|
}
|
|
66
|
-
async doOriginVsContentDiff(url, content) {
|
|
67
|
-
const html = await this.fetchHtml(url);
|
|
68
|
-
const origin = await this.diffService.writeContentToTemporalFile("origin", html);
|
|
69
|
-
const local = await this.diffService.writeContentToTemporalFile("content", content);
|
|
70
|
-
return await this.diffService.executeDiff(local, origin);
|
|
71
|
-
}
|
|
72
66
|
async fetchHtml(url) {
|
|
73
67
|
const agent = new node_https_1.Agent({
|
|
74
68
|
rejectUnauthorized: false,
|
package/oclif.manifest.json
CHANGED