gt 2.11.1 → 2.11.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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # gtx-cli
2
2
 
3
+ ## 2.11.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1125](https://github.com/generaltranslation/gt/pull/1125) [`c3f8a78`](https://github.com/generaltranslation/gt/commit/c3f8a782f692fd69998a44b8116a3adfab6ea7c8) Thanks [@moss-bryophyta](https://github.com/moss-bryophyta)! - Fix logo URLs in README files (updated to `/brand/gt-logo-*.svg`)
8
+
9
+ - [#1132](https://github.com/generaltranslation/gt/pull/1132) [`a83a130`](https://github.com/generaltranslation/gt/commit/a83a130944193ec4b9784fb7687808936e175d19) Thanks [@fernando-aviles](https://github.com/fernando-aviles)! - Make CDN unpublish behavior opt-in
10
+
11
+ - Updated dependencies [[`c3f8a78`](https://github.com/generaltranslation/gt/commit/c3f8a782f692fd69998a44b8116a3adfab6ea7c8)]:
12
+ - generaltranslation@8.1.20
13
+ - gt-remark@1.0.6
14
+ - @generaltranslation/python-extractor@0.1.6
15
+
3
16
  ## 2.11.1
4
17
 
5
18
  ### Patch Changes
package/README.md CHANGED
@@ -1,9 +1,8 @@
1
1
  <p align="center">
2
2
  <a href="https://generaltranslation.com/docs/cli">
3
3
  <picture>
4
- <source media="(prefers-color-scheme: dark)" srcset="https://generaltranslation.com/gt-logo-dark.svg">
5
- <source media="(prefers-color-scheme: light)" srcset="https://generaltranslation.com/gt-logo-light.svg">
6
- <img alt="General Translation" src="https://generaltranslation.com/gt-logo-light.svg" width="100" height="100">
4
+ <source media="(prefers-color-scheme: light)" srcset="https://generaltranslation.com/brand/gt-logo-light.svg">
5
+ <img alt="General Translation" src="https://generaltranslation.com/brand/gt-logo-dark.svg" width="100" height="100">
7
6
  </picture>
8
7
  </a>
9
8
  </p>
@@ -113,8 +113,18 @@ export async function generateSettings(flags, cwd = process.cwd()) {
113
113
  // Add stageTranslations if not provided
114
114
  // For human review, always stage the project
115
115
  mergedOptions.stageTranslations = mergedOptions.stageTranslations ?? false;
116
- // Add publish if not provided
117
- mergedOptions.publish = (gtConfig.publish || flags.publish) ?? false;
116
+ // Add publish — only set if explicitly configured or passed via flag.
117
+ // When neither is set, leave undefined so the publish step knows
118
+ // there is no global publish intent.
119
+ if (flags.publish) {
120
+ mergedOptions.publish = true;
121
+ }
122
+ else if (gtConfig.publish !== undefined) {
123
+ mergedOptions.publish = gtConfig.publish;
124
+ }
125
+ else {
126
+ mergedOptions.publish = undefined;
127
+ }
118
128
  // Don't default src here — each pipeline (JS/Python) has its own defaults.
119
129
  // Only set src if the user explicitly provided it via flags or config.
120
130
  // Resolve all glob patterns in the files object
@@ -37,13 +37,21 @@ export async function aggregateFiles(settings) {
37
37
  }
38
38
  const { resolvedPaths: filePaths } = settings.files;
39
39
  const skipValidation = settings.options?.skipFileValidation;
40
- // Build publish map upfront from resolved paths
40
+ // Build publish map upfront from resolved paths.
41
+ // Only include files that have an explicit publish config or when a global
42
+ // publish flag is defined. Files without any config are left out of the map
43
+ // so the publish endpoint is never called for them.
44
+ const hasGlobalPublish = settings.publish !== undefined;
41
45
  for (const fileType of SUPPORTED_FILE_EXTENSIONS) {
42
46
  if (filePaths[fileType]) {
43
47
  for (const absolutePath of filePaths[fileType]) {
44
- const relativePath = getRelative(absolutePath);
45
- const fileId = hashStringSync(relativePath);
46
- publishMap.set(fileId, shouldPublishFile(absolutePath, settings));
48
+ const hasExplicitConfig = settings.files.publishPaths?.has(absolutePath) ||
49
+ settings.files.unpublishPaths?.has(absolutePath);
50
+ if (hasGlobalPublish || hasExplicitConfig) {
51
+ const relativePath = getRelative(absolutePath);
52
+ const fileId = hashStringSync(relativePath);
53
+ publishMap.set(fileId, shouldPublishFile(absolutePath, settings));
54
+ }
47
55
  }
48
56
  }
49
57
  }
@@ -44,7 +44,11 @@ export async function collectFiles(options, settings, library) {
44
44
  versionId: hashStringSync(JSON.stringify(Object.keys(fileData).sort())),
45
45
  locale: settings.defaultLocale,
46
46
  });
47
- publishMap.set(TEMPLATE_FILE_ID, shouldPublishGt(settings));
47
+ // Only add GT JSON to publishMap if there's an explicit publish config
48
+ const gtPublishValue = shouldPublishGt(settings);
49
+ if (gtPublishValue !== undefined) {
50
+ publishMap.set(TEMPLATE_FILE_ID, gtPublishValue);
51
+ }
48
52
  }
49
53
  }
50
54
  return { files, reactComponents, publishMap };
@@ -1 +1 @@
1
- export declare const PACKAGE_VERSION = "2.11.1";
1
+ export declare const PACKAGE_VERSION = "2.11.2";
@@ -1,2 +1,2 @@
1
1
  // This file is auto-generated. Do not edit manually.
2
- export const PACKAGE_VERSION = '2.11.1';
2
+ export const PACKAGE_VERSION = '2.11.2';
@@ -172,7 +172,7 @@ export type Settings = {
172
172
  };
173
173
  };
