Skip to content

Commit a531941

Browse files
authored
Migrate postcss-double-position-gradients (#26)
* postcss-double-position-gradients : monorepo migration * migrate
1 parent c8f6b44 commit a531941

File tree

10 files changed

+62
-137
lines changed

10 files changed

+62
-137
lines changed

plugins/postcss-double-position-gradients/.editorconfig

-15
This file was deleted.

plugins/postcss-double-position-gradients/.gitattributes

-1
This file was deleted.

plugins/postcss-double-position-gradients/.github/workflows/test.yml

-18
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
node_modules
2+
dist
23
package-lock.json
3-
yarn-lock.json
4+
yarn.lock
45
*.log*
56
*.result.css
6-
.*
7+
*.result.css.map
78
!.editorconfig
8-
!.gitattributes
99
!.gitignore
10+
!.rollup.js
1011
!.tape.js
12+
!.travis.yml
1113
!.github

plugins/postcss-double-position-gradients/CONTRIBUTING.md

-65
This file was deleted.

plugins/postcss-double-position-gradients/INSTALL.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,6 @@ grunt.initConfig({
165165
[PostCSS]: https://github.com/postcss/postcss
166166
[PostCSS CLI]: https://github.com/postcss/postcss-cli
167167
[PostCSS Loader]: https://github.com/postcss/postcss-loader
168-
[PostCSS Double Position Gradients]: https://github.com/csstools/postcss-double-position-gradients
168+
[PostCSS Double Position Gradients]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-double-position-gradients
169169
[React App Rewire PostCSS]: https://github.com/csstools/react-app-rewire-postcss
170170
[React App Rewired]: https://github.com/timarney/react-app-rewired

plugins/postcss-double-position-gradients/README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
[<img alt="NPM Version" src="https://img.shields.io/npm/v/postcss-double-position-gradients.svg" height="20">][npm-url]
44
[<img alt="CSS Standard Status" src="https://cssdb.org/badge/double-position-gradients.svg" height="20">][css-url]
5-
[<img alt="Build Status" src="https://img.shields.io/travis/csstools/postcss-double-position-gradients/master.svg" height="20">][cli-url]
65
[<img alt="Support Chat" src="https://img.shields.io/badge/support-chat-blue.svg" height="20">][git-url]
76

87
[PostCSS Double Position Gradients] lets you use double-position gradients in
@@ -94,10 +93,9 @@ postcssDoublePositionGradients({ preserve: false })
9493
```
9594

9695
[css-url]: https://cssdb.org/#double-position-gradients
97-
[cli-url]: https://travis-ci.org/csstools/postcss-double-position-gradients
9896
[git-url]: https://gitter.im/postcss/postcss
9997
[npm-url]: https://www.npmjs.com/package/postcss-double-position-gradients
10098

10199
[CSS Image Values and Replaced Content]: https://www.w3.org/TR/css-images-4/#color-stop-syntax
102100
[PostCSS]: https://github.com/postcss/postcss
103-
[PostCSS Double Position Gradients]: https://github.com/csstools/postcss-double-position-gradients
101+
[PostCSS Double Position Gradients]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-double-position-gradients

plugins/postcss-double-position-gradients/package.json

+30-23
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,39 @@
44
"description": "Use double-position gradients in CSS",
55
"author": "Jonathan Neal <jonathantneal@hotmail.com>",
66
"license": "CC0-1.0",
7-
"repository": "csstools/postcss-double-position-gradients",
8-
"homepage": "https://github.com/csstools/postcss-double-position-gradients#readme",
9-
"bugs": "https://github.com/csstools/postcss-double-position-gradients/issues",
10-
"main": "index.js",
7+
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-double-position-gradients#readme",
8+
"bugs": "https://github.com/csstools/postcss-plugins/issues",
9+
"main": "dist/index.cjs",
10+
"module": "dist/index.mjs",
11+
"files": [
12+
"CHANGELOG.md",
13+
"INSTALL.md",
14+
"LICENSE.md",
15+
"README.md",
16+
"dist"
17+
],
18+
"bin": {
19+
"postcss-double-position-gradients": "dist/cli.mjs"
20+
},
1121
"scripts": {
12-
"prepublishOnly": "npm test",
13-
"lint": "eslint *.js --cache",
14-
"lint:fix": "eslint *.js --cache --fix",
15-
"test": "npm run lint && npm run tape",
16-
"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"
1727
},
1828
"engines": {
19-
"node": ">=12"
29+
"node": "^12 || ^14 || >=16"
2030
},
2131
"dependencies": {
22-
"postcss-values-parser": "6.0.1"
23-
},
24-
"peerDependencies": {
25-
"postcss": "^8.3"
32+
"postcss-values-parser": "^6.0.1"
2633
},
2734
"devDependencies": {
28-
"eslint": "8.2.0",
29-
"postcss": "8.3.11",
35+
"postcss": "8.3.6",
3036
"postcss-tape": "6.0.1"
3137
},
32-
"eslintConfig": {
33-
"env": {
34-
"es6": true,
35-
"node": true
36-
},
37-
"extends": "eslint:recommended"
38+
"peerDependencies": {
39+
"postcss": "^8.3"
3840
},
3941
"keywords": [
4042
"postcss",
@@ -50,5 +52,10 @@
5052
"stop",
5153
"syntax",
5254
"repeating"
53-
]
55+
],
56+
"repository": {
57+
"type": "git",
58+
"url": "https://github.com/csstools/postcss-plugins.git",
59+
"directory": "plugins/postcss-double-position-gradients"
60+
}
5461
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import plugin from './index';
2+
import { cli, helpTextLogger } from '@csstools/base-cli';
3+
4+
cli(
5+
plugin,
6+
['preserve'],
7+
helpTextLogger(
8+
'postcss-double-position-gradients',
9+
'PostCSS Double Position Gradients',
10+
'Lets you use double-position gradients in CSS, following the [CSS Image Values and Replaced Content] specification',
11+
{
12+
dir: 'ltr',
13+
preserve: true,
14+
shadow: true,
15+
},
16+
),
17+
);

plugins/postcss-double-position-gradients/index.js renamed to plugins/postcss-double-position-gradients/src/index.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const Punctuation = require('postcss-values-parser/lib/nodes/Punctuation');
55
const gradientRegExp = /(repeating-)?(conic|linear|radial)-gradient\([\W\w]*\)/i;
66
const gradientPartsRegExp = /^(repeating-)?(conic|linear|radial)-gradient$/i;
77

8-
const isPunctuationCommaNode = node => node.type === 'punctuation' && node.value === ','
8+
const isPunctuationCommaNode = node => node.type === 'punctuation' && node.value === ',';
99

1010
/**
1111
* Transform double-position gradients in CSS.
@@ -29,7 +29,7 @@ module.exports = function creator(opts) {
2929
} catch (error) {
3030
decl.warn(
3131
result,
32-
`Failed to parse value '${decl.value}' as a CSS gradient. Leaving the original value intact.`
32+
`Failed to parse value '${decl.value}' as a CSS gradient. Leaving the original value intact.`,
3333
);
3434
}
3535

@@ -60,22 +60,22 @@ module.exports = function creator(opts) {
6060
value: ',',
6161
raws: isPunctuationCommaNode(node1next)
6262
? Object.assign({}, node1next.clone().raws)
63-
: { before: '', after: '' }
63+
: { before: '', after: '' },
6464
});
6565

6666
func.insertBefore(node, [comma, color]);
6767
}
68-
})
69-
})
68+
});
69+
});
7070

7171
const modifiedValue = String(valueAST);
7272

7373
if (modifiedValue !== decl.value) {
7474
if (preserve) decl.cloneBefore({ value: modifiedValue });
7575
else decl.value = modifiedValue;
7676
}
77-
}
78-
}
79-
}
77+
},
78+
};
79+
};
8080

8181
module.exports.postcss = true;

0 commit comments

Comments
 (0)