|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# As far as we can tell, `npm deprecate` only deprecates currently existing |
| 4 | +# package versions. Whenever we publish a backport to AS2/AS3, the latest |
| 5 | +# version will end up not deprecated! So after publishing backport versions, we |
| 6 | +# run this script (with apollo-bot credentials). As far as we can tell you can't |
| 7 | +# use npm tokens for this so it requires you to enter a ton of OTPs. Fun! |
| 8 | +# https://stackoverflow.com/questions/74466186/keeping-npm-deprecated-packages-deprecated |
| 9 | + |
| 10 | +set -e |
| 11 | + |
| 12 | +with_replacement() { |
| 13 | + npm deprecate $1 'The `'"$1"'` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package'"'"'s functionality is now found in the `'"$2"'` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.' |
| 14 | +} |
| 15 | + |
| 16 | +with_replacement apollo-server @apollo/server |
| 17 | +with_replacement apollo-server-core @apollo/server |
| 18 | +with_replacement apollo-server-express @apollo/server |
| 19 | +with_replacement apollo-server-errors @apollo/server |
| 20 | +with_replacement apollo-server-plugin-base @apollo/server |
| 21 | +with_replacement apollo-server-types @apollo/server |
| 22 | +with_replacement apollo-datasource-rest @apollo/datasource-rest |
| 23 | +with_replacement apollo-reporting-protobuf @apollo/usage-reporting-protobuf |
| 24 | +with_replacement apollo-server-env @apollo/utils.fetcher |
| 25 | +with_replacement apollo-server-plugin-response-cache @apollo/server-plugin-response-cache |
| 26 | +with_replacement apollo-server-azure-functions @apollo/server |
| 27 | +with_replacement apollo-server-cloud-functions @apollo/server |
| 28 | +with_replacement apollo-server-cloudflare @apollo/server |
| 29 | +with_replacement apollo-server-fastify @apollo/server |
| 30 | +with_replacement apollo-server-hapi @apollo/server |
| 31 | +with_replacement apollo-server-koa @apollo/server |
| 32 | +with_replacement apollo-server-lambda @apollo/server |
| 33 | +with_replacement apollo-server-micro @apollo/server |
| 34 | + |
| 35 | +# This package isn't exactly replaced, so leave that sentence off. |
| 36 | +npm deprecate apollo-datasource 'The `apollo-datasource` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.' |
| 37 | + |
| 38 | +caching() { |
| 39 | + npm deprecate $1 'This package is part of the legacy caching implementation used by Apollo Server v2 and v3, and is no longer maintained. We recommend you switch to the newer Keyv-based implementation (which is compatible with all versions of Apollo Server). See https://www.apollographql.com/docs/apollo-server/v3/performance/cache-backends#legacy-caching-implementation for more details.' |
| 40 | +} |
| 41 | + |
| 42 | +caching apollo-server-caching |
| 43 | +caching apollo-server-cache-memcached |
| 44 | +caching apollo-server-cache-redis |
0 commit comments