You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Related to #1787, Follows up on #1793
Implements GitDirectoryResource to enable loading files directly from
git repositories as follows:
```ts
{
"landingPage": "/guides/for-plugin-developers.md",
"steps": [
{
"step": "writeFiles",
"writeToPath": "/wordpress/guides",
"filesTree": {
"resource": "git:directory",
"url": "https://github.com/WordPress/wordpress-playground.git",
"ref": "trunk",
"path": "packages/docs/site/docs/main/guides"
}
}
]
}
```
## Implementation details
Uses git client functions merged in
#1764 to sparse
checkout the requested files. It also leans on the PHP CORS proxy which
is now started as a part of the `npm run dev` command.
The CORS proxy URL is configurable per `compileBlueprint()` call so that each
Playground runtime may choose to either use it or not. For example, it
wouldn't be very useful in the CLI version of Playground.
## Testing plan
Go to
`http://localhost:5400/website-server/#{%20%22landingPage%22:%20%22/guides/for-plugin-developers.md%22,%20%22steps%22:%20[%20{%20%22step%22:%20%22writeFiles%22,%20%22writeToPath%22:%20%22/wordpress/guides%22,%20%22filesTree%22:%20{%20%22resource%22:%20%22git:directory%22,%20%22url%22:%20%22https://github.com/WordPress/wordpress-playground.git%22,%20%22ref%22:%20%22trunk%22,%20%22path%22:%20%22packages/docs/site/docs/main/guides%22%20}%20}%20]%20}`
and confirm Playground loads a markdown file.
0 commit comments