@csstools/postcss-stepped-value-functions 1.0.0 → 2.0.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changes to PostCSS Stepped Value Functions
2
2
 
3
+ ### 2.0.0 (January 24, 2023)
4
+
5
+ - Updated: Support for Node v14+ (major).
6
+
7
+ ### 1.0.1 (July 8, 2022)
8
+
9
+ - Fix case insensitive matching.
10
+
3
11
  ### 1.0.0 (May 2, 2022)
4
12
 
5
13
  - Initial version
package/README.md CHANGED
@@ -1,9 +1,6 @@
1
- # PostCSS Stepped Value Functions [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][postcss]
1
+ # PostCSS Stepped Value Functions [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][PostCSS]
2
2
 
3
- [<img alt="npm version" src="https://img.shields.io/npm/v/@csstools/postcss-stepped-value-functions.svg" height="20">][npm-url]
4
- [<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/stepped-value-functions.svg" height="20">][css-url]
5
- [<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url]
6
- [<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]
3
+ [<img alt="npm version" src="https://img.shields.io/npm/v/@csstools/postcss-stepped-value-functions.svg" height="20">][npm-url] [<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/stepped-value-functions.svg" height="20">][css-url] [<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url] [<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]
7
4
 
8
5
  [PostCSS Stepped Value Functions] lets you use `round`, `rem` and `mod` stepped value functions, following the [CSS Values 4].
9
6
 
@@ -53,12 +50,17 @@ postcss([
53
50
  [PostCSS Stepped Value Functions] runs in all Node environments, with special
54
51
  instructions for:
55
52
 
56
- | [Node](INSTALL.md#node) | [PostCSS CLI](INSTALL.md#postcss-cli) | [Webpack](INSTALL.md#webpack) | [Create React App](INSTALL.md#create-react-app) | [Gulp](INSTALL.md#gulp) | [Grunt](INSTALL.md#grunt) |
57
- | --- | --- | --- | --- | --- | --- |
53
+ - [Node](INSTALL.md#node)
54
+ - [PostCSS CLI](INSTALL.md#postcss-cli)
55
+ - [PostCSS Load Config](INSTALL.md#postcss-load-config)
56
+ - [Webpack](INSTALL.md#webpack)
57
+ - [Next.js](INSTALL.md#nextjs)
58
+ - [Gulp](INSTALL.md#gulp)
59
+ - [Grunt](INSTALL.md#grunt)
58
60
 
59
61
  ## ⚠️ About custom properties
60
62
 
61
- Given the dynamic nature of custom properties it's impossible to know what the variable value is which means the plugin can't compute a final value for the stylesheet.
63
+ Given the dynamic nature of custom properties it's impossible to know what the variable value is, which means the plugin can't compute a final value for the stylesheet.
62
64
 
63
65
  Because of that, any usage that contains a `var` is skipped.
64
66
 
@@ -120,7 +122,7 @@ postcssSteppedValueFunctions({ onInvalid: 'warn' })
120
122
 
121
123
  Will produce on the terminal:
122
124
 
123
- ```bash
125
+ ```txt
124
126
  [postcss-stepped-value-functions]: Failed to transform mod(18px, 5rem) as the units don't match
125
127
  ```
126
128
 
@@ -129,9 +131,6 @@ Will produce on the terminal:
129
131
  [discord]: https://discord.gg/bUadyRwkJS
130
132
  [npm-url]: https://www.npmjs.com/package/@csstools/postcss-stepped-value-functions
131
133
 
132
- [Gulp PostCSS]: https://github.com/postcss/gulp-postcss
133
- [Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss
134
134
  [PostCSS]: https://github.com/postcss/postcss
135
- [PostCSS Loader]: https://github.com/postcss/postcss-loader
136
135
  [PostCSS Stepped Value Functions]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-stepped-value-functions
137
136
  [CSS Values 4]: https://www.w3.org/TR/css-values-4/#round-func
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=e(require("postcss-value-parser"));function n(e,n,r,a){const o=[];let l=!1;if(e.nodes.forEach((e=>{"word"!==e.type?function(e){return"function"===e.type&&"var"===e.value}(e)&&(l=!0):o.push(e)})),l)return void u(n,r,`Failed to transform ${n.value} as variables can't be processed.`,a);if(2!==o.length)return void u(n,r,`Failed to transform ${n.value} as it's expecting 2 arguments instead of ${o.length}`,a);const i=t.default.unit(o[0].value),s=t.default.unit(o[1].value);if(i&&s){if(i.unit===s.unit)return[i,s];u(n,r,`Failed to transform ${n.value} as the units don't match`,a)}}function u(e,t,n,u){"warn"===u.onInvalid&&e.warn(t,n)}function r(e){delete e.nodes;const t=e;return t.type="word",t}var a;!function(e){e.Nearest="nearest",e.Up="up",e.Down="down",e.ToZero="to-zero"}(a||(a={}));const o=/^[a-z|-]+$/i;const l=e=>{const l=Object.assign({preserve:!1,onInvalid:""},e);return{postcssPlugin:"postcss-stepped-value-functions",Declaration(e,{result:i}){const s=["mod(","rem(","round("].some((t=>e.value.includes(t)));if(!e||!s)return;const c=e.clone();if(e.value.includes("mod(")){const e=function(e,u,a){const o=t.default(e.value);return o.walk((t=>{if("function"!==t.type||"mod"!==t.value)return;const o=n(t,e,u,a);if(!o)return;const[l,i]=o,s=Number(l.number),c=Number(i.number),d=(s%c+c)%c;"number"!=typeof d||isNaN(d)||(r(t).value=0===d?"0":`${d}${l.unit}`)})),o.toString()}(c,i,l);e&&(c.value=e)}if(c.value.includes("rem(")){const e=function(e,u,a){const o=t.default(e.value);return o.walk((t=>{if("function"!==t.type||"rem"!==t.value)return;const o=n(t,e,u,a);if(!o)return;const[l,i]=o,s=Number(l.number)%Number(i.number);("number"==typeof s||isNaN(s))&&(r(t).value=0===s?"0":`${s}${l.unit}`)})),o.toString()}(c,i,l);e&&(c.value=e)}if(c.value.includes("round(")){const e=function(e,n,l){const i=t.default(e.value);return i.walk((i=>{if("function"!==i.type||"round"!==i.value)return;if(3!==i.nodes.length&&5!==i.nodes.length)return void u(e,n,`Failed to transform ${e.value} as the amount of arguments isn't valid`,l);const s=i.nodes.filter((e=>"word"===e.type)),c=s[0].value;let d,f,v;if(o.test(c)){var m,p;if(!Object.values(a).includes(c))return void u(e,n,`Failed to transform ${e.value} as ${c} is not a valid rounding strategy.`,l);d=c,f=t.default.unit((null==s||null==(m=s[1])?void 0:m.value)||""),v=t.default.unit((null==s||null==(p=s[2])?void 0:p.value)||"")}else{var b,h;d=a.Nearest,f=t.default.unit((null==s||null==(b=s[0])?void 0:b.value)||""),v=t.default.unit((null==s||null==(h=s[1])?void 0:h.value)||"")}if(!f||!v)return;if(f.unit!==v.unit)return void u(e,n,`Failed to transform ${e.value} as the units don't match`,l);const N=Number(f.number),$=Number(v.number);let g;switch(d){case a.Down:g=Math.floor(N/$)*$;break;case a.Up:g=Math.ceil(N/$)*$;break;case a.ToZero:g=Math.trunc(N/$)*$;break;case a.Nearest:default:g=Math.round(N/$)*$}"number"!=typeof g||isNaN(g)||(r(i).value=0===g?"0":`${g}${f.unit}`)})),i.toString()}(c,i,l);e&&(c.value=e)}e.value!==c.value&&(l.preserve?e.cloneBefore({value:c.value}):e.value=c.value)}}};l.postcss=!0,module.exports=l;
1
+ "use strict";var e=require("postcss-value-parser");function isVarNode(e){return"function"===e.type&&"var"===e.value.toLowerCase()}function validateArgumentsAndTypes(n,t,o,r){const u=[];let a=!1;if(n.nodes.forEach((e=>{"word"!==e.type?isVarNode(e)&&(a=!0):u.push(e)})),a)return void optionallyWarn(t,o,`Failed to transform ${t.value} as variables can't be processed.`,r);if(2!==u.length)return void optionallyWarn(t,o,`Failed to transform ${t.value} as it's expecting 2 arguments instead of ${u.length}`,r);const s=e.unit(u[0].value),i=e.unit(u[1].value);if(s&&i){if(s.unit===i.unit)return[s,i];optionallyWarn(t,o,`Failed to transform ${t.value} as the units don't match`,r)}}function optionallyWarn(e,n,t,o){"warn"===o.onInvalid&&e.warn(n,t)}function functionNodeToWordNode(e){delete e.nodes;const n=e;return n.type="word",n}const n="mod(";function transformModFunction(n,t,o){const r=e(n.value);return r.walk((e=>{if("function"!==e.type||"mod"!==e.value.toLowerCase())return;const r=validateArgumentsAndTypes(e,n,t,o);if(!r)return;const[u,a]=r,s=Number(u.number),i=Number(a.number),l=(s%i+i)%i;if("number"!=typeof l||isNaN(l))return;functionNodeToWordNode(e).value=0===l?"0":`${l}${u.unit}`}),!0),r.toString()}const t="rem(";function transformRemFunction(n,t,o){const r=e(n.value);return r.walk((e=>{if("function"!==e.type||"rem"!==e.value.toLowerCase())return;const r=validateArgumentsAndTypes(e,n,t,o);if(!r)return;const[u,a]=r,s=Number(u.number)%Number(a.number);if("number"!=typeof s&&!isNaN(s))return;functionNodeToWordNode(e).value=0===s?"0":`${s}${u.unit}`}),!0),r.toString()}const o="round(";var r;!function(e){e.Nearest="nearest",e.Up="up",e.Down="down",e.ToZero="to-zero"}(r||(r={}));const u=/^[a-z|-]+$/i;function transformRoundFunction(n,t,o){const a=e(n.value);return a.walk((a=>{if("function"!==a.type||"round"!==a.value.toLowerCase())return;if(3!==a.nodes.length&&5!==a.nodes.length)return void optionallyWarn(n,t,`Failed to transform ${n.value} as the amount of arguments isn't valid`,o);const s=a.nodes.filter((e=>"word"===e.type)),i=s[0].value;let l,c,d;if(u.test(i.toLowerCase())){var f,v;if(!Object.values(r).includes(i.toLowerCase()))return void optionallyWarn(n,t,`Failed to transform ${n.value} as ${i} is not a valid rounding strategy.`,o);l=i.toLowerCase(),c=e.unit((null==s||null==(f=s[1])?void 0:f.value)||""),d=e.unit((null==s||null==(v=s[2])?void 0:v.value)||"")}else{var m,p;l=r.Nearest,c=e.unit((null==s||null==(m=s[0])?void 0:m.value)||""),d=e.unit((null==s||null==(p=s[1])?void 0:p.value)||"")}if(!c||!d)return;if(c.unit!==d.unit)return void optionallyWarn(n,t,`Failed to transform ${n.value} as the units don't match`,o);const N=Number(c.number),b=Number(d.number);let w;switch(l){case r.Down:w=Math.floor(N/b)*b;break;case r.Up:w=Math.ceil(N/b)*b;break;case r.ToZero:w=Math.trunc(N/b)*b;break;case r.Nearest:default:w=Math.round(N/b)*b}if("number"!=typeof w||isNaN(w))return;functionNodeToWordNode(a).value=0===w?"0":`${w}${c.unit}`}),!0),a.toString()}const creator=e=>{const r=Object.assign({preserve:!1,onInvalid:""},e);return{postcssPlugin:"postcss-stepped-value-functions",Declaration(e,{result:u}){const a=[n,t,o].some((n=>e.value.toLowerCase().includes(n)));if(!e||!a)return;const s=e.clone();if(s.value.toLowerCase().includes(n)){const e=transformModFunction(s,u,r);e&&(s.value=e)}if(s.value.toLowerCase().includes(t)){const e=transformRemFunction(s,u,r);e&&(s.value=e)}if(s.value.toLowerCase().includes(o)){const e=transformRoundFunction(s,u,r);e&&(s.value=e)}e.value!==s.value&&(e.before(s),r.preserve||e.remove())}}};creator.postcss=!0,module.exports=creator;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,5 @@
1
1
  import type { PluginCreator } from 'postcss';
2
- export declare type pluginOptions = {
3
- preserve?: boolean;
4
- onInvalid?: string;
5
- };
2
+ import type { pluginOptions } from './options';
3
+ export type { pluginOptions } from './options';
6
4
  declare const creator: PluginCreator<pluginOptions>;
7
5
  export default creator;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import e from"postcss-value-parser";function n(n,u,r,o){const a=[];let l=!1;if(n.nodes.forEach((e=>{"word"!==e.type?function(e){return"function"===e.type&&"var"===e.value}(e)&&(l=!0):a.push(e)})),l)return void t(u,r,`Failed to transform ${u.value} as variables can't be processed.`,o);if(2!==a.length)return void t(u,r,`Failed to transform ${u.value} as it's expecting 2 arguments instead of ${a.length}`,o);const s=e.unit(a[0].value),i=e.unit(a[1].value);if(s&&i){if(s.unit===i.unit)return[s,i];t(u,r,`Failed to transform ${u.value} as the units don't match`,o)}}function t(e,n,t,u){"warn"===u.onInvalid&&e.warn(n,t)}function u(e){delete e.nodes;const n=e;return n.type="word",n}var r;!function(e){e.Nearest="nearest",e.Up="up",e.Down="down",e.ToZero="to-zero"}(r||(r={}));const o=/^[a-z|-]+$/i;const a=a=>{const l=Object.assign({preserve:!1,onInvalid:""},a);return{postcssPlugin:"postcss-stepped-value-functions",Declaration(a,{result:s}){const i=["mod(","rem(","round("].some((e=>a.value.includes(e)));if(!a||!i)return;const c=a.clone();if(a.value.includes("mod(")){const t=function(t,r,o){const a=e(t.value);return a.walk((e=>{if("function"!==e.type||"mod"!==e.value)return;const a=n(e,t,r,o);if(!a)return;const[l,s]=a,i=Number(l.number),c=Number(s.number),v=(i%c+c)%c;"number"!=typeof v||isNaN(v)||(u(e).value=0===v?"0":`${v}${l.unit}`)})),a.toString()}(c,s,l);t&&(c.value=t)}if(c.value.includes("rem(")){const t=function(t,r,o){const a=e(t.value);return a.walk((e=>{if("function"!==e.type||"rem"!==e.value)return;const a=n(e,t,r,o);if(!a)return;const[l,s]=a,i=Number(l.number)%Number(s.number);("number"==typeof i||isNaN(i))&&(u(e).value=0===i?"0":`${i}${l.unit}`)})),a.toString()}(c,s,l);t&&(c.value=t)}if(c.value.includes("round(")){const n=function(n,a,l){const s=e(n.value);return s.walk((s=>{if("function"!==s.type||"round"!==s.value)return;if(3!==s.nodes.length&&5!==s.nodes.length)return void t(n,a,`Failed to transform ${n.value} as the amount of arguments isn't valid`,l);const i=s.nodes.filter((e=>"word"===e.type)),c=i[0].value;let v,d,f;if(o.test(c)){var m,p;if(!Object.values(r).includes(c))return void t(n,a,`Failed to transform ${n.value} as ${c} is not a valid rounding strategy.`,l);v=c,d=e.unit((null==i||null==(m=i[1])?void 0:m.value)||""),f=e.unit((null==i||null==(p=i[2])?void 0:p.value)||"")}else{var b,h;v=r.Nearest,d=e.unit((null==i||null==(b=i[0])?void 0:b.value)||""),f=e.unit((null==i||null==(h=i[1])?void 0:h.value)||"")}if(!d||!f)return;if(d.unit!==f.unit)return void t(n,a,`Failed to transform ${n.value} as the units don't match`,l);const N=Number(d.number),$=Number(f.number);let g;switch(v){case r.Down:g=Math.floor(N/$)*$;break;case r.Up:g=Math.ceil(N/$)*$;break;case r.ToZero:g=Math.trunc(N/$)*$;break;case r.Nearest:default:g=Math.round(N/$)*$}"number"!=typeof g||isNaN(g)||(u(s).value=0===g?"0":`${g}${d.unit}`)})),s.toString()}(c,s,l);n&&(c.value=n)}a.value!==c.value&&(l.preserve?a.cloneBefore({value:c.value}):a.value=c.value)}}};a.postcss=!0;export{a as default};
1
+ import e from"postcss-value-parser";function isVarNode(e){return"function"===e.type&&"var"===e.value.toLowerCase()}function validateArgumentsAndTypes(n,t,o,r){const a=[];let u=!1;if(n.nodes.forEach((e=>{"word"!==e.type?isVarNode(e)&&(u=!0):a.push(e)})),u)return void optionallyWarn(t,o,`Failed to transform ${t.value} as variables can't be processed.`,r);if(2!==a.length)return void optionallyWarn(t,o,`Failed to transform ${t.value} as it's expecting 2 arguments instead of ${a.length}`,r);const s=e.unit(a[0].value),i=e.unit(a[1].value);if(s&&i){if(s.unit===i.unit)return[s,i];optionallyWarn(t,o,`Failed to transform ${t.value} as the units don't match`,r)}}function optionallyWarn(e,n,t,o){"warn"===o.onInvalid&&e.warn(n,t)}function functionNodeToWordNode(e){delete e.nodes;const n=e;return n.type="word",n}const n="mod(";function transformModFunction(n,t,o){const r=e(n.value);return r.walk((e=>{if("function"!==e.type||"mod"!==e.value.toLowerCase())return;const r=validateArgumentsAndTypes(e,n,t,o);if(!r)return;const[a,u]=r,s=Number(a.number),i=Number(u.number),l=(s%i+i)%i;if("number"!=typeof l||isNaN(l))return;functionNodeToWordNode(e).value=0===l?"0":`${l}${a.unit}`}),!0),r.toString()}const t="rem(";function transformRemFunction(n,t,o){const r=e(n.value);return r.walk((e=>{if("function"!==e.type||"rem"!==e.value.toLowerCase())return;const r=validateArgumentsAndTypes(e,n,t,o);if(!r)return;const[a,u]=r,s=Number(a.number)%Number(u.number);if("number"!=typeof s&&!isNaN(s))return;functionNodeToWordNode(e).value=0===s?"0":`${s}${a.unit}`}),!0),r.toString()}const o="round(";var r;!function(e){e.Nearest="nearest",e.Up="up",e.Down="down",e.ToZero="to-zero"}(r||(r={}));const a=/^[a-z|-]+$/i;function transformRoundFunction(n,t,o){const u=e(n.value);return u.walk((u=>{if("function"!==u.type||"round"!==u.value.toLowerCase())return;if(3!==u.nodes.length&&5!==u.nodes.length)return void optionallyWarn(n,t,`Failed to transform ${n.value} as the amount of arguments isn't valid`,o);const s=u.nodes.filter((e=>"word"===e.type)),i=s[0].value;let l,c,d;if(a.test(i.toLowerCase())){var f,v;if(!Object.values(r).includes(i.toLowerCase()))return void optionallyWarn(n,t,`Failed to transform ${n.value} as ${i} is not a valid rounding strategy.`,o);l=i.toLowerCase(),c=e.unit((null==s||null==(f=s[1])?void 0:f.value)||""),d=e.unit((null==s||null==(v=s[2])?void 0:v.value)||"")}else{var m,p;l=r.Nearest,c=e.unit((null==s||null==(m=s[0])?void 0:m.value)||""),d=e.unit((null==s||null==(p=s[1])?void 0:p.value)||"")}if(!c||!d)return;if(c.unit!==d.unit)return void optionallyWarn(n,t,`Failed to transform ${n.value} as the units don't match`,o);const N=Number(c.number),b=Number(d.number);let w;switch(l){case r.Down:w=Math.floor(N/b)*b;break;case r.Up:w=Math.ceil(N/b)*b;break;case r.ToZero:w=Math.trunc(N/b)*b;break;case r.Nearest:default:w=Math.round(N/b)*b}if("number"!=typeof w||isNaN(w))return;functionNodeToWordNode(u).value=0===w?"0":`${w}${c.unit}`}),!0),u.toString()}const creator=e=>{const r=Object.assign({preserve:!1,onInvalid:""},e);return{postcssPlugin:"postcss-stepped-value-functions",Declaration(e,{result:a}){const u=[n,t,o].some((n=>e.value.toLowerCase().includes(n)));if(!e||!u)return;const s=e.clone();if(s.value.toLowerCase().includes(n)){const e=transformModFunction(s,a,r);e&&(s.value=e)}if(s.value.toLowerCase().includes(t)){const e=transformRemFunction(s,a,r);e&&(s.value=e)}if(s.value.toLowerCase().includes(o)){const e=transformRoundFunction(s,a,r);e&&(s.value=e)}e.value!==s.value&&(e.before(s),r.preserve||e.remove())}}};creator.postcss=!0;export{creator as default};
package/dist/mod.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { Declaration, Result } from 'postcss';
2
- import { pluginOptions } from './index';
2
+ import type { pluginOptions } from './options';
3
3
  declare const modFunctionCheck = "mod(";
4
4
  declare function transformModFunction(decl: Declaration, result: Result, options: pluginOptions): string | undefined;
5
5
  export { modFunctionCheck, transformModFunction };
@@ -0,0 +1,10 @@
1
+ /** postcss-stepped-value-functions plugin options */
2
+ export type pluginOptions = {
3
+ /** Preserve the original notation. default: false */
4
+ preserve?: boolean;
5
+ /**
6
+ * Set `warn` to get warnings when the usage of the functions is incorrect.
7
+ * default: _not set_
8
+ */
9
+ onInvalid?: 'warn';
10
+ };
package/dist/rem.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { Declaration, Result } from 'postcss';
2
- import { pluginOptions } from './index';
2
+ import type { pluginOptions } from './options';
3
3
  declare const remFunctionCheck = "rem(";
4
4
  declare function transformRemFunction(decl: Declaration, result: Result, options: pluginOptions): string | undefined;
5
5
  export { remFunctionCheck, transformRemFunction };
package/dist/round.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { Declaration, Result } from 'postcss';
2
- import { pluginOptions } from './index';
2
+ import type { pluginOptions } from './options';
3
3
  declare const roundFunctionCheck = "round(";
4
4
  declare function transformRoundFunction(decl: Declaration, result: Result, options: pluginOptions): string | undefined;
5
5
  export { roundFunctionCheck, transformRoundFunction };
package/dist/utils.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import valueParser from 'postcss-value-parser';
2
2
  import type { FunctionNode, Node, WordNode } from 'postcss-value-parser';
3
3
  import type { Declaration, Result } from 'postcss';
4
- import { pluginOptions } from './index';
4
+ import type { pluginOptions } from './options';
5
5
  export declare function isVarNode(node: Node): boolean;
6
6
  export declare function validateArgumentsAndTypes(node: FunctionNode, decl: Declaration, result: Result, options: pluginOptions): valueParser.Dimension[] | undefined;
7
7
  export declare function optionallyWarn(decl: Declaration, result: Result, message: string, options: pluginOptions): void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@csstools/postcss-stepped-value-functions",
3
3
  "description": "Use round, rem and mod functions in CSS",
4
- "version": "1.0.0",
4
+ "version": "2.0.0",
5
5
  "contributors": [
6
6
  {
7
7
  "name": "Antonio Laguna",
@@ -9,7 +9,7 @@
9
9
  "url": "https://antonio.laguna.es"
10
10
  },
11
11
  {
12
- "name": "Romain Menke ",
12
+ "name": "Romain Menke",
13
13
  "email": "romainmenke@gmail.com"
14
14
  }
15
15
  ],
@@ -19,7 +19,7 @@
19
19
  "url": "https://opencollective.com/csstools"
20
20
  },
21
21
  "engines": {
22
- "node": "^12 || ^14 || >=16"
22
+ "node": "^14 || ^16 || >=18"
23
23
  },
24
24
  "main": "dist/index.cjs",
25
25
  "module": "dist/index.mjs",
@@ -41,11 +41,12 @@
41
41
  "postcss-value-parser": "^4.2.0"
42
42
  },
43
43
  "peerDependencies": {
44
- "postcss": "^8.3"
44
+ "postcss": "^8.4"
45
45
  },
46
46
  "scripts": {
47
- "build": "rollup -c ../../rollup/default.js",
48
- "clean": "node -e \"fs.rmSync('./dist', { recursive: true, force: true });\"",
47
+ "prebuild": "npm run clean",
48
+ "build": "rollup -c ../../rollup/default.mjs",
49
+ "clean": "node -e \"fs.rmSync('./dist', { recursive: true, force: true }); fs.mkdirSync('./dist');\"",
49
50
  "docs": "node ../../.github/bin/generate-docs/install.mjs && node ../../.github/bin/generate-docs/readme.mjs",
50
51
  "lint": "npm run lint:eslint && npm run lint:package-json",
51
52
  "lint:eslint": "eslint ./src --ext .js --ext .ts --ext .mjs --no-error-on-unmatched-pattern",