diff --git a/packages/xarc-app-dev/package.json b/packages/xarc-app-dev/package.json index 86620bd96..420417a14 100644 --- a/packages/xarc-app-dev/package.json +++ b/packages/xarc-app-dev/package.json @@ -94,7 +94,7 @@ "webpack-dev-middleware": "^3.7.2", "webpack-hot-middleware": "^2.25.0", "winston": "^2.4.4", - "xaa": "^1.6.2", + "xaa": "^1.7.0", "xenv-config": "^1.3.1", "xsh": "^0.4.5" }, diff --git a/packages/xarc-app-dev/scripts/l10n/flatten-messages.js b/packages/xarc-app-dev/scripts/l10n/flatten-messages.js index 56e07cfcd..fa1da19f8 100644 --- a/packages/xarc-app-dev/scripts/l10n/flatten-messages.js +++ b/packages/xarc-app-dev/scripts/l10n/flatten-messages.js @@ -10,6 +10,7 @@ const getFilePaths = Util.promisify(require("glob")); const MESSAGES_PATTERN = "./tmp/messages/**/*.json"; const RAW_MESSAGES_DIR = "./dist/"; const RAW_MESSAGES_NAME = "raw-messages.json"; +const xaa = require("xaa"); /** * @param {String} filePath The file path @@ -37,15 +38,14 @@ function readFileAsJSON(filePath) { * @return {Promise} A promise that resolves to a flat POJO with the default messages extracted * from all files */ -function getAllDefaultMessages(messageFilesPathPattern) { - return getFilePaths(messageFilesPathPattern) - .map(readFileAsJSON) - .reduce((previousValue, defaultMessageDescriptors) => { - defaultMessageDescriptors.forEach(descriptor => { - previousValue[descriptor.id] = descriptor; - }); - return previousValue; - }, {}); +async function getAllDefaultMessages(messageFilesPathPattern) { + const fileJsons = await xaa.map(await getFilePaths(messageFilesPathPattern), readFileAsJSON); + return fileJsons.reduce((previousValue, defaultMessageDescriptors) => { + defaultMessageDescriptors.forEach(descriptor => { + previousValue[descriptor.id] = descriptor; + }); + return previousValue; + }, {}); } const writeRawMessages = _.partial(writeFileAsJSON, RAW_MESSAGES_DIR, RAW_MESSAGES_NAME);