stylehacks 5.0.0-rc.1 → 5.0.2

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/README.md CHANGED
@@ -52,7 +52,11 @@ it will return `false` instead.
52
52
  h1 { _color: red }
53
53
  ```
54
54
 
55
- ### `stylehacks.process(css, [options]).then(function(result) {})`
55
+ ### `postcss([ stylehacks(opts) ])`
56
+
57
+ stylehacks can also be consumed as a PostCSS plugin. See the
58
+ [documentation](https://github.com/postcss/postcss#usage) for examples for
59
+ your environment.
56
60
 
57
61
  #### options
58
62
 
@@ -65,13 +69,6 @@ If lint mode is enabled, stylehacks will not remove hacks from the CSS; instead,
65
69
  it will add warnings to `Result#messages`.
66
70
 
67
71
 
68
- ### `postcss([ stylehacks(opts) ])`
69
-
70
- stylehacks can also be consumed as a PostCSS plugin. See the
71
- [documentation](https://github.com/postcss/postcss#usage) for examples for
72
- your environment.
73
-
74
-
75
72
  ## Related
76
73
 
77
74
  stylehacks works well with your existing PostCSS setup:
package/dist/index.js CHANGED
@@ -40,7 +40,7 @@ function pluginCreator(opts = {}) {
40
40
 
41
41
  css.walk(node => {
42
42
  processors.forEach(proc => {
43
- if (!~proc.nodeTypes.indexOf(node.type)) {
43
+ if (!proc.nodeTypes.includes(node.type)) {
44
44
  return;
45
45
  }
46
46
 
package/dist/plugin.js CHANGED
@@ -23,7 +23,7 @@ function plugin(targets, nodeTypes, detect) {
23
23
  }
24
24
 
25
25
  any(node) {
26
- if (~this.nodeTypes.indexOf(node.type)) {
26
+ if (this.nodeTypes.includes(node.type)) {
27
27
  detect.apply(this, arguments);
28
28
  return !!node._stylehacks;
29
29
  }
@@ -39,7 +39,7 @@ var _default = (0, _plugin.default)([_browsers.IE_5_5, _browsers.IE_6, _browsers
39
39
  }
40
40
 
41
41
  hacks.some(hack => {
42
- if (~before.indexOf(hack)) {
42
+ if (before.includes(hack)) {
43
43
  this.push(node, {
44
44
  identifier: _identifiers.PROPERTY,
45
45
  hack: `${before.trim()}${node.prop}`
@@ -30,7 +30,7 @@ var _default = (0, _plugin.default)([_browsers.IE_6], [_postcss.DECL], function
30
30
  before
31
31
  } = decl.raws;
32
32
 
33
- if (before && ~before.indexOf('_')) {
33
+ if (before && before.includes('_')) {
34
34
  this.push(decl, {
35
35
  identifier: _identifiers.PROPERTY,
36
36
  hack: `${before.trim()}${decl.prop}`
package/package.json CHANGED
@@ -1,17 +1,12 @@
1
1
  {
2
2
  "name": "stylehacks",
3
- "version": "5.0.0-rc.1",
3
+ "version": "5.0.2",
4
4
  "description": "Detect/remove browser hacks from CSS files.",
5
5
  "main": "dist/index.js",
6
6
  "files": [
7
7
  "LICENSE-MIT",
8
8
  "dist"
9
9
  ],
10
- "scripts": {
11
- "prebuild": "del-cli dist",
12
- "build": "cross-env BABEL_ENV=publish babel src --config-file ../../babel.config.js --out-dir dist --ignore \"**/__tests__/\"",
13
- "prepublish": "yarn build"
14
- },
15
10
  "keywords": [
16
11
  "browsers",
17
12
  "css",
@@ -31,7 +26,7 @@
31
26
  },
32
27
  "repository": "cssnano/cssnano",
33
28
  "dependencies": {
34
- "browserslist": "^4.16.0",
29
+ "browserslist": "^4.16.6",
35
30
  "postcss-selector-parser": "^6.0.4"
36
31
  },
37
32
  "bugs": {
@@ -41,10 +36,14 @@
41
36
  "node": "^10 || ^12 || >=14.0"
42
37
  },
43
38
  "devDependencies": {
44
- "postcss": "^8.2.1"
39
+ "postcss": "^8.2.15"
45
40
  },
46
41
  "peerDependencies": {
47
- "postcss": "^8.2.1"
42
+ "postcss": "^8.2.15"
43
+ },
44
+ "scripts": {
45
+ "prebuild": "rimraf dist",
46
+ "build": "babel src --config-file ../../babel.config.json --out-dir dist --ignore \"**/__tests__/\""
48
47
  },
49
- "gitHead": "114efb0092fff944dd4c8a28d184add24d8fde3e"
50
- }
48
+ "readme": "# stylehacks\n\n> Detect/remove browser hacks from CSS files.\n\n\n## Install\n\nWith [npm](https://npmjs.org/package/stylehacks) do:\n\n```\nnpm install stylehacks --save\n```\n\n\n## Example\n\nIn its default mode, stylehacks will remove hacks from your CSS file, based on\nthe browsers that you wish to support.\n\n### Input\n\n```css\nh1 {\n _color: white;\n color: rgba(255, 255, 255, 0.5);\n}\n```\n\n### Output\n\n```css\nh1 {\n color: rgba(255, 255, 255, 0.5);\n}\n```\n\n\n## API\n\n### `stylehacks.detect(node)`\n\nType: `function` \nReturns: `boolean`\n\nThis method will take any PostCSS *node*, run applicable plugins depending on\nits type, then will return a boolean depending on whether it found any of\nthe supported hacks. For example, if the `decl` node found below is passed to\nthe `detect` function, it will return `true`. But if the `rule` node is passed,\nit will return `false` instead.\n\n```css\nh1 { _color: red }\n```\n\n### `postcss([ stylehacks(opts) ])`\n\nstylehacks can also be consumed as a PostCSS plugin. See the\n[documentation](https://github.com/postcss/postcss#usage) for examples for\nyour environment.\n\n#### options\n\n##### lint\n\nType: `boolean` \nDefault: `false`\n\nIf lint mode is enabled, stylehacks will not remove hacks from the CSS; instead,\nit will add warnings to `Result#messages`.\n\n\n## Related\n\nstylehacks works well with your existing PostCSS setup:\n\n* [stylelint] - Comprehensive & modern CSS linter, to ensure that your code\n style rules are respected.\n\n\n## Contributing\n\nPull requests are welcome. If you add functionality, then please add unit tests\nto cover it.\n\n\n## License\n\nMIT © [Ben Briggs](http://beneb.info)\n\n\n[stylelint]: https://github.com/stylelint/stylelint\n"
49
+ }
package/CHANGELOG.md DELETED
@@ -1,57 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- # [5.0.0-rc.1](https://github.com/cssnano/cssnano/compare/stylehacks@5.0.0-rc.0...stylehacks@5.0.0-rc.1) (2021-03-04)
7
-
8
- **Note:** Version bump only for package stylehacks
9
-
10
-
11
-
12
-
13
-
14
- # 5.0.0-rc.0 (2021-02-19)
15
-
16
-
17
- ### chore
18
-
19
- * minimum require version of node is 10.13 ([#871](https://github.com/cssnano/cssnano/issues/871)) ([28bda24](https://github.com/cssnano/cssnano/commit/28bda243e32ce3ba89b3c358a5f78727b3732f11))
20
-
21
-
22
- ### Features
23
-
24
- * migarete to PostCSS 8 ([#975](https://github.com/cssnano/cssnano/issues/975)) ([40b82dc](https://github.com/cssnano/cssnano/commit/40b82dca7f53ac02cd4fe62846dec79b898ccb49))
25
-
26
-
27
- ### BREAKING CHANGES
28
-
29
- * minimum supported `postcss` version is `8.2.1`
30
- * minimum require version of node is 10.13
31
-
32
-
33
-
34
- ## 4.1.10 (2019-02-14)
35
-
36
-
37
- ### Bug Fixes
38
-
39
- * **stylehacks:** doesn't throw error on `[attr]` selector ([#711](https://github.com/cssnano/cssnano/issues/711)) ([a4a43c3](https://github.com/cssnano/cssnano/commit/a4a43c37c58eb9dec3123072485f12e20f627bd1))
40
-
41
-
42
-
43
- ## 4.1.9 (2019-02-12)
44
-
45
-
46
- ### Bug Fixes
47
-
48
- * **stylehacks:** better handle uppercase ([#704](https://github.com/cssnano/cssnano/issues/704)) ([8d48058](https://github.com/cssnano/cssnano/commit/8d48058b0f5be6943c443e4ce653fb156794f6b7))
49
-
50
-
51
-
52
- ## 4.1.1 (2018-09-24)
53
-
54
-
55
- ### Bug Fixes
56
-
57
- * **postcss-merge-longhand:** not mangle border output ([#555](https://github.com/cssnano/cssnano/issues/555)) ([9a70605](https://github.com/cssnano/cssnano/commit/9a706050b621e7795a9bf74eb7110b5c81804ffe)), closes [#553](https://github.com/cssnano/cssnano/issues/553) [#554](https://github.com/cssnano/cssnano/issues/554)