From 882496d30c85c509053d1892b6a68e4ec2225f23 Mon Sep 17 00:00:00 2001 From: Alan Date: Wed, 17 Jul 2019 11:36:56 +1000 Subject: [PATCH] [SDPA-2718] Update docs / new-component / package-dependencies scripts. (#412) * [SDPA-2718] Update generate-readme to work with storybook 5. * [SDPA-2718] Update package-dependencies script. * [SDPA-2718] Update new-package script. * [SDPA-2718] Fixes to new-component script. --- package.json | 5 +- src/package.json | 6 +- .../.npmignore | 0 .../LICENSE | 0 .../component_template.vue} | 8 +- .../generate-component/generate-component.js | 91 +++++++++++++++++++ .../generate-component/index_template.js | 4 + .../generate-component/package_template.json | 15 +++ .../generate-component/stories_template.js | 15 +++ .../generate-dependencies/dependency-utils.js | 14 +-- .../generate-dependencies.js | 7 +- .../generate-package/generate-package.js | 87 ------------------ .../generate-package/index_template.js | 4 - .../generate-package/package_template.json | 15 --- .../generate-package/stories_template.js | 16 ---- .../generate-readme/generate-readme.js | 54 ++++++++--- yarn.lock | 32 ++++++- 17 files changed, 221 insertions(+), 152 deletions(-) rename src/scripts/{generate-package => generate-component}/.npmignore (100%) rename src/scripts/{generate-package => generate-component}/LICENSE (100%) rename src/scripts/{generate-package/package_template.vue => generate-component/component_template.vue} (72%) create mode 100644 src/scripts/generate-component/generate-component.js create mode 100644 src/scripts/generate-component/index_template.js create mode 100644 src/scripts/generate-component/package_template.json create mode 100644 src/scripts/generate-component/stories_template.js delete mode 100644 src/scripts/generate-package/generate-package.js delete mode 100644 src/scripts/generate-package/index_template.js delete mode 100644 src/scripts/generate-package/package_template.json delete mode 100644 src/scripts/generate-package/stories_template.js diff --git a/package.json b/package.json index 0a12a7cda..9ad43a7a3 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,10 @@ "bay:destroy": "docker-compose down -v", "bay:logs": "docker-compose logs", "bay:cli": "docker exec -i $(docker-compose ps -q app)", - "bay:pull": "docker image ls --format \"{{.Repository}}:{{.Tag}}\" | grep amazeeio | grep -v none | xargs -n1 docker pull | cat" + "bay:pull": "docker image ls --format \"{{.Repository}}:{{.Tag}}\" | grep amazeeio | grep -v none | xargs -n1 docker pull | cat", + "docs:storybook": "cd src/ && yarn run docs", + "new-component:storybook": "cd src/ && yarn run new-component", + "package-dependencies:storybook": "cd src/ && yarn run package-dependencies" }, "devDependencies": { "@babel/core": "^7.5.0", diff --git a/src/package.json b/src/package.json index 9845dad55..76b825fa9 100644 --- a/src/package.json +++ b/src/package.json @@ -7,7 +7,10 @@ "scripts": { "start": "start-storybook -p 6006 -s ./static", "build-storybook": "cross-env NODE_ENV=production build-storybook -c .storybook -s ./static -o ./public", - "test:unit": "cross-env NODE_ENV=test jest --colors" + "test:unit": "cross-env NODE_ENV=test jest --colors", + "docs": "node ./scripts/generate-readme/generate-readme.js", + "new-component": "node ./scripts/generate-component/generate-component.js", + "package-dependencies": "node ./scripts/generate-dependencies/generate-dependencies.js" }, "dependencies": { "@dpc-sdp/ripple-accordion": "1.0.0-beta.8", @@ -76,6 +79,7 @@ "svg-sprite-loader": "^3.7.3", "svgo": "^1.2.2", "svgo-loader": "^2.2.1", + "twig": "^1.13.3", "url-loader": "^2.0.1", "vue-loader": "^15.7.0", "vue-style-loader": "^4.1.2", diff --git a/src/scripts/generate-package/.npmignore b/src/scripts/generate-component/.npmignore similarity index 100% rename from src/scripts/generate-package/.npmignore rename to src/scripts/generate-component/.npmignore diff --git a/src/scripts/generate-package/LICENSE b/src/scripts/generate-component/LICENSE similarity index 100% rename from src/scripts/generate-package/LICENSE rename to src/scripts/generate-component/LICENSE diff --git a/src/scripts/generate-package/package_template.vue b/src/scripts/generate-component/component_template.vue similarity index 72% rename from src/scripts/generate-package/package_template.vue rename to src/scripts/generate-component/component_template.vue index 082f06a9c..619a284ad 100644 --- a/src/scripts/generate-package/package_template.vue +++ b/src/scripts/generate-component/component_template.vue @@ -1,5 +1,7 @@