Skip to content

feat(images): add sync_upstream_images script for image synchronization#1815

Closed
debs-obrien wants to merge 8 commits intomicrosoft:mainfrom
debs-obrien:image-script
Closed

feat(images): add sync_upstream_images script for image synchronization#1815
debs-obrien wants to merge 8 commits intomicrosoft:mainfrom
debs-obrien:image-script

Conversation

@debs-obrien
Copy link
Contributor

@debs-obrien debs-obrien commented Jul 25, 2025

Automatically syncs images from the upstream Playwright repo to the docs site and converts image paths during build.

Eliminates manual work - no more uploading and copying images by hand
Keeps images in sync - automatically pulls latest screenshots from upstream
Fixes VS Code preview - uses relative paths in source, absolute paths in generated docs
The script watches for image changes and ensures documentation always has the latest visuals without manual intervention.

@debs-obrien debs-obrien requested review from Copilot and mxschmitt July 25, 2025 11:45

This comment was marked as outdated.

Copy link
Contributor

@mxschmitt mxschmitt left a comment

Choose a reason for hiding this comment

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

There is already src/generate.js which does the chokidar watching. Ideally we can just have a function there which copies all the images over if its !watchMode and if its watchMode it reflects the changes in the directory. Then we dont have to repeat ourselves. Inside the md files we can use it like this:
<img src={require('@site/static/docs/playwright-logo.svg').default} />
see: https://docusaurus.io/docs/static-assets
and we should put the images in this folder in the microsoft/playwright repo (where we sync from): docs/src/images
and in the microsoft/playwright.dev repo we want to have it inside: static/docs/

@debs-obrien debs-obrien requested review from Copilot and mxschmitt July 25, 2025 14:52
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds image synchronization functionality to automatically sync image files from the upstream Playwright repository to the documentation site. The feature includes both initial sync and watch-based synchronization for real-time updates during development.

  • Adds comprehensive image file handling with copy, remove, and recursive sync operations
  • Implements file system watching for automatic image updates during development
  • Integrates image synchronization into the existing documentation generation workflow

debs-obrien and others added 5 commits July 25, 2025 16:54
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@mxschmitt
Copy link
Contributor

Looks not relevant anymore after #1818.

@mxschmitt mxschmitt closed this Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants