@cubicecho/server-kit 0.6.0 → 0.6.2

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.
@@ -1,6 +1,6 @@
1
1
  # Database boot
2
2
 
3
- `@cubicecho/server-kit/db` makes a Postgres database ready to migrate: it waits for the server, creates the database when it is missing, and refuses a server the app cannot run on.
3
+ `@cubicecho/server-kit/db` makes a Postgres database ready to migrate: it waits for the server, creates the database when it is missing, and refuses a server the app cannot run on. It needs `postgres`, an optional peer.
4
4
 
5
5
  ```ts
6
6
  import { connectionOptions, DatabaseBootError, prepareDatabase } from '@cubicecho/server-kit/db';
@@ -39,7 +39,7 @@ const auth = betterAuth({
39
39
  - `deliver: undefined` is an instance that cannot email. `sendsMagicLinks(auth)` says which it is.
40
40
  - `paths` moves the app's `login`, `verify` and `signedIn` pages.
41
41
  - An option after the spread replaces the preset's whole value, so `session: { … }` has to repeat `expiresIn`.
42
- - `@better-auth/sso` and `better-auth` are peers: install both in the server.
42
+ - `@better-auth/sso` (an optional peer, which `/auth` needs) and `better-auth` are peers: install both in the server.
43
43
 
44
44
  ## Rate limiting sign-in
45
45
 
package/dist/db/ssl.js CHANGED
@@ -65,8 +65,8 @@ export function isPrivateHost(hostname) {
65
65
  const [firstOctet, secondOctet] = ipv4.slice(1).map(Number);
66
66
  return PRIVATE_IPV4.some((range) => range.first === firstOctet && secondOctet >= range.low && secondOctet <= range.high);
67
67
  }
68
- // Loopback, unique-local fc00::/7, then link-local fe80::/10.
69
- return hostname === '::1' || /^f[cd]/.test(hostname) || /^fe[89ab]/.test(hostname);
68
+ // Loopback, unique-local fc00::/7, then link-local fe80::/10. Only an address has a colon: fd.example.com is a name.
69
+ return hostname.includes(':') && /^(::1$|f[cd]|fe[89ab])/.test(hostname);
70
70
  }
71
71
  /**
72
72
  * Whether to insist on TLS for a connection string.
package/llms.txt CHANGED
@@ -4,11 +4,11 @@
4
4
 
5
5
  Agent-facing docs for @cubicecho/server-kit: one task or concept per page, then what each package.json "exports" entry exports. Generated from _agents/docs/ and the doc comments in src/ by @cubicecho/agent-docs; edit those, not this file.
6
6
 
7
- Requires Node >=22. Peer dependencies: `@better-auth/sso` >=1.7.28 <1.8.0, `@cubicecho/graphql-mcp` ^3.1.0 (optional), `@electric-sql/pglite` ^0.5.0 (optional), `better-auth` >=1.7.28 <1.8.0, `drizzle-orm` 1.0.0-rc.5, `express` ^5.0.0, `graphql` ^16.0.0, `graphql-yoga` ^6.0.0, `postgres` ^3.4.0, `vitest` ^5.0.0 (optional).
7
+ Requires Node >=22. Peer dependencies: `@better-auth/sso` >=1.7.28 <1.8.0 (optional), `@cubicecho/graphql-mcp` ^3.1.0 (optional), `@electric-sql/pglite` ^0.5.0 (optional), `better-auth` >=1.7.28 <1.8.0, `drizzle-orm` 1.0.0-rc.5, `express` ^5.0.0, `graphql` ^16.0.0, `graphql-yoga` ^6.0.0, `postgres` ^3.4.0 (optional), `vitest` ^5.0.0 (optional).
8
8
 
9
9
  ## Docs
10
10
 
11
- - [Database boot](_agents/docs/01-database.md): `@cubicecho/server-kit/db` makes a Postgres database ready to migrate: it waits for the server, creates the database when it is missing, and refuses a server the app cannot run on.
11
+ - [Database boot](_agents/docs/01-database.md): `@cubicecho/server-kit/db` makes a Postgres database ready to migrate: it waits for the server, creates the database when it is missing, and refuses a server the app cannot run on. It needs `postgres`, an optional peer.
12
12
  - [Columns](_agents/docs/02-columns.md): `@cubicecho/server-kit/columns` has the Drizzle columns that keep a table to the conventions: a UUIDv7 id, moments with a time zone, and a table limited to one row.
13
13
  - [Test checks](_agents/docs/03-testing.md): `@cubicecho/server-kit/testing` registers Vitest tests that hold an app to the backend standard: its tables, and the Postgres it runs.
14
14
  - [Auth preset](_agents/docs/04-auth.md): `@cubicecho/server-kit/auth` has the better-auth options and sign-in plugins every server shares: sessions in Postgres, bearer tokens, emailed links, and OIDC with pairing. The app still calls `betterAuth`, so it adds its own plugins and hooks and keeps exact types.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cubicecho/server-kit",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "The server code every cubicecho GraphQL backend shares: database boot, id columns and the checks that keep a schema to the standard.",
5
5
  "license": "MIT",
6
6
  "author": "Benjamin Van Treese",
@@ -83,12 +83,18 @@
83
83
  "vitest": "^5.0.0"
84
84
  },
85
85
  "peerDependenciesMeta": {
86
+ "@better-auth/sso": {
87
+ "optional": true
88
+ },
86
89
  "@cubicecho/graphql-mcp": {
87
90
  "optional": true
88
91
  },
89
92
  "@electric-sql/pglite": {
90
93
  "optional": true
91
94
  },
95
+ "postgres": {
96
+ "optional": true
97
+ },
92
98
  "vitest": {
93
99
  "optional": true
94
100
  }