Skip to content

Commit 82f6264

Browse files
authored
Merge pull request #4609 from VisActor/release/2.1.2
Release/2.1.2
2 parents f12363c + ebf4b20 commit 82f6264

40 files changed

Lines changed: 622 additions & 325 deletions

.github/workflows/release.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,13 @@ jobs:
342342
with:
343343
path: packages/vchart
344344

345+
- name: BytePack CDN smoke test (release)
346+
if: startsWith(github.ref_name, 'release/')
347+
env:
348+
BYTEPACK_SMOKE_ATTEMPTS: 12
349+
BYTEPACK_SMOKE_DELAY_MS: 30000
350+
run: node --experimental-network-imports common/scripts/bytepack-smoke-test.mjs ${{ steps.package_version_release.outputs.current_version }}
351+
345352
- name: Commit & Push changes (release)
346353
if: startsWith(github.ref_name, 'release/')
347354
run: |
@@ -407,6 +414,13 @@ jobs:
407414
with:
408415
path: packages/vchart
409416

417+
- name: BytePack CDN smoke test (hotfix)
418+
if: startsWith(github.ref_name, 'hotfix/')
419+
env:
420+
BYTEPACK_SMOKE_ATTEMPTS: 12
421+
BYTEPACK_SMOKE_DELAY_MS: 30000
422+
run: node --experimental-network-imports common/scripts/bytepack-smoke-test.mjs ${{ steps.package_version_hotfix.outputs.current_version }}
423+
410424
- name: Commit & Push changes (hotfix)
411425
if: startsWith(github.ref_name, 'hotfix/')
412426
run: |
@@ -444,6 +458,13 @@ jobs:
444458
with:
445459
path: packages/vchart
446460

461+
- name: BytePack CDN smoke test (pre-release)
462+
if: startsWith(github.ref_name, 'pre-release/')
463+
env:
464+
BYTEPACK_SMOKE_ATTEMPTS: 12
465+
BYTEPACK_SMOKE_DELAY_MS: 30000
466+
run: node --experimental-network-imports common/scripts/bytepack-smoke-test.mjs ${{ steps.package_version_prerelease.outputs.current_version }}
467+
447468
- name: Commit & Push changes (pre-release)
448469
if: startsWith(github.ref_name, 'pre-release/')
449470
run: |

common/config/rush/pnpm-lock.yaml

Lines changed: 174 additions & 248 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
import { createRequire } from 'node:module';
2+
import path from 'node:path';
3+
import { fileURLToPath } from 'node:url';
4+
5+
const version = process.argv[2];
6+
7+
if (!version) {
8+
console.error('Usage: node --experimental-network-imports common/scripts/bytepack-smoke-test.mjs <version>');
9+
process.exit(1);
10+
}
11+
12+
const attempts = Number(process.env.BYTEPACK_SMOKE_ATTEMPTS || 10);
13+
const delayMs = Number(process.env.BYTEPACK_SMOKE_DELAY_MS || 30000);
14+
const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..');
15+
const requireFromVChart = createRequire(path.join(repoRoot, 'packages/vchart/package.json'));
16+
const Canvas = requireFromVChart('canvas');
17+
18+
const wait = ms => new Promise(resolve => setTimeout(resolve, ms));
19+
20+
async function runSmoke() {
21+
const vchartModule = await import(`https://bytepack.bytedance.net/@visactor/vchart@${version}`);
22+
const extensionModule = await import(
23+
`https://bytepack.bytedance.net/@visactor/vchart-extension@${version}/esm/charts/pie-3d/chart.js`
24+
);
25+
26+
extensionModule.registerPie3dChart();
27+
28+
const VChart = vchartModule.default ?? vchartModule.VChart;
29+
if (!VChart) {
30+
throw new Error('Unable to resolve VChart constructor from BytePack module.');
31+
}
32+
33+
const chart = new VChart(
34+
{
35+
type: 'pie3d',
36+
width: 240,
37+
height: 240,
38+
data: [
39+
{
40+
id: 'data',
41+
values: [
42+
{ category: 'A', value: 12 },
43+
{ category: 'B', value: 18 }
44+
]
45+
}
46+
],
47+
categoryField: 'category',
48+
valueField: 'value',
49+
outerRadius: 0.72
50+
},
51+
{
52+
mode: 'node',
53+
modeParams: Canvas,
54+
animation: false,
55+
options3d: {
56+
enable: true
57+
}
58+
}
59+
);
60+
61+
chart.renderSync();
62+
chart.release();
63+
}
64+
65+
let lastError;
66+
for (let attempt = 1; attempt <= attempts; attempt++) {
67+
try {
68+
console.log(`BytePack smoke test for @visactor/vchart@${version}, attempt ${attempt}/${attempts}`);
69+
await runSmoke();
70+
console.log(`BytePack smoke test passed for @visactor/vchart@${version}`);
71+
process.exit(0);
72+
} catch (err) {
73+
lastError = err;
74+
console.error(`BytePack smoke test failed on attempt ${attempt}/${attempts}:`);
75+
console.error(err && err.stack ? err.stack : err);
76+
77+
if (attempt < attempts) {
78+
await wait(delayMs);
79+
}
80+
}
81+
}
82+
83+
console.error(`BytePack smoke test failed after ${attempts} attempts.`);
84+
if (lastError) {
85+
console.error(lastError && lastError.stack ? lastError.stack : lastError);
86+
}
87+
process.exit(1);

