Skip to content

Commit

Permalink
chore(core): improve help output for generators and executors (#9800)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesHenry committed Apr 12, 2022
1 parent d4682be commit 46e7b4d
Show file tree
Hide file tree
Showing 73 changed files with 665 additions and 130 deletions.
12 changes: 10 additions & 2 deletions .eslintrc.json
Expand Up @@ -5,10 +5,18 @@
"node": true
},
"ignorePatterns": ["**/*.ts"],
"plugins": ["@typescript-eslint"],
"plugins": ["@typescript-eslint", "@nrwl/nx"],
"extends": [],
"rules": {
"@typescript-eslint/explicit-module-boundary-types": "off"
},
"overrides": []
"overrides": [
{
"files": ["**/executors/**/schema.json", "**/generators/**/schema.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"@nrwl/nx/workspace/valid-schema-description": "error"
}
}
]
}
24 changes: 14 additions & 10 deletions docs/generated/packages/angular.json
Expand Up @@ -12,6 +12,7 @@
"$schema": "http://json-schema.org/schema",
"$id": "NxAngularAddLintingGenerator",
"title": "Add linting to an Angular project.",
"description": "Adds linting configuration to an Angular project.",
"cli": "nx",
"type": "object",
"properties": {
Expand Down Expand Up @@ -61,6 +62,7 @@
"$schema": "http://json-schema.org/schema",
"$id": "GeneratorNxApp",
"title": "Creates an Angular application.",
"description": "Creates an Angular application.",
"type": "object",
"cli": "nx",
"properties": {
Expand Down Expand Up @@ -245,7 +247,7 @@
"title": "Angular Component Schema",
"cli": "nx",
"type": "object",
"description": "Creates a new, generic component definition in the given or default project.",
"description": "Creates a new, generic Angular component definition in the given or default project.",
"additionalProperties": false,
"properties": {
"path": {
Expand Down Expand Up @@ -355,6 +357,7 @@
"$id": "NxAngularComponentCypressSpecGenerator",
"type": "object",
"cli": "nx",
"description": "Creates a Cypress spec for a UI component that has a story.",
"properties": {
"projectName": {
"type": "string",
Expand Down Expand Up @@ -410,6 +413,7 @@
"$id": "NxAngularComponentStoryGenerator",
"type": "object",
"cli": "nx",
"description": "Creates a `stories.ts` file for an Angular component.",
"properties": {
"projectPath": {
"type": "string",
Expand Down Expand Up @@ -455,7 +459,7 @@
"$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`",
"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",
Expand Down Expand Up @@ -513,7 +517,7 @@
"$schema": "http://json-schema.org/schema",
"$id": "NxDowngradeModuleGenerator",
"title": "Generates downgradeModule setup.",
"description": "Sets up a Downgrade Module.",
"description": "Sets up a Downgrade Module for using AngularJS and Angular.",
"cli": "nx",
"type": "object",
"properties": {
Expand Down Expand Up @@ -559,7 +563,7 @@
"$id": "SchematicsAngularModuleInit",
"cli": "nx",
"title": "Init Angular Plugin",
"description": "Initializes the `@nrwl/angular` plugin. NOTE: Does not work in the `--dry-run` mode",
"description": "Initializes the `@nrwl/angular` plugin. NOTE: Does not work in the `--dry-run` mode.",
"type": "object",
"properties": {
"unitTestRunner": {
Expand Down Expand Up @@ -1087,7 +1091,7 @@
"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!_",
"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": {
Expand All @@ -1113,7 +1117,7 @@
"$id": "NxMFEHost",
"cli": "nx",
"title": "Nx MFE Host Application",
"description": "Create an Angular Host Micro Frontend Application",
"description": "Create an Angular Host Micro Frontend Application.",
"type": "object",
"examples": [
{
Expand Down Expand Up @@ -1433,7 +1437,7 @@
"cli": "nx",
"title": "SCAM Generator Options Schema",
"type": "object",
"description": "Creates a new, generic component definition in the given or default project.",
"description": "Creates a new, generic Angular component definition in the given or default project.",
"additionalProperties": false,
"properties": {
"path": {
Expand Down Expand Up @@ -1553,7 +1557,7 @@
"cli": "nx",
"title": "SCAM Directive Generator Options Schema",
"type": "object",
"description": "Creates a new, generic directive definition in the given or default project.",
"description": "Creates a new, generic Angular directive definition in the given or default project.",
"additionalProperties": false,
"properties": {
"path": {
Expand Down Expand Up @@ -1626,7 +1630,7 @@
"cli": "nx",
"title": "SCAM Pipe Generator Options Schema",
"type": "object",
"description": "Creates a new, generic pipe definition in the given or default project.",
"description": "Creates a new, generic Angular pipe definition in the given or default project.",
"additionalProperties": false,
"properties": {
"path": {
Expand Down Expand Up @@ -1798,7 +1802,7 @@
"$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.",
"description": "Creates Storybook stories/specs for all Angular components declared in a project.",
"cli": "nx",
"type": "object",
"properties": {
Expand Down
2 changes: 1 addition & 1 deletion docs/generated/packages/jest.json
Expand Up @@ -45,7 +45,7 @@
"$id": "NxJestProject",
"cli": "nx",
"title": "Add Jest Configuration to a project",
"description": "Add Jest Configuration to a project",
"description": "Add Jest Configuration to a project.",
"type": "object",
"properties": {
"project": {
Expand Down
2 changes: 1 addition & 1 deletion docs/generated/packages/js.json
Expand Up @@ -136,7 +136,7 @@
"$id": "NxTypescriptInit",
"cli": "nx",
"title": "Init nrwl/js",
"description": "Init generator placeholder for nrwl/js",
"description": "Init generator placeholder for nrwl/js.",
"presets": []
},
"aliases": ["lib"],
Expand Down
2 changes: 1 addition & 1 deletion docs/generated/packages/nest.json
Expand Up @@ -12,7 +12,7 @@
"$schema": "http://json-schema.org/schema",
"$id": "NxNestApplicationGenerator",
"title": "Nx Application Options Schema",
"description": "Nx Application Options Schema",
"description": "Nx Application Options Schema.",
"cli": "nx",
"type": "object",
"properties": {
Expand Down
6 changes: 4 additions & 2 deletions docs/generated/packages/next.json
Expand Up @@ -51,6 +51,7 @@
"cli": "nx",
"$id": "NxNextApp",
"title": "Create a Next.js Application for Nx",
"description": "Create a Next.js Application for Nx.",
"examples": [
{
"command": "nx g app myapp --directory=myorg",
Expand Down Expand Up @@ -287,6 +288,7 @@
"cli": "nx",
"$id": "NxNextReactComponent",
"title": "Create a React Component for Next",
"description": "Create a React Component for Next.",
"type": "object",
"examples": [
{
Expand Down Expand Up @@ -560,7 +562,7 @@
"$schema": "http://json-schema.org/schema",
"cli": "nx",
"title": "Next Build",
"description": "Build a Next.js app",
"description": "Build a Next.js app.",
"type": "object",
"properties": {
"root": { "description": "The source root", "type": "string" },
Expand Down Expand Up @@ -612,7 +614,7 @@
"schema": {
"cli": "nx",
"title": "Next Serve",
"description": "Serve a Next.js app",
"description": "Serve a Next.js app.",
"type": "object",
"properties": {
"dev": {
Expand Down
1 change: 0 additions & 1 deletion docs/generated/packages/node.json
Expand Up @@ -205,7 +205,6 @@
},
"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": {
Expand Down
2 changes: 1 addition & 1 deletion docs/generated/packages/react-native.json
Expand Up @@ -325,7 +325,7 @@
"cli": "nx",
"$id": "NxReactNativeStorybookConfigure",
"title": "React native Storybook configuration",
"description": "Set up Storybook for a React-Native app or library",
"description": "Set up Storybook for a React-Native app or library.",
"type": "object",
"properties": {
"name": {
Expand Down
4 changes: 2 additions & 2 deletions docs/generated/packages/react.json
Expand Up @@ -12,7 +12,7 @@
"$schema": "http://json-schema.org/schema",
"$id": "NxReactNgInit",
"title": "Init React Plugin",
"description": "Initialize a React Plugin",
"description": "Initialize a React Plugin.",
"cli": "nx",
"type": "object",
"properties": {
Expand Down Expand Up @@ -218,7 +218,7 @@
"cli": "nx",
"$id": "NxReactLibrary",
"title": "Create a React Library",
"description": "Create a React Library for an Nx workspace",
"description": "Create a React Library for an Nx workspace.",
"type": "object",
"examples": [
{
Expand Down
3 changes: 2 additions & 1 deletion docs/generated/packages/web.json
Expand Up @@ -13,6 +13,7 @@
"$id": "NxWebInit",
"cli": "nx",
"title": "Init Web Plugin",
"description": "Init Web Plugin.",
"type": "object",
"properties": {
"unitTestRunner": {
Expand Down Expand Up @@ -148,7 +149,7 @@
"implementation": "/packages/web/src/executors/webpack/webpack.impl.ts",
"schema": {
"title": "Webpack Executor",
"description": "Builds web applications using webpack",
"description": "Builds web applications using webpack.",
"cli": "nx",
"type": "object",
"properties": {
Expand Down
6 changes: 4 additions & 2 deletions e2e/cli/src/cli.test.ts
Expand Up @@ -72,11 +72,13 @@ describe('Cli', () => {

const genHelp = runCLI(`g @nrwl/web:app --help`);
expect(genHelp).toContain(
'The file extension to be used for style files. (default: css)'
'Find more information and examples at: https://nx.dev/packages/web/generators/application'
);

const buildHelp = runCLI(`build ${myapp} --help`);
expect(buildHelp).toContain('The name of the main entry-point file.');
expect(buildHelp).toContain(
'Find more information and examples at: https://nx.dev/packages/web/executors/webpack'
);

const affectedHelp = runCLI(`affected --help`);
expect(affectedHelp).toContain('Run target for affected projects');
Expand Down
3 changes: 2 additions & 1 deletion nx.json
Expand Up @@ -3,7 +3,8 @@
"package.json": "*",
".eslintrc.json": "*",
"scripts/vercel/*": ["nx-dev"],
".circleci/config.yml": "*"
".circleci/config.yml": "*",
"tools/eslint-rules/**/*": "*"
},
"affected": {
"defaultBase": "master"
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -166,6 +166,7 @@
"jest": "27.2.3",
"jest-circus": "27.2.3",
"jest-preset-angular": "11.1.1",
"jsonc-eslint-parser": "^2.1.0",
"jsonc-parser": "3.0.0",
"karma": "~4.0.0",
"karma-chrome-launcher": "~2.2.0",
Expand Down
4 changes: 3 additions & 1 deletion packages/angular/project.json
Expand Up @@ -85,7 +85,9 @@
"packages/angular/**/*.spec.tsx",
"packages/angular/**/*.spec.js",
"packages/angular/**/*.spec.jsx",
"packages/angular/**/*.d.ts"
"packages/angular/**/*.d.ts",
"packages/angular/**/executors/**/schema.json",
"packages/angular/**/generators/**/schema.json"
]
},
"outputs": ["{options.outputFile}"]
Expand Down
1 change: 1 addition & 0 deletions packages/angular/src/generators/add-linting/schema.json
Expand Up @@ -2,6 +2,7 @@
"$schema": "http://json-schema.org/schema",
"$id": "NxAngularAddLintingGenerator",
"title": "Add linting to an Angular project.",
"description": "Adds linting configuration to an Angular project.",
"cli": "nx",
"type": "object",
"properties": {
Expand Down
1 change: 1 addition & 0 deletions packages/angular/src/generators/application/schema.json
Expand Up @@ -2,6 +2,7 @@
"$schema": "http://json-schema.org/schema",
"$id": "GeneratorNxApp",
"title": "Creates an Angular application.",
"description": "Creates an Angular application.",
"type": "object",
"cli": "nx",
"properties": {
Expand Down
Expand Up @@ -3,6 +3,7 @@
"$id": "NxAngularComponentCypressSpecGenerator",
"type": "object",
"cli": "nx",
"description": "Creates a Cypress spec for a UI component that has a story.",
"properties": {
"projectName": {
"type": "string",
Expand Down
Expand Up @@ -3,6 +3,7 @@
"$id": "NxAngularComponentStoryGenerator",
"type": "object",
"cli": "nx",
"description": "Creates a `stories.ts` file for an Angular component.",
"properties": {
"projectPath": {
"type": "string",
Expand Down
2 changes: 1 addition & 1 deletion packages/angular/src/generators/component/schema.json
Expand Up @@ -4,7 +4,7 @@
"title": "Angular Component Schema",
"cli": "nx",
"type": "object",
"description": "Creates a new, generic component definition in the given or default project.",
"description": "Creates a new, generic Angular component definition in the given or default project.",
"additionalProperties": false,
"properties": {
"path": {
Expand Down
Expand Up @@ -4,7 +4,7 @@
"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!_",
"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": {
Expand Down
Expand Up @@ -3,7 +3,7 @@
"$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`",
"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",
Expand Down
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/schema",
"$id": "NxDowngradeModuleGenerator",
"title": "Generates downgradeModule setup.",
"description": "Sets up a Downgrade Module.",
"description": "Sets up a Downgrade Module for using AngularJS and Angular.",
"cli": "nx",
"type": "object",
"properties": {
Expand Down
2 changes: 1 addition & 1 deletion packages/angular/src/generators/init/schema.json
Expand Up @@ -3,7 +3,7 @@
"$id": "SchematicsAngularModuleInit",
"cli": "nx",
"title": "Init Angular Plugin",
"description": "Initializes the `@nrwl/angular` plugin. NOTE: Does not work in the `--dry-run` mode",
"description": "Initializes the `@nrwl/angular` plugin. NOTE: Does not work in the `--dry-run` mode.",
"type": "object",
"properties": {
"unitTestRunner": {
Expand Down
2 changes: 1 addition & 1 deletion packages/angular/src/generators/mfe-host/schema.json
Expand Up @@ -3,7 +3,7 @@
"$id": "NxMFEHost",
"cli": "nx",
"title": "Nx MFE Host Application",
"description": "Create an Angular Host Micro Frontend Application",
"description": "Create an Angular Host Micro Frontend Application.",
"type": "object",
"examples": [
{
Expand Down
2 changes: 1 addition & 1 deletion packages/angular/src/generators/scam-directive/schema.json
Expand Up @@ -4,7 +4,7 @@
"cli": "nx",
"title": "SCAM Directive Generator Options Schema",
"type": "object",
"description": "Creates a new, generic directive definition in the given or default project.",
"description": "Creates a new, generic Angular directive definition in the given or default project.",
"additionalProperties": false,
"properties": {
"path": {
Expand Down

1 comment on commit 46e7b4d

@vercel
Copy link

@vercel vercel bot commented on 46e7b4d Apr 12, 2022

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

nx-dev – ./

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

Please sign in to comment.