@weapp-tailwindcss/postcss 2.1.6 → 2.2.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,27 @@ import { Result } from 'postcss-load-config';
4
4
  import { PxTransformOptions } from 'postcss-pxtrans';
5
5
  import { UserDefinedOptions } from 'postcss-rem-to-responsive-pixel';
6
6
  import { UserDefinedOptions as UserDefinedOptions$1 } from 'postcss-units-to-px';
7
+ import autoprefixer from 'autoprefixer';
8
+
9
+ type AutoprefixerOptions = autoprefixer.Options;
10
+ type WeappAutoprefixerOptions = boolean | AutoprefixerOptions;
11
+
12
+ /**
13
+ * CSS 内容特征探测模块
14
+ *
15
+ * 通过正则和字符串匹配快速判断 CSS 是否包含特定特征,
16
+ * 用于在构建流水线前决定哪些插件可以跳过。
17
+ * 仅使用字符串方法和正则表达式,不引入 AST 解析开销。
18
+ */
19
+ /**
20
+ * CSS 内容特征信号,表示哪些特征存在于当前 CSS 中
21
+ */
22
+ interface FeatureSignal {
23
+ /** CSS 中是否包含现代颜色函数语法(如 rgb(r g b / a) 空格分隔写法) */
24
+ hasModernColorFunction: boolean;
25
+ /** CSS 中是否包含需要 postcss-preset-env 处理的特征 */
26
+ hasPresetEnvFeatures: boolean;
27
+ }
7
28
 
8
29
  type PipelineStage = 'pre' | 'normal' | 'post';
