fix: make the build guide clear in README.md
diff --git a/README.md b/README.md
index d2c7314..7d84a7e 100644
--- a/README.md
+++ b/README.md
@@ -6,26 +6,10 @@
npm install
```
-## Dev
-```shell
-npm run dev
-```
+## Edit examples
-## Release
-
-```shell
-npm run release
-```
-
-It will copy all the build resources to echarts-website/next/examples
-
-## Use local echarts build
-
-1. Update the URL of localEChartsMinJS in `common/config.js`
-2. Add `local=1` in URL. For example: `editor.html?c=area-basic&local=1`
-
-## Edit example
+### How
All test cases are in the `public/examples/ts` folder. The comment in the header
@@ -58,9 +42,9 @@
npm run compile:example
```
-## Some built-in features available in examples
+### Some built-in features available in examples
-### Import third-party library
+#### Import third-party library
For example:
@@ -75,37 +59,37 @@
});
```
-### Controller panel
+#### Controller panel
Use this code to enable controller panel for a example:
```js
app.config = {
- aNameForTheSelectWidget: 'This is the initial value'
- aNameForTheRangeWidget: 45,
- aNameForTheButtonWidget: function () {
- // Do something.
- },
- onChange: function () {
- // Do something.
- }
+ aNameForTheSelectWidget: 'This is the initial value'
+ aNameForTheRangeWidget: 45,
+ aNameForTheButtonWidget: function () {
+ // Do something.
+ },
+ onChange: function () {
+ // Do something.
+ }
};
app.configParameters = {
- aNameForTheSelectWidget: {
- options: [
- 'This is the initial value',
- 'This is another value',
- 'This is the third value'
- ]
- },
- aNameForTheRangeWidget: {
- min: -90,
- max: 90
- }
+ aNameForTheSelectWidget: {
+ options: [
+ 'This is the initial value',
+ 'This is another value',
+ 'This is the third value'
+ ]
+ },
+ aNameForTheRangeWidget: {
+ min: -90,
+ max: 90
+ }
};
```
-### Resize
+#### Resize
```js
app.onresize = function () {
@@ -113,57 +97,76 @@
};
```
-### Get width and height of the chart area
+#### Get width and height of the chart area
```js
var width = myChart.getWidth();
var height = myChart.getHeight();
```
-## Update example snapshots
+
+## View and edit echarts-examples website
+
+### Dev and view examples in website
```shell
-npm run build:example
+npm run dev
```
-Only for default theme
+### Use local echarts build
-```shell
-node tool/build-example.js -t default
-```
+1. Update the URL of `localEChartsDir` & `localEChartsGLJS` in `src/common/config.js`
+2. Add `local=1` in URL. For example:
+ + `editor.html?c=area-basic&local=1`
+
## Run e2e tests.
Run all the examples to test package publishing and install, module importing, minimal bundling and DTS correctness.
-Before run the tests. you need to update the examples.
+Before run the tests. you need to update the examples list.
```shell
-npm run build:example
+npm run build:examplelist
```
-Then run the tests.
+If puppeteer has not been installed:
+```shell
+npm i puppeteer
+```
+
+If you want to save the log:
+```shell
+exe_something > 1.log 2>&1
+```
+
+### Run e2e test using local dependent repos
+
+If you are testing a new version of echarts or zrender, which are not released in github yet, you need run e2e test with local dependent repos.
+
+Firstly, make sure the dependent repos listed in `dir` attributes in `echarts-examples/e2e/config.js` existing and having release built.
+
+Note: the commands below will execute `npm install` in these local directories.
```shell
+# run e2e using local dependent repos and webpack.
+npm run test:e2e:local
+# run e2e using local dependent repos and esbuild, which is much faster.
+npm run test:e2e:esbuild:local
+```
+
+### Run e2e test using remote dependent repos
+
+Note: the commands below will download the repos listed in `echarts-examples/e2e/config.js` to a temporary folder.
+
+```shell
+# run e2e using remote dependent repos and webpack.
npm run test:e2e
-```
-
-You can change the testing branch or local dir, which is available when add `--local` in `e2e/config.js`
-
-If you want to test with esbuild bundler. Which is much faster.
-
-```shell
+# run e2e using remote dependent repos and esbuild, which is much faster.
npm run test:e2e:esbuild
```
-If you want use the packages in your local folder which is still in developing. Please update the `dir` path in `test/config.js` for all packages first. Then run the script directly with `--local` arg.
-
-```shell
-node e2e/main.js --bundler esbuild -m --local
-node e2e/main.js --bundler webpack -m --local
-```
-
-#### Run partial tests.
+### Run partial tests.
> Note: This can only be used when you run the whole e2e test at least once.
@@ -178,3 +181,21 @@
```shell
node e2e/main.js --skip npm --tests bar3D*
```
+
+
+## Release
+
+1. Update example snapshots
+ ```shell
+ npm run build:example
+
+ # Node: If only build for default theme:
+ node tool/build-example.js -t default
+ ```
+2. Build and copy all the build resources to `echarts-website`
+ ```shell
+ npm run release
+
+ # Note: the config of the dir of echarts-website is in
+ # `echarts-examples/config/**`
+ ```