From 32e34ab0a6fff64a2b68f69ebe593994e3c6a7fe Mon Sep 17 00:00:00 2001 From: David Glasser Date: Thu, 5 May 2022 15:00:22 -0700 Subject: [PATCH] Fix a bundle of dependency issues 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. --- CHANGELOG.md | 2 +- package-lock.json | 11 +++++++---- packages/apollo-datasource-rest/package.json | 4 ++-- packages/apollo-datasource-rest/src/RESTDataSource.ts | 3 +-- packages/apollo-datasource-rest/tsconfig.json | 1 - packages/apollo-server-types/package.json | 1 + packages/apollo-server/package.json | 1 + 7 files changed, 13 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f293a53441..727ac01131e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ The version headers in this history reflect the versions of Apollo Server itself ## vNEXT -- _Nothing yet! Stay tuned._ +- Add a few missing dependencies to packages. [PR #FIXME](https://github.com/apollographql/apollo-server/pull/FIXME) ## v3.7.0 diff --git a/package-lock.json b/package-lock.json index ebfba486c82..187eec4cc26 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21205,11 +21205,11 @@ "apollo-server-errors": "file:../apollo-server-errors", "http-cache-semantics": "^4.1.0" }, - "devDependencies": { - "apollo-server-types": "file:../apollo-server-types" - }, "engines": { "node": ">=12.0" + }, + "peerDependencies": { + "graphql": "^15.3.0 || ^16.0.0" } }, "packages/apollo-reporting-protobuf": { @@ -21223,6 +21223,7 @@ "version": "3.7.0", "license": "MIT", "dependencies": { + "@types/express": "4.17.13", "apollo-server-core": "file:../apollo-server-core", "apollo-server-express": "file:../apollo-server-express", "express": "^4.17.1" @@ -21587,6 +21588,7 @@ "version": "3.5.3", "license": "MIT", "dependencies": { + "@apollo/utils.logger": "^1.0.0", "apollo-reporting-protobuf": "file:../apollo-reporting-protobuf", "apollo-server-caching": "file:../apollo-server-caching", "apollo-server-env": "file:../apollo-server-env" @@ -26994,7 +26996,6 @@ "apollo-server-caching": "file:../apollo-server-caching", "apollo-server-env": "file:../apollo-server-env", "apollo-server-errors": "file:../apollo-server-errors", - "apollo-server-types": "file:../apollo-server-types", "http-cache-semantics": "^4.1.0" } }, @@ -27007,6 +27008,7 @@ "apollo-server": { "version": "file:packages/apollo-server", "requires": { + "@types/express": "4.17.13", "apollo-server-core": "file:../apollo-server-core", "apollo-server-express": "file:../apollo-server-express", "apollo-server-integration-testsuite": "file:../apollo-server-integration-testsuite", @@ -27229,6 +27231,7 @@ "apollo-server-types": { "version": "file:packages/apollo-server-types", "requires": { + "@apollo/utils.logger": "^1.0.0", "apollo-reporting-protobuf": "file:../apollo-reporting-protobuf", "apollo-server-caching": "file:../apollo-server-caching", "apollo-server-env": "file:../apollo-server-env" diff --git a/packages/apollo-datasource-rest/package.json b/packages/apollo-datasource-rest/package.json index d734c6c9d03..ea2505ede70 100644 --- a/packages/apollo-datasource-rest/package.json +++ b/packages/apollo-datasource-rest/package.json @@ -24,7 +24,7 @@ "apollo-server-errors": "file:../apollo-server-errors", "http-cache-semantics": "^4.1.0" }, - "devDependencies": { - "apollo-server-types": "file:../apollo-server-types" + "peerDependencies": { + "graphql": "^15.3.0 || ^16.0.0" } } diff --git a/packages/apollo-datasource-rest/src/RESTDataSource.ts b/packages/apollo-datasource-rest/src/RESTDataSource.ts index 591464eaf9e..4d016dcd4a9 100644 --- a/packages/apollo-datasource-rest/src/RESTDataSource.ts +++ b/packages/apollo-datasource-rest/src/RESTDataSource.ts @@ -10,8 +10,6 @@ import { fetch, } from 'apollo-server-env'; -import type { ValueOrPromise } from 'apollo-server-types'; - import { DataSource, DataSourceConfig } from 'apollo-datasource'; import { HTTPCache } from './HTTPCache'; @@ -22,6 +20,7 @@ import { ForbiddenError, } from 'apollo-server-errors'; +type ValueOrPromise = T | Promise; declare module 'apollo-server-env/dist/fetch' { interface RequestInit { cacheOptions?: diff --git a/packages/apollo-datasource-rest/tsconfig.json b/packages/apollo-datasource-rest/tsconfig.json index 1e054329388..83c0c7fe9c3 100644 --- a/packages/apollo-datasource-rest/tsconfig.json +++ b/packages/apollo-datasource-rest/tsconfig.json @@ -10,6 +10,5 @@ { "path": "../apollo-datasource" }, { "path": "../apollo-server-caching" }, { "path": "../apollo-server-errors" }, - { "path": "../apollo-server-types" }, ] } diff --git a/packages/apollo-server-types/package.json b/packages/apollo-server-types/package.json index c51deaeb948..abf2a1c148e 100644 --- a/packages/apollo-server-types/package.json +++ b/packages/apollo-server-types/package.json @@ -11,6 +11,7 @@ "node": ">=12.0" }, "dependencies": { + "@apollo/utils.logger": "^1.0.0", "apollo-reporting-protobuf": "file:../apollo-reporting-protobuf", "apollo-server-caching": "file:../apollo-server-caching", "apollo-server-env": "file:../apollo-server-env" diff --git a/packages/apollo-server/package.json b/packages/apollo-server/package.json index b7f75c27d04..e2ac000025b 100644 --- a/packages/apollo-server/package.json +++ b/packages/apollo-server/package.json @@ -22,6 +22,7 @@ }, "homepage": "https://github.com/apollographql/apollo-server#readme", "dependencies": { + "@types/express": "4.17.13", "apollo-server-core": "file:../apollo-server-core", "apollo-server-express": "file:../apollo-server-express", "express": "^4.17.1"