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

@types/express dependency is missing in apollo-server package #6390

Closed
Grmiade opened this issue May 5, 2022 · 1 comment · Fixed by #6393
Closed

@types/express dependency is missing in apollo-server package #6390

Grmiade opened this issue May 5, 2022 · 1 comment · Fixed by #6393

Comments

@Grmiade
Copy link

Grmiade commented May 5, 2022

When we try to generate our TS code without skipLibCheck, we have this error: Could not find a declaration file for module 'express'
The .d.ts file generated by https://github.com/apollographql/apollo-server/blob/main/packages/apollo-server/src/index.ts needs @types/express.
We should declare @types/express as dependency in the apollo-server package.

/// <reference types="node" />
import express from 'express';
import http from 'http';
import { ApolloServer as ApolloServerExpress, CorsOptions, ApolloServerExpressConfig } from 'apollo-server-express';
export * from './exports';
export interface ServerInfo {
    address: string;
    family: string;
    url: string;
    port: number | string;
    server: http.Server;
}
export declare class ApolloServer extends ApolloServerExpress {
    private cors;
    private onHealthCheck;
    private healthCheckPath;
    private httpServer;
    constructor(config: ApolloServerExpressConfig & {
        cors?: CorsOptions | boolean;
        onHealthCheck?: (req: express.Request) => Promise<any>;
        healthCheckPath?: string | null;
        stopGracePeriodMillis?: number;
    });
    private createServerInfo;
    applyMiddleware(): void;
    start(): Promise<void>;
    listen(...opts: Array<any>): Promise<ServerInfo>;
}
//# sourceMappingURL=index.d.ts.map
@glasser
Copy link
Member

glasser commented May 5, 2022

I think that's right, since express.Request is in the API. Will fix along with your other concerns.
(This stuff is all much simpler on version-4 where we don't have a zillion separate packages.)

glasser added a commit that referenced this issue May 5, 2022
Some packages were depending on other packages that were only declared
as transitive dependencies. Clean this up by adding appropriate
dependencies (or in one case, just re-declaring ValueOrPromise and
dropping the apollo-server-types dependency).

The peer dep one is a bit funny.  But "Y has a peer dep on Z" means
"when you install Y you need to install Z", and so if X depends on Y,
then when you install X you need to install Z... so sure, that means X
needs to have a peer dep on Z too, I guess.

Fixes #6389.
Fixes #6390.
Fixes #6391.
Fixes #6392.
glasser added a commit that referenced this issue May 5, 2022
Some packages were depending on other packages that were only declared
as transitive dependencies. Clean this up by adding appropriate
dependencies (or in one case, just re-declaring ValueOrPromise and
dropping the apollo-server-types dependency).

The peer dep one is a bit funny.  But "Y has a peer dep on Z" means
"when you install Y you need to install Z", and so if X depends on Y,
then when you install X you need to install Z... so sure, that means X
needs to have a peer dep on Z too, I guess.

Fixes #6389.
Fixes #6390.
Fixes #6391.
Fixes #6392.
glasser added a commit that referenced this issue May 5, 2022
Some packages were depending on other packages that were only declared
as transitive dependencies. Clean this up by adding appropriate
dependencies (or in one case, just re-declaring ValueOrPromise and
dropping the apollo-server-types dependency).

The peer dep one is a bit funny.  But "Y has a peer dep on Z" means
"when you install Y you need to install Z", and so if X depends on Y,
then when you install X you need to install Z... so sure, that means X
needs to have a peer dep on Z too, I guess.

Fixes #6389.
Fixes #6390.
Fixes #6391.
Fixes #6392.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants