prototype

This commit is contained in:
Jacob Nguyen
2024-05-02 01:23:09 -05:00
parent cc6affb0a1
commit 4014fea984

View File

@@ -132,12 +132,15 @@ export async function build(options: Record<string, any>) {
const commandsImports = commandNames.map((fname, i) =>
`import m${i} from "./${p.join(`./commands/${fname.name}.js`).split(p.sep).join(p.posix.sep)}"`);
const commandMapTemplate =
'const __commands = new Map();\n ' +
'const __commands = new Map();\n' +
commandNames.map((_, i) => `__commands.set(m${i}.meta.id, m${i});`).join("\n");
const startFile =
'import { interactionHandler, __dependencies } from "@sern/handler/internal" \n'+
'import { __start } from "@sern/handler/internal" \n'+
commandsImports.join('\n') + '\n' +
commandMapTemplate + "\n"
commandMapTemplate + "\n" +
'exports.default = function(path, wrapper) {\n\
__start(path, wrapper);\n\
}\n'
console.log(entryPoints)