From 79d26ee742479474a3a321c639328997e31ffbc3 Mon Sep 17 00:00:00 2001 From: vsoftic Date: Tue, 2 Feb 2016 07:49:25 +0100 Subject: [PATCH] fix(Intl.js): update intl.js updates the used version of the Intl.js polyfill and switches to installing it from NPM. --- config.js | 6 +++++- package.json | 28 +++++----------------------- src/aurelia-i18n.js | 4 ++-- test/unit/numberformat.spec.js | 1 + 4 files changed, 13 insertions(+), 26 deletions(-) diff --git a/config.js b/config.js index ce3ad744..08a11ade 100644 --- a/config.js +++ b/config.js @@ -13,10 +13,11 @@ System.config({ }, map: { - "Intl.js": "github:andyearnshaw/Intl.js@0.1.4", + "Intl.js": "npm:intl@1.0.1", "aurelia-binding": "npm:aurelia-binding@1.0.0-beta.1.1.1", "aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.0.0-beta.1.1.2", "aurelia-event-aggregator": "npm:aurelia-event-aggregator@1.0.0-beta.1.1.0", + "aurelia-loader": "npm:aurelia-loader@1.0.0-beta.1.1.0", "aurelia-loader-default": "npm:aurelia-loader-default@1.0.0-beta.1.1.1", "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.1.1", "aurelia-pal-browser": "npm:aurelia-pal-browser@1.0.0-beta.1.1.2", @@ -111,6 +112,9 @@ System.config({ "npm:inherits@2.0.1": { "util": "github:jspm/nodelibs-util@0.1.0" }, + "npm:intl@1.0.1": { + "process": "github:jspm/nodelibs-process@0.1.2" + }, "npm:path-browserify@0.0.0": { "process": "github:jspm/nodelibs-process@0.1.2" }, diff --git a/package.json b/package.json index c99d78d5..17354b5b 100644 --- a/package.json +++ b/package.json @@ -21,24 +21,19 @@ }, "jspm": { "registry": "npm", - "jspmPackage": true, "main": "aurelia-i18n", "format": "amd", "directories": { "dist": "dist/amd" }, "dependencies": { - "Intl.js": "andyearnshaw/Intl.js@^0.1.4", - "i18next": "i18next/i18next@^1.9.0" - }, - "peerDependencies": { - "aurelia-binding": "^1.0.0-beta.1.1.0", - "aurelia-dependency-injection": "^1.0.0-beta.1.1.2", + "Intl.js": "intl@^1.0.1", + "aurelia-binding": "^1.0.0-beta.1.1.1", "aurelia-event-aggregator": "^1.0.0-beta.1.1.0", - "aurelia-loader-default": "^1.0.0-beta.1.1.1", - "aurelia-pal": "^1.0.0-beta.1.1.1", + "aurelia-loader": "^1.0.0-beta.1.1.0", "aurelia-templating": "^1.0.0-beta.1.1.0", - "aurelia-templating-resources": "^1.0.0-beta.1.1.0" + "aurelia-templating-resources": "^1.0.0-beta.1.1.0", + "i18next": "i18next/i18next@^1.9.0" }, "devDependencies": { "aurelia-pal-browser": "^1.0.0-beta.1.1.2", @@ -48,19 +43,6 @@ "text": "github:systemjs/plugin-text@^0.0.2" } }, - "peerDependencies": { - "aurelia-binding": "^1.0.0-beta.1.1.0", - "aurelia-dependency-injection": "^1.0.0-beta.1.1.2", - "aurelia-event-aggregator": "^1.0.0-beta.1.1.0", - "aurelia-loader-default": "^1.0.0-beta.1.1.1", - "aurelia-pal": "^1.0.0-beta.1.1.1", - "aurelia-templating": "^1.0.0-beta.1.1.0", - "aurelia-templating-resources": "^1.0.0-beta.1.1.0" - }, - "dependencies": { - "Intl.js": "andyearnshaw/Intl.js@^0.1.4", - "i18next": "i18next/i18next@^1.9.0" - }, "devDependencies": { "aurelia-tools": "^0.1.15", "babel": "^5.8.23", diff --git a/src/aurelia-i18n.js b/src/aurelia-i18n.js index 127a4b8c..d5f96f72 100644 --- a/src/aurelia-i18n.js +++ b/src/aurelia-i18n.js @@ -1,6 +1,6 @@ import {EventAggregator} from 'aurelia-event-aggregator'; import {ViewResources} from 'aurelia-templating'; -import {DefaultLoader} from 'aurelia-loader-default'; +import {Loader} from 'aurelia-loader'; import {BindingSignaler} from 'aurelia-templating-resources'; import {I18N} from './i18n'; @@ -51,7 +51,7 @@ function configure(frameworkConfig, cb): Promise { // check whether Intl is available, otherwise load the polyfill if (window.Intl === undefined) { - let loader = frameworkConfig.container.get(DefaultLoader); + let loader = frameworkConfig.container.get(Loader); return loader.normalize('aurelia-i18n').then((i18nName) => { return loader.normalize('Intl.js', i18nName).then((intlName) => { diff --git a/test/unit/numberformat.spec.js b/test/unit/numberformat.spec.js index 92f24d82..23425766 100644 --- a/test/unit/numberformat.spec.js +++ b/test/unit/numberformat.spec.js @@ -2,6 +2,7 @@ import {I18N} from '../../src/i18n'; import {BindingSignaler} from 'aurelia-templating-resources'; import {EventAggregator} from 'aurelia-event-aggregator'; import Intl from 'Intl.js'; +import * as allData from 'Intl.js/locale-data/complete'; describe('numberformat tests', () => { let sut;