| 54 | * @returns {Promise<EXPECTED_ANY>} the generator config |
| 55 | */ |
| 56 | const generatorFor = async (template) => { |
| 57 | const module = await import(pathToFileURL(path.join(LIB, "generators/init", `${template}.js`))); |
| 58 | |
| 59 | let config; |
| 60 | |
| 61 | await module.default({ |
| 62 | load: async () => {}, |
| 63 | setDefaultInclude: () => {}, |
| 64 | setPlopfilePath: () => {}, |
| 65 | getPlopfilePath: () => path.join(LIB, "plopfile.js"), |
| 66 | setGenerator: (name, generatorConfig) => { |
| 67 | config = generatorConfig; |
| 68 | }, |
| 69 | }); |
| 70 | |
| 71 | return config; |
| 72 | }; |
| 73 | |
| 74 | // The action list is built without running any action, so no project is written |
| 75 | // and nothing is installed. |