From 564cf1ebf400a7a297ff13dfc6e5e096b91a48fc Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 14 Jul 2018 03:16:21 +0200 Subject: [PATCH] Setup deploy scripts --- .gitignore | 1 + docs/api/panels.md | 37 ++++++++++--------------------------- docs/deploy.sh | 32 ++++++++++++++++++++++++++++++++ package.json | 4 +++- 4 files changed, 46 insertions(+), 28 deletions(-) create mode 100755 docs/deploy.sh diff --git a/.gitignore b/.gitignore index 47c4cb71d..a68fe8236 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ node_modules/ bower_components/ grapesjs-*.tgz _index.html +docs/.vuepress/dist diff --git a/docs/api/panels.md b/docs/api/panels.md index 35ee37efd..5e8a69618 100644 --- a/docs/api/panels.md +++ b/docs/api/panels.md @@ -27,15 +27,6 @@ const panelManager = editor.Panels; - [getPanelsEl][8] - [removePanel][9] - [removeButton][10] -- [render][11] - -## init - -Initialize module. Automatically called with a new instance of the editor - -### Parameters - -- `config` **[Object][12]** Configurations ## getPanels @@ -47,7 +38,7 @@ Returns **Collection** Collection of panel Returns panels element -Returns **[HTMLElement][13]** +Returns **[HTMLElement][11]** ## addPanel @@ -75,7 +66,7 @@ Remove a panel from the collection ### Parameters -- `panel` **([Object][12] | Panel | [String][14])** Object with right properties or an instance of Panel or Painel id +- `panel` **([Object][12] | Panel | [String][13])** Object with right properties or an instance of Panel or Painel id ### Examples @@ -97,7 +88,7 @@ Get panel by ID ### Parameters -- `id` **[string][14]** Id string +- `id` **[string][13]** Id string ### Examples @@ -113,7 +104,7 @@ Add button to the panel ### Parameters -- `panelId` **[string][14]** Panel's ID +- `panelId` **[string][13]** Panel's ID - `button` **([Object][12] | Button)** Button object or instance of Button ### Examples @@ -152,8 +143,8 @@ Remove button from the panel ### Parameters -- `panelId` **[string][14]** Panel's ID -- `button` **([Object][12] | Button | [String][14])** Button object or instance of Button or button id +- `panelId` **[string][13]** Panel's ID +- `button` **([Object][12] | Button | [String][13])** Button object or instance of Button or button id ### Examples @@ -178,8 +169,8 @@ Get button from the panel ### Parameters -- `panelId` **[string][14]** Panel's ID -- `id` **[string][14]** Button's ID +- `panelId` **[string][13]** Panel's ID +- `id` **[string][13]** Button's ID ### Examples @@ -189,12 +180,6 @@ var button = panelManager.getButton('myPanel','myButton'); Returns **(Button | null)** -## render - -Render panels and buttons - -Returns **[HTMLElement][13]** - [1]: https://github.com/artf/grapesjs/blob/master/src/panels/config/config.js [2]: #addpanel @@ -215,10 +200,8 @@ Returns **[HTMLElement][13]** [10]: #removeButton -[11]: #render +[11]: https://developer.mozilla.org/docs/Web/HTML/Element [12]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object -[13]: https://developer.mozilla.org/docs/Web/HTML/Element - -[14]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String +[13]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String diff --git a/docs/deploy.sh b/docs/deploy.sh new file mode 100755 index 000000000..6c7278c65 --- /dev/null +++ b/docs/deploy.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env sh + +# abort on errors +set -e + +# build +npm run docs:build-vp + +# navigate into the build output directory +cd docs/.vuepress/dist + +# I need to deploy all the documentation inside docs folder +mkdir docs-new + +# move all the files from the current directory in docs +mv `\ls -1 ./ | grep -v docs-new` ./docs-new + +# fetch the current site, remove the old docs dir and make current the new one +git clone -b gh-pages https://github.com/artf/grapesjs.git +rm -fR docs +mv ./docs-new ./docs + +# stage all and commit +git add -A +git commit -m 'deploy docs' + +# git push -f git@github.com:artf/grapesjs.git master:gh-pages +# git push -f git@github.com:artf/grapesjs.git gh-pages + +surge --domain closed-harmony.surge.sh + +cd - diff --git a/package.json b/package.json index bd61b4934..e577d248b 100644 --- a/package.json +++ b/package.json @@ -92,7 +92,9 @@ "scripts": { "docs": "vuepress dev docs", "docs:api": "node docs/api.js", - "docs:build": "npm run docs:api && vuepress build docs", + "docs:build-vp": "vuepress build docs", + "docs:build": "npm run docs:api && npm run docs:build-vp", + "docs:deploy": "docs/deploy.sh", "lint": "eslint src", "check": "npm run lint && npm run test", "precommit": "lint-staged",