gt 2.14.2 → 2.14.3
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 +6 -0
- package/dist/api/downloadFileBatch.js +4 -1
- package/dist/cli/base.js +2 -2
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.js +1 -1
- package/dist/state/recentDownloads.d.ts +7 -0
- package/dist/state/recentDownloads.js +13 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# gtx-cli
|
|
2
2
|
|
|
3
|
+
## 2.14.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1168](https://github.com/generaltranslation/gt/pull/1168) [`55d7ccd`](https://github.com/generaltranslation/gt/commit/55d7ccd82683992f8d9a0cfa9d380dd95b24b85e) Thanks [@fernando-aviles](https://github.com/fernando-aviles)! - Record re-merged files for postprocessing
|
|
8
|
+
|
|
3
9
|
## 2.14.2
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -9,7 +9,7 @@ import { extractJson } from '../formats/json/extractJson.js';
|
|
|
9
9
|
import mergeYaml from '../formats/yaml/mergeYaml.js';
|
|
10
10
|
import { extractYaml } from '../formats/yaml/extractYaml.js';
|
|
11
11
|
import { readLockfile, writeLockfile, findOrCreateEntry, } from '../fs/config/downloadedVersions.js';
|
|
12
|
-
import { recordDownloaded } from '../state/recentDownloads.js';
|
|
12
|
+
import { recordDownloaded, recordRemerged } from '../state/recentDownloads.js';
|
|
13
13
|
import { recordWarning } from '../state/translateWarnings.js';
|
|
14
14
|
import stringify from 'fast-json-stable-stringify';
|
|
15
15
|
/**
|
|
@@ -116,6 +116,9 @@ export async function downloadFileBatch(fileTracker, files, options, forceDownlo
|
|
|
116
116
|
if (remerged !== existingContent) {
|
|
117
117
|
await fs.promises.writeFile(outputPath, remerged);
|
|
118
118
|
}
|
|
119
|
+
// Track for postprocessing (e.g. openapi path localization)
|
|
120
|
+
// even when the API download was skipped
|
|
121
|
+
recordRemerged(outputPath);
|
|
119
122
|
}
|
|
120
123
|
}
|
|
121
124
|
catch {
|
package/dist/cli/base.js
CHANGED
|
@@ -20,7 +20,7 @@ import { handleStage } from './commands/stage.js';
|
|
|
20
20
|
import { handleSetupProject } from './commands/setupProject.js';
|
|
21
21
|
import { handleDownload } from './commands/download.js';
|
|
22
22
|
import { handleTranslate, postProcessTranslations, } from './commands/translate.js';
|
|
23
|
-
import {
|
|
23
|
+
import { getNeedsPostprocessing, clearDownloaded, } from '../state/recentDownloads.js';
|
|
24
24
|
import { clearWarnings } from '../state/translateWarnings.js';
|
|
25
25
|
import { displayTranslateSummary } from '../console/displayTranslateSummary.js';
|
|
26
26
|
import updateConfig from '../fs/config/updateConfig.js';
|
|
@@ -181,7 +181,7 @@ export class BaseCLI {
|
|
|
181
181
|
await handleDownload(initOptions, settings, this.library);
|
|
182
182
|
}
|
|
183
183
|
// Only postprocess files downloaded in this run
|
|
184
|
-
const include =
|
|
184
|
+
const include = getNeedsPostprocessing();
|
|
185
185
|
if (include.size > 0) {
|
|
186
186
|
await postProcessTranslations(settings, include);
|
|
187
187
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PACKAGE_VERSION = "2.14.
|
|
1
|
+
export declare const PACKAGE_VERSION = "2.14.3";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// This file is auto-generated. Do not edit manually.
|
|
2
|
-
export const PACKAGE_VERSION = '2.14.
|
|
2
|
+
export const PACKAGE_VERSION = '2.14.3';
|
|
@@ -6,7 +6,14 @@ type DownloadMeta = {
|
|
|
6
6
|
inputPath?: string;
|
|
7
7
|
};
|
|
8
8
|
export declare function recordDownloaded(filePath: string, meta?: DownloadMeta): void;
|
|
9
|
+
/**
|
|
10
|
+
* Track a file that was re-merged with the source
|
|
11
|
+
* so that postprocessing still runs on it.
|
|
12
|
+
*/
|
|
13
|
+
export declare function recordRemerged(filePath: string): void;
|
|
9
14
|
export declare function getDownloaded(): Set<string>;
|
|
15
|
+
/** Files that need postprocessing: downloaded OR re-merged */
|
|
16
|
+
export declare function getNeedsPostprocessing(): Set<string>;
|
|
10
17
|
export declare function getDownloadedMeta(): Map<string, DownloadMeta>;
|
|
11
18
|
export declare function clearDownloaded(): void;
|
|
12
19
|
export {};
|
|
@@ -1,18 +1,31 @@
|
|
|
1
1
|
const recent = new Set();
|
|
2
2
|
const recentMeta = new Map();
|
|
3
|
+
const remerged = new Set();
|
|
3
4
|
export function recordDownloaded(filePath, meta) {
|
|
4
5
|
recent.add(filePath);
|
|
5
6
|
if (meta) {
|
|
6
7
|
recentMeta.set(filePath, meta);
|
|
7
8
|
}
|
|
8
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Track a file that was re-merged with the source
|
|
12
|
+
* so that postprocessing still runs on it.
|
|
13
|
+
*/
|
|
14
|
+
export function recordRemerged(filePath) {
|
|
15
|
+
remerged.add(filePath);
|
|
16
|
+
}
|
|
9
17
|
export function getDownloaded() {
|
|
10
18
|
return recent;
|
|
11
19
|
}
|
|
20
|
+
/** Files that need postprocessing: downloaded OR re-merged */
|
|
21
|
+
export function getNeedsPostprocessing() {
|
|
22
|
+
return new Set([...recent, ...remerged]);
|
|
23
|
+
}
|
|
12
24
|
export function getDownloadedMeta() {
|
|
13
25
|
return recentMeta;
|
|
14
26
|
}
|
|
15
27
|
export function clearDownloaded() {
|
|
16
28
|
recent.clear();
|
|
17
29
|
recentMeta.clear();
|
|
30
|
+
remerged.clear();
|
|
18
31
|
}
|