fix(auth-local): store documentation and bundling #58

Merged
crapougnax merged 5 commits from fix/56-auth-local-store-docs into develop 2026-11-16 11:16:24 +00:00
Member

Refs #56

Two fixes on @quatrain/auth-local, which is not on npm yet.

1. JSDoc of the stores

#57 was merged a few minutes before its last commit was pushed, so develop holds the package without the JSDoc of its two stores. The JSDoc quality gate fails there (run 91, 26 missing entries) and the publish job is skipped. One documentation line per store method, no code change.

2. The package could not be bundled

PostgresLocalAuthStore computed the path of sql/auth_local.sql from __dirname when the module loaded. Bundled into an ES module application (Vite SSR), __dirname does not exist and importing the package failed with ReferenceError: __dirname is not defined in ES module scope. Found while wiring the package into an application.

The DDL is now the exported constant AUTH_LOCAL_SCHEMA_SQL; sql/auth_local.sql stays shipped for migrations and a test keeps the two identical.

@quatrain/queue-postgres reads its DDL the same way and has the same defect; it is left for its own issue.

Tests

36 tests, all passing locally, PostgreSQL included.

🤖 Generated with Claude Code

Refs #56 Two fixes on `@quatrain/auth-local`, which is not on npm yet. ## 1. JSDoc of the stores #57 was merged a few minutes before its last commit was pushed, so `develop` holds the package without the JSDoc of its two stores. The JSDoc quality gate fails there (run 91, 26 missing entries) and the publish job is skipped. One documentation line per store method, no code change. ## 2. The package could not be bundled `PostgresLocalAuthStore` computed the path of `sql/auth_local.sql` from `__dirname` when the module loaded. Bundled into an ES module application (Vite SSR), `__dirname` does not exist and importing the package failed with `ReferenceError: __dirname is not defined in ES module scope`. Found while wiring the package into an application. The DDL is now the exported constant `AUTH_LOCAL_SCHEMA_SQL`; `sql/auth_local.sql` stays shipped for migrations and a test keeps the two identical. `@quatrain/queue-postgres` reads its DDL the same way and has the same defect; it is left for its own issue. ## Tests 36 tests, all passing locally, PostgreSQL included. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
docs(auth-local): document the store methods (#56)
All checks were successful
Quatrain Core CI / Monorepo Build, Tests & Quality Audit (push) Successful in 3m24s
Quatrain Core CI / Publish Changed Packages to npm (push) Has been skipped
529aa51f66
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Merge remote-tracking branch 'sovereign/develop' into fix/56-auth-local-store-docs
All checks were successful
Quatrain Core CI / Monorepo Build, Tests & Quality Audit (pull_request) Successful in 3m20s
Quatrain Core CI / Publish Changed Packages to npm (pull_request) Has been skipped
9928fe63f7
claude-bot changed title from docs(auth-local): document the store methods to fix(auth-local): store documentation and bundling 2026-11-16 10:53:43 +00:00
fix(auth-local): keep the DDL in the code so the package can be bundled (#56)
Some checks failed
Quatrain Core CI / Monorepo Build, Tests & Quality Audit (pull_request) Has started running
Quatrain Core CI / Publish Changed Packages to npm (pull_request) Has been cancelled
9083e9ac06
PostgresLocalAuthStore computed the path of sql/auth_local.sql from
__dirname when the module loaded. Bundled into an ES module application
(Vite SSR), __dirname does not exist and importing the package failed.

The DDL is now the constant AUTH_LOCAL_SCHEMA_SQL; the SQL file stays
shipped for migrations, and a test keeps the two identical.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
fix(auth-local): read timestamps and claims whatever the driver type parsers (#56)
Some checks failed
Quatrain Core CI / Monorepo Build, Tests & Quality Audit (pull_request) Has been cancelled
Quatrain Core CI / Publish Changed Packages to npm (pull_request) Has been cancelled
36ef31290b
The type parsers of `pg` are global to the module. An application that
also uses @quatrain/backend-postgres gets timestamps back as strings, and
the store handed them to the adapter as if they were dates: resolving a
session threw `lastSeenAt.getTime is not a function`.

The store now converts timestamp columns itself and parses claims when
they come back as text. The contract suite runs a second time with text
parsers.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
fix(auth-local): read the short time zone offset of PostgreSQL timestamps (#56)
All checks were successful
Quatrain Core CI / Monorepo Build, Tests & Quality Audit (pull_request) Successful in 2m53s
Quatrain Core CI / Publish Changed Packages to npm (pull_request) Has been skipped
b4e923ac10
With the type parsers set by @quatrain/backend-postgres a timestamp comes
back as `2026-01-01T10:00:00.123+00`, an offset `Date` does not read.
The store expands it, and the test now sets the parser exactly as the
backend adapter does.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
crapougnax merged commit 2f93394d31 into develop 2026-11-16 11:16:24 +00:00
crapougnax deleted branch fix/56-auth-local-store-docs 2026-11-16 11:16:24 +00:00
Sign in to join this conversation.
No description provided.