@workerstack/clients 1.0.0-rc.26 → 1.0.0-rc.27
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 +43 -43
- package/bin/{honey-clients.js → clients.js} +12 -12
- package/dist/cli.d.ts +3 -3
- package/dist/cli.js +14 -14
- package/dist/emit/cli/discovery.js +1 -1
- package/dist/emit/cli/install.js +2 -2
- package/dist/emit/cli/layout.js +1 -1
- package/dist/emit/cli/module.js +1 -1
- package/dist/emit/cli/release.js +1 -1
- package/dist/emit/csharp/errors.js +1 -1
- package/dist/emit/csharp/sdk-client.js +1 -1
- package/dist/emit/csharp/sdk-csproj.d.ts +1 -1
- package/dist/emit/csharp/sdk-csproj.js +2 -2
- package/dist/emit/csharp/sdk.d.ts +1 -1
- package/dist/emit/csharp/sdk.js +2 -2
- package/dist/emit/csharp/transport.js +2 -2
- package/dist/emit/csharp/types-record.d.ts +1 -1
- package/dist/emit/go/sdk-client.js +1 -1
- package/dist/emit/go/sdk.js +1 -1
- package/dist/emit/java/sdk-errors.js +5 -5
- package/dist/emit/java/sdk-op.d.ts +1 -1
- package/dist/emit/java/sdk.js +3 -3
- package/dist/emit/mcp/files.d.ts +1 -1
- package/dist/emit/mcp/mounted.js +2 -2
- package/dist/emit/mcp/runtime.js +1 -1
- package/dist/emit/mcp/server.js +1 -1
- package/dist/emit/python/errors.js +1 -1
- package/dist/emit/python/sdk-client.js +2 -2
- package/dist/emit/python/sdk-pyproject.js +4 -4
- package/dist/emit/python/sdk.d.ts +1 -1
- package/dist/emit/python/sdk.js +11 -11
- package/dist/emit/python/transport.js +1 -1
- package/dist/emit/rust/errors.js +2 -2
- package/dist/emit/rust/sdk-cargo.js +3 -3
- package/dist/emit/rust/sdk.d.ts +1 -1
- package/dist/emit/rust/sdk.js +2 -2
- package/dist/emit/shared/format.d.ts +1 -1
- package/dist/emit/shared/metadata.d.ts +1 -1
- package/dist/emit/shared/status-keys.d.ts +1 -1
- package/dist/emit/shared/status-keys.js +1 -1
- package/dist/emit/ts/app-client.js +2 -2
- package/dist/emit/ts/route-tree.js +1 -1
- package/dist/emit/ts/sdk-types-preamble.js +16 -16
- package/dist/emit/ts/sdk-types.js +6 -6
- package/dist/emit/ts/tanstack-query.js +5 -5
- package/dist/emit/ts/type-gen.d.ts +2 -2
- package/dist/emit/ts/type-gen.js +16 -16
- package/dist/extract/extract.js +3 -3
- package/dist/extract/serialize.js +1 -1
- package/dist/gen/args.js +3 -3
- package/dist/gen/formatters.d.ts +6 -6
- package/dist/gen/formatters.js +7 -7
- package/dist/gen/process.d.ts +3 -3
- package/dist/gen/process.js +7 -7
- package/dist/gen/targets.d.ts +3 -3
- package/dist/gen/targets.js +3 -3
- package/dist/gen/write.d.ts +1 -1
- package/dist/gen/write.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/ir/load.js +10 -10
- package/dist/ir/model.d.ts +4 -4
- package/dist/ir/sdk-model.d.ts +1 -1
- package/dist/ir/sdk-model.js +1 -1
- package/dist/ir/slots.d.ts +3 -3
- package/dist/ir/slots.js +10 -10
- package/dist/release/bootstrap.js +1 -1
- package/dist/release/bump-command.js +1 -1
- package/dist/release/cli.d.ts +4 -4
- package/dist/release/cli.js +6 -6
- package/dist/release/context.d.ts +1 -1
- package/dist/release/context.js +1 -1
- package/dist/release/digest.d.ts +1 -1
- package/dist/release/digest.js +2 -2
- package/dist/release/index.d.ts +1 -1
- package/dist/release/load.js +1 -1
- package/dist/release/manifest.js +1 -1
- package/dist/release/registries.js +3 -3
- package/dist/release/release-workflow.js +1 -1
- package/dist/release/spec-gate.d.ts +2 -2
- package/dist/release/spec-gate.js +2 -2
- package/dist/release/sync-command.d.ts +1 -1
- package/dist/release/sync-command.js +1 -1
- package/dist/release/sync-tree.js +1 -1
- package/dist/release/types.d.ts +6 -6
- package/dist/runtime/cli/body.go +1 -1
- package/dist/runtime/cli/config.go +3 -3
- package/dist/runtime/cli/discovery.go +1 -1
- package/dist/runtime/cli/format.go +1 -1
- package/dist/runtime/cli/log.go +1 -1
- package/dist/runtime/cli/output.go +1 -1
- package/dist/runtime/cli/params.go +1 -1
- package/dist/runtime/cli/run.go +1 -1
- package/dist/runtime/cli/socket.go +1 -1
- package/dist/runtime/cli/stream.go +1 -1
- package/dist/runtime/cli/target.go +1 -1
- package/dist/runtime/csharp/Adapters.cs +2 -2
- package/dist/runtime/csharp/Auth.cs +2 -2
- package/dist/runtime/csharp/Body.cs +3 -3
- package/dist/runtime/csharp/Config.cs +2 -2
- package/dist/runtime/csharp/Envelope.cs +3 -3
- package/dist/runtime/csharp/Errors.cs +10 -10
- package/dist/runtime/csharp/Events.cs +2 -2
- package/dist/runtime/csharp/Exchange.cs +4 -4
- package/dist/runtime/csharp/Handler.cs +3 -3
- package/dist/runtime/csharp/Hooks.cs +3 -3
- package/dist/runtime/csharp/Invalidation.cs +2 -2
- package/dist/runtime/csharp/Json.cs +2 -2
- package/dist/runtime/csharp/Log.cs +2 -2
- package/dist/runtime/csharp/Operation.cs +2 -2
- package/dist/runtime/csharp/Path.cs +2 -2
- package/dist/runtime/csharp/Query.cs +2 -2
- package/dist/runtime/csharp/Realtime.cs +2 -2
- package/dist/runtime/csharp/RealtimeLoop.cs +3 -3
- package/dist/runtime/csharp/Redirect.cs +2 -2
- package/dist/runtime/csharp/Result.cs +2 -2
- package/dist/runtime/csharp/Sse.cs +2 -2
- package/dist/runtime/csharp/Stale.cs +2 -2
- package/dist/runtime/csharp/Transport.cs +2 -2
- package/dist/runtime/csharp/TransportLongPoll.cs +2 -2
- package/dist/runtime/csharp/TransportSse.cs +2 -2
- package/dist/runtime/csharp/TransportWs.cs +2 -2
- package/dist/runtime/csharp/Wire.cs +2 -2
- package/dist/runtime/csharp/Ws.cs +2 -2
- package/dist/runtime/csharp/WsDial.cs +2 -2
- package/dist/runtime/go/auth.go +1 -1
- package/dist/runtime/go/body.go +2 -2
- package/dist/runtime/go/config.go +1 -1
- package/dist/runtime/go/errors.go +5 -5
- package/dist/runtime/go/export.go +10 -10
- package/dist/runtime/go/hooks.go +2 -2
- package/dist/runtime/go/invalidation.go +2 -2
- package/dist/runtime/go/log.go +1 -1
- package/dist/runtime/go/nullable.go +1 -1
- package/dist/runtime/go/options.go +1 -1
- package/dist/runtime/go/path.go +1 -1
- package/dist/runtime/go/query.go +2 -2
- package/dist/runtime/go/realtime.go +4 -4
- package/dist/runtime/go/realtime_loop.go +1 -1
- package/dist/runtime/go/redirect.go +2 -2
- package/dist/runtime/go/request.go +9 -9
- package/dist/runtime/go/result.go +2 -2
- package/dist/runtime/go/sse.go +3 -3
- package/dist/runtime/go/stale.go +1 -1
- package/dist/runtime/go/stream.go +2 -2
- package/dist/runtime/go/transport.go +2 -2
- package/dist/runtime/go/transport_longpoll.go +1 -1
- package/dist/runtime/go/transport_sse.go +2 -2
- package/dist/runtime/go/ws.go +1 -1
- package/dist/runtime/java/Answer.java +2 -2
- package/dist/runtime/java/ApiException.java +2 -2
- package/dist/runtime/java/BinaryBody.java +2 -2
- package/dist/runtime/java/Body.java +4 -4
- package/dist/runtime/java/Call.java +2 -2
- package/dist/runtime/java/CallLog.java +2 -2
- package/dist/runtime/java/ClientConfig.java +2 -2
- package/dist/runtime/java/ConnectionState.java +2 -2
- package/dist/runtime/java/Credential.java +2 -2
- package/dist/runtime/java/Deadline.java +2 -2
- package/dist/runtime/java/Decode.java +2 -2
- package/dist/runtime/java/Envelope.java +2 -2
- package/dist/runtime/java/ErrorEnvelope.java +3 -3
- package/dist/runtime/java/EventStream.java +2 -2
- package/dist/runtime/java/Exchange.java +2 -2
- package/dist/runtime/java/FilePart.java +2 -2
- package/dist/runtime/java/Flight.java +3 -3
- package/dist/runtime/java/Hooks.java +3 -3
- package/dist/runtime/java/Hops.java +2 -2
- package/dist/runtime/java/{HoneyException.java → HttpException.java} +4 -4
- package/dist/runtime/java/InvalidationConfig.java +2 -2
- package/dist/runtime/java/Json.java +3 -3
- package/dist/runtime/java/Keepalive.java +2 -2
- package/dist/runtime/java/LogEntry.java +2 -2
- package/dist/runtime/java/LongPollAdapter.java +2 -2
- package/dist/runtime/java/Operation.java +2 -2
- package/dist/runtime/java/Opt.java +2 -2
- package/dist/runtime/java/Pump.java +2 -2
- package/dist/runtime/java/RawResponse.java +2 -2
- package/dist/runtime/java/Realtime.java +2 -2
- package/dist/runtime/java/RealtimeLoop.java +4 -4
- package/dist/runtime/java/RedirectPolicy.java +2 -2
- package/dist/runtime/java/Redirects.java +2 -2
- package/dist/runtime/java/RequestContext.java +2 -2
- package/dist/runtime/java/RequestHook.java +2 -2
- package/dist/runtime/java/RequestOptions.java +2 -2
- package/dist/runtime/java/ResponseContext.java +2 -2
- package/dist/runtime/java/ResponseHook.java +2 -2
- package/dist/runtime/java/Result.java +2 -2
- package/dist/runtime/java/ResumableConnection.java +2 -2
- package/dist/runtime/java/SdkException.java +3 -3
- package/dist/runtime/java/Socket.java +2 -2
- package/dist/runtime/java/Sse.java +2 -2
- package/dist/runtime/java/SseAdapter.java +2 -2
- package/dist/runtime/java/SseEvent.java +2 -2
- package/dist/runtime/java/StaleMeta.java +2 -2
- package/dist/runtime/java/StaleTracker.java +2 -2
- package/dist/runtime/java/Transport.java +2 -2
- package/dist/runtime/java/TransportAdapter.java +2 -2
- package/dist/runtime/java/TransportConnection.java +2 -2
- package/dist/runtime/java/TransportKind.java +2 -2
- package/dist/runtime/java/TransportMessage.java +2 -2
- package/dist/runtime/java/TransportOptions.java +2 -2
- package/dist/runtime/java/TypedWebSocket.java +2 -2
- package/dist/runtime/java/UrlPath.java +2 -2
- package/dist/runtime/java/UrlQuery.java +2 -2
- package/dist/runtime/java/WsAdapter.java +2 -2
- package/dist/runtime/java/WsClose.java +2 -2
- package/dist/runtime/java/WsDial.java +2 -2
- package/dist/runtime/java/WsMessage.java +2 -2
- package/dist/runtime/mcp/call.ts +3 -3
- package/dist/runtime/mcp/result.ts +2 -2
- package/dist/runtime/python/__init__.py +1 -1
- package/dist/runtime/python/auth.py +1 -1
- package/dist/runtime/python/body.py +1 -1
- package/dist/runtime/python/config.py +1 -1
- package/dist/runtime/python/errors.py +11 -11
- package/dist/runtime/python/events.py +4 -4
- package/dist/runtime/python/exchange.py +1 -1
- package/dist/runtime/python/hooks.py +4 -4
- package/dist/runtime/python/invalidation.py +1 -1
- package/dist/runtime/python/log.py +1 -1
- package/dist/runtime/python/operation.py +1 -1
- package/dist/runtime/python/path.py +1 -1
- package/dist/runtime/python/query.py +1 -1
- package/dist/runtime/python/realtime.py +5 -5
- package/dist/runtime/python/redirect.py +1 -1
- package/dist/runtime/python/result.py +1 -1
- package/dist/runtime/python/send_async.py +4 -4
- package/dist/runtime/python/send_sync.py +3 -3
- package/dist/runtime/python/sse.py +1 -1
- package/dist/runtime/python/stale.py +1 -1
- package/dist/runtime/python/transport.py +1 -1
- package/dist/runtime/python/transport_longpoll.py +1 -1
- package/dist/runtime/python/transport_sse.py +1 -1
- package/dist/runtime/python/transport_ws.py +1 -1
- package/dist/runtime/python/ws.py +3 -3
- package/dist/runtime/rust/Cargo.lock +1 -1
- package/dist/runtime/rust/answer.rs +1 -1
- package/dist/runtime/rust/auth.rs +1 -1
- package/dist/runtime/rust/body.rs +2 -2
- package/dist/runtime/rust/call.rs +1 -1
- package/dist/runtime/rust/config.rs +1 -1
- package/dist/runtime/rust/envelope.rs +3 -3
- package/dist/runtime/rust/errors.rs +3 -3
- package/dist/runtime/rust/events.rs +1 -1
- package/dist/runtime/rust/exchange.rs +1 -1
- package/dist/runtime/rust/hooks.rs +1 -1
- package/dist/runtime/rust/invalidation.rs +1 -1
- package/dist/runtime/rust/log.rs +1 -1
- package/dist/runtime/rust/nullable.rs +1 -1
- package/dist/runtime/rust/path.rs +1 -1
- package/dist/runtime/rust/query.rs +1 -1
- package/dist/runtime/rust/realtime.rs +1 -1
- package/dist/runtime/rust/realtime_loop.rs +1 -1
- package/dist/runtime/rust/redirect.rs +1 -1
- package/dist/runtime/rust/request.rs +1 -1
- package/dist/runtime/rust/result.rs +1 -1
- package/dist/runtime/rust/sse.rs +1 -1
- package/dist/runtime/rust/stale.rs +1 -1
- package/dist/runtime/rust/transport.rs +1 -1
- package/dist/runtime/rust/transport_longpoll.rs +1 -1
- package/dist/runtime/rust/transport_sse.rs +1 -1
- package/dist/runtime/rust/transport_ws.rs +1 -1
- package/dist/runtime/rust/ws.rs +1 -1
- package/dist/runtime/ts/app-types.ts +5 -5
- package/dist/runtime/ts/app.ts +5 -5
- package/dist/runtime/ts/http.ts +3 -3
- package/dist/runtime/ts/path.ts +1 -1
- package/dist/runtime/ts/request.ts +1 -1
- package/dist/runtime/ts/sdk.ts +1 -1
- package/package.json +5 -5
|
@@ -161,7 +161,7 @@ async function record(release, { decision, dir, now, observed, pkg }, versionFil
|
|
|
161
161
|
export async function runBump(release, major, ctx) {
|
|
162
162
|
regenerate(release, ctx.env);
|
|
163
163
|
const releasing = (await plan(release, major, ctx.env)).filter((planned) => planned.decision.kind !== "none");
|
|
164
|
-
const generated = releasing.filter(({ observed, pkg, previous }) => pkg.
|
|
164
|
+
const generated = releasing.filter(({ observed, pkg, previous }) => pkg.clients !== undefined && observed.output !== previous?.output);
|
|
165
165
|
if (generated.length > 0) {
|
|
166
166
|
const gate = await checkDeployedSpec(release.spec, ctx.fetch);
|
|
167
167
|
if (gate.status === "drift") {
|
package/dist/release/cli.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `
|
|
2
|
+
* `clients release bump|sync|bootstrap|codegen|toolchains --config <path>`: cut a product's versions, mirror its
|
|
3
3
|
* packages into their public repos, and make the first push to a new one, all from the product's `release.config.ts`.
|
|
4
4
|
* `codegen` and `toolchains` serve the release workflows: what to install before codegen, and codegen run alone.
|
|
5
5
|
*/
|
|
6
6
|
import type { Io } from "../cli.ts";
|
|
7
7
|
import { type LoadReleaseOptions } from "./load.ts";
|
|
8
|
-
/** What `
|
|
9
|
-
export declare const USAGE = "usage:
|
|
8
|
+
/** What `clients release` prints when it is given no command, or one it does not know. */
|
|
9
|
+
export declare const USAGE = "usage: clients release <command> --config <path> [options]\n\n bump --config <path> [--major]\n regenerate, then release each package whose output or hand files changed: any API change is a minor,\n --major makes each release a major\n sync --config <path> [--only <names>] [--dry-run] [--validate-only]\n mirror each package into its public repo (release sync --help says more)\n bootstrap --config <path> (--all | --only <names>) [--force-bootstrap]\n the first push to an empty public repo, or over the stub a new one starts with\n codegen --config <path>\n run the config's codegen from the repo root, as bump does before it decides\n toolchains --config <path>\n print the config's toolchains, one per line: the system.config.ts names its codegen needs\n";
|
|
10
10
|
/** What a release run reads beside its arguments; each defaults to the running process's own. */
|
|
11
11
|
export type ReleaseOptions = {
|
|
12
12
|
/** The environment: `GH_TOKEN`, and what codegen and Go run with. */
|
|
@@ -17,7 +17,7 @@ export type ReleaseOptions = {
|
|
|
17
17
|
readonly load?: LoadReleaseOptions;
|
|
18
18
|
};
|
|
19
19
|
/**
|
|
20
|
-
* Runs `
|
|
20
|
+
* Runs `clients release <argv>`: the exit code it ends with. A usage mistake is one line naming the command; any
|
|
21
21
|
* other failure is its message, never a stack.
|
|
22
22
|
*/
|
|
23
23
|
export declare function release(argv: readonly string[], io: Io, options?: ReleaseOptions): Promise<number>;
|
package/dist/release/cli.js
CHANGED
|
@@ -12,8 +12,8 @@ const CODEGEN_USAGE = `codegen --config <path>
|
|
|
12
12
|
const TOOLCHAINS_USAGE = `toolchains --config <path>
|
|
13
13
|
print the config's toolchains, one per line: the system.config.ts names its codegen needs
|
|
14
14
|
`;
|
|
15
|
-
/** What `
|
|
16
|
-
export const USAGE = `usage:
|
|
15
|
+
/** What `clients release` prints when it is given no command, or one it does not know. */
|
|
16
|
+
export const USAGE = `usage: clients release <command> --config <path> [options]
|
|
17
17
|
|
|
18
18
|
bump --config <path> [--major]
|
|
19
19
|
regenerate, then release each package whose output or hand files changed: any API change is a minor,
|
|
@@ -34,7 +34,7 @@ async function bump(argv, ctx) {
|
|
|
34
34
|
async function codegen(argv, ctx) {
|
|
35
35
|
const parsed = parseConfigOnly(argv);
|
|
36
36
|
if (parsed.help) {
|
|
37
|
-
ctx.out(`usage:
|
|
37
|
+
ctx.out(`usage: clients release ${CODEGEN_USAGE}`);
|
|
38
38
|
return 0;
|
|
39
39
|
}
|
|
40
40
|
regenerate(await ctx.load(parsed.config), ctx.env);
|
|
@@ -44,7 +44,7 @@ async function codegen(argv, ctx) {
|
|
|
44
44
|
async function toolchains(argv, ctx) {
|
|
45
45
|
const parsed = parseConfigOnly(argv);
|
|
46
46
|
if (parsed.help) {
|
|
47
|
-
ctx.out(`usage:
|
|
47
|
+
ctx.out(`usage: clients release ${TOOLCHAINS_USAGE}`);
|
|
48
48
|
return 0;
|
|
49
49
|
}
|
|
50
50
|
for (const name of (await ctx.load(parsed.config)).toolchains)
|
|
@@ -54,7 +54,7 @@ async function toolchains(argv, ctx) {
|
|
|
54
54
|
const COMMANDS = { bootstrap, bump, codegen, sync, toolchains };
|
|
55
55
|
const isCommand = (name) => name !== undefined && Object.hasOwn(COMMANDS, name);
|
|
56
56
|
/**
|
|
57
|
-
* Runs `
|
|
57
|
+
* Runs `clients release <argv>`: the exit code it ends with. A usage mistake is one line naming the command; any
|
|
58
58
|
* other failure is its message, never a stack.
|
|
59
59
|
*/
|
|
60
60
|
export async function release(argv, io, options = {}) {
|
|
@@ -79,7 +79,7 @@ export async function release(argv, io, options = {}) {
|
|
|
79
79
|
}
|
|
80
80
|
catch (error) {
|
|
81
81
|
const prefix = error instanceof ReleaseUsageError ? `release ${command}: ` : "";
|
|
82
|
-
io.err(`
|
|
82
|
+
io.err(`clients: ${prefix}${error instanceof Error ? error.message : String(error)}\n`);
|
|
83
83
|
return 1;
|
|
84
84
|
}
|
|
85
85
|
}
|
|
@@ -12,7 +12,7 @@ export type ReleaseContext = {
|
|
|
12
12
|
/** Receives the command's standard error, whole lines ending in a newline. */
|
|
13
13
|
readonly err: (text: string) => void;
|
|
14
14
|
};
|
|
15
|
-
/** A mistake in how a release command was called: printed after `
|
|
15
|
+
/** A mistake in how a release command was called: printed after `clients: release <command>: `. */
|
|
16
16
|
export declare class ReleaseUsageError extends Error {
|
|
17
17
|
/** Always `"ReleaseUsageError"`, so a caught error is told apart from a failure by name. */
|
|
18
18
|
name: string;
|
package/dist/release/context.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** A mistake in how a release command was called: printed after `
|
|
1
|
+
/** A mistake in how a release command was called: printed after `clients: release <command>: `. */
|
|
2
2
|
export class ReleaseUsageError extends Error {
|
|
3
3
|
/** Always `"ReleaseUsageError"`, so a caught error is told apart from a failure by name. */
|
|
4
4
|
name = "ReleaseUsageError";
|
package/dist/release/digest.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PublicPackage } from "./types.ts";
|
|
2
2
|
/**
|
|
3
|
-
* sha256 over
|
|
3
|
+
* sha256 over clients' `.clients-generated.json` file map in the package dir. A hand-kept package (no clients target)
|
|
4
4
|
* publishes its product's spec, so its output is `specSha`.
|
|
5
5
|
*/
|
|
6
6
|
export declare function outputDigest(repoRoot: string, pkg: PublicPackage, specSha: string): string;
|
package/dist/release/digest.js
CHANGED
|
@@ -16,11 +16,11 @@ const BUMP_WRITES = [RELEASE_STATE, CHANGELOG_FILE];
|
|
|
16
16
|
const NORMALIZED_VERSION = "0.0.0";
|
|
17
17
|
const sha256 = (bytes) => createHash("sha256").update(bytes).digest("hex");
|
|
18
18
|
/**
|
|
19
|
-
* sha256 over
|
|
19
|
+
* sha256 over clients' `.clients-generated.json` file map in the package dir. A hand-kept package (no clients target)
|
|
20
20
|
* publishes its product's spec, so its output is `specSha`.
|
|
21
21
|
*/
|
|
22
22
|
export function outputDigest(repoRoot, pkg, specSha) {
|
|
23
|
-
if (pkg.
|
|
23
|
+
if (pkg.clients === undefined)
|
|
24
24
|
return specSha;
|
|
25
25
|
const files = generatedFiles(join(repoRoot, pkg.path));
|
|
26
26
|
if (files === undefined)
|
package/dist/release/index.d.ts
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export { defineRelease, RELEASE_VERSIONS_ENV } from "./manifest.ts";
|
|
6
6
|
export { loadRelease } from "./load.ts";
|
|
7
|
-
export type { Committer,
|
|
7
|
+
export type { Committer, ReleaseRun, ManifestPackage, ManifestPackageInput, PackageMetadata, PublicPackage, Registry, Release, ReleaseManifestInput, SpecSource, } from "./types.ts";
|
package/dist/release/load.js
CHANGED
|
@@ -28,7 +28,7 @@ async function importConfig(path, options) {
|
|
|
28
28
|
const ext = extname(path);
|
|
29
29
|
if (runtime.runtime === "node" && (ext === ".ts" || ext === ".mts") && !stripsTypes(runtime.nodeVersion)) {
|
|
30
30
|
throw new Error(`${path}: a TypeScript release config needs Node >= 22.18 (23.6 on Node 23; this is ${runtime.nodeVersion}); ` +
|
|
31
|
-
"run
|
|
31
|
+
"run clients with Bun, or upgrade Node");
|
|
32
32
|
}
|
|
33
33
|
const importModule = options.importModule ?? ((url) => import(__rewriteRelativeImportExtension(url)));
|
|
34
34
|
/* the sibling entry in this module's own form: index.ts from a checkout's source, index.js from an install */
|
package/dist/release/manifest.js
CHANGED
|
@@ -47,9 +47,9 @@ function manifestPackage() {
|
|
|
47
47
|
return z.object({
|
|
48
48
|
bootstrapExclude: z.array(z.string()).optional(),
|
|
49
49
|
branch: z.string().default("main"),
|
|
50
|
+
clients: z.object({ options: z.record(z.string(), z.string()).default({}), target: z.enum(TARGETS) }).optional(),
|
|
50
51
|
commitMessage: z.string().min(1),
|
|
51
52
|
description: z.string().min(1).max(DESCRIPTION_MAX),
|
|
52
|
-
honey: z.object({ options: z.record(z.string(), z.string()).default({}), target: z.enum(TARGETS) }).optional(),
|
|
53
53
|
metadata: packageMetadata().optional(),
|
|
54
54
|
name: z.string().regex(SLUG),
|
|
55
55
|
registries: z.array(registry()).default([]),
|
|
@@ -23,9 +23,9 @@ export const TOOLS = {
|
|
|
23
23
|
python: "3.12",
|
|
24
24
|
rust: "1.99.0",
|
|
25
25
|
};
|
|
26
|
-
/* The record
|
|
27
|
-
const IDENTITY = ".
|
|
28
|
-
/* `field` of the package
|
|
26
|
+
/* The record clients keeps in every package it generates: the package's name and version on each registry. */
|
|
27
|
+
const IDENTITY = ".clients-generated.json";
|
|
28
|
+
/* `field` of the package clients recorded for `registry`, or a failed step when it recorded none. */
|
|
29
29
|
const identity = (registry, field) => `jq -er '.packages[] | select(.registry == "${registry}") | .${field}' ${IDENTITY}`;
|
|
30
30
|
/* A `key = '…'` line of a Gradle build script. */
|
|
31
31
|
const gradleField = (key, file) => `sed -n "s/^${key} = '\\(.*\\)'$/\\1/p" ${file}`;
|
|
@@ -33,7 +33,7 @@ export function releaseWorkflow(registries) {
|
|
|
33
33
|
` contents: ${registries.some((r) => r.kind === "github") ? "write" : "read"}`,
|
|
34
34
|
...(kinds.some(({ k }) => k.oidc) ? [" id-token: write"] : []),
|
|
35
35
|
].join("\n");
|
|
36
|
-
return `# Generated by
|
|
36
|
+
return `# Generated by clients release sync from release.config.ts; the next sync overwrites any edit.
|
|
37
37
|
# Publishes the tag sync pushes (or the one given to a manual run) to: ${registries.map((r) => r.kind).join(", ")}.
|
|
38
38
|
name: release
|
|
39
39
|
on:
|
|
@@ -20,9 +20,9 @@ export declare function canonicalSha(spec: unknown): string;
|
|
|
20
20
|
export declare function checkDeployedSpec(source: SpecSource, fetchImpl?: typeof fetch): Promise<SpecGate>;
|
|
21
21
|
/** Why `packageName` was refused, and what unblocks it. */
|
|
22
22
|
export declare function describeDrift(packageName: string, gate: SpecDrift): string;
|
|
23
|
-
/**
|
|
23
|
+
/** Backend's manifest in `dir`: each generated path, relative to `dir`, with its sha256; undefined when there is none. */
|
|
24
24
|
export declare function generatedFiles(dir: string): Readonly<Record<string, string>> | undefined;
|
|
25
|
-
/** The paths, relative to `dir`, that
|
|
25
|
+
/** The paths, relative to `dir`, that clients' manifest in `dir` lists as generated; empty when there is none. */
|
|
26
26
|
export declare function generatedPaths(dir: string): ReadonlySet<string>;
|
|
27
27
|
/** `checkDeployedSpec`, fetched once per deployed URL for the life of the returned function: one run, one answer. */
|
|
28
28
|
export declare function memoizedSpecGate(fetchImpl?: typeof fetch): (source: SpecSource) => Promise<SpecGate>;
|
|
@@ -80,7 +80,7 @@ export function describeDrift(packageName, gate) {
|
|
|
80
80
|
"Deploy the API so it serves the committed spec, then re-run the bump; the next sync picks it up.",
|
|
81
81
|
].join("\n");
|
|
82
82
|
}
|
|
83
|
-
/**
|
|
83
|
+
/** Backend's manifest in `dir`: each generated path, relative to `dir`, with its sha256; undefined when there is none. */
|
|
84
84
|
export function generatedFiles(dir) {
|
|
85
85
|
const file = join(dir, MANIFEST);
|
|
86
86
|
if (!existsSync(file))
|
|
@@ -88,7 +88,7 @@ export function generatedFiles(dir) {
|
|
|
88
88
|
const { files } = JSON.parse(readFileSync(file, "utf8"));
|
|
89
89
|
return files ?? {};
|
|
90
90
|
}
|
|
91
|
-
/** The paths, relative to `dir`, that
|
|
91
|
+
/** The paths, relative to `dir`, that clients' manifest in `dir` lists as generated; empty when there is none. */
|
|
92
92
|
export function generatedPaths(dir) {
|
|
93
93
|
return new Set(Object.keys(generatedFiles(dir) ?? {}));
|
|
94
94
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ReleaseContext } from "./context.ts";
|
|
2
2
|
import { type PackageResult } from "./sync.ts";
|
|
3
3
|
/** What `release sync --help` prints. */
|
|
4
|
-
export declare const HELP = "Usage:
|
|
4
|
+
export declare const HELP = "Usage: clients release sync --config <path> [options]\n\nOptions:\n --config <path> The release config (required)\n --only <names> Comma-separated package filter. Accepts short \"name\" (if unique) or \"project/name\"\n --dry-run Log push commands without executing them\n --validate-only Validate the release config and exit 0/1\n --help Show this message\n\nEnv:\n GH_TOKEN GitHub token (required unless --validate-only or --dry-run)\n";
|
|
5
5
|
/** What `release sync` was asked for. */
|
|
6
6
|
export interface CliOptions {
|
|
7
7
|
/** The release config's path; required unless `--help`. */
|
|
@@ -6,7 +6,7 @@ import { memoizedSpecGate } from "./spec-gate.js";
|
|
|
6
6
|
import { syncAll } from "./sync.js";
|
|
7
7
|
const MIN_NAME_WIDTH = 4;
|
|
8
8
|
/** What `release sync --help` prints. */
|
|
9
|
-
export const HELP = `Usage:
|
|
9
|
+
export const HELP = `Usage: clients release sync --config <path> [options]
|
|
10
10
|
|
|
11
11
|
Options:
|
|
12
12
|
--config <path> The release config (required)
|
|
@@ -32,7 +32,7 @@ export async function replaceTreeWithSource(args) {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
async function runRsync(src, dst, excludes) {
|
|
35
|
-
/*
|
|
35
|
+
/* clients' manifest is the source repo's record of what it generated, not part of the package */
|
|
36
36
|
const args = ["-a", "--delete", "--exclude=.git", `--exclude=${MANIFEST}`];
|
|
37
37
|
for (const glob of excludes) {
|
|
38
38
|
args.push(`--exclude=${glob}`);
|
package/dist/release/types.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* that parse a config into them, each checked against these at compile time.
|
|
4
4
|
*/
|
|
5
5
|
import type { Target } from "../gen/targets.ts";
|
|
6
|
-
/** The package metadata
|
|
6
|
+
/** The package metadata clients writes into each generated package's manifest; every field is optional. */
|
|
7
7
|
export type PackageMetadata = {
|
|
8
8
|
/** Authors, as `Name <email>`. */
|
|
9
9
|
readonly authors?: readonly string[];
|
|
@@ -30,11 +30,11 @@ export type PackageMetadata = {
|
|
|
30
30
|
/** The source repository's URL. */
|
|
31
31
|
readonly repository?: string;
|
|
32
32
|
};
|
|
33
|
-
/** How
|
|
34
|
-
export type
|
|
33
|
+
/** How clients generates a package: its target, and that target's options by name. */
|
|
34
|
+
export type ReleaseRun = {
|
|
35
35
|
/** The target's options, as `--<target>-<option>` takes them; none by default. */
|
|
36
36
|
readonly options?: Readonly<Record<string, string>>;
|
|
37
|
-
/** The
|
|
37
|
+
/** The clients target the package is generated with. */
|
|
38
38
|
readonly target: Target;
|
|
39
39
|
};
|
|
40
40
|
/** A registry a package's public repo publishes it to; names come from the package's own files. */
|
|
@@ -57,8 +57,8 @@ export type ManifestPackageInput = {
|
|
|
57
57
|
readonly commitMessage: string;
|
|
58
58
|
/** The package's one description: its public repo's, every registry's, and its first CHANGELOG entry. */
|
|
59
59
|
readonly description: string;
|
|
60
|
-
/** How
|
|
61
|
-
readonly
|
|
60
|
+
/** How clients generates it; absent for a package backend does not generate (the spec itself). */
|
|
61
|
+
readonly clients?: ReleaseRun;
|
|
62
62
|
/** This package's metadata over the product's; its keywords add to the product's. */
|
|
63
63
|
readonly metadata?: PackageMetadata;
|
|
64
64
|
/** The package's slug: its dir beside the config, and the key bump's `RELEASE_VERSIONS` uses. */
|
package/dist/runtime/cli/body.go
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Code generated by
|
|
1
|
+
// Code generated by clients. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
package cli
|
|
4
4
|
|
|
@@ -51,8 +51,8 @@ type saved struct {
|
|
|
51
51
|
|
|
52
52
|
// the root annotations holding the environment variables' prefix and the API's default base URL
|
|
53
53
|
const (
|
|
54
|
-
envPrefixKey = "
|
|
55
|
-
serverKey = "
|
|
54
|
+
envPrefixKey = "cli.envPrefix"
|
|
55
|
+
serverKey = "cli.server"
|
|
56
56
|
)
|
|
57
57
|
|
|
58
58
|
// globalFlags declares the flags every command takes.
|
package/dist/runtime/cli/log.go
CHANGED
package/dist/runtime/cli/run.go
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Code generated by
|
|
1
|
+
// Code generated by clients. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
// Package cli is the generated CLI's runtime: the root command and its global flags, the settings
|
|
4
4
|
// each run resolves, the parameter flags, and the run that maps an outcome to the exit code a
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by
|
|
1
|
+
// @generated by clients. DO NOT EDIT.
|
|
2
2
|
using System;
|
|
3
3
|
using System.Collections.Generic;
|
|
4
4
|
using System.Globalization;
|
|
@@ -7,7 +7,7 @@ using System.Text.Json.Serialization.Metadata;
|
|
|
7
7
|
using System.Threading;
|
|
8
8
|
using System.Threading.Tasks;
|
|
9
9
|
|
|
10
|
-
namespace
|
|
10
|
+
namespace Http.Runtime;
|
|
11
11
|
|
|
12
12
|
/// <summary>What a realtime connection opens over.</summary>
|
|
13
13
|
public enum TransportKind
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by
|
|
1
|
+
// @generated by clients. DO NOT EDIT.
|
|
2
2
|
using System;
|
|
3
3
|
using System.Collections.Generic;
|
|
4
4
|
using System.IO;
|
|
@@ -6,7 +6,7 @@ using System.Text;
|
|
|
6
6
|
using System.Text.Json;
|
|
7
7
|
using System.Text.Json.Serialization.Metadata;
|
|
8
8
|
|
|
9
|
-
namespace
|
|
9
|
+
namespace Http.Runtime;
|
|
10
10
|
|
|
11
11
|
/// <summary>
|
|
12
12
|
/// A binary body: a <c>byte[]</c>, sent with its length and sent again after a 401 or a 307/308, or a
|
|
@@ -114,7 +114,7 @@ internal sealed record Body(byte[]? Content, Stream? Stream, string MediaType)
|
|
|
114
114
|
{
|
|
115
115
|
return null;
|
|
116
116
|
}
|
|
117
|
-
var mark = $"
|
|
117
|
+
var mark = $"clients-{Guid.NewGuid()}";
|
|
118
118
|
var body = new MemoryStream();
|
|
119
119
|
foreach (var part in parts)
|
|
120
120
|
{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by
|
|
1
|
+
// @generated by clients. DO NOT EDIT.
|
|
2
2
|
using System;
|
|
3
3
|
using System.Collections.Generic;
|
|
4
4
|
using System.Linq;
|
|
@@ -7,7 +7,7 @@ using System.Text;
|
|
|
7
7
|
using System.Threading;
|
|
8
8
|
using System.Threading.Tasks;
|
|
9
9
|
|
|
10
|
-
namespace
|
|
10
|
+
namespace Http.Runtime;
|
|
11
11
|
|
|
12
12
|
/// <summary>
|
|
13
13
|
/// How a client connects and what it runs around each call: its base URL (the API's first server when unset), its
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
// @generated by
|
|
1
|
+
// @generated by clients. DO NOT EDIT.
|
|
2
2
|
using System;
|
|
3
3
|
using System.Collections.Generic;
|
|
4
4
|
using System.Globalization;
|
|
5
5
|
using System.Text;
|
|
6
6
|
using System.Text.Json;
|
|
7
7
|
|
|
8
|
-
namespace
|
|
8
|
+
namespace Http.Runtime;
|
|
9
9
|
|
|
10
10
|
/// <summary>
|
|
11
|
-
///
|
|
11
|
+
/// backend's error envelope, read from an error body's JSON object (empty for any other body): each member it names
|
|
12
12
|
/// when the server sent it with its type, and every other member, a mistyped one included, in <see cref="Extra"/>.
|
|
13
13
|
/// </summary>
|
|
14
14
|
public sealed record ErrorEnvelope(
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
// @generated by
|
|
1
|
+
// @generated by clients. DO NOT EDIT.
|
|
2
2
|
using System;
|
|
3
3
|
using System.Collections.Generic;
|
|
4
4
|
using System.Text.Json;
|
|
5
5
|
using System.Text.Json.Serialization.Metadata;
|
|
6
6
|
|
|
7
|
-
namespace
|
|
7
|
+
namespace Http.Runtime;
|
|
8
8
|
|
|
9
9
|
/// <summary>Every error the SDK throws; the caller's own cancellation is an OperationCanceledException instead.</summary>
|
|
10
|
-
public abstract class
|
|
10
|
+
public abstract class HttpException : Exception
|
|
11
11
|
{
|
|
12
|
-
private protected
|
|
12
|
+
private protected HttpException(string message, Exception? inner = null)
|
|
13
13
|
: base(message, inner)
|
|
14
14
|
{
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
/// <summary>A client or call configured in a way it cannot send: no absolute base URL, a header value with a line break, a handler it cannot install.</summary>
|
|
19
|
-
public sealed class ConfigException(string message) :
|
|
19
|
+
public sealed class ConfigException(string message) : HttpException(message);
|
|
20
20
|
|
|
21
21
|
/// <summary>A path param that is empty, <c>.</c> or <c>..</c>: nothing is sent.</summary>
|
|
22
|
-
public sealed class PathParamException(string message) :
|
|
22
|
+
public sealed class PathParamException(string message) : HttpException(message);
|
|
23
23
|
|
|
24
24
|
/// <summary>No answer: the connection failed or broke, or a realtime dial's answer ran past the largest the client reads.</summary>
|
|
25
|
-
public sealed class ApiConnectionException(string message, Exception? inner = null) :
|
|
25
|
+
public sealed class ApiConnectionException(string message, Exception? inner = null) : HttpException(message, inner);
|
|
26
26
|
|
|
27
27
|
/// <summary>The call ran past its timeout.</summary>
|
|
28
|
-
public sealed class ApiTimeoutException(string message, Exception inner) :
|
|
28
|
+
public sealed class ApiTimeoutException(string message, Exception inner) : HttpException(message, inner);
|
|
29
29
|
|
|
30
30
|
/// <summary>An answer the call does not return: an error status or a 2xx that does not decode; a <c>client.Safe</c> Result's Err.</summary>
|
|
31
|
-
public abstract class SdkException :
|
|
31
|
+
public abstract class SdkException : HttpException
|
|
32
32
|
{
|
|
33
33
|
private protected SdkException(string message, Exception? inner = null)
|
|
34
34
|
: base(message, inner)
|
|
@@ -40,7 +40,7 @@ public abstract class SdkException : HoneyException
|
|
|
40
40
|
public sealed class DecodeException(string message, Exception? inner = null) : SdkException(message, inner);
|
|
41
41
|
|
|
42
42
|
/// <summary>A hook or <c>OnAuthExpired</c> threw; what it threw is the inner exception.</summary>
|
|
43
|
-
public sealed class HookException(string message, Exception? inner = null) :
|
|
43
|
+
public sealed class HookException(string message, Exception? inner = null) : HttpException(message, inner);
|
|
44
44
|
|
|
45
45
|
/// <summary>
|
|
46
46
|
/// A status outside 2xx: one class per common status, <see cref="UnexpectedStatusException"/> for the rest. Its
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by
|
|
1
|
+
// @generated by clients. DO NOT EDIT.
|
|
2
2
|
using System;
|
|
3
3
|
using System.Collections.Generic;
|
|
4
4
|
using System.IO;
|
|
@@ -8,7 +8,7 @@ using System.Text.Json.Serialization.Metadata;
|
|
|
8
8
|
using System.Threading;
|
|
9
9
|
using System.Threading.Tasks;
|
|
10
10
|
|
|
11
|
-
namespace
|
|
11
|
+
namespace Http.Runtime;
|
|
12
12
|
|
|
13
13
|
/// <summary>One server-sent event: its decoded data, its type, the stream's last event id when it came, and its <c>retry</c>.</summary>
|
|
14
14
|
public sealed record SseEvent<T>(T Data, string? Event, string? Id, TimeSpan? Retry);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by
|
|
1
|
+
// @generated by clients. DO NOT EDIT.
|
|
2
2
|
using System;
|
|
3
3
|
using System.Collections.Generic;
|
|
4
4
|
using System.IO;
|
|
@@ -7,7 +7,7 @@ using System.Net.Http;
|
|
|
7
7
|
using System.Threading;
|
|
8
8
|
using System.Threading.Tasks;
|
|
9
9
|
|
|
10
|
-
namespace
|
|
10
|
+
namespace Http.Runtime;
|
|
11
11
|
|
|
12
12
|
internal sealed record Answered(int Status, Dictionary<string, string> Headers, byte[] Body, Uri Url, bool Over);
|
|
13
13
|
|
|
@@ -66,7 +66,7 @@ internal sealed class Exchange(Transport client, Operation op, Call call, bool s
|
|
|
66
66
|
{
|
|
67
67
|
return await AnswerAsync(deadline.Token).ConfigureAwait(false);
|
|
68
68
|
}
|
|
69
|
-
catch (
|
|
69
|
+
catch (HttpException e)
|
|
70
70
|
{
|
|
71
71
|
_log.Failed(e);
|
|
72
72
|
throw;
|
|
@@ -86,7 +86,7 @@ internal sealed class Exchange(Transport client, Operation op, Call call, bool s
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
private
|
|
89
|
+
private HttpException Failed(HttpException error)
|
|
90
90
|
{
|
|
91
91
|
_log.Failed(error);
|
|
92
92
|
return error;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by
|
|
1
|
+
// @generated by clients. DO NOT EDIT.
|
|
2
2
|
using System;
|
|
3
3
|
using System.Linq;
|
|
4
4
|
using System.Net;
|
|
@@ -6,11 +6,11 @@ using System.Net.Http;
|
|
|
6
6
|
using System.Threading;
|
|
7
7
|
using System.Threading.Tasks;
|
|
8
8
|
|
|
9
|
-
namespace
|
|
9
|
+
namespace Http.Runtime;
|
|
10
10
|
|
|
11
11
|
internal sealed class StripHandler : DelegatingHandler
|
|
12
12
|
{
|
|
13
|
-
public static readonly HttpRequestOptionsKey<bool> Cross = new("
|
|
13
|
+
public static readonly HttpRequestOptionsKey<bool> Cross = new("http.cross");
|
|
14
14
|
|
|
15
15
|
private static readonly string[] Safe = ["Accept", "Accept-Language", "User-Agent"];
|
|
16
16
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
// @generated by
|
|
1
|
+
// @generated by clients. DO NOT EDIT.
|
|
2
2
|
using System;
|
|
3
3
|
using System.Collections.Generic;
|
|
4
4
|
using System.Threading;
|
|
5
5
|
using System.Threading.Tasks;
|
|
6
6
|
|
|
7
|
-
namespace
|
|
7
|
+
namespace Http.Runtime;
|
|
8
8
|
|
|
9
9
|
/// <summary>
|
|
10
10
|
/// A request about to be sent, before each attempt: a hook may change its method, URL, headers and body. Its
|
|
@@ -124,5 +124,5 @@ internal static class Hooks
|
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
public static bool Wraps(Exception error, CancellationToken token) =>
|
|
127
|
-
error is not
|
|
127
|
+
error is not HttpException && !(error is OperationCanceledException && token.IsCancellationRequested);
|
|
128
128
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
// @generated by
|
|
1
|
+
// @generated by clients. DO NOT EDIT.
|
|
2
2
|
using System;
|
|
3
3
|
using System.Collections.Generic;
|
|
4
4
|
using System.Text.Json;
|
|
5
5
|
using System.Text.Json.Serialization;
|
|
6
6
|
using System.Text.Json.Serialization.Metadata;
|
|
7
7
|
|
|
8
|
-
namespace
|
|
8
|
+
namespace Http.Runtime;
|
|
9
9
|
|
|
10
10
|
/// <summary>An optional nullable member: unset (the default, never written), null, or a value.</summary>
|
|
11
11
|
public readonly struct Opt<T> : IEquatable<Opt<T>>
|