mirror of
https://github.com/grafana/grafana.git
synced 2025-01-19 13:03:32 -06:00
tech(systemjs): starting work on systemjs bundling
This commit is contained in:
parent
df1e52e394
commit
545c39356a
14
package.json
14
package.json
@ -10,6 +10,9 @@
|
||||
"url": "http://github.com/torkelo/grafana.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"angular2": "2.0.0-beta.0",
|
||||
"es6-promise": "^3.0.2",
|
||||
"es6-shim": "^0.33.3",
|
||||
"expect.js": "~0.2.0",
|
||||
"glob": "~3.2.7",
|
||||
"grunt": "~0.4.0",
|
||||
@ -32,6 +35,7 @@
|
||||
"grunt-karma": "~0.8.3",
|
||||
"grunt-ng-annotate": "^0.9.2",
|
||||
"grunt-string-replace": "~0.2.4",
|
||||
"grunt-systemjs-builder": "^0.2.5",
|
||||
"grunt-tslint": "^2.5.0",
|
||||
"grunt-typescript": "^0.8.0",
|
||||
"grunt-usemin": "3.0.0",
|
||||
@ -48,15 +52,12 @@
|
||||
"karma-script-launcher": "0.1.0",
|
||||
"load-grunt-tasks": "0.2.0",
|
||||
"mocha": "2.2.4",
|
||||
"reflect-metadata": "0.1.2",
|
||||
"requirejs": "2.1.17",
|
||||
"rjs-build-analysis": "0.0.3",
|
||||
"tslint": "^2.5.0-beta",
|
||||
"angular2": "2.0.0-beta.0",
|
||||
"systemjs": "0.19.6",
|
||||
"es6-promise": "^3.0.2",
|
||||
"es6-shim": "^0.33.3",
|
||||
"reflect-metadata": "0.1.2",
|
||||
"rxjs": "5.0.0-beta.0",
|
||||
"systemjs": "0.19.6",
|
||||
"tslint": "^2.5.0-beta",
|
||||
"zone.js": "0.5.10"
|
||||
},
|
||||
"engines": {
|
||||
@ -74,6 +75,7 @@
|
||||
"karma-sinon": "^1.0.3",
|
||||
"lodash": "^2.4.1",
|
||||
"sinon": "1.16.1",
|
||||
"systemjs-builder": "^0.14.15",
|
||||
"typescript": "^1.7.5"
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,9 @@
|
||||
///<reference path="../../headers/common.d.ts" />
|
||||
|
||||
import moment = require('moment');
|
||||
import _ = require('lodash');
|
||||
import angular = require('angular');
|
||||
|
||||
import angular from 'angular';
|
||||
import moment from 'moment';
|
||||
import * as dateMath from './datemath';
|
||||
|
||||
var spans = {
|
||||
|
@ -1,11 +1,11 @@
|
||||
///<reference path="../../../headers/common.d.ts" />
|
||||
///<amd-dependency path="./input_date" name="inputDate" />
|
||||
|
||||
import angular = require('angular');
|
||||
import _ = require('lodash');
|
||||
import moment = require('moment');
|
||||
import kbn = require('app/core/utils/kbn');
|
||||
|
||||
import angular from 'angular';
|
||||
import moment from 'moment';
|
||||
import * as dateMath from 'app/core/utils/datemath';
|
||||
import * as rangeUtil from 'app/core/utils/rangeutil';
|
||||
|
||||
|
@ -17,6 +17,9 @@ import bootstrap = require('bootstrap');
|
||||
import kbn = require('app/core/utils/kbn');
|
||||
import config = require('app/core/config');
|
||||
|
||||
// import {Component} from 'vendor/npm/angular2/core';
|
||||
// console.log(Component);
|
||||
|
||||
export class GrafanaApp {
|
||||
registerFunctions: any;
|
||||
ngModuleDependencies: any[];
|
||||
|
@ -1,11 +1,11 @@
|
||||
///<reference path="../../../headers/common.d.ts" />
|
||||
|
||||
import angular = require('angular');
|
||||
import $ = require('jquery');
|
||||
import _ = require('lodash');
|
||||
import kbn = require('app/core/utils/kbn');
|
||||
import moment = require('moment');
|
||||
|
||||
import $ from 'jquery';
|
||||
import moment from 'moment';
|
||||
import angular from 'angular';
|
||||
import {transformers} from './transformers';
|
||||
|
||||
export class TablePanelEditorCtrl {
|
||||
|
@ -1,11 +1,11 @@
|
||||
///<reference path="../../../headers/common.d.ts" />
|
||||
|
||||
import angular = require('angular');
|
||||
import $ = require('jquery');
|
||||
import _ = require('lodash');
|
||||
import kbn = require('app/core/utils/kbn');
|
||||
import moment = require('moment');
|
||||
|
||||
import $ from 'jquery';
|
||||
import moment from 'moment';
|
||||
import angular from 'angular';
|
||||
import {TablePanelCtrl} from './controller';
|
||||
import {TableRenderer} from './renderer';
|
||||
import {tablePanelEditor} from './editor';
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
import _ = require('lodash');
|
||||
import kbn = require('app/core/utils/kbn');
|
||||
import moment = require('moment');
|
||||
import moment from 'moment';
|
||||
|
||||
export class TableRenderer {
|
||||
formaters: any[];
|
||||
|
@ -1,20 +1,21 @@
|
||||
System.config({
|
||||
defaultJSExtenions: true,
|
||||
baseURL: 'public',
|
||||
paths: {
|
||||
'moment': 'public/vendor/moment.js',
|
||||
"jquery": "public/vendor/jquery/dist/jquery.js",
|
||||
'lodash-src': 'public/vendor/lodash.js',
|
||||
"lodash": 'public/app/core/lodash_extended.js',
|
||||
"angular": "public/vendor/angular/angular.js",
|
||||
"bootstrap": "public/vendor/bootstrap/bootstrap.js",
|
||||
'angular-route': 'public/vendor/angular-route/angular-route.js',
|
||||
'angular-sanitize': 'public/vendor/angular-sanitize/angular-sanitize.js',
|
||||
"angular-ui": "public/vendor/angular-ui/ui-bootstrap-tpls.js",
|
||||
"angular-strap": "public/vendor/angular-other/angular-strap.js",
|
||||
"angular-dragdrop": "public/vendor/angular-native-dragdrop/draganddrop.js",
|
||||
"angular-bindonce": "public/vendor/angular-bindonce/bindonce.js",
|
||||
"spectrum": "public/vendor/spectrum.js",
|
||||
"bootstrap-tagsinput": "public/vendor/tagsinput/bootstrap-tagsinput.js",
|
||||
'moment': 'vendor/moment.js',
|
||||
"jquery": "vendor/jquery/dist/jquery.js",
|
||||
'lodash-src': 'vendor/lodash.js',
|
||||
"lodash": 'app/core/lodash_extended.js',
|
||||
"angular": "vendor/angular/angular.js",
|
||||
"bootstrap": "vendor/bootstrap/bootstrap.js",
|
||||
'angular-route': 'vendor/angular-route/angular-route.js',
|
||||
'angular-sanitize': 'vendor/angular-sanitize/angular-sanitize.js',
|
||||
"angular-ui": "vendor/angular-ui/ui-bootstrap-tpls.js",
|
||||
"angular-strap": "vendor/angular-other/angular-strap.js",
|
||||
"angular-dragdrop": "vendor/angular-native-dragdrop/draganddrop.js",
|
||||
"angular-bindonce": "vendor/angular-bindonce/bindonce.js",
|
||||
"spectrum": "vendor/spectrum.js",
|
||||
"bootstrap-tagsinput": "vendor/tagsinput/bootstrap-tagsinput.js",
|
||||
"jquery.flot": "vendor/flot/jquery.flot",
|
||||
"jquery.flot.pie": "vendor/flot/jquery.flot.pie",
|
||||
"jquery.flot.events": "vendor/flot/jquery.flot.events",
|
||||
@ -36,9 +37,6 @@ System.config({
|
||||
},
|
||||
|
||||
map: {
|
||||
'vendor/npm/angular2': 'angular2',
|
||||
app: 'public/app',
|
||||
vendor: 'public/vendor',
|
||||
},
|
||||
|
||||
meta: {
|
||||
|
1
public/vendor/moment.js
vendored
1
public/vendor/moment.js
vendored
@ -2788,7 +2788,6 @@
|
||||
globalScope.moment = moment;
|
||||
}
|
||||
}
|
||||
debugger;
|
||||
|
||||
// CommonJS module is defined
|
||||
if (hasModule) {
|
||||
|
@ -62,6 +62,8 @@
|
||||
<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>
|
||||
<!-- endbuild -->
|
||||
|
||||
|
27
tasks/systemjs_task.js
Normal file
27
tasks/systemjs_task.js
Normal file
@ -0,0 +1,27 @@
|
||||
module.exports = function(grunt) {
|
||||
"use strict";
|
||||
|
||||
grunt.registerTask('systemjs:build', function() {
|
||||
var path = require("path");
|
||||
var Builder = require('systemjs-builder');
|
||||
var done = this.async();
|
||||
|
||||
// optional constructor options
|
||||
// sets the baseURL and loads the configuration file
|
||||
var builder = new Builder('public_gen', 'public_gen/app/systemjs.conf.js');
|
||||
console.log('Starting systemjs-builder');
|
||||
|
||||
builder
|
||||
.bundle('app/app', 'public_gen/app/app.js')
|
||||
.then(function() {
|
||||
console.log('Build complete');
|
||||
done();
|
||||
})
|
||||
.catch(function(err) {
|
||||
console.log('Build error');
|
||||
console.log(err);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
};
|
Loading…
Reference in New Issue
Block a user