Skip to content

Commit

Permalink
fix: add license and fix addHeader script.
Browse files Browse the repository at this point in the history
  • Loading branch information
100pah committed Nov 10, 2020
1 parent aa0bb8d commit ff95252
Show file tree
Hide file tree
Showing 16 changed files with 285 additions and 17 deletions.
18 changes: 18 additions & 0 deletions .asf.yaml
Original file line number Diff line number Diff line change
@@ -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/
Expand Down
18 changes: 18 additions & 0 deletions .eslintrc-common.yaml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
4 changes: 4 additions & 0 deletions .headerignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,7 @@ test/lib/countup\.js
.+\.gif
.+\.GIF
.+\.class
types
lib
esm
dist
18 changes: 18 additions & 0 deletions .lgtm.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 5 additions & 5 deletions build/addHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 {
Expand All @@ -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 {
Expand All @@ -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 {
Expand Down
20 changes: 20 additions & 0 deletions build/build-i18n.js
Original file line number Diff line number Diff line change
@@ -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');
Expand Down
20 changes: 20 additions & 0 deletions build/dev-fast.js
Original file line number Diff line number Diff line change
@@ -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');
Expand Down
40 changes: 28 additions & 12 deletions build/preamble.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ function addPreamble(fileStr, fileExt) {

const addFns = {

ts: function (headStr, fileStr) {
return headStr + fileStr;
},

js: function (headStr, fileStr) {
return headStr + fileStr;
},
Expand All @@ -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.
Expand All @@ -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);
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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');
}
Expand Down
20 changes: 20 additions & 0 deletions build/testDts.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
18 changes: 18 additions & 0 deletions extension-src/.eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
18 changes: 18 additions & 0 deletions src/.eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
20 changes: 20 additions & 0 deletions src/chart/helper/enableAriaDecalForTree.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
20 changes: 20 additions & 0 deletions src/util/decal.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
20 changes: 20 additions & 0 deletions src/util/states.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Loading

0 comments on commit ff95252

Please sign in to comment.