Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: postcss/autoprefixer
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 10.4.4
Choose a base ref
...
head repository: postcss/autoprefixer
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 10.4.5
Choose a head ref
  • 4 commits
  • 11 files changed
  • 2 contributors

Commits on Apr 23, 2022

  1. Fix #1446 (#1457)

    * Fix #1446
    
    * Test: cover the `utils#isPureNumber`
    SukkaW authored Apr 23, 2022
    Copy the full SHA
    355a87a View commit details
  2. Update CI config

    ai committed Apr 23, 2022
    Copy the full SHA
    f6fa524 View commit details
  3. Update dependencies

    ai committed Apr 23, 2022
    Copy the full SHA
    4ad9f72 View commit details
  4. Release 10.4.5 version

    ai committed Apr 23, 2022
    Copy the full SHA
    fdddbf3 View commit details
Showing with 320 additions and 220 deletions.
  1. +10 −8 .github/workflows/test.yml
  2. +3 −0 CHANGELOG.md
  3. +7 −2 lib/hacks/grid-end.js
  4. +1 −1 lib/hacks/grid-start.js
  5. +15 −0 lib/utils.js
  6. +9 −9 package.json
  7. +242 −199 pnpm-lock.yaml
  8. +6 −0 test/cases/grid.css
  9. +6 −0 test/cases/grid.disabled.css
  10. +6 −0 test/cases/grid.out.css
  11. +15 −1 test/utils.test.js
18 changes: 10 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
name: Test
on:
push:
branches:
- main
pull_request:
jobs:
full:
name: Node.js 17 Full
name: Node.js Latest Full
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- name: Install Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 17
node-version: 18
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile --ignore-scripts
@@ -35,13 +37,13 @@ jobs:
name: Node.js ${{ matrix.node-version }} Quick
steps:
- name: Checkout the repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- name: Install Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
@@ -56,15 +58,15 @@ jobs:
name: Node.js 10 Quick
steps:
- name: Checkout the repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v1
with:
version: 3
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- name: Install Node.js 10
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 10
- name: Install dependencies
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Change Log
This project adheres to [Semantic Versioning](http://semver.org/).

## 10.4.5
* Fixed `NaN` in grid (by @SukkaW).

## 10.4.4
* Fixed `package.funding` to have same value between all PostCSS packages.

9 changes: 7 additions & 2 deletions lib/hacks/grid-end.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
let Declaration = require('../declaration')
let { isPureNumber } = require('../utils')

class GridEnd extends Declaration {
/**
@@ -26,8 +27,12 @@ class GridEnd extends Declaration {
startDecl = d
})
if (startDecl) {
let value = Number(decl.value) - Number(startDecl.value) + ''
clonedDecl.value = value
if (isPureNumber(startDecl.value)) {
let value = Number(decl.value) - Number(startDecl.value) + ''
clonedDecl.value = value
} else {
return undefined
}
} else {
decl.warn(
result,
2 changes: 1 addition & 1 deletion lib/hacks/grid-start.js
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ class GridStart extends Declaration {
*/
check(decl) {
let value = decl.value
return !value.includes('/') || value.includes('span')
return !value.includes('/') && !value.includes('span')
}

/**
15 changes: 15 additions & 0 deletions lib/utils.js
Original file line number Diff line number Diff line change
@@ -76,3 +76,18 @@ module.exports.splitSelector = function (selector) {
})
})
}

/**
* Return true if a given value only contains numbers.
* @param {*} value
* @returns {boolean}
*/
module.exports.isPureNumber = function (value) {
if (typeof value === 'number') {
return true
}
if (typeof value === 'string') {
return /^[0-9]+$/.test(value)
}
return false
}
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "autoprefixer",
"version": "10.4.4",
"version": "10.4.5",
"description": "Parse CSS and add vendor prefixes to CSS rules using values from the Can I Use website",
"engines": {
"node": "^10 || ^12 || >=14"
@@ -40,21 +40,21 @@
},
"dependencies": {
"browserslist": "^4.20.2",
"caniuse-lite": "^1.0.30001317",
"caniuse-lite": "^1.0.30001332",
"fraction.js": "^4.2.0",
"normalize-range": "^0.1.2",
"picocolors": "^1.0.0",
"postcss-value-parser": "^4.2.0"
},
"devDependencies": {
"@logux/eslint-config": "^46.1.1",
"@logux/eslint-config": "^47.0.0",
"@size-limit/preset-small-lib": "7.0.8",
"c8": "^7.11.0",
"c8": "^7.11.2",
"clean-publish": "^4.0.0",
"eslint": "^8.11.0",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-node": "^11.1.0",
"eslint": "^8.14.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-n": "^15.1.0",
"eslint-plugin-prefer-let": "^3.0.1",
"eslint-plugin-promise": "^6.0.0",
"nanospy": "^0.5.0",
@@ -89,7 +89,7 @@
"bin/autoprefixer"
],
"rules": {
"node/global-require": "off"
"n/global-require": "off"
}
},
{
Loading