angular-architects / nx-ddd-plugin

Nx plugin for structuring a monorepo with domains and layers
308 stars 55 forks source link

Export Init/Domain/Feature/Api/Ui/Util layer generators #129

Open itsboogie opened 1 year ago

itsboogie commented 1 year ago

exported generators to allow for better generator composition

itsboogie commented 1 year ago

This PR allows one to extend the @angular-architects/ddd generators with extra features in custom generators:

import { angularArchitectsDddApiGenerator } from '@angular-architects/ddd';
import { formatFiles, Tree } from '@nx/devkit';

const myCustomFeatureGenerator= async (
  tree: Tree,
  options: { myOption: string }
): Promise<void> => {
  const { myOption } = options;

  await angularArchitectsDddApiGenerator(tree, {
   // default generator can be customized here
  });

  // do extra stuff like adding linting rules, setting up libraries, etc here :)

  return await formatFiles(tree);
};

export default myCustomFeatureGenerator;
wolfmanfx commented 1 year ago

@itsboogie Can you revert the package-lock json changes>