Skip to content

Commit

Permalink
chore(all): prepare release 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Dec 8, 2016
1 parent b245878 commit 11f31bf
Show file tree
Hide file tree
Showing 11 changed files with 140 additions and 99 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-bootstrapper",
"version": "1.0.1",
"version": "2.0.0",
"description": "Sets up the default configuration for the aurelia framework and gets you up and running quick and easy.",
"keywords": [
"aurelia",
Expand Down
33 changes: 18 additions & 15 deletions dist/amd/aurelia-bootstrapper.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define(['exports', 'aurelia-pal', 'aurelia-polyfills'], function (exports, _aureliaPal) {
define(['module', 'exports', 'aurelia-pal', 'aurelia-polyfills'], function (module, exports, _aureliaPal) {
'use strict';

Object.defineProperty(exports, "__esModule", {
Expand All @@ -12,6 +12,7 @@ define(['exports', 'aurelia-pal', 'aurelia-polyfills'], function (exports, _aure
var sharedLoader = null;
var Aurelia = null;
var host = _aureliaPal.PLATFORM.global;
var isNodeLike = typeof process !== 'undefined' && !process.browser;

function onBootstrap(callback) {
return new Promise(function (resolve, reject) {
Expand All @@ -31,7 +32,7 @@ define(['exports', 'aurelia-pal', 'aurelia-polyfills'], function (exports, _aure

function ready() {
return new Promise(function (resolve, reject) {
if (host.document.readyState === 'complete') {
if (!host.document || host.document.readyState === 'complete') {
resolve();
} else {
host.document.addEventListener('DOMContentLoaded', completed);
Expand All @@ -52,11 +53,11 @@ define(['exports', 'aurelia-pal', 'aurelia-polyfills'], function (exports, _aure
}

if (typeof __webpack_require__ !== 'undefined') {
var loaderModule = __webpack_require__(require.resolve('aurelia-loader-webpack'));
return Promise.resolve(new loaderModule.WebpackLoader());
var m = __webpack_require__(require.resolve('aurelia-loader-webpack'));
return Promise.resolve(new m.WebpackLoader());
}

if (host.System && typeof host.System.import === 'function') {
if (host.System && typeof host.System.config === 'function') {
return host.System.normalize('aurelia-bootstrapper').then(function (bsn) {
return host.System.normalize('aurelia-loader-default', bsn);
}).then(function (loaderName) {
Expand All @@ -66,37 +67,39 @@ define(['exports', 'aurelia-pal', 'aurelia-polyfills'], function (exports, _aure
});
}

if (typeof global !== 'undefined' && typeof global.require !== 'undefined') {
var _loaderModule = global.require('aurelia-loader-nodejs');
return Promise.resolve(new _loaderModule.NodeJsLoader());
}

if (typeof host.require === 'function') {
if (typeof host.require === 'function' && typeof host.require.version === 'string') {
return new Promise(function (resolve, reject) {
return host.require(['aurelia-loader-default'], function (m) {
return resolve(new m.DefaultLoader());
}, reject);
});
}

if (isNodeLike && typeof module !== 'undefined' && typeof module.require !== 'undefined') {
var _m = module.require('aurelia-loader-nodejs');
return Promise.resolve(new _m.NodeJsLoader());
}

return Promise.reject('No PLATFORM.Loader is defined and there is neither a System API (ES6) or a Require API (AMD) globally available to load your app.');
}

function initializePal(loader) {
var type = void 0;

if (typeof window !== 'undefined') {
var isElectronRenderer = isNodeLike && process.type === 'renderer';

if (isNodeLike && !isElectronRenderer) {
type = 'nodejs';
} else if (typeof window !== 'undefined') {
type = 'browser';
} else if (typeof self !== 'undefined') {
type = 'worker';
} else if (typeof global !== 'undefined') {
type = 'nodejs';
} else {
throw new Error('Could not determine platform implementation to load.');
}

return loader.loadModule('aurelia-pal-' + type).then(function (palModule) {
return palModule.initialize();
return type === 'nodejs' && !_aureliaPal.isInitialized && palModule.globalize() || palModule.initialize();
});
}

Expand Down
3 changes: 2 additions & 1 deletion dist/aurelia-bootstrapper.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'aurelia-polyfills';
import {
PLATFORM
PLATFORM,
isInitialized
} from 'aurelia-pal';

/**
Expand Down
44 changes: 23 additions & 21 deletions dist/aurelia-bootstrapper.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import 'aurelia-polyfills';
import {PLATFORM} from 'aurelia-pal';
import {PLATFORM,isInitialized} from 'aurelia-pal';

let bootstrapQueue = [];
let sharedLoader = null;
let Aurelia = null;
let host = PLATFORM.global;
const host = PLATFORM.global;
const isNodeLike = typeof process !== 'undefined' && !process.browser;

function onBootstrap(callback) {
return new Promise((resolve, reject) => {
Expand All @@ -24,7 +25,7 @@ function onBootstrap(callback) {

function ready() {
return new Promise((resolve, reject) => {
if (host.document.readyState === 'complete') {
if (!host.document || host.document.readyState === 'complete') {
resolve();
} else {
host.document.addEventListener('DOMContentLoaded', completed);
Expand All @@ -50,52 +51,53 @@ function createLoader() {
// Webpack needs the require to be top level to parse the request.
// However, we don't want to use require or that will cause the Babel
// transpiler to detect an incorrect dependency.
const loaderModule = __webpack_require__(require.resolve('aurelia-loader-webpack'));
return Promise.resolve(new loaderModule.WebpackLoader());
const m = __webpack_require__(require.resolve('aurelia-loader-webpack'));
return Promise.resolve(new m.WebpackLoader());
}

// SystemJS Loader Support
if (host.System && typeof host.System.import === 'function') {
if (host.System && typeof host.System.config === 'function') {
return host.System.normalize('aurelia-bootstrapper').then(bsn => {
return host.System.normalize('aurelia-loader-default', bsn);
}).then(loaderName => {
return host.System.import(loaderName).then(m => new m.DefaultLoader());
});
}

// Node.js Support
if (typeof global !== 'undefined' && typeof global.require !== 'undefined') {
/* note: we use a scoped global.require() instead of simply require()
* so that Webpack does not automatically include this loader as a dependency,
* similarly to the non-global call to System.import() before
*/
const loaderModule = global.require('aurelia-loader-nodejs');
return Promise.resolve(new loaderModule.NodeJsLoader());
}

// AMD Module Loader Support
if (typeof host.require === 'function') {
if (typeof host.require === 'function' && typeof host.require.version === 'string') {
return new Promise((resolve, reject) => host.require(['aurelia-loader-default'], m => resolve(new m.DefaultLoader()), reject));
}

// Node.js and Electron Support
if (isNodeLike && typeof module !== 'undefined' && typeof module.require !== 'undefined') {
// note: we use a scoped module.require() instead of simply require()
// so that Webpack's parser does not automatically include this loader as a dependency,
// similarly to the non-global call to System.import() above
const m = module.require('aurelia-loader-nodejs');
return Promise.resolve(new m.NodeJsLoader());
}

return Promise.reject('No PLATFORM.Loader is defined and there is neither a System API (ES6) or a Require API (AMD) globally available to load your app.');
}

function initializePal(loader) {
let type;

if (typeof window !== 'undefined') {
const isElectronRenderer = isNodeLike && process.type === 'renderer';

if (isNodeLike && !isElectronRenderer) {
type = 'nodejs';
} else if (typeof window !== 'undefined') {
type = 'browser';
} else if (typeof self !== 'undefined') {
type = 'worker';
} else if (typeof global !== 'undefined') {
type = 'nodejs';
} else {
throw new Error('Could not determine platform implementation to load.');
}

return loader.loadModule('aurelia-pal-' + type)
.then(palModule => palModule.initialize());
.then(palModule => type === 'nodejs' && !isInitialized && palModule.globalize() || palModule.initialize());
}

function preparePlatform(loader) {
Expand Down
31 changes: 17 additions & 14 deletions dist/commonjs/aurelia-bootstrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var bootstrapQueue = [];
var sharedLoader = null;
var Aurelia = null;
var host = _aureliaPal.PLATFORM.global;
var isNodeLike = typeof process !== 'undefined' && !process.browser;

function onBootstrap(callback) {
return new Promise(function (resolve, reject) {
Expand All @@ -33,7 +34,7 @@ function onBootstrap(callback) {

function ready() {
return new Promise(function (resolve, reject) {
if (host.document.readyState === 'complete') {
if (!host.document || host.document.readyState === 'complete') {
resolve();
} else {
host.document.addEventListener('DOMContentLoaded', completed);
Expand All @@ -54,11 +55,11 @@ function createLoader() {
}

if (typeof __webpack_require__ !== 'undefined') {
var loaderModule = __webpack_require__(require.resolve('aurelia-loader-webpack'));
return Promise.resolve(new loaderModule.WebpackLoader());
var m = __webpack_require__(require.resolve('aurelia-loader-webpack'));
return Promise.resolve(new m.WebpackLoader());
}

if (host.System && typeof host.System.import === 'function') {
if (host.System && typeof host.System.config === 'function') {
return host.System.normalize('aurelia-bootstrapper').then(function (bsn) {
return host.System.normalize('aurelia-loader-default', bsn);
}).then(function (loaderName) {
Expand All @@ -68,37 +69,39 @@ function createLoader() {
});
}

if (typeof global !== 'undefined' && typeof global.require !== 'undefined') {
var _loaderModule = global.require('aurelia-loader-nodejs');
return Promise.resolve(new _loaderModule.NodeJsLoader());
}

if (typeof host.require === 'function') {
if (typeof host.require === 'function' && typeof host.require.version === 'string') {
return new Promise(function (resolve, reject) {
return host.require(['aurelia-loader-default'], function (m) {
return resolve(new m.DefaultLoader());
}, reject);
});
}

if (isNodeLike && typeof module !== 'undefined' && typeof module.require !== 'undefined') {
var _m = module.require('aurelia-loader-nodejs');
return Promise.resolve(new _m.NodeJsLoader());
}

return Promise.reject('No PLATFORM.Loader is defined and there is neither a System API (ES6) or a Require API (AMD) globally available to load your app.');
}

function initializePal(loader) {
var type = void 0;

if (typeof window !== 'undefined') {
var isElectronRenderer = isNodeLike && process.type === 'renderer';

if (isNodeLike && !isElectronRenderer) {
type = 'nodejs';
} else if (typeof window !== 'undefined') {
type = 'browser';
} else if (typeof self !== 'undefined') {
type = 'worker';
} else if (typeof global !== 'undefined') {
type = 'nodejs';
} else {
throw new Error('Could not determine platform implementation to load.');
}

return loader.loadModule('aurelia-pal-' + type).then(function (palModule) {
return palModule.initialize();
return type === 'nodejs' && !_aureliaPal.isInitialized && palModule.globalize() || palModule.initialize();
});
}

Expand Down
33 changes: 18 additions & 15 deletions dist/es2015/aurelia-bootstrapper.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import 'aurelia-polyfills';
import { PLATFORM } from 'aurelia-pal';
import { PLATFORM, isInitialized } from 'aurelia-pal';

let bootstrapQueue = [];
let sharedLoader = null;
let Aurelia = null;
let host = PLATFORM.global;
const host = PLATFORM.global;
const isNodeLike = typeof process !== 'undefined' && !process.browser;

function onBootstrap(callback) {
return new Promise((resolve, reject) => {
Expand All @@ -24,7 +25,7 @@ function onBootstrap(callback) {

function ready() {
return new Promise((resolve, reject) => {
if (host.document.readyState === 'complete') {
if (!host.document || host.document.readyState === 'complete') {
resolve();
} else {
host.document.addEventListener('DOMContentLoaded', completed);
Expand All @@ -45,25 +46,25 @@ function createLoader() {
}

if (typeof __webpack_require__ !== 'undefined') {
const loaderModule = __webpack_require__(require.resolve('aurelia-loader-webpack'));
return Promise.resolve(new loaderModule.WebpackLoader());
const m = __webpack_require__(require.resolve('aurelia-loader-webpack'));
return Promise.resolve(new m.WebpackLoader());
}

if (host.System && typeof host.System.import === 'function') {
if (host.System && typeof host.System.config === 'function') {
return host.System.normalize('aurelia-bootstrapper').then(bsn => {
return host.System.normalize('aurelia-loader-default', bsn);
}).then(loaderName => {
return host.System.import(loaderName).then(m => new m.DefaultLoader());
});
}

if (typeof global !== 'undefined' && typeof global.require !== 'undefined') {
const loaderModule = global.require('aurelia-loader-nodejs');
return Promise.resolve(new loaderModule.NodeJsLoader());
if (typeof host.require === 'function' && typeof host.require.version === 'string') {
return new Promise((resolve, reject) => host.require(['aurelia-loader-default'], m => resolve(new m.DefaultLoader()), reject));
}

if (typeof host.require === 'function') {
return new Promise((resolve, reject) => host.require(['aurelia-loader-default'], m => resolve(new m.DefaultLoader()), reject));
if (isNodeLike && typeof module !== 'undefined' && typeof module.require !== 'undefined') {
const m = module.require('aurelia-loader-nodejs');
return Promise.resolve(new m.NodeJsLoader());
}

return Promise.reject('No PLATFORM.Loader is defined and there is neither a System API (ES6) or a Require API (AMD) globally available to load your app.');
Expand All @@ -72,17 +73,19 @@ function createLoader() {
function initializePal(loader) {
let type;

if (typeof window !== 'undefined') {
const isElectronRenderer = isNodeLike && process.type === 'renderer';

if (isNodeLike && !isElectronRenderer) {
type = 'nodejs';
} else if (typeof window !== 'undefined') {
type = 'browser';
} else if (typeof self !== 'undefined') {
type = 'worker';
} else if (typeof global !== 'undefined') {
type = 'nodejs';
} else {
throw new Error('Could not determine platform implementation to load.');
}

return loader.loadModule('aurelia-pal-' + type).then(palModule => palModule.initialize());
return loader.loadModule('aurelia-pal-' + type).then(palModule => type === 'nodejs' && !isInitialized && palModule.globalize() || palModule.initialize());
}

function preparePlatform(loader) {
Expand Down
Loading

0 comments on commit 11f31bf

Please sign in to comment.