mirror of
https://github.com/nasa/openmct.git
synced 2025-06-30 04:33:03 +00:00
Compare commits
9 Commits
code-cover
...
es6-1245
Author | SHA1 | Date | |
---|---|---|---|
04618a1a36 | |||
de2e546f18 | |||
c1630c339e | |||
e86a3de31a | |||
fdb269ef97 | |||
ce4b85be6e | |||
1215dd7b99 | |||
f942fd3cf3 | |||
d33e8d9be4 |
@ -3,6 +3,7 @@
|
|||||||
"browser": true,
|
"browser": true,
|
||||||
"curly": true,
|
"curly": true,
|
||||||
"eqeqeq": true,
|
"eqeqeq": true,
|
||||||
|
"esversion": 6,
|
||||||
"forin": true,
|
"forin": true,
|
||||||
"freeze": true,
|
"freeze": true,
|
||||||
"funcscope": false,
|
"funcscope": false,
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
"lodash": "3.10.1",
|
"lodash": "3.10.1",
|
||||||
"almond": "~0.3.2",
|
"almond": "~0.3.2",
|
||||||
"d3": "~4.1.0",
|
"d3": "~4.1.0",
|
||||||
"html2canvas": "^0.4.1"
|
"html2canvas": "^0.4.1",
|
||||||
|
"babel-polyfill": "^0.0.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,9 @@ var gulp = require('gulp'),
|
|||||||
specs: [ 'platform/**/*Spec.js', 'src/**/*Spec.js' ],
|
specs: [ 'platform/**/*Spec.js', 'src/**/*Spec.js' ],
|
||||||
},
|
},
|
||||||
options = {
|
options = {
|
||||||
|
babel: {
|
||||||
|
presets: ['es2015']
|
||||||
|
},
|
||||||
requirejsOptimize: {
|
requirejsOptimize: {
|
||||||
name: 'bower_components/almond/almond.js',
|
name: 'bower_components/almond/almond.js',
|
||||||
include: paths.main.replace('.js', ''),
|
include: paths.main.replace('.js', ''),
|
||||||
@ -70,10 +73,12 @@ var gulp = require('gulp'),
|
|||||||
};
|
};
|
||||||
|
|
||||||
gulp.task('scripts', function () {
|
gulp.task('scripts', function () {
|
||||||
|
var babel = require('gulp-babel');
|
||||||
var requirejsOptimize = require('gulp-requirejs-optimize');
|
var requirejsOptimize = require('gulp-requirejs-optimize');
|
||||||
var replace = require('gulp-replace-task');
|
var replace = require('gulp-replace-task');
|
||||||
return gulp.src(paths.main)
|
return gulp.src(paths.main)
|
||||||
.pipe(sourcemaps.init())
|
.pipe(sourcemaps.init())
|
||||||
|
.pipe(babel(options.babel))
|
||||||
.pipe(requirejsOptimize(options.requirejsOptimize))
|
.pipe(requirejsOptimize(options.requirejsOptimize))
|
||||||
.pipe(sourcemaps.write('.'))
|
.pipe(sourcemaps.write('.'))
|
||||||
.pipe(replace(options.replace))
|
.pipe(replace(options.replace))
|
||||||
|
@ -53,10 +53,14 @@ module.exports = function(config) {
|
|||||||
// Preprocess matching files before serving them to the browser.
|
// Preprocess matching files before serving them to the browser.
|
||||||
// https://npmjs.org/browse/keyword/karma-preprocessor
|
// https://npmjs.org/browse/keyword/karma-preprocessor
|
||||||
preprocessors: {
|
preprocessors: {
|
||||||
|
'openmct.js': ['babel'],
|
||||||
|
'test-main.js': ['babel'],
|
||||||
|
'src/**/*.js': ['babel'],
|
||||||
|
'platform/**/src/**/*.js': ['babel'],
|
||||||
|
'platform/**/test/**/*.js': ['babel'],
|
||||||
'src/**/src/**/!(*Spec).js': [ 'coverage' ],
|
'src/**/src/**/!(*Spec).js': [ 'coverage' ],
|
||||||
'platform/**/src/**/!(*Spec).js': [ 'coverage' ]
|
'platform/**/src/**/!(*Spec).js': [ 'coverage' ]
|
||||||
},
|
},
|
||||||
|
|
||||||
// Test results reporter to use
|
// Test results reporter to use
|
||||||
// Possible values: 'dots', 'progress'
|
// Possible values: 'dots', 'progress'
|
||||||
// Available reporters: https://npmjs.org/browse/keyword/karma-reporter
|
// Available reporters: https://npmjs.org/browse/keyword/karma-reporter
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
requirejs.config({
|
requirejs.config({
|
||||||
"paths": {
|
"paths": {
|
||||||
|
"browser-polyfill": "bower_components/babel-polyfill/browser-polyfill", // ES6 browser polyfill, must be included before any other loads
|
||||||
"legacyRegistry": "src/legacyRegistry",
|
"legacyRegistry": "src/legacyRegistry",
|
||||||
"angular": "bower_components/angular/angular.min",
|
"angular": "bower_components/angular/angular.min",
|
||||||
"angular-route": "bower_components/angular-route/angular-route.min",
|
"angular-route": "bower_components/angular-route/angular-route.min",
|
||||||
|
@ -8,10 +8,12 @@
|
|||||||
"request": "^2.69.0"
|
"request": "^2.69.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"babel-preset-es2015": "^6.18.0",
|
||||||
"bower": "^1.7.7",
|
"bower": "^1.7.7",
|
||||||
"git-rev-sync": "^1.4.0",
|
"git-rev-sync": "^1.4.0",
|
||||||
"glob": ">= 3.0.0",
|
"glob": ">= 3.0.0",
|
||||||
"gulp": "^3.9.0",
|
"gulp": "^3.9.0",
|
||||||
|
"gulp-babel": "^6.1.2",
|
||||||
"gulp-jscs": "^3.0.2",
|
"gulp-jscs": "^3.0.2",
|
||||||
"gulp-jshint": "^2.0.0",
|
"gulp-jshint": "^2.0.0",
|
||||||
"gulp-jshint-html-reporter": "^0.1.3",
|
"gulp-jshint-html-reporter": "^0.1.3",
|
||||||
@ -24,6 +26,7 @@
|
|||||||
"jsdoc": "^3.3.2",
|
"jsdoc": "^3.3.2",
|
||||||
"jshint": "^2.7.0",
|
"jshint": "^2.7.0",
|
||||||
"karma": "^0.13.3",
|
"karma": "^0.13.3",
|
||||||
|
"karma-babel-preprocessor": "^6.0.1",
|
||||||
"karma-chrome-launcher": "^0.1.8",
|
"karma-chrome-launcher": "^0.1.8",
|
||||||
"karma-cli": "0.0.4",
|
"karma-cli": "0.0.4",
|
||||||
"karma-coverage": "^0.5.3",
|
"karma-coverage": "^0.5.3",
|
||||||
|
@ -32,7 +32,7 @@ define(
|
|||||||
html2canvas,
|
html2canvas,
|
||||||
saveAs
|
saveAs
|
||||||
) {
|
) {
|
||||||
var self = this;
|
var self = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The export image service will export any HTML node to
|
* The export image service will export any HTML node to
|
||||||
@ -44,6 +44,7 @@ define(
|
|||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
function ExportImageService($q, $timeout, $log, EXPORT_IMAGE_TIMEOUT, injHtml2Canvas, injSaveAs, injFileReader) {
|
function ExportImageService($q, $timeout, $log, EXPORT_IMAGE_TIMEOUT, injHtml2Canvas, injSaveAs, injFileReader) {
|
||||||
|
self = this;
|
||||||
self.$q = $q;
|
self.$q = $q;
|
||||||
self.$timeout = $timeout;
|
self.$timeout = $timeout;
|
||||||
self.$log = $log;
|
self.$log = $log;
|
||||||
|
@ -20,55 +20,54 @@
|
|||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
define(function () {
|
define(() => class BundleRegistry {
|
||||||
|
constructor() {
|
||||||
function BundleRegistry() {
|
|
||||||
this.bundles = {};
|
this.bundles = {};
|
||||||
this.knownBundles = {};
|
this.knownBundles = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
BundleRegistry.prototype.register = function (path, definition) {
|
register(path, definition) {
|
||||||
if (this.knownBundles.hasOwnProperty(path)) {
|
if (this.knownBundles.hasOwnProperty(path)) {
|
||||||
throw new Error('Cannot register bundle with duplicate path', path);
|
throw new Error('Cannot register bundle with duplicate path', path);
|
||||||
}
|
}
|
||||||
this.knownBundles[path] = definition;
|
this.knownBundles[path] = definition;
|
||||||
};
|
}
|
||||||
|
|
||||||
BundleRegistry.prototype.enable = function (path) {
|
enable(path) {
|
||||||
if (!this.knownBundles[path]) {
|
if (!this.knownBundles[path]) {
|
||||||
throw new Error('Unknown bundle ' + path);
|
throw new Error('Unknown bundle ' + path);
|
||||||
}
|
}
|
||||||
this.bundles[path] = this.knownBundles[path];
|
this.bundles[path] = this.knownBundles[path];
|
||||||
};
|
}
|
||||||
|
|
||||||
BundleRegistry.prototype.disable = function (path) {
|
disable(path) {
|
||||||
if (!this.bundles[path]) {
|
if (!this.bundles[path]) {
|
||||||
throw new Error('Tried to disable inactive bundle ' + path);
|
throw new Error('Tried to disable inactive bundle ' + path);
|
||||||
}
|
}
|
||||||
delete this.bundles[path];
|
delete this.bundles[path];
|
||||||
};
|
}
|
||||||
|
|
||||||
BundleRegistry.prototype.contains = function (path) {
|
contains(path) {
|
||||||
return !!this.bundles[path];
|
return !!this.bundles[path];
|
||||||
};
|
}
|
||||||
|
|
||||||
BundleRegistry.prototype.get = function (path) {
|
get(path) {
|
||||||
return this.bundles[path];
|
return this.bundles[path];
|
||||||
};
|
}
|
||||||
|
|
||||||
BundleRegistry.prototype.list = function () {
|
list() {
|
||||||
return Object.keys(this.bundles);
|
return Object.keys(this.bundles);
|
||||||
};
|
}
|
||||||
|
|
||||||
BundleRegistry.prototype.remove = BundleRegistry.prototype.disable;
|
remove(path) {
|
||||||
|
this.disable(path);
|
||||||
|
}
|
||||||
|
|
||||||
BundleRegistry.prototype.delete = function (path) {
|
["delete"](path) {
|
||||||
if (!this.knownBundles[path]) {
|
if (!this.knownBundles[path]) {
|
||||||
throw new Error('Cannot remove Unknown Bundle ' + path);
|
throw new Error('Cannot remove Unknown Bundle ' + path);
|
||||||
}
|
}
|
||||||
delete this.bundles[path];
|
delete this.bundles[path];
|
||||||
delete this.knownBundles[path];
|
delete this.knownBundles[path];
|
||||||
};
|
}
|
||||||
|
|
||||||
return BundleRegistry;
|
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user