docs(nxdev): remove nx-devkit generated redirect rules & fix url (#10318)

This commit is contained in:
Benjamin Cabanes 2022-05-16 10:34:53 -04:00 committed by GitHub
parent 17c40229a7
commit c7ec631060
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 342 additions and 368 deletions

View File

@ -4,13 +4,13 @@
### Ng CLI Adapter Classes ### Ng CLI Adapter Classes
- [NxScopedHost](../../nx-devkit/ngcli_adapter#nxscopedhost) - [NxScopedHost](../../devkit/ngcli_adapter#nxscopedhost)
### Functions ### Functions
- [mockSchematicsForTesting](../../nx-devkit/ngcli_adapter#mockschematicsfortesting) - [mockSchematicsForTesting](../../devkit/ngcli_adapter#mockschematicsfortesting)
- [overrideCollectionResolutionForTesting](../../nx-devkit/ngcli_adapter#overridecollectionresolutionfortesting) - [overrideCollectionResolutionForTesting](../../devkit/ngcli_adapter#overridecollectionresolutionfortesting)
- [wrapAngularDevkitSchematic](../../nx-devkit/ngcli_adapter#wrapangulardevkitschematic) - [wrapAngularDevkitSchematic](../../devkit/ngcli_adapter#wrapangulardevkitschematic)
## Ng CLI Adapter Classes ## Ng CLI Adapter Classes
@ -91,7 +91,7 @@ overrideCollectionResolutionForTesting({
### wrapAngularDevkitSchematic ### 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 #### Parameters
@ -108,10 +108,10 @@ overrideCollectionResolutionForTesting({
##### Parameters ##### Parameters
| Name | Type | | Name | Type |
| :----------------- | :----------------------------------- | | :----------------- | :-------------------------------- |
| `host` | [`Tree`](../../nx-devkit/index#tree) | | `host` | [`Tree`](../../devkit/index#tree) |
| `generatorOptions` | `Object` | | `generatorOptions` | `Object` |
##### Returns ##### Returns

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1028,12 +1028,12 @@
{ {
"id": "index", "id": "index",
"name": "Overview", "name": "Overview",
"file": "generated/api-nx-devkit/index" "file": "generated/devkit/index"
}, },
{ {
"id": "ngcli_adapter", "id": "ngcli_adapter",
"name": "Ng CLI Adapter", "name": "Ng CLI Adapter",
"file": "generated/api-nx-devkit/ngcli_adapter" "file": "generated/devkit/ngcli_adapter"
} }
] ]
} }

View File

@ -1,6 +1,6 @@
# Nx Devkit and Angular Devkit # 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. 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.

View File

@ -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 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. > 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> <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>

View File

@ -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. - `readTargetOptions` -- Reads and combines options for a given target.
- `runExecutor` -- Constructs options and invokes an executor. - `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 ## Using RxJS observables

View File

@ -65,7 +65,7 @@ export function Community(props: CommunityProps): ReactComponentElement<any> {
description: description:
'It contains many utility functions for reading and writing files, updating configuration, working with Abstract Syntax Trees(ASTs), and more.', 'It contains many utility functions for reading and writing files, updating configuration, working with Abstract Syntax Trees(ASTs), and more.',
name: '@nrwl/devkit', name: '@nrwl/devkit',
url: 'https://nx.dev/nx-devkit/index', url: 'https://nx.dev/devkit/index',
isOfficial: true, isOfficial: true,
}, },
{ {

View File

@ -134,8 +134,6 @@ const schemaUrls = {
'/nx-plugin/plugin': '/packages/nx-plugin/generators/plugin', '/nx-plugin/plugin': '/packages/nx-plugin/generators/plugin',
'/nx-plugin/schematic': '/packages/nx-plugin/generators/generator', '/nx-plugin/schematic': '/packages/nx-plugin/generators/generator',
'/nx-plugin/e2e': '/packages/nx-plugin/executors/e2e', '/nx-plugin/e2e': '/packages/nx-plugin/executors/e2e',
'/nx-devkit/index': '/packages/nx-devkit/index',
'/nx-devkit/ngcli_adapter': '/packages/nx-devkit/ngcli_adapter',
}; };
/** /**

View File

@ -13,7 +13,7 @@ const featureItems: {
}[] = [ }[] = [
{ {
classNames: 'bg-green-nx-base', classNames: 'bg-green-nx-base',
link: '/getting-started/nx-devkit', link: '/devkit/index',
title: 'Plugins for everything', title: 'Plugins for everything',
subTitle: subTitle:
'React, React Native, Angular, NativeScript, Cypress, Nest.js, Storybook, Ionic, Go among others.', 'React, React Native, Angular, NativeScript, Cypress, Nest.js, Storybook, Ionic, Go among others.',

View File

@ -119,7 +119,7 @@ const featureItems: {
}, },
{ {
classNames: 'bg-purple-nx-base', classNames: 'bg-purple-nx-base',
link: '/getting-started/nx-devkit', link: '/devkit/index',
title: 'Nx Devkit', title: 'Nx Devkit',
subTitle: subTitle:
'Nx enables a custom dev experience to match the needs of your organization.', 'Nx enables a custom dev experience to match the needs of your organization.',

View File

@ -12,19 +12,19 @@ export function generateDevkitDocumentation() {
execSync('nx build typedoc-theme', execSyncOptions); execSync('nx build typedoc-theme', execSyncOptions);
execSync( 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 execSyncOptions
); );
execSync( 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 execSyncOptions
); );
execSync( 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 execSyncOptions
); );
execSync( execSync(
`npx prettier docs/generated/api-nx-devkit --write --config ${join( `npx prettier docs/generated/devkit --write --config ${join(
__dirname, __dirname,
'..', '..',
'..', '..',

View File

@ -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');
}