Skip to content

Commit dfb922b

Browse files
authored
Decouple HomegrownAdapter schema authority
Add explicit HomegrownAdapter schema injection, keep auth-pg as an optional compatibility fallback, and remove the mandatory auth-pg Bzlmod edge.
2 parents 119d427 + 94a4ce4 commit dfb922b

11 files changed

Lines changed: 206 additions & 116 deletions

File tree

AGENTS.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,14 @@ Current operational truth:
5757

5858
- local development should default to `jesssullivan/main`
5959
- that branch is the current functional release line
60-
- current published package truth is `@tummycrypt/scheduling-kit` `0.7.6`
60+
- current published package truth is `@tummycrypt/scheduling-kit` `0.7.7`
6161
on npm, GitHub Releases, GitHub Packages, and the active tinyland Bazel
6262
registry
63-
- `0.7.6` fixes downstream Bzlmod `//:pkg` consumption by making the Svelte
63+
- `0.7.7` fixes downstream Bzlmod `//:pkg` consumption by making the Svelte
6464
package build independent of main-workspace-relative `src` paths
65+
- the next release candidate should not reintroduce a mandatory
66+
`tinyland-auth-pg` dependency for HomegrownAdapter; use explicit schema
67+
injection and keep any auth-pg fallback optional
6568
- `#73` remains open only for explicit historical release-surface
6669
backfill/documentation around older `0.7.1` / `0.7.2` gaps; the current
6770
release/tag/npm/Bazel/registry authority path is healthy

BUILD.bazel

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ npm_package(
149149
],
150150
package = "@tummycrypt/scheduling-kit",
151151
tags = ["manual"],
152-
version = "0.7.7",
152+
version = "0.7.8",
153153
visibility = ["//visibility:public"],
154154
)
155155

@@ -189,7 +189,6 @@ ts_project(
189189
":node_modules",
190190
":node_modules/effect",
191191
":node_modules/drizzle-orm",
192-
":node_modules/@tummycrypt/tinyland-auth-pg",
193192
],
194193
visibility = ["//visibility:public"],
195194
)

MODULE.bazel

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Subpackage targets (finer-grained caching):
2222

2323
module(
2424
name = "tummycrypt_scheduling_kit",
25-
version = "0.7.7",
25+
version = "0.7.8",
2626
compatibility_level = 1,
2727
)
2828

@@ -43,14 +43,6 @@ bazel_dep(name = "aspect_rules_js", version = "2.9.1")
4343
bazel_dep(name = "aspect_rules_ts", version = "3.8.4")
4444
bazel_dep(name = "aspect_rules_swc", version = "2.6.1")
4545

46-
# =============================================================================
47-
# Inter-module dependencies (tinyland building blocks)
48-
# =============================================================================
49-
50-
# HomegrownAdapter uses @tummycrypt/tinyland-auth-pg's drizzle schema and
51-
# storage primitives. The bazel_dep edge mirrors the npm dependency.
52-
bazel_dep(name = "tummycrypt_tinyland_auth_pg", version = "0.2.2")
53-
5446
# =============================================================================
5547
# Node.js toolchain
5648
# =============================================================================

