From ff60d726e289b35da01bb97a423aabc55bb5c3fe Mon Sep 17 00:00:00 2001 From: romainmenke Date: Sun, 28 Nov 2021 18:56:45 +0100 Subject: [PATCH 1/4] Migrate postcss-preset-env --- plugin-packs/postcss-preset-env/.editorconfig | 15 -- .../postcss-preset-env/.gitattributes | 1 - .../.github/workflows/test.yml | 18 --- plugin-packs/postcss-preset-env/.gitignore | 8 +- plugin-packs/postcss-preset-env/.rollup.js | 9 -- .../postcss-preset-env/CONTRIBUTING.md | 75 --------- plugin-packs/postcss-preset-env/INSTALL.md | 10 +- plugin-packs/postcss-preset-env/README.md | 10 +- plugin-packs/postcss-preset-env/package.json | 91 +++-------- plugin-packs/postcss-preset-env/src/cli.js | 149 ++++-------------- .../src/{postcss.js => index.js} | 30 ++-- .../src/lib/get-transformed-insertions.js | 8 +- .../get-unsupported-browsers-by-feature.js | 8 +- .../src/lib/ids-by-execution-order.js | 2 +- .../src/lib/plugins-by-id.js | 8 +- .../src/lib/write-to-exports.js | 4 +- .../patch/postcss-system-ui-font-family.js | 6 +- 17 files changed, 95 insertions(+), 357 deletions(-) delete mode 100644 plugin-packs/postcss-preset-env/.editorconfig delete mode 100644 plugin-packs/postcss-preset-env/.gitattributes delete mode 100644 plugin-packs/postcss-preset-env/.github/workflows/test.yml delete mode 100644 plugin-packs/postcss-preset-env/.rollup.js delete mode 100644 plugin-packs/postcss-preset-env/CONTRIBUTING.md rename plugin-packs/postcss-preset-env/src/{postcss.js => index.js} (91%) diff --git a/plugin-packs/postcss-preset-env/.editorconfig b/plugin-packs/postcss-preset-env/.editorconfig deleted file mode 100644 index e06d7982b..000000000 --- a/plugin-packs/postcss-preset-env/.editorconfig +++ /dev/null @@ -1,15 +0,0 @@ -root = true - -[*] -charset = utf-8 -end_of_line = lf -indent_style = tab -insert_final_newline = true -trim_trailing_whitespace = true - -[*.md] -trim_trailing_whitespace = false - -[*.{json,md,yml}] -indent_size = 2 -indent_style = space diff --git a/plugin-packs/postcss-preset-env/.gitattributes b/plugin-packs/postcss-preset-env/.gitattributes deleted file mode 100644 index 6313b56c5..000000000 --- a/plugin-packs/postcss-preset-env/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -* text=auto eol=lf diff --git a/plugin-packs/postcss-preset-env/.github/workflows/test.yml b/plugin-packs/postcss-preset-env/.github/workflows/test.yml deleted file mode 100644 index f9eb0482d..000000000 --- a/plugin-packs/postcss-preset-env/.github/workflows/test.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: test -on: - push: - -jobs: - test: - runs-on: ubuntu-latest - strategy: - matrix: - node: [12, 14, 16] - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node }} - - run: npm install --ignore-scripts - - run: npm run build - - run: npm run test diff --git a/plugin-packs/postcss-preset-env/.gitignore b/plugin-packs/postcss-preset-env/.gitignore index 1ee23c339..b5d13c8c0 100644 --- a/plugin-packs/postcss-preset-env/.gitignore +++ b/plugin-packs/postcss-preset-env/.gitignore @@ -1,13 +1,13 @@ -dist node_modules +dist package-lock.json yarn.lock *.log* *.result.css -.* +*.result.css.map !.editorconfig -!.gitattributes -!.github !.gitignore !.rollup.js !.tape.js +!.travis.yml +!.github diff --git a/plugin-packs/postcss-preset-env/.rollup.js b/plugin-packs/postcss-preset-env/.rollup.js deleted file mode 100644 index 1fb0d8719..000000000 --- a/plugin-packs/postcss-preset-env/.rollup.js +++ /dev/null @@ -1,9 +0,0 @@ -import pkg from './package.json' - -export default { - ...pkg.rollup, - plugins: pkg.rollup.plugins.map(plugin => require(plugin)()), - onwarn(warning, warn) { - if (warning.code !== 'UNRESOLVED_IMPORT') warn(warning) - } -} diff --git a/plugin-packs/postcss-preset-env/CONTRIBUTING.md b/plugin-packs/postcss-preset-env/CONTRIBUTING.md deleted file mode 100644 index fd10b6ab7..000000000 --- a/plugin-packs/postcss-preset-env/CONTRIBUTING.md +++ /dev/null @@ -1,75 +0,0 @@ -# Contributing to PostCSS Preset Env - -You want to help? You rock! Now, take a moment to be sure your contributions -make sense to everyone else. - -## Reporting Issues - -Found a problem? Want a new feature? - -- See if your issue or idea has [already been reported]. -- Provide a [reduced test case] or a [live example]. - -Remember, a bug is a _demonstrable problem_ caused by _our_ code. - -## Submitting Pull Requests - -Pull requests are the greatest contributions, so be sure they are focused in -scope and avoid unrelated commits. - -1. To begin; [fork this project], clone your fork, and add our upstream. - ```bash - # Clone your fork of the repo into the current directory - git clone git@github.com:YOUR_USER/postcss-preset-env.git - - # Navigate to the newly cloned directory - cd postcss-preset-env - - # Assign the original repo to a remote called "upstream" - git remote add upstream git@github.com:csstools/postcss-preset-env.git - - # Install the tools necessary for testing - npm install - ``` - -2. Create a branch for your feature or fix: - ```bash - # Move into a new branch for your feature - git checkout -b feature/thing - ``` - ```bash - # Move into a new branch for your fix - git checkout -b fix/something - ``` - -3. If your code follows our practices, then push your feature branch: - ```bash - # Test current code - npm test - ``` - ```bash - # Push the branch for your new feature - git push origin feature/thing - ``` - ```bash - # Or, push the branch for your update - git push origin update/something - ``` - -That’s it! Now [open a pull request] with a clear title and description. - -## Adding a new plugin to Postcss Preset Env - -If you want to add a new plugin, follow the -[pull request guidelines](#submitting-pull-requests) while making these changes: - -- Ensure the feature exists in [cssdb](https://cssdb.org/). -- Add the plugin to the `dependencies` list in [`package.json`](package.json). -- Add the plugin to - [`lib/plugins-by-id.js`](lib/plugins-by-id.js). - -[already been reported]: issues -[fork this project]: fork -[live example]: https://codepen.io/pen -[open a pull request]: https://help.github.com/articles/using-pull-requests/ -[reduced test case]: https://css-tricks.com/reduced-test-cases/ diff --git a/plugin-packs/postcss-preset-env/INSTALL.md b/plugin-packs/postcss-preset-env/INSTALL.md index 877f2f313..b0887f80c 100644 --- a/plugin-packs/postcss-preset-env/INSTALL.md +++ b/plugin-packs/postcss-preset-env/INSTALL.md @@ -13,15 +13,7 @@ Add [PostCSS Preset Env] to your project: npm install postcss-preset-env --save-dev ``` -Use [PostCSS Preset Env] to process your CSS: - -```js -const postcssPresetEnv = require('postcss-preset-env'); - -postcssPresetEnv.process(YOUR_CSS /*, processOptions, pluginOptions */); -``` - -Or use it as a [PostCSS] plugin: +Use [PostCSS Preset Env] as a [PostCSS] plugin: ```js const postcss = require('postcss'); diff --git a/plugin-packs/postcss-preset-env/README.md b/plugin-packs/postcss-preset-env/README.md index 9c847bd8c..2123cbf61 100644 --- a/plugin-packs/postcss-preset-env/README.md +++ b/plugin-packs/postcss-preset-env/README.md @@ -95,15 +95,7 @@ Add [PostCSS Preset Env] to your project: npm install postcss-preset-env --save-dev ``` -Use [PostCSS Preset Env] to process your CSS: - -```js -const postcssPresetEnv = require('postcss-preset-env'); - -postcssPresetEnv.process(YOUR_CSS /*, processOptions, pluginOptions */); -``` - -Or use it as a [PostCSS] plugin: +Use [PostCSS Preset Env] as a [PostCSS] plugin: ```js const postcss = require('postcss'); diff --git a/plugin-packs/postcss-preset-env/package.json b/plugin-packs/postcss-preset-env/package.json index e6a218ca2..6c9eef3af 100644 --- a/plugin-packs/postcss-preset-env/package.json +++ b/plugin-packs/postcss-preset-env/package.json @@ -4,29 +4,29 @@ "description": "Convert modern CSS into something browsers understand", "author": "Jonathan Neal ", "license": "CC0-1.0", - "repository": "csstools/postcss-preset-env", - "homepage": "https://github.com/csstools/postcss-preset-env#readme", - "bugs": "https://github.com/csstools/postcss-preset-env/issues", - "main": "dist/index.js", + "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-preset-env#readme", + "bugs": "https://github.com/csstools/postcss-plugins/issues", + "main": "dist/index.cjs", "module": "dist/index.mjs", "files": [ + "CHANGELOG.md", + "INSTALL.md", + "LICENSE.md", + "README.md", "dist" ], + "bin": { + "postcss-preset-env": "dist/cli.mjs" + }, "scripts": { - "build": "npx rollup -c .rollup.js", - "build:watch": "npx rollup -c .rollup.js --watch", - "lint": "npx eslint --cache src", - "lint:fix": "npx eslint --cache --fix", - "pretest": "npm install && npm run build", - "test": "npm run lint && npm run tape", - "tape": "npx postcss-tape", - "prepublishOnly": "npm test" + "prepublishOnly": "npm run build && npm run test", + "lint": "eslint src/**/*.js", + "test": "postcss-tape", + "build": "rollup -c ../../rollup/default.js", + "stryker": "stryker run --logLevel error" }, "engines": { - "node": ">=12" - }, - "peerDependencies": { - "postcss": "^8.3" + "node": "^12 || ^14 || >=16" }, "dependencies": { "autoprefixer": "^10.4.0", @@ -36,7 +36,6 @@ "css-has-pseudo": "^2.0.0", "css-prefers-color-scheme": "^5.0.0", "cssdb": "^5.0.0", - "postcss": "^8.3", "postcss-attribute-case-insensitive": "^5.0.0", "postcss-color-functional-notation": "^4.0.1", "postcss-color-hex-alpha": "^8.0.0", @@ -65,54 +64,11 @@ "postcss-selector-not": "^5.0.0" }, "devDependencies": { - "@babel/core": "^7.15.8", - "@babel/preset-env": "^7.15.8", - "eslint": "^8.1.0", - "postcss-simple-vars": "^6.0.3", - "postcss-tape": "^6.0.1", - "pre-commit": "^1.2.2", - "rollup": "^2.58.3", - "rollup-plugin-babel": "^4.4.0" - }, - "babel": { - "presets": [ - [ - "@babel/env", - { - "targets": "maintained node versions" - } - ] - ] + "postcss": "8.3.6", + "postcss-tape": "6.0.1" }, - "eslintConfig": { - "env": { - "browser": true, - "es6": true, - "node": true - }, - "extends": "eslint:recommended", - "parserOptions": { - "ecmaVersion": 2020, - "sourceType": "module" - }, - "root": true - }, - "rollup": { - "input": "src/postcss.js", - "plugins": [ - "rollup-plugin-babel" - ], - "output": [ - { - "exports": "default", - "file": "dist/index.js", - "format": "cjs" - }, - { - "file": "dist/index.mjs", - "format": "esm" - } - ] + "peerDependencies": { + "postcss": "^8.3" }, "keywords": [ "postcss", @@ -127,5 +83,10 @@ "csswg", "future", "next" - ] + ], + "repository": { + "type": "git", + "url": "https://github.com/csstools/postcss-plugins.git", + "directory": "plugin-packs/postcss-preset-env" + } } diff --git a/plugin-packs/postcss-preset-env/src/cli.js b/plugin-packs/postcss-preset-env/src/cli.js index 199ce8eb0..2349a2b2a 100644 --- a/plugin-packs/postcss-preset-env/src/cli.js +++ b/plugin-packs/postcss-preset-env/src/cli.js @@ -1,120 +1,31 @@ -import fs from 'fs'; -import plugin from './postcss'; - -if (process.argv.length < 3) { - console.log([ - 'PostCSS Preset Env\n', - ' Transforms Modern CSS\n', - 'Usage:\n', - ' postcss-preset-env source.css transformed.css', - ' postcss-preset-env --in=source.css --out=transformed.css --opts={}', - ' echo "/* a bunch of css */" | focus-within\n' - ].join('\n')); - process.exit(0); -} - -// get process and plugin options from the command line -const fileRegExp = /^[\w/.]+$/; -const argRegExp = /^--(\w+)=("|')?(.+)\2$/; -const relaxedJsonPropRegExp = /(['"])?([a-z0-9A-Z_]+)(['"])?:/g; -const relaxedJsonValueRegExp = /("[a-z0-9A-Z_]+":\s*)(?!true|false|null|\d+)'?([A-z0-9]+)'?([,}])/g; -const argo = process.argv.slice(2).reduce( - (object, arg) => { - const argMatch = arg.match(argRegExp); - const fileMatch = arg.match(fileRegExp); - - if (argMatch) { - object[argMatch[1]] = argMatch[3]; - } else if (fileMatch) { - if (object.from === '') { - object.from = arg; - } else if (object.to === '') { - object.to = arg; - } - } - - return object; - }, - { from: '', to: '', opts: 'null' } +import plugin from './index'; +import { cli, helpTextLogger } from '@csstools/base-cli'; + +cli( + plugin, + [ + 'stage', + 'features', + 'browsers', + 'autoprefixer', + 'importFrom', + 'exportTo', + ], + helpTextLogger( + 'postcss-preset-env', + 'PostCSS Preset Env', + 'Lets you convert modern CSS into something most browsers can understand, determining the polyfills you need based on your targeted browsers or runtime environments.', + { + stage: 0, + features: { + 'blank-pseudo-class': { preserve: false }, + 'color-functional-notation': { preserve: true }, + }, + browsers: 'last 2 versions', + autoprefixer: { grid: true }, + preserve: false, + importFrom: 'path/to/file.css', + exportTo: 'path/to/file.css', + }, + ), ); - -// get css from command line arguments or stdin -(argo.from === '' ? getStdin() : readFile(argo.from)) -.then(css => { - const pluginOpts = JSON.parse( - argo.opts - .replace(relaxedJsonPropRegExp, '"$2": ') - .replace(relaxedJsonValueRegExp, '$1"$2"$3') - ); - const processOptions = Object.assign({ from: argo.from, to: argo.to || argo.from }, argo.map ? { map: JSON.parse(argo.map) } : {}); - - const result = plugin.process(css, processOptions, pluginOpts); - - if (argo.to === '') { - return result.css; - } else { - return writeFile(argo.to, result.css).then( - () => `CSS was written to "${argo.to}"` - ) - } -}).then( - result => { - console.log(result); - - process.exit(0); - }, - error => { - console.error(error); - - process.exit(1); - } -); - -function readFile(pathname) { - return new Promise((resolve, reject) => { - fs.readFile(pathname, 'utf8', (error, data) => { - if (error) { - reject(error); - } else { - resolve(data); - } - }); - }); -} - -function writeFile(pathname, data) { - return new Promise((resolve, reject) => { - fs.writeFile(pathname, data, (error, content) => { - if (error) { - reject(error); - } else { - resolve(content); - } - }); - }); -} - -function getStdin() { - return new Promise(resolve => { - let data = ''; - - if (process.stdin.isTTY) { - resolve(data); - } else { - process.stdin.setEncoding('utf8'); - - process.stdin.on('readable', () => { - let chunk; - - // eslint-disable-next-line no-cond-assign - while (chunk = process.stdin.read()) { - data += chunk; - } - }); - - process.stdin.on('end', () => { - resolve(data); - }); - } - }); -} diff --git a/plugin-packs/postcss-preset-env/src/postcss.js b/plugin-packs/postcss-preset-env/src/index.js similarity index 91% rename from plugin-packs/postcss-preset-env/src/postcss.js rename to plugin-packs/postcss-preset-env/src/index.js index 55ff2fe14..9e668ed2e 100644 --- a/plugin-packs/postcss-preset-env/src/postcss.js +++ b/plugin-packs/postcss-preset-env/src/index.js @@ -29,13 +29,13 @@ const plugin = opts => { // additional features to be inserted before cssdb features getTransformedInsertions(insertBefore, 'insertBefore'), // additional features to be inserted after cssdb features - getTransformedInsertions(insertAfter, 'insertAfter') + getTransformedInsertions(insertAfter, 'insertAfter'), ).filter( // inserted features or features with an available postcss plugin - feature => feature.insertBefore || feature.id in plugins + feature => feature.insertBefore || feature.id in plugins, ).sort( // features sorted by execution order and then insertion order - (a, b) => idsByExecutionOrder.indexOf(a.id) - idsByExecutionOrder.indexOf(b.id) || (a.insertBefore ? -1 : b.insertBefore ? 1 : 0) || (a.insertAfter ? 1 : b.insertAfter ? -1 : 0) + (a, b) => idsByExecutionOrder.indexOf(a.id) - idsByExecutionOrder.indexOf(b.id) || (a.insertBefore ? -1 : b.insertBefore ? 1 : 0) || (a.insertAfter ? 1 : b.insertAfter ? -1 : 0), ).map( // polyfillable features as an object feature => { @@ -46,21 +46,21 @@ const plugin = opts => { browsers: unsupportedBrowsers, plugin: feature.plugin, id: `${feature.insertBefore ? 'before' : 'after'}-${feature.id}`, - stage: 6 + stage: 6, } : { browsers: unsupportedBrowsers, plugin: plugins[feature.id], id: feature.id, - stage: feature.stage + stage: feature.stage, }; - } + }, ); // staged features (those at or above the selected stage) const stagedFeatures = polyfillableFeatures.filter( feature => feature.id in features ? features[feature.id] - : feature.stage >= stage + : feature.stage >= stage, ).map( feature => { let options; @@ -86,9 +86,9 @@ const plugin = opts => { return { browsers: feature.browsers, plugin, - id: feature.id + id: feature.id, }; - } + }, ); // browsers supported by the configuration @@ -100,11 +100,11 @@ const plugin = opts => { ? features[feature.id] : supportedBrowsers.some( supportedBrowser => browserslist(feature.browsers, { - ignoreUnknownVersions: true + ignoreUnknownVersions: true, }).some( - polyfillBrowser => polyfillBrowser === supportedBrowser - ) - ) + polyfillBrowser => polyfillBrowser === supportedBrowser, + ), + ), ); const usedPlugins = supportedFeatures.map(feature => feature.plugin); @@ -117,9 +117,9 @@ const plugin = opts => { if ( Object( opts ).exportTo ) { writeToExports( sharedOpts.exportTo, opts.exportTo ); } - } + }, }; -} +}; const initializeSharedOpts = opts => { if ('importFrom' in opts || 'exportTo' in opts || 'preserve' in opts) { diff --git a/plugin-packs/postcss-preset-env/src/lib/get-transformed-insertions.js b/plugin-packs/postcss-preset-env/src/lib/get-transformed-insertions.js index 6fc643c5f..7080d3e99 100644 --- a/plugin-packs/postcss-preset-env/src/lib/get-transformed-insertions.js +++ b/plugin-packs/postcss-preset-env/src/lib/get-transformed-insertions.js @@ -5,10 +5,10 @@ export default function getTransformedInsertions(insertions, placement) { plugin => ({ [placement]: true, plugin, - id - }) - ) + id, + }), + ), ).reduce( - (array, feature) => array.concat(feature), [] + (array, feature) => array.concat(feature), [], ); } diff --git a/plugin-packs/postcss-preset-env/src/lib/get-unsupported-browsers-by-feature.js b/plugin-packs/postcss-preset-env/src/lib/get-unsupported-browsers-by-feature.js index f71860fd2..566db488e 100644 --- a/plugin-packs/postcss-preset-env/src/lib/get-unsupported-browsers-by-feature.js +++ b/plugin-packs/postcss-preset-env/src/lib/get-unsupported-browsers-by-feature.js @@ -12,12 +12,12 @@ export default function getUnsupportedBrowsersByFeature(feature) { const results = Object.keys(stats).reduce( (browsers, browser) => browsers.concat( Object.keys(stats[browser]).filter( - version => stats[browser][version].indexOf('y') !== 0 + version => stats[browser][version].indexOf('y') !== 0, ).map( - version => `${browser} ${version}` - ) + version => `${browser} ${version}`, + ), ), - [] + [], ); return results; diff --git a/plugin-packs/postcss-preset-env/src/lib/ids-by-execution-order.js b/plugin-packs/postcss-preset-env/src/lib/ids-by-execution-order.js index 986e911a3..d6bd8a226 100644 --- a/plugin-packs/postcss-preset-env/src/lib/ids-by-execution-order.js +++ b/plugin-packs/postcss-preset-env/src/lib/ids-by-execution-order.js @@ -31,5 +31,5 @@ export default [ 'overflow-property', 'overflow-wrap-property', 'place-properties', - 'system-ui-font-family' + 'system-ui-font-family', ]; diff --git a/plugin-packs/postcss-preset-env/src/lib/plugins-by-id.js b/plugin-packs/postcss-preset-env/src/lib/plugins-by-id.js index 5c4090e3a..eb901473e 100644 --- a/plugin-packs/postcss-preset-env/src/lib/plugins-by-id.js +++ b/plugin-packs/postcss-preset-env/src/lib/plugins-by-id.js @@ -1,5 +1,5 @@ import postcssAttributeCaseInsensitive from 'postcss-attribute-case-insensitive'; -import postcssBlankPseudo from 'css-blank-pseudo/postcss'; +import postcssBlankPseudo from 'css-blank-pseudo'; import postcssColorFunctionalNotation from 'postcss-color-functional-notation'; import postcssColorHexAlpha from 'postcss-color-hex-alpha'; import postcssColorRebeccapurple from 'postcss-color-rebeccapurple'; @@ -14,7 +14,7 @@ import postcssFocusWithin from 'postcss-focus-within'; import postcssFontVariant from 'postcss-font-variant'; import postcssFontFamilySystemUi from '../patch/postcss-system-ui-font-family'; import postcssGapProperties from 'postcss-gap-properties'; -import postcssHasPseudo from 'css-has-pseudo/postcss'; +import postcssHasPseudo from 'css-has-pseudo'; import postcssImageSetPolyfill from 'postcss-image-set-function'; import postcssInitial from 'postcss-initial'; import postcssLabFunction from 'postcss-lab-function'; @@ -24,7 +24,7 @@ import postcssNesting from 'postcss-nesting'; import postcssOverflowShorthand from 'postcss-overflow-shorthand'; import postcssPageBreak from 'postcss-page-break'; import postcssPlace from 'postcss-place'; -import postcssPrefersColorScheme from 'css-prefers-color-scheme/postcss'; +import postcssPrefersColorScheme from 'css-prefers-color-scheme'; import postcssPseudoClassAnyLink from 'postcss-pseudo-class-any-link'; import postcssReplaceOverflowWrap from 'postcss-replace-overflow-wrap'; import postcssSelectorNot from 'postcss-selector-not'; @@ -60,5 +60,5 @@ export default { 'place-properties': postcssPlace, 'prefers-color-scheme-query': postcssPrefersColorScheme, 'rebeccapurple-color': postcssColorRebeccapurple, - 'system-ui-font-family': postcssFontFamilySystemUi + 'system-ui-font-family': postcssFontFamilySystemUi, }; diff --git a/plugin-packs/postcss-preset-env/src/lib/write-to-exports.js b/plugin-packs/postcss-preset-env/src/lib/write-to-exports.js index c7e303230..40af0165c 100644 --- a/plugin-packs/postcss-preset-env/src/lib/write-to-exports.js +++ b/plugin-packs/postcss-preset-env/src/lib/write-to-exports.js @@ -55,7 +55,7 @@ async function writeExportsToJsonFile(to, customMedia, customProperties, customS const jsonContent = JSON.stringify({ 'custom-media': customMedia, 'custom-properties': customProperties, - 'custom-selectors': customSelectors + 'custom-selectors': customSelectors, }, null, ' '); const json = `${jsonContent}\n`; @@ -117,7 +117,7 @@ export default function writeToExports(customExports, destinations) { await destination({ customMedia: getObjectWithStringifiedKeys(customExports.customMedia), customProperties: getObjectWithStringifiedKeys(customExports.customProperties), - customSelectors: getObjectWithStringifiedKeys(customExports.customSelectors) + customSelectors: getObjectWithStringifiedKeys(customExports.customSelectors), }); } else { // read the destination as an object diff --git a/plugin-packs/postcss-preset-env/src/patch/postcss-system-ui-font-family.js b/plugin-packs/postcss-preset-env/src/patch/postcss-system-ui-font-family.js index d50cb5611..4ad4f88d8 100644 --- a/plugin-packs/postcss-preset-env/src/patch/postcss-system-ui-font-family.js +++ b/plugin-packs/postcss-preset-env/src/patch/postcss-system-ui-font-family.js @@ -7,8 +7,8 @@ export default function postcssSystemUiFont() { node.value = node.value.replace(systemUiMatch, systemUiReplace); } } - } - } + }, + }; } postcssSystemUiFont.postcss = true; @@ -23,7 +23,7 @@ const systemUiFamily = [ /* Ubuntu 10.10+ */ 'Ubuntu', /* Gnome 3+ */ 'Cantarell', /* KDE Plasma 5+ */ 'Noto Sans', - /* fallback */ 'sans-serif' + /* fallback */ 'sans-serif', ]; const systemUiMatch = new RegExp(`(^|,|${whitespace}+)(?:system-ui${whitespace}*)(?:,${whitespace}*(?:${systemUiFamily.join('|')})${whitespace}*)?(,|$)`, 'i'); const systemUiReplace = `$1${systemUiFamily.join(', ')}$2`; From d02378024ca494f474481d42ddd54bc721033edc Mon Sep 17 00:00:00 2001 From: romainmenke Date: Sun, 28 Nov 2021 19:01:06 +0100 Subject: [PATCH 2/4] fixes --- plugin-packs/postcss-preset-env/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin-packs/postcss-preset-env/package.json b/plugin-packs/postcss-preset-env/package.json index 6c9eef3af..fbca8ced0 100644 --- a/plugin-packs/postcss-preset-env/package.json +++ b/plugin-packs/postcss-preset-env/package.json @@ -64,8 +64,8 @@ "postcss-selector-not": "^5.0.0" }, "devDependencies": { - "postcss": "8.3.6", - "postcss-tape": "6.0.1" + "postcss": "^8.3.6", + "postcss-tape": "^6.0.1" }, "peerDependencies": { "postcss": "^8.3" From c1e1d32a6ee409b687d314a435cf9e7813b3c80a Mon Sep 17 00:00:00 2001 From: Romain Menke <11521496+romainmenke@users.noreply.github.com> Date: Mon, 29 Nov 2021 09:22:19 +0100 Subject: [PATCH 3/4] enable full CI (#27) * enable full CI * resolve some rollup warnings * cleanup * fixes * update tests * postcss-tape --ci * fix tests * fix tests * fix tests * fix tests * fix tests * cleanup * fix tests * fix tests * fix tests * Revert "fix tests" This reverts commit ebe8acaa7fdb29a14f015e999e8d234542375035. * add separate workflow for older node versions * better workflow description --- .github/bin/install-and-test-all-packages.sh | 12 ++--- .../test-node-without-workspaces.yml | 22 ++++++++ .github/workflows/test.yml | 54 +++++++++---------- plugin-packs/postcss-preset-env/.tape.js | 6 +-- plugin-packs/postcss-preset-env/package.json | 5 +- .../test/basic.autoprefixer.expect.css | 16 +++--- .../test/basic.autoprefixer.false.expect.css | 16 +++--- .../test/basic.ch38.expect.css | 18 ++++--- .../postcss-preset-env/test/basic.expect.css | 18 ++++--- .../test/basic.ff49.expect.css | 16 +++--- .../test/basic.stage0-ff49.expect.css | 16 +++--- .../test/basic.stage0.expect.css | 18 ++++--- plugins/css-blank-pseudo/package.json | 13 +++-- plugins/css-has-pseudo/package.json | 13 +++-- plugins/css-prefers-color-scheme/package.json | 11 ++-- plugins/postcss-base-plugin/package.json | 3 +- plugins/postcss-base-plugin/src/index.ts | 2 +- .../package.json | 2 +- plugins/postcss-dir-pseudo-class/package.json | 8 +-- .../package.json | 6 +-- plugins/postcss-env-function/package.json | 8 +-- plugins/postcss-focus-visible/package.json | 8 +-- plugins/postcss-focus-visible/src/index.ts | 2 +- plugins/postcss-focus-within/package.json | 8 +-- plugins/postcss-gap-properties/package.json | 6 +-- .../postcss-image-set-function/package.json | 10 ++-- plugins/postcss-lab-function/package.json | 3 +- plugins/postcss-lab-function/src/index.ts | 8 ++- .../postcss-lab-function/test/color/test.mjs | 4 +- plugins/postcss-logical/package.json | 6 +-- plugins/postcss-nesting/package.json | 8 +-- .../postcss-overflow-shorthand/package.json | 6 +-- plugins/postcss-place/package.json | 8 +-- .../package.json | 6 +-- rollup/default-with-browser.js | 44 ++++++++++++++- rollup/default-with-deno.js | 40 ++++++++++++++ rollup/default.js | 44 ++++++++++++++- rollup/default.ts.js | 44 ++++++++++++++- 38 files changed, 387 insertions(+), 151 deletions(-) create mode 100644 .github/workflows/test-node-without-workspaces.yml diff --git a/.github/bin/install-and-test-all-packages.sh b/.github/bin/install-and-test-all-packages.sh index 0513d5f70..168815aca 100644 --- a/.github/bin/install-and-test-all-packages.sh +++ b/.github/bin/install-and-test-all-packages.sh @@ -4,27 +4,27 @@ set -e start_dir=$(pwd) -for package in $(ls -d ./packages); do +for package in $(ls -d ./packages/*); do echo "Installing and testing $package" cd $package npm install --ignore-scripts - npm test + npm run test cd $start_dir done -for package in $(ls -d ./plugins); do +for package in $(ls -d ./plugins/*); do echo "Installing and testing $package" cd $package npm install --ignore-scripts - npm test + npm run test cd $start_dir done -for package in $(ls -d ./plugin-packs); do +for package in $(ls -d ./plugin-packs/*); do echo "Installing and testing $package" cd $package npm install --ignore-scripts - npm test + npm run test cd $start_dir done diff --git a/.github/workflows/test-node-without-workspaces.yml b/.github/workflows/test-node-without-workspaces.yml new file mode 100644 index 000000000..5c3c01c02 --- /dev/null +++ b/.github/workflows/test-node-without-workspaces.yml @@ -0,0 +1,22 @@ +name: test node without workspaces +on: + push: + +jobs: + test_without_workspaces_support: + runs-on: ubuntu-latest + strategy: + matrix: + node: [12, 14] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 16 + - run: npm install --ignore-scripts + - run: npm run build --workspaces --if-present + + - uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node }} + - run: bash ./.github/bin/install-and-test-all-packages.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 585539abf..a313184c2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,40 +14,36 @@ jobs: with: node-version: ${{ matrix.node }} - - run: exit 0 - # - run: npm install --ignore-scripts - # - run: npm run build --workspaces --if-present - # - run: npm run lint --workspaces --if-present - # - run: npm run test --workspaces --if-present + - run: npm install --ignore-scripts + - run: npm run build --workspaces --if-present + - run: npm run lint --workspaces --if-present + - run: npm run test --workspaces --if-present - test_without_workspaces_support: - runs-on: ubuntu-latest + # Run cross platform test of the basic CLI. + test_cli: + runs-on: ${{ matrix.os }} strategy: matrix: - node: [12, 14] + os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: node-version: 16 - - run: exit 0 - # - run: npm install --ignore-scripts - # - run: npm run build --workspaces --if-present + - run: npm install --ignore-scripts + - run: npm run build --workspaces --if-present - - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node }} + # running "npm install" places the cli in node_modules/bin + - run: npm install --ignore-scripts - - run: exit 0 - # - run: bash ./.github/bin/install-and-test-all-packages.sh + - run: | + npm run test --workspace="@csstools/base-cli" + npm run test:cli --workspace="@csstools/postcss-base-plugin" - # Run cross platform test of the basic CLI. - test_cli: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] + # Run Deno tests one by one + test_deno: + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 @@ -55,11 +51,13 @@ jobs: node-version: 16 - run: npm install --ignore-scripts - # - run: npm run build --workspaces --if-present + - run: npm run build --workspaces --if-present + + - uses: denoland/setup-deno@v1 + with: + deno-version: v1.x.x + # Per plugin from here - run: | - npm run build --workspace="@csstools/base-cli" --workspace="@csstools/postcss-base-plugin" - # running install places the cli in node_modules/bin - npm install - npm run test --workspace="@csstools/base-cli" - npm run test:cli --workspace="@csstools/postcss-base-plugin" + cd plugins/postcss-nesting + npm run test:deno diff --git a/plugin-packs/postcss-preset-env/.tape.js b/plugin-packs/postcss-preset-env/.tape.js index 40df4f4b8..145bd340e 100644 --- a/plugin-packs/postcss-preset-env/.tape.js +++ b/plugin-packs/postcss-preset-env/.tape.js @@ -83,7 +83,7 @@ module.exports = { }, insertBefore: { 'color-mod-function': [ - require('postcss-simple-vars') + require('postcss-simple-vars')() ] } } @@ -93,7 +93,7 @@ module.exports = { options: { stage: 1, insertAfter: { - 'color-mod-function': require('postcss-simple-vars') + 'color-mod-function': require('postcss-simple-vars')() } }, }, @@ -113,7 +113,7 @@ module.exports = { stage: 1, insertAfter: { 'color-mod-function': [ - require('postcss-simple-vars') + require('postcss-simple-vars')() ] }, features: { diff --git a/plugin-packs/postcss-preset-env/package.json b/plugin-packs/postcss-preset-env/package.json index fbca8ced0..cb85df663 100644 --- a/plugin-packs/postcss-preset-env/package.json +++ b/plugin-packs/postcss-preset-env/package.json @@ -21,7 +21,7 @@ "scripts": { "prepublishOnly": "npm run build && npm run test", "lint": "eslint src/**/*.js", - "test": "postcss-tape", + "test": "postcss-tape --ci", "build": "rollup -c ../../rollup/default.js", "stryker": "stryker run --logLevel error" }, @@ -65,7 +65,8 @@ }, "devDependencies": { "postcss": "^8.3.6", - "postcss-tape": "^6.0.1" + "postcss-tape": "^6.0.1", + "postcss-simple-vars": "^6.0.3" }, "peerDependencies": { "postcss": "^8.3" diff --git a/plugin-packs/postcss-preset-env/test/basic.autoprefixer.expect.css b/plugin-packs/postcss-preset-env/test/basic.autoprefixer.expect.css index 7b3eaf1a2..ae592c00b 100644 --- a/plugin-packs/postcss-preset-env/test/basic.autoprefixer.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.autoprefixer.expect.css @@ -9,18 +9,22 @@ .test-image-set-function { background-image: url(img/test.png); + background-image: image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x); + order: 2; } -@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { +@media (-webkit-min-device-pixel-ratio: 1), (min-resolution: 96dpi) { .test-image-set-function { - background-image: url(img/test-2x.png); + background-image: url(img/test.png); } } +@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { + .test-image-set-function { - background-image: image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x); - order: 2; + background-image: url(img/test-2x.png); +} } [dir="ltr"] .test-logical-properties-and-values { @@ -97,8 +101,8 @@ } .test-lab-function { - background-color: rgb(178, 34, 34); - color: rgba(178, 34, 34, 0.5); + background-color: rgb(179, 35, 35); + color: rgba(179, 34, 35, 0.5); order: 14; } diff --git a/plugin-packs/postcss-preset-env/test/basic.autoprefixer.false.expect.css b/plugin-packs/postcss-preset-env/test/basic.autoprefixer.false.expect.css index 7b3eaf1a2..ae592c00b 100644 --- a/plugin-packs/postcss-preset-env/test/basic.autoprefixer.false.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.autoprefixer.false.expect.css @@ -9,18 +9,22 @@ .test-image-set-function { background-image: url(img/test.png); + background-image: image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x); + order: 2; } -@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { +@media (-webkit-min-device-pixel-ratio: 1), (min-resolution: 96dpi) { .test-image-set-function { - background-image: url(img/test-2x.png); + background-image: url(img/test.png); } } +@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { + .test-image-set-function { - background-image: image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x); - order: 2; + background-image: url(img/test-2x.png); +} } [dir="ltr"] .test-logical-properties-and-values { @@ -97,8 +101,8 @@ } .test-lab-function { - background-color: rgb(178, 34, 34); - color: rgba(178, 34, 34, 0.5); + background-color: rgb(179, 35, 35); + color: rgba(179, 34, 35, 0.5); order: 14; } diff --git a/plugin-packs/postcss-preset-env/test/basic.ch38.expect.css b/plugin-packs/postcss-preset-env/test/basic.ch38.expect.css index 286e8618d..a2e037294 100644 --- a/plugin-packs/postcss-preset-env/test/basic.ch38.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.ch38.expect.css @@ -9,19 +9,23 @@ .test-image-set-function { background-image: url(img/test.png); + background-image: -webkit-image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x); + background-image: image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x); + order: 2; } -@media (min-resolution: 192dpi) { +@media (min-resolution: 96dpi) { .test-image-set-function { - background-image: url(img/test-2x.png); + background-image: url(img/test.png); } } +@media (min-resolution: 192dpi) { + .test-image-set-function { - background-image: -webkit-image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x); - background-image: image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x); - order: 2; + background-image: url(img/test-2x.png); +} } [dir="ltr"] .test-logical-properties-and-values { @@ -98,8 +102,8 @@ } .test-lab-function { - background-color: rgb(178, 34, 34); - color: rgba(178, 34, 34, 0.5); + background-color: rgb(179, 35, 35); + color: rgba(179, 34, 35, 0.5); order: 14; } diff --git a/plugin-packs/postcss-preset-env/test/basic.expect.css b/plugin-packs/postcss-preset-env/test/basic.expect.css index f66a86bd7..d8e8d8916 100644 --- a/plugin-packs/postcss-preset-env/test/basic.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.expect.css @@ -9,19 +9,23 @@ .test-image-set-function { background-image: url(img/test.png); + background-image: -webkit-image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x); + background-image: image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x); + order: 2; } -@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { +@media (-webkit-min-device-pixel-ratio: 1), (min-resolution: 96dpi) { .test-image-set-function { - background-image: url(img/test-2x.png); + background-image: url(img/test.png); } } +@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { + .test-image-set-function { - background-image: -webkit-image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x); - background-image: image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x); - order: 2; + background-image: url(img/test-2x.png); +} } [dir="ltr"] .test-logical-properties-and-values { @@ -98,8 +102,8 @@ } .test-lab-function { - background-color: rgb(178, 34, 34); - color: rgba(178, 34, 34, 0.5); + background-color: rgb(179, 35, 35); + color: rgba(179, 34, 35, 0.5); order: 14; } diff --git a/plugin-packs/postcss-preset-env/test/basic.ff49.expect.css b/plugin-packs/postcss-preset-env/test/basic.ff49.expect.css index 416b52c3a..c98fbf83f 100644 --- a/plugin-packs/postcss-preset-env/test/basic.ff49.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.ff49.expect.css @@ -8,18 +8,22 @@ .test-image-set-function { background-image: url(img/test.png); + background-image: image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x); + order: 2; } -@media (min-resolution: 192dpi) { +@media (min-resolution: 96dpi) { .test-image-set-function { - background-image: url(img/test-2x.png); + background-image: url(img/test.png); } } +@media (min-resolution: 192dpi) { + .test-image-set-function { - background-image: image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x); - order: 2; + background-image: url(img/test-2x.png); +} } .test-logical-properties-and-values { @@ -88,8 +92,8 @@ } .test-lab-function { - background-color: rgb(178, 34, 34); - color: rgba(178, 34, 34, 0.5); + background-color: rgb(179, 35, 35); + color: rgba(179, 34, 35, 0.5); order: 14; } diff --git a/plugin-packs/postcss-preset-env/test/basic.stage0-ff49.expect.css b/plugin-packs/postcss-preset-env/test/basic.stage0-ff49.expect.css index 79fe510c9..fb13c1998 100644 --- a/plugin-packs/postcss-preset-env/test/basic.stage0-ff49.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.stage0-ff49.expect.css @@ -8,18 +8,22 @@ .test-image-set-function { background-image: url(img/test.png); + background-image: image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x); + order: 2; } -@media (min-resolution: 192dpi) { +@media (min-resolution: 96dpi) { .test-image-set-function { - background-image: url(img/test-2x.png); + background-image: url(img/test.png); } } +@media (min-resolution: 192dpi) { + .test-image-set-function { - background-image: image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x); - order: 2; + background-image: url(img/test-2x.png); +} } .test-logical-properties-and-values { @@ -92,8 +96,8 @@ h1.test-custom-selectors,h2.test-custom-selectors,h3.test-custom-selectors,h4.te } .test-lab-function { - background-color: rgb(178, 34, 34); - color: rgba(178, 34, 34, 0.5); + background-color: rgb(179, 35, 35); + color: rgba(179, 34, 35, 0.5); order: 14; } diff --git a/plugin-packs/postcss-preset-env/test/basic.stage0.expect.css b/plugin-packs/postcss-preset-env/test/basic.stage0.expect.css index b5262b8aa..af1344c4e 100644 --- a/plugin-packs/postcss-preset-env/test/basic.stage0.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.stage0.expect.css @@ -9,19 +9,23 @@ .test-image-set-function { background-image: url(img/test.png); + background-image: -webkit-image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x); + background-image: image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x); + order: 2; } -@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { +@media (-webkit-min-device-pixel-ratio: 1), (min-resolution: 96dpi) { .test-image-set-function { - background-image: url(img/test-2x.png); + background-image: url(img/test.png); } } +@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { + .test-image-set-function { - background-image: -webkit-image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x); - background-image: image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x); - order: 2; + background-image: url(img/test-2x.png); +} } [dir="ltr"] .test-logical-properties-and-values { @@ -102,8 +106,8 @@ h1.test-custom-selectors,h2.test-custom-selectors,h3.test-custom-selectors,h4.te } .test-lab-function { - background-color: rgb(178, 34, 34); - color: rgba(178, 34, 34, 0.5); + background-color: rgb(179, 35, 35); + color: rgba(179, 34, 35, 0.5); order: 14; } diff --git a/plugins/css-blank-pseudo/package.json b/plugins/css-blank-pseudo/package.json index 7746f3940..cace0b936 100644 --- a/plugins/css-blank-pseudo/package.json +++ b/plugins/css-blank-pseudo/package.json @@ -9,6 +9,11 @@ "main": "dist/index.cjs", "module": "dist/index.mjs", "exports": { + ".": { + "import": "./dist/index.mjs", + "require": "./dist/index.cjs", + "default": "./dist/index.mjs" + }, "./browser": { "default": "./dist/browser.js" }, @@ -29,7 +34,7 @@ "scripts": { "prepublishOnly": "npm run build && npm run test", "lint": "eslint src/**/*.js", - "test": "postcss-tape", + "test": "postcss-tape --ci", "build": "rollup -c ../../rollup/default-with-browser.js", "stryker": "stryker run --logLevel error" }, @@ -37,11 +42,11 @@ "node": "^12 || ^14 || >=16" }, "dependencies": { - "postcss-selector-parser": "6.0.6" + "postcss-selector-parser": "^6.0.6" }, "devDependencies": { - "postcss": "8.3.6", - "postcss-tape": "6.0.1" + "postcss": "^8.3.6", + "postcss-tape": "^6.0.1" }, "peerDependencies": { "postcss": "^8.3" diff --git a/plugins/css-has-pseudo/package.json b/plugins/css-has-pseudo/package.json index 871d927de..9bd97c7f6 100644 --- a/plugins/css-has-pseudo/package.json +++ b/plugins/css-has-pseudo/package.json @@ -9,6 +9,11 @@ "main": "dist/index.cjs", "module": "dist/index.mjs", "exports": { + ".": { + "import": "./dist/index.mjs", + "require": "./dist/index.cjs", + "default": "./dist/index.mjs" + }, "./browser": { "default": "./dist/browser.js" }, @@ -29,7 +34,7 @@ "scripts": { "prepublishOnly": "npm run build && npm run test", "lint": "eslint src/**/*.js", - "test": "postcss-tape", + "test": "postcss-tape --ci", "build": "rollup -c ../../rollup/default-with-browser.js", "stryker": "stryker run --logLevel error" }, @@ -37,11 +42,11 @@ "node": "^12 || ^14 || >=16" }, "dependencies": { - "postcss-selector-parser": "6.0.6" + "postcss-selector-parser": "^6.0.6" }, "devDependencies": { - "postcss": "8.3.6", - "postcss-tape": "6.0.1" + "postcss": "^8.3.6", + "postcss-tape": "^6.0.1" }, "peerDependencies": { "postcss": "^8.3" diff --git a/plugins/css-prefers-color-scheme/package.json b/plugins/css-prefers-color-scheme/package.json index 5d6a7d878..f249ac6f8 100644 --- a/plugins/css-prefers-color-scheme/package.json +++ b/plugins/css-prefers-color-scheme/package.json @@ -9,6 +9,11 @@ "main": "dist/index.cjs", "module": "dist/index.mjs", "exports": { + ".": { + "import": "./dist/index.mjs", + "require": "./dist/index.cjs", + "default": "./dist/index.mjs" + }, "./browser": { "default": "./dist/browser.js" }, @@ -29,7 +34,7 @@ "scripts": { "prepublishOnly": "npm run build && npm run test", "lint": "eslint src/**/*.js", - "test": "postcss-tape", + "test": "postcss-tape --ci", "build": "rollup -c ../../rollup/default-with-browser.js", "stryker": "stryker run --logLevel error" }, @@ -37,8 +42,8 @@ "node": "^12 || ^14 || >=16" }, "devDependencies": { - "postcss": "8.3.6", - "postcss-tape": "6.0.1" + "postcss": "^8.3.6", + "postcss-tape": "^6.0.1" }, "peerDependencies": { "postcss": "^8.3" diff --git a/plugins/postcss-base-plugin/package.json b/plugins/postcss-base-plugin/package.json index c5b8f10f8..ebc97f273 100644 --- a/plugins/postcss-base-plugin/package.json +++ b/plugins/postcss-base-plugin/package.json @@ -24,13 +24,12 @@ "scripts": { "prepublishOnly": "npm run build --if-present && npm run test --if-present", "lint": "eslint src/**/*.ts", - "test": "postcss-tape", + "test": "postcss-tape --ci", "test:cli": "bash ./test/cli/test.sh", "build": "rollup -c ../../rollup/default.ts.js", "stryker": "stryker run --logLevel error" }, "devDependencies": { - "@csstools/base-cli": "^0.1.0", "postcss": "^8.3.6", "postcss-tape": "^6.0.1" }, diff --git a/plugins/postcss-base-plugin/src/index.ts b/plugins/postcss-base-plugin/src/index.ts index 1068ac962..ee1f96bc0 100644 --- a/plugins/postcss-base-plugin/src/index.ts +++ b/plugins/postcss-base-plugin/src/index.ts @@ -5,7 +5,7 @@ const creator: PluginCreator<{ color: string }> = (opts?: { color: string }) => postcssPlugin: 'postcss-base-plugin', Declaration(decl) { if (decl.value === 'red') { - if (opts?.color) { + if (opts && opts.color) { decl.value = opts.color; } else { decl.value = 'blue'; diff --git a/plugins/postcss-color-functional-notation/package.json b/plugins/postcss-color-functional-notation/package.json index 92a455113..0a35e3f8d 100644 --- a/plugins/postcss-color-functional-notation/package.json +++ b/plugins/postcss-color-functional-notation/package.json @@ -21,7 +21,7 @@ "scripts": { "prepublishOnly": "npm run build && npm run test", "lint": "eslint src/**/*.js", - "test": "postcss-tape", + "test": "postcss-tape --ci", "build": "rollup -c ../../rollup/default.js", "stryker": "stryker run --logLevel error" }, diff --git a/plugins/postcss-dir-pseudo-class/package.json b/plugins/postcss-dir-pseudo-class/package.json index d65a523ae..d927f8b4b 100644 --- a/plugins/postcss-dir-pseudo-class/package.json +++ b/plugins/postcss-dir-pseudo-class/package.json @@ -21,7 +21,7 @@ "scripts": { "prepublishOnly": "npm run build && npm run test", "lint": "eslint src/**/*.js", - "test": "postcss-tape", + "test": "postcss-tape --ci", "build": "rollup -c ../../rollup/default.js", "stryker": "stryker run --logLevel error" }, @@ -29,11 +29,11 @@ "node": "^12 || ^14 || >=16" }, "dependencies": { - "postcss-selector-parser": "6.0.6" + "postcss-selector-parser": "^6.0.6" }, "devDependencies": { - "postcss": "8.3.6", - "postcss-tape": "6.0.1" + "postcss": "^8.3.6", + "postcss-tape": "^6.0.1" }, "peerDependencies": { "postcss": "^8.3" diff --git a/plugins/postcss-double-position-gradients/package.json b/plugins/postcss-double-position-gradients/package.json index 0c259827f..b08676fb0 100644 --- a/plugins/postcss-double-position-gradients/package.json +++ b/plugins/postcss-double-position-gradients/package.json @@ -21,7 +21,7 @@ "scripts": { "prepublishOnly": "npm run build && npm run test", "lint": "eslint src/**/*.js", - "test": "postcss-tape", + "test": "postcss-tape --ci", "build": "rollup -c ../../rollup/default.js", "stryker": "stryker run --logLevel error" }, @@ -32,8 +32,8 @@ "postcss-values-parser": "^6.0.1" }, "devDependencies": { - "postcss": "8.3.6", - "postcss-tape": "6.0.1" + "postcss": "^8.3.6", + "postcss-tape": "^6.0.1" }, "peerDependencies": { "postcss": "^8.3" diff --git a/plugins/postcss-env-function/package.json b/plugins/postcss-env-function/package.json index c3207a703..2b1b074f4 100644 --- a/plugins/postcss-env-function/package.json +++ b/plugins/postcss-env-function/package.json @@ -21,7 +21,7 @@ "scripts": { "prepublishOnly": "npm run build && npm run test", "lint": "eslint src/**/*.js", - "test": "postcss-tape", + "test": "postcss-tape --ci", "build": "rollup -c ../../rollup/default.js", "stryker": "stryker run --logLevel error" }, @@ -29,11 +29,11 @@ "node": "^12 || ^14 || >=16" }, "dependencies": { - "postcss-values-parser": "6.0.1" + "postcss-values-parser": "^6.0.1" }, "devDependencies": { - "postcss": "8.3.6", - "postcss-tape": "6.0.1" + "postcss": "^8.3.6", + "postcss-tape": "^6.0.1" }, "peerDependencies": { "postcss": "^8.3" diff --git a/plugins/postcss-focus-visible/package.json b/plugins/postcss-focus-visible/package.json index 3effe76e3..e86233d0a 100644 --- a/plugins/postcss-focus-visible/package.json +++ b/plugins/postcss-focus-visible/package.json @@ -22,7 +22,7 @@ "scripts": { "prepublishOnly": "npm run build && npm run test", "lint": "eslint src/**/*.ts", - "test": "postcss-tape", + "test": "postcss-tape --ci", "build": "rollup -c ../../rollup/default.ts.js", "stryker": "stryker run --logLevel error" }, @@ -30,11 +30,11 @@ "node": "^12 || ^14 || >=16" }, "dependencies": { - "postcss-selector-parser": "6.0.6" + "postcss-selector-parser": "^6.0.6" }, "devDependencies": { - "postcss": "8.3.6", - "postcss-tape": "6.0.1" + "postcss": "^8.3.6", + "postcss-tape": "^6.0.1" }, "peerDependencies": { "postcss": "^8.3" diff --git a/plugins/postcss-focus-visible/src/index.ts b/plugins/postcss-focus-visible/src/index.ts index 43b196a21..8f18496c3 100644 --- a/plugins/postcss-focus-visible/src/index.ts +++ b/plugins/postcss-focus-visible/src/index.ts @@ -2,7 +2,7 @@ import parser from 'postcss-selector-parser'; import type { PluginCreator } from 'postcss'; -export const selectorRegExp = /(? = (opts?: { preserve?: boolean, replaceWith?: string }) => { opts = Object(opts); diff --git a/plugins/postcss-focus-within/package.json b/plugins/postcss-focus-within/package.json index 77e1f6016..43c922404 100644 --- a/plugins/postcss-focus-within/package.json +++ b/plugins/postcss-focus-within/package.json @@ -22,7 +22,7 @@ "scripts": { "prepublishOnly": "npm run build && npm run test", "lint": "eslint src/**/*.ts", - "test": "postcss-tape", + "test": "postcss-tape --ci", "build": "rollup -c ../../rollup/default.ts.js", "stryker": "stryker run --logLevel error" }, @@ -30,11 +30,11 @@ "node": "^12 || ^14 || >=16" }, "dependencies": { - "postcss-selector-parser": "6.0.6" + "postcss-selector-parser": "^6.0.6" }, "devDependencies": { - "postcss": "8.3.6", - "postcss-tape": "6.0.1" + "postcss": "^8.3.6", + "postcss-tape": "^6.0.1" }, "peerDependencies": { "postcss": "^8.3" diff --git a/plugins/postcss-gap-properties/package.json b/plugins/postcss-gap-properties/package.json index 3848657ce..75b89cbae 100644 --- a/plugins/postcss-gap-properties/package.json +++ b/plugins/postcss-gap-properties/package.json @@ -21,7 +21,7 @@ "scripts": { "prepublishOnly": "npm run build && npm run test", "lint": "eslint src/**/*.js", - "test": "postcss-tape", + "test": "postcss-tape --ci", "build": "rollup -c ../../rollup/default.js", "stryker": "stryker run --logLevel error" }, @@ -29,8 +29,8 @@ "node": "^12 || ^14 || >=16" }, "devDependencies": { - "postcss": "8.3.6", - "postcss-tape": "6.0.1" + "postcss": "^8.3.6", + "postcss-tape": "^6.0.1" }, "peerDependencies": { "postcss": "^8.3" diff --git a/plugins/postcss-image-set-function/package.json b/plugins/postcss-image-set-function/package.json index c18e19e57..a55ccae1e 100644 --- a/plugins/postcss-image-set-function/package.json +++ b/plugins/postcss-image-set-function/package.json @@ -21,8 +21,8 @@ }, "scripts": { "prepublishOnly": "npm run build && npm run test", - "lint": "eslint src/**/*.js", - "test": "postcss-tape", + "lint": "eslint src/**/*.ts", + "test": "postcss-tape --ci", "build": "rollup -c ../../rollup/default.ts.js", "stryker": "stryker run --logLevel error" }, @@ -30,11 +30,11 @@ "node": "^12 || ^14 || >=16" }, "dependencies": { - "postcss-values-parser": "6.0.1" + "postcss-values-parser": "^6.0.1" }, "devDependencies": { - "postcss": "8.3.6", - "postcss-tape": "6.0.1" + "postcss": "^8.3.6", + "postcss-tape": "^6.0.1" }, "peerDependencies": { "postcss": "^8.3" diff --git a/plugins/postcss-lab-function/package.json b/plugins/postcss-lab-function/package.json index c146026a0..0a847926b 100644 --- a/plugins/postcss-lab-function/package.json +++ b/plugins/postcss-lab-function/package.json @@ -22,7 +22,7 @@ "scripts": { "prepublishOnly": "npm run build --if-present && npm run test --if-present", "lint": "eslint src/**/*.ts", - "test": "node ./test/color/test.mjs && postcss-tape", + "test": "node ./test/color/test.mjs && postcss-tape --ci", "build": "rollup -c ../../rollup/default.ts.js", "stryker": "stryker run --logLevel error", "generate-color-corpus": "python3 ./test/color/generate.py" @@ -34,7 +34,6 @@ "postcss-values-parser": "^6.0.1" }, "devDependencies": { - "@csstools/base-cli": "^0.1.0", "postcss": "^8.3.6", "postcss-tape": "^6.0.1" }, diff --git a/plugins/postcss-lab-function/src/index.ts b/plugins/postcss-lab-function/src/index.ts index f3df7eb3f..c0aa16f5c 100644 --- a/plugins/postcss-lab-function/src/index.ts +++ b/plugins/postcss-lab-function/src/index.ts @@ -6,7 +6,7 @@ import onCSSFunction from './on-css-function'; import type { PluginCreator } from 'postcss'; // NOTE : Used in unit tests. -export { labToSRgb, lchToSRgb } from './color'; +import { labToSRgb, lchToSRgb } from './color'; /** Transform lab() and lch() functions in CSS. */ const postcssPlugin: PluginCreator<{ preserve: boolean }> = (opts?: { preserve: boolean }) => { @@ -86,4 +86,10 @@ const postcssPlugin: PluginCreator<{ preserve: boolean }> = (opts?: { preserve: postcssPlugin.postcss = true; +// Used by unit tests. +// Mixing named and default export causes issues with CJS. +// Attaching these to the default export is the best solution. +postcssPlugin['_labToSRgb'] = labToSRgb; +postcssPlugin['_lchToSRgb'] = lchToSRgb; + export default postcssPlugin; diff --git a/plugins/postcss-lab-function/test/color/test.mjs b/plugins/postcss-lab-function/test/color/test.mjs index 63eb2f8a9..f1b023b88 100644 --- a/plugins/postcss-lab-function/test/color/test.mjs +++ b/plugins/postcss-lab-function/test/color/test.mjs @@ -3,7 +3,9 @@ // ColorAid is a python package that follows the CSS specification. // Comparing our output to the python package gives a relatively good idea of how good we convert. import fs from 'fs'; -import { labToSRgb, lchToSRgb } from '../../dist/index.mjs'; +import plugin from '../../dist/index.mjs'; +const labToSRgb = plugin._labToSRgb; +const lchToSRgb = plugin._lchToSRgb; // LAB to SRGB { diff --git a/plugins/postcss-logical/package.json b/plugins/postcss-logical/package.json index c398cf1c3..14be88440 100644 --- a/plugins/postcss-logical/package.json +++ b/plugins/postcss-logical/package.json @@ -21,7 +21,7 @@ "scripts": { "prepublishOnly": "npm run build && npm run test", "lint": "eslint src/**/*.js", - "test": "postcss-tape", + "test": "postcss-tape --ci", "build": "rollup -c ../../rollup/default.js", "stryker": "stryker run --logLevel error" }, @@ -29,8 +29,8 @@ "node": "^12 || ^14 || >=16" }, "devDependencies": { - "postcss": "8.3.6", - "postcss-tape": "6.0.1" + "postcss": "^8.3.6", + "postcss-tape": "^6.0.1" }, "peerDependencies": { "postcss": "^8.3" diff --git a/plugins/postcss-nesting/package.json b/plugins/postcss-nesting/package.json index 67fb80af4..0f4ed46b1 100644 --- a/plugins/postcss-nesting/package.json +++ b/plugins/postcss-nesting/package.json @@ -30,7 +30,7 @@ "scripts": { "prepublishOnly": "npm run build && npm run test", "lint": "eslint src/**/*.js", - "test": "postcss-tape && npm run test:deno", + "test": "postcss-tape --ci", "test:deno": "deno run --unstable --allow-env --allow-read test/deno/test.js", "build": "rollup -c ../../rollup/default-with-deno.js", "stryker": "stryker run --logLevel error" @@ -39,11 +39,11 @@ "node": "^12 || ^14 || >=16" }, "dependencies": { - "postcss-selector-parser": "6.0.6" + "postcss-selector-parser": "^6.0.6" }, "devDependencies": { - "postcss": "8.3.6", - "postcss-tape": "6.0.1" + "postcss": "^8.3.6", + "postcss-tape": "^6.0.1" }, "peerDependencies": { "postcss": "^8.3" diff --git a/plugins/postcss-overflow-shorthand/package.json b/plugins/postcss-overflow-shorthand/package.json index a9ad23a5d..37f5f7e90 100644 --- a/plugins/postcss-overflow-shorthand/package.json +++ b/plugins/postcss-overflow-shorthand/package.json @@ -21,7 +21,7 @@ "scripts": { "prepublishOnly": "npm run build && npm run test", "lint": "eslint src/**/*.js", - "test": "postcss-tape", + "test": "postcss-tape --ci", "build": "rollup -c ../../rollup/default.js", "stryker": "stryker run --logLevel error" }, @@ -29,8 +29,8 @@ "node": "^12 || ^14 || >=16" }, "devDependencies": { - "postcss": "8.3.6", - "postcss-tape": "6.0.1" + "postcss": "^8.3.6", + "postcss-tape": "^6.0.1" }, "peerDependencies": { "postcss": "^8.3" diff --git a/plugins/postcss-place/package.json b/plugins/postcss-place/package.json index eede19f40..dfdefcce7 100755 --- a/plugins/postcss-place/package.json +++ b/plugins/postcss-place/package.json @@ -21,7 +21,7 @@ "scripts": { "prepublishOnly": "npm run build && npm run test", "lint": "eslint src/**/*.js", - "test": "postcss-tape", + "test": "postcss-tape --ci", "build": "rollup -c ../../rollup/default.js", "stryker": "stryker run --logLevel error" }, @@ -29,11 +29,11 @@ "node": "^12 || ^14 || >=16" }, "dependencies": { - "postcss-values-parser": "6.0.1" + "postcss-values-parser": "^6.0.1" }, "devDependencies": { - "postcss": "8.3.6", - "postcss-tape": "6.0.1" + "postcss": "^8.3.6", + "postcss-tape": "^6.0.1" }, "peerDependencies": { "postcss": "^8.3" diff --git a/plugins/postcss-pseudo-class-any-link/package.json b/plugins/postcss-pseudo-class-any-link/package.json index 51170863b..89edd5e1d 100644 --- a/plugins/postcss-pseudo-class-any-link/package.json +++ b/plugins/postcss-pseudo-class-any-link/package.json @@ -21,7 +21,7 @@ "scripts": { "prepublishOnly": "npm run build && npm run test", "lint": "eslint src/**/*.js", - "test": "postcss-tape", + "test": "postcss-tape --ci", "build": "rollup -c ../../rollup/default.js", "stryker": "stryker run --logLevel error" }, @@ -32,8 +32,8 @@ "postcss-selector-parser": "^6.0.6" }, "devDependencies": { - "postcss": "8.3.6", - "postcss-tape": "6.0.1" + "postcss": "^8.3.6", + "postcss-tape": "^6.0.1" }, "peerDependencies": { "postcss": "^8.3" diff --git a/rollup/default-with-browser.js b/rollup/default-with-browser.js index 4c983e09c..968f2f4d8 100644 --- a/rollup/default-with-browser.js +++ b/rollup/default-with-browser.js @@ -12,8 +12,10 @@ export default [ { file: 'dist/index.mjs', format: 'esm', sourcemap: true, exports: 'auto' }, ], external: [ - 'postcss-values-parser', + 'fs', + 'path', 'postcss-selector-parser', + 'postcss-values-parser', ], plugins: [ babel({ @@ -37,6 +39,46 @@ export default [ output: [ { file: 'dist/browser.cjs', format: 'cjs', sourcemap: true, exports: 'auto', strict: false }, ], + external: [ + 'fs', + 'path', + + 'autoprefixer', + 'browserslist', + 'caniuse-lite', + 'css-blank-pseudo', + 'css-has-pseudo', + 'css-prefers-color-scheme', + 'cssdb', + 'postcss-attribute-case-insensitive', + 'postcss-color-functional-notation', + 'postcss-color-hex-alpha', + 'postcss-color-rebeccapurple', + 'postcss-custom-media', + 'postcss-custom-properties', + 'postcss-custom-selectors', + 'postcss-dir-pseudo-class', + 'postcss-double-position-gradients', + 'postcss-env-function', + 'postcss-focus-visible', + 'postcss-focus-within', + 'postcss-font-variant', + 'postcss-gap-properties', + 'postcss-image-set-function', + 'postcss-initial', + 'postcss-lab-function', + 'postcss-logical', + 'postcss-media-minmax', + 'postcss-nesting', + 'postcss-overflow-shorthand', + 'postcss-page-break', + 'postcss-place', + 'postcss-pseudo-class-any-link', + 'postcss-replace-overflow-wrap', + 'postcss-selector-not', + 'postcss-selector-parser', + 'postcss-values-parser', + ], plugins: [ babel({ babelHelpers: 'bundled', diff --git a/rollup/default-with-deno.js b/rollup/default-with-deno.js index c062f5b00..01131802c 100644 --- a/rollup/default-with-deno.js +++ b/rollup/default-with-deno.js @@ -37,6 +37,46 @@ export default [ output: [ { file: 'dist/cli.mjs', format: 'esm', sourcemap: false }, ], + external: [ + 'fs', + 'path', + + 'autoprefixer', + 'browserslist', + 'caniuse-lite', + 'css-blank-pseudo', + 'css-has-pseudo', + 'css-prefers-color-scheme', + 'cssdb', + 'postcss-attribute-case-insensitive', + 'postcss-color-functional-notation', + 'postcss-color-hex-alpha', + 'postcss-color-rebeccapurple', + 'postcss-custom-media', + 'postcss-custom-properties', + 'postcss-custom-selectors', + 'postcss-dir-pseudo-class', + 'postcss-double-position-gradients', + 'postcss-env-function', + 'postcss-focus-visible', + 'postcss-focus-within', + 'postcss-font-variant', + 'postcss-gap-properties', + 'postcss-image-set-function', + 'postcss-initial', + 'postcss-lab-function', + 'postcss-logical', + 'postcss-media-minmax', + 'postcss-nesting', + 'postcss-overflow-shorthand', + 'postcss-page-break', + 'postcss-place', + 'postcss-pseudo-class-any-link', + 'postcss-replace-overflow-wrap', + 'postcss-selector-not', + 'postcss-selector-parser', + 'postcss-values-parser', + ], onwarn: (warning) => { // Silence circular dependency warning for postcss-values-parsers package if ( diff --git a/rollup/default.js b/rollup/default.js index 38071c1c1..ff97dc6b2 100644 --- a/rollup/default.js +++ b/rollup/default.js @@ -12,8 +12,10 @@ export default [ { file: 'dist/index.mjs', format: 'esm', sourcemap: true, exports: 'auto' }, ], external: [ - 'postcss-values-parser', + 'fs', + 'path', 'postcss-selector-parser', + 'postcss-values-parser', ], plugins: [ babel({ @@ -37,6 +39,46 @@ export default [ output: [ { file: 'dist/cli.mjs', format: 'esm', sourcemap: false }, ], + external: [ + 'fs', + 'path', + + 'autoprefixer', + 'browserslist', + 'caniuse-lite', + 'css-blank-pseudo', + 'css-has-pseudo', + 'css-prefers-color-scheme', + 'cssdb', + 'postcss-attribute-case-insensitive', + 'postcss-color-functional-notation', + 'postcss-color-hex-alpha', + 'postcss-color-rebeccapurple', + 'postcss-custom-media', + 'postcss-custom-properties', + 'postcss-custom-selectors', + 'postcss-dir-pseudo-class', + 'postcss-double-position-gradients', + 'postcss-env-function', + 'postcss-focus-visible', + 'postcss-focus-within', + 'postcss-font-variant', + 'postcss-gap-properties', + 'postcss-image-set-function', + 'postcss-initial', + 'postcss-lab-function', + 'postcss-logical', + 'postcss-media-minmax', + 'postcss-nesting', + 'postcss-overflow-shorthand', + 'postcss-page-break', + 'postcss-place', + 'postcss-pseudo-class-any-link', + 'postcss-replace-overflow-wrap', + 'postcss-selector-not', + 'postcss-selector-parser', + 'postcss-values-parser', + ], onwarn: (warning) => { // Silence circular dependency warning for postcss-values-parsers package if ( diff --git a/rollup/default.ts.js b/rollup/default.ts.js index 7d0df0606..2dbd49780 100644 --- a/rollup/default.ts.js +++ b/rollup/default.ts.js @@ -13,8 +13,10 @@ export default [ { file: 'dist/index.mjs', format: 'esm', sourcemap: true, exports: 'auto' }, ], external: [ - 'postcss-values-parser', + 'fs', + 'path', 'postcss-selector-parser', + 'postcss-values-parser', ], plugins: [ typescript({ tsconfig: './tsconfig.json' }), @@ -39,6 +41,46 @@ export default [ output: [ { file: 'dist/cli.mjs', format: 'esm', sourcemap: false }, ], + external: [ + 'fs', + 'path', + + 'autoprefixer', + 'browserslist', + 'caniuse-lite', + 'css-blank-pseudo', + 'css-has-pseudo', + 'css-prefers-color-scheme', + 'cssdb', + 'postcss-attribute-case-insensitive', + 'postcss-color-functional-notation', + 'postcss-color-hex-alpha', + 'postcss-color-rebeccapurple', + 'postcss-custom-media', + 'postcss-custom-properties', + 'postcss-custom-selectors', + 'postcss-dir-pseudo-class', + 'postcss-double-position-gradients', + 'postcss-env-function', + 'postcss-focus-visible', + 'postcss-focus-within', + 'postcss-font-variant', + 'postcss-gap-properties', + 'postcss-image-set-function', + 'postcss-initial', + 'postcss-lab-function', + 'postcss-logical', + 'postcss-media-minmax', + 'postcss-nesting', + 'postcss-overflow-shorthand', + 'postcss-page-break', + 'postcss-place', + 'postcss-pseudo-class-any-link', + 'postcss-replace-overflow-wrap', + 'postcss-selector-not', + 'postcss-selector-parser', + 'postcss-values-parser', + ], onwarn: (warning) => { // Silence circular dependency warning for postcss-values-parsers package if ( From b457a4283e7f3ea2bd69907ffc37c7a4d0bb77eb Mon Sep 17 00:00:00 2001 From: romainmenke Date: Mon, 29 Nov 2021 10:59:19 +0100 Subject: [PATCH 4/4] update tests --- .../postcss-preset-env/test/basic.autoprefixer.expect.css | 7 ------- .../test/basic.autoprefixer.false.expect.css | 7 ------- plugin-packs/postcss-preset-env/test/basic.ch38.expect.css | 7 ------- plugin-packs/postcss-preset-env/test/basic.expect.css | 7 ------- plugin-packs/postcss-preset-env/test/basic.ff49.expect.css | 7 ------- .../postcss-preset-env/test/basic.stage0-ff49.expect.css | 7 ------- .../postcss-preset-env/test/basic.stage0.expect.css | 7 ------- 7 files changed, 49 deletions(-) diff --git a/plugin-packs/postcss-preset-env/test/basic.autoprefixer.expect.css b/plugin-packs/postcss-preset-env/test/basic.autoprefixer.expect.css index ae592c00b..c4a3b425f 100644 --- a/plugin-packs/postcss-preset-env/test/basic.autoprefixer.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.autoprefixer.expect.css @@ -13,13 +13,6 @@ order: 2; } -@media (-webkit-min-device-pixel-ratio: 1), (min-resolution: 96dpi) { - -.test-image-set-function { - background-image: url(img/test.png); -} -} - @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { .test-image-set-function { diff --git a/plugin-packs/postcss-preset-env/test/basic.autoprefixer.false.expect.css b/plugin-packs/postcss-preset-env/test/basic.autoprefixer.false.expect.css index ae592c00b..c4a3b425f 100644 --- a/plugin-packs/postcss-preset-env/test/basic.autoprefixer.false.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.autoprefixer.false.expect.css @@ -13,13 +13,6 @@ order: 2; } -@media (-webkit-min-device-pixel-ratio: 1), (min-resolution: 96dpi) { - -.test-image-set-function { - background-image: url(img/test.png); -} -} - @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { .test-image-set-function { diff --git a/plugin-packs/postcss-preset-env/test/basic.ch38.expect.css b/plugin-packs/postcss-preset-env/test/basic.ch38.expect.css index a2e037294..dc841dd36 100644 --- a/plugin-packs/postcss-preset-env/test/basic.ch38.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.ch38.expect.css @@ -14,13 +14,6 @@ order: 2; } -@media (min-resolution: 96dpi) { - -.test-image-set-function { - background-image: url(img/test.png); -} -} - @media (min-resolution: 192dpi) { .test-image-set-function { diff --git a/plugin-packs/postcss-preset-env/test/basic.expect.css b/plugin-packs/postcss-preset-env/test/basic.expect.css index d8e8d8916..569980e19 100644 --- a/plugin-packs/postcss-preset-env/test/basic.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.expect.css @@ -14,13 +14,6 @@ order: 2; } -@media (-webkit-min-device-pixel-ratio: 1), (min-resolution: 96dpi) { - -.test-image-set-function { - background-image: url(img/test.png); -} -} - @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { .test-image-set-function { diff --git a/plugin-packs/postcss-preset-env/test/basic.ff49.expect.css b/plugin-packs/postcss-preset-env/test/basic.ff49.expect.css index c98fbf83f..1de6c4154 100644 --- a/plugin-packs/postcss-preset-env/test/basic.ff49.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.ff49.expect.css @@ -12,13 +12,6 @@ order: 2; } -@media (min-resolution: 96dpi) { - -.test-image-set-function { - background-image: url(img/test.png); -} -} - @media (min-resolution: 192dpi) { .test-image-set-function { diff --git a/plugin-packs/postcss-preset-env/test/basic.stage0-ff49.expect.css b/plugin-packs/postcss-preset-env/test/basic.stage0-ff49.expect.css index fb13c1998..b53dec5c6 100644 --- a/plugin-packs/postcss-preset-env/test/basic.stage0-ff49.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.stage0-ff49.expect.css @@ -12,13 +12,6 @@ order: 2; } -@media (min-resolution: 96dpi) { - -.test-image-set-function { - background-image: url(img/test.png); -} -} - @media (min-resolution: 192dpi) { .test-image-set-function { diff --git a/plugin-packs/postcss-preset-env/test/basic.stage0.expect.css b/plugin-packs/postcss-preset-env/test/basic.stage0.expect.css index af1344c4e..9a10585a2 100644 --- a/plugin-packs/postcss-preset-env/test/basic.stage0.expect.css +++ b/plugin-packs/postcss-preset-env/test/basic.stage0.expect.css @@ -14,13 +14,6 @@ order: 2; } -@media (-webkit-min-device-pixel-ratio: 1), (min-resolution: 96dpi) { - -.test-image-set-function { - background-image: url(img/test.png); -} -} - @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { .test-image-set-function {