Skip to content

Commit 9b3cd3b

Browse files
committed
fix: πŸ› types for postcss 8
βœ… Closes: #258
1 parent e5fd816 commit 9b3cd3b

File tree

4 files changed

+33
-9
lines changed

4 files changed

+33
-9
lines changed

Diff for: β€Žpackage.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"license": "MIT",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
7-
"description": "A Svelte preprocessor wrapper with baked in support for common used preprocessors",
7+
"description": "A Svelte preprocessor wrapper with baked-in support for commonly used preprocessors",
88
"author": "Christian Kaisermann <[email protected]>",
99
"repository": "https://github.com/sveltejs/svelte-preprocess",
1010
"keywords": [
@@ -78,7 +78,7 @@
7878
"less": "^3.11.3",
7979
"lint-staged": "^10.2.9",
8080
"node-sass": "^4.14.1",
81-
"postcss": "^7.0.32",
81+
"postcss": "^8",
8282
"postcss-easy-import": "^3.0.0",
8383
"postcss-load-config": "^2.1.0",
8484
"prettier": "^2.0.5",
@@ -100,7 +100,7 @@
100100
"@babel/core": "^7.10.2",
101101
"coffeescript": "^2.5.1",
102102
"less": "^3.11.3",
103-
"postcss": "^7.0.32",
103+
"postcss": "^7 || ^8",
104104
"postcss-load-config": "^2.1.0",
105105
"pug": "^3.0.0",
106106
"sass": "^1.26.8",

Diff for: β€Žsrc/transformers/globalStyle.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import postcss, { AtRule } from 'postcss';
1+
import postcss from 'postcss';
2+
import type * as pcss from 'postcss';
23

34
import { Transformer, Options } from '../types';
45
import { globalifySelector } from '../modules/globalifySelector';
56

67
const selectorPattern = /:global(?!\()/;
78

8-
const globalifyRulePlugin: postcss.Transformer = (root) => {
9+
const globalifyRulePlugin = (root: pcss.Root) => {
910
root.walkRules(selectorPattern, (rule) => {
1011
const modifiedSelectors = rule.selectors
1112
.filter((selector) => selector !== ':global')
@@ -34,7 +35,7 @@ const globalifyRulePlugin: postcss.Transformer = (root) => {
3435
});
3536
};
3637

37-
const globalAttrPlugin = (root: postcss.Root) => {
38+
const globalAttrPlugin = (root: pcss.Root) => {
3839
root.walkAtRules(/keyframes$/, (atrule) => {
3940
if (!atrule.params.startsWith('-global-')) {
4041
atrule.replaceWith(
@@ -47,7 +48,7 @@ const globalAttrPlugin = (root: postcss.Root) => {
4748

4849
root.walkRules((rule) => {
4950
// we use endsWith for checking @keyframes and prefixed @-{prefix}-keyframes
50-
if ((rule?.parent as AtRule)?.name?.endsWith('keyframes')) {
51+
if ((rule?.parent as pcss.AtRule)?.name?.endsWith('keyframes')) {
5152
return;
5253
}
5354

Diff for: β€Žsrc/types/options.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import postcss from 'postcss';
1+
import type * as postcss from 'postcss';
22
import { Options as SassOptions, render, renderSync } from 'sass';
33
import { Options as PugOptions } from 'pug';
44
import { TransformOptions as BabelOptions } from '@babel/core';

Diff for: β€Žyarn.lock

+24-1
Original file line numberDiff line numberDiff line change
@@ -2250,7 +2250,7 @@ color-name@~1.1.4:
22502250
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
22512251
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
22522252

2253-
colorette@^1.2.0:
2253+
colorette@^1.2.0, colorette@^1.2.1:
22542254
version "1.2.1"
22552255
resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.1.tgz#4d0b921325c14faf92633086a536db6e89564b1b"
22562256
integrity sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw==
@@ -4666,6 +4666,14 @@ levn@^0.3.0, levn@~0.3.0:
46664666
prelude-ls "~1.1.2"
46674667
type-check "~0.3.2"
46684668

4669+
line-column@^1.0.2:
4670+
version "1.0.2"
4671+
resolved "https://registry.yarnpkg.com/line-column/-/line-column-1.0.2.tgz#d25af2936b6f4849172b312e4792d1d987bc34a2"
4672+
integrity sha1-0lryk2tvSEkXKzEuR5LR2Ye8NKI=
4673+
dependencies:
4674+
isarray "^1.0.0"
4675+
isobject "^2.0.0"
4676+
46694677
lines-and-columns@^1.1.6:
46704678
version "1.1.6"
46714679
resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00"
@@ -5084,6 +5092,11 @@ nan@^2.13.2:
50845092
resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.1.tgz#d7be34dfa3105b91494c3147089315eff8874b01"
50855093
integrity sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==
50865094

5095+
nanoid@^3.1.12:
5096+
version "3.1.12"
5097+
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.12.tgz#6f7736c62e8d39421601e4a0c77623a97ea69654"
5098+
integrity sha512-1qstj9z5+x491jfiC4Nelk+f8XBad7LN20PmyWINJEMRSf3wcAjAWysw1qaA8z6NSKe2sjq1hRSDpBH5paCb6A==
5099+
50875100
nanomatch@^1.2.9:
50885101
version "1.2.13"
50895102
resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119"
@@ -5696,6 +5709,16 @@ postcss@^7.0.2, postcss@^7.0.32:
56965709
source-map "^0.6.1"
56975710
supports-color "^6.1.0"
56985711

5712+
postcss@^8:
5713+
version "8.1.1"
5714+
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.1.1.tgz#c3a287dd10e4f6c84cb3791052b96a5d859c9389"
5715+
integrity sha512-9DGLSsjooH3kSNjTZUOt2eIj2ZTW0VI2PZ/3My+8TC7KIbH2OKwUlISfDsf63EP4aiRUt3XkEWMWvyJHvJelEg==
5716+
dependencies:
5717+
colorette "^1.2.1"
5718+
line-column "^1.0.2"
5719+
nanoid "^3.1.12"
5720+
source-map "^0.6.1"
5721+
56995722
prelude-ls@~1.1.2:
57005723
version "1.1.2"
57015724
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"

0 commit comments

Comments
Β (0)