Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,576 changes: 2,108 additions & 1,468 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
},
"private": true,
"dependencies": {
"@forge/bridge": "^3.3.0",
"@forge/resolver": "^1.5.29",
"@trpc/client": "^11.0.0",
"@trpc/server": "^11.0.0",
"fp-ts": "^2.13.1",
Expand All @@ -20,6 +18,8 @@
"devDependencies": {
"@commitlint/cli": "^19.2.1",
"@commitlint/config-conventional": "^19.1.0",
"@forge/bridge": "^6.0.0",
"@forge/resolver": "^2.0.0",
"@nx/eslint": "18.1.2",
"@nx/eslint-plugin": "18.1.2",
"@nx/jest": "18.1.2",
Expand Down
6 changes: 5 additions & 1 deletion packages/forge-trpc-adapter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ Custom [tRCP adapter](https://trpc.io/docs/adapters) to enable tRPC for [Atlassi
npm install @toolsplus/forge-trpc-adapter
```

Note that this package has a peer dependency on `@forge/resolver`. If you have not installed `@forge/resolver` you may install before installing this package.
Note that this package declares `@forge/resolver` (`^1.4.8 || ^2.0.0`) as a peer dependency. Forge apps typically already have it installed. If your app does not, install it alongside this package:

```
npm install @forge/resolver
```

## Usage

Expand Down
4 changes: 3 additions & 1 deletion packages/forge-trpc-adapter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@
"directory": "packages/forge-trpc-adapter"
},
"dependencies": {
"@forge/resolver": "^1.4.8",
"@toolsplus/forge-trpc-protocol": "0.0.0-development",
"@trpc/server": "^11.0.0",
"fp-ts": "^2.13.1",
"io-ts": "^2.2.20",
"tslib": "^2.3.0"
},
"peerDependencies": {
"@forge/resolver": "^1.4.8 || ^2.0.0"
}
}
5 changes: 3 additions & 2 deletions packages/forge-trpc-adapter/src/lib/resolve-procedure-call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ const callProcedures = <TRouter extends AnyRouter>({

return pipe(
paths,
A.mapWithIndex((index, path) => ({ path, input: inputs[index] })),
A.map(({ path, input }) =>
A.mapWithIndex((index, path) => ({ index, path, input: inputs[index] })),
A.map(({ index, path, input }) =>
pipe(
TE.tryCatch(
() =>
Expand All @@ -182,6 +182,7 @@ const callProcedures = <TRouter extends AnyRouter>({
ctx,
type: callOptions.type,
signal: undefined,
batchIndex: index,
}),
(cause) => {
const error = getTRPCErrorFromUnknown(cause);
Expand Down
6 changes: 5 additions & 1 deletion packages/forge-trpc-link/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ npm install @toolsplus/forge-trpc-link
npm install superjson
```

Note that this package has a peer dependency on `@forge/bridge`. If you have not installed `@forge/bridge` you may install before installing this package.
Note that this package declares `@forge/bridge` (`^6.0.0`) as a peer dependency. Forge apps typically already have it installed. If your app does not, install it alongside this package:

```shell
npm install @forge/bridge
```

## Usage

Expand Down
4 changes: 3 additions & 1 deletion packages/forge-trpc-link/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
"directory": "packages/forge-trpc-link"
},
"dependencies": {
"@forge/bridge": "^3.3.0",
"@toolsplus/forge-trpc-protocol": "0.0.0-development",
"@trpc/client": "^11.0.0",
"@trpc/server": "^11.0.0",
"tslib": "^2.3.0"
},
"peerDependencies": {
"@forge/bridge": "^6.0.0"
}
}
7 changes: 5 additions & 2 deletions packages/forge-trpc-link/src/lib/custom-ui-bridge-request.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TRPCClientRuntime } from '@trpc/client';
import type { ProcedureType } from '@trpc/server';
import type { TRPCResponse } from '@trpc/server/dist/rpc';
import type { TRPCResponse } from '@trpc/server/rpc';
import { invoke } from '@forge/bridge';
import {
defaultResolverFunctionKey,
Expand Down Expand Up @@ -58,8 +58,11 @@ export const customUiBridgeRequest = <TResponseShape = TRPCResponse>(
isBatchCall,
};

// This call never passes invoke metadata, so the response is always the
// plain body, never the { body, metadata } envelope from the
// InvokeResponse union introduced in @forge/bridge 6.
return invoke<TResponseShape>(
resolverFunctionKey ?? defaultResolverFunctionKey,
options
);
) as Promise<TResponseShape>;
};
Loading