@meterapp/glossa 0.7.1 → 0.7.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/bin/glossa.mjs CHANGED
@@ -10,7 +10,7 @@ import { dirname, join, relative, resolve } from "node:path";
10
10
  import { createInterface } from "node:readline";
11
11
  import { brotliCompressSync, brotliDecompressSync, constants as zlib } from "node:zlib";
12
12
 
13
- const VERSION = "0.7.1";
13
+ const VERSION = "0.7.2";
14
14
  const DEFAULT_HOST = "https://getglossa.dev";
15
15
  const CONFIG_PATH = join(process.env.XDG_CONFIG_HOME || join(homedir(), ".config"), "glossa", "config.json");
16
16
  /** The last failed call, so `glossa feedback report --last` can attach it. */
@@ -611,13 +611,14 @@ export function checkInput(flags, config, sources) {
611
611
 
612
612
  /**
613
613
  * Compares the locale files in the tree with what pull writes now (the hashes check_sync returns)
614
- * and folds the result into the verdict. A file whose source differs from Glossa's isn't compared.
614
+ * and folds the result into the verdict. A file whose source differs from Glossa's is compared
615
+ * only when the server rendered it from the commit (`outputs_from: "commit"`); older servers didn't.
615
616
  */
616
617
  export function compareLocal(result, stale, hashOf) {
617
618
  const differ = [];
618
619
  for (const file of result.files) {
619
620
  for (const out of file.outputs) {
620
- if (file.source === "changed") out.status = "not_comparable";
621
+ if (file.source === "changed" && file.outputs_from !== "commit") out.status = "not_comparable";
621
622
  else {
622
623
  const local = hashOf(out.path);
623
624
  out.status = local === null ? "missing" : local === out.sha256 ? "in_sync" : "stale";
@@ -196,7 +196,7 @@ describe("check", () => {
196
196
  expect(() => checkInput({ stale: "maybe" }, config, [])).toThrow(/--stale/);
197
197
  });
198
198
 
199
- it("compares the tree with pull's output and skips files whose source changed", () => {
199
+ it("compares the tree with pull's output and skips files whose source changed unless rendered from the commit", () => {
200
200
  const result = {
201
201
  ok: true,
202
202
  failures: [],
@@ -205,11 +205,12 @@ describe("check", () => {
205
205
  files: [
206
206
  { source: "current", outputs: [{ path: "es.json", sha256: syncHash("es") }, { path: "fr.json", sha256: syncHash("fr") }, { path: "de.json", sha256: syncHash("de") }] },
207
207
  { source: "changed", outputs: [{ path: "other/es.json", sha256: syncHash("x") }] },
208
+ { source: "changed", outputs_from: "commit", outputs: [{ path: "web/es.json", sha256: syncHash("web") }] },
208
209
  ],
209
210
  };
210
- const tree = { "es.json": syncHash("es"), "fr.json": syncHash("old") };
211
+ const tree = { "es.json": syncHash("es"), "fr.json": syncHash("old"), "web/es.json": syncHash("web") };
211
212
  const out = compareLocal(result, "fail", (path) => tree[path] ?? null);
212
- expect(out.files.flatMap((f) => f.outputs.map((o) => o.status))).toEqual(["in_sync", "stale", "missing", "not_comparable"]);
213
+ expect(out.files.flatMap((f) => f.outputs.map((o) => o.status))).toEqual(["in_sync", "stale", "missing", "not_comparable", "in_sync"]);
213
214
  expect(out).toMatchObject({ ok: false, totals: { stale: 2 }, failures: [{ code: "stale_files" }] });
214
215
  expect(compareLocal(result, "warn", (path) => tree[path] ?? null)).toMatchObject({ ok: true, warnings: [expect.stringContaining("2 locale files")] });
215
216
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meterapp/glossa",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "description": "Glossa CLI: push and pull translation files, run the AI review queue, and every other Glossa op from your terminal or CI. Includes a stdio MCP bridge.",
5
5
  "type": "module",
6
6
  "bin": { "glossa": "bin/glossa.mjs" },