From 10640acb59acdcff6dce34bd2c147ff712c910c7 Mon Sep 17 00:00:00 2001 From: Aidas Patas Date: Mon, 15 Mar 2021 16:05:03 +0200 Subject: [PATCH] update stub with caveat message --- cli/stubs/actor.stub | 9 ++++++++- index.js | 12 +----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/cli/stubs/actor.stub b/cli/stubs/actor.stub index d9855cc..b36e45c 100644 --- a/cli/stubs/actor.stub +++ b/cli/stubs/actor.stub @@ -14,4 +14,11 @@ class __CLASSNAME__ extends Actor } } -export default __CLASSNAME__; +// NOTE: If you're going to be targetting this file directly via the editor, you are not allowed to export things. +// Seems like nothing breaks apart from the scary error message. + +new __CLASSNAME__(GWorld); + +// However, if this is a class you're going to be extending, then feel free to export it and remove the new instance + +// export default __CLASSNAME__; diff --git a/index.js b/index.js index 344e0bf..d55f07d 100644 --- a/index.js +++ b/index.js @@ -3,18 +3,8 @@ /* eslint-disable no-console */ const yargs = require('yargs/yargs'); const { hideBin } = require('yargs/helpers'); -const utils = require('./utils'); -const compiler = require('./compiler'); const cli = require('./cli'); const { argv } = yargs(hideBin(process.argv)); -if (argv.file) { - (async () => { - const code = await utils.readCode(argv.file); - const compiled = compiler(code); - console.log(compiled); - })(); -} else { - cli(argv._); -} +cli(argv._);