|
1 | 1 | const limits = require("./.size-limits.json");
|
2 | 2 |
|
| 3 | +/* prettier-ignore */ |
| 4 | +const nameMapping = { |
| 5 | + 'import { ApolloClient, InMemoryCache, HttpLink } from "dist/main.cjs"': 'import { ApolloClient, InMemoryCache, HttpLink } from "@apollo/client" (CJS)', |
| 6 | + 'import { ApolloClient, InMemoryCache, HttpLink } from "dist/main.cjs" (production)': 'import { ApolloClient, InMemoryCache, HttpLink } from "@apollo/client" (production) (CJS)', |
| 7 | + 'import { ApolloClient, InMemoryCache, HttpLink } from "dist/index.js"': 'import { ApolloClient, InMemoryCache, HttpLink } from "@apollo/client"', |
| 8 | + 'import { ApolloClient, InMemoryCache, HttpLink } from "dist/index.js" (production)': 'import { ApolloClient, InMemoryCache, HttpLink } from "@apollo/client" (production)', |
| 9 | + 'import { ApolloProvider } from "dist/react/index.js"': 'import { ApolloProvider } from "@apollo/client/react"', |
| 10 | + 'import { ApolloProvider } from "dist/react/index.js" (production)': 'import { ApolloProvider } from "@apollo/client/react" (production)', |
| 11 | + 'import { useQuery } from "dist/react/index.js"': 'import { useQuery } from "@apollo/client/react"', |
| 12 | + 'import { useQuery } from "dist/react/index.js" (production)': 'import { useQuery } from "@apollo/client/react" (production)', |
| 13 | + 'import { useLazyQuery } from "dist/react/index.js"': 'import { useLazyQuery } from "@apollo/client/react"', |
| 14 | + 'import { useLazyQuery } from "dist/react/index.js" (production)': 'import { useLazyQuery } from "@apollo/client/react"', |
| 15 | + 'import { useMutation } from "dist/react/index.js"': 'import { useMutation } from "@apollo/client/react"', |
| 16 | + 'import { useMutation } from "dist/react/index.js" (production)': 'import { useMutation } from "@apollo/client/react" (production)', |
| 17 | + 'import { useSubscription } from "dist/react/index.js"': 'import { useSubscription } from "@apollo/client/react"', |
| 18 | + 'import { useSubscription } from "dist/react/index.js" (production)': 'import { useSubscription } from "@apollo/client/react" (production)', |
| 19 | + 'import { useSuspenseQuery } from "dist/react/index.js"': 'import { useSuspenseQuery } from "@apollo/client/react"', |
| 20 | + 'import { useSuspenseQuery } from "dist/react/index.js" (production)': 'import { useSuspenseQuery } from "@apollo/client/react" (production)', |
| 21 | + 'import { useBackgroundQuery } from "dist/react/index.js"': 'import { useBackgroundQuery } from "@apollo/client/react"', |
| 22 | + 'import { useBackgroundQuery } from "dist/react/index.js" (production)': 'import { useBackgroundQuery } from "@apollo/client/react" (production)', |
| 23 | + 'import { useLoadableQuery } from "dist/react/index.js"': 'import { useLoadableQuery } from "@apollo/client/react"', |
| 24 | + 'import { useLoadableQuery } from "dist/react/index.js" (production)': 'import { useLoadableQuery } from "@apollo/client/react" (production)', |
| 25 | + 'import { useReadQuery } from "dist/react/index.js"': 'import { useReadQuery } from "@apollo/client/react"', |
| 26 | + 'import { useReadQuery } from "dist/react/index.js" (production)': 'import { useReadQuery } from "@apollo/client/react" (production)', |
| 27 | + 'import { useFragment } from "dist/react/index.js"': 'import { useFragment } from "@apollo/client/react"', |
| 28 | + 'import { useFragment } from "dist/react/index.js" (production)': 'import { useFragment } from "@apollo/client/react" (production)', |
| 29 | +}; |
| 30 | + |
3 | 31 | const checks = [
|
4 | 32 | {
|
5 | 33 | path: "dist/apollo-client.min.cjs",
|
@@ -73,6 +101,7 @@ const checks = [
|
73 | 101 | ]
|
74 | 102 | )
|
75 | 103 | .map((value) => {
|
| 104 | + value.name = nameMapping[value.name] || value.name; |
76 | 105 | value.limit = limits[value.name];
|
77 | 106 | return value;
|
78 | 107 | });
|
|
0 commit comments