undeclarye module type, remove deep import test. add file extensions to some imports

This commit is contained in:
d98762625 2020-05-22 11:46:21 +01:00
parent ce7427b288
commit 16db8b0b72
7 changed files with 11 additions and 47 deletions

36
src/node/repl.mjs Normal file
View file

@ -0,0 +1,36 @@
/**
* Create a REPL server for chef
*
*
* @author d98762656 [d98762625@gmail.com]
* @copyright Crown Copyright 2018
* @license Apache-2.0
*/
import chef from "./index.mjs"
import repl from "repl"
/* eslint no-console: ["off"] */
console.log(`
______ __ ________ ____
/ ____/_ __/ /_ ___ _____/ ____/ /_ ___ / __/
/ / / / / / __ \\/ _ \\/ ___/ / / __ \\/ _ \\/ /_
/ /___/ /_/ / /_/ / __/ / / /___/ / / / __/ __/
\\____/\\__, /_.___/\\___/_/ \\____/_/ /_/\\___/_/
/____/
`);
const replServer = repl.start({
prompt: "chef > ",
});
global.File = chef.File;
Object.keys(chef).forEach((key) => {
if (key !== "operations") {
replServer.context[key] = chef[key];
}
});