From f4d83548f38a09c3be65b662bbc1dac4730a4112 Mon Sep 17 00:00:00 2001 From: Jack Hsu Date: Fri, 16 Aug 2019 13:01:57 -0400 Subject: [PATCH] feat(react): add aliases for common React commands (#1732) --- docs/api-react/schematics/application.md | 10 ++++++++++ docs/api-react/schematics/library.md | 12 +++++++++++- .../react/src/schematics/application/schema.json | 9 +++++++-- packages/react/src/schematics/library/schema.json | 13 +++++++++---- 4 files changed, 37 insertions(+), 7 deletions(-) diff --git a/docs/api-react/schematics/application.md b/docs/api-react/schematics/application.md index 29999e367c4cc..d1c2e748c4f38 100644 --- a/docs/api-react/schematics/application.md +++ b/docs/api-react/schematics/application.md @@ -21,6 +21,8 @@ Use Babel and TypeScript preset instead of ts-loader (Useful if you need Babel p ### classComponent +Alias(es): C + Default: `false` Type: `boolean` @@ -29,6 +31,8 @@ Use class components instead of functional component ### directory +Alias(es): d + Type: `string` The directory of the new application. @@ -57,6 +61,8 @@ The name of the application. ### pascalCaseFiles +Alias(es): P + Default: `false` Type: `boolean` @@ -87,6 +93,8 @@ Skip updating workspace.json with default schematic options based on values prov ### style +Alias(es): s + Default: `css` Type: `string` @@ -95,6 +103,8 @@ The file extension to be used for style files. ### tags +Alias(es): t + Type: `string` Add tags to the application (used for linting) diff --git a/docs/api-react/schematics/library.md b/docs/api-react/schematics/library.md index 4ed1ed864d098..79f7de7fb355f 100644 --- a/docs/api-react/schematics/library.md +++ b/docs/api-react/schematics/library.md @@ -13,12 +13,16 @@ ng generate library ... ### appProject +Alias(es): a + Type: `string` The application project to add the library route to ### directory +Alias(es): d + Type: `string` A directory where the app is placed @@ -39,11 +43,13 @@ Library name ### pascalCaseFiles +Alias(es): P + Default: `false` Type: `boolean` -Use pascal case component file name (e.g. App.tsx)® +Use pascal case component file name (e.g. App.tsx) ### routing @@ -69,6 +75,8 @@ Do not update tsconfig.json for development experience. ### style +Alias(es): s + Default: `css` Type: `string` @@ -77,6 +85,8 @@ The file extension to be used for style files. ### tags +Alias(es): t + Type: `string` Add tags to the library (used for linting) diff --git a/packages/react/src/schematics/application/schema.json b/packages/react/src/schematics/application/schema.json index 64230c882ed43..0d4645ac77338 100644 --- a/packages/react/src/schematics/application/schema.json +++ b/packages/react/src/schematics/application/schema.json @@ -15,12 +15,14 @@ }, "directory": { "description": "The directory of the new application.", - "type": "string" + "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", @@ -84,16 +86,19 @@ }, "tags": { "type": "string", - "description": "Add tags to the application (used for linting)" + "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 }, "babel": { diff --git a/packages/react/src/schematics/library/schema.json b/packages/react/src/schematics/library/schema.json index 124658ba056ce..e9ee408072199 100644 --- a/packages/react/src/schematics/library/schema.json +++ b/packages/react/src/schematics/library/schema.json @@ -15,12 +15,14 @@ }, "directory": { "type": "string", - "description": "A directory where the app is placed" + "description": "A directory where the app is placed", + "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", @@ -63,7 +65,8 @@ }, "tags": { "type": "string", - "description": "Add tags to the library (used for linting)" + "description": "Add tags to the library (used for linting)", + "alias": "t" }, "skipFormat": { "description": "Skip formatting files", @@ -77,7 +80,8 @@ }, "pascalCaseFiles": { "type": "boolean", - "description": "Use pascal case component file name (e.g. App.tsx)®", + "description": "Use pascal case component file name (e.g. App.tsx)", + "alias": "P", "default": false }, "routing": { @@ -86,7 +90,8 @@ }, "appProject": { "type": "string", - "description": "The application project to add the library route to" + "description": "The application project to add the library route to", + "alias": "a" } }, "required": ["name"]