mirror of
https://github.com/grafana/grafana.git
synced 2025-08-01 11:32:36 +08:00
tech(systemjs): finally starting to get systemjs and typescript and runtime loading to work together in a manner that I want it to.. took forever
This commit is contained in:
@ -17,6 +17,9 @@ import kbn = require('app/core/utils/kbn');
|
|||||||
import angular = require('angular');
|
import angular = require('angular');
|
||||||
import config = require('app/core/config');
|
import config = require('app/core/config');
|
||||||
|
|
||||||
|
import mod from 'app/core/core_module';
|
||||||
|
console.log(mod);
|
||||||
|
|
||||||
class GrafanaApp {
|
class GrafanaApp {
|
||||||
registerFunctions: any;
|
registerFunctions: any;
|
||||||
ngModuleDependencies: any[];
|
ngModuleDependencies: any[];
|
||||||
@ -66,7 +69,8 @@ class GrafanaApp {
|
|||||||
this.useModule(angular.module(moduleName, []));
|
this.useModule(angular.module(moduleName, []));
|
||||||
});
|
});
|
||||||
|
|
||||||
var preBootRequires = [System.import('app/features/all')];
|
//var preBootRequires = [System.import('app/features/all')];
|
||||||
|
var preBootRequires = [];
|
||||||
var pluginModules = config.bootData.pluginModules || [];
|
var pluginModules = config.bootData.pluginModules || [];
|
||||||
|
|
||||||
// add plugin modules
|
// add plugin modules
|
||||||
@ -76,7 +80,7 @@ class GrafanaApp {
|
|||||||
|
|
||||||
Promise.all(preBootRequires).then(() => {
|
Promise.all(preBootRequires).then(() => {
|
||||||
// disable tool tip animation
|
// disable tool tip animation
|
||||||
$.fn.tooltip.defaults.animation = false;
|
//$.fn.tooltip.defaults.animation = false;
|
||||||
// bootstrap the app
|
// bootstrap the app
|
||||||
angular.bootstrap(document, this.ngModuleDependencies).invoke(() => {
|
angular.bootstrap(document, this.ngModuleDependencies).invoke(() => {
|
||||||
_.each(this.preBootModules, module => {
|
_.each(this.preBootModules, module => {
|
||||||
|
@ -28,8 +28,9 @@ import * as routes from 'app/core/routes/all';
|
|||||||
// export * from './directives/give_focus'
|
// export * from './directives/give_focus'
|
||||||
// export * from './filters/filters'
|
// export * from './filters/filters'
|
||||||
|
|
||||||
import {Component} from 'angular2/core';
|
import {Component} from 'vendor/jspm/angular2/core';
|
||||||
console.log(Component);
|
console.log(Component);
|
||||||
|
|
||||||
// console.log(Component);
|
// console.log(Component);
|
||||||
// // console.log(Component);
|
// // console.log(Component);
|
||||||
|
|
||||||
|
2
public/app/headers/common.d.ts
vendored
2
public/app/headers/common.d.ts
vendored
@ -1,5 +1,7 @@
|
|||||||
///<reference path="lodash/lodash.d.ts" />
|
///<reference path="lodash/lodash.d.ts" />
|
||||||
///<reference path="moment/moment.d.ts" />
|
///<reference path="moment/moment.d.ts" />
|
||||||
|
///<reference path="../../vendor/jspm/angular2/typings/tsd.d.ts" />
|
||||||
|
///<reference path="../../vendor/jspm/angular2/manual_typings/globals.d.ts" />
|
||||||
|
|
||||||
// dummy modules
|
// dummy modules
|
||||||
declare module 'app/core/config' {
|
declare module 'app/core/config' {
|
||||||
|
@ -1,23 +1,21 @@
|
|||||||
System.config({
|
System.config({
|
||||||
baseURL: "public",
|
defaultJSExtenions: true,
|
||||||
defaultJSExtensions: true,
|
|
||||||
transpiler: false,
|
|
||||||
paths: {
|
paths: {
|
||||||
moment: 'vendor/moment',
|
moment: 'public/vendor/moment.js',
|
||||||
"jquery": "vendor/jquery/dist/jquery.js",
|
"jquery": "public/vendor/jquery/dist/jquery.js",
|
||||||
'lodash-src': 'vendor/lodash',
|
'lodash-src': 'public/vendor/lodash.js',
|
||||||
"lodash": 'app/core/lodash_extended',
|
"lodash": 'public/app/core/lodash_extended.js',
|
||||||
"angular": "vendor/angular/angular.js",
|
"angular": "public/vendor/angular/angular.js",
|
||||||
"bootstrap": "vendor/bootstrap/bootstrap.js",
|
"bootstrap": "public/vendor/bootstrap/bootstrap.js",
|
||||||
'angular-route': 'vendor/angular-route/angular-route',
|
'angular-route': 'public/vendor/angular-route/angular-route.js',
|
||||||
'angular-sanitize': 'vendor/angular-sanitize/angular-sanitize',
|
'angular-sanitize': 'public/vendor/angular-sanitize/angular-sanitize.js',
|
||||||
"angular-ui": "vendor/angular-ui/ui-bootstrap-tpls.js",
|
"angular-ui": "public/vendor/angular-ui/ui-bootstrap-tpls.js",
|
||||||
"angular-strap": "vendor/angular-other/angular-strap.js",
|
"angular-strap": "public/vendor/angular-other/angular-strap.js",
|
||||||
"angular-dragdrop": "vendor/angular-native-dragdrop/draganddrop.js",
|
"angular-dragdrop": "public/vendor/angular-native-dragdrop/draganddrop.js",
|
||||||
"angular-bindonce": "vendor/angular-bindonce/bindonce.js",
|
"angular-bindonce": "public/vendor/angular-bindonce/bindonce.js",
|
||||||
"spectrum": "vendor/spectrum.js",
|
"spectrum": "public/vendor/spectrum.js",
|
||||||
"filesaver": "vendor/filesaver.js",
|
"filesaver": "public/vendor/filesaver.js",
|
||||||
"bootstrap-tagsinput": "vendor/tagsinput/bootstrap-tagsinput.js",
|
"bootstrap-tagsinput": "public/vendor/tagsinput/bootstrap-tagsinput.js",
|
||||||
"jquery.flot": "vendor/flot/jquery.flot",
|
"jquery.flot": "vendor/flot/jquery.flot",
|
||||||
"jquery.flot.pie": "vendor/flot/jquery.flot.pie",
|
"jquery.flot.pie": "vendor/flot/jquery.flot.pie",
|
||||||
"jquery.flot.events": "vendor/flot/jquery.flot.events",
|
"jquery.flot.events": "vendor/flot/jquery.flot.events",
|
||||||
@ -30,12 +28,15 @@ System.config({
|
|||||||
},
|
},
|
||||||
|
|
||||||
packages: {
|
packages: {
|
||||||
"js": {
|
app: {
|
||||||
"defaultExtension": "js"
|
defaultExtension: 'js',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
map: {
|
map: {
|
||||||
|
'vendor/jspm/angular2': 'angular2',
|
||||||
|
app: 'public/app',
|
||||||
|
vendor: 'public/vendor',
|
||||||
},
|
},
|
||||||
|
|
||||||
meta: {
|
meta: {
|
||||||
|
@ -11,7 +11,6 @@ module.exports = function() {
|
|||||||
rootDir: 'public/',
|
rootDir: 'public/',
|
||||||
sourceRoot: 'public/',
|
sourceRoot: 'public/',
|
||||||
declaration: true,
|
declaration: true,
|
||||||
moduleResolution: 2,
|
|
||||||
emitDecoratorMetadata: true,
|
emitDecoratorMetadata: true,
|
||||||
experimentalDecorators: true,
|
experimentalDecorators: true,
|
||||||
sourceMap: true,
|
sourceMap: true,
|
||||||
|
@ -1,16 +1,15 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"sourceMap": true,
|
"emitDecoratorMetadata": true,
|
||||||
"declaration": true,
|
"experimentalDecorators": true,
|
||||||
"outDir": "public_gen",
|
"sourceMap": true,
|
||||||
"noImplicitAny": false,
|
"declaration": true,
|
||||||
"target": "es5",
|
"outDir": "public_gen",
|
||||||
"rootDir": "public/",
|
"noImplicitAny": false,
|
||||||
"module": "system",
|
"target": "es5",
|
||||||
"moduleResolution": 2,
|
"rootDir": "public",
|
||||||
"noEmitOnError": true
|
"module": "system",
|
||||||
},
|
"noEmitOnError": true,
|
||||||
"files": [
|
"moduleResolution": "classic"
|
||||||
"public/app/core/core_module.ts"
|
}
|
||||||
]
|
}
|
||||||
}
|
|
||||||
|
Reference in New Issue
Block a user