sequenceserver 2.0.0.rc8 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of sequenceserver might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/bin/sequenceserver +22 -30
- data/lib/sequenceserver/api_errors.rb +5 -1
- data/lib/sequenceserver/blast/constants.rb +1 -1
- data/lib/sequenceserver/blast/hit.rb +5 -16
- data/lib/sequenceserver/blast/job.rb +9 -18
- data/lib/sequenceserver/blast/report.rb +5 -3
- data/lib/sequenceserver/config.rb +4 -1
- data/lib/sequenceserver/database.rb +69 -9
- data/lib/sequenceserver/job.rb +1 -1
- data/lib/sequenceserver/makeblastdb.rb +40 -45
- data/lib/sequenceserver/routes.rb +4 -0
- data/lib/sequenceserver/version.rb +1 -1
- data/lib/sequenceserver.rb +15 -11
- data/public/config.js +143 -142
- data/public/css/fonts.css +23 -22
- data/public/css/grapher.css +598 -594
- data/public/css/sequenceserver.css +86 -24
- data/public/css/sequenceserver.min.css +2 -2
- data/public/js/alignment_exporter.js +14 -14
- data/public/js/databases_tree.js +215 -0
- data/public/js/download_fasta.js +1 -1
- data/public/js/hit.js +6 -2
- data/public/js/hits_overview.js +1 -1
- data/public/js/length_distribution.js +5 -5
- data/public/js/query.js +4 -7
- data/public/js/report.js +12 -24
- data/public/js/search.js +21 -2
- data/public/js/sidebar.js +4 -4
- data/public/js/svgExporter.js +12 -12
- data/public/js/visualisation_helpers.js +4 -5
- data/public/sequenceserver-report.min.js +11 -11
- data/public/sequenceserver-search.min.js +15 -11
- data/public/vendor/github/vakata/jstree@3.3.8/LICENSE-MIT +22 -0
- data/public/vendor/github/vakata/jstree@3.3.8/README.md +663 -0
- data/public/vendor/github/vakata/jstree@3.3.8/bower.json +33 -0
- data/public/vendor/github/vakata/jstree@3.3.8/component.json +28 -0
- data/public/vendor/github/vakata/jstree@3.3.8/composer.json +46 -0
- data/public/vendor/github/vakata/jstree@3.3.8/demo/README.md +2 -0
- data/public/vendor/github/vakata/jstree@3.3.8/demo/basic/index.html +146 -0
- data/public/vendor/github/vakata/jstree@3.3.8/demo/basic/root.json +1 -0
- data/public/vendor/github/vakata/jstree@3.3.8/dist/jstree.js +8612 -0
- data/public/vendor/github/vakata/jstree@3.3.8/dist/jstree.min.js +6 -0
- data/public/vendor/github/vakata/jstree@3.3.8/dist/themes/default/32px.png +0 -0
- data/public/vendor/github/vakata/jstree@3.3.8/dist/themes/default/40px.png +0 -0
- data/public/vendor/github/vakata/jstree@3.3.8/dist/themes/default/style.css +1102 -0
- data/public/vendor/github/vakata/jstree@3.3.8/dist/themes/default/style.min.css +1 -0
- data/public/vendor/github/vakata/jstree@3.3.8/dist/themes/default/throbber.gif +0 -0
- data/public/vendor/github/vakata/jstree@3.3.8/dist/themes/default-dark/32px.png +0 -0
- data/public/vendor/github/vakata/jstree@3.3.8/dist/themes/default-dark/40px.png +0 -0
- data/public/vendor/github/vakata/jstree@3.3.8/dist/themes/default-dark/style.css +1146 -0
- data/public/vendor/github/vakata/jstree@3.3.8/dist/themes/default-dark/style.min.css +1 -0
- data/public/vendor/github/vakata/jstree@3.3.8/dist/themes/default-dark/throbber.gif +0 -0
- data/public/vendor/github/vakata/jstree@3.3.8/gruntfile.js +242 -0
- data/public/vendor/github/vakata/jstree@3.3.8/jstree.jquery.json +28 -0
- data/public/vendor/github/vakata/jstree@3.3.8/package.json +58 -0
- data/public/vendor/github/vakata/jstree@3.3.8/src/intro.js +14 -0
- data/public/vendor/github/vakata/jstree@3.3.8/src/jstree.changed.js +69 -0
- data/public/vendor/github/vakata/jstree@3.3.8/src/jstree.checkbox.js +976 -0
- data/public/vendor/github/vakata/jstree@3.3.8/src/jstree.conditionalselect.js +38 -0
- data/public/vendor/github/vakata/jstree@3.3.8/src/jstree.contextmenu.js +661 -0
- data/public/vendor/github/vakata/jstree@3.3.8/src/jstree.dnd.js +669 -0
- data/public/vendor/github/vakata/jstree@3.3.8/src/jstree.js +4931 -0
- data/public/vendor/github/vakata/jstree@3.3.8/src/jstree.massload.js +137 -0
- data/public/vendor/github/vakata/jstree@3.3.8/src/jstree.search.js +421 -0
- data/public/vendor/github/vakata/jstree@3.3.8/src/jstree.sort.js +74 -0
- data/public/vendor/github/vakata/jstree@3.3.8/src/jstree.state.js +138 -0
- data/public/vendor/github/vakata/jstree@3.3.8/src/jstree.types.js +372 -0
- data/public/vendor/github/vakata/jstree@3.3.8/src/jstree.unique.js +164 -0
- data/public/vendor/github/vakata/jstree@3.3.8/src/jstree.wholerow.js +122 -0
- data/public/vendor/github/vakata/jstree@3.3.8/src/misc.js +656 -0
- data/public/vendor/github/vakata/jstree@3.3.8/src/outro.js +1 -0
- data/public/vendor/github/vakata/jstree@3.3.8/src/sample.js +93 -0
- data/public/vendor/github/vakata/jstree@3.3.8/src/themes/base.less +93 -0
- data/public/vendor/github/vakata/jstree@3.3.8/src/themes/default/32px.png +0 -0
- data/public/vendor/github/vakata/jstree@3.3.8/src/themes/default/40px.png +0 -0
- data/public/vendor/github/vakata/jstree@3.3.8/src/themes/default/style.css +1102 -0
- data/public/vendor/github/vakata/jstree@3.3.8/src/themes/default/style.less +22 -0
- data/public/vendor/github/vakata/jstree@3.3.8/src/themes/default/throbber.gif +0 -0
- data/public/vendor/github/vakata/jstree@3.3.8/src/themes/default-dark/32px.png +0 -0
- data/public/vendor/github/vakata/jstree@3.3.8/src/themes/default-dark/40px.png +0 -0
- data/public/vendor/github/vakata/jstree@3.3.8/src/themes/default-dark/style.css +1146 -0
- data/public/vendor/github/vakata/jstree@3.3.8/src/themes/default-dark/style.less +50 -0
- data/public/vendor/github/vakata/jstree@3.3.8/src/themes/default-dark/throbber.gif +0 -0
- data/public/vendor/github/vakata/jstree@3.3.8/src/themes/main.less +77 -0
- data/public/vendor/github/vakata/jstree@3.3.8/src/themes/mixins.less +104 -0
- data/public/vendor/github/vakata/jstree@3.3.8/src/themes/responsive.less +67 -0
- data/public/vendor/github/vakata/jstree@3.3.8/src/vakata-jstree.js +38 -0
- data/public/vendor/github/vakata/jstree@3.3.8/test/unit/index.html +16 -0
- data/public/vendor/github/vakata/jstree@3.3.8/test/unit/libs/qunit.css +244 -0
- data/public/vendor/github/vakata/jstree@3.3.8/test/unit/libs/qunit.js +2212 -0
- data/public/vendor/github/vakata/jstree@3.3.8/test/unit/test.js +11 -0
- data/public/vendor/github/vakata/jstree@3.3.8/test/visual/desktop/index.html +44 -0
- data/public/vendor/github/vakata/jstree@3.3.8/test/visual/mobile/index.html +42 -0
- data/public/vendor/github/vakata/jstree@3.3.8/test/visual/screenshots/desktop/desktop.png +0 -0
- data/public/vendor/github/vakata/jstree@3.3.8/test/visual/screenshots/desktop/home.png +0 -0
- data/public/vendor/github/vakata/jstree@3.3.8/test/visual/screenshots/mobile/home.png +0 -0
- data/public/vendor/github/vakata/jstree@3.3.8/test/visual/screenshots/mobile/mobile.png +0 -0
- data/public/vendor/github/vakata/jstree@3.3.8.js +3 -0
- data/public/vendor/system-csp-production.js +3 -3
- data/public/vendor/system-csp-production.js.map +1 -1
- data/public/vendor/system-csp-production.src.js +146 -140
- data/public/vendor/system-polyfills.js.map +1 -1
- data/public/vendor/system-polyfills.src.js +1 -0
- data/public/vendor/system.js +3 -3
- data/public/vendor/system.js.map +1 -1
- data/public/vendor/system.src.js +4771 -2383
- data/views/_options.erb +21 -0
- data/views/layout.erb +17 -18
- metadata +102 -43
- data/bin/chromedriver +0 -0
- data/bin/geckodriver +0 -0
- data/public/shims/form-core.js +0 -3
- data/public/shims/form-validation.js +0 -3
- data/public/shims/plugins/jquery.ui.position.js +0 -13
- data/public/shims/styles/shim.css +0 -1
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* SystemJS v0.19.
|
2
|
+
* SystemJS v0.19.46
|
3
3
|
*/
|
4
4
|
(function() {
|
5
5
|
function bootstrap() {// from https://gist.github.com/Yaffle/1088850
|
@@ -7,7 +7,7 @@ function bootstrap() {// from https://gist.github.com/Yaffle/1088850
|
|
7
7
|
function URLPolyfill(url, baseURL) {
|
8
8
|
if (typeof url != 'string')
|
9
9
|
throw new TypeError('URL must be a string');
|
10
|
-
var m = String(url).replace(/^\s+|\s+$/g, "").match(/^([^:\/?#]+:)?(?:\/\/(?:([^:@\/?#]*)(?::([^:@\/?#]*))?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);
|
10
|
+
var m = String(url).replace(/^\s+|\s+$/g, "").replace(/\\/g, '/').match(/^([^:\/?#]+:)?(?:\/\/(?:([^:@\/?#]*)(?::([^:@\/?#]*))?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);
|
11
11
|
if (!m)
|
12
12
|
throw new RangeError('Invalid URL format');
|
13
13
|
var protocol = m[1] || "";
|
@@ -49,9 +49,8 @@ function URLPolyfill(url, baseURL) {
|
|
49
49
|
protocol = base.protocol;
|
50
50
|
}
|
51
51
|
|
52
|
-
// convert
|
53
|
-
|
54
|
-
pathname = pathname.replace(/\\/g, '/');
|
52
|
+
// convert URLs to use / always
|
53
|
+
pathname = pathname.replace(/\\/g, '/');
|
55
54
|
|
56
55
|
this.origin = host ? protocol + (protocol !== "" || host !== "" ? "//" : "") + host : "";
|
57
56
|
this.href = protocol + (protocol && host || protocol == "file:" ? "//" : "") + (username !== "" ? username + (password !== "" ? ":" + password : "") + "@" : "") + host + pathname + search + hash;
|
@@ -66,7 +65,8 @@ function URLPolyfill(url, baseURL) {
|
|
66
65
|
this.hash = hash;
|
67
66
|
}
|
68
67
|
global.URLPolyfill = URLPolyfill;
|
69
|
-
})(typeof self != 'undefined' ? self : global);
|
68
|
+
})(typeof self != 'undefined' ? self : global);
|
69
|
+
(function(__global) {
|
70
70
|
|
71
71
|
var isWorker = typeof window == 'undefined' && typeof self != 'undefined' && typeof importScripts != 'undefined';
|
72
72
|
var isBrowser = typeof window != 'undefined' && typeof document != 'undefined';
|
@@ -84,7 +84,7 @@ global.URLPolyfill = URLPolyfill;
|
|
84
84
|
}
|
85
85
|
return -1;
|
86
86
|
};
|
87
|
-
|
87
|
+
|
88
88
|
var defineProperty;
|
89
89
|
(function () {
|
90
90
|
try {
|
@@ -106,7 +106,7 @@ global.URLPolyfill = URLPolyfill;
|
|
106
106
|
function addToError(err, msg) {
|
107
107
|
// parse the stack removing loader code lines for simplification
|
108
108
|
if (!err.originalErr) {
|
109
|
-
var stack = (err.
|
109
|
+
var stack = ((err.message || err) + (err.stack ? '\n' + err.stack : '')).toString().split('\n');
|
110
110
|
var newStack = [];
|
111
111
|
for (var i = 0; i < stack.length; i++) {
|
112
112
|
if (typeof $__curScript == 'undefined' || stack[i].indexOf($__curScript.src) == -1)
|
@@ -121,14 +121,9 @@ global.URLPolyfill = URLPolyfill;
|
|
121
121
|
newMsg = newMsg.replace(isWindows ? /file:\/\/\//g : /file:\/\//g, '');
|
122
122
|
|
123
123
|
var newErr = errArgs ? new Error(newMsg, err.fileName, err.lineNumber) : new Error(newMsg);
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
newErr.stack = newMsg;
|
128
|
-
// Clearing the stack stops unnecessary loader lines showing
|
129
|
-
else
|
130
|
-
newErr.stack = null;
|
131
|
-
|
124
|
+
|
125
|
+
newErr.stack = newMsg;
|
126
|
+
|
132
127
|
// track the original error
|
133
128
|
newErr.originalErr = err.originalErr || err;
|
134
129
|
|
@@ -437,7 +432,7 @@ function logloads(loads) {
|
|
437
432
|
.then(function(instantiateResult) {
|
438
433
|
if (instantiateResult === undefined)
|
439
434
|
throw new TypeError('Declarative modules unsupported in the polyfill.');
|
440
|
-
|
435
|
+
|
441
436
|
if (typeof instantiateResult != 'object')
|
442
437
|
throw new TypeError('Invalid instantiate return value');
|
443
438
|
|
@@ -484,8 +479,6 @@ function logloads(loads) {
|
|
484
479
|
// console.log('LoadSucceeded ' + load.name);
|
485
480
|
// snapshot(loader);
|
486
481
|
|
487
|
-
console.assert(load.status == 'loading', 'is loading');
|
488
|
-
|
489
482
|
load.status = 'loaded';
|
490
483
|
|
491
484
|
var linkSets = load.linkSets.concat([]);
|
@@ -502,8 +495,6 @@ function logloads(loads) {
|
|
502
495
|
for (var i = 0, l = linkSets.length; i < l; i++) {
|
503
496
|
linkSetFailed(linkSets[i], load, exc);
|
504
497
|
}
|
505
|
-
|
506
|
-
console.assert(load.linkSets.length == 0, 'linkSets not removed');
|
507
498
|
});
|
508
499
|
}
|
509
500
|
|
@@ -556,7 +547,6 @@ function logloads(loads) {
|
|
556
547
|
proceedToFetch(loader, load, Promise.resolve(stepState.moduleAddress));
|
557
548
|
|
558
549
|
else {
|
559
|
-
console.assert(step == 'translate', 'translate step');
|
560
550
|
load.address = stepState.moduleAddress;
|
561
551
|
proceedToTranslate(loader, load, Promise.resolve(stepState.moduleSource));
|
562
552
|
}
|
@@ -644,9 +634,6 @@ function logloads(loads) {
|
|
644
634
|
function updateLinkSetOnLoad(linkSet, load) {
|
645
635
|
// console.log('update linkset on load ' + load.name);
|
646
636
|
// snapshot(linkSet.loader);
|
647
|
-
|
648
|
-
console.assert(load.status == 'loaded' || load.status == 'linked', 'loaded or linked');
|
649
|
-
|
650
637
|
linkSet.loadingCount--;
|
651
638
|
|
652
639
|
if (linkSet.loadingCount > 0)
|
@@ -679,8 +666,6 @@ function logloads(loads) {
|
|
679
666
|
if (abrupt)
|
680
667
|
return;
|
681
668
|
|
682
|
-
console.assert(linkSet.loads.length == 0, 'loads cleared');
|
683
|
-
|
684
669
|
linkSet.resolve(startingLoad);
|
685
670
|
}
|
686
671
|
|
@@ -689,7 +674,7 @@ function logloads(loads) {
|
|
689
674
|
var loader = linkSet.loader;
|
690
675
|
var requests;
|
691
676
|
|
692
|
-
checkError:
|
677
|
+
checkError:
|
693
678
|
if (load) {
|
694
679
|
if (linkSet.loads[0].name == load.name) {
|
695
680
|
exc = addToError(exc, 'Error loading ' + load.name);
|
@@ -723,7 +708,6 @@ function logloads(loads) {
|
|
723
708
|
loader.loaderObj.failed.push(load);
|
724
709
|
|
725
710
|
var linkIndex = indexOf.call(load.linkSets, linkSet);
|
726
|
-
console.assert(linkIndex != -1, 'link not present');
|
727
711
|
load.linkSets.splice(linkIndex, 1);
|
728
712
|
if (load.linkSets.length == 0) {
|
729
713
|
var globalLoadsIndex = indexOf.call(linkSet.loader.loads, load);
|
@@ -755,7 +739,6 @@ function logloads(loads) {
|
|
755
739
|
}
|
756
740
|
// if not anonymous, add to the module table
|
757
741
|
if (load.name) {
|
758
|
-
console.assert(!loader.modules[load.name] || loader.modules[load.name].module === load.module.module, 'load not in module table');
|
759
742
|
loader.modules[load.name] = load.module;
|
760
743
|
}
|
761
744
|
var loadIndex = indexOf.call(loader.loads, load);
|
@@ -985,7 +968,6 @@ function logloads(loads) {
|
|
985
968
|
})();
|
986
969
|
|
987
970
|
var System;
|
988
|
-
|
989
971
|
// SystemJS Loader Class and Extension helpers
|
990
972
|
function SystemJSLoader() {
|
991
973
|
Loader.call(this);
|
@@ -1029,7 +1011,7 @@ function urlResolve(name, parent) {
|
|
1029
1011
|
// url resolution shortpaths
|
1030
1012
|
if (name[0] == '.') {
|
1031
1013
|
// dot-relative url normalization
|
1032
|
-
if (name[1] == '/')
|
1014
|
+
if (name[1] == '/' && name[2] != '.')
|
1033
1015
|
return (parent && parent.substr(0, parent.lastIndexOf('/') + 1) || baseURI) + name.substr(2);
|
1034
1016
|
}
|
1035
1017
|
else if (name[0] != '/' && name.indexOf(':') == -1) {
|
@@ -1062,7 +1044,7 @@ function applyPaths(loader, name) {
|
|
1062
1044
|
if (p.indexOf('*') === -1) {
|
1063
1045
|
if (name == p)
|
1064
1046
|
return paths[p];
|
1065
|
-
|
1047
|
+
|
1066
1048
|
// support trailing / in paths rules
|
1067
1049
|
else if (name.substr(0, p.length - 1) == p.substr(0, p.length - 1) && (name.length < p.length || name[p.length - 1] == p[p.length - 1]) && (paths[p][paths[p].length - 1] == '/' || paths[p] == '')) {
|
1068
1050
|
return paths[p].substr(0, paths[p].length - 1) + (name.length > p.length ? (paths[p] && '/' || '') + name.substr(p.length) : '');
|
@@ -1216,7 +1198,7 @@ function extendPkgConfig(pkgCfgA, pkgCfgB, pkgName, loader, warnInvalidPropertie
|
|
1216
1198
|
loader.depCache[dNormalized] = (loader.depCache[dNormalized] || []).concat(pkgCfgB.depCache[d]);
|
1217
1199
|
}
|
1218
1200
|
}
|
1219
|
-
else if (warnInvalidProperties && indexOf.call(['browserConfig', 'nodeConfig', 'devConfig', 'productionConfig'], prop) == -1 &&
|
1201
|
+
else if (warnInvalidProperties && indexOf.call(['browserConfig', 'nodeConfig', 'devConfig', 'productionConfig'], prop) == -1 &&
|
1220
1202
|
(!pkgCfgB.hasOwnProperty || pkgCfgB.hasOwnProperty(prop))) {
|
1221
1203
|
warn.call(loader, '"' + prop + '" is not a valid package configuration option in package ' + pkgName);
|
1222
1204
|
}
|
@@ -1238,7 +1220,7 @@ function setPkgConfig(loader, pkgName, cfg, prependConfig) {
|
|
1238
1220
|
extendPkgConfig(pkg, prependConfig ? cfg : basePkg, pkgName, loader, prependConfig);
|
1239
1221
|
extendPkgConfig(pkg, prependConfig ? basePkg : cfg, pkgName, loader, !prependConfig);
|
1240
1222
|
}
|
1241
|
-
|
1223
|
+
|
1242
1224
|
// main object becomes main map
|
1243
1225
|
if (typeof pkg.main == 'object') {
|
1244
1226
|
pkg.map = pkg.map || {};
|
@@ -1254,6 +1236,15 @@ function warn(msg) {
|
|
1254
1236
|
if (this.warnings && typeof console != 'undefined' && console.warn)
|
1255
1237
|
console.warn(msg);
|
1256
1238
|
}
|
1239
|
+
|
1240
|
+
function createInstantiate (load, result) {
|
1241
|
+
load.metadata.entry = createEntry();
|
1242
|
+
load.metadata.entry.execute = function() {
|
1243
|
+
return result;
|
1244
|
+
}
|
1245
|
+
load.metadata.entry.deps = [];
|
1246
|
+
load.metadata.format = 'defined';
|
1247
|
+
}
|
1257
1248
|
var fetchTextFromURL;
|
1258
1249
|
if (typeof XMLHttpRequest != 'undefined') {
|
1259
1250
|
fetchTextFromURL = function(url, authorization, fulfill, reject) {
|
@@ -1407,18 +1398,19 @@ function prepareBaseURL(loader) {
|
|
1407
1398
|
if (this._loader.baseURL !== this.baseURL) {
|
1408
1399
|
if (this.baseURL[this.baseURL.length - 1] != '/')
|
1409
1400
|
this.baseURL += '/';
|
1410
|
-
|
1401
|
+
|
1411
1402
|
this._loader.baseURL = this.baseURL = new URL(this.baseURL, baseURIObj).href;
|
1412
1403
|
}
|
1413
1404
|
}
|
1414
1405
|
|
1415
1406
|
var envModule;
|
1416
|
-
function setProduction(isProduction) {
|
1407
|
+
function setProduction(isProduction, isBuilder) {
|
1417
1408
|
this.set('@system-env', envModule = this.newModule({
|
1418
1409
|
browser: isBrowser,
|
1419
1410
|
node: !!this._nodeRequire,
|
1420
|
-
production: isProduction,
|
1421
|
-
dev: !isProduction,
|
1411
|
+
production: !isBuilder && isProduction,
|
1412
|
+
dev: isBuilder || !isProduction,
|
1413
|
+
build: isBuilder,
|
1422
1414
|
'default': true
|
1423
1415
|
}));
|
1424
1416
|
}
|
@@ -1433,6 +1425,10 @@ hookConstructor(function(constructor) {
|
|
1433
1425
|
// support map and paths
|
1434
1426
|
this.map = {};
|
1435
1427
|
|
1428
|
+
// make the location of the system.js script accessible
|
1429
|
+
if (typeof $__curScript != 'undefined')
|
1430
|
+
this.scriptSrc = $__curScript.src;
|
1431
|
+
|
1436
1432
|
// global behaviour flags
|
1437
1433
|
this.warnings = false;
|
1438
1434
|
this.defaultJSExtensions = false;
|
@@ -1447,7 +1443,7 @@ hookConstructor(function(constructor) {
|
|
1447
1443
|
// support the empty module, as a concept
|
1448
1444
|
this.set('@empty', this.newModule({}));
|
1449
1445
|
|
1450
|
-
setProduction.call(this, false);
|
1446
|
+
setProduction.call(this, false, false);
|
1451
1447
|
};
|
1452
1448
|
});
|
1453
1449
|
|
@@ -1469,22 +1465,18 @@ if (typeof require != 'undefined' && typeof process != 'undefined' && !process.b
|
|
1469
1465
|
a URL.
|
1470
1466
|
*/
|
1471
1467
|
|
1472
|
-
|
1468
|
+
var parentModuleContext;
|
1469
|
+
function getNodeModule(name, baseURL) {
|
1473
1470
|
if (!isPlain(name))
|
1474
1471
|
throw new Error('Node module ' + name + ' can\'t be loaded as it is not a package require.');
|
1475
1472
|
|
1476
|
-
|
1477
|
-
|
1478
|
-
|
1479
|
-
|
1480
|
-
|
1481
|
-
}
|
1482
|
-
catch(e) {
|
1483
|
-
// fall back to direct require (in theory this is core modules only, which should really be filtered)
|
1484
|
-
if (e.code == 'MODULE_NOT_FOUND')
|
1485
|
-
module = this._nodeRequire(name);
|
1473
|
+
if (!parentModuleContext) {
|
1474
|
+
var Module = this._nodeRequire('module');
|
1475
|
+
var base = baseURL.substr(isWindows ? 8 : 7);
|
1476
|
+
parentModuleContext = new Module(base);
|
1477
|
+
parentModuleContext.paths = Module._nodeModulePaths(base);
|
1486
1478
|
}
|
1487
|
-
return
|
1479
|
+
return parentModuleContext.require(name);
|
1488
1480
|
}
|
1489
1481
|
|
1490
1482
|
function coreResolve(name, parentName) {
|
@@ -1508,11 +1500,15 @@ function coreResolve(name, parentName) {
|
|
1508
1500
|
|
1509
1501
|
if (this.has(name))
|
1510
1502
|
return name;
|
1503
|
+
|
1511
1504
|
// dynamically load node-core modules when requiring `@node/fs` for example
|
1512
1505
|
if (name.substr(0, 6) == '@node/') {
|
1513
1506
|
if (!this._nodeRequire)
|
1514
1507
|
throw new TypeError('Error loading ' + name + '. Can only load node core modules in Node.');
|
1515
|
-
|
1508
|
+
if (this.builder)
|
1509
|
+
this.set(name, this.newModule({}));
|
1510
|
+
else
|
1511
|
+
this.set(name, this.newModule(getESModule(getNodeModule.call(this, name.substr(6), this.baseURL))));
|
1516
1512
|
return name;
|
1517
1513
|
}
|
1518
1514
|
|
@@ -1557,7 +1553,7 @@ hook('fetch', function() {
|
|
1557
1553
|
|
1558
1554
|
/*
|
1559
1555
|
__useDefault
|
1560
|
-
|
1556
|
+
|
1561
1557
|
When a module object looks like:
|
1562
1558
|
newModule(
|
1563
1559
|
__useDefault: true,
|
@@ -1663,8 +1659,6 @@ hook('instantiate', function(instantiate) {
|
|
1663
1659
|
For easy normalization canonicalization with latest URL support.
|
1664
1660
|
|
1665
1661
|
*/
|
1666
|
-
SystemJSLoader.prototype.env = 'dev';
|
1667
|
-
|
1668
1662
|
function envSet(loader, cfg, envCallback) {
|
1669
1663
|
if (envModule.browser && cfg.browserConfig)
|
1670
1664
|
envCallback(cfg.browserConfig);
|
@@ -1672,6 +1666,8 @@ function envSet(loader, cfg, envCallback) {
|
|
1672
1666
|
envCallback(cfg.nodeConfig);
|
1673
1667
|
if (envModule.dev && cfg.devConfig)
|
1674
1668
|
envCallback(cfg.devConfig);
|
1669
|
+
if (envModule.build && cfg.buildConfig)
|
1670
|
+
envCallback(cfg.buildConfig);
|
1675
1671
|
if (envModule.production && cfg.productionConfig)
|
1676
1672
|
envCallback(cfg.productionConfig);
|
1677
1673
|
}
|
@@ -1680,9 +1676,9 @@ SystemJSLoader.prototype.getConfig = function(name) {
|
|
1680
1676
|
var cfg = {};
|
1681
1677
|
var loader = this;
|
1682
1678
|
for (var p in loader) {
|
1683
|
-
if (loader.hasOwnProperty && !loader.hasOwnProperty(p) || p in SystemJSLoader.prototype)
|
1679
|
+
if (loader.hasOwnProperty && !loader.hasOwnProperty(p) || p in SystemJSLoader.prototype && p != 'transpiler')
|
1684
1680
|
continue;
|
1685
|
-
if (indexOf.call(['_loader', 'amdDefine', 'amdRequire', 'defined', 'failed', 'version'], p) == -1)
|
1681
|
+
if (indexOf.call(['_loader', 'amdDefine', 'amdRequire', 'defined', 'failed', 'version', 'loads'], p) == -1)
|
1686
1682
|
cfg[p] = loader[p];
|
1687
1683
|
}
|
1688
1684
|
cfg.production = envModule.production;
|
@@ -1708,8 +1704,8 @@ SystemJSLoader.prototype.config = function(cfg, isEnvConfig) {
|
|
1708
1704
|
if (cfg.transpilerRuntime === false)
|
1709
1705
|
loader._loader.loadedTranspilerRuntime = true;
|
1710
1706
|
|
1711
|
-
if ('production' in cfg)
|
1712
|
-
setProduction.call(loader, cfg.production);
|
1707
|
+
if ('production' in cfg || 'build' in cfg)
|
1708
|
+
setProduction.call(loader, !!cfg.production, !!(cfg.build || envModule && envModule.build));
|
1713
1709
|
|
1714
1710
|
if (!isEnvConfig) {
|
1715
1711
|
// if using nodeConfig / browserConfig / productionConfig, take baseURL from there
|
@@ -1747,7 +1743,7 @@ SystemJSLoader.prototype.config = function(cfg, isEnvConfig) {
|
|
1747
1743
|
if (this.warnings) {
|
1748
1744
|
for (var p in loader.paths)
|
1749
1745
|
if (p.indexOf('*') != -1)
|
1750
|
-
warn.call(loader, 'Paths configuration "' + p + '" -> "' + loader.paths[p] + '" uses wildcards which are being deprecated for
|
1746
|
+
warn.call(loader, 'Paths configuration "' + p + '" -> "' + loader.paths[p] + '" uses wildcards which are being deprecated for just leaving a trailing "/" to indicate folder paths.');
|
1751
1747
|
}
|
1752
1748
|
}
|
1753
1749
|
|
@@ -1760,14 +1756,11 @@ SystemJSLoader.prototype.config = function(cfg, isEnvConfig) {
|
|
1760
1756
|
loader.pluginFirst = cfg.pluginFirst;
|
1761
1757
|
|
1762
1758
|
if (cfg.map) {
|
1763
|
-
var objMaps = '';
|
1764
1759
|
for (var p in cfg.map) {
|
1765
1760
|
var v = cfg.map[p];
|
1766
1761
|
|
1767
1762
|
// object map backwards-compat into packages configuration
|
1768
1763
|
if (typeof v !== 'string') {
|
1769
|
-
objMaps += (objMaps.length ? ', ' : '') + '"' + p + '"';
|
1770
|
-
|
1771
1764
|
var defaultJSExtension = loader.defaultJSExtensions && p.substr(p.length - 3, 3) != '.js';
|
1772
1765
|
var prop = loader.decanonicalize(p);
|
1773
1766
|
if (defaultJSExtension && prop.substr(prop.length - 3, 3) == '.js')
|
@@ -1776,8 +1769,8 @@ SystemJSLoader.prototype.config = function(cfg, isEnvConfig) {
|
|
1776
1769
|
// if a package main, revert it
|
1777
1770
|
var pkgMatch = '';
|
1778
1771
|
for (var pkg in loader.packages) {
|
1779
|
-
if (prop.substr(0, pkg.length) == pkg
|
1780
|
-
&& (!prop[pkg.length] || prop[pkg.length] == '/')
|
1772
|
+
if (prop.substr(0, pkg.length) == pkg
|
1773
|
+
&& (!prop[pkg.length] || prop[pkg.length] == '/')
|
1781
1774
|
&& pkgMatch.split('/').length < pkg.split('/').length)
|
1782
1775
|
pkgMatch = pkg;
|
1783
1776
|
}
|
@@ -1791,8 +1784,6 @@ SystemJSLoader.prototype.config = function(cfg, isEnvConfig) {
|
|
1791
1784
|
loader.map[p] = v;
|
1792
1785
|
}
|
1793
1786
|
}
|
1794
|
-
if (objMaps)
|
1795
|
-
warn.call(loader, 'The map configuration for ' + objMaps + ' uses object submaps, which is deprecated in global map.\nUpdate this to use package contextual map with configs like SystemJS.config({ packages: { "' + p + '": { map: {...} } } }).');
|
1796
1787
|
}
|
1797
1788
|
|
1798
1789
|
if (cfg.packageConfigPaths) {
|
@@ -1838,8 +1829,8 @@ SystemJSLoader.prototype.config = function(cfg, isEnvConfig) {
|
|
1838
1829
|
for (var c in cfg) {
|
1839
1830
|
var v = cfg[c];
|
1840
1831
|
|
1841
|
-
if (indexOf.call(['baseURL', 'map', 'packages', 'bundles', 'paths', 'warnings', 'packageConfigPaths',
|
1842
|
-
'loaderErrorStack', 'browserConfig', 'nodeConfig', 'devConfig', 'productionConfig'], c) != -1)
|
1832
|
+
if (indexOf.call(['baseURL', 'map', 'packages', 'bundles', 'paths', 'warnings', 'packageConfigPaths',
|
1833
|
+
'loaderErrorStack', 'browserConfig', 'nodeConfig', 'devConfig', 'buildConfig', 'productionConfig'], c) != -1)
|
1843
1834
|
continue;
|
1844
1835
|
|
1845
1836
|
if (typeof v != 'object' || v instanceof Array) {
|
@@ -1877,7 +1868,8 @@ SystemJSLoader.prototype.config = function(cfg, isEnvConfig) {
|
|
1877
1868
|
envSet(loader, cfg, function(cfg) {
|
1878
1869
|
loader.config(cfg, true);
|
1879
1870
|
});
|
1880
|
-
}
|
1871
|
+
};
|
1872
|
+
/*
|
1881
1873
|
* Package Configuration Extension
|
1882
1874
|
*
|
1883
1875
|
* Example:
|
@@ -2566,7 +2558,7 @@ SystemJSLoader.prototype.config = function(cfg, isEnvConfig) {
|
|
2566
2558
|
|
2567
2559
|
// if nothing registered, then something went wrong
|
2568
2560
|
if (!load.metadata.entry)
|
2569
|
-
reject(new Error(load.address + ' did not call System.register or AMD define'));
|
2561
|
+
reject(new Error(load.address + ' did not call System.register or AMD define. If loading a global, ensure the meta format is set to global.'));
|
2570
2562
|
|
2571
2563
|
resolve('');
|
2572
2564
|
});
|
@@ -2681,7 +2673,7 @@ SystemJSLoader.prototype.config = function(cfg, isEnvConfig) {
|
|
2681
2673
|
*
|
2682
2674
|
*
|
2683
2675
|
* The code here replicates the ES6 linking groups algorithm to ensure that
|
2684
|
-
* circular ES6 compiled into System.register can work alongside circular AMD
|
2676
|
+
* circular ES6 compiled into System.register can work alongside circular AMD
|
2685
2677
|
* and CommonJS, identically to the actual ES6 loader.
|
2686
2678
|
*
|
2687
2679
|
*/
|
@@ -2691,7 +2683,7 @@ SystemJSLoader.prototype.config = function(cfg, isEnvConfig) {
|
|
2691
2683
|
* Registry side table entries in loader.defined
|
2692
2684
|
* Registry Entry Contains:
|
2693
2685
|
* - name
|
2694
|
-
* - deps
|
2686
|
+
* - deps
|
2695
2687
|
* - declare for declarative modules
|
2696
2688
|
* - execute for dynamic modules, different to declarative execute on module
|
2697
2689
|
* - executingRequire indicates require drives execution for circularity of dynamic modules
|
@@ -2709,7 +2701,7 @@ SystemJSLoader.prototype.config = function(cfg, isEnvConfig) {
|
|
2709
2701
|
* For dynamic we track the es module with:
|
2710
2702
|
* - esModule actual es module value
|
2711
2703
|
* - esmExports whether to extend the esModule with named exports
|
2712
|
-
*
|
2704
|
+
*
|
2713
2705
|
* Then for declarative only we track dynamic bindings with the 'module' records:
|
2714
2706
|
* - name
|
2715
2707
|
* - exports
|
@@ -2754,7 +2746,7 @@ function createEntry() {
|
|
2754
2746
|
* see https://github.com/ModuleLoader/es6-module-loader/wiki/System.register-Explained
|
2755
2747
|
*
|
2756
2748
|
* 2. System.registerDynamic for dynamic modules (3-4 params) - System.registerDynamic([name, ]deps, executingRequire, execute)
|
2757
|
-
* the true or false statement
|
2749
|
+
* the true or false statement
|
2758
2750
|
*
|
2759
2751
|
* this extension implements the linking algorithm for the two variations identical to the spec
|
2760
2752
|
* allowing compiled ES6 circular references to work alongside AMD and CJS circular references.
|
@@ -2773,7 +2765,7 @@ function createEntry() {
|
|
2773
2765
|
return this.registerDynamic.apply(this, arguments);
|
2774
2766
|
|
2775
2767
|
var entry = createEntry();
|
2776
|
-
// ideally wouldn't apply map config to bundle names but
|
2768
|
+
// ideally wouldn't apply map config to bundle names but
|
2777
2769
|
// dependencies go through map regardless so we can't restrict
|
2778
2770
|
// could reconsider in shift to new spec
|
2779
2771
|
entry.name = name && (this.decanonicalize || this.normalize).call(this, name);
|
@@ -2859,17 +2851,17 @@ function createEntry() {
|
|
2859
2851
|
for (var i = 0, l = entry.normalizedDeps.length; i < l; i++) {
|
2860
2852
|
var depName = entry.normalizedDeps[i];
|
2861
2853
|
var depEntry = loader.defined[depName];
|
2862
|
-
|
2854
|
+
|
2863
2855
|
// not in the registry means already linked / ES6
|
2864
2856
|
if (!depEntry || depEntry.evaluated)
|
2865
2857
|
continue;
|
2866
|
-
|
2858
|
+
|
2867
2859
|
// now we know the entry is in our unlinked linkage group
|
2868
2860
|
var depGroupIndex = entry.groupIndex + (depEntry.declarative != entry.declarative);
|
2869
2861
|
|
2870
2862
|
// the group index of an entry is always the maximum
|
2871
2863
|
if (depEntry.groupIndex === null || depEntry.groupIndex < depGroupIndex) {
|
2872
|
-
|
2864
|
+
|
2873
2865
|
// if already in a group, remove from the old group
|
2874
2866
|
if (depEntry.groupIndex !== null) {
|
2875
2867
|
groups[depEntry.groupIndex].splice(indexOf.call(groups[depEntry.groupIndex], depEntry), 1);
|
@@ -2909,7 +2901,7 @@ function createEntry() {
|
|
2909
2901
|
else
|
2910
2902
|
linkDynamicModule(entry, loader);
|
2911
2903
|
}
|
2912
|
-
curGroupDeclarative = !curGroupDeclarative;
|
2904
|
+
curGroupDeclarative = !curGroupDeclarative;
|
2913
2905
|
}
|
2914
2906
|
}
|
2915
2907
|
|
@@ -2954,14 +2946,22 @@ function createEntry() {
|
|
2954
2946
|
var importerModule = module.importers[i];
|
2955
2947
|
if (!importerModule.locked) {
|
2956
2948
|
var importerIndex = indexOf.call(importerModule.dependencies, module);
|
2957
|
-
importerModule.setters[importerIndex]
|
2949
|
+
var setter = importerModule.setters[importerIndex];
|
2950
|
+
if (setter)
|
2951
|
+
setter(exports);
|
2958
2952
|
}
|
2959
2953
|
}
|
2960
2954
|
|
2961
2955
|
module.locked = false;
|
2962
2956
|
return value;
|
2963
2957
|
}, { id: entry.name });
|
2964
|
-
|
2958
|
+
|
2959
|
+
if (typeof declaration == 'function')
|
2960
|
+
declaration = { setters: [], execute: declaration };
|
2961
|
+
|
2962
|
+
// allowing undefined declaration was a mistake! To be deprecated.
|
2963
|
+
declaration = declaration || { setters: [], execute: function() {} };
|
2964
|
+
|
2965
2965
|
module.setters = declaration.setters;
|
2966
2966
|
module.execute = declaration.execute;
|
2967
2967
|
|
@@ -3004,7 +3004,7 @@ function createEntry() {
|
|
3004
3004
|
else {
|
3005
3005
|
module.dependencies.push(null);
|
3006
3006
|
}
|
3007
|
-
|
3007
|
+
|
3008
3008
|
// run setters for all entries with the matching dependency name
|
3009
3009
|
var originalIndices = entry.originalIndices[i];
|
3010
3010
|
for (var j = 0, len = originalIndices.length; j < len; ++j) {
|
@@ -3030,7 +3030,7 @@ function createEntry() {
|
|
3030
3030
|
else {
|
3031
3031
|
if (entry.declarative)
|
3032
3032
|
ensureEvaluated(name, entry, [], loader);
|
3033
|
-
|
3033
|
+
|
3034
3034
|
else if (!entry.evaluated)
|
3035
3035
|
linkDynamicModule(entry, loader);
|
3036
3036
|
|
@@ -3039,7 +3039,7 @@ function createEntry() {
|
|
3039
3039
|
|
3040
3040
|
if ((!entry || entry.declarative) && exports && exports.__useDefault)
|
3041
3041
|
return exports['default'];
|
3042
|
-
|
3042
|
+
|
3043
3043
|
return exports;
|
3044
3044
|
}
|
3045
3045
|
|
@@ -3077,8 +3077,8 @@ function createEntry() {
|
|
3077
3077
|
|
3078
3078
|
throw new Error('Module ' + name + ' not declared as a dependency of ' + entry.name);
|
3079
3079
|
}, exports, module);
|
3080
|
-
|
3081
|
-
if (output)
|
3080
|
+
|
3081
|
+
if (output !== undefined)
|
3082
3082
|
module.exports = output;
|
3083
3083
|
|
3084
3084
|
// create the esModule object, which allows ES6 named imports of dynamics
|
@@ -3092,7 +3092,7 @@ function createEntry() {
|
|
3092
3092
|
entry.esModule = loader.newModule(getESModule(exports));
|
3093
3093
|
// just use the 'default' export
|
3094
3094
|
else
|
3095
|
-
entry.esModule = loader.newModule({ 'default': exports });
|
3095
|
+
entry.esModule = loader.newModule({ 'default': exports, __useDefault: true });
|
3096
3096
|
}
|
3097
3097
|
|
3098
3098
|
/*
|
@@ -3101,7 +3101,7 @@ function createEntry() {
|
|
3101
3101
|
* (unless one is a circular dependency already in the list of seen
|
3102
3102
|
* modules, in which case we execute it)
|
3103
3103
|
*
|
3104
|
-
* Then we evaluate the module itself depth-first left to right
|
3104
|
+
* Then we evaluate the module itself depth-first left to right
|
3105
3105
|
* execution to match ES6 modules
|
3106
3106
|
*/
|
3107
3107
|
function ensureEvaluated(moduleName, entry, seen, loader) {
|
@@ -3147,7 +3147,7 @@ function createEntry() {
|
|
3147
3147
|
}
|
3148
3148
|
|
3149
3149
|
load.metadata.deps = load.metadata.deps || [];
|
3150
|
-
|
3150
|
+
|
3151
3151
|
return fetch.call(this, load);
|
3152
3152
|
};
|
3153
3153
|
});
|
@@ -3158,7 +3158,7 @@ function createEntry() {
|
|
3158
3158
|
load.metadata.deps = load.metadata.deps || [];
|
3159
3159
|
return Promise.resolve(translate.apply(this, arguments)).then(function(source) {
|
3160
3160
|
// run detection for register format
|
3161
|
-
if (load.metadata.format == 'register' || !load.metadata.format && detectRegisterFormat(load.source))
|
3161
|
+
if (load.metadata.format == 'register' || load.metadata.format == 'system' || !load.metadata.format && detectRegisterFormat(load.source))
|
3162
3162
|
load.metadata.format = 'register';
|
3163
3163
|
return source;
|
3164
3164
|
});
|
@@ -3176,7 +3176,7 @@ function createEntry() {
|
|
3176
3176
|
|
3177
3177
|
entry.originalIndices = entry.normalizedDeps = [];
|
3178
3178
|
|
3179
|
-
// recursively ensure that the module and all its
|
3179
|
+
// recursively ensure that the module and all its
|
3180
3180
|
// dependencies are linked (with dependency group handling)
|
3181
3181
|
link(normalized, entry, loader);
|
3182
3182
|
|
@@ -3227,9 +3227,9 @@ function createEntry() {
|
|
3227
3227
|
|
3228
3228
|
// Contains System.register calls
|
3229
3229
|
// (dont run bundles in the builder)
|
3230
|
-
else if (!(loader.builder && load.metadata.bundle)
|
3230
|
+
else if (!(loader.builder && load.metadata.bundle)
|
3231
3231
|
&& (load.metadata.format == 'register' || load.metadata.format == 'esm' || load.metadata.format == 'es6')) {
|
3232
|
-
|
3232
|
+
|
3233
3233
|
if (typeof __exec != 'undefined')
|
3234
3234
|
__exec.call(loader, load);
|
3235
3235
|
|
@@ -3252,9 +3252,9 @@ function createEntry() {
|
|
3252
3252
|
|
3253
3253
|
// place this module onto defined for circular references
|
3254
3254
|
loader.defined[load.name] = entry;
|
3255
|
-
|
3255
|
+
|
3256
3256
|
var grouped = group(entry.deps);
|
3257
|
-
|
3257
|
+
|
3258
3258
|
entry.deps = grouped.names;
|
3259
3259
|
entry.originalIndices = grouped.indices;
|
3260
3260
|
entry.name = load.name;
|
@@ -3272,7 +3272,7 @@ function createEntry() {
|
|
3272
3272
|
return {
|
3273
3273
|
deps: entry.deps,
|
3274
3274
|
execute: function() {
|
3275
|
-
// recursively ensure that the module and all its
|
3275
|
+
// recursively ensure that the module and all its
|
3276
3276
|
// dependencies are linked (with dependency group handling)
|
3277
3277
|
link(load.name, entry, loader);
|
3278
3278
|
|
@@ -3318,7 +3318,7 @@ function getGlobalValue(exports) {
|
|
3318
3318
|
|
3319
3319
|
hook('reduceRegister_', function(reduceRegister) {
|
3320
3320
|
return function(load, register) {
|
3321
|
-
if (register || !load.metadata.exports)
|
3321
|
+
if (register || (!load.metadata.exports && !(isWorker && load.metadata.format == 'global')))
|
3322
3322
|
return reduceRegister.call(this, load, register);
|
3323
3323
|
|
3324
3324
|
load.metadata.format = 'global';
|
@@ -3710,7 +3710,7 @@ hookConstructor(function(constructor) {
|
|
3710
3710
|
if (curMeta) {
|
3711
3711
|
if (!curMeta.entry && !curMeta.bundle)
|
3712
3712
|
curMeta.entry = entry;
|
3713
|
-
else if (curMeta.entry && curMeta.entry.name)
|
3713
|
+
else if (curMeta.entry && curMeta.entry.name && curMeta.entry.name != load.name)
|
3714
3714
|
curMeta.entry = undefined;
|
3715
3715
|
|
3716
3716
|
// note this is now a bundle
|
@@ -3795,13 +3795,13 @@ hookConstructor(function(constructor) {
|
|
3795
3795
|
// if so, remove for backwards compat
|
3796
3796
|
// this is strange and sucks, but will be deprecated
|
3797
3797
|
function checkDefaultExtension(loader, arg) {
|
3798
|
-
return loader.defaultJSExtensions && arg.substr(arg.length - 3, 3) != '.js';
|
3798
|
+
return loader.defaultJSExtensions && arg.substr(arg.length - 3, 3) != '.js';
|
3799
3799
|
}
|
3800
3800
|
|
3801
3801
|
function createNormalizeSync(normalizeSync) {
|
3802
3802
|
return function(name, parentName, isPlugin) {
|
3803
3803
|
var loader = this;
|
3804
|
-
|
3804
|
+
|
3805
3805
|
var parsed = parsePlugin(loader, name);
|
3806
3806
|
parentName = getParentName(this, parentName);
|
3807
3807
|
|
@@ -3814,7 +3814,7 @@ hookConstructor(function(constructor) {
|
|
3814
3814
|
return combinePluginParts(loader, argumentName, pluginName, checkDefaultExtension(loader, parsed.argument));
|
3815
3815
|
};
|
3816
3816
|
}
|
3817
|
-
|
3817
|
+
|
3818
3818
|
hook('decanonicalize', createNormalizeSync);
|
3819
3819
|
hook('normalizeSync', createNormalizeSync);
|
3820
3820
|
|
@@ -3908,15 +3908,16 @@ hookConstructor(function(constructor) {
|
|
3908
3908
|
hook('fetch', function(fetch) {
|
3909
3909
|
return function(load) {
|
3910
3910
|
var loader = this;
|
3911
|
-
if (load.metadata.loaderModule && load.metadata.
|
3911
|
+
if (load.metadata.loaderModule && load.metadata.format != 'defined') {
|
3912
|
+
if (typeof load.metadata.loaderModule === 'function' || load.metadata.loaderModule instanceof Module && typeof load.metadata.loaderModule.default === 'function')
|
3913
|
+
return '';
|
3912
3914
|
load.metadata.scriptLoad = false;
|
3913
|
-
|
3914
|
-
return fetch.call(loader, load)
|
3915
|
-
|
3916
|
-
|
3917
|
-
else {
|
3918
|
-
return fetch.call(loader, load);
|
3915
|
+
if (load.metadata.loaderModule.fetch)
|
3916
|
+
return load.metadata.loaderModule.fetch.call(loader, load, function(load) {
|
3917
|
+
return fetch.call(loader, load);
|
3918
|
+
});
|
3919
3919
|
}
|
3920
|
+
return fetch.call(loader, load);
|
3920
3921
|
};
|
3921
3922
|
});
|
3922
3923
|
|
@@ -3934,7 +3935,7 @@ hookConstructor(function(constructor) {
|
|
3934
3935
|
throw new Error('load.metadata.sourceMap must be set to an object.');
|
3935
3936
|
|
3936
3937
|
var originalName = load.address.split('!')[0];
|
3937
|
-
|
3938
|
+
|
3938
3939
|
// force set the filename of the original file
|
3939
3940
|
if (!sourceMap.file || sourceMap.file == load.address)
|
3940
3941
|
sourceMap.file = originalName + '!transpiled';
|
@@ -3949,15 +3950,11 @@ hookConstructor(function(constructor) {
|
|
3949
3950
|
|
3950
3951
|
if (typeof result == 'string')
|
3951
3952
|
load.source = result;
|
3952
|
-
else
|
3953
|
-
warn.call(this, 'Plugin ' + load.metadata.loader + ' should return the source in translate, instead of setting load.source directly. This support will be deprecated.');
|
3954
3953
|
|
3955
3954
|
return translate.apply(loader, args);
|
3956
3955
|
});
|
3957
3956
|
}
|
3958
|
-
|
3959
|
-
return translate.apply(loader, args);
|
3960
|
-
}
|
3957
|
+
return translate.apply(loader, args);
|
3961
3958
|
};
|
3962
3959
|
});
|
3963
3960
|
|
@@ -3966,30 +3963,35 @@ hookConstructor(function(constructor) {
|
|
3966
3963
|
var loader = this;
|
3967
3964
|
var calledInstantiate = false;
|
3968
3965
|
|
3969
|
-
if (load.metadata.loaderModule &&
|
3970
|
-
|
3971
|
-
|
3972
|
-
|
3973
|
-
|
3974
|
-
|
3975
|
-
|
3976
|
-
|
3977
|
-
|
3978
|
-
|
3979
|
-
|
3980
|
-
|
3981
|
-
|
3982
|
-
|
3983
|
-
|
3984
|
-
|
3985
|
-
return
|
3986
|
-
|
3987
|
-
|
3988
|
-
|
3966
|
+
if (load.metadata.loaderModule && !loader.builder && load.metadata.format != 'defined') {
|
3967
|
+
if (load.metadata.loaderModule.instantiate)
|
3968
|
+
return Promise.resolve(load.metadata.loaderModule.instantiate.call(loader, load, function(load) {
|
3969
|
+
if (calledInstantiate)
|
3970
|
+
throw new Error('Instantiate must only be called once.');
|
3971
|
+
calledInstantiate = true;
|
3972
|
+
return instantiate.call(loader, load);
|
3973
|
+
})).then(function(result) {
|
3974
|
+
if (calledInstantiate)
|
3975
|
+
return result;
|
3976
|
+
|
3977
|
+
if (result !== undefined)
|
3978
|
+
createInstantiate(load, result);
|
3979
|
+
return instantiate.call(loader, load);
|
3980
|
+
});
|
3981
|
+
else if (typeof load.metadata.loaderModule === 'function' || load.metadata.loaderModule instanceof Module && typeof load.metadata.loaderModule.default === 'function')
|
3982
|
+
return Promise.resolve((load.metadata.loaderModule.default || load.metadata.loaderModule).call(loader, load.address, load.name))
|
3983
|
+
.then(function (result) {
|
3984
|
+
if (result !== undefined)
|
3985
|
+
createInstantiate(load, result);
|
3986
|
+
return instantiate.call(loader, load);
|
3987
|
+
});
|
3988
|
+
}
|
3989
|
+
return instantiate.call(loader, load);
|
3989
3990
|
};
|
3990
3991
|
});
|
3991
3992
|
|
3992
|
-
})()
|
3993
|
+
})();
|
3994
|
+
/*
|
3993
3995
|
* Conditions Extension
|
3994
3996
|
*
|
3995
3997
|
* Allows a condition module to alter the resolution of an import via syntax:
|
@@ -4029,7 +4031,7 @@ hookConstructor(function(constructor) {
|
|
4029
4031
|
*
|
4030
4032
|
*/
|
4031
4033
|
|
4032
|
-
var sysConditions = ['browser', 'node', 'dev', 'production', 'default'];
|
4034
|
+
var sysConditions = ['browser', 'node', 'dev', 'build', 'production', 'default'];
|
4033
4035
|
|
4034
4036
|
function parseCondition(condition) {
|
4035
4037
|
var conditionExport, conditionModule, negation;
|
@@ -4478,7 +4480,7 @@ hook('fetch', function(fetch) {
|
|
4478
4480
|
});System = new SystemJSLoader();
|
4479
4481
|
|
4480
4482
|
__global.SystemJS = System;
|
4481
|
-
System.version = '0.19.
|
4483
|
+
System.version = '0.19.46 CSP';
|
4482
4484
|
if (typeof module == 'object' && module.exports && typeof exports == 'object')
|
4483
4485
|
module.exports = System;
|
4484
4486
|
|
@@ -4493,6 +4495,10 @@ var doPolyfill = typeof Promise === 'undefined';
|
|
4493
4495
|
if (typeof document !== 'undefined') {
|
4494
4496
|
var scripts = document.getElementsByTagName('script');
|
4495
4497
|
$__curScript = scripts[scripts.length - 1];
|
4498
|
+
if (document.currentScript && ($__curScript.defer || $__curScript.async))
|
4499
|
+
$__curScript = document.currentScript;
|
4500
|
+
if (!$__curScript.src)
|
4501
|
+
$__curScript = undefined;
|
4496
4502
|
if (doPolyfill) {
|
4497
4503
|
var curPath = $__curScript.src;
|
4498
4504
|
var basePath = curPath.substr(0, curPath.lastIndexOf('/') + 1);
|
@@ -4526,4 +4532,4 @@ else {
|
|
4526
4532
|
}
|
4527
4533
|
|
4528
4534
|
|
4529
|
-
})();
|
4535
|
+
})();
|