docs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
"@visactor/vchart-theme": "~1.6.6",
2020
"@visactor/vmind": "1.2.4-alpha.5",
2121
"@visactor/vutils": "~1.0.23",
22-
"@visactor/vrender": "1.1.1",
23-
"@visactor/vrender-kits": "1.1.1",
22+
"@visactor/vrender": "^1.1.3",
23+
"@visactor/vrender-kits": "^1.1.3",
2424
"@visactor/vtable": "1.19.0-alpha.0",
2525
"@visactor/vtable-editors": "1.19.0-alpha.0",
2626
"@visactor/vtable-gantt": "1.19.0-alpha.0",

packages/openinula-vchart/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
"dependencies": {
3131
"@visactor/vchart": "workspace:2.1.1",
3232
"@visactor/vutils": "~1.0.23",
33-
"@visactor/vrender-core": "1.1.1",
34-
"@visactor/vrender-kits": "1.1.1",
33+
"@visactor/vrender-core": "^1.1.3",
34+
"@visactor/vrender-kits": "^1.1.3",
3535
"react-is": "^18.2.0"
3636
},
3737
"devDependencies": {

packages/react-vchart/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
"@visactor/vchart": "workspace:2.1.1",
3737
"@visactor/vchart-extension": "workspace:2.1.1",
3838
"@visactor/vutils": "~1.0.23",
39-
"@visactor/vrender-core": "1.1.1",
40-
"@visactor/vrender-kits": "1.1.1",
39+
"@visactor/vrender-core": "^1.1.3",
40+
"@visactor/vrender-kits": "^1.1.3",
4141
"react-is": "^18.2.0"
4242
},
4343
"devDependencies": {

packages/vchart-extension/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
"start": "ts-node __tests__/runtime/browser/scripts/initVite.ts && vite serve __tests__/runtime/browser"
2727
},
2828
"dependencies": {
29-
"@visactor/vrender-core": "1.1.1",
30-
"@visactor/vrender-kits": "1.1.1",
31-
"@visactor/vrender-components": "1.1.1",
32-
"@visactor/vrender-animate": "1.1.1",
29+
"@visactor/vrender-core": "^1.1.3",
30+
"@visactor/vrender-kits": "^1.1.3",
31+
"@visactor/vrender-components": "^1.1.3",
32+
"@visactor/vrender-animate": "^1.1.3",
3333
"@visactor/vchart": "workspace:2.1.1",
3434
"@visactor/vutils": "~1.0.23",
3535
"@visactor/vdataset": "~1.0.23",

packages/vchart-extension/src/charts/3d/arc-3d.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
import { registerArc3d, registerShadowRoot, createArc3d } from '@visactor/vchart';
2-
import { BaseArcMark, Factory, registerArcAnimation } from '@visactor/vchart';
1+
import { registerArc3d } from '@visactor/vrender-kits/register/register-arc3d';
2+
import { registerShadowRoot } from '@visactor/vrender-kits/register/register-shadowRoot';
3+
import { createArc3d } from '@visactor/vrender-core';
4+
import { registerArcAnimation } from '@visactor/vchart/esm/animation/config';
5+
import { Factory } from '@visactor/vchart/esm/core/factory';
6+
import { BaseArcMark } from '@visactor/vchart/esm/mark/arc';
37
import { MarkType3dEnum } from './enum';
48
import type { IArc3dMark, IArc3dMarkSpec } from './interface';
59

packages/vchart-extension/src/charts/3d/interface.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import type { IArcMarkSpec, IMarkRaw, IPoint, IPolygonMarkSpec, IRectMarkSpec } from '@visactor/vchart';
1+
import type { IMarkRaw } from '@visactor/vchart/esm/mark/interface/common';
2+
import type { IPoint } from '@visactor/vchart/esm/typings/coordinate';
3+
import type { IArcMarkSpec, IPolygonMarkSpec, IRectMarkSpec } from '@visactor/vchart/esm/typings/visual';
24

35
// 3d rect,支持length表示长宽高中的长属性(深度属性)
46
export interface IRect3dMarkSpec extends IRectMarkSpec {

packages/vchart-extension/src/charts/3d/layout.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
import type { IAxis, IBaseLayout, IChart, ILayoutItem, IOffset, LayoutSideType } from '@visactor/vchart';
2-
import { Factory, isXAxis, isYAxis, Layout } from '@visactor/vchart';
3-
import type { IBoundsLike } from '@visactor/vchart';
4-
import type { IRect } from '@visactor/vchart/src/typings/space';
1+
import type { IBoundsLike } from '@visactor/vutils';
2+
import type { IChart } from '@visactor/vchart/esm/chart/interface/chart';
3+
import { isXAxis, isYAxis } from '@visactor/vchart/esm/component/axis/cartesian/util/common';
4+
import type { IAxis } from '@visactor/vchart/esm/component/axis/interface/common';
5+
import { Factory } from '@visactor/vchart/esm/core/factory';
6+
import { Layout, type IOffset, type LayoutSideType } from '@visactor/vchart/esm/layout/base-layout';
7+
import type { IBaseLayout, ILayoutItem } from '@visactor/vchart/esm/layout/interface';
8+
import type { IRect } from '@visactor/vchart/esm/typings/space';
59

610
export class Layout3d extends Layout implements IBaseLayout {
711
declare recomputeWidth: boolean;

0 commit comments

Comments
 (0)