diff --git a/packages/generator/new-action/src/module.ts b/packages/generator/new-action/src/module.ts index 4901df48e1f4..b67e87465faf 100644 --- a/packages/generator/new-action/src/module.ts +++ b/packages/generator/new-action/src/module.ts @@ -91,7 +91,7 @@ export const ModuleNewAction = async (options: IModuleNewActionOption) => { }); if (!hasOption) { - smith.logger.warn('no option can be enabled'); + smith.logger.warn('No option can be enabled, exit 1.', funcMap); // eslint-disable-next-line no-process-exit process.exit(1); } diff --git a/tests/generator/utils/prepare.ts b/tests/generator/utils/prepare.ts index 001f93d99c93..a9de7ef730b2 100644 --- a/tests/generator/utils/prepare.ts +++ b/tests/generator/utils/prepare.ts @@ -9,6 +9,8 @@ async function addNewActionDevDependence(repoCwd: string) { 'packages/generator/new-action/package.json', ); const pkgJSON = JSON.parse(await fs.readFile(actionPath, 'utf-8')); + + // Should add new generator below for testing pkgJSON.devDependencies = { ...pkgJSON.devDependencies, '@modern-js/bff-generator': 'workspace:*', @@ -23,6 +25,7 @@ async function addNewActionDevDependence(repoCwd: string) { '@modern-js/ssg-generator': 'workspace:*', '@modern-js/module-test-generator': 'workspace:*', '@modern-js/rspack-generator': 'workspace:*', + '@modern-js/module-doc-generator': 'workspace:*', }; await fs.writeFile( actionPath,