Skip to content

Commit

Permalink
docs(misc): update imports to @nrwl/workspace generators to avoid req…
Browse files Browse the repository at this point in the history
…uiring @angular-devkit/schematics (#10554)
  • Loading branch information
leosvelperez committed Jun 2, 2022
1 parent ec90625 commit 4576d74
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/shared/generators/composing-generators.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Generators are useful individually, but reusing and composing generators allows
Nx Devkit generators can be imported and invoked like any javascript function. They often return a `Promise`, so they can be used with the `await` keyword to mimic synchronous code. Because this is standard javascript, control flow logic can be adjusted with `if` blocks and `for` loops as usual.

```typescript
import { libraryGenerator } from '@nrwl/workspace';
import { libraryGenerator } from '@nrwl/workspace/generators';

export default async function (tree: Tree, schema: any) {
await libraryGenerator(
Expand Down
2 changes: 1 addition & 1 deletion docs/shared/generators/creating-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import {
joinPathFragments,
readProjectConfiguration,
} from '@nrwl/devkit';
import { libraryGenerator } from '@nrwl/workspace';
import { libraryGenerator } from '@nrwl/workspace/generators';

export default async function (tree: Tree, schema: any) {
await libraryGenerator(tree, { name: schema.name });
Expand Down
2 changes: 1 addition & 1 deletion docs/shared/generators/generator-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Import the TypeScript schema into your generator file and replace the any in you

```typescript
import { Tree, formatFiles, installPackagesTask } from '@nrwl/devkit';
import { libraryGenerator } from '@nrwl/workspace';
import { libraryGenerator } from '@nrwl/workspace/generators';

export default async function (tree: Tree, schema: GeneratorOptions) {
await libraryGenerator(tree, { name: `${schema.name}-${schema.type || ''}` });
Expand Down
2 changes: 1 addition & 1 deletion docs/shared/generators/workspace-generators.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The initial generator function creates a library.

```typescript
import { Tree, formatFiles, installPackagesTask } from '@nrwl/devkit';
import { libraryGenerator } from '@nrwl/workspace';
import { libraryGenerator } from '@nrwl/workspace/generators';

export default async function (tree: Tree, schema: any) {
await libraryGenerator(tree, { name: schema.name });
Expand Down

1 comment on commit 4576d74

@vercel
Copy link

@vercel vercel bot commented on 4576d74 Jun 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx.dev
nx-dev-nrwl.vercel.app
nx-dev-git-master-nrwl.vercel.app
nx-five.vercel.app

Please sign in to comment.