README.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,11 @@ import {
119119

120120
// Create a scheduling adapter
121121
const scheduler = createHomegrownAdapter({
122-
db: drizzleInstance,
122+
withDb: async (fn) => fn(drizzleInstance),
123+
schemas: {
124+
content: contentSchema,
125+
booking: bookingSchema,
126+
},
123127
timezone: 'America/New_York',
124128
});
125129

@@ -170,17 +174,33 @@ Direct PostgreSQL adapter using Drizzle ORM. Replaces third-party scheduling
170174
APIs entirely.
171175

172176
```typescript
173-
import { createHomegrownAdapter } from '@tummycrypt/scheduling-kit/adapters';
177+
import {
178+
createHomegrownAdapter,
179+
type HomegrownAdapterSchemas,
180+
} from '@tummycrypt/scheduling-kit/adapters';
181+
import * as contentSchema from '@tummycrypt/tinyland-business-pg/content-schema';
182+
import * as bookingSchema from '@tummycrypt/tinyland-business-pg/booking-schema';
183+
184+
const schemas: HomegrownAdapterSchemas = {
185+
content: contentSchema,
186+
booking: bookingSchema,
187+
};
174188

175189
const adapter = createHomegrownAdapter({
176-
db: drizzleInstance,
190+
withDb: async (fn) => fn(drizzleInstance),
191+
schemas,
177192
timezone: 'America/New_York',
178193
});
179194

180195
// 16 methods: getServices, getAvailability, getSlots, book, cancel,
181196
// reschedule, ...
182197
```
183198

199+
`schemas` is the preferred boundary for reusable adopters. It lets the
200+
homegrown backend use whichever Drizzle schema package owns business and
201+
booking tables. Existing adopters may still omit it if they intentionally use
202+
the legacy optional `@tummycrypt/tinyland-auth-pg` schema exports.
203+
184204
### AcuityAdapter
185205

186206
API-based adapter for Acuity Scheduling (requires Powerhouse plan).

docs/generated/package-surface.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Generated from `package.json` and the current `src/` tree.
1111
| Field | Value |
1212
| --- | --- |
1313
| Package | `@tummycrypt/scheduling-kit` |
14-
| Version | `0.7.7` |
14+
| Version | `0.7.8` |
1515
| Description | Backend-agnostic scheduling components with alternative payment support |
1616
| Node range | `>=20 <25` |
1717
| Repository | https://github.com/Jesssullivan/scheduling-kit.git |

docs/generated/release-metadata.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ Generated from `package.json`, `MODULE.bazel`, `BUILD.bazel`,
1111

1212
| Surface | Value |
1313
| --- | --- |
14-
| package.json version | `0.7.7` |
15-
| MODULE.bazel version | `0.7.7` |
16-
| BUILD.bazel npm_package version | `0.7.7` |
14+
| package.json version | `0.7.8` |
15+
| MODULE.bazel version | `0.7.8` |
16+
| BUILD.bazel npm_package version | `0.7.8` |
1717
| BUILD.bazel package name | `@tummycrypt/scheduling-kit` |
1818
| .bazelversion | `8.1.1` |
1919
| pnpm packageManager | `pnpm@9.15.9` |

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tummycrypt/scheduling-kit",
3-
"version": "0.7.7",
3+
"version": "0.7.8",
44
"description": "Backend-agnostic scheduling components with alternative payment support",
55
"type": "module",
66
"packageManager": "pnpm@9.15.9",
@@ -87,11 +87,15 @@
8787
"traces:refresh": "npx tsx scripts/refresh-traces.ts"
8888
},
8989
"peerDependencies": {
90+
"@tummycrypt/tinyland-auth-pg": "^0.2.1",
9091
"@skeletonlabs/skeleton": "^4.0.0",
9192
"@skeletonlabs/skeleton-svelte": "^4.0.0",
9293
"svelte": "^5.0.0"
9394
},
9495
"peerDependenciesMeta": {
96+
"@tummycrypt/tinyland-auth-pg": {
97+
"optional": true
98+
},
9599
"@skeletonlabs/skeleton": {
96100
"optional": true
97101
},
@@ -100,7 +104,6 @@
100104
}
101105
},
102106
"dependencies": {
103-
"@tummycrypt/tinyland-auth-pg": "^0.2.1",
104107
"drizzle-orm": "0.39.3",
105108
"effect": "^3.19.14",
106109
"zod": "^4.3.5"
@@ -112,6 +115,7 @@
112115
"@sveltejs/vite-plugin-svelte": "^6.0.0",
113116
"@testing-library/jest-dom": "^6.9.1",
114117
"@testing-library/svelte": "^5.3.1",
118+
"@tummycrypt/tinyland-auth-pg": "^0.2.4",
115119
"@types/node": "^20.0.0",
116120
"@typescript-eslint/parser": "^8.58.2",
117121
"@vitest/coverage-v8": "^4.0.0",

pnpm-lock.yaml

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)