Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename tRpcAzureFunctionsPlugin to unstable prefix #115

Merged
merged 1 commit into from
Jan 20, 2024
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 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.eslintrc.js
.eslintrc.js
examples
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ npm start

### Available Adatpers

- [azure-functions][@nammatham/azure-functions], Azure Functions Adapter for Nammatham
- [azure-functions][@nammatham/azure-functions], Azure Functions Adapter for Nammatham, internally, Azure Functions in local dev mode is dependend on Express.js.

### Available Plugins

Expand Down
18 changes: 18 additions & 0 deletions examples/azure-functions-with-trpc/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# @examples/azure-functions-with-trpc

> Unstable API, please use in your own risk, any PRs are welcome!

## Usage

```ts
// No need to call expressPlugin() in dev mode, as it is already called by nammathamTrpcPlugin()
// app.register(expressPlugin());
app.register(
unstable__tRpcAzureFunctionsPlugin({
prefix: '/trpc',
trpcOptions: {
router: appRouter,
createContext,
}
})
);
```

## Run Dev Server

```
Expand Down
4 changes: 2 additions & 2 deletions examples/azure-functions-with-trpc/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { tRpcAzureFunctionsPlugin } from '@nammatham/trpc-azure-functions';
import { unstable__tRpcAzureFunctionsPlugin } from '@nammatham/trpc-azure-functions';
import { app } from './nammatham';
import { appRouter, createContext } from './router';

// No need to call expressPlugin() in dev mode, as it is already called by nammathamTrpcPlugin()
// app.register(expressPlugin());
app.register(
tRpcAzureFunctionsPlugin({
unstable__tRpcAzureFunctionsPlugin({

Check warning on line 8 in examples/azure-functions-with-trpc/src/main.ts

View check run for this annotation

Codecov / codecov/patch

examples/azure-functions-with-trpc/src/main.ts#L8

Added line #L8 was not covered by tests
prefix: '/trpc',
trpcOptions: {
router: appRouter,
Expand Down
3 changes: 1 addition & 2 deletions examples/azure-functions-with-trpc/src/nammatham.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import { AzureFunctionsAdapter } from '@nammatham/azure-functions';

const n = initNammatham.create(new AzureFunctionsAdapter());
n.func;
// ^?

Check warning on line 5 in examples/azure-functions-with-trpc/src/nammatham.ts

View check run for this annotation

Codecov / codecov/patch

examples/azure-functions-with-trpc/src/nammatham.ts#L5

Added line #L5 was not covered by tests
export const func = n.func;
export const app = n.app;
7 changes: 6 additions & 1 deletion packages/trpc-azure-functions/src/trpc-azure-functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@
expressPluginOption?: ExpressServerOption;
}

export function tRpcAzureFunctionsPlugin<TRouter extends AnyRouter>(option: TrpcAzureFunctionsPluginOption<TRouter>) {
/**
* tRPC plugin for AzureFunctions
* Unstable, some features are not implemented yet.
*/

export function unstable__tRpcAzureFunctionsPlugin<TRouter extends AnyRouter>(option: TrpcAzureFunctionsPluginOption<TRouter>) {

Check warning on line 27 in packages/trpc-azure-functions/src/trpc-azure-functions.ts

View check run for this annotation

Codecov / codecov/patch

packages/trpc-azure-functions/src/trpc-azure-functions.ts#L22-L27

Added lines #L22 - L27 were not covered by tests
return (app: NammathamApp, handlerResolver: BaseHandlerResolver) => {
logger.info(`Using plugin: tRPC for AzureFunctions`);

Expand Down
Loading