@hasna/events 0.1.15 → 0.1.17

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/README.md CHANGED
@@ -8,8 +8,19 @@ This package is local-first. By default it stores JSON files under `~/.hasna/eve
8
8
  - `events.json`
9
9
  - `deliveries.json`
10
10
 
11
- The CLI `--dir` flag has highest precedence, followed by `HASNA_EVENTS_DIR`,
12
- then the legacy `HASNA_EVENTS_HOME` fallback.
11
+ The data home is resolved through the shared `@hasna/paths` resolver, in this order:
12
+
13
+ 1. The CLI `--dir` flag (highest precedence);
14
+ 2. the exact-app `HASNA_EVENTS_DIR` override, then the legacy
15
+ `HASNA_EVENTS_HOME` fallback;
16
+ 3. the `@hasna/paths`-resolved XDG data home (`HASNA_DATA_HOME`/`~/.local/share/hasna/events`),
17
+ adopted once `HASNA_DATA_HOME` is set or the store has been physically migrated there
18
+ (`events.json` exists at that home);
19
+ 4. the legacy `~/.hasna/events` default.
20
+
21
+ Nothing moves on its own: the package keeps reading and writing whichever home is
22
+ effective, and the legacy `~/.hasna/events` stays effective until an operator opts into
23
+ the XDG layout or the store is migrated to it.
13
24
 
14
25
  ## Storage Runtime Contract
15
26
 
@@ -137,9 +148,9 @@ const client = new EventsClient({ catalog, validateCatalogTypes: true });
137
148
  // Registered type with an invalid payload throws EventValidationError
138
149
  // BEFORE the event is stored or delivered.
139
150
  await client.emit({
140
- source: "open-publish",
151
+ source: "publish",
141
152
  type: "release.published",
142
- data: { appId: "open-todos" },
153
+ data: { appId: "todos" },
143
154
  });
144
155
  ```
145
156
 
@@ -520,7 +531,7 @@ events channels add events --id nested-route --transport command -- handle todos
520
531
  events channels match open-source-task-route \
521
532
  --source todos \
522
533
  --type task.created \
523
- --metadata '{"project_path":"/home/hasna/workspace/hasna/opensource/open-events","route_enabled":true}'
534
+ --metadata '{"project_path":"/home/hasna/workspace/repos/hasna/events","route_enabled":true}'
524
535
 
525
536
  events channels test open-source-task-route --honor-filters \
526
537
  --source todos \