diff --git a/docs/infer-handler-type.md b/docs/infer-handler-type.md new file mode 100644 index 00000000..6a1c1453 --- /dev/null +++ b/docs/infer-handler-type.md @@ -0,0 +1,32 @@ + + +```ts +import { container } from '../container'; +import { func } from '../nammatham'; +import { injector } from '@di-extra/inversify'; +import { DataService } from '../services/data.service'; +import type { InferHandler } from '@nammatham/core'; + +const trigger = func + .httpGet('hello', { + route: 'hello-world', + }) + .setContext({ + // prettier-ignore + services: injector(container) + .inject('dataService', DataService).to() + .resolve(), + }); + +export const _handler: InferHandler = ({ trigger, context, services }) => { + context.log('HTTP trigger function processed a request.'); + + return { + jsonBody: { + data: 'hello world' + services.dataService.getData(), + }, + }; +}; + +export default trigger.handler(_handler); +``` \ No newline at end of file diff --git a/examples/azure-functions-with-inversify/README.md b/examples/azure-functions-with-inversify/README.md new file mode 100644 index 00000000..0aec29f0 --- /dev/null +++ b/examples/azure-functions-with-inversify/README.md @@ -0,0 +1 @@ +# @examples/azure-functions diff --git a/examples/azure-functions-with-inversify/host.json b/examples/azure-functions-with-inversify/host.json new file mode 100644 index 00000000..852b7b7a --- /dev/null +++ b/examples/azure-functions-with-inversify/host.json @@ -0,0 +1,15 @@ +{ + "version": "2.0", + "logging": { + "applicationInsights": { + "samplingSettings": { + "isEnabled": true, + "excludedTypes": "Request" + } + } + }, + "extensionBundle": { + "id": "Microsoft.Azure.Functions.ExtensionBundle", + "version": "[3.15.0, 4.0.0)" + } +} \ No newline at end of file diff --git a/examples/azure-functions-with-inversify/local.settings.json b/examples/azure-functions-with-inversify/local.settings.json new file mode 100644 index 00000000..6199cf10 --- /dev/null +++ b/examples/azure-functions-with-inversify/local.settings.json @@ -0,0 +1,9 @@ +{ + "IsEncrypted": false, + "Values": { + "FUNCTIONS_WORKER_RUNTIME": "node", + "AzureWebJobsFeatureFlags": "EnableWorkerIndexing", + "AzureWebJobsStorage": "UseDevelopmentStorage=true" + }, + "ConnectionStrings": {} +} \ No newline at end of file diff --git a/examples/azure-functions-with-inversify/package.json b/examples/azure-functions-with-inversify/package.json new file mode 100644 index 00000000..dab5405f --- /dev/null +++ b/examples/azure-functions-with-inversify/package.json @@ -0,0 +1,29 @@ +{ + "name": "@examples/azure-functions-with-inversify", + "version": "1.0.0", + "description": "", + "main": "dist/src/main.js", + "scripts": { + "build": "tsc", + "lint": "tsc --noEmit", + "start": "tsc && func start", + "dev": "cross-env NAMMATHAM_ENV=development tsx watch src/main.ts" + }, + "author": "Thada Wangthammang", + "license": "MIT", + "dependencies": { + "@azure/functions": "^4.1.0", + "@di-extra/inversify": "^0.2.0", + "@nammatham/azure-functions": "2.0.0-alpha.8", + "@nammatham/core": "2.0.0-alpha.8", + "@nammatham/express": "2.0.0-alpha.8", + "inversify": "^6.0.2", + "reflect-metadata": "^0.2.1" + }, + "devDependencies": { + "cross-env": "^7.0.3", + "npm-run-all": "^4.1.5", + "tsx": "^4.7.0", + "typescript": "^5.0.2" + } +} \ No newline at end of file diff --git a/examples/azure-functions-with-inversify/src/container.ts b/examples/azure-functions-with-inversify/src/container.ts new file mode 100644 index 00000000..5ac6234e --- /dev/null +++ b/examples/azure-functions-with-inversify/src/container.ts @@ -0,0 +1,6 @@ +import { Container } from 'inversify'; +import { DataService } from './services/data.service'; + +export const container = new Container(); +container.bind(DataService).toSelf(); + diff --git a/examples/azure-functions-with-inversify/src/functions/hello.ts b/examples/azure-functions-with-inversify/src/functions/hello.ts new file mode 100644 index 00000000..70e48708 --- /dev/null +++ b/examples/azure-functions-with-inversify/src/functions/hello.ts @@ -0,0 +1,26 @@ +import { container } from '../container'; +import { func } from '../nammatham'; +import { injector } from '@di-extra/inversify'; +import { DataService } from '../services/data.service'; + +// prettier-ignore +const services = injector(container) + .inject('dataService', DataService).to() + .resolve(); + +export default func + .httpGet('hello', { + route: 'hello-world', + }) + .setContext({ + services, + }) + .handler(async ({ trigger, context, services }) => { + context.log('HTTP trigger function processed a request.'); + + return { + jsonBody: { + data: 'hello world' + services.dataService.getData(), + }, + }; + }); diff --git a/examples/azure-functions-with-inversify/src/main.ts b/examples/azure-functions-with-inversify/src/main.ts new file mode 100644 index 00000000..8b06f866 --- /dev/null +++ b/examples/azure-functions-with-inversify/src/main.ts @@ -0,0 +1,9 @@ +import 'reflect-metadata'; +import { expressPlugin } from '@nammatham/express'; +import hello from './functions/hello'; +import { app } from './nammatham'; + +app.addFunctions(hello); + +app.register(expressPlugin()); +app.start(); diff --git a/examples/azure-functions-with-inversify/src/nammatham.ts b/examples/azure-functions-with-inversify/src/nammatham.ts new file mode 100644 index 00000000..e4ec4298 --- /dev/null +++ b/examples/azure-functions-with-inversify/src/nammatham.ts @@ -0,0 +1,8 @@ +import { initNammatham } from '@nammatham/core'; +import { AzureFunctionsAdapter } from '@nammatham/azure-functions'; + +const n = initNammatham.create(new AzureFunctionsAdapter()); +n.func; +// ^? +export const func = n.func; +export const app = n.app; diff --git a/examples/azure-functions-with-inversify/src/services/data.service.ts b/examples/azure-functions-with-inversify/src/services/data.service.ts new file mode 100644 index 00000000..ed289e29 --- /dev/null +++ b/examples/azure-functions-with-inversify/src/services/data.service.ts @@ -0,0 +1,9 @@ +import { injectable } from 'inversify'; + +@injectable() +export class DataService { + + public getData() { + return `Data from DataService`; + } +} \ No newline at end of file diff --git a/examples/azure-functions-with-inversify/tsconfig.json b/examples/azure-functions-with-inversify/tsconfig.json new file mode 100644 index 00000000..f970fa21 --- /dev/null +++ b/examples/azure-functions-with-inversify/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "outDir": "dist", + "rootDir": ".", + "sourceMap": true, + "strict": true, + "esModuleInterop": true, + "experimentalDecorators": true, + }, + "exclude": ["node_modules", "**/*.test.ts"] +} \ No newline at end of file diff --git a/examples/azure-functions-with-test/README.md b/examples/azure-functions-with-test/README.md new file mode 100644 index 00000000..0aec29f0 --- /dev/null +++ b/examples/azure-functions-with-test/README.md @@ -0,0 +1 @@ +# @examples/azure-functions diff --git a/examples/azure-functions-with-test/__test__/helloFunction.test.ts b/examples/azure-functions-with-test/__test__/helloFunction.test.ts new file mode 100644 index 00000000..4d9dda75 --- /dev/null +++ b/examples/azure-functions-with-test/__test__/helloFunction.test.ts @@ -0,0 +1,26 @@ +import { expect, test } from 'vitest'; +import helloFunc from '../src/functions/hello'; +import { HttpRequest, InvocationContext } from '@azure/functions'; + +test('helloFunc', async () => { + const handler = helloFunc.getHandler(); + const result = await handler({ + context: new InvocationContext(), + trigger: new HttpRequest({ + method: 'GET', + url: 'http://localhost:3000/api/hello-world', + query: { + name: 'world', + }, + }), + }); + + expect(result).toEqual({ + jsonBody: { + data: { + name: 'world', + message: 'Hello, world!', + }, + }, + }); +}); diff --git a/examples/azure-functions-with-test/host.json b/examples/azure-functions-with-test/host.json new file mode 100644 index 00000000..852b7b7a --- /dev/null +++ b/examples/azure-functions-with-test/host.json @@ -0,0 +1,15 @@ +{ + "version": "2.0", + "logging": { + "applicationInsights": { + "samplingSettings": { + "isEnabled": true, + "excludedTypes": "Request" + } + } + }, + "extensionBundle": { + "id": "Microsoft.Azure.Functions.ExtensionBundle", + "version": "[3.15.0, 4.0.0)" + } +} \ No newline at end of file diff --git a/examples/azure-functions-with-test/local.settings.json b/examples/azure-functions-with-test/local.settings.json new file mode 100644 index 00000000..6199cf10 --- /dev/null +++ b/examples/azure-functions-with-test/local.settings.json @@ -0,0 +1,9 @@ +{ + "IsEncrypted": false, + "Values": { + "FUNCTIONS_WORKER_RUNTIME": "node", + "AzureWebJobsFeatureFlags": "EnableWorkerIndexing", + "AzureWebJobsStorage": "UseDevelopmentStorage=true" + }, + "ConnectionStrings": {} +} \ No newline at end of file diff --git a/examples/azure-functions-with-test/package.json b/examples/azure-functions-with-test/package.json new file mode 100644 index 00000000..93181dab --- /dev/null +++ b/examples/azure-functions-with-test/package.json @@ -0,0 +1,26 @@ +{ + "name": "@examples/azure-functions-with-test", + "version": "1.0.0", + "description": "", + "main": "dist/src/main.js", + "scripts": { + "build": "tsc", + "lint": "tsc --noEmit", + "start": "tsc && func start", + "dev": "cross-env NAMMATHAM_ENV=development tsx watch src/main.ts" + }, + "author": "Thada Wangthammang", + "license": "MIT", + "dependencies": { + "@azure/functions": "^4.1.0", + "@nammatham/azure-functions": "2.0.0-alpha.8", + "@nammatham/core": "2.0.0-alpha.8", + "@nammatham/express": "2.0.0-alpha.8" + }, + "devDependencies": { + "cross-env": "^7.0.3", + "npm-run-all": "^4.1.5", + "tsx": "^4.7.0", + "typescript": "^5.0.2" + } +} \ No newline at end of file diff --git a/examples/azure-functions-with-test/src/functions/hello.ts b/examples/azure-functions-with-test/src/functions/hello.ts new file mode 100644 index 00000000..114ce4af --- /dev/null +++ b/examples/azure-functions-with-test/src/functions/hello.ts @@ -0,0 +1,23 @@ +import { func } from '../nammatham'; + +export default func + .httpGet('hello', { + route: 'hello-world', + }) + .handler(async ({ trigger, context }) => { + context.log('HTTP trigger function processed a request.'); + context.debug(`Http function processed request for url "${trigger.url}"`); + const name = trigger.query.get('name') || (await trigger.text()) || 'world'; + if (name === 'error') { + throw new Error('this is an error'); + } + const result = { + data: { + name: name, + message: `Hello, ${name}!` + } + } + return { + jsonBody: result, + } + }); diff --git a/examples/azure-functions-with-test/src/main.ts b/examples/azure-functions-with-test/src/main.ts new file mode 100644 index 00000000..a29a41bd --- /dev/null +++ b/examples/azure-functions-with-test/src/main.ts @@ -0,0 +1,8 @@ +import { expressPlugin } from '@nammatham/express'; +import hello from './functions/hello'; +import { app } from './nammatham'; + +app.addFunctions(hello); + +app.register(expressPlugin()); +app.start(); diff --git a/examples/azure-functions-with-test/src/nammatham.ts b/examples/azure-functions-with-test/src/nammatham.ts new file mode 100644 index 00000000..31e14679 --- /dev/null +++ b/examples/azure-functions-with-test/src/nammatham.ts @@ -0,0 +1,7 @@ +import { initNammatham } from '@nammatham/core'; +import { AzureFunctionsAdapter } from '@nammatham/azure-functions'; + +const n = initNammatham.create(new AzureFunctionsAdapter()); + +export const func = n.func; +export const app = n.app; diff --git a/examples/azure-functions-with-test/tsconfig.json b/examples/azure-functions-with-test/tsconfig.json new file mode 100644 index 00000000..f970fa21 --- /dev/null +++ b/examples/azure-functions-with-test/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "outDir": "dist", + "rootDir": ".", + "sourceMap": true, + "strict": true, + "esModuleInterop": true, + "experimentalDecorators": true, + }, + "exclude": ["node_modules", "**/*.test.ts"] +} \ No newline at end of file diff --git a/packages/azure-functions/src/handler.test.ts b/packages/azure-functions/src/handler.test.ts index 45d72ff1..b5c65a11 100644 --- a/packages/azure-functions/src/handler.test.ts +++ b/packages/azure-functions/src/handler.test.ts @@ -19,19 +19,19 @@ test(`${AzureFunctionsHandler.name}.handler should be invoked correctly`, async // Act const endpoint = handler.handler(() => 'handlerResult'); - const result = endpoint.invokeHandler({}, new InvocationContext()); + const result = endpoint.build().invokeHandler({}, new InvocationContext()); // Assert expect(result).toBe('handlerResult'); // NOTE: invokeHandler should test end-to-end - expect(endpoint.invokeHandler).toBeInstanceOf(Function); + expect(endpoint.build().invokeHandler).toBeInstanceOf(Function); // NOTE: registerFunc should test end-to-end expect(endpoint.registerFunc).toBeInstanceOf(Function); expect(handler).toBeInstanceOf(AzureFunctionsHandler); - expect(endpoint.endpointOption?.type).toBe('http'); - expect(endpoint.endpointOption?.route).toBe('test'); - expect(endpoint.endpointOption?.methods).toEqual(['GET']); - expect(endpoint.type).toBe('azure-functions'); - expect(endpoint.name).toBe('test'); + expect(endpoint.build().endpointOption?.type).toBe('http'); + expect(endpoint.build().endpointOption?.route).toBe('test'); + expect(endpoint.build().endpointOption?.methods).toEqual(['GET']); + expect(endpoint.build().type).toBe('azure-functions'); + expect(endpoint.build().name).toBe('test'); }); diff --git a/packages/azure-functions/src/handler.ts b/packages/azure-functions/src/handler.ts index d521bcd0..cbbf9858 100644 --- a/packages/azure-functions/src/handler.ts +++ b/packages/azure-functions/src/handler.ts @@ -1,21 +1,37 @@ import type { InvocationContext } from '@azure/functions'; -import type { WithEndpointOption } from '@nammatham/core'; + +import { BaseHandler, type WithEndpointOption } from '@nammatham/core'; import type { HandlerFunction, RegisterFunctionOption, AzureFunctionsEndpoint, FunctionOption } from './types'; import { NammathamContext } from './nammatham-context'; -export class AzureFunctionsHandler { +export class AzureFunctionsHandler< + TTriggerType, + TReturnType, + // eslint-disable-next-line @typescript-eslint/ban-types + ExtraContext extends Record = {} +> extends BaseHandler> { + context: ExtraContext = {} as ExtraContext; + protected funcHandler!: HandlerFunction; + constructor( public funcName: string, public functionOption: WithEndpointOption & FunctionOption, public registerFunc: RegisterFunctionOption - ) {} + ) { + super(); + } + + handler(func: HandlerFunction) { + this.funcHandler = func; + return this; + } - handler(func: HandlerFunction): AzureFunctionsEndpoint { - const invokeHandler = (triggerInput: TTriggerType, context: InvocationContext) => { - const nammathamContext = new NammathamContext(context, triggerInput); - return func(nammathamContext); + build(): AzureFunctionsEndpoint { + const invokeHandler = (triggerInput: TTriggerType, innocationContext: InvocationContext) => { + const nammathamContext = new NammathamContext(innocationContext, triggerInput); + return this.funcHandler({ ...nammathamContext, ...this.context }); }; return { ...this.functionOption, @@ -25,4 +41,13 @@ export class AzureFunctionsHandler { registerFunc: this.registerFunc, }; } + + setContext>(context: NewItem) { + this.context = { ...this.context, ...context }; + return this as AzureFunctionsHandler; + } + + getHandler() { + return this.funcHandler; + } } diff --git a/packages/azure-functions/src/trigger.ts b/packages/azure-functions/src/trigger.ts index a8587854..18748c36 100644 --- a/packages/azure-functions/src/trigger.ts +++ b/packages/azure-functions/src/trigger.ts @@ -80,12 +80,16 @@ export class AzureFunctionsTrigger extends BaseFunctionTrigger { } timer(funcName: string, option: Omit) { - return new AzureFunctionsHandler(funcName, this.parseFunctionOption(funcName, option), funcOption => { - app.timer(funcName, { - ...option, - ...funcOption, - }); - }); + return new AzureFunctionsHandler( + funcName, + this.parseFunctionOption(funcName, option), + funcOption => { + app.timer(funcName, { + ...option, + ...funcOption, + }); + } + ); } private parseFunctionOption( diff --git a/packages/azure-functions/src/types.ts b/packages/azure-functions/src/types.ts index e7d38627..7db76982 100644 --- a/packages/azure-functions/src/types.ts +++ b/packages/azure-functions/src/types.ts @@ -3,8 +3,9 @@ import type { FunctionInput, FunctionOutput, InvocationContext } from '@azure/fu import type { NammathamContext } from './nammatham-context'; -export type HandlerFunction = ( - ctx: NammathamContext +// eslint-disable-next-line @typescript-eslint/ban-types +export type HandlerFunction = {}> = ( + ctx: NammathamContext & ExtraContext ) => PromiseLike; // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/packages/core/src/bases/base-handler.ts b/packages/core/src/bases/base-handler.ts new file mode 100644 index 00000000..4f692364 --- /dev/null +++ b/packages/core/src/bases/base-handler.ts @@ -0,0 +1,7 @@ +import type { NammamthamEndpoint } from '../types'; + +export abstract class BaseHandler any> { + abstract build(): NammamthamEndpoint; + abstract handler(func: Handler): this; + abstract getHandler(): Handler; +} diff --git a/packages/core/src/bases/index.ts b/packages/core/src/bases/index.ts index 31ff0687..0ce7c33e 100644 --- a/packages/core/src/bases/index.ts +++ b/packages/core/src/bases/index.ts @@ -2,3 +2,4 @@ export * from './base-function-trigger'; export * from './base-runtime-adapter'; export * from './nammatham-context-base'; export * from './base-handler-resolver'; +export * from './base-handler'; diff --git a/packages/core/src/nammatham-app.ts b/packages/core/src/nammatham-app.ts index ffb4ff7b..a7fbfee8 100644 --- a/packages/core/src/nammatham-app.ts +++ b/packages/core/src/nammatham-app.ts @@ -1,7 +1,7 @@ import { bgBlue, blue } from 'colorette'; import type { NammamthamEndpoint } from './types'; -import type { BaseHandlerResolver } from './bases'; +import type { BaseHandler, BaseHandlerResolver } from './bases'; import { logger } from './main'; @@ -11,6 +11,7 @@ export async function logo() { export class NammathamApp { protected readonly _functions: NammamthamEndpoint[] = []; + /** * The runtime server e.g. Azure Functions, * this is used to determine whether to start the server or not. @@ -39,17 +40,30 @@ export class NammathamApp { console.log(`${logo()} \n`); } - addFunctions(...functions: NammamthamEndpoint[]) { + addEndpoint(func: NammamthamEndpoint) { + logger.debug(`Adding function "${func.name}" on route: ${func.endpointOption?.route}`); + this._functions.push(func); + logger.debug(`Function "${func.name}" added`); + return this; + } + + addEndpoints(...functions: NammamthamEndpoint[]) { + for (const func of functions) { + this.addEndpoint(func); + } + return this; + } + + addFunctions(...functions: BaseHandler[]) { for (const func of functions) { this.addFunction(func); } return this; } - addFunction(func: NammamthamEndpoint) { - logger.debug(`Adding function "${func.name}" on route: ${func.endpointOption?.route}`); - this._functions.push(func); - logger.debug(`Function "${func.name}" added`); + addFunction(handler: BaseHandler) { + const func = handler.build(); + this.addEndpoint(func); return this; } diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 37a87784..20cc832a 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -35,3 +35,5 @@ export interface AfterServerStartedMetadata { port?: number; allowAllFunctionsAccessByHttp?: boolean; } + +export type InferHandler any }> = Parameters[0]; diff --git a/packages/trpc-azure-functions/src/trpc-azure-functions.ts b/packages/trpc-azure-functions/src/trpc-azure-functions.ts index 5d455cc4..c955d61e 100644 --- a/packages/trpc-azure-functions/src/trpc-azure-functions.ts +++ b/packages/trpc-azure-functions/src/trpc-azure-functions.ts @@ -65,7 +65,7 @@ export function unstable__tRpcAzureFunctionsPlugin( // TODO: Fix later, this is a workaround to remove trpc function from NammatamApp, // Thie will be empty NammatamApp with functions, e.g. only functions will register. // However, the `startExpress` only needs `functions` from NammatamApp. - const nammathamAppWithoutTrpc = new NammathamApp(handlerResolver).addFunctions( + const nammathamAppWithoutTrpc = new NammathamApp(handlerResolver).addEndpoints( ...app.functions.filter(func => func.name !== 'trpc') ); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 25bd24ef..73cc0c05 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -150,6 +150,71 @@ importers: specifier: ^5.0.2 version: 5.3.3 + examples/azure-functions-with-inversify: + dependencies: + '@azure/functions': + specifier: ^4.1.0 + version: 4.1.0 + '@di-extra/inversify': + specifier: ^0.2.0 + version: 0.2.0 + '@nammatham/azure-functions': + specifier: 2.0.0-alpha.8 + version: link:../../packages/azure-functions + '@nammatham/core': + specifier: 2.0.0-alpha.8 + version: link:../../packages/core + '@nammatham/express': + specifier: 2.0.0-alpha.8 + version: link:../../packages/express + inversify: + specifier: ^6.0.2 + version: 6.0.2 + reflect-metadata: + specifier: ^0.2.1 + version: 0.2.1 + devDependencies: + cross-env: + specifier: ^7.0.3 + version: 7.0.3 + npm-run-all: + specifier: ^4.1.5 + version: 4.1.5 + tsx: + specifier: ^4.7.0 + version: 4.7.0 + typescript: + specifier: ^5.0.2 + version: 5.3.3 + + examples/azure-functions-with-test: + dependencies: + '@azure/functions': + specifier: ^4.1.0 + version: 4.1.0 + '@nammatham/azure-functions': + specifier: 2.0.0-alpha.8 + version: link:../../packages/azure-functions + '@nammatham/core': + specifier: 2.0.0-alpha.8 + version: link:../../packages/core + '@nammatham/express': + specifier: 2.0.0-alpha.8 + version: link:../../packages/express + devDependencies: + cross-env: + specifier: ^7.0.3 + version: 7.0.3 + npm-run-all: + specifier: ^4.1.5 + version: 4.1.5 + tsx: + specifier: ^4.7.0 + version: 4.7.0 + typescript: + specifier: ^5.0.2 + version: 5.3.3 + examples/azure-functions-with-trpc: dependencies: '@azure/functions': @@ -339,6 +404,12 @@ packages: resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} dev: true + /@di-extra/inversify@0.2.0: + resolution: {integrity: sha512-R37Jp6nIgFcAlRyWbsK6oQq7nwujCFxb5QvOE4Q78F9AU22VgPw11VAeouZNyBCR9q+7UM8siYJJ3Yv1ZyOetw==} + dependencies: + inversify: 6.0.2 + dev: false + /@esbuild/aix-ppc64@0.19.11: resolution: {integrity: sha512-FnzU0LyE3ySQk7UntJO4+qIiQgI7KoODnZg5xzXIrFJlKd2P2gwHsHY4927xj9y5PJmJSzULiUCWmv7iWnNa7g==} engines: {node: '>=12'} @@ -2890,6 +2961,10 @@ packages: side-channel: 1.0.4 dev: true + /inversify@6.0.2: + resolution: {integrity: sha512-i9m8j/7YIv4mDuYXUAcrpKPSaju/CIly9AHK5jvCBeoiM/2KEsuCQTTP+rzSWWpLYWRukdXFSl6ZTk2/uumbiA==} + dev: false + /ipaddr.js@1.9.1: resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} engines: {node: '>= 0.10'} @@ -4020,6 +4095,10 @@ packages: engines: {node: '>= 12.13.0'} dev: false + /reflect-metadata@0.2.1: + resolution: {integrity: sha512-i5lLI6iw9AU3Uu4szRNPPEkomnkjRTaVt9hy/bn5g/oSzekBSMeLZblcjP74AW0vBabqERLLIrz+gR8QYR54Tw==} + dev: false + /regexp.prototype.flags@1.5.1: resolution: {integrity: sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==} engines: {node: '>= 0.4'} diff --git a/vitest.config.ts b/vitest.config.ts index 7c484909..6662083a 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -8,6 +8,11 @@ export default defineConfig({ exclude: [ ...configDefaults.coverage.exclude ?? [], 'scripts', + 'examples', + /** + * Ignore tRPC plugins, it's unstable yet. + */ + 'packages/trpc-azure-functions', ] }, },