Skip to content

Commit

Permalink
Support NestJS v9 (#895)
Browse files Browse the repository at this point in the history
  • Loading branch information
x1127 committed Aug 4, 2022
1 parent e674ed5 commit 9c68ec5
Show file tree
Hide file tree
Showing 27 changed files with 649 additions and 7,474 deletions.
28 changes: 0 additions & 28 deletions .commitlintrc.json

This file was deleted.

20 changes: 17 additions & 3 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
---
kind: pipeline
type: docker
name: default
name: node-16

steps:
- name: Build & Test
image: node:15-alpine
- name: build & test
image: node:16-alpine
commands:
- npm ci
- npm run build --if-present
- npm test

---
kind: pipeline
type: docker
name: node-18

steps:
- name: build & test
image: node:18-alpine
commands:
- npm ci
- npm run build --if-present
Expand Down
26 changes: 0 additions & 26 deletions .eslintrc.js

This file was deleted.

6 changes: 0 additions & 6 deletions .github/dependabot.yml

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/build-test.yml

This file was deleted.

1 change: 0 additions & 1 deletion .husky/.gitignore

This file was deleted.

3 changes: 0 additions & 3 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
lib
sample
website
.commitlintrc.json
.eslintrc.js
.prettierrc
package-lock.json
renovate.json
tsconfig.json
tsconfig.typedoc.json
5 changes: 3 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"trailingComma": "all",
"singleQuote": true
"printWidth": 80,
"singleQuote": true,
"arrowParens": "avoid"
}
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 - present Alexander Bukhalo (a@bukhalo.com)
Copyright (c) 2019 - present Robot Mafia Inc. (opensource@robot-mafia.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion lib/decorators/core/scene.decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { SCENE_METADATA } from '../../telegraf.constants';

export const Scene = (
sceneId: string,
options?: SceneOptions<any>,
options?: SceneOptions<any>
): ClassDecorator =>
SetMetadata<string, SceneMetadata>(SCENE_METADATA, {
sceneId,
Expand Down
2 changes: 1 addition & 1 deletion lib/decorators/core/wizard.decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { SCENE_METADATA } from '../../telegraf.constants';

export const Wizard = (
sceneId: string,
options?: SceneOptions<any>,
options?: SceneOptions<any>
): ClassDecorator =>
SetMetadata<string, SceneMetadata>(SCENE_METADATA, {
sceneId,
Expand Down
2 changes: 1 addition & 1 deletion lib/decorators/params/context.decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { createTelegrafParamDecorator } from '../../utils/param-decorator.util';
import { TelegrafParamtype } from '../../enums/telegraf-paramtype.enum';

export const Context: () => ParameterDecorator = createTelegrafParamDecorator(
TelegrafParamtype.CONTEXT,
TelegrafParamtype.CONTEXT
);

export const Ctx = Context;
2 changes: 1 addition & 1 deletion lib/decorators/params/message.decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ export function Message(
) {
return createTelegrafPipesParamDecorator(TelegrafParamtype.MESSAGE)(
property,
...pipes,
...pipes
);
}
2 changes: 1 addition & 1 deletion lib/decorators/params/next.decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import { createTelegrafParamDecorator } from '../../utils/param-decorator.util';
import { TelegrafParamtype } from '../../enums/telegraf-paramtype.enum';

export const Next: () => ParameterDecorator = createTelegrafParamDecorator(
TelegrafParamtype.NEXT,
TelegrafParamtype.NEXT
);
2 changes: 1 addition & 1 deletion lib/decorators/params/sender.decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ export function Sender(
) {
return createTelegrafPipesParamDecorator(TelegrafParamtype.SENDER)(
property,
...pipes,
...pipes
);
}
2 changes: 1 addition & 1 deletion lib/execution-context/telegraf-execution-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class TelegrafExecutionContext
const tgContext = new TelegrafExecutionContext(
context.getArgs(),
context.getClass(),
context.getHandler(),
context.getHandler()
);
tgContext.setType(type);
return tgContext;
Expand Down
2 changes: 1 addition & 1 deletion lib/factories/telegraf-params-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export class TelegrafParamsFactory implements ParamsFactory {
exchangeKeyForValue(
type: TelegrafParamtype,
data: ParamData,
args: unknown[],
args: unknown[]
): unknown {
const ctx = args[0] as Context;
const next = args[1] as Function;
Expand Down
8 changes: 4 additions & 4 deletions lib/services/base-explorer.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { flattenDeep, identity, isEmpty } from 'lodash';
export class BaseExplorerService {
getModules(
modulesContainer: Map<string, Module>,
include: Function[],
include: Function[]
): Module[] {
if (!include || isEmpty(include)) {
return [...modulesContainer.values()];
Expand All @@ -15,15 +15,15 @@ export class BaseExplorerService {

includeWhitelisted(
modulesContainer: Map<string, Module>,
include: Function[],
include: Function[]
): Module[] {
const modules = [...modulesContainer.values()];
return modules.filter(({ metatype }) => include.includes(metatype));
}

flatMap<T>(
modules: Module[],
callback: (instance: InstanceWrapper, moduleRef: Module) => T | T[],
callback: (instance: InstanceWrapper, moduleRef: Module) => T | T[]
): T[] {
const visitedModules = new Set<Module>();

Expand All @@ -36,7 +36,7 @@ export class BaseExplorerService {
}

const providers = [...moduleRef.providers.values()];
const defined = providers.map((wrapper) => callback(wrapper, moduleRef));
const defined = providers.map(wrapper => callback(wrapper, moduleRef));

const imported: (T | T[])[] = moduleRef.imports?.size
? [...moduleRef.imports.values()].reduce((prev, cur) => {
Expand Down
Loading

1 comment on commit 9c68ec5

@vercel
Copy link

@vercel vercel bot commented on 9c68ec5 Aug 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nestjs-telegraf – ./

nestjs-telegraf-bukhalo.vercel.app
nestjs-telegraf-git-master-bukhalo.vercel.app
nestjs-telegraf.vercel.app

Please sign in to comment.