diff --git a/docs/generated/api-angular/executors/delegate-build.md b/docs/generated/api-angular/executors/delegate-build.md deleted file mode 100644 index 254b3874aa..0000000000 --- a/docs/generated/api-angular/executors/delegate-build.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: '@nrwl/angular:delegate-build executor' -description: 'Delegates the build to a different target while supporting incremental builds.' ---- - -# @nrwl/angular:delegate-build - -Delegates the build to a different target while supporting incremental builds. - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Options - -### buildTarget (_**required**_) - -Type: `string` - -Build target used for building the application after its dependencies have been built. - -### outputPath (_**required**_) - -Type: `string` - -The full path for the output directory, relative to the workspace root. - -### tsConfig (_**required**_) - -Type: `string` - -The full path for the TypeScript configuration file, relative to the workspace root. - -### watch - -Default: `false` - -Type: `boolean` - -Whether to run a build when any file changes. diff --git a/docs/generated/api-angular/executors/ng-packagr-lite.md b/docs/generated/api-angular/executors/ng-packagr-lite.md deleted file mode 100644 index 2e6d819931..0000000000 --- a/docs/generated/api-angular/executors/ng-packagr-lite.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: '@nrwl/angular:ng-packagr-lite executor' -description: 'Builds a library with support for incremental builds.' ---- - -# @nrwl/angular:ng-packagr-lite - -Builds a library with support for incremental builds. - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Options - -### project (_**required**_) - -Type: `string` - -The file path for the ng-packagr configuration file, relative to the workspace root. - -### buildableProjectDepsInPackageJsonType - -Default: `peerDependencies` - -Type: `string` - -Possible values: `dependencies`, `peerDependencies` - -When `updateBuildableProjectDepsInPackageJson` is `true`, this adds dependencies to either `peerDependencies` or `dependencies`. - -### tailwindConfig - -Type: `string` - -The full path for the Tailwind configuration file, relative to the workspace root. If not provided and a `tailwind.config.js` file exists in the project or workspace root, it will be used. Otherwise, Tailwind will not be configured. - -### tsConfig - -Type: `string` - -The full path for the TypeScript configuration file, relative to the workspace root. - -### updateBuildableProjectDepsInPackageJson - -Default: `true` - -Type: `boolean` - -Whether to update the buildable project dependencies in package.json. - -### watch - -Default: `false` - -Type: `boolean` - -Whether to run a build when any file changes. diff --git a/docs/generated/api-angular/executors/package.md b/docs/generated/api-angular/executors/package.md deleted file mode 100644 index 5fa64ae3e3..0000000000 --- a/docs/generated/api-angular/executors/package.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: '@nrwl/angular:package executor' -description: 'Builds and packages an Angular library to be distributed as an NPM package. It supports incremental builds.' ---- - -# @nrwl/angular:package - -Builds and packages an Angular library to be distributed as an NPM package. It supports incremental builds. - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Options - -### project (_**required**_) - -Type: `string` - -The file path for the ng-packagr configuration file, relative to the workspace root. - -### buildableProjectDepsInPackageJsonType - -Default: `peerDependencies` - -Type: `string` - -Possible values: `dependencies`, `peerDependencies` - -When `updateBuildableProjectDepsInPackageJson` is `true`, this adds dependencies to either `peerDependencies` or `dependencies`. - -### tailwindConfig - -Type: `string` - -The full path for the Tailwind configuration file, relative to the workspace root. If not provided and a `tailwind.config.js` file exists in the project or workspace root, it will be used. Otherwise, Tailwind will not be configured. - -### tsConfig - -Type: `string` - -The full path for the TypeScript configuration file, relative to the workspace root. - -### updateBuildableProjectDepsInPackageJson - -Default: `true` - -Type: `boolean` - -Whether to update the buildable project dependencies in package.json. - -### watch - -Default: `false` - -Type: `boolean` - -Whether to run a build when any file changes. diff --git a/docs/generated/api-angular/executors/webpack-browser.md b/docs/generated/api-angular/executors/webpack-browser.md deleted file mode 100644 index ca4e38d86b..0000000000 --- a/docs/generated/api-angular/executors/webpack-browser.md +++ /dev/null @@ -1,373 +0,0 @@ ---- -title: "@nrwl/angular:webpack-browser executor" -description: "The webpack-browser executor is very similar to the standard browser builder provided by the Angular Devkit. It allows you to build your Angular application to a build artifact that can be hosted online. There are some key differences: -- Supports Custom Webpack Configurations -- Supports Incremental Building" ---- - -# @nrwl/angular:webpack-browser - -The webpack-browser executor is very similar to the standard browser builder provided by the Angular Devkit. It allows you to build your Angular application to a build artifact that can be hosted online. There are some key differences: - -- Supports Custom Webpack Configurations -- Supports Incremental Building - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Examples - -##### Using a custom webpack configuration - -The executor supports providing a path to a custom webpack configuration. This allows you to customize how your Angular application is built. It currently supports the following types of webpack configurations: - -- `object` -- `Function` -- `Promise` - -The executor will merge the provided configuration with the webpack configuration that Angular Devkit uses. The merge order is: - -- Angular Devkit Configuration -- Provided Configuration - -To use a custom webpack configuration when building your Angular application, change the `build` target in your `project.json` to match the following: - -```ts -"build": { - "executor": "@nrwl/angular:webpack-browser", - "options": { - ... - "customWebpackConfig": { - "path": "apps/appName/webpack.config.js" - } - } -} -``` - -##### Incrementally Building your Application - -The executor supports incrementally building your Angular application by building the workspace libraries it depends on _(that have been marked as buildable)_ and then building your application using the built source of the libraries. - -This can improve build time as the building of the workspace libraries can be cached, meaning they only have to be rebuilt if they have changed. - -> Note: There may be some additional overhead in the linking of the built libraries' sources which may reduce the overall improvement in build time. Therefore this approach only benefits large applications and would likely have a negative impact on small and medium applications. -> You can read more about when to use incremental builds [here](/ci/incremental-builds#when-should-i-use-incremental-builds). - -To allow your Angular application to take advantage of incremental building, change the `build` target in your `project.json` to match the following: - -```ts -"build": { - "executor": "@nrwl/angular:webpack-browser", - "options": { - ... - "buildLibsFromSource": false - } -} -``` - -## Options - -### index (_**required**_) - -Type: `string` - -Configures the generation of the application's HTML index. - -### main (_**required**_) - -Type: `string` - -The full path for the main entry point to the app, relative to the current workspace. - -### outputPath (_**required**_) - -Type: `string` - - The full path for the new output directory, relative to the current workspace. - -By default, writes output to a folder named dist/ in the current project. - -### tsConfig (_**required**_) - -Type: `string` - -The full path for the TypeScript configuration file, relative to the current workspace. - -### allowedCommonJsDependencies - -Type: `array` - -A list of CommonJS packages that are allowed to be used without a build time warning. - -### aot - -Default: `true` - -Type: `boolean` - -Build using Ahead of Time compilation. - -### assets - -Type: `array` - -List of static application assets. - -### baseHref - -Type: `string` - -Base url for the application being built. - -### budgets - -Type: `array` - -Budget thresholds to ensure parts of your application stay within boundaries which you set. - -### buildLibsFromSource - -Default: `true` - -Type: `boolean` - -Read buildable libraries from source instead of building them separately. - -### buildOptimizer - -Default: `true` - -Type: `boolean` - -Enables '@angular-devkit/build-optimizer' optimizations when using the 'aot' option. - -### commonChunk - -Default: `true` - -Type: `boolean` - -Generate a seperate bundle containing code used across multiple bundles. - -### crossOrigin - -Default: `none` - -Type: `string` - -Possible values: `none`, `anonymous`, `use-credentials` - -Define the crossorigin attribute setting of elements that provide CORS support. - -### deleteOutputPath - -Default: `true` - -Type: `boolean` - -Delete the output path before building. - -### ~~deployUrl~~ - -Type: `string` - -**Deprecated:** Use "baseHref" option, "APP_BASE_HREF" DI token or a combination of both instead. For more information, see https://angular.io/guide/deployment#the-deploy-url. - -URL where files will be deployed. - -### extractLicenses - -Default: `true` - -Type: `boolean` - -Extract all licenses in a separate file. - -### fileReplacements - -Type: `array` - -Replace compilation source files with other compilation source files in the build. - -### i18nDuplicateTranslation - -Default: `warning` - -Type: `string` - -Possible values: `warning`, `error`, `ignore` - -How to handle duplicate translations for i18n. - -### i18nMissingTranslation - -Default: `warning` - -Type: `string` - -Possible values: `warning`, `error`, `ignore` - -How to handle missing translations for i18n. - -### inlineStyleLanguage - -Default: `css` - -Type: `string` - -Possible values: `css`, `less`, `sass`, `scss` - -The stylesheet language to use for the application's inline component styles. - -### localize - -Type: `boolean | boolean[] ` - -Translate the bundles in one or more locales. - -### namedChunks - -Default: `false` - -Type: `boolean` - -Use file name for lazy loaded chunks. - -### ngswConfigPath - -Type: `string` - -Path to ngsw-config.json. - -### optimization - -Default: `true` - -Type: `boolean` - -Enables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For more information, see https://angular.io/guide/workspace-config#optimization-configuration. - -### outputHashing - -Default: `none` - -Type: `string` - -Possible values: `none`, `all`, `media`, `bundles` - -Define the output filename cache-busting hashing mode. - -### poll - -Type: `number` - -Enable and define the file watching poll time period in milliseconds. - -### polyfills - -Type: `string` - -The full path for the polyfills file, relative to the current workspace. - -### preserveSymlinks - -Type: `boolean` - -Do not use the real path when resolving modules. If unset then will default to `true` if NodeJS option --preserve-symlinks is set. - -### progress - -Default: `true` - -Type: `boolean` - -Log progress to the console while building. - -### resourcesOutputPath - -Type: `string` - -The path where style resources will be placed, relative to outputPath. - -### scripts - -Type: `array` - -Global scripts to be included in the build. - -### serviceWorker - -Default: `false` - -Type: `boolean` - -Generates a service worker config for production builds. - -### ~~showCircularDependencies~~ - -Default: `false` - -Type: `boolean` - -**Deprecated:** The recommended method to detect circular dependencies in project code is to use either a lint rule or other external tooling. - -Show circular dependency warnings on builds. - -### sourceMap - -Default: `false` - -Type: `boolean` - -Output source maps for scripts and styles. For more information, see https://angular.io/guide/workspace-config#source-map-configuration. - -### statsJson - -Default: `false` - -Type: `boolean` - -Generates a 'stats.json' file which can be analyzed using tools such as 'webpack-bundle-analyzer'. - -### styles - -Type: `array` - -Global styles to be included in the build. - -### subresourceIntegrity - -Default: `false` - -Type: `boolean` - -Enables the use of subresource integrity validation. - -### vendorChunk - -Default: `false` - -Type: `boolean` - -Generate a seperate bundle containing only vendor libraries. This option should only used for development. - -### verbose - -Default: `false` - -Type: `boolean` - -Adds more details to output logging. - -### watch - -Default: `false` - -Type: `boolean` - -Run build when files change. - -### webWorkerTsConfig - -Type: `string` - -TypeScript configuration for Web Worker modules. diff --git a/docs/generated/api-angular/executors/webpack-server.md b/docs/generated/api-angular/executors/webpack-server.md deleted file mode 100644 index c833a9d45f..0000000000 --- a/docs/generated/api-angular/executors/webpack-server.md +++ /dev/null @@ -1,164 +0,0 @@ ---- -title: '@nrwl/angular:webpack-server executor' -description: 'The webpack-server executor is very similar to the standard dev server builder provided by the Angular Devkit. It is usually used in tandem with `@nrwl/angular:webpack-browser` when your Angular application uses a custom webpack configuration.' ---- - -# @nrwl/angular:webpack-server - -The webpack-server executor is very similar to the standard dev server builder provided by the Angular Devkit. It is usually used in tandem with `@nrwl/angular:webpack-browser` when your Angular application uses a custom webpack configuration. - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Examples - -##### Seving an application with a custom webpack configuration - -This executor should be used along with `@nrwl/angular:webpack-browser` to serve an application using a custom webpack configuration. - -Your `project.json` file should contain a `build` and `serve` target that matches the following: - -```json -"build": { - "executor": "@nrwl/angular:webpack-browser", - "options": { - ... - "customWebpackConfig": { - "path": "apps/appName/webpack.config.js" - } - } -}, -"serve": { - "executor": "@nrwl/angular:webpack-server", - "configurations": { - "production": { - "browserTarget": "appName:build:production" - }, - "development": { - "browserTarget": "appName:build:development" - } - }, - "defaultConfiguration": "development", -} -``` - -## Options - -### browserTarget (_**required**_) - -Type: `string` - -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`. - -### allowedHosts - -Type: `array` - -List of hosts that are allowed to access the dev server. - -### disableHostCheck - -Default: `false` - -Type: `boolean` - -Don't verify connected clients are part of allowed hosts. - -### hmr - -Default: `false` - -Type: `boolean` - -Enable hot module replacement. - -### host - -Default: `localhost` - -Type: `string` - -Host to listen on. - -### liveReload - -Default: `true` - -Type: `boolean` - -Whether to reload the page on change, using live-reload. - -### open - -Alias(es): o - -Default: `false` - -Type: `boolean` - -Opens the url in default browser. - -### poll - -Type: `number` - -Enable and define the file watching poll time period in milliseconds. - -### port - -Default: `4200` - -Type: `number` - -Port to listen on. - -### proxyConfig - -Type: `string` - -Proxy configuration file. For more information, see https://angular.io/guide/build#proxying-to-a-backend-server. - -### publicHost - -Type: `string` - -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. - -### servePath - -Type: `string` - -The pathname where the app will be served. - -### ssl - -Default: `false` - -Type: `boolean` - -Serve using HTTPS. - -### sslCert - -Type: `string` - -SSL certificate to use for serving HTTPS. - -### sslKey - -Type: `string` - -SSL key to use for serving HTTPS. - -### verbose - -Type: `boolean` - -Adds more details to output logging. - -### watch - -Default: `true` - -Type: `boolean` - -Rebuild on change. diff --git a/docs/generated/api-angular/generators/application.md b/docs/generated/api-angular/generators/application.md deleted file mode 100644 index 05b4220a30..0000000000 --- a/docs/generated/api-angular/generators/application.md +++ /dev/null @@ -1,234 +0,0 @@ ---- -title: '@nrwl/angular:application generator' -description: 'Creates an Angular application.' ---- - -# @nrwl/angular:application - -Creates an Angular application. - -## Usage - -```bash -nx generate application ... -``` - -```bash -nx g app ... # same -``` - -By default, Nx will search for `application` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/angular:application ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g application ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name of the application. - -### addTailwind - -Default: `false` - -Type: `boolean` - -Whether to configure Tailwind CSS for the application. - -### backendProject - -Type: `string` - -Backend project that provides data to this application. This sets up `proxy.config.json`. - -### directory - -Type: `string` - -The directory of the new application. - -### e2eTestRunner - -Default: `cypress` - -Type: `string` - -Possible values: `protractor`, `cypress`, `none` - -Test runner to use for end to end (e2e) tests. - -### host - -Type: `string` - -The name of the host application that the remote application will be consumed by. - -### inlineStyle - -Alias(es): s - -Default: `false` - -Type: `boolean` - -Specifies if the style will be in the ts file. - -### inlineTemplate - -Alias(es): t - -Default: `false` - -Type: `boolean` - -Specifies if the template will be in the ts file. - -### linter - -Default: `eslint` - -Type: `string` - -Possible values: `eslint`, `none` - -The tool to use for running lint checks. - -### mfe - -Default: `false` - -Type: `boolean` - -Generate a Module Federation configuration for the application - -### mfeType - -Default: `remote` - -Type: `string` - -Possible values: `host`, `remote` - -Type of application to generate the Module Federation configuration for. - -### port - -Type: `number` - -The port at which the remote application should be served. - -### prefix - -Alias(es): p - -Type: `string` - -The prefix to apply to generated selectors. - -### remotes - -Type: `array` - -A list of remote application names that the host application should consume. - -### routing - -Default: `false` - -Type: `boolean` - -Generate a routing module. - -### setParserOptionsProject - -Default: `false` - -Type: `boolean` - -Whether or not to configure the ESLint "parserOptions.project" option. We do not do this by default for lint performance reasons. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files. - -### skipPackageJson - -Default: `false` - -Type: `boolean` - -Do not add dependencies to `package.json`. - -### skipTests - -Alias(es): S - -Default: `false` - -Type: `boolean` - -Skip creating spec files. - -### standaloneConfig - -Type: `boolean` - -Split the project configuration into `/project.json` rather than including it inside `workspace.json`. - -### strict - -Default: `true` - -Type: `boolean` - -Create an application with stricter type checking and build optimization options. - -### style - -Default: `css` - -Type: `string` - -Possible values: `css`, `scss`, `sass`, `less` - -The file extension to be used for style files. - -### tags - -Type: `string` - -Add tags to the application (used for linting). - -### unitTestRunner - -Default: `jest` - -Type: `string` - -Possible values: `karma`, `jest`, `none` - -Test runner to use for unit tests. - -### viewEncapsulation - -Type: `string` - -Possible values: `Emulated`, `None`, `ShadowDom` - -Specifies the view encapsulation strategy. diff --git a/docs/generated/api-angular/generators/component.md b/docs/generated/api-angular/generators/component.md deleted file mode 100644 index 3623ed472b..0000000000 --- a/docs/generated/api-angular/generators/component.md +++ /dev/null @@ -1,156 +0,0 @@ ---- -title: '@nrwl/angular:component generator' -description: 'Generate an Angular Component.' ---- - -# @nrwl/angular:component - -Generate an Angular Component. - -## Usage - -```bash -nx generate component ... -``` - -By default, Nx will search for `component` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/angular:component ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g component ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name of the component. - -### changeDetection - -Alias(es): c - -Default: `Default` - -Type: `string` - -Possible values: `Default`, `OnPush` - -The change detection strategy to use in the new component. - -### displayBlock - -Alias(es): b - -Default: `false` - -Type: `boolean` - -Specifies if the style will contain `:host { display: block; }`. - -### export - -Default: `false` - -Type: `boolean` - -Specifies if the component should be exported in the declaring NgModule. Additionally, if the project is a library, the component will be exported from the project's entry point (normally `index.ts`). - -### flat - -Default: `false` - -Type: `boolean` - -Create the new files at the top level of the current project. - -### inlineStyle - -Alias(es): s - -Default: `false` - -Type: `boolean` - -Include styles inline in the component.ts file. Only CSS styles can be included inline. By default, an external styles file is created and referenced in the component.ts file. - -### inlineTemplate - -Alias(es): t - -Default: `false` - -Type: `boolean` - -Include template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file. - -### path (**hidden**) - -Type: `string` - -The path at which to create the component file, relative to the current workspace. Default is a folder with the same name as the component in the project root. - -### project - -Type: `string` - -The name of the project. - -### selector - -Type: `string` - -The HTML selector to use for this component. - -### skipSelector - -Default: `false` - -Type: `boolean` - -Specifies if the component should have a selector or not. - -### skipTests - -Default: `false` - -Type: `boolean` - -Do not create "spec.ts" test files for the new component. - -### style - -Default: `css` - -Type: `string` - -Possible values: `css`, `scss`, `sass`, `less`, `none` - -The file extension or preprocessor to use for style files, or 'none' to skip generating the style file. - -### type - -Default: `component` - -Type: `string` - -Adds a developer-defined type to the filename, in the format "name.type.ts". - -### viewEncapsulation - -Alias(es): v - -Type: `string` - -Possible values: `Emulated`, `None`, `ShadowDom` - -The view encapsulation strategy to use in the new component. diff --git a/docs/generated/api-angular/generators/convert-to-with-mf.md b/docs/generated/api-angular/generators/convert-to-with-mf.md deleted file mode 100644 index 94b78a236e..0000000000 --- a/docs/generated/api-angular/generators/convert-to-with-mf.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -title: '@nrwl/angular:convert-to-with-mf generator' -description: - 'Converts an old micro frontend configuration to use the new withModuleFederation helper. It will run successfully if the following conditions are met: - - Is either a host or remote application - - Shared npm package configurations have not been modified - - Name used to identify the Micro Frontend application matches the project name - - _**Note:** This generator will overwrite your webpack config. If you have additional custom configuration in your config file, it will be lost!_' ---- - -# @nrwl/angular:convert-to-with-mf - -Converts an old micro frontend configuration to use the new withModuleFederation helper. It will run successfully if the following conditions are met: - -- Is either a host or remote application -- Shared npm package configurations have not been modified -- Name used to identify the Micro Frontend application matches the project name - -_**Note:** This generator will overwrite your webpack config. If you have additional custom configuration in your config file, it will be lost!_ - -## Usage - -```bash -nx generate convert-to-with-mf ... -``` - -By default, Nx will search for `convert-to-with-mf` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/angular:convert-to-with-mf ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g convert-to-with-mf ... --dry-run -``` - -## Options - -### project - -Type: `string` - -The name of the micro frontend project to migrate. diff --git a/docs/generated/api-angular/generators/convert-tslint-to-eslint.md b/docs/generated/api-angular/generators/convert-tslint-to-eslint.md deleted file mode 100644 index db65a46a8a..0000000000 --- a/docs/generated/api-angular/generators/convert-tslint-to-eslint.md +++ /dev/null @@ -1,80 +0,0 @@ ---- -title: '@nrwl/angular:convert-tslint-to-eslint generator' -description: 'Converts a project from TSLint to ESLint.' ---- - -# @nrwl/angular:convert-tslint-to-eslint - -Converts a project from TSLint to ESLint. - -## Usage - -```bash -nx generate convert-tslint-to-eslint ... -``` - -By default, Nx will search for `convert-tslint-to-eslint` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/angular:convert-tslint-to-eslint ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g convert-tslint-to-eslint ... --dry-run -``` - -### Examples - -The following will first configure the project, `myapp`, the same way a _new_ project is configured i.e. It will use Nx's new recommended ESLint config. By default, this also adds the existing TSLint configuration on top of the default ESLint config from Nx to continue checking what it checks today. This is done by migrating TSLint rules to their equivalent ESLint rules to the best of its abilities. Some TSLint rules may not have ESLint equivalents and will be reported during the conversion: - -```bash -nx g convert-tslint-to-eslint myapp -``` - -If your TSLint config isn't extremely important to you, ignoring it makes this process more deterministic. Unlike the prior example, this will discard the existing TSLint configuration, meaning that the project will only have the Nx's latest recommended ESLint configuration which may be good enough for some workspaces: - -```bash -nx g convert-tslint-to-eslint myapp --ignoreExistingTslintConfig=true -``` - -By default, this process removes the TSLint related dependencies and configuration once no more projects use TSLint. This can be disabled with the following flag to keep TSLint related dependencies and configuration in the repo: - -```bash -nx g convert-tslint-to-eslint myapp --removeTSLintIfNoMoreTSLintTargets=false -``` - -## Options - -### project (_**required**_) - -Type: `string` - -The name of the Angular project to convert. Please note, if the project is an Angular app with an associated Cypress e2e project, it will also attempt to convert that. - -### ignoreExistingTslintConfig - -Default: `false` - -Type: `boolean` - -If true, it will not use existing TSLint config as a reference, it will just reset the project with the latest recommended ESLint config. - -### removeTSLintIfNoMoreTSLintTargets - -Default: `true` - -Type: `boolean` - -If this conversion leaves no more TSLint usage in the workspace, it will remove TSLint and related dependencies and configuration. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files. diff --git a/docs/generated/api-angular/generators/downgrade-module.md b/docs/generated/api-angular/generators/downgrade-module.md deleted file mode 100644 index 99ac2aa89b..0000000000 --- a/docs/generated/api-angular/generators/downgrade-module.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -title: '@nrwl/angular:downgrade-module generator' -description: 'Sets up a Downgrade Module.' ---- - -# @nrwl/angular:downgrade-module - -Sets up a Downgrade Module. - -## Usage - -```bash -nx generate downgrade-module ... -``` - -By default, Nx will search for `downgrade-module` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/angular:downgrade-module ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g downgrade-module ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name of the main AngularJS module. - -### project (_**required**_) - -Type: `string` - -The name of the project. - -### angularJsImport - -Type: `string` - -Import expression of the AngularJS application (e.g., `--angularJsImport=some_node_module/my_app`). - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files. - -### skipPackageJson - -Default: `false` - -Type: `boolean` - -Do not add `@angular/upgrade` to `package.json` (e.g., `--skipPackageJson`). diff --git a/docs/generated/api-angular/generators/karma-project.md b/docs/generated/api-angular/generators/karma-project.md deleted file mode 100644 index 12923a4179..0000000000 --- a/docs/generated/api-angular/generators/karma-project.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: '@nrwl/angular:karma-project generator' -description: 'Adds Karma configuration to a project.' ---- - -# @nrwl/angular:karma-project - -Adds Karma configuration to a project. - -## Usage - -```bash -nx generate karma-project ... -``` - -By default, Nx will search for `karma-project` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/angular:karma-project ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g karma-project ... --dry-run -``` - -## Options - -### project (_**required**_) - -Type: `string` - -The name of the project. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files. diff --git a/docs/generated/api-angular/generators/karma.md b/docs/generated/api-angular/generators/karma.md deleted file mode 100644 index 0e8c839427..0000000000 --- a/docs/generated/api-angular/generators/karma.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: '@nrwl/angular:karma generator' -description: 'Adds Karma configuration to a workspace.' ---- - -# @nrwl/angular:karma - -Adds Karma configuration to a workspace. - -## Usage - -```bash -nx generate karma ... -``` - -By default, Nx will search for `karma` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/angular:karma ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g karma ... --dry-run -``` - -## Options - -### skipPackageJson - -Default: `false` - -Type: `boolean` - -Do not add dependencies to `package.json`. diff --git a/docs/generated/api-angular/generators/library-secondary-entry-point.md b/docs/generated/api-angular/generators/library-secondary-entry-point.md deleted file mode 100644 index dd63569655..0000000000 --- a/docs/generated/api-angular/generators/library-secondary-entry-point.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -title: '@nrwl/angular:library-secondary-entry-point generator' -description: 'Creates a secondary entry point for an Angular publishable library.' ---- - -# @nrwl/angular:library-secondary-entry-point - -Creates a secondary entry point for an Angular publishable library. - -## Usage - -```bash -nx generate library-secondary-entry-point ... -``` - -```bash -nx g secondary-entry-point ... # same -``` - -By default, Nx will search for `library-secondary-entry-point` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/angular:library-secondary-entry-point ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g library-secondary-entry-point ... --dry-run -``` - -## Options - -### library (_**required**_) - -Type: `string` - -The name of the library to create the secondary entry point for. - -### name (_**required**_) - -Type: `string` - -The name of the secondary entry point. - -### skipModule - -Default: `false` - -Type: `boolean` - -Skip generating a module for the secondary entry point. diff --git a/docs/generated/api-angular/generators/library.md b/docs/generated/api-angular/generators/library.md deleted file mode 100644 index e6f81b3a20..0000000000 --- a/docs/generated/api-angular/generators/library.md +++ /dev/null @@ -1,210 +0,0 @@ ---- -title: '@nrwl/angular:library generator' -description: 'Creates an Angular library.' ---- - -# @nrwl/angular:library - -Creates an Angular library. - -## Usage - -```bash -nx generate library ... -``` - -```bash -nx g lib ... # same -``` - -By default, Nx will search for `library` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/angular:library ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g library ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name of the library. - -### addModuleSpec - -Default: `false` - -Type: `boolean` - -Add a module spec file. - -### addTailwind - -Default: `false` - -Type: `boolean` - -Whether to configure Tailwind CSS for the application. It can only be used with buildable and publishable libraries. Non-buildable libraries will use the application's Tailwind configuration. - -### buildable - -Default: `false` - -Type: `boolean` - -Generate a buildable library. - -### compilationMode - -Type: `string` - -Possible values: `full`, `partial` - -Specifies the compilation mode to use. If not specified, it will default to `partial` for publishable libraries and to `full` for buildable libraries. The `full` value can not be used for publishable libraries. - -### directory - -Type: `string` - -A directory where the library is placed. - -### importPath - -Type: `string` - -The library name used to import it, like `@myorg/my-awesome-lib`. Must be a valid npm name. - -### lazy - -Default: `false` - -Type: `boolean` - -Add `RouterModule.forChild` when set to true, and a simple array of routes when set to false. - -### linter - -Default: `eslint` - -Type: `string` - -Possible values: `eslint`, `none` - -The tool to use for running lint checks. - -### parentModule - -Type: `string` - -Update the router configuration of the parent module using `loadChildren` or `children`, depending on what `lazy` is set to. - -### prefix - -Alias(es): p - -Type: `string` - -The prefix to apply to generated selectors. - -### publishable - -Default: `false` - -Type: `boolean` - -Generate a publishable library. - -### routing - -Default: `false` - -Type: `boolean` - -Add router configuration. See `lazy` for more information. - -### setParserOptionsProject - -Default: `false` - -Type: `boolean` - -Whether or not to configure the ESLint "parserOptions.project" option. We do not do this by default for lint performance reasons. - -### simpleModuleName - -Default: `false` - -Type: `boolean` - -Keep the module name simple (when using `--directory`). - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files. - -### skipModule - -Default: `false` - -Type: `boolean` - -Whether to skip the creation of a default module when generating the library. - -### skipPackageJson - -Default: `false` - -Type: `boolean` - -Do not add dependencies to `package.json`. - -### skipTsConfig - -Default: `false` - -Type: `boolean` - -Do not update `tsconfig.json` for development experience. - -### standaloneConfig - -Type: `boolean` - -Split the project configuration into `/project.json` rather than including it inside `workspace.json`. - -### strict - -Default: `true` - -Type: `boolean` - -Create a library with stricter type checking and build optimization options. - -### tags - -Type: `string` - -Add tags to the library (used for linting). - -### unitTestRunner - -Default: `jest` - -Type: `string` - -Possible values: `karma`, `jest`, `none` - -Test runner to use for unit tests. diff --git a/docs/generated/api-angular/generators/mfe-host.md b/docs/generated/api-angular/generators/mfe-host.md deleted file mode 100644 index 80b217de61..0000000000 --- a/docs/generated/api-angular/generators/mfe-host.md +++ /dev/null @@ -1,60 +0,0 @@ ---- -title: '@nrwl/angular:mfe-host generator' -description: 'Generate a Host Angular Micro Frontend Application.' ---- - -# @nrwl/angular:mfe-host - -Generate a Host Angular Micro Frontend Application. - -## Usage - -```bash -nx generate mfe-host ... -``` - -```bash -nx g host ... # same -``` - -By default, Nx will search for `mfe-host` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/angular:mfe-host ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g mfe-host ... --dry-run -``` - -### Examples - -Create an Angular app with configuration in place for MFE. If remotes is provided, attach the remote app to this app's configuration.: - -```bash -nx g @nrwl/angular:mfe-host appName --remotes=remote1 -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name to give to the host Angular app. - -### host - -Type: `string` - -The name of the host app to attach this host app to. - -### port - -Type: `number` - -The port on which this app should be served. diff --git a/docs/generated/api-angular/generators/mfe-remote.md b/docs/generated/api-angular/generators/mfe-remote.md deleted file mode 100644 index f41a40a4ad..0000000000 --- a/docs/generated/api-angular/generators/mfe-remote.md +++ /dev/null @@ -1,60 +0,0 @@ ---- -title: '@nrwl/angular:mfe-remote generator' -description: 'Generate a Remote Angular Micro-Frontend Application.' ---- - -# @nrwl/angular:mfe-remote - -Generate a Remote Angular Micro-Frontend Application. - -## Usage - -```bash -nx generate mfe-remote ... -``` - -```bash -nx g remote ... # same -``` - -By default, Nx will search for `mfe-remote` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/angular:mfe-remote ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g mfe-remote ... --dry-run -``` - -### Examples - -Create an Angular app with configuration in place for MFE. If host is provided, attach this remote app to host app's configuration.: - -```bash -nx g @nrwl/angular:mfe-remote appName --host=host --port=4201 -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name to give to the remote Angular app. - -### host - -Type: `string` - -The name of the host app to attach this remote app to. - -### port - -Type: `number` - -The port on which this app should be served. diff --git a/docs/generated/api-angular/generators/move.md b/docs/generated/api-angular/generators/move.md deleted file mode 100644 index 0a9a0d756f..0000000000 --- a/docs/generated/api-angular/generators/move.md +++ /dev/null @@ -1,80 +0,0 @@ ---- -title: '@nrwl/angular:move generator' -description: 'Moves an Angular application or library to another folder within the workspace and updates the project configuration.' ---- - -# @nrwl/angular:move - -Moves an Angular application or library to another folder within the workspace and updates the project configuration. - -## Usage - -```bash -nx generate move ... -``` - -```bash -nx g mv ... # same -``` - -By default, Nx will search for `move` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/angular:move ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g move ... --dry-run -``` - -### Examples - -Move libs/my-feature-lib to libs/shared/my-feature-lib: - -```bash -nx g @nrwl/angular:move --project my-feature-lib shared/my-feature-lib -``` - -## Options - -### destination (_**required**_) - -Type: `string` - -The folder to move the Angular project into. - -### projectName (_**required**_) - -Alias(es): project - -Type: `string` - -The name of the Angular project to move. - -### importPath - -Type: `string` - -The new import path to use in the `tsconfig.base.json`. - -### skipFormat - -Alias(es): skip-format - -Default: `false` - -Type: `boolean` - -Skip formatting files. - -### updateImportPath - -Default: `true` - -Type: `boolean` - -Update the import path to reflect the new location. diff --git a/docs/generated/api-angular/generators/ngrx.md b/docs/generated/api-angular/generators/ngrx.md deleted file mode 100644 index 433d6f2a30..0000000000 --- a/docs/generated/api-angular/generators/ngrx.md +++ /dev/null @@ -1,124 +0,0 @@ ---- -title: '@nrwl/angular:ngrx generator' -description: 'Adds NgRx support to an application or library.' ---- - -# @nrwl/angular:ngrx - -Adds NgRx support to an application or library. - -## Usage - -```bash -nx generate ngrx ... -``` - -By default, Nx will search for `ngrx` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/angular:ngrx ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g ngrx ... --dry-run -``` - -## Options - -### module (_**required**_) - -Type: `string` - -The path to the `NgModule` where the feature state will be registered. The host directory will create/use the new state directory. - -### name (_**required**_) - -Type: `string` - -Name of the NgRx feature state, such as `products` or `users`. Recommended to use the plural form of the name. - -### barrels - -Default: `false` - -Type: `boolean` - -Use barrels to re-export actions, state and selectors. - -### directory - -Default: `+state` - -Type: `string` - -The name of the folder used to contain/group the generated NgRx files. - -### facade - -Default: `false` - -Type: `boolean` - -Create a Facade class for the the feature. - -### minimal - -Default: `true` - -Type: `boolean` - -Only register the root state management setup or feature state. - -### root - -Default: `false` - -Type: `boolean` - -Setup root or feature state management with NgRx. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files. - -### skipImport - -Default: `false` - -Type: `boolean` - -Generate NgRx feature files without registering the feature in the NgModule. - -### skipPackageJson - -Default: `false` - -Type: `boolean` - -Do not update the `package.json` with NgRx dependencies. - -### syntax - -Default: `creators` - -Type: `string` - -Possible values: `classes`, `creators` - -Specifies whether to use class-based or creator functions for actions, reducers, and effects. - -### useDataPersistence - -Default: `false` - -Type: `boolean` - -Generate NgRx Effects with the `DataPersistence` helper service. Set to false to use plain effects data persistence operators. diff --git a/docs/generated/api-angular/generators/scam-directive.md b/docs/generated/api-angular/generators/scam-directive.md deleted file mode 100644 index cc32b87eb0..0000000000 --- a/docs/generated/api-angular/generators/scam-directive.md +++ /dev/null @@ -1,94 +0,0 @@ ---- -title: '@nrwl/angular:scam-directive generator' -description: 'Generate a directive with an accompanying Single Component Angular Module (SCAM).' ---- - -# @nrwl/angular:scam-directive - -Generate a directive with an accompanying Single Component Angular Module (SCAM). - -## Usage - -```bash -nx generate scam-directive ... -``` - -By default, Nx will search for `scam-directive` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/angular:scam-directive ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g scam-directive ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name of the directive. - -### export - -Default: `true` - -Type: `boolean` - -Specifies if the SCAM should be exported from the project's entry point (normally `index.ts`). It only applies to libraries. - -### flat - -Default: `true` - -Type: `boolean` - -Create the new files at the top level of the current project. - -### inlineScam - -Default: `true` - -Type: `boolean` - -Create the NgModule in the same file as the Directive. - -### path (**hidden**) - -Type: `string` - -The path at which to create the directive file, relative to the current workspace. Default is a folder with the same name as the directive in the project root. - -### prefix - -Alias(es): p - -Type: `string` - -The prefix to apply to the generated directive selector. - -### project - -Type: `string` - -The name of the project. - -### selector - -Type: `string` - -The HTML selector to use for this directive. - -### skipTests - -Default: `false` - -Type: `boolean` - -Do not create "spec.ts" test files for the new directive. diff --git a/docs/generated/api-angular/generators/scam-pipe.md b/docs/generated/api-angular/generators/scam-pipe.md deleted file mode 100644 index 69b3187ffd..0000000000 --- a/docs/generated/api-angular/generators/scam-pipe.md +++ /dev/null @@ -1,80 +0,0 @@ ---- -title: '@nrwl/angular:scam-pipe generator' -description: 'Generate a pipe with an accompanying Single Component Angular Module (SCAM).' ---- - -# @nrwl/angular:scam-pipe - -Generate a pipe with an accompanying Single Component Angular Module (SCAM). - -## Usage - -```bash -nx generate scam-pipe ... -``` - -By default, Nx will search for `scam-pipe` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/angular:scam-pipe ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g scam-pipe ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name of the pipe. - -### export - -Default: `true` - -Type: `boolean` - -Specifies if the SCAM should be exported from the project's entry point (normally `index.ts`). It only applies to libraries. - -### flat - -Default: `true` - -Type: `boolean` - -Create the new files at the top level of the current project. - -### inlineScam - -Default: `true` - -Type: `boolean` - -Create the NgModule in the same file as the Pipe. - -### path (**hidden**) - -Type: `string` - -The path at which to create the pipe file, relative to the current workspace. Default is a folder with the same name as the pipe in the project root. - -### project - -Type: `string` - -The name of the project. - -### skipTests - -Default: `false` - -Type: `boolean` - -Do not create "spec.ts" test files for the new pipe. diff --git a/docs/generated/api-angular/generators/scam.md b/docs/generated/api-angular/generators/scam.md deleted file mode 100644 index 2f93c876e3..0000000000 --- a/docs/generated/api-angular/generators/scam.md +++ /dev/null @@ -1,172 +0,0 @@ ---- -title: '@nrwl/angular:scam generator' -description: 'Generate a component with an accompanying Single Component Angular Module (SCAM).' ---- - -# @nrwl/angular:scam - -Generate a component with an accompanying Single Component Angular Module (SCAM). - -## Usage - -```bash -nx generate scam ... -``` - -By default, Nx will search for `scam` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/angular:scam ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g scam ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name of the component. - -### changeDetection - -Alias(es): c - -Default: `Default` - -Type: `string` - -Possible values: `Default`, `OnPush` - -The change detection strategy to use in the new component. - -### displayBlock - -Alias(es): b - -Default: `false` - -Type: `boolean` - -Specifies if the style will contain `:host { display: block; }`. - -### export - -Default: `true` - -Type: `boolean` - -Specifies if the SCAM should be exported from the project's entry point (normally `index.ts`). It only applies to libraries. - -### flat - -Default: `false` - -Type: `boolean` - -Create the new files at the top level of the current project. - -### inlineScam - -Default: `true` - -Type: `boolean` - -Create the NgModule in the same file as the Component. - -### inlineStyle - -Alias(es): s - -Default: `false` - -Type: `boolean` - -Include styles inline in the component.ts file. Only CSS styles can be included inline. By default, an external styles file is created and referenced in the component.ts file. - -### inlineTemplate - -Alias(es): t - -Default: `false` - -Type: `boolean` - -Include template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file. - -### path (**hidden**) - -Type: `string` - -The path at which to create the component file, relative to the current workspace. Default is a folder with the same name as the component in the project root. - -### prefix - -Alias(es): p - -Type: `string` - -The prefix to apply to the generated component selector. - -### project - -Type: `string` - -The name of the project. - -### selector - -Type: `string` - -The HTML selector to use for this component. - -### skipSelector - -Default: `false` - -Type: `boolean` - -Specifies if the component should have a selector or not. - -### skipTests - -Default: `false` - -Type: `boolean` - -Do not create "spec.ts" test files for the new component. - -### style - -Default: `css` - -Type: `string` - -Possible values: `css`, `scss`, `sass`, `less`, `none` - -The file extension or preprocessor to use for style files, or 'none' to skip generating the style file. - -### type - -Default: `component` - -Type: `string` - -Adds a developer-defined type to the filename, in the format "name.type.ts". - -### viewEncapsulation - -Alias(es): v - -Type: `string` - -Possible values: `Emulated`, `None`, `ShadowDom` - -The view encapsulation strategy to use in the new component. diff --git a/docs/generated/api-angular/generators/setup-mfe.md b/docs/generated/api-angular/generators/setup-mfe.md deleted file mode 100644 index 4e5762746c..0000000000 --- a/docs/generated/api-angular/generators/setup-mfe.md +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: '@nrwl/angular:setup-mfe generator' -description: 'Generate a Module Federation configuration for a given Angular application.' ---- - -# @nrwl/angular:setup-mfe - -Generate a Module Federation configuration for a given Angular application. - -## Usage - -```bash -nx generate setup-mfe ... -``` - -By default, Nx will search for `setup-mfe` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/angular:setup-mfe ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g setup-mfe ... --dry-run -``` - -## Options - -### appName (_**required**_) - -Type: `string` - -The name of the application to generate the Module Federation configuration for. - -### mfeType (_**required**_) - -Default: `remote` - -Type: `string` - -Possible values: `host`, `remote` - -Type of application to generate the Module Federation configuration for. - -### e2eProjectName - -Type: `string` - -The project name of the associated e2e project for the application. This is only required for Cypress e2e projects that do not follow the naming convention `-e2e`. - -### host - -Type: `string` - -The name of the host application that the remote application will be consumed by. - -### port - -Type: `number` - -The port at which the remote application should be served. - -### remotes - -Type: `array` - -A list of remote application names that the host application should consume. - -### routing - -Type: `boolean` - -Generate a routing setup to allow a host application to route to the remote application. - -### skipFormat - -Type: `boolean` - -Skip formatting the workspace after the generator completes. - -### skipPackageJson - -Default: `false` - -Type: `boolean` - -Do not add dependencies to `package.json`. diff --git a/docs/generated/api-angular/generators/setup-tailwind.md b/docs/generated/api-angular/generators/setup-tailwind.md deleted file mode 100644 index d2d7211a06..0000000000 --- a/docs/generated/api-angular/generators/setup-tailwind.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -title: '@nrwl/angular:setup-tailwind generator' -description: 'Configures Tailwind CSS for an application or a buildable/publishable library.' ---- - -# @nrwl/angular:setup-tailwind - -Configures Tailwind CSS for an application or a buildable/publishable library. - -## Usage - -```bash -nx generate setup-tailwind ... -``` - -By default, Nx will search for `setup-tailwind` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/angular:setup-tailwind ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g setup-tailwind ... --dry-run -``` - -## Options - -### project (_**required**_) - -Type: `string` - -The name of the project to add the Tailwind CSS setup for. - -### buildTarget - -Default: `build` - -Type: `string` - -The name of the target used to build the project. This option only applies to buildable/publishable libraries. - -### skipFormat - -Type: `boolean` - -Skips formatting the workspace after the generator completes. - -### skipPackageJson - -Default: `false` - -Type: `boolean` - -Do not add dependencies to `package.json`. - -### stylesEntryPoint - -Type: `string` - -Path to the styles entry point relative to the workspace root. If not provided the generator will do its best to find it and it will error if it can't. This option only applies to applications. diff --git a/docs/generated/api-angular/generators/stories.md b/docs/generated/api-angular/generators/stories.md deleted file mode 100644 index 399453eea7..0000000000 --- a/docs/generated/api-angular/generators/stories.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -title: '@nrwl/angular:stories generator' -description: 'Creates stories/specs for all components declared in a project.' ---- - -# @nrwl/angular:stories - -Creates stories/specs for all components declared in a project. - -## Usage - -```bash -nx generate stories ... -``` - -By default, Nx will search for `stories` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/angular:stories ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g stories ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name of the project. - -### cypressProject - -Type: `string` - -The Cypress project to generate the stories under. This is inferred from `name` by default. - -### generateCypressSpecs - -Type: `boolean` - -Specifies whether to automatically generate `*.spec.ts` files in the Cypress e2e app generated by the `cypress-configure` generator. diff --git a/docs/generated/api-angular/generators/storybook-configuration.md b/docs/generated/api-angular/generators/storybook-configuration.md deleted file mode 100644 index c56c5bbe93..0000000000 --- a/docs/generated/api-angular/generators/storybook-configuration.md +++ /dev/null @@ -1,76 +0,0 @@ ---- -title: '@nrwl/angular:storybook-configuration generator' -description: 'Adds Storybook configuration to a project.' ---- - -# @nrwl/angular:storybook-configuration - -Adds Storybook configuration to a project. - -## Usage - -```bash -nx generate storybook-configuration ... -``` - -By default, Nx will search for `storybook-configuration` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/angular:storybook-configuration ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g storybook-configuration ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name of the project. - -### configureCypress - -Default: `true` - -Type: `boolean` - -Specifies whether to configure Cypress or not. - -### cypressDirectory - -Type: `string` - -A directory where the Cypress project will be placed. Placed at the root by default. - -### generateCypressSpecs - -Default: `true` - -Type: `boolean` - -Specifies whether to automatically generate `*.spec.ts` files in the generated Cypress e2e app. - -### generateStories - -Default: `true` - -Type: `boolean` - -Specifies whether to automatically generate `*.stories.ts` files for components declared in this project or not. - -### linter - -Default: `eslint` - -Type: `string` - -Possible values: `eslint`, `none` - -The tool to use for running lint checks. diff --git a/docs/generated/api-angular/generators/storybook-migrate-defaults-5-to-6.md b/docs/generated/api-angular/generators/storybook-migrate-defaults-5-to-6.md deleted file mode 100644 index dd0010a3a5..0000000000 --- a/docs/generated/api-angular/generators/storybook-migrate-defaults-5-to-6.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -title: '@nrwl/angular:storybook-migrate-defaults-5-to-6 generator' -description: 'Generates default Storybook configuration files using Storybook version >=6.x specs, for projects that already have Storybook instances and configurations of versions <6.x.' ---- - -# @nrwl/angular:storybook-migrate-defaults-5-to-6 - -Generates default Storybook configuration files using Storybook version >=6.x specs, for projects that already have Storybook instances and configurations of versions <6.x. - -## Usage - -```bash -nx generate storybook-migrate-defaults-5-to-6 ... -``` - -By default, Nx will search for `storybook-migrate-defaults-5-to-6` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/angular:storybook-migrate-defaults-5-to-6 ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g storybook-migrate-defaults-5-to-6 ... --dry-run -``` - -## Options - -### all - -Default: `true` - -Type: `boolean` - -Generate new Storybook configurations for all Storybook instances across all applications and libraries. - -### keepOld - -Default: `true` - -Type: `boolean` - -Keep the old configuration files by placing them in a folder called `.old_storybook`. - -### name - -Type: `string` - -Library or application name for which you want to generate the new Storybook configuration. Leave empty to upgrade all Storybook instances. Only use this if you want to do a gradual migration. diff --git a/docs/generated/api-angular/generators/storybook-migrate-stories-to-6-2.md b/docs/generated/api-angular/generators/storybook-migrate-stories-to-6-2.md deleted file mode 100644 index a81530a233..0000000000 --- a/docs/generated/api-angular/generators/storybook-migrate-stories-to-6-2.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: '@nrwl/angular:storybook-migrate-stories-to-6-2 generator' -description: 'Migrates stories to match the new syntax in v6.2 where the component declaration should be in the default export.' ---- - -# @nrwl/angular:storybook-migrate-stories-to-6-2 - -Migrates stories to match the new syntax in v6.2 where the component declaration should be in the default export. - -## Usage - -```bash -nx generate storybook-migrate-stories-to-6-2 ... -``` - -By default, Nx will search for `storybook-migrate-stories-to-6-2` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/angular:storybook-migrate-stories-to-6-2 ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g storybook-migrate-stories-to-6-2 ... --dry-run -``` diff --git a/docs/generated/api-angular/generators/upgrade-module.md b/docs/generated/api-angular/generators/upgrade-module.md deleted file mode 100644 index 7cbcd4152e..0000000000 --- a/docs/generated/api-angular/generators/upgrade-module.md +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: '@nrwl/angular:upgrade-module generator' -description: 'Sets up an Upgrade Module.' ---- - -# @nrwl/angular:upgrade-module - -Sets up an Upgrade Module. - -## Usage - -```bash -nx generate upgrade-module ... -``` - -By default, Nx will search for `upgrade-module` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/angular:upgrade-module ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g upgrade-module ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name of the main AngularJS module. - -### project (_**required**_) - -Type: `string` - -The name of the project. - -### angularJsCmpSelector - -Type: `string` - -The selector of an AngularJS component (e.g., `--angularJsCmpSelector=myComponent`). - -### angularJsImport - -Type: `string` - -Import expression of the AngularJS application (e.g., `--angularJsImport=some_node_module/my_app`). - -### router - -Default: `false` - -Type: `boolean` - -Sets up router synchronization (e.g., `--router`). - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files. - -### skipPackageJson - -Default: `false` - -Type: `boolean` - -Do not add `@angular/upgrade` to `package.json` (e.g., `--skipPackageJson`). diff --git a/docs/generated/api-angular/generators/web-worker.md b/docs/generated/api-angular/generators/web-worker.md deleted file mode 100644 index 293af264e7..0000000000 --- a/docs/generated/api-angular/generators/web-worker.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -title: '@nrwl/angular:web-worker generator' -description: 'Creates a Web Worker.' ---- - -# @nrwl/angular:web-worker - -Creates a Web Worker. - -## Usage - -```bash -nx generate web-worker ... -``` - -By default, Nx will search for `web-worker` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/angular:web-worker ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g web-worker ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name of the worker. - -### project (_**required**_) - -Type: `string` - -The name of the project. - -### path - -Type: `string` - -The path at which to create the worker file, relative to the current workspace. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files. - -### snippet - -Default: `true` - -Type: `boolean` - -Add a worker creation snippet in a sibling file of the same name. diff --git a/docs/generated/api-cypress/executors/cypress.md b/docs/generated/api-cypress/executors/cypress.md deleted file mode 100644 index de1d9547f2..0000000000 --- a/docs/generated/api-cypress/executors/cypress.md +++ /dev/null @@ -1,164 +0,0 @@ ---- -title: '@nrwl/cypress:cypress executor' -description: 'Run Cypress e2e tests' ---- - -# @nrwl/cypress:cypress - -Run Cypress e2e tests - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Options - -### cypressConfig (_**required**_) - -Type: `string` - -The path of the Cypress configuration json file. - -### baseUrl - -Type: `string` - -The address (with the port) which your application is running on - -### browser - -Type: `string` - -The browser to run tests in. - -### ciBuildId - -Type: `string | number ` - -A unique identifier for a run to enable grouping or parallelization. - -### ~~copyFiles~~ - -Type: `string` - -**Deprecated:** A regex string that is used to choose what additional integration files to copy to the dist folder - -### devServerTarget - -Type: `string` - -Dev server target to run tests against. - -### exit - -Default: `true` - -Type: `boolean` - -Whether or not the Cypress Test Runner will stay open after running tests in a spec file - -### group - -Type: `string` - -A named group for recorded runs in the Cypress dashboard. - -### headed - -Default: `false` - -Type: `boolean` - -Displays the browser instead of running headlessly. Set this to 'true' if your run depends on a Chrome extension being loaded. - -### ~~headless~~ - -Default: `false` - -Type: `boolean` - -**Deprecated:** Hide the browser instead of running headed (default for cypress run). - -### ignoreTestFiles - -Type: `string` - -A String or Array of glob patterns used to ignore test files that would otherwise be shown in your list of tests. Cypress uses minimatch with the options: {dot: true, matchBase: true}. We suggest using https://globster.xyz to test what files would match. - -### key - -Type: `string` - -The key cypress should use to run tests in parallel/record the run (CI only) - -### parallel - -Default: `false` - -Type: `boolean` - -Whether or not Cypress should run its tests in parallel (CI only) - -### record - -Default: `false` - -Type: `boolean` - -Whether or not Cypress should record the results of the tests - -### reporter - -Type: `string` - -The reporter used during cypress run - -### reporterOptions - -Type: `string` - -The reporter options used. Supported options depend on the reporter. - -### skipServe - -Default: `false` - -Type: `boolean` - -Skip dev-server build. - -### spec - -Type: `string` - -A comma delimited glob string that is provided to the Cypress runner to specify which spec files to run. i.e. '**examples/**,**actions.spec** - -### tag - -Alias(es): t - -Type: `string` - -A comma delimited list to identify a run with - -### testingType - -Default: `e2e` - -Type: `string` - -Possible values: `component`, `e2e` - -Specify the type of tests to execute - -### tsConfig - -Type: `string` - -The path of the Cypress tsconfig configuration json file. - -### watch - -Default: `false` - -Type: `boolean` - -Recompile and run tests when files change. diff --git a/docs/generated/api-cypress/generators/cypress-project.md b/docs/generated/api-cypress/generators/cypress-project.md deleted file mode 100644 index 26afa88c10..0000000000 --- a/docs/generated/api-cypress/generators/cypress-project.md +++ /dev/null @@ -1,102 +0,0 @@ ---- -title: '@nrwl/cypress:cypress-project generator' -description: 'Add a Cypress E2E Project' ---- - -# @nrwl/cypress:cypress-project - -Add a Cypress E2E Project - -## Usage - -```bash -nx generate cypress-project ... -``` - -By default, Nx will search for `cypress-project` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/cypress:cypress-project ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g cypress-project ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -Name of the E2E Project - -### baseUrl - -Type: `string` - -The address (with the port) which your application is running on - -### directory - -Type: `string` - -A directory where the project is placed - -### js - -Default: `false` - -Type: `boolean` - -Generate JavaScript files rather than TypeScript files - -### linter - -Default: `eslint` - -Type: `string` - -Possible values: `eslint`, `tslint`, `none` - -The tool to use for running lint checks. - -### project - -Type: `string` - -The name of the frontend project to test. - -### setParserOptionsProject - -Default: `false` - -Type: `boolean` - -Whether or not to configure the ESLint "parserOptions.project" option. We do not do this by default for lint performance reasons. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files - -### skipPackageJson - -Default: `false` - -Type: `boolean` - -Do not add dependencies to `package.json`. - -### standaloneConfig - -Type: `boolean` - -Split the project configuration into /project.json rather than including it inside workspace.json diff --git a/docs/generated/api-detox/executors/build.md b/docs/generated/api-detox/executors/build.md deleted file mode 100644 index 7f768cd2aa..0000000000 --- a/docs/generated/api-detox/executors/build.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: '@nrwl/detox:build executor' -description: 'Run the command defined in build property of the specified configuration.' ---- - -# @nrwl/detox:build - -Run the command defined in build property of the specified configuration. - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Options - -### configPath - -Alias(es): cp - -Type: `string` - -Specify Detox config file path. If not supplied, detox searches for .detoxrc[.js] or "detox" section in package.json - -### detoxConfiguration - -Alias(es): C - -Type: `string` - -Select a device configuration from your defined configurations, if not supplied, and there's only one configuration, detox will default to it diff --git a/docs/generated/api-detox/executors/test.md b/docs/generated/api-detox/executors/test.md deleted file mode 100644 index a1555442be..0000000000 --- a/docs/generated/api-detox/executors/test.md +++ /dev/null @@ -1,202 +0,0 @@ ---- -title: '@nrwl/detox:test executor' -description: 'Initiating your detox test suite.' ---- - -# @nrwl/detox:test - -Initiating your detox test suite. - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Options - -### detoxConfiguration (_**required**_) - -Alias(es): C - -Type: `string` - -Select a device configuration from your defined configurations, if not supplied, and there's only one configuration, detox will default to it - -### appLaunchArgs - -Type: `number` - -Custom arguments to pass (through) onto the app every time it is launched. - -### artifactsLocation - -Alias(es): a - -Type: `string` - -Artifacts (logs, screenshots, etc) root directory. - -### buildTarget - -Type: `string` - -Target which builds the application - -### captureViewHierarchy - -Type: `string` - -Possible values: `enabled`, `disabled` - -[iOS Only] Capture \*.uihierarchy snapshots on view action errors and device.captureViewHierarchy() calls. - -### cleanup - -Type: `boolean` - -Shutdown simulator when test is over, useful for CI scripts, to make sure detox exists cleanly with no residue - -### configPath - -Alias(es): cp - -Type: `string` - -Specify Detox config file path. If not supplied, detox searches for .detoxrc[.js] or "detox" section in package.json - -### debugSynchronization - -Alias(es): d - -Type: `boolean` - -Customize how long an action/expectation can take to complete before Detox starts querying the app why it is busy. By default, the app status will be printed if the action takes more than 10s to complete. - -### deviceLaunchArgs - -Type: `string` - -A list of passthrough-arguments to use when (if) devices (Android emulator / iOS simulator) are launched by Detox. - -### deviceName - -Alias(es): n - -Type: `string` - -Override the device name specified in a configuration. Useful for running a single build configuration on multiple devices. - -### forceAdbInstall - -Type: `boolean` - -Due to problems with the adb install command on Android, Detox resorts to a different scheme for install APK's. Setting true will disable that and force usage of adb install, instead. - -### gpu - -Type: `boolean` - -[Android Only] Launch Emulator with the specific -gpu [gpu mode] parameter. - -### headless - -Type: `boolean` - -Android Only] Launch Emulator in headless mode. Useful when running on CI. - -### inspectBrk - -Type: `boolean` - -Uses node's --inspect-brk flag to let users debug the jest/mocha test runner - -### jestReportSpecs - -Type: `boolean` - -[Jest Only] Whether to output logs per each running spec, in real-time. By default, disabled with multiple workers. - -### loglevel - -Alias(es): l - -Type: `string` - -Possible values: `fatal`, `error`, `warn`, `info`, `verbose`, `trace` - -Log level: fatal, error, warn, info, verbose, trace - -### noColor - -Type: `boolean` - -Disable colors in log output - -### recordLogs - -Type: `string` - -Possible values: `failing`, `all`, `none` - -Save logs during each test to artifacts directory. Pass "failing" to save logs of failing tests only. - -### recordPerformance - -Type: `string` - -Possible values: `all`, `none` - -[iOS Only] Save Detox Instruments performance recordings of each test to artifacts directory. - -### recordTimeline - -Type: `string` - -Possible values: `all`, `none` - -[Jest Only] Record tests and events timeline, for visual display on the chrome://tracing tool. - -### recordVideos - -Type: `string` - -Possible values: `failing`, `all`, `none` - -Save screen recordings of each test to artifacts directory. Pass "failing" to save recordings of failing tests only. - -### retries - -Type: `number` - -[Jest Circus Only] Re-spawn the test runner for individual failing suite files until they pass, or times at least. - -### reuse - -Type: `boolean` - -Reuse existing installed app (do not delete + reinstall) for a faster run. - -### runnerConfig - -Alias(es): o - -Type: `string` - -Test runner config file, defaults to 'e2e/mocha.opts' for mocha and 'e2e/config.json' for jest. - -### takeScreenshots - -Type: `string` - -Possible values: `manual`, `failing`, `all`, `none` - -Save screenshots before and after each test to artifacts directory. Pass "failing" to save screenshots of failing tests only. - -### useCustomLogger - -Type: `boolean` - -Use Detox' custom console-logging implementation, for logging Detox (non-device) logs. Disabling will fallback to node.js / test-runner's implementation (e.g. Jest / Mocha). - -### workers - -Type: `number` - -Specifies number of workers the test runner should spawn, requires a test runner with parallel execution support (Detox CLI currently supports Jest). diff --git a/docs/generated/api-detox/generators/application.md b/docs/generated/api-detox/generators/application.md deleted file mode 100644 index 36b863db4a..0000000000 --- a/docs/generated/api-detox/generators/application.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -title: '@nrwl/detox:application generator' -description: 'Create a detox application' ---- - -# @nrwl/detox:application - -Create a detox application - -## Usage - -```bash -nx generate application ... -``` - -```bash -nx g app ... # same -``` - -By default, Nx will search for `application` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/detox:application ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g application ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -Name of the E2E Project - -### project (_**required**_) - -Type: `string` - -The name of the frontend project to test. - -### directory - -Type: `string` - -A directory where the project is placed - -### js - -Default: `false` - -Type: `boolean` - -Generate JavaScript files rather than TypeScript files - -### linter - -Default: `eslint` - -Type: `string` - -Possible values: `eslint`, `tslint`, `none` - -The tool to use for running lint checks. - -### setParserOptionsProject - -Default: `false` - -Type: `boolean` - -Whether or not to configure the ESLint "parserOptions.project" option. We do not do this by default for lint performance reasons. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files diff --git a/docs/generated/api-express/generators/application.md b/docs/generated/api-express/generators/application.md deleted file mode 100644 index 9adb724215..0000000000 --- a/docs/generated/api-express/generators/application.md +++ /dev/null @@ -1,134 +0,0 @@ ---- -title: '@nrwl/express:application generator' -description: 'Create an express application' ---- - -# @nrwl/express:application - -Create an express application - -## Usage - -```bash -nx generate application ... -``` - -```bash -nx g app ... # same -``` - -By default, Nx will search for `application` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/express:application ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g application ... --dry-run -``` - -## Options - -### babelJest - -Default: `false` - -Type: `boolean` - -Use babel instead ts-jest - -### directory - -Type: `string` - -The directory of the new application. - -### frontendProject - -Type: `string` - -Frontend project that needs to access this application. This sets up proxy configuration. - -### js - -Default: `false` - -Type: `boolean` - -Generate JavaScript files rather than TypeScript files. - -### linter - -Default: `eslint` - -Type: `string` - -Possible values: `eslint`, `tslint` - -The tool to use for running lint checks. - -### name - -Type: `string` - -The name of the application. - -### pascalCaseFiles - -Alias(es): P - -Default: `false` - -Type: `boolean` - -Use pascal case file names. - -### setParserOptionsProject - -Default: `false` - -Type: `boolean` - -Whether or not to configure the ESLint "parserOptions.project" option. We do not do this by default for lint performance reasons. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files - -### skipPackageJson - -Default: `false` - -Type: `boolean` - -Do not add dependencies to package.json. - -### standaloneConfig - -Type: `boolean` - -Split the project configuration into /project.json rather than including it inside workspace.json - -### tags - -Type: `string` - -Add tags to the application (used for linting) - -### unitTestRunner - -Default: `jest` - -Type: `string` - -Possible values: `jest`, `none` - -Test runner to use for unit tests diff --git a/docs/generated/api-jest/executors/jest.md b/docs/generated/api-jest/executors/jest.md deleted file mode 100644 index d409e49187..0000000000 --- a/docs/generated/api-jest/executors/jest.md +++ /dev/null @@ -1,256 +0,0 @@ ---- -title: '@nrwl/jest:jest executor' -description: 'Run Jest unit tests' ---- - -# @nrwl/jest:jest - -Run Jest unit tests - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Options - -### jestConfig (_**required**_) - -Type: `string` - -The path of the Jest configuration. (https://jestjs.io/docs/en/configuration) - -### bail - -Alias(es): b - -Type: `number | boolean ` - -Exit the test suite immediately after `n` number of failing tests. (https://jestjs.io/docs/cli#--bail) - -### changedSince - -Type: `string` - -Runs tests related to the changes since the provided branch or commit hash. If the current branch has diverged from the given branch, then only changes made locally will be tested. (https://jestjs.io/docs/cli#--changedsince) - -### ci - -Type: `boolean` - -Whether to run Jest in continuous integration (CI) mode. This option is on by default in most popular CI environments. It will prevent snapshots from being written unless explicitly requested. (https://jestjs.io/docs/cli#--ci) - -### clearCache - -Type: `boolean` - -Deletes the Jest cache directory and then exits without running tests. Will delete Jest's default cache directory. _Note: clearing the cache will reduce performance_. - -### codeCoverage - -Alias(es): coverage - -Type: `boolean` - -Indicates that test coverage information should be collected and reported in the output. (https://jestjs.io/docs/cli#--coverageboolean) - -### color - -Alias(es): colors - -Type: `boolean` - -Forces test results output color highlighting (even if stdout is not a TTY). Set to false if you would like to have no colors. (https://jestjs.io/docs/cli#--colors) - -### colors - -Type: `boolean` - -Forces test results output highlighting even if stdout is not a TTY. (https://jestjs.io/docs/cli#--colors) - -### config - -Type: `string` - -The path to a Jest config file specifying how to find and execute tests. If no rootDir is set in the config, the directory containing the config file is assumed to be the rootDir for the project. This can also be a JSON-encoded value which Jest will use as configuration - -### coverageDirectory - -Type: `string` - -The directory where Jest should output its coverage files. - -### coverageReporters - -Type: `array` - -A list of reporter names that Jest uses when writing coverage reports. Any istanbul reporter - -### detectLeaks - -Type: `boolean` - -**EXPERIMENTAL**: Detect memory leaks in tests. After executing a test, it will try to garbage collect the global object used, and fail if it was leaked - -### detectOpenHandles - -Type: `boolean` - -Attempt to collect and print open handles preventing Jest from exiting cleanly (https://jestjs.io/docs/cli#--detectopenhandles) - -### findRelatedTests - -Type: `string` - -Find and run the tests that cover a comma separated list of source files that were passed in as arguments. (https://jestjs.io/docs/cli#--findrelatedtests-spaceseparatedlistofsourcefiles) - -### json - -Type: `boolean` - -Prints the test results in JSON. This mode will send all other test output and user messages to stderr. (https://jestjs.io/docs/cli#--json) - -### logHeapUsage - -Type: `boolean` - -Logs the heap usage after every test. Useful to debug memory leaks. Use together with --runInBand and --expose-gc in node. - -### maxWorkers - -Alias(es): w - -Type: `number | string ` - -Specifies the maximum number of workers the worker-pool will spawn for running tests. This defaults to the number of the cores available on your machine. Useful for CI. (its usually best not to override this default) (https://jestjs.io/docs/cli#--maxworkersnumstring) - -### onlyChanged - -Alias(es): o - -Type: `boolean` - -Attempts to identify which tests to run based on which files have changed in the current repository. Only works if you're running tests in a git or hg repository at the moment. (https://jestjs.io/docs/cli#--onlychanged) - -### outputFile - -Type: `string` - -Write test results to a file when the --json option is also specified. (https://jestjs.io/docs/cli#--outputfilefilename) - -### passWithNoTests - -Type: `boolean` - -Will not fail if no tests are found (for example while using `--testPathPattern`.) (https://jestjs.io/docs/cli#--passwithnotests) - -### reporters - -Type: `array` - -Run tests with specified reporters. Reporter options are not available via CLI. Example with multiple reporters: jest --reporters="default" --reporters="jest-junit" (https://jestjs.io/docs/cli#--reporters) - -### runInBand - -Alias(es): i - -Type: `boolean` - -Run all tests serially in the current process (rather than creating a worker pool of child processes that run tests). This is sometimes useful for debugging, but such use cases are pretty rare. Useful for CI. (https://jestjs.io/docs/cli#--runinband) - -### ~~setupFile~~ - -Type: `string` - -**Deprecated:** The name of a setup file used by Jest. (use Jest config file https://jestjs.io/docs/en/configuration#setupfilesafterenv-array) - -### showConfig - -Type: `boolean` - -Print your Jest config and then exits. (https://jestjs.io/docs/en/cli#--showconfig) - -### silent - -Type: `boolean` - -Prevent tests from printing messages through the console. (https://jestjs.io/docs/cli#--silent) - -### testFile - -Type: `string` - -The name of the file to test. - -### testLocationInResults - -Type: `boolean` - -Adds a location field to test results. Used to report location of a test in a reporter. { "column": 4, "line": 5 } (https://jestjs.io/docs/cli#--testlocationinresults) - -### testNamePattern - -Alias(es): t - -Type: `string` - -Run only tests with a name that matches the regex pattern. (https://jestjs.io/docs/cli#--testnamepatternregex) - -### testPathIgnorePatterns - -Type: `array` - -An array of regexp pattern strings that is matched against all tests paths before executing the test. Only run those tests with a path that does not match with the provided regexp expressions. (https://jestjs.io/docs/cli#--testpathignorepatternsregexarray) - -### testPathPattern - -Type: `array` - -An array of regexp pattern strings that is matched against all tests paths before executing the test. (https://jestjs.io/docs/cli#--testpathpatternregex) - -### testResultsProcessor - -Type: `string` - -Node module that implements a custom results processor. (https://jestjs.io/docs/en/configuration#testresultsprocessor-string) - -### testTimeout - -Type: `number` - -Default timeout of a test in milliseconds. Default value: 5000. (https://jestjs.io/docs/cli#--testtimeoutnumber) - -### ~~tsConfig~~ - -Type: `string` - -**Deprecated:** The name of the Typescript configuration file. Set the tsconfig option in the jest config file. - -### updateSnapshot - -Alias(es): u - -Type: `boolean` - -Use this flag to re-record snapshots. Can be used together with a test suite pattern or with `--testNamePattern` to re-record snapshot for test matching the pattern. (https://jestjs.io/docs/cli#--updatesnapshot) - -### useStderr - -Type: `boolean` - -Divert all output to stderr. - -### verbose - -Type: `boolean` - -Display individual test results with the test suite hierarchy. (https://jestjs.io/docs/cli#--verbose) - -### watch - -Type: `boolean` - -Watch files for changes and rerun tests related to changed files. If you want to re-run all tests when a file has changed, use the `--watchAll` option. (https://jestjs.io/docs/cli#--watch) - -### watchAll - -Type: `boolean` - -Watch files for changes and rerun all tests when something changes. If you want to re-run only the tests that depend on the changed files, use the `--watch` option. (https://jestjs.io/docs/cli#--watchall) diff --git a/docs/generated/api-js/executors/swc.md b/docs/generated/api-js/executors/swc.md deleted file mode 100644 index 04cb70fec0..0000000000 --- a/docs/generated/api-js/executors/swc.md +++ /dev/null @@ -1,76 +0,0 @@ ---- -title: '@nrwl/js:swc executor' -description: 'Build a project using SWC' ---- - -# @nrwl/js:swc - -Build a project using SWC - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Options - -### main (_**required**_) - -Type: `string` - -The name of the main entry-point file. - -### outputPath (_**required**_) - -Type: `string` - -The output path of the generated files. - -### tsConfig (_**required**_) - -Type: `string` - -The path to the Typescript configuration file. - -### assets - -Type: `array` - -List of static assets. - -### buildableProjectDepsInPackageJsonType - -Default: `peerDependencies` - -Type: `string` - -Possible values: `dependencies`, `peerDependencies` - -When `updateBuildableProjectDepsInPackageJson` is `true`, this adds dependencies to either `peerDependencies` or `dependencies`. - -### skipTypeCheck - -Default: `false` - -Type: `boolean` - -Whether to skip TypeScript type checking. - -### swcExclude - -Type: `array` - -List of SWC Glob/Regex to be excluded from compilation (https://swc.rs/docs/configuration/compilation#exclude) - -### updateBuildableProjectDepsInPackageJson - -Default: `true` - -Type: `boolean` - -Whether to update the buildable project dependencies in package.json. - -### watch - -Default: `false` - -Type: `boolean` - -Enable re-building when files change. diff --git a/docs/generated/api-js/executors/tsc.md b/docs/generated/api-js/executors/tsc.md deleted file mode 100644 index d969811292..0000000000 --- a/docs/generated/api-js/executors/tsc.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: '@nrwl/js:tsc executor' -description: 'Build a project using TypeScript.' ---- - -# @nrwl/js:tsc - -Build a project using TypeScript. - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Options - -### main (_**required**_) - -Type: `string` - -The name of the main entry-point file. - -### outputPath (_**required**_) - -Type: `string` - -The output path of the generated files. - -### tsConfig (_**required**_) - -Type: `string` - -The path to the Typescript configuration file. - -### assets - -Type: `array` - -List of static assets. - -### buildableProjectDepsInPackageJsonType - -Default: `peerDependencies` - -Type: `string` - -Possible values: `dependencies`, `peerDependencies` - -When `updateBuildableProjectDepsInPackageJson` is `true`, this adds dependencies to either `peerDependencies` or `dependencies`. - -### transformers - -Type: `array` - -List of TypeScript Transformer Plugins. - -### updateBuildableProjectDepsInPackageJson - -Default: `true` - -Type: `boolean` - -Whether to update the buildable project dependencies in package.json. - -### watch - -Default: `false` - -Type: `boolean` - -Enable re-building when files change. diff --git a/docs/generated/api-js/generators/convert-to-swc.md b/docs/generated/api-js/generators/convert-to-swc.md deleted file mode 100644 index f8fc46c4fb..0000000000 --- a/docs/generated/api-js/generators/convert-to-swc.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -title: '@nrwl/js:convert-to-swc generator' -description: 'Convert a tsc library to swc' ---- - -# @nrwl/js:convert-to-swc - -Convert a tsc library to swc - -## Usage - -```bash -nx generate convert-to-swc ... -``` - -```bash -nx g swc ... # same -``` - -By default, Nx will search for `convert-to-swc` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/js:convert-to-swc ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g convert-to-swc ... --dry-run -``` - -### Examples - -Convert libs/myapp/mylib to swc: - -```bash -nx g swc mylib -``` - -## Options - -### project (_**required**_) - -Type: `string` - -Library name - -### targets - -Type: `array` - -List of targets to convert diff --git a/docs/generated/api-js/generators/library.md b/docs/generated/api-js/generators/library.md deleted file mode 100644 index 27d84e71a7..0000000000 --- a/docs/generated/api-js/generators/library.md +++ /dev/null @@ -1,190 +0,0 @@ ---- -title: '@nrwl/js:library generator' -description: 'Create a library' ---- - -# @nrwl/js:library - -Create a library - -## Usage - -```bash -nx generate library ... -``` - -```bash -nx g lib ... # same -``` - -By default, Nx will search for `library` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/js:library ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g library ... --dry-run -``` - -### Examples - -Generate libs/myapp/mylib: - -```bash -nx g lib mylib --directory=myapp -``` - -## Options - -### name (_**required**_) - -Type: `string` - -Library name - -### buildable - -Default: `true` - -Type: `boolean` - -Generate a buildable library. - -### compiler - -Default: `tsc` - -Type: `string` - -Possible values: `tsc`, `swc` - -The compiler used by the build and test targets - -### config - -Default: `project` - -Type: `string` - -Possible values: `workspace`, `project`, `npm-scripts` - -Determines whether the project's executors should be configured in workspace.json, project.json or as npm scripts - -### directory - -Type: `string` - -A directory where the lib is placed - -### importPath - -Type: `string` - -The library name used to import it, like @myorg/my-awesome-lib - -### js - -Default: `false` - -Type: `boolean` - -Generate JavaScript files rather than TypeScript files - -### linter - -Default: `eslint` - -Type: `string` - -Possible values: `eslint`, `none` - -The tool to use for running lint checks. - -### pascalCaseFiles - -Alias(es): P - -Default: `false` - -Type: `boolean` - -Use pascal case file names. - -### publishable - -Default: `false` - -Type: `boolean` - -Generate a publishable library. - -### setParserOptionsProject - -Default: `false` - -Type: `boolean` - -Whether or not to configure the ESLint "parserOptions.project" option. We do not do this by default for lint performance reasons. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files - -### skipTsConfig - -Default: `false` - -Type: `boolean` - -Do not update tsconfig.json for development experience. - -### skipTypeCheck - -Default: `false` - -Type: `boolean` - -Whether to skip TypeScript type checking for SWC compiler. - -### strict - -Default: `true` - -Type: `boolean` - -Whether to enable tsconfig strict mode or not. - -### tags - -Type: `string` - -Add tags to the library (used for linting) - -### testEnvironment - -Default: `jsdom` - -Type: `string` - -Possible values: `jsdom`, `node` - -The test environment to use if unitTestRunner is set to jest - -### unitTestRunner - -Default: `jest` - -Type: `string` - -Possible values: `jest`, `none` - -Test runner to use for unit tests diff --git a/docs/generated/api-linter/executors/eslint.md b/docs/generated/api-linter/executors/eslint.md deleted file mode 100644 index 54bc67e6f2..0000000000 --- a/docs/generated/api-linter/executors/eslint.md +++ /dev/null @@ -1,112 +0,0 @@ ---- -title: '@nrwl/linter:eslint executor' -description: 'Run ESLint on a project' ---- - -# @nrwl/linter:eslint - -Run ESLint on a project - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Options - -### lintFilePatterns (_**required**_) - -Type: `array` - -One or more files/dirs/globs to pass directly to ESLint's lintFiles() method. - -### cache - -Default: `false` - -Type: `boolean` - -Only check changed files. - -### cacheLocation - -Type: `string` - -Path to the cache file or directory. - -### eslintConfig - -Type: `string` - -The name of the ESLint configuration file. - -### fix - -Default: `false` - -Type: `boolean` - -Fixes linting errors (may overwrite linted files). - -### force - -Default: `false` - -Type: `boolean` - -Succeeds even if there was linting errors. - -### format - -Default: `stylish` - -Type: `string` - -ESLint Output formatter (https://eslint.org/docs/user-guide/formatters). - -### hasTypeAwareRules - -Type: `boolean` - -When set to true, the linter will invalidate its cache when any of its dependencies changes. - -### ignorePath - -Type: `string` - -The path of the .eslintignore file. - -### maxWarnings - -Default: `-1` - -Type: `number` - -Number of warnings to trigger nonzero exit code - default: -1 - -### noEslintrc - -Default: `false` - -Type: `boolean` - -The equivalent of the --no-eslintrc flag on the ESLint CLI, it is false by default - -### outputFile - -Type: `string` - -File to write report to. - -### quiet - -Default: `false` - -Type: `boolean` - -Report errors only - default: false - -### silent - -Default: `false` - -Type: `boolean` - -Hide output text. diff --git a/docs/generated/api-linter/executors/lint.md b/docs/generated/api-linter/executors/lint.md deleted file mode 100644 index 4af3f20270..0000000000 --- a/docs/generated/api-linter/executors/lint.md +++ /dev/null @@ -1,114 +0,0 @@ ---- -title: '@nrwl/linter:lint executor' -description: '**[DEPRECATED]**: Please use the eslint builder instead, an automated migration was provided in v10.3.0' ---- - -# @nrwl/linter:lint - -**[DEPRECATED]**: Please use the eslint builder instead, an automated migration was provided in v10.3.0 - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Options - -### linter (_**required**_) - -Default: `eslint` - -Type: `string` - -Possible values: `eslint`, `tslint` - -The tool to use for running lint checks. - -### cache - -Default: `false` - -Type: `boolean` - -Only check changed files. - -### cacheLocation - -Type: `string` - -Path to the cache file or directory. - -### config - -Type: `string` - -The name of the configuration file. - -### exclude - -Type: `array` - -Files to exclude from linting. - -### files - -Type: `array` - -Files to include in linting. - -### fix - -Default: `false` - -Type: `boolean` - -Fixes linting errors (may overwrite linted files). - -### force - -Default: `false` - -Type: `boolean` - -Succeeds even if there was linting errors. - -### format - -Default: `stylish` - -Type: `string` - -ESLint Output formatter (https://eslint.org/docs/user-guide/formatters). - -### maxWarnings - -Default: `-1` - -Type: `number` - -Number of warnings to trigger nonzero exit code - default: -1 - -### outputFile - -Type: `string` - -File to write report to. - -### quiet - -Default: `false` - -Type: `boolean` - -Report errors only - default: false - -### silent - -Default: `false` - -Type: `boolean` - -Hide output text. - -### tsConfig - -Type: `string | string[] ` - -The name of the TypeScript configuration file. diff --git a/docs/generated/api-linter/generators/workspace-rule.md b/docs/generated/api-linter/generators/workspace-rule.md deleted file mode 100644 index ac04b9e342..0000000000 --- a/docs/generated/api-linter/generators/workspace-rule.md +++ /dev/null @@ -1,60 +0,0 @@ ---- -title: '@nrwl/linter:workspace-rule generator' -description: 'Create a new workspace ESLint rule' ---- - -# @nrwl/linter:workspace-rule - -Create a new workspace ESLint rule - -## Usage - -```bash -nx generate workspace-rule ... -``` - -By default, Nx will search for `workspace-rule` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/linter:workspace-rule ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g workspace-rule ... --dry-run -``` - -### Examples - -Create a new workspace lint rule called my-custom-rule: - -```bash -nx g @nrwl/linter:workspace-rule my-custom-rule -``` - -Create a new workspace lint rule located at tools/eslint-rules/a/b/c/my-custom-rule.ts: - -```bash -nx g @nrwl/linter:workspace-rule --name=my-custom-rule --directory=a/b/c -``` - -## Options - -### directory (_**required**_) - -Alias(es): dir - -Default: `rules` - -Type: `string` - -Create the rule under this directory within tools/eslint-rules/ (can be nested). - -### name (_**required**_) - -Type: `string` - -The name of the new rule diff --git a/docs/generated/api-nest/generators/application.md b/docs/generated/api-nest/generators/application.md deleted file mode 100644 index fde171a1ed..0000000000 --- a/docs/generated/api-nest/generators/application.md +++ /dev/null @@ -1,108 +0,0 @@ ---- -title: '@nrwl/nest:application generator' -description: 'Create a NestJS application.' ---- - -# @nrwl/nest:application - -Create a NestJS application. - -## Usage - -```bash -nx generate application ... -``` - -```bash -nx g app ... # same -``` - -By default, Nx will search for `application` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/nest:application ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g application ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name of the application. - -### directory - -Type: `string` - -The directory of the new application. - -### frontendProject - -Type: `string` - -Frontend project that needs to access this application. This sets up proxy configuration. - -### linter - -Default: `eslint` - -Type: `string` - -Possible values: `eslint`, `none` - -The tool to use for running lint checks. - -### setParserOptionsProject - -Default: `false` - -Type: `boolean` - -Whether or not to configure the ESLint "parserOptions.project" option. We do not do this by default for lint performance reasons. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files. - -### skipPackageJson - -Default: `false` - -Type: `boolean` - -Do not add dependencies to package.json. - -### standaloneConfig - -Type: `boolean` - -Split the project configuration into /project.json rather than including it inside workspace.json. - -### tags - -Type: `string` - -Add tags to the application (used for linting). - -### unitTestRunner - -Default: `jest` - -Type: `string` - -Possible values: `jest`, `none` - -Test runner to use for unit tests. diff --git a/docs/generated/api-nest/generators/class.md b/docs/generated/api-nest/generators/class.md deleted file mode 100644 index a652e44eae..0000000000 --- a/docs/generated/api-nest/generators/class.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -title: '@nrwl/nest:class generator' -description: 'Run the `class` NestJS generator with Nx project support.' ---- - -# @nrwl/nest:class - -Run the `class` NestJS generator with Nx project support. - -## Usage - -```bash -nx generate class ... -``` - -By default, Nx will search for `class` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/nest:class ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g class ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name of the class. - -### project (_**required**_) - -Alias(es): p - -Type: `string` - -The Nest project to target. - -### directory - -Alias(es): dir,path - -Type: `string` - -Directory where the generated files are placed. - -### flat - -Default: `true` - -Type: `boolean` - -Flag to indicate if a directory is created. - -### language - -Type: `string` - -Possible values: `js`, `ts` - -Nest class language. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files. - -### unitTestRunner - -Default: `jest` - -Type: `string` - -Possible values: `jest`, `none` - -Test runner to use for unit tests. diff --git a/docs/generated/api-nest/generators/controller.md b/docs/generated/api-nest/generators/controller.md deleted file mode 100644 index 2c68a99510..0000000000 --- a/docs/generated/api-nest/generators/controller.md +++ /dev/null @@ -1,100 +0,0 @@ ---- -title: '@nrwl/nest:controller generator' -description: 'Run the `controller` NestJS generator with Nx project support.' ---- - -# @nrwl/nest:controller - -Run the `controller` NestJS generator with Nx project support. - -## Usage - -```bash -nx generate controller ... -``` - -By default, Nx will search for `controller` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/nest:controller ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g controller ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name of the controller. - -### project (_**required**_) - -Alias(es): p - -Type: `string` - -The Nest project to target. - -### directory - -Alias(es): dir,path - -Type: `string` - -Directory where the generated files are placed. - -### flat - -Default: `false` - -Type: `boolean` - -Flag to indicate if a directory is created. - -### language - -Type: `string` - -Possible values: `js`, `ts` - -Nest controller language. - -### module - -Type: `string` - -Allows specification of the declaring module. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files. - -### skipImport - -Default: `false` - -Type: `boolean` - -Flag to skip the module import. - -### unitTestRunner - -Default: `jest` - -Type: `string` - -Possible values: `jest`, `none` - -Test runner to use for unit tests. diff --git a/docs/generated/api-nest/generators/convert-tslint-to-eslint.md b/docs/generated/api-nest/generators/convert-tslint-to-eslint.md deleted file mode 100644 index f13547958f..0000000000 --- a/docs/generated/api-nest/generators/convert-tslint-to-eslint.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: '@nrwl/nest:convert-tslint-to-eslint generator' -description: 'Convert a project from TSLint to ESLint.' ---- - -# @nrwl/nest:convert-tslint-to-eslint - -Convert a project from TSLint to ESLint. - -## Usage - -```bash -nx generate convert-tslint-to-eslint ... -``` - -By default, Nx will search for `convert-tslint-to-eslint` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/nest:convert-tslint-to-eslint ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g convert-tslint-to-eslint ... --dry-run -``` - -### Examples - -Convert the NestJS project `myapp` from TSLint to ESLint: - -```bash -nx g convert-tslint-to-eslint myapp -``` - -## Options - -### project (_**required**_) - -Type: `string` - -The name of the NestJS project to convert. - -### ignoreExistingTslintConfig - -Default: `false` - -Type: `boolean` - -If true we will not use existing TSLint config as a reference, we will just reset the project with the latest recommended ESLint config. - -### removeTSLintIfNoMoreTSLintTargets - -Default: `true` - -Type: `boolean` - -If this conversion leaves no more TSLint usage in the workspace, it will remove TSLint and related dependencies and configuration. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files. diff --git a/docs/generated/api-nest/generators/decorator.md b/docs/generated/api-nest/generators/decorator.md deleted file mode 100644 index 30e98953db..0000000000 --- a/docs/generated/api-nest/generators/decorator.md +++ /dev/null @@ -1,76 +0,0 @@ ---- -title: '@nrwl/nest:decorator generator' -description: 'Run the `decorator` NestJS generator with Nx project support.' ---- - -# @nrwl/nest:decorator - -Run the `decorator` NestJS generator with Nx project support. - -## Usage - -```bash -nx generate decorator ... -``` - -By default, Nx will search for `decorator` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/nest:decorator ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g decorator ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name of the decorator. - -### project (_**required**_) - -Alias(es): p - -Type: `string` - -The Nest project to target. - -### directory - -Alias(es): dir,path - -Type: `string` - -Directory where the generated files are placed. - -### flat - -Default: `true` - -Type: `boolean` - -Flag to indicate if a directory is created. - -### language - -Type: `string` - -Possible values: `js`, `ts` - -Nest decorator language. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files. diff --git a/docs/generated/api-nest/generators/filter.md b/docs/generated/api-nest/generators/filter.md deleted file mode 100644 index ebd2cf9c75..0000000000 --- a/docs/generated/api-nest/generators/filter.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -title: '@nrwl/nest:filter generator' -description: 'Run the `filter` NestJS generator with Nx project support.' ---- - -# @nrwl/nest:filter - -Run the `filter` NestJS generator with Nx project support. - -## Usage - -```bash -nx generate filter ... -``` - -By default, Nx will search for `filter` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/nest:filter ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g filter ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name of the filter. - -### project (_**required**_) - -Alias(es): p - -Type: `string` - -The Nest project to target. - -### directory - -Alias(es): dir,path - -Type: `string` - -Directory where the generated files are placed. - -### flat - -Default: `true` - -Type: `boolean` - -Flag to indicate if a directory is created. - -### language - -Type: `string` - -Possible values: `js`, `ts` - -Nest filter language. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files. - -### unitTestRunner - -Default: `jest` - -Type: `string` - -Possible values: `jest`, `none` - -Test runner to use for unit tests. diff --git a/docs/generated/api-nest/generators/gateway.md b/docs/generated/api-nest/generators/gateway.md deleted file mode 100644 index 4ae8d463da..0000000000 --- a/docs/generated/api-nest/generators/gateway.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -title: '@nrwl/nest:gateway generator' -description: 'Run the `gateway` NestJS generator with Nx project support.' ---- - -# @nrwl/nest:gateway - -Run the `gateway` NestJS generator with Nx project support. - -## Usage - -```bash -nx generate gateway ... -``` - -By default, Nx will search for `gateway` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/nest:gateway ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g gateway ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name of the gateway. - -### project (_**required**_) - -Alias(es): p - -Type: `string` - -The Nest project to target. - -### directory - -Alias(es): dir,path - -Type: `string` - -Directory where the generated files are placed. - -### flat - -Default: `true` - -Type: `boolean` - -Flag to indicate if a directory is created. - -### language - -Type: `string` - -Possible values: `js`, `ts` - -Nest gateway language. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files. - -### unitTestRunner - -Default: `jest` - -Type: `string` - -Possible values: `jest`, `none` - -Test runner to use for unit tests. diff --git a/docs/generated/api-nest/generators/guard.md b/docs/generated/api-nest/generators/guard.md deleted file mode 100644 index e42e94cef4..0000000000 --- a/docs/generated/api-nest/generators/guard.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -title: '@nrwl/nest:guard generator' -description: 'Run the `guard` NestJS generator with Nx project support.' ---- - -# @nrwl/nest:guard - -Run the `guard` NestJS generator with Nx project support. - -## Usage - -```bash -nx generate guard ... -``` - -By default, Nx will search for `guard` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/nest:guard ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g guard ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name of the guard. - -### project (_**required**_) - -Alias(es): p - -Type: `string` - -The Nest project to target. - -### directory - -Alias(es): dir,path - -Type: `string` - -Directory where the generated files are placed. - -### flat - -Default: `true` - -Type: `boolean` - -Flag to indicate if a directory is created. - -### language - -Type: `string` - -Possible values: `js`, `ts` - -Nest guard language. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files. - -### unitTestRunner - -Default: `jest` - -Type: `string` - -Possible values: `jest`, `none` - -Test runner to use for unit tests. diff --git a/docs/generated/api-nest/generators/interceptor.md b/docs/generated/api-nest/generators/interceptor.md deleted file mode 100644 index f48bf5cfd5..0000000000 --- a/docs/generated/api-nest/generators/interceptor.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -title: '@nrwl/nest:interceptor generator' -description: 'Run the `interceptor` NestJS generator with Nx project support.' ---- - -# @nrwl/nest:interceptor - -Run the `interceptor` NestJS generator with Nx project support. - -## Usage - -```bash -nx generate interceptor ... -``` - -By default, Nx will search for `interceptor` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/nest:interceptor ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g interceptor ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name of the interceptor. - -### project (_**required**_) - -Alias(es): p - -Type: `string` - -The Nest project to target. - -### directory - -Alias(es): dir,path - -Type: `string` - -Directory where the generated files are placed. - -### flat - -Default: `true` - -Type: `boolean` - -Flag to indicate if a directory is created. - -### language - -Type: `string` - -Possible values: `js`, `ts` - -Nest interceptor language. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files. - -### unitTestRunner - -Default: `jest` - -Type: `string` - -Possible values: `jest`, `none` - -Test runner to use for unit tests. diff --git a/docs/generated/api-nest/generators/interface.md b/docs/generated/api-nest/generators/interface.md deleted file mode 100644 index c92aa0cb54..0000000000 --- a/docs/generated/api-nest/generators/interface.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: '@nrwl/nest:interface generator' -description: 'Run the `interface` NestJS generator with Nx project support.' ---- - -# @nrwl/nest:interface - -Run the `interface` NestJS generator with Nx project support. - -## Usage - -```bash -nx generate interface ... -``` - -By default, Nx will search for `interface` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/nest:interface ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g interface ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name of the interface. - -### project (_**required**_) - -Alias(es): p - -Type: `string` - -The Nest project to target. - -### directory - -Alias(es): dir,path - -Type: `string` - -Directory where the generated files are placed. - -### flat - -Default: `true` - -Type: `boolean` - -Flag to indicate if a directory is created. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files. diff --git a/docs/generated/api-nest/generators/library.md b/docs/generated/api-nest/generators/library.md deleted file mode 100644 index db0ab1c738..0000000000 --- a/docs/generated/api-nest/generators/library.md +++ /dev/null @@ -1,188 +0,0 @@ ---- -title: '@nrwl/nest:library generator' -description: 'Create a new NestJS library.' ---- - -# @nrwl/nest:library - -Create a new NestJS library. - -## Usage - -```bash -nx generate library ... -``` - -```bash -nx g lib ... # same -``` - -By default, Nx will search for `library` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/nest:library ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g library ... --dry-run -``` - -### Examples - -Generate libs/myapp/mylib: - -```bash -nx g lib mylib --directory=myapp -``` - -## Options - -### name (_**required**_) - -Type: `string` - -Library name. - -### buildable - -Default: `false` - -Type: `boolean` - -Generate a buildable library. - -### controller - -Default: `false` - -Type: `boolean` - -Include a controller with the library. - -### directory - -Alias(es): dir - -Type: `string` - -A directory where the library is placed. - -### global - -Default: `false` - -Type: `boolean` - -Add the Global decorator to the generated module. - -### importPath - -Type: `string` - -The library name used to import it, like @myorg/my-awesome-lib. Must be a valid npm name. - -### linter - -Default: `eslint` - -Type: `string` - -Possible values: `eslint`, `none` - -The tool to use for running lint checks. - -### publishable - -Type: `boolean` - -Create a publishable library. - -### service - -Default: `false` - -Type: `boolean` - -Include a service with the library. - -### setParserOptionsProject - -Default: `false` - -Type: `boolean` - -Whether or not to configure the ESLint "parserOptions.project" option. We do not do this by default for lint performance reasons. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files. - -### skipTsConfig - -Default: `false` - -Type: `boolean` - -Do not update tsconfig.base.json for development experience. - -### standaloneConfig - -Default: `true` - -Type: `boolean` - -Split the project configuration into /project.json rather than including it inside workspace.json - -### strict - -Default: `false` - -Type: `boolean` - -Whether to enable tsconfig strict mode or not. - -### tags - -Alias(es): t - -Type: `string` - -Add tags to the library (used for linting). - -### target - -Default: `es6` - -Type: `string` - -Possible values: `es5`, `es6`, `esnext`, `es2015`, `es2016`, `es2017`, `es2018`, `es2019`, `es2020` - -The ES target, Nest suggest using es6 or higher. - -### testEnvironment - -Default: `node` - -Type: `string` - -Possible values: `jsdom`, `node` - -The test environment for jest, for node applications this should stay as node unless doing DOM testing. - -### unitTestRunner - -Default: `jest` - -Type: `string` - -Possible values: `jest`, `none` - -Test runner to use for unit tests. diff --git a/docs/generated/api-nest/generators/middleware.md b/docs/generated/api-nest/generators/middleware.md deleted file mode 100644 index 5e4b0c40a3..0000000000 --- a/docs/generated/api-nest/generators/middleware.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -title: '@nrwl/nest:middleware generator' -description: 'Run the `middleware` NestJS generator with Nx project support.' ---- - -# @nrwl/nest:middleware - -Run the `middleware` NestJS generator with Nx project support. - -## Usage - -```bash -nx generate middleware ... -``` - -By default, Nx will search for `middleware` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/nest:middleware ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g middleware ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name of the middleware. - -### project (_**required**_) - -Alias(es): p - -Type: `string` - -The Nest project to target. - -### directory - -Alias(es): dir,path - -Type: `string` - -Directory where the generated files are placed. - -### flat - -Default: `true` - -Type: `boolean` - -Flag to indicate if a directory is created. - -### language - -Type: `string` - -Possible values: `js`, `ts` - -Nest middleware language. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files. - -### unitTestRunner - -Default: `jest` - -Type: `string` - -Possible values: `jest`, `none` - -Test runner to use for unit tests. diff --git a/docs/generated/api-nest/generators/module.md b/docs/generated/api-nest/generators/module.md deleted file mode 100644 index a98640fa8d..0000000000 --- a/docs/generated/api-nest/generators/module.md +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: '@nrwl/nest:module generator' -description: 'Run the `module` NestJS generator with Nx project support.' ---- - -# @nrwl/nest:module - -Run the `module` NestJS generator with Nx project support. - -## Usage - -```bash -nx generate module ... -``` - -By default, Nx will search for `module` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/nest:module ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g module ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name of the module. - -### project (_**required**_) - -Alias(es): p - -Type: `string` - -The Nest project to target. - -### directory - -Alias(es): dir,path - -Type: `string` - -Directory where the generated files are placed. - -### flat - -Default: `false` - -Type: `boolean` - -Flag to indicate if a directory is created. - -### language - -Type: `string` - -Possible values: `js`, `ts` - -Nest module language. - -### module - -Type: `string` - -The path to import the module. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files. - -### skipImport - -Default: `false` - -Type: `boolean` - -Flag to skip the module import. diff --git a/docs/generated/api-nest/generators/pipe.md b/docs/generated/api-nest/generators/pipe.md deleted file mode 100644 index 2b19264077..0000000000 --- a/docs/generated/api-nest/generators/pipe.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -title: '@nrwl/nest:pipe generator' -description: 'Run the `pipe` NestJS generator with Nx project support.' ---- - -# @nrwl/nest:pipe - -Run the `pipe` NestJS generator with Nx project support. - -## Usage - -```bash -nx generate pipe ... -``` - -By default, Nx will search for `pipe` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/nest:pipe ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g pipe ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name of the pipe. - -### project (_**required**_) - -Alias(es): p - -Type: `string` - -The Nest project to target. - -### directory - -Alias(es): dir,path - -Type: `string` - -Directory where the generated files are placed. - -### flat - -Default: `true` - -Type: `boolean` - -Flag to indicate if a directory is created. - -### language - -Type: `string` - -Possible values: `js`, `ts` - -Nest pipe language. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files. - -### unitTestRunner - -Default: `jest` - -Type: `string` - -Possible values: `jest`, `none` - -Test runner to use for unit tests. diff --git a/docs/generated/api-nest/generators/provider.md b/docs/generated/api-nest/generators/provider.md deleted file mode 100644 index 17e4166dd8..0000000000 --- a/docs/generated/api-nest/generators/provider.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -title: '@nrwl/nest:provider generator' -description: 'Run the `provider` NestJS generator with Nx project support.' ---- - -# @nrwl/nest:provider - -Run the `provider` NestJS generator with Nx project support. - -## Usage - -```bash -nx generate provider ... -``` - -By default, Nx will search for `provider` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/nest:provider ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g provider ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name of the provider. - -### project (_**required**_) - -Alias(es): p - -Type: `string` - -The Nest project to target. - -### directory - -Alias(es): dir,path - -Type: `string` - -Directory where the generated files are placed. - -### flat - -Default: `true` - -Type: `boolean` - -Flag to indicate if a directory is created. - -### language - -Type: `string` - -Possible values: `js`, `ts` - -Nest provider language. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files. - -### unitTestRunner - -Default: `jest` - -Type: `string` - -Possible values: `jest`, `none` - -Test runner to use for unit tests. diff --git a/docs/generated/api-nest/generators/resolver.md b/docs/generated/api-nest/generators/resolver.md deleted file mode 100644 index afca3530fb..0000000000 --- a/docs/generated/api-nest/generators/resolver.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -title: '@nrwl/nest:resolver generator' -description: 'Run the `resolver` NestJS generator with Nx project support.' ---- - -# @nrwl/nest:resolver - -Run the `resolver` NestJS generator with Nx project support. - -## Usage - -```bash -nx generate resolver ... -``` - -By default, Nx will search for `resolver` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/nest:resolver ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g resolver ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name of the resolver. - -### project (_**required**_) - -Alias(es): p - -Type: `string` - -The Nest project to target. - -### directory - -Alias(es): dir,path - -Type: `string` - -Directory where the generated files are placed. - -### flat - -Default: `false` - -Type: `boolean` - -Flag to indicate if a directory is created. - -### language - -Type: `string` - -Possible values: `js`, `ts` - -Nest resolver language. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files. - -### unitTestRunner - -Default: `jest` - -Type: `string` - -Possible values: `jest`, `none` - -Test runner to use for unit tests. diff --git a/docs/generated/api-nest/generators/resource.md b/docs/generated/api-nest/generators/resource.md deleted file mode 100644 index 35e19905aa..0000000000 --- a/docs/generated/api-nest/generators/resource.md +++ /dev/null @@ -1,112 +0,0 @@ ---- -title: '@nrwl/nest:resource generator' -description: 'Run the `resource` NestJS generator with Nx project support.' ---- - -# @nrwl/nest:resource - -Run the `resource` NestJS generator with Nx project support. - -## Usage - -```bash -nx generate resource ... -``` - -By default, Nx will search for `resource` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/nest:resource ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g resource ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name of the resource. - -### project (_**required**_) - -Alias(es): p - -Type: `string` - -The Nest project to target. - -### crud - -Default: `true` - -Type: `boolean` - -When true, CRUD entry points are generated. - -### directory - -Alias(es): dir,path - -Type: `string` - -Directory where the generated files are placed. - -### flat - -Default: `false` - -Type: `boolean` - -Flag to indicate if a directory is created. - -### language - -Type: `string` - -Possible values: `js`, `ts` - -Nest class language. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files. - -### skipImport - -Default: `false` - -Type: `boolean` - -Flag to skip the module import. - -### type - -Default: `rest` - -Type: `string` - -Possible values: `rest`, `graphql-code-first`, `graphql-schema-first`, `microservice`, `ws` - -The transport layer. - -### unitTestRunner - -Default: `jest` - -Type: `string` - -Possible values: `jest`, `none` - -Test runner to use for unit tests. diff --git a/docs/generated/api-nest/generators/service.md b/docs/generated/api-nest/generators/service.md deleted file mode 100644 index 976473c4f8..0000000000 --- a/docs/generated/api-nest/generators/service.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -title: '@nrwl/nest:service generator' -description: 'Run the `service` NestJS generator with Nx project support.' ---- - -# @nrwl/nest:service - -Run the `service` NestJS generator with Nx project support. - -## Usage - -```bash -nx generate service ... -``` - -By default, Nx will search for `service` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/nest:service ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g service ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name of the service. - -### project (_**required**_) - -Alias(es): p - -Type: `string` - -The Nest project to target. - -### directory - -Alias(es): dir,path - -Type: `string` - -Directory where the generated files are placed. - -### flat - -Default: `false` - -Type: `boolean` - -Flag to indicate if a directory is created. - -### language - -Type: `string` - -Possible values: `js`, `ts` - -Nest service language. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files. - -### unitTestRunner - -Default: `jest` - -Type: `string` - -Possible values: `jest`, `none` - -Test runner to use for unit tests. diff --git a/docs/generated/api-next/executors/build.md b/docs/generated/api-next/executors/build.md deleted file mode 100644 index a1af2f6040..0000000000 --- a/docs/generated/api-next/executors/build.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: '@nrwl/next:build executor' -description: 'Build a Next.js app' ---- - -# @nrwl/next:build - -Build a Next.js app - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Options - -### outputPath (_**required**_) - -Type: `string` - -The output path of the generated files. - -### root (_**required**_) - -Type: `string` - -The source root - -### buildLibsFromSource - -Default: `true` - -Type: `boolean` - -Read buildable libraries from source instead of building them separately. - -### fileReplacements - -Type: `object[]` - -Replace files with other files in the build. - -#### replace - -Type: `string` - -The file to be replaced. - -#### with - -Type: `string` - -The file to replace with. - -### nextConfig - -Type: `string` - -Path (relative to workspace root) to a function which takes phase, config, and builder options, and returns the resulting config. This is an advanced option and should not be used with a normal Next.js config file (i.e. next.config.js). diff --git a/docs/generated/api-next/executors/export.md b/docs/generated/api-next/executors/export.md deleted file mode 100644 index 293a7872be..0000000000 --- a/docs/generated/api-next/executors/export.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: '@nrwl/next:export executor' -description: 'Export a Next.js app. The exported application is located at dist/$outputPath/exported.' ---- - -# @nrwl/next:export - -Export a Next.js app. The exported application is located at dist/$outputPath/exported. - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Options - -### buildLibsFromSource - -Default: `true` - -Type: `boolean` - -Read buildable libraries from source instead of building them separately. - -### buildTarget - -Type: `string` - -Target which builds the application - -### silent - -Default: `false` - -Type: `boolean` - -Hide progress or not (default is false) - -### threads - -Type: `number` - -Number of worker threads to utilize (defaults to the number of CPUs) diff --git a/docs/generated/api-next/executors/server.md b/docs/generated/api-next/executors/server.md deleted file mode 100644 index 7d3baf7f3e..0000000000 --- a/docs/generated/api-next/executors/server.md +++ /dev/null @@ -1,76 +0,0 @@ ---- -title: '@nrwl/next:server executor' -description: 'Serve a Next.js app' ---- - -# @nrwl/next:server - -Serve a Next.js app - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Options - -### buildTarget (_**required**_) - -Type: `string` - -Target which builds the application - -### buildLibsFromSource - -Default: `true` - -Type: `boolean` - -Read buildable libraries from source instead of building them separately. - -### customServerPath - -Type: `string` - -Use a custom server script - -### dev - -Default: `true` - -Type: `boolean` - -Serve the application in the dev mode - -### hostname - -Type: `string` - -Hostname on which the application is served. - -### port - -Default: `4200` - -Type: `number` - -Port to listen on. - -### proxyConfig - -Type: `string` - -Path to the proxy configuration file. - -### quiet - -Default: `false` - -Type: `boolean` - -Hide error messages containing server information. - -### staticMarkup - -Default: `false` - -Type: `boolean` - -Static markup. diff --git a/docs/generated/api-next/generators/application.md b/docs/generated/api-next/generators/application.md deleted file mode 100644 index 03d7b90102..0000000000 --- a/docs/generated/api-next/generators/application.md +++ /dev/null @@ -1,158 +0,0 @@ ---- -title: '@nrwl/next:application generator' -description: 'Create a Next.js application' ---- - -# @nrwl/next:application - -Create a Next.js application - -## Usage - -```bash -nx generate application ... -``` - -```bash -nx g app ... # same -``` - -By default, Nx will search for `application` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/next:application ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g application ... --dry-run -``` - -### Examples - -Generate apps/myorg/myapp and apps/myorg/myapp-e2e: - -```bash -nx g app myapp --directory=myorg -``` - -## Options - -### directory - -Alias(es): d - -Type: `string` - -The directory of the new application. - -### e2eTestRunner - -Default: `cypress` - -Type: `string` - -Possible values: `cypress`, `none` - -Test runner to use for end to end (e2e) tests - -### js - -Default: `false` - -Type: `boolean` - -Generate JavaScript files rather than TypeScript files. - -### linter - -Default: `eslint` - -Type: `string` - -Possible values: `eslint`, `tslint` - -The tool to use for running lint checks. - -### name - -Type: `string` - -The name of the application. - -### server - -Type: `string` - -The server script path to be used with next. - -### setParserOptionsProject - -Default: `false` - -Type: `boolean` - -Whether or not to configure the ESLint "parserOptions.project" option. We do not do this by default for lint performance reasons. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files - -### skipWorkspaceJson - -Default: `false` - -Type: `boolean` - -Skip updating workspace.json with default options based on values provided to this app (e.g. babel, style) - -### standaloneConfig - -Type: `boolean` - -Split the project configuration into /project.json rather than including it inside workspace.json - -### style - -Alias(es): s - -Default: `css` - -Type: `string` - -Possible values: `css`, `scss`, `styl`, `less`, `styled-components`, `@emotion/styled`, `styled-jsx` - -The file extension to be used for style files. - -### swc - -Default: `true` - -Type: `boolean` - -Enable the Rust-based compiler SWC to compile JS/TS files. - -### tags - -Alias(es): t - -Type: `string` - -Add tags to the application (used for linting) - -### unitTestRunner - -Default: `jest` - -Type: `string` - -Possible values: `jest`, `none` - -Test runner to use for unit tests diff --git a/docs/generated/api-next/generators/component.md b/docs/generated/api-next/generators/component.md deleted file mode 100644 index b3528c8138..0000000000 --- a/docs/generated/api-next/generators/component.md +++ /dev/null @@ -1,112 +0,0 @@ ---- -title: '@nrwl/next:component generator' -description: 'Create a React component' ---- - -# @nrwl/next:component - -Create a React component - -## Usage - -```bash -nx generate component ... -``` - -By default, Nx will search for `component` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/next:component ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g component ... --dry-run -``` - -### Examples - -Generate a component in the mylib library: - -```bash -nx g component my-component --project=mylib -``` - -Generate a class component in the mylib library: - -```bash -nx g component my-component --project=mylib --classComponent -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name of the component. - -### project (_**required**_) - -Alias(es): p - -Type: `string` - -The name of the project. - -### directory - -Alias(es): dir - -Type: `string` - -Create the component under this directory (can be nested). - -### export - -Alias(es): e - -Default: `false` - -Type: `boolean` - -When true, the component is exported from the project index.ts (if it exists). - -### flat - -Default: `false` - -Type: `boolean` - -Create component at the source root rather than its own directory. - -### js - -Default: `false` - -Type: `boolean` - -Generate JavaScript files rather than TypeScript files. - -### skipTests - -Default: `false` - -Type: `boolean` - -When true, does not create "spec.ts" test files for the new component. - -### style - -Alias(es): s - -Default: `css` - -Type: `string` - -Possible values: `css`, `scss`, `styl`, `less`, `styled-components`, `@emotion/styled`, `styled-jsx` - -The file extension to be used for style files. diff --git a/docs/generated/api-next/generators/page.md b/docs/generated/api-next/generators/page.md deleted file mode 100644 index df12dbd371..0000000000 --- a/docs/generated/api-next/generators/page.md +++ /dev/null @@ -1,106 +0,0 @@ ---- -title: '@nrwl/next:page generator' -description: 'Create a Next.js page component' ---- - -# @nrwl/next:page - -Create a Next.js page component - -## Usage - -```bash -nx generate page ... -``` - -By default, Nx will search for `page` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/next:page ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g page ... --dry-run -``` - -### Examples - -Generate a page in the my-app application: - -```bash -nx nx g page my-new-page --project=my-app -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name of the component. - -### project (_**required**_) - -Alias(es): p - -Type: `string` - -The name of the project. - -### directory - -Alias(es): dir - -Type: `string` - -Create the page under this directory (can be nested). Will be created under 'pages/'. - -### export - -Alias(es): e - -Default: `false` - -Type: `boolean` - -When true, the component is exported from the project index.ts (if it exists). - -### flat - -Default: `false` - -Type: `boolean` - -Create component at the source root rather than its own directory. - -### js - -Default: `false` - -Type: `boolean` - -Generate JavaScript files rather than TypeScript files. - -### style - -Alias(es): s - -Default: `css` - -Type: `string` - -Possible values: `css`, `scss`, `styl`, `less`, `styled-components`, `@emotion/styled`, `styled-jsx`, `none` - -The file extension to be used for style files. - -### withTests - -Default: `false` - -Type: `boolean` - -When true, creates a "spec.ts" test file for the new page. diff --git a/docs/generated/api-node/executors/node.md b/docs/generated/api-node/executors/node.md deleted file mode 100644 index a53b2dbed4..0000000000 --- a/docs/generated/api-node/executors/node.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: '@nrwl/node:node executor' -description: 'Execute a Node application' ---- - -# @nrwl/node:node - -Execute a Node application - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Options - -### buildTarget (_**required**_) - -Type: `string` - -The target to run to build you the app - -### args - -Type: `array` - -Extra args when starting the app - -### host - -Default: `localhost` - -Type: `string` - -The host to inspect the process on - -### inspect - -Default: `inspect` - -Type: `string | boolean ` - -Ensures the app is starting with debugging - -### port - -Default: `9229` - -Type: `number` - -The port to inspect the process on. Setting port to 0 will assign random free ports to all forked processes. - -### runtimeArgs - -Type: `array` - -Extra args passed to the node process - -### waitUntilTargets - -Type: `array` - -The targets to run to before starting the node app - -### watch - -Default: `true` - -Type: `boolean` - -Enable re-building when files change. diff --git a/docs/generated/api-node/executors/webpack.md b/docs/generated/api-node/executors/webpack.md deleted file mode 100644 index db3030261e..0000000000 --- a/docs/generated/api-node/executors/webpack.md +++ /dev/null @@ -1,190 +0,0 @@ ---- -title: '@nrwl/node:webpack executor' -description: 'Build a Node application using webpack' ---- - -# @nrwl/node:webpack - -Build a Node application using webpack - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Options - -### main (_**required**_) - -Type: `string` - -The name of the main entry-point file. - -### tsConfig (_**required**_) - -Type: `string` - -The name of the Typescript configuration file. - -### additionalEntryPoints - -Type: `object[]` - -#### entryName - -Type: `string` - -Name of the additional entry file - -#### entryPath - -Type: `string` - -Path to the additional entry file - -### assets - -Type: `array` - -List of static application assets. - -### buildLibsFromSource - -Default: `true` - -Type: `boolean` - -Read buildable libraries from source instead of building them separately. - -### externalDependencies - -Default: `all` - -Type: `string | string[] ` - -Dependencies to keep external to the bundle. ("all" (default), "none", or an array of module names) - -### extractLicenses - -Default: `false` - -Type: `boolean` - -Extract all licenses in a separate file, in the case of production builds only. - -### fileReplacements - -Type: `object[]` - -Replace files with other files in the build. - -#### replace - -Type: `string` - -The file to be replaced. - -#### with - -Type: `string` - -The file to replace with. - -### generatePackageJson - -Default: `false` - -Type: `boolean` - -Generates a package.json file with the project's node_module dependencies populated for installing in a container. If a package.json exists in the project's directory, it will be reused with dependencies populated. - -### maxWorkers - -Type: `number` - -Number of workers to use for type checking. (defaults to # of CPUS - 2) - -### memoryLimit - -Type: `number` - -Memory limit for type checking service process in MB. (defaults to 2048) - -### optimization - -Default: `false` - -Type: `boolean` - -Defines the optimization level of the build. - -### outputFileName - -Default: `main.js` - -Type: `string` - -Name of the main output file. (defaults to 'main.js') - -### outputPath - -Type: `string` - -The output path of the generated files. - -### poll - -Type: `number` - -Frequency of file watcher in ms. - -### progress - -Default: `false` - -Type: `boolean` - -Log progress to the console while building. - -### sourceMap - -Default: `true` - -Type: `boolean` - -Produce source maps. - -### statsJson - -Default: `false` - -Type: `boolean` - -Generates a 'stats.json' file which can be analyzed using tools such as: 'webpack-bundle-analyzer' or . - -### transformers - -Alias(es): tsPlugins - -Type: `array` - -List of TypeScript Compiler Transfomers Plugins. - -### verbose - -Default: `false` - -Type: `boolean` - -Emits verbose output - -### watch - -Default: `false` - -Type: `boolean` - -Run build when files change. - -### webpackConfig - -Type: `array[] | string ` - -Path to a function which takes a webpack config, context and returns the resulting webpack config diff --git a/docs/generated/api-node/generators/application.md b/docs/generated/api-node/generators/application.md deleted file mode 100644 index 3144b0ab63..0000000000 --- a/docs/generated/api-node/generators/application.md +++ /dev/null @@ -1,134 +0,0 @@ ---- -title: '@nrwl/node:application generator' -description: 'Create a node application' ---- - -# @nrwl/node:application - -Create a node application - -## Usage - -```bash -nx generate application ... -``` - -```bash -nx g app ... # same -``` - -By default, Nx will search for `application` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/node:application ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g application ... --dry-run -``` - -## Options - -### babelJest - -Default: `false` - -Type: `boolean` - -Use babel instead ts-jest - -### directory - -Type: `string` - -The directory of the new application. - -### frontendProject - -Type: `string` - -Frontend project that needs to access this application. This sets up proxy configuration. - -### js - -Default: `false` - -Type: `boolean` - -Generate JavaScript files rather than TypeScript files. - -### linter - -Default: `eslint` - -Type: `string` - -Possible values: `eslint`, `tslint` - -The tool to use for running lint checks. - -### name - -Type: `string` - -The name of the application. - -### pascalCaseFiles - -Alias(es): P - -Default: `false` - -Type: `boolean` - -Use pascal case file names. - -### setParserOptionsProject - -Default: `false` - -Type: `boolean` - -Whether or not to configure the ESLint "parserOptions.project" option. We do not do this by default for lint performance reasons. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files - -### skipPackageJson - -Default: `false` - -Type: `boolean` - -Do not add dependencies to package.json. - -### standaloneConfig - -Type: `boolean` - -Split the project configuration into /project.json rather than including it inside workspace.json - -### tags - -Type: `string` - -Add tags to the application (used for linting) - -### unitTestRunner - -Default: `jest` - -Type: `string` - -Possible values: `jest`, `none` - -Test runner to use for unit tests diff --git a/docs/generated/api-node/generators/library.md b/docs/generated/api-node/generators/library.md deleted file mode 100644 index 963693c1e1..0000000000 --- a/docs/generated/api-node/generators/library.md +++ /dev/null @@ -1,204 +0,0 @@ ---- -title: '@nrwl/node:library generator' -description: 'Create a library' ---- - -# @nrwl/node:library - -Create a library - -## Usage - -```bash -nx generate library ... -``` - -```bash -nx g lib ... # same -``` - -By default, Nx will search for `library` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/node:library ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g library ... --dry-run -``` - -### Examples - -Generate libs/myapp/mylib: - -```bash -nx g lib mylib --directory=myapp -``` - -## Options - -### name (_**required**_) - -Type: `string` - -Library name - -### babelJest - -Default: `false` - -Type: `boolean` - -Use babel instead ts-jest - -### buildable - -Default: `false` - -Type: `boolean` - -Generate a buildable library. - -### compiler - -Default: `tsc` - -Type: `string` - -Possible values: `tsc`, `swc` - -The compiler used by the build and test targets - -### directory - -Alias(es): dir - -Type: `string` - -A directory where the lib is placed - -### importPath - -Type: `string` - -The library name used to import it, like @myorg/my-awesome-lib. Must be a valid npm name. - -### js - -Default: `false` - -Type: `boolean` - -Generate JavaScript files rather than TypeScript files. - -### linter - -Default: `eslint` - -Type: `string` - -Possible values: `eslint`, `tslint` - -The tool to use for running lint checks. - -### pascalCaseFiles - -Alias(es): P - -Default: `false` - -Type: `boolean` - -Use pascal case file names. - -### publishable - -Type: `boolean` - -Create a publishable library. - -### rootDir - -Alias(es): srcRootForCompilationRoot - -Type: `string` - -Sets the rootDir for TypeScript compilation. When not defined, it uses the project's root property, or srcRootForCompilationRoot if it is defined. - -### setParserOptionsProject - -Default: `false` - -Type: `boolean` - -Whether or not to configure the ESLint "parserOptions.project" option. We do not do this by default for lint performance reasons. - -### simpleModuleName - -Default: `false` - -Type: `boolean` - -Keep the module name simple (when using --directory) - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files - -### skipTsConfig - -Default: `false` - -Type: `boolean` - -Do not update tsconfig.base.json for development experience. - -### standaloneConfig - -Type: `boolean` - -Split the project configuration into /project.json rather than including it inside workspace.json - -### strict - -Default: `false` - -Type: `boolean` - -Whether to enable tsconfig strict mode or not. - -### tags - -Alias(es): t - -Type: `string` - -Add tags to the library (used for linting) - -### testEnvironment - -Default: `jsdom` - -Type: `string` - -Possible values: `jsdom`, `node` - -The test environment to use if unitTestRunner is set to jest - -### unitTestRunner - -Default: `jest` - -Type: `string` - -Possible values: `jest`, `none` - -Test runner to use for unit tests diff --git a/docs/generated/api-nx-plugin/executors/e2e.md b/docs/generated/api-nx-plugin/executors/e2e.md deleted file mode 100644 index ef73868681..0000000000 --- a/docs/generated/api-nx-plugin/executors/e2e.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: '@nrwl/nx-plugin:e2e executor' -description: 'Creates and runs the e2e tests for an Nx Plugin.' ---- - -# @nrwl/nx-plugin:e2e - -Creates and runs the e2e tests for an Nx Plugin. - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Options - -### jestConfig (_**required**_) - -Type: `string` - -Jest config file. - -### target (_**required**_) - -Type: `string` - -The build target for the Nx Plugin project. - -### ~~tsSpecConfig~~ - -Type: `string` - -**Deprecated:** Use the `tsconfig` property for `ts-jest` in the e2e project `jest.config.js` file. It will be removed in the next major release. - -The tsconfig file for specs. diff --git a/docs/generated/api-nx-plugin/generators/executor.md b/docs/generated/api-nx-plugin/generators/executor.md deleted file mode 100644 index 9ba010200f..0000000000 --- a/docs/generated/api-nx-plugin/generators/executor.md +++ /dev/null @@ -1,70 +0,0 @@ ---- -title: '@nrwl/nx-plugin:executor generator' -description: 'Create a executor for an Nx Plugin' ---- - -# @nrwl/nx-plugin:executor - -Create a executor for an Nx Plugin - -## Usage - -```bash -nx generate executor ... -``` - -By default, Nx will search for `executor` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/nx-plugin:executor ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g executor ... --dry-run -``` - -### Examples - -Generate libs/my-plugin/src/executors/my-executor: - -```bash -nx g executor my-executor --project=my-plugin -``` - -## Options - -### name (_**required**_) - -Type: `string` - -Executor name - -### project (_**required**_) - -Alias(es): p - -Type: `string` - -The name of the project. - -### description - -Alias(es): d - -Type: `string` - -Executor description - -### unitTestRunner - -Default: `jest` - -Type: `string` - -Possible values: `jest`, `none` - -Test runner to use for unit tests diff --git a/docs/generated/api-nx-plugin/generators/generator.md b/docs/generated/api-nx-plugin/generators/generator.md deleted file mode 100644 index 9e93ca51e0..0000000000 --- a/docs/generated/api-nx-plugin/generators/generator.md +++ /dev/null @@ -1,70 +0,0 @@ ---- -title: '@nrwl/nx-plugin:generator generator' -description: 'Create a generator for an Nx Plugin' ---- - -# @nrwl/nx-plugin:generator - -Create a generator for an Nx Plugin - -## Usage - -```bash -nx generate generator ... -``` - -By default, Nx will search for `generator` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/nx-plugin:generator ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g generator ... --dry-run -``` - -### Examples - -Generate libs/my-plugin/src/generators/my-generator: - -```bash -nx g generator my-generator --project=my-plugin -``` - -## Options - -### name (_**required**_) - -Type: `string` - -Generator name - -### project (_**required**_) - -Alias(es): p - -Type: `string` - -The name of the project. - -### description - -Alias(es): d - -Type: `string` - -Generator description - -### unitTestRunner - -Default: `jest` - -Type: `string` - -Possible values: `jest`, `none` - -Test runner to use for unit tests diff --git a/docs/generated/api-nx-plugin/generators/migration.md b/docs/generated/api-nx-plugin/generators/migration.md deleted file mode 100644 index 79e825351c..0000000000 --- a/docs/generated/api-nx-plugin/generators/migration.md +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: '@nrwl/nx-plugin:migration generator' -description: 'Create a migration for an Nx Plugin' ---- - -# @nrwl/nx-plugin:migration - -Create a migration for an Nx Plugin - -## Usage - -```bash -nx generate migration ... -``` - -By default, Nx will search for `migration` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/nx-plugin:migration ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g migration ... --dry-run -``` - -### Examples - -Generate libs/my-plugin/src/migrations/my-migration: - -```bash -nx g migration my-migration --project=my-plugin --version=1.0.0 -``` - -## Options - -### packageVersion (_**required**_) - -Alias(es): v - -Type: `string` - -Version to use for the migration - -### project (_**required**_) - -Alias(es): p - -Type: `string` - -The name of the project. - -### description - -Alias(es): d - -Type: `string` - -Migration description - -### name - -Type: `string` - -Migration name - -### packageJsonUpdates - -Alias(es): p - -Default: `false` - -Type: `boolean` - -Whether or not to include package.json updates diff --git a/docs/generated/api-nx-plugin/generators/plugin.md b/docs/generated/api-nx-plugin/generators/plugin.md deleted file mode 100644 index 28cf02cbc2..0000000000 --- a/docs/generated/api-nx-plugin/generators/plugin.md +++ /dev/null @@ -1,126 +0,0 @@ ---- -title: '@nrwl/nx-plugin:plugin generator' -description: 'Create a Nx Plugin' ---- - -# @nrwl/nx-plugin:plugin - -Create a Nx Plugin - -## Usage - -```bash -nx generate plugin ... -``` - -By default, Nx will search for `plugin` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/nx-plugin:plugin ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g plugin ... --dry-run -``` - -### Examples - -Generate libs/plugins/my-plugin: - -```bash -nx g plugin my-plugin --directory=plugins --importPath=@myorg/my-plugin -``` - -## Options - -### name (_**required**_) - -Type: `string` - -Plugin name - -### compiler - -Default: `tsc` - -Type: `string` - -Possible values: `tsc`, `swc` - -The compiler used by the build and test targets - -### directory - -Alias(es): d - -Type: `string` - -A directory where the plugin is placed - -### importPath - -Type: `string` - -How the plugin will be published, like @myorg/my-awesome-plugin. Note this must be a valid npm name - -### linter - -Default: `eslint` - -Type: `string` - -Possible values: `eslint`, `tslint` - -The tool to use for running lint checks. - -### setParserOptionsProject - -Default: `false` - -Type: `boolean` - -Whether or not to configure the ESLint "parserOptions.project" option. We do not do this by default for lint performance reasons. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files - -### skipTsConfig - -Default: `false` - -Type: `boolean` - -Do not update tsconfig.json for development experience. - -### standaloneConfig - -Type: `boolean` - -Split the project configuration into /project.json rather than including it inside workspace.json - -### tags - -Alias(es): t - -Type: `string` - -Add tags to the library (used for linting) - -### unitTestRunner - -Default: `jest` - -Type: `string` - -Possible values: `jest`, `none` - -Test runner to use for unit tests diff --git a/docs/generated/api-react-native/executors/build-android.md b/docs/generated/api-react-native/executors/build-android.md deleted file mode 100644 index 03f1f3086c..0000000000 --- a/docs/generated/api-react-native/executors/build-android.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: '@nrwl/react-native:build-android executor' -description: 'Release Build for Android.' ---- - -# @nrwl/react-native:build-android - -Release Build for Android. - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Options - -### apk - -Type: `boolean` - -Generate apk file(s) rather than a bundle (.aab). - -### debug - -Type: `boolean` - -Generate a debug build instead of a release build diff --git a/docs/generated/api-react-native/executors/bundle.md b/docs/generated/api-react-native/executors/bundle.md deleted file mode 100644 index 0d34ebe0f0..0000000000 --- a/docs/generated/api-react-native/executors/bundle.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -title: '@nrwl/react-native:bundle executor' -description: 'Builds the JavaScript bundle for offline use.' ---- - -# @nrwl/react-native:bundle - -Builds the JavaScript bundle for offline use. - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Options - -### bundleOutput (_**required**_) - -Type: `string` - -The output path of the generated files. - -### entryFile (_**required**_) - -Type: `string` - -The entry file relative to project root. - -### platform (_**required**_) - -Type: `string` - -Platform to build for (ios, android). - -### dev - -Default: `true` - -Type: `boolean` - -Generate a development build. - -### maxWorkers - -Type: `number` - -The number of workers we should parallelize the transformer on. - -### sourceMap - -Type: `boolean` - -Whether source maps should be generated or not. diff --git a/docs/generated/api-react-native/executors/ensure-symlink.md b/docs/generated/api-react-native/executors/ensure-symlink.md deleted file mode 100644 index db2e65b434..0000000000 --- a/docs/generated/api-react-native/executors/ensure-symlink.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: '@nrwl/react-native:ensure-symlink executor' -description: "Ensure workspace node_modules is symlink under app's node_modules folder." ---- - -# @nrwl/react-native:ensure-symlink - -Ensure workspace node_modules is symlink under app's node_modules folder. - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. diff --git a/docs/generated/api-react-native/executors/run-android.md b/docs/generated/api-react-native/executors/run-android.md deleted file mode 100644 index ec8797aa20..0000000000 --- a/docs/generated/api-react-native/executors/run-android.md +++ /dev/null @@ -1,106 +0,0 @@ ---- -title: '@nrwl/react-native:run-android executor' -description: 'Runs Android application.' ---- - -# @nrwl/react-native:run-android - -Runs Android application. - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Options - -### appId - -Type: `string` - -Specify an applicationId to launch after build. If not specified, 'package' from AndroidManifest.xml will be used. - -### appIdSuffix - -Type: `string` - -Specify an applicationIdSuffix to launch after build. - -### deviceId - -Type: `string` - -Builds your app and starts it on a specific device/simulator with the given device id (listed by running "adb devices" on the command line). - -### interactive - -Default: `true` - -Type: `boolean` - -Run packager server in interactive mode. - -### jetifier - -Default: `true` - -Type: `boolean` - -Run jetifier – the AndroidX transition tool. By default it runs before Gradle to ease working with libraries that don't support AndroidX yet. - -### mainActivity - -Default: `MainActivity` - -Type: `string` - -Name of the activity to start. - -### packager - -Default: `true` - -Type: `boolean` - -Starts the packager server. - -### port - -Default: `8081` - -Type: `number` - -The port where the packager server is listening on. - -### resetCache - -Default: `false` - -Type: `boolean` - -Resets metro cache. - -### sync - -Default: `true` - -Type: `boolean` - -Syncs npm dependencies to package.json (for React Native autolink). - -### tasks - -Type: `string` - -Run custom gradle tasks. If this argument is provided, then --variant option is ignored. Example: yarn react-native run-android --tasks clean,installDebug. - -### terminal - -Type: `string` - -Launches the Metro Bundler in a new window using the specified terminal path. - -### variant - -Default: `debug` - -Type: `string` - -Specify your app's build variant (e.g. debug, release). diff --git a/docs/generated/api-react-native/executors/run-ios.md b/docs/generated/api-react-native/executors/run-ios.md deleted file mode 100644 index d8a2a1d6f2..0000000000 --- a/docs/generated/api-react-native/executors/run-ios.md +++ /dev/null @@ -1,92 +0,0 @@ ---- -title: '@nrwl/react-native:run-ios executor' -description: 'Runs iOS application.' ---- - -# @nrwl/react-native:run-ios - -Runs iOS application. - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Options - -### device - -Type: `string` - -Explicitly set device to use by name. The value is not required if you have a single device connected. - -### install - -Default: `true` - -Type: `boolean` - -Runs 'pod install' for native modules before building iOS app. - -### interactive - -Default: `true` - -Type: `boolean` - -Run packager server in interactive mode. - -### packager - -Default: `true` - -Type: `boolean` - -Starts the packager server. - -### port - -Default: `8081` - -Type: `number` - -The port where the packager server is listening on. - -### resetCache - -Default: `false` - -Type: `boolean` - -Resets metro cache. - -### scheme - -Type: `string` - -Explicitly set the Xcode scheme to use - -### simulator - -Type: `string` - -Explicitly set simulator to use. Optionally include iOS version between parenthesis at the end to match an exact version: "iPhone X (12.1)" - -### sync - -Default: `true` - -Type: `boolean` - -Syncs npm dependencies to package.json (for React Native autolink). Always true when --install is used. - -### terminal - -Type: `string` - -Launches the Metro Bundler in a new window using the specified terminal path. - -### xcodeConfiguration - -Default: `Debug` - -Type: `string` - -Explicitly set the Xcode configuration to use diff --git a/docs/generated/api-react-native/executors/start.md b/docs/generated/api-react-native/executors/start.md deleted file mode 100644 index 4bab560015..0000000000 --- a/docs/generated/api-react-native/executors/start.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: '@nrwl/react-native:start executor' -description: 'Starts the Javascript server that communicates with connected devices.' ---- - -# @nrwl/react-native:start - -Starts the Javascript server that communicates with connected devices. - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Options - -### interactive - -Default: `true` - -Type: `boolean` - -Run packager server in interactive mode. - -### port - -Default: `8081` - -Type: `number` - -The port to listen on. - -### resetCache - -Default: `false` - -Type: `boolean` - -Resets metro cache. diff --git a/docs/generated/api-react-native/executors/storybook.md b/docs/generated/api-react-native/executors/storybook.md deleted file mode 100644 index c59d54defd..0000000000 --- a/docs/generated/api-react-native/executors/storybook.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: '@nrwl/react-native:storybook executor' -description: 'Serve React Native Storybook' ---- - -# @nrwl/react-native:storybook - -Serve React Native Storybook - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Options - -### outputFile (_**required**_) - -Default: `./.storybook/story-loader.js` - -Type: `string` - -The output file that will be written. It is relative to the project directory. - -### pattern (_**required**_) - -Default: `**/*.stories.@(js|jsx|ts|tsx|md)` - -Type: `string` - -The pattern of files to look at. It can be a specific file, or any valid glob. Note: if using the CLI, globs with \*_/_... must be escaped with quotes - -### searchDir (_**required**_) - -Type: `string` - -The directory or directories, relative to the project root, to search for files in. - -### silent - -Default: `false` - -Type: `boolean` - -Silences output. diff --git a/docs/generated/api-react-native/executors/sync-deps.md b/docs/generated/api-react-native/executors/sync-deps.md deleted file mode 100644 index 2d3c2649da..0000000000 --- a/docs/generated/api-react-native/executors/sync-deps.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: '@nrwl/react-native:sync-deps executor' -description: 'Syncs dependencies to package.json (required for autolinking).' ---- - -# @nrwl/react-native:sync-deps - -Syncs dependencies to package.json (required for autolinking). - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Options - -### include - -Type: `string` - -A comma-separated list of additional npm packages to include. e.g. 'nx sync-deps --include=react-native-gesture-handler,react-native-safe-area-context' diff --git a/docs/generated/api-react-native/generators/application.md b/docs/generated/api-react-native/generators/application.md deleted file mode 100644 index c240edeab8..0000000000 --- a/docs/generated/api-react-native/generators/application.md +++ /dev/null @@ -1,130 +0,0 @@ ---- -title: '@nrwl/react-native:application generator' -description: 'Create a React Native application' ---- - -# @nrwl/react-native:application - -Create a React Native application - -## Usage - -```bash -nx generate application ... -``` - -```bash -nx g app ... # same -``` - -By default, Nx will search for `application` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/react-native:application ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g application ... --dry-run -``` - -### Examples - -Generate apps/nested/myapp: - -```bash -nx g app myapp --directory=nested -``` - -Use class components instead of functional components: - -```bash -nx g app myapp --classComponent -``` - -## Options - -### directory - -Alias(es): d - -Type: `string` - -The directory of the new application. - -### displayName - -Type: `string` - -The display name to show in the application. Defaults to name. - -### e2eTestRunner - -Default: `detox` - -Type: `string` - -Possible values: `detox`, `none` - -Adds the specified e2e test runner - -### js - -Default: `false` - -Type: `boolean` - -Generate JavaScript files rather than TypeScript files - -### linter - -Default: `eslint` - -Type: `string` - -Possible values: `eslint`, `tslint` - -The tool to use for running lint checks. - -### name - -Type: `string` - -The name of the application. - -### setParserOptionsProject - -Default: `false` - -Type: `boolean` - -Whether or not to configure the ESLint "parserOptions.project" option. We do not do this by default for lint performance reasons. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files - -### tags - -Alias(es): t - -Type: `string` - -Add tags to the application (used for linting) - -### unitTestRunner - -Default: `jest` - -Type: `string` - -Possible values: `jest`, `none` - -Test runner to use for unit tests diff --git a/docs/generated/api-react-native/generators/component-story.md b/docs/generated/api-react-native/generators/component-story.md deleted file mode 100644 index 789898a6dc..0000000000 --- a/docs/generated/api-react-native/generators/component-story.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: '@nrwl/react-native:component-story generator' -description: 'Generate storybook story for a react-native component' ---- - -# @nrwl/react-native:component-story - -Generate storybook story for a react-native component - -## Usage - -```bash -nx generate component-story ... -``` - -By default, Nx will search for `component-story` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/react-native:component-story ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g component-story ... --dry-run -``` - -## Options - -### componentPath (_**required**_) - -Type: `string` - -Relative path to the component file from the library root - -### project (_**required**_) - -Type: `string` - -The project name where to add the components. diff --git a/docs/generated/api-react-native/generators/component.md b/docs/generated/api-react-native/generators/component.md deleted file mode 100644 index dcece36b30..0000000000 --- a/docs/generated/api-react-native/generators/component.md +++ /dev/null @@ -1,124 +0,0 @@ ---- -title: '@nrwl/react-native:component generator' -description: 'Create a React Native component' ---- - -# @nrwl/react-native:component - -Create a React Native component - -## Usage - -```bash -nx generate component ... -``` - -```bash -nx g c ... # same -``` - -By default, Nx will search for `component` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/react-native:component ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g component ... --dry-run -``` - -### Examples - -Generate a component in the mylib library: - -```bash -nx g component my-component --project=mylib -``` - -Generate a class component in the mylib library: - -```bash -nx g component my-component --project=mylib --classComponent -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name of the component. - -### project (_**required**_) - -Alias(es): p - -Type: `string` - -The name of the project. - -### classComponent - -Alias(es): C - -Default: `false` - -Type: `boolean` - -Use class components instead of functional component. - -### directory - -Alias(es): d - -Type: `string` - -Create the component under this directory (can be nested). - -### export - -Alias(es): e - -Default: `false` - -Type: `boolean` - -When true, the component is exported from the project index.ts (if it exists). - -### flat - -Default: `false` - -Type: `boolean` - -Create component at the source root rather than its own directory. - -### js - -Default: `false` - -Type: `boolean` - -Generate JavaScript files rather than TypeScript files. - -### pascalCaseFiles - -Alias(es): P - -Default: `false` - -Type: `boolean` - -Use pascal case component file name (e.g. App.tsx). - -### skipTests - -Default: `false` - -Type: `boolean` - -When true, does not create "spec.ts" test files for the new component. diff --git a/docs/generated/api-react-native/generators/library.md b/docs/generated/api-react-native/generators/library.md deleted file mode 100644 index bed3e5b66f..0000000000 --- a/docs/generated/api-react-native/generators/library.md +++ /dev/null @@ -1,162 +0,0 @@ ---- -title: '@nrwl/react-native:library generator' -description: 'Create a React Native library' ---- - -# @nrwl/react-native:library - -Create a React Native library - -## Usage - -```bash -nx generate library ... -``` - -```bash -nx g lib ... # same -``` - -By default, Nx will search for `library` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/react-native:library ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g library ... --dry-run -``` - -### Examples - -Generate libs/myapp/mylib: - -```bash -nx g lib mylib --directory=myapp -``` - -## Options - -### name (_**required**_) - -Type: `string` - -Library name - -### buildable - -Default: `false` - -Type: `boolean` - -Generate a buildable library. - -### directory - -Alias(es): d - -Type: `string` - -A directory where the lib is placed. - -### globalCss - -Default: `false` - -Type: `boolean` - -When true, the stylesheet is generated using global CSS instead of CSS modules (e.g. file is '_.css' rather than '_.module.css'). - -### importPath - -Type: `string` - -The library name used to import it, like @myorg/my-awesome-lib - -### js - -Default: `false` - -Type: `boolean` - -Generate JavaScript files rather than TypeScript files. - -### linter - -Default: `eslint` - -Type: `string` - -Possible values: `eslint`, `tslint` - -The tool to use for running lint checks. - -### pascalCaseFiles - -Alias(es): P - -Default: `false` - -Type: `boolean` - -Use pascal case component file name (e.g. App.tsx). - -### publishable - -Type: `boolean` - -Create a publishable library. - -### setParserOptionsProject - -Default: `false` - -Type: `boolean` - -Whether or not to configure the ESLint "parserOptions.project" option. We do not do this by default for lint performance reasons. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files. - -### skipTsConfig - -Default: `false` - -Type: `boolean` - -Do not update tsconfig.json for development experience. - -### strict - -Default: `true` - -Type: `boolean` - -Whether to enable tsconfig strict mode or not. - -### tags - -Alias(es): t - -Type: `string` - -Add tags to the library (used for linting). - -### unitTestRunner - -Default: `jest` - -Type: `string` - -Possible values: `jest`, `none` - -Test runner to use for unit tests. diff --git a/docs/generated/api-react-native/generators/stories.md b/docs/generated/api-react-native/generators/stories.md deleted file mode 100644 index 2b040cb980..0000000000 --- a/docs/generated/api-react-native/generators/stories.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: '@nrwl/react-native:stories generator' -description: 'Create stories for all components declared in an app or library' ---- - -# @nrwl/react-native:stories - -Create stories for all components declared in an app or library - -## Usage - -```bash -nx generate stories ... -``` - -By default, Nx will search for `stories` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/react-native:stories ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g stories ... --dry-run -``` - -## Options - -### project (_**required**_) - -Type: `string` - -Library or application name diff --git a/docs/generated/api-react-native/generators/storybook-configuration.md b/docs/generated/api-react-native/generators/storybook-configuration.md deleted file mode 100644 index 09bc218e00..0000000000 --- a/docs/generated/api-react-native/generators/storybook-configuration.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: '@nrwl/react-native:storybook-configuration generator' -description: 'Set up storybook for a react-native app or library' ---- - -# @nrwl/react-native:storybook-configuration - -Set up storybook for a react-native app or library - -## Usage - -```bash -nx generate storybook-configuration ... -``` - -By default, Nx will search for `storybook-configuration` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/react-native:storybook-configuration ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g storybook-configuration ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -Project name - -### generateStories - -Default: `true` - -Type: `boolean` - -Automatically generate \*.stories.ts files for components declared in this project? - -### js - -Default: `false` - -Type: `boolean` - -Generate JavaScript files rather than TypeScript files. - -### linter - -Default: `eslint` - -Type: `string` - -Possible values: `eslint`, `tslint` - -The tool to use for running lint checks. - -### standaloneConfig - -Type: `boolean` - -Split the project configuration into /project.json rather than including it inside workspace.json diff --git a/docs/generated/api-react/generators/application.md b/docs/generated/api-react/generators/application.md deleted file mode 100644 index f0e527cf8f..0000000000 --- a/docs/generated/api-react/generators/application.md +++ /dev/null @@ -1,210 +0,0 @@ ---- -title: '@nrwl/react:application generator' -description: 'Create a React application' ---- - -# @nrwl/react:application - -Create a React application - -## Usage - -```bash -nx generate application ... -``` - -```bash -nx g app ... # same -``` - -By default, Nx will search for `application` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/react:application ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g application ... --dry-run -``` - -### Examples - -Generate apps/myorg/myapp and apps/myorg/myapp-e2e: - -```bash -nx g app myapp --directory=myorg -``` - -Use class components instead of functional components: - -```bash -nx g app myapp --classComponent -``` - -Set up React Router: - -```bash -nx g app myapp --routing -``` - -## Options - -### classComponent - -Alias(es): C - -Default: `false` - -Type: `boolean` - -Use class components instead of functional component. - -### compiler - -Default: `babel` - -Type: `string` - -Possible values: `babel`, `swc` - -The compiler to use - -### directory - -Alias(es): dir - -Type: `string` - -The directory of the new application. - -### e2eTestRunner - -Default: `cypress` - -Type: `string` - -Possible values: `cypress`, `none` - -Test runner to use for end to end (e2e) tests. - -### globalCss - -Default: `false` - -Type: `boolean` - -Default is false. When true, the component is generated with _.css/_.scss instead of _.module.css/_.module.scss - -### js - -Default: `false` - -Type: `boolean` - -Generate JavaScript files rather than TypeScript files. - -### linter - -Default: `eslint` - -Type: `string` - -Possible values: `eslint`, `tslint` - -The tool to use for running lint checks. - -### name - -Type: `string` - -The name of the application. - -### pascalCaseFiles - -Alias(es): P - -Default: `false` - -Type: `boolean` - -Use pascal case component file name (e.g. App.tsx). - -### routing - -Default: `false` - -Type: `boolean` - -Generate application with routes. - -### setParserOptionsProject - -Default: `false` - -Type: `boolean` - -Whether or not to configure the ESLint "parserOptions.project" option. We do not do this by default for lint performance reasons. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files. - -### skipWorkspaceJson - -Default: `false` - -Type: `boolean` - -Skip updating workspace.json with default options based on values provided to this app (e.g. babel, style). - -### standaloneConfig - -Type: `boolean` - -Split the project configuration into /project.json rather than including it inside workspace.json - -### strict - -Default: `true` - -Type: `boolean` - -Creates an application with strict mode and strict type checking - -### style - -Alias(es): s - -Default: `css` - -Type: `string` - -Possible values: `css`, `scss`, `styl`, `less`, `styled-components`, `@emotion/styled`, `styled-jsx`, `none` - -The file extension to be used for style files. - -### tags - -Alias(es): t - -Type: `string` - -Add tags to the application (used for linting). - -### unitTestRunner - -Default: `jest` - -Type: `string` - -Possible values: `jest`, `none` - -Test runner to use for unit tests. diff --git a/docs/generated/api-react/generators/component-cypress-spec.md b/docs/generated/api-react/generators/component-cypress-spec.md deleted file mode 100644 index f69d0785a5..0000000000 --- a/docs/generated/api-react/generators/component-cypress-spec.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: '@nrwl/react:component-cypress-spec generator' -description: 'Create a cypress spec for a ui component that has a story' ---- - -# @nrwl/react:component-cypress-spec - -Create a cypress spec for a ui component that has a story - -## Usage - -```bash -nx generate component-cypress-spec ... -``` - -By default, Nx will search for `component-cypress-spec` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/react:component-cypress-spec ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g component-cypress-spec ... --dry-run -``` - -## Options - -### componentPath (_**required**_) - -Type: `string` - -Relative path to the component file from the library root? - -### project (_**required**_) - -Type: `string` - -The project name for which to generate tests. - -### cypressProject - -Type: `string` - -The Cypress project to generate the stories under. By default, inferred from 'project' - -### js - -Default: `false` - -Type: `boolean` - -Generate JavaScript files rather than TypeScript files. diff --git a/docs/generated/api-react/generators/component-story.md b/docs/generated/api-react/generators/component-story.md deleted file mode 100644 index 5812759ece..0000000000 --- a/docs/generated/api-react/generators/component-story.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: '@nrwl/react:component-story generator' -description: 'Generate storybook story for a react component' ---- - -# @nrwl/react:component-story - -Generate storybook story for a react component - -## Usage - -```bash -nx generate component-story ... -``` - -By default, Nx will search for `component-story` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/react:component-story ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g component-story ... --dry-run -``` - -## Options - -### componentPath (_**required**_) - -Type: `string` - -Relative path to the component file from the library root - -### project (_**required**_) - -Type: `string` - -The project name where to add the components. diff --git a/docs/generated/api-react/generators/component.md b/docs/generated/api-react/generators/component.md deleted file mode 100644 index d6a5e5dfe7..0000000000 --- a/docs/generated/api-react/generators/component.md +++ /dev/null @@ -1,166 +0,0 @@ ---- -title: '@nrwl/react:component generator' -description: 'Create a React component' ---- - -# @nrwl/react:component - -Create a React component - -## Usage - -```bash -nx generate component ... -``` - -```bash -nx g c ... # same -``` - -By default, Nx will search for `component` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/react:component ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g component ... --dry-run -``` - -### Examples - -Generate a component in the mylib library: - -```bash -nx g component my-component --project=mylib -``` - -Generate a class component in the mylib library: - -```bash -nx g component my-component --project=mylib --classComponent -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name of the component. - -### project (_**required**_) - -Alias(es): p - -Type: `string` - -The name of the project. - -### classComponent - -Alias(es): C - -Default: `false` - -Type: `boolean` - -Use class components instead of functional component. - -### directory - -Alias(es): dir - -Type: `string` - -Create the component under this directory (can be nested). - -### export - -Alias(es): e - -Default: `false` - -Type: `boolean` - -When true, the component is exported from the project index.ts (if it exists). - -### fileName - -Type: `string` - -Create a component with this file name. - -### flat - -Default: `false` - -Type: `boolean` - -Create component at the source root rather than its own directory. - -### globalCss - -Default: `false` - -Type: `boolean` - -Default is false. When true, the component is generated with _.css/_.scss instead of _.module.css/_.module.scss - -### js - -Default: `false` - -Type: `boolean` - -Generate JavaScript files rather than TypeScript files. - -### pascalCaseDirectory - -Alias(es): R - -Default: `false` - -Type: `boolean` - -Use pascal case directory name (e.g. App/App.tsx). - -### pascalCaseFiles - -Alias(es): P - -Default: `false` - -Type: `boolean` - -Use pascal case component file name (e.g. App.tsx). - -### routing - -Type: `boolean` - -Generate a library with routes. - -### skipTests - -Default: `false` - -Type: `boolean` - -When true, does not create "spec.ts" test files for the new component. - -### style - -Alias(es): s - -Default: `css` - -Type: `string` - -Possible values: `css`, `scss`, `styl`, `less`, `styled-components`, `@emotion/styled`, `styled-jsx`, `none` - -The file extension to be used for style files. diff --git a/docs/generated/api-react/generators/hook.md b/docs/generated/api-react/generators/hook.md deleted file mode 100644 index 93c6f2c85c..0000000000 --- a/docs/generated/api-react/generators/hook.md +++ /dev/null @@ -1,118 +0,0 @@ ---- -title: '@nrwl/react:hook generator' -description: 'Create a hook' ---- - -# @nrwl/react:hook - -Create a hook - -## Usage - -```bash -nx generate hook ... -``` - -```bash -nx g h ... # same -``` - -By default, Nx will search for `hook` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/react:hook ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g hook ... --dry-run -``` - -### Examples - -Generate a hook in the mylib library: - -```bash -nx g hook my-hook --project=mylib -``` - -## Options - -### name (_**required**_) - -Type: `string` - -The name of the hook. - -### project (_**required**_) - -Alias(es): p - -Type: `string` - -The name of the project. - -### directory - -Alias(es): d - -Type: `string` - -Create the hook under this directory (can be nested). - -### export - -Alias(es): e - -Default: `false` - -Type: `boolean` - -When true, the hook is exported from the project index.ts (if it exists). - -### flat - -Default: `false` - -Type: `boolean` - -Create hook at the source root rather than its own directory. - -### js - -Default: `false` - -Type: `boolean` - -Generate JavaScript files rather than TypeScript files. - -### pascalCaseDirectory - -Alias(es): R - -Default: `false` - -Type: `boolean` - -Use pascal case directory name (e.g. useHook/useHook.ts). - -### pascalCaseFiles - -Alias(es): P - -Default: `false` - -Type: `boolean` - -Use pascal case hook file name (e.g. useHook.ts). - -### skipTests - -Default: `false` - -Type: `boolean` - -When true, does not create "spec.ts" test files for the new hook. diff --git a/docs/generated/api-react/generators/library.md b/docs/generated/api-react/generators/library.md deleted file mode 100644 index b79ccd1a33..0000000000 --- a/docs/generated/api-react/generators/library.md +++ /dev/null @@ -1,218 +0,0 @@ ---- -title: '@nrwl/react:library generator' -description: 'Create a React library' ---- - -# @nrwl/react:library - -Create a React library - -## Usage - -```bash -nx generate library ... -``` - -```bash -nx g lib ... # same -``` - -By default, Nx will search for `library` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/react:library ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g library ... --dry-run -``` - -### Examples - -Generate libs/myapp/mylib: - -```bash -nx g lib mylib --directory=myapp -``` - -Generate a library with routes and add them to myapp: - -```bash -nx g lib mylib --appProject=myapp -``` - -## Options - -### name (_**required**_) - -Type: `string` - -Library name - -### appProject - -Alias(es): a - -Type: `string` - -The application project to add the library route to. - -### buildable - -Default: `false` - -Type: `boolean` - -Generate a buildable library. - -### compiler - -Default: `babel` - -Type: `string` - -Possible values: `babel`, `swc` - -Which compiler to use. - -### component - -Default: `true` - -Type: `boolean` - -Generate a default component. - -### directory - -Alias(es): dir - -Type: `string` - -A directory where the lib is placed. - -### globalCss - -Default: `false` - -Type: `boolean` - -When true, the stylesheet is generated using global CSS instead of CSS modules (e.g. file is '_.css' rather than '_.module.css'). - -### importPath - -Type: `string` - -The library name used to import it, like @myorg/my-awesome-lib - -### js - -Default: `false` - -Type: `boolean` - -Generate JavaScript files rather than TypeScript files. - -### linter - -Default: `eslint` - -Type: `string` - -Possible values: `eslint`, `tslint` - -The tool to use for running lint checks. - -### pascalCaseFiles - -Alias(es): P - -Default: `false` - -Type: `boolean` - -Use pascal case component file name (e.g. App.tsx). - -### publishable - -Type: `boolean` - -Create a publishable library. - -### routing - -Type: `boolean` - -Generate library with routes. - -### setParserOptionsProject - -Default: `false` - -Type: `boolean` - -Whether or not to configure the ESLint "parserOptions.project" option. We do not do this by default for lint performance reasons. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files. - -### skipTsConfig - -Default: `false` - -Type: `boolean` - -Do not update tsconfig.json for development experience. - -### standaloneConfig - -Type: `boolean` - -Split the project configuration into /project.json rather than including it inside workspace.json - -### strict - -Default: `true` - -Type: `boolean` - -Whether to enable tsconfig strict mode or not. - -### style - -Alias(es): s - -Default: `css` - -Type: `string` - -Possible values: `css`, `scss`, `styl`, `less`, `styled-components`, `@emotion/styled`, `styled-jsx`, `none` - -The file extension to be used for style files. - -### tags - -Alias(es): t - -Type: `string` - -Add tags to the library (used for linting). - -### unitTestRunner - -Default: `jest` - -Type: `string` - -Possible values: `jest`, `none` - -Test runner to use for unit tests. diff --git a/docs/generated/api-react/generators/redux.md b/docs/generated/api-react/generators/redux.md deleted file mode 100644 index 95929652f2..0000000000 --- a/docs/generated/api-react/generators/redux.md +++ /dev/null @@ -1,72 +0,0 @@ ---- -title: '@nrwl/react:redux generator' -description: 'Create a redux slice for a project' ---- - -# @nrwl/react:redux - -Create a redux slice for a project - -## Usage - -```bash -nx generate redux ... -``` - -```bash -nx g slice ... # same -``` - -By default, Nx will search for `redux` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/react:redux ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g redux ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -Redux slice name. - -### appProject - -Alias(es): a - -Type: `string` - -The application project to add the slice to. - -### directory - -Alias(es): dir - -Type: `string` - -The name of the folder used to contain/group the generated Redux files. - -### js - -Default: `false` - -Type: `boolean` - -Generate JavaScript files rather than TypeScript files. - -### project - -Alias(es): p - -Type: `string` - -The name of the project to add the slice to. If it is an application, then the store configuration will be updated too. diff --git a/docs/generated/api-react/generators/stories.md b/docs/generated/api-react/generators/stories.md deleted file mode 100644 index 450e56af4f..0000000000 --- a/docs/generated/api-react/generators/stories.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: '@nrwl/react:stories generator' -description: 'Create stories/specs for all components declared in an app or library' ---- - -# @nrwl/react:stories - -Create stories/specs for all components declared in an app or library - -## Usage - -```bash -nx generate stories ... -``` - -By default, Nx will search for `stories` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/react:stories ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g stories ... --dry-run -``` - -## Options - -### project (_**required**_) - -Type: `string` - -Library or application name - -### cypressProject - -Type: `string` - -The Cypress project to generate the stories under. This is inferred from 'project' by default - -### generateCypressSpecs - -Type: `boolean` - -Automatically generate \*.spec.ts files in the cypress e2e app generated by the cypress-configure generator. - -### js - -Default: `false` - -Type: `boolean` - -Generate JavaScript files rather than TypeScript files. diff --git a/docs/generated/api-react/generators/storybook-configuration.md b/docs/generated/api-react/generators/storybook-configuration.md deleted file mode 100644 index 3bd1828248..0000000000 --- a/docs/generated/api-react/generators/storybook-configuration.md +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: '@nrwl/react:storybook-configuration generator' -description: 'Set up storybook for a react app or library' ---- - -# @nrwl/react:storybook-configuration - -Set up storybook for a react app or library - -## Usage - -```bash -nx generate storybook-configuration ... -``` - -By default, Nx will search for `storybook-configuration` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/react:storybook-configuration ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g storybook-configuration ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -Project name - -### configureCypress - -Default: `true` - -Type: `boolean` - -Run the cypress-configure generator. - -### cypressDirectory - -Type: `string` - -A directory where the Cypress project will be placed. Placed at the root by default. - -### generateCypressSpecs - -Default: `true` - -Type: `boolean` - -Automatically generate \*.spec.ts files in the cypress e2e app generated by the cypress-configure generator - -### generateStories - -Default: `true` - -Type: `boolean` - -Automatically generate \*.stories.ts files for components declared in this project? - -### js - -Default: `false` - -Type: `boolean` - -Generate JavaScript files rather than TypeScript files. - -### linter - -Default: `eslint` - -Type: `string` - -Possible values: `eslint`, `tslint` - -The tool to use for running lint checks. - -### standaloneConfig - -Type: `boolean` - -Split the project configuration into /project.json rather than including it inside workspace.json diff --git a/docs/generated/api-react/generators/storybook-migrate-defaults-5-to-6.md b/docs/generated/api-react/generators/storybook-migrate-defaults-5-to-6.md deleted file mode 100644 index c340edc3f0..0000000000 --- a/docs/generated/api-react/generators/storybook-migrate-defaults-5-to-6.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -title: '@nrwl/react:storybook-migrate-defaults-5-to-6 generator' -description: 'Generate default Storybook configuration files using Storybook version >=6.x specs, for projects that already have Storybook instances and configurations of versions <6.x.' ---- - -# @nrwl/react:storybook-migrate-defaults-5-to-6 - -Generate default Storybook configuration files using Storybook version >=6.x specs, for projects that already have Storybook instances and configurations of versions <6.x. - -## Usage - -```bash -nx generate storybook-migrate-defaults-5-to-6 ... -``` - -By default, Nx will search for `storybook-migrate-defaults-5-to-6` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/react:storybook-migrate-defaults-5-to-6 ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g storybook-migrate-defaults-5-to-6 ... --dry-run -``` - -## Options - -### all - -Default: `true` - -Type: `boolean` - -Generate new Storybook configurations for all Storybook instances across all apps and libs. - -### keepOld - -Default: `true` - -Type: `boolean` - -Keep the old configuration files - put them in a folder called .old_storybook. - -### name - -Type: `string` - -Leave empty to upgrade all Storybook instances. Only use this if you want to do a gradual migration. Library or application name for which you want to generate the new Storybook configuration. diff --git a/docs/generated/api-storybook/executors/build.md b/docs/generated/api-storybook/executors/build.md deleted file mode 100644 index 3b5b83ca7d..0000000000 --- a/docs/generated/api-storybook/executors/build.md +++ /dev/null @@ -1,60 +0,0 @@ ---- -title: '@nrwl/storybook:build executor' -description: 'Build Storybook' ---- - -# @nrwl/storybook:build - -Build Storybook - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Options - -### uiFramework (_**required**_) (**hidden**) - -Default: `@storybook/angular` - -Type: `string` - -Storybook framework npm package - -### docsMode - -Default: `false` - -Type: `boolean` - -Build a documentation-only site using addon-docs. - -### outputPath - -Type: `string` - -The output path of the generated files. - -### projectBuildConfig - -Type: `string` - -Workspace project where Storybook reads the Webpack config from - -### quiet - -Default: `true` - -Type: `boolean` - -Suppress verbose build output. - -### stylePreprocessorOptions.includePaths - -Type: `array` - -Options to pass to style preprocessors. The paths to include. Paths will be resolved to workspace root. This is for Angular projects only, as an option for the Storybook/Angular builder. It will be ignored in non-Angular projects. - -### styles - -Type: `array` - -Global styles to be included in the build. This is for Angular projects only, as an option for the Storybook/Angular builder. It will be ignored in non-Angular projects. diff --git a/docs/generated/api-storybook/executors/storybook.md b/docs/generated/api-storybook/executors/storybook.md deleted file mode 100644 index 5eac57e141..0000000000 --- a/docs/generated/api-storybook/executors/storybook.md +++ /dev/null @@ -1,108 +0,0 @@ ---- -title: '@nrwl/storybook:storybook executor' -description: 'Serve Storybook' ---- - -# @nrwl/storybook:storybook - -Serve Storybook - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Options - -### uiFramework (_**required**_) (**hidden**) - -Default: `@storybook/angular` - -Type: `string` - -Possible values: `@storybook/angular`, `@storybook/react`, `@storybook/html`, `@storybook/web-components`, `@storybook/vue`, `@storybook/vue3`, `@storybook/svelte` - -Storybook framework npm package - -### docsMode - -Default: `false` - -Type: `boolean` - -Build a documentation-only site using addon-docs. - -### host - -Default: `localhost` - -Type: `string` - -Host to listen on. - -### https - -Default: `false` - -Type: `boolean` - -Serve using HTTPS. - -### port - -Default: `9009` - -Type: `number` - -Port to listen on. - -### projectBuildConfig - -Type: `string` - -Workspace project where Storybook reads the Webpack config from - -### quiet - -Default: `true` - -Type: `boolean` - -Suppress verbose build output. - -### sslCert - -Type: `string` - -SSL certificate to use for serving HTTPS. - -### sslKey - -Type: `string` - -SSL key to use for serving HTTPS. - -### ~~staticDir~~ - -Type: `array` - -**Deprecated:** In Storybook 6.4 the `--static-dir` CLI flag has been replaced with the the `staticDirs` field in `.storybook/main.js`. It will be removed completely in Storybook 7.0. - -Directory where to load static files from, array of strings - -### stylePreprocessorOptions.includePaths - -Type: `array` - -Options to pass to style preprocessors. The paths to include. Paths will be resolved to workspace root. This is for Angular projects only, as an option for the Storybook/Angular builder. It will be ignored in non-Angular projects. - -### styles - -Type: `array` - -Global styles to be included in the build. This is for Angular projects only, as an option for the Storybook/Angular builder. It will be ignored in non-Angular projects. - -### watch - -Default: `true` - -Type: `boolean` - -Watches for changes and rebuilds application diff --git a/docs/generated/api-storybook/generators/configuration.md b/docs/generated/api-storybook/generators/configuration.md deleted file mode 100644 index 0fde868742..0000000000 --- a/docs/generated/api-storybook/generators/configuration.md +++ /dev/null @@ -1,80 +0,0 @@ ---- -title: '@nrwl/storybook:configuration generator' -description: 'Add storybook configuration to a ui library or an application' ---- - -# @nrwl/storybook:configuration - -Add storybook configuration to a ui library or an application - -## Usage - -```bash -nx generate configuration ... -``` - -By default, Nx will search for `configuration` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/storybook:configuration ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g configuration ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -Library or application name - -### configureCypress - -Type: `boolean` - -Run the cypress-configure generator - -### cypressDirectory - -Type: `string` - -A directory where the Cypress project will be placed. Added at root by default. - -### js - -Default: `false` - -Type: `boolean` - -Generate JavaScript files rather than TypeScript files - -### linter - -Default: `eslint` - -Type: `string` - -Possible values: `eslint`, `tslint`, `none` - -The tool to use for running lint checks. - -### standaloneConfig - -Type: `boolean` - -Split the project configuration into /project.json rather than including it inside workspace.json - -### uiFramework - -Type: `string` - -Possible values: `@storybook/angular`, `@storybook/react` - -Storybook UI Framework to use diff --git a/docs/generated/api-storybook/generators/cypress-project.md b/docs/generated/api-storybook/generators/cypress-project.md deleted file mode 100644 index 6d7e27b712..0000000000 --- a/docs/generated/api-storybook/generators/cypress-project.md +++ /dev/null @@ -1,66 +0,0 @@ ---- -title: '@nrwl/storybook:cypress-project generator' -description: 'Add cypress e2e app to test a ui library that is set up for storybook' ---- - -# @nrwl/storybook:cypress-project - -Add cypress e2e app to test a ui library that is set up for storybook - -## Usage - -```bash -nx generate cypress-project ... -``` - -By default, Nx will search for `cypress-project` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/storybook:cypress-project ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g cypress-project ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -Library or application name - -### directory - -Type: `string` - -A directory where the project is placed - -### js - -Default: `false` - -Type: `boolean` - -Generate JavaScript files rather than TypeScript files - -### linter - -Default: `eslint` - -Type: `string` - -Possible values: `eslint`, `tslint`, `none` - -The tool to use for running lint checks. - -### standaloneConfig - -Type: `boolean` - -Split the project configuration into /project.json rather than including it inside workspace.json diff --git a/docs/generated/api-storybook/generators/migrate-defaults-5-to-6.md b/docs/generated/api-storybook/generators/migrate-defaults-5-to-6.md deleted file mode 100644 index 2d89444bb8..0000000000 --- a/docs/generated/api-storybook/generators/migrate-defaults-5-to-6.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -title: '@nrwl/storybook:migrate-defaults-5-to-6 generator' -description: 'Generate default Storybook configuration files using Storybook version >=6.x specs, for projects that already have Storybook instances and configurations of versions <6.x.' ---- - -# @nrwl/storybook:migrate-defaults-5-to-6 - -Generate default Storybook configuration files using Storybook version >=6.x specs, for projects that already have Storybook instances and configurations of versions <6.x. - -## Usage - -```bash -nx generate migrate-defaults-5-to-6 ... -``` - -By default, Nx will search for `migrate-defaults-5-to-6` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/storybook:migrate-defaults-5-to-6 ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g migrate-defaults-5-to-6 ... --dry-run -``` - -## Options - -### all - -Default: `true` - -Type: `boolean` - -Generate new Storybook configurations for all Storybook instances across all apps and libs. - -### keepOld - -Default: `true` - -Type: `boolean` - -Keep the old configuration files - put them in a folder called .old_storybook. - -### name - -Type: `string` - -Leave empty to upgrade all Storybook instances. Only use this if you want to do a gradual migration. Library or application name for which you want to generate the new Storybook configuration. diff --git a/docs/generated/api-storybook/generators/migrate-stories-to-6-2.md b/docs/generated/api-storybook/generators/migrate-stories-to-6-2.md deleted file mode 100644 index a980e2e390..0000000000 --- a/docs/generated/api-storybook/generators/migrate-stories-to-6-2.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: '@nrwl/storybook:migrate-stories-to-6-2 generator' -description: 'Migrate stories syntax to 6.2' ---- - -# @nrwl/storybook:migrate-stories-to-6-2 - -Migrate stories syntax to 6.2 - -## Usage - -```bash -nx generate migrate-stories-to-6-2 ... -``` - -By default, Nx will search for `migrate-stories-to-6-2` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/storybook:migrate-stories-to-6-2 ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g migrate-stories-to-6-2 ... --dry-run -``` diff --git a/docs/generated/api-web/executors/dev-server.md b/docs/generated/api-web/executors/dev-server.md deleted file mode 100644 index 03b2d41927..0000000000 --- a/docs/generated/api-web/executors/dev-server.md +++ /dev/null @@ -1,116 +0,0 @@ ---- -title: '@nrwl/web:dev-server executor' -description: 'Serve a web application' ---- - -# @nrwl/web:dev-server - -Serve a web application - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Options - -### allowedHosts - -Type: `string` - -This option allows you to whitelist services that are allowed to access the dev server. - -### baseHref - -Type: `string` - -Base url for the application being built. - -### buildTarget - -Type: `string` - -Target which builds the application - -### hmr - -Default: `false` - -Type: `boolean` - -Enable hot module replacement. - -### host - -Default: `localhost` - -Type: `string` - -Host to listen on. - -### liveReload - -Default: `true` - -Type: `boolean` - -Whether to reload the page on change, using live-reload. - -### maxWorkers - -Type: `number` - -Number of workers to use for type checking. - -### memoryLimit - -Type: `number` - -Memory limit for type checking service process in MB. - -### open - -Default: `false` - -Type: `boolean` - -Open the application in the browser. - -### port - -Default: `4200` - -Type: `number` - -Port to listen on. - -### publicHost - -Type: `string` - -Public URL where the application will be served - -### ssl - -Default: `false` - -Type: `boolean` - -Serve using HTTPS. - -### sslCert - -Type: `string` - -SSL certificate to use for serving HTTPS. - -### sslKey - -Type: `string` - -SSL key to use for serving HTTPS. - -### watch - -Default: `true` - -Type: `boolean` - -Watches for changes and rebuilds application diff --git a/docs/generated/api-web/executors/file-server.md b/docs/generated/api-web/executors/file-server.md deleted file mode 100644 index cfb653f60a..0000000000 --- a/docs/generated/api-web/executors/file-server.md +++ /dev/null @@ -1,84 +0,0 @@ ---- -title: '@nrwl/web:file-server executor' -description: 'Serve a web application from a folder' ---- - -# @nrwl/web:file-server - -Serve a web application from a folder - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Options - -### buildTarget (_**required**_) - -Type: `string` - -Target which builds the application - -### host - -Default: `localhost` - -Type: `string` - -Host to listen on. - -### maxParallel - -Type: `number` - -Max number of parallel jobs - -### parallel - -Default: `true` - -Type: `boolean` - -Build the target in parallel - -### port - -Default: `4200` - -Type: `number` - -Port to listen on. - -### proxyUrl - -Type: `string` - -URL to proxy unhandled requests to. - -### ssl - -Default: `false` - -Type: `boolean` - -Serve using HTTPS. - -### sslCert - -Type: `string` - -SSL certificate to use for serving HTTPS. - -### sslKey - -Type: `string` - -SSL key to use for serving HTTPS. - -### ~~withDeps~~ - -Default: `false` - -Type: `boolean` - -**Deprecated:** "withDeps" is deprecated and it will be removed in v14. Configure target dependencies instead: https://nx.dev/configuration/projectjson. - -Build the target and all its deps diff --git a/docs/generated/api-web/executors/rollup.md b/docs/generated/api-web/executors/rollup.md deleted file mode 100644 index 538477c1a8..0000000000 --- a/docs/generated/api-web/executors/rollup.md +++ /dev/null @@ -1,138 +0,0 @@ ---- -title: '@nrwl/web:rollup executor' -description: 'Package a library using rollup' ---- - -# @nrwl/web:rollup - -Package a library using rollup - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Options - -### entryFile (_**required**_) - -Type: `string` - -The path to the entry file, relative to project. - -### outputPath (_**required**_) - -Type: `string` - -The output path of the generated files. - -### project (_**required**_) - -Type: `string` - -The path to package.json file. - -### tsConfig (_**required**_) - -Type: `string` - -The path to tsconfig file. - -### assets - -Type: `array` - -List of static assets. - -### buildableProjectDepsInPackageJsonType - -Default: `peerDependencies` - -Type: `string` - -Possible values: `dependencies`, `peerDependencies` - -When updateBuildableProjectDepsInPackageJson is true, this adds dependencies to either `peerDependencies` or `dependencies` - -### compiler - -Default: `babel` - -Type: `string` - -Possible values: `babel`, `swc` - -Which compiler to use. - -### deleteOutputPath - -Default: `true` - -Type: `boolean` - -Delete the output path before building. - -### external - -Type: `array` - -A list of external modules that will not be bundled (react, react-dom, etc.). - -### extractCss - -Default: `true` - -Type: `boolean` - -CSS files will be extracted to the output folder. - -### format - -Alias(es): f - -Type: `array` - -Only build the specified comma-separated formats (esm,umd,cjs) - -### globals - -Type: `object[]` - -A mapping of node modules to their UMD global names. Used by the UMD bundle - -#### moduleId - -Type: `string` - -The node module to map from (e.g. `react-dom`). - -#### global - -Type: `string` - -The global name to map to (e.g. `ReactDOM`). - -### rollupConfig - -Type: `array[] | string ` - -Path to a function which takes a rollup config and returns an updated rollup config - -### umdName - -Type: `string` - -The name of your module in UMD format. Defaulted to your project name. - -### updateBuildableProjectDepsInPackageJson - -Default: `true` - -Type: `boolean` - -Update buildable project dependencies in package.json - -### watch - -Default: `false` - -Type: `boolean` - -Enable re-building when files change. diff --git a/docs/generated/api-web/executors/webpack.md b/docs/generated/api-web/executors/webpack.md deleted file mode 100644 index ad73048d43..0000000000 --- a/docs/generated/api-web/executors/webpack.md +++ /dev/null @@ -1,278 +0,0 @@ ---- -title: '@nrwl/web:webpack executor' -description: 'Build an application using webpack' ---- - -# @nrwl/web:webpack - -Build an application using webpack - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Options - -### index (_**required**_) - -Type: `string` - -HTML File which will be contain the application - -### main (_**required**_) - -Type: `string` - -The name of the main entry-point file. - -### tsConfig (_**required**_) - -Type: `string` - -The name of the Typescript configuration file. - -### assets - -Type: `array` - -List of static application assets. - -### baseHref - -Type: `string` - -Base url for the application being built. - -### budgets - -Type: `array` - -Budget thresholds to ensure parts of your application stay within boundaries which you set. - -### buildLibsFromSource - -Default: `true` - -Type: `boolean` - -Read buildable libraries from source instead of building them separately. - -### commonChunk - -Default: `true` - -Type: `boolean` - -Use a separate bundle containing code used across multiple bundles. - -### compiler - -Default: `babel` - -Type: `string` - -Possible values: `babel`, `swc` - -The compiler to use - -### crossOrigin - -Type: `string` - -The crossorigin attribute to use for generated javascript script tags. One of 'none' | 'anonymous' | 'use-credentials' - -### deleteOutputPath - -Default: `true` - -Type: `boolean` - -Delete the output path before building. - -### deployUrl - -Type: `string` - -URL where the application will be deployed. - -### es2015Polyfills - -Type: `string` - -Conditional polyfills loaded in browsers which do not support ES2015. - -### extractCss - -Default: `false` - -Type: `boolean` - -Extract css into a .css file - -### extractLicenses - -Default: `false` - -Type: `boolean` - -Extract all licenses in a separate file, in the case of production builds only. - -### fileReplacements - -Type: `object[]` - -Replace files with other files in the build. - -#### replace - -Type: `string` - -The file to be replaced. - -#### with - -Type: `string` - -The file to replace with. - -### generateIndexHtml - -Default: `true` - -Type: `boolean` - -Generates `index.html` file to the output path. This can be turned off if using a webpack plugin to generate HTML such as `html-webpack-plugin` - -### maxWorkers - -Type: `number` - -Number of workers to use for type checking. (defaults to # of CPUS - 2) - -### memoryLimit - -Type: `number` - -Memory limit for type checking service process in MB. (defaults to 2048) - -### namedChunks - -Default: `true` - -Type: `boolean` - -Names the produced bundles according to their entry file - -### optimization - -Type: `boolean` - -Enables optimization of the build output. - -### outputHashing - -Default: `none` - -Type: `string` - -Possible values: `none`, `all`, `media`, `bundles` - -Define the output filename cache-busting hashing mode. - -### outputPath - -Type: `string` - -The output path of the generated files. - -### polyfills - -Type: `string` - -Polyfills to load before application - -### postcssConfig - -Type: `string` - -Set a path to PostCSS config that applies to the app and all libs. Defaults to `undefined`, which auto-detects postcss.config.js files in each app/lib directory. - -### progress - -Default: `false` - -Type: `boolean` - -Log progress to the console while building. - -### runtimeChunk - -Default: `true` - -Type: `boolean` - -Use a separate bundle containing the runtime. - -### scripts - -Type: `array` - -External Scripts which will be included before the main application entry - -### sourceMap - -Default: `true` - -Type: `boolean | string ` - -Output sourcemaps. Use 'hidden' for use with error reporting tools without generating sourcemap comment. - -### statsJson - -Default: `false` - -Type: `boolean` - -Generates a 'stats.json' file which can be analyzed using tools such as: 'webpack-bundle-analyzer' or . - -### styles - -Type: `array` - -External Styles which will be included with the application - -### subresourceIntegrity - -Default: `false` - -Type: `boolean` - -Enables the use of subresource integrity validation. - -### vendorChunk - -Default: `true` - -Type: `boolean` - -Use a separate bundle containing only vendor libraries. - -### verbose - -Default: `false` - -Type: `boolean` - -Emits verbose output - -### watch - -Default: `false` - -Type: `boolean` - -Enable re-building when files change. - -### webpackConfig - -Type: `string` - -Path to a function which takes a webpack config, some context and returns the resulting webpack config diff --git a/docs/generated/api-web/generators/application.md b/docs/generated/api-web/generators/application.md deleted file mode 100644 index 3d5a1cf708..0000000000 --- a/docs/generated/api-web/generators/application.md +++ /dev/null @@ -1,124 +0,0 @@ ---- -title: '@nrwl/web:application generator' -description: 'Create an application' ---- - -# @nrwl/web:application - -Create an application - -## Usage - -```bash -nx generate application ... -``` - -```bash -nx g app ... # same -``` - -By default, Nx will search for `application` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/web:application ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g application ... --dry-run -``` - -## Options - -### compiler - -Default: `babel` - -Type: `string` - -Possible values: `babel`, `swc` - -The compiler to use - -### directory - -Type: `string` - -The directory of the new application. - -### e2eTestRunner - -Default: `cypress` - -Type: `string` - -Possible values: `cypress`, `none` - -Test runner to use for end to end (e2e) tests - -### linter - -Default: `eslint` - -Type: `string` - -Possible values: `eslint`, `tslint` - -The tool to use for running lint checks. - -### name - -Type: `string` - -The name of the application. - -### setParserOptionsProject - -Default: `false` - -Type: `boolean` - -Whether or not to configure the ESLint "parserOptions.project" option. We do not do this by default for lint performance reasons. - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files - -### standaloneConfig - -Type: `boolean` - -Split the project configuration into /project.json rather than including it inside workspace.json - -### style - -Default: `css` - -Type: `string` - -Possible values: `css`, `scss`, `styl`, `less` - -The file extension to be used for style files. - -### tags - -Type: `string` - -Add tags to the application (used for linting) - -### unitTestRunner - -Default: `jest` - -Type: `string` - -Possible values: `jest`, `none` - -Test runner to use for unit tests diff --git a/docs/generated/api-workspace/executors/run-commands.md b/docs/generated/api-workspace/executors/run-commands.md deleted file mode 100644 index e768aa54b4..0000000000 --- a/docs/generated/api-workspace/executors/run-commands.md +++ /dev/null @@ -1,230 +0,0 @@ ---- -title: '@nrwl/workspace:run-commands executor' -description: 'Run any custom commands with Nx' ---- - -# @nrwl/workspace:run-commands - -Run any custom commands with Nx - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Examples - -`workspace.json`: - -```json -//... -"frontend": { - "targets": { - //... - "ls-project-root": { - "executor": "@nrwl/workspace:run-commands", - "options": { - "command": "ls apps/frontend/src" - } - } - } -} -``` - -```bash -nx run frontend:ls-project-root -``` - -##### Chaining commands, interpolating args and setting the cwd - -Let's say each of our workspace projects has some custom bash scripts in a `scripts` folder. -We want a simple way to create empty bash script files for a given project, that have the execute permissions already set. - -Given that Nx knows our workspace structure, we should be able to give it a project and the name of our script, and it should take care of the rest. - -The `commands` option accepts as many commands as you want. By default, they all run in parallel. -You can run them sequentially by setting `parallel: false`: - -```json -"create-script": { - "executor": "@nrwl/workspace:run-commands", - "options": { - "commands": [ - "mkdir -p scripts", - "touch scripts/{args.name}.sh", - "chmod +x scripts/{args.name}.sh" - ], - "cwd": "apps/frontend", - "parallel": false - } -} -``` - -By setting the `cwd` option, each command will run in the `apps/frontend` folder. - -We run the above with: - -```bash -nx run frontend:create-script --args="--name=example" -``` - -or simply with: - -```bash -nx run frontend:create-script --name=example -``` - -##### Arguments forwarding - -When interpolation is not present in the command, all arguments are forwarded to the command by default. - -This is useful when you need to pass raw argument strings to your command. - -For example, when you run: - -nx run frontend:webpack --args="--config=example.config.js" - -```json -"webpack": { - "executor": "@nrwl/workspace:run-commands", - "options": { - "command": "webpack" - } -} -``` - -The above command will execute: `webpack --config=example.config.js` - -This functionality can be disabled by using `commands` and expanding each `command` into an object -that sets the `forwardAllArgs` option to `false` as shown below: - -```json -"webpack": { - "executor": "@nrwl/workspace:run-commands", - "options": { - "commands": [ - { - "command": "webpack", - "forwardAllArgs": false - } - ] - } -} -``` - -##### Custom **done** conditions - -Normally, `run-commands` considers the commands done when all of them have finished running. If you don't need to wait until they're all done, you can set a special string that considers the commands finished the moment the string appears in `stdout` or `stderr`: - -```json -"finish-when-ready": { - "executor": "@nrwl/workspace:run-commands", - "options": { - "commands": [ - "sleep 5 && echo 'FINISHED'", - "echo 'READY'" - ], - "readyWhen": "READY", - "parallel": true - } -} -``` - -```bash -nx run frontend:finish-when-ready -``` - -The above commands will finish immediately, instead of waiting for 5 seconds. - -##### Nx Affected - -The true power of `run-commands` comes from the fact that it runs through `nx`, which knows about your project graph. So you can run **custom commands** only for the projects that have been affected by a change. - -We can create some configurations to generate docs, and if run using `nx affected`, it will only generate documentation for the projects that have been changed: - -```bash -nx affected --target=generate-docs -``` - -```json -//... -"frontend": { - "targets": { - //... - "generate-docs": { - "executor": "@nrwl/workspace:run-commands", - "options": { - "command": "npx compodoc -p apps/frontend/tsconfig.app.json" - } - } - } -}, -"api": { - "targets": { - //... - "generate-docs": { - "executor": "@nrwl/workspace:run-commands", - "options": { - "command": "npx compodoc -p apps/api/tsconfig.app.json" - } - } - } -} -``` - -## Options - -### args - -Type: `string` - -Extra arguments. You can pass them as follows: nx run project:target --args='--wait=100'. You can then use {args.wait} syntax to interpolate them in the workspace config file. See example [above](#chaining-commands-interpolating-args-and-setting-the-cwd) - -### color - -Default: `false` - -Type: `boolean` - -Use colors when showing output of command - -### command - -Type: `string` - -Command to run in child process - -### commands - -Type: `array` - -Commands to run in child process - -### cwd - -Type: `string` - -Current working directory of the commands. If it's not specified the commands will run in the workspace root, if a relative path is specified the commands will run in that path relative to the workspace root and if it's an absolute path the commands will run in that path. - -### envFile - -Type: `string` - -You may specify a custom .env file path - -### outputPath - -Type: `string | string[] ` - -Allows you to specify where the build artifacts are stored. This allows Nx Cloud to pick them up correctly, in the case that the build artifacts are placed somewhere other than the top level dist folder. - -### parallel - -Default: `true` - -Type: `boolean` - -Run commands in parallel - -### readyWhen - -Type: `string` - -String to appear in `stdout` or `stderr` that indicates that the task is done. When running multiple commands, this option can only be used when `parallel` is set to `true`. If not specified, the task is done when all the child processes complete. diff --git a/docs/generated/api-workspace/executors/run-script.md b/docs/generated/api-workspace/executors/run-script.md deleted file mode 100644 index 344a4eda77..0000000000 --- a/docs/generated/api-workspace/executors/run-script.md +++ /dev/null @@ -1,61 +0,0 @@ ---- -title: '@nrwl/workspace:run-script executor' -description: 'Run an npm script using Nx' ---- - -# @nrwl/workspace:run-script - -Run an npm script using Nx - -Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. - -## Examples - -`workspace.json`: - -```json -"frontend": { - "root": "packages/frontend", - "targets": { - "build": { - "executor": "@nrwl/workspace:run-script", - "options": { - "script": "build-my-project" - } - } - } -} -``` - -```bash -nx run frontend:build -``` - -The `build` target is going to run `npm run build-my-project` (or `yarn build-my-project`) in the `packages/frontend` directory. - -#### Caching Artifacts - -By default, Nx is going to cache `dist/packages/frontend`, `packages/frontend/dist`, `packages/frontend/build`, `packages/frontend/public`. If your npm script writes files to other places, you can override the list of cached outputs as follows: - -```json -"frontend": { - "root": "packages/frontend", - "targets": { - "build": { - "executor": "@nrwl/workspace:run-script", - "outputs": ["packages/frontend/dist", "packaged/frontend/docs"], - "options": { - "script": "build-my-project" - } - } - } -} -``` - -## Options - -### script (_**required**_) - -Type: `string` - -An npm script name in the package.json file of the project (e.g., build) diff --git a/docs/generated/api-workspace/generators/convert-to-nx-project.md b/docs/generated/api-workspace/generators/convert-to-nx-project.md deleted file mode 100644 index 3d768395c5..0000000000 --- a/docs/generated/api-workspace/generators/convert-to-nx-project.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -title: '@nrwl/workspace:convert-to-nx-project generator' -description: "Moves a project's configuration outside of workspace.json" ---- - -# @nrwl/workspace:convert-to-nx-project - -Moves a project's configuration outside of workspace.json - -## Usage - -```bash -nx generate convert-to-nx-project ... -``` - -By default, Nx will search for `convert-to-nx-project` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/workspace:convert-to-nx-project ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g convert-to-nx-project ... --dry-run -``` - -### Examples - -Convert the my-feature-lib project to use project.json file instead of workspace.json: - -```bash -nx g @nrwl/workspace:convert-to-nx-project --project my-feature-lib -``` - -Convert all projects in workspace.json to separate project.json files.: - -```bash -nx g @nrwl/workspace:convert-to-nx-project --all -``` - -## Options - -### all - -Type: `boolean` - -Should every project be converted? - -### project - -Type: `string` - -Project name - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files. diff --git a/docs/generated/api-workspace/generators/library.md b/docs/generated/api-workspace/generators/library.md deleted file mode 100644 index 49245254c0..0000000000 --- a/docs/generated/api-workspace/generators/library.md +++ /dev/null @@ -1,176 +0,0 @@ ---- -title: '@nrwl/workspace:library generator' -description: 'Create a library' ---- - -# @nrwl/workspace:library - -Create a library - -## Usage - -```bash -nx generate library ... -``` - -```bash -nx g lib ... # same -``` - -By default, Nx will search for `library` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/workspace:library ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g library ... --dry-run -``` - -### Examples - -Generate libs/myapp/mylib: - -```bash -nx g lib mylib --directory=myapp -``` - -## Options - -### name (_**required**_) - -Type: `string` - -Library name - -### babelJest - -Default: `false` - -Type: `boolean` - -Use babel instead ts-jest - -### buildable - -Default: `false` - -Type: `boolean` - -Generate a buildable library. - -### directory - -Type: `string` - -A directory where the lib is placed - -### importPath - -Type: `string` - -The library name used to import it, like @myorg/my-awesome-lib - -### js - -Default: `false` - -Type: `boolean` - -Generate JavaScript files rather than TypeScript files - -### linter - -Default: `eslint` - -Type: `string` - -Possible values: `eslint` - -The tool to use for running lint checks. - -### pascalCaseFiles - -Alias(es): P - -Default: `false` - -Type: `boolean` - -Use pascal case file names. - -### setParserOptionsProject - -Default: `false` - -Type: `boolean` - -Whether or not to configure the ESLint "parserOptions.project" option. We do not do this by default for lint performance reasons. - -### skipBabelrc - -Default: `false` - -Type: `boolean` - -Do not generate .babelrc file. Useful for Node libraries that are not compiled by Babel - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files - -### skipTsConfig - -Default: `false` - -Type: `boolean` - -Do not update tsconfig.json for development experience. - -### standaloneConfig - -Type: `boolean` - -Split the project configuration into /project.json rather than including it inside workspace.json - -### strict - -Default: `true` - -Type: `boolean` - -Whether to enable tsconfig strict mode or not. - -### tags - -Type: `string` - -Add tags to the library (used for linting) - -### testEnvironment - -Default: `jsdom` - -Type: `string` - -Possible values: `jsdom`, `node` - -The test environment to use if unitTestRunner is set to jest - -### unitTestRunner - -Default: `jest` - -Type: `string` - -Possible values: `jest`, `none` - -Test runner to use for unit tests diff --git a/docs/generated/api-workspace/generators/move.md b/docs/generated/api-workspace/generators/move.md deleted file mode 100644 index cde24e0be6..0000000000 --- a/docs/generated/api-workspace/generators/move.md +++ /dev/null @@ -1,80 +0,0 @@ ---- -title: '@nrwl/workspace:move generator' -description: 'Move an application or library to another folder' ---- - -# @nrwl/workspace:move - -Move an application or library to another folder - -## Usage - -```bash -nx generate move ... -``` - -```bash -nx g mv ... # same -``` - -By default, Nx will search for `move` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/workspace:move ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g move ... --dry-run -``` - -### Examples - -Move libs/my-feature-lib to libs/shared/my-feature-lib: - -```bash -nx g @nrwl/workspace:move --project my-feature-lib shared/my-feature-lib -``` - -## Options - -### destination (_**required**_) - -Type: `string` - -The folder to move the project into - -### projectName (_**required**_) - -Alias(es): project - -Type: `string` - -The name of the project to move - -### importPath - -Type: `string` - -The new import path to use in the tsconfig.base.json - -### skipFormat - -Alias(es): skip-format - -Default: `false` - -Type: `boolean` - -Skip formatting files. - -### updateImportPath - -Default: `true` - -Type: `boolean` - -Should the generator update the import path to reflect the new location? diff --git a/docs/generated/api-workspace/generators/npm-package.md b/docs/generated/api-workspace/generators/npm-package.md deleted file mode 100644 index ca5ad7bdc5..0000000000 --- a/docs/generated/api-workspace/generators/npm-package.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: '@nrwl/workspace:npm-package generator' -description: 'Create a minimal npm package' ---- - -# @nrwl/workspace:npm-package - -Create a minimal npm package - -## Usage - -```bash -nx generate npm-package ... -``` - -By default, Nx will search for `npm-package` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/workspace:npm-package ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g npm-package ... --dry-run -``` - -## Options - -### name (_**required**_) - -Type: `string` - -Package name diff --git a/docs/generated/api-workspace/generators/remove.md b/docs/generated/api-workspace/generators/remove.md deleted file mode 100644 index 494639ce26..0000000000 --- a/docs/generated/api-workspace/generators/remove.md +++ /dev/null @@ -1,76 +0,0 @@ ---- -title: '@nrwl/workspace:remove generator' -description: 'Remove an application or library' ---- - -# @nrwl/workspace:remove - -Remove an application or library - -## Usage - -```bash -nx generate remove ... -``` - -```bash -nx g rm ... # same -``` - -By default, Nx will search for `remove` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/workspace:remove ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g remove ... --dry-run -``` - -### Examples - -Remove my-feature-lib from the workspace: - -```bash -nx g @nrwl/workspace:remove my-feature-lib -``` - -Force removal of my-feature-lib from the workspace: - -```bash -nx g @nrwl/workspace:remove my-feature-lib --forceRemove -``` - -## Options - -### projectName (_**required**_) - -Alias(es): project - -Type: `string` - -The name of the project to remove - -### forceRemove - -Alias(es): force-remove - -Default: `false` - -Type: `boolean` - -When true, forces removal even if the project is still in use. - -### skipFormat - -Alias(es): skip-format - -Default: `false` - -Type: `boolean` - -Skip formatting files. diff --git a/docs/generated/api-workspace/generators/run-commands.md b/docs/generated/api-workspace/generators/run-commands.md deleted file mode 100644 index 79cb2ee0ef..0000000000 --- a/docs/generated/api-workspace/generators/run-commands.md +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: '@nrwl/workspace:run-commands generator' -description: 'Generates a target to run any command in the terminal' ---- - -# @nrwl/workspace:run-commands - -Generates a target to run any command in the terminal - -## Usage - -```bash -nx generate run-commands ... -``` - -```bash -nx g run-command ... # same -``` - -By default, Nx will search for `run-commands` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/workspace:run-commands ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g run-commands ... --dry-run -``` - -### Examples - -Add the printhello target to my-feature-lib: - -```bash -nx g @nrwl/workspace:run-commands printhello --project my-feature-lib --command 'echo hello' -``` - -## Options - -### command (_**required**_) - -Type: `string` - -Command to run - -### name (_**required**_) - -Type: `string` - -Target name - -### project (_**required**_) - -Type: `string` - -Project name - -### cwd - -Type: `string` - -Current working directory of the command - -### envFile - -Type: `string` - -Env files to be loaded before executing the commands - -### outputs - -Type: `string` - -Allows you to specify where the build artifacts are stored. This allows Nx Cloud to pick them up correctly, in the case that the build artifacts are placed somewhere other than the top level dist folder. diff --git a/docs/generated/api-workspace/generators/workspace-generator.md b/docs/generated/api-workspace/generators/workspace-generator.md deleted file mode 100644 index 99fdf2e494..0000000000 --- a/docs/generated/api-workspace/generators/workspace-generator.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -title: '@nrwl/workspace:workspace-generator generator' -description: 'Generates a workspace generator' ---- - -# @nrwl/workspace:workspace-generator - -Generates a workspace generator - -## Usage - -```bash -nx generate workspace-generator ... -``` - -```bash -nx g workspace-schematic ... # same -``` - -By default, Nx will search for `workspace-generator` in the default collection provisioned in `workspace.json`. - -You can specify the collection explicitly as follows: - -```bash -nx g @nrwl/workspace:workspace-generator ... -``` - -Show what will be generated without writing to disk: - -```bash -nx g workspace-generator ... --dry-run -``` - -## Options - -### name - -Type: `string` - -Generator name - -### skipFormat - -Default: `false` - -Type: `boolean` - -Skip formatting files diff --git a/docs/generated/executors.json b/docs/generated/executors.json deleted file mode 100644 index d935d32a41..0000000000 --- a/docs/generated/executors.json +++ /dev/null @@ -1,15 +0,0 @@ -[ - "angular", - "cypress", - "detox", - "jest", - "js", - "linter", - "next", - "node", - "nx-plugin", - "react-native", - "storybook", - "web", - "workspace" -] diff --git a/docs/generated/generators.json b/docs/generated/generators.json deleted file mode 100644 index 0605d7e687..0000000000 --- a/docs/generated/generators.json +++ /dev/null @@ -1,18 +0,0 @@ -[ - "angular", - "cypress", - "detox", - "express", - "jest", - "js", - "linter", - "nest", - "next", - "node", - "nx-plugin", - "react", - "react-native", - "storybook", - "web", - "workspace" -] diff --git a/docs/generated/packages/add-nx-to-monorepo.json b/docs/generated/packages/add-nx-to-monorepo.json new file mode 100644 index 0000000000..6faf737fe5 --- /dev/null +++ b/docs/generated/packages/add-nx-to-monorepo.json @@ -0,0 +1,9 @@ +{ + "githubRoot": "https://github.com/nrwl/nx/blob/master", + "name": "add-nx-to-monorepo", + "description": "Make any monorepo faster by adding Nx to it", + "root": "/packages/add-nx-to-monorepo", + "source": "/packages/add-nx-to-monorepo/src", + "generators": [], + "executors": [] +} diff --git a/docs/generated/packages/angular.json b/docs/generated/packages/angular.json new file mode 100644 index 0000000000..275ecdf7d2 --- /dev/null +++ b/docs/generated/packages/angular.json @@ -0,0 +1,2775 @@ +{ + "githubRoot": "https://github.com/nrwl/nx/blob/master", + "name": "angular", + "description": "Angular Plugin for Nx", + "root": "/packages/angular", + "source": "/packages/angular/src", + "generators": [ + { + "name": "add-linting", + "factory": "./src/generators/add-linting/add-linting", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxAngularAddLintingGenerator", + "title": "Add linting to an Angular project.", + "cli": "nx", + "type": "object", + "properties": { + "prefix": { + "type": "string", + "format": "html-selector", + "description": "The prefix to apply to generated selectors." + }, + "projectName": { + "type": "string", + "description": "The name of the project." + }, + "projectRoot": { + "type": "string", + "description": "The path to the root of the selected project." + }, + "setParserOptionsProject": { + "type": "boolean", + "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.", + "default": false + }, + "skipFormat": { + "type": "boolean", + "description": "Skip formatting files.", + "default": false + }, + "skipPackageJson": { + "type": "boolean", + "default": false, + "description": "Do not add dependencies to `package.json`." + } + }, + "additionalProperties": false, + "required": ["prefix", "projectName", "projectRoot"], + "presets": [] + }, + "description": "Adds linting configuration to an Angular project.", + "hidden": true, + "implementation": "/packages/angular/src/generators/add-linting/add-linting.ts", + "aliases": [], + "path": "/packages/angular/src/generators/add-linting/schema.json" + }, + { + "name": "application", + "factory": "./src/generators/application/application", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "GeneratorNxApp", + "title": "Creates an Angular application.", + "type": "object", + "cli": "nx", + "properties": { + "name": { + "description": "The name of the application.", + "type": "string", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the application?", + "pattern": "^[a-zA-Z].*$" + }, + "directory": { + "description": "The directory of the new application.", + "type": "string" + }, + "style": { + "description": "The file extension to be used for style files.", + "type": "string", + "default": "css", + "enum": ["css", "scss", "sass", "less"], + "x-prompt": { + "message": "Which stylesheet format would you like to use?", + "type": "list", + "items": [ + { "value": "css", "label": "CSS" }, + { + "value": "scss", + "label": "SASS(.scss) [ http://sass-lang.com ]" + }, + { + "value": "sass", + "label": "SASS(.sass) [ http://sass-lang.com ]" + }, + { + "value": "less", + "label": "LESS [ http://lesscss.org ]" + } + ] + } + }, + "routing": { + "type": "boolean", + "description": "Generate a routing module.", + "default": false, + "x-prompt": "Would you like to configure routing for this application?" + }, + "inlineStyle": { + "description": "Specifies if the style will be in the ts file.", + "type": "boolean", + "default": false, + "alias": "s" + }, + "inlineTemplate": { + "description": "Specifies if the template will be in the ts file.", + "type": "boolean", + "default": false, + "alias": "t" + }, + "viewEncapsulation": { + "description": "Specifies the view encapsulation strategy.", + "enum": ["Emulated", "None", "ShadowDom"], + "type": "string" + }, + "prefix": { + "type": "string", + "format": "html-selector", + "description": "The prefix to apply to generated selectors.", + "alias": "p" + }, + "skipTests": { + "description": "Skip creating spec files.", + "type": "boolean", + "default": false, + "alias": "S" + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + }, + "skipPackageJson": { + "type": "boolean", + "default": false, + "description": "Do not add dependencies to `package.json`." + }, + "unitTestRunner": { + "type": "string", + "enum": ["karma", "jest", "none"], + "description": "Test runner to use for unit tests.", + "default": "jest" + }, + "e2eTestRunner": { + "type": "string", + "enum": ["protractor", "cypress", "none"], + "description": "Test runner to use for end to end (E2E) tests.", + "default": "cypress" + }, + "tags": { + "type": "string", + "description": "Add tags to the application (used for linting)." + }, + "linter": { + "description": "The tool to use for running lint checks.", + "type": "string", + "enum": ["eslint", "none"], + "default": "eslint" + }, + "backendProject": { + "type": "string", + "description": "Backend project that provides data to this application. This sets up `proxy.config.json`." + }, + "strict": { + "type": "boolean", + "description": "Create an application with stricter type checking and build optimization options.", + "default": true + }, + "standaloneConfig": { + "description": "Split the project configuration into `/project.json` rather than including it inside `workspace.json`.", + "type": "boolean" + }, + "mfe": { + "description": "Generate a Module Federation configuration for the application", + "type": "boolean", + "default": false + }, + "mfeType": { + "type": "string", + "enum": ["host", "remote"], + "description": "Type of application to generate the Module Federation configuration for.", + "default": "remote" + }, + "port": { + "type": "number", + "description": "The port at which the remote application should be served." + }, + "remotes": { + "type": "array", + "description": "A list of remote application names that the host application should consume." + }, + "host": { + "type": "string", + "description": "The name of the host application that the remote application will be consumed by." + }, + "setParserOptionsProject": { + "type": "boolean", + "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.", + "default": false + }, + "addTailwind": { + "type": "boolean", + "description": "Whether to configure Tailwind CSS for the application.", + "default": false + } + }, + "additionalProperties": false, + "required": ["name"], + "presets": [] + }, + "aliases": ["app"], + "x-type": "application", + "description": "Creates an Angular application.", + "implementation": "/packages/angular/src/generators/application/application.ts", + "hidden": false, + "path": "/packages/angular/src/generators/application/schema.json" + }, + { + "name": "component", + "factory": "./src/generators/component/component", + "schema": { + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "SchematicsAngularComponent", + "title": "Angular Component Schema", + "cli": "nx", + "type": "object", + "description": "Creates a new, generic component definition in the given or default project.", + "additionalProperties": false, + "properties": { + "path": { + "type": "string", + "format": "path", + "description": "The path at which to create the component file, relative to the current workspace. Default is a folder with the same name as the component in the project root.", + "visible": false + }, + "project": { + "type": "string", + "description": "The name of the project.", + "$default": { "$source": "projectName" } + }, + "name": { + "type": "string", + "description": "The name of the component.", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the component?" + }, + "displayBlock": { + "description": "Specifies if the style will contain `:host { display: block; }`.", + "type": "boolean", + "default": false, + "alias": "b" + }, + "inlineStyle": { + "description": "Include styles inline in the component.ts file. Only CSS styles can be included inline. By default, an external styles file is created and referenced in the component.ts file.", + "type": "boolean", + "default": false, + "alias": "s" + }, + "inlineTemplate": { + "description": "Include template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file.", + "type": "boolean", + "default": false, + "alias": "t" + }, + "viewEncapsulation": { + "description": "The view encapsulation strategy to use in the new component.", + "enum": ["Emulated", "None", "ShadowDom"], + "type": "string", + "alias": "v" + }, + "changeDetection": { + "description": "The change detection strategy to use in the new component.", + "enum": ["Default", "OnPush"], + "type": "string", + "default": "Default", + "alias": "c" + }, + "style": { + "description": "The file extension or preprocessor to use for style files, or `none` to skip generating the style file.", + "type": "string", + "default": "css", + "enum": ["css", "scss", "sass", "less", "none"] + }, + "skipTests": { + "type": "boolean", + "description": "Do not create `spec.ts` test files for the new component.", + "default": false + }, + "flat": { + "type": "boolean", + "description": "Create the new files at the top level of the current project.", + "default": false + }, + "selector": { + "type": "string", + "format": "html-selector", + "description": "The HTML selector to use for this component." + }, + "skipSelector": { + "type": "boolean", + "default": false, + "description": "Specifies if the component should have a selector or not." + }, + "type": { + "type": "string", + "description": "Adds a developer-defined type to the filename, in the format `name.type.ts`.", + "default": "component" + }, + "export": { + "type": "boolean", + "description": "Specifies if the component should be exported in the declaring `NgModule`. Additionally, if the project is a library, the component will be exported from the project's entry point (normally `index.ts`).", + "default": false + } + }, + "required": ["name"], + "presets": [] + }, + "description": "Generate an Angular Component.", + "implementation": "/packages/angular/src/generators/component/component.ts", + "aliases": [], + "hidden": false, + "path": "/packages/angular/src/generators/component/schema.json" + }, + { + "name": "component-cypress-spec", + "factory": "./src/generators/component-cypress-spec/component-cypress-spec", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxAngularComponentCypressSpecGenerator", + "type": "object", + "cli": "nx", + "properties": { + "projectName": { + "type": "string", + "description": "The name of the project.", + "examples": ["ui-samples"] + }, + "projectPath": { + "type": "string", + "description": "Path to the project.", + "examples": ["libs/ui-samples"] + }, + "componentName": { + "type": "string", + "description": "Class name of the component.", + "examples": ["AwesomeComponent"] + }, + "componentPath": { + "type": "string", + "description": "Relative path to the component file from the project root.", + "examples": ["awesome"] + }, + "componentFileName": { + "type": "string", + "description": "Component file name without the `.ts` extension.", + "examples": ["awesome.component"] + }, + "cypressProject": { + "type": "string", + "description": "The Cypress project to generate the stories under. By default, inferred from `projectName`." + } + }, + "additionalProperties": false, + "required": [ + "projectName", + "projectPath", + "componentName", + "componentPath", + "componentFileName" + ], + "presets": [] + }, + "description": "Creates a Cypress spec for a UI component that has a story.", + "hidden": true, + "implementation": "/packages/angular/src/generators/component-cypress-spec/component-cypress-spec.ts", + "aliases": [], + "path": "/packages/angular/src/generators/component-cypress-spec/schema.json" + }, + { + "name": "component-story", + "factory": "./src/generators/component-story/component-story", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxAngularComponentStoryGenerator", + "type": "object", + "cli": "nx", + "properties": { + "projectPath": { + "type": "string", + "description": "Path to the project.", + "examples": ["libs/ui-samples"] + }, + "componentName": { + "type": "string", + "description": "Class name of the component.", + "examples": ["AwesomeComponent"] + }, + "componentPath": { + "type": "string", + "description": "Relative path to the component file from the project root.", + "examples": ["awesome"] + }, + "componentFileName": { + "type": "string", + "description": "Component file name without the `.ts` extension.", + "examples": ["awesome.component"] + } + }, + "additionalProperties": false, + "required": [ + "projectPath", + "componentName", + "componentPath", + "componentFileName" + ], + "presets": [] + }, + "description": "Creates a stories.ts file for a component.", + "hidden": true, + "implementation": "/packages/angular/src/generators/component-story/component-story.ts", + "aliases": [], + "path": "/packages/angular/src/generators/component-story/schema.json" + }, + { + "name": "convert-tslint-to-eslint", + "factory": "./src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint#conversionGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxAngularConvertTSLintToESLintGenerator", + "cli": "nx", + "title": "Convert an Angular project from TSLint to ESLint", + "description": "Convert an Angular project from TSLint to ESLint. NOTE: Does not work in `--dry-run mode`", + "examples": [ + { + "command": "nx g convert-tslint-to-eslint myapp", + "description": "The following will first configure the project, `myapp`, the same way a _new_ project is configured i.e. It will use Nx's new recommended ESLint config. By default, this also adds the existing TSLint configuration on top of the default ESLint config from Nx to continue checking what it checks today. This is done by migrating TSLint rules to their equivalent ESLint rules to the best of its abilities. Some TSLint rules may not have ESLint equivalents and will be reported during the conversion" + }, + { + "command": "nx g convert-tslint-to-eslint myapp --ignoreExistingTslintConfig=true", + "description": "If your TSLint config isn't extremely important to you, ignoring it makes this process more deterministic. Unlike the prior example, this will discard the existing TSLint configuration, meaning that the project will only have the Nx's latest recommended ESLint configuration which may be good enough for some workspaces" + }, + { + "command": "nx g convert-tslint-to-eslint myapp --removeTSLintIfNoMoreTSLintTargets=false", + "description": "By default, this process removes the TSLint related dependencies and configuration once no more projects use TSLint. This can be disabled with the following flag to keep TSLint related dependencies and configuration in the repo" + } + ], + "type": "object", + "properties": { + "project": { + "description": "The name of the Angular project to convert. Please note, if the project is an Angular app with an associated Cypress e2e project, it will also attempt to convert that.", + "type": "string", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "Which Angular project would you like to convert from TSLint to ESLint?" + }, + "ignoreExistingTslintConfig": { + "type": "boolean", + "description": "If true, it will not use existing TSLint config as a reference, it will just reset the project with the latest recommended ESLint config.", + "default": false, + "x-prompt": "Would you like to ignore the existing TSLint config? Recommended if the TSLint config has not been altered much as it makes the new ESLint config cleaner." + }, + "removeTSLintIfNoMoreTSLintTargets": { + "type": "boolean", + "description": "If this conversion leaves no more TSLint usage in the workspace, it will remove TSLint and related dependencies and configuration.", + "default": true, + "x-prompt": "Would you like to remove TSLint and its related config if there are no TSLint projects remaining after this conversion?" + }, + "skipFormat": { + "type": "boolean", + "description": "Skip formatting files.", + "default": false + } + }, + "additionalProperties": false, + "required": ["project"], + "presets": [] + }, + "description": "Converts a project from TSLint to ESLint.", + "implementation": "/packages/angular/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint#conversionGenerator.ts", + "aliases": [], + "hidden": false, + "path": "/packages/angular/src/generators/convert-tslint-to-eslint/schema.json" + }, + { + "name": "downgrade-module", + "factory": "./src/generators/downgrade-module/downgrade-module", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxDowngradeModuleGenerator", + "title": "Generates downgradeModule setup.", + "description": "Sets up a Downgrade Module.", + "cli": "nx", + "type": "object", + "properties": { + "project": { + "type": "string", + "description": "The name of the project." + }, + "name": { + "type": "string", + "description": "The name of the main AngularJS module.", + "$default": { "$source": "argv", "index": 0 } + }, + "angularJsImport": { + "type": "string", + "description": "Import expression of the AngularJS application (e.g., `--angularJsImport=some_node_module/my_app`)." + }, + "skipFormat": { + "type": "boolean", + "description": "Skip formatting files.", + "default": false + }, + "skipPackageJson": { + "type": "boolean", + "description": "Do not add `@angular/upgrade` to `package.json` (e.g., `--skipPackageJson`).", + "default": false + } + }, + "additionalProperties": false, + "required": ["name", "project"], + "presets": [] + }, + "description": "Sets up a Downgrade Module.", + "implementation": "/packages/angular/src/generators/downgrade-module/downgrade-module.ts", + "aliases": [], + "hidden": false, + "path": "/packages/angular/src/generators/downgrade-module/schema.json" + }, + { + "name": "init", + "factory": "./src/generators/init/init", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "SchematicsAngularModuleInit", + "cli": "nx", + "title": "Init Angular Plugin", + "description": "Initializes the `@nrwl/angular` plugin. NOTE: Does not work in the `--dry-run` mode", + "type": "object", + "properties": { + "unitTestRunner": { + "type": "string", + "enum": ["karma", "jest", "none"], + "description": "Test runner to use for unit tests.", + "default": "jest" + }, + "e2eTestRunner": { + "type": "string", + "enum": ["protractor", "cypress", "none"], + "description": "Test runner to use for end to end (e2e) tests.", + "default": "cypress" + }, + "skipInstall": { + "type": "boolean", + "description": "Skip installing after adding `@nrwl/workspace`.", + "default": false + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + }, + "linter": { + "description": "The tool to use for running lint checks.", + "type": "string", + "enum": ["eslint", "none"], + "default": "eslint" + }, + "style": { + "description": "The file extension to be used for style files.", + "type": "string", + "default": "css", + "enum": ["css", "scss", "sass", "less"], + "x-prompt": { + "message": "Which stylesheet format would you like to use?", + "type": "list", + "items": [ + { "value": "css", "label": "CSS" }, + { + "value": "scss", + "label": "SASS(.scss) [ http://sass-lang.com ]" + }, + { + "value": "sass", + "label": "SASS(.sass) [ http://sass-lang.com ]" + }, + { + "value": "less", + "label": "LESS [ http://lesscss.org ]" + } + ] + } + }, + "skipPackageJson": { + "type": "boolean", + "default": false, + "description": "Do not add dependencies to `package.json`." + } + }, + "additionalProperties": false, + "presets": [] + }, + "description": "Initializes the @nrwl/angular plugin.", + "hidden": true, + "implementation": "/packages/angular/src/generators/init/init.ts", + "aliases": [], + "path": "/packages/angular/src/generators/init/schema.json" + }, + { + "name": "karma", + "factory": "./src/generators/karma/karma", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxAngularKarmaGenerator", + "title": "Add Karma Configuration to the workspace.", + "description": "Add Karma configuration to an Nx workspace.", + "cli": "nx", + "type": "object", + "properties": { + "skipPackageJson": { + "type": "boolean", + "default": false, + "description": "Do not add dependencies to `package.json`." + } + }, + "additionalProperties": false, + "required": [], + "presets": [] + }, + "description": "Adds Karma configuration to a workspace.", + "implementation": "/packages/angular/src/generators/karma/karma.ts", + "aliases": [], + "hidden": false, + "path": "/packages/angular/src/generators/karma/schema.json" + }, + { + "name": "karma-project", + "factory": "./src/generators/karma-project/karma-project", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxKarmaProjectGenerator", + "title": "Create Karma Configuration for a project", + "description": "Add Karma configuration to an angular project.", + "cli": "nx", + "type": "object", + "properties": { + "project": { + "type": "string", + "description": "The name of the project.", + "$default": { "$source": "projectName" } + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + } + }, + "additionalProperties": false, + "required": ["project"], + "presets": [] + }, + "description": "Adds Karma configuration to a project.", + "implementation": "/packages/angular/src/generators/karma-project/karma-project.ts", + "aliases": [], + "hidden": false, + "path": "/packages/angular/src/generators/karma-project/schema.json" + }, + { + "name": "library", + "factory": "./src/generators/library/library", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "GeneratorAngularLibrary", + "title": "Create a library", + "description": "Creates an Angular library.", + "type": "object", + "cli": "nx", + "properties": { + "name": { + "type": "string", + "description": "The name of the library.", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the library?", + "pattern": "^[a-zA-Z].*$" + }, + "directory": { + "type": "string", + "description": "A directory where the library is placed." + }, + "publishable": { + "type": "boolean", + "default": false, + "description": "Generate a publishable library." + }, + "buildable": { + "type": "boolean", + "default": false, + "description": "Generate a buildable library." + }, + "prefix": { + "type": "string", + "format": "html-selector", + "description": "The prefix to apply to generated selectors.", + "alias": "p" + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + }, + "simpleModuleName": { + "description": "Keep the module name simple (when using `--directory`).", + "type": "boolean", + "default": false + }, + "addModuleSpec": { + "description": "Add a module spec file.", + "type": "boolean", + "default": false + }, + "skipPackageJson": { + "type": "boolean", + "default": false, + "description": "Do not add dependencies to `package.json`." + }, + "skipTsConfig": { + "type": "boolean", + "default": false, + "description": "Do not update `tsconfig.json` for development experience." + }, + "routing": { + "type": "boolean", + "default": false, + "description": "Add router configuration. See `lazy` for more information." + }, + "lazy": { + "type": "boolean", + "default": false, + "description": "Add `RouterModule.forChild` when set to true, and a simple array of routes when set to false." + }, + "parentModule": { + "type": "string", + "description": "Update the router configuration of the parent module using `loadChildren` or `children`, depending on what `lazy` is set to." + }, + "tags": { + "type": "string", + "description": "Add tags to the library (used for linting)." + }, + "unitTestRunner": { + "type": "string", + "enum": ["karma", "jest", "none"], + "description": "Test runner to use for unit tests.", + "default": "jest" + }, + "importPath": { + "type": "string", + "description": "The library name used to import it, like `@myorg/my-awesome-lib`. Must be a valid npm name." + }, + "strict": { + "type": "boolean", + "description": "Create a library with stricter type checking and build optimization options.", + "default": true + }, + "linter": { + "description": "The tool to use for running lint checks.", + "type": "string", + "enum": ["eslint", "none"], + "default": "eslint" + }, + "standaloneConfig": { + "description": "Split the project configuration into `/project.json` rather than including it inside `workspace.json`.", + "type": "boolean" + }, + "compilationMode": { + "description": "Specifies the compilation mode to use. If not specified, it will default to `partial` for publishable libraries and to `full` for buildable libraries. The `full` value can not be used for publishable libraries.", + "type": "string", + "enum": ["full", "partial"] + }, + "setParserOptionsProject": { + "type": "boolean", + "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.", + "default": false + }, + "addTailwind": { + "type": "boolean", + "description": "Whether to configure Tailwind CSS for the application. It can only be used with buildable and publishable libraries. Non-buildable libraries will use the application's Tailwind configuration.", + "default": false + }, + "skipModule": { + "type": "boolean", + "description": "Whether to skip the creation of a default module when generating the library.", + "default": false + } + }, + "additionalProperties": false, + "required": ["name"], + "presets": [] + }, + "aliases": ["lib"], + "x-type": "library", + "description": "Creates an Angular library.", + "implementation": "/packages/angular/src/generators/library/library.ts", + "hidden": false, + "path": "/packages/angular/src/generators/library/schema.json" + }, + { + "name": "library-secondary-entry-point", + "factory": "./src/generators/library-secondary-entry-point/library-secondary-entry-point", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxAngularLibrarySecondaryEntryPoint", + "title": "Creates a secondary entry point for a library", + "description": "Creates a secondary entry point for an Angular publishable library.", + "type": "object", + "cli": "nx", + "properties": { + "name": { + "type": "string", + "description": "The name of the secondary entry point.", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the secondary entry point?", + "pattern": "^[a-zA-Z].*$" + }, + "library": { + "type": "string", + "description": "The name of the library to create the secondary entry point for.", + "x-prompt": "What library would you like to create the secondary entry point for?", + "pattern": "^[a-zA-Z].*$" + }, + "skipModule": { + "type": "boolean", + "description": "Skip generating a module for the secondary entry point.", + "default": false + } + }, + "additionalProperties": false, + "required": ["name", "library"], + "presets": [] + }, + "aliases": ["secondary-entry-point", "entry-point"], + "description": "Creates a secondary entry point for an Angular publishable library.", + "implementation": "/packages/angular/src/generators/library-secondary-entry-point/library-secondary-entry-point.ts", + "hidden": false, + "path": "/packages/angular/src/generators/library-secondary-entry-point/schema.json" + }, + { + "name": "mfe-remote", + "factory": "./src/generators/mfe-remote/mfe-remote", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxMFERemote", + "cli": "nx", + "title": "Nx MFE Remote App", + "description": "Create an Angular Remote Micro Frontend Application.", + "type": "object", + "examples": [ + { + "command": "nx g @nrwl/angular:mfe-remote appName --host=host --port=4201", + "description": "Create an Angular app with configuration in place for MFE. If host is provided, attach this remote app to host app's configuration." + } + ], + "properties": { + "name": { + "type": "string", + "description": "The name to give to the remote Angular app.", + "$default": { "$source": "argv", "index": 0 } + }, + "host": { + "type": "string", + "description": "The name of the host app to attach this remote app to." + }, + "port": { + "type": "number", + "description": "The port on which this app should be served." + } + }, + "required": ["name"], + "presets": [] + }, + "aliases": ["remote"], + "description": "Generate a Remote Angular Micro-Frontend Application.", + "implementation": "/packages/angular/src/generators/mfe-remote/mfe-remote.ts", + "hidden": false, + "path": "/packages/angular/src/generators/mfe-remote/schema.json" + }, + { + "name": "move", + "factory": "./src/generators/move/move#angularMoveGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxAngularMove", + "cli": "nx", + "title": "Nx Angular Move", + "description": "Move an Angular project to another folder in the workspace.", + "type": "object", + "examples": [ + { + "command": "nx g @nrwl/angular:move --project my-feature-lib shared/my-feature-lib", + "description": "Move libs/my-feature-lib to libs/shared/my-feature-lib." + } + ], + "properties": { + "projectName": { + "type": "string", + "alias": "project", + "description": "The name of the Angular project to move." + }, + "destination": { + "type": "string", + "description": "The folder to move the Angular project into.", + "$default": { "$source": "argv", "index": 0 } + }, + "importPath": { + "type": "string", + "description": "The new import path to use in the `tsconfig.base.json`." + }, + "updateImportPath": { + "type": "boolean", + "description": "Update the import path to reflect the new location.", + "default": true + }, + "skipFormat": { + "type": "boolean", + "aliases": ["skip-format"], + "description": "Skip formatting files.", + "default": false + } + }, + "required": ["projectName", "destination"], + "presets": [] + }, + "aliases": ["mv"], + "description": "Moves an Angular application or library to another folder within the workspace and updates the project configuration.", + "implementation": "/packages/angular/src/generators/move/move#angularMoveGenerator.ts", + "hidden": false, + "path": "/packages/angular/src/generators/move/schema.json" + }, + { + "name": "convert-to-with-mf", + "factory": "./src/generators/convert-to-with-mf/convert-to-with-mf", + "schema": { + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "ConvertToWithMFGenerator", + "cli": "nx", + "title": "Convert to withModuleFederation Generator Options Schema", + "type": "object", + "description": "Converts an old micro frontend configuration to use the new withModuleFederation helper. It will run successfully if the following conditions are met: \n - Is either a host or remote application \n - Shared npm package configurations have not been modified \n - Name used to identify the Micro Frontend application matches the project name \n\n _**Note:** This generator will overwrite your webpack config. If you have additional custom configuration in your config file, it will be lost!_", + "additionalProperties": false, + "properties": { + "project": { + "type": "string", + "description": "The name of the micro frontend project to migrate.", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What micro frontend project would you like to migrate?" + } + }, + "presets": [] + }, + "description": "Converts an old micro frontend configuration to use the new withModuleFederation helper. It will run successfully if the following conditions are met: \n - Is either a host or remote application \n - Shared npm package configurations have not been modified \n - Name used to identify the Micro Frontend application matches the project name \n\n _**Note:** This generator will overwrite your webpack config. If you have additional custom configuration in your config file, it will be lost!_", + "implementation": "/packages/angular/src/generators/convert-to-with-mf/convert-to-with-mf.ts", + "aliases": [], + "hidden": false, + "path": "/packages/angular/src/generators/convert-to-with-mf/schema.json" + }, + { + "name": "mfe-host", + "factory": "./src/generators/mfe-host/mfe-host", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxMFEHost", + "cli": "nx", + "title": "Nx MFE Host App", + "description": "Create an Angular Host Micro Frontend Application", + "type": "object", + "examples": [ + { + "command": "nx g @nrwl/angular:mfe-host appName --remotes=remote1", + "description": "Create an Angular app with configuration in place for MFE. If remotes is provided, attach the remote app to this app's configuration." + } + ], + "properties": { + "name": { + "type": "string", + "description": "The name to give to the host Angular app.", + "$default": { "$source": "argv", "index": 0 } + }, + "host": { + "type": "string", + "description": "The name of the host app to attach this host app to." + }, + "port": { + "type": "number", + "description": "The port on which this app should be served." + } + }, + "required": ["name"], + "presets": [] + }, + "aliases": ["host"], + "description": "Generate a Host Angular Micro Frontend Application.", + "implementation": "/packages/angular/src/generators/mfe-host/mfe-host.ts", + "hidden": false, + "path": "/packages/angular/src/generators/mfe-host/schema.json" + }, + { + "name": "ng-add", + "factory": "./src/generators/ng-add/ng-add", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxAngularNgAddGenerator", + "title": "Angular plugin initialization", + "cli": "nx", + "description": "Migrates an Angular CLI workspace to Nx or adds the Angular plugin to an Nx workspace. NOTE: Does not work in the `--dry-run` mode.", + "type": "object", + "properties": { + "npmScope": { + "type": "string", + "description": "Npm scope for importing libs. NOTE: only used if running the generator in an Angular CLI workspace." + }, + "defaultBase": { + "type": "string", + "description": "Default base branch for affected. NOTE: only used if running the generator in an Angular CLI workspace." + }, + "skipInstall": { + "type": "boolean", + "description": "Skip installing added packages.", + "default": false + }, + "preserveAngularCliLayout": { + "type": "boolean", + "description": "Preserve the Angular CLI layout instead of moving the app into apps. NOTE: only used if running the generator in an Angular CLI workspace.", + "default": false + }, + "name": { + "type": "string", + "description": "Project name. NOTE: only used if running the generator in an Angular CLI workspace.", + "$default": { "$source": "projectName" } + }, + "unitTestRunner": { + "type": "string", + "enum": ["karma", "jest", "none"], + "description": "Test runner to use for unit tests. NOTE: only used if running the generator in an Nx workspace.", + "default": "jest" + }, + "e2eTestRunner": { + "type": "string", + "enum": ["protractor", "cypress", "none"], + "description": "Test runner to use for end to end (e2e) tests. NOTE: only used if running the generator in an Nx workspace.", + "default": "cypress" + }, + "skipFormat": { + "description": "Skip formatting files. NOTE: only used if running the generator in an Nx workspace.", + "type": "boolean", + "default": false + }, + "linter": { + "description": "The tool to use for running lint checks. NOTE: only used if running the generator in an Nx workspace.", + "type": "string", + "enum": ["eslint", "none"], + "default": "eslint" + }, + "style": { + "description": "The file extension to be used for style files. NOTE: only used if running the generator in an Nx workspace.", + "type": "string", + "default": "css", + "enum": ["css", "scss", "sass", "less"] + }, + "skipPackageJson": { + "type": "boolean", + "default": false, + "description": "Do not add dependencies to `package.json`. NOTE: only used if running the generator in an Nx workspace." + } + }, + "additionalProperties": false, + "presets": [] + }, + "description": "Migrates an Angular CLI workspace to Nx or adds the Angular plugin to an Nx workspace.", + "hidden": true, + "implementation": "/packages/angular/src/generators/ng-add/ng-add.ts", + "aliases": [], + "path": "/packages/angular/src/generators/ng-add/schema.json" + }, + { + "name": "ngrx", + "factory": "./src/generators/ngrx/ngrx", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxNgrxGenerator", + "title": "Add NgRx support to an application or library.", + "description": "Adds NgRx support to an application or library.", + "cli": "nx", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the NgRx feature state, such as `products` or `users`. Recommended to use the plural form of the name.", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the NgRx feature state? An example would be `users`." + }, + "module": { + "type": "string", + "description": "The path to the `NgModule` where the feature state will be registered. The host directory will create/use the new state directory.", + "x-prompt": "What is the path to the module where this NgRx state should be registered?" + }, + "directory": { + "type": "string", + "default": "+state", + "description": "The name of the folder used to contain/group the generated NgRx files." + }, + "root": { + "type": "boolean", + "default": false, + "description": "Setup root or feature state management with NgRx.", + "x-prompt": "Is this the root state of the application?" + }, + "facade": { + "type": "boolean", + "default": false, + "description": "Create a Facade class for the the feature.", + "x-prompt": "Would you like to use a Facade with your NgRx state?" + }, + "skipImport": { + "type": "boolean", + "default": false, + "description": "Generate NgRx feature files without registering the feature in the NgModule." + }, + "minimal": { + "type": "boolean", + "default": true, + "description": "Only register the root state management setup or feature state." + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + }, + "skipPackageJson": { + "type": "boolean", + "default": false, + "description": "Do not update the `package.json` with NgRx dependencies." + }, + "syntax": { + "type": "string", + "enum": ["classes", "creators"], + "default": "creators", + "description": "Specifies whether to use class-based or creator functions for actions, reducers, and effects." + }, + "useDataPersistence": { + "type": "boolean", + "default": false, + "description": "Generate NgRx Effects with the `DataPersistence` helper service. Set to false to use plain effects data persistence operators." + }, + "barrels": { + "type": "boolean", + "default": false, + "description": "Use barrels to re-export actions, state and selectors." + } + }, + "additionalProperties": false, + "required": ["module", "name"], + "presets": [] + }, + "description": "Adds NgRx support to an application or library.", + "implementation": "/packages/angular/src/generators/ngrx/ngrx.ts", + "aliases": [], + "hidden": false, + "path": "/packages/angular/src/generators/ngrx/schema.json" + }, + { + "name": "scam", + "factory": "./src/generators/scam/scam", + "schema": { + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "SCAMGenerator", + "cli": "nx", + "title": "SCAM Generator Options Schema", + "type": "object", + "description": "Creates a new, generic component definition in the given or default project.", + "additionalProperties": false, + "properties": { + "path": { + "type": "string", + "format": "path", + "description": "The path at which to create the component file, relative to the current workspace. Default is a folder with the same name as the component in the project root.", + "visible": false + }, + "project": { + "type": "string", + "description": "The name of the project.", + "$default": { "$source": "projectName" } + }, + "name": { + "type": "string", + "description": "The name of the component.", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the component?" + }, + "displayBlock": { + "description": "Specifies if the style will contain `:host { display: block; }`.", + "type": "boolean", + "default": false, + "alias": "b" + }, + "inlineStyle": { + "description": "Include styles inline in the `component.ts` file. Only CSS styles can be included inline. By default, an external styles file is created and referenced in the `component.ts` file.", + "type": "boolean", + "default": false, + "alias": "s" + }, + "inlineTemplate": { + "description": "Include template inline in the `component.ts` file. By default, an external template file is created and referenced in the `component.ts` file.", + "type": "boolean", + "default": false, + "alias": "t" + }, + "viewEncapsulation": { + "description": "The view encapsulation strategy to use in the new component.", + "enum": ["Emulated", "None", "ShadowDom"], + "type": "string", + "alias": "v" + }, + "changeDetection": { + "description": "The change detection strategy to use in the new component.", + "enum": ["Default", "OnPush"], + "type": "string", + "default": "Default", + "alias": "c" + }, + "style": { + "description": "The file extension or preprocessor to use for style files, or 'none' to skip generating the style file.", + "type": "string", + "default": "css", + "enum": ["css", "scss", "sass", "less", "none"] + }, + "skipTests": { + "type": "boolean", + "description": "Do not create `spec.ts` test files for the new component.", + "default": false + }, + "inlineScam": { + "type": "boolean", + "description": "Create the `NgModule` in the same file as the component.", + "default": true + }, + "flat": { + "type": "boolean", + "description": "Create the new files at the top level of the current project.", + "default": false + }, + "selector": { + "type": "string", + "format": "html-selector", + "description": "The `HTML` selector to use for this component." + }, + "skipSelector": { + "type": "boolean", + "default": false, + "description": "Specifies if the component should have a selector or not." + }, + "type": { + "type": "string", + "description": "Adds a developer-defined type to the filename, in the format `name.type.ts`.", + "default": "component" + }, + "prefix": { + "type": "string", + "description": "The prefix to apply to the generated component selector.", + "alias": "p", + "oneOf": [ + { "maxLength": 0 }, + { "minLength": 1, "format": "html-selector" } + ] + }, + "export": { + "type": "boolean", + "description": "Specifies if the SCAM should be exported from the project's entry point (normally `index.ts`). It only applies to libraries.", + "default": true + } + }, + "required": ["name"], + "presets": [] + }, + "description": "Generate a component with an accompanying Single Component Angular Module (SCAM).", + "implementation": "/packages/angular/src/generators/scam/scam.ts", + "aliases": [], + "hidden": false, + "path": "/packages/angular/src/generators/scam/schema.json" + }, + { + "name": "scam-directive", + "factory": "./src/generators/scam-directive/scam-directive", + "schema": { + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "SCAMDirectiveGenerator", + "cli": "nx", + "title": "SCAM Directive Generator Options Schema", + "type": "object", + "description": "Creates a new, generic directive definition in the given or default project.", + "additionalProperties": false, + "properties": { + "path": { + "type": "string", + "format": "path", + "description": "The path at which to create the directive file, relative to the current workspace. Default is a folder with the same name as the directive in the project root.", + "visible": false + }, + "project": { + "type": "string", + "description": "The name of the project.", + "$default": { "$source": "projectName" } + }, + "name": { + "type": "string", + "description": "The name of the directive.", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the directive?" + }, + "skipTests": { + "type": "boolean", + "description": "Do not create `spec.ts` test files for the new directive.", + "default": false + }, + "inlineScam": { + "type": "boolean", + "description": "Create the `NgModule` in the same file as the Directive.", + "default": true + }, + "flat": { + "type": "boolean", + "description": "Create the new files at the top level of the current project.", + "default": true + }, + "selector": { + "type": "string", + "format": "html-selector", + "description": "The `HTML` selector to use for this directive." + }, + "prefix": { + "type": "string", + "description": "The prefix to apply to the generated directive selector.", + "alias": "p", + "oneOf": [ + { "maxLength": 0 }, + { "minLength": 1, "format": "html-selector" } + ] + }, + "export": { + "type": "boolean", + "description": "Specifies if the SCAM should be exported from the project's entry point (normally `index.ts`). It only applies to libraries.", + "default": true + } + }, + "required": ["name"], + "presets": [] + }, + "description": "Generate a directive with an accompanying Single Component Angular Module (SCAM).", + "implementation": "/packages/angular/src/generators/scam-directive/scam-directive.ts", + "aliases": [], + "hidden": false, + "path": "/packages/angular/src/generators/scam-directive/schema.json" + }, + { + "name": "scam-pipe", + "factory": "./src/generators/scam-pipe/scam-pipe", + "schema": { + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "SCAMPipeGenerator", + "cli": "nx", + "title": "SCAM Pipe Generator Options Schema", + "type": "object", + "description": "Creates a new, generic pipe definition in the given or default project.", + "additionalProperties": false, + "properties": { + "path": { + "type": "string", + "format": "path", + "description": "The path at which to create the pipe file, relative to the current workspace. Default is a folder with the same name as the pipe in the project root.", + "visible": false + }, + "project": { + "type": "string", + "description": "The name of the project.", + "$default": { "$source": "projectName" } + }, + "name": { + "type": "string", + "description": "The name of the pipe.", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the pipe?" + }, + "skipTests": { + "type": "boolean", + "description": "Do not create `spec.ts` test files for the new pipe.", + "default": false + }, + "inlineScam": { + "type": "boolean", + "description": "Create the NgModule in the same file as the Pipe.", + "default": true + }, + "flat": { + "type": "boolean", + "description": "Create the new files at the top level of the current project.", + "default": true + }, + "export": { + "type": "boolean", + "description": "Specifies if the SCAM should be exported from the project's entry point (normally `index.ts`). It only applies to libraries.", + "default": true + } + }, + "required": ["name"], + "presets": [] + }, + "description": "Generate a pipe with an accompanying Single Component Angular Module (SCAM).", + "implementation": "/packages/angular/src/generators/scam-pipe/scam-pipe.ts", + "aliases": [], + "hidden": false, + "path": "/packages/angular/src/generators/scam-pipe/schema.json" + }, + { + "name": "setup-mfe", + "factory": "./src/generators/setup-mfe/setup-mfe", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "GeneratorAngularMFESetup", + "cli": "nx", + "title": "Generate Module Federation Setup for Angular App", + "description": "Create Module Federation configuration files for given Angular Application.", + "type": "object", + "properties": { + "appName": { + "type": "string", + "description": "The name of the application to generate the Module Federation configuration for.", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What app would you like to generate a Module Federation configuration for?" + }, + "mfeType": { + "type": "string", + "enum": ["host", "remote"], + "description": "Type of application to generate the Module Federation configuration for.", + "default": "remote" + }, + "port": { + "type": "number", + "description": "The port at which the remote application should be served." + }, + "remotes": { + "type": "array", + "description": "A list of remote application names that the host application should consume." + }, + "host": { + "type": "string", + "description": "The name of the host application that the remote application will be consumed by." + }, + "routing": { + "type": "boolean", + "description": "Generate a routing setup to allow a host application to route to the remote application." + }, + "skipFormat": { + "type": "boolean", + "description": "Skip formatting the workspace after the generator completes." + }, + "skipPackageJson": { + "type": "boolean", + "default": false, + "description": "Do not add dependencies to `package.json`." + }, + "e2eProjectName": { + "type": "string", + "description": "The project name of the associated E2E project for the application. This is only required for Cypress E2E projects that do not follow the naming convention `-e2e`." + } + }, + "required": ["appName", "mfeType"], + "additionalProperties": false, + "presets": [] + }, + "description": "Generate a Module Federation configuration for a given Angular application.", + "implementation": "/packages/angular/src/generators/setup-mfe/setup-mfe.ts", + "aliases": [], + "hidden": false, + "path": "/packages/angular/src/generators/setup-mfe/schema.json" + }, + { + "name": "setup-tailwind", + "factory": "./src/generators/setup-tailwind/setup-tailwind", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxAngularTailwindSetupGenerator", + "cli": "nx", + "title": "Configures Tailwind CSS for an application or a buildable/publishable library.", + "description": "Adds the Tailwind CSS configuration files for a given Angular project and installs, if needed, the packages required for Tailwind CSS to work.", + "type": "object", + "properties": { + "project": { + "type": "string", + "description": "The name of the project to add the Tailwind CSS setup for.", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What project would you like to add the Tailwind CSS setup?" + }, + "buildTarget": { + "type": "string", + "description": "The name of the target used to build the project. This option only applies to buildable/publishable libraries.", + "default": "build" + }, + "skipFormat": { + "type": "boolean", + "description": "Skips formatting the workspace after the generator completes." + }, + "stylesEntryPoint": { + "type": "string", + "description": "Path to the styles entry point relative to the workspace root. If not provided the generator will do its best to find it and it will error if it can't. This option only applies to applications." + }, + "skipPackageJson": { + "type": "boolean", + "default": false, + "description": "Do not add dependencies to `package.json`." + } + }, + "additionalProperties": false, + "required": ["project"], + "presets": [] + }, + "description": "Configures Tailwind CSS for an application or a buildable/publishable library.", + "implementation": "/packages/angular/src/generators/setup-tailwind/setup-tailwind.ts", + "aliases": [], + "hidden": false, + "path": "/packages/angular/src/generators/setup-tailwind/schema.json" + }, + { + "name": "stories", + "factory": "./src/generators/stories/stories", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxAngularStorybookStoriesGenerator", + "title": "Create Storybook stories/specs", + "description": "Creates Storybook stories/specs for all components declared in a project.", + "cli": "nx", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the project.", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What's the name of the project for which you want to generate stories?" + }, + "generateCypressSpecs": { + "type": "boolean", + "description": "Specifies whether to automatically generate `*.spec.ts` files in the Cypress e2e app generated by the `cypress-configure` generator.", + "x-prompt": "Do you want to generate Cypress specs as well?" + }, + "cypressProject": { + "type": "string", + "description": "The Cypress project to generate the stories under. This is inferred from `name` by default." + } + }, + "additionalProperties": false, + "required": ["name"], + "presets": [] + }, + "description": "Creates stories/specs for all components declared in a project.", + "implementation": "/packages/angular/src/generators/stories/stories.ts", + "aliases": [], + "hidden": false, + "path": "/packages/angular/src/generators/stories/schema.json" + }, + { + "name": "storybook-configuration", + "factory": "./src/generators/storybook-configuration/storybook-configuration", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxAngularStorybookConfigurationGenerator", + "title": "Adds Storybook configuration to a project.", + "description": "Adds Storybook configuration to a project to be able to use and create stories.", + "cli": "nx", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the project.", + "$default": { "$source": "argv", "index": 0 } + }, + "configureCypress": { + "type": "boolean", + "description": "Specifies whether to configure Cypress or not.", + "x-prompt": "Configure a Cypress e2e app to run against the storybook instance?", + "default": true + }, + "generateStories": { + "type": "boolean", + "description": "Specifies whether to automatically generate `*.stories.ts` files for components declared in this project or not.", + "x-prompt": "Automatically generate *.stories.ts files for components declared in this project?", + "default": true + }, + "generateCypressSpecs": { + "type": "boolean", + "description": "Specifies whether to automatically generate `*.spec.ts` files in the generated Cypress e2e app.", + "x-prompt": "Automatically generate *.spec.ts files in the generated Cypress e2e app?", + "default": true + }, + "cypressDirectory": { + "type": "string", + "description": "A directory where the Cypress project will be placed. Placed at the root by default." + }, + "linter": { + "description": "The tool to use for running lint checks.", + "type": "string", + "enum": ["eslint", "none"], + "default": "eslint" + } + }, + "additionalProperties": false, + "required": ["name"], + "presets": [] + }, + "description": "Adds Storybook configuration to a project.", + "implementation": "/packages/angular/src/generators/storybook-configuration/storybook-configuration.ts", + "aliases": [], + "hidden": false, + "path": "/packages/angular/src/generators/storybook-configuration/schema.json" + }, + { + "name": "storybook-migrate-defaults-5-to-6", + "factory": "./src/generators/storybook-migrate-defaults-5-to-6/storybook-migrate-defaults-5-to-6", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxStorybookMigrateDefaults5To6Generator", + "title": "Storybook migrate default 5 to 6", + "description": "Generates default Storybook configuration files using Storybook version `>=6.x` specs, for projects that already have Storybook instances and configurations of versions `<6.x.`", + "cli": "nx", + "type": "object", + "properties": { + "all": { + "type": "boolean", + "description": "Generate new Storybook configurations for all Storybook instances across all applications and libraries.", + "default": true + }, + "keepOld": { + "type": "boolean", + "description": "Keep the old configuration files by placing them in a folder called `.old_storybook`.", + "default": true + }, + "name": { + "type": "string", + "description": "Library or application name for which you want to generate the new Storybook configuration. Leave empty to upgrade all Storybook instances. Only use this if you want to do a gradual migration.", + "$default": { "$source": "argv", "index": 0 } + } + }, + "additionalProperties": false, + "required": [], + "presets": [] + }, + "description": "Generates default Storybook configuration files using Storybook version >=6.x specs, for projects that already have Storybook instances and configurations of versions <6.x.", + "implementation": "/packages/angular/src/generators/storybook-migrate-defaults-5-to-6/storybook-migrate-defaults-5-to-6.ts", + "aliases": [], + "hidden": false, + "path": "/packages/angular/src/generators/storybook-migrate-defaults-5-to-6/schema.json" + }, + { + "name": "storybook-migrate-stories-to-6-2", + "factory": "./src/generators/storybook-migrate-stories-to-6-2/migrate-stories-to-6-2", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxAngularStorybookMigrateStoriesTo62Generator", + "title": "Storybook migrate stories to 6.2", + "description": "Migrates stories to match the new syntax in `v6.2` where the component declaration should be in the default export.", + "type": "object", + "cli": "nx", + "properties": {}, + "additionalProperties": false, + "required": [], + "presets": [] + }, + "description": "Migrates stories to match the new syntax in v6.2 where the component declaration should be in the default export.", + "implementation": "/packages/angular/src/generators/storybook-migrate-stories-to-6-2/migrate-stories-to-6-2.ts", + "aliases": [], + "hidden": false, + "path": "/packages/angular/src/generators/storybook-migrate-stories-to-6-2/schema.json" + }, + { + "name": "upgrade-module", + "factory": "./src/generators/upgrade-module/upgrade-module", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxUpgradeModuleGenerator", + "title": "Generates UpgradeModule setup.", + "description": "Sets up an Upgrade Module.", + "cli": "nx", + "type": "object", + "properties": { + "project": { + "type": "string", + "description": "The name of the project." + }, + "name": { + "type": "string", + "description": "The name of the main AngularJS module.", + "$default": { "$source": "argv", "index": 0 } + }, + "angularJsImport": { + "type": "string", + "description": "Import expression of the AngularJS application (e.g., `--angularJsImport=some_node_module/my_app`)." + }, + "angularJsCmpSelector": { + "type": "string", + "description": "The selector of an AngularJS component (e.g., `--angularJsCmpSelector=myComponent`)." + }, + "skipFormat": { + "type": "boolean", + "description": "Skip formatting files.", + "default": false + }, + "skipPackageJson": { + "type": "boolean", + "description": "Do not add `@angular/upgrade` to `package.json` (e.g., `--skipPackageJson`).", + "default": false + }, + "router": { + "type": "boolean", + "description": "Sets up router synchronization (e.g., `--router`).", + "default": false + } + }, + "additionalProperties": false, + "required": ["name", "project"], + "presets": [] + }, + "description": "Sets up an Upgrade Module.", + "implementation": "/packages/angular/src/generators/upgrade-module/upgrade-module.ts", + "aliases": [], + "hidden": false, + "path": "/packages/angular/src/generators/upgrade-module/schema.json" + }, + { + "name": "web-worker", + "factory": "./src/generators/web-worker/web-worker", + "schema": { + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "NxAngularWebWorkerGenerator", + "title": "Angular Web Worker Options Schema", + "description": "Creates a new, generic web worker definition in the given or default project.", + "cli": "nx", + "type": "object", + "properties": { + "path": { + "type": "string", + "format": "path", + "description": "The path at which to create the worker file, relative to the current workspace." + }, + "project": { + "type": "string", + "description": "The name of the project.", + "$default": { "$source": "projectName" } + }, + "name": { + "type": "string", + "description": "The name of the worker.", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the worker?" + }, + "snippet": { + "type": "boolean", + "default": true, + "description": "Add a worker creation snippet in a sibling file of the same name." + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + } + }, + "additionalProperties": false, + "required": ["name", "project"], + "presets": [] + }, + "description": "Creates a Web Worker.", + "implementation": "/packages/angular/src/generators/web-worker/web-worker.ts", + "aliases": [], + "hidden": false, + "path": "/packages/angular/src/generators/web-worker/schema.json" + } + ], + "executors": [ + { + "name": "delegate-build", + "implementation": "/packages/angular/src/executors/delegate-build/delegate-build.impl.ts", + "schema": { + "$schema": "http://json-schema.org/draft-07/schema", + "title": "Schema for an executor which delegates a build.", + "description": "Options for delegating a build to a different target.", + "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." + }, + "tsConfig": { + "type": "string", + "description": "The full path for the TypeScript configuration file, relative to the workspace root." + }, + "watch": { + "type": "boolean", + "description": "Whether to run a build when any file changes.", + "default": false + } + }, + "additionalProperties": false, + "required": ["buildTarget", "outputPath", "tsConfig"], + "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" + }, + { + "name": "ng-packagr-lite", + "implementation": "/packages/angular/src/executors/ng-packagr-lite/ng-packagr-lite.impl.ts", + "schema": { + "$schema": "http://json-schema.org/schema", + "title": "ng-packagr Target", + "description": "ng-packagr target options for Build Architect. Use to build library projects.", + "cli": "nx", + "type": "object", + "presets": [ + { + "name": "Buildable Library with Tailwind", + "keys": ["tailwindConfig"] + }, + { + "name": "Updating Project Dependencies for Buildable Library", + "keys": [ + "updateBuildableProjectDepsInPackageJson", + "buildableProjectDepsInPackageJsonType" + ] + } + ], + "properties": { + "project": { + "type": "string", + "description": "The file path for the ng-packagr configuration file, relative to the workspace root." + }, + "tsConfig": { + "type": "string", + "description": "The full path for the TypeScript configuration file, relative to the workspace root." + }, + "watch": { + "type": "boolean", + "description": "Whether to run a build when any file changes.", + "default": false + }, + "updateBuildableProjectDepsInPackageJson": { + "type": "boolean", + "description": "Whether to update the buildable project dependencies in package.json.", + "default": true + }, + "buildableProjectDepsInPackageJsonType": { + "type": "string", + "description": "When `updateBuildableProjectDepsInPackageJson` is `true`, this adds dependencies to either `peerDependencies` or `dependencies`.", + "enum": ["dependencies", "peerDependencies"], + "default": "peerDependencies" + }, + "tailwindConfig": { + "type": "string", + "description": "The full path for the Tailwind configuration file, relative to the workspace root. If not provided and a `tailwind.config.js` file exists in the project or workspace root, it will be used. Otherwise, Tailwind will not be configured." + } + }, + "additionalProperties": false, + "required": ["project"] + }, + "description": "Builds a library with support for incremental builds.", + "aliases": [], + "hidden": false, + "path": "/packages/angular/src/executors/ng-packagr-lite/schema.json" + }, + { + "name": "package", + "implementation": "/packages/angular/src/executors/package/package.impl.ts", + "schema": { + "$schema": "http://json-schema.org/schema", + "title": "ng-packagr Target", + "description": "ng-packagr target options for Build Architect. Use to build and package library projects for publishing.", + "cli": "nx", + "type": "object", + "presets": [ + { + "name": "Publishable Library with Tailwind", + "keys": ["tailwindConfig"] + }, + { + "name": "Updating Project Dependencies for Publishable Library", + "keys": [ + "updateBuildableProjectDepsInPackageJson", + "buildableProjectDepsInPackageJsonType" + ] + } + ], + "properties": { + "project": { + "type": "string", + "description": "The file path for the ng-packagr configuration file, relative to the workspace root." + }, + "tsConfig": { + "type": "string", + "description": "The full path for the TypeScript configuration file, relative to the workspace root." + }, + "watch": { + "type": "boolean", + "description": "Whether to run a build when any file changes.", + "default": false + }, + "updateBuildableProjectDepsInPackageJson": { + "type": "boolean", + "description": "Whether to update the buildable project dependencies in package.json.", + "default": true + }, + "buildableProjectDepsInPackageJsonType": { + "type": "string", + "description": "When `updateBuildableProjectDepsInPackageJson` is `true`, this adds dependencies to either `peerDependencies` or `dependencies`.", + "enum": ["dependencies", "peerDependencies"], + "default": "peerDependencies" + }, + "tailwindConfig": { + "type": "string", + "description": "The full path for the Tailwind configuration file, relative to the workspace root. If not provided and a `tailwind.config.js` file exists in the project or workspace root, it will be used. Otherwise, Tailwind will not be configured." + } + }, + "additionalProperties": false, + "required": ["project"] + }, + "description": "Builds and packages an Angular library to be distributed as an NPM package. It supports incremental builds.", + "aliases": [], + "hidden": false, + "path": "/packages/angular/src/executors/package/schema.json" + }, + { + "name": "webpack-browser", + "implementation": "/packages/angular/src/builders/webpack-browser/webpack-browser.impl.ts", + "schema": { + "$schema": "http://json-schema.org/draft-07/schema", + "title": "Schema for Webpack Browser", + "description": "The webpack-browser executor is very similar to the standard browser builder provided by the Angular Devkit. It allows you to build your Angular application to a build artifact that can be hosted online. There are some key differences: \n- Supports Custom Webpack Configurations \n- Supports Incremental Building", + "examplesFile": "##### Using a custom webpack configuration\n\nThe executor supports providing a path to a custom webpack configuration. This allows you to customize how your Angular application is built. It currently supports the following types of webpack configurations:\n\n- `object`\n- `Function`\n- `Promise`\n\nThe executor will merge the provided configuration with the webpack configuration that Angular Devkit uses. The merge order is:\n\n- Angular Devkit Configuration\n- Provided Configuration\n\nTo use a custom webpack configuration when building your Angular application, change the `build` target in your `project.json` to match the following:\n\n```ts\n\"build\": {\n \"executor\": \"@nrwl/angular:webpack-browser\",\n \"options\": {\n ...\n \"customWebpackConfig\": {\n \"path\": \"apps/appName/webpack.config.js\"\n }\n }\n}\n```\n\n##### Incrementally Building your Application\n\nThe executor supports incrementally building your Angular application by building the workspace libraries it depends on _(that have been marked as buildable)_ and then building your application using the built source of the libraries.\n\nThis can improve build time as the building of the workspace libraries can be cached, meaning they only have to be rebuilt if they have changed.\n\n> Note: There may be some additional overhead in the linking of the built libraries' sources which may reduce the overall improvement in build time. Therefore this approach only benefits large applications and would likely have a negative impact on small and medium applications. \n> You can read more about when to use incremental builds [here](/ci/incremental-builds#when-should-i-use-incremental-builds).\n\nTo allow your Angular application to take advantage of incremental building, change the `build` target in your `project.json` to match the following:\n\n```ts\n\"build\": {\n \"executor\": \"@nrwl/angular:webpack-browser\",\n \"options\": {\n ...\n \"buildLibsFromSource\": false\n }\n}\n```\n", + "type": "object", + "presets": [ + { + "name": "Custom Webpack Configuration", + "keys": [ + "outputs", + "outputPath", + "index", + "main", + "polyfills", + "tsConfig", + "assets", + "styles", + "scripts", + "customWebpackConfig" + ] + }, + { + "name": "Incremental Builds", + "keys": [ + "outputs", + "buildLibsFromSource", + "outputPath", + "index", + "main", + "polyfills", + "tsConfig", + "assets", + "styles", + "scripts" + ] + } + ], + "properties": { + "assets": { + "type": "array", + "description": "List of static application assets.", + "default": [], + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "followSymlinks": { + "type": "boolean", + "default": false, + "description": "Allow glob patterns to follow symlink directories. This allows subdirectories of the symlink to be searched." + }, + "glob": { + "type": "string", + "description": "The pattern to match." + }, + "input": { + "type": "string", + "description": "The input directory path in which to apply 'glob'. Defaults to the project root." + }, + "ignore": { + "description": "An array of globs to ignore.", + "type": "array", + "items": { "type": "string" } + }, + "output": { + "type": "string", + "description": "Absolute path within the output." + } + }, + "additionalProperties": false, + "required": ["glob", "input", "output"] + }, + { "type": "string" } + ] + } + }, + "main": { + "type": "string", + "description": "The full path for the main entry point to the app, relative to the current workspace." + }, + "polyfills": { + "type": "string", + "description": "The full path for the polyfills file, relative to the current workspace." + }, + "tsConfig": { + "type": "string", + "description": "The full path for the TypeScript configuration file, relative to the current workspace." + }, + "scripts": { + "description": "Global scripts to be included in the build.", + "type": "array", + "default": [], + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "input": { + "type": "string", + "description": "The file to include." + }, + "bundleName": { + "type": "string", + "pattern": "^[\\w\\-.]*$", + "description": "The bundle name for this extra entry point." + }, + "inject": { + "type": "boolean", + "description": "If the bundle will be referenced in the HTML file.", + "default": true + } + }, + "additionalProperties": false, + "required": ["input"] + }, + { "type": "string", "description": "The file to include." } + ] + } + }, + "styles": { + "description": "Global styles to be included in the build.", + "type": "array", + "default": [], + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "input": { + "type": "string", + "description": "The file to include." + }, + "bundleName": { + "type": "string", + "pattern": "^[\\w\\-.]*$", + "description": "The bundle name for this extra entry point." + }, + "inject": { + "type": "boolean", + "description": "If the bundle will be referenced in the HTML file.", + "default": true + } + }, + "additionalProperties": false, + "required": ["input"] + }, + { "type": "string", "description": "The file to include." } + ] + } + }, + "inlineStyleLanguage": { + "description": "The stylesheet language to use for the application's inline component styles.", + "type": "string", + "default": "css", + "enum": ["css", "less", "sass", "scss"] + }, + "stylePreprocessorOptions": { + "description": "Options to pass to style preprocessors.", + "type": "object", + "properties": { + "includePaths": { + "description": "Paths to include. Paths will be resolved to project root.", + "type": "array", + "items": { "type": "string" }, + "default": [] + } + }, + "additionalProperties": false + }, + "optimization": { + "description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For more information, see https://angular.io/guide/workspace-config#optimization-configuration.", + "x-user-analytics": 16, + "default": true, + "oneOf": [ + { + "type": "object", + "properties": { + "scripts": { + "type": "boolean", + "description": "Enables optimization of the scripts output.", + "default": true + }, + "styles": { + "description": "Enables optimization of the styles output.", + "default": true, + "oneOf": [ + { + "type": "object", + "properties": { + "minify": { + "type": "boolean", + "description": "Minify CSS definitions by removing extraneous whitespace and comments, merging identifiers and minimizing values.", + "default": true + }, + "inlineCritical": { + "type": "boolean", + "description": "Extract and inline critical CSS definitions to improve first paint time.", + "default": true + } + }, + "additionalProperties": false + }, + { "type": "boolean" } + ] + }, + "fonts": { + "description": "Enables optimization for fonts. This option requires internet access. `HTTPS_PROXY` environment variable can be used to specify a proxy server.", + "default": true, + "oneOf": [ + { + "type": "object", + "properties": { + "inline": { + "type": "boolean", + "description": "Reduce render blocking requests by inlining external Google Fonts and Adobe Fonts CSS definitions in the application's HTML index file. This option requires internet access. `HTTPS_PROXY` environment variable can be used to specify a proxy server.", + "default": true + } + }, + "additionalProperties": false + }, + { "type": "boolean" } + ] + } + }, + "additionalProperties": false + }, + { "type": "boolean" } + ] + }, + "fileReplacements": { + "description": "Replace compilation source files with other compilation source files in the build.", + "type": "array", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "src": { + "type": "string", + "pattern": "\\.(([cm]?j|t)sx?|json)$" + }, + "replaceWith": { + "type": "string", + "pattern": "\\.(([cm]?j|t)sx?|json)$" + } + }, + "additionalProperties": false, + "required": ["src", "replaceWith"] + }, + { + "type": "object", + "properties": { + "replace": { + "type": "string", + "pattern": "\\.(([cm]?j|t)sx?|json)$" + }, + "with": { + "type": "string", + "pattern": "\\.(([cm]?j|t)sx?|json)$" + } + }, + "additionalProperties": false, + "required": ["replace", "with"] + } + ] + }, + "default": [] + }, + "outputPath": { + "type": "string", + "description": "The full path for the new output directory, relative to the current workspace.\n\nBy default, writes output to a folder named dist/ in the current project." + }, + "resourcesOutputPath": { + "type": "string", + "description": "The path where style resources will be placed, relative to outputPath.", + "default": "" + }, + "aot": { + "type": "boolean", + "description": "Build using Ahead of Time compilation.", + "x-user-analytics": 13, + "default": true + }, + "sourceMap": { + "description": "Output source maps for scripts and styles. For more information, see https://angular.io/guide/workspace-config#source-map-configuration.", + "default": false, + "oneOf": [ + { + "type": "object", + "properties": { + "scripts": { + "type": "boolean", + "description": "Output source maps for all scripts.", + "default": true + }, + "styles": { + "type": "boolean", + "description": "Output source maps for all styles.", + "default": true + }, + "hidden": { + "type": "boolean", + "description": "Output source maps used for error reporting tools.", + "default": false + }, + "vendor": { + "type": "boolean", + "description": "Resolve vendor packages source maps.", + "default": false + } + }, + "additionalProperties": false + }, + { "type": "boolean" } + ] + }, + "vendorChunk": { + "type": "boolean", + "description": "Generate a seperate bundle containing only vendor libraries. This option should only used for development.", + "default": false + }, + "commonChunk": { + "type": "boolean", + "description": "Generate a seperate bundle containing code used across multiple bundles.", + "default": true + }, + "baseHref": { + "type": "string", + "description": "Base url for the application being built." + }, + "deployUrl": { + "type": "string", + "description": "URL where files will be deployed.", + "x-deprecated": "Use `baseHref` option, `APP_BASE_HREF` DI token or a combination of both instead. For more information, see https://angular.io/guide/deployment#the-deploy-url." + }, + "verbose": { + "type": "boolean", + "description": "Adds more details to output logging.", + "default": false + }, + "progress": { + "type": "boolean", + "description": "Log progress to the console while building.", + "default": true + }, + "i18nMissingTranslation": { + "type": "string", + "description": "How to handle missing translations for i18n.", + "enum": ["warning", "error", "ignore"], + "default": "warning" + }, + "i18nDuplicateTranslation": { + "type": "string", + "description": "How to handle duplicate translations for i18n.", + "enum": ["warning", "error", "ignore"], + "default": "warning" + }, + "localize": { + "description": "Translate the bundles in one or more locales.", + "oneOf": [ + { "type": "boolean", "description": "Translate all locales." }, + { + "type": "array", + "description": "List of locales ID's to translate.", + "minItems": 1, + "items": { + "type": "string", + "pattern": "^[a-zA-Z]{2,3}(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|[0-9]{3}))?(-[a-zA-Z]{5,8})?(-x(-[a-zA-Z0-9]{1,8})+)?$" + } + } + ] + }, + "watch": { + "type": "boolean", + "description": "Run build when files change.", + "default": false + }, + "outputHashing": { + "type": "string", + "description": "Define the output filename cache-busting hashing mode.", + "default": "none", + "enum": ["none", "all", "media", "bundles"] + }, + "poll": { + "type": "number", + "description": "Enable and define the file watching poll time period in milliseconds." + }, + "deleteOutputPath": { + "type": "boolean", + "description": "Delete the output path before building.", + "default": true + }, + "preserveSymlinks": { + "type": "boolean", + "description": "Do not use the real path when resolving modules. If unset then will default to `true` if NodeJS option --preserve-symlinks is set." + }, + "extractLicenses": { + "type": "boolean", + "description": "Extract all licenses in a separate file.", + "default": true + }, + "showCircularDependencies": { + "type": "boolean", + "description": "Show circular dependency warnings on builds.", + "default": false, + "x-deprecated": "The recommended method to detect circular dependencies in project code is to use either a lint rule or other external tooling." + }, + "buildOptimizer": { + "type": "boolean", + "description": "Enables '@angular-devkit/build-optimizer' optimizations when using the 'aot' option.", + "default": true + }, + "namedChunks": { + "type": "boolean", + "description": "Use file name for lazy loaded chunks.", + "default": false + }, + "subresourceIntegrity": { + "type": "boolean", + "description": "Enables the use of subresource integrity validation.", + "default": false + }, + "serviceWorker": { + "type": "boolean", + "description": "Generates a service worker config for production builds.", + "default": false + }, + "ngswConfigPath": { + "type": "string", + "description": "Path to ngsw-config.json." + }, + "index": { + "description": "Configures the generation of the application's HTML index.", + "oneOf": [ + { + "type": "string", + "description": "The path of a file to use for the application's HTML index. The filename of the specified path will be used for the generated file and will be created in the root of the application's configured output path." + }, + { + "type": "object", + "description": "", + "properties": { + "input": { + "type": "string", + "minLength": 1, + "description": "The path of a file to use for the application's generated HTML index." + }, + "output": { + "type": "string", + "minLength": 1, + "default": "index.html", + "description": "The output path of the application's generated HTML index file. The full provided path will be used and will be considered relative to the application's configured output path." + } + }, + "required": ["input"] + } + ] + }, + "statsJson": { + "type": "boolean", + "description": "Generates a 'stats.json' file which can be analyzed using tools such as 'webpack-bundle-analyzer'.", + "default": false + }, + "budgets": { + "description": "Budget thresholds to ensure parts of your application stay within boundaries which you set.", + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The type of budget.", + "enum": [ + "all", + "allScript", + "any", + "anyScript", + "anyComponentStyle", + "bundle", + "initial" + ] + }, + "name": { + "type": "string", + "description": "The name of the bundle." + }, + "baseline": { + "type": "string", + "description": "The baseline size for comparison." + }, + "maximumWarning": { + "type": "string", + "description": "The maximum threshold for warning relative to the baseline." + }, + "maximumError": { + "type": "string", + "description": "The maximum threshold for error relative to the baseline." + }, + "minimumWarning": { + "type": "string", + "description": "The minimum threshold for warning relative to the baseline." + }, + "minimumError": { + "type": "string", + "description": "The minimum threshold for error relative to the baseline." + }, + "warning": { + "type": "string", + "description": "The threshold for warning relative to the baseline (min & max)." + }, + "error": { + "type": "string", + "description": "The threshold for error relative to the baseline (min & max)." + } + }, + "additionalProperties": false, + "required": ["type"] + }, + "default": [] + }, + "webWorkerTsConfig": { + "type": "string", + "description": "TypeScript configuration for Web Worker modules." + }, + "crossOrigin": { + "type": "string", + "description": "Define the crossorigin attribute setting of elements that provide CORS support.", + "default": "none", + "enum": ["none", "anonymous", "use-credentials"] + }, + "allowedCommonJsDependencies": { + "description": "A list of CommonJS packages that are allowed to be used without a build time warning.", + "type": "array", + "items": { "type": "string" }, + "default": [] + }, + "customWebpackConfig": { + "description": "Options for additional webpack configurations.", + "type": "object", + "properties": { + "path": { + "description": "Path to additional webpack configuration, relative to the workspace root.", + "type": "string" + } + }, + "additionalProperties": false + }, + "buildLibsFromSource": { + "type": "boolean", + "description": "Read buildable libraries from source instead of building them separately.", + "default": true + } + }, + "additionalProperties": false, + "required": ["outputPath", "index", "main", "tsConfig"], + "definitions": { + "assetPattern": { + "oneOf": [ + { + "type": "object", + "properties": { + "followSymlinks": { + "type": "boolean", + "default": false, + "description": "Allow glob patterns to follow symlink directories. This allows subdirectories of the symlink to be searched." + }, + "glob": { + "type": "string", + "description": "The pattern to match." + }, + "input": { + "type": "string", + "description": "The input directory path in which to apply 'glob'. Defaults to the project root." + }, + "ignore": { + "description": "An array of globs to ignore.", + "type": "array", + "items": { "type": "string" } + }, + "output": { + "type": "string", + "description": "Absolute path within the output." + } + }, + "additionalProperties": false, + "required": ["glob", "input", "output"] + }, + { "type": "string" } + ] + }, + "fileReplacement": { + "oneOf": [ + { + "type": "object", + "properties": { + "src": { + "type": "string", + "pattern": "\\.(([cm]?j|t)sx?|json)$" + }, + "replaceWith": { + "type": "string", + "pattern": "\\.(([cm]?j|t)sx?|json)$" + } + }, + "additionalProperties": false, + "required": ["src", "replaceWith"] + }, + { + "type": "object", + "properties": { + "replace": { + "type": "string", + "pattern": "\\.(([cm]?j|t)sx?|json)$" + }, + "with": { + "type": "string", + "pattern": "\\.(([cm]?j|t)sx?|json)$" + } + }, + "additionalProperties": false, + "required": ["replace", "with"] + } + ] + }, + "extraEntryPoint": { + "oneOf": [ + { + "type": "object", + "properties": { + "input": { + "type": "string", + "description": "The file to include." + }, + "bundleName": { + "type": "string", + "pattern": "^[\\w\\-.]*$", + "description": "The bundle name for this extra entry point." + }, + "inject": { + "type": "boolean", + "description": "If the bundle will be referenced in the HTML file.", + "default": true + } + }, + "additionalProperties": false, + "required": ["input"] + }, + { "type": "string", "description": "The file to include." } + ] + }, + "budget": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The type of budget.", + "enum": [ + "all", + "allScript", + "any", + "anyScript", + "anyComponentStyle", + "bundle", + "initial" + ] + }, + "name": { + "type": "string", + "description": "The name of the bundle." + }, + "baseline": { + "type": "string", + "description": "The baseline size for comparison." + }, + "maximumWarning": { + "type": "string", + "description": "The maximum threshold for warning relative to the baseline." + }, + "maximumError": { + "type": "string", + "description": "The maximum threshold for error relative to the baseline." + }, + "minimumWarning": { + "type": "string", + "description": "The minimum threshold for warning relative to the baseline." + }, + "minimumError": { + "type": "string", + "description": "The minimum threshold for error relative to the baseline." + }, + "warning": { + "type": "string", + "description": "The threshold for warning relative to the baseline (min & max)." + }, + "error": { + "type": "string", + "description": "The threshold for error relative to the baseline (min & max)." + } + }, + "additionalProperties": false, + "required": ["type"] + } + } + }, + "description": "The webpack-browser executor is very similar to the standard browser builder provided by the Angular Devkit. It allows you to build your Angular application to a build artifact that can be hosted online. There are some key differences: \n- Supports Custom Webpack Configurations \n- Supports Incremental Building", + "aliases": [], + "hidden": false, + "path": "/packages/angular/src/builders/webpack-browser/schema.json" + }, + { + "name": "webpack-server", + "implementation": "/packages/angular/src/builders/webpack-server/webpack-server.impl.ts", + "schema": { + "$schema": "http://json-schema.org/draft-07/schema", + "title": "Schema for Webpack Server", + "description": "The webpack-server executor is very similar to the standard dev server builder provided by the Angular Devkit. It is usually used in tandem with `@nrwl/angular:webpack-browser` when your Angular application uses a custom webpack configuration.", + "examplesFile": "##### Seving an application with a custom webpack configuration\n\nThis executor should be used along with `@nrwl/angular:webpack-browser` to serve an application using a custom webpack configuration.\n\nYour `project.json` file should contain a `build` and `serve` target that matches the following:\n\n```json\n\"build\": {\n \"executor\": \"@nrwl/angular:webpack-browser\",\n \"options\": {\n ...\n \"customWebpackConfig\": {\n \"path\": \"apps/appName/webpack.config.js\"\n }\n }\n},\n\"serve\": {\n \"executor\": \"@nrwl/angular:webpack-server\",\n \"configurations\": {\n \"production\": {\n \"browserTarget\": \"appName:build:production\"\n },\n \"development\": {\n \"browserTarget\": \"appName:build:development\"\n }\n },\n \"defaultConfiguration\": \"development\",\n}\n```\n", + "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." + } + }, + "additionalProperties": false, + "required": ["browserTarget"] + }, + "description": "The webpack-server executor is very similar to the standard dev server builder provided by the Angular Devkit. It is usually used in tandem with `@nrwl/angular:webpack-browser` when your Angular application uses a custom webpack configuration.", + "aliases": [], + "hidden": false, + "path": "/packages/angular/src/builders/webpack-server/schema.json" + } + ] +} diff --git a/docs/generated/packages/cli.json b/docs/generated/packages/cli.json new file mode 100644 index 0000000000..a68b2221a5 --- /dev/null +++ b/docs/generated/packages/cli.json @@ -0,0 +1,9 @@ +{ + "githubRoot": "https://github.com/nrwl/nx/blob/master", + "name": "cli", + "description": "Smart, Fast and Extensible Build System", + "root": "/packages/cli", + "source": "/packages/cli/src", + "generators": [], + "executors": [] +} diff --git a/docs/generated/packages/cra-to-nx.json b/docs/generated/packages/cra-to-nx.json new file mode 100644 index 0000000000..5b6bf2973b --- /dev/null +++ b/docs/generated/packages/cra-to-nx.json @@ -0,0 +1,8 @@ +{ + "githubRoot": "https://github.com/nrwl/nx/blob/master", + "name": "cra-to-nx", + "root": "/packages/cra-to-nx", + "source": "/packages/cra-to-nx/src", + "generators": [], + "executors": [] +} diff --git a/docs/generated/packages/create-nx-plugin.json b/docs/generated/packages/create-nx-plugin.json new file mode 100644 index 0000000000..ce9342406f --- /dev/null +++ b/docs/generated/packages/create-nx-plugin.json @@ -0,0 +1,9 @@ +{ + "githubRoot": "https://github.com/nrwl/nx/blob/master", + "name": "create-nx-plugin", + "description": "Smart, Fast and Extensible Build System", + "root": "/packages/create-nx-plugin", + "source": "/packages/create-nx-plugin/src", + "generators": [], + "executors": [] +} diff --git a/docs/generated/packages/create-nx-workspace.json b/docs/generated/packages/create-nx-workspace.json new file mode 100644 index 0000000000..0bba26e25a --- /dev/null +++ b/docs/generated/packages/create-nx-workspace.json @@ -0,0 +1,9 @@ +{ + "githubRoot": "https://github.com/nrwl/nx/blob/master", + "name": "create-nx-workspace", + "description": "Smart, Fast and Extensible Build System", + "root": "/packages/create-nx-workspace", + "source": "/packages/create-nx-workspace/src", + "generators": [], + "executors": [] +} diff --git a/docs/generated/packages/cypress.json b/docs/generated/packages/cypress.json new file mode 100644 index 0000000000..94cd6f1739 --- /dev/null +++ b/docs/generated/packages/cypress.json @@ -0,0 +1,231 @@ +{ + "githubRoot": "https://github.com/nrwl/nx/blob/master", + "name": "cypress", + "description": "Cypress plugin for Nx", + "root": "/packages/cypress", + "source": "/packages/cypress/src", + "generators": [ + { + "name": "init", + "factory": "./src/generators/init/init#cypressInitGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxCypressInit", + "cli": "nx", + "title": "Add Cypress Configuration to the workspace", + "description": "Add Cypress Configuration to the workspace.", + "type": "object", + "properties": { + "skipPackageJson": { + "type": "boolean", + "default": false, + "description": "Do not add dependencies to `package.json`." + } + }, + "presets": [] + }, + "description": "Initialize the @nrwl/cypress plugin", + "aliases": ["ng-add"], + "hidden": true, + "implementation": "/packages/cypress/src/generators/init/init#cypressInitGenerator.ts", + "path": "/packages/cypress/src/generators/init/schema.json" + }, + { + "name": "cypress-project", + "factory": "./src/generators/cypress-project/cypress-project#cypressProjectGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxCypressProjectGeneratorSchema", + "cli": "nx", + "title": "Create Cypress Configuration for the workspace", + "description": "Create Cypress Configuration for the workspace.", + "type": "object", + "properties": { + "project": { + "type": "string", + "description": "The name of the frontend project to test.", + "$default": { "$source": "projectName" } + }, + "baseUrl": { + "type": "string", + "description": "The address (with the port) which your application is running on." + }, + "name": { + "type": "string", + "description": "Name of the E2E Project.", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the e2e project?" + }, + "directory": { + "type": "string", + "description": "A directory where the project is placed." + }, + "linter": { + "description": "The tool to use for running lint checks.", + "type": "string", + "enum": ["eslint", "tslint", "none"], + "default": "eslint" + }, + "js": { + "description": "Generate JavaScript files rather than TypeScript files.", + "type": "boolean", + "default": false + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + }, + "setParserOptionsProject": { + "type": "boolean", + "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.", + "default": false + }, + "standaloneConfig": { + "description": "Split the project configuration into `/project.json` rather than including it inside workspace.json.", + "type": "boolean" + }, + "skipPackageJson": { + "type": "boolean", + "default": false, + "description": "Do not add dependencies to `package.json`." + } + }, + "required": ["name"], + "presets": [] + }, + "description": "Add a Cypress E2E Project", + "hidden": true, + "implementation": "/packages/cypress/src/generators/cypress-project/cypress-project#cypressProjectGenerator.ts", + "aliases": [], + "path": "/packages/cypress/src/generators/cypress-project/schema.json" + } + ], + "executors": [ + { + "name": "cypress", + "implementation": "/packages/cypress/src/executors/cypress/cypress.impl.ts", + "schema": { + "title": "Cypress Target", + "description": "Cypress target option for Build Facade.", + "type": "object", + "outputCapture": "pipe", + "cli": "nx", + "properties": { + "cypressConfig": { + "type": "string", + "description": "The path of the Cypress configuration json file." + }, + "watch": { + "type": "boolean", + "description": "Recompile and run tests when files change.", + "default": false + }, + "tsConfig": { + "type": "string", + "description": "The path of the Cypress tsconfig configuration json file." + }, + "devServerTarget": { + "type": "string", + "description": "Dev server target to run tests against." + }, + "headed": { + "type": "boolean", + "description": "Displays the browser instead of running headlessly. Set this to `true` if your run depends on a Chrome extension being loaded.", + "default": false + }, + "headless": { + "type": "boolean", + "description": "Hide the browser instead of running headed (default for cypress run).", + "default": false, + "x-deprecated": true + }, + "exit": { + "type": "boolean", + "description": "Whether or not the Cypress Test Runner will stay open after running tests in a spec file.", + "default": true + }, + "key": { + "type": "string", + "description": "The key cypress should use to run tests in parallel/record the run (CI only)." + }, + "record": { + "type": "boolean", + "description": "Whether or not Cypress should record the results of the tests.", + "default": false + }, + "parallel": { + "type": "boolean", + "description": "Whether or not Cypress should run its tests in parallel (CI only).", + "default": false + }, + "baseUrl": { + "type": "string", + "description": "The address (with the port) which your application is running on." + }, + "browser": { + "type": "string", + "description": "The browser to run tests in." + }, + "env": { + "type": "object", + "description": "A key-value Pair of environment variables to pass to Cypress runner." + }, + "spec": { + "type": "string", + "description": "A comma delimited glob string that is provided to the Cypress runner to specify which spec files to run. i.e. `**examples/**,**actions.spec**`." + }, + "copyFiles": { + "type": "string", + "description": "A regex string that is used to choose what additional integration files to copy to the dist folder.", + "x-deprecated": true + }, + "ciBuildId": { + "oneOf": [{ "type": "string" }, { "type": "number" }], + "description": "A unique identifier for a run to enable grouping or parallelization." + }, + "group": { + "type": "string", + "description": "A named group for recorded runs in the Cypress dashboard." + }, + "ignoreTestFiles": { + "type": "string", + "description": "A String or Array of glob patterns used to ignore test files that would otherwise be shown in your list of tests. Cypress uses minimatch with the options: `{dot: true, matchBase: true}`. We suggest using https://globster.xyz to test what files would match." + }, + "reporter": { + "type": "string", + "description": "The reporter used during cypress run." + }, + "reporterOptions": { + "type": "string", + "description": "The reporter options used. Supported options depend on the reporter." + }, + "skipServe": { + "type": "boolean", + "description": "Skip dev-server build.", + "default": false + }, + "testingType": { + "type": "string", + "description": "Specify the type of tests to execute.", + "enum": ["component", "e2e"], + "default": "e2e" + }, + "tag": { + "type": "string", + "description": "A comma delimited list to identify a run with.", + "aliases": ["t"] + } + }, + "additionalProperties": true, + "required": ["cypressConfig"], + "presets": [] + }, + "hasher": "./src/executors/cypress/hasher", + "description": "Run Cypress e2e tests", + "aliases": [], + "hidden": false, + "path": "/packages/cypress/src/executors/cypress/schema.json" + } + ] +} diff --git a/docs/generated/packages/detox.json b/docs/generated/packages/detox.json new file mode 100644 index 0000000000..d8c26b5598 --- /dev/null +++ b/docs/generated/packages/detox.json @@ -0,0 +1,271 @@ +{ + "githubRoot": "https://github.com/nrwl/nx/blob/master", + "name": "detox", + "description": "Detox Plugin for Nx", + "root": "/packages/detox", + "source": "/packages/detox/src", + "generators": [ + { + "name": "init", + "factory": "./src/generators/init/init#detoxInitGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "title": "Add Detox Schematics", + "description": "Add Detox Schematics.", + "type": "object", + "properties": { + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + } + }, + "required": [], + "presets": [] + }, + "description": "Initialize the @nrwl/detox plugin", + "hidden": true, + "implementation": "/packages/detox/src/generators/init/init#detoxInitGenerator.ts", + "aliases": [], + "path": "/packages/detox/src/generators/init/schema.json" + }, + { + "name": "application", + "factory": "./src/generators/application/application#detoxApplicationGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "title": "Create Detox Configuration for the workspace", + "description": "Create Detox Configuration for the workspace.", + "type": "object", + "properties": { + "project": { + "type": "string", + "description": "The name of the frontend project to test.", + "$default": { "$source": "projectName" }, + "x-prompt": "What is the name of the frontend project to test?" + }, + "name": { + "type": "string", + "description": "Name of the E2E Project.", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the E2E project?" + }, + "directory": { + "type": "string", + "description": "A directory where the project is placed." + }, + "linter": { + "description": "The tool to use for running lint checks.", + "type": "string", + "enum": ["eslint", "tslint", "none"], + "default": "eslint" + }, + "js": { + "description": "Generate JavaScript files rather than TypeScript files.", + "type": "boolean", + "default": false + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + }, + "setParserOptionsProject": { + "type": "boolean", + "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.", + "default": false + } + }, + "required": ["name", "project"], + "presets": [] + }, + "aliases": ["app"], + "x-type": "application", + "description": "Create a detox application", + "implementation": "/packages/detox/src/generators/application/application#detoxApplicationGenerator.ts", + "hidden": false, + "path": "/packages/detox/src/generators/application/schema.json" + } + ], + "executors": [ + { + "name": "build", + "implementation": "/packages/detox/src/executors/build/build.impl.ts", + "schema": { + "title": "Run detox build", + "description": "Run detox build options.", + "type": "object", + "cli": "nx", + "properties": { + "detoxConfiguration": { + "type": "string", + "description": "Select a device configuration from your defined configurations, if not supplied, and there's only one configuration, detox will default to it.", + "alias": "C" + }, + "configPath": { + "type": "string", + "description": "Specify Detox config file path. If not supplied, detox searches for `.detoxrc[.js]` or `detox` section in `package.json`.", + "alias": "cp" + } + }, + "required": [], + "presets": [] + }, + "description": "Run the command defined in build property of the specified configuration.", + "aliases": [], + "hidden": false, + "path": "/packages/detox/src/executors/build/schema.json" + }, + { + "name": "test", + "implementation": "/packages/detox/src/executors/test/test.impl.ts", + "schema": { + "title": "Run detox test", + "description": "Run detox test options.", + "type": "object", + "cli": "nx", + "presets": [ + { + "name": "Run tests", + "keys": ["detoxConfiguration", "loglevel", "reuse"] + } + ], + "properties": { + "detoxConfiguration": { + "type": "string", + "description": "Select a device configuration from your defined configurations, if not supplied, and there's only one configuration, detox will default to it.", + "alias": "C", + "examples": [ + "ios.sim.debug", + "ios.sim.release", + "android.emu.debug", + "android.emu.release" + ] + }, + "buildTarget": { + "type": "string", + "description": "Target which builds the application." + }, + "configPath": { + "type": "string", + "description": "Specify Detox config file path. If not supplied, detox searches for `.detoxrc[.js]` or `detox` section in package.json.", + "alias": "cp" + }, + "runnerConfig": { + "type": "string", + "description": "Test runner config file, defaults to `e2e/mocha.opts` for mocha and `e2e/config.json` for Jest.", + "alias": "o" + }, + "deviceName": { + "type": "string", + "description": "Override the device name specified in a configuration. Useful for running a single build configuration on multiple devices.", + "alias": "n" + }, + "loglevel": { + "type": "string", + "enum": ["fatal", "error", "warn", "info", "verbose", "trace"], + "description": "Log level: `fatal`, `error`, `warn`, `info`, `verbose`, `trace`.", + "alias": "l" + }, + "debugSynchronization": { + "type": "boolean", + "description": "Customize how long an action/expectation can take to complete before Detox starts querying the app why it is busy. By default, the app status will be printed if the action takes more than 10s to complete.", + "alias": "d" + }, + "artifactsLocation": { + "type": "string", + "description": "Artifacts (logs, screenshots, etc) root directory.", + "alias": "a" + }, + "recordLogs": { + "type": "string", + "enum": ["failing", "all", "none"], + "description": "Save logs during each test to artifacts directory. Pass `failing` to save logs of failing tests only." + }, + "takeScreenshots": { + "type": "string", + "enum": ["manual", "failing", "all", "none"], + "description": "Save screenshots before and after each test to artifacts directory. Pass `failing` to save screenshots of failing tests only. " + }, + "recordVideos": { + "type": "string", + "enum": ["failing", "all", "none"], + "description": "Save screen recordings of each test to artifacts directory. Pass `failing` to save recordings of failing tests only." + }, + "recordPerformance": { + "type": "string", + "enum": ["all", "none"], + "description": "[iOS Only] Save Detox Instruments performance recordings of each test to artifacts directory." + }, + "recordTimeline": { + "type": "string", + "enum": ["all", "none"], + "description": "[Jest Only] Record tests and events timeline, for visual display on the `chrome://tracing` tool." + }, + "captureViewHierarchy": { + "type": "string", + "enum": ["enabled", "disabled"], + "description": "[iOS Only] Capture `*.uihierarchy` snapshots on view action errors and `device.captureViewHierarchy()` calls." + }, + "retries": { + "type": "number", + "description": "[Jest Circus Only] Re-spawn the test runner for individual failing suite files until they pass, or `` times at least." + }, + "reuse": { + "type": "boolean", + "description": "Reuse existing installed app (do not delete + reinstall) for a faster run." + }, + "cleanup": { + "type": "boolean", + "description": "Shutdown simulator when test is over, useful for CI scripts, to make sure detox exists cleanly with no residue" + }, + "workers": { + "type": "number", + "description": "Specifies number of workers the test runner should spawn, requires a test runner with parallel execution support (Detox CLI currently supports Jest)." + }, + "jestReportSpecs": { + "type": "boolean", + "description": "[Jest Only] Whether to output logs per each running spec, in real-time. By default, disabled with multiple workers." + }, + "headless": { + "type": "boolean", + "description": "Android Only] Launch Emulator in headless mode. Useful when running on CI." + }, + "gpu": { + "type": "boolean", + "description": "[Android Only] Launch Emulator with the specific `-gpu [gpu mode]` parameter." + }, + "deviceLaunchArgs": { + "type": "string", + "description": "A list of passthrough-arguments to use when (if) devices (Android emulator / iOS simulator) are launched by Detox." + }, + "appLaunchArgs": { + "type": "number", + "description": "Custom arguments to pass (through) onto the app every time it is launched." + }, + "noColor": { + "type": "boolean", + "description": "Disable colors in log output" + }, + "useCustomLogger": { + "type": "boolean", + "description": "Use Detox' custom console-logging implementation, for logging Detox (non-device) logs. Disabling will fallback to Node.js / test-runner's implementation (e.g. Jest / Mocha)." + }, + "forceAdbInstall": { + "type": "boolean", + "description": "Due to problems with the adb install command on Android, Detox resorts to a different scheme for install APK's. Setting true will disable that and force usage of `adb install`, instead." + }, + "inspectBrk": { + "type": "boolean", + "description": "Uses node's `--inspect-brk` flag to let users debug the jest/mocha test runner" + } + }, + "required": ["detoxConfiguration"] + }, + "description": "Initiating your detox test suite.", + "aliases": [], + "hidden": false, + "path": "/packages/detox/src/executors/test/schema.json" + } + ] +} diff --git a/docs/generated/packages/devkit.json b/docs/generated/packages/devkit.json new file mode 100644 index 0000000000..02992f19ae --- /dev/null +++ b/docs/generated/packages/devkit.json @@ -0,0 +1,9 @@ +{ + "githubRoot": "https://github.com/nrwl/nx/blob/master", + "name": "devkit", + "description": "Smart, Fast and Extensible Build System", + "root": "/packages/devkit", + "source": "/packages/devkit/src", + "generators": [], + "executors": [] +} diff --git a/docs/generated/packages/eslint-plugin-nx.json b/docs/generated/packages/eslint-plugin-nx.json new file mode 100644 index 0000000000..0c2c0302b6 --- /dev/null +++ b/docs/generated/packages/eslint-plugin-nx.json @@ -0,0 +1,9 @@ +{ + "githubRoot": "https://github.com/nrwl/nx/blob/master", + "name": "eslint-plugin-nx", + "description": "ESLint Plugin for Nx", + "root": "/packages/eslint-plugin-nx", + "source": "/packages/eslint-plugin-nx/src", + "generators": [], + "executors": [] +} diff --git a/docs/generated/packages/express.json b/docs/generated/packages/express.json new file mode 100644 index 0000000000..b098f89c6c --- /dev/null +++ b/docs/generated/packages/express.json @@ -0,0 +1,130 @@ +{ + "githubRoot": "https://github.com/nrwl/nx/blob/master", + "name": "express", + "description": "Express Plugin for Nx", + "root": "/packages/express", + "source": "/packages/express/src", + "generators": [ + { + "name": "init", + "factory": "./src/generators/init/init#initGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "$id": "NxExpressInit", + "title": "Init Express Plugin", + "description": "Init Express Plugin.", + "type": "object", + "properties": { + "unitTestRunner": { + "description": "Adds the specified unit test runner.", + "type": "string", + "enum": ["jest", "none"], + "default": "jest" + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + } + }, + "required": [], + "presets": [] + }, + "description": "Initialize the @nrwl/express plugin", + "aliases": ["ng-add"], + "hidden": true, + "implementation": "/packages/express/src/generators/init/init#initGenerator.ts", + "path": "/packages/express/src/generators/init/schema.json" + }, + { + "name": "application", + "factory": "./src/generators/application/application#applicationGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "$id": "SchematicsNxExpressApp", + "title": "Nx Application Options Schema", + "description": "Nx Application Options Schema.", + "type": "object", + "properties": { + "name": { + "description": "The name of the application.", + "type": "string", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the node application?", + "pattern": "^[a-zA-Z].*$" + }, + "directory": { + "description": "The directory of the new application.", + "type": "string" + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + }, + "skipPackageJson": { + "type": "boolean", + "default": false, + "description": "Do not add dependencies to `package.json`." + }, + "linter": { + "description": "The tool to use for running lint checks.", + "type": "string", + "enum": ["eslint", "tslint"], + "default": "eslint" + }, + "unitTestRunner": { + "type": "string", + "enum": ["jest", "none"], + "description": "Test runner to use for unit tests.", + "default": "jest" + }, + "tags": { + "type": "string", + "description": "Add tags to the application (used for linting)." + }, + "frontendProject": { + "type": "string", + "description": "Frontend project that needs to access this application. This sets up proxy configuration." + }, + "babelJest": { + "type": "boolean", + "description": "Use `babel` instead `ts-jest`.", + "default": false + }, + "pascalCaseFiles": { + "type": "boolean", + "description": "Use pascal case file names.", + "alias": "P", + "default": false + }, + "js": { + "type": "boolean", + "description": "Generate JavaScript files rather than TypeScript files.", + "default": false + }, + "standaloneConfig": { + "description": "Split the project configuration into `/project.json` rather than including it inside `workspace.json`.", + "type": "boolean" + }, + "setParserOptionsProject": { + "type": "boolean", + "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.", + "default": false + } + }, + "required": [], + "presets": [] + }, + "aliases": ["app"], + "x-type": "application", + "description": "Create an express application", + "implementation": "/packages/express/src/generators/application/application#applicationGenerator.ts", + "hidden": false, + "path": "/packages/express/src/generators/application/schema.json" + } + ], + "executors": [] +} diff --git a/docs/generated/packages/jest.json b/docs/generated/packages/jest.json new file mode 100644 index 0000000000..04f17da86f --- /dev/null +++ b/docs/generated/packages/jest.json @@ -0,0 +1,308 @@ +{ + "githubRoot": "https://github.com/nrwl/nx/blob/master", + "name": "jest", + "description": "Jest plugin for Nx", + "root": "/packages/jest", + "source": "/packages/jest/src", + "generators": [ + { + "name": "init", + "factory": "./src/generators/init/init#jestInitGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxJestInit", + "cli": "nx", + "title": "Jest init", + "description": "Add Jest Configuration to a workspace.", + "type": "object", + "properties": { + "babelJest": { + "type": "boolean", + "alias": "babel-jest", + "description": "Use `babel-jest` instead of `ts-jest`.", + "default": false + }, + "skipPackageJson": { + "type": "boolean", + "default": false, + "description": "Do not add dependencies to `package.json`." + } + }, + "required": [], + "presets": [] + }, + "description": "Initialize the @nrwl/jest plugin", + "aliases": ["ng-add"], + "hidden": true, + "implementation": "/packages/jest/src/generators/init/init#jestInitGenerator.ts", + "path": "/packages/jest/src/generators/init/schema.json" + }, + { + "name": "jest-project", + "factory": "./src/generators/jest-project/jest-project#jestProjectGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxJestProject", + "cli": "nx", + "title": "Add Jest Configuration to a project", + "description": "Add Jest Configuration to a project", + "type": "object", + "properties": { + "project": { + "type": "string", + "description": "The name of the project.", + "$default": { "$source": "projectName" } + }, + "skipSetupFile": { + "type": "boolean", + "description": "[Deprecated]: Skips the setup file required for angular. (Use `--setup-file`)", + "default": false, + "x-deprecated": true + }, + "setupFile": { + "type": "string", + "enum": ["none", "angular", "web-components"], + "description": "The setup file to be generated.", + "default": "none" + }, + "skipSerializers": { + "type": "boolean", + "description": "Skips the serializers required to snapshot angular templates.", + "default": false + }, + "supportTsx": { + "type": "boolean", + "description": "Setup `tsx` support.", + "default": false + }, + "testEnvironment": { + "type": "string", + "enum": ["jsdom", "node"], + "description": "The test environment for jest.", + "default": "jsdom" + }, + "compiler": { + "type": "string", + "enum": ["tsc", "babel", "swc"], + "description": "The compiler to use for source and tests.", + "default": "tsc" + }, + "babelJest": { + "type": "boolean", + "alias": "babel-jest", + "description": "Use `babel-jest` instead of `ts-jest` (Deprecated: Use `--compiler=babel` instead).", + "x-deprecated": true, + "default": false + }, + "skipFormat": { + "description": "Skip formatting files", + "type": "boolean", + "default": false + }, + "skipPackageJson": { + "type": "boolean", + "default": false, + "description": "Do not add dependencies to `package.json`." + } + }, + "required": [], + "presets": [] + }, + "description": "Add Jest configuration to a project", + "hidden": true, + "implementation": "/packages/jest/src/generators/jest-project/jest-project#jestProjectGenerator.ts", + "aliases": [], + "path": "/packages/jest/src/generators/jest-project/schema.json" + } + ], + "executors": [ + { + "name": "jest", + "implementation": "/packages/jest/src/executors/jest/jest.impl.ts", + "batchImplementation": "./src/executors/jest/jest.impl#batchJest", + "schema": { + "title": "Jest Builder", + "description": "Jest target options for Build Facade.", + "cli": "nx", + "type": "object", + "properties": { + "codeCoverage": { + "description": "Indicates that test coverage information should be collected and reported in the output. (https://jestjs.io/docs/cli#--coverageboolean)", + "type": "boolean", + "aliases": ["coverage"] + }, + "config": { + "description": "The path to a Jest config file specifying how to find and execute tests. If no `rootDir` is set in the config, the directory containing the config file is assumed to be the `rootDir` for the project. This can also be a JSON-encoded value which Jest will use as configuration.", + "type": "string" + }, + "clearCache": { + "description": "Deletes the Jest cache directory and then exits without running tests. Will delete Jest's default cache directory. _Note: clearing the cache will reduce performance_.", + "type": "boolean" + }, + "detectOpenHandles": { + "description": "Attempt to collect and print open handles preventing Jest from exiting cleanly (https://jestjs.io/docs/cli#--detectopenhandles)", + "type": "boolean" + }, + "logHeapUsage": { + "description": "Logs the heap usage after every test. Useful to debug memory leaks. Use together with --runInBand and --expose-gc in node.", + "type": "boolean" + }, + "detectLeaks": { + "description": "**EXPERIMENTAL**: Detect memory leaks in tests. After executing a test, it will try to garbage collect the global object used, and fail if it was leaked", + "type": "boolean" + }, + "jestConfig": { + "description": "The path of the Jest configuration. (https://jestjs.io/docs/en/configuration)", + "type": "string" + }, + "testFile": { + "description": "The name of the file to test.", + "type": "string" + }, + "tsConfig": { + "description": "The name of the Typescript configuration file. Set the tsconfig option in the jest config file. ", + "type": "string", + "x-deprecated": true + }, + "setupFile": { + "description": "The name of a setup file used by Jest. (use Jest config file https://jestjs.io/docs/en/configuration#setupfilesafterenv-array)", + "type": "string", + "x-deprecated": true + }, + "bail": { + "alias": "b", + "description": "Exit the test suite immediately after `n` number of failing tests. (https://jestjs.io/docs/cli#--bail)", + "oneOf": [{ "type": "number" }, { "type": "boolean" }] + }, + "ci": { + "description": "Whether to run Jest in continuous integration (CI) mode. This option is on by default in most popular CI environments. It will prevent snapshots from being written unless explicitly requested. (https://jestjs.io/docs/cli#--ci)", + "type": "boolean" + }, + "color": { + "alias": "colors", + "description": "Forces test results output color highlighting (even if `stdout` is not a TTY). Set to false if you would like to have no colors. (https://jestjs.io/docs/cli#--colors)", + "type": "boolean" + }, + "findRelatedTests": { + "description": "Find and run the tests that cover a comma separated list of source files that were passed in as arguments. (https://jestjs.io/docs/cli#--findrelatedtests-spaceseparatedlistofsourcefiles)", + "type": "string" + }, + "json": { + "description": "Prints the test results in `JSON`. This mode will send all other test output and user messages to `stderr`. (https://jestjs.io/docs/cli#--json)", + "type": "boolean" + }, + "maxWorkers": { + "alias": "w", + "description": "Specifies the maximum number of workers the worker-pool will spawn for running tests. This defaults to the number of the cores available on your machine. Useful for CI. (its usually best not to override this default) (https://jestjs.io/docs/cli#--maxworkersnumstring)", + "oneOf": [{ "type": "number" }, { "type": "string" }] + }, + "onlyChanged": { + "alias": "o", + "description": "Attempts to identify which tests to run based on which files have changed in the current repository. Only works if you're running tests in a `git` or `hg` repository at the moment. (https://jestjs.io/docs/cli#--onlychanged)", + "type": "boolean" + }, + "changedSince": { + "description": "Runs tests related to the changes since the provided branch or commit hash. If the current branch has diverged from the given branch, then only changes made locally will be tested. (https://jestjs.io/docs/cli#--changedsince)", + "type": "string" + }, + "outputFile": { + "description": "Write test results to a file when the `--json` option is also specified. (https://jestjs.io/docs/cli#--outputfilefilename)", + "type": "string" + }, + "passWithNoTests": { + "description": "Will not fail if no tests are found (for example while using `--testPathPattern`.) (https://jestjs.io/docs/cli#--passwithnotests)", + "type": "boolean" + }, + "runInBand": { + "alias": "i", + "description": "Run all tests serially in the current process (rather than creating a worker pool of child processes that run tests). This is sometimes useful for debugging, but such use cases are pretty rare. Useful for CI. (https://jestjs.io/docs/cli#--runinband)", + "type": "boolean" + }, + "showConfig": { + "description": "Print your Jest config and then exits. (https://jestjs.io/docs/en/cli#--showconfig)", + "type": "boolean" + }, + "silent": { + "description": "Prevent tests from printing messages through the console. (https://jestjs.io/docs/cli#--silent)", + "type": "boolean" + }, + "testNamePattern": { + "alias": "t", + "description": "Run only tests with a name that matches the regex pattern. (https://jestjs.io/docs/cli#--testnamepatternregex)", + "type": "string" + }, + "testPathIgnorePatterns": { + "description": "An array of regexp pattern strings that is matched against all tests paths before executing the test. Only run those tests with a path that does not match with the provided regexp expressions. (https://jestjs.io/docs/cli#--testpathignorepatternsregexarray)", + "type": "array", + "items": { "type": "string" } + }, + "testPathPattern": { + "description": "An array of regexp pattern strings that is matched against all tests paths before executing the test. (https://jestjs.io/docs/cli#--testpathpatternregex)", + "type": "array", + "items": { "type": "string" }, + "default": [] + }, + "colors": { + "description": "Forces test results output highlighting even if stdout is not a TTY. (https://jestjs.io/docs/cli#--colors)", + "type": "boolean" + }, + "reporters": { + "description": "Run tests with specified reporters. Reporter options are not available via CLI. Example with multiple reporters: `jest --reporters=\"default\" --reporters=\"jest-junit\"`. (https://jestjs.io/docs/cli#--reporters)", + "type": "array", + "items": { "type": "string" } + }, + "verbose": { + "description": "Display individual test results with the test suite hierarchy. (https://jestjs.io/docs/cli#--verbose)", + "type": "boolean" + }, + "coverageReporters": { + "description": "A list of reporter names that Jest uses when writing coverage reports. Any istanbul reporter.", + "type": "array", + "items": { "type": "string" } + }, + "coverageDirectory": { + "description": "The directory where Jest should output its coverage files.", + "type": "string" + }, + "testResultsProcessor": { + "description": "Node module that implements a custom results processor. (https://jestjs.io/docs/en/configuration#testresultsprocessor-string)", + "type": "string" + }, + "updateSnapshot": { + "alias": "u", + "description": "Use this flag to re-record snapshots. Can be used together with a test suite pattern or with `--testNamePattern` to re-record snapshot for test matching the pattern. (https://jestjs.io/docs/cli#--updatesnapshot)", + "type": "boolean" + }, + "useStderr": { + "description": "Divert all output to stderr.", + "type": "boolean" + }, + "watch": { + "description": "Watch files for changes and rerun tests related to changed files. If you want to re-run all tests when a file has changed, use the `--watchAll` option. (https://jestjs.io/docs/cli#--watch)", + "type": "boolean" + }, + "watchAll": { + "description": "Watch files for changes and rerun all tests when something changes. If you want to re-run only the tests that depend on the changed files, use the `--watch` option. (https://jestjs.io/docs/cli#--watchall)", + "type": "boolean" + }, + "testLocationInResults": { + "description": "Adds a location field to test results. Used to report location of a test in a reporter. { \"column\": 4, \"line\": 5 } (https://jestjs.io/docs/cli#--testlocationinresults)", + "type": "boolean" + }, + "testTimeout": { + "description": "Default timeout of a test in milliseconds. Default value: `5000`. (https://jestjs.io/docs/cli#--testtimeoutnumber)", + "default": 5000, + "type": "number" + } + }, + "required": ["jestConfig"], + "presets": [] + }, + "hasher": "./src/executors/jest/hasher", + "description": "Run Jest unit tests", + "aliases": [], + "hidden": false, + "path": "/packages/jest/src/executors/jest/schema.json" + } + ] +} diff --git a/docs/generated/packages/js.json b/docs/generated/packages/js.json new file mode 100644 index 0000000000..198a52e61b --- /dev/null +++ b/docs/generated/packages/js.json @@ -0,0 +1,450 @@ +{ + "githubRoot": "https://github.com/nrwl/nx/blob/master", + "name": "js", + "description": "JavaScript Plugin for Nx", + "root": "/packages/js", + "source": "/packages/js/src", + "generators": [ + { + "name": "library", + "factory": "./src/generators/library/library#libraryGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxTypescriptLibrary", + "cli": "nx", + "title": "Create a TypeScript Library", + "description": "Create a TypeScript Library.", + "type": "object", + "examples": [ + { + "command": "nx g lib mylib --directory=myapp", + "description": "Generate libs/myapp/mylib" + } + ], + "properties": { + "name": { + "type": "string", + "description": "Library name.", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the library?", + "pattern": "^[a-zA-Z].*$" + }, + "directory": { + "type": "string", + "description": "A directory where the lib is placed." + }, + "linter": { + "description": "The tool to use for running lint checks.", + "type": "string", + "enum": ["eslint", "none"], + "default": "eslint" + }, + "unitTestRunner": { + "type": "string", + "enum": ["jest", "none"], + "description": "Test runner to use for unit tests.", + "default": "jest" + }, + "tags": { + "type": "string", + "description": "Add tags to the library (used for linting)." + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + }, + "skipTsConfig": { + "type": "boolean", + "description": "Do not update tsconfig.json for development experience.", + "default": false + }, + "testEnvironment": { + "type": "string", + "enum": ["jsdom", "node"], + "description": "The test environment to use if unitTestRunner is set to jest.", + "default": "jsdom" + }, + "importPath": { + "type": "string", + "description": "The library name used to import it, like @myorg/my-awesome-lib." + }, + "pascalCaseFiles": { + "type": "boolean", + "description": "Use pascal case file names.", + "alias": "P", + "default": false + }, + "js": { + "type": "boolean", + "description": "Generate JavaScript files rather than TypeScript files.", + "default": false + }, + "strict": { + "type": "boolean", + "description": "Whether to enable tsconfig strict mode or not.", + "default": true + }, + "publishable": { + "type": "boolean", + "default": false, + "description": "Generate a publishable library." + }, + "buildable": { + "type": "boolean", + "default": true, + "description": "Generate a buildable library." + }, + "setParserOptionsProject": { + "type": "boolean", + "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.", + "default": false + }, + "config": { + "type": "string", + "enum": ["workspace", "project", "npm-scripts"], + "default": "project", + "description": "Determines whether the project's executors should be configured in `workspace.json`, `project.json` or as npm scripts." + }, + "compiler": { + "type": "string", + "enum": ["tsc", "swc"], + "default": "tsc", + "description": "The compiler used by the build and test targets" + }, + "skipTypeCheck": { + "type": "boolean", + "description": "Whether to skip TypeScript type checking for SWC compiler.", + "default": false + } + }, + "required": ["name"], + "presets": [] + }, + "aliases": ["lib"], + "x-type": "library", + "description": "Create a library", + "implementation": "/packages/js/src/generators/library/library#libraryGenerator.ts", + "hidden": false, + "path": "/packages/js/src/generators/library/schema.json" + }, + { + "name": "convert-to-swc", + "factory": "./src/generators/convert-to-swc/convert-to-swc#convertToSwcGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxTypescriptLibrary", + "cli": "nx", + "title": "Convert a TSC library to SWC", + "description": "Convert a TSC library to SWC.", + "type": "object", + "examples": [ + { + "command": "nx g swc mylib", + "description": "Convert `libs/myapp/mylib` to SWC." + } + ], + "properties": { + "project": { + "type": "string", + "description": "Library name.", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the library?", + "pattern": "^[a-zA-Z].*$" + }, + "targets": { + "type": "array", + "description": "List of targets to convert.", + "items": { "type": "string", "description": "Target to convert." }, + "default": ["build"] + } + }, + "required": ["project"], + "presets": [] + }, + "aliases": ["swc"], + "x-type": "library", + "description": "Convert a tsc library to swc", + "implementation": "/packages/js/src/generators/convert-to-swc/convert-to-swc#convertToSwcGenerator.ts", + "hidden": false, + "path": "/packages/js/src/generators/convert-to-swc/schema.json" + } + ], + "executors": [ + { + "name": "tsc", + "implementation": "/packages/js/src/executors/tsc/tsc.impl.ts", + "schema": { + "title": "Typescript Build Target", + "description": "Builds using TypeScript.", + "cli": "nx", + "type": "object", + "properties": { + "main": { + "type": "string", + "description": "The name of the main entry-point file." + }, + "outputPath": { + "type": "string", + "description": "The output path of the generated files." + }, + "tsConfig": { + "type": "string", + "description": "The path to the Typescript configuration file." + }, + "assets": { + "type": "array", + "description": "List of static assets.", + "default": [], + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "glob": { + "type": "string", + "description": "The pattern to match." + }, + "input": { + "type": "string", + "description": "The input directory path in which to apply 'glob'. Defaults to the project root." + }, + "ignore": { + "description": "An array of globs to ignore.", + "type": "array", + "items": { "type": "string" } + }, + "output": { + "type": "string", + "description": "Absolute path within the output." + } + }, + "additionalProperties": false, + "required": ["glob", "input", "output"] + }, + { "type": "string" } + ] + } + }, + "watch": { + "type": "boolean", + "description": "Enable re-building when files change.", + "default": false + }, + "transformers": { + "type": "array", + "description": "List of TypeScript Transformer Plugins.", + "default": [], + "items": { + "oneOf": [ + { "type": "string" }, + { + "type": "object", + "properties": { + "name": { "type": "string" }, + "options": { + "type": "object", + "additionalProperties": true + } + }, + "additionalProperties": false, + "required": ["name"] + } + ] + } + }, + "updateBuildableProjectDepsInPackageJson": { + "type": "boolean", + "description": "Whether to update the buildable project dependencies in `package.json`.", + "default": true + }, + "buildableProjectDepsInPackageJsonType": { + "type": "string", + "description": "When `updateBuildableProjectDepsInPackageJson` is `true`, this adds dependencies to either `peerDependencies` or `dependencies`.", + "enum": ["dependencies", "peerDependencies"], + "default": "peerDependencies" + } + }, + "required": ["main", "outputPath", "tsConfig"], + "definitions": { + "assetPattern": { + "oneOf": [ + { + "type": "object", + "properties": { + "glob": { + "type": "string", + "description": "The pattern to match." + }, + "input": { + "type": "string", + "description": "The input directory path in which to apply 'glob'. Defaults to the project root." + }, + "ignore": { + "description": "An array of globs to ignore.", + "type": "array", + "items": { "type": "string" } + }, + "output": { + "type": "string", + "description": "Absolute path within the output." + } + }, + "additionalProperties": false, + "required": ["glob", "input", "output"] + }, + { "type": "string" } + ] + }, + "transformerPattern": { + "oneOf": [ + { "type": "string" }, + { + "type": "object", + "properties": { + "name": { "type": "string" }, + "options": { "type": "object", "additionalProperties": true } + }, + "additionalProperties": false, + "required": ["name"] + } + ] + } + }, + "presets": [] + }, + "description": "Build a project using TypeScript.", + "aliases": [], + "hidden": false, + "path": "/packages/js/src/executors/tsc/schema.json" + }, + { + "name": "swc", + "implementation": "/packages/js/src/executors/swc/swc.impl.ts", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "title": "Typescript Build Target", + "description": "Builds using SWC.", + "type": "object", + "properties": { + "main": { + "type": "string", + "description": "The name of the main entry-point file." + }, + "outputPath": { + "type": "string", + "description": "The output path of the generated files." + }, + "tsConfig": { + "type": "string", + "description": "The path to the Typescript configuration file." + }, + "assets": { + "type": "array", + "description": "List of static assets.", + "default": [], + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "glob": { + "type": "string", + "description": "The pattern to match." + }, + "input": { + "type": "string", + "description": "The input directory path in which to apply 'glob'. Defaults to the project root." + }, + "ignore": { + "description": "An array of globs to ignore.", + "type": "array", + "items": { "type": "string" } + }, + "output": { + "type": "string", + "description": "Absolute path within the output." + } + }, + "additionalProperties": false, + "required": ["glob", "input", "output"] + }, + { "type": "string" } + ] + } + }, + "watch": { + "type": "boolean", + "description": "Enable re-building when files change.", + "default": false + }, + "skipTypeCheck": { + "type": "boolean", + "description": "Whether to skip TypeScript type checking.", + "default": false + }, + "swcExclude": { + "type": "array", + "description": "List of SWC Glob/Regex to be excluded from compilation (https://swc.rs/docs/configuration/compilation#exclude).", + "default": [ + "./src/**/.*.spec.ts$", + "./**/.*.spec.ts$", + "./src/**/jest-setup.ts$", + "./**/jest-setup.ts$", + "./**/.*.js$" + ] + }, + "updateBuildableProjectDepsInPackageJson": { + "type": "boolean", + "description": "Whether to update the buildable project dependencies in `package.json`.", + "default": true + }, + "buildableProjectDepsInPackageJsonType": { + "type": "string", + "description": "When `updateBuildableProjectDepsInPackageJson` is `true`, this adds dependencies to either `peerDependencies` or `dependencies`.", + "enum": ["dependencies", "peerDependencies"], + "default": "peerDependencies" + } + }, + "required": ["main", "outputPath", "tsConfig"], + "definitions": { + "assetPattern": { + "oneOf": [ + { + "type": "object", + "properties": { + "glob": { + "type": "string", + "description": "The pattern to match." + }, + "input": { + "type": "string", + "description": "The input directory path in which to apply 'glob'. Defaults to the project root." + }, + "ignore": { + "description": "An array of globs to ignore.", + "type": "array", + "items": { "type": "string" } + }, + "output": { + "type": "string", + "description": "Absolute path within the output." + } + }, + "additionalProperties": false, + "required": ["glob", "input", "output"] + }, + { "type": "string" } + ] + } + }, + "presets": [] + }, + "description": "Build a project using SWC", + "aliases": [], + "hidden": false, + "path": "/packages/js/src/executors/swc/schema.json" + } + ] +} diff --git a/docs/generated/packages/linter.json b/docs/generated/packages/linter.json new file mode 100644 index 0000000000..5c762ae657 --- /dev/null +++ b/docs/generated/packages/linter.json @@ -0,0 +1,298 @@ +{ + "githubRoot": "https://github.com/nrwl/nx/blob/master", + "name": "linter", + "description": "Lint Plugin for Nx", + "root": "/packages/linter", + "source": "/packages/linter/src", + "generators": [ + { + "name": "workspace-rules-project", + "factory": "./src/generators/workspace-rules-project/workspace-rules-project#lintWorkspaceRulesProjectGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxWorkspaceRulesProject", + "cli": "nx", + "title": "Create the Workspace Lint Rules Project", + "description": "Create the Workspace Lint Rules Project.", + "type": "object", + "examples": [ + { + "command": "nx g @nrwl/linter:workspace-rules-project", + "description": "Create the Workspace Lint Rules Project" + } + ], + "properties": {}, + "required": [], + "presets": [] + }, + "description": "Create the Workspace Lint Rules Project", + "hidden": true, + "implementation": "/packages/linter/src/generators/workspace-rules-project/workspace-rules-project#lintWorkspaceRulesProjectGenerator.ts", + "aliases": [], + "path": "/packages/linter/src/generators/workspace-rules-project/schema.json" + }, + { + "name": "workspace-rule", + "factory": "./src/generators/workspace-rule/workspace-rule#lintWorkspaceRuleGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxWorkspaceRule", + "cli": "nx", + "title": "Create a new Workspace Lint Rule", + "description": "Create a new Workspace Lint Rule.", + "type": "object", + "examples": [ + { + "command": "nx g @nrwl/linter:workspace-rule my-custom-rule", + "description": "Create a new workspace lint rule called my-custom-rule" + }, + { + "command": "nx g @nrwl/linter:workspace-rule --name=my-custom-rule --directory=a/b/c", + "description": "Create a new workspace lint rule located at `tools/eslint-rules/a/b/c/my-custom-rule.ts`" + } + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the new rule.", + "$default": { "$source": "argv", "index": 0 } + }, + "directory": { + "type": "string", + "description": "Create the rule under this directory within `tools/eslint-rules/` (can be nested).", + "alias": "dir", + "default": "rules" + } + }, + "required": ["name", "directory"], + "presets": [] + }, + "description": "Create a new workspace ESLint rule", + "implementation": "/packages/linter/src/generators/workspace-rule/workspace-rule#lintWorkspaceRuleGenerator.ts", + "aliases": [], + "hidden": false, + "path": "/packages/linter/src/generators/workspace-rule/schema.json" + } + ], + "executors": [ + { + "name": "lint", + "implementation": "/packages/linter/src/executors/lint/lint.impl.ts", + "schema": { + "$schema": "http://json-schema.org/schema", + "title": "Lint Target", + "description": "Linter.", + "cli": "nx", + "type": "object", + "properties": { + "linter": { + "description": "The tool to use for running lint checks.", + "type": "string", + "enum": ["eslint", "tslint"], + "default": "eslint" + }, + "config": { + "type": "string", + "description": "The name of the configuration file." + }, + "tsConfig": { + "description": "The name of the TypeScript configuration file.", + "oneOf": [ + { "type": "string" }, + { "type": "array", "items": { "type": "string" } } + ] + }, + "format": { + "type": "string", + "description": "ESLint Output formatter (https://eslint.org/docs/user-guide/formatters).", + "default": "stylish", + "anyOf": [ + { + "enum": [ + "stylish", + "compact", + "codeframe", + "unix", + "visualstudio", + "table", + "checkstyle", + "html", + "jslint-xml", + "json", + "json-with-metadata", + "junit", + "tap" + ] + }, + { "minLength": 1 } + ] + }, + "exclude": { + "type": "array", + "description": "Files to exclude from linting.", + "default": [], + "items": { "type": "string" } + }, + "files": { + "type": "array", + "description": "Files to include in linting.", + "default": [], + "items": { "type": "string" } + }, + "force": { + "type": "boolean", + "description": "Succeeds even if there was linting errors.", + "default": false + }, + "silent": { + "type": "boolean", + "description": "Hide output text.", + "default": false + }, + "fix": { + "type": "boolean", + "description": "Fixes linting errors (may overwrite linted files).", + "default": false + }, + "cache": { + "type": "boolean", + "description": "Only check changed files.", + "default": false + }, + "cacheLocation": { + "type": "string", + "description": "Path to the cache file or directory." + }, + "outputFile": { + "type": "string", + "description": "File to write report to." + }, + "maxWarnings": { + "type": "number", + "description": "Number of warnings to trigger nonzero exit code - default: `-1`.", + "default": -1 + }, + "quiet": { + "type": "boolean", + "description": "Report errors only - default: `false`.", + "default": false + } + }, + "additionalProperties": false, + "required": ["linter"], + "presets": [] + }, + "description": "**[DEPRECATED]**: Please use the eslint builder instead, an automated migration was provided in v10.3.0", + "aliases": [], + "hidden": false, + "path": "/packages/linter/src/executors/lint/schema.json" + }, + { + "name": "eslint", + "implementation": "/packages/linter/src/executors/eslint/lint.impl.ts", + "schema": { + "$schema": "http://json-schema.org/schema", + "title": "ESLint Lint Target", + "description": "ESLint Lint Target.", + "cli": "nx", + "type": "object", + "properties": { + "eslintConfig": { + "type": "string", + "description": "The name of the ESLint configuration file." + }, + "lintFilePatterns": { + "type": "array", + "description": "One or more files/dirs/globs to pass directly to ESLint's `lintFiles()` method.", + "default": [], + "items": { "type": "string" } + }, + "format": { + "type": "string", + "description": "ESLint Output formatter (https://eslint.org/docs/user-guide/formatters).", + "default": "stylish", + "anyOf": [ + { + "enum": [ + "stylish", + "compact", + "codeframe", + "unix", + "visualstudio", + "table", + "checkstyle", + "html", + "jslint-xml", + "json", + "json-with-metadata", + "junit", + "tap" + ] + }, + { "minLength": 1 } + ] + }, + "force": { + "type": "boolean", + "description": "Succeeds even if there was linting errors.", + "default": false + }, + "silent": { + "type": "boolean", + "description": "Hide output text.", + "default": false + }, + "fix": { + "type": "boolean", + "description": "Fixes linting errors (may overwrite linted files).", + "default": false + }, + "cache": { + "type": "boolean", + "description": "Only check changed files.", + "default": false + }, + "cacheLocation": { + "type": "string", + "description": "Path to the cache file or directory." + }, + "outputFile": { + "type": "string", + "description": "File to write report to." + }, + "maxWarnings": { + "type": "number", + "description": "Number of warnings to trigger nonzero exit code - default: `-1`.", + "default": -1 + }, + "quiet": { + "type": "boolean", + "description": "Report errors only - default: `false`.", + "default": false + }, + "ignorePath": { + "type": "string", + "description": "The path of the `.eslintignore` file." + }, + "noEslintrc": { + "type": "boolean", + "description": "The equivalent of the `--no-eslintrc` flag on the ESLint CLI, it is `false` by default.", + "default": false + }, + "hasTypeAwareRules": { + "type": "boolean", + "description": "When set to `true`, the linter will invalidate its cache when any of its dependencies changes." + } + }, + "additionalProperties": false, + "required": ["lintFilePatterns"], + "presets": [] + }, + "hasher": "./src/executors/eslint/hasher", + "description": "Run ESLint on a project", + "aliases": [], + "hidden": false, + "path": "/packages/linter/src/executors/eslint/schema.json" + } + ] +} diff --git a/docs/generated/packages/make-angular-cli-faster.json b/docs/generated/packages/make-angular-cli-faster.json new file mode 100644 index 0000000000..4f56ba5279 --- /dev/null +++ b/docs/generated/packages/make-angular-cli-faster.json @@ -0,0 +1,9 @@ +{ + "githubRoot": "https://github.com/nrwl/nx/blob/master", + "name": "make-angular-cli-faster", + "description": "Make Angular CLI faster by enabling distributed computation caching", + "root": "/packages/make-angular-cli-faster", + "source": "/packages/make-angular-cli-faster/src", + "generators": [], + "executors": [] +} diff --git a/docs/generated/packages/nest.json b/docs/generated/packages/nest.json new file mode 100644 index 0000000000..dc892d51aa --- /dev/null +++ b/docs/generated/packages/nest.json @@ -0,0 +1,1251 @@ +{ + "githubRoot": "https://github.com/nrwl/nx/blob/master", + "name": "nest", + "description": "Nest Plugin for Nx", + "root": "/packages/nest", + "source": "/packages/nest/src", + "generators": [ + { + "name": "application", + "factory": "./src/generators/application/application", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxNestApplicationGenerator", + "title": "Nx Application Options Schema", + "description": "Nx Application Options Schema", + "cli": "nx", + "type": "object", + "properties": { + "name": { + "description": "The name of the application.", + "type": "string", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the node application?" + }, + "directory": { + "description": "The directory of the new application.", + "type": "string" + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + }, + "skipPackageJson": { + "description": "Do not add dependencies to `package.json`.", + "type": "boolean", + "default": false + }, + "linter": { + "description": "The tool to use for running lint checks.", + "type": "string", + "enum": ["eslint", "none"], + "default": "eslint" + }, + "unitTestRunner": { + "description": "Test runner to use for unit tests.", + "type": "string", + "enum": ["jest", "none"], + "default": "jest" + }, + "tags": { + "description": "Add tags to the application (used for linting).", + "type": "string" + }, + "frontendProject": { + "description": "Frontend project that needs to access this application. This sets up proxy configuration.", + "type": "string" + }, + "standaloneConfig": { + "description": "Split the project configuration into `/project.json` rather than including it inside `workspace.json`.", + "type": "boolean" + }, + "setParserOptionsProject": { + "type": "boolean", + "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.", + "default": false + } + }, + "additionalProperties": false, + "required": ["name"], + "presets": [] + }, + "aliases": ["app"], + "x-type": "application", + "description": "Create a NestJS application.", + "implementation": "/packages/nest/src/generators/application/application.ts", + "hidden": false, + "path": "/packages/nest/src/generators/application/schema.json" + }, + { + "name": "convert-tslint-to-eslint", + "factory": "./src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint#conversionGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "nest-convert-tslint-to-eslint", + "cli": "nx", + "title": "Convert a NestJS project from TSLint to ESLint", + "description": "Convert a NestJS project from TSLint to ESLint. \n_NOTE: Does not work in `--dry-run` mode_.", + "examples": [ + { + "command": "nx g convert-tslint-to-eslint myapp", + "description": "Convert the NestJS project `myapp` from TSLint to ESLint" + } + ], + "type": "object", + "properties": { + "project": { + "description": "The name of the NestJS project to convert.", + "type": "string", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "Which NestJS project would you like to convert from TSLint to ESLint?" + }, + "ignoreExistingTslintConfig": { + "description": "If true we will not use existing TSLint config as a reference, we will just reset the project with the latest recommended ESLint config.", + "type": "boolean", + "default": false, + "x-prompt": "Would you like to ignore the existing TSLint config? Recommended if the TSLint config has not been altered much as it makes the new ESLint config cleaner." + }, + "removeTSLintIfNoMoreTSLintTargets": { + "description": "If this conversion leaves no more TSLint usage in the workspace, it will remove TSLint and related dependencies and configuration.", + "type": "boolean", + "default": true, + "x-prompt": "Would you like to remove TSLint and its related config if there are no TSLint projects remaining after this conversion?" + }, + "skipFormat": { + "type": "boolean", + "description": "Skip formatting files.", + "default": false + } + }, + "required": ["project"], + "presets": [] + }, + "description": "Convert a project from TSLint to ESLint.", + "implementation": "/packages/nest/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint#conversionGenerator.ts", + "aliases": [], + "hidden": false, + "path": "/packages/nest/src/generators/convert-tslint-to-eslint/schema.json" + }, + { + "name": "init", + "factory": "./src/generators/init/init", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxNestInitGenerator", + "title": "Init Nest Plugin", + "description": "Init Nest Plugin.", + "cli": "nx", + "type": "object", + "properties": { + "unitTestRunner": { + "description": "Adds the specified unit test runner.", + "type": "string", + "enum": ["jest", "none"], + "default": "jest" + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + } + }, + "additionalProperties": false, + "required": [], + "presets": [] + }, + "description": "Initialize the @nrwl/nest plugin.", + "aliases": ["ng-add"], + "hidden": true, + "implementation": "/packages/nest/src/generators/init/init.ts", + "path": "/packages/nest/src/generators/init/schema.json" + }, + { + "name": "library", + "factory": "./src/generators/library/library", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxNestLibraryGenerator", + "title": "Create a NestJS Library for Nx", + "description": "Create a NestJS Library for Nx.", + "cli": "nx", + "type": "object", + "examples": [ + { + "command": "nx g lib mylib --directory=myapp", + "description": "Generate libs/myapp/mylib" + } + ], + "properties": { + "name": { + "description": "Library name.", + "type": "string", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the library?" + }, + "directory": { + "description": "A directory where the library is placed.", + "type": "string", + "alias": "dir" + }, + "linter": { + "description": "The tool to use for running lint checks.", + "type": "string", + "enum": ["eslint", "none"], + "default": "eslint" + }, + "unitTestRunner": { + "description": "Test runner to use for unit tests.", + "type": "string", + "enum": ["jest", "none"], + "default": "jest" + }, + "tags": { + "description": "Add tags to the library (used for linting).", + "type": "string", + "alias": "t" + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + }, + "skipTsConfig": { + "description": "Do not update tsconfig.base.json for development experience.", + "type": "boolean", + "default": false + }, + "publishable": { + "description": "Create a publishable library.", + "type": "boolean" + }, + "buildable": { + "description": "Generate a buildable library.", + "type": "boolean", + "default": false + }, + "importPath": { + "description": "The library name used to import it, like @myorg/my-awesome-lib. Must be a valid npm name.", + "type": "string" + }, + "global": { + "description": "Add the Global decorator to the generated module.", + "type": "boolean", + "default": false + }, + "service": { + "description": "Include a service with the library.", + "type": "boolean", + "default": false + }, + "controller": { + "description": "Include a controller with the library.", + "type": "boolean", + "default": false + }, + "testEnvironment": { + "description": "The test environment for jest, for node applications this should stay as node unless doing DOM testing.", + "type": "string", + "enum": ["jsdom", "node"], + "default": "node" + }, + "target": { + "description": "The ES target, Nest suggest using es6 or higher.", + "type": "string", + "default": "es6", + "enum": [ + "es5", + "es6", + "esnext", + "es2015", + "es2016", + "es2017", + "es2018", + "es2019", + "es2020" + ] + }, + "strict": { + "description": "Whether to enable tsconfig strict mode or not.", + "type": "boolean", + "default": false + }, + "standaloneConfig": { + "description": "Split the project configuration into /project.json rather than including it inside workspace.json", + "type": "boolean", + "default": true + }, + "setParserOptionsProject": { + "type": "boolean", + "description": "Whether or not to configure the ESLint \"parserOptions.project\" option. We do not do this by default for lint performance reasons.", + "default": false + } + }, + "additionalProperties": false, + "required": ["name"], + "presets": [] + }, + "aliases": ["lib"], + "x-type": "library", + "description": "Create a new NestJS library.", + "implementation": "/packages/nest/src/generators/library/library.ts", + "hidden": false, + "path": "/packages/nest/src/generators/library/schema.json" + }, + { + "name": "class", + "factory": "./src/generators/class/class", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxNestClassGenerator", + "title": "Nest Class Options Schema", + "description": "Nest Class Options Schema.", + "cli": "nx", + "type": "object", + "properties": { + "name": { + "description": "The name of the class.", + "type": "string", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use?" + }, + "project": { + "description": "The Nest project to target.", + "type": "string", + "$default": { "$source": "projectName" }, + "alias": "p", + "x-prompt": "What Nest project would you like to target?" + }, + "directory": { + "description": "Directory where the generated files are placed.", + "type": "string", + "aliases": ["dir", "path"] + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + }, + "unitTestRunner": { + "description": "Test runner to use for unit tests.", + "type": "string", + "enum": ["jest", "none"], + "default": "jest" + }, + "flat": { + "description": "Flag to indicate if a directory is created.", + "type": "boolean", + "default": true + }, + "language": { + "description": "Nest class language.", + "type": "string", + "enum": ["js", "ts"] + } + }, + "additionalProperties": false, + "required": ["name", "project"], + "presets": [] + }, + "description": "Run the `class` NestJS generator with Nx project support.", + "implementation": "/packages/nest/src/generators/class/class.ts", + "aliases": [], + "hidden": false, + "path": "/packages/nest/src/generators/class/schema.json" + }, + { + "name": "controller", + "factory": "./src/generators/controller/controller", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxNestControllerGenerator", + "title": "Nest Controller Options Schema", + "description": "Nest Controller Options Schema.", + "cli": "nx", + "type": "object", + "properties": { + "name": { + "description": "The name of the controller.", + "type": "string", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use?" + }, + "project": { + "description": "The Nest project to target.", + "type": "string", + "$default": { "$source": "projectName" }, + "alias": "p", + "x-prompt": "What Nest project would you like to target?" + }, + "directory": { + "description": "Directory where the generated files are placed.", + "type": "string", + "aliases": ["dir", "path"] + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + }, + "unitTestRunner": { + "description": "Test runner to use for unit tests.", + "type": "string", + "enum": ["jest", "none"], + "default": "jest" + }, + "flat": { + "description": "Flag to indicate if a directory is created.", + "type": "boolean", + "default": false + }, + "language": { + "description": "Nest controller language.", + "type": "string", + "enum": ["js", "ts"] + }, + "skipImport": { + "description": "Flag to skip the module import.", + "type": "boolean", + "default": false + }, + "module": { + "description": "Allows specification of the declaring module.", + "type": "string" + } + }, + "additionalProperties": false, + "required": ["name", "project"], + "presets": [] + }, + "description": "Run the `controller` NestJS generator with Nx project support.", + "implementation": "/packages/nest/src/generators/controller/controller.ts", + "aliases": [], + "hidden": false, + "path": "/packages/nest/src/generators/controller/schema.json" + }, + { + "name": "decorator", + "factory": "./src/generators/decorator/decorator", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxNestDecoratorGenerator", + "title": "Nest Decorator Options Schema", + "description": "Nest Decorator Options Schema.", + "cli": "nx", + "type": "object", + "properties": { + "name": { + "description": "The name of the decorator.", + "type": "string", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use?" + }, + "project": { + "description": "The Nest project to target.", + "type": "string", + "$default": { "$source": "projectName" }, + "alias": "p", + "x-prompt": "What Nest project would you like to target?" + }, + "directory": { + "description": "Directory where the generated files are placed.", + "type": "string", + "aliases": ["dir", "path"] + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + }, + "flat": { + "description": "Flag to indicate if a directory is created.", + "type": "boolean", + "default": true + }, + "language": { + "description": "Nest decorator language.", + "type": "string", + "enum": ["js", "ts"] + } + }, + "additionalProperties": false, + "required": ["name", "project"], + "presets": [] + }, + "description": "Run the `decorator` NestJS generator with Nx project support.", + "implementation": "/packages/nest/src/generators/decorator/decorator.ts", + "aliases": [], + "hidden": false, + "path": "/packages/nest/src/generators/decorator/schema.json" + }, + { + "name": "filter", + "factory": "./src/generators/filter/filter", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxNestFilterGenerator", + "title": "Nest Filter Options Schema", + "description": "Nest Filter Options Schema.", + "cli": "nx", + "type": "object", + "properties": { + "name": { + "description": "The name of the filter.", + "type": "string", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use?" + }, + "project": { + "description": "The Nest project to target.", + "type": "string", + "$default": { "$source": "projectName" }, + "alias": "p", + "x-prompt": "What Nest project would you like to target?" + }, + "directory": { + "description": "Directory where the generated files are placed.", + "type": "string", + "aliases": ["dir", "path"] + }, + "skipFormat": { + "type": "boolean", + "description": "Skip formatting files.", + "default": false + }, + "unitTestRunner": { + "description": "Test runner to use for unit tests.", + "type": "string", + "enum": ["jest", "none"], + "default": "jest" + }, + "flat": { + "description": "Flag to indicate if a directory is created.", + "type": "boolean", + "default": true + }, + "language": { + "description": "Nest filter language.", + "type": "string", + "enum": ["js", "ts"] + } + }, + "additionalProperties": false, + "required": ["name", "project"], + "presets": [] + }, + "description": "Run the `filter` NestJS generator with Nx project support.", + "implementation": "/packages/nest/src/generators/filter/filter.ts", + "aliases": [], + "hidden": false, + "path": "/packages/nest/src/generators/filter/schema.json" + }, + { + "name": "gateway", + "factory": "./src/generators/gateway/gateway", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxNestGatewayGenerator", + "title": "Nest Gateway Options Schema", + "description": "Nest Gateway Options Schema.", + "cli": "nx", + "type": "object", + "properties": { + "name": { + "description": "The name of the gateway.", + "type": "string", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use?" + }, + "project": { + "description": "The Nest project to target.", + "type": "string", + "$default": { "$source": "projectName" }, + "alias": "p", + "x-prompt": "What Nest project would you like to target?" + }, + "directory": { + "description": "Directory where the generated files are placed.", + "type": "string", + "aliases": ["dir", "path"] + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + }, + "unitTestRunner": { + "description": "Test runner to use for unit tests.", + "type": "string", + "enum": ["jest", "none"], + "default": "jest" + }, + "flat": { + "description": "Flag to indicate if a directory is created.", + "type": "boolean", + "default": true + }, + "language": { + "description": "Nest gateway language.", + "type": "string", + "enum": ["js", "ts"] + } + }, + "additionalProperties": false, + "required": ["name", "project"], + "presets": [] + }, + "description": "Run the `gateway` NestJS generator with Nx project support.", + "implementation": "/packages/nest/src/generators/gateway/gateway.ts", + "aliases": [], + "hidden": false, + "path": "/packages/nest/src/generators/gateway/schema.json" + }, + { + "name": "guard", + "factory": "./src/generators/guard/guard", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxNestGuardGenerator", + "title": "Nest Guard Options Schema", + "description": "Nest Guard Options Schema.", + "cli": "nx", + "type": "object", + "properties": { + "name": { + "description": "The name of the guard.", + "type": "string", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use?" + }, + "project": { + "description": "The Nest project to target.", + "type": "string", + "$default": { "$source": "projectName" }, + "alias": "p", + "x-prompt": "What Nest project would you like to target?" + }, + "directory": { + "description": "Directory where the generated files are placed.", + "type": "string", + "aliases": ["dir", "path"] + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + }, + "unitTestRunner": { + "description": "Test runner to use for unit tests.", + "type": "string", + "enum": ["jest", "none"], + "default": "jest" + }, + "flat": { + "description": "Flag to indicate if a directory is created.", + "type": "boolean", + "default": true + }, + "language": { + "description": "Nest guard language.", + "type": "string", + "enum": ["js", "ts"] + } + }, + "additionalProperties": false, + "required": ["name", "project"], + "presets": [] + }, + "description": "Run the `guard` NestJS generator with Nx project support.", + "implementation": "/packages/nest/src/generators/guard/guard.ts", + "aliases": [], + "hidden": false, + "path": "/packages/nest/src/generators/guard/schema.json" + }, + { + "name": "interceptor", + "factory": "./src/generators/interceptor/interceptor", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxNestInterceptorGenerator", + "title": "Nest Interceptor Options Schema", + "description": "Nest Interceptor Options Schema.", + "cli": "nx", + "type": "object", + "properties": { + "name": { + "description": "The name of the interceptor.", + "type": "string", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use?" + }, + "project": { + "description": "The Nest project to target.", + "type": "string", + "$default": { "$source": "projectName" }, + "alias": "p", + "x-prompt": "What Nest project would you like to target?" + }, + "directory": { + "description": "Directory where the generated files are placed.", + "type": "string", + "aliases": ["dir", "path"] + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + }, + "unitTestRunner": { + "description": "Test runner to use for unit tests.", + "type": "string", + "enum": ["jest", "none"], + "default": "jest" + }, + "flat": { + "description": "Flag to indicate if a directory is created.", + "type": "boolean", + "default": true + }, + "language": { + "description": "Nest interceptor language.", + "type": "string", + "enum": ["js", "ts"] + } + }, + "additionalProperties": false, + "required": ["name", "project"], + "presets": [] + }, + "description": "Run the `interceptor` NestJS generator with Nx project support.", + "implementation": "/packages/nest/src/generators/interceptor/interceptor.ts", + "aliases": [], + "hidden": false, + "path": "/packages/nest/src/generators/interceptor/schema.json" + }, + { + "name": "interface", + "factory": "./src/generators/interface/interface", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxNestInterfaceGenerator", + "title": "Nest Interface Options Schema", + "description": "Nest Interface Options Schema.", + "cli": "nx", + "type": "object", + "properties": { + "name": { + "description": "The name of the interface.", + "type": "string", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use?" + }, + "project": { + "description": "The Nest project to target.", + "type": "string", + "$default": { "$source": "projectName" }, + "alias": "p", + "x-prompt": "What Nest project would you like to target?" + }, + "directory": { + "description": "Directory where the generated files are placed.", + "type": "string", + "aliases": ["dir", "path"] + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + }, + "flat": { + "description": "Flag to indicate if a directory is created.", + "type": "boolean", + "default": true + } + }, + "additionalProperties": false, + "required": ["name", "project"], + "presets": [] + }, + "description": "Run the `interface` NestJS generator with Nx project support.", + "implementation": "/packages/nest/src/generators/interface/interface.ts", + "aliases": [], + "hidden": false, + "path": "/packages/nest/src/generators/interface/schema.json" + }, + { + "name": "middleware", + "factory": "./src/generators/middleware/middleware", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxNestMiddlewareGenerator", + "title": "Nest Middleware Options Schema", + "description": "Nest Middleware Options Schema.", + "cli": "nx", + "type": "object", + "properties": { + "name": { + "description": "The name of the middleware.", + "type": "string", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use?" + }, + "project": { + "description": "The Nest project to target.", + "type": "string", + "$default": { "$source": "projectName" }, + "alias": "p", + "x-prompt": "What Nest project would you like to target?" + }, + "directory": { + "description": "Directory where the generated files are placed.", + "type": "string", + "aliases": ["dir", "path"] + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + }, + "unitTestRunner": { + "description": "Test runner to use for unit tests.", + "type": "string", + "enum": ["jest", "none"], + "default": "jest" + }, + "flat": { + "description": "Flag to indicate if a directory is created.", + "type": "boolean", + "default": true + }, + "language": { + "description": "Nest middleware language.", + "type": "string", + "enum": ["js", "ts"] + } + }, + "additionalProperties": false, + "required": ["name", "project"], + "presets": [] + }, + "description": "Run the `middleware` NestJS generator with Nx project support.", + "implementation": "/packages/nest/src/generators/middleware/middleware.ts", + "aliases": [], + "hidden": false, + "path": "/packages/nest/src/generators/middleware/schema.json" + }, + { + "name": "module", + "factory": "./src/generators/module/module", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxNestModuleGenerator", + "title": "Nest Module Options Schema", + "description": "Nest Module Options Schema.", + "cli": "nx", + "type": "object", + "properties": { + "name": { + "description": "The name of the module.", + "type": "string", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use?" + }, + "project": { + "description": "The Nest project to target.", + "type": "string", + "$default": { "$source": "projectName" }, + "alias": "p", + "x-prompt": "What Nest project would you like to target?" + }, + "directory": { + "description": "Directory where the generated files are placed.", + "type": "string", + "aliases": ["dir", "path"] + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + }, + "flat": { + "description": "Flag to indicate if a directory is created.", + "type": "boolean", + "default": false + }, + "language": { + "description": "Nest module language.", + "type": "string", + "enum": ["js", "ts"] + }, + "module": { + "description": "The path to import the module.", + "type": "string", + "format": "path" + }, + "skipImport": { + "description": "Flag to skip the module import.", + "type": "boolean", + "default": false + } + }, + "additionalProperties": false, + "required": ["name", "project"], + "presets": [] + }, + "description": "Run the `module` NestJS generator with Nx project support.", + "implementation": "/packages/nest/src/generators/module/module.ts", + "aliases": [], + "hidden": false, + "path": "/packages/nest/src/generators/module/schema.json" + }, + { + "name": "pipe", + "factory": "./src/generators/pipe/pipe", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxNestPipeGenerator", + "title": "Nest Pipe Options Schema", + "description": "Nest Pipe Options Schema.", + "cli": "nx", + "type": "object", + "properties": { + "name": { + "description": "The name of the pipe.", + "type": "string", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use?" + }, + "project": { + "description": "The Nest project to target.", + "type": "string", + "$default": { "$source": "projectName" }, + "alias": "p", + "x-prompt": "What Nest project would you like to target?" + }, + "directory": { + "description": "Directory where the generated files are placed.", + "type": "string", + "aliases": ["dir", "path"] + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + }, + "unitTestRunner": { + "description": "Test runner to use for unit tests.", + "type": "string", + "enum": ["jest", "none"], + "default": "jest" + }, + "flat": { + "description": "Flag to indicate if a directory is created.", + "type": "boolean", + "default": true + }, + "language": { + "description": "Nest pipe language.", + "type": "string", + "enum": ["js", "ts"] + } + }, + "additionalProperties": false, + "required": ["name", "project"], + "presets": [] + }, + "description": "Run the `pipe` NestJS generator with Nx project support.", + "implementation": "/packages/nest/src/generators/pipe/pipe.ts", + "aliases": [], + "hidden": false, + "path": "/packages/nest/src/generators/pipe/schema.json" + }, + { + "name": "provider", + "factory": "./src/generators/provider/provider", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxNestProviderGenerator", + "title": "Nest Provider Options Schema", + "description": "Nest Provider Options Schema.", + "cli": "nx", + "type": "object", + "properties": { + "name": { + "description": "The name of the provider.", + "type": "string", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use?" + }, + "project": { + "description": "The Nest project to target.", + "type": "string", + "$default": { "$source": "projectName" }, + "alias": "p", + "x-prompt": "What Nest project would you like to target?" + }, + "directory": { + "description": "Directory where the generated files are placed.", + "type": "string", + "aliases": ["dir", "path"] + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + }, + "unitTestRunner": { + "description": "Test runner to use for unit tests.", + "type": "string", + "enum": ["jest", "none"], + "default": "jest" + }, + "flat": { + "description": "Flag to indicate if a directory is created.", + "type": "boolean", + "default": true + }, + "language": { + "description": "Nest provider language.", + "type": "string", + "enum": ["js", "ts"] + } + }, + "additionalProperties": false, + "required": ["name", "project"], + "presets": [] + }, + "description": "Run the `provider` NestJS generator with Nx project support.", + "implementation": "/packages/nest/src/generators/provider/provider.ts", + "aliases": [], + "hidden": false, + "path": "/packages/nest/src/generators/provider/schema.json" + }, + { + "name": "resolver", + "factory": "./src/generators/resolver/resolver", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxNestResolverGenerator", + "title": "Nest Resolver Options Schema", + "description": "Nest Resolver Options Schema.", + "cli": "nx", + "type": "object", + "properties": { + "name": { + "description": "The name of the resolver.", + "type": "string", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use?" + }, + "project": { + "description": "The Nest project to target.", + "type": "string", + "$default": { "$source": "projectName" }, + "alias": "p", + "x-prompt": "What Nest project would you like to target?" + }, + "directory": { + "description": "Directory where the generated files are placed.", + "type": "string", + "aliases": ["dir", "path"] + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + }, + "unitTestRunner": { + "description": "Test runner to use for unit tests.", + "type": "string", + "enum": ["jest", "none"], + "default": "jest" + }, + "flat": { + "description": "Flag to indicate if a directory is created.", + "type": "boolean", + "default": false + }, + "language": { + "description": "Nest resolver language.", + "type": "string", + "enum": ["js", "ts"] + } + }, + "additionalProperties": false, + "required": ["name", "project"], + "presets": [] + }, + "description": "Run the `resolver` NestJS generator with Nx project support.", + "implementation": "/packages/nest/src/generators/resolver/resolver.ts", + "aliases": [], + "hidden": false, + "path": "/packages/nest/src/generators/resolver/schema.json" + }, + { + "name": "resource", + "factory": "./src/generators/resource/resource", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxNestResourceGenerator", + "title": "Nest Resource Options Schema", + "description": "Nest Resource Options Schema.", + "cli": "nx", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the resource.", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for this resource (plural, e.g., `users`)?" + }, + "project": { + "description": "The Nest project to target.", + "type": "string", + "$default": { "$source": "projectName" }, + "alias": "p", + "x-prompt": "What Nest project would you like to target?" + }, + "directory": { + "description": "Directory where the generated files are placed.", + "type": "string", + "aliases": ["dir", "path"] + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + }, + "unitTestRunner": { + "description": "Test runner to use for unit tests.", + "type": "string", + "enum": ["jest", "none"], + "default": "jest" + }, + "flat": { + "description": "Flag to indicate if a directory is created.", + "type": "boolean", + "default": false + }, + "language": { + "description": "Nest class language.", + "type": "string", + "enum": ["js", "ts"] + }, + "type": { + "type": "string", + "description": "The transport layer.", + "default": "rest", + "enum": [ + "rest", + "graphql-code-first", + "graphql-schema-first", + "microservice", + "ws" + ], + "x-prompt": { + "message": "What transport layer do you use?", + "type": "list", + "items": [ + { "value": "rest", "label": "REST API" }, + { + "value": "graphql-code-first", + "label": "GraphQL (code first)" + }, + { + "value": "graphql-schema-first", + "label": "GraphQL (schema first)" + }, + { "value": "microservice", "label": "Microservice (non-HTTP)" }, + { "value": "ws", "label": "WebSockets" } + ] + } + }, + "skipImport": { + "type": "boolean", + "description": "Flag to skip the module import.", + "default": false + }, + "crud": { + "type": "boolean", + "description": "When true, CRUD entry points are generated.", + "default": true, + "x-prompt": { + "message": "Would you like to generate CRUD entry points?", + "type": "confirmation" + } + } + }, + "additionalProperties": false, + "required": ["name", "project"], + "presets": [] + }, + "description": "Run the `resource` NestJS generator with Nx project support.", + "implementation": "/packages/nest/src/generators/resource/resource.ts", + "aliases": [], + "hidden": false, + "path": "/packages/nest/src/generators/resource/schema.json" + }, + { + "name": "service", + "factory": "./src/generators/service/service", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxNestServiceGenerator", + "title": "Nest Service Options Schema", + "description": "Nest Service Options Schema.", + "cli": "nx", + "type": "object", + "properties": { + "name": { + "description": "The name of the service.", + "type": "string", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use?" + }, + "project": { + "description": "The Nest project to target.", + "type": "string", + "$default": { "$source": "projectName" }, + "alias": "p", + "x-prompt": "What Nest project would you like to target?" + }, + "directory": { + "description": "Directory where the generated files are placed.", + "type": "string", + "aliases": ["dir", "path"] + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + }, + "unitTestRunner": { + "description": "Test runner to use for unit tests.", + "type": "string", + "enum": ["jest", "none"], + "default": "jest" + }, + "flat": { + "description": "Flag to indicate if a directory is created.", + "type": "boolean", + "default": false + }, + "language": { + "description": "Nest service language.", + "type": "string", + "enum": ["js", "ts"] + } + }, + "additionalProperties": false, + "required": ["name", "project"], + "presets": [] + }, + "description": "Run the `service` NestJS generator with Nx project support.", + "implementation": "/packages/nest/src/generators/service/service.ts", + "aliases": [], + "hidden": false, + "path": "/packages/nest/src/generators/service/schema.json" + } + ], + "executors": [] +} diff --git a/docs/generated/packages/next.json b/docs/generated/packages/next.json new file mode 100644 index 0000000000..6554656158 --- /dev/null +++ b/docs/generated/packages/next.json @@ -0,0 +1,705 @@ +{ + "githubRoot": "https://github.com/nrwl/nx/blob/master", + "name": "next", + "description": "Next.js Plugin for Nx", + "root": "/packages/next", + "source": "/packages/next/src", + "generators": [ + { + "name": "init", + "factory": "./src/generators/init/init#nextInitGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "$id": "NxNextNgInit", + "title": "Init Next Plugin", + "description": "Init Next Plugin.", + "type": "object", + "properties": { + "unitTestRunner": { + "description": "Adds the specified unit test runner.", + "type": "string", + "enum": ["jest", "none"], + "default": "jest" + }, + "e2eTestRunner": { + "description": "Adds the specified e2e test runner.", + "type": "string", + "enum": ["cypress", "none"], + "default": "cypress" + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + } + }, + "required": [], + "presets": [] + }, + "description": "Initialize the @nrwl/next plugin", + "hidden": true, + "implementation": "/packages/next/src/generators/init/init#nextInitGenerator.ts", + "aliases": [], + "path": "/packages/next/src/generators/init/schema.json" + }, + { + "name": "application", + "factory": "./src/generators/application/application#applicationGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "$id": "NxNextApp", + "title": "Create a Next.js Application for Nx", + "examples": [ + { + "command": "nx g app myapp --directory=myorg", + "description": "Generate `apps/myorg/myapp` and `apps/myorg/myapp-e2e`" + } + ], + "type": "object", + "properties": { + "name": { + "description": "The name of the application.", + "type": "string", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the application?", + "pattern": "^[a-zA-Z].*$" + }, + "directory": { + "description": "The directory of the new application.", + "type": "string", + "alias": "d" + }, + "style": { + "description": "The file extension to be used for style files.", + "type": "string", + "default": "css", + "alias": "s", + "x-prompt": { + "message": "Which stylesheet format would you like to use?", + "type": "list", + "items": [ + { "value": "css", "label": "CSS" }, + { + "value": "scss", + "label": "SASS(.scss) [ http://sass-lang.com ]" + }, + { + "value": "styl", + "label": "Stylus(.styl) [ http://stylus-lang.com ]" + }, + { + "value": "less", + "label": "LESS [ http://lesscss.org ]" + }, + { + "value": "styled-components", + "label": "styled-components [ https://styled-components.com ]" + }, + { + "value": "@emotion/styled", + "label": "emotion [ https://emotion.sh ]" + }, + { + "value": "styled-jsx", + "label": "styled-jsx [ https://www.npmjs.com/package/styled-jsx ]" + } + ] + } + }, + "server": { + "description": "The server script path to be used with next.", + "type": "string" + }, + "linter": { + "description": "The tool to use for running lint checks.", + "type": "string", + "enum": ["eslint", "tslint"], + "default": "eslint" + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + }, + "skipWorkspaceJson": { + "description": "Skip updating `workspace.json` with default options based on values provided to this app (e.g. `babel`, `style`).", + "type": "boolean", + "default": false + }, + "unitTestRunner": { + "type": "string", + "enum": ["jest", "none"], + "description": "Test runner to use for unit tests.", + "default": "jest" + }, + "e2eTestRunner": { + "type": "string", + "enum": ["cypress", "none"], + "description": "Test runner to use for end to end (E2E) tests.", + "default": "cypress" + }, + "tags": { + "type": "string", + "description": "Add tags to the application (used for linting).", + "alias": "t" + }, + "js": { + "type": "boolean", + "description": "Generate JavaScript files rather than TypeScript files.", + "default": false + }, + "setParserOptionsProject": { + "type": "boolean", + "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.", + "default": false + }, + "standaloneConfig": { + "description": "Split the project configuration into `/project.json` rather than including it inside `workspace.json`", + "type": "boolean" + }, + "swc": { + "description": "Enable the Rust-based compiler SWC to compile JS/TS files.", + "type": "boolean", + "default": true + } + }, + "required": [], + "presets": [] + }, + "aliases": ["app"], + "x-type": "application", + "description": "Create an application", + "implementation": "/packages/next/src/generators/application/application#applicationGenerator.ts", + "hidden": false, + "path": "/packages/next/src/generators/application/schema.json" + }, + { + "name": "page", + "factory": "./src/generators/page/page#pageGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "$id": "NxNextReactPage", + "title": "Create a Page for Next", + "description": "Create a Page for Next.", + "type": "object", + "examples": [ + { + "command": "nx g page my-new-page --project=my-app", + "description": "Generate a page in the my-app application" + } + ], + "properties": { + "project": { + "type": "string", + "description": "The name of the project.", + "alias": "p", + "$default": { "$source": "projectName" }, + "x-prompt": "What is the name of the project for this component?" + }, + "name": { + "type": "string", + "description": "The name of the component.", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the component?" + }, + "directory": { + "type": "string", + "description": "Create the page under this directory (can be nested). Will be created under `pages/`.", + "alias": "dir" + }, + "style": { + "description": "The file extension to be used for style files.", + "type": "string", + "alias": "s", + "default": "css", + "x-prompt": { + "message": "Which stylesheet format would you like to use?", + "type": "list", + "items": [ + { "value": "css", "label": "CSS" }, + { + "value": "scss", + "label": "SASS(.scss) [ http://sass-lang.com ]" + }, + { + "value": "styl", + "label": "Stylus(.styl) [ http://stylus-lang.com ]" + }, + { + "value": "less", + "label": "LESS [ http://lesscss.org ]" + }, + { + "value": "styled-components", + "label": "styled-components [ https://styled-components.com ]" + }, + { + "value": "@emotion/styled", + "label": "emotion [ https://emotion.sh ]" + }, + { + "value": "styled-jsx", + "label": "styled-jsx [ https://www.npmjs.com/package/styled-jsx ]" + }, + { "value": "none", "label": "None" } + ] + } + }, + "withTests": { + "type": "boolean", + "description": "When true, creates a `spec.ts` test file for the new page.", + "default": false + }, + "export": { + "type": "boolean", + "description": "When true, the component is exported from the project `index.ts` (if it exists).", + "alias": "e", + "default": false + }, + "js": { + "type": "boolean", + "description": "Generate JavaScript files rather than TypeScript files.", + "default": false + }, + "flat": { + "type": "boolean", + "description": "Create component at the source root rather than its own directory.", + "default": false + } + }, + "required": ["name", "project"], + "presets": [] + }, + "description": "Create a page", + "implementation": "/packages/next/src/generators/page/page#pageGenerator.ts", + "aliases": [], + "hidden": false, + "path": "/packages/next/src/generators/page/schema.json" + }, + { + "name": "component", + "factory": "./src/generators/component/component#componentGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "$id": "NxNextReactComponent", + "title": "Create a React Component for Next", + "type": "object", + "examples": [ + { + "command": "nx g component my-component --project=mylib", + "description": "Generate a component in the `mylib` library" + }, + { + "command": "nx g component my-component --project=mylib --classComponent", + "description": "Generate a class component in the `mylib` library" + } + ], + "properties": { + "project": { + "type": "string", + "description": "The name of the project.", + "alias": "p", + "$default": { "$source": "projectName" }, + "x-prompt": "What is the name of the project for this component?" + }, + "name": { + "type": "string", + "description": "The name of the component.", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the component?" + }, + "style": { + "description": "The file extension to be used for style files.", + "type": "string", + "alias": "s", + "default": "css", + "x-prompt": { + "message": "Which stylesheet format would you like to use?", + "type": "list", + "items": [ + { "value": "css", "label": "CSS" }, + { + "value": "scss", + "label": "SASS(.scss) [ http://sass-lang.com ]" + }, + { + "value": "styl", + "label": "Stylus(.styl) [ http://stylus-lang.com ]" + }, + { + "value": "less", + "label": "LESS [ http://lesscss.org ]" + }, + { + "value": "styled-components", + "label": "styled-components [ https://styled-components.com ]" + }, + { + "value": "@emotion/styled", + "label": "emotion [ https://emotion.sh ]" + }, + { + "value": "styled-jsx", + "label": "styled-jsx [ https://www.npmjs.com/package/styled-jsx ]" + } + ] + } + }, + "skipTests": { + "type": "boolean", + "description": "When true, does not create `spec.ts` test files for the new component.", + "default": false + }, + "directory": { + "type": "string", + "description": "Create the component under this directory (can be nested).", + "alias": "dir" + }, + "export": { + "type": "boolean", + "description": "When true, the component is exported from the project index.ts (if it exists).", + "alias": "e", + "default": false + }, + "js": { + "type": "boolean", + "description": "Generate JavaScript files rather than TypeScript files.", + "default": false + }, + "flat": { + "type": "boolean", + "description": "Create component at the source root rather than its own directory.", + "default": false + } + }, + "required": ["name", "project"], + "presets": [] + }, + "description": "Create a component", + "implementation": "/packages/next/src/generators/component/component#componentGenerator.ts", + "aliases": [], + "hidden": false, + "path": "/packages/next/src/generators/component/schema.json" + }, + { + "name": "library", + "factory": "./src/generators/library/library#libraryGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "$id": "NxReactLibrary", + "title": "Create a React Library for Nx", + "description": "Create a React Library for an Nx workspace.", + "type": "object", + "examples": [ + { + "command": "nx g lib mylib --directory=myapp", + "description": "Generate `libs/myapp/mylib`" + }, + { + "command": "nx g lib mylib --appProject=myapp", + "description": "Generate a library with routes and add them to `myapp`" + } + ], + "properties": { + "name": { + "type": "string", + "description": "Library name", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the library?", + "pattern": "^[a-zA-Z].*$" + }, + "directory": { + "type": "string", + "description": "A directory where the lib is placed.", + "alias": "dir" + }, + "style": { + "description": "The file extension to be used for style files.", + "type": "string", + "default": "css", + "alias": "s", + "x-prompt": { + "message": "Which stylesheet format would you like to use?", + "type": "list", + "items": [ + { "value": "css", "label": "CSS" }, + { + "value": "scss", + "label": "SASS(.scss) [ http://sass-lang.com ]" + }, + { + "value": "styl", + "label": "Stylus(.styl) [ http://stylus-lang.com ]" + }, + { + "value": "less", + "label": "LESS [ http://lesscss.org ]" + }, + { + "value": "styled-components", + "label": "styled-components [ https://styled-components.com ]" + }, + { + "value": "@emotion/styled", + "label": "emotion [ https://emotion.sh ]" + }, + { + "value": "styled-jsx", + "label": "styled-jsx [ https://www.npmjs.com/package/styled-jsx ]" + }, + { "value": "none", "label": "None" } + ] + } + }, + "linter": { + "description": "The tool to use for running lint checks.", + "type": "string", + "enum": ["eslint", "tslint"], + "default": "eslint" + }, + "unitTestRunner": { + "type": "string", + "enum": ["jest", "none"], + "description": "Test runner to use for unit tests.", + "default": "jest" + }, + "tags": { + "type": "string", + "description": "Add tags to the library (used for linting).", + "alias": "t" + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + }, + "skipTsConfig": { + "type": "boolean", + "default": false, + "description": "Do not update tsconfig.json for development experience." + }, + "pascalCaseFiles": { + "type": "boolean", + "description": "Use pascal case component file name (e.g. `App.tsx`).", + "alias": "P", + "default": false + }, + "routing": { + "type": "boolean", + "description": "Generate library with routes." + }, + "appProject": { + "type": "string", + "description": "The application project to add the library route to.", + "alias": "a" + }, + "publishable": { + "type": "boolean", + "description": "Create a publishable library." + }, + "buildable": { + "type": "boolean", + "default": false, + "description": "Generate a buildable library." + }, + "importPath": { + "type": "string", + "description": "The library name used to import it, like `@myorg/my-awesome-lib`." + }, + "component": { + "type": "boolean", + "description": "Generate a default component.", + "default": true + }, + "js": { + "type": "boolean", + "description": "Generate JavaScript files rather than TypeScript files.", + "default": false + }, + "globalCss": { + "type": "boolean", + "description": "When true, the stylesheet is generated using global CSS instead of CSS modules (e.g. file is `*.css` rather than `*.module.css`).", + "default": false + }, + "strict": { + "type": "boolean", + "description": "Whether to enable tsconfig strict mode or not.", + "default": true + }, + "setParserOptionsProject": { + "type": "boolean", + "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.", + "default": false + }, + "standaloneConfig": { + "description": "Split the project configuration into `/project.json` rather than including it inside `workspace.json`", + "type": "boolean" + } + }, + "required": ["name"], + "presets": [] + }, + "aliases": ["lib"], + "x-type": "library", + "description": "Create a library", + "implementation": "/packages/next/src/generators/library/library#libraryGenerator.ts", + "hidden": false, + "path": "/packages/next/src/generators/library/schema.json" + } + ], + "executors": [ + { + "name": "build", + "implementation": "/packages/next/src/executors/build/build.impl.ts", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "title": "Next Build", + "description": "Build a Next.js app", + "type": "object", + "properties": { + "root": { "description": "The source root", "type": "string" }, + "outputPath": { + "type": "string", + "description": "The output path of the generated files." + }, + "fileReplacements": { + "description": "Replace files with other files in the build.", + "type": "array", + "items": { + "type": "object", + "properties": { + "replace": { + "type": "string", + "description": "The file to be replaced." + }, + "with": { + "type": "string", + "description": "The file to replace with." + } + }, + "additionalProperties": false, + "required": ["replace", "with"] + }, + "default": [] + }, + "nextConfig": { + "description": "Path (relative to workspace root) to a function which takes phase, config, and builder options, and returns the resulting config. This is an advanced option and should not be used with a normal Next.js config file (i.e. `next.config.js`).", + "type": "string" + }, + "buildLibsFromSource": { + "type": "boolean", + "description": "Read buildable libraries from source instead of building them separately.", + "default": true + } + }, + "required": ["root", "outputPath"], + "presets": [] + }, + "description": "Build a Next.js app", + "aliases": [], + "hidden": false, + "path": "/packages/next/src/executors/build/schema.json" + }, + { + "name": "server", + "implementation": "/packages/next/src/executors/server/server.impl.ts", + "schema": { + "cli": "nx", + "title": "Next Serve", + "description": "Serve a Next.js app", + "type": "object", + "properties": { + "dev": { + "type": "boolean", + "description": "Serve the application in the dev mode.", + "default": true + }, + "buildTarget": { + "type": "string", + "description": "Target which builds the application." + }, + "port": { + "type": "number", + "description": "Port to listen on.", + "default": 4200 + }, + "staticMarkup": { + "type": "boolean", + "description": "Static markup.", + "default": false + }, + "quiet": { + "type": "boolean", + "description": "Hide error messages containing server information.", + "default": false + }, + "customServerPath": { + "type": "string", + "description": "Use a custom server script." + }, + "hostname": { + "type": "string", + "description": "Hostname on which the application is served." + }, + "proxyConfig": { + "type": "string", + "description": "Path to the proxy configuration file." + }, + "buildLibsFromSource": { + "type": "boolean", + "description": "Read buildable libraries from source instead of building them separately.", + "default": true + } + }, + "required": ["buildTarget"], + "presets": [] + }, + "description": "Serve a Next.js app", + "aliases": [], + "hidden": false, + "path": "/packages/next/src/executors/server/schema.json" + }, + { + "name": "export", + "implementation": "/packages/next/src/executors/export/export.impl.ts", + "schema": { + "cli": "nx", + "title": "Next Export", + "description": "Export a Next.js application. The exported application is located at `dist/$outputPath/exported`.", + "type": "object", + "properties": { + "buildTarget": { + "type": "string", + "description": "Target which builds the application" + }, + "silent": { + "type": "boolean", + "description": "Hide progress or not (default is `false`)", + "default": false + }, + "threads": { + "type": "number", + "description": "Number of worker threads to utilize (defaults to the number of CPUs)" + }, + "buildLibsFromSource": { + "type": "boolean", + "description": "Read buildable libraries from source instead of building them separately.", + "default": true + } + }, + "required": [], + "presets": [] + }, + "description": "Export a Next.js app. The exported application is located at dist/$outputPath/exported.", + "aliases": [], + "hidden": false, + "path": "/packages/next/src/executors/export/schema.json" + } + ] +} diff --git a/docs/generated/packages/node.json b/docs/generated/packages/node.json new file mode 100644 index 0000000000..e76b519972 --- /dev/null +++ b/docs/generated/packages/node.json @@ -0,0 +1,577 @@ +{ + "githubRoot": "https://github.com/nrwl/nx/blob/master", + "name": "node", + "description": "Node Plugin for Nx", + "root": "/packages/node", + "source": "/packages/node/src", + "generators": [ + { + "name": "init", + "factory": "./src/generators/init/init", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "$id": "NxNodeInit", + "title": "Init Node Plugin", + "description": "Init Node Plugin.", + "type": "object", + "properties": { + "unitTestRunner": { + "description": "Adds the specified unit test runner.", + "type": "string", + "enum": ["jest", "none"], + "default": "jest" + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + } + }, + "required": [], + "presets": [] + }, + "description": "Initialize the @nrwl/node plugin", + "aliases": ["ng-add"], + "hidden": true, + "implementation": "/packages/node/src/generators/init/init.ts", + "path": "/packages/node/src/generators/init/schema.json" + }, + { + "name": "application", + "factory": "./src/generators/application/application", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "$id": "SchematicsNxNodeApp", + "title": "Nx Application Options Schema", + "description": "Nx Application Options Schema.", + "type": "object", + "properties": { + "name": { + "description": "The name of the application.", + "type": "string", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the node application?" + }, + "directory": { + "description": "The directory of the new application.", + "type": "string" + }, + "skipFormat": { + "description": "Skip formatting files", + "type": "boolean", + "default": false + }, + "skipPackageJson": { + "type": "boolean", + "default": false, + "description": "Do not add dependencies to `package.json`." + }, + "linter": { + "description": "The tool to use for running lint checks.", + "type": "string", + "enum": ["eslint", "tslint"], + "default": "eslint" + }, + "unitTestRunner": { + "type": "string", + "enum": ["jest", "none"], + "description": "Test runner to use for unit tests.", + "default": "jest" + }, + "tags": { + "type": "string", + "description": "Add tags to the application (used for linting)." + }, + "frontendProject": { + "type": "string", + "description": "Frontend project that needs to access this application. This sets up proxy configuration." + }, + "babelJest": { + "type": "boolean", + "description": "Use `babel` instead of `ts-jest`.", + "default": false + }, + "pascalCaseFiles": { + "type": "boolean", + "description": "Use pascal case file names.", + "alias": "P", + "default": false + }, + "js": { + "type": "boolean", + "description": "Generate JavaScript files rather than TypeScript files.", + "default": false + }, + "setParserOptionsProject": { + "type": "boolean", + "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.", + "default": false + }, + "standaloneConfig": { + "description": "Split the project configuration into `/project.json` rather than including it inside `workspace.json`.", + "type": "boolean" + } + }, + "required": [], + "presets": [] + }, + "aliases": ["app"], + "x-type": "application", + "description": "Create a node application", + "implementation": "/packages/node/src/generators/application/application.ts", + "hidden": false, + "path": "/packages/node/src/generators/application/schema.json" + }, + { + "name": "library", + "factory": "./src/generators/library/library", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "$id": "NxNodeLibrary", + "title": "Create a Node Library for Nx", + "description": "Create a Node Library for an Nx workspace.", + "type": "object", + "examples": [ + { + "command": "nx g lib mylib --directory=myapp", + "description": "Generate `libs/myapp/mylib`" + } + ], + "properties": { + "name": { + "type": "string", + "description": "Library name", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the library?" + }, + "directory": { + "type": "string", + "description": "A directory where the lib is placed", + "alias": "dir" + }, + "simpleModuleName": { + "description": "Keep the module name simple (when using `--directory`).", + "type": "boolean", + "default": false + }, + "linter": { + "description": "The tool to use for running lint checks.", + "type": "string", + "enum": ["eslint", "tslint"], + "default": "eslint" + }, + "unitTestRunner": { + "type": "string", + "enum": ["jest", "none"], + "description": "Test runner to use for unit tests.", + "default": "jest" + }, + "tags": { + "type": "string", + "description": "Add tags to the library (used for linting).", + "alias": "t" + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + }, + "skipTsConfig": { + "type": "boolean", + "default": false, + "description": "Do not update `tsconfig.base.json` for development experience." + }, + "publishable": { + "type": "boolean", + "description": "Create a publishable library." + }, + "buildable": { + "type": "boolean", + "default": false, + "description": "Generate a buildable library." + }, + "compiler": { + "type": "string", + "enum": ["tsc", "swc"], + "default": "tsc", + "description": "The compiler used by the build and test targets." + }, + "importPath": { + "type": "string", + "description": "The library name used to import it, like `@myorg/my-awesome-lib`. Must be a valid npm name." + }, + "rootDir": { + "type": "string", + "alias": "srcRootForCompilationRoot", + "description": "Sets the `rootDir` for TypeScript compilation. When not defined, it uses the project's root property, or `srcRootForCompilationRoot` if it is defined." + }, + "testEnvironment": { + "type": "string", + "enum": ["jsdom", "node"], + "description": "The test environment to use if `unitTestRunner` is set to `jest`.", + "default": "jsdom" + }, + "babelJest": { + "type": "boolean", + "description": "Use `babel` instead of `ts-jest`.", + "default": false + }, + "pascalCaseFiles": { + "type": "boolean", + "description": "Use pascal case file names.", + "alias": "P", + "default": false + }, + "js": { + "type": "boolean", + "description": "Generate JavaScript files rather than TypeScript files.", + "default": false + }, + "strict": { + "type": "boolean", + "description": "Whether to enable tsconfig strict mode or not.", + "default": false + }, + "standaloneConfig": { + "description": "Split the project configuration into `/project.json` rather than including it inside `workspace.json`.", + "type": "boolean" + }, + "setParserOptionsProject": { + "type": "boolean", + "description": "Whether or not to configure the ESLint `parserOptions.project`. We do not do this by default for lint performance reasons.", + "default": false + } + }, + "required": ["name"], + "presets": [] + }, + "aliases": ["lib"], + "x-type": "library", + "description": "Create a library", + "implementation": "/packages/node/src/generators/library/library.ts", + "hidden": false, + "path": "/packages/node/src/generators/library/schema.json" + } + ], + "executors": [ + { + "name": "webpack", + "implementation": "/packages/node/src/executors/webpack/webpack.impl.ts", + "schema": { + "title": "Node Application Build Target", + "description": "Node application build target options for Build Facade.", + "cli": "nx", + "type": "object", + "properties": { + "main": { + "type": "string", + "description": "The name of the main entry-point file." + }, + "tsConfig": { + "type": "string", + "description": "The name of the Typescript configuration file." + }, + "outputPath": { + "type": "string", + "description": "The output path of the generated files." + }, + "watch": { + "type": "boolean", + "description": "Run build when files change.", + "default": false + }, + "poll": { + "type": "number", + "description": "Frequency of file watcher in ms." + }, + "sourceMap": { + "type": "boolean", + "description": "Produce source maps.", + "default": true + }, + "progress": { + "type": "boolean", + "description": "Log progress to the console while building.", + "default": false + }, + "assets": { + "type": "array", + "description": "List of static application assets.", + "default": [], + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "glob": { + "type": "string", + "description": "The pattern to match." + }, + "input": { + "type": "string", + "description": "The input directory path in which to apply `glob`. Defaults to the project root." + }, + "ignore": { + "description": "An array of globs to ignore.", + "type": "array", + "items": { "type": "string" } + }, + "output": { + "type": "string", + "description": "Absolute path within the output." + } + }, + "additionalProperties": false, + "required": ["glob", "input", "output"] + }, + { "type": "string" } + ] + } + }, + "externalDependencies": { + "oneOf": [ + { "type": "string", "enum": ["none", "all"] }, + { "type": "array", "items": { "type": "string" } } + ], + "description": "Dependencies to keep external to the bundle. (`all` (default), `none`, or an array of module names)", + "default": "all" + }, + "statsJson": { + "type": "boolean", + "description": "Generates a `stats.json` file which can be analyzed using tools such as: `webpack-bundle-analyzer` or ``.", + "default": false + }, + "verbose": { + "type": "boolean", + "description": "Emits verbose output", + "default": false + }, + "extractLicenses": { + "type": "boolean", + "description": "Extract all licenses in a separate file, in the case of production builds only.", + "default": false + }, + "optimization": { + "type": "boolean", + "description": "Defines the optimization level of the build.", + "default": false + }, + "maxWorkers": { + "type": "number", + "description": "Number of workers to use for type checking. (defaults to # of CPUS)" + }, + "memoryLimit": { + "type": "number", + "description": "Memory limit for type checking service process in MB. (defaults to `2048`)", + "default": 2048 + }, + "fileReplacements": { + "description": "Replace files with other files in the build.", + "type": "array", + "items": { + "type": "object", + "properties": { + "replace": { + "type": "string", + "description": "The file to be replaced." + }, + "with": { + "type": "string", + "description": "The file to replace with." + } + }, + "additionalProperties": false, + "required": ["replace", "with"] + }, + "default": [] + }, + "webpackConfig": { + "oneOf": [ + { "type": "array", "items": { "type": "string" } }, + { "type": "string" } + ], + "description": "Path to a function which takes a webpack config, context and returns the resulting webpack config." + }, + "buildLibsFromSource": { + "type": "boolean", + "description": "Read buildable libraries from source instead of building them separately.", + "default": true + }, + "generatePackageJson": { + "type": "boolean", + "description": "Generates a `package.json` file with the project's `node_module` dependencies populated for installing in a container. If a `package.json` exists in the project's directory, it will be reused with dependencies populated.", + "default": false + }, + "transformers": { + "type": "array", + "description": "List of TypeScript Compiler Transfomers Plugins.", + "default": [], + "aliases": ["tsPlugins"], + "items": { + "oneOf": [ + { "type": "string" }, + { + "type": "object", + "properties": { + "name": { "type": "string" }, + "options": { + "type": "object", + "additionalProperties": true + } + }, + "additionalProperties": false, + "required": ["name"] + } + ] + } + }, + "additionalEntryPoints": { + "type": "array", + "items": { + "type": "object", + "properties": { + "entryName": { + "type": "string", + "description": "Name of the additional entry file." + }, + "entryPath": { + "type": "string", + "description": "Path to the additional entry file." + } + } + } + }, + "outputFileName": { + "type": "string", + "description": "Name of the main output file. (defaults to `main.js`)", + "default": "main.js" + } + }, + "required": ["tsConfig", "main"], + "definitions": { + "assetPattern": { + "oneOf": [ + { + "type": "object", + "properties": { + "glob": { + "type": "string", + "description": "The pattern to match." + }, + "input": { + "type": "string", + "description": "The input directory path in which to apply `glob`. Defaults to the project root." + }, + "ignore": { + "description": "An array of globs to ignore.", + "type": "array", + "items": { "type": "string" } + }, + "output": { + "type": "string", + "description": "Absolute path within the output." + } + }, + "additionalProperties": false, + "required": ["glob", "input", "output"] + }, + { "type": "string" } + ] + }, + "transformerPattern": { + "oneOf": [ + { "type": "string" }, + { + "type": "object", + "properties": { + "name": { "type": "string" }, + "options": { "type": "object", "additionalProperties": true } + }, + "additionalProperties": false, + "required": ["name"] + } + ] + } + }, + "presets": [] + }, + "description": "Build a Node application using webpack", + "aliases": [], + "hidden": false, + "path": "/packages/node/src/executors/webpack/schema.json" + }, + { + "name": "node", + "implementation": "/packages/node/src/executors/node/node.impl.ts", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "title": "Node executor", + "description": "Execute Nodejs applications.", + "type": "object", + "properties": { + "buildTarget": { + "type": "string", + "description": "The target to run to build you the app." + }, + "buildTargetOptions": { + "type": "object", + "description": "Additional options to pass into the build target.", + "default": {} + }, + "waitUntilTargets": { + "type": "array", + "description": "The targets to run to before starting the node app.", + "default": [], + "items": { "type": "string" } + }, + "host": { + "type": "string", + "default": "localhost", + "description": "The host to inspect the process on." + }, + "port": { + "type": "number", + "default": 9229, + "description": "The port to inspect the process on. Setting port to 0 will assign random free ports to all forked processes." + }, + "inspect": { + "oneOf": [ + { "type": "string", "enum": ["inspect", "inspect-brk"] }, + { "type": "boolean" } + ], + "description": "Ensures the app is starting with debugging.", + "default": "inspect" + }, + "runtimeArgs": { + "type": "array", + "description": "Extra args passed to the node process.", + "default": [], + "items": { "type": "string" } + }, + "args": { + "type": "array", + "description": "Extra args when starting the app.", + "default": [], + "items": { "type": "string" } + }, + "watch": { + "type": "boolean", + "description": "Enable re-building when files change.", + "default": true + } + }, + "additionalProperties": false, + "required": ["buildTarget"], + "presets": [] + }, + "description": "Execute a Node application", + "aliases": [], + "hidden": false, + "path": "/packages/node/src/executors/node/schema.json" + } + ] +} diff --git a/docs/generated/packages/nx-plugin.json b/docs/generated/packages/nx-plugin.json new file mode 100644 index 0000000000..9101af30bd --- /dev/null +++ b/docs/generated/packages/nx-plugin.json @@ -0,0 +1,340 @@ +{ + "githubRoot": "https://github.com/nrwl/nx/blob/master", + "name": "nx-plugin", + "description": "Plugin for creating plugins for Nx :)", + "root": "/packages/nx-plugin", + "source": "/packages/nx-plugin/src", + "generators": [ + { + "name": "plugin", + "factory": "./src/generators/plugin/plugin", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "$id": "NxPluginPlugin", + "title": "Create a Plugin for Nx", + "description": "Create a Plugin for Nx.", + "type": "object", + "examples": [ + { + "command": "g plugin my-plugin --directory=plugins --importPath=@myorg/my-plugin", + "description": "Generate `libs/plugins/my-plugin`" + } + ], + "properties": { + "name": { + "type": "string", + "description": "Plugin name", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the plugin?" + }, + "directory": { + "type": "string", + "description": "A directory where the plugin is placed.", + "alias": "d" + }, + "importPath": { + "type": "string", + "description": "How the plugin will be published, like `@myorg/my-awesome-plugin`. Note this must be a valid NPM name." + }, + "linter": { + "description": "The tool to use for running lint checks.", + "type": "string", + "enum": ["eslint", "tslint"], + "default": "eslint" + }, + "unitTestRunner": { + "type": "string", + "enum": ["jest", "none"], + "description": "Test runner to use for unit tests.", + "default": "jest" + }, + "tags": { + "type": "string", + "description": "Add tags to the library (used for linting).", + "alias": "t" + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + }, + "skipTsConfig": { + "type": "boolean", + "default": false, + "description": "Do not update tsconfig.json for development experience." + }, + "standaloneConfig": { + "description": "Split the project configuration into `/project.json` rather than including it inside `workspace.json`.", + "type": "boolean" + }, + "setParserOptionsProject": { + "type": "boolean", + "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.", + "default": false + }, + "compiler": { + "type": "string", + "enum": ["tsc", "swc"], + "default": "tsc", + "description": "The compiler used by the build and test targets." + } + }, + "required": ["name"], + "additionalProperties": false, + "presets": [] + }, + "description": "Create a Nx Plugin", + "implementation": "/packages/nx-plugin/src/generators/plugin/plugin.ts", + "aliases": [], + "hidden": false, + "path": "/packages/nx-plugin/src/generators/plugin/schema.json" + }, + { + "name": "e2e-project", + "factory": "./src/generators/e2e-project/e2e", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "$id": "NxPluginE2E", + "title": "Create an E2E app for a Nx Plugin", + "description": "Create an E2E app for a Nx Plugin.", + "type": "object", + "properties": { + "pluginName": { + "type": "string", + "description": "the name of the plugin to be tested." + }, + "npmPackageName": { + "type": "string", + "description": "the name of the package that would be published to NPM." + }, + "projectDirectory": { + "type": "string", + "description": "the directory where the plugin is placed." + }, + "pluginOutputPath": { + "type": "string", + "description": "the output path of the plugin after it builds." + }, + "jestConfig": { + "type": "string", + "description": "Jest config file." + }, + "tsSpecConfig": { + "type": "string", + "description": "Spec `tsconfig` file.", + "x-deprecated": true + }, + "standaloneConfig": { + "description": "Split the project configuration into `/project.json` rather than including it inside `workspace.json`.", + "type": "boolean" + } + }, + "required": ["pluginName", "npmPackageName"], + "additionalProperties": false, + "presets": [] + }, + "description": "Create a e2e application for a Nx Plugin", + "hidden": true, + "implementation": "/packages/nx-plugin/src/generators/e2e-project/e2e.ts", + "aliases": [], + "path": "/packages/nx-plugin/src/generators/e2e-project/schema.json" + }, + { + "name": "migration", + "factory": "./src/generators/migration/migration", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "$id": "NxPluginMigration", + "title": "Create a Migration for an Nx Plugin", + "description": "Create a Migration for an Nx Plugin.", + "type": "object", + "examples": [ + { + "command": "nx g migration my-migration --project=my-plugin --version=1.0.0", + "description": "Generate `libs/my-plugin/src/migrations/my-migration`" + } + ], + "properties": { + "project": { + "type": "string", + "description": "The name of the project.", + "alias": "p", + "$default": { "$source": "projectName" }, + "x-prompt": "What is the name of the project for the migration?" + }, + "name": { + "type": "string", + "description": "Migration name.", + "$default": { "$source": "argv", "index": 0 } + }, + "description": { + "type": "string", + "description": "Migration description.", + "alias": "d" + }, + "packageVersion": { + "type": "string", + "description": "Version to use for the migration.", + "alias": "v", + "x-prompt": "What version would you like to use for the migration?" + }, + "packageJsonUpdates": { + "type": "boolean", + "description": "Whether or not to include `package.json` updates.", + "alias": "p", + "default": false + } + }, + "required": ["project", "packageVersion"], + "additionalProperties": false, + "presets": [] + }, + "description": "Create a migration for an Nx Plugin", + "implementation": "/packages/nx-plugin/src/generators/migration/migration.ts", + "aliases": [], + "hidden": false, + "path": "/packages/nx-plugin/src/generators/migration/schema.json" + }, + { + "name": "generator", + "factory": "./src/generators/generator/generator", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "$id": "NxPluginGenerator", + "title": "Create a Generator for an Nx Plugin", + "description": "Create a Generator for an Nx Plugin.", + "type": "object", + "examples": [ + { + "command": "nx g generator my-generator --project=my-plugin", + "description": "Generate `libs/my-plugin/src/generators/my-generator`" + } + ], + "properties": { + "project": { + "type": "string", + "description": "The name of the project.", + "alias": "p", + "$default": { "$source": "projectName" }, + "x-prompt": "What is the name of the project for the generator?" + }, + "name": { + "type": "string", + "description": "Generator name.", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the generator?" + }, + "description": { + "type": "string", + "description": "Generator description.", + "alias": "d" + }, + "unitTestRunner": { + "type": "string", + "enum": ["jest", "none"], + "description": "Test runner to use for unit tests.", + "default": "jest" + } + }, + "required": ["project", "name"], + "additionalProperties": false, + "presets": [] + }, + "description": "Create a generator for an Nx Plugin", + "implementation": "/packages/nx-plugin/src/generators/generator/generator.ts", + "aliases": [], + "hidden": false, + "path": "/packages/nx-plugin/src/generators/generator/schema.json" + }, + { + "name": "executor", + "factory": "./src/generators/executor/executor", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "$id": "NxPluginExecutor", + "title": "Create a Executor for an Nx Plugin", + "description": "Create a Executor for an Nx Plugin.", + "type": "object", + "examples": [ + { + "command": "nx g executor my-executor --project=my-plugin", + "description": "Generate `libs/my-plugin/src/executors/my-executor`" + } + ], + "properties": { + "project": { + "type": "string", + "description": "The name of the project.", + "alias": "p", + "$default": { "$source": "projectName" }, + "x-prompt": "What is the name of the project for the executor?" + }, + "name": { + "type": "string", + "description": "Executor name.", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the executor?" + }, + "description": { + "type": "string", + "description": "Executor description.", + "alias": "d" + }, + "unitTestRunner": { + "type": "string", + "enum": ["jest", "none"], + "description": "Test runner to use for unit tests.", + "default": "jest" + } + }, + "required": ["project", "name"], + "additionalProperties": false, + "presets": [] + }, + "description": "Create a executor for an Nx Plugin", + "implementation": "/packages/nx-plugin/src/generators/executor/executor.ts", + "aliases": [], + "hidden": false, + "path": "/packages/nx-plugin/src/generators/executor/schema.json" + } + ], + "executors": [ + { + "name": "e2e", + "implementation": "/packages/nx-plugin/src/executors/e2e/e2e.impl.ts", + "schema": { + "title": "Nx Plugin Playground Target", + "description": "Creates a playground for a Nx Plugin.", + "cli": "nx", + "type": "object", + "properties": { + "target": { + "description": "The build target for the Nx Plugin project.", + "type": "string" + }, + "jestConfig": { + "type": "string", + "description": "Jest config file." + }, + "tsSpecConfig": { + "type": "string", + "description": "The tsconfig file for specs.", + "x-deprecated": "Use the `tsconfig` property for `ts-jest` in the e2e project `jest.config.js` file. It will be removed in the next major release." + } + }, + "additionalProperties": false, + "required": ["target", "jestConfig"], + "presets": [] + }, + "description": "Creates and runs the e2e tests for an Nx Plugin.", + "aliases": [], + "hidden": false, + "path": "/packages/nx-plugin/src/executors/e2e/schema.json" + } + ] +} diff --git a/docs/generated/packages/nx.json b/docs/generated/packages/nx.json new file mode 100644 index 0000000000..a50cf41132 --- /dev/null +++ b/docs/generated/packages/nx.json @@ -0,0 +1,9 @@ +{ + "githubRoot": "https://github.com/nrwl/nx/blob/master", + "name": "nx", + "description": "Smart, Fast and Extensible Build System", + "root": "/packages/nx", + "source": "/packages/nx/src", + "generators": [], + "executors": [] +} diff --git a/docs/generated/packages/react-native.json b/docs/generated/packages/react-native.json new file mode 100644 index 0000000000..b529f5ca2a --- /dev/null +++ b/docs/generated/packages/react-native.json @@ -0,0 +1,786 @@ +{ + "githubRoot": "https://github.com/nrwl/nx/blob/master", + "name": "react-native", + "description": "React Native Plugin for Nx", + "root": "/packages/react-native", + "source": "/packages/react-native/src", + "generators": [ + { + "name": "init", + "factory": "./src/generators/init/init#reactNativeInitGenerator", + "schema": { + "cli": "nx", + "$id": "NxReactNativeInit", + "$schema": "http://json-schema.org/schema", + "title": "Add Nx React Native Schematics", + "description": "Add Nx React native schematics.", + "type": "object", + "properties": { + "unitTestRunner": { + "description": "Adds the specified unit test runner.", + "type": "string", + "enum": ["jest", "none"], + "default": "jest" + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + }, + "e2eTestRunner": { + "description": "Adds the specified E2E test runner.", + "type": "string", + "enum": ["detox", "none"], + "default": "detox" + } + }, + "required": [], + "presets": [] + }, + "description": "Initialize the @nrwl/react-native plugin", + "hidden": true, + "implementation": "/packages/react-native/src/generators/init/init#reactNativeInitGenerator.ts", + "aliases": [], + "path": "/packages/react-native/src/generators/init/schema.json" + }, + { + "name": "application", + "factory": "./src/generators/application/application#reactNativeApplicationGenerator", + "schema": { + "cli": "nx", + "$id": "NxReactNativeApplication", + "$schema": "http://json-schema.org/schema", + "title": "Create a React Application for Nx", + "description": "Create a React Application for Nx.", + "examples": [ + { + "command": "nx g app myapp --directory=nested", + "description": "Generate `apps/nested/myapp`" + }, + { + "command": "nx g app myapp --classComponent", + "description": "Use class components instead of functional components" + } + ], + "type": "object", + "properties": { + "name": { + "description": "The name of the application.", + "type": "string", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the application?" + }, + "displayName": { + "description": "The display name to show in the application. Defaults to name.", + "type": "string" + }, + "directory": { + "description": "The directory of the new application.", + "type": "string", + "alias": "d" + }, + "skipFormat": { + "description": "Skip formatting files", + "type": "boolean", + "default": false + }, + "linter": { + "description": "The tool to use for running lint checks.", + "type": "string", + "enum": ["eslint", "tslint"], + "default": "eslint" + }, + "unitTestRunner": { + "type": "string", + "enum": ["jest", "none"], + "description": "Test runner to use for unit tests", + "default": "jest" + }, + "tags": { + "type": "string", + "description": "Add tags to the application (used for linting).", + "alias": "t" + }, + "js": { + "type": "boolean", + "description": "Generate JavaScript files rather than TypeScript files", + "default": false + }, + "setParserOptionsProject": { + "type": "boolean", + "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.", + "default": false + }, + "e2eTestRunner": { + "description": "Adds the specified e2e test runner.", + "type": "string", + "enum": ["detox", "none"], + "default": "detox" + } + }, + "required": [], + "presets": [] + }, + "aliases": ["app"], + "x-type": "application", + "description": "Create a React Native application", + "implementation": "/packages/react-native/src/generators/application/application#reactNativeApplicationGenerator.ts", + "hidden": false, + "path": "/packages/react-native/src/generators/application/schema.json" + }, + { + "name": "library", + "factory": "./src/generators/library/library#reactNativeLibraryGenerator", + "schema": { + "cli": "nx", + "$id": "NxReactNativeLibrary", + "$schema": "http://json-schema.org/schema", + "title": "Create a React Native Library for Nx", + "description": "Create a React Native Library for Nx.", + "type": "object", + "examples": [ + { + "command": "nx g lib mylib --directory=myapp", + "description": "Generate `libs/myapp/mylib`" + } + ], + "properties": { + "name": { + "type": "string", + "description": "Library name.", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the library?", + "pattern": "^[a-zA-Z].*$" + }, + "directory": { + "type": "string", + "description": "A directory where the lib is placed.", + "alias": "d" + }, + "linter": { + "description": "The tool to use for running lint checks.", + "type": "string", + "enum": ["eslint", "tslint"], + "default": "eslint" + }, + "unitTestRunner": { + "type": "string", + "enum": ["jest", "none"], + "description": "Test runner to use for unit tests.", + "default": "jest" + }, + "tags": { + "type": "string", + "description": "Add tags to the library (used for linting).", + "alias": "t" + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + }, + "skipTsConfig": { + "type": "boolean", + "default": false, + "description": "Do not update `tsconfig.json` for development experience." + }, + "pascalCaseFiles": { + "type": "boolean", + "description": "Use pascal case component file name (e.g. `App.tsx`).", + "alias": "P", + "default": false + }, + "publishable": { + "type": "boolean", + "description": "Create a publishable library." + }, + "buildable": { + "type": "boolean", + "default": false, + "description": "Generate a buildable library." + }, + "importPath": { + "type": "string", + "description": "The library name used to import it, like `@myorg/my-awesome-lib`." + }, + "js": { + "type": "boolean", + "description": "Generate JavaScript files rather than TypeScript files.", + "default": false + }, + "globalCss": { + "type": "boolean", + "description": "When `true`, the stylesheet is generated using global CSS instead of CSS modules (e.g. file is `*.css` rather than `*.module.css`).", + "default": false + }, + "strict": { + "type": "boolean", + "description": "Whether to enable tsconfig strict mode or not.", + "default": true + }, + "setParserOptionsProject": { + "type": "boolean", + "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.", + "default": false + } + }, + "required": ["name"], + "presets": [] + }, + "aliases": ["lib"], + "x-type": "library", + "description": "Create a React Native library", + "implementation": "/packages/react-native/src/generators/library/library#reactNativeLibraryGenerator.ts", + "hidden": false, + "path": "/packages/react-native/src/generators/library/schema.json" + }, + { + "name": "component", + "factory": "./src/generators/component/component#reactNativeComponentGenerator", + "schema": { + "cli": "nx", + "$id": "NxReactNativeApplication", + "$schema": "http://json-schema.org/schema", + "title": "Create a React Native Component for Nx", + "description": "Create a React native Component for Nx.", + "type": "object", + "examples": [ + { + "command": "nx g component my-component --project=mylib", + "description": "Generate a component in the `mylib` library" + }, + { + "command": "nx g component my-component --project=mylib --classComponent", + "description": "Generate a class component in the `mylib` library" + } + ], + "properties": { + "project": { + "type": "string", + "description": "The name of the project.", + "alias": "p", + "$default": { "$source": "projectName" }, + "x-prompt": "What is the name of the project for this component?" + }, + "name": { + "type": "string", + "description": "The name of the component.", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the component?" + }, + "js": { + "type": "boolean", + "description": "Generate JavaScript files rather than TypeScript files.", + "default": false + }, + "skipTests": { + "type": "boolean", + "description": "When true, does not create `spec.ts` test files for the new component.", + "default": false + }, + "directory": { + "type": "string", + "description": "Create the component under this directory (can be nested).", + "alias": "d" + }, + "flat": { + "type": "boolean", + "description": "Create component at the source root rather than its own directory.", + "default": false + }, + "export": { + "type": "boolean", + "description": "When true, the component is exported from the project `index.ts` (if it exists).", + "alias": "e", + "default": false, + "x-prompt": "Should this component be exported in the project?" + }, + "pascalCaseFiles": { + "type": "boolean", + "description": "Use pascal case component file name (e.g. `App.tsx`).", + "alias": "P", + "default": false + }, + "classComponent": { + "type": "boolean", + "alias": "C", + "description": "Use class components instead of functional component.", + "default": false + } + }, + "required": ["name", "project"], + "presets": [] + }, + "description": "Create a React Native component", + "aliases": ["c"], + "implementation": "/packages/react-native/src/generators/component/component#reactNativeComponentGenerator.ts", + "hidden": false, + "path": "/packages/react-native/src/generators/component/schema.json" + }, + { + "name": "storybook-configuration", + "factory": "./src/generators/storybook-configuration/configuration#storybookConfigurationGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "$id": "NxReactNativeStorybookConfigure", + "title": "React native Storybook configuration", + "description": "Set up Storybook for a React-Native app or library", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Project name.", + "$default": { "$source": "argv", "index": 0 } + }, + "generateStories": { + "type": "boolean", + "description": "Automatically generate *.stories.ts files for components declared in this project?", + "x-prompt": "Automatically generate *.stories.ts files for components declared in this project?", + "default": true + }, + "js": { + "type": "boolean", + "description": "Generate JavaScript files rather than TypeScript files.", + "default": false + }, + "linter": { + "description": "The tool to use for running lint checks.", + "type": "string", + "enum": ["eslint", "tslint"], + "default": "eslint" + }, + "standaloneConfig": { + "description": "Split the project configuration into `/project.json` rather than including it inside `workspace.json`.", + "type": "boolean" + } + }, + "required": ["name"], + "presets": [] + }, + "description": "Set up storybook for a react-native app or library", + "hidden": false, + "implementation": "/packages/react-native/src/generators/storybook-configuration/configuration#storybookConfigurationGenerator.ts", + "aliases": [], + "path": "/packages/react-native/src/generators/storybook-configuration/schema.json" + }, + { + "name": "component-story", + "factory": "./src/generators/component-story/component-story#componentStoryGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "$id": "NxReactNativeComponentStory", + "title": "React native component story", + "description": "Generate storybook story for a react-native component.", + "type": "object", + "properties": { + "project": { + "type": "string", + "description": "The project name where to add the components.", + "examples": ["shared-ui-component"], + "$default": { "$source": "projectName", "index": 0 }, + "x-prompt": "What's the name of the project where the component lives?" + }, + "componentPath": { + "type": "string", + "description": "Relative path to the component file from the library root.", + "examples": ["lib/components"], + "x-prompt": "What's path of the component relative to the project's lib root?" + } + }, + "required": ["project", "componentPath"], + "presets": [] + }, + "description": "Generate storybook story for a react-native component", + "hidden": false, + "implementation": "/packages/react-native/src/generators/component-story/component-story#componentStoryGenerator.ts", + "aliases": [], + "path": "/packages/react-native/src/generators/component-story/schema.json" + }, + { + "name": "stories", + "factory": "./src/generators/stories/stories#storiesGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "$id": "NxReactNativeStorybookStories", + "title": "React native Storybook stories", + "description": "React native Storybook stories.", + "type": "object", + "properties": { + "project": { + "type": "string", + "description": "Library or application name.", + "$default": { "$source": "projectName", "index": 0 }, + "x-prompt": "What's the name of the project for which you want to generate stories?" + } + }, + "required": ["project"], + "presets": [] + }, + "description": "Create stories/specs for all components declared in an app or library", + "hidden": false, + "implementation": "/packages/react-native/src/generators/stories/stories#storiesGenerator.ts", + "aliases": [], + "path": "/packages/react-native/src/generators/stories/schema.json" + } + ], + "executors": [ + { + "name": "run-android", + "implementation": "/packages/react-native/src/executors/run-android/run-android.impl.ts", + "schema": { + "cli": "nx", + "$id": "NxReactNativeRunAndroid", + "$schema": "http://json-schema.org/schema", + "title": "Run Android application", + "description": "Run Android target options.", + "type": "object", + "presets": [ + { + "name": "Run Android without cache", + "keys": ["variant", "sync", "port", "packager", "resetCache"] + } + ], + "properties": { + "variant": { + "type": "string", + "description": "Specify your app's build variant (e.g. `debug`, `release`).", + "default": "debug", + "examples": ["debug", "release"] + }, + "appId": { + "type": "string", + "description": "Specify an `applicationId` to launch after build. If not specified, `package` from `AndroidManifest.xml` will be used." + }, + "appIdSuffix": { + "type": "string", + "description": "Specify an `applicationIdSuffix` to launch after build." + }, + "mainActivity": { + "type": "string", + "description": "Name of the activity to start.", + "default": "MainActivity" + }, + "deviceId": { + "type": "string", + "description": "Builds your app and starts it on a specific device/simulator with the given device id (listed by running `adb devices` on the command line)." + }, + "tasks": { + "type": "string", + "description": "Run custom Gradle tasks. If this argument is provided, then `--variant` option is ignored. Example: `yarn react-native run-android --tasks clean,installDebug`." + }, + "jetifier": { + "type": "boolean", + "description": "Run Jetifier – the AndroidX transition tool. By default it runs before Gradle to ease working with libraries that don't support AndroidX yet.", + "default": true + }, + "sync": { + "type": "boolean", + "description": "Syncs npm dependencies to `package.json` (for React Native autolink).", + "default": true + }, + "port": { + "type": "number", + "description": "The port where the packager server is listening on.", + "default": 8081 + }, + "terminal": { + "type": "string", + "description": "Launches the Metro Bundler in a new window using the specified terminal path." + }, + "packager": { + "type": "boolean", + "description": "Starts the packager server.", + "default": true + }, + "resetCache": { + "type": "boolean", + "description": "Resets metro cache.", + "default": false + }, + "interactive": { + "type": "boolean", + "description": "Run packager server in interactive mode.", + "default": true + } + } + }, + "description": "Runs Android application.", + "aliases": [], + "hidden": false, + "path": "/packages/react-native/src/executors/run-android/schema.json" + }, + { + "name": "run-ios", + "implementation": "/packages/react-native/src/executors/run-ios/run-ios.impl.ts", + "schema": { + "cli": "nx", + "$id": "NxReactNativeRunIos", + "$schema": "http://json-schema.org/schema", + "title": "Run iOS application", + "description": "Run iOS target options.", + "type": "object", + "presets": [ + { + "name": "Run iOS without cache", + "keys": [ + "xcodeConfiguration", + "install", + "sync", + "port", + "packager", + "resetCache" + ] + } + ], + "properties": { + "xcodeConfiguration": { + "type": "string", + "description": "Explicitly set the Xcode configuration to use.", + "default": "Debug", + "examples": ["Debug", "Release"] + }, + "scheme": { + "type": "string", + "description": "Explicitly set the Xcode scheme to use." + }, + "simulator": { + "type": "string", + "description": "Explicitly set simulator to use. Optionally include iOS version between parenthesis at the end to match an exact version: `iPhone X (12.1)`.", + "default": "iPhone X", + "examples": ["iPhone X"] + }, + "device": { + "type": "string", + "description": "Explicitly set device to use by name. The value is not required if you have a single device connected." + }, + "install": { + "type": "boolean", + "description": "Runs `pod install` for native modules before building iOS app.", + "default": true + }, + "sync": { + "type": "boolean", + "description": "Syncs npm dependencies to `package.json` (for React Native autolink). Always true when `--install` is used.", + "default": true + }, + "port": { + "type": "number", + "description": "The port where the packager server is listening on.", + "default": 8081 + }, + "terminal": { + "type": "string", + "description": "Launches the Metro Bundler in a new window using the specified terminal path." + }, + "packager": { + "type": "boolean", + "description": "Starts the packager server.", + "default": true + }, + "resetCache": { + "type": "boolean", + "description": "Resets metro cache.", + "default": false + }, + "interactive": { + "type": "boolean", + "description": "Run packager server in interactive mode.", + "default": true + } + } + }, + "description": "Runs iOS application.", + "aliases": [], + "hidden": false, + "path": "/packages/react-native/src/executors/run-ios/schema.json" + }, + { + "name": "bundle", + "implementation": "/packages/react-native/src/executors/bundle/bundle.impl.ts", + "schema": { + "cli": "nx", + "$id": "NxReactNativeBundle", + "$schema": "http://json-schema.org/schema", + "title": "Offline JS Bundle for React Native", + "description": "JS Bundle target options.", + "type": "object", + "properties": { + "dev": { + "type": "boolean", + "description": "Generate a development build.", + "default": true + }, + "entryFile": { + "type": "string", + "description": "The entry file relative to project root." + }, + "bundleOutput": { + "type": "string", + "description": "The output path of the generated files." + }, + "maxWorkers": { + "type": "number", + "description": "The number of workers we should parallelize the transformer on." + }, + "sourceMap": { + "type": "boolean", + "description": "Whether source maps should be generated or not." + }, + "platform": { + "description": "Platform to build for (`ios`, `android`).", + "type": "string" + } + }, + "required": ["platform", "entryFile", "bundleOutput"], + "presets": [] + }, + "description": "Builds the JavaScript bundle for offline use.", + "aliases": [], + "hidden": false, + "path": "/packages/react-native/src/executors/bundle/schema.json" + }, + { + "name": "build-android", + "implementation": "/packages/react-native/src/executors/build-android/build-android.impl.ts", + "schema": { + "cli": "nx", + "$id": "NxReactNativeBuildAndroid", + "$schema": "http://json-schema.org/schema", + "title": "Release Build for Android", + "description": "Build target options for Android.", + "type": "object", + "properties": { + "apk": { + "type": "boolean", + "description": "Generate apk file(s) rather than a bundle (`.aab`)." + }, + "debug": { + "type": "boolean", + "description": "Generate a debug build instead of a release build." + } + }, + "required": [], + "presets": [] + }, + "description": "Release Build for Android.", + "aliases": [], + "hidden": false, + "path": "/packages/react-native/src/executors/build-android/schema.json" + }, + { + "name": "start", + "implementation": "/packages/react-native/src/executors/start/start.impl.ts", + "schema": { + "cli": "nx", + "$id": "NxReactNativeStart", + "$schema": "http://json-schema.org/schema", + "title": "Packager Server for React Native", + "description": "Packager Server target options.", + "type": "object", + "properties": { + "port": { + "type": "number", + "description": "The port to listen on.", + "default": 8081 + }, + "resetCache": { + "type": "boolean", + "description": "Resets metro cache.", + "default": false + }, + "interactive": { + "type": "boolean", + "description": "Run packager server in interactive mode.", + "default": true + } + }, + "presets": [] + }, + "description": "Starts the Javascript server that communicates with connected devices.", + "aliases": [], + "hidden": false, + "path": "/packages/react-native/src/executors/start/schema.json" + }, + { + "name": "sync-deps", + "implementation": "/packages/react-native/src/executors/sync-deps/sync-deps.impl.ts", + "schema": { + "cli": "nx", + "$id": "NxReactNativeSyncDeps", + "$schema": "http://json-schema.org/schema", + "title": "Sync Deps for React Native", + "description": "Updates `package.json` with project dependencies.", + "type": "object", + "properties": { + "include": { + "type": "string", + "description": "A comma-separated list of additional npm packages to include. e.g. `nx sync-deps --include=react-native-gesture-handler,react-native-safe-area-context`" + } + }, + "presets": [] + }, + "description": "Syncs dependencies to package.json (required for autolinking).", + "aliases": [], + "hidden": false, + "path": "/packages/react-native/src/executors/sync-deps/schema.json" + }, + { + "name": "ensure-symlink", + "implementation": "/packages/react-native/src/executors/ensure-symlink/ensure-symlink.impl.ts", + "schema": { + "cli": "nx", + "$id": "NxReactNativeEnsureSymlink", + "$schema": "http://json-schema.org/schema", + "title": "Ensure Symlink for React Native", + "description": "Ensure workspace node_modules is symlink under app's node_modules folder.", + "type": "object", + "properties": {}, + "presets": [] + }, + "description": "Ensure workspace node_modules is symlink under app's node_modules folder.", + "aliases": [], + "hidden": false, + "path": "/packages/react-native/src/executors/ensure-symlink/schema.json" + }, + { + "name": "storybook", + "implementation": "/packages/react-native/src/executors/storybook/storybook.impl.ts", + "schema": { + "title": "React Native Storybook Load Stories", + "cli": "nx", + "description": "Load stories for react native.", + "type": "object", + "properties": { + "searchDir": { + "type": "string", + "description": "The directory or directories, relative to the project root, to search for files in." + }, + "outputFile": { + "type": "string", + "description": "The output file that will be written. It is relative to the project directory.", + "default": "./.storybook/story-loader.js" + }, + "pattern": { + "type": "string", + "description": "The pattern of files to look at. It can be a specific file, or any valid glob. Note: if using the CLI, globs with `**/*...` must be escaped with quotes", + "default": "**/*.stories.@(js|jsx|ts|tsx|md)" + }, + "silent": { + "type": "boolean", + "description": "Silences output.", + "default": false + } + }, + "required": ["searchDir", "outputFile", "pattern"], + "presets": [] + }, + "description": "Serve React Native Storybook", + "aliases": [], + "hidden": false, + "path": "/packages/react-native/src/executors/storybook/schema.json" + } + ] +} diff --git a/docs/generated/packages/react.json b/docs/generated/packages/react.json new file mode 100644 index 0000000000..ac92bf2ea6 --- /dev/null +++ b/docs/generated/packages/react.json @@ -0,0 +1,872 @@ +{ + "githubRoot": "https://github.com/nrwl/nx/blob/master", + "name": "react", + "description": "React Plugin for Nx", + "root": "/packages/react", + "source": "/packages/react/src", + "generators": [ + { + "name": "init", + "factory": "./src/generators/init/init#reactInitGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxReactNgInit", + "title": "Init React Plugin", + "description": "Initialize a React Plugin", + "cli": "nx", + "type": "object", + "properties": { + "unitTestRunner": { + "description": "Adds the specified unit test runner.", + "type": "string", + "enum": ["jest", "none"], + "default": "jest" + }, + "e2eTestRunner": { + "description": "Adds the specified e2e test runner.", + "type": "string", + "enum": ["cypress", "none"], + "default": "cypress" + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + } + }, + "required": [], + "presets": [] + }, + "description": "Initialize the @nrwl/react plugin", + "aliases": ["ng-add"], + "hidden": true, + "implementation": "/packages/react/src/generators/init/init#reactInitGenerator.ts", + "path": "/packages/react/src/generators/init/schema.json" + }, + { + "name": "application", + "factory": "./src/generators/application/application#applicationGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "$id": "NxReactApp", + "title": "Create a React Application", + "description": "Create a React application for Nx.", + "examples": [ + { + "command": "nx g app myapp --directory=myorg", + "description": "Generate apps/myorg/myapp and apps/myorg/myapp-e2e" + }, + { + "command": "nx g app myapp --classComponent", + "description": "Use class components instead of functional components" + }, + { + "command": "nx g app myapp --routing", + "description": "Set up React Router" + } + ], + "type": "object", + "properties": { + "name": { + "description": "The name of the application.", + "type": "string", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the application?", + "pattern": "^[a-zA-Z].*$" + }, + "directory": { + "description": "The directory of the new application.", + "type": "string", + "alias": "dir" + }, + "style": { + "description": "The file extension to be used for style files.", + "type": "string", + "default": "css", + "alias": "s", + "x-prompt": { + "message": "Which stylesheet format would you like to use?", + "type": "list", + "items": [ + { "value": "css", "label": "CSS" }, + { + "value": "scss", + "label": "SASS(.scss) [ http://sass-lang.com ]" + }, + { + "value": "styl", + "label": "Stylus(.styl) [ http://stylus-lang.com ]" + }, + { + "value": "less", + "label": "LESS [ http://lesscss.org ]" + }, + { + "value": "styled-components", + "label": "styled-components [ https://styled-components.com ]" + }, + { + "value": "@emotion/styled", + "label": "emotion [ https://emotion.sh ]" + }, + { + "value": "styled-jsx", + "label": "styled-jsx [ https://www.npmjs.com/package/styled-jsx ]" + }, + { "value": "none", "label": "None" } + ] + } + }, + "linter": { + "description": "The tool to use for running lint checks.", + "type": "string", + "enum": ["eslint", "tslint"], + "default": "eslint" + }, + "routing": { + "type": "boolean", + "description": "Generate application with routes.", + "x-prompt": "Would you like to add React Router to this application?", + "default": false + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + }, + "skipWorkspaceJson": { + "description": "Skip updating `workspace.json` with default options based on values provided to this app (e.g. babel, style).", + "type": "boolean", + "default": false + }, + "unitTestRunner": { + "type": "string", + "enum": ["jest", "none"], + "description": "Test runner to use for unit tests.", + "default": "jest" + }, + "e2eTestRunner": { + "type": "string", + "enum": ["cypress", "none"], + "description": "Test runner to use for end to end (E2E) tests.", + "default": "cypress" + }, + "tags": { + "type": "string", + "description": "Add tags to the application (used for linting).", + "alias": "t" + }, + "pascalCaseFiles": { + "type": "boolean", + "description": "Use pascal case component file name (e.g. `App.tsx`).", + "alias": "P", + "default": false + }, + "classComponent": { + "type": "boolean", + "description": "Use class components instead of functional component.", + "alias": "C", + "default": false + }, + "js": { + "type": "boolean", + "description": "Generate JavaScript files rather than TypeScript files.", + "default": false + }, + "globalCss": { + "type": "boolean", + "description": "Default is `false`. When `true`, the component is generated with `*.css`/`*.scss` instead of `*.module.css`/`*.module.scss`.", + "default": false + }, + "strict": { + "type": "boolean", + "description": "Creates an application with strict mode and strict type checking.", + "default": true + }, + "setParserOptionsProject": { + "type": "boolean", + "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.", + "default": false + }, + "standaloneConfig": { + "description": "Split the project configuration into `/project.json` rather than including it inside `workspace.json`.", + "type": "boolean" + }, + "compiler": { + "type": "string", + "description": "The compiler to use.", + "enum": ["babel", "swc"], + "default": "babel" + } + }, + "required": [], + "presets": [] + }, + "aliases": ["app"], + "x-type": "application", + "description": "Create a React application", + "implementation": "/packages/react/src/generators/application/application#applicationGenerator.ts", + "hidden": false, + "path": "/packages/react/src/generators/application/schema.json" + }, + { + "name": "library", + "factory": "./src/generators/library/library#libraryGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "$id": "NxReactLibrary", + "title": "Create a React Library", + "description": "Create a React Library for an Nx workspace", + "type": "object", + "examples": [ + { + "command": "nx g lib mylib --directory=myapp", + "description": "Generate libs/myapp/mylib" + }, + { + "command": "nx g lib mylib --appProject=myapp", + "description": "Generate a library with routes and add them to myapp" + } + ], + "properties": { + "name": { + "type": "string", + "description": "Library name", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the library?", + "pattern": "^[a-zA-Z].*$" + }, + "directory": { + "type": "string", + "description": "A directory where the lib is placed.", + "alias": "dir" + }, + "style": { + "description": "The file extension to be used for style files.", + "type": "string", + "default": "css", + "alias": "s", + "x-prompt": { + "message": "Which stylesheet format would you like to use?", + "type": "list", + "items": [ + { "value": "css", "label": "CSS" }, + { + "value": "scss", + "label": "SASS(.scss) [ http://sass-lang.com ]" + }, + { + "value": "styl", + "label": "Stylus(.styl) [ http://stylus-lang.com ]" + }, + { + "value": "less", + "label": "LESS [ http://lesscss.org ]" + }, + { + "value": "styled-components", + "label": "styled-components [ https://styled-components.com ]" + }, + { + "value": "@emotion/styled", + "label": "emotion [ https://emotion.sh ]" + }, + { + "value": "styled-jsx", + "label": "styled-jsx [ https://www.npmjs.com/package/styled-jsx ]" + }, + { "value": "none", "label": "None" } + ] + } + }, + "linter": { + "description": "The tool to use for running lint checks.", + "type": "string", + "enum": ["eslint", "tslint"], + "default": "eslint" + }, + "unitTestRunner": { + "type": "string", + "enum": ["jest", "none"], + "description": "Test runner to use for unit tests.", + "default": "jest" + }, + "tags": { + "type": "string", + "description": "Add tags to the library (used for linting).", + "alias": "t" + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + }, + "skipTsConfig": { + "type": "boolean", + "default": false, + "description": "Do not update `tsconfig.json` for development experience." + }, + "pascalCaseFiles": { + "type": "boolean", + "description": "Use pascal case component file name (e.g. `App.tsx`).", + "alias": "P", + "default": false + }, + "routing": { + "type": "boolean", + "description": "Generate library with routes." + }, + "appProject": { + "type": "string", + "description": "The application project to add the library route to.", + "alias": "a" + }, + "publishable": { + "type": "boolean", + "description": "Create a publishable library." + }, + "buildable": { + "type": "boolean", + "default": false, + "description": "Generate a buildable library." + }, + "importPath": { + "type": "string", + "description": "The library name used to import it, like `@myorg/my-awesome-lib`." + }, + "component": { + "type": "boolean", + "description": "Generate a default component.", + "default": true + }, + "js": { + "type": "boolean", + "description": "Generate JavaScript files rather than TypeScript files.", + "default": false + }, + "globalCss": { + "type": "boolean", + "description": "When `true`, the stylesheet is generated using global CSS instead of CSS modules (e.g. file is `*.css` rather than `*.module.css`).", + "default": false + }, + "strict": { + "type": "boolean", + "description": "Whether to enable tsconfig strict mode or not.", + "default": true + }, + "setParserOptionsProject": { + "type": "boolean", + "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.", + "default": false + }, + "standaloneConfig": { + "description": "Split the project configuration into `/project.json` rather than including it inside `workspace.json`.", + "type": "boolean" + }, + "compiler": { + "type": "string", + "enum": ["babel", "swc"], + "default": "babel", + "description": "Which compiler to use." + } + }, + "required": ["name"], + "presets": [] + }, + "aliases": ["lib"], + "x-type": "library", + "description": "Create a React library", + "implementation": "/packages/react/src/generators/library/library#libraryGenerator.ts", + "hidden": false, + "path": "/packages/react/src/generators/library/schema.json" + }, + { + "name": "component", + "factory": "./src/generators/component/component#componentGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "$id": "NxReactComponent", + "title": "Create a React Component", + "description": "Create a React Component for Nx.", + "type": "object", + "examples": [ + { + "command": "nx g component my-component --project=mylib", + "description": "Generate a component in the mylib library" + }, + { + "command": "nx g component my-component --project=mylib --classComponent", + "description": "Generate a class component in the mylib library" + } + ], + "properties": { + "project": { + "type": "string", + "description": "The name of the project.", + "alias": "p", + "$default": { "$source": "projectName" }, + "x-prompt": "What is the name of the project for this component?" + }, + "name": { + "type": "string", + "description": "The name of the component.", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the component?" + }, + "style": { + "description": "The file extension to be used for style files.", + "type": "string", + "alias": "s", + "default": "css", + "x-prompt": { + "message": "Which stylesheet format would you like to use?", + "type": "list", + "items": [ + { "value": "css", "label": "CSS" }, + { + "value": "scss", + "label": "SASS(.scss) [ http://sass-lang.com ]" + }, + { + "value": "styl", + "label": "Stylus(.styl) [ http://stylus-lang.com ]" + }, + { + "value": "less", + "label": "LESS [ http://lesscss.org ]" + }, + { + "value": "styled-components", + "label": "styled-components [ https://styled-components.com ]" + }, + { + "value": "@emotion/styled", + "label": "emotion [ https://emotion.sh ]" + }, + { + "value": "styled-jsx", + "label": "styled-jsx [ https://www.npmjs.com/package/styled-jsx ]" + }, + { "value": "none", "label": "None" } + ] + } + }, + "js": { + "type": "boolean", + "description": "Generate JavaScript files rather than TypeScript files.", + "default": false + }, + "skipTests": { + "type": "boolean", + "description": "When true, does not create `spec.ts` test files for the new component.", + "default": false + }, + "directory": { + "type": "string", + "description": "Create the component under this directory (can be nested).", + "alias": "dir" + }, + "flat": { + "type": "boolean", + "description": "Create component at the source root rather than its own directory.", + "default": false + }, + "export": { + "type": "boolean", + "description": "When true, the component is exported from the project `index.ts` (if it exists).", + "alias": "e", + "default": false, + "x-prompt": "Should this component be exported in the project?" + }, + "pascalCaseFiles": { + "type": "boolean", + "description": "Use pascal case component file name (e.g. `App.tsx`).", + "alias": "P", + "default": false + }, + "pascalCaseDirectory": { + "type": "boolean", + "description": "Use pascal case directory name (e.g. `App/App.tsx`).", + "alias": "R", + "default": false + }, + "classComponent": { + "type": "boolean", + "alias": "C", + "description": "Use class components instead of functional component.", + "default": false + }, + "routing": { + "type": "boolean", + "description": "Generate a library with routes." + }, + "globalCss": { + "type": "boolean", + "description": "Default is `false`. When `true`, the component is generated with `*.css`/`*.scss` instead of `*.module.css`/`*.module.scss`.", + "default": false + }, + "fileName": { + "type": "string", + "description": "Create a component with this file name." + } + }, + "required": ["name", "project"], + "presets": [] + }, + "description": "Create a React component", + "aliases": "c", + "implementation": "/packages/react/src/generators/component/component#componentGenerator.ts", + "hidden": false, + "path": "/packages/react/src/generators/component/schema.json" + }, + { + "name": "redux", + "factory": "./src/generators/redux/redux#reduxGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "$id": "redux", + "title": "Create Redux state", + "description": "Create a Redux state slice for a React project.", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Redux slice name.", + "$default": { "$source": "argv", "index": 0 } + }, + "project": { + "type": "string", + "description": "The name of the project to add the slice to. If it is an application, then the store configuration will be updated too.", + "alias": "p", + "$default": { "$source": "projectName" }, + "x-prompt": "What is the name of the project for this slice?" + }, + "directory": { + "type": "string", + "alias": "dir", + "default": "", + "description": "The name of the folder used to contain/group the generated Redux files." + }, + "appProject": { + "type": "string", + "description": "The application project to add the slice to.", + "alias": "a" + }, + "js": { + "type": "boolean", + "description": "Generate JavaScript files rather than TypeScript files.", + "default": false + } + }, + "required": ["name"], + "presets": [] + }, + "description": "Create a redux slice for a project", + "aliases": ["slice"], + "implementation": "/packages/react/src/generators/redux/redux#reduxGenerator.ts", + "hidden": false, + "path": "/packages/react/src/generators/redux/schema.json" + }, + { + "name": "storybook-configuration", + "factory": "./src/generators/storybook-configuration/configuration#storybookConfigurationGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "$id": "NxReactStorybookConfigure", + "title": "React Storybook Configure", + "description": "Set up Storybook for a React app or library.", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Project name", + "$default": { "$source": "argv", "index": 0 } + }, + "configureCypress": { + "type": "boolean", + "description": "Run the cypress-configure generator.", + "x-prompt": "Configure a cypress e2e app to run against the storybook instance?", + "default": true + }, + "generateStories": { + "type": "boolean", + "description": "Automatically generate `*.stories.ts` files for components declared in this project?", + "x-prompt": "Automatically generate *.stories.ts files for components declared in this project?", + "default": true + }, + "generateCypressSpecs": { + "type": "boolean", + "description": "Automatically generate `*.spec.ts` files in the Cypress E2E app generated by the `cypress-configure` generator.", + "x-prompt": "Automatically generate *.spec.ts files in the Cypress E2E app generated by the cypress-configure generator?", + "default": true + }, + "cypressDirectory": { + "type": "string", + "description": "A directory where the Cypress project will be placed. Placed at the root by default." + }, + "js": { + "type": "boolean", + "description": "Generate JavaScript files rather than TypeScript files.", + "default": false + }, + "linter": { + "description": "The tool to use for running lint checks.", + "type": "string", + "enum": ["eslint", "tslint"], + "default": "eslint" + }, + "standaloneConfig": { + "description": "Split the project configuration into `/project.json` rather than including it inside `workspace.json`.", + "type": "boolean" + } + }, + "required": ["name"], + "presets": [] + }, + "description": "Set up storybook for a react app or library", + "hidden": false, + "implementation": "/packages/react/src/generators/storybook-configuration/configuration#storybookConfigurationGenerator.ts", + "aliases": [], + "path": "/packages/react/src/generators/storybook-configuration/schema.json" + }, + { + "name": "storybook-migrate-defaults-5-to-6", + "factory": "./src/generators/storybook-migrate-defaults-5-to-6/migrate-defaults-5-to-6#storybookMigration5to6Generator", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "$id": "storybook-migrate-defaults-5-to-6", + "title": "Storybook migrate defaults 5 to 6", + "description": "Generate default Storybook configuration files using Storybook version `>=6.x` specs, for projects that already have Storybook instances and configurations of versions `<6.x`.", + "type": "object", + "properties": { + "all": { + "type": "boolean", + "description": "Generate new Storybook configurations for all Storybook instances across all apps and libs.", + "default": true + }, + "keepOld": { + "type": "boolean", + "description": "Keep the old configuration files - put them in a folder called `.old_storybook`.", + "default": true + }, + "name": { + "type": "string", + "description": "Leave empty to upgrade all Storybook instances. Only use this if you want to do a gradual migration. Library or application name for which you want to generate the new Storybook configuration.", + "$default": { "$source": "argv", "index": 0 } + } + }, + "required": [], + "presets": [] + }, + "description": "Generate default Storybook configuration files using Storybook version >=6.x specs, for projects that already have Storybook instances and configurations of versions <6.x.", + "hidden": false, + "implementation": "/packages/react/src/generators/storybook-migrate-defaults-5-to-6/migrate-defaults-5-to-6#storybookMigration5to6Generator.ts", + "aliases": [], + "path": "/packages/react/src/generators/storybook-migrate-defaults-5-to-6/schema.json" + }, + { + "name": "component-story", + "factory": "./src/generators/component-story/component-story#componentStoryGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "$id": "NxReactComponentStory", + "title": "Create component story", + "description": "Generate storybook story for a react component.", + "type": "object", + "properties": { + "project": { + "type": "string", + "description": "The project name where to add the components.", + "examples": ["shared-ui-component"], + "$default": { "$source": "projectName", "index": 0 }, + "x-prompt": "What's name of the project where the component lives?" + }, + "componentPath": { + "type": "string", + "description": "Relative path to the component file from the library root.", + "examples": ["lib/components"], + "x-prompt": "What's path of the component relative to the project's lib root?" + } + }, + "required": ["project", "componentPath"], + "presets": [] + }, + "description": "Generate storybook story for a react component", + "hidden": false, + "implementation": "/packages/react/src/generators/component-story/component-story#componentStoryGenerator.ts", + "aliases": [], + "path": "/packages/react/src/generators/component-story/schema.json" + }, + { + "name": "stories", + "factory": "./src/generators/stories/stories#storiesGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "$id": "NxReactStorybookStories", + "title": "Create React Storybook stories", + "description": "Create stories/specs for all components declared in an app or a library.", + "type": "object", + "properties": { + "project": { + "type": "string", + "description": "Library or application name.", + "$default": { "$source": "projectName", "index": 0 }, + "x-prompt": "What's name of the project for which you want to generate stories?" + }, + "generateCypressSpecs": { + "type": "boolean", + "description": "Automatically generate `*.spec.ts` files in the cypress e2e app generated by the cypress-configure generator.", + "x-prompt": "Do you want to generate Cypress specs as well?" + }, + "cypressProject": { + "type": "string", + "description": "The Cypress project to generate the stories under. This is inferred from `project` by default." + }, + "js": { + "type": "boolean", + "description": "Generate JavaScript files rather than TypeScript files.", + "default": false + } + }, + "required": ["project"], + "presets": [] + }, + "description": "Create stories/specs for all components declared in an app or library", + "hidden": false, + "implementation": "/packages/react/src/generators/stories/stories#storiesGenerator.ts", + "aliases": [], + "path": "/packages/react/src/generators/stories/schema.json" + }, + { + "name": "component-cypress-spec", + "factory": "./src/generators/component-cypress-spec/component-cypress-spec#componentCypressGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "$id": "NxReactComponentCypressSpec", + "title": "Create component Cypress spec", + "description": "Create a Cypress spec for a UI component that has a story.", + "type": "object", + "properties": { + "project": { + "type": "string", + "description": "The project name for which to generate tests.", + "examples": ["shared-ui-component"], + "$default": { "$source": "projectName", "index": 0 }, + "x-prompt": "What's name of the project for which to generate tests?" + }, + "componentPath": { + "type": "string", + "description": "Relative path to the component file from the library root?", + "examples": ["lib/components"], + "x-prompt": "What's path of the component relative to the project's lib root for which to generate a test?" + }, + "js": { + "type": "boolean", + "description": "Generate JavaScript files rather than TypeScript files.", + "default": false + }, + "cypressProject": { + "type": "string", + "description": "The Cypress project to generate the stories under. By default, inferred from `project`." + } + }, + "required": ["project", "componentPath"], + "presets": [] + }, + "description": "Create a cypress spec for a ui component that has a story", + "hidden": false, + "implementation": "/packages/react/src/generators/component-cypress-spec/component-cypress-spec#componentCypressGenerator.ts", + "aliases": [], + "path": "/packages/react/src/generators/component-cypress-spec/schema.json" + }, + { + "name": "hook", + "factory": "./src/generators/hook/hook#hookGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "$id": "NxReactHook", + "title": "Create a React Hook for Nx", + "description": "Create a React component using Hooks in a dedicated React project.", + "type": "object", + "examples": [ + { + "command": "nx g hook my-hook --project=mylib", + "description": "Generate a hook in the mylib library" + } + ], + "properties": { + "project": { + "type": "string", + "description": "The name of the project.", + "alias": "p", + "$default": { "$source": "projectName" }, + "x-prompt": "What is the name of the project for this hook?" + }, + "name": { + "type": "string", + "description": "The name of the hook.", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the hook?" + }, + "js": { + "type": "boolean", + "description": "Generate JavaScript files rather than TypeScript files.", + "default": false + }, + "skipTests": { + "type": "boolean", + "description": "When true, does not create `spec.ts` test files for the new hook.", + "default": false + }, + "directory": { + "type": "string", + "description": "Create the hook under this directory (can be nested).", + "alias": "d" + }, + "flat": { + "type": "boolean", + "description": "Create hook at the source root rather than its own directory.", + "default": false + }, + "export": { + "type": "boolean", + "description": "When true, the hook is exported from the project `index.ts` (if it exists).", + "alias": "e", + "default": false, + "x-prompt": "Should this hook be exported in the project?" + }, + "pascalCaseFiles": { + "type": "boolean", + "description": "Use pascal case hook file name (e.g. `useHook.ts`).", + "alias": "P", + "default": false + }, + "pascalCaseDirectory": { + "type": "boolean", + "description": "Use pascal case directory name (e.g. `useHook/useHook.ts`).", + "alias": "R", + "default": false + } + }, + "required": ["name", "project"], + "presets": [] + }, + "description": "Create a hook", + "aliases": "c", + "implementation": "/packages/react/src/generators/hook/hook#hookGenerator.ts", + "hidden": false, + "path": "/packages/react/src/generators/hook/schema.json" + } + ], + "executors": [] +} diff --git a/docs/generated/packages/storybook.json b/docs/generated/packages/storybook.json new file mode 100644 index 0000000000..f9003e5259 --- /dev/null +++ b/docs/generated/packages/storybook.json @@ -0,0 +1,495 @@ +{ + "githubRoot": "https://github.com/nrwl/nx/blob/master", + "name": "storybook", + "description": "Storybook plugin for Nx", + "root": "/packages/storybook", + "source": "/packages/storybook/src", + "generators": [ + { + "name": "init", + "factory": "./src/generators/init/init", + "schema": { + "cli": "nx", + "title": "Add Storybook Configuration to the workspace", + "description": "Add Storybook Configuration to the workspace.", + "$id": "init-storybook-plugin", + "type": "object", + "properties": { + "uiFramework": { + "type": "string", + "description": "Storybook UI Framework to use.", + "enum": [ + "@storybook/angular", + "@storybook/react", + "@storybook/html", + "@storybook/web-components", + "@storybook/vue", + "@storybook/vue3", + "@storybook/svelte", + "@storybook/react-native" + ], + "x-prompt": "What UI framework plugin should storybook use?" + } + }, + "presets": [] + }, + "description": "Add storybook configuration to the workspace", + "aliases": ["ng-add"], + "hidden": true, + "implementation": "/packages/storybook/src/generators/init/init.ts", + "path": "/packages/storybook/src/generators/init/schema.json" + }, + { + "name": "configuration", + "factory": "./src/generators/configuration/configuration", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "$id": "NxStorybookConfigure", + "title": "Storybook Configuration", + "description": "Add Storybook configuration to a UI library or an application.", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Library or application name.", + "$default": { "$source": "argv", "index": 0 } + }, + "uiFramework": { + "type": "string", + "description": "Storybook UI Framework to use.", + "enum": ["@storybook/angular", "@storybook/react"], + "x-prompt": "What UI framework plugin should storybook use?" + }, + "configureCypress": { + "type": "boolean", + "description": "Run the cypress-configure generator.", + "x-prompt": "Configure a cypress e2e app to run against the storybook instance?" + }, + "cypressDirectory": { + "type": "string", + "description": "A directory where the Cypress project will be placed. Added at root by default." + }, + "linter": { + "description": "The tool to use for running lint checks.", + "type": "string", + "enum": ["eslint", "tslint", "none"], + "default": "eslint" + }, + "js": { + "type": "boolean", + "description": "Generate JavaScript files rather than TypeScript files.", + "default": false + }, + "standaloneConfig": { + "description": "Split the project configuration into `/project.json` rather than including it inside `workspace.json`.", + "type": "boolean" + } + }, + "required": ["name"], + "presets": [] + }, + "description": "Add storybook configuration to a ui library or an application", + "hidden": false, + "implementation": "/packages/storybook/src/generators/configuration/configuration.ts", + "aliases": [], + "path": "/packages/storybook/src/generators/configuration/schema.json" + }, + { + "name": "cypress-project", + "factory": "./src/generators/cypress-project/cypress-project", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "$id": "cypress-configure", + "title": "Cypress Configuration", + "description": "Add cypress E2E app to test a ui library that is set up for Storybook.", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Library or application name.", + "$default": { "$source": "argv", "index": 0 } + }, + "js": { + "type": "boolean", + "description": "Generate JavaScript files rather than TypeScript files.", + "default": false + }, + "directory": { + "type": "string", + "description": "A directory where the project is placed." + }, + "linter": { + "description": "The tool to use for running lint checks.", + "type": "string", + "enum": ["eslint", "tslint", "none"], + "default": "eslint" + }, + "standaloneConfig": { + "description": "Split the project configuration into `/project.json` rather than including it inside `workspace.json`.", + "type": "boolean" + } + }, + "required": ["name"], + "presets": [] + }, + "description": "Add cypress e2e app to test a ui library that is set up for storybook", + "hidden": false, + "implementation": "/packages/storybook/src/generators/cypress-project/cypress-project.ts", + "aliases": [], + "path": "/packages/storybook/src/generators/cypress-project/schema.json" + }, + { + "name": "migrate-defaults-5-to-6", + "factory": "./src/generators/migrate-defaults-5-to-6/migrate-defaults-5-to-6", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "$id": "migrate-defaults-5-to-6", + "title": "Migrate defaults 5 to 6", + "description": "Generate default Storybook configuration files using Storybook version `>=6.x` specs, for projects that already have Storybook instances and configurations of versions `<6.x`.", + "type": "object", + "properties": { + "all": { + "type": "boolean", + "description": "Generate new Storybook configurations for all Storybook instances across all apps and libs.", + "default": true + }, + "keepOld": { + "type": "boolean", + "description": "Keep the old configuration files - put them in a folder called `.old_storybook`.", + "default": true + }, + "name": { + "type": "string", + "description": "Leave empty to upgrade all Storybook instances. Only use this if you want to do a gradual migration. Library or application name for which you want to generate the new Storybook configuration.", + "$default": { "$source": "argv", "index": 0 } + } + }, + "required": [], + "presets": [] + }, + "description": "Generate default Storybook configuration files using Storybook version >=6.x specs, for projects that already have Storybook instances and configurations of versions <6.x.", + "hidden": false, + "implementation": "/packages/storybook/src/generators/migrate-defaults-5-to-6/migrate-defaults-5-to-6.ts", + "aliases": [], + "path": "/packages/storybook/src/generators/migrate-defaults-5-to-6/schema.json" + }, + { + "name": "migrate-stories-to-6-2", + "factory": "./src/generators/migrate-stories-to-6-2/migrate-stories-to-6-2", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "$id": "migrate-stories-to-6-2", + "title": "Migrate stories to 6.2", + "description": "Migrate stories syntax to `6.2`.", + "type": "object", + "properties": {}, + "required": [], + "presets": [] + }, + "description": "Generate default Storybook configuration files using Storybook version >=6.x specs, for projects that already have Storybook instances and configurations of versions <6.x.", + "hidden": false, + "implementation": "/packages/storybook/src/generators/migrate-stories-to-6-2/migrate-stories-to-6-2.ts", + "aliases": [], + "path": "/packages/storybook/src/generators/migrate-stories-to-6-2/schema.json" + } + ], + "executors": [ + { + "name": "storybook", + "implementation": "/packages/storybook/src/executors/storybook/storybook.impl.ts", + "schema": { + "title": "Storybook Dev Builder", + "cli": "nx", + "description": "Serve up storybook in development mode.", + "type": "object", + "properties": { + "uiFramework": { + "type": "string", + "description": "Storybook framework npm package", + "enum": [ + "@storybook/angular", + "@storybook/react", + "@storybook/html", + "@storybook/web-components", + "@storybook/vue", + "@storybook/vue3", + "@storybook/svelte" + ], + "default": "@storybook/angular", + "hidden": true + }, + "port": { + "type": "number", + "description": "Port to listen on.", + "default": 9009 + }, + "host": { + "type": "string", + "description": "Host to listen on.", + "default": "localhost" + }, + "https": { + "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." + }, + "watch": { + "type": "boolean", + "description": "Watches for changes and rebuilds application", + "default": true + }, + "staticDir": { + "type": "array", + "description": "Directory where to load static files from, array of strings", + "items": { "type": "string" }, + "x-deprecated": "In Storybook 6.4 the `--static-dir` CLI flag has been replaced with the the `staticDirs` field in `.storybook/main.js`. It will be removed completely in Storybook 7.0." + }, + "projectBuildConfig": { + "type": "string", + "description": "Workspace project where Storybook reads the Webpack config from" + }, + "styles": { + "type": "array", + "description": "Global styles to be included in the build. This is for Angular projects only, as an option for the Storybook/Angular builder. It will be ignored in non-Angular projects.", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "input": { + "type": "string", + "description": "The file to include." + }, + "bundleName": { + "type": "string", + "pattern": "^[\\w\\-.]*$", + "description": "The bundle name for this extra entry point." + }, + "inject": { + "type": "boolean", + "description": "If the bundle will be referenced in the HTML file.", + "default": true + } + }, + "additionalProperties": false, + "required": ["input"] + }, + { "type": "string", "description": "The file to include." } + ] + } + }, + "stylePreprocessorOptions.includePaths": { + "description": "Options to pass to style preprocessors. The paths to include. Paths will be resolved to workspace root. This is for Angular projects only, as an option for the Storybook/Angular builder. It will be ignored in non-Angular projects.", + "type": "array", + "items": { "type": "string" } + }, + "config": { + "type": "object", + "description": ".storybook configuration", + "properties": { + "configFolder": { + "type": "string", + "description": "Directory where to load Storybook configurations from" + }, + "pluginPath": { + "type": "string", + "description": "Path to storybook plugin.js file." + }, + "configPath": { + "type": "string", + "description": "Path to storybook preview.js file." + }, + "srcRoot": { + "type": "string", + "description": "Project source path." + } + } + }, + "docsMode": { + "type": "boolean", + "description": "Build a documentation-only site using addon-docs.", + "default": false + }, + "quiet": { + "type": "boolean", + "description": "Suppress verbose build output.", + "default": true + } + }, + "definitions": { + "extraEntryPoint": { + "oneOf": [ + { + "type": "object", + "properties": { + "input": { + "type": "string", + "description": "The file to include." + }, + "bundleName": { + "type": "string", + "pattern": "^[\\w\\-.]*$", + "description": "The bundle name for this extra entry point." + }, + "inject": { + "type": "boolean", + "description": "If the bundle will be referenced in the HTML file.", + "default": true + } + }, + "additionalProperties": false, + "required": ["input"] + }, + { "type": "string", "description": "The file to include." } + ] + } + }, + "required": ["uiFramework", "config"], + "presets": [] + }, + "description": "Serve Storybook", + "aliases": [], + "hidden": false, + "path": "/packages/storybook/src/executors/storybook/schema.json" + }, + { + "name": "build", + "implementation": "/packages/storybook/src/executors/build-storybook/build-storybook.impl.ts", + "schema": { + "title": "Storybook Builder", + "cli": "nx", + "description": "Build storybook in production mode.", + "type": "object", + "properties": { + "uiFramework": { + "type": "string", + "description": "Storybook framework npm package.", + "default": "@storybook/angular", + "hidden": true + }, + "outputPath": { + "type": "string", + "description": "The output path of the generated files." + }, + "projectBuildConfig": { + "type": "string", + "description": "Workspace project where Storybook reads the Webpack config from." + }, + "styles": { + "type": "array", + "description": "Global styles to be included in the build. This is for Angular projects only, as an option for the Storybook/Angular builder. It will be ignored in non-Angular projects.", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "input": { + "type": "string", + "description": "The file to include." + }, + "bundleName": { + "type": "string", + "pattern": "^[\\w\\-.]*$", + "description": "The bundle name for this extra entry point." + }, + "inject": { + "type": "boolean", + "description": "If the bundle will be referenced in the HTML file.", + "default": true + } + }, + "additionalProperties": false, + "required": ["input"] + }, + { "type": "string", "description": "The file to include." } + ] + } + }, + "stylePreprocessorOptions.includePaths": { + "description": "Options to pass to style preprocessors. The paths to include. Paths will be resolved to workspace root. This is for Angular projects only, as an option for the Storybook/Angular builder. It will be ignored in non-Angular projects.", + "type": "array", + "items": { "type": "string" } + }, + "config": { + "type": "object", + "description": "`.storybook` file configuration", + "properties": { + "configFolder": { + "type": "string", + "description": "Directory where to load Storybook configurations from" + }, + "pluginPath": { + "type": "string", + "description": "Path to storybook `plugin.js` file." + }, + "configPath": { + "type": "string", + "description": "Path to storybook `preview.js` file." + }, + "srcRoot": { + "type": "string", + "description": "Project source path." + } + } + }, + "docsMode": { + "type": "boolean", + "description": "Build a documentation-only site using addon-docs.", + "default": false + }, + "quiet": { + "type": "boolean", + "description": "Suppress verbose build output.", + "default": true + } + }, + "definitions": { + "extraEntryPoint": { + "oneOf": [ + { + "type": "object", + "properties": { + "input": { + "type": "string", + "description": "The file to include." + }, + "bundleName": { + "type": "string", + "pattern": "^[\\w\\-.]*$", + "description": "The bundle name for this extra entry point." + }, + "inject": { + "type": "boolean", + "description": "If the bundle will be referenced in the HTML file.", + "default": true + } + }, + "additionalProperties": false, + "required": ["input"] + }, + { "type": "string", "description": "The file to include." } + ] + } + }, + "required": ["uiFramework", "config"], + "presets": [] + }, + "description": "Build Storybook", + "aliases": [], + "hidden": false, + "path": "/packages/storybook/src/executors/build-storybook/schema.json" + } + ] +} diff --git a/docs/generated/packages/tao.json b/docs/generated/packages/tao.json new file mode 100644 index 0000000000..8e11abe91f --- /dev/null +++ b/docs/generated/packages/tao.json @@ -0,0 +1,9 @@ +{ + "githubRoot": "https://github.com/nrwl/nx/blob/master", + "name": "tao", + "description": "CLI for generating code and running commands", + "root": "/packages/tao", + "source": "/packages/tao/src", + "generators": [], + "executors": [] +} diff --git a/docs/generated/packages/web.json b/docs/generated/packages/web.json new file mode 100644 index 0000000000..7d625a0370 --- /dev/null +++ b/docs/generated/packages/web.json @@ -0,0 +1,938 @@ +{ + "githubRoot": "https://github.com/nrwl/nx/blob/master", + "name": "web", + "description": "Web Plugin for Nx", + "root": "/packages/web", + "source": "/packages/web/src", + "generators": [ + { + "name": "init", + "factory": "./src/generators/init/init#webInitGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxWebInit", + "cli": "nx", + "title": "Init Web Plugin", + "type": "object", + "properties": { + "unitTestRunner": { + "description": "Adds the specified unit test runner", + "type": "string", + "enum": ["jest", "none"], + "default": "jest" + }, + "e2eTestRunner": { + "description": "Adds the specified e2e test runner", + "type": "string", + "enum": ["cypress", "none"], + "default": "cypress" + }, + "skipFormat": { + "description": "Skip formatting files", + "type": "boolean", + "default": false + } + }, + "required": [], + "presets": [] + }, + "description": "Add @nrwl/web to a project", + "hidden": true, + "implementation": "/packages/web/src/generators/init/init#webInitGenerator.ts", + "aliases": [], + "path": "/packages/web/src/generators/init/schema.json" + }, + { + "name": "application", + "factory": "./src/generators/application/application#applicationGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "cli": "nx", + "$id": "NxWebApp", + "title": "Create a Web Application for Nx", + "description": "Create a web application using `swc` or `babel` as compiler.", + "type": "object", + "properties": { + "name": { + "description": "The name of the application.", + "type": "string", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the application?", + "pattern": "^[a-zA-Z].*$" + }, + "directory": { + "description": "The directory of the new application.", + "type": "string" + }, + "style": { + "description": "The file extension to be used for style files.", + "type": "string", + "default": "css", + "x-prompt": { + "message": "Which stylesheet format would you like to use?", + "type": "list", + "items": [ + { "value": "css", "label": "CSS" }, + { + "value": "scss", + "label": "SASS(.scss) [ http://sass-lang.com ]" + }, + { + "value": "styl", + "label": "Stylus(.styl)[ http://stylus-lang.com ]" + }, + { + "value": "less", + "label": "LESS [ http://lesscss.org ]" + } + ] + } + }, + "compiler": { + "type": "string", + "description": "The compiler to use", + "enum": ["babel", "swc"], + "default": "babel" + }, + "linter": { + "description": "The tool to use for running lint checks.", + "type": "string", + "enum": ["eslint", "tslint"], + "default": "eslint" + }, + "skipFormat": { + "description": "Skip formatting files", + "type": "boolean", + "default": false + }, + "unitTestRunner": { + "type": "string", + "enum": ["jest", "none"], + "description": "Test runner to use for unit tests", + "default": "jest" + }, + "e2eTestRunner": { + "type": "string", + "enum": ["cypress", "none"], + "description": "Test runner to use for end to end (e2e) tests", + "default": "cypress" + }, + "tags": { + "type": "string", + "description": "Add tags to the application (used for linting)" + }, + "setParserOptionsProject": { + "type": "boolean", + "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.", + "default": false + }, + "standaloneConfig": { + "description": "Split the project configuration into `/project.json` rather than including it inside workspace.json", + "type": "boolean" + } + }, + "required": [], + "presets": [] + }, + "aliases": ["app"], + "x-type": "application", + "description": "Create an application", + "implementation": "/packages/web/src/generators/application/application#applicationGenerator.ts", + "hidden": false, + "path": "/packages/web/src/generators/application/schema.json" + } + ], + "executors": [ + { + "name": "webpack", + "implementation": "/packages/web/src/executors/webpack/webpack.impl.ts", + "schema": { + "title": "Webpack Executor", + "description": "Builds web applications using webpack", + "cli": "nx", + "type": "object", + "properties": { + "crossOrigin": { + "type": "string", + "description": "The `crossorigin` attribute to use for generated javascript script tags. One of 'none' | 'anonymous' | 'use-credentials'." + }, + "main": { + "type": "string", + "description": "The name of the main entry-point file." + }, + "tsConfig": { + "type": "string", + "description": "The name of the Typescript configuration file." + }, + "compiler": { + "type": "string", + "description": "The compiler to use.", + "enum": ["babel", "swc"], + "default": "babel" + }, + "outputPath": { + "type": "string", + "description": "The output path of the generated files." + }, + "deleteOutputPath": { + "type": "boolean", + "description": "Delete the output path before building.", + "default": true + }, + "watch": { + "type": "boolean", + "description": "Enable re-building when files change.", + "default": false + }, + "baseHref": { + "type": "string", + "description": "Base url for the application being built." + }, + "deployUrl": { + "type": "string", + "description": "URL where the application will be deployed." + }, + "vendorChunk": { + "type": "boolean", + "description": "Use a separate bundle containing only vendor libraries.", + "default": true + }, + "commonChunk": { + "type": "boolean", + "description": "Use a separate bundle containing code used across multiple bundles.", + "default": true + }, + "runtimeChunk": { + "type": "boolean", + "description": "Use a separate bundle containing the runtime.", + "default": true + }, + "sourceMap": { + "description": "Output sourcemaps. Use 'hidden' for use with error reporting tools without generating sourcemap comment.", + "default": true, + "oneOf": [{ "type": "boolean" }, { "type": "string" }] + }, + "progress": { + "type": "boolean", + "description": "Log progress to the console while building.", + "default": false + }, + "assets": { + "type": "array", + "description": "List of static application assets.", + "default": [], + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "glob": { + "type": "string", + "description": "The pattern to match." + }, + "input": { + "type": "string", + "description": "The input directory path in which to apply 'glob'. Defaults to the project root." + }, + "ignore": { + "description": "An array of globs to ignore.", + "type": "array", + "items": { "type": "string" } + }, + "output": { + "type": "string", + "description": "Absolute path within the output." + } + }, + "additionalProperties": false, + "required": ["glob", "input", "output"] + }, + { "type": "string" } + ] + } + }, + "index": { + "type": "string", + "description": "HTML File which will be contain the application." + }, + "scripts": { + "type": "array", + "description": "External Scripts which will be included before the main application entry.", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "input": { + "type": "string", + "description": "The file to include." + }, + "bundleName": { + "type": "string", + "description": "The bundle name for this extra entry point." + }, + "inject": { + "type": "boolean", + "description": "If the bundle will be referenced in the HTML file.", + "default": true + } + }, + "additionalProperties": false, + "required": ["input"] + }, + { "type": "string", "description": "The file to include." } + ] + }, + "default": [] + }, + "styles": { + "type": "array", + "description": "External Styles which will be included with the application", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "input": { + "type": "string", + "description": "The file to include." + }, + "bundleName": { + "type": "string", + "description": "The bundle name for this extra entry point." + }, + "inject": { + "type": "boolean", + "description": "If the bundle will be referenced in the HTML file.", + "default": true + } + }, + "additionalProperties": false, + "required": ["input"] + }, + { "type": "string", "description": "The file to include." } + ] + }, + "default": [] + }, + "budgets": { + "description": "Budget thresholds to ensure parts of your application stay within boundaries which you set.", + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The type of budget.", + "enum": [ + "all", + "allScript", + "any", + "anyScript", + "bundle", + "initial" + ] + }, + "name": { + "type": "string", + "description": "The name of the bundle." + }, + "baseline": { + "type": "string", + "description": "The baseline size for comparison." + }, + "maximumWarning": { + "type": "string", + "description": "The maximum threshold for warning relative to the baseline." + }, + "maximumError": { + "type": "string", + "description": "The maximum threshold for error relative to the baseline." + }, + "minimumWarning": { + "type": "string", + "description": "The minimum threshold for warning relative to the baseline." + }, + "minimumError": { + "type": "string", + "description": "The minimum threshold for error relative to the baseline." + }, + "warning": { + "type": "string", + "description": "The threshold for warning relative to the baseline (min & max)." + }, + "error": { + "type": "string", + "description": "The threshold for error relative to the baseline (min & max)." + } + }, + "additionalProperties": false, + "required": ["type"] + }, + "default": [] + }, + "namedChunks": { + "type": "boolean", + "description": "Names the produced bundles according to their entry file.", + "default": true + }, + "outputHashing": { + "type": "string", + "description": "Define the output filename cache-busting hashing mode.", + "default": "none", + "enum": ["none", "all", "media", "bundles"] + }, + "stylePreprocessorOptions": { + "description": "Options to pass to style preprocessors.", + "type": "object", + "properties": { + "includePaths": { + "description": "Paths to include. Paths will be resolved to project root.", + "type": "array", + "items": { "type": "string" }, + "default": [] + } + }, + "additionalProperties": false + }, + "optimization": { + "description": "Enables optimization of the build output.", + "oneOf": [ + { + "type": "object", + "properties": { + "scripts": { + "type": "boolean", + "description": "Enables optimization of the scripts output.", + "default": true + }, + "styles": { + "type": "boolean", + "description": "Enables optimization of the styles output.", + "default": true + } + }, + "additionalProperties": false + }, + { "type": "boolean" } + ] + }, + "extractCss": { + "type": "boolean", + "description": "Extract CSS into a `.css` file.", + "default": false + }, + "es2015Polyfills": { + "description": "Conditional polyfills loaded in browsers which do not support `ES2015`.", + "type": "string" + }, + "subresourceIntegrity": { + "type": "boolean", + "description": "Enables the use of subresource integrity validation.", + "default": false + }, + "polyfills": { + "type": "string", + "description": "Polyfills to load before application" + }, + "verbose": { + "type": "boolean", + "description": "Emits verbose output", + "default": false + }, + "statsJson": { + "type": "boolean", + "description": "Generates a 'stats.json' file which can be analyzed using tools such as: 'webpack-bundle-analyzer' or ``.", + "default": false + }, + "extractLicenses": { + "type": "boolean", + "description": "Extract all licenses in a separate file, in the case of production builds only.", + "default": false + }, + "memoryLimit": { + "type": "number", + "description": "Memory limit for type checking service process in `MB`.", + "default": 2048 + }, + "maxWorkers": { + "type": "number", + "description": "Number of workers to use for type checking.", + "default": 2 + }, + "fileReplacements": { + "description": "Replace files with other files in the build.", + "type": "array", + "items": { + "type": "object", + "properties": { + "replace": { + "type": "string", + "description": "The file to be replaced." + }, + "with": { + "type": "string", + "description": "The file to replace with." + } + }, + "additionalProperties": false, + "required": ["replace", "with"] + }, + "default": [] + }, + "buildLibsFromSource": { + "type": "boolean", + "description": "Read buildable libraries from source instead of building them separately.", + "default": true + }, + "generateIndexHtml": { + "type": "boolean", + "description": "Generates `index.html` file to the output path. This can be turned off if using a webpack plugin to generate HTML such as `html-webpack-plugin`.", + "default": true + }, + "postcssConfig": { + "type": "string", + "description": "Set a path to PostCSS config that applies to the app and all libs. Defaults to `undefined`, which auto-detects postcss.config.js files in each `app`/`lib` directory." + }, + "webpackConfig": { + "type": "string", + "description": "Path to a function which takes a webpack config, some context and returns the resulting webpack config." + } + }, + "required": ["tsConfig", "main", "index"], + "definitions": { + "assetPattern": { + "oneOf": [ + { + "type": "object", + "properties": { + "glob": { + "type": "string", + "description": "The pattern to match." + }, + "input": { + "type": "string", + "description": "The input directory path in which to apply 'glob'. Defaults to the project root." + }, + "ignore": { + "description": "An array of globs to ignore.", + "type": "array", + "items": { "type": "string" } + }, + "output": { + "type": "string", + "description": "Absolute path within the output." + } + }, + "additionalProperties": false, + "required": ["glob", "input", "output"] + }, + { "type": "string" } + ] + }, + "budget": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The type of budget.", + "enum": [ + "all", + "allScript", + "any", + "anyScript", + "bundle", + "initial" + ] + }, + "name": { + "type": "string", + "description": "The name of the bundle." + }, + "baseline": { + "type": "string", + "description": "The baseline size for comparison." + }, + "maximumWarning": { + "type": "string", + "description": "The maximum threshold for warning relative to the baseline." + }, + "maximumError": { + "type": "string", + "description": "The maximum threshold for error relative to the baseline." + }, + "minimumWarning": { + "type": "string", + "description": "The minimum threshold for warning relative to the baseline." + }, + "minimumError": { + "type": "string", + "description": "The minimum threshold for error relative to the baseline." + }, + "warning": { + "type": "string", + "description": "The threshold for warning relative to the baseline (min & max)." + }, + "error": { + "type": "string", + "description": "The threshold for error relative to the baseline (min & max)." + } + }, + "additionalProperties": false, + "required": ["type"] + }, + "extraEntryPoint": { + "oneOf": [ + { + "type": "object", + "properties": { + "input": { + "type": "string", + "description": "The file to include." + }, + "bundleName": { + "type": "string", + "description": "The bundle name for this extra entry point." + }, + "inject": { + "type": "boolean", + "description": "If the bundle will be referenced in the HTML file.", + "default": true + } + }, + "additionalProperties": false, + "required": ["input"] + }, + { "type": "string", "description": "The file to include." } + ] + } + }, + "presets": [] + }, + "description": "Build an application using webpack", + "aliases": [], + "hidden": false, + "path": "/packages/web/src/executors/webpack/schema.json" + }, + { + "name": "rollup", + "implementation": "/packages/web/src/executors/rollup/rollup.impl.ts", + "schema": { + "title": "Web Library Rollup Target (Experimental)", + "description": "Packages a library for different web usages (`UMD`, `ESM`, `CJS`).", + "cli": "nx", + "type": "object", + "properties": { + "project": { + "type": "string", + "description": "The path to package.json file." + }, + "entryFile": { + "type": "string", + "description": "The path to the entry file, relative to project." + }, + "outputPath": { + "type": "string", + "description": "The output path of the generated files." + }, + "deleteOutputPath": { + "type": "boolean", + "description": "Delete the output path before building.", + "default": true + }, + "tsConfig": { + "type": "string", + "description": "The path to tsconfig file." + }, + "format": { + "type": "array", + "description": "Only build the specified comma-separated formats (`esm,umd,cjs`)", + "alias": "f", + "items": { "type": "string", "enum": ["esm", "umd", "cjs"] }, + "default": ["esm", "umd"] + }, + "external": { + "type": "array", + "description": "A list of external modules that will not be bundled (`react`, `react-dom`, etc.).", + "items": { "type": "string" } + }, + "watch": { + "type": "boolean", + "description": "Enable re-building when files change.", + "default": false + }, + "updateBuildableProjectDepsInPackageJson": { + "type": "boolean", + "description": "Update buildable project dependencies in `package.json`.", + "default": true + }, + "buildableProjectDepsInPackageJsonType": { + "type": "string", + "description": "When `updateBuildableProjectDepsInPackageJson` is `true`, this adds dependencies to either `peerDependencies` or `dependencies`.", + "enum": ["dependencies", "peerDependencies"], + "default": "peerDependencies" + }, + "rollupConfig": { + "oneOf": [ + { "type": "array", "items": { "type": "string" } }, + { "type": "string" } + ], + "description": "Path to a function which takes a rollup config and returns an updated rollup config." + }, + "umdName": { + "type": "string", + "description": "The name of your module in `UMD` format. Defaulted to your project name." + }, + "globals": { + "description": "A mapping of node modules to their `UMD` global names. Used by the `UMD` bundle.", + "type": "array", + "items": { + "type": "object", + "properties": { + "moduleId": { + "type": "string", + "description": "The node module to map from (e.g. `react-dom`)." + }, + "global": { + "type": "string", + "description": "The global name to map to (e.g. `ReactDOM`)." + } + }, + "additionalProperties": false, + "required": ["moduleId", "global"] + }, + "default": [] + }, + "extractCss": { + "type": "boolean", + "description": "CSS files will be extracted to the output folder.", + "default": true + }, + "assets": { + "type": "array", + "description": "List of static assets.", + "default": [], + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "glob": { + "type": "string", + "description": "The pattern to match." + }, + "input": { + "type": "string", + "description": "The input directory path in which to apply `glob`. Defaults to the project root." + }, + "output": { + "type": "string", + "description": "Relative path within the output folder." + } + }, + "additionalProperties": false, + "required": ["glob", "input", "output"] + }, + { "type": "string" } + ] + } + }, + "compiler": { + "type": "string", + "enum": ["babel", "swc"], + "default": "babel", + "description": "Which compiler to use." + } + }, + "required": ["tsConfig", "project", "entryFile", "outputPath"], + "definitions": { + "assetPattern": { + "oneOf": [ + { + "type": "object", + "properties": { + "glob": { + "type": "string", + "description": "The pattern to match." + }, + "input": { + "type": "string", + "description": "The input directory path in which to apply `glob`. Defaults to the project root." + }, + "output": { + "type": "string", + "description": "Relative path within the output folder." + } + }, + "additionalProperties": false, + "required": ["glob", "input", "output"] + }, + { "type": "string" } + ] + } + }, + "presets": [] + }, + "description": "Package a library using rollup", + "aliases": [], + "hidden": false, + "path": "/packages/web/src/executors/rollup/schema.json" + }, + { + "name": "dev-server", + "implementation": "/packages/web/src/executors/dev-server/dev-server.impl.ts", + "schema": { + "title": "Web Dev Server", + "description": "Serve a web application.", + "cli": "nx", + "type": "object", + "properties": { + "buildTarget": { + "type": "string", + "description": "Target which builds the application." + }, + "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`." + }, + "watch": { + "type": "boolean", + "description": "Watches for changes and rebuilds application.", + "default": true + }, + "liveReload": { + "type": "boolean", + "description": "Whether to reload the page on change, using live-reload.", + "default": true + }, + "hmr": { + "type": "boolean", + "description": "Enable hot module replacement.", + "default": false + }, + "publicHost": { + "type": "string", + "description": "Public URL where the application will be served." + }, + "open": { + "type": "boolean", + "description": "Open the application in the browser.", + "default": false + }, + "allowedHosts": { + "type": "string", + "description": "This option allows you to whitelist services that are allowed to access the dev server." + }, + "memoryLimit": { + "type": "number", + "description": "Memory limit for type checking service process in `MB`." + }, + "maxWorkers": { + "type": "number", + "description": "Number of workers to use for type checking." + }, + "baseHref": { + "type": "string", + "description": "Base url for the application being built." + } + }, + "presets": [] + }, + "description": "Serve a web application", + "aliases": [], + "hidden": false, + "path": "/packages/web/src/executors/dev-server/schema.json" + }, + { + "name": "file-server", + "implementation": "/packages/web/src/executors/file-server/file-server.impl.ts", + "schema": { + "title": "File Server", + "description": "Serve a web application from a folder.", + "type": "object", + "cli": "nx", + "properties": { + "buildTarget": { + "type": "string", + "description": "Target which builds the application." + }, + "withDeps": { + "type": "boolean", + "description": "Build the target and all its deps", + "default": false, + "x-deprecated": "\"withDeps\" is deprecated and it will be removed in `v14`. Configure target dependencies instead: https://nx.dev/configuration/projectjson." + }, + "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 + } + }, + "additionalProperties": false, + "required": ["buildTarget"], + "presets": [] + }, + "description": "Serve a web application from a folder", + "aliases": [], + "hidden": false, + "path": "/packages/web/src/executors/file-server/schema.json" + } + ] +} diff --git a/docs/generated/packages/workspace.json b/docs/generated/packages/workspace.json new file mode 100644 index 0000000000..8232febe9c --- /dev/null +++ b/docs/generated/packages/workspace.json @@ -0,0 +1,798 @@ +{ + "githubRoot": "https://github.com/nrwl/nx/blob/master", + "name": "workspace", + "description": "Smart, Fast and Extensible Build System", + "root": "/packages/workspace", + "source": "/packages/workspace/src", + "generators": [ + { + "name": "workspace", + "factory": "./src/generators/workspace/workspace#workspaceGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "SchematicsNxNgNew", + "cli": "nx", + "title": "Create an empty workspace", + "description": "Create an empty workspace.", + "type": "object", + "properties": { + "name": { + "description": "The name of the workspace.", + "type": "string", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the workspace?" + }, + "style": { + "description": "The file extension to be used for style files.", + "type": "string", + "default": "css", + "x-prompt": { + "message": "Which stylesheet format would you like to use?", + "type": "list", + "items": [ + { "value": "css", "label": "CSS" }, + { + "value": "scss", + "label": "SASS(.scss) [ http://sass-lang.com ]" + }, + { + "value": "styl", + "label": "Stylus(.styl)[ http://stylus-lang.com ]" + }, + { + "value": "less", + "label": "LESS [ http://lesscss.org ]" + } + ] + } + }, + "directory": { + "type": "string", + "format": "path", + "description": "The directory name to create the workspace in.", + "default": "" + }, + "preset": { + "type": "string", + "description": "Preset of the workspace." + }, + "npmScope": { + "type": "string", + "description": "Npm scope for importing libs." + }, + "defaultBase": { + "type": "string", + "description": "Default base branch for affected." + }, + "skipInstall": { + "description": "Skip installing dependency packages.", + "type": "boolean", + "default": false + }, + "skipGit": { + "description": "Skip initializing a git repository.", + "type": "boolean", + "default": false, + "alias": "g" + }, + "commit": { + "description": "Initial repository commit information.", + "oneOf": [ + { "type": "boolean" }, + { + "type": "object", + "properties": { + "name": { "type": "string" }, + "email": { "type": "string", "format": "email" }, + "message": { "type": "string" } + }, + "required": ["name", "email"] + } + ], + "default": true + }, + "packageManager": { + "description": "The package manager used to install dependencies.", + "type": "string", + "enum": ["npm", "yarn", "pnpm"] + }, + "cli": { + "description": "CLI used for generating code and running tasks", + "type": "string", + "enum": ["nx", "angular"], + "default": "nx" + } + }, + "presets": [] + }, + "description": "Create an empty workspace", + "hidden": true, + "implementation": "/packages/workspace/src/generators/workspace/workspace#workspaceGenerator.ts", + "aliases": [], + "path": "/packages/workspace/src/generators/workspace/schema.json" + }, + { + "name": "preset", + "factory": "./src/generators/preset/preset#presetGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxWorkspacePreset", + "cli": "nx", + "title": "Creates applications in a new workspace", + "description": "Creates applications in a new workspace.", + "type": "object", + "properties": { + "preset": { + "description": "The name of the preset.", + "type": "string" + }, + "name": { + "description": "The name of the application.", + "type": "string" + }, + "npmScope": { + "description": "Npm scope for importing libs.", + "type": "string" + }, + "cli": { + "description": "CLI powering the workspace.", + "type": "string" + }, + "linter": { + "description": "The tool to use for running lint checks.", + "type": "string", + "enum": ["tslint", "eslint"], + "default": "eslint" + }, + "style": { + "description": "The file extension to be used for style files.", + "type": "string", + "default": "css", + "x-prompt": { + "message": "Which stylesheet format would you like to use?", + "type": "list", + "items": [ + { "value": "css", "label": "CSS" }, + { + "value": "scss", + "label": "SASS(.scss) [ http://sass-lang.com ]" + }, + { + "value": "styl", + "label": "Stylus(.styl)[ http://stylus-lang.com ]" + }, + { + "value": "less", + "label": "LESS [ http://lesscss.org ]" + } + ] + } + }, + "standaloneConfig": { + "description": "Split the project configurations into `/project.json` rather than including it inside `workspace.json`.", + "type": "boolean" + }, + "packageManager": { + "description": "The package manager used to install dependencies.", + "type": "string", + "enum": ["npm", "yarn", "pnpm"] + } + }, + "presets": [] + }, + "description": "Create application in an empty workspace", + "hidden": true, + "implementation": "/packages/workspace/src/generators/preset/preset#presetGenerator.ts", + "aliases": [], + "path": "/packages/workspace/src/generators/preset/schema.json" + }, + { + "name": "move", + "factory": "./src/generators/move/move#moveGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxWorkspaceMove", + "cli": "nx", + "title": "Nx Move", + "description": "Move a project to another folder in the workspace.", + "type": "object", + "examples": [ + { + "command": "nx g @nrwl/workspace:move --project my-feature-lib shared/my-feature-lib", + "description": "Move `libs/my-feature-lib` to `libs/shared/my-feature-lib`" + } + ], + "properties": { + "projectName": { + "type": "string", + "alias": "project", + "description": "The name of the project to move." + }, + "destination": { + "type": "string", + "description": "The folder to move the project into.", + "$default": { "$source": "argv", "index": 0 } + }, + "importPath": { + "type": "string", + "description": "The new import path to use in the `tsconfig.base.json`." + }, + "updateImportPath": { + "type": "boolean", + "description": "Should the generator update the import path to reflect the new location?", + "default": true + }, + "skipFormat": { + "type": "boolean", + "aliases": ["skip-format"], + "description": "Skip formatting files.", + "default": false + } + }, + "required": ["projectName", "destination"], + "presets": [] + }, + "aliases": ["mv"], + "description": "Move an application or library to another folder", + "implementation": "/packages/workspace/src/generators/move/move#moveGenerator.ts", + "hidden": false, + "path": "/packages/workspace/src/generators/move/schema.json" + }, + { + "name": "remove", + "factory": "./src/generators/remove/remove#removeGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxWorkspaceRemove", + "cli": "nx", + "title": "Nx Remove", + "description": "Remove a project from the workspace.", + "type": "object", + "examples": [ + { + "command": "nx g @nrwl/workspace:remove my-feature-lib", + "description": "Remove `my-feature-lib` from the workspace" + }, + { + "command": "nx g @nrwl/workspace:remove my-feature-lib --forceRemove", + "description": "Force removal of `my-feature-lib` from the workspace" + } + ], + "properties": { + "projectName": { + "type": "string", + "alias": "project", + "description": "The name of the project to remove.", + "$default": { "$source": "argv", "index": 0 } + }, + "forceRemove": { + "type": "boolean", + "aliases": ["force-remove"], + "description": "When `true`, forces removal even if the project is still in use.", + "default": false + }, + "skipFormat": { + "type": "boolean", + "aliases": ["skip-format"], + "description": "Skip formatting files.", + "default": false + } + }, + "required": ["projectName"], + "presets": [] + }, + "aliases": ["rm"], + "description": "Remove an application or library", + "implementation": "/packages/workspace/src/generators/remove/remove#removeGenerator.ts", + "hidden": false, + "path": "/packages/workspace/src/generators/remove/schema.json" + }, + { + "name": "new", + "factory": "./src/generators/new/new#newGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxWorkspaceNew", + "title": "Create an empty workspace", + "description": "Create an empty workspace.", + "type": "object", + "cli": "nx", + "properties": { + "name": { + "description": "The name of the workspace.", + "type": "string", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the workspace?" + }, + "cli": { + "description": "CLI used for generating code and running tasks.", + "type": "string", + "enum": ["nx", "angular"], + "default": "nx" + }, + "style": { + "description": "The file extension to be used for style files.", + "type": "string", + "default": "css" + }, + "npmScope": { + "type": "string", + "description": "Npm scope for importing libs." + }, + "defaultBase": { + "type": "string", + "description": "Default base branch for affected." + }, + "skipInstall": { + "description": "Skip installing dependency packages.", + "type": "boolean", + "default": false + }, + "skipGit": { + "description": "Skip initializing a git repository.", + "type": "boolean", + "default": false, + "alias": "g" + }, + "commit": { + "description": "Initial repository commit information.", + "oneOf": [ + { "type": "boolean" }, + { + "type": "object", + "properties": { + "name": { "type": "string" }, + "email": { "type": "string", "format": "email" }, + "message": { "type": "string" } + }, + "required": ["name", "email"] + } + ], + "default": true + }, + "preset": { + "description": "What to create in the new workspace.", + "type": "string" + }, + "appName": { "type": "string", "description": "Application name." }, + "nxCloud": { + "description": "Connect the workspace to the free tier of the distributed cache provided by Nx Cloud.", + "type": "boolean", + "default": false + }, + "linter": { + "description": "The tool to use for running lint checks.", + "type": "string", + "enum": ["tslint", "eslint"], + "default": "eslint" + }, + "packageManager": { + "description": "The package manager used to install dependencies.", + "type": "string", + "enum": ["npm", "yarn", "pnpm"] + } + }, + "additionalProperties": true, + "presets": [] + }, + "description": "Create a workspace", + "hidden": true, + "implementation": "/packages/workspace/src/generators/new/new#newGenerator.ts", + "aliases": [], + "path": "/packages/workspace/src/generators/new/schema.json" + }, + { + "name": "library", + "factory": "./src/generators/library/library#libraryGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxTypescriptLibrary", + "cli": "nx", + "title": "Create a TypeScript Library", + "description": "Create a TypeScript Library.", + "type": "object", + "examples": [ + { + "command": "nx g lib mylib --directory=myapp", + "description": "Generate `libs/myapp/mylib`" + } + ], + "properties": { + "name": { + "type": "string", + "description": "Library name.", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the library?", + "pattern": "^[a-zA-Z].*$" + }, + "directory": { + "type": "string", + "description": "A directory where the lib is placed." + }, + "linter": { + "description": "The tool to use for running lint checks.", + "type": "string", + "enum": ["eslint"], + "default": "eslint" + }, + "unitTestRunner": { + "type": "string", + "enum": ["jest", "none"], + "description": "Test runner to use for unit tests.", + "default": "jest" + }, + "tags": { + "type": "string", + "description": "Add tags to the library (used for linting)." + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + }, + "skipTsConfig": { + "type": "boolean", + "description": "Do not update `tsconfig.json` for development experience.", + "default": false + }, + "testEnvironment": { + "type": "string", + "enum": ["jsdom", "node"], + "description": "The test environment to use if `unitTestRunner` is set to `jest`.", + "default": "jsdom" + }, + "importPath": { + "type": "string", + "description": "The library name used to import it, like `@myorg/my-awesome-lib`." + }, + "babelJest": { + "type": "boolean", + "description": "Use `babel` instead `ts-jest`.", + "default": false + }, + "pascalCaseFiles": { + "type": "boolean", + "description": "Use pascal case file names.", + "alias": "P", + "default": false + }, + "js": { + "type": "boolean", + "description": "Generate JavaScript files rather than TypeScript files.", + "default": false + }, + "strict": { + "type": "boolean", + "description": "Whether to enable `tsconfig` strict mode or not.", + "default": true + }, + "skipBabelrc": { + "type": "boolean", + "description": "Do not generate `.babelrc` file. Useful for Node libraries that are not compiled by Babel.", + "default": false + }, + "buildable": { + "type": "boolean", + "default": false, + "description": "Generate a buildable library." + }, + "setParserOptionsProject": { + "type": "boolean", + "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.", + "default": false + }, + "standaloneConfig": { + "description": "Split the project configuration into `/project.json` rather than including it inside `workspace.json`.", + "type": "boolean" + } + }, + "required": ["name"], + "presets": [] + }, + "aliases": ["lib"], + "x-type": "library", + "description": "Create a library", + "implementation": "/packages/workspace/src/generators/library/library#libraryGenerator.ts", + "hidden": false, + "path": "/packages/workspace/src/generators/library/schema.json" + }, + { + "name": "workspace-generator", + "factory": "./src/generators/workspace-generator/workspace-generator", + "schema": { + "cli": "nx", + "$id": "SchematicsNxWorkspaceSchematic", + "title": "Create a custom generator", + "description": "Create a custom generator.", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Generator name.", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use for the workspace generator?" + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + } + }, + "required": [], + "presets": [] + }, + "aliases": ["workspace-schematic"], + "description": "Generates a workspace generator", + "implementation": "/packages/workspace/src/generators/workspace-generator/workspace-generator.ts", + "hidden": false, + "path": "/packages/workspace/src/generators/workspace-generator/schema.json" + }, + { + "name": "run-commands", + "factory": "./src/generators/run-commands/run-commands#runCommandsGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "SchematicsRunCommands", + "title": "Create a custom target to run any command", + "description": "Create a custom target to run any command.", + "type": "object", + "cli": "nx", + "examples": [ + { + "command": "nx g @nrwl/workspace:run-commands printhello --project my-feature-lib --command 'echo hello'", + "description": "Add the `printhello` target to `my-feature-lib`" + } + ], + "properties": { + "name": { + "type": "string", + "description": "Target name.", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name would you like to use to invoke the command?" + }, + "project": { + "description": "Project name.", + "type": "string", + "x-prompt": "What project does the target belong to?" + }, + "command": { + "description": "Command to run.", + "type": "string", + "x-prompt": "What command would you like to run?" + }, + "cwd": { + "description": "Current working directory of the command.", + "type": "string" + }, + "outputs": { + "description": "Allows you to specify where the build artifacts are stored. This allows Nx Cloud to pick them up correctly, in the case that the build artifacts are placed somewhere other than the top level dist folder.", + "type": "string" + }, + "envFile": { + "description": "Env files to be loaded before executing the commands.", + "type": "string" + } + }, + "required": ["name", "command", "project"], + "presets": [] + }, + "aliases": ["run-command", "target"], + "description": "Generates a target to run any command in the terminal", + "implementation": "/packages/workspace/src/generators/run-commands/run-commands#runCommandsGenerator.ts", + "hidden": false, + "path": "/packages/workspace/src/generators/run-commands/schema.json" + }, + { + "name": "convert-to-nx-project", + "factory": "./src/generators/convert-to-nx-project/convert-to-nx-project#convertToNxProjectGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "SchematicsConvertToNxProject", + "title": "Create a custom target to run any command", + "description": "Create a custom target to run any command.", + "type": "object", + "cli": "nx", + "examples": [ + { + "command": "nx g @nrwl/workspace:convert-to-nx-project --project my-feature-lib", + "description": "Convert the `my-feature-lib` project to use `project.json` file instead of `workspace.json`" + }, + { + "command": "nx g @nrwl/workspace:convert-to-nx-project --all", + "description": "Convert all projects in `workspace.json` to separate `project.json` files" + } + ], + "properties": { + "project": { "description": "Project name.", "type": "string" }, + "all": { + "description": "Should every project be converted?", + "type": "boolean" + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false + } + }, + "presets": [] + }, + "description": "Moves a project's configuration outside of workspace.json", + "implementation": "/packages/workspace/src/generators/convert-to-nx-project/convert-to-nx-project#convertToNxProjectGenerator.ts", + "aliases": [], + "hidden": false, + "path": "/packages/workspace/src/generators/convert-to-nx-project/schema.json" + }, + { + "name": "npm-package", + "factory": "./src/generators/npm-package/npm-package#npmPackageGenerator", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxWorkspaceNpmPackage", + "title": "Add a minimal npm package", + "description": "Add a minimal npm package.", + "cli": "nx", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Package name.", + "$default": { "$source": "argv", "index": 0 }, + "x-prompt": "What name of your npm package?", + "pattern": "^[a-zA-Z].*$" + } + }, + "required": ["name"], + "presets": [] + }, + "description": "Create a minimal npm package", + "x-type": "library", + "implementation": "/packages/workspace/src/generators/npm-package/npm-package#npmPackageGenerator.ts", + "aliases": [], + "hidden": false, + "path": "/packages/workspace/src/generators/npm-package/schema.json" + } + ], + "executors": [ + { + "name": "run-commands", + "implementation": "/packages/workspace/src/executors/run-commands/run-commands.impl.ts", + "schema": { + "title": "Run Commands", + "description": "Run any custom commands with Nx.", + "type": "object", + "cli": "nx", + "outputCapture": "pipe", + "presets": [ + { "name": "Arguments forwarding", "keys": ["commands"] }, + { + "name": "Custom done conditions", + "keys": ["commands", "readyWhen"] + }, + { "name": "Setting the cwd", "keys": ["commands", "cwd"] } + ], + "properties": { + "commands": { + "type": "array", + "description": "Commands to run in child process.", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "command": { + "type": "string", + "description": "Command to run in child process." + }, + "forwardAllArgs": { + "type": "boolean", + "description": "Whether arguments should be forwarded when interpolation is not present." + }, + "description": { + "type": "string", + "description": "An optional description useful for inline documentation purposes. It is not used as part of the execution of the command." + } + }, + "additionalProperties": false, + "required": ["command"] + }, + { "type": "string" } + ] + } + }, + "command": { + "type": "string", + "description": "Command to run in child process." + }, + "parallel": { + "type": "boolean", + "description": "Run commands in parallel.", + "default": true + }, + "readyWhen": { + "type": "string", + "description": "String to appear in `stdout` or `stderr` that indicates that the task is done. When running multiple commands, this option can only be used when `parallel` is set to `true`. If not specified, the task is done when all the child processes complete." + }, + "args": { + "type": "string", + "description": "Extra arguments. You can pass them as follows: nx run project:target --args='--wait=100'. You can then use {args.wait} syntax to interpolate them in the workspace config file. See example [above](#chaining-commands-interpolating-args-and-setting-the-cwd)" + }, + "envFile": { + "type": "string", + "description": "You may specify a custom .env file path." + }, + "color": { + "type": "boolean", + "description": "Use colors when showing output of command.", + "default": false + }, + "outputPath": { + "description": "Allows you to specify where the build artifacts are stored. This allows Nx Cloud to pick them up correctly, in the case that the build artifacts are placed somewhere other than the top level dist folder.", + "oneOf": [ + { "type": "string" }, + { "type": "array", "items": { "type": "string" } } + ] + }, + "cwd": { + "type": "string", + "description": "Current working directory of the commands. If it's not specified the commands will run in the workspace root, if a relative path is specified the commands will run in that path relative to the workspace root and if it's an absolute path the commands will run in that path." + } + }, + "additionalProperties": true, + "required": [], + "examplesFile": "`workspace.json`:\n\n```json\n//...\n\"frontend\": {\n \"targets\": {\n //...\n \"ls-project-root\": {\n \"executor\": \"@nrwl/workspace:run-commands\",\n \"options\": {\n \"command\": \"ls apps/frontend/src\"\n }\n }\n }\n}\n```\n\n```bash\nnx run frontend:ls-project-root\n```\n\n##### Chaining commands, interpolating args and setting the cwd\n\nLet's say each of our workspace projects has some custom bash scripts in a `scripts` folder.\nWe want a simple way to create empty bash script files for a given project, that have the execute permissions already set.\n\nGiven that Nx knows our workspace structure, we should be able to give it a project and the name of our script, and it should take care of the rest.\n\nThe `commands` option accepts as many commands as you want. By default, they all run in parallel.\nYou can run them sequentially by setting `parallel: false`:\n\n```json\n\"create-script\": {\n \"executor\": \"@nrwl/workspace:run-commands\",\n \"options\": {\n \"commands\": [\n \"mkdir -p scripts\",\n \"touch scripts/{args.name}.sh\",\n \"chmod +x scripts/{args.name}.sh\"\n ],\n \"cwd\": \"apps/frontend\",\n \"parallel\": false\n }\n}\n```\n\nBy setting the `cwd` option, each command will run in the `apps/frontend` folder.\n\nWe run the above with:\n\n```bash\nnx run frontend:create-script --args=\"--name=example\"\n```\n\nor simply with:\n\n```bash\nnx run frontend:create-script --name=example\n```\n\n##### Arguments forwarding\n\nWhen interpolation is not present in the command, all arguments are forwarded to the command by default.\n\nThis is useful when you need to pass raw argument strings to your command.\n\nFor example, when you run:\n\nnx run frontend:webpack --args=\"--config=example.config.js\"\n\n```json\n\"webpack\": {\n \"executor\": \"@nrwl/workspace:run-commands\",\n \"options\": {\n \"command\": \"webpack\"\n }\n}\n```\n\nThe above command will execute: `webpack --config=example.config.js`\n\nThis functionality can be disabled by using `commands` and expanding each `command` into an object\nthat sets the `forwardAllArgs` option to `false` as shown below:\n\n```json\n\"webpack\": {\n \"executor\": \"@nrwl/workspace:run-commands\",\n \"options\": {\n \"commands\": [\n {\n \"command\": \"webpack\",\n \"forwardAllArgs\": false\n }\n ]\n }\n}\n```\n\n##### Custom **done** conditions\n\nNormally, `run-commands` considers the commands done when all of them have finished running. If you don't need to wait until they're all done, you can set a special string that considers the commands finished the moment the string appears in `stdout` or `stderr`:\n\n```json\n\"finish-when-ready\": {\n \"executor\": \"@nrwl/workspace:run-commands\",\n \"options\": {\n \"commands\": [\n \"sleep 5 && echo 'FINISHED'\",\n \"echo 'READY'\"\n ],\n \"readyWhen\": \"READY\",\n \"parallel\": true\n }\n}\n```\n\n```bash\nnx run frontend:finish-when-ready\n```\n\nThe above commands will finish immediately, instead of waiting for 5 seconds.\n\n##### Nx Affected\n\nThe true power of `run-commands` comes from the fact that it runs through `nx`, which knows about your project graph. So you can run **custom commands** only for the projects that have been affected by a change.\n\nWe can create some configurations to generate docs, and if run using `nx affected`, it will only generate documentation for the projects that have been changed:\n\n```bash\nnx affected --target=generate-docs\n```\n\n```json\n//...\n\"frontend\": {\n \"targets\": {\n //...\n \"generate-docs\": {\n \"executor\": \"@nrwl/workspace:run-commands\",\n \"options\": {\n \"command\": \"npx compodoc -p apps/frontend/tsconfig.app.json\"\n }\n }\n }\n},\n\"api\": {\n \"targets\": {\n //...\n \"generate-docs\": {\n \"executor\": \"@nrwl/workspace:run-commands\",\n \"options\": {\n \"command\": \"npx compodoc -p apps/api/tsconfig.app.json\"\n }\n }\n }\n}\n```\n" + }, + "description": "Run any custom commands with Nx", + "aliases": [], + "hidden": false, + "path": "/packages/workspace/src/executors/run-commands/schema.json" + }, + { + "name": "counter", + "implementation": "/packages/workspace/src/executors/counter/counter.impl.ts", + "batchImplementation": "./src/executors/counter/counter.impl#batchCounter", + "schema": { + "title": "Counter", + "description": "A dummy executor useful for E2E tests.", + "type": "object", + "cli": "nx", + "outputCapture": "pipe", + "properties": { + "to": { "type": "number", "description": "Count to this number." }, + "result": { "type": "boolean", "description": "Final result." } + }, + "additionalProperties": true, + "required": ["to"], + "presets": [] + }, + "description": "A dummy executor useful for e2e tests", + "hidden": true, + "aliases": [], + "path": "/packages/workspace/src/executors/counter/schema.json" + }, + { + "name": "run-script", + "implementation": "/packages/workspace/src/executors/run-script/run-script.impl.ts", + "schema": { + "title": "Run Script", + "description": "Run any NPM script of a project in the project's root directory.", + "type": "object", + "cli": "nx", + "outputCapture": "pipe", + "properties": { + "script": { + "type": "string", + "description": "An npm script name in the `package.json` file of the project (e.g., `build`)." + } + }, + "additionalProperties": true, + "required": ["script"], + "examplesFile": "`workspace.json`:\n\n```json\n\"frontend\": {\n \"root\": \"packages/frontend\",\n \"targets\": {\n \"build\": {\n \"executor\": \"@nrwl/workspace:run-script\",\n \"options\": {\n \"script\": \"build-my-project\"\n }\n }\n }\n}\n```\n\n```bash\nnx run frontend:build\n```\n\nThe `build` target is going to run `npm run build-my-project` (or `yarn build-my-project`) in the `packages/frontend` directory.\n\n#### Caching Artifacts\n\nBy default, Nx is going to cache `dist/packages/frontend`, `packages/frontend/dist`, `packages/frontend/build`, `packages/frontend/public`. If your npm script writes files to other places, you can override the list of cached outputs as follows:\n\n```json\n\"frontend\": {\n \"root\": \"packages/frontend\",\n \"targets\": {\n \"build\": {\n \"executor\": \"@nrwl/workspace:run-script\",\n \"outputs\": [\"packages/frontend/dist\", \"packaged/frontend/docs\"],\n \"options\": {\n \"script\": \"build-my-project\"\n }\n }\n }\n}\n```\n", + "presets": [] + }, + "description": "Run an npm script using Nx", + "aliases": [], + "hidden": false, + "path": "/packages/workspace/src/executors/run-script/schema.json" + } + ] +} diff --git a/docs/map.json b/docs/map.json index 849be08ba0..c658541a6c 100644 --- a/docs/map.json +++ b/docs/map.json @@ -365,46 +365,14 @@ "id": "generate", "file": "generated/cli/generate" }, - { - "name": "serve", - "id": "serve", - "file": "generated/cli/serve" - }, - { - "name": "build", - "id": "build", - "file": "generated/cli/build" - }, - { - "name": "test", - "id": "test", - "file": "generated/cli/test" - }, - { - "name": "lint", - "id": "lint", - "file": "generated/cli/lint" - }, - { - "name": "e2e", - "id": "e2e", - "file": "generated/cli/e2e" - }, - { - "name": "run", - "id": "run", - "file": "generated/cli/run" - }, - { - "name": "daemon", - "id": "daemon", - "file": "generated/cli/daemon" - }, - { - "name": "graph", - "id": "dep-graph", - "file": "generated/cli/graph" - }, + { "name": "serve", "id": "serve", "file": "generated/cli/serve" }, + { "name": "build", "id": "build", "file": "generated/cli/build" }, + { "name": "test", "id": "test", "file": "generated/cli/test" }, + { "name": "lint", "id": "lint", "file": "generated/cli/lint" }, + { "name": "e2e", "id": "e2e", "file": "generated/cli/e2e" }, + { "name": "run", "id": "run", "file": "generated/cli/run" }, + { "name": "daemon", "id": "daemon", "file": "generated/cli/daemon" }, + { "name": "graph", "id": "dep-graph", "file": "generated/cli/graph" }, { "name": "run-many", "id": "run-many", @@ -450,16 +418,8 @@ "id": "migrate", "file": "generated/cli/migrate" }, - { - "name": "report", - "id": "report", - "file": "generated/cli/report" - }, - { - "name": "list", - "id": "list", - "file": "generated/cli/list" - }, + { "name": "report", "id": "report", "file": "generated/cli/report" }, + { "name": "list", "id": "list", "file": "generated/cli/list" }, { "name": "workspace-lint", "id": "workspace-lint", @@ -475,11 +435,7 @@ "id": "connect-to-nx-cloud", "file": "generated/cli/connect-to-nx-cloud" }, - { - "name": "reset", - "id": "reset", - "file": "generated/cli/reset" - } + { "name": "reset", "id": "reset", "file": "generated/cli/reset" } ] }, { @@ -489,53 +445,52 @@ { "id": "nrwl-workspace-overview", "name": "Overview", - "searchResultsName": "@nrwl/workspace Overview", "file": "shared/workspace-plugin" }, { "name": "library generator", "id": "library", - "file": "generated/api-workspace/generators/library" + "path": "/packages/workspace/generators/library" }, { "name": "npm-package generator", "id": "npm-package", - "file": "generated/api-workspace/generators/npm-package" + "path": "/packages/workspace/generators/npm-package" }, { "name": "move generator", "id": "move", - "file": "generated/api-workspace/generators/move" + "path": "/packages/workspace/generators/move" }, { "name": "remove generator", "id": "remove", - "file": "generated/api-workspace/generators/remove" + "path": "/packages/workspace/generators/remove" }, { "name": "run-commands generator", "id": "run-commands-generator", - "file": "generated/api-workspace/generators/run-commands" + "path": "/packages/workspace/generators/run-commands" }, { "name": "workspace-generator generator", "id": "workspace-generator", - "file": "generated/api-workspace/generators/workspace-generator" + "path": "/packages/workspace/generators/workspace-generator" }, { "name": "convert-to-nx-project generator", "id": "convert-to-nx-project-generator", - "file": "generated/api-workspace/generators/convert-to-nx-project" + "path": "/packages/workspace/generators/convert-to-nx-project" }, { "name": "run-commands executor", "id": "run-commands-executor", - "file": "generated/api-workspace/executors/run-commands" + "path": "/packages/workspace/executors/run-commands" }, { "name": "run-script executor", "id": "run-script", - "file": "generated/api-workspace/executors/run-script" + "path": "/packages/workspace/executors/run-script" } ] }, @@ -546,28 +501,27 @@ { "name": "Overview", "id": "overview", - "searchResultsName": "@nrwl/js Overview", "file": "shared/js-plugin" }, { "name": "library generator", "id": "library", - "file": "generated/api-js/generators/library" + "path": "/packages/js/generators/library" }, { "name": "convert-to-swc generator", "id": "convert-to-swc", - "file": "generated/api-js/generators/convert-to-swc" + "path": "/packages/js/generators/convert-to-swc" }, { "name": "tsc executor", "id": "tsc", - "file": "generated/api-js/executors/tsc" + "path": "/packages/js/executors/tsc" }, { "name": "swc executor", "id": "swc", - "file": "generated/api-js/executors/swc" + "path": "/packages/js/executors/swc" } ] }, @@ -578,33 +532,32 @@ { "id": "overview", "name": "Overview", - "searchResultsName": "@nrwl/web Overview", "file": "shared/web-plugin" }, { "name": "application generator", "id": "application", - "file": "generated/api-web/generators/application" + "path": "/packages/web/generators/application" }, { "name": "build executor", "id": "build", - "file": "generated/api-web/executors/webpack" + "path": "/packages/web/executors/webpack" }, { "name": "dev-server executor", "id": "dev-server", - "file": "generated/api-web/executors/dev-server" + "path": "/packages/web/executors/dev-server" }, { "name": "file-server executor", "id": "file-server", - "file": "generated/api-web/executors/file-server" + "path": "/packages/web/executors/file-server" }, { "name": "package executor", "id": "package", - "file": "generated/api-web/executors/rollup" + "path": "/packages/web/executors/rollup" } ] }, @@ -615,153 +568,152 @@ { "id": "overview", "name": "Overview", - "searchResultsName": "@nrwl/angular Overview", "file": "shared/angular-plugin" }, { "name": "application generator", "id": "application", - "file": "generated/api-angular/generators/application" + "path": "/packages/angular/generators/application" }, { "name": "component generator", "id": "component", - "file": "generated/api-angular/generators/component" + "path": "/packages/angular/generators/component" }, { "name": "convert-tslint-to-eslint", "id": "convert-tslint-to-eslint", - "file": "generated/api-angular/generators/convert-tslint-to-eslint" + "path": "/packages/angular/generators/convert-tslint-to-eslint" }, { "name": "downgrade-module generator", "id": "downgrade-module", - "file": "generated/api-angular/generators/downgrade-module" + "path": "/packages/angular/generators/downgrade-module" }, { "name": "karma generator", "id": "karma", - "file": "generated/api-angular/generators/karma" + "path": "/packages/angular/generators/karma" }, { "name": "karma-project generator", "id": "karma-project", - "file": "generated/api-angular/generators/karma-project" + "path": "/packages/angular/generators/karma-project" }, { "name": "library generator", "id": "library", - "file": "generated/api-angular/generators/library" + "path": "/packages/angular/generators/library" }, { "name": "library-secondary-entry-point generator", "id": "library-secondary-entry-point", - "file": "generated/api-angular/generators/library-secondary-entry-point" + "path": "/packages/angular/generators/library-secondary-entry-point" }, { "name": "mfe-host generator", "id": "mfe-host", - "file": "generated/api-angular/generators/mfe-host" + "path": "/packages/angular/generators/mfe-host" }, { "name": "mfe-remote generator", "id": "mfe-remote", - "file": "generated/api-angular/generators/mfe-remote" + "path": "/packages/angular/generators/mfe-remote" }, { "name": "move generator", "id": "move", - "file": "generated/api-angular/generators/move" + "path": "/packages/angular/generators/move" }, { "name": "convert-to-with-mf generator", "id": "convert-to-with-mf", - "file": "generated/api-angular/generators/convert-to-with-mf" + "path": "/packages/angular/generators/convert-to-with-mf" }, { "name": "ngrx generator", "id": "ngrx", - "file": "generated/api-angular/generators/ngrx" + "path": "/packages/angular/generators/ngrx" }, { "name": "scam generator", "id": "scam", - "file": "generated/api-angular/generators/scam" + "path": "/packages/angular/generators/scam" }, { "name": "scam-directive generator", "id": "scam-directive", - "file": "generated/api-angular/generators/scam-directive" + "path": "/packages/angular/generators/scam-directive" }, { "name": "scam-pipe generator", "id": "scam-pipe", - "file": "generated/api-angular/generators/scam-pipe" + "path": "/packages/angular/generators/scam-pipe" }, { "name": "setup-mfe generator", "id": "setup-mfe", - "file": "generated/api-angular/generators/setup-mfe" + "path": "/packages/angular/generators/setup-mfe" }, { "name": "setup-tailwind generator", "id": "setup-tailwind", - "file": "generated/api-angular/generators/setup-tailwind" + "path": "/packages/angular/generators/setup-tailwind" }, { "name": "stories generator", "id": "stories", - "file": "generated/api-angular/generators/stories" + "path": "/packages/angular/generators/stories" }, { "name": "storybook-configuration generator", "id": "storybook-configuration", - "file": "generated/api-angular/generators/storybook-configuration" + "path": "/packages/angular/generators/storybook-configuration" }, { "name": "storybook-migrate-defaults-5-to-6 generator", "id": "storybook-migrate-defaults-5-to-6", - "file": "generated/api-angular/generators/storybook-migrate-defaults-5-to-6" + "path": "/packages/angular/generators/storybook-migrate-defaults-5-to-6" }, { "name": "storybook-migrate-stories-to-6-2 generator", "id": "storybook-migrate-stories-to-6-2", - "file": "generated/api-angular/generators/storybook-migrate-stories-to-6-2" + "path": "/packages/angular/generators/storybook-migrate-stories-to-6-2" }, { "name": "upgrade-module generator", "id": "upgrade-module", - "file": "generated/api-angular/generators/upgrade-module" + "path": "/packages/angular/generators/upgrade-module" }, { "name": "web-worker generator", "id": "web-worker", - "file": "generated/api-angular/generators/web-worker" + "path": "/packages/angular/generators/web-worker" }, { "name": "delegate-build executor", "id": "delegate-build", - "file": "generated/api-angular/executors/delegate-build" + "path": "/packages/angular/executors/delegate-build" }, { "name": "ng packagr lite executor", "id": "ng-packagr-lite", - "file": "generated/api-angular/executors/ng-packagr-lite" + "path": "/packages/angular/executors/ng-packagr-lite" }, { "name": "package executor", "id": "package", - "file": "generated/api-angular/executors/package" + "path": "/packages/angular/executors/package" }, { "name": "webpack-browser executor", "id": "webpack-browser", - "file": "generated/api-angular/executors/webpack-browser" + "path": "/packages/angular/executors/webpack-browser" }, { "name": "webpack-server executor", "id": "webpack-server", - "file": "generated/api-angular/executors/webpack-server" + "path": "/packages/angular/executors/webpack-server" } ] }, @@ -772,58 +724,57 @@ { "id": "overview", "name": "Overview", - "searchResultsName": "@nrwl/react Overview", "file": "shared/react-plugin" }, { "name": "application generator", "id": "application", - "file": "generated/api-react/generators/application" + "path": "/packages/react/generators/application" }, { "name": "component generator", "id": "component", - "file": "generated/api-react/generators/component" + "path": "/packages/react/generators/component" }, { "name": "component-cypress-spec generator", "id": "component-cypress-spec", - "file": "generated/api-react/generators/component-cypress-spec" + "path": "/packages/react/generators/component-cypress-spec" }, { "name": "component-story generator", "id": "component-story", - "file": "generated/api-react/generators/component-story" + "path": "/packages/react/generators/component-story" }, { "name": "library generator", "id": "library", - "file": "generated/api-react/generators/library" + "path": "/packages/react/generators/library" }, { "name": "redux generator", "id": "redux", - "file": "generated/api-react/generators/redux" + "path": "/packages/react/generators/redux" }, { "name": "stories generator", "id": "stories", - "file": "generated/api-react/generators/stories" + "path": "/packages/react/generators/stories" }, { "name": "storybook-configuration generator", "id": "storybook-configuration", - "file": "generated/api-react/generators/storybook-configuration" + "path": "/packages/react/generators/storybook-configuration" }, { "name": "storybook-migrate-defaults-5-to-6 generator", "id": "storybook-migrate-defaults-5-to-6", - "file": "generated/api-react/generators/storybook-migrate-defaults-5-to-6" + "path": "/packages/react/generators/storybook-migrate-defaults-5-to-6" }, { "name": "hook generator", "id": "hook", - "file": "generated/api-react/generators/hook" + "path": "/packages/react/generators/hook" } ] }, @@ -834,13 +785,12 @@ { "id": "overview", "name": "Overview", - "searchResultsName": "@nrwl/jest Overview", "file": "shared/jest-plugin" }, { "name": "jest executor", "id": "jest", - "file": "generated/api-jest/executors/jest" + "path": "/packages/jest/executors/jest" } ] }, @@ -851,18 +801,17 @@ { "id": "overview", "name": "Overview", - "searchResultsName": "@nrwl/cypress Overview", "file": "shared/cypress-plugin" }, { "name": "cypress executor", "id": "cypress", - "file": "generated/api-cypress/executors/cypress" + "path": "/packages/cypress/executors/cypress" }, { "name": "cypress-project generator", "id": "cypress-project", - "file": "generated/api-cypress/generators/cypress-project" + "path": "/packages/cypress/generators/cypress-project" } ] }, @@ -873,13 +822,11 @@ { "id": "overview-react", "name": "Overview (React)", - "searchResultsName": "@nrwl/storybook Overview (React)", "file": "shared/guides/storybook/plugin-react" }, { "id": "overview-angular", "name": "Overview (Angular)", - "searchResultsName": "@nrwl/storybook Overview (Angular)", "file": "shared/guides/storybook/plugin-angular" }, { @@ -910,32 +857,32 @@ { "name": "configuration generator", "id": "configuration", - "file": "generated/api-storybook/generators/configuration" + "path": "/packages/storybook/generators/configuration" }, { "name": "cypress-project generator", "id": "cypress-project", - "file": "generated/api-storybook/generators/cypress-project" + "path": "/packages/storybook/generators/cypress-project" }, { "name": "migrate-defaults-5-to-6 generator", "id": "migrate-defaults-5-to-6", - "file": "generated/api-storybook/generators/migrate-defaults-5-to-6" + "path": "/packages/storybook/generators/migrate-defaults-5-to-6" }, { "name": "migrate-stories-to-6-2 generator", "id": "migrate-stories-to-6-2", - "file": "generated/api-storybook/generators/migrate-stories-to-6-2" + "path": "/packages/storybook/generators/migrate-stories-to-6-2" }, { "name": "Executors: Build", "id": "executors-build", - "file": "generated/api-storybook/executors/build" + "path": "/packages/storybook/executors/build" }, { "name": "Executors: Storybook", "id": "executors-storybook", - "file": "generated/api-storybook/executors/storybook" + "path": "/packages/storybook/executors/storybook" } ] }, @@ -946,29 +893,27 @@ { "id": "overview", "name": "Overview", - "searchResultsName": "@nrwl/linter Overview", "file": "shared/linter-plugin" }, { "id": "eslint-plugin-nx", "name": "eslint-plugin-nx", - "searchResultsName": "@nrwl/eslint-plugin-nx Overview", "file": "shared/eslint-plugin-nx" }, { "name": "eslint executor", "id": "eslint", - "file": "generated/api-linter/executors/eslint" + "path": "/packages/linter/executors/eslint" }, { "name": "lint executor", "id": "lint", - "file": "generated/api-linter/executors/lint" + "path": "/packages/linter/executors/lint" }, { "name": "workspace-rule generator", "id": "workspace-rule", - "file": "generated/api-linter/generators/workspace-rule" + "path": "/packages/linter/generators/workspace-rule" } ] }, @@ -979,28 +924,27 @@ { "id": "overview", "name": "Overview", - "searchResultsName": "@nrwl/node Overview", "file": "shared/node-plugin" }, { "name": "application generator", "id": "application", - "file": "generated/api-node/generators/application" + "path": "/packages/node/generators/application" }, { "name": "library generator", "id": "library", - "file": "generated/api-node/generators/library" + "path": "/packages/node/generators/library" }, { "name": "webpack executor", "id": "webpack", - "file": "generated/api-node/executors/webpack" + "path": "/packages/node/executors/webpack" }, { "name": "node executor", "id": "node", - "file": "generated/api-node/executors/node" + "path": "/packages/node/executors/node" } ] }, @@ -1011,13 +955,12 @@ { "id": "overview", "name": "Overview", - "searchResultsName": "@nrwl/express Overview", "file": "shared/express-plugin" }, { "name": "application generator", "id": "application", - "file": "generated/api-express/generators/application" + "path": "/packages/express/generators/application" } ] }, @@ -1028,98 +971,97 @@ { "id": "overview", "name": "Overview", - "searchResultsName": "@nrwl/nest Overview", "file": "shared/nest-plugin" }, { "name": "application generator", "id": "application", - "file": "generated/api-nest/generators/application" + "path": "/packages/nest/generators/application" }, { "name": "class generator", "id": "class", - "file": "generated/api-nest/generators/class" + "path": "/packages/nest/generators/class" }, { "name": "controller generator", "id": "controller", - "file": "generated/api-nest/generators/controller" + "path": "/packages/nest/generators/controller" }, { "name": "decorator generator", "id": "decorator", - "file": "generated/api-nest/generators/decorator" + "path": "/packages/nest/generators/decorator" }, { "name": "filter generator", "id": "filter", - "file": "generated/api-nest/generators/filter" + "path": "/packages/nest/generators/filter" }, { "name": "gateway generator", "id": "gateway", - "file": "generated/api-nest/generators/gateway" + "path": "/packages/nest/generators/gateway" }, { "name": "guard generator", "id": "guard", - "file": "generated/api-nest/generators/guard" + "path": "/packages/nest/generators/guard" }, { "name": "interceptor generator", "id": "interceptor", - "file": "generated/api-nest/generators/interceptor" + "path": "/packages/nest/generators/interceptor" }, { "name": "interface generator", "id": "interface", - "file": "generated/api-nest/generators/interface" + "path": "/packages/nest/generators/interface" }, { "name": "library generator", "id": "library", - "file": "generated/api-nest/generators/library" + "path": "/packages/nest/generators/library" }, { "name": "middleware generator", "id": "middleware", - "file": "generated/api-nest/generators/middleware" + "path": "/packages/nest/generators/middleware" }, { "name": "module generator", "id": "module", - "file": "generated/api-nest/generators/module" + "path": "/packages/nest/generators/module" }, { "name": "pipe generator", "id": "pipe", - "file": "generated/api-nest/generators/pipe" + "path": "/packages/nest/generators/pipe" }, { "name": "provider generator", "id": "provider", - "file": "generated/api-nest/generators/provider" + "path": "/packages/nest/generators/provider" }, { "name": "resolver generator", "id": "resolver", - "file": "generated/api-nest/generators/resolver" + "path": "/packages/nest/generators/resolver" }, { "name": "resource generator", "id": "resource", - "file": "generated/api-nest/generators/resource" + "path": "/packages/nest/generators/resource" }, { "name": "service generator", "id": "service", - "file": "generated/api-nest/generators/service" + "path": "/packages/nest/generators/service" }, { "name": "convert-tslint-to-eslint", "id": "convert-tslint-to-eslint", - "file": "generated/api-nest/generators/convert-tslint-to-eslint" + "path": "/packages/nest/generators/convert-tslint-to-eslint" } ] }, @@ -1130,38 +1072,37 @@ { "id": "overview", "name": "Overview", - "searchResultsName": "@nrwl/next Overview", "file": "shared/next-plugin" }, { "name": "application generator", "id": "application", - "file": "generated/api-next/generators/application" + "path": "/packages/next/generators/application" }, { "name": "component generator", "id": "component", - "file": "generated/api-next/generators/component" + "path": "/packages/next/generators/component" }, { "name": "page generator", "id": "page", - "file": "generated/api-next/generators/page" + "path": "/packages/next/generators/page" }, { "name": "build executor", "id": "build", - "file": "generated/api-next/executors/build" + "path": "/packages/next/executors/build" }, { "name": "server executor", "id": "server", - "file": "generated/api-next/executors/server" + "path": "/packages/next/executors/server" }, { "name": "export executor", "id": "export", - "file": "generated/api-next/executors/export" + "path": "/packages/next/executors/export" } ] }, @@ -1172,23 +1113,22 @@ { "id": "overview", "name": "Overview", - "searchResultsName": "@nrwl/detox Overview", "file": "shared/detox-plugin" }, { "name": "application generator", "id": "application", - "file": "generated/api-detox/generators/application" + "path": "/packages/detox/generators/application" }, { "name": "build executor", "id": "build", - "file": "generated/api-detox/executors/build" + "path": "/packages/detox/executors/build" }, { "name": "test executor", "id": "test", - "file": "generated/api-detox/executors/test" + "path": "/packages/detox/executors/test" } ] }, @@ -1199,78 +1139,77 @@ { "id": "overview", "name": "Overview", - "searchResultsName": "@nrwl/react-native Overview", "file": "shared/react-native-plugin" }, { "name": "application generator", "id": "application", - "file": "generated/api-react-native/generators/application" + "path": "/packages/react-native/generators/application" }, { "name": "component generator", "id": "component", - "file": "generated/api-react-native/generators/component" + "path": "/packages/react-native/generators/component" }, { "name": "library generator", "id": "library", - "file": "generated/api-react-native/generators/library" + "path": "/packages/react-native/generators/library" }, { "name": "component-story generator", "id": "component-story", - "file": "generated/api-react-native/generators/component-story" + "path": "/packages/react-native/generators/component-story" }, { "name": "stories generator", "id": "stories", - "file": "generated/api-react-native/generators/stories" + "path": "/packages/react-native/generators/stories" }, { "name": "storybook-configuration generator", "id": "storybook-configuration", - "file": "generated/api-react-native/generators/storybook-configuration" + "path": "/packages/react-native/generators/storybook-configuration" }, { "name": "build android executor", "id": "build-android", - "file": "generated/api-react-native/executors/build-android" + "path": "/packages/react-native/executors/build-android" }, { "name": "bundle executor", "id": "bundle", - "file": "generated/api-react-native/executors/bundle" + "path": "/packages/react-native/executors/bundle" }, { "name": "ensure symlink executor", "id": "ensure-symlink", - "file": "generated/api-react-native/executors/ensure-symlink" + "path": "/packages/react-native/executors/ensure-symlink" }, { "name": "run android executor", "id": "run-android", - "file": "generated/api-react-native/executors/run-android" + "path": "/packages/react-native/executors/run-android" }, { "name": "run ios executor", "id": "run-ios", - "file": "generated/api-react-native/executors/run-ios" + "path": "/packages/react-native/executors/run-ios" }, { "name": "start executor", "id": "start", - "file": "generated/api-react-native/executors/start" + "path": "/packages/react-native/executors/start" }, { "name": "storybook executor", "id": "storybook", - "file": "generated/api-react-native/executors/storybook" + "path": "/packages/react-native/executors/storybook" }, { "name": "sync deps executor", "id": "sync-deps", - "file": "generated/api-react-native/executors/sync-deps" + "path": "/packages/react-native/executors/sync-deps" } ] }, @@ -1281,33 +1220,32 @@ { "id": "overview", "name": "Overview", - "searchResultsName": "@nrwl/nx-plugin Overview", "file": "shared/nx-plugin" }, { "name": "executor generator", "id": "executor", - "file": "generated/api-nx-plugin/generators/executor" + "path": "/packages/nx-plugin/generators/executor" }, { "name": "migration generator", "id": "migration", - "file": "generated/api-nx-plugin/generators/migration" + "path": "/packages/nx-plugin/generators/migration" }, { "name": "plugin generator", "id": "plugin", - "file": "generated/api-nx-plugin/generators/plugin" + "path": "/packages/nx-plugin/generators/plugin" }, { "name": "generator generator", "id": "schematic", - "file": "generated/api-nx-plugin/generators/generator" + "path": "/packages/nx-plugin/generators/generator" }, { "name": "e2e executor", "id": "e2e", - "file": "generated/api-nx-plugin/executors/e2e" + "path": "/packages/nx-plugin/executors/e2e" } ] }, @@ -1318,13 +1256,11 @@ { "id": "index", "name": "Overview", - "searchResultsName": "Nx Devkit", "file": "generated/api-nx-devkit/index" }, { "id": "ngcli_adapter", "name": "Ng CLI Adapter", - "searchResultsName": "Ng CLI Adapter", "file": "generated/api-nx-devkit/ngcli_adapter" } ] @@ -1522,11 +1458,7 @@ "id": "eslint", "file": "shared/eslint" }, - { - "name": "Nx Daemon", - "id": "nx-daemon", - "file": "shared/daemon" - }, + { "name": "Nx Daemon", "id": "nx-daemon", "file": "shared/daemon" }, { "name": "JavaScript and TypeScript", "id": "js-and-ts", diff --git a/docs/packages.json b/docs/packages.json new file mode 100644 index 0000000000..5e7f694e26 --- /dev/null +++ b/docs/packages.json @@ -0,0 +1,282 @@ +[ + { + "name": "add-nx-to-monorepo", + "path": "generated/packages/add-nx-to-monorepo.json", + "schemas": { "executors": [], "generators": [] } + }, + { + "name": "angular", + "path": "generated/packages/angular.json", + "schemas": { + "executors": [ + "delegate-build", + "ng-packagr-lite", + "package", + "webpack-browser", + "webpack-server" + ], + "generators": [ + "add-linting", + "application", + "component", + "component-cypress-spec", + "component-story", + "convert-tslint-to-eslint", + "downgrade-module", + "init", + "karma", + "karma-project", + "library", + "library-secondary-entry-point", + "mfe-remote", + "move", + "convert-to-with-mf", + "mfe-host", + "ng-add", + "ngrx", + "scam", + "scam-directive", + "scam-pipe", + "setup-mfe", + "setup-tailwind", + "stories", + "storybook-configuration", + "storybook-migrate-defaults-5-to-6", + "storybook-migrate-stories-to-6-2", + "upgrade-module", + "web-worker" + ] + } + }, + { + "name": "cli", + "path": "generated/packages/cli.json", + "schemas": { "executors": [], "generators": [] } + }, + { + "name": "cra-to-nx", + "path": "generated/packages/cra-to-nx.json", + "schemas": { "executors": [], "generators": [] } + }, + { + "name": "create-nx-plugin", + "path": "generated/packages/create-nx-plugin.json", + "schemas": { "executors": [], "generators": [] } + }, + { + "name": "create-nx-workspace", + "path": "generated/packages/create-nx-workspace.json", + "schemas": { "executors": [], "generators": [] } + }, + { + "name": "cypress", + "path": "generated/packages/cypress.json", + "schemas": { + "executors": ["cypress"], + "generators": ["init", "cypress-project"] + } + }, + { + "name": "detox", + "path": "generated/packages/detox.json", + "schemas": { + "executors": ["build", "test"], + "generators": ["init", "application"] + } + }, + { + "name": "devkit", + "path": "generated/packages/devkit.json", + "schemas": { "executors": [], "generators": [] } + }, + { + "name": "eslint-plugin-nx", + "path": "generated/packages/eslint-plugin-nx.json", + "schemas": { "executors": [], "generators": [] } + }, + { + "name": "express", + "path": "generated/packages/express.json", + "schemas": { "executors": [], "generators": ["init", "application"] } + }, + { + "name": "jest", + "path": "generated/packages/jest.json", + "schemas": { "executors": ["jest"], "generators": ["init", "jest-project"] } + }, + { + "name": "js", + "path": "generated/packages/js.json", + "schemas": { + "executors": ["tsc", "swc"], + "generators": ["library", "convert-to-swc"] + } + }, + { + "name": "linter", + "path": "generated/packages/linter.json", + "schemas": { + "executors": ["lint", "eslint"], + "generators": ["workspace-rules-project", "workspace-rule"] + } + }, + { + "name": "make-angular-cli-faster", + "path": "generated/packages/make-angular-cli-faster.json", + "schemas": { "executors": [], "generators": [] } + }, + { + "name": "nest", + "path": "generated/packages/nest.json", + "schemas": { + "executors": [], + "generators": [ + "application", + "convert-tslint-to-eslint", + "init", + "library", + "class", + "controller", + "decorator", + "filter", + "gateway", + "guard", + "interceptor", + "interface", + "middleware", + "module", + "pipe", + "provider", + "resolver", + "resource", + "service" + ] + } + }, + { + "name": "next", + "path": "generated/packages/next.json", + "schemas": { + "executors": ["build", "server", "export"], + "generators": ["init", "application", "page", "component", "library"] + } + }, + { + "name": "node", + "path": "generated/packages/node.json", + "schemas": { + "executors": ["webpack", "node"], + "generators": ["init", "application", "library"] + } + }, + { + "name": "nx", + "path": "generated/packages/nx.json", + "schemas": { "executors": [], "generators": [] } + }, + { + "name": "nx-plugin", + "path": "generated/packages/nx-plugin.json", + "schemas": { + "executors": ["e2e"], + "generators": [ + "plugin", + "e2e-project", + "migration", + "generator", + "executor" + ] + } + }, + { + "name": "react", + "path": "generated/packages/react.json", + "schemas": { + "executors": [], + "generators": [ + "init", + "application", + "library", + "component", + "redux", + "storybook-configuration", + "storybook-migrate-defaults-5-to-6", + "component-story", + "stories", + "component-cypress-spec", + "hook" + ] + } + }, + { + "name": "react-native", + "path": "generated/packages/react-native.json", + "schemas": { + "executors": [ + "run-android", + "run-ios", + "bundle", + "build-android", + "start", + "sync-deps", + "ensure-symlink", + "storybook" + ], + "generators": [ + "init", + "application", + "library", + "component", + "storybook-configuration", + "component-story", + "stories" + ] + } + }, + { + "name": "storybook", + "path": "generated/packages/storybook.json", + "schemas": { + "executors": ["storybook", "build"], + "generators": [ + "init", + "configuration", + "cypress-project", + "migrate-defaults-5-to-6", + "migrate-stories-to-6-2" + ] + } + }, + { + "name": "tao", + "path": "generated/packages/tao.json", + "schemas": { "executors": [], "generators": [] } + }, + { + "name": "web", + "path": "generated/packages/web.json", + "schemas": { + "executors": ["webpack", "rollup", "dev-server", "file-server"], + "generators": ["init", "application"] + } + }, + { + "name": "workspace", + "path": "generated/packages/workspace.json", + "schemas": { + "executors": ["run-commands", "counter", "run-script"], + "generators": [ + "workspace", + "preset", + "move", + "remove", + "new", + "library", + "workspace-generator", + "run-commands", + "convert-to-nx-project", + "npm-package" + ] + } + } +] diff --git a/nx-dev/data-access-documents/jest.config.js b/nx-dev/data-access-documents/jest.config.js index 37d046f9fe..eedaf93796 100644 --- a/nx-dev/data-access-documents/jest.config.js +++ b/nx-dev/data-access-documents/jest.config.js @@ -12,5 +12,5 @@ module.exports = { '^.+\\.[tj]sx?$': 'ts-jest', }, moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], - coverageDirectory: '../../../coverage/nx-dev/data-access-documents', + coverageDirectory: '../../coverage/nx-dev/data-access-documents', }; diff --git a/nx-dev/data-access-documents/src/index.ts b/nx-dev/data-access-documents/src/index.ts index eadc3d1fee..714dd8766e 100644 --- a/nx-dev/data-access-documents/src/index.ts +++ b/nx-dev/data-access-documents/src/index.ts @@ -1,4 +1,2 @@ -export * from './lib/documents.api'; export * from './lib/documents.models'; -export * from './lib/menu.api'; export * from './lib/menu.models'; diff --git a/nx-dev/data-access-documents/src/lib/documents.api.ts b/nx-dev/data-access-documents/src/lib/documents.api.ts index bd7fe81868..3a782e8f24 100644 --- a/nx-dev/data-access-documents/src/lib/documents.api.ts +++ b/nx-dev/data-access-documents/src/lib/documents.api.ts @@ -1,7 +1,7 @@ +import { DocumentData, DocumentMetadata } from '@nrwl/nx-dev/models-document'; import { readFileSync } from 'fs'; import matter from 'gray-matter'; import { join } from 'path'; -import { DocumentData, DocumentMetadata } from './documents.models'; import { extractTitle } from './documents.utils'; export interface StaticDocumentPaths { @@ -40,7 +40,7 @@ export class DocumentsApi { }; } - getDocuments() { + getDocuments(): DocumentMetadata { const docs = this.options.documents; if (docs) return docs; throw new Error(`Cannot find any documents`); @@ -55,6 +55,14 @@ export class DocumentsApi { recur(ii, [...acc, curr.id]); }); } else { + /* + * Do not try to get paths for Packages (done by the PackagesApi). + * This should be removed when the packages/schemas menu is inferred directly from PackagesApi. + * TODO@ben: Remove this when packages schemas menu is auto-generated. + */ + if (!!curr['path'] && curr['path'].startsWith('/packages/')) + return void 0; // Do nothing + paths.push({ params: { segments: [...acc, curr.id], diff --git a/nx-dev/data-access-documents/src/lib/documents.models.ts b/nx-dev/data-access-documents/src/lib/documents.models.ts deleted file mode 100644 index f97be0a2d6..0000000000 --- a/nx-dev/data-access-documents/src/lib/documents.models.ts +++ /dev/null @@ -1,32 +0,0 @@ -export interface DocumentData { - filePath: string; - data: { [key: string]: any }; - content: string; - excerpt?: string; -} - -export interface FlavorMetadata { - name: string; - id: string; - alias: string; - path: string; - default?: boolean; -} - -export interface VersionMetadata { - name: string; - id: string; - alias: string; - release: string; - path: string; - default?: boolean; - hidden?: boolean; -} - -export interface DocumentMetadata { - id: string; - name?: string; - file?: string; - searchResultsName?: string; - itemList?: DocumentMetadata[]; -} diff --git a/nx-dev/data-access-documents/src/lib/menu.api.ts b/nx-dev/data-access-documents/src/lib/menu.api.ts index d2e7017ba4..da70604881 100644 --- a/nx-dev/data-access-documents/src/lib/menu.api.ts +++ b/nx-dev/data-access-documents/src/lib/menu.api.ts @@ -1,5 +1,5 @@ -import type { DocumentsApi } from './documents.api'; -import { Menu } from './menu.models'; +import { DocumentMetadata } from '@nrwl/nx-dev/models-document'; +import { Menu } from '@nrwl/nx-dev/models-menu'; import { createMenuItems, getApiSection, @@ -10,13 +10,13 @@ import { export class MenuApi { private menuCache: Menu | null = null; - constructor(private readonly documentsApi: DocumentsApi) {} + constructor(private readonly documents: DocumentMetadata) {} getMenu(): Menu { let menu = this.menuCache; if (!menu) { - const items = createMenuItems(this.documentsApi.getDocuments()); + const items = createMenuItems(this.documents); if (items) { menu = { sections: [ diff --git a/nx-dev/data-access-documents/src/lib/menu.utils.ts b/nx-dev/data-access-documents/src/lib/menu.utils.ts index 095c0492a4..783b0ce3df 100644 --- a/nx-dev/data-access-documents/src/lib/menu.utils.ts +++ b/nx-dev/data-access-documents/src/lib/menu.utils.ts @@ -1,5 +1,5 @@ -import { DocumentMetadata } from '@nrwl/nx-dev/data-access-documents'; -import { MenuItem, MenuSection } from './menu.models'; +import { DocumentMetadata } from '@nrwl/nx-dev/models-document'; +import { MenuItem, MenuSection } from '@nrwl/nx-dev/models-menu'; export function createMenuItems(root: DocumentMetadata): MenuItem[] { const items = root?.itemList; @@ -7,8 +7,7 @@ export function createMenuItems(root: DocumentMetadata): MenuItem[] { const createPathMetadata = (g: DocumentMetadata, parentId = ''): MenuItem => { const pathData = { ...g, - path: `/${parentId}/${g.id}`, - url: `/${parentId}/${g.id}`, + path: g['path'] ?? `/${parentId}/${g.id}`, }; if (Array.isArray(g.itemList)) { diff --git a/nx-dev/data-access-documents/src/node.index.ts b/nx-dev/data-access-documents/src/node.index.ts new file mode 100644 index 0000000000..a4524643df --- /dev/null +++ b/nx-dev/data-access-documents/src/node.index.ts @@ -0,0 +1,2 @@ +export * from './lib/documents.api'; +export * from './lib/menu.api'; diff --git a/nx-dev/data-access-packages/.eslintrc.json b/nx-dev/data-access-packages/.eslintrc.json new file mode 100644 index 0000000000..9d9c0db55b --- /dev/null +++ b/nx-dev/data-access-packages/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + } + ] +} diff --git a/nx-dev/data-access-packages/README.md b/nx-dev/data-access-packages/README.md new file mode 100644 index 0000000000..724ea10b1f --- /dev/null +++ b/nx-dev/data-access-packages/README.md @@ -0,0 +1,7 @@ +# nx-dev-data-access-packages + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test nx-dev-data-access-packages` to execute the unit tests via [Jest](https://jestjs.io). diff --git a/nx-dev/data-access-packages/jest.config.js b/nx-dev/data-access-packages/jest.config.js new file mode 100644 index 0000000000..246edfb3b8 --- /dev/null +++ b/nx-dev/data-access-packages/jest.config.js @@ -0,0 +1,16 @@ +const nxPreset = require('@nrwl/jest/preset'); +module.exports = { + ...nxPreset, + setupFilesAfterEnv: ['/src/test-setup.ts'], + displayName: 'nx-dev-data-access-packages', + globals: { + 'ts-jest': { + tsconfig: '/tsconfig.spec.json', + }, + }, + transform: { + '^.+\\.[tj]sx?$': 'ts-jest', + }, + moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], + coverageDirectory: '../../coverage/nx-dev/data-access-packages', +}; diff --git a/nx-dev/data-access-packages/project.json b/nx-dev/data-access-packages/project.json new file mode 100644 index 0000000000..e9683fc47f --- /dev/null +++ b/nx-dev/data-access-packages/project.json @@ -0,0 +1,23 @@ +{ + "root": "nx-dev/data-access-packages", + "sourceRoot": "nx-dev/data-access-packages/src", + "projectType": "library", + "targets": { + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["nx-dev/data-access-packages/**/*.ts"] + } + }, + "test": { + "executor": "@nrwl/jest:jest", + "outputs": ["coverage/nx-dev/data-access-packages"], + "options": { + "jestConfig": "nx-dev/data-access-packages/jest.config.js", + "passWithNoTests": true + } + } + }, + "tags": ["scope:nx-dev", "type:data-access"] +} diff --git a/nx-dev/data-access-packages/src/index.ts b/nx-dev/data-access-packages/src/index.ts new file mode 100644 index 0000000000..fb61249db0 --- /dev/null +++ b/nx-dev/data-access-packages/src/index.ts @@ -0,0 +1,3 @@ +export * from './lib/get-title-for-schema'; +export * from './lib/get-description-for-schema'; +export * from './lib/lookup'; diff --git a/nx-dev/data-access-packages/src/lib/get-description-for-schema.ts b/nx-dev/data-access-packages/src/lib/get-description-for-schema.ts new file mode 100644 index 0000000000..38dffc3819 --- /dev/null +++ b/nx-dev/data-access-packages/src/lib/get-description-for-schema.ts @@ -0,0 +1,13 @@ +import { JsonSchema } from '@nrwl/nx-dev/models-package'; + +export function getDescriptionForSchema(schema: JsonSchema): string { + if (typeof schema === 'boolean') { + return schema + ? 'Anything is allowed here.' + : 'There is no valid value for this property.'; + } + if (Object.keys(schema).length === 0) { + return 'Anything is allowed here.'; + } + return schema.description ?? 'No description available.'; +} diff --git a/nx-dev/data-access-packages/src/lib/get-title-for-schema.ts b/nx-dev/data-access-packages/src/lib/get-title-for-schema.ts new file mode 100644 index 0000000000..b646ec1f5a --- /dev/null +++ b/nx-dev/data-access-packages/src/lib/get-title-for-schema.ts @@ -0,0 +1,27 @@ +import { JsonSchema1 } from '@nrwl/nx-dev/models-package'; + +export function getTitleForSchema( + reference: string, + schema: JsonSchema1 +): string | undefined { + if (schema.title !== undefined) { + return schema.title; + } + + const rs = reference.split('/'); + const last = rs[rs.length - 1]; + const secondLast = rs[rs.length - 2]; + const thirdLast = rs[rs.length - 3]; + if (['properties', 'definitions'].includes(secondLast)) { + return last; + } else if (last === 'additionalProperties') { + return '(Additional properties)'; + } else if ( + last === 'items' && + ['properties', 'definitions'].includes(thirdLast) + ) { + return secondLast + ' items'; + } + + return undefined; +} diff --git a/nx-dev/data-access-packages/src/lib/lookup.ts b/nx-dev/data-access-packages/src/lib/lookup.ts new file mode 100644 index 0000000000..780f4b62f1 --- /dev/null +++ b/nx-dev/data-access-packages/src/lib/lookup.ts @@ -0,0 +1,87 @@ +import { JsonSchema, JsonSchema1 } from '@nrwl/nx-dev/models-package'; +import { get as pointerGet } from 'jsonpointer'; + +/** + * @param reference '#' is root + * @param lookup Instantiated Lookup class + */ +export function getSchemaFromReference( + reference: string, + lookup: Lookup +): JsonSchema | undefined { + return getSchemaFromResult(loadReference(reference, lookup)); +} + +export function loadReference(reference: string, lookup: Lookup): LookupResult { + return lookup.getSchema({ $ref: reference }); +} + +export function getSchemaFromResult( + result: LookupResult +): JsonSchema | undefined { + return result === undefined ? undefined : result.schema; +} + +export type LookupResult = + | undefined + | { + schema: JsonSchema; + baseReference?: string; + }; + +function isReference(s: JsonSchema1): boolean { + return s.$ref !== undefined; +} + +export interface Lookup { + getSchema: (schema: JsonSchema) => LookupResult; +} + +export class IdLookup { + getSchema(schema: JsonSchema): LookupResult { + if (typeof schema === 'boolean') { + return { schema }; + } + + if (isReference(schema)) { + return undefined; + } + + return { schema }; + } +} + +export class InternalLookup { + constructor(private schema: JsonSchema) {} + + getSchema(schema: JsonSchema): LookupResult { + if (schema === undefined) { + return undefined; + } + + if (typeof schema === 'boolean') return { schema }; + + if (schema.$ref === undefined) return { schema }; + + const ref = schema.$ref; + if (!ref.startsWith('#')) { + // We do not support non-internal references + console.error( + '[SCHEMA] The schema appears to have non-internal references which is not supported:', + ref + ); + return undefined; + } + + const result = pointerGet(this.schema, ref.slice(1)); + if (result === undefined) return undefined; + + const subResult = this.getSchema(result); + if (subResult === undefined) return undefined; + + return { + schema: subResult.schema, + baseReference: subResult.baseReference ?? ref, + }; + } +} diff --git a/nx-dev/data-access-packages/src/lib/packages.api.ts b/nx-dev/data-access-packages/src/lib/packages.api.ts new file mode 100644 index 0000000000..3402dd4a7a --- /dev/null +++ b/nx-dev/data-access-packages/src/lib/packages.api.ts @@ -0,0 +1,80 @@ +import { PackageMetadata, SchemaMetadata } from '@nrwl/nx-dev/models-package'; +import { readFileSync } from 'fs'; + +export interface StaticPackagePaths { + params: { segments: string[] }; +} + +export class PackagesApi { + private database: Record = {}; + + constructor( + private readonly options: { + publicPackagesRoot: string; // eg: nx-dev/nx-dev/public/documentation + // packages.json content file + packagesIndex: { + name: string; + path: string; + schemas: { executors: string[]; generators: string[] }; + }[]; + } + ) { + if (!options.publicPackagesRoot) { + throw new Error('public packages root cannot be undefined'); + } + } + + getPackage(name: string): PackageMetadata { + const packagePath: string | null = + this.options.packagesIndex.find((p) => p.name === name)?.path ?? null; + + if (!packagePath) + throw new Error('Package name could not be found: ' + name); + + if (!this.database[name]) + this.database[name] = JSON.parse( + readFileSync( + [this.options.publicPackagesRoot, packagePath].join('/'), + 'utf-8' + ) + ); + + return this.database[name]; + } + + getStaticPackagePaths(): StaticPackagePaths[] { + const paths: StaticPackagePaths[] = []; + + this.options.packagesIndex.map((p) => { + paths.push({ + params: { + segments: ['packages', p.name], + }, + }); + p.schemas.generators.forEach((g) => { + paths.push({ + params: { + segments: ['packages', p.name, 'generators', g], + }, + }); + }); + p.schemas.executors.forEach((e) => { + paths.push({ + params: { + segments: ['packages', p.name, 'executors', e], + }, + }); + }); + }); + return paths; + } + + getPackageSchema( + packageName: string, + type: 'executors' | 'generators', + schemaName: string + ): SchemaMetadata | null { + const file = this.getPackage(packageName); + return file[type].find((s) => s.name === schemaName) ?? null; + } +} diff --git a/nx-dev/data-access-packages/src/node.index.ts b/nx-dev/data-access-packages/src/node.index.ts new file mode 100644 index 0000000000..a1ac52490e --- /dev/null +++ b/nx-dev/data-access-packages/src/node.index.ts @@ -0,0 +1 @@ +export * from './lib/packages.api'; diff --git a/nx-dev/data-access-packages/src/test-setup.ts b/nx-dev/data-access-packages/src/test-setup.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/nx-dev/data-access-packages/tsconfig.json b/nx-dev/data-access-packages/tsconfig.json new file mode 100644 index 0000000000..ecd9872c40 --- /dev/null +++ b/nx-dev/data-access-packages/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "strictNullChecks": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/nx-dev/data-access-packages/tsconfig.lib.json b/nx-dev/data-access-packages/tsconfig.lib.json new file mode 100644 index 0000000000..3b6a2b54ff --- /dev/null +++ b/nx-dev/data-access-packages/tsconfig.lib.json @@ -0,0 +1,12 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "outDir": "../../dist/out-tsc", + "types": ["node"] + }, + "include": ["**/*.ts"], + "exclude": ["**/*.spec.ts", "**/*.test.ts"] +} diff --git a/nx-dev/data-access-packages/tsconfig.spec.json b/nx-dev/data-access-packages/tsconfig.spec.json new file mode 100644 index 0000000000..46f2253261 --- /dev/null +++ b/nx-dev/data-access-packages/tsconfig.spec.json @@ -0,0 +1,22 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": [ + "**/*.test.ts", + "**/*.spec.ts", + "**/*.test.tsx", + "**/*.spec.tsx", + "**/*.test.js", + "**/*.spec.js", + "**/*.test.jsx", + "**/*.spec.jsx", + "**/*.d.ts" + ] +} diff --git a/nx-dev/feature-doc-viewer/src/lib/sidebar.tsx b/nx-dev/feature-doc-viewer/src/lib/sidebar.tsx index b9fdfe4675..1594d6be92 100644 --- a/nx-dev/feature-doc-viewer/src/lib/sidebar.tsx +++ b/nx-dev/feature-doc-viewer/src/lib/sidebar.tsx @@ -110,13 +110,13 @@ function SidebarSectionItems({
    {(item.itemList as MenuItem[]).map((item, index) => { - const isActiveLink = item.url === withoutAnchors(router?.asPath); + const isActiveLink = item.path === withoutAnchors(router?.asPath); return (
  • - + /tsconfig.spec.json', + }, + }, + transform: { + '^.+\\.[tj]sx?$': 'ts-jest', + }, + moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], + coverageDirectory: '../../coverage/nx-dev/feature-package-schema-viewer', +}; diff --git a/nx-dev/feature-package-schema-viewer/project.json b/nx-dev/feature-package-schema-viewer/project.json new file mode 100644 index 0000000000..512921617b --- /dev/null +++ b/nx-dev/feature-package-schema-viewer/project.json @@ -0,0 +1,25 @@ +{ + "root": "nx-dev/feature-package-schema-viewer", + "sourceRoot": "nx-dev/feature-package-schema-viewer/src", + "projectType": "library", + "targets": { + "lint": { + "executor": "@nrwl/linter:eslint", + "options": { + "lintFilePatterns": [ + "nx-dev/feature-package-schema-viewer/**/*.{ts,tsx,js,jsx}" + ] + }, + "outputs": ["{options.outputFile}"] + }, + "test": { + "executor": "@nrwl/jest:jest", + "outputs": ["coverage/nx-dev/feature-package-schema-viewer"], + "options": { + "jestConfig": "nx-dev/feature-package-schema-viewer/jest.config.js", + "passWithNoTests": true + } + } + }, + "tags": ["scope:nx-dev", "type:feature"] +} diff --git a/nx-dev/feature-package-schema-viewer/src/index.ts b/nx-dev/feature-package-schema-viewer/src/index.ts new file mode 100644 index 0000000000..13ce8e872a --- /dev/null +++ b/nx-dev/feature-package-schema-viewer/src/index.ts @@ -0,0 +1,4 @@ +export * from './lib/get-schema-view-model'; +export * from './lib/get-schema-view-model'; +export * from './lib/package-schema-list'; +export * from './lib/package-schema-viewer'; diff --git a/nx-dev/feature-package-schema-viewer/src/lib/content.tsx b/nx-dev/feature-package-schema-viewer/src/lib/content.tsx new file mode 100644 index 0000000000..536a2b509d --- /dev/null +++ b/nx-dev/feature-package-schema-viewer/src/lib/content.tsx @@ -0,0 +1,282 @@ +import { XCircleIcon } from '@heroicons/react/solid'; +import { getSchemaFromReference } from '@nrwl/nx-dev/data-access-packages'; +import { JsonSchema1, NxSchema } from '@nrwl/nx-dev/models-package'; +import { Breadcrumbs } from '@nrwl/nx-dev/ui-common'; +import Link from 'next/link'; +import { useRouter } from 'next/router'; +import { useState } from 'react'; +import { generateJsonExampleFor, isErrors } from './examples'; +import { SchemaViewModel } from './get-schema-view-model'; +import { SchemaEditor } from './schema-editor'; +import { SchemaViewer } from './schema-viewer'; +import { Heading2, Heading3 } from './ui/headings'; +import { Markdown } from './ui/markdown/markdown'; + +function pathCleaner(path: string): string { + return path.split('?')[0]; +} + +export function Content({ + schemaViewModel, +}: { + schemaViewModel: SchemaViewModel; +}) { + if (!schemaViewModel.currentSchema) + throw new Error( + 'A valid schema has to be defined for the "currentSchema" property' + ); + + const router = useRouter(); + const [presets, setPresets] = useState([]); + const filterWithPresets = ( + data: Record, + wantedProperties: string[] + ): Record => { + const result: Record = {}; + + if (!wantedProperties.length) return data; + + for (const p in data) { + if (wantedProperties.includes(p)) { + result[p] = data[p]; + } + } + + return result; + }; + + const vm = { + get fullExample(): Record { + const examples = generateJsonExampleFor( + schemaViewModel.currentSchema as NxSchema, + schemaViewModel.lookup, + 'both' + ); + return isErrors(examples) ? {} : examples.value; + }, + get pages(): { name: string; href: string; current: boolean }[] { + return [ + { + name: schemaViewModel.packageName, + href: pathCleaner(router.asPath), + current: false, + }, + { + name: schemaViewModel.schemaMetadata.name, + href: pathCleaner(router.asPath), + current: !schemaViewModel.subReference, + }, + !!schemaViewModel.subReference + ? { + name: schemaViewModel.subReference.split('/')[2], + href: pathCleaner(router.asPath), + current: true, + } + : void 0, + ].filter( + (x): x is { name: string; href: string; current: boolean } => !!x + ); + }, + }; + + return ( + <> +
    + + + {/* We remove the top description on sub property lookup */} + {!schemaViewModel.subReference && ( + <> + +
    {/* SPACER */}
    + + )} + + {schemaViewModel.subReference && ( +
    + +
    + )} + + {/*TODO@ben: create new component*/} + {schemaViewModel.type === 'executors' && !schemaViewModel.subReference && ( +
    + +

    + This is an example of what the properties looks like and their + values. Go ahead and try, test your configuration this is a + live-edit window, you can interact directly and get intellisense + on property's values. +

    + {!!schemaViewModel.currentSchema.presets.length && ( + <> + +

    + Here are some examples to tinker with specific usages that + could be useful: +

    +
    + {schemaViewModel.currentSchema.presets.map((p) => ( + + ))} + {!!presets.length && ( + + )} +
    + + )} +
    + +
    +
    + )} + +
    + + {!schemaViewModel.subReference && ( + + )} + {schemaViewModel.subReference && ( + + )} +
    +
    + + ); +} + +const getMarkdown = (data: { + packageName: string; + schemaAlias: string; + schemaName: string; + schema: JsonSchema1; + type: 'executors' | 'generators'; +}): string => { + const hasExamples = !!data.schema['examples']; + const hasExamplesFile = !!data.schema['examplesFile']; + const executorNotice: string = `Options can be configured in \`project.json\` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: [https://nx.dev/configuration/projectjson#targets](https://nx.dev/configuration/projectjson#targets).`; + + return [ + `# ${data.packageName}:${data.schemaName}`, + `\n\n`, + data.schema.description, + '\n\n', + data.type === 'executors' ? executorNotice : '', + `\n\n`, + hasExamplesFile ? data.schema['examplesFile'] : '', + data.type === 'generators' + ? hasExamplesFile + ? data.schema['examplesFile'] + : getUsage(data.packageName, data.schemaName, data.schemaAlias) + : '', + hasExamples + ? `### Examples \n ${data.schema['examples'] + .map((e) => `${e.description}: \n \`\`\`bash\n${e.command}\n\`\`\``) + .join('\n')}` + : '', + `\n\n`, + ].join(''); +}; + +const getUsage = ( + packageName: string, + schemaName: string, + schemaAlias: string +): string => ` +## Usage +\`\`\`bash +nx generate ${schemaName} ... +\`\`\` +${!!schemaAlias ? `\`\`\`bash\nnx g ${schemaAlias} ... #same\n\`\`\`\n` : ''} + +By default, Nx will search for \`${schemaName}\` in the default collection provisioned in workspace.json. + +You can specify the collection explicitly as follows: + +\`\`\`bash +nx g ${packageName}:${schemaName} ... +\`\`\` + +Show what will be generated without writing to disk: + +\`\`\`bash +nx g ${schemaName} ... --dry-run +\`\`\` +`; + +export default Content; diff --git a/nx-dev/feature-package-schema-viewer/src/lib/examples.ts b/nx-dev/feature-package-schema-viewer/src/lib/examples.ts new file mode 100644 index 0000000000..a5e235c270 --- /dev/null +++ b/nx-dev/feature-package-schema-viewer/src/lib/examples.ts @@ -0,0 +1,505 @@ +import { getSchemaFromResult, Lookup } from '@nrwl/nx-dev/data-access-packages'; +import { JsonSchema, JsonSchema1 } from '@nrwl/nx-dev/models-package'; +import { shouldShowInStage, Stage } from './stage'; +import { getOrInferType } from './types/type-inference'; + +export class Example { + private _value: any; + + public static of(value: any) { + return new Example(value); + } + + constructor(value: any) { + this._value = value; + } + + get value() { + return this._value; + } +} + +export type ErrorReason = + | 'missing-schema' + | 'schema-not-supported' + | 'infinite-prop-loop' + | 'all-of-mismatched-types' + | 'example-of-nothing-is-impossible' + | 'type-array-was-empty' + | 'ran-out-of-memory'; + +export class Error { + private _reason: ErrorReason; + private _message: string; + + constructor(reason: ErrorReason, message: string) { + this._reason = reason; + this._message = message; + } + + get reason() { + return this._reason; + } + + get message() { + return this._message; + } +} + +export class Errors { + private _errors: Error[]; + + public static from(...manyErrors: Errors[]) { + return new Errors( + manyErrors + .map((errs) => errs.errors) + .reduce((prev, curr) => { + prev.push(...curr); + return prev; + }, []) + ); + } + + public static of(...errors: Error[]) { + return new Errors(errors); + } + + constructor(errors: Error[]) { + this._errors = errors; + } + + get errors() { + return this._errors; + } + + get length() { + return this._errors.length; + } +} + +class ChainContext { + constructor( + private resolvedReferences: Set, + private internalLookup: Lookup, + private internalDepth: number, + private internalStage: Stage, + private internalParent: JsonSchema | undefined + ) {} + + get lookup(): Lookup { + return this.internalLookup; + } + + get depth(): number { + return this.internalDepth; + } + + get stage(): Stage { + return this.internalStage; + } + + get parent(): JsonSchema | undefined { + return this.internalParent; + } + + public registerReference(ref: NonNullable) { + this.resolvedReferences.add(ref); + } + + public seenBefore(ref: NonNullable): boolean { + return this.resolvedReferences.has(ref); + } + + public clone(currentParent: JsonSchema): ChainContext { + return new ChainContext( + new Set(this.resolvedReferences), + this.internalLookup, + this.internalDepth + 1, + this.internalStage, + currentParent + ); + } +} + +type NameAndExample = { + name: string; + example: Example | Errors; +}; + +function missingSchema(schemaOrRef: JsonSchema): Error { + return new Error( + 'missing-schema', + `Could not find a schema for: ${JSON.stringify(schemaOrRef)}` + ); +} + +function notSupported(message: string): Error { + return new Error('schema-not-supported', message); +} + +function infinitePropLoopForObject( + propName: string, + ref: NonNullable, + schema: JsonSchema1 +): Error { + return new Error( + 'infinite-prop-loop', + `The reference to '${ref}' in the property '${propName}' in the schema '${ + schema.title || 'object' + }' + causes an infinite loop.` + ); +} + +function allOfMismatchedTypes(allTypes: (string | null)[]): Error { + return new Error( + 'all-of-mismatched-types', + `There was an allOf that evaluated to examples of mismatched types: ${JSON.stringify( + allTypes + )}` + ); +} + +function nothing(parentSchema: JsonSchema | undefined): Error { + const renderedParent = + parentSchema === undefined ? 'root' : JSON.stringify(parentSchema); + return new Error( + 'example-of-nothing-is-impossible', + `Can't generate an example of the 'nothing' type for a child of: ${renderedParent}` + ); +} + +export function isExample(t: any): t is Example { + return t instanceof Example; +} + +export function isErrors(t: any): t is Errors { + return t instanceof Errors; +} + +function isError(t: any): t is Error { + return t instanceof Error; +} + +function isSchema(t: JsonSchema | Error): t is JsonSchema { + return !isError(t); +} + +type IgnoredProperty = { + name: string; +}; + +function isNameAndExample( + t: NameAndExample | IgnoredProperty +): t is NameAndExample { + return 'example' in t; +} + +function inferExample( + schema: JsonSchema1, + typeMatcher: (x: any) => boolean, + defaultExample: () => Example +): Example { + const match = (schema.examples || []).find(typeMatcher); + if (match !== undefined) { + return Example.of(match); + } + + if ( + schema.enum !== undefined && + schema.enum.length > 0 && + typeMatcher(schema.enum[0]) + ) { + return Example.of(schema.enum[0]); + } + return defaultExample(); +} + +function getSchemaNameForError(schemaOrRef: JsonSchema): string { + if (typeof schemaOrRef === 'boolean') { + return ''; + } + + if (schemaOrRef.$ref !== undefined) { + return schemaOrRef.$ref; + } + + return schemaOrRef.title === undefined ? 'object' : schemaOrRef.title; +} + +function generateJsonExampleForHelper( + context: ChainContext, + schemaOrRef: JsonSchema +): Example | Errors { + const { lookup } = context; + const schema = getSchemaFromResult(lookup.getSchema(schemaOrRef)); + if (schema === undefined) { + return Errors.of(missingSchema(schemaOrRef)); + } + + if (typeof schemaOrRef !== 'boolean' && schemaOrRef.$ref !== undefined) { + context.registerReference(schemaOrRef.$ref); + } + + if (typeof schema === 'boolean') { + if (schema) { + // We have no examples, so let's just return an empty object + return Example.of({}); + } else { + return Errors.of(nothing(context.parent)); + } + } + + if (Object.keys(schema).length === 0) { + // You accept anything in this slot, so let's just return an empty object. + return Example.of({}); + } + + let type = getOrInferType(schema); + + if (Array.isArray(type)) { + if (type.length >= 1) { + type = type[0]; + } else { + return Errors.of( + new Error( + 'type-array-was-empty', + `The type was an empty array for: ${JSON.stringify(schemaOrRef)}` + ) + ); + } + } + + if (type !== undefined) { + if (type === 'boolean') { + return inferExample( + schema, + (x) => typeof x === 'boolean', + () => Example.of(true) + ); + } else if (type === 'integer' || type === 'number') { + return inferExample( + schema, + (x) => typeof x === 'number' || typeof x === 'bigint', + () => Example.of(schema.description ? schema.description.length : 2154) + ); + } else if (type === 'string') { + return inferExample( + schema, + (x) => typeof x === 'string', + () => Example.of('') + ); + } else if (type === 'array') { + const match = (schema.examples || []).find(Array.isArray); + if (match !== undefined) { + return Example.of(match); + } + + if (schema.items === undefined) { + return Example.of([]); + } + + const chosenItem = Array.isArray(schema.items) + ? schema.items[0] + : schema.items; + const itemSchema = + schema.items === undefined + ? undefined + : getSchemaFromResult(lookup.getSchema(chosenItem)); + + if (itemSchema === undefined) { + return Example.of([]); + } else { + // Setup the next context + let nextContext = context; + if (typeof chosenItem !== 'boolean' && chosenItem.$ref !== undefined) { + if (context.seenBefore(chosenItem.$ref)) { + // If it's an infinite loop then just return no elements. Magic! + return Example.of([]); + } + nextContext = context.clone(chosenItem); + nextContext.registerReference(chosenItem.$ref); + } + + const itemExample = generateJsonExampleForHelper( + nextContext, + itemSchema + ); + + if (isErrors(itemExample)) { + return Example.of([]); + } + + const itemsToRender = schema.uniqueItems ? 1 : schema.minItems || 1; + return Example.of(Array(itemsToRender).fill(itemExample.value)); + } + } else { + const match = (schema.examples || []).find((x) => typeof x === 'object'); + if (match !== undefined) { + return Example.of(match); + } + + const { properties, required } = schema; + const requiredPropNames = new Set(required || []); + if (properties === undefined) { + // Return an empty object because no properties are allowed + return Example.of({}); + } else { + const props = Object.keys(properties) + .filter((name) => { + const propSchema = getSchemaFromResult( + context.lookup.getSchema(properties[name]) + ); + if (propSchema === undefined) { + return true; + } + return shouldShowInStage(context.stage, propSchema); + }) + .map((name) => { + const propOrRef = properties[name]; + + if (context.depth >= 1 && !requiredPropNames.has(name)) { + return { name }; + } + + if (typeof propOrRef === 'boolean') { + if (propOrRef) { + // We have no examples, so let's just return an empty object + return { name, example: Example.of({}) }; + } else { + return { name, example: Errors.of(nothing(schema)) }; + } + } + + // Setup the next context + let nextContext = context; + if (propOrRef.$ref !== undefined) { + if (context.seenBefore(propOrRef.$ref)) { + return requiredPropNames.has(name) + ? { + name, + example: Errors.of( + infinitePropLoopForObject(name, propOrRef.$ref, schema) + ), + } + : { name }; + } + nextContext = context.clone(propOrRef); + nextContext.registerReference(propOrRef.$ref); + } + + const prop = getSchemaFromResult(lookup.getSchema(propOrRef)); + if (prop === undefined) { + return { name, example: Errors.of(missingSchema(propOrRef)) }; + } + + const generatedExample = generateJsonExampleForHelper( + nextContext, + prop + ); + if (isErrors(generatedExample) && !requiredPropNames.has(name)) { + return { name }; + } + + return { + name, + example: generatedExample, + }; + }); + + const nonIgnoredProps = props.filter(isNameAndExample); + + // If there were errors then just return the errors + const e = Errors.from( + ...nonIgnoredProps.map((p) => p.example).filter(isErrors) + ); + if (e.length > 0) { + return e; + } + + // Otherwise, just make the example + let example: Record = {}; + nonIgnoredProps.forEach((prop) => { + if (isExample(prop.example)) { + example[prop.name] = prop.example.value; + } + }); + return Example.of(example); + } + } + } else { + if (schema.anyOf !== undefined && schema.anyOf.length > 0) { + return generateJsonExampleForHelper(context, schema.anyOf[0]); + } else if (schema.oneOf !== undefined && schema.oneOf.length > 0) { + return generateJsonExampleForHelper(context, schema.oneOf[0]); + } else if (schema.allOf !== undefined && schema.allOf.length > 0) { + let nextContext = context.clone(schema); + const potentialSchemas = schema.allOf.map((s) => { + const ps = getSchemaFromResult(lookup.getSchema(s)); + if (typeof s !== 'boolean' && s.$ref !== undefined) { + nextContext.registerReference(s.$ref); + } + return ps === undefined ? missingSchema(s) : ps; + }); + + let errors = potentialSchemas.filter(isError); + if (errors.length > 0) { + return new Errors(errors); + } + + const exs = potentialSchemas + .filter(isSchema) + .map((s) => generateJsonExampleForHelper(nextContext, s)); + + const errs = exs.filter(isErrors); + if (errs.length > 0) { + return Errors.from(...errs); + } + + const examples = exs.filter(isExample).map((e) => e.value); + const allExampleTypes = examples.map((e) => typeof e); + const matchedType = allExampleTypes.reduce((a, b) => + a === b ? a : null + ); + if (matchedType === null) { + return Errors.of(allOfMismatchedTypes(allExampleTypes)); + } + + if (matchedType === 'object') { + const example = Object.assign({}, ...examples); + return Example.of(example); + } else if ( + matchedType === 'string' || + matchedType === 'number' || + matchedType === 'boolean' + ) { + return Example.of(examples[0]); + } + } + + const schemaName = getSchemaNameForError(schemaOrRef); + + return Errors.of( + notSupported( + `Support schemas without a "type" has not been written yet. Source: ${schemaName}. Parent ${JSON.stringify( + context.parent + )}` + ) + ); + } +} + +export function generateJsonExampleFor( + schemaOrRef: JsonSchema, + lookup: Lookup, + stage: Stage +): Example | Errors { + try { + return generateJsonExampleForHelper( + new ChainContext(new Set(), lookup, 0, stage, undefined), + schemaOrRef + ); + } catch (e) { + return Errors.of(new Error('ran-out-of-memory', `Ran out of memory: ${e}`)); + } +} diff --git a/nx-dev/feature-package-schema-viewer/src/lib/get-schema-view-model.ts b/nx-dev/feature-package-schema-viewer/src/lib/get-schema-view-model.ts new file mode 100644 index 0000000000..0c71241b1e --- /dev/null +++ b/nx-dev/feature-package-schema-viewer/src/lib/get-schema-view-model.ts @@ -0,0 +1,74 @@ +import { + getSchemaFromReference, + InternalLookup, + Lookup, +} from '@nrwl/nx-dev/data-access-packages'; +import { + JsonSchema, + NxSchema, + SchemaMetadata, +} from '@nrwl/nx-dev/models-package'; +import { ParsedUrlQuery } from 'querystring'; +import { Errors, Example, generateJsonExampleFor } from './examples'; +import { SchemaRequest } from './schema-request.models'; + +function getReferenceFromQuery(query: string): string { + return query.replace('root/', '#/'); +} + +export interface SchemaViewModel { + packageName: string; + /** + * TODO@ben: Remove this property when there is nor more consumer. + * @Deprecated Will be removed. We are switching to internal linking, use "packageUrl". + */ + packageGithubUrl: string; + packageUrl: string; + schemaGithubUrl: string; + schemaMetadata: SchemaMetadata; + rootReference: string; + subReference: string; + lookup: Lookup; + currentSchema: NxSchema | null; + currentSchemaExamples: Example | Errors; + type: 'executors' | 'generators'; +} + +export function getSchemaViewModel( + routerQuery: ParsedUrlQuery, + schemaRequest: SchemaRequest +): SchemaViewModel | null { + const schemaMetadata = schemaRequest.pkg[schemaRequest.type].find( + (s) => s.name === schemaRequest.schemaName + ); + if (!schemaMetadata) return null; + + return { + schemaMetadata, + packageName: `@nrwl/${schemaRequest.pkg.name}`, + packageGithubUrl: schemaRequest.pkg.githubRoot + schemaRequest.pkg.root, + packageUrl: `/packages/${schemaRequest.pkg.name}`, + schemaGithubUrl: schemaRequest.pkg.githubRoot + schemaMetadata.path, + rootReference: '#', + subReference: + Object.prototype.hasOwnProperty.call(routerQuery, 'ref') && + !Array.isArray(routerQuery['ref']) + ? getReferenceFromQuery(String(routerQuery['ref'])) + : '', + lookup: new InternalLookup(schemaMetadata.schema as JsonSchema), + get currentSchema() { + return ( + (getSchemaFromReference(this.rootReference, this.lookup) as NxSchema) ?? + null + ); + }, + get currentSchemaExamples() { + return generateJsonExampleFor( + this.schemaMetadata.schema as JsonSchema, + this.lookup, + 'both' + ); + }, + type: schemaRequest.type, + }; +} diff --git a/nx-dev/feature-package-schema-viewer/src/lib/package-schema-list.tsx b/nx-dev/feature-package-schema-viewer/src/lib/package-schema-list.tsx new file mode 100644 index 0000000000..e5bf8d0cad --- /dev/null +++ b/nx-dev/feature-package-schema-viewer/src/lib/package-schema-list.tsx @@ -0,0 +1,180 @@ +import { ChipIcon, CogIcon } from '@heroicons/react/solid'; +import { Menu } from '@nrwl/nx-dev/models-menu'; +import { PackageMetadata } from '@nrwl/nx-dev/models-package'; +import { Sidebar } from '@nrwl/nx-dev/ui-common'; +import cx from 'classnames'; +import { NextSeo } from 'next-seo'; +import Link from 'next/link'; +import { useRouter } from 'next/router'; +import { ReactComponentElement } from 'react'; +import { Heading1, Heading2 } from './ui/headings'; + +export function PackageSchemaList({ + pkg, + menu, + navIsOpen, +}: { + pkg: PackageMetadata; + menu: Menu; + navIsOpen?: boolean; +}): ReactComponentElement { + const router = useRouter(); + + const vm: { + pkg: { + name: string; + description: string; + githubUrl: string; + }; + seo: { title: string; description: string; url: string; imageUrl: string }; + } = { + pkg: { + name: `@nrwl/${pkg.name}`, + description: pkg.description, + githubUrl: pkg.githubRoot + pkg.root, + }, + seo: { + title: `@nrwl/${pkg.name} | Nx`, + description: + 'An overview of the powerful integrations Nx is providing you for this specific technology.', + imageUrl: `https://nx.dev/images/open-graph/${router.asPath + .replace('/', '') + .replace(/\//gi, '-')}.jpg`, + url: 'https://nx.dev' + router.asPath, + }, + }; + + return ( + <> + +
    +
    + +
    +
    + + + +

    {vm.pkg.description}

    +

    + Here is a list of all the executors and generators available + from this package. +

    + + +
      + {pkg.executors.map((executors) => ( +
    • + +
      +

      + + + + {executors.name} + + +

      +

      + {executors.description} +

      +
      +
    • + ))} +
    + +
    {/* SPACER */}
    + + +
    +
    +
    +
    + + ); +} + +export default PackageSchemaList; diff --git a/nx-dev/feature-package-schema-viewer/src/lib/package-schema-viewer.tsx b/nx-dev/feature-package-schema-viewer/src/lib/package-schema-viewer.tsx new file mode 100644 index 0000000000..4c559d28f4 --- /dev/null +++ b/nx-dev/feature-package-schema-viewer/src/lib/package-schema-viewer.tsx @@ -0,0 +1,90 @@ +import { Menu } from '@nrwl/nx-dev/models-menu'; +import { Sidebar } from '@nrwl/nx-dev/ui-common'; +import cx from 'classnames'; +import { NextSeo } from 'next-seo'; +import { useRouter } from 'next/router'; +import { ReactComponentElement } from 'react'; +import Content from './content'; +import { getSchemaViewModel, SchemaViewModel } from './get-schema-view-model'; +import { SchemaRequest } from './schema-request.models'; + +export function PackageSchemaViewer({ + schemaRequest, + menu, + navIsOpen, +}: { + schemaRequest: SchemaRequest; + menu: Menu; + navIsOpen?: boolean; +}): ReactComponentElement { + const router = useRouter(); + + const vm: { + schema: SchemaViewModel | null; + seo: { title: string; description: string; url: string; imageUrl: string }; + } = { + // Processing the request and make available the needed schema information + schema: getSchemaViewModel(router.query, schemaRequest), + seo: { + title: `@nrwl/${schemaRequest.pkg.name}:${schemaRequest.schemaName} | Nx`, + description: + 'Next generation build system with first class monorepo support and powerful integrations.', + imageUrl: `https://nx.dev/images/open-graph/${router.asPath + .replace('/', '') + .replace(/\//gi, '-')}.jpg`, + url: 'https://nx.dev' + router.asPath, + }, + }; + + // TODO@ben link up this to HTML component + if (!vm.schema) + throw new Error('Could not find schema: ' + schemaRequest.schemaName); + + // TODO@ben link up this to HTML component + if (!vm.schema.currentSchema) + throw new Error( + 'Could not interpret schema data: ' + schemaRequest.schemaName + ); + + vm.seo.description = vm.schema.currentSchema.description; + + return ( + <> + +
    +
    + +
    + +
    +
    +
    + + ); +} + +export default PackageSchemaViewer; diff --git a/nx-dev/feature-package-schema-viewer/src/lib/parameter-metadata.ts b/nx-dev/feature-package-schema-viewer/src/lib/parameter-metadata.ts new file mode 100644 index 0000000000..f742d86cf5 --- /dev/null +++ b/nx-dev/feature-package-schema-viewer/src/lib/parameter-metadata.ts @@ -0,0 +1,114 @@ +import { JsonSchema } from '@nrwl/nx-dev/models-package'; +import { slugify } from './slugify.utils'; + +interface ParameterMetadata { + name: string; + key: string; + value: string; +} + +export function getParameterMetadata(schema: JsonSchema): ParameterMetadata[] { + const parameterMetadata: ParameterMetadata[] = []; + if (typeof schema === 'boolean') return parameterMetadata; + + function createParameterMetadata( + name: string, + value: unknown + ): ParameterMetadata { + return { + name, + key: slugify(name), + value: String(value), + }; + } + + if (schema.default !== undefined) { + const def = schema.default; + parameterMetadata.push(createParameterMetadata('Default', def)); + } + + if (schema.minItems !== undefined) { + parameterMetadata.push( + createParameterMetadata('Min items', schema.minItems) + ); + } + if (schema.maxItems !== undefined) { + parameterMetadata.push( + createParameterMetadata('Max items', schema.maxItems) + ); + } + if (typeof schema.uniqueItems !== 'undefined') { + parameterMetadata.push( + createParameterMetadata('Unique items', schema.uniqueItems) + ); + } + if (schema.minimum !== undefined) { + const isExclusive = + typeof schema.exclusiveMinimum === 'boolean' && schema.exclusiveMinimum; + parameterMetadata.push( + createParameterMetadata( + isExclusive ? 'Exclusive minimum' : 'minimum', + schema.minimum + ) + ); + } + if (schema.maximum !== undefined) { + const isExclusive = + typeof schema.exclusiveMaximum === 'boolean' && schema.exclusiveMaximum; + parameterMetadata.push( + createParameterMetadata( + isExclusive ? 'Exclusive maximum' : 'maximum', + schema.maximum + ) + ); + } + if ( + typeof schema.exclusiveMinimum === 'number' && + schema.minimum === undefined + ) { + parameterMetadata.push( + createParameterMetadata('Exclusive minimum', schema.exclusiveMinimum) + ); + } + if ( + typeof schema.exclusiveMaximum === 'number' && + schema.maximum === undefined + ) { + parameterMetadata.push( + createParameterMetadata('Exclusive maximum', schema.exclusiveMaximum) + ); + } + if (schema.multipleOf !== undefined) { + parameterMetadata.push( + createParameterMetadata('Multiple of', schema.multipleOf) + ); + } + if (schema.minProperties !== undefined) { + parameterMetadata.push( + createParameterMetadata('Min properties', schema.minProperties) + ); + } + if (schema.maxProperties !== undefined) { + parameterMetadata.push( + createParameterMetadata('Max properties', schema.maxProperties) + ); + } + if (schema.minLength !== undefined) { + parameterMetadata.push( + createParameterMetadata('Min length', schema.minLength) + ); + } + if (schema.maxLength !== undefined) { + parameterMetadata.push( + createParameterMetadata('Max length', schema.maxLength) + ); + } + if (typeof schema.pattern !== 'undefined') { + parameterMetadata.push(createParameterMetadata('Pattern', schema.pattern)); + } + if (typeof schema.format !== 'undefined') { + parameterMetadata.push(createParameterMetadata('Format', schema.format)); + } + + return parameterMetadata; +} diff --git a/nx-dev/feature-package-schema-viewer/src/lib/parameter-view.tsx b/nx-dev/feature-package-schema-viewer/src/lib/parameter-view.tsx new file mode 100644 index 0000000000..b999750265 --- /dev/null +++ b/nx-dev/feature-package-schema-viewer/src/lib/parameter-view.tsx @@ -0,0 +1,105 @@ +import { Lookup } from '@nrwl/nx-dev/data-access-packages'; +import { JsonSchema } from '@nrwl/nx-dev/models-package'; +import { getParameterMetadata } from './parameter-metadata'; +import { getEnum } from './types/get-enum'; +import { Type } from './types/type'; +import { Heading3 } from './ui/headings'; +import { Markdown } from './ui/markdown/markdown'; + +export const ParameterView = (props: { + key: string; + name: string; + alias: string; + description: string; + required: boolean; + deprecated: boolean; + schema: JsonSchema | undefined; + reference: string; + lookup: Lookup; +}) => ( +
    +
    + +
    + {props.alias && ( + + {props.alias} + + )} + {props.required && ( + + Required + + )} + {props.deprecated && ( + + Deprecated + + )} + {((props.schema as any)['hidden'] as boolean) && ( + + Hidden + + )} +
    +
    +
    +
    + +
    + {props.schema && } + {props.schema && ( + + )} +
    + + + + {props.deprecated && props.schema['x-deprecated'] && ( +
    + +
    + )} +
    +); + +function ParameterMetadata({ schema }: { schema: JsonSchema }) { + const data = getParameterMetadata(schema); + return !!data.length ? ( +
    + {data.map((i) => ( + + {i.name}: {i.value} + + ))} +
    + ) : null; +} + +function ParameterEnums({ + schema, + lookup, +}: { + schema: JsonSchema; + lookup: Lookup; +}) { + const potentialEnums = (getEnum(schema, lookup) as string[]) ?? []; + return !!potentialEnums.length ? ( +
    + Accepted values:{' '} + {potentialEnums.map((e, i) => ( + + {e} + {potentialEnums.length === i + 1 ? null : ', '} + + ))} +
    + ) : null; +} diff --git a/nx-dev/feature-package-schema-viewer/src/lib/schema-editor.tsx b/nx-dev/feature-package-schema-viewer/src/lib/schema-editor.tsx new file mode 100644 index 0000000000..55c580702b --- /dev/null +++ b/nx-dev/feature-package-schema-viewer/src/lib/schema-editor.tsx @@ -0,0 +1,49 @@ +import Editor, { useMonaco } from '@monaco-editor/react'; +import { JsonSchema } from '@nrwl/nx-dev/models-package'; +import { useEffect } from 'react'; + +export const SchemaEditor = ({ + packageName, + schemaName, + type, + content, + schema, +}: { + packageName: string; + schemaName: string; + type: 'executor' | 'generator'; + content: Record; + schema: JsonSchema; +}) => { + const monaco = useMonaco(); + + useEffect(() => { + monaco?.languages.json.jsonDefaults.setDiagnosticsOptions({ + validate: true, + allowComments: true, + schemas: [ + { + uri: 'https://json-schema.app/example.json', // id of the first schema + fileMatch: ['a://b/example.json'], + schema: schema, + }, + ], + }); + }, [monaco, schema]); + + return ( + + ); +}; diff --git a/nx-dev/feature-package-schema-viewer/src/lib/schema-request.models.ts b/nx-dev/feature-package-schema-viewer/src/lib/schema-request.models.ts new file mode 100644 index 0000000000..3d22f41a5b --- /dev/null +++ b/nx-dev/feature-package-schema-viewer/src/lib/schema-request.models.ts @@ -0,0 +1,7 @@ +import { PackageMetadata } from '@nrwl/nx-dev/models-package'; + +export interface SchemaRequest { + pkg: PackageMetadata; + type: 'executors' | 'generators'; + schemaName: string; +} diff --git a/nx-dev/feature-package-schema-viewer/src/lib/schema-viewer.tsx b/nx-dev/feature-package-schema-viewer/src/lib/schema-viewer.tsx new file mode 100644 index 0000000000..88a1384938 --- /dev/null +++ b/nx-dev/feature-package-schema-viewer/src/lib/schema-viewer.tsx @@ -0,0 +1,204 @@ +import { + getDescriptionForSchema, + getSchemaFromResult, + Lookup, +} from '@nrwl/nx-dev/data-access-packages'; +import { JsonSchema, JsonSchema1 } from '@nrwl/nx-dev/models-package'; +import { ParameterView } from './parameter-view'; +import { shouldShowInStage, Stage } from './stage'; +import { Type } from './types/type'; + +export function SchemaViewer({ + schema, + reference, + lookup, + stage, +}: { + schema: JsonSchema1; + reference: string; + lookup: Lookup; + stage: Stage; +}) { + const properties = schema.properties || {}; + const isDeprecated = (schema: JsonSchema): boolean => + typeof schema === 'boolean' ? false : !!schema['x-deprecated']; + const getAlias = (schema: JsonSchema): string => + typeof schema === 'boolean' ? '' : (schema['alias'] as string); + + const renderedProps = Object.keys(properties) + .sort((a, b) => a[0].localeCompare(b[0])) // Sort properties alphabetically + .map((propertyName) => { + const propertySchema = properties[propertyName]; + const lookupResult = lookup.getSchema(propertySchema); + return { + propertyName, + alias: ((properties[propertyName] as any)['alias'] as string) ?? '', + initialSchema: propertySchema, + lookupResult, + propertyReference: + lookupResult?.baseReference || + `${reference}/properties/${propertyName}`, + }; + }) + .filter((p) => { + if (p.lookupResult === undefined) { + return true; + } + return shouldShowInStage(stage, p.lookupResult.schema); + }) + .map((p) => { + const isRequired = + typeof schema.required !== 'undefined' && + !!schema.required.find((n) => n === p.propertyName); + + if (p.lookupResult) { + return ( + + ); + } else { + return ( + + ); + } + }); + + const additionalProperties = new Array(); + if (typeof schema.additionalProperties === 'boolean') { + if (schema.additionalProperties) { + additionalProperties.push( + + ); + } + } else if (schema.additionalProperties !== undefined) { + const additionalPropertiesResult = lookup.getSchema( + schema.additionalProperties + ); + if (additionalPropertiesResult !== undefined) { + const resolvedReference = + additionalPropertiesResult.baseReference || + `${reference}/additionalProperties`; + additionalProperties.push( + + ); + } + } + + const patternProperties = schema.patternProperties || {}; + const renderedPatternProperties = Object.keys(patternProperties).map( + (pattern, i) => { + const lookupResult = lookup.getSchema(patternProperties[pattern]); + const currentSchema = + getSchemaFromResult(lookupResult) || patternProperties[pattern]; + return ( + + ); + } + ); + + const hasProperties = + renderedProps.length > 0 || + renderedPatternProperties.length > 0 || + additionalProperties.length > 0; + + const { anyOf, allOf, oneOf, not } = schema; + const compositeOnlyType: JsonSchema1 = { anyOf, allOf, oneOf, not }; + let mixinProps = <>; + if ( + Object.keys(compositeOnlyType).some( + (key) => compositeOnlyType[key] !== undefined + ) + ) { + mixinProps = ( + <> +

    Mixins

    + {hasProperties ? ( +

    + This type has all of the properties below, but must also match this + type: +

    + ) : ( +

    + This object must match the following conditions: +

    + )} + + + ); + } + + let allRenderedProperties = <>; + if (hasProperties) { + allRenderedProperties = ( + <> + {renderedProps} + {renderedPatternProperties} + {additionalProperties} + + ); + } + + return ( +
    + {mixinProps} + {allRenderedProperties} +
    + ); +} diff --git a/nx-dev/feature-package-schema-viewer/src/lib/slugify.utils.ts b/nx-dev/feature-package-schema-viewer/src/lib/slugify.utils.ts new file mode 100644 index 0000000000..8690cf8920 --- /dev/null +++ b/nx-dev/feature-package-schema-viewer/src/lib/slugify.utils.ts @@ -0,0 +1,11 @@ +export const slugify = (...args: (string | number)[]): string => { + const value = args.join(' '); + + return value + .normalize('NFD') + .replace(/[\u0300-\u036f]/g, '') + .toLowerCase() + .trim() + .replace(/[^a-z0-9 ]/g, '') + .replace(/\s+/g, '-'); +}; diff --git a/nx-dev/feature-package-schema-viewer/src/lib/stage.ts b/nx-dev/feature-package-schema-viewer/src/lib/stage.ts new file mode 100644 index 0000000000..5478ea9b46 --- /dev/null +++ b/nx-dev/feature-package-schema-viewer/src/lib/stage.ts @@ -0,0 +1,30 @@ +import { JsonSchema } from '@nrwl/nx-dev/models-package'; + +export type Stage = 'read' | 'write' | 'both'; + +export function shouldShowInStage(stage: Stage, schema: JsonSchema): boolean { + if (typeof schema === 'boolean') { + return true; + } + + if (stage === 'both') { + return true; + } + + const readOnly = !!schema.readOnly; + const writeOnly = !!schema.writeOnly; + + if (readOnly === writeOnly) { + return true; + } + + if (stage === 'read' && readOnly) { + return true; + } + + if (stage === 'write' && writeOnly) { + return true; + } + + return false; +} diff --git a/nx-dev/feature-package-schema-viewer/src/lib/types/get-enum.ts b/nx-dev/feature-package-schema-viewer/src/lib/types/get-enum.ts new file mode 100644 index 0000000000..c3f955e5ce --- /dev/null +++ b/nx-dev/feature-package-schema-viewer/src/lib/types/get-enum.ts @@ -0,0 +1,61 @@ +import { getSchemaFromResult, Lookup } from '@nrwl/nx-dev/data-access-packages'; +import { JsonSchema, JsonSchema1 } from '@nrwl/nx-dev/models-package'; +import { getTypesFromEnum, isPrimitiveType } from './type-inference'; + +function extractEnumDirectly(schema?: JsonSchema): JsonSchema1['enum'] { + if (schema === undefined || typeof schema === 'boolean') { + return undefined; + } + + if (schema.enum !== undefined) { + const enumTypes = getTypesFromEnum(schema.enum); + if (enumTypes !== undefined && isPrimitiveType(enumTypes)) { + return schema.enum; + } + } + + return undefined; +} + +function extractArrayEnum( + schema: JsonSchema, + lookup: Lookup +): JsonSchema1['enum'] { + if ( + typeof schema !== 'boolean' && + schema.type === 'array' && + schema.items !== undefined && + !Array.isArray(schema.items) + ) { + return extractEnumDirectly( + getSchemaFromResult(lookup.getSchema(schema.items)) + ); + } + return undefined; +} + +function runUntilFirstResult( + inputFunctions: ((a: A) => B | undefined)[], + value: A +): B | undefined { + for (let i = 0; i < inputFunctions.length; i++) { + const potentialResult = inputFunctions[i](value); + if (typeof potentialResult !== 'undefined') { + return potentialResult; + } + } + + return undefined; +} + +export function getEnum( + schema: JsonSchema, + lookup: Lookup +): JsonSchema1['enum'] { + const extractors: ((s: JsonSchema) => JsonSchema1['enum'])[] = [ + extractEnumDirectly, + (s) => extractArrayEnum(s, lookup), + ]; + + return runUntilFirstResult(extractors, schema); +} diff --git a/nx-dev/feature-package-schema-viewer/src/lib/types/join-types.tsx b/nx-dev/feature-package-schema-viewer/src/lib/types/join-types.tsx new file mode 100644 index 0000000000..3761f764b0 --- /dev/null +++ b/nx-dev/feature-package-schema-viewer/src/lib/types/join-types.tsx @@ -0,0 +1,19 @@ +export function joinTypes( + arr: T[], + sep: string +): (JSX.Element | string)[] { + let results: Array = new Array(); + let first = true; + let keyGen = 0; + arr.forEach((a) => { + if (!first) { + results.push({sep}); + keyGen++; + } else { + first = false; + } + results.push({a}); + keyGen++; + }); + return results; +} diff --git a/nx-dev/feature-package-schema-viewer/src/lib/types/type-inference.ts b/nx-dev/feature-package-schema-viewer/src/lib/types/type-inference.ts new file mode 100644 index 0000000000..fc5ca154bb --- /dev/null +++ b/nx-dev/feature-package-schema-viewer/src/lib/types/type-inference.ts @@ -0,0 +1,121 @@ +import { JsonSchema1, SimpleTypes } from '@nrwl/nx-dev/models-package'; + +export function isPresent(t: T | undefined | null | void): t is T { + return t !== undefined && t !== null; +} + +function hasNumber(s: JsonSchema1): boolean { + return [ + s.minimum, + s.maximum, + s.exclusiveMaximum, + s.exclusiveMinimum, + s.multipleOf, + ].some((v) => v !== undefined); +} + +function hasString(s: JsonSchema1): boolean { + return [s.minLength, s.maxLength, s.pattern].some((v) => v !== undefined); +} + +function hasObject(s: JsonSchema1): boolean { + return [ + s.properties, + s.additionalProperties, + s.minProperties, + s.maxProperties, + ].some((v) => v !== undefined); +} + +function hasArray(s: JsonSchema1): boolean { + return [s.items, s.minItems, s.maxItems, s.uniqueItems].some( + (v) => v !== undefined + ); +} + +export function jsonTypeToSchemaType( + someType: unknown +): SimpleTypes | undefined { + switch (typeof someType) { + case 'boolean': + return 'boolean'; + case 'string': + return 'string'; + case 'number': + return 'number'; + case 'bigint': + return 'integer'; + case 'object': + return 'object'; + default: + return undefined; + } +} + +export function getTypesFromEnum( + enumValue: NonNullable +): JsonSchema1['type'] | undefined { + const types = Array.from( + new Set(enumValue.map(jsonTypeToSchemaType).filter(isPresent)) + ); + if (types.length === 0) { + return undefined; + } else if (types.length === 1) { + return types[0]; + } + + return [types[0], ...types.slice(1)]; +} + +export function getOrInferType( + schema: JsonSchema1 +): JsonSchema1['type'] | undefined { + if (schema.type !== undefined) { + return schema.type; + } + + // Otherwise, infer the type from the other restrictors + if (hasObject(schema)) { + return 'object'; + } + + if (hasArray(schema)) { + return 'array'; + } + + if (hasNumber(schema)) { + return 'number'; + } + + if (hasString(schema)) { + return 'string'; + } + + if (schema.enum !== undefined) { + const enumType = getTypesFromEnum(schema.enum); + if (enumType !== undefined) { + return enumType; + } + } + + return undefined; +} + +const primitiveTypes: Array = [ + 'boolean', + 'integer', + 'null', + 'number', + 'string', +]; + +export function isPrimitiveType(type: JsonSchema1['type']): boolean { + if (Array.isArray(type)) { + return type.every((t) => primitiveTypes.includes(t)); + } + return primitiveTypes.includes(type); +} + +export function isExternalReference(schema: JsonSchema1): boolean { + return schema.$ref !== undefined && schema.$ref.startsWith('http'); +} diff --git a/nx-dev/feature-package-schema-viewer/src/lib/types/type.tsx b/nx-dev/feature-package-schema-viewer/src/lib/types/type.tsx new file mode 100644 index 0000000000..24325e213c --- /dev/null +++ b/nx-dev/feature-package-schema-viewer/src/lib/types/type.tsx @@ -0,0 +1,439 @@ +import { ExternalLinkIcon, LinkIcon } from '@heroicons/react/solid'; +import { + getSchemaFromResult, + getTitleForSchema, + Lookup, +} from '@nrwl/nx-dev/data-access-packages'; +import { + JsonSchema, + JsonSchema1, + SimpleTypes, +} from '@nrwl/nx-dev/models-package'; +import React from 'react'; +import { joinTypes } from './join-types'; +import { + getOrInferType, + isExternalReference, + isPresent, + isPrimitiveType, +} from './type-inference'; + +class LookupContext { + readonly lookup: Lookup; + readonly discriminate: string | undefined; + + private constructor(lookup: Lookup, discriminate: string | undefined) { + this.lookup = lookup; + this.discriminate = discriminate; + } + + public static root(lookup: Lookup): LookupContext { + return new LookupContext(lookup, undefined); + } + + public clone(discriminate: string | undefined): LookupContext { + if (this.discriminate === discriminate) { + return this; + } + return new LookupContext(this.lookup, discriminate); + } +} + +function hasCompositeDefinition(s: JsonSchema1): boolean { + return ( + (s.anyOf !== undefined && s.anyOf.length > 0) || + (s.oneOf !== undefined && s.oneOf.length > 0) || + (s.allOf !== undefined && s.allOf.length > 0) || + s.not !== undefined + ); +} + +function hasProperties(s: JsonSchema1): boolean { + return s.properties !== undefined && Object.keys(s.properties).length > 0; +} + +function hasPatternProperties(s: JsonSchema1): boolean { + return ( + s.patternProperties !== undefined && + Object.keys(s.patternProperties).length > 0 + ); +} + +function hasAdditionalProperties(s: JsonSchema1): boolean { + return !( + typeof s.additionalProperties === 'boolean' && !s.additionalProperties + ); +} + +export function isLink(s: JsonSchema): boolean { + if (typeof s === 'boolean') { + return false; + } + + const type = getOrInferType(s); + + return ( + hasProperties(s) || + hasPatternProperties(s) || + (type === 'object' && hasAdditionalProperties(s)) + ); +} + +function schemaHasCompositeType(s: JsonSchema1): boolean { + return ( + (s.allOf !== undefined && s.allOf.length > 0) || + (s.anyOf !== undefined && s.anyOf.length > 0) || + (s.oneOf !== undefined && s.oneOf.length > 0) || + s.not !== undefined + ); +} + +const LinkType = ({ + fallbackTitle, + schema, + reference, +}: { + fallbackTitle: string; + schema: JsonSchema1; + reference: string; +}): JSX.Element => { + if (isExternalReference(schema) && schema.$ref !== undefined) { + return ( + + external reference: {schema.$ref}{' '} + + + ); + } + + return ( + + {getTitleForSchema(reference, schema) || fallbackTitle}{' '} + + + ); +}; +export const Anything = () => <>anything; +export const Nothing = () => <>nothing; +export const Not = ({ inside }: { inside: JSX.Element }) => <>not ({inside}); +export const AllOf = ({ joined }: { joined: (JSX.Element | string)[] }) => ( + <>allOf [{joined}] +); +export const AnyOf = ({ joined }: { joined: (JSX.Element | string)[] }) => ( + <>anyOf [{joined}] +); +export const OneOf = ({ joined }: { joined: (JSX.Element | string)[] }) => ( + <>oneOf [{joined}] +); +export const Primitives = ({ + type, +}: { + type: SimpleTypes | undefined | (SimpleTypes | undefined)[]; +}) => (Array.isArray(type) ? <>{type.join(' ∪ ')} : <>{type}); +export const ArrayOf = ({ type }: { type: JSX.Element }) => ( + <>Array<{type}> +); +export const ArrayOfAnything = () => <>Array<anything>; +export const ArrayOfAnyOf = ({ + joined, +}: { + joined: (JSX.Element | string)[]; +}) => <>Array<anyOf [{joined}]>; +export const ObjectNamed = ({ name }: { name: string }) => <>object: {name}; + +type SchemaAndReference = { + schema: JsonSchema | undefined; + reference: string; +}; + +function extractSchemaAndReference( + propertyName: string, + lookup: Lookup, + currentReference: string +) { + return (schema: JsonSchema, arrayIndex: number): SchemaAndReference => { + const lookupResult = lookup.getSchema(schema); + return { + schema: getSchemaFromResult(lookupResult), + reference: + (lookupResult !== undefined && lookupResult.baseReference) || + `${currentReference}/${propertyName}/${arrayIndex}`, + }; + }; +} + +function onlyKeyPresent(schema: JsonSchema1, key: keyof JsonSchema1): boolean { + return Object.keys(schema).every( + (schemaKey) => schemaKey !== key || schema[schemaKey] !== undefined + ); +} + +function getObjectName(s: JsonSchema1, context: LookupContext): string { + if (s.title !== undefined) { + return s.title; + } + + if (context.discriminate !== undefined && s.properties !== undefined) { + const propertyName = context.discriminate; + const propertyLookupResult = context.lookup.getSchema( + s.properties[propertyName] + ); + if (propertyLookupResult !== undefined) { + const property = propertyLookupResult.schema; + + if ( + property !== undefined && + typeof property !== 'boolean' && + property.enum !== undefined && + property.enum.length === 1 + ) { + return `${propertyName}: ${property.enum[0]}`; + } + } + } + + return 'object'; +} + +function findDis( + sr: Array, + context: LookupContext +): string | undefined { + return findDiscriminant( + sr.map((s) => s.schema).filter(isPresent), + context.lookup + ); +} + +const getTypeText = ( + initialSchema: JsonSchema | undefined, + initialReference: string, + context: LookupContext +): JSX.Element => { + const lookup = context.lookup; + + if (initialSchema === undefined) { + return ; + } + + if (typeof initialSchema === 'boolean') { + return initialSchema ? : ; + } + + if (isExternalReference(initialSchema)) { + return ( + + ); + } + + const lookupResult = lookup.getSchema(initialSchema); + if (lookupResult === undefined) { + return ; + } + + const s = lookupResult.schema; + const currentReference = lookupResult.baseReference || initialReference; + + if (typeof s === 'boolean') { + return getTypeText(s, currentReference, context.clone(undefined)); + } + + const type = getOrInferType(s); + + if (isLink(s)) { + return ( + + ); + } + + if (schemaHasCompositeType(s)) { + const compositeTypes: JSX.Element[] = new Array(); + + if (s.anyOf !== undefined && s.anyOf.length > 0) { + const schemas = s.anyOf.map( + extractSchemaAndReference('anyOf', lookup, currentReference) + ); + // const schemas = mergeCompositesWithParent(s, s.anyOf.map(sx => schemas.getSchema(sx))); + + if (schemas.find((sx) => sx.schema === undefined)) { + // If you have an anything in an anyOf then you should just simplify to anything + return ; + } else { + const renderedSchemas = schemas.map((sx) => + getTypeText(sx.schema, sx.reference, context.clone(undefined)) + ); + if (renderedSchemas.length === 1) { + compositeTypes.push(renderedSchemas[0]); + } else { + const joined = joinTypes(renderedSchemas, ', '); + + compositeTypes.push(); + } + } + } + + if (s.oneOf !== undefined && s.oneOf.length > 0) { + const schemas = s.oneOf.map( + extractSchemaAndReference('oneOf', lookup, currentReference) + ); + + const renderedSchemas = schemas.map((sx) => + getTypeText( + sx.schema, + sx.reference, + context.clone(findDis(schemas, context)) + ) + ); + + if (renderedSchemas.length === 1) { + compositeTypes.push(renderedSchemas[0]); + } else { + const joined = joinTypes(renderedSchemas, ', '); + + compositeTypes.push(); + } + } + + if (s.allOf !== undefined && s.allOf.length > 0) { + const schemas = s.allOf.map( + extractSchemaAndReference('allOf', lookup, currentReference) + ); + + const renderedSchemas = schemas.map((sx) => + getTypeText( + sx.schema, + sx.reference, + context.clone(findDis(schemas, context)) + ) + ); + if (renderedSchemas.length === 1) { + compositeTypes.push(renderedSchemas[0]); + } else { + const joined = joinTypes(renderedSchemas, ', '); + + compositeTypes.push(); + } + } + + if (s.not !== undefined && typeof s.not !== 'boolean') { + const lookupResult = lookup.getSchema(s.not); + const inside = getTypeText( + lookupResult?.schema, + lookupResult?.baseReference || `${currentReference}/not`, + context.clone(undefined) + ); + compositeTypes.push(); + } + + if (compositeTypes.length === 1) { + return compositeTypes[0]; + } else if (compositeTypes.length > 1) { + return <>{joinTypes(compositeTypes, ' AND ')}; + } + } else if (isPrimitiveType(type)) { + return ; + } else if (type === 'array') { + if (s.items === undefined) { + return ; + } else if (!Array.isArray(s.items)) { + return ( + + ); + } else if (s.items.length === 0) { + return ; + } else if (s.items.length === 1) { + return ( + + ); + } else { + const items = s.items; + const renderedItems = items.map((item, i) => + getTypeText( + item, + `${currentReference}/items/${i}`, + context.clone(findDiscriminant(items, lookup)) + ) + ); + const joined = joinTypes(renderedItems, ', '); + + return ; + } + } else if (type === 'object') { + const name = getObjectName(s, context); + if (isLink(s)) { + return ( + + ); + } else { + return ; + } + } else if (Array.isArray(type)) { + if (type.length === 0) { + return ; + } else if (type.length === 1) { + return getTypeText( + { ...s, type: type[0] }, + currentReference, + context.clone(undefined) + ); + } else { + const splitSchemas = type.map((t) => ({ ...s, type: t })); + + const renderedSchemas = splitSchemas.map((splitSchema) => + getTypeText( + splitSchema, + currentReference, + context.clone(findDiscriminant(splitSchemas, lookup)) + ) + ); + const joined = joinTypes(renderedSchemas, ', '); + + return ; + } + } else if (s.required !== undefined && onlyKeyPresent(s, 'required')) { + return <>required: {s.required.join(' ∩ ')}; + } + + return ; +}; + +export const Type: React.FunctionComponent<{ + s: JsonSchema | undefined; + reference: string; + lookup: Lookup; +}> = ({ s, lookup, reference }) => + getTypeText(s, reference, LookupContext.root(lookup)); + +function findDiscriminant( + arg0: (boolean | JsonSchema1)[], + lookup: Lookup +): string | undefined { + return 'TODO'; +} diff --git a/nx-dev/feature-package-schema-viewer/src/lib/ui/headings.tsx b/nx-dev/feature-package-schema-viewer/src/lib/ui/headings.tsx new file mode 100644 index 0000000000..c5d936c290 --- /dev/null +++ b/nx-dev/feature-package-schema-viewer/src/lib/ui/headings.tsx @@ -0,0 +1,47 @@ +import { LinkIcon } from '@heroicons/react/solid'; +import { slugify } from '../slugify.utils'; + +export const Heading1 = ({ title }: { title: string }) => ( +

    + {title} + +

    +); + +export const Heading2 = ({ title }: { title: string }) => ( +

    + {title} + +

    +); + +export const Heading3 = ({ title }: { title: string }) => ( +

    + {title} + +

    +); diff --git a/nx-dev/feature-package-schema-viewer/src/lib/ui/info-panel.tsx b/nx-dev/feature-package-schema-viewer/src/lib/ui/info-panel.tsx new file mode 100644 index 0000000000..034d0f46c2 --- /dev/null +++ b/nx-dev/feature-package-schema-viewer/src/lib/ui/info-panel.tsx @@ -0,0 +1,26 @@ +import { InformationCircleIcon } from '@heroicons/react/solid'; + +export default function InfoPanel() { + return ( +
    +
    +
    +
    +
    +

    + Options can be configured in project.json when defining + the executor, or when invoking it. Read more about how to configure + targets and executors here:{' '} + + https://nx.dev/configuration/projectjson#targets. + +

    +
    +
    +
    + ); +} diff --git a/nx-dev/feature-package-schema-viewer/src/lib/ui/markdown/code-block.tsx b/nx-dev/feature-package-schema-viewer/src/lib/ui/markdown/code-block.tsx new file mode 100644 index 0000000000..dc4d1c7b54 --- /dev/null +++ b/nx-dev/feature-package-schema-viewer/src/lib/ui/markdown/code-block.tsx @@ -0,0 +1,69 @@ +import React, { useEffect, useState } from 'react'; +// @ts-ignore +import { CopyToClipboard } from 'react-copy-to-clipboard'; +import SyntaxHighlighter from 'react-syntax-highlighter'; + +export function CodeBlock({ + text, + language, + callback, + ...rest +}: { + text: string; + language: string; + [key: string]: any; + callback: (text: string) => void; +}) { + const [copied, setCopied] = useState(false); + useEffect(() => { + let t: NodeJS.Timeout; + if (copied) { + t = setTimeout(() => { + setCopied(false); + }, 3000); + } + return () => { + t && clearTimeout(t); + }; + }, [copied]); + return ( +
    + { + setCopied(true); + callback(text); + }} + > + + + +
    + ); +} diff --git a/nx-dev/feature-package-schema-viewer/src/lib/ui/markdown/markdown.tsx b/nx-dev/feature-package-schema-viewer/src/lib/ui/markdown/markdown.tsx new file mode 100644 index 0000000000..a0eddeb9f0 --- /dev/null +++ b/nx-dev/feature-package-schema-viewer/src/lib/ui/markdown/markdown.tsx @@ -0,0 +1,93 @@ +import ReactMarkdown from 'react-markdown'; +import autolinkHeadings from 'rehype-autolink-headings'; +import slug from 'rehype-slug'; +import gfm from 'remark-gfm'; +import { CodeBlock } from './code-block'; +import { renderIframes } from './renderers/render-iframe'; + +export const Markdown = ({ content }: { content: string }) => ( + void 0, + }, + })} + /> +); + +function createAnchorContent(node: any) { + node.properties.className = ['group']; + return { + type: 'element', + tagName: 'svg', + properties: { + xmlns: 'http://www.w3.org/2000/svg', + className: [ + 'inline', + 'ml-2', + 'mb-1', + `h-5`, + `w-5`, + 'opacity-0', + 'group-hover:opacity-100', + ], + fill: 'none', + viewBox: '0 0 24 24', + stroke: 'currentColor', + }, + children: [ + { + type: 'element', + tagName: 'path', + properties: { + 'stroke-linecap': 'round', + 'stroke-linejoin': 'round', + 'stroke-width': '2', + d: 'M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1', + }, + children: [], + }, + ], + }; +} + +interface ComponentsConfig { + readonly code: { callback: (command: string) => void }; +} +const components: any = (config: ComponentsConfig) => ({ + img({ node, alt, src, ...props }) { + return {alt}; + }, + code({ node, inline, className, children, ...props }) { + const language = /language-(\w+)/.exec(className || '')?.[1]; + return !inline && language ? ( + config.code.callback(command)} + /> + ) : ( + + {children} + + ); + }, + pre({ children }) { + return <>{children}; + }, +}); diff --git a/nx-dev/feature-package-schema-viewer/src/lib/ui/markdown/renderers/render-iframe.ts b/nx-dev/feature-package-schema-viewer/src/lib/ui/markdown/renderers/render-iframe.ts new file mode 100644 index 0000000000..aaee57a8c6 --- /dev/null +++ b/nx-dev/feature-package-schema-viewer/src/lib/ui/markdown/renderers/render-iframe.ts @@ -0,0 +1,21 @@ +export function renderIframes(): (tree: any) => void { + return (tree): void => { + const iframeList = tree.children.filter( + (child) => child.type === 'raw' && child.value.includes(' { + item.type = 'element'; + item.tagName = 'iframe'; + item.children = []; + item.properties = {}; + let match; + const regex = new RegExp( + '[\\s\\r\\t\\n]*([a-z0-9\\-_]+)[\\s\\r\\t\\n]*=[\\s\\r\\t\\n]*([\'"])((?:\\\\\\2|(?!\\2).)*)\\2', + 'ig' + ); + while ((match = regex.exec(item.value))) { + item.properties[match[1]] = match[3]; + } + }); + }; +} diff --git a/nx-dev/feature-package-schema-viewer/tsconfig.json b/nx-dev/feature-package-schema-viewer/tsconfig.json new file mode 100644 index 0000000000..3230750a88 --- /dev/null +++ b/nx-dev/feature-package-schema-viewer/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "jsx": "react-jsx", + "allowJs": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/nx-dev/feature-package-schema-viewer/tsconfig.lib.json b/nx-dev/feature-package-schema-viewer/tsconfig.lib.json new file mode 100644 index 0000000000..e9f02ac714 --- /dev/null +++ b/nx-dev/feature-package-schema-viewer/tsconfig.lib.json @@ -0,0 +1,23 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "types": ["node"], + "lib": ["dom"] + }, + "files": [ + "../../node_modules/@nrwl/react/typings/cssmodule.d.ts", + "../../node_modules/@nrwl/next/typings/image.d.ts" + ], + "exclude": [ + "**/*.spec.ts", + "**/*.test.ts", + "**/*.spec.tsx", + "**/*.test.tsx", + "**/*.spec.js", + "**/*.test.js", + "**/*.spec.jsx", + "**/*.test.jsx" + ], + "include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"] +} diff --git a/nx-dev/feature-package-schema-viewer/tsconfig.spec.json b/nx-dev/feature-package-schema-viewer/tsconfig.spec.json new file mode 100644 index 0000000000..67f149c4c0 --- /dev/null +++ b/nx-dev/feature-package-schema-viewer/tsconfig.spec.json @@ -0,0 +1,19 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": [ + "**/*.test.ts", + "**/*.spec.ts", + "**/*.test.tsx", + "**/*.spec.tsx", + "**/*.test.js", + "**/*.spec.js", + "**/*.test.jsx", + "**/*.spec.jsx", + "**/*.d.ts" + ] +} diff --git a/nx-dev/models-document/.babelrc b/nx-dev/models-document/.babelrc new file mode 100644 index 0000000000..cf7ddd99c6 --- /dev/null +++ b/nx-dev/models-document/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": [["@nrwl/web/babel", { "useBuiltIns": "usage" }]] +} diff --git a/nx-dev/models-document/.eslintrc.json b/nx-dev/models-document/.eslintrc.json new file mode 100644 index 0000000000..9d9c0db55b --- /dev/null +++ b/nx-dev/models-document/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + } + ] +} diff --git a/nx-dev/models-document/README.md b/nx-dev/models-document/README.md new file mode 100644 index 0000000000..a2c826fedc --- /dev/null +++ b/nx-dev/models-document/README.md @@ -0,0 +1,7 @@ +# nx-dev-models-document + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test nx-dev-models-document` to execute the unit tests via [Jest](https://jestjs.io). diff --git a/nx-dev/models-document/jest.config.js b/nx-dev/models-document/jest.config.js new file mode 100644 index 0000000000..dc526cc9b6 --- /dev/null +++ b/nx-dev/models-document/jest.config.js @@ -0,0 +1,15 @@ +module.exports = { + displayName: 'nx-dev-models-document', + preset: '../../jest.preset.js', + globals: { + 'ts-jest': { + tsconfig: '/tsconfig.spec.json', + }, + }, + testEnvironment: 'node', + transform: { + '^.+\\.[tj]sx?$': 'ts-jest', + }, + moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], + coverageDirectory: '../../coverage/nx-dev/models-document', +}; diff --git a/nx-dev/models-document/project.json b/nx-dev/models-document/project.json new file mode 100644 index 0000000000..9e0e9d2127 --- /dev/null +++ b/nx-dev/models-document/project.json @@ -0,0 +1,23 @@ +{ + "root": "nx-dev/models-document", + "sourceRoot": "nx-dev/models-document/src", + "projectType": "library", + "targets": { + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["nx-dev/models-document/**/*.ts"] + } + }, + "test": { + "executor": "@nrwl/jest:jest", + "outputs": ["coverage/nx-dev/models-document"], + "options": { + "jestConfig": "nx-dev/models-document/jest.config.js", + "passWithNoTests": true + } + } + }, + "tags": [] +} diff --git a/nx-dev/models-document/src/index.ts b/nx-dev/models-document/src/index.ts new file mode 100644 index 0000000000..e6fdfbe110 --- /dev/null +++ b/nx-dev/models-document/src/index.ts @@ -0,0 +1 @@ +export * from './lib/documents.models'; diff --git a/nx-dev/models-document/src/lib/documents.models.ts b/nx-dev/models-document/src/lib/documents.models.ts new file mode 100644 index 0000000000..6569121e3f --- /dev/null +++ b/nx-dev/models-document/src/lib/documents.models.ts @@ -0,0 +1,13 @@ +export interface DocumentData { + filePath: string; + data: { [key: string]: any }; + content: string; + excerpt?: string; +} + +export interface DocumentMetadata { + id: string; + name?: string; + file?: string; + itemList?: DocumentMetadata[]; +} diff --git a/nx-dev/models-document/tsconfig.json b/nx-dev/models-document/tsconfig.json new file mode 100644 index 0000000000..62ebbd9464 --- /dev/null +++ b/nx-dev/models-document/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tsconfig.base.json", + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/nx-dev/models-document/tsconfig.lib.json b/nx-dev/models-document/tsconfig.lib.json new file mode 100644 index 0000000000..6efdbeecb5 --- /dev/null +++ b/nx-dev/models-document/tsconfig.lib.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "commonjs", + "outDir": "../../dist/out-tsc", + "declaration": true, + "types": ["node"] + }, + "exclude": ["**/*.spec.ts", "**/*.test.ts"], + "include": ["**/*.ts"] +} diff --git a/nx-dev/models-document/tsconfig.spec.json b/nx-dev/models-document/tsconfig.spec.json new file mode 100644 index 0000000000..67f149c4c0 --- /dev/null +++ b/nx-dev/models-document/tsconfig.spec.json @@ -0,0 +1,19 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": [ + "**/*.test.ts", + "**/*.spec.ts", + "**/*.test.tsx", + "**/*.spec.tsx", + "**/*.test.js", + "**/*.spec.js", + "**/*.test.jsx", + "**/*.spec.jsx", + "**/*.d.ts" + ] +} diff --git a/nx-dev/models-menu/.babelrc b/nx-dev/models-menu/.babelrc new file mode 100644 index 0000000000..cf7ddd99c6 --- /dev/null +++ b/nx-dev/models-menu/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": [["@nrwl/web/babel", { "useBuiltIns": "usage" }]] +} diff --git a/nx-dev/models-menu/.eslintrc.json b/nx-dev/models-menu/.eslintrc.json new file mode 100644 index 0000000000..9d9c0db55b --- /dev/null +++ b/nx-dev/models-menu/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + } + ] +} diff --git a/nx-dev/models-menu/README.md b/nx-dev/models-menu/README.md new file mode 100644 index 0000000000..fae2bf93fd --- /dev/null +++ b/nx-dev/models-menu/README.md @@ -0,0 +1,7 @@ +# nx-dev-models-menu + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test nx-dev-models-menu` to execute the unit tests via [Jest](https://jestjs.io). diff --git a/nx-dev/models-menu/jest.config.js b/nx-dev/models-menu/jest.config.js new file mode 100644 index 0000000000..2feb34d18d --- /dev/null +++ b/nx-dev/models-menu/jest.config.js @@ -0,0 +1,15 @@ +module.exports = { + displayName: 'nx-dev-models-menu', + preset: '../../jest.preset.js', + globals: { + 'ts-jest': { + tsconfig: '/tsconfig.spec.json', + }, + }, + testEnvironment: 'node', + transform: { + '^.+\\.[tj]sx?$': 'ts-jest', + }, + moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], + coverageDirectory: '../../coverage/nx-dev/models-menu', +}; diff --git a/nx-dev/models-menu/project.json b/nx-dev/models-menu/project.json new file mode 100644 index 0000000000..1e07a550b6 --- /dev/null +++ b/nx-dev/models-menu/project.json @@ -0,0 +1,23 @@ +{ + "root": "nx-dev/models-menu", + "sourceRoot": "nx-dev/models-menu/src", + "projectType": "library", + "targets": { + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["nx-dev/models-menu/**/*.ts"] + } + }, + "test": { + "executor": "@nrwl/jest:jest", + "outputs": ["coverage/nx-dev/models-menu"], + "options": { + "jestConfig": "nx-dev/models-menu/jest.config.js", + "passWithNoTests": true + } + } + }, + "tags": [] +} diff --git a/nx-dev/models-menu/src/index.ts b/nx-dev/models-menu/src/index.ts new file mode 100644 index 0000000000..9bdb858ec7 --- /dev/null +++ b/nx-dev/models-menu/src/index.ts @@ -0,0 +1 @@ +export * from './lib/menu.models'; diff --git a/nx-dev/data-access-documents/src/lib/menu.models.ts b/nx-dev/models-menu/src/lib/menu.models.ts similarity index 81% rename from nx-dev/data-access-documents/src/lib/menu.models.ts rename to nx-dev/models-menu/src/lib/menu.models.ts index dcc9a3f6ac..aded16cbec 100644 --- a/nx-dev/data-access-documents/src/lib/menu.models.ts +++ b/nx-dev/models-menu/src/lib/menu.models.ts @@ -1,4 +1,4 @@ -import { DocumentMetadata } from './documents.models'; +import { DocumentMetadata } from '@nrwl/nx-dev/models-document'; export interface Menu { sections: MenuSection[]; @@ -13,7 +13,6 @@ export interface MenuSection { export interface MenuItem extends DocumentMetadata { path?: string; - url?: string; itemList?: MenuItem[]; disableCollapsible?: boolean; } diff --git a/nx-dev/models-menu/tsconfig.json b/nx-dev/models-menu/tsconfig.json new file mode 100644 index 0000000000..62ebbd9464 --- /dev/null +++ b/nx-dev/models-menu/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tsconfig.base.json", + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/nx-dev/models-menu/tsconfig.lib.json b/nx-dev/models-menu/tsconfig.lib.json new file mode 100644 index 0000000000..6efdbeecb5 --- /dev/null +++ b/nx-dev/models-menu/tsconfig.lib.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "commonjs", + "outDir": "../../dist/out-tsc", + "declaration": true, + "types": ["node"] + }, + "exclude": ["**/*.spec.ts", "**/*.test.ts"], + "include": ["**/*.ts"] +} diff --git a/nx-dev/models-menu/tsconfig.spec.json b/nx-dev/models-menu/tsconfig.spec.json new file mode 100644 index 0000000000..67f149c4c0 --- /dev/null +++ b/nx-dev/models-menu/tsconfig.spec.json @@ -0,0 +1,19 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": [ + "**/*.test.ts", + "**/*.spec.ts", + "**/*.test.tsx", + "**/*.spec.tsx", + "**/*.test.js", + "**/*.spec.js", + "**/*.test.jsx", + "**/*.spec.jsx", + "**/*.d.ts" + ] +} diff --git a/nx-dev/models-package/.babelrc b/nx-dev/models-package/.babelrc new file mode 100644 index 0000000000..cf7ddd99c6 --- /dev/null +++ b/nx-dev/models-package/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": [["@nrwl/web/babel", { "useBuiltIns": "usage" }]] +} diff --git a/nx-dev/models-package/.eslintrc.json b/nx-dev/models-package/.eslintrc.json new file mode 100644 index 0000000000..9d9c0db55b --- /dev/null +++ b/nx-dev/models-package/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + } + ] +} diff --git a/nx-dev/models-package/README.md b/nx-dev/models-package/README.md new file mode 100644 index 0000000000..f36cf13ba6 --- /dev/null +++ b/nx-dev/models-package/README.md @@ -0,0 +1,7 @@ +# nx-dev-models-package + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test nx-dev-models-package` to execute the unit tests via [Jest](https://jestjs.io). diff --git a/nx-dev/models-package/jest.config.js b/nx-dev/models-package/jest.config.js new file mode 100644 index 0000000000..9798a5129e --- /dev/null +++ b/nx-dev/models-package/jest.config.js @@ -0,0 +1,15 @@ +module.exports = { + displayName: 'nx-dev-models-package', + preset: '../../jest.preset.js', + globals: { + 'ts-jest': { + tsconfig: '/tsconfig.spec.json', + }, + }, + testEnvironment: 'node', + transform: { + '^.+\\.[tj]sx?$': 'ts-jest', + }, + moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], + coverageDirectory: '../../coverage/nx-dev/models-package', +}; diff --git a/nx-dev/models-package/project.json b/nx-dev/models-package/project.json new file mode 100644 index 0000000000..498b209fb2 --- /dev/null +++ b/nx-dev/models-package/project.json @@ -0,0 +1,23 @@ +{ + "root": "nx-dev/models-package", + "sourceRoot": "nx-dev/models-package/src", + "projectType": "library", + "targets": { + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["nx-dev/models-package/**/*.ts"] + } + }, + "test": { + "executor": "@nrwl/jest:jest", + "outputs": ["coverage/nx-dev/models-package"], + "options": { + "jestConfig": "nx-dev/models-package/jest.config.js", + "passWithNoTests": true + } + } + }, + "tags": [] +} diff --git a/nx-dev/models-package/src/index.ts b/nx-dev/models-package/src/index.ts new file mode 100644 index 0000000000..ab9551a1fb --- /dev/null +++ b/nx-dev/models-package/src/index.ts @@ -0,0 +1,2 @@ +export * from './lib/json-schema.models'; +export * from './lib/package.models'; diff --git a/nx-dev/models-package/src/lib/json-schema.draft-07.json b/nx-dev/models-package/src/lib/json-schema.draft-07.json new file mode 100644 index 0000000000..ccbd254720 --- /dev/null +++ b/nx-dev/models-package/src/lib/json-schema.draft-07.json @@ -0,0 +1,169 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://json-schema.org/draft-07/schema#", + "title": "Json Schema", + "definitions": { + "JsonSchema": { + "type": "object", + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": {}, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": {} + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": ["number", "boolean"] + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": ["number", "boolean"] + }, + "maxLength": { "$ref": "#/definitions/nonNegativeInteger" }, + "minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": { "$ref": "#/definitions/JsonSchema" }, + "items": { + "anyOf": [{ "$ref": "#" }, { "$ref": "#/definitions/schemaArray" }], + "default": true + }, + "maxItems": { "$ref": "#/definitions/nonNegativeInteger" }, + "minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": { "$ref": "#" }, + "maxProperties": { "$ref": "#/definitions/nonNegativeInteger" }, + "minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "required": { "$ref": "#/definitions/stringArray" }, + "additionalProperties": { "$ref": "#" }, + "definitions": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "propertyNames": { "format": "regex" }, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [{ "$ref": "#" }, { "$ref": "#/definitions/stringArray" }] + } + }, + "propertyNames": { "$ref": "#" }, + "const": true, + "enum": { + "type": "array", + "items": {}, + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + { "$ref": "#/definitions/simpleTypes" }, + { + "type": "array", + "items": { "$ref": "#/definitions/simpleTypes" }, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": { "type": "string" }, + "contentMediaType": { "type": "string" }, + "contentEncoding": { "type": "string" }, + "if": { "$ref": "#" }, + "then": { "$ref": "#" }, + "else": { "$ref": "#" }, + "allOf": { "$ref": "#/definitions/schemaArray" }, + "anyOf": { "$ref": "#/definitions/schemaArray" }, + "oneOf": { "$ref": "#/definitions/schemaArray" }, + "not": { "$ref": "#" } + } + }, + "schemaArray": { + "type": "array", + "minItems": 1, + "items": { "$ref": "#" } + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [ + { "$ref": "#/definitions/nonNegativeInteger" }, + { "default": 0 } + ] + }, + "simpleTypes": { + "enum": [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + "stringArray": { + "type": "array", + "items": { "type": "string" }, + "uniqueItems": true, + "default": [] + } + }, + "anyOf": [{ "type": "boolean" }, { "$ref": "#/definitions/JsonSchema" }], + "default": true +} diff --git a/nx-dev/models-package/src/lib/json-schema.models.ts b/nx-dev/models-package/src/lib/json-schema.models.ts new file mode 100644 index 0000000000..5c9857c69b --- /dev/null +++ b/nx-dev/models-package/src/lib/json-schema.models.ts @@ -0,0 +1,78 @@ +/* tslint:disable */ +/** + * This file was automatically generated by json-schema-to-typescript. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run json-schema-to-typescript to regenerate this file. + */ + +export type JsonSchema = boolean | JsonSchema1; +export type NonNegativeInteger = number; +export type NonNegativeIntegerDefault0 = NonNegativeInteger; +export type SchemaArray = [JsonSchema, ...JsonSchema[]]; +export type StringArray = string[]; +export type SimpleTypes = + | 'array' + | 'boolean' + | 'integer' + | 'null' + | 'number' + | 'object' + | 'string'; + +export interface JsonSchema1 { + $id?: string; + $schema?: string; + $ref?: string; + $comment?: string; + title?: string; + description?: string; + default?: unknown; + readOnly?: boolean; + writeOnly?: boolean; + examples?: unknown[]; + multipleOf?: number; + maximum?: number; + exclusiveMaximum?: number | boolean; + minimum?: number; + exclusiveMinimum?: number | boolean; + maxLength?: NonNegativeInteger; + minLength?: NonNegativeIntegerDefault0; + pattern?: string; + additionalItems?: JsonSchema1; + items?: JsonSchema | SchemaArray; + maxItems?: NonNegativeInteger; + minItems?: NonNegativeIntegerDefault0; + uniqueItems?: boolean; + contains?: JsonSchema; + maxProperties?: NonNegativeInteger; + minProperties?: NonNegativeIntegerDefault0; + required?: StringArray; + additionalProperties?: JsonSchema; + definitions?: { + [k: string]: JsonSchema; + }; + properties?: { + [k: string]: JsonSchema; + }; + patternProperties?: { + [k: string]: JsonSchema; + }; + dependencies?: { + [k: string]: JsonSchema | StringArray; + }; + propertyNames?: JsonSchema; + const?: true; + enum?: [unknown, ...unknown[]]; + type?: SimpleTypes | [SimpleTypes, ...SimpleTypes[]]; + format?: string; + contentMediaType?: string; + contentEncoding?: string; + if?: JsonSchema; + then?: JsonSchema; + else?: JsonSchema; + allOf?: SchemaArray; + anyOf?: SchemaArray; + oneOf?: SchemaArray; + not?: JsonSchema; + [k: string]: unknown; +} diff --git a/nx-dev/models-package/src/lib/package.models.ts b/nx-dev/models-package/src/lib/package.models.ts new file mode 100644 index 0000000000..fb28efc545 --- /dev/null +++ b/nx-dev/models-package/src/lib/package.models.ts @@ -0,0 +1,33 @@ +/** + * To generate base json-schema models, you need to run the following command: + * `npx json2ts nx-dev/models-package/src/lib/json-schema.draft-07.json > nx-dev/models-package/src/lib/json-schema.model.ts` + */ +import { JsonSchema1 } from './json-schema.models'; + +export interface PackageMetadata { + githubRoot: string; + name: string; + description: string; + root: string; + source: string; + generators: SchemaMetadata[]; + executors: SchemaMetadata[]; +} + +export interface SchemaMetadata { + name: string; + aliases: string[]; + implementation: string; + path: string; + schema: NxSchema | null; + description: string; + hidden: boolean; +} + +export interface NxSchema extends JsonSchema1 { + title: string; + description: string; + presets: { name: string; keys: string[] }[]; + examplesFile: string; + hidden: boolean; +} diff --git a/nx-dev/models-package/tsconfig.json b/nx-dev/models-package/tsconfig.json new file mode 100644 index 0000000000..62ebbd9464 --- /dev/null +++ b/nx-dev/models-package/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tsconfig.base.json", + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/nx-dev/models-package/tsconfig.lib.json b/nx-dev/models-package/tsconfig.lib.json new file mode 100644 index 0000000000..6efdbeecb5 --- /dev/null +++ b/nx-dev/models-package/tsconfig.lib.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "commonjs", + "outDir": "../../dist/out-tsc", + "declaration": true, + "types": ["node"] + }, + "exclude": ["**/*.spec.ts", "**/*.test.ts"], + "include": ["**/*.ts"] +} diff --git a/nx-dev/models-package/tsconfig.spec.json b/nx-dev/models-package/tsconfig.spec.json new file mode 100644 index 0000000000..67f149c4c0 --- /dev/null +++ b/nx-dev/models-package/tsconfig.spec.json @@ -0,0 +1,19 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": [ + "**/*.test.ts", + "**/*.spec.ts", + "**/*.test.tsx", + "**/*.spec.tsx", + "**/*.test.js", + "**/*.spec.js", + "**/*.test.jsx", + "**/*.spec.jsx", + "**/*.d.ts" + ] +} diff --git a/nx-dev/nx-dev/lib/api.ts b/nx-dev/nx-dev/lib/api.ts index 1917d098ad..fa879c9c30 100644 --- a/nx-dev/nx-dev/lib/api.ts +++ b/nx-dev/nx-dev/lib/api.ts @@ -1,16 +1,23 @@ import { - DocumentMetadata, DocumentsApi, MenuApi, -} from '@nrwl/nx-dev/data-access-documents'; +} from '@nrwl/nx-dev/data-access-documents/node-only'; +import { PackagesApi } from '@nrwl/nx-dev/data-access-packages/node-only'; +import { DocumentMetadata } from '@nrwl/nx-dev/models-document'; // Imports JSON directly so they can be bundled into the app and functions. // Also provides some test safety. import documents from '../public/documentation/map.json'; +import packages from '../public/documentation/packages.json'; + +export const packagesApi = new PackagesApi({ + publicPackagesRoot: 'nx-dev/nx-dev/public/documentation', + packagesIndex: packages, +}); export const documentsApi = new DocumentsApi({ publicDocsRoot: 'nx-dev/nx-dev/public/documentation', documents: documents.find((x) => x.id === 'default') as DocumentMetadata, }); -export const menuApi = new MenuApi(documentsApi); +export const menuApi = new MenuApi(documentsApi.getDocuments()); diff --git a/nx-dev/nx-dev/next.config.js b/nx-dev/nx-dev/next.config.js index 81bedac424..34ab981e51 100644 --- a/nx-dev/nx-dev/next.config.js +++ b/nx-dev/nx-dev/next.config.js @@ -2,6 +2,7 @@ const withNx = require('@nrwl/next/plugins/with-nx'); const { copy } = require('fs-extra'); const path = require('path'); +const redirectRules = require('./redirect-rules.config'); /** * TODO@ben: Temporary solution before Nextjs' assets management tasks is up and running @@ -12,19 +13,6 @@ copy( { overwrite: true } ); -const redirects = { - '/core-concepts/configuration': '/configuration/projectjson', - '/core-concepts/mental-model': '/using-nx/mental-model', - '/core-concepts/updating-nx': '/using-nx/updating-nx', - '/core-concepts/ci-overview': '/using-nx/ci-overview', - '/using-nx/nx-devkit': '/getting-started/nx-devkit', - '/getting-started/nx-cli': '/using-nx/nx-cli', - '/getting-started/console': '/using-nx/console', - '/core-extended/affected': '/using-nx/affected', - '/core-extended/computation-caching': '/using-nx/caching', - '/guides/nextjs': '/next/overview', -}; - module.exports = withNx({ // For both client and server env: { @@ -75,28 +63,37 @@ module.exports = withNx({ }); // Customs - for (let s of Object.keys(redirects)) { + for (let s of Object.keys(redirectRules.guideUrls)) { rules.push({ source: `/l/n${s}`, - destination: redirects[s], + destination: redirectRules.guideUrls[s], permanent: true, }); rules.push({ source: `/l/r${s}`, - destination: redirects[s], + destination: redirectRules.guideUrls[s], permanent: true, }); rules.push({ source: `/l/a${s}`, - destination: redirects[s], + destination: redirectRules.guideUrls[s], permanent: true, }); rules.push({ source: s, - destination: redirects[s], + destination: redirectRules.guideUrls[s], + permanent: true, + }); + } + + // Schemas (generators & executors) + for (let s of Object.keys(redirectRules.schemaUrls)) { + rules.push({ + source: s, + destination: redirectRules.schemaUrls[s], permanent: true, }); } diff --git a/nx-dev/nx-dev/pages/[...segments].tsx b/nx-dev/nx-dev/pages/[...segments].tsx index a60d0ef746..4c3a74d5bf 100644 --- a/nx-dev/nx-dev/pages/[...segments].tsx +++ b/nx-dev/nx-dev/pages/[...segments].tsx @@ -1,14 +1,25 @@ -import type { DocumentData, Menu } from '@nrwl/nx-dev/data-access-documents'; +import { + PackageSchemaList, + PackageSchemaViewer, +} from '@nrwl/nx-dev-feature-package-schema-viewer'; import { DocViewer } from '@nrwl/nx-dev/feature-doc-viewer'; +import { DocumentData } from '@nrwl/nx-dev/models-document'; +import { Menu } from '@nrwl/nx-dev/models-menu'; +import { PackageMetadata } from '@nrwl/nx-dev/models-package'; import { Footer, Header } from '@nrwl/nx-dev/ui-common'; import cx from 'classnames'; import Router from 'next/router'; import { useCallback, useEffect, useState } from 'react'; -import { documentsApi, menuApi } from '../lib/api'; +import { documentsApi, menuApi, packagesApi } from '../lib/api'; interface DocumentationPageProps { menu: Menu; - document: DocumentData; + document: DocumentData | null; + pkg: PackageMetadata | null; + schemaRequest: { + type: 'executors' | 'generators'; + schemaName: string; + } | null; } // We may want to extract this to another lib. @@ -34,21 +45,48 @@ function useNavToggle() { } export default function DocumentationPage({ - document, menu, + document, + pkg, + schemaRequest, }: DocumentationPageProps) { const { toggleNav, navIsOpen } = useNavToggle(); + const vm: { entryComponent: JSX.Element } = { + entryComponent: ( + + ), + }; + + if (!!pkg) { + vm.entryComponent = ( + + ); + } + + if (!!pkg && !!schemaRequest) { + vm.entryComponent = ( + + ); + } + return ( <>
    - + {vm.entryComponent}