Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/source-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ jobs:
index.d.ts
src/
extension-src/
dist/package.json
ssr/client/src/
ssr/client/dist/package.json
i18n/package.json
licenses/
theme/
build/
Expand Down
78 changes: 44 additions & 34 deletions .headerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Only support regexp, testing against each relative file path
# based on the echart base directory. And the pattern should
# match the relative path completely.
# Each line is a RegExp, testing against each relative file path;
# case-sensitive; based on the echarts base directory.
# And the pattern should match the relative path completely.
# A relative path to matching is like:
# types/src/i18n/langZH.d.ts
# dist
# (no prefix './'; no trailing '/' for a directory)

node_modules
.*\.git
Expand All @@ -18,41 +22,47 @@ node_modules
.*rat\.iml
__MAC_OS
.*README.md
CONTRIBUTING.md
.*MANIFEST\.txt
DISCLAIMER
NOTICE
KEYS
LICENSE
LICENSE-.+
licenses
map/js
map/json
benchmark/dep/*
test/ut/lib
test/runTest/tmp
test/data$
test/lib/esl\.js
test/lib/perlin\.js
test/lib/countup\.js
.*jquery\.min\.js
.*rollup\.browser\.js
.*configure
.+\.json
.+\.map
.+\.gexf
.+\.jar
.+\.bin
.+\.csv
.+\.png
.+\.PNG
.+\.jpg
.+\.JPG
.+\.jpeg
.+\.JPEG
.+\.gif
.+\.GIF
.+\.class
types
lib
esm
dist
^map/js$
^map/json$
^benchmark/dep/*
^test/ut/lib
^test/runTest/tmp
^test/data$
^test/lib$
^coverage$
^test/ut/coverage$
.*jquery\.min\.js$
.*rollup\.browser\.js$
.*configure$
.eslintignore
.+\.json$
.+\.map$
.+\.gexf$
.+\.jar$
.+\.bin$
.+\.csv$
.+\.png$
.+\.PNG$
.+\.jpg$
.+\.JPG$
.+\.jpeg$
.+\.JPEG$
.+\.gif$
.+\.GIF$
.+\.class$
^types$
^lib$
^ssr/client/lib$
^ssr/client/types$
^ssr/client/index.d.ts$
^ssr/client/index.js$
^dist$
^build/source-release/template$
15 changes: 11 additions & 4 deletions build/headerUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ const fs = require('fs');

// In the `.headerignore`, each line is a pattern in RegExp.
// all relative path (based on the echarts base directory) is tested.
// The pattern should match the relative path completely.
// The pattern should match the relative path completely. case-sensitive.
// A relative path to matching is like:
// types/src/i18n/langZH.d.ts
// dist
// (no prefix './'; no trailing '/' for a directory)

const excludesPath = pathTool.join(__dirname, '../.headerignore');
const ecBasePath = pathTool.join(__dirname, '../');

Expand All @@ -34,18 +39,20 @@ function eachFile(visit) {
travel('./');

function travel(relativePath) {
if (isExclude(relativePath)) {
const absolutePath = pathTool.join(ecBasePath, relativePath);

const relativePathForMatching = pathTool.relative(ecBasePath, absolutePath);
if (relativePathForMatching && isExclude(relativePathForMatching)) {
return;
}

const absolutePath = pathTool.join(ecBasePath, relativePath);
const stat = fs.statSync(absolutePath);

if (stat.isFile()) {
visit(absolutePath, getExt(absolutePath));
}
else if (stat.isDirectory()) {
fs.readdirSync(relativePath).forEach(function (file) {
fs.readdirSync(absolutePath).forEach(function (file) {
travel(pathTool.join(relativePath, file));
});
}
Expand Down
12 changes: 12 additions & 0 deletions build/preamble.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@ const addFns = {
return headStr + fileStr;
},

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

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

css: function (headStr, fileStr) {
return headStr + fileStr;
},
Expand Down Expand Up @@ -157,6 +165,8 @@ function xmlAddFn(headStr, fileStr) {
const preambleMap = {
ts: cStyleComment,
js: cStyleComment,
cjs: cStyleComment,
mjs: cStyleComment,
css: cStyleComment,
java: cStyleComment,
yml: hashComment,
Expand Down Expand Up @@ -195,6 +205,8 @@ const mlCommentReg = /<\!\-\-[\S\s]*?\-\->/;
const commentReg = {
ts: cStyleCommentReg,
js: cStyleCommentReg,
cjs: cStyleCommentReg,
mjs: cStyleCommentReg,
css: cStyleCommentReg,
java: cStyleCommentReg,
yml: hashCommentReg,
Expand Down
Loading