Skip to content

Commit

Permalink
Use AMD paths mappings
Browse files Browse the repository at this point in the history
Fixes ibm-js#73
  • Loading branch information
rxaviers committed Oct 7, 2014
1 parent 80e3b79 commit bacbb08
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 20 deletions.
3 changes: 0 additions & 3 deletions .bowerrc

This file was deleted.

6 changes: 3 additions & 3 deletions Intl.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
define([ "./impl/Record", "./impl/calendars", "./impl/common", "./locales!",
"requirejs-text/text!./cldr/supplemental/currencyData.json",
"requirejs-text/text!./cldr/supplemental/timeData.json",
"requirejs-text/text!./cldr/supplemental/numberingSystems.json" ],
"text!cldr/supplemental/currencyData.json",
"text!cldr/supplemental/timeData.json",
"text!cldr/supplemental/numberingSystems.json" ],
function (Record, calendars, common, preloads,
currencyDataJson, timeDataJson, numberingSystemsJson) {
/**
Expand Down
4 changes: 2 additions & 2 deletions impl/calendarFunctions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define([ "./Record", "requirejs-text/text!../cldr/supplemental/calendarData.json"],
define([ "./Record", "text!cldr/supplemental/calendarData.json"],
function (Record, calendarDataJson) {
/**
* Utility functions that are common across multiple
Expand Down Expand Up @@ -73,4 +73,4 @@ define([ "./Record", "requirejs-text/text!../cldr/supplemental/calendarData.json
}
};
return calendarFunctions;
});
});
2 changes: 1 addition & 1 deletion impl/calendars.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
define([ "./Record",
"requirejs-text/text!../cldr/config/calendarDependencies.json",
"text!cldr/config/calendarDependencies.json",
"../calendars/gregorianCalendar"],
/**
* Functions and data related to implementation of calendars.
Expand Down
14 changes: 7 additions & 7 deletions impl/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
* Commonly used routines throughout ECMA-402 package. Also referred to in the standard as "Abstract Operations"
*/
define(["./List", "./Record",
"requirejs-text/text!../cldr/config/availableLocales.json",
"requirejs-text/text!../cldr/supplemental/aliases.json",
"requirejs-text/text!../cldr/supplemental/localeAliases.json",
"requirejs-text/text!../cldr/supplemental/parentLocales.json",
"requirejs-text/text!../cldr/supplemental/likelySubtags.json",
"requirejs-text/text!../cldr/supplemental/calendarPreferenceData.json",
"text!cldr/config/availableLocales.json",
"text!cldr/supplemental/aliases.json",
"text!cldr/supplemental/localeAliases.json",
"text!cldr/supplemental/parentLocales.json",
"text!cldr/supplemental/likelySubtags.json",
"text!cldr/supplemental/calendarPreferenceData.json",
],
function (List, Record, availableLocalesJson, aliasesJson, localeAliasesJson,
parentLocalesJson, likelySubtagsJson, calendarPreferenceDataJson) {
Expand Down Expand Up @@ -724,4 +724,4 @@ define(["./List", "./Record",

common.availableLocalesList = common.CanonicalizeLocaleList(JSON.parse(availableLocalesJson).availableLocales);
return common;
});
});
4 changes: 2 additions & 2 deletions impl/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ define([
"./common",
"require",
"module",
"requirejs-text/text" // just so builder knows we will be using that module
"text" // just so builder knows we will be using that module
], function (calendars, common, require, module) {
return {
id: module.id,
Expand Down Expand Up @@ -38,7 +38,7 @@ define([
dependencies = jsonElements = [config._layerMid + "_" + locale];
} else {
dependencies = jsonElements.map(function (element) {
return "requirejs-text/text!../cldr/" + locale + "/" + element + ".json";
return "text!cldr/" + locale + "/" + element + ".json";
});
}

Expand Down
8 changes: 6 additions & 2 deletions tests/intern.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,19 @@ define({
// loader
useLoader: {
"host-node": "requirejs",
"host-browser": "../../../requirejs/require.js"
"host-browser": "../../bower_components/requirejs/require.js"
},

// Configuration options for the module loader; any AMD configuration options supported by the specified AMD loader
// can be used here
loader: {
baseUrl: "..",
config : {
"ecma402/locales" : /^(ar|de(-CH)?|el|en(-(GB|NZ))?|es|fr|he|hi|id|ja|pt.*|sl|sr(-Latn)?|th|zh.*)$/
},
paths: {
"ecma402": ".",
"requirejs-dplugins": "bower_components/requirejs-dplugins",
"text": "bower_components/requirejs-text/text"
}
},

Expand Down

0 comments on commit bacbb08

Please sign in to comment.