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/11/10 18:04:55 UTC

[incubator-echarts] 01/01: fix: add license and fix addHeader script.

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

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

commit ff952528ba0ed73dd785b584a6ec89a654511860
Author: 100pah <su...@gmail.com>
AuthorDate: Wed Nov 11 02:04:15 2020 +0800

    fix: add license and fix addHeader script.
---
 .asf.yaml                                  | 18 ++++++++++++++
 .eslintrc-common.yaml                      | 18 ++++++++++++++
 .headerignore                              |  4 +++
 .lgtm.yml                                  | 18 ++++++++++++++
 build/addHeader.js                         | 10 ++++----
 build/build-i18n.js                        | 20 +++++++++++++++
 build/dev-fast.js                          | 20 +++++++++++++++
 build/preamble.js                          | 40 +++++++++++++++++++++---------
 build/testDts.js                           | 20 +++++++++++++++
 extension-src/.eslintrc.yaml               | 18 ++++++++++++++
 src/.eslintrc.yaml                         | 18 ++++++++++++++
 src/chart/helper/enableAriaDecalForTree.ts | 20 +++++++++++++++
 src/util/decal.ts                          | 20 +++++++++++++++
 src/util/states.ts                         | 20 +++++++++++++++
 test/custom-transition-texture.js          | 20 +++++++++++++++
 test/ut/.eslintrc.yaml                     | 18 ++++++++++++++
 16 files changed, 285 insertions(+), 17 deletions(-)

diff --git a/.asf.yaml b/.asf.yaml
index 41d26c8..a905078 100644
--- a/.asf.yaml
+++ b/.asf.yaml
@@ -1,3 +1,21 @@
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
 github:
   description: A powerful, interactive charting and data visualization library for browser
   homepage: https://echarts.apache.org/
diff --git a/.eslintrc-common.yaml b/.eslintrc-common.yaml
index 1c63140..e502508 100644
--- a/.eslintrc-common.yaml
+++ b/.eslintrc-common.yaml
@@ -1,3 +1,21 @@
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
 # Note:
 # If eslint does not work in VSCode, please check:
 # (1) Whether "@typescript-eslint/eslint-plugin" and "@typescript-eslint/parser"
diff --git a/.headerignore b/.headerignore
index 41d55d6..932a4e1 100644
--- a/.headerignore
+++ b/.headerignore
@@ -50,3 +50,7 @@ test/lib/countup\.js
 .+\.gif
 .+\.GIF
 .+\.class
+types
+lib
+esm
+dist
diff --git a/.lgtm.yml b/.lgtm.yml
index c9c1894..b6fe4a8 100644
--- a/.lgtm.yml
+++ b/.lgtm.yml
@@ -1,3 +1,21 @@
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
 path_classifiers:
   test:
     - test
diff --git a/build/addHeader.js b/build/addHeader.js
index 1599ffc..61d21e7 100644
--- a/build/addHeader.js
+++ b/build/addHeader.js
@@ -21,7 +21,7 @@
 const fs = require('fs');
 const preamble = require('./preamble');
 const pathTool = require('path');
-const {color} = require('zrender/build/helper');
+const chalk = require('chalk');
 
 // In the `.headerignore`, each line is a pattern in RegExp.
 // all relative path (based on the echarts base directory) is tested.
