mirror of
https://github.com/primer/css.git
synced 2024-12-23 22:24:11 +03:00
build: run selector diff report in prepublish
This commit is contained in:
parent
183f73f3ce
commit
1b82944060
@ -8,6 +8,9 @@ npx action-status --context="$PUBLISH_STATUS_CONTEXT" \
|
||||
# generate the build directory
|
||||
npm run dist
|
||||
|
||||
# run the selector diff report
|
||||
script/selector-diff-report
|
||||
|
||||
# TODO: remove this in v13
|
||||
mkdir -p build
|
||||
cp dist/primer.css build/build.css
|
||||
|
@ -10,8 +10,10 @@ old_path="primer/build/data.json"
|
||||
log "Pulling the old $old_path ..."
|
||||
curl -sL "https://unpkg.com/$old_path" > before.json
|
||||
|
||||
log "Building the stats locally..."
|
||||
npm run dist
|
||||
if [[ ! -f dist/stats/primer.json ]]; then
|
||||
log "Building the stats locally..."
|
||||
npm run dist
|
||||
fi
|
||||
cp dist/stats/primer.json after.json
|
||||
|
||||
function list_selectors() {
|
||||
@ -21,5 +23,8 @@ function list_selectors() {
|
||||
jq -r '.cssstats.selectors.values[]' before.json > before.txt
|
||||
jq -r '.selectors.values[]' after.json > after.txt
|
||||
|
||||
echo "[selector report] diff:"
|
||||
(diff before.txt after.txt | tee selector-diff.log) || log "(no diff!)"
|
||||
echo "[selector report] end"
|
||||
|
||||
rm {before,after}.{json,txt}
|
||||
|
Loading…
Reference in New Issue
Block a user