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
22 changes: 14 additions & 8 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,28 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}

- name: npm install
run: |
npm install
npm install git+https://github.com/ecomfe/zrender.git
- name: build zrender
run: |
cd node_modules/zrender
npm install
npm run prepublish
cd ../..
npm ci
- name: check type
run: |
npm run checktype
- name: build release
run: |
npm run release
- name: test generated DTS
run: |
npm run test:dts

# test:
# runs-on: ubuntu-latest
Expand Down
24 changes: 3 additions & 21 deletions build/pre-publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ async function runTsCompile(localTs, compilerOptions, srcPathList) {
console.log(chalk.red(localTs.flattenDiagnosticMessageText(diagnostic.messageText, '\n')));
}
});
assert(!emitResult.emitSkipped, 'ts compile failed.');
if (allDiagnostics.length > 0) {
throw new Error('TypeScript Compile Failed')
}
}
module.exports.runTsCompile = runTsCompile;

Expand Down Expand Up @@ -270,26 +272,6 @@ async function transformDistributionFiles(rooltFolder, replacement) {
}
}

/**
* Remove __esModule mark.
*
* In the 4.x version. The exported CJS don't have __esModule mark.
* Developers can use `import echarts from 'echarts/lib/echarts' instead of
* `import * as echarts from 'echarts/lib/echarts'` to import all the exported methods.
* It's not recommand but developers may still have the chance to do it.
* But in the tsc export with __esModule mark. This will get an undefined export.
* To avoid breaking this kind of code. We remove __esModule mark manually here.
*/
function removeESmoduleMark() {
const filePath = nodePath.resolve(ecDir, 'lib/echarts.js');
const code = fs.readFileSync(filePath, 'utf-8')
.replace('\nexports.__esModule = true;\n', '');
if (code.indexOf('__esModule') >= 0) {
throw new Error('Seems still has __esModule mark');
}
fs.writeFileSync(filePath, code, 'utf-8');
}

function singleTransformZRRootFolder(code, replacement) {
return code.replace(/([\"\'])zrender\/src\//g, `$1zrender/${replacement}/`);
}
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"@types/jest": "^26.0.14",
"@typescript-eslint/eslint-plugin": "^4.9.1",
"@typescript-eslint/parser": "^4.9.1",
"canvas": "^2.6.0",
"chalk": "^3.0.0",
"commander": "2.11.0",
"dtslint": "^4.0.5",
Expand Down
1 change: 0 additions & 1 deletion src/chart/helper/EffectSymbol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,5 @@ class EffectSymbol extends Group {
};

}
zrUtil.inherits(EffectSymbol, Group);

export default EffectSymbol;
26 changes: 13 additions & 13 deletions src/chart/pie/PieView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,19 +191,19 @@ class PiePiece extends graphic.Sector {
const labelPosition = seriesModel.get(['label', 'position']);
if (labelPosition !== 'outside' && labelPosition !== 'outer') {
sector.removeTextGuideLine();
return;
} else {
let polyline = this.getTextGuideLine();
if (!polyline) {
polyline = new graphic.Polyline();
this.setTextGuideLine(polyline);
}

// Default use item visual color
setLabelLineStyle(this, getLabelLineStatesModels(itemModel), {
stroke: visualColor,
opacity: retrieve3(labelLineModel.get(['lineStyle', 'opacity']), visualOpacity, 1)
});
}
else {
let polyline = this.getTextGuideLine();
if (!polyline) {
polyline = new graphic.Polyline();
this.setTextGuideLine(polyline);
}

// Default use item visual color
setLabelLineStyle(this, getLabelLineStatesModels(itemModel), {
stroke: visualColor,
opacity: retrieve3(labelLineModel.get(['lineStyle', 'opacity']), visualOpacity, 1)
});
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/util/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1355,8 +1355,6 @@ export type ComponentItemTooltipLabelFormatterParams = {
name: string
// properies key array like ['name']
$vars: string[]
} & {
[key in `${ComponentMainType}Index`]: number
} & {
// Other properties
[key in string]: unknown
Expand Down
10 changes: 1 addition & 9 deletions test/ut/core/setup.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions test/ut/index.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions test/ut/jest.config.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 2 additions & 10 deletions test/ut/tsconfig.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.