💥✨ Add include/exclude cli-snapshot options & deprecate files/ignore #498
Merged
💥✨ Add include/exclude cli-snapshot options & deprecate files/ignore #498
Conversation
Contributor
|
Is the todo for this PR or a follow up task? We have to update docs.percy.io too |
Contributor
|
The amount of times I type that is too much. We need to build docs from source 😩 |
Contributor
Author
|
Both. I need to update the readme for this PR and also the docs site |
The `files` and `ignore` options were static snapshot only options, while the new `include` and `exclude` options will work for both static snapshots and snapshot list files. These two new options also accept string patterns, regular expressions, and functions, in addition to globs. References to "pages" were replaced with references to "snapshots" instead. Since the merger of core `#capture()` and `#snapshot()` methods, the distinction is moot. Other small naming changes were made as well in reference to internal methods and utils. The static snapshots method will now only pass strings to globby, while continuing to pass all include/exclude options on to the static mapping util. Snapshot list files can now also accept top-level include, exclude, and base-url options.
b3d563c to
1ab58f0
Compare
Contributor
Author
|
Readme here updated. Docs site will be updated along with the next release |
Robdel12
approved these changes
Aug 18, 2021
Contributor
Robdel12
left a comment
There was a problem hiding this comment.
🔥 🏁 Just keeps getting better
samarsault
pushed a commit
that referenced
this pull request
Mar 3, 2023
Bumps [@percy/core](https://github.com/percy/cli/tree/HEAD/packages/core) from 1.1.0 to 1.1.2. - [Release notes](https://github.com/percy/cli/releases) - [Commits](https://github.com/percy/cli/commits/v1.1.2/packages/core) --- updated-dependencies: - dependency-name: "@percy/core" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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.
What is this?
This PR brings more robust filtering options to the
percy snaphotcommand!Building off of the recent work around adding deprecation utils and fixing various small bugs, both the previous
filesandignoreflags are now deprecated and will log as such. The preferred options are nowincludeandexclude.These new options are more than just a name change. The flags also work for filtering lists of snapshots when using a single file with the snapshot command. Plus, in addition to the existing glob support, the new options also allow filtering using a regular expression, a regex-like string pattern, or even a filter function. Snapshot list files can now also accept top-level
include,exclude, andbase-urloptions.The static snapshots method previously passed all
filesandignoreoptions to globby. Now, it will only passincludeandexcludeto globby if said options only contain strings. Allincludeandexcludeoptions will continue to be passed along to the static mapping util where new filter logic is used.The tests for the snapshot command were also split up into dedicated files covering each functionality of the command. A base test suite for common features, a directory suite for static features, and a file suite for snapshot listing features.
Slightly related — while refactoring a portion of the snapshot command, references to "pages" were replaced with references to "snapshots" instead. Since the merger of core
#capture()and#snapshot()methods, the distinction is moot. Other small naming changes were made as well in reference to internal methods and utils.