174
174
  stageTranslations: boolean;
175
- publish: boolean;
175
+ publish?: boolean;
176
176
  _versionId?: string;
177
177
  _branchId?: string;
178
178
  version?: string;
@@ -14,5 +14,6 @@ export declare function hasPublishConfig(settings: Settings): boolean;
14
14
  /**
15
15
  * Determines whether gtjson content should be published.
16
16
  * Uses the gt-specific publish flag if set, otherwise falls back to global.
17
+ * Returns undefined when there is no explicit config at any level.
17
18
  */
18
- export declare function shouldPublishGt(settings: Settings): boolean;
19
+ export declare function shouldPublishGt(settings: Settings): boolean | undefined;
@@ -16,7 +16,7 @@ export function shouldPublishFile(resolvedPath, settings) {
16
16
  * global flag, gt-specific flag, or per-file publish/unpublish patterns.
17
17
  */
18
18
  export function hasPublishConfig(settings) {
19
- return (settings.publish ||
19
+ return (settings.publish !== undefined ||
20
20
  settings.files.gtJson.publish !== undefined ||
21
21
  (settings.files.publishPaths?.size ?? 0) > 0 ||
22
22
  (settings.files.unpublishPaths?.size ?? 0) > 0);
@@ -24,6 +24,7 @@ export function hasPublishConfig(settings) {
24
24
  /**
25
25
  * Determines whether gtjson content should be published.
26
26
  * Uses the gt-specific publish flag if set, otherwise falls back to global.
27
+ * Returns undefined when there is no explicit config at any level.
27
28
  */
28
29
  export function shouldPublishGt(settings) {
29
30
  if (settings.files.gtJson.publish === false)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gt",
3
- "version": "2.11.1",
3
+ "version": "2.11.2",
4
4
  "main": "dist/index.js",
5
5
  "bin": "dist/main.js",
6
6
  "files": [
@@ -110,9 +110,9 @@
110
110
  "unified": "^11.0.5",
111
111
  "unist-util-visit": "^5.0.0",
112
112
  "yaml": "^2.8.0",
113
- "@generaltranslation/python-extractor": "0.1.5",
114
- "generaltranslation": "8.1.19",
115
- "gt-remark": "1.0.5"
113
+ "@generaltranslation/python-extractor": "0.1.6",
114
+ "generaltranslation": "8.1.20",
115
+ "gt-remark": "1.0.6"
116
116
  },
117
117
  "devDependencies": {
118
118
  "@babel/types": "^7.28.4",