From 6593fff8c0190c81d3b687ac7d04ad2c1a667911 Mon Sep 17 00:00:00 2001 From: Sergey Goliney Date: Sun, 19 Feb 2017 13:22:48 +0200 Subject: [PATCH] fix(sass): Move node-sass dep into dev dep Closes #5 --- lib/coderoom.js | 12 ------------ lib/templates/default/static/css/base.css | 1 - lib/templates/default/static/css/base.css.map | 1 - package.json | 5 +++-- 4 files changed, 3 insertions(+), 16 deletions(-) delete mode 100644 lib/templates/default/static/css/base.css delete mode 100644 lib/templates/default/static/css/base.css.map diff --git a/lib/coderoom.js b/lib/coderoom.js index a4c357d..c3b6739 100644 --- a/lib/coderoom.js +++ b/lib/coderoom.js @@ -7,7 +7,6 @@ const _ = require('lodash'); const handlebars = require('handlebars'); const commonPathPrefix = require('common-path-prefix'); const normalizePath = require('normalize-path'); -const sass = require('node-sass'); const settings = require('./settings'); const Room = require('./room.class.js'); @@ -27,7 +26,6 @@ module.exports = { root = planRooms(source); - compileSCSS(); copyStatic(); copyMedia(); @@ -68,16 +66,6 @@ function planRooms(sourceDir, parent) { return room; } -function compileSCSS() { - let css_dir = path.resolve(__dirname, settings.paths.static, 'css'); - let result = sass.renderSync({ - file: path.resolve(__dirname, settings.sass_entry), - outputStyle: 'compressed', - sourceMap: true - }); - fs.writeFileSync(path.join(css_dir, 'base.css'), result.css); -} - function copyStatic() { fs.copySync( path.resolve(__dirname, settings.paths.static), diff --git a/lib/templates/default/static/css/base.css b/lib/templates/default/static/css/base.css deleted file mode 100644 index dd65187..0000000 --- a/lib/templates/default/static/css/base.css +++ /dev/null @@ -1 +0,0 @@ -html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}table{border-collapse:collapse;border-spacing:0}html,body{font-family:Arial,Helvetica,sans-serif;font-size:14px}.hidden{display:none}.invisible{visibility:hidden}html,body{margin:0;padding:0;width:100%;height:100%;min-width:1050px;display:flex}#sidebar{position:relative;width:220px;z-index:100}#main{position:relative;flex:1;display:flex;flex-direction:column}#main #operations{position:relative;height:25px;z-index:100}#main #content{flex:1;display:flex}#main #content #editor{flex:1;position:relative;z-index:80}#main #content #iframe{position:relative;width:50%;z-index:80}#main #content #resize-handle{position:relative;width:1px;z-index:90}#backdrop{position:absolute;z-index:9999}#landing{box-sizing:border-box;padding:100px;background-color:#fff;color:#dcdcdc;font-size:2em}#sidebar{box-sizing:border-box;background-color:#1b1c1d;color:rgba(255,255,255,0.9);font-size:.87em;padding-top:15px;overflow:auto}#sidebar header{margin-bottom:15px;margin-left:15px;margin-right:15px;font-size:1.2em}#sidebar header a{color:rgba(255,255,255,0.9);text-decoration:none}#sidebar #menu a,#sidebar #menu a:visited,#sidebar #menu a:hover{display:block;color:rgba(255,255,255,0.5);text-decoration:none}#sidebar #menu a:hover{color:rgba(255,255,255,0.9)}#sidebar #menu .dir-name,#sidebar #menu .link{padding:4px 15px 4px 0px}#sidebar #menu .dir-name.active,#sidebar #menu .link.active{color:#6ce0e0}#sidebar #menu .dir-name{font-weight:700}#sidebar #menu li{padding-left:15px}#sidebar #menu>li{padding-top:7px;padding-bottom:7px;border-bottom:1px solid rgba(255,255,255,0.08)}#sidebar #menu>li:first-child{border-top:1px solid rgba(255,255,255,0.08)}#editor{position:relative}#iframe{position:relative;box-sizing:border-box}#iframe iframe{position:absolute;display:block;width:100%;height:100%}#operations{background-color:#1b1c1d;color:rgba(255,255,255,0.5);line-height:25px;font-size:0.9em}#operations .dropdown{float:left;position:relative}#operations .dropdown .head{padding-left:20px;padding-right:20px;color:rgba(255,255,255,0.9);cursor:default}#operations .dropdown .head .fa{font-size:0.9em;padding-left:7px}#operations .dropdown .panel{display:none;position:absolute;background-color:#1b1c1d}#operations .dropdown .panel a{display:block;clear:both;padding:2px 20px 2px 20px;color:rgba(255,255,255,0.5);white-space:nowrap;text-decoration:none}#operations .dropdown .panel a:hover{color:rgba(255,255,255,0.9)}#operations .dropdown .panel a.active{color:#6ce0e0}#operations .dropdown:hover .head{text-decoration:underline}#operations .dropdown:hover .panel{display:block}#operations .dropdown.right .panel{right:0}#operations .dropdown.disabled .head{color:rgba(255,255,255,0.5);text-decoration:none}#operations .dropdown.disabled .panel{display:none !important}#operations .dropdown hr{height:0;border:0;border-bottom:1px solid rgba(255,255,255,0.08)}#operations .operation{float:left;color:rgba(255,255,255,0.5);padding:0px 20px}#operations .operation:hover{color:rgba(255,255,255,0.9)}#operations .right{float:right;text-align:right}#resize-handle{background-color:#dcdcdc;cursor:ew-resize}#resize-handle #knob{position:absolute;width:7px;left:-3px;top:0;bottom:0}#backdrop{top:0;bottom:0;left:0;right:0;cursor:ew-resize} diff --git a/lib/templates/default/static/css/base.css.map b/lib/templates/default/static/css/base.css.map deleted file mode 100644 index dd65187..0000000 --- a/lib/templates/default/static/css/base.css.map +++ /dev/null @@ -1 +0,0 @@ -html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}table{border-collapse:collapse;border-spacing:0}html,body{font-family:Arial,Helvetica,sans-serif;font-size:14px}.hidden{display:none}.invisible{visibility:hidden}html,body{margin:0;padding:0;width:100%;height:100%;min-width:1050px;display:flex}#sidebar{position:relative;width:220px;z-index:100}#main{position:relative;flex:1;display:flex;flex-direction:column}#main #operations{position:relative;height:25px;z-index:100}#main #content{flex:1;display:flex}#main #content #editor{flex:1;position:relative;z-index:80}#main #content #iframe{position:relative;width:50%;z-index:80}#main #content #resize-handle{position:relative;width:1px;z-index:90}#backdrop{position:absolute;z-index:9999}#landing{box-sizing:border-box;padding:100px;background-color:#fff;color:#dcdcdc;font-size:2em}#sidebar{box-sizing:border-box;background-color:#1b1c1d;color:rgba(255,255,255,0.9);font-size:.87em;padding-top:15px;overflow:auto}#sidebar header{margin-bottom:15px;margin-left:15px;margin-right:15px;font-size:1.2em}#sidebar header a{color:rgba(255,255,255,0.9);text-decoration:none}#sidebar #menu a,#sidebar #menu a:visited,#sidebar #menu a:hover{display:block;color:rgba(255,255,255,0.5);text-decoration:none}#sidebar #menu a:hover{color:rgba(255,255,255,0.9)}#sidebar #menu .dir-name,#sidebar #menu .link{padding:4px 15px 4px 0px}#sidebar #menu .dir-name.active,#sidebar #menu .link.active{color:#6ce0e0}#sidebar #menu .dir-name{font-weight:700}#sidebar #menu li{padding-left:15px}#sidebar #menu>li{padding-top:7px;padding-bottom:7px;border-bottom:1px solid rgba(255,255,255,0.08)}#sidebar #menu>li:first-child{border-top:1px solid rgba(255,255,255,0.08)}#editor{position:relative}#iframe{position:relative;box-sizing:border-box}#iframe iframe{position:absolute;display:block;width:100%;height:100%}#operations{background-color:#1b1c1d;color:rgba(255,255,255,0.5);line-height:25px;font-size:0.9em}#operations .dropdown{float:left;position:relative}#operations .dropdown .head{padding-left:20px;padding-right:20px;color:rgba(255,255,255,0.9);cursor:default}#operations .dropdown .head .fa{font-size:0.9em;padding-left:7px}#operations .dropdown .panel{display:none;position:absolute;background-color:#1b1c1d}#operations .dropdown .panel a{display:block;clear:both;padding:2px 20px 2px 20px;color:rgba(255,255,255,0.5);white-space:nowrap;text-decoration:none}#operations .dropdown .panel a:hover{color:rgba(255,255,255,0.9)}#operations .dropdown .panel a.active{color:#6ce0e0}#operations .dropdown:hover .head{text-decoration:underline}#operations .dropdown:hover .panel{display:block}#operations .dropdown.right .panel{right:0}#operations .dropdown.disabled .head{color:rgba(255,255,255,0.5);text-decoration:none}#operations .dropdown.disabled .panel{display:none !important}#operations .dropdown hr{height:0;border:0;border-bottom:1px solid rgba(255,255,255,0.08)}#operations .operation{float:left;color:rgba(255,255,255,0.5);padding:0px 20px}#operations .operation:hover{color:rgba(255,255,255,0.9)}#operations .right{float:right;text-align:right}#resize-handle{background-color:#dcdcdc;cursor:ew-resize}#resize-handle #knob{position:absolute;width:7px;left:-3px;top:0;bottom:0}#backdrop{top:0;bottom:0;left:0;right:0;cursor:ew-resize} diff --git a/package.json b/package.json index 71a7fd0..2a8a635 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,6 @@ "glob": "7.0.5", "handlebars": "4.0.5", "lodash": "4.14.2", - "node-sass": "3.8.0", "normalize-path": "2.0.1" }, "devDependencies": { @@ -39,13 +38,15 @@ "istanbul": "^1.0.0-alpha", "mocha": "2.5.3", "mock-fs": "3.12.0", + "node-sass": "3.8.0", "semantic-release": "4.3.5" }, "files": [ "dist" ], "scripts": { - "build": "./node_modules/.bin/babel lib -d dist --copy-files", + "build": "./node_modules/.bin/babel lib -d dist --copy-files && npm run sass", + "sass": "./node_modules/.bin/node-sass lib/templates/default/scss/base.scss dist/templates/default/static/css/base.css --source-map=true", "commit": "git-cz", "test": "./node_modules/.bin/babel-node ./node_modules/istanbul/lib/cli.js cover ./node_modules/.bin/_mocha -- -R spec", "test:watch": "mocha ./test/*.spec.js -w --compilers js:babel-register",