diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f3658441d3..bc29ec8978 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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: | @@ -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: | @@ -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: | diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 14462b0b85..cc313d777d 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -37,11 +37,11 @@ importers: specifier: 1.2.4-alpha.5 version: 1.2.4-alpha.5 '@visactor/vrender': - specifier: 1.1.1 - version: 1.1.1 + specifier: ^1.1.2 + version: 1.1.2 '@visactor/vrender-kits': - specifier: 1.1.1 - version: 1.1.1 + specifier: ^1.1.2 + version: 1.1.2 '@visactor/vtable': specifier: 1.19.0-alpha.0 version: 1.19.0-alpha.0 @@ -203,11 +203,11 @@ importers: specifier: workspace:2.1.1 version: link:../vchart '@visactor/vrender-core': - specifier: 1.1.1 - version: 1.1.1 + specifier: ^1.1.2 + version: 1.1.2 '@visactor/vrender-kits': - specifier: 1.1.1 - version: 1.1.1 + specifier: ^1.1.2 + version: 1.1.2 '@visactor/vutils': specifier: ~1.0.23 version: 1.0.23 @@ -294,11 +294,11 @@ importers: specifier: workspace:2.1.1 version: link:../vchart-extension '@visactor/vrender-core': - specifier: 1.1.1 - version: 1.1.1 + specifier: ^1.1.2 + version: 1.1.2 '@visactor/vrender-kits': - specifier: 1.1.1 - version: 1.1.1 + specifier: ^1.1.2 + version: 1.1.2 '@visactor/vutils': specifier: ~1.0.23 version: 1.0.23 @@ -529,20 +529,20 @@ importers: specifier: ~1.0.23 version: 1.0.23 '@visactor/vrender': - specifier: 1.1.1 - version: 1.1.1 + specifier: ^1.1.2 + version: 1.1.2 '@visactor/vrender-animate': - specifier: 1.1.1 - version: 1.1.1 + specifier: ^1.1.2 + version: 1.1.2 '@visactor/vrender-components': - specifier: 1.1.1 - version: 1.1.1 + specifier: ^1.1.2 + version: 1.1.2 '@visactor/vrender-core': - specifier: 1.1.1 - version: 1.1.1 + specifier: ^1.1.2 + version: 1.1.2 '@visactor/vrender-kits': - specifier: 1.1.1 - version: 1.1.1 + specifier: ^1.1.2 + version: 1.1.2 '@visactor/vscale': specifier: ~1.0.23 version: 1.0.23 @@ -695,17 +695,17 @@ importers: specifier: ~1.0.23 version: 1.0.23 '@visactor/vrender-animate': - specifier: 1.1.1 - version: 1.1.1 + specifier: ^1.1.2 + version: 1.1.2 '@visactor/vrender-components': - specifier: 1.1.1 - version: 1.1.1 + specifier: ^1.1.2 + version: 1.1.2 '@visactor/vrender-core': - specifier: 1.1.1 - version: 1.1.1 + specifier: ^1.1.2 + version: 1.1.2 '@visactor/vrender-kits': - specifier: 1.1.1 - version: 1.1.1 + specifier: ^1.1.2 + version: 1.1.2 '@visactor/vutils': specifier: ~1.0.23 version: 1.0.23 @@ -1263,14 +1263,14 @@ importers: specifier: workspace:2.1.1 version: link:../../packages/vchart '@visactor/vrender': - specifier: 1.1.1 - version: 1.1.1 + specifier: ^1.1.2 + version: 1.1.2 '@visactor/vrender-core': - specifier: 1.1.1 - version: 1.1.1 + specifier: ^1.1.2 + version: 1.1.2 '@visactor/vrender-kits': - specifier: 1.1.1 - version: 1.1.1 + specifier: ^1.1.2 + version: 1.1.2 '@visactor/vutils': specifier: ~1.0.23 version: 1.0.23 @@ -3079,29 +3079,29 @@ packages: '@visactor/vrender-animate@1.0.0-alpha.18': resolution: {integrity: sha512-9kTtvp1ef+1t+AtUiza6A7qBQP7SmvOu3/ILGrqs/HGdZVj1XGjbYvD/X/zwKJ3LEb7gGV5fa8x95e4czTvRSA==} - '@visactor/vrender-animate@1.1.1': - resolution: {integrity: sha512-rrxVDZSvxGsRsgUjmuivQtQqcqkk35dOqYGAVE2fs9lD/TYEhErJjhmwRAuqGaTR2fBAFRgVku6h+O7H4qalAQ==} + '@visactor/vrender-animate@1.1.2': + resolution: {integrity: sha512-HU6KXG5dmY7Fn68QnasFykhWdCgpWxvOO+xkAKVwnXNjHwWELi4L9E2lm6t0NbmI1YY147qp0MSoORzqHXegzA==} '@visactor/vrender-components@1.0.0-alpha.18': resolution: {integrity: sha512-7Euq+ZfswL74n2pgkaqZSsPxoSa5SPIGyXatN1eUrdzM2Z0kX6U0RcJg01fctvRs4op6WhcecRLqGvnHcBeb9Q==} - '@visactor/vrender-components@1.1.1': - resolution: {integrity: sha512-Dyk+zwx8/ofYFA2QoxFWXsyWip2+8LhO8UQJ9d1V7/x7pJ4twa3aPBbu5drC5Gx6SqI/7RkwuSA3Y0yzRmvYEA==} + '@visactor/vrender-components@1.1.2': + resolution: {integrity: sha512-0iPF25DocfsqK8Ko17dcQY89+G9JD64rGDS4NjJQxL8EMHdsmD3U2+Knn0broHhqnXKA/LpUYFU/5rnUki9pyw==} '@visactor/vrender-core@1.0.0-alpha.18': resolution: {integrity: sha512-0ihtNvCyNkOsWPFgRqowHzq0IcQgS2Wl/nPpKbVtxWKveenwlhA+ZKoQvam6VJyBY7jeNe1pROy0mJMDyVAJQw==} - '@visactor/vrender-core@1.1.1': - resolution: {integrity: sha512-GumHmNqmCVl7uYJJwC3O1lAN7/rCtnSIkEuA6QDUAyFzhzFuaTtG9eDFDDU+f4AaslFZM67D3FI+c7WOFOq3vw==} + '@visactor/vrender-core@1.1.2': + resolution: {integrity: sha512-9qDjL3HCkwswSFV2z2NKrs0Fq/1sHWzIIToLjP2zmIOkNUhaJ+GVbD3nqPgg+oD2Xh3O25ePQg0tTnyU9Nm+9g==} '@visactor/vrender-kits@1.0.0-alpha.18': resolution: {integrity: sha512-Tvolkq+4G8qiPFZo0Aj8M//Yr6jR2h8FNkFEyWM9gbQbEiTkjpmHAJOYnoSsaPtPrcMSlG4EhJSFDk6ymANHVg==} - '@visactor/vrender-kits@1.1.1': - resolution: {integrity: sha512-t+lBq/6lA8Ck7ZOgtUgCFGV4Zuj06Irk2qIMze8fqpNn1+htzEizxgTgT8FdZuYN6mybHJbzL86BpicBw1tMfg==} + '@visactor/vrender-kits@1.1.2': + resolution: {integrity: sha512-E986T3lNqmJUWQlU/X6AY12LRYIAcOUamMHAH6wDIMyU6J2cqz5ODY+dz/tCs4E3VzhwxQr8whimgwTgXoLe8w==} - '@visactor/vrender@1.1.1': - resolution: {integrity: sha512-sRcaLfaD7LHtxIOm/EIeJ75BQhr7asUdkmdSWnnYuAL/yzEkrQvAF4Nf+g9Rf45XwRK3f38n339kUwlsyS0a+Q==} + '@visactor/vrender@1.1.2': + resolution: {integrity: sha512-ITZgzlFc8lIxFh37l6bFk3/xNEksa0lMym5caP1gYjMMfnx1VWNKzeF5Af5wXIh7glE4tFZfCeXt2tzrVaYnLw==} '@visactor/vscale@0.18.18': resolution: {integrity: sha512-iRG4kv+5Fv4KX3AxEfV95XU3I6OmF0QizyAhqHxKa7L1MaT+MRvDDk5zHWf1E8gialLbL2xDe3GnT6g/4u5jhA==} @@ -15061,9 +15061,9 @@ snapshots: '@visactor/vrender-core': 1.0.0-alpha.18 '@visactor/vutils': 1.0.4 - '@visactor/vrender-animate@1.1.1': + '@visactor/vrender-animate@1.1.2': dependencies: - '@visactor/vrender-core': 1.1.1 + '@visactor/vrender-core': 1.1.2 '@visactor/vutils': 1.0.23 '@visactor/vrender-components@1.0.0-alpha.18': @@ -15074,11 +15074,11 @@ snapshots: '@visactor/vscale': 1.0.4 '@visactor/vutils': 1.0.4 - '@visactor/vrender-components@1.1.1': + '@visactor/vrender-components@1.1.2': dependencies: - '@visactor/vrender-animate': 1.1.1 - '@visactor/vrender-core': 1.1.1 - '@visactor/vrender-kits': 1.1.1 + '@visactor/vrender-animate': 1.1.2 + '@visactor/vrender-core': 1.1.2 + '@visactor/vrender-kits': 1.1.2 '@visactor/vscale': 1.0.23 '@visactor/vutils': 1.0.23 @@ -15087,7 +15087,7 @@ snapshots: '@visactor/vutils': 1.0.4 color-convert: 2.0.1 - '@visactor/vrender-core@1.1.1': + '@visactor/vrender-core@1.1.2': dependencies: '@visactor/vutils': 1.0.23 color-convert: 2.0.1 @@ -15101,21 +15101,21 @@ snapshots: lottie-web: 5.13.0 roughjs: 4.5.2 - '@visactor/vrender-kits@1.1.1': + '@visactor/vrender-kits@1.1.2': dependencies: '@resvg/resvg-js': 2.4.1 - '@visactor/vrender-core': 1.1.1 + '@visactor/vrender-core': 1.1.2 '@visactor/vutils': 1.0.23 gifuct-js: 2.1.2 lottie-web: 5.13.0 roughjs: 4.6.6 - '@visactor/vrender@1.1.1': + '@visactor/vrender@1.1.2': dependencies: - '@visactor/vrender-animate': 1.1.1 - '@visactor/vrender-components': 1.1.1 - '@visactor/vrender-core': 1.1.1 - '@visactor/vrender-kits': 1.1.1 + '@visactor/vrender-animate': 1.1.2 + '@visactor/vrender-components': 1.1.2 + '@visactor/vrender-core': 1.1.2 + '@visactor/vrender-kits': 1.1.2 '@visactor/vscale@0.18.18': dependencies: diff --git a/common/scripts/bytepack-smoke-test.mjs b/common/scripts/bytepack-smoke-test.mjs new file mode 100644 index 0000000000..2d7547ef0e --- /dev/null +++ b/common/scripts/bytepack-smoke-test.mjs @@ -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 '); + 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); diff --git a/docs/package.json b/docs/package.json index 03d3fd978f..af7241106d 100644 --- a/docs/package.json +++ b/docs/package.json @@ -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", diff --git a/packages/openinula-vchart/package.json b/packages/openinula-vchart/package.json index ab72173e54..d6fc3e45ac 100644 --- a/packages/openinula-vchart/package.json +++ b/packages/openinula-vchart/package.json @@ -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": { diff --git a/packages/react-vchart/package.json b/packages/react-vchart/package.json index 2c20bf660d..beff3cfa0c 100644 --- a/packages/react-vchart/package.json +++ b/packages/react-vchart/package.json @@ -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": { diff --git a/packages/vchart-extension/package.json b/packages/vchart-extension/package.json index f700139d26..41a6cbdd6a 100644 --- a/packages/vchart-extension/package.json +++ b/packages/vchart-extension/package.json @@ -26,10 +26,10 @@ "start": "ts-node __tests__/runtime/browser/scripts/initVite.ts && vite serve __tests__/runtime/browser" }, "dependencies": { - "@visactor/vrender-core": "1.1.1", - "@visactor/vrender-kits": "1.1.1", - "@visactor/vrender-components": "1.1.1", - "@visactor/vrender-animate": "1.1.1", + "@visactor/vrender-core": "^1.1.2", + "@visactor/vrender-kits": "^1.1.2", + "@visactor/vrender-components": "^1.1.2", + "@visactor/vrender-animate": "^1.1.2", "@visactor/vchart": "workspace:2.1.1", "@visactor/vutils": "~1.0.23", "@visactor/vdataset": "~1.0.23", diff --git a/packages/vchart-extension/src/charts/3d/arc-3d.ts b/packages/vchart-extension/src/charts/3d/arc-3d.ts index 4d4d925d09..f4e1ec22c9 100644 --- a/packages/vchart-extension/src/charts/3d/arc-3d.ts +++ b/packages/vchart-extension/src/charts/3d/arc-3d.ts @@ -1,4 +1,5 @@ -import { registerArc3d, registerShadowRoot, createArc3d } from '@visactor/vchart'; +import { registerArc3d } from '@visactor/vrender-kits/register/register-arc3d'; +import { registerShadowRoot, createArc3d } from '@visactor/vchart'; import { BaseArcMark, Factory, registerArcAnimation } from '@visactor/vchart'; import { MarkType3dEnum } from './enum'; import type { IArc3dMark, IArc3dMarkSpec } from './interface'; diff --git a/packages/vchart/package.json b/packages/vchart/package.json index 33ca089d7e..1409c4d9d2 100644 --- a/packages/vchart/package.json +++ b/packages/vchart/package.json @@ -128,11 +128,11 @@ "@visactor/vdataset": "~1.0.23", "@visactor/vscale": "~1.0.23", "@visactor/vlayouts": "~1.0.23", - "@visactor/vrender": "1.1.1", - "@visactor/vrender-core": "1.1.1", - "@visactor/vrender-kits": "1.1.1", - "@visactor/vrender-components": "1.1.1", - "@visactor/vrender-animate": "1.1.1", + "@visactor/vrender": "^1.1.2", + "@visactor/vrender-core": "^1.1.2", + "@visactor/vrender-kits": "^1.1.2", + "@visactor/vrender-components": "^1.1.2", + "@visactor/vrender-animate": "^1.1.2", "@visactor/vutils-extension": "workspace:2.1.1" }, "publishConfig": { diff --git a/packages/vchart/src/index.ts b/packages/vchart/src/index.ts index 105f0676dd..e0df93ebe9 100644 --- a/packages/vchart/src/index.ts +++ b/packages/vchart/src/index.ts @@ -81,14 +81,12 @@ export { } from '@visactor/vrender-components'; // vrender-kits -export { - registerLine, - registerRect, - registerArc3d, - registerPyramid3d, - registerRect3d, - registerShadowRoot -} from '@visactor/vrender-kits'; +export { registerLine } from '@visactor/vrender-kits/register/register-line'; +export { registerRect } from '@visactor/vrender-kits/register/register-rect'; +export { registerArc3d } from '@visactor/vrender-kits/register/register-arc3d'; +export { registerPyramid3d } from '@visactor/vrender-kits/register/register-pyramid3d'; +export { registerRect3d } from '@visactor/vrender-kits/register/register-rect3d'; +export { registerShadowRoot } from '@visactor/vrender-kits/register/register-shadowRoot'; // vlayouts export * from '@visactor/vlayouts'; diff --git a/tools/story-player/package.json b/tools/story-player/package.json index ffb64c7c57..3cb6c37c00 100644 --- a/tools/story-player/package.json +++ b/tools/story-player/package.json @@ -56,10 +56,10 @@ "vite": "3.2.6" }, "dependencies": { - "@visactor/vrender-core": "1.1.1", - "@visactor/vrender-kits": "1.1.1", + "@visactor/vrender-core": "^1.1.2", + "@visactor/vrender-kits": "^1.1.2", "@visactor/vchart": "workspace:2.1.1", - "@visactor/vrender": "1.1.1", + "@visactor/vrender": "^1.1.2", "@visactor/vutils": "~1.0.23" } } diff --git a/tools/story-player/src/layer/vrender-layer.ts b/tools/story-player/src/layer/vrender-layer.ts index 9abc2b03c5..a1646a49d9 100644 --- a/tools/story-player/src/layer/vrender-layer.ts +++ b/tools/story-player/src/layer/vrender-layer.ts @@ -1,4 +1,4 @@ -import type { Stage as VRenderStage } from '@visactor/vrender-core'; +import type { IStage as VRenderStage } from '@visactor/vrender-core'; // eslint-disable-next-line no-duplicate-imports import { createStage } from '@visactor/vrender-core'; import { CanvasLayer } from './canvas-layer';