-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Add API Extractor API reports as a CI check #11215
Merged
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
55a6351
add api extractor
phryneas f909921
add api reports
phryneas e1e2fbb
add workflow
phryneas 0426c84
formatting
phryneas be151b0
package lock
phryneas ebad71b
Merge remote-tracking branch 'origin/main' into pr/api-extractor
phryneas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
## API Report File for "@apollo/client" | ||
|
||
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). | ||
|
||
```ts | ||
|
||
// @public (undocumented) | ||
interface ErrorCodes { | ||
// (undocumented) | ||
[key: number]: { | ||
file: string; | ||
condition?: string; | ||
message?: string; | ||
}; | ||
} | ||
|
||
// @public (undocumented) | ||
export function loadDevMessages(): void; | ||
|
||
// Warning: (ae-forgotten-export) The symbol "ErrorCodes" needs to be exported by the entry point index.d.ts | ||
// | ||
// @public (undocumented) | ||
export function loadErrorMessageHandler(...errorCodes: ErrorCodes[]): ((message: string | number, args: unknown[]) => string | undefined) & ErrorCodes; | ||
|
||
// @public (undocumented) | ||
export function loadErrorMessages(): void; | ||
|
||
// (No @packageDocumentation comment for this package) | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
## API Report File for "@apollo/client" | ||
|
||
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). | ||
|
||
```ts | ||
|
||
import type { ExecutionResult } from 'graphql'; | ||
import type { GraphQLError } from 'graphql'; | ||
import type { GraphQLErrorExtensions } from 'graphql'; | ||
|
||
// @public (undocumented) | ||
export class ApolloError extends Error { | ||
constructor({ graphQLErrors, protocolErrors, clientErrors, networkError, errorMessage, extraInfo, }: ApolloErrorOptions); | ||
// (undocumented) | ||
clientErrors: ReadonlyArray<Error>; | ||
// (undocumented) | ||
extraInfo: any; | ||
// (undocumented) | ||
graphQLErrors: GraphQLErrors; | ||
// (undocumented) | ||
message: string; | ||
// (undocumented) | ||
name: string; | ||
// Warning: (ae-forgotten-export) The symbol "ServerParseError" needs to be exported by the entry point index.d.ts | ||
// Warning: (ae-forgotten-export) The symbol "ServerError" needs to be exported by the entry point index.d.ts | ||
// | ||
// (undocumented) | ||
networkError: Error | ServerParseError | ServerError | null; | ||
// (undocumented) | ||
protocolErrors: ReadonlyArray<{ | ||
message: string; | ||
extensions?: GraphQLErrorExtensions[]; | ||
}>; | ||
} | ||
|
||
// @public (undocumented) | ||
export interface ApolloErrorOptions { | ||
// (undocumented) | ||
clientErrors?: ReadonlyArray<Error>; | ||
// (undocumented) | ||
errorMessage?: string; | ||
// (undocumented) | ||
extraInfo?: any; | ||
// (undocumented) | ||
graphQLErrors?: ReadonlyArray<GraphQLError>; | ||
// (undocumented) | ||
networkError?: Error | ServerParseError | ServerError | null; | ||
// (undocumented) | ||
protocolErrors?: ReadonlyArray<{ | ||
message: string; | ||
extensions?: GraphQLErrorExtensions[]; | ||
}>; | ||
} | ||
|
||
// @public (undocumented) | ||
interface DefaultContext extends Record<string, any> { | ||
} | ||
|
||
// Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts | ||
// | ||
// @public (undocumented) | ||
interface ExecutionPatchIncrementalResult<TData = Record<string, any>, TExtensions = Record<string, any>> extends ExecutionPatchResultBase { | ||
// (undocumented) | ||
data?: never; | ||
// (undocumented) | ||
errors?: never; | ||
// (undocumented) | ||
extensions?: never; | ||
// Warning: (ae-forgotten-export) The symbol "IncrementalPayload" needs to be exported by the entry point index.d.ts | ||
// | ||
// (undocumented) | ||
incremental?: IncrementalPayload<TData, TExtensions>[]; | ||
} | ||
|
||
// @public (undocumented) | ||
interface ExecutionPatchInitialResult<TData = Record<string, any>, TExtensions = Record<string, any>> extends ExecutionPatchResultBase { | ||
// (undocumented) | ||
data: TData | null | undefined; | ||
// (undocumented) | ||
errors?: ReadonlyArray<GraphQLError>; | ||
// (undocumented) | ||
extensions?: TExtensions; | ||
// (undocumented) | ||
incremental?: never; | ||
} | ||
|
||
// Warning: (ae-forgotten-export) The symbol "ExecutionPatchInitialResult" needs to be exported by the entry point index.d.ts | ||
// Warning: (ae-forgotten-export) The symbol "ExecutionPatchIncrementalResult" needs to be exported by the entry point index.d.ts | ||
// | ||
// @public (undocumented) | ||
type ExecutionPatchResult<TData = Record<string, any>, TExtensions = Record<string, any>> = ExecutionPatchInitialResult<TData, TExtensions> | ExecutionPatchIncrementalResult<TData, TExtensions>; | ||
|
||
// @public (undocumented) | ||
interface ExecutionPatchResultBase { | ||
// (undocumented) | ||
hasNext?: boolean; | ||
} | ||
|
||
// Warning: (ae-forgotten-export) The symbol "SingleExecutionResult" needs to be exported by the entry point index.d.ts | ||
// Warning: (ae-forgotten-export) The symbol "ExecutionPatchResult" needs to be exported by the entry point index.d.ts | ||
// | ||
// @public (undocumented) | ||
type FetchResult<TData = Record<string, any>, TContext = Record<string, any>, TExtensions = Record<string, any>> = SingleExecutionResult<TData, TContext, TExtensions> | ExecutionPatchResult<TData, TExtensions>; | ||
|
||
// Warning: (ae-forgotten-export) The symbol "FetchResult" needs to be exported by the entry point index.d.ts | ||
// | ||
// @public (undocumented) | ||
type FetchResultWithSymbolExtensions<T> = FetchResult<T> & { | ||
extensions: Record<string | symbol, any>; | ||
}; | ||
|
||
// @public (undocumented) | ||
export type GraphQLErrors = ReadonlyArray<GraphQLError>; | ||
|
||
// Warning: (ae-forgotten-export) The symbol "FetchResultWithSymbolExtensions" needs to be exported by the entry point index.d.ts | ||
// | ||
// @public (undocumented) | ||
export function graphQLResultHasProtocolErrors<T>(result: FetchResult<T>): result is FetchResultWithSymbolExtensions<T>; | ||
|
||
// @public (undocumented) | ||
interface IncrementalPayload<TData, TExtensions> { | ||
// (undocumented) | ||
data: TData | null; | ||
// (undocumented) | ||
errors?: ReadonlyArray<GraphQLError>; | ||
// (undocumented) | ||
extensions?: TExtensions; | ||
// (undocumented) | ||
label?: string; | ||
// Warning: (ae-forgotten-export) The symbol "Path" needs to be exported by the entry point index.d.ts | ||
// | ||
// (undocumented) | ||
path: Path; | ||
} | ||
|
||
// @public (undocumented) | ||
export function isApolloError(err: Error): err is ApolloError; | ||
|
||
// @public (undocumented) | ||
export type NetworkError = Error | ServerParseError | ServerError | null; | ||
|
||
// @public (undocumented) | ||
type Path = ReadonlyArray<string | number>; | ||
|
||
// @public (undocumented) | ||
export const PROTOCOL_ERRORS_SYMBOL: unique symbol; | ||
|
||
// @public (undocumented) | ||
type ServerError = Error & { | ||
response: Response; | ||
result: Record<string, any> | string; | ||
statusCode: number; | ||
}; | ||
|
||
// @public (undocumented) | ||
type ServerParseError = Error & { | ||
response: Response; | ||
statusCode: number; | ||
bodyText: string; | ||
}; | ||
|
||
// Warning: (ae-forgotten-export) The symbol "DefaultContext" needs to be exported by the entry point index.d.ts | ||
// | ||
// @public (undocumented) | ||
interface SingleExecutionResult<TData = Record<string, any>, TContext = DefaultContext, TExtensions = Record<string, any>> extends ExecutionResult<TData, TExtensions> { | ||
// (undocumented) | ||
context?: TContext; | ||
// (undocumented) | ||
data?: TData | null; | ||
} | ||
|
||
// (No @packageDocumentation comment for this package) | ||
|
||
``` |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can read up on this warning here:
https://api-extractor.com/pages/messages/ae-forgotten-export/
TLDR: The type is not public, but used by a public export.
That means multiple things:
declaration: true
, they might get a TS build error (along the lines of "export cannot be named")On the other hand, it might be perfectly fine - we shouldn't add every helper type to our public api, as it would add tons of stuff to keep supporting for backwards compatibility.
=> The warnings are here, we should consider them on a per-case basis (mostly when we add new stuff), but not take them too seriously.