@checkstack/backend-api 0.21.0 → 0.21.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/CHANGELOG.md +18 -0
- package/package.json +8 -8
- package/src/config-versioning.ts +6 -12
- package/src/types.ts +5 -38
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @checkstack/backend-api
|
|
2
2
|
|
|
3
|
+
## 0.21.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 13373ce: Break the publish-time dependency cycle between `@checkstack/backend-api` and `@checkstack/cache-api` / `@checkstack/queue-api`.
|
|
8
|
+
|
|
9
|
+
`cache-api` and `queue-api` only ever used `Logger` and `Migration` from `backend-api` as `import type`, yet declared `@checkstack/backend-api` as a runtime dependency. In the monorepo this is harmless (everything resolves via `workspace:*`), but once published, `bun publish` freezes each `workspace:*` into a concrete pin of the _other_ package's then-current version. Because the dependency is mutual, a consumer installing these packages from the registry must resolve `backend-api -> cache-api -> backend-api -> ...` backward through release history until it reaches ancient versions that shipped raw `workspace:*` ranges and a long-removed `@checkstack/cache-api@0.1.0` pin - which fail to resolve. This surfaced as `bun install` errors (and a missing `checkstack-dev` binary) in freshly scaffolded standalone plugins.
|
|
10
|
+
|
|
11
|
+
`Logger` and `Migration` now live in `@checkstack/common` (a dependency-free leaf package). `@checkstack/backend-api` re-exports both for backward compatibility, so existing `import type { Logger, Migration } from "@checkstack/backend-api"` call sites are unchanged. `cache-api` and `queue-api` now depend on `@checkstack/common` instead of `@checkstack/backend-api`, removing the cycle.
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [13373ce]
|
|
14
|
+
- @checkstack/common@0.14.0
|
|
15
|
+
- @checkstack/cache-api@0.3.10
|
|
16
|
+
- @checkstack/queue-api@0.3.10
|
|
17
|
+
- @checkstack/healthcheck-common@1.5.1
|
|
18
|
+
- @checkstack/signal-common@0.2.7
|
|
19
|
+
- @checkstack/template-engine@0.4.1
|
|
20
|
+
|
|
3
21
|
## 0.21.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@checkstack/backend-api",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.1",
|
|
4
4
|
"license": "Elastic-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
"lint:code": "eslint . --max-warnings 0"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@checkstack/cache-api": "0.3.
|
|
14
|
-
"@checkstack/common": "0.
|
|
15
|
-
"@checkstack/healthcheck-common": "1.
|
|
16
|
-
"@checkstack/queue-api": "0.3.
|
|
17
|
-
"@checkstack/signal-common": "0.2.
|
|
18
|
-
"@checkstack/template-engine": "0.
|
|
13
|
+
"@checkstack/cache-api": "0.3.9",
|
|
14
|
+
"@checkstack/common": "0.13.0",
|
|
15
|
+
"@checkstack/healthcheck-common": "1.5.0",
|
|
16
|
+
"@checkstack/queue-api": "0.3.9",
|
|
17
|
+
"@checkstack/signal-common": "0.2.6",
|
|
18
|
+
"@checkstack/template-engine": "0.4.0",
|
|
19
19
|
"@orpc/client": "^1.14.4",
|
|
20
20
|
"@orpc/contract": "^1.14.4",
|
|
21
21
|
"@orpc/openapi": "^1.14.4",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"zod": "^4.2.1"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@checkstack/scripts": "0.
|
|
30
|
+
"@checkstack/scripts": "0.4.0",
|
|
31
31
|
"@checkstack/tsconfig": "0.0.7",
|
|
32
32
|
"@types/bun": "latest",
|
|
33
33
|
"@types/pg": "^8.20.0",
|
package/src/config-versioning.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { extractErrorMessage } from "@checkstack/common";
|
|
3
|
+
import type { Migration } from "@checkstack/common";
|
|
3
4
|
|
|
4
5
|
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
5
6
|
// Storage Interfaces (simple data shapes for DB/API)
|
|
@@ -34,19 +35,12 @@ export interface VersionedPluginRecord<T = unknown> extends VersionedRecord<T> {
|
|
|
34
35
|
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
35
36
|
|
|
36
37
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
38
|
+
* The canonical `Migration` definition now lives in `@checkstack/common` so
|
|
39
|
+
* that low-level packages (`@checkstack/cache-api`, `@checkstack/queue-api`)
|
|
40
|
+
* can reference it without depending on `backend-api` and creating a
|
|
41
|
+
* publish-time dependency cycle. Re-exported here for backward compatibility.
|
|
39
42
|
*/
|
|
40
|
-
export
|
|
41
|
-
/** Version number migrating from */
|
|
42
|
-
fromVersion: number;
|
|
43
|
-
/** Version number migrating to (must be fromVersion + 1) */
|
|
44
|
-
toVersion: number;
|
|
45
|
-
/** Human-readable description of what this migration does */
|
|
46
|
-
description: string;
|
|
47
|
-
/** Migration function that transforms old data to new format */
|
|
48
|
-
migrate(data: TFrom): TTo | Promise<TTo>;
|
|
49
|
-
}
|
|
43
|
+
export type { Migration } from "@checkstack/common";
|
|
50
44
|
|
|
51
45
|
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
52
46
|
// Migration Chain Validation
|
package/src/types.ts
CHANGED
|
@@ -2,45 +2,12 @@ import { ZodSchema } from "zod";
|
|
|
2
2
|
import { ClientDefinition, InferClient } from "@checkstack/common";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* so the long-standing varargs callsites — `logger.error("…", err)` where `err`
|
|
10
|
-
* is an `Error`, or `logger.info("…", value1, value2)` — keep working unchanged.
|
|
11
|
-
*
|
|
12
|
-
* For NEW code, prefer the structured-metadata shape:
|
|
13
|
-
*
|
|
14
|
-
* logger.info("did something", { userId, durationMs });
|
|
15
|
-
*
|
|
16
|
-
* Winston's `splat` handling treats a single trailing plain object as
|
|
17
|
-
* structured metadata (merged into the log entry), and an `Error` instance as
|
|
18
|
-
* a special-cased error (with stack). Either shape lands in the same vararg
|
|
19
|
-
* slot here, so this signature covers both without overload churn.
|
|
20
|
-
*
|
|
21
|
-
* Auto-injected metadata (when the request flows through
|
|
22
|
-
* `correlationMiddleware`): `{ correlationId, pluginId, userId? }`. Do NOT
|
|
23
|
-
* include secrets in the structured-metadata object — it is forwarded
|
|
24
|
-
* verbatim to the log destination.
|
|
5
|
+
* The canonical `Logger` definition now lives in `@checkstack/common` so that
|
|
6
|
+
* low-level packages (`@checkstack/cache-api`, `@checkstack/queue-api`) can
|
|
7
|
+
* reference it without depending on `backend-api` and creating a publish-time
|
|
8
|
+
* dependency cycle. Re-exported here for backward compatibility.
|
|
25
9
|
*/
|
|
26
|
-
export
|
|
27
|
-
info(message: string, ...args: unknown[]): void;
|
|
28
|
-
error(message: string, ...args: unknown[]): void;
|
|
29
|
-
warn(message: string, ...args: unknown[]): void;
|
|
30
|
-
debug(message: string, ...args: unknown[]): void;
|
|
31
|
-
/**
|
|
32
|
-
* Returns a derived logger with the supplied metadata bound to every
|
|
33
|
-
* subsequent log entry. Used by `correlationMiddleware` to attach
|
|
34
|
-
* `{ correlationId, pluginId, userId? }`, and available to handlers that
|
|
35
|
-
* want a tighter scope (e.g. `ctx.logger.child({ jobId })`).
|
|
36
|
-
*
|
|
37
|
-
* Optional only to keep minimal test-mock logger objects compatible with
|
|
38
|
-
* this interface — production loggers (Winston via `core/backend`) always
|
|
39
|
-
* implement it. Call sites that rely on metadata binding should branch
|
|
40
|
-
* on presence and fall back to the base logger when it is not available.
|
|
41
|
-
*/
|
|
42
|
-
child?(meta: Record<string, unknown>): Logger;
|
|
43
|
-
}
|
|
10
|
+
export type { Logger } from "@checkstack/common";
|
|
44
11
|
|
|
45
12
|
export interface Fetch {
|
|
46
13
|
fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
|