postcss-reduce-initial 8.0.5 → 9.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/package.json +4 -9
- package/src/index.js +10 -11
- package/src/lib/computeBrowsersToSupport.js +10 -12
- package/src/lib/getBrowsersForWebBuild.js +2 -4
- package/src/lib/ignoreProps.js +1 -2
- package/types/index.d.ts +16 -2
- package/types/index.d.ts.map +1 -1
- package/types/lib/computeBrowsersToSupport.d.ts +2 -2
- package/types/lib/computeBrowsersToSupport.d.ts.map +1 -1
- package/types/lib/getBrowsersForWebBuild.d.ts +2 -2
- package/types/lib/ignoreProps.d.ts +2 -2
package/package.json
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "postcss-reduce-initial",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0",
|
|
4
4
|
"description": "Reduce initial definitions to the actual initial value, where possible.",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./types/index.d.ts",
|
|
8
8
|
"default": "./src/index.js"
|
|
9
|
-
}
|
|
10
|
-
"./src": "./src/index.js",
|
|
11
|
-
"./src/index": "./src/index.js",
|
|
12
|
-
"./src/index.js": "./src/index.js",
|
|
13
|
-
"./src/lib/ignoreProps": "./src/lib/ignoreProps.js",
|
|
14
|
-
"./src/lib/ignoreProps.js": "./src/lib/ignoreProps.js",
|
|
15
|
-
"./package.json": "./package.json"
|
|
9
|
+
}
|
|
16
10
|
},
|
|
17
11
|
"imports": {
|
|
18
12
|
"#getBrowsersList": {
|
|
@@ -49,7 +43,7 @@
|
|
|
49
43
|
"url": "https://github.com/cssnano/cssnano/issues"
|
|
50
44
|
},
|
|
51
45
|
"engines": {
|
|
52
|
-
"node": "^22.
|
|
46
|
+
"node": "^22.22.3 || ^24.15.0 || >=26.0"
|
|
53
47
|
},
|
|
54
48
|
"devDependencies": {
|
|
55
49
|
"mdn-data": "2.33.0",
|
|
@@ -58,6 +52,7 @@
|
|
|
58
52
|
"peerDependencies": {
|
|
59
53
|
"postcss": "^8.5.26"
|
|
60
54
|
},
|
|
55
|
+
"type": "module",
|
|
61
56
|
"scripts": {
|
|
62
57
|
"acquire": "node ./script/acquire.mjs",
|
|
63
58
|
"test": "node --test"
|
package/src/index.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const toInitial = require('./data/toInitial.json');
|
|
7
|
-
const ignoreProps = require('./lib/ignoreProps.js');
|
|
1
|
+
import getBrowsersList from '#getBrowsersList';
|
|
2
|
+
import caniuseApi from 'caniuse-api';
|
|
3
|
+
import fromInitial from './data/fromInitial.json' with { type: 'json' };
|
|
4
|
+
import toInitial from './data/toInitial.json' with { type: 'json' };
|
|
5
|
+
import ignoreProps from './lib/ignoreProps.js';
|
|
8
6
|
|
|
7
|
+
const { isSupported } = caniuseApi;
|
|
9
8
|
const initial = 'initial';
|
|
10
9
|
|
|
11
10
|
// In most of the browser including chrome the initial for `writing-mode` is not `horizontal-tb`. Ref https://github.com/cssnano/cssnano/pull/905
|
|
@@ -80,8 +79,8 @@ function pluginCreator(options = {}) {
|
|
|
80
79
|
},
|
|
81
80
|
};
|
|
82
81
|
}
|
|
83
|
-
|
|
82
|
+
/** @type {true} */
|
|
84
83
|
pluginCreator.postcss = true;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
const moduleExports = pluginCreator;
|
|
85
|
+
|
|
86
|
+
export { moduleExports as default, moduleExports as 'module.exports' };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { fileURLToPath } from 'node:url';
|
|
2
|
+
import browserslist from 'browserslist';
|
|
3
|
+
import nodepath from 'node:path';
|
|
2
4
|
|
|
3
|
-
const
|
|
4
|
-
const { dirname } = require('node:path');
|
|
5
|
+
const { dirname } = nodepath;
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
*
|
|
@@ -12,16 +13,13 @@ const { dirname } = require('node:path');
|
|
|
12
13
|
* @param {browserslist.Options["env"]} [env]
|
|
13
14
|
* @returns {string[]}
|
|
14
15
|
*/
|
|
15
|
-
|
|
16
|
-
options,
|
|
17
|
-
stats,
|
|
18
|
-
from,
|
|
19
|
-
file,
|
|
20
|
-
env
|
|
21
|
-
) {
|
|
16
|
+
function computeBrowsersToSupport(options, stats, from, file, env) {
|
|
22
17
|
return browserslist(options.overrideBrowserslist, {
|
|
23
18
|
stats: options.stats || stats,
|
|
24
|
-
path:
|
|
19
|
+
path:
|
|
20
|
+
options.path || dirname(from || file || fileURLToPath(import.meta.url)),
|
|
25
21
|
env: options.env || env,
|
|
26
22
|
});
|
|
27
|
-
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default computeBrowsersToSupport;
|
package/src/lib/ignoreProps.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
'
|
|
2
|
-
module.exports = ['writing-mode', 'transform-box'];
|
|
1
|
+
export default ['writing-mode', 'transform-box'];
|
package/types/index.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
declare const _exports: import("postcss").PluginCreator<Options>;
|
|
2
|
-
export = _exports;
|
|
3
1
|
import type browserslist from 'browserslist';
|
|
4
2
|
export type AutoprefixerOptions = {
|
|
5
3
|
overrideBrowserslist?: string | string[];
|
|
@@ -8,4 +6,20 @@ export type BrowserslistOptions = Pick<browserslist.Options, 'stats' | 'path' |
|
|
|
8
6
|
export type Options = {
|
|
9
7
|
ignore?: string[];
|
|
10
8
|
} & AutoprefixerOptions & BrowserslistOptions;
|
|
9
|
+
/**
|
|
10
|
+
* @import browserslist from 'browserslist'
|
|
11
|
+
* @typedef {{ overrideBrowserslist?: string | string[] }} AutoprefixerOptions
|
|
12
|
+
* @typedef {Pick<browserslist.Options, 'stats' | 'path' | 'env'>} BrowserslistOptions
|
|
13
|
+
* @typedef {{ignore?: string[]} & AutoprefixerOptions & BrowserslistOptions} Options
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* @param {Options} options
|
|
17
|
+
* @return {import('postcss').Plugin}
|
|
18
|
+
*/
|
|
19
|
+
declare function pluginCreator(options?: Options): import('postcss').Plugin;
|
|
20
|
+
declare namespace pluginCreator {
|
|
21
|
+
var postcss: true;
|
|
22
|
+
}
|
|
23
|
+
declare const moduleExports: typeof pluginCreator;
|
|
24
|
+
export { moduleExports as default, moduleExports as 'module.exports' };
|
|
11
25
|
//# sourceMappingURL=index.d.ts.map
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"AAaG,OAAQ,KAAA,YAAY,MAAM,cAAc,CACxC;AAAA,YAAwD,mBAAmB,GAAjE;IAAE,oBAAoB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAAE,CAAqB;AAC3E,YAAgE,mBAAmB,GAAzE,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC,CAAqB;AACnF,YAA2E,OAAO,GAAxE;IAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;CAAC,GAAG,mBAAmB,GAAG,mBAAmB,CAAS;AAJrF;;;;;GAKG;AAEH;;;GAGG;AACH,iBAAS,aAAa,CAAC,OAAO,GAHnB,OAGwB,GAFvB,OAAO,SAAS,EAAE,MAAM,CA2DnC;kBAzDQ,aAAa;iBA0DX,IAAI;;AAEf,QAAA,MAAM,aAAa,sBAAgB,CAAC;AAEpC,OAAO,EAAE,aAAa,IAAI,OAAO,EAAE,aAAa,IAAI,gBAAgB,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import browserslist from 'browserslist';
|
|
2
2
|
/**
|
|
3
3
|
*
|
|
4
4
|
* @param {{overrideBrowserslist?: string | string[] | undefined, stats?: browserslist.Options["stats"], path?: browserslist.Options["path"], env?: browserslist.Options["env"]}} options
|
|
@@ -14,5 +14,5 @@ declare function computeBrowsersToSupport(options: {
|
|
|
14
14
|
path?: browserslist.Options["path"];
|
|
15
15
|
env?: browserslist.Options["env"];
|
|
16
16
|
}, stats: browserslist.Options["stats"], from: string | undefined, file?: string, env?: browserslist.Options["env"]): string[];
|
|
17
|
-
|
|
17
|
+
export default computeBrowsersToSupport;
|
|
18
18
|
//# sourceMappingURL=computeBrowsersToSupport.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computeBrowsersToSupport.d.ts","sourceRoot":"","sources":["../../src/lib/computeBrowsersToSupport.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"computeBrowsersToSupport.d.ts","sourceRoot":"","sources":["../../src/lib/computeBrowsersToSupport.js"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,cAAc,CAAC;AAKxC;;;;;;;;GAQG;AACH,iBAAS,wBAAwB,CAAC,OAAO,EAP9B;IAAC,oBAAoB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;IAAC,KAAK,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAAC,IAAI,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAAC,GAAG,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;CAOtI,EAAE,KAAK,EANrC,YAAY,CAAC,OAAO,CAAC,OAAO,CAMS,EAAE,IAAI,EAL3C,MAAM,GAAC,SAKoC,EAAE,IAAI,AAJzD,CACA,EADQ,MAIiD,EAAE,GAAG,AAH9D,CACA,EADQ,YAAY,CAAC,OAAO,CAAC,KAAK,CAG4B,GAFpD,MAAM,EAAE,CASpB;eAEc,wBAAwB"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
declare function
|
|
1
|
+
export default _default;
|
|
2
|
+
declare function _default(): string[];
|
|
3
3
|
//# sourceMappingURL=getBrowsersForWebBuild.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const
|
|
2
|
-
export
|
|
1
|
+
declare const _default: string[];
|
|
2
|
+
export default _default;
|
|
3
3
|
//# sourceMappingURL=ignoreProps.d.ts.map
|