Skip to content

Commit 4afd297

Browse files
committed
Use the updated API from v8 to define the plugin
https://evilmartians.com/chronicles/postcss-8-plugin-migration This removes the warning "postcss-inline-class: postcss.plugin was deprecated" postcss-tape was update because the previous version was not compatible with post css v8 syntax: csstools/postcss-tape#5
1 parent ebca4e3 commit 4afd297

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sector-labs/postcss-inline-class",
3-
"version": "0.0.7",
3+
"version": "0.0.8",
44
"description": "Inline the declarations of other CSS classes in your CSS classes.",
55
"main": "src/index.js",
66
"repository": "https://github.com/sectorlabs/postcss-inline-class",
@@ -31,7 +31,7 @@
3131
"eslint-config-i-am-meticulous": "^12.0.0",
3232
"eslint-plugin-import": "^2.20.2",
3333
"eslint-plugin-prettier": "^3.1.2",
34-
"postcss-tape": "^5.0.2",
34+
"postcss-tape": "^6.0.0",
3535
"prettier": "^2.0.4"
3636
},
3737
"scripts": {

src/index.js

+11-4
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,14 @@ const defaultOptions = Object.freeze({
125125
extensions: [''],
126126
});
127127

128-
module.exports = postcss.plugin('postcss-inline-class', (options) => {
129-
return (root, result) =>
130-
new Promise(processFile(root, result, (options || defaultOptions).paths));
131-
});
128+
const plugin = (options) => {
129+
return {
130+
postcssPlugin: 'postcss-inline-class',
131+
Once(root, { result }) {
132+
return new Promise(processFile(root, result, (options || defaultOptions).paths));
133+
},
134+
};
135+
};
136+
plugin.postcss = true;
137+
138+
module.exports = plugin;

yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -1229,10 +1229,10 @@ possible-typed-array-names@^1.0.0:
12291229
resolved "https://registry.yarnpkg.com/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz#89bb63c6fada2c3e90adc4a647beeeb39cc7bf8f"
12301230
integrity sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==
12311231

1232-
postcss-tape@^5.0.2:
1233-
version "5.0.2"
1234-
resolved "https://registry.yarnpkg.com/postcss-tape/-/postcss-tape-5.0.2.tgz#7ae011050954fdc10b17d1f1551c9d9bf14e4bdf"
1235-
integrity sha512-e4770WnsUzczQp/pAIsz0s0MDLAQ7luyh1/hs8QBcdfXOMrz0siEqYNHAKJIoCvGtLoi2QUjWASvTbPfyTfIWg==
1232+
postcss-tape@^6.0.0:
1233+
version "6.0.1"
1234+
resolved "https://registry.yarnpkg.com/postcss-tape/-/postcss-tape-6.0.1.tgz#c81bd77c79c7a9a9a559b6af04a02e4487eb467a"
1235+
integrity sha512-qw/1YCSoGgmz8DC/8lbUo3OZGN0UWWZdThAvCSOIJrK346Weu8bM+aC5c9q1/Np2YjCJfRqhJO+P94A3sLdWhQ==
12361236

12371237
postcss@^8.0.0:
12381238
version "8.4.47"

0 commit comments

Comments
 (0)