mirror of
https://github.com/sern-handler/cli
synced 2026-06-06 01:16:53 +00:00
prototype
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user