Skip to content

Commit

Permalink
Merge pull request #183 from aktos-io/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
ceremcem authored May 25, 2019
2 parents f31743e + 294aadc commit 2253a15
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 37 deletions.
1 change: 1 addition & 0 deletions components/ace-editor/index.ls
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ require 'brace/mode/javascript'
require 'brace/mode/livescript'
require 'brace/theme/monokai'
require 'brace/theme/xcode'
require 'brace/ext/searchbox'

Ractive.components['ace-editorASYNC'] = Ractive.extend do
template: RACTIVE_PREPARSE('index.pug')
Expand Down
5 changes: 4 additions & 1 deletion components/icon/index.pug
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
i.icon(class="{{add}}")
+if('@this.partials.content')
+space
| {{yield}}
| {{yield}}
+elif('svg')
i.icon(class="{{class}}")
img(src="{{svg}}")
+else
i.icon(class="{{class}} {{size}}" on-click="click")
+if('@this.partials.content')
Expand Down
5 changes: 5 additions & 0 deletions doc/svg-as-icons.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Using SVG images as Icons

```pug
icon(svg="path/to/image.svg")
```
46 changes: 18 additions & 28 deletions gulpfile.ls
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,11 @@ my-uglify = (x) ->
.on \error, gutil.log

my-buble = (input) ->
es5 = buble.transform input
es5 = buble.transform input, {
transforms: {
classes: true
}
}
es5.code

browserify-cache = {}
Expand Down Expand Up @@ -281,21 +285,6 @@ get-bundler = (entry) ->
catch
console.log "Livescript compile error: ", e
@emit 'error', e

..transform (file) ->
unless optimize-for-production
return through!

through (buf, enc, next) !->
content = buf.to-string \utf8
try
es5 = my-buble content
@push es5
next!
catch
console.log "This is buble error: ", e
@emit 'error', e

..transform ractive-preparserify
..transform browserify-optimize-js

Expand All @@ -318,12 +307,15 @@ gulp.task \browserify, ->

.pipe source filebase
.pipe buffer!
#.pipe sourcemaps.init {+load-maps, +large-files}

.pipe if-else optimize-for-production, my-uglify

#.pipe rename basename: 'app'
#.pipe sourcemaps.write '.'
# ES-5 Transpilation MUST BE the last step
.pipe through.obj (file, enc, cb) ->
contents = file.contents.to-string!
es5 = my-buble contents
file.contents = new Buffer es5
cb null, file

.pipe gulp.dest "#{paths.build-folder}/#{webapp}/js"
.pipe tap (file) ->
#console.log "browserify cache: ", pack keys browserify-cache
Expand All @@ -343,23 +335,21 @@ gulp.task \browserify, ->
compile-js = (watchlist, output) ->
gulp.src watchlist
.pipe cat output
.pipe if-else optimize-for-production, my-uglify

.pipe through.obj (file, enc, cb) ->
contents = file.contents.to-string!
es5 = my-buble contents
file.contents = new Buffer es5
optimized = optimize-js contents
file.contents = new Buffer optimized
cb null, file
.pipe if-else optimize-for-production, my-uglify

# ES-5 Transpilation MUST BE the last step
.pipe through.obj (file, enc, cb) ->
contents = file.contents.to-string!
optimized = optimize-js contents
file.contents = new Buffer optimized
es5 = my-buble contents
file.contents = new Buffer es5
cb null, file

.pipe gulp.dest "#{paths.client-public}/js"


compile-css = (watchlist, output) ->
gulp.src watchlist
.pipe cssimport {includePaths: ['node_modules', '../node_modules']}
Expand Down
2 changes: 1 addition & 1 deletion lib/aea/copy-to-clipboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ function copyToClipboard(text) {
}
}

module.exports = {copyToClipboard}
module.exports = {copyToClipboard: copyToClipboard}
2 changes: 1 addition & 1 deletion lib/aea/file-download.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ var createDownload = function(filename,text){
document.body.removeChild(link);
}

module.exports = {createDownload}
module.exports = {createDownload: createDownload}
9 changes: 3 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,12 @@
"homepage": "https://github.com/aktos-io/scada.js",
"dependencies": {
"brace": "^0.11.1",
"bufferutil": "^3.0.2",
"c3": "^0.4.18",
"colors": "^1.1.2",
"cropperjs": "^1.1.3",
"cson-parser": "^4.0.0",
"csv-parse": "^1.3.3",
"express": "^4.16.2",
"gulp-terser": "^1.1.5",
"gulp-util": "^3.0.8",
"jquery": "^3.2.1",
"jquery-mousewheel": "^3.1.13",
"jstransformer-markdown-it": "^2.1.0",
Expand All @@ -44,7 +41,6 @@
"sifter": "^0.5.3",
"superagent": "^3.8.0",
"superagent-jsonp": "^0.2.1",
"utf-8-validate": "^3.0.3",
"uuid4": "^1.0.0"
},
"devDependencies": {
Expand All @@ -68,15 +64,16 @@
"gulp-sourcemaps": "^1.9.1",
"gulp-tap": "^0.1.3",
"gulp-watch": "^4.3.8",
"gulp-terser": "^1.1.5",
"gulp-util": "^3.0.8",
"node-notifier": "^4.6.1",
"optimize-js": "^1.0.2",
"pug": "^2.0.3",
"through2": "^2.0.3",
"touch": "^1.0.0",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.1.0",
"watchify": "^3.7.0",
"yargs": "^4.8.1"
"watchify": "^3.7.0"
},
"directories": {
"doc": "doc"
Expand Down

0 comments on commit 2253a15

Please sign in to comment.