From 9254409c40f340a4391962d15373490461f1d97f Mon Sep 17 00:00:00 2001 From: Farhad Yasir Date: Sun, 4 Nov 2018 21:41:12 +1100 Subject: [PATCH 1/2] [Feature] wrapped html tag differently --- index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.js b/index.js index f136b38..0a77267 100644 --- a/index.js +++ b/index.js @@ -16,6 +16,9 @@ const postCssWrapperPlugin= postCss.plugin('postcss-wrapper-plugin', function(pr const joinPrefix = function(prefix) { return function(selector) { + if(selector === 'html') { + return selector+prefix; + } return _.join(' ', [prefix, selector]); }; }; From 902b595cd2fed20e5038345fd1920516a99f3225 Mon Sep 17 00:00:00 2001 From: Farhad Yasir Date: Sun, 4 Nov 2018 23:39:02 +1100 Subject: [PATCH 2/2] [Feature] config files added --- .gitignore | 1 + .npmignore | 8 +++++ .travis.yml | 6 ++++ LICENSE | 21 +++++++++++++ package-lock.json | 77 +++++++++++++++++++++++++++++++++++++++++++++++ package.json | 6 ++-- 6 files changed, 117 insertions(+), 2 deletions(-) create mode 100644 .npmignore create mode 100644 .travis.yml create mode 100644 LICENSE create mode 100644 package-lock.json diff --git a/.gitignore b/.gitignore index eb79dd5..02960a4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules .idea +.vscode diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..cb3d8ed --- /dev/null +++ b/.npmignore @@ -0,0 +1,8 @@ + ignore all + +* + +# override above and include followings + +!index.js +!package.json diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..6506ec5 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,6 @@ +language: node_js +node_js: stable +cache: yarn +before_install: yarn global add greenkeeper-lockfile@1 +before_script: greenkeeper-lockfile-update +after_script: greenkeeper-lockfile-upload \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..83bb674 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Farhad Yasir + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..0be730a --- /dev/null +++ b/package-lock.json @@ -0,0 +1,77 @@ +{ + "name": "postcss-wrapper-loader", + "version": "0.0.2", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" + }, + "postcss": { + "version": "6.0.23", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", + "requires": { + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } + } +} diff --git a/package.json b/package.json index cc7a1c5..b759e7d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "postcss-wrapper-loader", - "version": "0.0.2", + "version": "1.0.0", "private": false, "description": "This plugin wraps all the cssClasses in a css file with a prefix class while webpack bundled. It helps to scope a specific css file with a prefix class", "main": "index.js", @@ -12,7 +12,9 @@ "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [ - "postcss-wrapper" + "postcss-wrapper", + "global class wrapper", + "parent class wrapper" ], "author": "Farhad Yasir", "license": "MIT",