conjur-asset-ui 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -3
- data/Gemfile +1 -3
- data/README.md +0 -34
- data/Rakefile +1 -69
- data/conjur-asset-ui.gemspec +1 -1
- data/lib/conjur-asset-ui-version.rb +1 -1
- data/lib/conjur/command/ui.rb +1 -1
- data/lib/conjur/webserver/server.rb +8 -14
- data/public/_client_code.html +42 -0
- data/public/_client_libs.html +15 -2
- data/public/css/bootstrap.css +7 -0
- data/public/css/styles.less +4 -170
- data/public/fonts/glyphicons-halflings-regular.eot +0 -0
- data/public/fonts/glyphicons-halflings-regular.svg +229 -0
- data/public/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/public/fonts/glyphicons-halflings-regular.woff +0 -0
- data/public/index.html.erb +7 -5
- data/public/js/init.js +97 -183
- data/public/js/lib/JSXTransformer.js +10862 -0
- data/public/js/lib/async.js +958 -0
- data/public/js/lib/backbone.js +2 -0
- data/public/js/lib/bootstrap.js +6 -0
- data/public/js/lib/less.js +16 -0
- data/public/js/lib/moment.js +7768 -0
- data/public/js/lib/react-bootstrap.js +5346 -0
- data/public/js/lib/react-bootstrap.min.js +4 -0
- data/public/js/lib/sorted-set.no-require.js +28 -3
- data/public/js/lib/underscore-min.js +6 -0
- data/public/js/lib/underscore.string.min.js +1 -0
- data/public/js/main.js +57 -0
- data/public/js/models/groupRecord.js +11 -12
- data/public/js/models/hostRecord.js +7 -6
- data/public/js/models/layerRecord.js +11 -12
- data/public/js/models/namespace.js +0 -2
- data/public/js/models/policyList.js +1 -3
- data/public/js/models/policyRecord.js +7 -6
- data/public/js/models/record.js +23 -24
- data/public/js/models/resourceList.js +10 -28
- data/public/js/models/userList.js +2 -7
- data/public/js/models/userRecord.js +8 -7
- data/public/js/models/variableList.js +7 -18
- data/public/js/models/variableRecord.js +12 -13
- data/public/js/routers.js +26 -72
- data/public/js/views/annotations.js +27 -38
- data/public/js/views/audit.js +17 -23
- data/public/js/views/dashboard.js +58 -94
- data/public/js/views/generic.js +9 -16
- data/public/js/views/group.js +55 -94
- data/public/js/views/groups.js +7 -3
- data/public/js/views/host.js +44 -75
- data/public/js/views/hosts.js +6 -2
- data/public/js/views/layer.js +82 -127
- data/public/js/views/layers.js +6 -2
- data/public/js/views/mixins/search.js +5 -12
- data/public/js/views/mixins/tabs.js +55 -95
- data/public/js/views/navSearch.js +5 -16
- data/public/js/views/owned.js +8 -14
- data/public/js/views/permissions.js +178 -244
- data/public/js/views/policies.js +4 -2
- data/public/js/views/policy.js +38 -65
- data/public/js/views/resource.js +34 -49
- data/public/js/views/role.js +37 -52
- data/public/js/views/searchResults.js +138 -205
- data/public/js/views/time.js +13 -26
- data/public/js/views/user.js +55 -178
- data/public/js/views/users.js +7 -2
- data/public/js/views/variable.js +45 -226
- data/public/js/views/variables.js +8 -4
- metadata +19 -18
- data/.jshintrc +0 -41
- data/bower.json +0 -93
- data/features/navigation_bar.feature +0 -31
- data/features/step_definitions/custom_step.rb +0 -32
- data/features/support/env.rb +0 -38
- data/features/support/hooks.rb +0 -30
- data/features/support/world.rb +0 -17
- data/gulpfile.js +0 -140
- data/package.json +0 -47
- data/preprocessor.js +0 -7
- data/public/js/views/chart.js +0 -471
@@ -1,16 +1,20 @@
|
|
1
1
|
/** @jsx React.DOM */
|
2
|
-
/* global conjur, React */
|
3
2
|
|
4
3
|
(function(conjur, React) {
|
5
4
|
'use strict';
|
6
5
|
|
7
6
|
var GenericList = conjur.views.GenericList;
|
8
7
|
|
9
|
-
this.VariableBox = React.createClass({
|
8
|
+
var VariableBox = this.VariableBox = React.createClass({
|
9
|
+
// getInitialState: function() {
|
10
|
+
// return { currentNamespace: "", members: [] };
|
11
|
+
// },
|
10
12
|
render: function() {
|
13
|
+
// <NamespaceFilter currentNamespace={this.props.currentNamespace}
|
14
|
+
// namespaces={this.props.data.namespaces} />
|
11
15
|
return (
|
12
|
-
<div className="
|
13
|
-
<div className="
|
16
|
+
<div className="groupBox">
|
17
|
+
<div className="groupList">
|
14
18
|
<h2>Variables</h2>
|
15
19
|
<GenericList data={{kind: 'variables', members: this.props.data.members}} />
|
16
20
|
</div>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: conjur-asset-ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Mason
|
@@ -208,7 +208,6 @@ files:
|
|
208
208
|
- .git-hooks/pre_commit/ensure_livescript_compiled.rb
|
209
209
|
- .git-hooks/pre_commit/trailing_whitespace.rb
|
210
210
|
- .gitignore
|
211
|
-
- .jshintrc
|
212
211
|
- .overcommit.yml
|
213
212
|
- .project
|
214
213
|
- CHANGELOG.md
|
@@ -216,15 +215,8 @@ files:
|
|
216
215
|
- LICENSE.txt
|
217
216
|
- README.md
|
218
217
|
- Rakefile
|
219
|
-
- bower.json
|
220
218
|
- compile_ls
|
221
219
|
- conjur-asset-ui.gemspec
|
222
|
-
- features/navigation_bar.feature
|
223
|
-
- features/step_definitions/custom_step.rb
|
224
|
-
- features/support/env.rb
|
225
|
-
- features/support/hooks.rb
|
226
|
-
- features/support/world.rb
|
227
|
-
- gulpfile.js
|
228
220
|
- lib/conjur-asset-ui-version.rb
|
229
221
|
- lib/conjur-asset-ui.rb
|
230
222
|
- lib/conjur/command/ui.rb
|
@@ -236,10 +228,14 @@ files:
|
|
236
228
|
- lib/conjur/webserver/renderer.rb
|
237
229
|
- lib/conjur/webserver/server.rb
|
238
230
|
- livescript/views/audit.ls
|
239
|
-
-
|
240
|
-
- preprocessor.js
|
231
|
+
- public/_client_code.html
|
241
232
|
- public/_client_libs.html
|
233
|
+
- public/css/bootstrap.css
|
242
234
|
- public/css/styles.less
|
235
|
+
- public/fonts/glyphicons-halflings-regular.eot
|
236
|
+
- public/fonts/glyphicons-halflings-regular.svg
|
237
|
+
- public/fonts/glyphicons-halflings-regular.ttf
|
238
|
+
- public/fonts/glyphicons-halflings-regular.woff
|
243
239
|
- public/images/conjur-logo.svg
|
244
240
|
- public/images/icon-client-pc.svg
|
245
241
|
- public/images/icon-environment.png
|
@@ -250,11 +246,22 @@ files:
|
|
250
246
|
- public/images/icon-variable.png
|
251
247
|
- public/index.html.erb
|
252
248
|
- public/js/init.js
|
249
|
+
- public/js/lib/JSXTransformer.js
|
250
|
+
- public/js/lib/async.js
|
251
|
+
- public/js/lib/backbone.js
|
252
|
+
- public/js/lib/bootstrap.js
|
253
253
|
- public/js/lib/date.extensions.js
|
254
|
+
- public/js/lib/less.js
|
255
|
+
- public/js/lib/moment.js
|
254
256
|
- public/js/lib/pace.js
|
255
257
|
- public/js/lib/prelude-browser-min.js
|
258
|
+
- public/js/lib/react-bootstrap.js
|
259
|
+
- public/js/lib/react-bootstrap.min.js
|
256
260
|
- public/js/lib/sorted-set.no-require.js
|
257
261
|
- public/js/lib/sorted-set.no-require.js.txt
|
262
|
+
- public/js/lib/underscore-min.js
|
263
|
+
- public/js/lib/underscore.string.min.js
|
264
|
+
- public/js/main.js
|
258
265
|
- public/js/models/groupRecord.js
|
259
266
|
- public/js/models/hostRecord.js
|
260
267
|
- public/js/models/layerRecord.js
|
@@ -270,7 +277,6 @@ files:
|
|
270
277
|
- public/js/routers.js
|
271
278
|
- public/js/views/annotations.js
|
272
279
|
- public/js/views/audit.js
|
273
|
-
- public/js/views/chart.js
|
274
280
|
- public/js/views/dashboard.js
|
275
281
|
- public/js/views/generic.js
|
276
282
|
- public/js/views/group.js
|
@@ -350,16 +356,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
350
356
|
version: '0'
|
351
357
|
requirements: []
|
352
358
|
rubyforge_project:
|
353
|
-
rubygems_version: 2.
|
359
|
+
rubygems_version: 2.2.2
|
354
360
|
signing_key:
|
355
361
|
specification_version: 4
|
356
362
|
summary: Conjur User Interface Plugin
|
357
363
|
test_files:
|
358
|
-
- features/navigation_bar.feature
|
359
|
-
- features/step_definitions/custom_step.rb
|
360
|
-
- features/support/env.rb
|
361
|
-
- features/support/hooks.rb
|
362
|
-
- features/support/world.rb
|
363
364
|
- spec/javascripts/helpers/.gitkeep
|
364
365
|
- spec/javascripts/support/jasmine.yml
|
365
366
|
- spec/javascripts/support/jasmine_helper.rb
|
data/.jshintrc
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"bitwise": true,
|
3
|
-
"camelcase": true,
|
4
|
-
"curly": true,
|
5
|
-
"eqeqeq": true,
|
6
|
-
"es3": true,
|
7
|
-
"forin": true,
|
8
|
-
"freeze": true,
|
9
|
-
"immed": false,
|
10
|
-
"indent": 4,
|
11
|
-
"latedef": true,
|
12
|
-
"newcap": false,
|
13
|
-
"noarg": true,
|
14
|
-
"noempty": true,
|
15
|
-
"nonbsp": true,
|
16
|
-
"nonew": true,
|
17
|
-
"plusplus": false,
|
18
|
-
// "quotmark": "single",
|
19
|
-
"undef": true,
|
20
|
-
"unused": true,
|
21
|
-
"strict": true,
|
22
|
-
"maxparams": 8,
|
23
|
-
"maxdepth": 4,
|
24
|
-
"maxstatements": 20,
|
25
|
-
"maxcomplexity": 20,
|
26
|
-
"maxlen": 100,
|
27
|
-
"browser": true,
|
28
|
-
"couch": false,
|
29
|
-
"devel": true,
|
30
|
-
"dojo": false,
|
31
|
-
"jquery": true,
|
32
|
-
"mootools": false,
|
33
|
-
"node": false,
|
34
|
-
"nonstandard": true,
|
35
|
-
"phantom": false,
|
36
|
-
"prototypejs": false,
|
37
|
-
"rhino": false,
|
38
|
-
"worker": false,
|
39
|
-
"wsh": false,
|
40
|
-
"yui": false
|
41
|
-
}
|
data/bower.json
DELETED
@@ -1,93 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "conjur-asset-ui",
|
3
|
-
"private": true,
|
4
|
-
"version": "1.2.0",
|
5
|
-
"homepage": "https://github.com/conjurinc/conjur-asset-ui",
|
6
|
-
"authors": [
|
7
|
-
"Nikolai Sevostjanov <nikolai.sevostjanov@gmail.com>"
|
8
|
-
],
|
9
|
-
"license": "MIT",
|
10
|
-
"ignore": [
|
11
|
-
"**/.*",
|
12
|
-
"node_modules",
|
13
|
-
"bower_components",
|
14
|
-
"test",
|
15
|
-
"tests"
|
16
|
-
],
|
17
|
-
"dependencies": {
|
18
|
-
"jquery": "~2.1.1",
|
19
|
-
"async": "~0.9.0",
|
20
|
-
"backbone": "~1.1.2",
|
21
|
-
"moment": "~2.8.3",
|
22
|
-
"underscore": "~1.7.0",
|
23
|
-
"underscore.string": "~2.3.3",
|
24
|
-
"react": "~0.11.2",
|
25
|
-
"bootstrap": "~3.2.0",
|
26
|
-
"react-bootstrap": "~0.12.0",
|
27
|
-
"d3": "~3.4.13",
|
28
|
-
"underscore-deep-extend": "~0.0.5"
|
29
|
-
},
|
30
|
-
"overrides": {
|
31
|
-
"jquery": {
|
32
|
-
"main": [
|
33
|
-
"dist/jquery.min.js",
|
34
|
-
"dist/jquery.min.map"
|
35
|
-
]
|
36
|
-
},
|
37
|
-
"async": {
|
38
|
-
"main": [
|
39
|
-
"lib/async.js"
|
40
|
-
]
|
41
|
-
},
|
42
|
-
"backbone": {
|
43
|
-
"main": [
|
44
|
-
"backbone.js"
|
45
|
-
]
|
46
|
-
},
|
47
|
-
"moment": {
|
48
|
-
"main": [
|
49
|
-
"min/moment-with-locales.min.js"
|
50
|
-
]
|
51
|
-
},
|
52
|
-
"underscore": {
|
53
|
-
"main": [
|
54
|
-
"underscore-min.js"
|
55
|
-
]
|
56
|
-
},
|
57
|
-
"underscore.string": {
|
58
|
-
"main": [
|
59
|
-
"lib/underscore.string.js"
|
60
|
-
]
|
61
|
-
},
|
62
|
-
"react": {
|
63
|
-
"main": [
|
64
|
-
"react-with-addons.min.js"
|
65
|
-
]
|
66
|
-
},
|
67
|
-
"react-bootstrap": {
|
68
|
-
"main": [
|
69
|
-
"react-bootstrap.min.js"
|
70
|
-
]
|
71
|
-
},
|
72
|
-
"bootstrap": {
|
73
|
-
"main": [
|
74
|
-
"dist/js/bootstrap.min.js",
|
75
|
-
"dist/css/bootstrap.min.css",
|
76
|
-
"dist/fonts/*.eot",
|
77
|
-
"dist/fonts/*.svg",
|
78
|
-
"dist/fonts/*.ttf",
|
79
|
-
"dist/fonts/*.woff"
|
80
|
-
]
|
81
|
-
},
|
82
|
-
"d3": {
|
83
|
-
"main": [
|
84
|
-
"d3.min.js"
|
85
|
-
]
|
86
|
-
},
|
87
|
-
"underscore-deep-extend": {
|
88
|
-
"main": [
|
89
|
-
"index.js"
|
90
|
-
]
|
91
|
-
}
|
92
|
-
}
|
93
|
-
}
|
@@ -1,31 +0,0 @@
|
|
1
|
-
Feature: Navigation menu
|
2
|
-
Scenario: Open Dashboard page
|
3
|
-
Given I should logged in
|
4
|
-
When I click on the button Dashboard of the navigation menu
|
5
|
-
Then element having css "#content .dashboard" should be present
|
6
|
-
|
7
|
-
Scenario Outline: Open page using navigation bar
|
8
|
-
Given I should logged in
|
9
|
-
When I click on the button <btn> of the navigation menu
|
10
|
-
Then the <box> list should be present
|
11
|
-
And the <btn> button of the navigation menu should be active
|
12
|
-
And other button except the <btn> button of the navigation menu should be not active
|
13
|
-
|
14
|
-
Examples:
|
15
|
-
| btn | box |
|
16
|
-
| Users | User |
|
17
|
-
| Groups | Group |
|
18
|
-
| Hosts | Host |
|
19
|
-
| Layers | Layer |
|
20
|
-
| Variables | Variable |
|
21
|
-
| Policies | Policy |
|
22
|
-
|
23
|
-
Scenario: Open Audit page
|
24
|
-
Given I should logged in
|
25
|
-
When I click on the button Audit of the navigation menu
|
26
|
-
Then element having css "#content .audit h3" should be present
|
27
|
-
And the Audit button of the navigation menu should be active
|
28
|
-
And other button except the Audit button of the navigation menu should be not active
|
29
|
-
|
30
|
-
Scenario: Close the browser
|
31
|
-
Then I close browser
|
@@ -1,32 +0,0 @@
|
|
1
|
-
require 'selenium-cucumber'
|
2
|
-
|
3
|
-
Given(/^I should logged in$/) do
|
4
|
-
step %[I navigate to "#{login_url}"]
|
5
|
-
end
|
6
|
-
|
7
|
-
When(/^I click on the button (.*) of the navigation menu$/) do |btn|
|
8
|
-
id = navigation_btn_to_id(btn)
|
9
|
-
|
10
|
-
step %[I click on element having css ".navbar .dropdown a"]
|
11
|
-
step %[element having css "#{id} a" should be present]
|
12
|
-
step %[I click on element having css "#{id} a"]
|
13
|
-
end
|
14
|
-
|
15
|
-
Then(/^the (.*) button of the navigation menu should be active$/) do |btn|
|
16
|
-
id = navigation_btn_to_id(btn)
|
17
|
-
|
18
|
-
step %[I click on element having css ".navbar .dropdown a"]
|
19
|
-
step %[element having css "#{id}.active a" should be present]
|
20
|
-
end
|
21
|
-
|
22
|
-
Then(/^the (.*) list should be present$/) do |btn|
|
23
|
-
btn = btn.downcase
|
24
|
-
|
25
|
-
step %[element having css "#content .#{btn}Box .#{btn}List h2" should be present]
|
26
|
-
end
|
27
|
-
|
28
|
-
Then(/^other button except the (.*) button of the navigation menu should be not active$/) do |btn|
|
29
|
-
id = navigation_btn_to_id(btn)
|
30
|
-
|
31
|
-
WAIT.until { $driver.find_elements(:css => '.navbar li.active').count } == 1
|
32
|
-
end
|
data/features/support/env.rb
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'selenium-webdriver'
|
3
|
-
|
4
|
-
def print_error
|
5
|
-
puts "\nInappropraite browser \"#{ENV['BROWSER']}\""
|
6
|
-
puts "\nUsage : cucumber BROWSER=browser_name"
|
7
|
-
puts "\nbrowser_name can be one of following :"
|
8
|
-
puts "1.ie\n2.chrome\n3.ff\n4.safari\n5.opera"
|
9
|
-
puts "\nNow using default browser \"Firefox\""
|
10
|
-
end
|
11
|
-
|
12
|
-
case ENV['BROWSER']
|
13
|
-
when 'ie'
|
14
|
-
browser_type = :ie
|
15
|
-
when 'ff'
|
16
|
-
browser_type = :ff
|
17
|
-
when 'chrome'
|
18
|
-
browser_type = :chrome
|
19
|
-
when 'opera'
|
20
|
-
browser_type = :opera
|
21
|
-
when 'safari'
|
22
|
-
browser_type = :safari
|
23
|
-
else
|
24
|
-
if ENV['BROWSER']
|
25
|
-
print_error
|
26
|
-
end
|
27
|
-
|
28
|
-
browser_type = :ff
|
29
|
-
end
|
30
|
-
|
31
|
-
|
32
|
-
begin
|
33
|
-
$driver = Selenium::WebDriver.for(browser_type)
|
34
|
-
$driver.manage().window().maximize()
|
35
|
-
|
36
|
-
rescue Exception => e
|
37
|
-
puts e.message
|
38
|
-
end
|
data/features/support/hooks.rb
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
Before do
|
2
|
-
require 'background_process'
|
3
|
-
command = 'conjur ui'
|
4
|
-
|
5
|
-
ENV['DONT_OPEN_IN_BROWSER'] = 'true'
|
6
|
-
|
7
|
-
@process = PTYBackgroundProcess.run command
|
8
|
-
|
9
|
-
exit = false
|
10
|
-
|
11
|
-
until exit do
|
12
|
-
raw_line = @process.stdout.gets
|
13
|
-
|
14
|
-
unless (match = /^If your browser did not opened the UI automatically, point it to (.*)$/.match(raw_line)).nil?
|
15
|
-
@login_url = match[1]
|
16
|
-
exit = true
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
raise "Can't run #{command}" unless @process.running?
|
21
|
-
|
22
|
-
@process_thread = Thread.new do
|
23
|
-
# pass
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
After do
|
28
|
-
@process_thread.kill
|
29
|
-
@process.kill('TERM')
|
30
|
-
end
|
data/features/support/world.rb
DELETED
data/gulpfile.js
DELETED
@@ -1,140 +0,0 @@
|
|
1
|
-
var gulp = require('gulp'),
|
2
|
-
autoprefixer = require('gulp-autoprefixer'),
|
3
|
-
flatten = require('gulp-flatten'),
|
4
|
-
cache = require('gulp-cached'),
|
5
|
-
concat = require('gulp-concat'),
|
6
|
-
uglify = require('gulp-uglify'),
|
7
|
-
plumber = require('gulp-plumber'),
|
8
|
-
react = require('gulp-react'),
|
9
|
-
remember = require('gulp-remember'),
|
10
|
-
jshint = require('gulp-jshint'),
|
11
|
-
stylish = require('jshint-stylish'),
|
12
|
-
less = require('gulp-less'),
|
13
|
-
sourcemaps = require('gulp-sourcemaps'),
|
14
|
-
mainBowerFiles = require('main-bower-files'),
|
15
|
-
minifyCSS = require('gulp-minify-css'),
|
16
|
-
filter = require('gulp-filter'),
|
17
|
-
del = require('del');
|
18
|
-
|
19
|
-
var paths = {
|
20
|
-
bower: 'bower_components',
|
21
|
-
styles: 'public/css/*.less',
|
22
|
-
scripts: [
|
23
|
-
'public/js/init.js',
|
24
|
-
'public/js/models/record.js',
|
25
|
-
'public/js/models/*.js',
|
26
|
-
'public/js/views/owned.js',
|
27
|
-
'public/js/views/chart.js',
|
28
|
-
'public/js/views/resource.js',
|
29
|
-
'public/js/views/role.js',
|
30
|
-
'public/js/views/role.js',
|
31
|
-
'public/js/views/permissions.js',
|
32
|
-
'public/js/views/time.js',
|
33
|
-
'public/js/views/mixins/search.js',
|
34
|
-
'public/js/views/mixins/tabs.js',
|
35
|
-
'public/js/views/**/*.js',
|
36
|
-
'public/js/routers.js'
|
37
|
-
]
|
38
|
-
};
|
39
|
-
|
40
|
-
gulp.task('clean', function(cb) {
|
41
|
-
del(['public/build'], cb);
|
42
|
-
});
|
43
|
-
|
44
|
-
gulp.task('bower', function() {
|
45
|
-
var jsFilter = filter(function(file) {
|
46
|
-
return /\.js$/.test(file.path) && !/\.min\.js$/.test(file.path);
|
47
|
-
});
|
48
|
-
|
49
|
-
var jsMinFilter = filter(['*.min.js']),
|
50
|
-
cssFilter = filter(['*.min.css']),
|
51
|
-
fontFilter = filter(['*.eot', '*.woff', '*.svg', '*.ttf']);
|
52
|
-
|
53
|
-
return gulp
|
54
|
-
.src(mainBowerFiles())
|
55
|
-
.pipe(fontFilter)
|
56
|
-
.pipe(flatten())
|
57
|
-
.pipe(gulp.dest('public/build/fonts'))
|
58
|
-
.pipe(fontFilter.restore())
|
59
|
-
|
60
|
-
.pipe(jsFilter)
|
61
|
-
.pipe(concat('vendor.min.js'))
|
62
|
-
.pipe(uglify())
|
63
|
-
.pipe(jsFilter.restore())
|
64
|
-
|
65
|
-
.pipe(jsMinFilter)
|
66
|
-
.pipe(concat('vendor.min.js'))
|
67
|
-
.pipe(gulp.dest('public/build/js'))
|
68
|
-
.pipe(jsFilter.restore())
|
69
|
-
|
70
|
-
.pipe(cssFilter)
|
71
|
-
.pipe(concat('vendor.css'))
|
72
|
-
.pipe(gulp.dest('public/build/css'))
|
73
|
-
.pipe(cssFilter.restore());
|
74
|
-
});
|
75
|
-
|
76
|
-
gulp.task('scripts', function() {
|
77
|
-
return gulp.src(paths.scripts)
|
78
|
-
.pipe(cache('scripts'))
|
79
|
-
.pipe(plumber())
|
80
|
-
.pipe(react())
|
81
|
-
.pipe(plumber.stop())
|
82
|
-
.pipe(remember('scripts'))
|
83
|
-
.pipe(sourcemaps.init())
|
84
|
-
.pipe(concat('app.min.js'))
|
85
|
-
.pipe(uglify())
|
86
|
-
.pipe(sourcemaps.write('../maps'))
|
87
|
-
.pipe(gulp.dest('public/build/js'));
|
88
|
-
});
|
89
|
-
|
90
|
-
gulp.task('jshint', function() {
|
91
|
-
var stream = gulp.src(paths.scripts)
|
92
|
-
.pipe(cache('linting'))
|
93
|
-
.pipe(plumber())
|
94
|
-
.pipe(react())
|
95
|
-
.pipe(plumber.stop())
|
96
|
-
.pipe(jshint())
|
97
|
-
.pipe(jshint.reporter(stylish));
|
98
|
-
|
99
|
-
if (process.env.CI) {
|
100
|
-
stream = stream.pipe(jshint.reporter('fail'));
|
101
|
-
}
|
102
|
-
|
103
|
-
return stream;
|
104
|
-
});
|
105
|
-
|
106
|
-
gulp.task('styles', function() {
|
107
|
-
return gulp.src(paths.styles)
|
108
|
-
// https://github.com/plus3network/gulp-less/pull/85
|
109
|
-
// .pipe(sourcemaps.init())
|
110
|
-
.pipe(less())
|
111
|
-
.pipe(autoprefixer({
|
112
|
-
browsers: ['> 1%', 'last 2 versions', 'Firefox ESR'],
|
113
|
-
cascade: false
|
114
|
-
}))
|
115
|
-
.pipe(minifyCSS({keepBreaks: true}))
|
116
|
-
// .pipe(sourcemaps.write('../maps'))
|
117
|
-
.pipe(gulp.dest('public/build/css'));
|
118
|
-
});
|
119
|
-
|
120
|
-
gulp.task('watch', function(cb) {
|
121
|
-
gulp.watch(paths.bower, ['bower']);
|
122
|
-
gulp.watch(paths.styles, ['styles']);
|
123
|
-
|
124
|
-
var watcher = gulp.watch(paths.scripts, ['jshint', 'scripts']);
|
125
|
-
|
126
|
-
watcher.on('change', function (event) {
|
127
|
-
if (event.type === 'deleted') {
|
128
|
-
delete cache.caches['scripts'][event.path];
|
129
|
-
remember.forget('scripts', event.path);
|
130
|
-
}
|
131
|
-
});
|
132
|
-
|
133
|
-
cb();
|
134
|
-
|
135
|
-
console.log('Watching files for changes...');
|
136
|
-
});
|
137
|
-
|
138
|
-
gulp.task('build', ['bower', 'styles', 'jshint', 'scripts']);
|
139
|
-
|
140
|
-
gulp.task('default', ['build']);
|