hazo_collect 0.2.7 → 0.2.8

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/CHANGE_LOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # hazo_collect — Change Log
2
2
 
3
+ ## 0.2.8 — 2026-09-19
4
+
5
+ ### Added
6
+
7
+ Future-proofing i18n plumbing only — no behavior change. hazo_collect is a "zero-string" package
8
+ (headless collector-manager engine, no rendered UI; the string literals in the codebase are
9
+ internal error messages for plugin/collector authors, not end-user copy), so this wires the
10
+ canonical `hazo_core/i18n` bridge without adding any real strings yet:
11
+
12
+ - `src/locales/en.json` — empty flat catalog (`{}`).
13
+ - `src/lib/index.ts` now exports `t = createPackageT('hazo_collect', en)`, re-exported from the
14
+ main entry point. Loads the catalog via `createRequire` rather than
15
+ `import en from '../locales/en.json' with { type: 'json' }` — this package's `tsconfig.json` uses
16
+ `"module": "Node16"`, which throws TS2823 on import attributes syntax (a known incompatibility
17
+ found during the workspace's i18n adoption pass). `tsup.config.ts` gained a `lib/index` build
18
+ entry and copies `src/locales/en.json` to `dist/locales/en.json`. The `createRequire` lookup
19
+ tries a couple of relative depths (`../locales/en.json`, `./locales/en.json`,
20
+ `../../locales/en.json`) rather than one hardcoded path, since tsup's code-splitting extracts
21
+ this module into a shared chunk whose on-disk depth doesn't reliably match the source file's —
22
+ confirmed empirically against a real build. Falls back to `{}` rather than throwing.
23
+ - `hazo_i18n` added to `peerDependencies` (`^0.5.0`) and marked optional in
24
+ `peerDependenciesMeta` — `hazo_core` was already a required peer.
25
+ - Added an `hazo_collect.i18n` autotest scenario group (one trivial case) to the test-app.
26
+
3
27
  ## Unreleased — test tooling
4
28
 
5
29
  ### Fixed
@@ -0,0 +1,19 @@
1
+ // src/lib/index.ts
2
+ import { createRequire } from "module";
3
+ import { createPackageT } from "hazo_core/i18n";
4
+ function loadEnCatalog() {
5
+ const req = createRequire(import.meta.url);
6
+ for (const rel of ["../locales/en.json", "./locales/en.json", "../../locales/en.json"]) {
7
+ try {
8
+ return req(rel);
9
+ } catch {
10
+ }
11
+ }
12
+ return {};
13
+ }
14
+ var en = loadEnCatalog();
15
+ var t = createPackageT("hazo_collect", en);
16
+
17
+ export {
18
+ t
19
+ };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  import { M as ManifestInput } from './run-envelope-BOV1BPah.js';
2
2
  export { a as Manifest, b as ManifestSchema, R as RunEnvelope, c as RunEnvelopeSchema, p as parseManifest, d as parseRunEnvelope } from './run-envelope-BOV1BPah.js';
3
3
  export { R as RunError, a as RunResult, b as RunResultSchema, p as parseRunResult } from './run-result-yw8Iqipg.js';
4
+ export { t } from './lib/index.js';
4
5
  import 'zod';
6
+ import 'hazo_core/i18n';
5
7
 
6
8
  declare const CONTRACT_VERSION = "1.0.0";
7
9
 
package/dist/index.js CHANGED
@@ -6,6 +6,9 @@ import {
6
6
  parseRunResult,
7
7
  validateInputs
8
8
  } from "./chunk-6RFFJN6X.js";
9
+ import {
10
+ t
11
+ } from "./chunk-TORPW2KF.js";
9
12
 
10
13
  // src/schema/run-envelope.ts
11
14
  import { z } from "zod";
@@ -41,5 +44,6 @@ export {
41
44
  parseManifest,
42
45
  parseRunEnvelope,
43
46
  parseRunResult,
47
+ t,
44
48
  validateInputs
45
49
  };
@@ -0,0 +1,14 @@
1
+ import * as hazo_core_i18n from 'hazo_core/i18n';
2
+
3
+ /**
4
+ * Future-proofing plumbing only: hazo_collect is a "zero-string" package —
5
+ * it's a headless collector-manager engine with no rendered UI and no
6
+ * user-facing copy (all string literals in this package are internal error
7
+ * messages for plugin/collector authors, not end-user text). `en` is an
8
+ * empty flat catalog today. If this package ever grows a user-facing
9
+ * string, add it to `src/locales/en.json` and read it via `t('some.key')`
10
+ * instead of a literal.
11
+ */
12
+ declare const t: hazo_core_i18n.TFunc;
13
+
14
+ export { t };
@@ -0,0 +1,6 @@
1
+ import {
2
+ t
3
+ } from "../chunk-TORPW2KF.js";
4
+ export {
5
+ t
6
+ };
@@ -0,0 +1 @@
1
+ {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hazo_collect",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "Collector-manager engine for the Ocdata platform",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
@@ -43,12 +43,13 @@
43
43
  "ajv": "^8.17.1"
44
44
  },
45
45
  "peerDependencies": {
46
- "hazo_core": "^2.0.0",
47
- "hazo_connect": "^4.0.0",
48
- "hazo_secure": "^1.7.1",
46
+ "hazo_core": "^2.4.0",
47
+ "hazo_connect": "^4.3.0",
48
+ "hazo_secure": "^1.8.1",
49
49
  "react": "^18.0.0 || ^19.0.0",
50
50
  "react-dom": "^18.0.0 || ^19.0.0",
51
- "hazo_ui": "^6.8.0"
51
+ "hazo_ui": "^6.12.0",
52
+ "hazo_i18n": "^0.5.0"
52
53
  },
53
54
  "peerDependenciesMeta": {
54
55
  "hazo_secure": {
@@ -62,6 +63,9 @@
62
63
  },
63
64
  "hazo_ui": {
64
65
  "optional": true
66
+ },
67
+ "hazo_i18n": {
68
+ "optional": true
65
69
  }
66
70
  },
67
71
  "devDependencies": {
@@ -74,9 +78,9 @@
74
78
  "@types/node": "^22.10.0",
75
79
  "@types/react": "^19.0.0",
76
80
  "@types/react-dom": "^19.0.0",
77
- "hazo_core": "^2.0.0",
78
- "hazo_connect": "^4.0.0",
79
- "hazo_secure": "^1.7.1"
81
+ "hazo_core": "^2.4.0",
82
+ "hazo_connect": "^4.3.0",
83
+ "hazo_secure": "^1.8.1"
80
84
  },
81
85
  "keywords": [],
82
86
  "author": "Pubs Abayasiri",