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
21 changes: 21 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,13 @@ jobs:
with:
path: packages/vchart

- name: BytePack CDN smoke test (release)
if: startsWith(github.ref_name, 'release/')
env:
BYTEPACK_SMOKE_ATTEMPTS: 12
BYTEPACK_SMOKE_DELAY_MS: 30000
run: node --experimental-network-imports common/scripts/bytepack-smoke-test.mjs ${{ steps.package_version_release.outputs.current_version }}

- name: Commit & Push changes (release)
if: startsWith(github.ref_name, 'release/')
run: |
Expand Down Expand Up @@ -407,6 +414,13 @@ jobs:
with:
path: packages/vchart

- name: BytePack CDN smoke test (hotfix)
if: startsWith(github.ref_name, 'hotfix/')
env:
BYTEPACK_SMOKE_ATTEMPTS: 12
BYTEPACK_SMOKE_DELAY_MS: 30000
run: node --experimental-network-imports common/scripts/bytepack-smoke-test.mjs ${{ steps.package_version_hotfix.outputs.current_version }}

- name: Commit & Push changes (hotfix)
if: startsWith(github.ref_name, 'hotfix/')
run: |
Expand Down Expand Up @@ -444,6 +458,13 @@ jobs:
with:
path: packages/vchart

- name: BytePack CDN smoke test (pre-release)
if: startsWith(github.ref_name, 'pre-release/')
env:
BYTEPACK_SMOKE_ATTEMPTS: 12
BYTEPACK_SMOKE_DELAY_MS: 30000
run: node --experimental-network-imports common/scripts/bytepack-smoke-test.mjs ${{ steps.package_version_prerelease.outputs.current_version }}

- name: Commit & Push changes (pre-release)
if: startsWith(github.ref_name, 'pre-release/')
run: |
Expand Down
120 changes: 60 additions & 60 deletions common/config/rush/pnpm-lock.yaml

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

87 changes: 87 additions & 0 deletions common/scripts/bytepack-smoke-test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import { createRequire } from 'node:module';
import path from 'node:path';
import { fileURLToPath } from 'node:url';

const version = process.argv[2];

if (!version) {
console.error('Usage: node --experimental-network-imports common/scripts/bytepack-smoke-test.mjs <version>');
process.exit(1);
}

const attempts = Number(process.env.BYTEPACK_SMOKE_ATTEMPTS || 10);
const delayMs = Number(process.env.BYTEPACK_SMOKE_DELAY_MS || 30000);
const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..');
const requireFromVChart = createRequire(path.join(repoRoot, 'packages/vchart/package.json'));
const Canvas = requireFromVChart('canvas');

const wait = ms => new Promise(resolve => setTimeout(resolve, ms));

async function runSmoke() {
const vchartModule = await import(`https://bytepack.bytedance.net/@visactor/vchart@${version}`);
const extensionModule = await import(
`https://bytepack.bytedance.net/@visactor/vchart-extension@${version}/esm/charts/pie-3d/chart.js`
);

extensionModule.registerPie3dChart();

const VChart = vchartModule.default ?? vchartModule.VChart;
if (!VChart) {
throw new Error('Unable to resolve VChart constructor from BytePack module.');
}

const chart = new VChart(
{
type: 'pie3d',
width: 240,
height: 240,
data: [
{
id: 'data',
values: [
{ category: 'A', value: 12 },
{ category: 'B', value: 18 }
]
}
],
categoryField: 'category',
valueField: 'value',
outerRadius: 0.72
},
{
mode: 'node',
modeParams: Canvas,
animation: false,
options3d: {
enable: true
}
}
);

chart.renderSync();
chart.release();
}

let lastError;
for (let attempt = 1; attempt <= attempts; attempt++) {
try {
console.log(`BytePack smoke test for @visactor/vchart@${version}, attempt ${attempt}/${attempts}`);
await runSmoke();
console.log(`BytePack smoke test passed for @visactor/vchart@${version}`);
process.exit(0);
} catch (err) {
lastError = err;
console.error(`BytePack smoke test failed on attempt ${attempt}/${attempts}:`);
console.error(err && err.stack ? err.stack : err);

if (attempt < attempts) {
await wait(delayMs);
}
}
}

console.error(`BytePack smoke test failed after ${attempts} attempts.`);
if (lastError) {
console.error(lastError && lastError.stack ? lastError.stack : lastError);
}
process.exit(1);
4 changes: 2 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"@visactor/vchart-theme": "~1.6.6",
"@visactor/vmind": "1.2.4-alpha.5",
"@visactor/vutils": "~1.0.23",
"@visactor/vrender": "1.1.1",
"@visactor/vrender-kits": "1.1.1",
"@visactor/vrender": "^1.1.2",
"@visactor/vrender-kits": "^1.1.2",
"@visactor/vtable": "1.19.0-alpha.0",
"@visactor/vtable-editors": "1.19.0-alpha.0",
"@visactor/vtable-gantt": "1.19.0-alpha.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/openinula-vchart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"dependencies": {
"@visactor/vchart": "workspace:2.1.1",
"@visactor/vutils": "~1.0.23",
"@visactor/vrender-core": "1.1.1",
"@visactor/vrender-kits": "1.1.1",
"@visactor/vrender-core": "^1.1.2",
"@visactor/vrender-kits": "^1.1.2",
"react-is": "^18.2.0"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/react-vchart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"@visactor/vchart": "workspace:2.1.1",
"@visactor/vchart-extension": "workspace:2.1.1",
"@visactor/vutils": "~1.0.23",
"@visactor/vrender-core": "1.1.1",
"@visactor/vrender-kits": "1.1.1",
"@visactor/vrender-core": "^1.1.2",
"@visactor/vrender-kits": "^1.1.2",
"react-is": "^18.2.0"
},
"devDependencies": {
Expand Down
Loading
Loading