Imports now specify the file extension to support Node v12

This commit is contained in:
n1474335 2019-07-09 12:23:59 +01:00
parent d7d50337f9
commit 566517d20f
469 changed files with 1098 additions and 1093 deletions

View file

@ -14,7 +14,7 @@
import path from "path";
import fs from "fs";
import process from "process";
import * as Ops from "../../operations/index";
import * as Ops from "../../operations/index.mjs";
const dir = path.join(process.cwd() + "/src/core/config/");
if (!fs.existsSync(dir)) {
@ -84,7 +84,7 @@ for (const module in modules) {
for (const opName in modules[module]) {
const objName = modules[module][opName];
code += `import ${objName} from "../../operations/${objName}";\n`;
code += `import ${objName} from "../../operations/${objName}.mjs";\n`;
}
code += `
@ -124,7 +124,7 @@ let opModulesCode = `/**
`;
for (const module in modules) {
opModulesCode += `import ${module}Module from "./${module}";\n`;
opModulesCode += `import ${module}Module from "./${module}.mjs";\n`;
}
opModulesCode += `

View file

@ -39,7 +39,7 @@ let code = `/**
`;
opObjs.forEach(obj => {
code += `import ${obj} from "./${obj}";\n`;
code += `import ${obj} from "./${obj}.mjs";\n`;
});
code += `

View file

@ -13,7 +13,7 @@ import colors from "colors";
import process from "process";
import fs from "fs";
import path from "path";
import EscapeString from "../../operations/EscapeString";
import EscapeString from "../../operations/EscapeString.mjs";
const dir = path.join(process.cwd() + "/src/core/operations/");
@ -130,8 +130,8 @@ prompt.get(schema, (err, result) => {
* @license Apache-2.0
*/
import Operation from "../Operation";
import OperationError from "../errors/OperationError";
import Operation from "../Operation.mjs";
import OperationError from "../errors/OperationError.mjs";
/**
* ${result.opName} operation