9
30
  interface PipelineNodeCursor {
@@ -45,7 +66,7 @@ interface StyleProcessingPipeline {
45
66
  nodes: ResolvedPipelineNode[];
46
67
  plugins: AcceptedPlugin[];
47
68
  }
48
- declare function createStylePipeline(options: IStyleHandlerOptions): StyleProcessingPipeline;
69
+ declare function createStylePipeline(options: IStyleHandlerOptions, signal?: FeatureSignal): StyleProcessingPipeline;
49
70
 
50
71
  declare function createContext(): {
51
72
  variablesScopeWeakMap: WeakMap<WeakKey, any>;
@@ -77,6 +98,8 @@ interface IPropValue {
77
98
  prop: string;
78
99
  value: string;
79
100
  }
101
+ type UniAppXCssTarget = 'uvue';
102
+ type UniAppXUnsupportedMode = 'error' | 'warn' | 'silent';
80
103
  type CssPreflightOptions = {
81
104
  [key: string]: string | number | boolean;
82
105
  } | false;
@@ -101,6 +124,7 @@ type IStyleHandlerOptions = {
101
124
  cssRemoveProperty?: boolean;
102
125
  cssRemoveHoverPseudoClass?: boolean;
103
126
  cssPresetEnv?: PresetEnvOptions;
127
+ autoprefixer?: WeappAutoprefixerOptions;
104
128
  cssCalc?: boolean | CssCalcOptions | (string | RegExp)[];
105
129
  atRules?: {
106
130
  property?: boolean;
@@ -108,6 +132,8 @@ type IStyleHandlerOptions = {
108
132
  media?: boolean;
109
133
  };
110
134
  uniAppX?: boolean;
135
+ uniAppXCssTarget?: UniAppXCssTarget;
136
+ uniAppXUnsupported?: UniAppXUnsupportedMode;
111
137
  majorVersion?: number;
112
138
  } & RequiredStyleHandlerOptions;
113
139
  interface UserDefinedPostcssOptions {
@@ -115,6 +141,7 @@ interface UserDefinedPostcssOptions {
115
141
  cssPreflightRange?: 'all';
116
142
  cssChildCombinatorReplaceValue?: string | string[];
117
143
  cssPresetEnv?: PresetEnvOptions;
144
+ autoprefixer?: WeappAutoprefixerOptions;
118
145
  injectAdditionalCssVarScope?: boolean;
119
146
  cssSelectorReplacement?: {
120
147
  root?: string | string[] | false;
@@ -127,6 +154,8 @@ interface UserDefinedPostcssOptions {
127
154
  cssRemoveHoverPseudoClass?: boolean;
128
155
  cssRemoveProperty?: boolean;
129
156
  uniAppX?: boolean;
157
+ uniAppXCssTarget?: UniAppXCssTarget;
158
+ uniAppXUnsupported?: UniAppXUnsupportedMode;
130
159
  }
131
160
 
132
161
  interface StyleHandler {
@@ -134,4 +163,4 @@ interface StyleHandler {
134
163
  getPipeline: (opt?: Partial<IStyleHandlerOptions>) => StyleProcessingPipeline;
135
164
  }
136
165
 
137
- export { type CssCalcOptions as C, type IStyleHandlerOptions as I, type LoadedPostcssOptions as L, type PipelineNodeContext as P, type RequiredStyleHandlerOptions as R, type StyleHandler as S, type UserDefinedPostcssOptions as U, type InternalCssSelectorReplacerOptions as a, type CssPreflightOptions as b, type IPropValue as c, type PipelineNodeCursor as d, type PipelineStage as e, type PresetEnvOptions as f, type ResolvedPipelineNode as g, type StyleProcessingPipeline as h, createInjectPreflight as i, createStylePipeline as j };
166
+ export { type CssCalcOptions as C, type IStyleHandlerOptions as I, type LoadedPostcssOptions as L, type PipelineNodeContext as P, type RequiredStyleHandlerOptions as R, type StyleHandler as S, type UniAppXCssTarget as U, type WeappAutoprefixerOptions as W, type InternalCssSelectorReplacerOptions as a, type CssPreflightOptions as b, type IPropValue as c, type PipelineNodeCursor as d, type PipelineStage as e, type PresetEnvOptions as f, type ResolvedPipelineNode as g, type StyleProcessingPipeline as h, type UniAppXUnsupportedMode as i, type UserDefinedPostcssOptions as j, createInjectPreflight as k, createStylePipeline as l };
package/dist/types.d.mts CHANGED
@@ -4,4 +4,5 @@ import 'postcss-load-config';
4
4
  export { PxTransformOptions as Px2rpxOptions } from 'postcss-pxtrans';
5
5
  export { UserDefinedOptions as Rem2rpxOptions } from 'postcss-rem-to-responsive-pixel';
6
6
  export { UserDefinedOptions as UnitsToPxOptions } from 'postcss-units-to-px';
7
- export { C as CssCalcOptions, b as CssPreflightOptions, c as IPropValue, I as IStyleHandlerOptions, a as InternalCssSelectorReplacerOptions, L as LoadedPostcssOptions, f as PresetEnvOptions, R as RequiredStyleHandlerOptions, S as StyleHandler, U as UserDefinedPostcssOptions } from './types-CsRGpZ_r.mjs';
7
+ export { C as CssCalcOptions, b as CssPreflightOptions, c as IPropValue, I as IStyleHandlerOptions, a as InternalCssSelectorReplacerOptions, L as LoadedPostcssOptions, f as PresetEnvOptions, R as RequiredStyleHandlerOptions, S as StyleHandler, U as UniAppXCssTarget, i as UniAppXUnsupportedMode, j as UserDefinedPostcssOptions, W as WeappAutoprefixerOptions } from './types-DJDvtI8K.mjs';
8
+ import 'autoprefixer';
package/dist/types.d.ts CHANGED
@@ -4,4 +4,5 @@ import 'postcss-load-config';
4
4
  export { PxTransformOptions as Px2rpxOptions } from 'postcss-pxtrans';
5
5
  export { UserDefinedOptions as Rem2rpxOptions } from 'postcss-rem-to-responsive-pixel';
6
6
  export { UserDefinedOptions as UnitsToPxOptions } from 'postcss-units-to-px';
7
- export { C as CssCalcOptions, b as CssPreflightOptions, c as IPropValue, I as IStyleHandlerOptions, a as InternalCssSelectorReplacerOptions, L as LoadedPostcssOptions, f as PresetEnvOptions, R as RequiredStyleHandlerOptions, S as StyleHandler, U as UserDefinedPostcssOptions } from './types-CsRGpZ_r.js';
7
+ export { C as CssCalcOptions, b as CssPreflightOptions, c as IPropValue, I as IStyleHandlerOptions, a as InternalCssSelectorReplacerOptions, L as LoadedPostcssOptions, f as PresetEnvOptions, R as RequiredStyleHandlerOptions, S as StyleHandler, U as UniAppXCssTarget, i as UniAppXUnsupportedMode, j as UserDefinedPostcssOptions, W as WeappAutoprefixerOptions } from './types-DJDvtI8K.js';
8
+ import 'autoprefixer';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weapp-tailwindcss/postcss",
3
- "version": "2.1.6",
3
+ "version": "2.2.0-next.0",
4
4
  "description": "@weapp-tailwindcss/postcss",
5
5
  "author": "ice breaker <1324318532@qq.com>",
6
6
  "license": "MIT",
@@ -58,17 +58,20 @@
58
58
  "dependencies": {
59
59
  "@weapp-core/escape": "~7.0.0",
60
60
  "@weapp-tailwindcss/postcss-calc": "^1.0.0",
61
- "postcss": "~8.5.8",
61
+ "autoprefixer": "^10.5.0",
62
+ "lru-cache": "10.4.3",
63
+ "postcss": "^8.5.12",
62
64
  "postcss-preset-env": "^10.6.1",
63
- "postcss-pxtrans": "^1.0.1",
64
- "postcss-rem-to-responsive-pixel": "^7.0.1",
65
+ "postcss-pxtrans": "^1.0.4",
66
+ "postcss-rem-to-responsive-pixel": "^7.0.4",
65
67
  "postcss-selector-parser": "~7.1.1",
66
- "postcss-units-to-px": "^0.2.0",
68
+ "postcss-units-to-px": "^0.2.2",
67
69
  "postcss-value-parser": "^4.2.0",
68
70
  "@weapp-tailwindcss/shared": "1.1.3"
69
71
  },
70
72
  "devDependencies": {
71
73
  "@csstools/postcss-is-pseudo-class": "^6.0.0",
74
+ "fast-check": "^4.7.0",
72
75
  "postcss-calc": "^10.1.1",
73
76
  "postcss-custom-properties": "^14.0.6"
74
77
  },