From 3c662c2ae256cd5a8e9a5c69b170e6349dda2f9b Mon Sep 17 00:00:00 2001 From: Katerina Skroumpelou Date: Mon, 28 Mar 2022 19:32:06 +0300 Subject: [PATCH] docs(nxdev): added some presets (#9552) --- docs/generated/packages/storybook.json | 77 +++++++++++++++---- .../src/executors/build-storybook/schema.json | 35 +++++++-- .../src/executors/storybook/schema.json | 35 +++++++-- 3 files changed, 121 insertions(+), 26 deletions(-) diff --git a/docs/generated/packages/storybook.json b/docs/generated/packages/storybook.json index e39a05928fb56..b92fb3a8e0858 100644 --- a/docs/generated/packages/storybook.json +++ b/docs/generated/packages/storybook.json @@ -206,6 +206,23 @@ "cli": "nx", "description": "Serve up storybook in development mode.", "type": "object", + "presets": [ + { + "name": "Default minimum setup", + "keys": ["uiFramework", "port", "projectBuildConfig", "config"] + }, + { + "name": "Angular setup with styles", + "keys": [ + "uiFramework", + "port", + "projectBuildConfig", + "config", + "styles", + "stylePreprocessorOptions" + ] + } + ], "properties": { "uiFramework": { "type": "string", @@ -262,7 +279,7 @@ }, "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.", + "description": "Global styles to be included in the build. This is for Angular projects only. It will be ignored in non-Angular projects.", "items": { "oneOf": [ { @@ -290,10 +307,16 @@ ] } }, - "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" } + "stylePreprocessorOptions": { + "type": "object", + "description": "Options to pass to style preprocessors.", + "properties": { + "includePaths": { + "type": "array", + "description": "The paths to include. Paths will be resolved to workspace root. This is for Angular projects only. It will be ignored in non-Angular projects.", + "items": { "type": "string" } + } + } }, "config": { "type": "object", @@ -356,8 +379,7 @@ ] } }, - "required": ["uiFramework", "config"], - "presets": [] + "required": ["uiFramework", "config"] }, "description": "Serve Storybook.", "aliases": [], @@ -372,6 +394,28 @@ "cli": "nx", "description": "Build storybook in production mode.", "type": "object", + "presets": [ + { + "name": "Default minimum setup", + "keys": [ + "uiFramework", + "outputPath", + "projectBuildConfig", + "config" + ] + }, + { + "name": "Angular setup with styles", + "keys": [ + "uiFramework", + "outputPath", + "projectBuildConfig", + "config", + "styles", + "stylePreprocessorOptions" + ] + } + ], "properties": { "uiFramework": { "type": "string", @@ -389,7 +433,7 @@ }, "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.", + "description": "Global styles to be included in the build. This is for Angular projects only. It will be ignored in non-Angular projects.", "items": { "oneOf": [ { @@ -417,10 +461,16 @@ ] } }, - "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" } + "stylePreprocessorOptions": { + "type": "object", + "description": "Options to pass to style preprocessors.", + "properties": { + "includePaths": { + "type": "array", + "description": "The paths to include. Paths will be resolved to workspace root. This is for Angular projects only. It will be ignored in non-Angular projects.", + "items": { "type": "string" } + } + } }, "config": { "type": "object", @@ -483,8 +533,7 @@ ] } }, - "required": ["uiFramework", "config"], - "presets": [] + "required": ["uiFramework", "config"] }, "description": "Build Storybook.", "aliases": [], diff --git a/packages/storybook/src/executors/build-storybook/schema.json b/packages/storybook/src/executors/build-storybook/schema.json index 5becea5031342..5481bff1daecd 100644 --- a/packages/storybook/src/executors/build-storybook/schema.json +++ b/packages/storybook/src/executors/build-storybook/schema.json @@ -3,6 +3,23 @@ "cli": "nx", "description": "Build storybook in production mode.", "type": "object", + "presets": [ + { + "name": "Default minimum setup", + "keys": ["uiFramework", "outputPath", "projectBuildConfig", "config"] + }, + { + "name": "Angular setup with styles", + "keys": [ + "uiFramework", + "outputPath", + "projectBuildConfig", + "config", + "styles", + "stylePreprocessorOptions" + ] + } + ], "properties": { "uiFramework": { "type": "string", @@ -20,16 +37,22 @@ }, "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.", + "description": "Global styles to be included in the build. This is for Angular projects only. It will be ignored in non-Angular projects.", "items": { "$ref": "#/definitions/extraEntryPoint" } }, - "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" + "stylePreprocessorOptions": { + "type": "object", + "description": "Options to pass to style preprocessors.", + "properties": { + "includePaths": { + "type": "array", + "description": "The paths to include. Paths will be resolved to workspace root. This is for Angular projects only. It will be ignored in non-Angular projects.", + "items": { + "type": "string" + } + } } }, "config": { diff --git a/packages/storybook/src/executors/storybook/schema.json b/packages/storybook/src/executors/storybook/schema.json index 28dca0098d351..8fa935af5caff 100644 --- a/packages/storybook/src/executors/storybook/schema.json +++ b/packages/storybook/src/executors/storybook/schema.json @@ -3,6 +3,23 @@ "cli": "nx", "description": "Serve up storybook in development mode.", "type": "object", + "presets": [ + { + "name": "Default minimum setup", + "keys": ["uiFramework", "port", "projectBuildConfig", "config"] + }, + { + "name": "Angular setup with styles", + "keys": [ + "uiFramework", + "port", + "projectBuildConfig", + "config", + "styles", + "stylePreprocessorOptions" + ] + } + ], "properties": { "uiFramework": { "type": "string", @@ -61,16 +78,22 @@ }, "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.", + "description": "Global styles to be included in the build. This is for Angular projects only. It will be ignored in non-Angular projects.", "items": { "$ref": "#/definitions/extraEntryPoint" } }, - "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" + "stylePreprocessorOptions": { + "type": "object", + "description": "Options to pass to style preprocessors.", + "properties": { + "includePaths": { + "type": "array", + "description": "The paths to include. Paths will be resolved to workspace root. This is for Angular projects only. It will be ignored in non-Angular projects.", + "items": { + "type": "string" + } + } } }, "config": {