@speedkit/cli 3.31.1 → 3.31.2
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 +1 -1
- package/dist/services/deploy/handler/customer-config-handler.js +2 -2
- package/dist/services/deploy/handler/install-resource-handler.js +2 -2
- package/dist/services/deploy/handler/module-handler.js +2 -2
- package/dist/services/deploy/handler/server-config-handler.js +2 -2
- package/dist/services/diff/diff-service.d.ts +1 -1
- package/dist/services/diff/diff-service.js +4 -2
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [3.31.2](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v3.31.1...v3.31.2) (2026-03-10)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **diff:** return updatedFile instead of originalFile after diff ([4894d1b](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/4894d1bc93387665add4d85af35b93650a911103))
|
|
7
|
+
|
|
1
8
|
## [3.31.1](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v3.31.0...v3.31.1) (2026-03-09)
|
|
2
9
|
|
|
3
10
|
|
package/README.md
CHANGED
|
@@ -138,7 +138,7 @@ class GeneratePopConfig extends core_1.Command {
|
|
|
138
138
|
const remoteConfig = await configService.getRemoteModule(moduleName);
|
|
139
139
|
const result = await diffService.diffContent(moduleName, remoteConfig, // remoteContent
|
|
140
140
|
popPrewarmingCode);
|
|
141
|
-
const content = result.
|
|
141
|
+
const content = result.updatedFile;
|
|
142
142
|
const isEqual = result.diff;
|
|
143
143
|
if (isEqual) {
|
|
144
144
|
cliService.write(`created config is the same as the deployed one`);
|
|
@@ -43,8 +43,8 @@ class CustomerConfigHandler {
|
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
45
|
// todo: add changedThrowable, let the handler catch and decide what to do with it
|
|
46
|
-
const {
|
|
47
|
-
const origins = JSON.parse(
|
|
46
|
+
const { updatedFile } = await this.diffService.diffContent(file.name, JSON.stringify(config.origins, null, 4), JSON.stringify(installResource.origins, null, 4));
|
|
47
|
+
const origins = JSON.parse(updatedFile);
|
|
48
48
|
file.updateOrigins(origins);
|
|
49
49
|
if (!(await this.cli.confirm("Update origins?", true))) {
|
|
50
50
|
file.skipFile();
|
|
@@ -94,10 +94,10 @@ class InstallResourceHandler {
|
|
|
94
94
|
await this.confirm(file, true);
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
97
|
-
const {
|
|
97
|
+
const { updatedFile, diff } = await this.diffService.diffContent(file.name, // fileName
|
|
98
98
|
installResource[file.remoteKey], // remote file content
|
|
99
99
|
file.getContent());
|
|
100
|
-
file.setContent(
|
|
100
|
+
file.setContent(updatedFile);
|
|
101
101
|
if (diff) {
|
|
102
102
|
this.cli.writeWarning(`skipped ${file.name} (identical with remote)`);
|
|
103
103
|
file.skipFile();
|
|
@@ -32,8 +32,8 @@ class ModuleHandler {
|
|
|
32
32
|
await this.confirm(file, true);
|
|
33
33
|
continue;
|
|
34
34
|
}
|
|
35
|
-
const {
|
|
36
|
-
file.setContent(
|
|
35
|
+
const { updatedFile, diff } = await this.diffService.diffContent(file.name, remote, file.getContent());
|
|
36
|
+
file.setContent(updatedFile);
|
|
37
37
|
if (diff) {
|
|
38
38
|
this.cli.writeWarning(`skipped ${file.name} (identical with remote)`);
|
|
39
39
|
file.skipFile();
|
|
@@ -27,8 +27,8 @@ 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 {
|
|
31
|
-
file.setContent(
|
|
30
|
+
const { updatedFile, diff } = await this.diffService.diffContent(file.name, remote, file.getContent());
|
|
31
|
+
file.setContent(updatedFile);
|
|
32
32
|
if (diff) {
|
|
33
33
|
this.cli.writeWarning(`skipped ${file.name} (identical with remote)`);
|
|
34
34
|
file.skipFile();
|
|
@@ -7,7 +7,7 @@ export declare class DiffService {
|
|
|
7
7
|
constructor(cli: CliService, diffExecutablePath?: string, diffExecutableTemplate?: string);
|
|
8
8
|
diff(localPath: string, fileName: string, temporaryContent: string): Promise<boolean>;
|
|
9
9
|
diffContent(fileName: string, firstContent: string, secondContent: string, diffSuffix?: string[]): Promise<{
|
|
10
|
-
|
|
10
|
+
updatedFile: string;
|
|
11
11
|
diff: boolean;
|
|
12
12
|
}>;
|
|
13
13
|
/**
|
|
@@ -26,8 +26,10 @@ class DiffService {
|
|
|
26
26
|
const temporaryFirstFilePath = await this.writeContentToTemporalFile(`${fileName}-${diffSuffix[0]}`, firstContent);
|
|
27
27
|
const temporarySecondFilePath = await this.writeContentToTemporalFile(`${fileName}-${diffSuffix[1]}`, secondContent);
|
|
28
28
|
const diff = await this.executeDiff(temporaryFirstFilePath, temporarySecondFilePath);
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
// return changes made in diffView
|
|
30
|
+
// eg adding changes from remote to safe locally
|
|
31
|
+
const changedFile = await (0, promises_1.readFile)(temporarySecondFilePath, "utf-8");
|
|
32
|
+
return { updatedFile: changedFile, diff };
|
|
31
33
|
}
|
|
32
34
|
/**
|
|
33
35
|
* Returns a temporal directory path.
|
package/oclif.manifest.json
CHANGED