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

Blueprints: Named resource overrides #1794

Open
adamziel opened this issue Sep 24, 2024 · 0 comments
Open

Blueprints: Named resource overrides #1794

adamziel opened this issue Sep 24, 2024 · 0 comments

Comments

@adamziel
Copy link
Collaborator

adamziel commented Sep 24, 2024

Let's introduce runtime-specific "resource overrides" to make Blueprint development easier. For example:

  • In Playground CLI, we could say --resource-override=gutenberg:./gutenberg/dist to load a local Gutenberg build instead of a fetching a remote zip file.
  • In Playground webapp, we could say ?resource-override=gutenberg:https://mysite.com/gutenberg.zip to load Gutenberg build from a remote zip file. We could also say ?resource-override=gutenberg:local-dir to trigger a directory picker and load a local Gutenberg build.

This would be highly useful in development and as a Blueprints builder feature.

Motivation

Building a Blueprint using external resources may require a couple of iterations on those resources. The typical process I've seen is this:

  1. Bundle the dependencies
  2. Push them to GitHub
  3. Wait a moment for the github.com cache to expire
  4. Update the Blueprint
  5. Reload Playground with the updated Blueprint
  6. Spot another issue, adjust the dependency, start over

This is annoying and time consuming. Playground would be so much more useful if it could just load a bunch of local files.

Implementation

Blueprints could support a new top-level "resources" key that would list all the overridable resources:

{
	"resources": {
		"gutenberg": {
			"resource": "wp.org/plugins",
			"slug": "gutenberg"
		}
	},
	"steps": [
		{
			"step": "installPlugin",
			"pluginData": { "ref": "gutenberg" }
		}
	]
}

From there, runtimes would be free to accept a list of label:URI overrides to adjust these top-level resources before resolving them.

This is also a step towards the Blueprints v2 schema.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In progress
Development

No branches or pull requests

1 participant