File tree Expand file tree Collapse file tree 3 files changed +5
-9
lines changed Expand file tree Collapse file tree 3 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ export default function (plop: NodePlopAPI) {
83
83
cli ( 'yarn config set nodeLinker node-modules' ) ,
84
84
cli ( 'yarn plugin import interactive-tools' ) ,
85
85
cli ( 'yarn' ) ,
86
- cli ( 'yarn lint --fix' ) ,
86
+ cli ( 'yarn lint --fix --max-warnings 10 ' ) ,
87
87
data ?. features . includes ( 'db' ) && cli ( 'yarn migration:create initial-schema' ) ,
88
88
{
89
89
type : 'gitInit' ,
Original file line number Diff line number Diff line change @@ -7,9 +7,6 @@ import { Kysely, PostgresDialect } from 'kysely';
7
7
import type { DB } from './generated/database';
8
8
{{ else }}
9
9
{{ /inArray }}
10
- import type { {{ properCase name }} , {{ properCase name }} ConfigSchema } from './types';
11
-
12
- type Config = {{ properCase name }} ConfigSchema;
13
10
14
11
export function service(): {{ properCase name }} ['Service'] {
15
12
const base = useService<{{properCase name}}[' ServiceLocals' ]>();
@@ -21,13 +18,13 @@ export function service(): {{properCase name}}['Service'] {
21
18
{{ #inArray features ' db' }}
22
19
const db = new Kysely<DB >({
23
20
dialect: new PostgresDialect({
24
- pool: new Pool(app.locals.config.get< Config [ ' db ' ]>('db') as Config['db'] ),
21
+ pool: new Pool(app.locals.config.db ),
25
22
}),
26
23
});
27
24
{{ /inArray }}
28
25
29
26
{{ #inArray features ' redis' }}
30
- const { enabled: redisEnabled, ...redisConfig } = app.locals.config.get< Config [ ' redis' ]>('redis') || {};
27
+ const { enabled: redisEnabled, ...redisConfig } = app.locals.config.redis || {};
31
28
const redis = redisEnabled ? new Redis(redisConfig) : undefined;
32
29
{{ /inArray }}
33
30
Original file line number Diff line number Diff line change 2
2
{{ #inArray features ' redis' }} import type { Redis } from 'ioredis';{{ /inArray }}
3
3
import type {
4
4
RequestLocals,
5
- RequestWithApp,
6
- Service,
7
- ServiceExpress,
8
5
ServiceLocals,
9
6
ServiceTypes,
10
7
} from '@openapi-typescript-infra/service';
@@ -14,6 +11,8 @@ import type { DB } from '../generated/database';
14
11
{{ /inArray }}
15
12
import type { operationHandlers } from '../generated/service';
16
13
14
+ import type { {{ properCase name }} , {{ properCase name }} ConfigSchema } from './types';
15
+
17
16
export interface {{ properCase name }} Locals extends ServiceLocals<{{properCase name}}ConfigSchema> {
18
17
{{ #inArray features ' db' }} db: Kysely<DB >;
19
18
{{ /inArray }} {{ #inArray features ' redis' }} redis?: Redis;
You can’t perform that action at this time.
0 commit comments