@@ -88,11 +88,11 @@ function run() {
     if (passFiles.length) {
         if (isVerbose) {
             passFiles.forEach(function (path) {
-                console.log(color('fgGreen', 'dim')(path));
+                console.log(chalk.green.dim(path));
             });
         }
         else {
-            console.log(color('fgGreen', 'dim')(passFiles.length + ' files. (use argument "--verbose" see details)'));
+            console.log(chalk.green.dim(passFiles.length + ' files. (use argument "--verbose" see details)'));
         }
     }
     else {
@@ -105,7 +105,7 @@ function run() {
     console.log('--------------------');
     if (updatedFiles.length) {
         updatedFiles.forEach(function (path) {
-            console.log(color('fgGreen', 'bright')(path));
+            console.log(chalk.green.bright(path));
         });
     }
     else {
@@ -118,7 +118,7 @@ function run() {
     console.log('----------------');
     if (pendingFiles.length) {
         pendingFiles.forEach(function (path) {
-            console.log(color('fgRed', 'dim')(path));
+            console.log(chalk.red.dim(path));
         });
     }
     else {
diff --git a/build/build-i18n.js b/build/build-i18n.js
index 57c2f56..6932c74 100644
--- a/build/build-i18n.js
+++ b/build/build-i18n.js
@@ -1,3 +1,23 @@
+
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
 const fs = require('fs');
 const preamble = require('./preamble');
 const ts = require('typescript');
diff --git a/build/dev-fast.js b/build/dev-fast.js
index b609ef4..84a6132 100644
--- a/build/dev-fast.js
+++ b/build/dev-fast.js
@@ -1,3 +1,23 @@
+
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
 const chokidar = require('chokidar');
 const path = require('path');
 const {build} = require('esbuild');
diff --git a/build/preamble.js b/build/preamble.js
index c58af71..d1bd0d2 100644
--- a/build/preamble.js
+++ b/build/preamble.js
@@ -95,6 +95,10 @@ function addPreamble(fileStr, fileExt) {
 
 const addFns = {
 
+    ts: function (headStr, fileStr) {
+        return headStr + fileStr;
+    },
+
     js: function (headStr, fileStr) {
         return headStr + fileStr;
     },
@@ -107,17 +111,11 @@ const addFns = {
         return headStr + fileStr;
     },
 
-    sh: function (headStr, fileStr) {
-        // Git diff enables manual check.
-        if (/^#\!/.test(fileStr)) {
-            const lines = fileStr.split('\n');
-            lines.splice(1, 0, headStr);
-            return lines.join('\n');
-        }
-        else {
-            return headStr + fileStr;
-        }
-    },
+    yml: addShellLikeHeader,
+
+    yaml: addShellLikeHeader,
+
+    sh: addShellLikeHeader,
 
     html: function (headStr, fileStr) {
         // Git diff enables manual check.
@@ -134,6 +132,18 @@ const addFns = {
     xsl: xmlAddFn
 };
 
+function addShellLikeHeader(headStr, fileStr) {
+    // Git diff enables manual check.
+    if (/^#\!/.test(fileStr)) {
+        const lines = fileStr.split('\n');
+        lines.splice(1, 0, headStr);
+        return lines.join('\n');
+    }
+    else {
+        return headStr + fileStr;
+    }
+}
+
 function xmlAddFn(headStr, fileStr) {
     // Git diff enables manual check.
     let resultStr = fileStr.replace(/^\s*<\?xml\s[^<>]+\?>/i, '$&' + headStr);
@@ -145,9 +155,12 @@ function xmlAddFn(headStr, fileStr) {
 }
 
 const preambleMap = {
+    ts: cStyleComment,
     js: cStyleComment,
     css: cStyleComment,
     java: cStyleComment,
+    yml: hashComment,
+    yaml: hashComment,
     sh: hashComment,
     html: mlComment,
     xml: mlComment,
@@ -180,9 +193,12 @@ const cStyleCommentReg = /\/\*[\S\s]*?\*\//;
 const hashCommentReg = /^\s*#.*$/gm;
 const mlCommentReg = /<\!\-\-[\S\s]*?\-\->/;
 const commentReg = {
+    ts: cStyleCommentReg,
     js: cStyleCommentReg,
     css: cStyleCommentReg,
     java: cStyleCommentReg,
+    yml: hashCommentReg,
+    yaml: hashCommentReg,
     sh: hashCommentReg,
     html: mlCommentReg,
     xml: mlCommentReg,
@@ -198,7 +214,7 @@ function extractComment(str, fileExt) {
 
     reg.lastIndex = 0;
 
-    if (fileExt === 'sh') {
+    if (fileExt === 'sh' || fileExt === 'yml' || fileExt === 'yaml') {
         let result = str.match(reg);
         return result && result.join('\n');
     }
diff --git a/build/testDts.js b/build/testDts.js
index 6b00f99..fdf1d1f 100644
--- a/build/testDts.js
+++ b/build/testDts.js
@@ -1,3 +1,23 @@
+
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
 const { TypeScriptVersion } = require('@definitelytyped/typescript-versions');
 const {
     cleanTypeScriptInstalls,
diff --git a/extension-src/.eslintrc.yaml b/extension-src/.eslintrc.yaml
index 55b3af0..87f2639 100644
--- a/extension-src/.eslintrc.yaml
+++ b/extension-src/.eslintrc.yaml
@@ -1,3 +1,21 @@
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
 # Note:
 # If eslint does not work in VSCode, please check:
 # (1) Whether "@typescript-eslint/eslint-plugin" and "@typescript-eslint/parser"
diff --git a/src/.eslintrc.yaml b/src/.eslintrc.yaml
index 55b3af0..87f2639 100644
--- a/src/.eslintrc.yaml
+++ b/src/.eslintrc.yaml
@@ -1,3 +1,21 @@
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
 # Note:
 # If eslint does not work in VSCode, please check:
 # (1) Whether "@typescript-eslint/eslint-plugin" and "@typescript-eslint/parser"
diff --git a/src/chart/helper/enableAriaDecalForTree.ts b/src/chart/helper/enableAriaDecalForTree.ts
index 520a089..09bbd55 100644
--- a/src/chart/helper/enableAriaDecalForTree.ts
+++ b/src/chart/helper/enableAriaDecalForTree.ts
@@ -1,3 +1,23 @@
+
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
 import SeriesModel from '../../model/Series';
 import {Dictionary, DecalObject} from '../../util/types';
 import { getDecalFromPalette } from '../../model/mixin/palette';
diff --git a/src/util/decal.ts b/src/util/decal.ts
index 5d2d971..f3cfa3a 100644
--- a/src/util/decal.ts
+++ b/src/util/decal.ts
@@ -1,3 +1,23 @@
+
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
 import WeakMap from 'zrender/src/core/WeakMap';
 import { PatternObject } from 'zrender/src/graphic/Pattern';
 import LRU from 'zrender/src/core/LRU';
diff --git a/src/util/states.ts b/src/util/states.ts
index 5af7ee6..779297b 100644
--- a/src/util/states.ts
+++ b/src/util/states.ts
@@ -1,3 +1,23 @@
+
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
 import { Dictionary } from 'zrender/src/core/types';
 import LRU from 'zrender/src/core/LRU';
 import Displayable, { DisplayableState } from 'zrender/src/graphic/Displayable';
diff --git a/test/custom-transition-texture.js b/test/custom-transition-texture.js
index 61f9d8f..a660774 100644
--- a/test/custom-transition-texture.js
+++ b/test/custom-transition-texture.js
@@ -1 +1,21 @@
+
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
 window.BAR_ROUND_GRADIENT_TEXTURE = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAgAElEQVR4Xu1debwUxbX+qudeLiLigktEDChClICCoOKSEBQiEteYEBV34xKNJmp88cUY4tNs5kUTNSbuiRpN0OeC4h4lxjXigqK4oKIibriggCx3ut6vZqYvNXVPVZ3q6Zk7997pf+BOd1dXnTrf+b5TXV0l0DiqZIELWoClXwHibQDZAuR7AfLLgPgCINcBZD9A5gAJQK5ZqkQM5CP1A4BWIG4CEAN4D4gjQL4HYC4QvwpgBRAtAOIPgOh5YM23gLNaq9SYblus6LYtz6zhP+8FrHEggH5ArJx+AoCBmvOXnqR8Xvl6ctj+n7dcY/tdlaPKVoApAOhpQM4C4nlA/t/An9/OrKndsKAGQII6fWoT0GcsEI0EVu0NYAcAzYAUJ [...]
\ No newline at end of file
diff --git a/test/ut/.eslintrc.yaml b/test/ut/.eslintrc.yaml
index d906da2..083d13f 100644
--- a/test/ut/.eslintrc.yaml
+++ b/test/ut/.eslintrc.yaml
@@ -1,3 +1,21 @@
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
 # Note:
 # If eslint does not work in VSCode, please check:
 # (1) Whether "@typescript-eslint/eslint-plugin" and "@typescript-eslint/parser"


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