@fitzzero/quickdraw-core 3.8.0 → 3.9.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/README.md +40 -6
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/index.js.map +1 -1
- package/oxlint.base.jsonc +123 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -352,18 +352,52 @@ import {
|
|
|
352
352
|
import { createMockSocket, createTestWrapper } from "@fitzzero/quickdraw-core/client/testing";
|
|
353
353
|
```
|
|
354
354
|
|
|
355
|
+
## Linting
|
|
356
|
+
|
|
357
|
+
The package ships a shared oxlint base config, `oxlint.base.jsonc` — the
|
|
358
|
+
framework's lint best practices (strict type-safety, complexity budgets, and
|
|
359
|
+
the `quickdraw` plugin rules pre-wired for `services/**` and client code).
|
|
360
|
+
Extend it from your root `.oxlintrc.json` so best practices update with the
|
|
361
|
+
package:
|
|
362
|
+
|
|
363
|
+
```jsonc
|
|
364
|
+
{
|
|
365
|
+
"extends": ["./node_modules/@fitzzero/quickdraw-core/oxlint.base.jsonc"],
|
|
366
|
+
// plugins are NOT purely inherited: omitting this array unions oxlint's
|
|
367
|
+
// default plugin set into the merge — mirror the base's list.
|
|
368
|
+
"plugins": ["typescript", "import", "react", "nextjs", "jsx_a11y"],
|
|
369
|
+
// ignorePatterns, env, globals, and settings are not inherited — declare here.
|
|
370
|
+
"ignorePatterns": ["**/dist/**", "**/node_modules/**"],
|
|
371
|
+
"overrides": [
|
|
372
|
+
// Project-specific relaxations win over the base (overrides concatenate,
|
|
373
|
+
// consumer last), e.g. allow specific cross-service mutations:
|
|
374
|
+
{
|
|
375
|
+
"files": ["**/services/**/*.ts"],
|
|
376
|
+
"rules": {
|
|
377
|
+
"quickdraw/no-cross-service-mutations": [
|
|
378
|
+
"error",
|
|
379
|
+
{ "allowedModels": { "chat": ["chatMember"] } },
|
|
380
|
+
],
|
|
381
|
+
},
|
|
382
|
+
},
|
|
383
|
+
],
|
|
384
|
+
}
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
The base config also loads `./eslint-plugin` (the `quickdraw` rules) via
|
|
388
|
+
`jsPlugins` — no separate wiring needed. The `./eslint-config` export (ESLint
|
|
389
|
+
flat config) is legacy; prefer the oxlint base.
|
|
390
|
+
|
|
355
391
|
## Local Development
|
|
356
392
|
|
|
357
393
|
This package is developed alongside [quickdraw-chat](https://github.com/fitzzero/quickdraw-chat), a reference implementation.
|
|
358
394
|
|
|
359
|
-
|
|
395
|
+
quickdraw-chat consumes the published npm package. For local iteration
|
|
396
|
+
against a checkout, use `bun link` (or point lint `extends` at the sibling
|
|
397
|
+
path), and always re-verify against a published version before releasing:
|
|
360
398
|
|
|
361
399
|
```bash
|
|
362
|
-
#
|
|
363
|
-
"@fitzzero/quickdraw-core": "link:../../../quickdraw"
|
|
364
|
-
|
|
365
|
-
# Changes to quickdraw-core are instantly available after rebuild
|
|
366
|
-
pnpm build # or pnpm dev for watch mode
|
|
400
|
+
bun run build # or bun run dev for watch mode
|
|
367
401
|
```
|
|
368
402
|
|
|
369
403
|
## Type Definitions
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1092,7 +1092,7 @@ interface CookieResponse {
|
|
|
1092
1092
|
interface SessionCookieOptions {
|
|
1093
1093
|
/** Cookie name. Default: "session". */
|
|
1094
1094
|
cookieName?: string;
|
|
1095
|
-
/** Lifetime in ms. Default:
|
|
1095
|
+
/** Lifetime in ms. Default: 7 days (matches the default JWT expiry). */
|
|
1096
1096
|
maxAgeMs?: number;
|
|
1097
1097
|
/** Cookie domain. Defaults to process.env.COOKIE_DOMAIN. */
|
|
1098
1098
|
domain?: string;
|
package/dist/server/index.js
CHANGED
|
@@ -2145,7 +2145,7 @@ function registerMockOAuthProvider(router, options) {
|
|
|
2145
2145
|
|
|
2146
2146
|
// src/server/auth/sessionCookie.ts
|
|
2147
2147
|
var SESSION_COOKIE = "session";
|
|
2148
|
-
var DEFAULT_MAX_AGE_MS =
|
|
2148
|
+
var DEFAULT_MAX_AGE_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
2149
2149
|
function cookieOptions(options) {
|
|
2150
2150
|
const isProd = process.env.NODE_ENV === "production";
|
|
2151
2151
|
const domain = options.domain ?? process.env.COOKIE_DOMAIN;
|