@effected/github-actions 0.13.0 → 0.13.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.
package/internal/twirp.js CHANGED
@@ -14,6 +14,23 @@ import { HttpClientRequest } from "effect/unstable/http";
14
14
  */
15
15
  const CONFLICT = Symbol.for("@effected/github-actions/twirp/conflict");
16
16
  /**
17
+ * The error fields a {@link TwirpFailure} contributes to a caller's own error
18
+ * class — the cache, artifact and blob-store errors all carry `reason`,
19
+ * `status`, `detail` and `cause` under the same names, so each spreads this
20
+ * and adds its own identifier.
21
+ *
22
+ * @internal
23
+ */
24
+ const twirpFailureFields = (failure) => failure.kind === "status" ? {
25
+ reason: "refused",
26
+ detail: failure.method,
27
+ ...failure.status === void 0 ? {} : { status: failure.status }
28
+ } : {
29
+ reason: "unreachable",
30
+ detail: `${failure.method} did not answer with a Twirp body`,
31
+ ...failure.cause === void 0 ? {} : { cause: failure.cause }
32
+ };
33
+ /**
17
34
  * Whether retrying could plausibly help.
18
35
  *
19
36
  * @remarks
@@ -94,4 +111,4 @@ const stringField = (body, name) => {
94
111
  const isOk = (body) => field(body, "ok") === true;
95
112
 
96
113
  //#endregion
97
- export { CONFLICT, field, isOk, isRetryable, stringField, twirpCall };
114
+ export { CONFLICT, field, isOk, isRetryable, stringField, twirpCall, twirpFailureFields };
@@ -0,0 +1,28 @@
1
+ import { Effect } from "effect";
2
+
3
+ //#region src/internal/unstubbed.ts
4
+ /**
5
+ * The one way an unstubbed test-double member dies, for every `makeTest` in
6
+ * this package.
7
+ *
8
+ * @remarks
9
+ * A double's unstubbed member must die rather than silently succeed — a stub
10
+ * that returns nothing teaches a test that nothing happened. The message names
11
+ * the double, the member and the override that fixes it, and it is spelled
12
+ * here once so a wording change is one edit rather than ten.
13
+ *
14
+ * @internal
15
+ */
16
+ /**
17
+ * The die-on-call members of `<double>.makeTest`: `dies("save")` is an
18
+ * `Effect` that defects naming `save` when run. Each package double binds its
19
+ * own name once, then lists its members.
20
+ *
21
+ * @internal
22
+ */
23
+ const unstubbed = (double) => (member) => Effect.sync(() => {
24
+ throw new Error(`${double}: ${member}() was called but not stubbed — pass a \`${member}\` override.`);
25
+ });
26
+
27
+ //#endregion
28
+ export { unstubbed };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effected/github-actions",
3
- "version": "0.13.0",
3
+ "version": "0.13.2",
4
4
  "private": false,
5
5
  "description": "The GitHub Actions runtime: env, inputs, outputs, state, logging, cache, artifacts, blob storage, OIDC and the token bridge.",
6
6
  "keywords": [
@@ -44,7 +44,8 @@
44
44
  "@effected/markdown": "^0.10.0",
45
45
  "@effected/npm": "^0.14.0",
46
46
  "@effected/sbom": "^0.6.1",
47
- "@effected/templates": "^0.6.0"
47
+ "@effected/templates": "^0.6.0",
48
+ "@effected/walker": "^0.9.0"
48
49
  },
49
50
  "peerDependencies": {
50
51
  "@effect/platform-node": "4.0.0-rc.115",