Browse Source

Add Travis-CI build + restore stylelint

Phyks (Lucas Verney) 5 years ago
parent
commit
1add19319d
9 changed files with 40 additions and 17 deletions
  1. 7
    1
      .stylelintrc
  2. 13
    0
      .travis.yml
  3. 1
    1
      app/dist/fix.ie9.js.map
  4. 1
    1
      app/dist/index.js.map
  5. 1
    1
      app/dist/style.css
  6. 1
    0
      app/styles/layouts/Sidebar.scss
  7. 2
    2
      hooks/pre-commit
  8. 12
    6
      package.json
  9. 2
    5
      webpack.config.base.js

+ 7
- 1
.stylelintrc View File

@@ -1,7 +1,13 @@
1 1
 {
2 2
     "extends": "stylelint-config-standard",
3 3
     "rules": {
4
-        "indentation": 4
4
+        "indentation": 4,
5
+        "selector-pseudo-class-no-unknown": [true, {
6
+            ignorePseudoClasses: ["global"]
7
+        }],
8
+        "no-unsupported-browser-features": [true, {
9
+            browsers: "ie >= 9, > 1%, last 3 versions, not op_mini all"
10
+        }]
5 11
     },
6 12
     "defaultSeverity": "error"
7 13
 }

+ 13
- 0
.travis.yml View File

@@ -0,0 +1,13 @@
1
+---
2
+sudo: required
3
+dist: trusty
4
+language: node_js
5
+node_js:
6
+    - 4
7
+install:
8
+    - npm install
9
+script:
10
+    - "npm run build:dev"
11
+    - "npm run clean"
12
+    - "npm run build:prod"
13
+    - "npm test"

+ 1
- 1
app/dist/fix.ie9.js.map
File diff suppressed because it is too large
View File


+ 1
- 1
app/dist/index.js.map
File diff suppressed because it is too large
View File


+ 1
- 1
app/dist/style.css
File diff suppressed because it is too large
View File


+ 1
- 0
app/styles/layouts/Sidebar.scss View File

@@ -39,6 +39,7 @@ $lightgrey: #eee;
39 39
     composes: link;
40 40
     background-color: $activeBackground !important;
41 41
 }
42
+
42 43
 .active:focus {
43 44
     background-color: $activeBackground !important;
44 45
 }

+ 2
- 2
hooks/pre-commit View File

@@ -16,7 +16,7 @@ then
16 16
 fi
17 17
 
18 18
 echo "Rebuilding dist JavaScript files…"
19
-export NODE_ENV=production
20 19
 npm run clean
21
-npm run build
20
+npm run build:prod
21
+npm test
22 22
 git add app/dist

+ 12
- 6
package.json View File

@@ -7,11 +7,18 @@
7 7
   "homepage": "https://github.com/Phyks/ampache_react",
8 8
   "repository": "git+https://github.com/Phyks/ampache_react.git",
9 9
   "scripts": {
10
-    "build": "./node_modules/.bin/webpack --progress",
11
-    "watch": "./node_modules/.bin/webpack --progress  --watch",
12
-    "prod": "NODE_ENV=production ./node_modules/.bin/webpack --progress",
13
-    "extractTranslations": "./node_modules/.bin/babel-node scripts/extractTranslations.js",
14
-    "clean": "./node_modules/.bin/rimraf .cache && ./node_modules/.bin/rimraf app/dist"
10
+    "clean": "rimraf .cache && rimraf app/dist",
11
+    "build:dev": "webpack --progress",
12
+    "build:prod": "NODE_ENV=production webpack --progress",
13
+    "watch:dev": "webpack --progress --watch",
14
+    "watch:prod": "NODE_ENV=production webpack --progress --watch",
15
+
16
+    "extractTranslations": "babel-node scripts/extractTranslations.js",
17
+
18
+    "lint:scss": "stylelint './app/**/*.scss' --syntax scss",
19
+    "lint:js": "eslint './app/**/*.js' './app/**/*.jsx'",
20
+
21
+    "test": "npm run lint:scss && npm run lint:js"
15 22
   },
16 23
   "dependencies": {
17 24
     "babel-polyfill": "^6.9.1",
@@ -60,7 +67,6 @@
60 67
     "postcss": "^5.1.0",
61 68
     "postcss-loader": "^0.9.1",
62 69
     "postcss-reporter": "^1.4.1",
63
-    "precss": "^1.4.0",
64 70
     "react-a11y": "^0.3.3",
65 71
     "react-intl-webpack-plugin": "0.0.3",
66 72
     "redbox-react": "^1.2.10",

+ 2
- 5
webpack.config.base.js View File

@@ -3,9 +3,6 @@ var webpack = require("webpack");
3 3
 
4 4
 var ExtractTextPlugin = require("extract-text-webpack-plugin");
5 5
 var postcssReporter = require("postcss-reporter");
6
-var doiuse = require("doiuse");
7
-var stylelint = require("stylelint");
8
-var precss = require("precss");
9 6
 var autoprefixer = require("autoprefixer");
10 7
 var browsers = ["ie >= 9", "> 1%", "last 3 versions", "not op_mini all"];
11 8
 
@@ -53,7 +50,7 @@ module.exports = {
53 50
                 loader: ExtractTextPlugin.extract(
54 51
                     "style-loader",
55 52
                     "css-loader?modules&importLoaders=1&localIdentName=[name]__[local]__[hash:base64:5]" +
56
-                    // TODO: "!postcss-loader" +
53
+                    "!postcss-loader" +
57 54
                     "!sass-loader"
58 55
                 )
59 56
             },
@@ -84,7 +81,7 @@ module.exports = {
84 81
         new ExtractTextPlugin("style.css", { allChunks: true })
85 82
     ],
86 83
 
87
-    postcss: [doiuse({ browsers: browsers }), stylelint, precss, autoprefixer({ browsers: browsers }), postcssReporter({ throwError: true, clearMessages: true })],
84
+    postcss: [autoprefixer({ browsers: browsers }), postcssReporter({ throwError: true, clearMessages: true })],
88 85
 
89 86
     resolve: {
90 87
         // Include empty string "" to resolve files by their explicit extension