Skip to content

Commit 78f2c49

Browse files
authored
Migrate postcss-overflow-shorthand (#41)
* Migrate postcss-overflow-shorthand * Migrate postcss-overflow-shorthand
1 parent b5b171c commit 78f2c49

File tree

10 files changed

+58
-105
lines changed

10 files changed

+58
-105
lines changed

plugins/postcss-overflow-shorthand/CONTRIBUTING.md renamed to CONTRIBUTING.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Contributing to PostCSS Overflow Shorthand
1+
# Contributing to CSSTools Plugins
22

33
You want to help? You rock! Now, take a moment to be sure your contributions
44
make sense to everyone else.
@@ -20,13 +20,13 @@ scope and avoid unrelated commits.
2020
1. To begin; [fork this project], clone your fork, and add our upstream.
2121
```bash
2222
# Clone your fork of the repo into the current directory
23-
git clone git@github.com:YOUR_USER/postcss-overflow-shorthand.git
23+
git clone https://github.com/<YOUR_USER>/postcss-plugins.git
2424

2525
# Navigate to the newly cloned directory
26-
cd postcss-overflow-shorthand
26+
cd postcss-plugins
2727

2828
# Assign the original repo to a remote called "upstream"
29-
git remote add upstream git@github.com:jonathantneal/postcss-overflow-shorthand.git
29+
git remote add upstream https://github.com/csstools/postcss-plugins.git
3030

3131
# Install the tools necessary for testing
3232
npm install

plugins/postcss-overflow-shorthand/.editorconfig

-15
This file was deleted.

plugins/postcss-overflow-shorthand/.github/workflows/test.yml

-18
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
node_modules
2-
index.*.*
2+
dist
33
package-lock.json
44
yarn.lock
55
*.log*
66
*.result.css
7-
.*
7+
*.result.css.map
88
!.editorconfig
99
!.gitignore
1010
!.rollup.js
1111
!.tape.js
12+
!.travis.yml
1213
!.github

plugins/postcss-overflow-shorthand/.rollup.js

-17
This file was deleted.

plugins/postcss-overflow-shorthand/INSTALL.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,6 @@ grunt.initConfig({
159159
[PostCSS]: https://github.com/postcss/postcss
160160
[PostCSS CLI]: https://github.com/postcss/postcss-cli
161161
[PostCSS Loader]: https://github.com/postcss/postcss-loader
162-
[PostCSS Overflow Shorthand]: https://github.com/jonathantneal/postcss-overflow-shorthand
162+
[PostCSS Overflow Shorthand]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-overflow-shorthand
163163
[React App Rewire PostCSS]: https://github.com/csstools/react-app-rewire-postcss
164164
[React App Rewired]: https://github.com/timarney/react-app-rewired

plugins/postcss-overflow-shorthand/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ html {
7373
}
7474
```
7575

76-
[cli-img]: https://github.com/csstools/postcss-overflow-shorthand/workflows/test/badge.svg
77-
[cli-url]: https://github.com/csstools/postcss-overflow-shorthand/actions/workflows/test.yml?query=workflow/test
76+
[cli-img]: https://github.com/csstools/postcss-plugins/workflows/test/badge.svg
77+
[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test
7878
[css-img]: https://cssdb.org/badge/overflow-property.svg
7979
[css-url]: https://cssdb.org/#overflow-property
8080
[git-img]: https://img.shields.io/badge/support-chat-blue.svg
@@ -87,4 +87,4 @@ html {
8787
[Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss
8888
[PostCSS]: https://github.com/postcss/postcss
8989
[PostCSS Loader]: https://github.com/postcss/postcss-loader
90-
[PostCSS Overflow Shorthand]: https://github.com/jonathantneal/postcss-overflow-shorthand
90+
[PostCSS Overflow Shorthand]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-overflow-shorthand

plugins/postcss-overflow-shorthand/package.json

+27-40
Original file line numberDiff line numberDiff line change
@@ -4,54 +4,36 @@
44
"description": "Use the overflow shorthand in CSS",
55
"author": "Jonathan Neal <jonathantneal@hotmail.com>",
66
"license": "CC0-1.0",
7-
"repository": "jonathantneal/postcss-overflow-shorthand",
8-
"homepage": "https://github.com/jonathantneal/postcss-overflow-shorthand#readme",
9-
"bugs": "https://github.com/jonathantneal/postcss-overflow-shorthand/issues",
10-
"main": "index.cjs.js",
11-
"module": "index.es.mjs",
7+
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-overflow-shorthand#readme",
8+
"bugs": "https://github.com/csstools/postcss-plugins/issues",
9+
"main": "dist/index.cjs",
10+
"module": "dist/index.mjs",
1211
"files": [
13-
"index.cjs.js",
14-
"index.cjs.js.map",
15-
"index.esm.mjs",
16-
"index.esm.mjs.map"
12+
"CHANGELOG.md",
13+
"INSTALL.md",
14+
"LICENSE.md",
15+
"README.md",
16+
"dist"
1717
],
18+
"bin": {
19+
"postcss-overflow-shorthand": "dist/cli.mjs"
20+
},
1821
"scripts": {
19-
"prepublishOnly": "npm test",
20-
"pretest": "rollup -c .rollup.js --silent",
21-
"test": "echo 'Running tests...'; npm run test:js && npm run test:tape",
22-
"test:ec": "echint --ignore index.*.js test",
23-
"test:js": "eslint *.js --cache --ignore-path .gitignore --quiet",
24-
"test:tape": "postcss-tape"
22+
"prepublishOnly": "npm run build && npm run test",
23+
"lint": "eslint src/**/*.js",
24+
"test": "postcss-tape",
25+
"build": "rollup -c ../../rollup/default.js",
26+
"stryker": "stryker run --logLevel error"
2527
},
2628
"engines": {
27-
"node": ">=12"
28-
},
29-
"peerDependencies": {
30-
"postcss": "^8.3"
29+
"node": "^12 || ^14 || >=16"
3130
},
3231
"devDependencies": {
33-
"@babel/core": "7.15.5",
34-
"@babel/preset-env": "7.15.6",
35-
"@rollup/plugin-babel": "5.3.0",
36-
"eslint": "7.32.0",
3732
"postcss": "8.3.6",
38-
"postcss-tape": "6.0.1",
39-
"pre-commit": "1.2.2",
40-
"rollup": "2.56.3"
33+
"postcss-tape": "6.0.1"
4134
},
42-
"eslintConfig": {
43-
"env": {
44-
"browser": true,
45-
"es6": true,
46-
"node": true
47-
},
48-
"extends": "eslint:recommended",
49-
"parserOptions": {
50-
"ecmaVersion": 2020,
51-
"impliedStrict": true,
52-
"sourceType": "module"
53-
},
54-
"root": true
35+
"peerDependencies": {
36+
"postcss": "^8.3"
5537
},
5638
"keywords": [
5739
"postcss",
@@ -61,5 +43,10 @@
6143
"properties",
6244
"shorthands",
6345
"values"
64-
]
46+
],
47+
"repository": {
48+
"type": "git",
49+
"url": "https://github.com/csstools/postcss-plugins.git",
50+
"directory": "plugins/postcss-overflow-shorthand"
51+
}
6552
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import plugin from './index';
2+
import { cli, helpTextLogger } from '@csstools/base-cli';
3+
4+
cli(
5+
plugin,
6+
['preserve'],
7+
helpTextLogger(
8+
'postcss-overflow-shorthand',
9+
'PostCSS Overflow Shorthand',
10+
'Lets you use the `overflow` shorthand in CSS, following the CSS Overflow specification.',
11+
{
12+
preserve: true,
13+
},
14+
),
15+
);

plugins/postcss-overflow-shorthand/index.js renamed to plugins/postcss-overflow-shorthand/src/index.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ function onCSSDeclaration(postcssList, decl, preserve) {
1010
// insert the overflow-* longhand declarations
1111
decl.cloneBefore({
1212
prop: `${decl.prop}-x`,
13-
value: overflowX
13+
value: overflowX,
1414
});
1515

1616
decl.cloneBefore({
1717
prop: `${decl.prop}-y`,
18-
value: overflowY
18+
value: overflowY,
1919
});
2020

2121
// conditionally remove the original declaration
@@ -35,9 +35,9 @@ const creator = opts => {
3535
onCSSDeclaration(list, decl, preserve);
3636
}
3737
},
38-
}
38+
};
3939
};
4040

41-
creator.postcss = true
41+
creator.postcss = true;
4242

43-
export default creator
43+
export default creator;

0 commit comments

Comments
 (0)