Snapshot the public API and report changes against the latest release - #367
Merged
Merged
Conversation
Source/api-surface.json records every export of every typed subpath with its declaration text; yarn ci fails when the built declarations differ, so a pull request shows exactly which exports it adds, removes, or changes. A CI step reports removals, changes, and additions against the latest published release in the job summary. Closes #216.
…shot A missing or unreachable baseline is stated in the report instead of failing the build. Unknown export shapes and unresolved exports now fail, re-exports of other packages are recorded by name, and ordering is locale-independent.
External re-exports are recorded as package#name from the export syntax, so the snapshot holds no machine paths and the baseline does not need its dependencies installed; it is still unpacked below node_modules so they resolve. Exporting a value with export type now changes the entry. Plain export targets other than CSS and JSON fail, and typed JSON subpaths are included.
export type * now marks the values it withholds. A package re-export is judged only by this package's aliases, so it reads the same whatever the package does internally. A namespace re-export of an internal module lists its export names, and the report removes the unpacked baseline on every exit.
…orts A namespace re-export of an internal module lists each member with its declaration, so a member's change shows up. A barrel's own export shadows its type-only star export, and a star-export cycle no longer clears the type-only mark.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The public API of
@cratis/componentsis now recorded, so each pull request shows what it changes in the API and how it compares with the last release.Added
Source/api-surface.jsonrecords every export of every typed package subpath, printed from its declarations with comments and whitespace normalized.yarn ciinSourcefails when the snapshot differs from the source, naming each added, removed or changed export. Runyarn generate-api-surfaceafter a deliberate API change and review the snapshot diff with the rest of the pull request. (Add packed public API snapshots and semver surface diffs #216)@cratis/components@lateston npm. The report is informational. When no published baseline can be fetched, it says so instead of failing the build. (Add packed public API snapshots and semver surface diffs #216)Closes #216.