Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
dfd5413b
Commit
dfd5413b
authored
Dec 21, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tech(systemjs): worked on making optimized builds work with systemjs builder
parent
93e424de
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
55 additions
and
36 deletions
+55
-36
public/app/app.js
+2
-1
public/app/app2.ts
+0
-4
public/app/boot.js
+11
-0
public/app/grafana.ts
+2
-1
public/app/systemjs.conf.js
+1
-1
public/views/index.html
+2
-13
tasks/build_task.js
+6
-7
tasks/options/concat.js
+16
-4
tasks/options/cssmin.js
+1
-1
tasks/options/ngtemplates.js
+1
-1
tasks/systemjs_task.js
+13
-3
No files found.
public/app/app.js
View file @
dfd5413b
define
([
'./
app2
'
'./
grafana
'
],
function
(
app
)
{
'use strict'
;
// backward compatability hack;
console
.
log
(
app
);
return
app
.
default
;
});
public/app/app2.ts
deleted
100644 → 0
View file @
93e424de
import
{
GrafanaApp
}
from
'app/grafana_app'
;
export
default
new
GrafanaApp
();
public/app/boot.js
0 → 100644
View file @
dfd5413b
(
function
bootGrafana
()
{
'use strict'
;
System
.
import
(
'app/app'
).
then
(
function
(
app
)
{
console
.
log
(
app
);
app
.
init
();
}).
catch
(
function
(
err
)
{
console
.
log
(
'Loading app module failed: '
,
err
);
});
})();
public/app/grafana
_app
.ts
→
public/app/grafana.ts
View file @
dfd5413b
...
...
@@ -93,5 +93,6 @@ export class GrafanaApp {
console
.
log
(
'Application boot failed:'
,
err
);
});
}
}
}
export
default
new
GrafanaApp
();
public/app/systemjs.conf.js
View file @
dfd5413b
...
...
@@ -41,7 +41,7 @@ System.config({
meta
:
{
'vendor/angular/angular.js'
:
{
format
:
'
amd
'
,
format
:
'
global
'
,
deps
:
[
'jquery'
],
exports
:
'angular'
,
},
...
...
public/views/index.html
View file @
dfd5413b
...
...
@@ -57,25 +57,14 @@
};
</script>
<!-- build:js [[.AppSubUrl]]/public/app/
app
.js -->
<!-- build:js [[.AppSubUrl]]/public/app/
boot
.js -->
<script
src=
"[[.AppSubUrl]]/public/vendor/npm/es6-shim/es6-shim.js"
></script>
<script
src=
"[[.AppSubUrl]]/public/vendor/npm/es6-promise/dist/es6-promise.js"
></script>
<script
src=
"[[.AppSubUrl]]/public/vendor/npm/systemjs/dist/system.src.js"
></script>
<script
src=
"[[.AppSubUrl]]/public/vendor/npm/rxjs/bundles/Rx.js"
></script>
<script
src=
"[[.AppSubUrl]]/public/vendor/npm/angular2/bundles/angular2-polyfills.js"
></script>
<script
src=
"[[.AppSubUrl]]/public/vendor/npm/angular2/bundles/angular2.dev.js"
></script>
<script
src=
"[[.AppSubUrl]]/public/app/systemjs.conf.js"
></script>
<script
src=
"[[.AppSubUrl]]/public/app/boot.js"
></script>
<!-- endbuild -->
<script>
System
.
import
(
'app/app'
).
then
(
function
(
app
)
{
console
.
log
(
app
)
app
.
init
();
}).
catch
(
function
(
err
)
{
console
.
log
(
'Loading app module failed: '
,
err
);
});
</script>
[[if .GoogleAnalyticsId]]
<script>
(
function
(
i
,
s
,
o
,
g
,
r
,
a
,
m
){
i
[
'GoogleAnalyticsObject'
]
=
r
;
i
[
r
]
=
i
[
r
]
||
function
(){
...
...
tasks/build_task.js
View file @
dfd5413b
...
...
@@ -10,20 +10,19 @@ module.exports = function(grunt) {
'clean:release'
,
'copy:public_to_gen'
,
'typescript:build'
,
'karma:test'
,
//
'karma:test',
'phantomjs'
,
'css'
,
//
'htmlmin:build',
'htmlmin:build'
,
'ngtemplates'
,
'cssmin:build'
,
'ngAnnotate:build'
,
'
require
js:build'
,
'
system
js:build'
,
'concat:js'
,
'clean:temp'
,
'filerev'
,
'remapFilerev'
,
// 'filerev',
// 'remapFilerev',
'usemin'
,
'uglify:genDir'
//
'uglify:genDir'
]);
// task to add [[.AppSubUrl]] to reved path
...
...
tasks/options/concat.js
View file @
dfd5413b
...
...
@@ -13,6 +13,7 @@ module.exports = function(config) {
],
dest
:
'<%= genDir %>/css/grafana.dark.min.css'
},
cssLight
:
{
src
:
[
'<%= genDir %>/vendor/css/normalize.min.css'
,
...
...
@@ -24,13 +25,24 @@ module.exports = function(config) {
],
dest
:
'<%= genDir %>/css/grafana.light.min.css'
},
js
:
{
src
:
[
'<%= tempDir %>/vendor/requirejs/require.js'
,
'<%= tempDir %>/app/require_config.js'
,
'<%= tempDir %>/app/app.js'
,
'<%= genDir %>/vendor/npm/es6-shim/es6-shim.js'
,
'<%= genDir %>/vendor/npm/es6-promise/es6-promise.js'
,
'<%= genDir %>/vendor/npm/systemjs/dist/system.js'
,
'<%= genDir %>/app/systemjs.conf.js'
,
'<%= genDir %>/app/boot.js'
,
],
dest
:
'<%= genDir %>/app/boot.js'
},
bundle_and_boot
:
{
src
:
[
'<%= genDir %>/app/app_bundle.js'
,
'<%= genDir %>/app/boot.js'
,
],
dest
:
'<%= genDir %>/app/
app
.js'
dest
:
'<%= genDir %>/app/
boot
.js'
},
};
};
tasks/options/cssmin.js
View file @
dfd5413b
...
...
@@ -3,7 +3,7 @@ module.exports = function(config) {
build
:
{
expand
:
true
,
cwd
:
'<%= genDir %>'
,
src
:
'**/*.css'
,
src
:
[
'css/*.css'
,
'vendor/css/*.css'
]
,
dest
:
'<%= genDir %>'
}
};
...
...
tasks/options/ngtemplates.js
View file @
dfd5413b
...
...
@@ -7,7 +7,7 @@ module.exports = function(config) {
options
:
{
bootstrap
:
function
(
module
,
script
)
{
return
"define('app/core/partials', ['app/core/core_module'], function(coreModule) {
\
n"
+
"coreModule.run(['$templateCache', function($templateCache) {
\
n"
+
"coreModule.
default.
run(['$templateCache', function($templateCache) {
\
n"
+
script
+
'
\
n}]);'
+
'
\
n});'
;
...
...
tasks/systemjs_task.js
View file @
dfd5413b
...
...
@@ -2,7 +2,6 @@ module.exports = function(grunt) {
"use strict"
;
grunt
.
registerTask
(
'systemjs:build'
,
function
()
{
var
path
=
require
(
"path"
);
var
Builder
=
require
(
'systemjs-builder'
);
var
done
=
this
.
async
();
...
...
@@ -11,11 +10,23 @@ module.exports = function(grunt) {
var
builder
=
new
Builder
(
'public_gen'
,
'public_gen/app/systemjs.conf.js'
);
console
.
log
(
'Starting systemjs-builder'
);
var
modules
=
[
'app/app'
,
'app/features/all'
,
'app/plugins/panels/**/*'
,
'app/plugins/datasource/graphite/**/*'
,
'app/plugins/datasource/influxdb/**/*'
,
'app/plugins/datasource/elasticsearch/**/*'
,
];
var
expression
=
modules
.
join
(
' + '
);
builder
.
bundle
(
'app/app + app/features/all'
,
'public_gen/app/app
.js'
)
.
bundle
(
expression
,
'public_gen/app/app_bundle
.js'
)
.
then
(
function
()
{
console
.
log
(
'Build complete'
);
done
();
grunt
.
task
.
run
(
'concat:bundle_and_boot'
);
})
.
catch
(
function
(
err
)
{
console
.
log
(
'Build error'
);
...
...
@@ -23,5 +34,4 @@ module.exports = function(grunt) {
done
();
});
});
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment