Skip to content

Commit efb2a5c

Browse files
author
Tyler Smalley
committed
Remove libsass as a dependency
libsass is platform specific, therefore we can not ship it as a dependency. Instead, we will commit the compiled CSS for the UI Framework to the repository. This is updated when running `npm run uiFramework:start` which also starts the docs site. Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
1 parent 980b67e commit efb2a5c

File tree

133 files changed

+926
-10
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+926
-10
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ selenium
3434
*.swp
3535
*.swo
3636
*.out
37-
src/ui_framework/doc_site/build/*.js*
37+
ui_framework/doc_site/build/*.js*

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"mocha": "mocha",
6464
"mocha:debug": "mocha --debug-brk",
6565
"sterilize": "grunt sterilize",
66-
"uiFramework:start": "webpack-dev-server --config src/ui_framework/doc_site/webpack.config.js --hot --inline --content-base src/ui_framework/doc_site/build"
66+
"uiFramework:start": "grunt uiFramework:start"
6767
},
6868
"repository": {
6969
"type": "git",
@@ -145,7 +145,6 @@
145145
"moment-timezone": "0.5.4",
146146
"no-ui-slider": "1.2.0",
147147
"node-fetch": "1.3.2",
148-
"node-sass": "3.8.0",
149148
"node-uuid": "1.4.7",
150149
"pegjs": "0.9.0",
151150
"postcss-loader": "1.2.1",
@@ -155,7 +154,6 @@
155154
"rimraf": "2.4.3",
156155
"rison-node": "1.0.0",
157156
"rjs-repack-loader": "1.0.6",
158-
"sass-loader": "4.0.0",
159157
"script-loader": "0.6.1",
160158
"semver": "5.1.0",
161159
"style-loader": "0.12.3",
@@ -222,6 +220,7 @@
222220
"mocha": "2.5.3",
223221
"murmurhash3js": "3.0.1",
224222
"ncp": "2.0.0",
223+
"node-sass": "3.8.0",
225224
"nock": "8.0.0",
226225
"npm": "3.10.8",
227226
"portscanner": "1.0.0",
@@ -234,6 +233,7 @@
234233
"react-router-redux": "4.0.4",
235234
"redux": "3.0.0",
236235
"redux-thunk": "0.1.0",
236+
"sass-loader": "4.0.0",
237237
"simple-git": "1.37.0",
238238
"sinon": "1.17.2",
239239
"source-map": "0.5.6",

src/optimize/base_optimizer.js

-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ class BaseOptimizer {
125125
module: {
126126
loaders: [
127127
{ test: /\.less$/, loader: makeStyleLoader('less-loader') },
128-
{ test: /\.scss$/, loader: makeStyleLoader('sass-loader') },
129128
{ test: /\.css$/, loader: makeStyleLoader() },
130129
{ test: /\.jade$/, loader: 'jade-loader' },
131130
{ test: /\.json$/, loader: 'json-loader' },

src/ui/public/autoload/styles.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Kibana UI Framework
2-
require('../../../ui_framework/components/index.scss');
2+
require('../../../../ui_framework/dist/ui_framework.css');
33

44
// All Kibana styles inside of the /styles dir
55
const context = require.context('../styles', false, /[\/\\](?!mixins|variables|_|\.)[^\/\\]+\.less/);

tasks/config/copy.js

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ module.exports = function (grunt) {
44
options: { mode: true },
55
src: [
66
'src/**',
7+
'ui_framework/dist/**',
78
'bin/**',
89
'webpackShims/**',
910
'config/kibana.yml',

tasks/ui_framework.js

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
const sass = require('node-sass');
2+
const platform = require('os').platform();
3+
4+
module.exports = function (grunt) {
5+
const watcherCmd = {
6+
cmd: /^win/.test(platform) ? '.\\node_modules\\.bin\\node-sass' : './node_modules/.bin/node-sass',
7+
args: [
8+
'ui_framework/components/index.scss',
9+
'--watch',
10+
'--recursive',
11+
'ui_framework/dist/ui_framework.css'
12+
]
13+
};
14+
15+
const serverCmd = {
16+
cmd: /^win/.test(platform) ? '.\\node_modules\\.bin\\webpack-dev-server' : './node_modules/.bin/webpack-dev-server',
17+
args: [
18+
'--config=ui_framework/doc_site/webpack.config.js',
19+
'--hot ',
20+
'--inline',
21+
'--content-base=ui_framework/doc_site/build'
22+
]
23+
};
24+
25+
function spawn(task) {
26+
return new Promise((resolve, reject) => {
27+
grunt.util.spawn(task, (error, result, code) => {
28+
grunt.log.writeln();
29+
30+
if (error || code !== 0) {
31+
const message = result.stderr || result.stdout;
32+
33+
grunt.log.error(message);
34+
35+
reject();
36+
}
37+
38+
grunt.log.writeln(result);
39+
40+
resolve();
41+
});
42+
43+
});
44+
}
45+
46+
grunt.registerTask('uiFramework:start', function () {
47+
const done = this.async();
48+
const commands = [watcherCmd, serverCmd].map((cmd) => {
49+
return Object.assign({ opts: { stdio: 'inherit' } }, cmd);
50+
});
51+
52+
Promise.all(commands.map(spawn)).then(done);
53+
});
54+
};
File renamed without changes.

0 commit comments

Comments
 (0)