@speedkit/cli 3.30.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 CHANGED
@@ -1,3 +1,17 @@
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
+
8
+ # [3.31.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v3.30.0...v3.31.0) (2026-03-03)
9
+
10
+
11
+ ### Features
12
+
13
+ * **customer-config:** update ssr config ([be9cfd4](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/be9cfd4dd43086e8c0ce6800e3cce33914f7297d))
14
+
1
15
  # [3.30.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v3.29.2...v3.30.0) (2026-03-03)
2
16
 
3
17
 
package/README.md CHANGED
@@ -21,7 +21,7 @@ $ npm install -g @speedkit/cli
21
21
  $ sk COMMAND
22
22
  running command...
23
23
  $ sk (--version)
24
- @speedkit/cli/3.30.0 linux-x64 node-v20.20.0
24
+ @speedkit/cli/3.31.1 linux-x64 node-v20.20.1
25
25
  $ sk --help [COMMAND]
26
26
  USAGE
27
27
  $ sk COMMAND
@@ -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, popPrewarmingCode, remoteConfig);
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) {
@@ -188,8 +188,8 @@ const config = {
188
188
  // Additional Asset Domains:
189
189
  // '<domain>',
190
190
  ],
191
- // Domains requested via POST:
192
191
  // dynamicUrl: [
192
+ // // Domains requested via POST:
193
193
  // '<domain>',
194
194
  // ],
195
195
  resourceType: [
@@ -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, file.getContent(), installResource[file.remoteKey]);
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(), remote);
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(), remote);
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, localContent: string, remoteContent: string): Promise<{
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 localPath
30
- * @param remotePath
29
+ * @param firstPath
30
+ * @param secondPath
31
31
  * @param skipDiffExecution
32
32
  */
33
- executeDiff(localPath: string, remotePath: string, skipDiffExecution?: boolean): Promise<boolean>;
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, localContent, remoteContent) {
26
- const temporaryLocalFilePath = await this.writeContentToTemporalFile(`${fileName}-local`, localContent);
27
- const temporaryRemoteFilePath = await this.writeContentToTemporalFile(`${fileName}-remote`, remoteContent);
28
- const diff = await this.executeDiff(temporaryLocalFilePath, temporaryRemoteFilePath);
29
- const changedFile = await (0, promises_1.readFile)(temporaryLocalFilePath, "utf-8");
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 localPath
70
- * @param remotePath
69
+ * @param firstPath
70
+ * @param secondPath
71
71
  * @param skipDiffExecution
72
72
  */
73
- async executeDiff(localPath, remotePath, skipDiffExecution = false) {
74
- let localContent;
75
- let remoteContent;
73
+ async executeDiff(firstPath, secondPath, skipDiffExecution = false) {
74
+ let firstContent;
75
+ let secondContent;
76
76
  try {
77
- localContent = await promises_1.default.readFile(localPath, {
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
- remoteContent = await promises_1.default.readFile(remotePath, {
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 ${remoteContent}: ${error.message}`);
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(localContent, remoteContent)) {
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", localPath)
110
- .replace("$file2", remotePath);
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 "${localPath}" "${remotePath}"`, {
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 ${localPath} ${remotePath}`, { stdio: "pipe" });
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 ${localPath} ${remotePath}`, { stdio: "pipe" });
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(localFilePath, remoteFilePath);
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,
@@ -731,5 +731,5 @@
731
731
  ]
732
732
  }
733
733
  },
734
- "version": "3.30.0"
734
+ "version": "3.31.1"
735
735
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@speedkit/cli",
3
3
  "description": "Speed Kit CLI",
4
- "version": "3.30.0",
4
+ "version": "3.31.1",
5
5
  "author": {
6
6
  "name": "Baqend.com",
7
7
  "email": "info@baqend.com"