Skip to content

Commit ff95252

Browse files
committed
fix: add license and fix addHeader script.
1 parent aa0bb8d commit ff95252

16 files changed

+285
-17
lines changed

.asf.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
119
github:
220
description: A powerful, interactive charting and data visualization library for browser
321
homepage: https://echarts.apache.org/

.eslintrc-common.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
119
# Note:
220
# If eslint does not work in VSCode, please check:
321
# (1) Whether "@typescript-eslint/eslint-plugin" and "@typescript-eslint/parser"

.headerignore

+4
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,7 @@ test/lib/countup\.js
5050
.+\.gif
5151
.+\.GIF
5252
.+\.class
53+
types
54+
lib
55+
esm
56+
dist

.lgtm.yml

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
119
path_classifiers:
220
test:
321
- test

build/addHeader.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
const fs = require('fs');
2222
const preamble = require('./preamble');
2323
const pathTool = require('path');
24-
const {color} = require('zrender/build/helper');
24+
const chalk = require('chalk');
2525

2626
// In the `.headerignore`, each line is a pattern in RegExp.
2727
// all relative path (based on the echarts base directory) is tested.
@@ -88,11 +88,11 @@ function run() {
8888
if (passFiles.length) {
8989
if (isVerbose) {
9090
passFiles.forEach(function (path) {
91-
console.log(color('fgGreen', 'dim')(path));
91+
console.log(chalk.green.dim(path));
9292
});
9393
}
9494
else {
95-
console.log(color('fgGreen', 'dim')(passFiles.length + ' files. (use argument "--verbose" see details)'));
95+
console.log(chalk.green.dim(passFiles.length + ' files. (use argument "--verbose" see details)'));
9696
}
9797
}
9898
else {
@@ -105,7 +105,7 @@ function run() {
105105
console.log('--------------------');
106106
if (updatedFiles.length) {
107107
updatedFiles.forEach(function (path) {
108-
console.log(color('fgGreen', 'bright')(path));
108+
console.log(chalk.green.bright(path));
109109
});
110110
}
111111
else {
@@ -118,7 +118,7 @@ function run() {
118118
console.log('----------------');
119119
if (pendingFiles.length) {
120120
pendingFiles.forEach(function (path) {
121-
console.log(color('fgRed', 'dim')(path));
121+
console.log(chalk.red.dim(path));
122122
});
123123
}
124124
else {

build/build-i18n.js

+20
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
2+
/*
3+
* Licensed to the Apache Software Foundation (ASF) under one
4+
* or more contributor license agreements. See the NOTICE file
5+
* distributed with this work for additional information
6+
* regarding copyright ownership. The ASF licenses this file
7+
* to you under the Apache License, Version 2.0 (the
8+
* "License"); you may not use this file except in compliance
9+
* with the License. You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing,
14+
* software distributed under the License is distributed on an
15+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
* KIND, either express or implied. See the License for the
17+
* specific language governing permissions and limitations
18+
* under the License.
19+
*/
20+
121
const fs = require('fs');
222
const preamble = require('./preamble');
323
const ts = require('typescript');

build/dev-fast.js

+20
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
2+
/*
3+
* Licensed to the Apache Software Foundation (ASF) under one
4+
* or more contributor license agreements. See the NOTICE file
5+
* distributed with this work for additional information
6+
* regarding copyright ownership. The ASF licenses this file
7+
* to you under the Apache License, Version 2.0 (the
8+
* "License"); you may not use this file except in compliance
9+
* with the License. You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing,
14+
* software distributed under the License is distributed on an
15+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
* KIND, either express or implied. See the License for the
17+
* specific language governing permissions and limitations
18+
* under the License.
19+
*/
20+
121
const chokidar = require('chokidar');
222
const path = require('path');
323
const {build} = require('esbuild');

build/preamble.js

+28-12
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ function addPreamble(fileStr, fileExt) {
9595

9696
const addFns = {
9797

98+
ts: function (headStr, fileStr) {
99+
return headStr + fileStr;
100+
},
101+
98102
js: function (headStr, fileStr) {
99103
return headStr + fileStr;
100104
},
@@ -107,17 +111,11 @@ const addFns = {
107111
return headStr + fileStr;
108112
},
109113

110-
sh: function (headStr, fileStr) {
111-
// Git diff enables manual check.
112-
if (/^#\!/.test(fileStr)) {
113-
const lines = fileStr.split('\n');
114-
lines.splice(1, 0, headStr);
115-
return lines.join('\n');
116-
}
117-
else {
118-
return headStr + fileStr;
119-
}
120-
},
114+
yml: addShellLikeHeader,
115+
116+
yaml: addShellLikeHeader,
117+
118+
sh: addShellLikeHeader,
121119

122120
html: function (headStr, fileStr) {
123121
// Git diff enables manual check.
@@ -134,6 +132,18 @@ const addFns = {
134132
xsl: xmlAddFn
135133
};
136134

135+
function addShellLikeHeader(headStr, fileStr) {
136+
// Git diff enables manual check.
137+
if (/^#\!/.test(fileStr)) {
138+
const lines = fileStr.split('\n');
139+
lines.splice(1, 0, headStr);
140+
return lines.join('\n');
141+
}
142+
else {
143+
return headStr + fileStr;
144+
}
145+
}
146+
137147
function xmlAddFn(headStr, fileStr) {
138148
// Git diff enables manual check.
139149
let resultStr = fileStr.replace(/^\s*<\?xml\s[^<>]+\?>/i, '$&' + headStr);
@@ -145,9 +155,12 @@ function xmlAddFn(headStr, fileStr) {
145155
}
146156

147157
const preambleMap = {
158+
ts: cStyleComment,
148159
js: cStyleComment,
149160
css: cStyleComment,
150161
java: cStyleComment,
162+
yml: hashComment,
163+
yaml: hashComment,
151164
sh: hashComment,
152165
html: mlComment,
153166
xml: mlComment,
@@ -180,9 +193,12 @@ const cStyleCommentReg = /\/\*[\S\s]*?\*\//;
180193
const hashCommentReg = /^\s*#.*$/gm;
181194
const mlCommentReg = /<\!\-\-[\S\s]*?\-\->/;
182195
const commentReg = {
196+
ts: cStyleCommentReg,
183197
js: cStyleCommentReg,
184198
css: cStyleCommentReg,
185199
java: cStyleCommentReg,
200+
yml: hashCommentReg,
201+
yaml: hashCommentReg,
186202
sh: hashCommentReg,
187203
html: mlCommentReg,
188204
xml: mlCommentReg,
@@ -198,7 +214,7 @@ function extractComment(str, fileExt) {
198214

199215
reg.lastIndex = 0;
200216

201-
if (fileExt === 'sh') {
217+
if (fileExt === 'sh' || fileExt === 'yml' || fileExt === 'yaml') {
202218
let result = str.match(reg);
203219
return result && result.join('\n');
204220
}

build/testDts.js

+20
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
2+
/*
3+
* Licensed to the Apache Software Foundation (ASF) under one
4+
* or more contributor license agreements. See the NOTICE file
5+
* distributed with this work for additional information
6+
* regarding copyright ownership. The ASF licenses this file
7+
* to you under the Apache License, Version 2.0 (the
8+
* "License"); you may not use this file except in compliance
9+
* with the License. You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing,
14+
* software distributed under the License is distributed on an
15+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
* KIND, either express or implied. See the License for the
17+
* specific language governing permissions and limitations
18+
* under the License.
19+
*/
20+
121
const { TypeScriptVersion } = require('@definitelytyped/typescript-versions');
222
const {
323
cleanTypeScriptInstalls,

extension-src/.eslintrc.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
119
# Note:
220
# If eslint does not work in VSCode, please check:
321
# (1) Whether "@typescript-eslint/eslint-plugin" and "@typescript-eslint/parser"

src/.eslintrc.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
119
# Note:
220
# If eslint does not work in VSCode, please check:
321
# (1) Whether "@typescript-eslint/eslint-plugin" and "@typescript-eslint/parser"

src/chart/helper/enableAriaDecalForTree.ts

+20
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
2+
/*
3+
* Licensed to the Apache Software Foundation (ASF) under one
4+
* or more contributor license agreements. See the NOTICE file
5+
* distributed with this work for additional information
6+
* regarding copyright ownership. The ASF licenses this file
7+
* to you under the Apache License, Version 2.0 (the
8+
* "License"); you may not use this file except in compliance
9+
* with the License. You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing,
14+
* software distributed under the License is distributed on an
15+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
* KIND, either express or implied. See the License for the
17+
* specific language governing permissions and limitations
18+
* under the License.
19+
*/
20+
121
import SeriesModel from '../../model/Series';
222
import {Dictionary, DecalObject} from '../../util/types';
323
import { getDecalFromPalette } from '../../model/mixin/palette';

src/util/decal.ts

+20
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
2+
/*
3+
* Licensed to the Apache Software Foundation (ASF) under one
4+
* or more contributor license agreements. See the NOTICE file
5+
* distributed with this work for additional information
6+
* regarding copyright ownership. The ASF licenses this file
7+
* to you under the Apache License, Version 2.0 (the
8+
* "License"); you may not use this file except in compliance
9+
* with the License. You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing,
14+
* software distributed under the License is distributed on an
15+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
* KIND, either express or implied. See the License for the
17+
* specific language governing permissions and limitations
18+
* under the License.
19+
*/
20+
121
import WeakMap from 'zrender/src/core/WeakMap';
222
import { PatternObject } from 'zrender/src/graphic/Pattern';
323
import LRU from 'zrender/src/core/LRU';

src/util/states.ts

+20
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
2+
/*
3+
* Licensed to the Apache Software Foundation (ASF) under one
4+
* or more contributor license agreements. See the NOTICE file
5+
* distributed with this work for additional information
6+
* regarding copyright ownership. The ASF licenses this file
7+
* to you under the Apache License, Version 2.0 (the
8+
* "License"); you may not use this file except in compliance
9+
* with the License. You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing,
14+
* software distributed under the License is distributed on an
15+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
* KIND, either express or implied. See the License for the
17+
* specific language governing permissions and limitations
18+
* under the License.
19+
*/
20+
121
import { Dictionary } from 'zrender/src/core/types';
222
import LRU from 'zrender/src/core/LRU';
323
import Displayable, { DisplayableState } from 'zrender/src/graphic/Displayable';

0 commit comments

Comments
 (0)