Skip to content

Commit 94aad7d

Browse files
authored
chore(bridge): Refactor TS-Core bridge (#1698)
1 parent cd1c6b1 commit 94aad7d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+7785
-4954
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,6 @@ jobs:
130130
- platform: windows-x64
131131
runner: windows-latest
132132
reuse-v8-context: true
133-
# Node 22.12.0 on Windows incorrectly resolves `localhost` to `::1`, rather than both `::1` and `127.0.0.1`.
134-
# We changed all of our internal tests to exclusively use `127.0.0.1`, but samples are still written to use
135-
# `localhost`, which really is the proper thing to do in samples. So until this gets fixed upstream, we force
136-
# the last known good version of Node on Windows.
137-
# See https://github.com/nodejs/node/issues/56137 (_resolved_ already, but not yet released).
138-
- platform: windows-x64
139-
node: 22
140-
node-release-override: 22.11.0
141133
runs-on: ${{ matrix.runner }}
142134
name: Run Integration Tests (${{ matrix.platform }}, Node ${{ matrix.node }}, Reuse V8 Context ${{ matrix.reuse-v8-context }})
143135
defaults:
@@ -222,7 +214,7 @@ jobs:
222214
TEMPORAL_CLIENT_KEY: ${{ secrets.TEMPORAL_CLIENT_KEY }}
223215

224216
- name: Run Tests
225-
run: npm test
217+
run: npm run test
226218
env:
227219
RUN_INTEGRATION_TESTS: true
228220
REUSE_V8_CONTEXT: ${{ matrix.reuse-v8-context }}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ packages/core-bridge/releases
1212
packages/*/package-lock.json
1313
/sdk-node.iml
1414
*~
15+
16+
# One test creates persisted SQLite DBs; they should normally be deleted automatically,
17+
# but may be left behind in some error scenarios.
18+
packages/test/temporal-db-*.sqlite

package-lock.json

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/common/src/errors.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ export class ValueError extends Error {
2020
export class PayloadConverterError extends ValueError {}
2121

2222
/**
23-
* Used in different parts of the SDK to note that something unexpected has happened.
23+
* Signals that a requested operation can't be completed because it is illegal given the
24+
* current state of the object; e.g. trying to use a resource after it has been closed.
2425
*/
2526
@SymbolBasedInstanceOfError('IllegalStateError')
2627
export class IllegalStateError extends Error {}

packages/common/src/type-helpers.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
1+
export type NonNullableObject<T> = { [P in keyof T]-?: NonNullable<T[P]> };
2+
13
/** Shorthand alias */
24
export type AnyFunc = (...args: any[]) => any;
5+
36
/** A tuple without its last element */
47
export type OmitLast<T> = T extends [...infer REST, any] ? REST : never;
8+
59
/** F with all arguments but the last */
610
export type OmitLastParam<F extends AnyFunc> = (...args: OmitLast<Parameters<F>>) => ReturnType<F>;
11+
12+
export type OmitFirst<T> = T extends [any, ...infer REST] ? REST : never;
13+
14+
export type OmitFirstParam<T> = T extends (...args: any[]) => any
15+
? (...args: OmitFirst<Parameters<T>>) => ReturnType<T>
16+
: never;
17+
718
/** Require that T has at least one of the provided properties defined */
819
export type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> &
920
{

0 commit comments

Comments
 (0)