@fonderie/events 1.0.0 → 1.0.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fonderie/events",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Event bus for @fonderie-js — memory and PostgreSQL transports built-in, adapter interface for Redis/Kafka/RabbitMQ.",
5
5
  "keywords": [
6
6
  "fonderie-js",
@@ -30,7 +30,7 @@
30
30
  "module": "./dist/index.js",
31
31
  "types": "./dist/index.d.ts",
32
32
  "scripts": {
33
- "build": "tsup && node -e \"require('node:fs').cpSync('src/migrations/sql', 'dist/migrations/sql', {recursive:true})\"",
33
+ "build": "tsup && tsup --config tsup.migrations.ts",
34
34
  "dev": "tsup --watch",
35
35
  "typecheck": "tsc --noEmit",
36
36
  "test": "tsx --test src/__tests__/*.test.ts",
@@ -39,8 +39,8 @@
39
39
  "check": "biome check --write src"
40
40
  },
41
41
  "peerDependencies": {
42
- "@fonderie/core": "^0.1.0",
43
- "@fonderie/store": "^0.1.0",
42
+ "@fonderie/core": "^0.1.1",
43
+ "@fonderie/store": "^0.1.1",
44
44
  "pg": "^8.0.0"
45
45
  },
46
46
  "peerDependenciesMeta": {
@@ -1,10 +0,0 @@
1
- CREATE TABLE IF NOT EXISTS fonderie_events (
2
- id UUID NOT NULL PRIMARY KEY DEFAULT gen_random_uuid(),
3
- type TEXT NOT NULL,
4
- payload JSONB NOT NULL DEFAULT '{}',
5
- meta JSONB NOT NULL DEFAULT '{}',
6
- created_at TIMESTAMPTZ NOT NULL DEFAULT now()
7
- );
8
-
9
- CREATE INDEX IF NOT EXISTS fonderie_events_created_idx
10
- ON fonderie_events (created_at);
@@ -1,25 +0,0 @@
1
- -- Drop mutable delivery columns from fonderie_events (no-op on fresh installs)
2
- ALTER TABLE fonderie_events
3
- DROP COLUMN IF EXISTS status,
4
- DROP COLUMN IF EXISTS attempts,
5
- DROP COLUMN IF EXISTS error,
6
- DROP COLUMN IF EXISTS processed_at;
7
-
8
- DROP INDEX IF EXISTS fonderie_events_status_idx;
9
-
10
- -- Per-consumer delivery tracking
11
- CREATE TABLE IF NOT EXISTS fonderie_event_consumers (
12
- event_id UUID NOT NULL REFERENCES fonderie_events(id) ON DELETE CASCADE,
13
- consumer TEXT NOT NULL,
14
- status TEXT NOT NULL DEFAULT 'pending'
15
- CHECK (status IN ('pending', 'processing', 'processed', 'failed', 'dead')),
16
- attempts INT NOT NULL DEFAULT 0,
17
- error TEXT,
18
- processed_at TIMESTAMPTZ,
19
- PRIMARY KEY (event_id, consumer)
20
- );
21
-
22
- -- Partial index — each consumer's poll touches only its own pending rows
23
- CREATE INDEX IF NOT EXISTS fonderie_event_consumers_poll_idx
24
- ON fonderie_event_consumers (consumer, status, event_id)
25
- WHERE status IN ('pending', 'failed');