Skip to content

Commit

Permalink
docs(nxdev): refactor docs sources generation and app consumption (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
bcabanes committed Dec 19, 2022
1 parent f1ac23f commit 19fd40d
Show file tree
Hide file tree
Showing 411 changed files with 45,917 additions and 19,192 deletions.
517 changes: 517 additions & 0 deletions docs/generated/manifests/cloud.json

Large diffs are not rendered by default.

6,306 changes: 6,306 additions & 0 deletions docs/generated/manifests/menus.json

Large diffs are not rendered by default.

2,056 changes: 2,056 additions & 0 deletions docs/generated/manifests/nx.json

Large diffs are not rendered by default.

2,951 changes: 2,951 additions & 0 deletions docs/generated/manifests/packages.json

Large diffs are not rendered by default.

1,583 changes: 1,583 additions & 0 deletions docs/generated/manifests/recipes.json

Large diffs are not rendered by default.

805 changes: 805 additions & 0 deletions docs/generated/manifests/tags.json

Large diffs are not rendered by default.

11 changes: 0 additions & 11 deletions docs/generated/packages/add-nx-to-monorepo.json

This file was deleted.

4,041 changes: 0 additions & 4,041 deletions docs/generated/packages/angular.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Nx and Angular Version Compatibility Matrix

Below is a reference table that matches versions of Angular to the version of Nx that is compatible with it. The table shows the version of Angular, the recommended version of Nx to use and the range of Nx versions that support the version of Angular.

We provide a recommended version, and it is usually the latest minor version of Nx in the range provided because there will have been bug fixes added since the first release in the range.

| Angular Version | **Nx Version _(recommended)_** | Nx Version _(range)_ |
| --------------- | ------------------------------ | -------------------- |
| ~15.0.0 | **latest** | 15.2.0 <= latest |
| ~14.2.0 | **15.1.1** | 14.6.0 <= 15.1.1 |
| ~14.1.0 | **14.5.10** | 14.5.0 <= 14.5.10 |
| ~14.0.0 | **14.4.3** | 14.2.1 <= 14.4.3 |
| ^13.0.0 | **14.1.9** | 13.2.0 <= 14.1.9 |
| ^12.0.0 | **13.1.4** | 12.3.0 <= 13.1.4 |
| ^11.0.0 | **12.2.0** | 11.0.0 <= 12.2.0 |
| ^10.0.0 | **10.4.15** | 9.7.0 <= 10.4.15 |
| ^9.0.0 | **9.6.0** | 8.12.4 <= 9.6.0 |
| ^8.0.0 | **8.12.2** | 8.7.0 <= 8.12.2 |

If you would like to see how the supported versions of Node and Typescript for the version of Angular you are using, [Lars Gyrup Brink Nielsen](https://twitter.com/LayZeeDK) has a very good resource for that [here](https://gist.github.com/LayZeeDK/c822cc812f75bb07b7c55d07ba2719b3).
88 changes: 88 additions & 0 deletions docs/generated/packages/angular/documents/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides:

- Integration with libraries such as Storybook, Jest, Cypress, Karma, and Protractor.
- Generators to help scaffold code quickly, including:
- Micro Frontends
- Libraries, both internal to your codebase and publishable to npm
- Upgrading AngularJS applications
- Single Component Application Modules (SCAMs)
- NgRx helpers.
- Utilities for automatic workspace refactoring.

{% callout type="note" title="Currently using the Angular CLI?" %}
You can easily and mostly **automatically migrate from an Angular CLI** project to Nx! Learn more [here](/recipes/adopting-nx/migration-angular).
{% /callout %}

## Setting up the Angular plugin

Adding the Angular plugin to an existing Nx workspace can be done with the following:

```shell
yarn add -D @nrwl/angular
```

```shell
npm install -D @nrwl/angular
```

## Using the Angular Plugin

### Generating an application

It's straightforward to generate an Angular application:

```shell
nx g @nrwl/angular:app appName
```

By default, the application will be generated with:

- ESLint as the linter.
- Jest as the unit test runner.
- Cypress as the E2E test runner.

We can then serve, build, test, lint, and run e2e tests on the application with the following commands:

```shell
nx serve appName
nx build appName
nx test appName
nx lint appName
nx e2e appName
```

### Generating a library

Generating an Angular library is very similar to generating an application:

```shell
nx g @nrwl/angular:lib libName
```

By default, the library will be generated with:

- ESLint as the linter.
- Jest as the unit test runner.

We can then test and lint the library with the following commands:

```shell
nx test libName
nx lint libName
```

Read more about:

- [Creating Libraries](/more-concepts/creating-libraries)
- [Library Types](/more-concepts/library-types)
- [Buildable and Publishable Libraries](/more-concepts/buildable-and-publishable-libraries)

## More Documentation

- [Angular Nx Tutorial](/angular-tutorial/1-code-generation)
- [Migrating from the Angular CLI](recipe/migration-angular)
- [Setup Module Federation with Angular and Nx](/recipes/module-federation/faster-builds)
- [Using NgRx](/recipes/other/misc-ngrx)
- [Using Data Persistence operators](/recipes/other/misc-data-persistence)
- [Upgrading an AngularJS application to Angular](/recipes/adopting-nx/migration-angularjs)
- [Using Tailwind CSS with Angular projects](/recipes/other/using-tailwind-css-with-angular-projects)
44 changes: 44 additions & 0 deletions docs/generated/packages/angular/executors/delegate-build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"name": "delegate-build",
"implementation": "/packages/angular/src/executors/delegate-build/delegate-build.impl.ts",
"schema": {
"version": 2,
"outputCapture": "direct-nodejs",
"$schema": "http://json-schema.org/draft-07/schema",
"title": "Schema for an executor which delegates a build.",
"description": "Delegates the build to a different target while supporting incremental builds.",
"cli": "nx",
"type": "object",
"properties": {
"buildTarget": {
"description": "Build target used for building the application after its dependencies have been built.",
"type": "string"
},
"outputPath": {
"type": "string",
"description": "The full path for the output directory, relative to the workspace root.",
"x-completion-type": "directory"
},
"tsConfig": {
"type": "string",
"description": "The full path for the TypeScript configuration file, relative to the workspace root.",
"x-completion-type": "file",
"x-completion-glob": "tsconfig.*.json"
},
"watch": {
"type": "boolean",
"description": "Whether to run a build when any file changes.",
"default": false
}
},
"additionalProperties": false,
"required": ["buildTarget", "outputPath", "tsConfig"],
"examplesFile": "## Examples\n\n{% tabs %}\n\n{% tab label=\"Basic Usage\" %}\nDelegate the build of the project to a different target.\n\n```json\n{\n \"prod-build\": {\n \"executor\": \"@nrwl/angular:delegate-build\",\n \"options\": {\n \"buildTarget\": \"app:build:production\",\n \"outputPath\": \"dist/apps/app/production\",\n \"tsConfig\": \"apps/app/tsconfig.json\",\n \"watch\": false\n }\n }\n}\n```\n\n{% /tab %}\n\n{% tab label=\"Watch for build changes\" %}\nDelegate the build of the project to a different target.\n\n```json\n{\n \"prod-build\": {\n \"executor\": \"@nrwl/angular:delegate-build\",\n \"options\": {\n \"buildTarget\": \"app:build:production\",\n \"outputPath\": \"dist/apps/app/production\",\n \"tsConfig\": \"apps/app/tsconfig.json\",\n \"watch\": true\n }\n }\n}\n```\n\n{% /tab %}\n\n{% /tabs %}\n",
"presets": []
},
"description": "Delegates the build to a different target while supporting incremental builds.",
"aliases": [],
"hidden": false,
"path": "/packages/angular/src/executors/delegate-build/schema.json",
"type": "executor"
}
80 changes: 80 additions & 0 deletions docs/generated/packages/angular/executors/file-server.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"name": "file-server",
"implementation": "/packages/angular/src/executors/file-server/file-server.impl.ts",
"schema": {
"version": 2,
"outputCapture": "direct-nodejs",
"title": "File Server",
"description": "Serves a static web application from a folder.",
"type": "object",
"cli": "nx",
"properties": {
"buildTarget": {
"type": "string",
"description": "Target which builds the application."
},
"parallel": {
"type": "boolean",
"description": "Build the target in parallel.",
"default": true
},
"maxParallel": {
"type": "number",
"description": "Max number of parallel jobs."
},
"port": {
"type": "number",
"description": "Port to listen on.",
"default": 4200
},
"host": {
"type": "string",
"description": "Host to listen on.",
"default": "localhost"
},
"ssl": {
"type": "boolean",
"description": "Serve using `HTTPS`.",
"default": false
},
"sslKey": {
"type": "string",
"description": "SSL key to use for serving `HTTPS`."
},
"sslCert": {
"type": "string",
"description": "SSL certificate to use for serving `HTTPS`."
},
"proxyUrl": {
"type": "string",
"description": "URL to proxy unhandled requests to."
},
"proxyOptions": {
"type": "object",
"description": "Options for the proxy used by `http-server`.",
"default": {},
"properties": { "secure": { "type": "boolean", "default": false } },
"additionalProperties": true
},
"watch": {
"type": "boolean",
"description": "Watch for file changes.",
"default": false
},
"spa": {
"type": "boolean",
"description": "Redirect 404 errors to index.html (useful for SPA's).",
"default": false
}
},
"additionalProperties": false,
"required": ["buildTarget"],
"examplesFile": "## Examples\n\n{% tabs %}\n\n{% tab label=\"Serve static files with http-server\" %}\n\nSet up `http-server` to host static files on a local webserver.\n\n```json\n{\n \"static-serve\": {\n \"executor\": \"@nrwl/angular:file-server\",\n \"options\": {\n \"buildTarget\": \"app:build\",\n \"port\": 4201\n }\n }\n}\n```\n\n{% /tab %}\n\n{% tab label=\"Watch for changes\" %}\n\nTo allow watching for changes, simply add the watch property.\n\n```json\n{\n \"static-serve\": {\n \"executor\": \"@nrwl/angular:file-server\",\n \"options\": {\n \"buildTarget\": \"app:build\",\n \"port\": 4201,\n \"watch\": true\n }\n }\n}\n```\n\n{% /tab %}\n\n{% /tabs %}\n",
"presets": []
},
"description": "Serves a static web application from a folder.",
"aliases": [],
"hidden": false,
"path": "/packages/angular/src/executors/file-server/schema.json",
"type": "executor"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
{
"name": "module-federation-dev-server",
"implementation": "/packages/angular/src/builders/module-federation-dev-server/module-federation-dev-server.impl.ts",
"schema": {
"version": 2,
"outputCapture": "direct-nodejs",
"$schema": "http://json-schema.org/draft-07/schema",
"title": "Schema for Module Federation Dev Server",
"description": "The module-federation-dev-server executor is reserved exclusively for use with host Module Federation applications. It allows the user to specify which remote applications should be served with the host.",
"type": "object",
"presets": [
{ "name": "Using a Different Port", "keys": ["browserTarget", "port"] }
],
"properties": {
"browserTarget": {
"type": "string",
"description": "A browser builder target to serve in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`.",
"pattern": "^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$"
},
"port": {
"type": "number",
"description": "Port to listen on.",
"default": 4200
},
"host": {
"type": "string",
"description": "Host to listen on.",
"default": "localhost"
},
"proxyConfig": {
"type": "string",
"description": "Proxy configuration file. For more information, see https://angular.io/guide/build#proxying-to-a-backend-server."
},
"ssl": {
"type": "boolean",
"description": "Serve using HTTPS.",
"default": false
},
"sslKey": {
"type": "string",
"description": "SSL key to use for serving HTTPS."
},
"sslCert": {
"type": "string",
"description": "SSL certificate to use for serving HTTPS."
},
"headers": {
"type": "object",
"description": "Custom HTTP headers to be added to all responses.",
"propertyNames": { "pattern": "^[-_A-Za-z0-9]+$" },
"additionalProperties": { "type": "string" }
},
"open": {
"type": "boolean",
"description": "Opens the url in default browser.",
"default": false,
"alias": "o"
},
"verbose": {
"type": "boolean",
"description": "Adds more details to output logging."
},
"liveReload": {
"type": "boolean",
"description": "Whether to reload the page on change, using live-reload.",
"default": true
},
"publicHost": {
"type": "string",
"description": "The URL that the browser client (or live-reload client, if enabled) should use to connect to the development server. Use for a complex dev server setup, such as one with reverse proxies."
},
"allowedHosts": {
"type": "array",
"description": "List of hosts that are allowed to access the dev server.",
"default": [],
"items": { "type": "string" }
},
"servePath": {
"type": "string",
"description": "The pathname where the app will be served."
},
"disableHostCheck": {
"type": "boolean",
"description": "Don't verify connected clients are part of allowed hosts.",
"default": false
},
"hmr": {
"type": "boolean",
"description": "Enable hot module replacement.",
"default": false
},
"watch": {
"type": "boolean",
"description": "Rebuild on change.",
"default": true
},
"poll": {
"type": "number",
"description": "Enable and define the file watching poll time period in milliseconds."
},
"devRemotes": {
"type": "array",
"items": { "type": "string" },
"description": "List of remote applications to run in development mode (i.e. using serve target)."
},
"skipRemotes": {
"type": "array",
"items": { "type": "string" },
"description": "List of remote applications to not automatically serve, either statically or in development mode. This can be useful for multi-repository module federation setups where the host application uses a remote application from an external repository."
}
},
"additionalProperties": false,
"required": ["browserTarget"],
"examplesFile": "## Examples\n\n{% tabs %}\n\n{% tab label=\"Basic Usage\" %}\nThe Module Federation Dev Server will serve a host application and find the remote applications associated with the host and serve them statically also. \nSee an example set up of it below:\n\n```json\n{\n \"serve\": {\n \"executor\": \"@nrwl/angular:module-federation-dev-server\",\n \"configurations\": {\n \"production\": {\n \"browserTarget\": \"host:build:production\"\n },\n \"development\": {\n \"browserTarget\": \"host:build:development\"\n }\n },\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"port\": 4200,\n \"publicHost\": \"http://localhost:4200\"\n }\n }\n}\n```\n\n{% /tab %}\n\n{% tab label=\"Serve host with remotes that can be live reloaded\" %}\nThe Module Federation Dev Server will serve a host application and find the remote applications associated with the host and serve a set selection with live reloading enabled also. \nSee an example set up of it below:\n\n```json\n{\n \"serve-with-hmr-remotes\": {\n \"executor\": \"@nrwl/angular:module-federation-dev-server\",\n \"configurations\": {\n \"production\": {\n \"browserTarget\": \"host:build:production\"\n },\n \"development\": {\n \"browserTarget\": \"host:build:development\"\n }\n },\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"port\": 4200,\n \"publicHost\": \"http://localhost:4200\",\n \"devRemotes\": [\"remote1\", \"remote2\"]\n }\n }\n}\n```\n\n{% /tab %}\n\n{% /tabs %}\n"
},
"description": "The module-federation-dev-server executor is reserved exclusively for use with host Module Federation applications. It allows the user to specify which remote applications should be served with the host.",
"aliases": [],
"hidden": false,
"path": "/packages/angular/src/builders/module-federation-dev-server/schema.json",
"type": "executor"
}
Loading

1 comment on commit 19fd40d

@vercel
Copy link

@vercel vercel bot commented on 19fd40d Dec 19, 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-nrwl.vercel.app
nx-five.vercel.app
nx.dev
nx-dev-git-master-nrwl.vercel.app

Please sign in to comment.