create-raredays-app 0.2.0 → 0.3.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": "create-raredays-app",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "description": "Scaffold a new RareDays Next.js app.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "Jeremy Harper <jeremy@raredays.com>",
@@ -3,14 +3,14 @@
3
3
  "label": "Billing (subscriptions + webhooks)",
4
4
  "description": "Plan registry, subscription state, webhook handler with idempotency + event-bus fan-out.",
5
5
  "deps": {
6
- "@raredays/billing": "^0.2.1"
6
+ "@raredays/billing": "^0.3.0"
7
7
  },
8
8
  "vendors": [
9
9
  {
10
10
  "key": "stripe",
11
11
  "label": "Stripe",
12
12
  "deps": {
13
- "@raredays/billing-stripe": "^0.1.0"
13
+ "@raredays/billing-stripe": "^0.1.1"
14
14
  },
15
15
  "env": [
16
16
  "STRIPE_SECRET_KEY",
@@ -3,14 +3,14 @@
3
3
  "label": "CMS (headless content + rich text)",
4
4
  "description": "Vendor-neutral CMS port. In-memory dev driver for development; swap to Hygraph (or another adapter) for production.",
5
5
  "deps": {
6
- "@raredays/cms": "^0.1.1"
6
+ "@raredays/cms": "^0.2.0"
7
7
  },
8
8
  "vendors": [
9
9
  {
10
10
  "key": "hygraph",
11
11
  "label": "Hygraph",
12
12
  "deps": {
13
- "@raredays/cms-hygraph": "^0.1.0"
13
+ "@raredays/cms-hygraph": "^0.2.0"
14
14
  },
15
15
  "env": [
16
16
  "HYGRAPH_ENDPOINT",
@@ -3,14 +3,14 @@
3
3
  "label": "Transactional email",
4
4
  "description": "Vendor-neutral email port. Console adapter for dev; swap to Resend for production.",
5
5
  "deps": {
6
- "@raredays/email": "^0.1.0"
6
+ "@raredays/email": "^0.2.0"
7
7
  },
8
8
  "vendors": [
9
9
  {
10
10
  "key": "resend",
11
11
  "label": "Resend",
12
12
  "deps": {
13
- "@raredays/email-resend": "^0.1.1"
13
+ "@raredays/email-resend": "^0.1.2"
14
14
  },
15
15
  "env": [
16
16
  "RESEND_API_KEY"
@@ -3,7 +3,7 @@
3
3
  "label": "Internationalisation (i18n)",
4
4
  "description": "Locale resolution, ICU message formatting, date/number/currency formatters, and React hooks.",
5
5
  "deps": {
6
- "@raredays/i18n": "^1.0.0"
6
+ "@raredays/i18n": "^1.0.1"
7
7
  },
8
8
  "templates": [
9
9
  "full-stack",
@@ -3,7 +3,7 @@
3
3
  "label": "Identity (auth, sessions, organizations, roles)",
4
4
  "description": "Identity port is always wired with an in-memory dev provider. Select a vendor to add the production adapter, env vars, mock handlers, and Next.js auth route stub.",
5
5
  "deps": {
6
- "@raredays/identity": "^0.1.0"
6
+ "@raredays/identity": "^0.1.1"
7
7
  },
8
8
  "vendors": [
9
9
  {
@@ -3,7 +3,7 @@
3
3
  "label": "Background jobs (in-process runner)",
4
4
  "description": "Type-safe job definitions, retries, idempotency. In-process runner by default; swap to Inngest/Trigger.dev for durable execution.",
5
5
  "deps": {
6
- "@raredays/jobs": "^0.1.1"
6
+ "@raredays/jobs": "^0.2.0"
7
7
  },
8
8
  "vendors": [],
9
9
  "templates": [
@@ -3,7 +3,7 @@
3
3
  "label": "Notifications (multi-channel send)",
4
4
  "description": "Notification definitions, channels (email + in-app), user preferences, dedupe, delivery logging.",
5
5
  "deps": {
6
- "@raredays/notifications": "^0.1.0"
6
+ "@raredays/notifications": "^0.2.0"
7
7
  },
8
8
  "vendors": [],
9
9
  "templates": [
@@ -3,7 +3,7 @@
3
3
  "label": "Organizations (multi-tenancy)",
4
4
  "description": "Domain types + role-based permissions for organizations, memberships, and invitations. Pairs with a postgres provider for storage.",
5
5
  "deps": {
6
- "@raredays/organizations": "^0.1.1"
6
+ "@raredays/organizations": "^0.2.0"
7
7
  },
8
8
  "vendors": [],
9
9
  "templates": [
@@ -3,14 +3,14 @@
3
3
  "label": "Telemetry (logging, errors, metrics, events)",
4
4
  "description": "Vendor-neutral observability port. Console adapters for dev; swap to Sentry + Axiom for production.",
5
5
  "deps": {
6
- "@raredays/telemetry": "^0.1.0"
6
+ "@raredays/telemetry": "^0.2.0"
7
7
  },
8
8
  "vendors": [
9
9
  {
10
10
  "key": "sentry",
11
11
  "label": "Sentry (error reporting)",
12
12
  "deps": {
13
- "@raredays/telemetry-sentry": "^0.1.1"
13
+ "@raredays/telemetry-sentry": "^0.2.0"
14
14
  },
15
15
  "env": [
16
16
  "SENTRY_DSN"
@@ -24,7 +24,7 @@
24
24
  "key": "axiom",
25
25
  "label": "Axiom (logging)",
26
26
  "deps": {
27
- "@raredays/telemetry-axiom": "^0.1.0"
27
+ "@raredays/telemetry-axiom": "^0.1.1"
28
28
  },
29
29
  "env": [
30
30
  "AXIOM_TOKEN",
@@ -27,8 +27,8 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@raredays/components": "^0.3.0",
30
- "@raredays/core": "^0.2.2",
31
- "@raredays/identity": "^0.1.0",
30
+ "@raredays/core": "^0.3.0",
31
+ "@raredays/identity": "^0.1.1",
32
32
  "@raredays/mocks": "^0.2.0",
33
33
  "@raredays/style": "^0.3.0",
34
34
  "lucide-react": "1.14.0",
@@ -44,7 +44,7 @@
44
44
  "@raredays/site-config": "^0.3.0",
45
45
  "@raredays/skills": "^0.2.0",
46
46
  "@raredays/theme-build": "^0.3.0",
47
- "@raredays/typescript": "^0.2.1",
47
+ "@raredays/typescript": "^0.3.0",
48
48
  "@storybook/react-vite": "10.3.6",
49
49
  "@tailwindcss/postcss": "4.2.4",
50
50
  "@tailwindcss/vite": "4.2.4",
@@ -36,8 +36,7 @@ const hasDatabaseUrl = Boolean(process.env.DATABASE_URL);
36
36
  // Dev fallback: bootstrap PGlite eagerly so providers can register
37
37
  // tables at composition-root eval. In prod, or when DATABASE_URL is
38
38
  // set, leave this null and fall through to the lazy Proxy below.
39
- const eagerPglite: Db | null =
40
- !isProduction && !hasDatabaseUrl ? await bootstrapPglite() : null;
39
+ const eagerPglite: Db | null = !isProduction && !hasDatabaseUrl ? await bootstrapPglite() : null;
41
40
 
42
41
  let cached: Db | undefined = eagerPglite ?? undefined;
43
42
 
@@ -60,15 +59,28 @@ async function bootstrapPglite(): Promise<Db> {
60
59
  // you need the full migration set in dev, point DATABASE_URL at a
61
60
  // local Postgres and run `pnpm db:migrate`.
62
61
  const statements: readonly string[] = [
63
- `CREATE TABLE IF NOT EXISTS audit_events (
64
- id text PRIMARY KEY,
65
- organization_id text NOT NULL,
66
- actor_id text,
67
- action text NOT NULL,
68
- resource_type text NOT NULL,
69
- resource_id text,
70
- payload jsonb NOT NULL DEFAULT '{}'::jsonb,
71
- created_at timestamptz NOT NULL DEFAULT now()
62
+ // Audit substrate — `audit_entries` is the ONE audit table (S2a / D3). The
63
+ // old `audit_events` table was retired: `@raredays/audit-drizzle` persists
64
+ // `audit_entries`, which matches the core `AuditProvider` port. If you hold
65
+ // legacy `audit_events` rows, backfill them into `audit_entries` before
66
+ // dropping (see the @raredays/postgres CHANGELOG / migration M8-backfill).
67
+ `DO $$ BEGIN
68
+ CREATE TYPE audit_actor_type AS ENUM ('user', 'system', 'api-key');
69
+ EXCEPTION WHEN duplicate_object THEN null; END $$`,
70
+ `CREATE TABLE IF NOT EXISTS audit_entries (
71
+ id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
72
+ organization_id uuid NOT NULL,
73
+ actor_id text NOT NULL,
74
+ actor_type audit_actor_type NOT NULL,
75
+ action varchar(255) NOT NULL,
76
+ target_type varchar(255) NOT NULL,
77
+ target_id text NOT NULL,
78
+ metadata jsonb NOT NULL DEFAULT '{}'::jsonb,
79
+ ip_address varchar(45),
80
+ user_agent text,
81
+ timestamp timestamptz NOT NULL DEFAULT now(),
82
+ created_at timestamptz NOT NULL DEFAULT now(),
83
+ updated_at timestamptz NOT NULL DEFAULT now()
72
84
  )`,
73
85
  `CREATE TABLE IF NOT EXISTS webhook_deliveries (
74
86
  id text PRIMARY KEY,
@@ -82,17 +94,35 @@ async function bootstrapPglite(): Promise<Db> {
82
94
  created_at timestamptz NOT NULL DEFAULT now(),
83
95
  updated_at timestamptz NOT NULL DEFAULT now()
84
96
  )`,
97
+ // Jobs substrate — append-only log + tenant-scoped dedup markers (S2a / D2).
98
+ // `job_executions` carries NO unique index (every status transition is an
99
+ // insert); dedup-of-record lives in `job_dedup_markers`.
100
+ `DO $$ BEGIN
101
+ CREATE TYPE job_execution_status AS ENUM
102
+ ('enqueued', 'running', 'succeeded', 'failed', 'skipped');
103
+ EXCEPTION WHEN duplicate_object THEN null; END $$`,
85
104
  `CREATE TABLE IF NOT EXISTS job_executions (
86
- id text PRIMARY KEY,
87
- organization_id text NOT NULL,
88
- job_name text NOT NULL,
89
- status text NOT NULL DEFAULT 'pending',
90
- payload jsonb NOT NULL DEFAULT '{}'::jsonb,
91
- result jsonb,
92
- error text,
93
- scheduled_at timestamptz NOT NULL DEFAULT now(),
94
- started_at timestamptz,
95
- completed_at timestamptz
105
+ id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
106
+ organization_id uuid NOT NULL,
107
+ created_at timestamptz NOT NULL DEFAULT now(),
108
+ updated_at timestamptz NOT NULL DEFAULT now(),
109
+ job_name varchar(64) NOT NULL,
110
+ idempotency_key varchar(128),
111
+ status job_execution_status NOT NULL,
112
+ attempts integer NOT NULL DEFAULT 0,
113
+ payload jsonb NOT NULL,
114
+ metadata jsonb NOT NULL DEFAULT '{}'::jsonb,
115
+ reason text,
116
+ error text
117
+ )`,
118
+ `CREATE TABLE IF NOT EXISTS job_dedup_markers (
119
+ id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
120
+ organization_id uuid NOT NULL,
121
+ created_at timestamptz NOT NULL DEFAULT now(),
122
+ updated_at timestamptz NOT NULL DEFAULT now(),
123
+ job_name varchar(64) NOT NULL,
124
+ idempotency_key varchar(128) NOT NULL,
125
+ CONSTRAINT job_dedup_markers_key_idx UNIQUE (organization_id, job_name, idempotency_key)
96
126
  )`,
97
127
  ];
98
128
  for (const stmt of statements) {
@@ -33,12 +33,12 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@raredays/components": "^0.3.0",
36
- "@raredays/core": "^0.2.2",
37
- "@raredays/identity": "^0.1.0",
36
+ "@raredays/core": "^0.3.0",
37
+ "@raredays/identity": "^0.1.1",
38
38
  "@raredays/mocks": "^0.2.0",
39
- "@raredays/postgres": "^0.2.0",
40
- "@raredays/postgres-neon": "^0.2.0",
41
- "@raredays/postgres-pglite": "^0.2.0",
39
+ "@raredays/postgres": "^0.3.0",
40
+ "@raredays/postgres-neon": "^0.2.1",
41
+ "@raredays/postgres-pglite": "^0.2.1",
42
42
  "@raredays/style": "^0.3.0",
43
43
  "drizzle-orm": "0.45.2",
44
44
  "lucide-react": "1.14.0",
@@ -54,7 +54,7 @@
54
54
  "@raredays/site-config": "^0.3.0",
55
55
  "@raredays/skills": "^0.2.0",
56
56
  "@raredays/theme-build": "^0.3.0",
57
- "@raredays/typescript": "^0.2.1",
57
+ "@raredays/typescript": "^0.3.0",
58
58
  "@tailwindcss/postcss": "4.2.4",
59
59
  "@types/node": "22.19.17",
60
60
  "@types/react": "19.2.14",
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "@raredays/components": "^0.3.0",
26
- "@raredays/core": "^0.2.2",
26
+ "@raredays/core": "^0.3.0",
27
27
  "@raredays/style": "^0.3.0",
28
28
  "lucide-react": "1.14.0",
29
29
  "next": "16.2.9",
@@ -37,7 +37,7 @@
37
37
  "@raredays/site-config": "^0.3.0",
38
38
  "@raredays/skills": "^0.2.0",
39
39
  "@raredays/theme-build": "^0.3.0",
40
- "@raredays/typescript": "^0.2.1",
40
+ "@raredays/typescript": "^0.3.0",
41
41
  "@storybook/react-vite": "10.3.6",
42
42
  "@tailwindcss/postcss": "4.2.4",
43
43
  "@tailwindcss/vite": "4.2.4",