You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by su...@apache.org on 2020/01/02 13:57:12 UTC

[incubator-echarts-doc] branch release updated: fix build: add "npm run localsite" to built for local total site dev.

This is an automated email from the ASF dual-hosted git repository.

sushuang pushed a commit to branch release
in repository https://gitbox.apache.org/repos/asf/incubator-echarts-doc.git


The following commit(s) were added to refs/heads/release by this push:
     new ac585e3  fix build: add "npm run localsite" to built for local total site dev.
ac585e3 is described below

commit ac585e3b4e19cb853ca3306bd56158838715df67
Author: 100pah <su...@gmail.com>
AuthorDate: Thu Jan 2 21:52:52 2020 +0800

    fix build: add "npm run localsite" to built for local total site dev.
---
 README.md                               | 33 +++++++++---------------------
 build.js                                |  7 ++++---
 config/env.dev.js                       |  2 +-
 config/{env.dev.js => env.localsite.js} |  0
 package.json                            |  3 ++-
 release.sh                              | 36 ---------------------------------
 6 files changed, 17 insertions(+), 64 deletions(-)

diff --git a/README.md b/README.md
index 852051d..3e5d59d 100644
--- a/README.md
+++ b/README.md
@@ -11,9 +11,11 @@
     + [API](https://echarts.apache.org/zh/api.html)
     + [Chart Configuration](https://echarts.apache.org/zh/option.html)
 
-## Build and Run Locally
+## Development
 
-#### Start developing environment (one way):
+### Document content development
+
+Do not need other project.
 
 ```shell
 npm run dev
@@ -24,34 +26,19 @@ It will:
 + Watch doc site src change and rebuild.
 + Watch doc markdown change and rebuild.
 
-#### Start developing environment (another way):
+### Website development
+Need project `incubator-echarts-website`, `echarts-www`, `echarts-examples` existing on the same same directory with this project.
 
 ```shell
-npm run watch
-# It will not start a web server.
+npm run localsite
 ```
-It will:
-
-+ Only watch doc site src change and rebuild.
-
-The entry site will be in "/public/en/" and "/public/zh/".
+And then check the result in `incubator-echarts-website` with your own web server.
 
-#### Build doc markdown:
-
-```shell
-npm run build
-```
-
-#### Build doc site:
-
-```shell
-npm run build:site
-```
-
-#### Release:
+### Release
 
 Check `incubator-echarts-website/README.md` please.
 
+
 ## Tips about writing doc
 
 #### Global variables can be used in doc:
diff --git a/build.js b/build.js
index c6f7b9e..f65cc09 100644
--- a/build.js
+++ b/build.js
@@ -3,9 +3,10 @@
  * Usage:
  *
  * ```shell
- * node build.js --env dev
- * node build.js --env asf
- * node build.js --env echartsjs
+ * node build.js --env asf # build all for asf
+ * node build.js --env echartsjs # build all for echartsjs.
+ * node build.js --env localsite # build all for localsite.
+ * node build.js --env dev # the same as "debug", dev the content of docs.
  * # Check `./config` to see the available env
  * ```
  * ------------------------------------------------------------------------
diff --git a/config/env.dev.js b/config/env.dev.js
index fd043bd..74bc11d 100644
--- a/config/env.dev.js
+++ b/config/env.dev.js
@@ -10,6 +10,6 @@ module.exports = {
         imagePath: 'asset/gl/img/'
     },
 
-    releaseDestDir: path.resolve(__dirname, '../../incubator-echarts-website'),
+    releaseDestDir: path.resolve(__dirname, '../public'),
     ecWWWGeneratedDir: path.resolve(__dirname, '../../echarts-www/_generated')
 };
\ No newline at end of file
diff --git a/config/env.dev.js b/config/env.localsite.js
similarity index 100%
copy from config/env.dev.js
copy to config/env.localsite.js
diff --git a/package.json b/package.json
index 17898f3..1b9ccc0 100644
--- a/package.json
+++ b/package.json
@@ -12,7 +12,8 @@
     "build:site": "npx webpack --config build/webpack.config.js --mode production",
     "watch:site": "npx webpack --config build/webpack.config.js --mode development --devtool sourcemap --watch",
     "server": "node server.js",
-    "dev": "npx concurrently --kill-others \"npm run watch\" \"npm run watch:site\" \"npm run server\""
+    "dev": "npx concurrently --kill-others \"npm run watch\" \"npm run watch:site\" \"npm run server\"",
+    "localsite": "npm run build:site && node build.js --env localsite"
   },
   "author": "shenyi",
   "license": "BSD",
diff --git a/release.sh b/release.sh
deleted file mode 100644
index 64e5c27..0000000
--- a/release.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/bash
-
-# ------------------------------------------------------------------------
-# Usage:
-# sh release.sh --env asf
-# sh release.sh --env echartsjs
-# sh release.sh --env dev # the same as "debug"
-# # Check `./config` to see the available env
-# ------------------------------------------------------------------------
-
-while [[ $# -gt 0 ]]; do
-    case "$1" in
-        --env) envType="$2"; shift; shift ;;
-        --env=*) envType="${1#*=}"; shift ;;
-        *) shift ;;
-    esac
-done
-if [[ ! -n "${envType}" ]]; then
-    echo "--env must be specified."
-    exit 1;
-fi
-
-basepath=$(cd `dirname $0`; pwd)
-currPath=$(pwd)
-
-
-cd ${basepath}
-
-# Build doc site
-npm run build:site
-
-node ./build.js --env ${envType}
-
-cd ${currPath}
-# Do not rm, keep option3.json.
-


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org