re-add translateTo call to chef export

This commit is contained in:
d98762625 2018-05-30 11:29:38 +01:00
parent 336810cbf4
commit 6db9521419
2 changed files with 5 additions and 14 deletions

View file

@ -388,16 +388,6 @@ module.exports = function (grunt) {
"echo '--- Config scripts finished. ---\n'" "echo '--- Config scripts finished. ---\n'"
].join(";") ].join(";")
}, },
generateNodeIndex: {
command: [
"echo '\n--- Regenerating node index ---'",
"mkdir -p src/core/config/modules",
"echo 'export default {};\n' > src/core/config/modules/OpModules.mjs",
"echo '[]\n' > src/core/config/OperationConfig.json",
"node --experimental-modules src/core/config/scripts/generateNodeIndex.mjs",
"echo '--- Node index finished. ---\n'"
].join(";"),
},
tests: { tests: {
command: "node --experimental-modules test/index.mjs" command: "node --experimental-modules test/index.mjs"
} }

View file

@ -9,8 +9,8 @@
* @license Apache-2.0 * @license Apache-2.0
*/ */
/*eslint no-console: ["off"] */ /*eslint no-console: 0 */
/* eslint camelcase: 0 */
import fs from "fs"; import fs from "fs";
import path from "path"; import path from "path";
@ -34,7 +34,7 @@ let code = `/**
*/ */
import "babel-polyfill"; import "babel-polyfill";
import { wrap } from "./apiUtils"; import { wrap, translateTo } from "./apiUtils";
import { import {
`; `;
@ -74,7 +74,7 @@ code += ` };
} }
const chef = generateChef(); const chef = generateChef();
chef.translateTo = translateTo;
`; `;
Object.keys(operations).forEach((op) => { Object.keys(operations).forEach((op) => {
@ -82,6 +82,7 @@ Object.keys(operations).forEach((op) => {
}); });
code +=` code +=`
export default chef; export default chef;
export { export {
`; `;