Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: support config metadata, update script and build config #6460

Merged
merged 2 commits into from
Oct 31, 2024

Conversation

Aarebecca
Copy link
Contributor

@Aarebecca Aarebecca commented Oct 31, 2024

  • SSR 支持配置 meta data
  • 新增配置项 waitForRender 用于增加额外等待时长

@@ -66,7 +67,19 @@ describe('createGraph', () => {
it('file pdf', async () => {
const graph = await fn('pdf');

graph.exportToFile(join(__dirname, '/assets/file'));
const metadata = {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里 pdf 添加 metadata,避免每次测试生成的文件不一致

@Aarebecca Aarebecca added the publish PR merges with this tag will perform the publication label Oct 31, 2024
exportToFile: (file: string) => void;
toBuffer: () => Buffer;
exportToFile: (file: string, meta?: MetaData) => void;
toBuffer: (meta?: MetaData) => Buffer;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个 api 的作用是什么呀

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果下游用户有需求直接拿到导出图片的 buffer,而不是写入到本地文件,可以调这个 API。
比如测试中,可以通过 toBuffer 拿到新生成的文件,并与本地文件进行比较,而不需要先将新截图写入。

@Aarebecca Aarebecca merged commit 404c3b9 into v5 Oct 31, 2024
5 checks passed
@Aarebecca Aarebecca deleted the refactor/g6-ssr branch October 31, 2024 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
publish PR merges with this tag will perform the publication
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants