From c4e93cff7a3e028cfac060ae1c3dc31a2e1c3e08 Mon Sep 17 00:00:00 2001 From: Rob Eisenberg Date: Tue, 29 Mar 2016 10:00:56 -0400 Subject: [PATCH] chore(all): prepare release 1.0.0-beta.1.2.1 --- bower.json | 2 +- dist/amd/aurelia-framework.js | 41 +++++++++++++++++++++++----- dist/aurelia-framework.js | 41 +++++++++++++++++++++++----- dist/commonjs/aurelia-framework.js | 41 +++++++++++++++++++++++----- dist/es2015/aurelia-framework.js | 41 +++++++++++++++++++++++----- dist/system/aurelia-framework.js | 43 ++++++++++++++++++++++++------ doc/CHANGELOG.md | 10 +++++++ doc/api.json | 37 +++++-------------------- package.json | 2 +- 9 files changed, 190 insertions(+), 68 deletions(-) diff --git a/bower.json b/bower.json index 066c0911..a044c4ad 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "aurelia-framework", - "version": "1.0.0-beta.1.2.0", + "version": "1.0.0-beta.1.2.1", "description": "The aurelia framework brings together all the required core aurelia libraries into a ready-to-go application-building platform.", "keywords": [ "aurelia", diff --git a/dist/amd/aurelia-framework.js b/dist/amd/aurelia-framework.js index 673f3bb3..10deded2 100644 --- a/dist/amd/aurelia-framework.js +++ b/dist/amd/aurelia-framework.js @@ -240,6 +240,7 @@ define(['exports', 'aurelia-dependency-injection', 'aurelia-binding', 'aurelia-m }(); var logger = TheLogManager.getLogger('aurelia'); + var extPattern = /\.[^/.]+$/; function runTasks(config, tasks) { var current = void 0; @@ -301,13 +302,43 @@ define(['exports', 'aurelia-dependency-injection', 'aurelia-binding', 'aurelia-m }); function _normalize(load) { - return aurelia.loader.normalize(load.moduleId, load.relativeTo).then(function (normalized) { + var moduleId = load.moduleId; + var ext = getExt(moduleId); + + if (isOtherResource(moduleId)) { + moduleId = removeExt(moduleId); + } + + return aurelia.loader.normalize(moduleId, load.relativeTo).then(function (normalized) { return { name: load.moduleId, - importId: normalized + importId: isOtherResource(load.moduleId) ? addOriginalExt(normalized, ext) : normalized }; }); } + + function isOtherResource(name) { + var ext = getExt(name); + if (!ext) return false; + if (ext === '') return false; + if (ext === '.js' || ext === '.ts') return false; + return true; + } + + function removeExt(name) { + return name.replace(extPattern, ''); + } + + function addOriginalExt(normalized, ext) { + return removeExt(normalized) + '.' + ext; + } + } + + function getExt(name) { + var match = name.match(extPattern); + if (match && match.length > 0) { + return match[0].split('.')[1]; + } } function assertProcessed(plugins) { @@ -367,15 +398,11 @@ define(['exports', 'aurelia-dependency-injection', 'aurelia-binding', 'aurelia-m }; FrameworkConfiguration.prototype.feature = function feature(plugin, config) { - if (hasExt(plugin)) { + if (getExt(plugin)) { return this.plugin({ moduleId: plugin, resourcesRelativeTo: [plugin, ''], config: config || {} }); } return this.plugin({ moduleId: plugin + '/index', resourcesRelativeTo: [plugin, ''], config: config || {} }); - - function hasExt(name) { - return plugin.split('.').length > 1; - } }; FrameworkConfiguration.prototype.globalResources = function globalResources(resources) { diff --git a/dist/aurelia-framework.js b/dist/aurelia-framework.js index 5b724f1e..eedd109c 100644 --- a/dist/aurelia-framework.js +++ b/dist/aurelia-framework.js @@ -169,6 +169,7 @@ export class Aurelia { /*eslint no-unused-vars:0, no-cond-assign:0*/ const logger = TheLogManager.getLogger('aurelia'); +const extPattern = /\.[^/.]+$/; function runTasks(config, tasks) { let current; @@ -228,14 +229,44 @@ function loadResources(aurelia, resourcesToLoad, appResources) { }); function _normalize(load) { - return aurelia.loader.normalize(load.moduleId, load.relativeTo) + let moduleId = load.moduleId; + let ext = getExt(moduleId); + + if (isOtherResource(moduleId)) { + moduleId = removeExt(moduleId); + } + + return aurelia.loader.normalize(moduleId, load.relativeTo) .then(normalized => { return { name: load.moduleId, - importId: normalized + importId: isOtherResource(load.moduleId) ? addOriginalExt(normalized, ext) : normalized }; }); } + + function isOtherResource(name) { + let ext = getExt(name); + if (!ext) return false; + if (ext === '') return false; + if (ext === '.js' || ext === '.ts') return false; + return true; + } + + function removeExt(name) { + return name.replace(extPattern, ''); + } + + function addOriginalExt(normalized, ext) { + return removeExt(normalized) + '.' + ext; + } +} + +function getExt(name) { + let match = name.match(extPattern); + if (match && match.length > 0) { + return (match[0].split('.'))[1]; + } } function assertProcessed(plugins) { @@ -336,15 +367,11 @@ export class FrameworkConfiguration { * @return Returns the current FrameworkConfiguration instance. */ feature(plugin: string, config?: any): FrameworkConfiguration { - if (hasExt(plugin)) { + if (getExt(plugin)) { return this.plugin({ moduleId: plugin, resourcesRelativeTo: [plugin, ''], config: config || {} }); } return this.plugin({ moduleId: plugin + '/index', resourcesRelativeTo: [plugin, ''], config: config || {} }); - - function hasExt(name) { - return (plugin.split('.')).length > 1; - } } /** diff --git a/dist/commonjs/aurelia-framework.js b/dist/commonjs/aurelia-framework.js index d220c2cb..e6684a10 100644 --- a/dist/commonjs/aurelia-framework.js +++ b/dist/commonjs/aurelia-framework.js @@ -246,6 +246,7 @@ var Aurelia = exports.Aurelia = function () { }(); var logger = TheLogManager.getLogger('aurelia'); +var extPattern = /\.[^/.]+$/; function runTasks(config, tasks) { var current = void 0; @@ -307,13 +308,43 @@ function loadResources(aurelia, resourcesToLoad, appResources) { }); function _normalize(load) { - return aurelia.loader.normalize(load.moduleId, load.relativeTo).then(function (normalized) { + var moduleId = load.moduleId; + var ext = getExt(moduleId); + + if (isOtherResource(moduleId)) { + moduleId = removeExt(moduleId); + } + + return aurelia.loader.normalize(moduleId, load.relativeTo).then(function (normalized) { return { name: load.moduleId, - importId: normalized + importId: isOtherResource(load.moduleId) ? addOriginalExt(normalized, ext) : normalized }; }); } + + function isOtherResource(name) { + var ext = getExt(name); + if (!ext) return false; + if (ext === '') return false; + if (ext === '.js' || ext === '.ts') return false; + return true; + } + + function removeExt(name) { + return name.replace(extPattern, ''); + } + + function addOriginalExt(normalized, ext) { + return removeExt(normalized) + '.' + ext; + } +} + +function getExt(name) { + var match = name.match(extPattern); + if (match && match.length > 0) { + return match[0].split('.')[1]; + } } function assertProcessed(plugins) { @@ -373,15 +404,11 @@ var FrameworkConfiguration = function () { }; FrameworkConfiguration.prototype.feature = function feature(plugin, config) { - if (hasExt(plugin)) { + if (getExt(plugin)) { return this.plugin({ moduleId: plugin, resourcesRelativeTo: [plugin, ''], config: config || {} }); } return this.plugin({ moduleId: plugin + '/index', resourcesRelativeTo: [plugin, ''], config: config || {} }); - - function hasExt(name) { - return plugin.split('.').length > 1; - } }; FrameworkConfiguration.prototype.globalResources = function globalResources(resources) { diff --git a/dist/es2015/aurelia-framework.js b/dist/es2015/aurelia-framework.js index b78f9668..f872b530 100644 --- a/dist/es2015/aurelia-framework.js +++ b/dist/es2015/aurelia-framework.js @@ -124,6 +124,7 @@ export let Aurelia = class Aurelia { }; const logger = TheLogManager.getLogger('aurelia'); +const extPattern = /\.[^/.]+$/; function runTasks(config, tasks) { let current; @@ -181,13 +182,43 @@ function loadResources(aurelia, resourcesToLoad, appResources) { }); function _normalize(load) { - return aurelia.loader.normalize(load.moduleId, load.relativeTo).then(normalized => { + let moduleId = load.moduleId; + let ext = getExt(moduleId); + + if (isOtherResource(moduleId)) { + moduleId = removeExt(moduleId); + } + + return aurelia.loader.normalize(moduleId, load.relativeTo).then(normalized => { return { name: load.moduleId, - importId: normalized + importId: isOtherResource(load.moduleId) ? addOriginalExt(normalized, ext) : normalized }; }); } + + function isOtherResource(name) { + let ext = getExt(name); + if (!ext) return false; + if (ext === '') return false; + if (ext === '.js' || ext === '.ts') return false; + return true; + } + + function removeExt(name) { + return name.replace(extPattern, ''); + } + + function addOriginalExt(normalized, ext) { + return removeExt(normalized) + '.' + ext; + } +} + +function getExt(name) { + let match = name.match(extPattern); + if (match && match.length > 0) { + return match[0].split('.')[1]; + } } function assertProcessed(plugins) { @@ -237,15 +268,11 @@ export let FrameworkConfiguration = class FrameworkConfiguration { } feature(plugin, config) { - if (hasExt(plugin)) { + if (getExt(plugin)) { return this.plugin({ moduleId: plugin, resourcesRelativeTo: [plugin, ''], config: config || {} }); } return this.plugin({ moduleId: plugin + '/index', resourcesRelativeTo: [plugin, ''], config: config || {} }); - - function hasExt(name) { - return plugin.split('.').length > 1; - } } globalResources(resources) { diff --git a/dist/system/aurelia-framework.js b/dist/system/aurelia-framework.js index bc776c6d..3dbf4e28 100644 --- a/dist/system/aurelia-framework.js +++ b/dist/system/aurelia-framework.js @@ -1,7 +1,7 @@ 'use strict'; System.register(['aurelia-logging', 'aurelia-dependency-injection', 'aurelia-loader', 'aurelia-templating', 'aurelia-pal', 'aurelia-path', 'aurelia-binding', 'aurelia-metadata', 'aurelia-task-queue'], function (_export, _context) { - var TheLogManager, Container, Loader, BindingLanguage, ViewSlot, ViewResources, TemplatingEngine, CompositionTransaction, ViewEngine, DOM, PLATFORM, join, Aurelia, logger, FrameworkConfiguration, LogManager; + var TheLogManager, Container, Loader, BindingLanguage, ViewSlot, ViewResources, TemplatingEngine, CompositionTransaction, ViewEngine, DOM, PLATFORM, join, Aurelia, logger, extPattern, FrameworkConfiguration, LogManager; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { @@ -80,13 +80,43 @@ System.register(['aurelia-logging', 'aurelia-dependency-injection', 'aurelia-loa }); function _normalize(load) { - return aurelia.loader.normalize(load.moduleId, load.relativeTo).then(function (normalized) { + var moduleId = load.moduleId; + var ext = getExt(moduleId); + + if (isOtherResource(moduleId)) { + moduleId = removeExt(moduleId); + } + + return aurelia.loader.normalize(moduleId, load.relativeTo).then(function (normalized) { return { name: load.moduleId, - importId: normalized + importId: isOtherResource(load.moduleId) ? addOriginalExt(normalized, ext) : normalized }; }); } + + function isOtherResource(name) { + var ext = getExt(name); + if (!ext) return false; + if (ext === '') return false; + if (ext === '.js' || ext === '.ts') return false; + return true; + } + + function removeExt(name) { + return name.replace(extPattern, ''); + } + + function addOriginalExt(normalized, ext) { + return removeExt(normalized) + '.' + ext; + } + } + + function getExt(name) { + var match = name.match(extPattern); + if (match && match.length > 0) { + return match[0].split('.')[1]; + } } function assertProcessed(plugins) { @@ -303,6 +333,7 @@ System.register(['aurelia-logging', 'aurelia-dependency-injection', 'aurelia-loa _export('Aurelia', Aurelia); logger = TheLogManager.getLogger('aurelia'); + extPattern = /\.[^/.]+$/; _export('FrameworkConfiguration', FrameworkConfiguration = function () { function FrameworkConfiguration(aurelia) { @@ -355,15 +386,11 @@ System.register(['aurelia-logging', 'aurelia-dependency-injection', 'aurelia-loa }; FrameworkConfiguration.prototype.feature = function feature(plugin, config) { - if (hasExt(plugin)) { + if (getExt(plugin)) { return this.plugin({ moduleId: plugin, resourcesRelativeTo: [plugin, ''], config: config || {} }); } return this.plugin({ moduleId: plugin + '/index', resourcesRelativeTo: [plugin, ''], config: config || {} }); - - function hasExt(name) { - return plugin.split('.').length > 1; - } }; FrameworkConfiguration.prototype.globalResources = function globalResources(resources) { diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index e8e615ce..677738d0 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,3 +1,13 @@ +### 1.0.0-beta.1.2.1 (2016-03-29) + + +#### Bug Fixes + +* **feature:** use proper parameter to check extension ([c179a3e9](http://github.com/aurelia/framework/commit/c179a3e97565a55a059d86ebb73dcee18732ede1)) +* **framework-configuration:** getExt return invalid extension when relative path is supplied ([335f8559](http://github.com/aurelia/framework/commit/335f8559eafaf5df1884489d1e29850669fb2204)) +* **global resource:** load resources other than .ts or .js ([b57f290a](http://github.com/aurelia/framework/commit/b57f290ab97d15cc9e0eedd18ec64af97c004e70)) + + ### 1.0.0-beta.1.2.0 (2016-03-22) diff --git a/doc/api.json b/doc/api.json index b2809bb5..d64d7361 100644 --- a/doc/api.json +++ b/doc/api.json @@ -53,7 +53,7 @@ "type": { "type": "reference", "name": "Loader", - "id": 636, + "id": 635, "moduleName": "\"aurelia-loader\"" } }, @@ -71,7 +71,7 @@ "type": { "type": "reference", "name": "Container", - "id": 515, + "id": 514, "moduleName": "\"aurelia-dependency-injection\"" } }, @@ -89,7 +89,7 @@ "type": { "type": "reference", "name": "ViewResources", - "id": 1258, + "id": 1257, "moduleName": "\"aurelia-templating\"" } } @@ -117,7 +117,7 @@ "type": { "type": "reference", "name": "Container", - "id": 515, + "id": 514, "moduleName": "\"aurelia-dependency-injection\"" } }, @@ -135,7 +135,7 @@ "type": { "type": "reference", "name": "Loader", - "id": 636, + "id": 635, "moduleName": "\"aurelia-loader\"" } }, @@ -153,7 +153,7 @@ "type": { "type": "reference", "name": "ViewResources", - "id": 1258, + "id": 1257, "moduleName": "\"aurelia-templating\"" } }, @@ -482,7 +482,7 @@ "type": { "type": "reference", "name": "Container", - "id": 515, + "id": 514, "moduleName": "\"aurelia-dependency-injection\"" } }, @@ -1253,22 +1253,6 @@ ] } ] - }, - { - "id": 78, - "name": "LogManager", - "kind": 32, - "kindString": "Variable", - "flags": { - "isExported": true - }, - "comment": { - "shortText": "The log manager." - }, - "type": { - "type": "instrinct", - "name": "any" - } } ], "groups": [ @@ -1279,13 +1263,6 @@ 3, 23 ] - }, - { - "title": "Variables", - "kind": 32, - "children": [ - 78 - ] } ] } \ No newline at end of file diff --git a/package.json b/package.json index 04ea878e..021f1bb6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-framework", - "version": "1.0.0-beta.1.2.0", + "version": "1.0.0-beta.1.2.1", "description": "The aurelia framework brings together all the required core aurelia libraries into a ready-to-go application-building platform.", "keywords": [ "aurelia",