Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Mar 5, 2021
1 parent cf87be4 commit 72a8574
Show file tree
Hide file tree
Showing 5 changed files with 706 additions and 931 deletions.
6 changes: 6 additions & 0 deletions data/prefixes.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ f(require('caniuse-lite/data/features/css-filter-function'), browsers =>

// Backdrop-filter
let backdrop = require('caniuse-lite/data/features/css-backdrop-filter')

f(backdrop, { match: /y\sx|y\s#2/ }, browsers =>
prefix(['backdrop-filter'], {
feature: 'css-backdrop-filter',
Expand Down Expand Up @@ -305,6 +306,7 @@ f(require('caniuse-lite/data/features/user-select-none'), browsers =>

// Flexible Box Layout
let flexbox = require('caniuse-lite/data/features/flexbox')

f(flexbox, { match: /a\sx/ }, browsers => {
browsers = browsers.map(i => {
if (/ie|firefox/.test(i)) {
Expand Down Expand Up @@ -685,6 +687,7 @@ f(require('caniuse-lite/data/features/css-deviceadaptation'), browsers =>

// Resolution Media Queries
let resolut = require('caniuse-lite/data/features/css-media-resolution')

f(resolut, { match: /( x($| )|a #2)/ }, browsers =>
prefix(['@resolution'], {
feature: 'css-media-resolution',
Expand Down Expand Up @@ -757,6 +760,7 @@ f(logicalProps, { match: /x\s#2/ }, browsers =>

// CSS appearance
let appearance = require('caniuse-lite/data/features/css-appearance')

f(appearance, { match: /#2|x/ }, browsers =>
prefix(['appearance'], {
feature: 'css-appearance',
Expand Down Expand Up @@ -810,6 +814,7 @@ f(require('caniuse-lite/data/features/css-image-set'), browsers =>

// Writing Mode
let writingMode = require('caniuse-lite/data/features/css-writing-mode')

f(writingMode, { match: /a|x/ }, browsers =>
prefix(['writing-mode'], {
feature: 'css-writing-mode',
Expand Down Expand Up @@ -944,6 +949,7 @@ f(bidi, { match: /y x/ }, browsers =>

// overscroll-behavior selector
let over = require('caniuse-lite/data/features/css-overscroll-behavior')

f(over, { match: /a #1/ }, browsers =>
prefix(['overscroll-behavior'], {
feature: 'css-overscroll-behavior',
Expand Down
2 changes: 1 addition & 1 deletion lib/hacks/grid-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ function changeDuplicateAreaSelectors (ruleSelectors, templateSelectors) {
*/
function selectorsEqual (ruleA, ruleB) {
return ruleA.selectors.some(sel => {
return ruleB.selectors.some(s => s === sel)
return ruleB.selectors.includes(sel)
})
}

Expand Down
41 changes: 21 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
"postcss": "^8.1.0"
},
"dependencies": {
"browserslist": "^4.16.1",
"caniuse-lite": "^1.0.30001181",
"colorette": "^1.2.1",
"browserslist": "^4.16.3",
"caniuse-lite": "^1.0.30001196",
"colorette": "^1.2.2",
"fraction.js": "^4.0.13",
"normalize-range": "^0.1.2",
"postcss-value-parser": "^4.1.0"
Expand All @@ -41,31 +41,31 @@
"chalk": false
},
"devDependencies": {
"@logux/eslint-config": "^44.1.0",
"@size-limit/preset-small-lib": "4.9.1",
"@logux/eslint-config": "^45.1.0",
"@size-limit/preset-small-lib": "4.10.0",
"@types/jest": "^26.0.20",
"@typescript-eslint/eslint-plugin": "^4.14.1",
"@typescript-eslint/parser": "^4.14.1",
"check-dts": "^0.4.1",
"clean-publish": "^1.1.8",
"eslint": "^7.18.0",
"@typescript-eslint/eslint-plugin": "^4.16.1",
"@typescript-eslint/parser": "^4.16.1",
"check-dts": "^0.4.4",
"clean-publish": "^1.1.9",
"eslint": "^7.21.0",
"eslint-config-standard": "^16.0.2",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^24.1.3",
"eslint-plugin-jest": "^24.1.5",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prefer-let": "^1.1.0",
"eslint-plugin-prettierx": "^0.16.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-prettierx": "^0.17.1",
"eslint-plugin-promise": "^4.3.1",
"eslint-plugin-security": "^1.4.0",
"eslint-plugin-unicorn": "^27.0.0",
"eslint-plugin-unicorn": "^28.0.2",
"fs-extra": "^9.1.0",
"husky": "^4.3.8",
"jest": "^26.6.3",
"lint-staged": "^10.5.3",
"postcss": "^8.2.4",
"size-limit": "^4.9.1",
"ts-jest": "^26.5.0",
"typescript": "^4.1.3"
"lint-staged": "^10.5.4",
"postcss": "^8.2.7",
"size-limit": "^4.10.0",
"ts-jest": "^26.5.3",
"typescript": "^4.2.3"
},
"lint-staged": {
"*.js": "eslint --fix",
Expand All @@ -88,7 +88,8 @@
"security/detect-unsafe-regex": "off",
"node/no-missing-require": "off",
"no-unused-expressions": "off",
"no-unused-vars": "off"
"no-unused-vars": "off",
"no-console": "off"
},
"overrides": [
{
Expand Down
18 changes: 9 additions & 9 deletions test/autoprefixer.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-unused-expressions */
import postcss, { AtRule, ChildNode, Container, Rule } from 'postcss'
import postcss, { AtRule, ChildNode, Container, Rule, Plugin } from 'postcss'
import path from 'path'
import fs from 'fs'

Expand Down Expand Up @@ -84,7 +84,7 @@ let example = autoprefixer({
overrideBrowserslist: ['defaults']
})

function prefixer (name: string) {
function prefixer (name: string): Plugin {
if (
name === 'grid' ||
name === 'grid-gap' ||
Expand Down Expand Up @@ -162,16 +162,16 @@ function prefixer (name: string) {
}
}

function read (name: string) {
function read (name: string): string {
let file = path.join(__dirname, '/cases/' + name + '.css')
return fs.readFileSync(file).toString()
}

function universalizer (string: string) {
function universalizer (string: string): string {
return string.replace(/\r/g, '')
}

function check (from: string, instance = prefixer(from)) {
function check (from: string, instance = prefixer(from)): void {
let input = read(from)
let output = read(from + '.out')
let result = postcss([instance]).process(input)
Expand Down Expand Up @@ -487,7 +487,7 @@ const isContainerNode = (node: ChildNode): node is AtRule | Rule => {
}

it('does not broke AST', () => {
function checkParent (node: Container) {
function checkParent (node: Container): void {
node.walk(child => {
expect(child.parent).toBeDefined()
if (isContainerNode(child)) checkParent(child)
Expand Down Expand Up @@ -535,7 +535,7 @@ it('sets browserslist environment', () => {
})

it('takes values from other PostCSS plugins', () => {
function plugin (root: Container) {
function plugin (root: Container): void {
root.walkDecls(i => {
i.value = 'calc(0)'
})
Expand Down Expand Up @@ -563,7 +563,7 @@ it('has disabled grid options by default', () => {
})

it('has different outputs for different grid options', () => {
function ap (gridValue: autoprefixer.Options['grid']) {
function ap (gridValue: autoprefixer.Options['grid']): Plugin {
return autoprefixer({
overrideBrowserslist: ['Edge 12', 'IE 10'],
grid: gridValue
Expand All @@ -590,7 +590,7 @@ it('has different outputs for different grid options', () => {
})

it('has different outputs for different grid environment variables', () => {
function ap (gridValue: autoprefixer.GridValue) {
function ap (gridValue: autoprefixer.GridValue): Plugin {
process.env.AUTOPREFIXER_GRID = gridValue
return autoprefixer({ overrideBrowserslist: ['Edge 12', 'IE 10'] })
}
Expand Down
Loading

0 comments on commit 72a8574

Please sign in to comment.