Skip to content

Commit

Permalink
Lab #3
Browse files Browse the repository at this point in the history
  • Loading branch information
christianliebel committed Oct 7, 2024
1 parent fa8eb70 commit b31a34c
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions tools/my-plugin/src/generators/my-generator/generator.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
import {
addProjectConfiguration,
formatFiles,
generateFiles,
Tree,
} from '@nx/devkit';
import * as path from 'path';
import { applicationGenerator } from '@nx/angular/generators';
import { Tree } from '@nx/devkit';
import { MyGeneratorGeneratorSchema } from './schema';

export async function myGeneratorGenerator(
tree: Tree,
options: MyGeneratorGeneratorSchema
) {
const projectRoot = `libs/${options.name}`;
addProjectConfiguration(tree, options.name, {
root: projectRoot,
projectType: 'library',
sourceRoot: `${projectRoot}/src`,
targets: {},
await applicationGenerator(tree, {
name: options.name,
routing: true,
prefix: options.name,
style: 'scss',
});
generateFiles(tree, path.join(__dirname, 'files'), projectRoot, options);
await formatFiles(tree);
}

export default myGeneratorGenerator;

0 comments on commit b31a34c

Please sign in to comment.