diff --git a/plugins/postcss-overflow-shorthand/CONTRIBUTING.md b/CONTRIBUTING.md similarity index 87% rename from plugins/postcss-overflow-shorthand/CONTRIBUTING.md rename to CONTRIBUTING.md index fee8ef5b0..914d7a4fb 100644 --- a/plugins/postcss-overflow-shorthand/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,4 @@ -# Contributing to PostCSS Overflow Shorthand +# Contributing to CSSTools Plugins You want to help? You rock! Now, take a moment to be sure your contributions make sense to everyone else. @@ -20,13 +20,13 @@ 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-overflow-shorthand.git + git clone https://github.com//postcss-plugins.git # Navigate to the newly cloned directory - cd postcss-overflow-shorthand + cd postcss-plugins # Assign the original repo to a remote called "upstream" - git remote add upstream git@github.com:jonathantneal/postcss-overflow-shorthand.git + git remote add upstream https://github.com/csstools/postcss-plugins.git # Install the tools necessary for testing npm install diff --git a/plugins/postcss-overflow-shorthand/.editorconfig b/plugins/postcss-overflow-shorthand/.editorconfig deleted file mode 100644 index e06d7982b..000000000 --- a/plugins/postcss-overflow-shorthand/.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/plugins/postcss-overflow-shorthand/.github/workflows/test.yml b/plugins/postcss-overflow-shorthand/.github/workflows/test.yml deleted file mode 100644 index 4a287db8e..000000000 --- a/plugins/postcss-overflow-shorthand/.github/workflows/test.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: test -on: - push: - -jobs: - test: - runs-on: ubuntu-latest - strategy: - matrix: - node: [12, 16] - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node }} - - - run: yarn install --ignore-scripts - - run: yarn run test diff --git a/plugins/postcss-overflow-shorthand/.gitignore b/plugins/postcss-overflow-shorthand/.gitignore index 748acf5f9..b5d13c8c0 100644 --- a/plugins/postcss-overflow-shorthand/.gitignore +++ b/plugins/postcss-overflow-shorthand/.gitignore @@ -1,12 +1,13 @@ node_modules -index.*.* +dist package-lock.json yarn.lock *.log* *.result.css -.* +*.result.css.map !.editorconfig !.gitignore !.rollup.js !.tape.js +!.travis.yml !.github diff --git a/plugins/postcss-overflow-shorthand/.rollup.js b/plugins/postcss-overflow-shorthand/.rollup.js deleted file mode 100644 index 24ac36644..000000000 --- a/plugins/postcss-overflow-shorthand/.rollup.js +++ /dev/null @@ -1,17 +0,0 @@ -import babel from '@rollup/plugin-babel'; - -export default { - input: 'index.js', - output: [ - { file: 'index.cjs.js', format: 'cjs', sourcemap: true, exports: 'default' }, - { file: 'index.esm.mjs', format: 'esm', sourcemap: true, exports: 'default' } - ], - plugins: [ - babel({ - babelHelpers: 'bundled', - presets: [ - ['@babel/preset-env', { modules: false, targets: { node: 10 } }] - ] - }) - ] -}; diff --git a/plugins/postcss-overflow-shorthand/INSTALL.md b/plugins/postcss-overflow-shorthand/INSTALL.md index 793c2ef5a..6757b01e0 100644 --- a/plugins/postcss-overflow-shorthand/INSTALL.md +++ b/plugins/postcss-overflow-shorthand/INSTALL.md @@ -159,6 +159,6 @@ grunt.initConfig({ [PostCSS]: https://github.com/postcss/postcss [PostCSS CLI]: https://github.com/postcss/postcss-cli [PostCSS Loader]: https://github.com/postcss/postcss-loader -[PostCSS Overflow Shorthand]: https://github.com/jonathantneal/postcss-overflow-shorthand +[PostCSS Overflow Shorthand]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-overflow-shorthand [React App Rewire PostCSS]: https://github.com/csstools/react-app-rewire-postcss [React App Rewired]: https://github.com/timarney/react-app-rewired diff --git a/plugins/postcss-overflow-shorthand/README.md b/plugins/postcss-overflow-shorthand/README.md index dd57fa82c..3b5e58101 100644 --- a/plugins/postcss-overflow-shorthand/README.md +++ b/plugins/postcss-overflow-shorthand/README.md @@ -73,8 +73,8 @@ html { } ``` -[cli-img]: https://github.com/csstools/postcss-overflow-shorthand/workflows/test/badge.svg -[cli-url]: https://github.com/csstools/postcss-overflow-shorthand/actions/workflows/test.yml?query=workflow/test +[cli-img]: https://github.com/csstools/postcss-plugins/workflows/test/badge.svg +[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test [css-img]: https://cssdb.org/badge/overflow-property.svg [css-url]: https://cssdb.org/#overflow-property [git-img]: https://img.shields.io/badge/support-chat-blue.svg @@ -87,4 +87,4 @@ html { [Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss [PostCSS]: https://github.com/postcss/postcss [PostCSS Loader]: https://github.com/postcss/postcss-loader -[PostCSS Overflow Shorthand]: https://github.com/jonathantneal/postcss-overflow-shorthand +[PostCSS Overflow Shorthand]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-overflow-shorthand diff --git a/plugins/postcss-overflow-shorthand/package.json b/plugins/postcss-overflow-shorthand/package.json index eab1972ff..a9ad23a5d 100644 --- a/plugins/postcss-overflow-shorthand/package.json +++ b/plugins/postcss-overflow-shorthand/package.json @@ -4,54 +4,36 @@ "description": "Use the overflow shorthand in CSS", "author": "Jonathan Neal ", "license": "CC0-1.0", - "repository": "jonathantneal/postcss-overflow-shorthand", - "homepage": "https://github.com/jonathantneal/postcss-overflow-shorthand#readme", - "bugs": "https://github.com/jonathantneal/postcss-overflow-shorthand/issues", - "main": "index.cjs.js", - "module": "index.es.mjs", + "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-overflow-shorthand#readme", + "bugs": "https://github.com/csstools/postcss-plugins/issues", + "main": "dist/index.cjs", + "module": "dist/index.mjs", "files": [ - "index.cjs.js", - "index.cjs.js.map", - "index.esm.mjs", - "index.esm.mjs.map" + "CHANGELOG.md", + "INSTALL.md", + "LICENSE.md", + "README.md", + "dist" ], + "bin": { + "postcss-overflow-shorthand": "dist/cli.mjs" + }, "scripts": { - "prepublishOnly": "npm test", - "pretest": "rollup -c .rollup.js --silent", - "test": "echo 'Running tests...'; npm run test:js && npm run test:tape", - "test:ec": "echint --ignore index.*.js test", - "test:js": "eslint *.js --cache --ignore-path .gitignore --quiet", - "test:tape": "postcss-tape" + "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" }, "devDependencies": { - "@babel/core": "7.15.5", - "@babel/preset-env": "7.15.6", - "@rollup/plugin-babel": "5.3.0", - "eslint": "7.32.0", "postcss": "8.3.6", - "postcss-tape": "6.0.1", - "pre-commit": "1.2.2", - "rollup": "2.56.3" + "postcss-tape": "6.0.1" }, - "eslintConfig": { - "env": { - "browser": true, - "es6": true, - "node": true - }, - "extends": "eslint:recommended", - "parserOptions": { - "ecmaVersion": 2020, - "impliedStrict": true, - "sourceType": "module" - }, - "root": true + "peerDependencies": { + "postcss": "^8.3" }, "keywords": [ "postcss", @@ -61,5 +43,10 @@ "properties", "shorthands", "values" - ] + ], + "repository": { + "type": "git", + "url": "https://github.com/csstools/postcss-plugins.git", + "directory": "plugins/postcss-overflow-shorthand" + } } diff --git a/plugins/postcss-overflow-shorthand/src/cli.js b/plugins/postcss-overflow-shorthand/src/cli.js new file mode 100644 index 000000000..91c2fd21a --- /dev/null +++ b/plugins/postcss-overflow-shorthand/src/cli.js @@ -0,0 +1,15 @@ +import plugin from './index'; +import { cli, helpTextLogger } from '@csstools/base-cli'; + +cli( + plugin, + ['preserve'], + helpTextLogger( + 'postcss-overflow-shorthand', + 'PostCSS Overflow Shorthand', + 'Lets you use the `overflow` shorthand in CSS, following the CSS Overflow specification.', + { + preserve: true, + }, + ), +); diff --git a/plugins/postcss-overflow-shorthand/index.js b/plugins/postcss-overflow-shorthand/src/index.js similarity index 90% rename from plugins/postcss-overflow-shorthand/index.js rename to plugins/postcss-overflow-shorthand/src/index.js index 68a50ca61..3e90caf4d 100644 --- a/plugins/postcss-overflow-shorthand/index.js +++ b/plugins/postcss-overflow-shorthand/src/index.js @@ -10,12 +10,12 @@ function onCSSDeclaration(postcssList, decl, preserve) { // insert the overflow-* longhand declarations decl.cloneBefore({ prop: `${decl.prop}-x`, - value: overflowX + value: overflowX, }); decl.cloneBefore({ prop: `${decl.prop}-y`, - value: overflowY + value: overflowY, }); // conditionally remove the original declaration @@ -35,9 +35,9 @@ const creator = opts => { onCSSDeclaration(list, decl, preserve); } }, - } + }; }; -creator.postcss = true +creator.postcss = true; -export default creator +export default creator;