Skip to content

Commit

Permalink
docs(nxdev): remove nx-devkit generated redirect rules & fix url (#10318
Browse files Browse the repository at this point in the history
)
  • Loading branch information
bcabanes committed May 16, 2022
1 parent 17c4022 commit c7ec631
Show file tree
Hide file tree
Showing 14 changed files with 342 additions and 368 deletions.
632 changes: 316 additions & 316 deletions docs/generated/api-nx-devkit/index.md → docs/generated/devkit/index.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

### Ng CLI Adapter Classes

- [NxScopedHost](../../nx-devkit/ngcli_adapter#nxscopedhost)
- [NxScopedHost](../../devkit/ngcli_adapter#nxscopedhost)

### Functions

- [mockSchematicsForTesting](../../nx-devkit/ngcli_adapter#mockschematicsfortesting)
- [overrideCollectionResolutionForTesting](../../nx-devkit/ngcli_adapter#overridecollectionresolutionfortesting)
- [wrapAngularDevkitSchematic](../../nx-devkit/ngcli_adapter#wrapangulardevkitschematic)
- [mockSchematicsForTesting](../../devkit/ngcli_adapter#mockschematicsfortesting)
- [overrideCollectionResolutionForTesting](../../devkit/ngcli_adapter#overridecollectionresolutionfortesting)
- [wrapAngularDevkitSchematic](../../devkit/ngcli_adapter#wrapangulardevkitschematic)

## Ng CLI Adapter Classes

Expand Down Expand Up @@ -91,7 +91,7 @@ overrideCollectionResolutionForTesting({

### wrapAngularDevkitSchematic

**wrapAngularDevkitSchematic**(`collectionName`, `generatorName`): (`host`: [`Tree`](../../nx-devkit/index#tree), `generatorOptions`: { [k: string]: `any`; }) => `Promise`<`any`\>
**wrapAngularDevkitSchematic**(`collectionName`, `generatorName`): (`host`: [`Tree`](../../devkit/index#tree), `generatorOptions`: { [k: string]: `any`; }) => `Promise`<`any`\>

#### Parameters

Expand All @@ -108,10 +108,10 @@ overrideCollectionResolutionForTesting({

##### Parameters

| Name | Type |
| :----------------- | :----------------------------------- |
| `host` | [`Tree`](../../nx-devkit/index#tree) |
| `generatorOptions` | `Object` |
| Name | Type |
| :----------------- | :-------------------------------- |
| `host` | [`Tree`](../../devkit/index#tree) |
| `generatorOptions` | `Object` |

##### Returns

Expand Down
8 changes: 4 additions & 4 deletions docs/generated/packages/devkit.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/generated/packages/nx-plugin.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -1028,12 +1028,12 @@
{
"id": "index",
"name": "Overview",
"file": "generated/api-nx-devkit/index"
"file": "generated/devkit/index"
},
{
"id": "ngcli_adapter",
"name": "Ng CLI Adapter",
"file": "generated/api-nx-devkit/ngcli_adapter"
"file": "generated/devkit/ngcli_adapter"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion docs/shared/guides/nx-devkit-angular-devkit.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Nx Devkit and Angular Devkit

> Note: this document covers the difference between Nx Devkit and Angular Devkit. See the [Nx Devkit](/getting-started/nx-devkit) guide for more in-depth details about Nx Devkit.
> Note: this document covers the difference between Nx Devkit and Angular Devkit. See the [Nx Devkit](/devkit/index) guide for more in-depth details about Nx Devkit.
Nx comes with a devkit to write generators and executors, but you can also use Angular devkit (schematics and builders). In other words, you can use an Angular schematic to implement a generator, and you can use an Angular builder to implement an executor.

Expand Down
2 changes: 1 addition & 1 deletion docs/shared/nx-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Nx plugins are npm packages that contain generators and executors to extend a Nx

> A list of plugins that is maintained by Nrwl is found in the [Nrwl/nx repo](https://github.com/nrwl/nx/tree/master/packages). \
> A list of custom plugins created by the community is found in the [Community](/community) section.
> Plugins are written using Nx Devkit. **Read [Nx Devkit](/getting-started/nx-devkit) for more information.**
> Plugins are written using Nx Devkit. **Read [Nx Devkit](/devkit/index) for more information.**
<iframe loading="lazy" width="560" height="315" src="https://www.youtube.com/embed/fC1-4fAZDP4" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture; fullscreen"></iframe>

Expand Down
2 changes: 1 addition & 1 deletion docs/shared/using-executors.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ The `runExecutor` utility will find the target in the configuration, find the ex
- `readTargetOptions` -- Reads and combines options for a given target.
- `runExecutor` -- Constructs options and invokes an executor.

See more helper functions in the [Devkit API Docs](/nx-devkit/index#functions)
See more helper functions in the [Devkit API Docs](/devkit/index#functions)

## Using RxJS observables

Expand Down
2 changes: 1 addition & 1 deletion nx-dev/nx-dev/pages/community.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export function Community(props: CommunityProps): ReactComponentElement<any> {
description:
'It contains many utility functions for reading and writing files, updating configuration, working with Abstract Syntax Trees(ASTs), and more.',
name: '@nrwl/devkit',
url: 'https://nx.dev/nx-devkit/index',
url: 'https://nx.dev/devkit/index',
isOfficial: true,
},
{
Expand Down
2 changes: 0 additions & 2 deletions nx-dev/nx-dev/redirect-rules.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ const schemaUrls = {
'/nx-plugin/plugin': '/packages/nx-plugin/generators/plugin',
'/nx-plugin/schematic': '/packages/nx-plugin/generators/generator',
'/nx-plugin/e2e': '/packages/nx-plugin/executors/e2e',
'/nx-devkit/index': '/packages/nx-devkit/index',
'/nx-devkit/ngcli_adapter': '/packages/nx-devkit/ngcli_adapter',
};

/**
Expand Down
2 changes: 1 addition & 1 deletion nx-dev/ui-home/src/lib/ecosystem-features.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const featureItems: {
}[] = [
{
classNames: 'bg-green-nx-base',
link: '/getting-started/nx-devkit',
link: '/devkit/index',
title: 'Plugins for everything',
subTitle:
'React, React Native, Angular, NativeScript, Cypress, Nest.js, Storybook, Ionic, Go among others.',
Expand Down
2 changes: 1 addition & 1 deletion nx-dev/ui-home/src/lib/experience-features.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const featureItems: {
},
{
classNames: 'bg-purple-nx-base',
link: '/getting-started/nx-devkit',
link: '/devkit/index',
title: 'Nx Devkit',
subTitle:
'Nx enables a custom dev experience to match the needs of your organization.',
Expand Down
8 changes: 4 additions & 4 deletions scripts/documentation/generate-devkit-documentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ export function generateDevkitDocumentation() {
execSync('nx build typedoc-theme', execSyncOptions);

execSync(
`rm -rf docs/generated/api-nx-devkit && npx typedoc packages/devkit/index.ts packages/devkit/ngcli-adapter.ts --tsconfig packages/devkit/tsconfig.lib.json --out ./docs/generated/api-nx-devkit --hideBreadcrumbs true --disableSources --publicPath ../../nx-devkit/ --theme dist/typedoc-theme/src/lib --readme none`,
`rm -rf docs/generated/devkit && npx typedoc packages/devkit/index.ts packages/devkit/ngcli-adapter.ts --tsconfig packages/devkit/tsconfig.lib.json --out ./docs/generated/devkit --hideBreadcrumbs true --disableSources --publicPath ../../devkit/ --theme dist/typedoc-theme/src/lib --readme none`,
execSyncOptions
);
execSync(
`rm -rf docs/generated/api-nx-devkit/modules.md docs/generated/api-nx-devkit/.nojekyll`,
`rm -rf docs/generated/devkit/modules.md docs/generated/devkit/.nojekyll`,
execSyncOptions
);
execSync(
`rm -rf docs/generated/api-nx-devkit/modules.md docs/generated/api-nx-devkit/README.md`,
`rm -rf docs/generated/devkit/modules.md docs/generated/devkit/README.md`,
execSyncOptions
);
execSync(
`npx prettier docs/generated/api-nx-devkit --write --config ${join(
`npx prettier docs/generated/devkit --write --config ${join(
__dirname,
'..',
'..',
Expand Down
24 changes: 0 additions & 24 deletions scripts/documentation/package-schemas/generatePackageSchemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,27 +87,3 @@ export function generatePackageSchemas(): void {
)
);
}

// Temp, rework map API-reference
function updateMenuPathsInMapJson(): void {
const absoluteRoot = resolve(join(__dirname, '../../../'));
const outputPath: string = join(absoluteRoot, 'docs');
const jsonFile = readJsonSync(join(outputPath, 'map.json'));

jsonFile[0].itemList.forEach((itemA, indexA) => {
itemA.itemList.forEach((itemB, indexB) => {
if (
itemB.file &&
itemB.file.includes('generated/api-') &&
!itemB.file.include('api-nx-devkit')
) {
jsonFile[0].itemList[indexA].itemList[indexB] = {
...itemB,
path: '/packages/' + itemB.file.replace('generated/api-', ''),
};
}
});
});

writeJSONSync(join(outputPath, 'map.json'), jsonFile, 'utf-8');
}

1 comment on commit c7ec631

@vercel
Copy link

@vercel vercel bot commented on c7ec631 May 16, 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-five.vercel.app
nx-dev-git-master-nrwl.vercel.app
nx-dev-nrwl.vercel.app

Please sign in to comment.