Skip to content

Commit c4e93cf

Browse files
chore(all): prepare release 1.0.0-beta.1.2.1
1 parent 335f855 commit c4e93cf

File tree

9 files changed

+190
-68
lines changed

9 files changed

+190
-68
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "aurelia-framework",
3-
"version": "1.0.0-beta.1.2.0",
3+
"version": "1.0.0-beta.1.2.1",
44
"description": "The aurelia framework brings together all the required core aurelia libraries into a ready-to-go application-building platform.",
55
"keywords": [
66
"aurelia",

dist/amd/aurelia-framework.js

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ define(['exports', 'aurelia-dependency-injection', 'aurelia-binding', 'aurelia-m
240240
}();
241241

242242
var logger = TheLogManager.getLogger('aurelia');
243+
var extPattern = /\.[^/.]+$/;
243244

244245
function runTasks(config, tasks) {
245246
var current = void 0;
@@ -301,13 +302,43 @@ define(['exports', 'aurelia-dependency-injection', 'aurelia-binding', 'aurelia-m
301302
});
302303

303304
function _normalize(load) {
304-
return aurelia.loader.normalize(load.moduleId, load.relativeTo).then(function (normalized) {
305+
var moduleId = load.moduleId;
306+
var ext = getExt(moduleId);
307+
308+
if (isOtherResource(moduleId)) {
309+
moduleId = removeExt(moduleId);
310+
}
311+
312+
return aurelia.loader.normalize(moduleId, load.relativeTo).then(function (normalized) {
305313
return {
306314
name: load.moduleId,
307-
importId: normalized
315+
importId: isOtherResource(load.moduleId) ? addOriginalExt(normalized, ext) : normalized
308316
};
309317
});
310318
}
319+
320+
function isOtherResource(name) {
321+
var ext = getExt(name);
322+
if (!ext) return false;
323+
if (ext === '') return false;
324+
if (ext === '.js' || ext === '.ts') return false;
325+
return true;
326+
}
327+
328+
function removeExt(name) {
329+
return name.replace(extPattern, '');
330+
}
331+
332+
function addOriginalExt(normalized, ext) {
333+
return removeExt(normalized) + '.' + ext;
334+
}
335+
}
336+
337+
function getExt(name) {
338+
var match = name.match(extPattern);
339+
if (match && match.length > 0) {
340+
return match[0].split('.')[1];
341+
}
311342
}
312343

313344
function assertProcessed(plugins) {
@@ -367,15 +398,11 @@ define(['exports', 'aurelia-dependency-injection', 'aurelia-binding', 'aurelia-m
367398
};
368399

369400
FrameworkConfiguration.prototype.feature = function feature(plugin, config) {
370-
if (hasExt(plugin)) {
401+
if (getExt(plugin)) {
371402
return this.plugin({ moduleId: plugin, resourcesRelativeTo: [plugin, ''], config: config || {} });
372403
}
373404

374405
return this.plugin({ moduleId: plugin + '/index', resourcesRelativeTo: [plugin, ''], config: config || {} });
375-
376-
function hasExt(name) {
377-
return plugin.split('.').length > 1;
378-
}
379406
};
380407

381408
FrameworkConfiguration.prototype.globalResources = function globalResources(resources) {

dist/aurelia-framework.js

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ export class Aurelia {
169169

170170
/*eslint no-unused-vars:0, no-cond-assign:0*/
171171
const logger = TheLogManager.getLogger('aurelia');
172+
const extPattern = /\.[^/.]+$/;
172173

173174
function runTasks(config, tasks) {
174175
let current;
@@ -228,14 +229,44 @@ function loadResources(aurelia, resourcesToLoad, appResources) {
228229
});
229230

230231
function _normalize(load) {
231-
return aurelia.loader.normalize(load.moduleId, load.relativeTo)
232+
let moduleId = load.moduleId;
233+
let ext = getExt(moduleId);
234+
235+
if (isOtherResource(moduleId)) {
236+
moduleId = removeExt(moduleId);
237+
}
238+
239+
return aurelia.loader.normalize(moduleId, load.relativeTo)
232240
.then(normalized => {
233241
return {
234242
name: load.moduleId,
235-
importId: normalized
243+
importId: isOtherResource(load.moduleId) ? addOriginalExt(normalized, ext) : normalized
236244
};
237245
});
238246
}
247+
248+
function isOtherResource(name) {
249+
let ext = getExt(name);
250+
if (!ext) return false;
251+
if (ext === '') return false;
252+
if (ext === '.js' || ext === '.ts') return false;
253+
return true;
254+
}
255+
256+
function removeExt(name) {
257+
return name.replace(extPattern, '');
258+
}
259+
260+
function addOriginalExt(normalized, ext) {
261+
return removeExt(normalized) + '.' + ext;
262+
}
263+
}
264+
265+
function getExt(name) {
266+
let match = name.match(extPattern);
267+
if (match && match.length > 0) {
268+
return (match[0].split('.'))[1];
269+
}
239270
}
240271

241272
function assertProcessed(plugins) {
@@ -336,15 +367,11 @@ export class FrameworkConfiguration {
336367
* @return Returns the current FrameworkConfiguration instance.
337368
*/
338369
feature(plugin: string, config?: any): FrameworkConfiguration {
339-
if (hasExt(plugin)) {
370+
if (getExt(plugin)) {
340371
return this.plugin({ moduleId: plugin, resourcesRelativeTo: [plugin, ''], config: config || {} });
341372
}
342373

343374
return this.plugin({ moduleId: plugin + '/index', resourcesRelativeTo: [plugin, ''], config: config || {} });
344-
345-
function hasExt(name) {
346-
return (plugin.split('.')).length > 1;
347-
}
348375
}
349376

350377
/**

dist/commonjs/aurelia-framework.js

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ var Aurelia = exports.Aurelia = function () {
246246
}();
247247

248248
var logger = TheLogManager.getLogger('aurelia');
249+
var extPattern = /\.[^/.]+$/;
249250

250251
function runTasks(config, tasks) {
251252
var current = void 0;
@@ -307,13 +308,43 @@ function loadResources(aurelia, resourcesToLoad, appResources) {
307308
});
308309

309310
function _normalize(load) {
310-
return aurelia.loader.normalize(load.moduleId, load.relativeTo).then(function (normalized) {
311+
var moduleId = load.moduleId;
312+
var ext = getExt(moduleId);
313+
314+
if (isOtherResource(moduleId)) {
315+
moduleId = removeExt(moduleId);
316+
}
317+
318+
return aurelia.loader.normalize(moduleId, load.relativeTo).then(function (normalized) {
311319
return {
312320
name: load.moduleId,
313-
importId: normalized
321+
importId: isOtherResource(load.moduleId) ? addOriginalExt(normalized, ext) : normalized
314322
};
315323
});
316324
}
325+
326+
function isOtherResource(name) {
327+
var ext = getExt(name);
328+
if (!ext) return false;
329+
if (ext === '') return false;
330+
if (ext === '.js' || ext === '.ts') return false;
331+
return true;
332+
}
333+
334+
function removeExt(name) {
335+
return name.replace(extPattern, '');
336+
}
337+
338+
function addOriginalExt(normalized, ext) {
339+
return removeExt(normalized) + '.' + ext;
340+
}
341+
}
342+
343+
function getExt(name) {
344+
var match = name.match(extPattern);
345+
if (match && match.length > 0) {
346+
return match[0].split('.')[1];
347+
}
317348
}
318349

319350
function assertProcessed(plugins) {
@@ -373,15 +404,11 @@ var FrameworkConfiguration = function () {
373404
};
374405

375406
FrameworkConfiguration.prototype.feature = function feature(plugin, config) {
376-
if (hasExt(plugin)) {
407+
if (getExt(plugin)) {
377408
return this.plugin({ moduleId: plugin, resourcesRelativeTo: [plugin, ''], config: config || {} });
378409
}
379410

380411
return this.plugin({ moduleId: plugin + '/index', resourcesRelativeTo: [plugin, ''], config: config || {} });
381-
382-
function hasExt(name) {
383-
return plugin.split('.').length > 1;
384-
}
385412
};
386413

387414
FrameworkConfiguration.prototype.globalResources = function globalResources(resources) {

dist/es2015/aurelia-framework.js

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ export let Aurelia = class Aurelia {
124124
};
125125

126126
const logger = TheLogManager.getLogger('aurelia');
127+
const extPattern = /\.[^/.]+$/;
127128

128129
function runTasks(config, tasks) {
129130
let current;
@@ -181,13 +182,43 @@ function loadResources(aurelia, resourcesToLoad, appResources) {
181182
});
182183

183184
function _normalize(load) {
184-
return aurelia.loader.normalize(load.moduleId, load.relativeTo).then(normalized => {
185+
let moduleId = load.moduleId;
186+
let ext = getExt(moduleId);
187+
188+
if (isOtherResource(moduleId)) {
189+
moduleId = removeExt(moduleId);
190+
}
191+
192+
return aurelia.loader.normalize(moduleId, load.relativeTo).then(normalized => {
185193
return {
186194
name: load.moduleId,
187-
importId: normalized
195+
importId: isOtherResource(load.moduleId) ? addOriginalExt(normalized, ext) : normalized
188196
};
189197
});
190198
}
199+
200+
function isOtherResource(name) {
201+
let ext = getExt(name);
202+
if (!ext) return false;
203+
if (ext === '') return false;
204+
if (ext === '.js' || ext === '.ts') return false;
205+
return true;
206+
}
207+
208+
function removeExt(name) {
209+
return name.replace(extPattern, '');
210+
}
211+
212+
function addOriginalExt(normalized, ext) {
213+
return removeExt(normalized) + '.' + ext;
214+
}
215+
}
216+
217+
function getExt(name) {
218+
let match = name.match(extPattern);
219+
if (match && match.length > 0) {
220+
return match[0].split('.')[1];
221+
}
191222
}
192223

193224
function assertProcessed(plugins) {
@@ -237,15 +268,11 @@ export let FrameworkConfiguration = class FrameworkConfiguration {
237268
}
238269

239270
feature(plugin, config) {
240-
if (hasExt(plugin)) {
271+
if (getExt(plugin)) {
241272
return this.plugin({ moduleId: plugin, resourcesRelativeTo: [plugin, ''], config: config || {} });
242273
}
243274

244275
return this.plugin({ moduleId: plugin + '/index', resourcesRelativeTo: [plugin, ''], config: config || {} });
245-
246-
function hasExt(name) {
247-
return plugin.split('.').length > 1;
248-
}
249276
}
250277

251278
globalResources(resources) {

dist/system/aurelia-framework.js

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
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) {
4-
var TheLogManager, Container, Loader, BindingLanguage, ViewSlot, ViewResources, TemplatingEngine, CompositionTransaction, ViewEngine, DOM, PLATFORM, join, Aurelia, logger, FrameworkConfiguration, LogManager;
4+
var TheLogManager, Container, Loader, BindingLanguage, ViewSlot, ViewResources, TemplatingEngine, CompositionTransaction, ViewEngine, DOM, PLATFORM, join, Aurelia, logger, extPattern, FrameworkConfiguration, LogManager;
55

66
function _classCallCheck(instance, Constructor) {
77
if (!(instance instanceof Constructor)) {
@@ -80,13 +80,43 @@ System.register(['aurelia-logging', 'aurelia-dependency-injection', 'aurelia-loa
8080
});
8181

8282
function _normalize(load) {
83-
return aurelia.loader.normalize(load.moduleId, load.relativeTo).then(function (normalized) {
83+
var moduleId = load.moduleId;
84+
var ext = getExt(moduleId);
85+
86+
if (isOtherResource(moduleId)) {
87+
moduleId = removeExt(moduleId);
88+
}
89+
90+
return aurelia.loader.normalize(moduleId, load.relativeTo).then(function (normalized) {
8491
return {
8592
name: load.moduleId,
86-
importId: normalized
93+
importId: isOtherResource(load.moduleId) ? addOriginalExt(normalized, ext) : normalized
8794
};
8895
});
8996
}
97+
98+
function isOtherResource(name) {
99+
var ext = getExt(name);
100+
if (!ext) return false;
101+
if (ext === '') return false;
102+
if (ext === '.js' || ext === '.ts') return false;
103+
return true;
104+
}
105+
106+
function removeExt(name) {
107+
return name.replace(extPattern, '');
108+
}
109+
110+
function addOriginalExt(normalized, ext) {
111+
return removeExt(normalized) + '.' + ext;
112+
}
113+
}
114+
115+
function getExt(name) {
116+
var match = name.match(extPattern);
117+
if (match && match.length > 0) {
118+
return match[0].split('.')[1];
119+
}
90120
}
91121

92122
function assertProcessed(plugins) {
@@ -303,6 +333,7 @@ System.register(['aurelia-logging', 'aurelia-dependency-injection', 'aurelia-loa
303333
_export('Aurelia', Aurelia);
304334

305335
logger = TheLogManager.getLogger('aurelia');
336+
extPattern = /\.[^/.]+$/;
306337

307338
_export('FrameworkConfiguration', FrameworkConfiguration = function () {
308339
function FrameworkConfiguration(aurelia) {
@@ -355,15 +386,11 @@ System.register(['aurelia-logging', 'aurelia-dependency-injection', 'aurelia-loa
355386
};
356387

357388
FrameworkConfiguration.prototype.feature = function feature(plugin, config) {
358-
if (hasExt(plugin)) {
389+
if (getExt(plugin)) {
359390
return this.plugin({ moduleId: plugin, resourcesRelativeTo: [plugin, ''], config: config || {} });
360391
}
361392

362393
return this.plugin({ moduleId: plugin + '/index', resourcesRelativeTo: [plugin, ''], config: config || {} });
363-
364-
function hasExt(name) {
365-
return plugin.split('.').length > 1;
366-
}
367394
};
368395

369396
FrameworkConfiguration.prototype.globalResources = function globalResources(resources) {

doc/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
### 1.0.0-beta.1.2.1 (2016-03-29)
2+
3+
4+
#### Bug Fixes
5+
6+
* **feature:** use proper parameter to check extension ([c179a3e9](http://github.com/aurelia/framework/commit/c179a3e97565a55a059d86ebb73dcee18732ede1))
7+
* **framework-configuration:** getExt return invalid extension when relative path is supplied ([335f8559](http://github.com/aurelia/framework/commit/335f8559eafaf5df1884489d1e29850669fb2204))
8+
* **global resource:** load resources other than .ts or .js ([b57f290a](http://github.com/aurelia/framework/commit/b57f290ab97d15cc9e0eedd18ec64af97c004e70))
9+
10+
111
### 1.0.0-beta.1.2.0 (2016-03-22)
212

313

0 commit comments

Comments
 (0)