Browse Source

Add postcss-safe-important and typescript

Let’s see if !important everywhere will be a good enough style protection
Artur Paikin 7 years ago
parent
commit
99a8a948e4
3 changed files with 33 additions and 1 deletions
  1. 2 1
      bin/build-css.js
  2. 28 0
      package-lock.json
  3. 3 0
      package.json

+ 2 - 1
bin/build-css.js

@@ -2,6 +2,7 @@ var sass = require('node-sass')
 var postcss = require('postcss')
 var autoprefixer = require('autoprefixer')
 var cssnano = require('cssnano')
+var safeImportant = require('postcss-safe-important')
 var chalk = require('chalk')
 var fs = require('fs')
 var path = require('path')
@@ -38,7 +39,7 @@ function compileCSS () {
   return new Promise(function (resolve) {
     sass.render({file: './src/scss/uppy.scss'}, function (err, sassResult) {
       if (err) handleErr(err)
-      postcss([ autoprefixer ])
+      postcss([ autoprefixer, safeImportant ])
         .process(sassResult.css, { from: path.join(__dirname, '../src/scss/uppy.scss') })
         .then(function (postCSSResult) {
           postCSSResult.warnings().forEach(function (warn) {

+ 28 - 0
package-lock.json

@@ -14105,6 +14105,29 @@
         }
       }
     },
+    "postcss-safe-important": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/postcss-safe-important/-/postcss-safe-important-1.1.0.tgz",
+      "integrity": "sha1-asaEGwpCujY0FnxYmxB6VNwDID8=",
+      "dev": true,
+      "requires": {
+        "postcss": "5.2.18"
+      },
+      "dependencies": {
+        "postcss": {
+          "version": "5.2.18",
+          "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz",
+          "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==",
+          "dev": true,
+          "requires": {
+            "chalk": "1.1.3",
+            "js-base64": "2.1.9",
+            "source-map": "0.5.6",
+            "supports-color": "3.2.3"
+          }
+        }
+      }
+    },
     "postcss-selector-parser": {
       "version": "2.2.3",
       "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-2.2.3.tgz",
@@ -16720,6 +16743,11 @@
       "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=",
       "dev": true
     },
+    "typescript": {
+      "version": "2.8.1",
+      "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.8.1.tgz",
+      "integrity": "sha512-Ao/f6d/4EPLq0YwzsQz8iXflezpTkQzqAyenTiw4kCUGr1uPiFLC3+fZ+gMZz6eeI/qdRUqvC+HxIJzUAzEFdg=="
+    },
     "ua-parser-js": {
       "version": "0.7.12",
       "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.12.tgz",

+ 3 - 0
package.json

@@ -86,6 +86,8 @@
     "npm-run-all": "^4.1.2",
     "onchange": "^3.3.0",
     "postcss": "^6.0.16",
+    "postcss-safe-important": "^1.1.0",
+    "typescript": "^2.8.1",
     "pre-commit": "^1.2.2",
     "redux": "^3.7.2",
     "replace-x": "^1.5.0",
@@ -139,6 +141,7 @@
     "test:acceptance": "./bin/endtoend-build && wdio test/endtoend/wdio.remote.conf.js",
     "test:acceptance:local": "./bin/endtoend-build && wdio test/endtoend/wdio.local.conf.js",
     "test:unit": "jest --testPathPattern=./src --coverage",
+    "test:type": "tsc -p .",
     "test": "npm run lint && npm run test:unit",
     "test:watch": "jest --watch --testPathPattern=src",
     "travis:deletecache": "travis cache --delete",