Skip to content

Commit

Permalink
fix: types
Browse files Browse the repository at this point in the history
  • Loading branch information
9renpoto committed Jan 20, 2024
1 parent 303b036 commit 26eb5db
Show file tree
Hide file tree
Showing 16 changed files with 43 additions and 35 deletions.
5 changes: 2 additions & 3 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
"scripts": {
"build": "nest build",
"clean": "rimraf dist",
"prebuild": "rimraf dist",
"lint": "tsc -p . --noEmit",
"start": "nest start",
"start:dev": "nest start --watch",
"test": "jest"
"start": "nest start --watch"
},
"dependencies": {
"@apollo/server": "^4.10.0",
Expand Down
14 changes: 7 additions & 7 deletions example/src/schema.gql
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@ interface Node {
id: ID!
}

type PageInfo {
startCursor: String
endCursor: String
hasPreviousPage: Boolean!
hasNextPage: Boolean!
}

type Recipe implements Node {
id: ID!
title: String!
Expand All @@ -26,6 +19,13 @@ A date-time string at UTC, such as 2019-12-03T09:54:33Z, compliant with the date
"""
scalar DateTime

type PageInfo {
startCursor: String
endCursor: String
hasPreviousPage: Boolean!
hasNextPage: Boolean!
}

type RecipesConnection {
pageInfo: PageInfo!
edges: [RecipesEdge!]!
Expand Down
2 changes: 1 addition & 1 deletion example/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "./tsconfig.json",
"exclude": ["node_modules", "test", "dist", "**/*spec.ts"]
"exclude": ["__tests__/*", "*.spec.ts"]
}
4 changes: 2 additions & 2 deletions example/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"declaration": true,
"noEmit": false,
"outDir": "./dist",
"removeComments": true,
"sourceMap": true
},
"exclude": ["node_modules", "dist"],
"extends": "../tsconfig.json"
"exclude": ["__tests__/*", "*.spec.ts"]
}
2 changes: 1 addition & 1 deletion packages/nestjs-firebase/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"main": "lib/index.js",
"scripts": {
"build": "npm run clean && tsc -p .",
"clean": "rimraf lib",
"clean": "tsc --build --clean",
"lint": "tsc -p . --noEmit"
},
"keywords": [
Expand Down
7 changes: 5 additions & 2 deletions packages/nestjs-firebase/src/firebase.interface.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import type { Type } from "@nestjs/common";
import type { ModuleMetadata } from "@nestjs/common/interfaces";
import type {
FactoryProvider,
ModuleMetadata,
} from "@nestjs/common/interfaces";
import * as firebaseAdmin from "firebase-admin";
import { AppOptions } from "firebase-admin";

Expand All @@ -12,7 +15,7 @@ export type FirebaseModuleAsyncOptions = {
useFactory?: (
...args: unknown[]
) => Promise<FirebaseModuleOptions> | FirebaseModuleOptions;
inject?: unknown[];
inject?: FactoryProvider<FirebaseModuleOptions>["inject"];
useExisting?: Type<FirebaseModuleOptionsFactory>;
} & Pick<ModuleMetadata, "imports">;

Expand Down
2 changes: 1 addition & 1 deletion packages/nestjs-firebase/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"outDir": "./lib",
"noEmit": false
},
"exclude": ["node_modules", "**/*.spec.ts", "dist"],
"exclude": ["__tests__/*", "*.spec.ts"],
"include": ["src"]
}
2 changes: 1 addition & 1 deletion packages/nestjs-graphql-relay/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"main": "lib/index.js",
"scripts": {
"build": "npm run clean && tsc -p .",
"clean": "rimraf lib",
"clean": "tsc --build --clean",
"lint": "tsc -p . --noEmit"
},
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion packages/nestjs-graphql-relay/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"outDir": "./lib",
"noEmit": false
},
"exclude": ["node_modules", "dist"],
"exclude": ["__tests__/*", "*.spec.ts"],
"include": ["src"]
}
7 changes: 2 additions & 5 deletions packages/nestjs-slack-webhook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,10 @@
"main": "lib/index.js",
"scripts": {
"build": "npm run clean && tsc -p .",
"clean": "rimraf lib",
"clean": "tsc --build --clean",
"lint": "tsc -p . --noEmit"
},
"keywords": [
"nest",
"slack-webhook"
],
"keywords": ["nest", "slack-webhook"],
"peerDependencies": {
"@nestjs/common": "^10.0.0",
"@slack/webhook": "^6.0.0 || ^7.0.0"
Expand Down
10 changes: 7 additions & 3 deletions packages/nestjs-slack-webhook/src/slackOptions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { ModuleMetadata, Type } from "@nestjs/common/interfaces";
import type {
FactoryProvider,
ModuleMetadata,
Type,
} from "@nestjs/common/interfaces";
import { IncomingWebhookDefaultArguments } from "@slack/webhook";

export interface SlackOptions extends IncomingWebhookDefaultArguments {
Expand All @@ -10,8 +14,8 @@ export interface SlackOptionsFactory {
}

export interface SlackAsyncOptions extends Pick<ModuleMetadata, "imports"> {
inject?: unknown[];
inject?: FactoryProvider["inject"];
useClass?: Type<SlackOptionsFactory>;
useExisting?: Type<SlackOptionsFactory>;
useFactory?: (...args: unknown[]) => Promise<SlackOptions> | SlackOptions;
useFactory?: FactoryProvider<SlackOptions>["useFactory"];
}
2 changes: 1 addition & 1 deletion packages/nestjs-slack-webhook/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"outDir": "./lib",
"noEmit": false
},
"exclude": ["node_modules", "dist"],
"exclude": ["__tests__/*", "*.spec.ts"],
"include": ["src"]
}
2 changes: 1 addition & 1 deletion packages/nestjs-zendesk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"main": "lib/index.js",
"scripts": {
"build": "npm run clean && tsc -p .",
"clean": "rimraf lib",
"clean": "tsc --build --clean",
"lint": "tsc -p . --noEmit"
},
"keywords": [
Expand Down
12 changes: 7 additions & 5 deletions packages/nestjs-zendesk/src/zendesk.interface.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import type { ModuleMetadata, Type } from "@nestjs/common/interfaces";
import type {
FactoryProvider,
ModuleMetadata,
Type,
} from "@nestjs/common/interfaces";
import type { ZendeskClientOptions } from "node-zendesk";

export interface ZendeskOptionsFactory {
createOptions(): Promise<ZendeskClientOptions> | ZendeskClientOptions;
}

export interface ZendeskAsyncOptions extends Pick<ModuleMetadata, "imports"> {
inject?: unknown[];
inject?: FactoryProvider["inject"];
useClass?: Type<ZendeskOptionsFactory>;
useExisting?: Type<ZendeskOptionsFactory>;
useFactory?: (
...args: unknown[]
) => Promise<ZendeskClientOptions> | ZendeskClientOptions;
useFactory?: FactoryProvider<ZendeskClientOptions>["useFactory"];
}
1 change: 1 addition & 0 deletions packages/nestjs-zendesk/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"outDir": "./lib",
"noEmit": false
},
"exclude": ["__tests__/*", "*.spec.ts"],
"include": ["src"]
}
4 changes: 3 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "@9renpoto/tsconfig",
"compilerOptions": {
"emitDecoratorMetadata": true,
Expand All @@ -7,6 +8,7 @@
"moduleResolution": "node",
"noEmit": true,
"strictPropertyInitialization": false,
"target": "ESNext"
"target": "ESNext",
"skipLibCheck": true
}
}

0 comments on commit 26eb5db

Please sign in to comment.