From 89591bd5594bc4a4b19bf88a9ccd5b0fce95605c Mon Sep 17 00:00:00 2001 From: Andreas Lordos Date: Mon, 9 Sep 2019 19:17:06 +0300 Subject: [PATCH] build: automate build & launch of storybook (#146) * build: automate build & launch of storybook - Added `build.py` in the `/packages/superset-ui-plugins-demo` directory - Running `build.py` will build & start storybook automatically - No need to run 4 separate commands to do so - Modified README.md to reflect this change and provide instructions on using `build.py` * build: delete build.py Get rid of build.py and transfer commands for automated building & launching to package.json * build: automate build & launch of storybook Use "sudo npm run build" to build & launch Storybook * docs: update readme Reflect changes in automated building & launching of Storybook, now uses command "npm run build" instead of "python build.py" * build: rename npm script rename npm script from "build" to "storybook" and update readme.md to reflect change * docs: amend error in docs documentation updated to reflect changes in package.json - command to run story * docs: change 'npm run' to 'yarn' replace 'npm run storybook' with 'yarn storybook' --- .../superset-ui/plugins/superset-ui-plugins/README.md | 6 ++++++ .../packages/superset-ui-plugins-demo/package.json | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/README.md b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/README.md index 21b40979cdbb..ab1a874a4872 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/README.md +++ b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/README.md @@ -106,6 +106,12 @@ You can demo your changes by running the storybook demo locally with the followi yarn install yarn build cd packages/superset-ui-plugins-demo +yarn storybook:run +``` + +Alternatively, you can demo your changes by using the following command while in `packages/superset-ui-plugins-demo`: + +```sh yarn storybook ``` diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-plugins-demo/package.json b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-plugins-demo/package.json index f53ec44e5baa..2ad28b48aa6b 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-plugins-demo/package.json +++ b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-plugins-demo/package.json @@ -9,7 +9,8 @@ "demo:build": "build-storybook -o _gh-pages", "demo:publish": "gh-pages -d _gh-pages", "deploy-demo": "npm run demo:clean && npm run demo:build && npm run demo:publish && npm run demo:clean", - "storybook": "start-storybook -p 9001" + "storybook:run": "start-storybook -p 9001", + "storybook": "cd ../../ && yarn build && cd - && yarn storybook:run" }, "repository": { "type": "git",