-
Notifications
You must be signed in to change notification settings - Fork 7
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
Runtime adapters #1
Labels
Milestone
Comments
This was referenced Feb 13, 2024
brandonpayton
added a commit
to brandonpayton/blueprints-library
that referenced
this issue
Oct 25, 2024
Runtime: PHP 8.3.12 Configuration: /Users/brandon/src/blueprints-library/phpunit.xml.dist ................................................... 51 / 51 (100%) Time: 00:00.021, Memory: 10.00 MB Blueprint Mapper (unit\blueprint\BlueprintMapper) ✔ Maps empty blueprint ✔ Maps word press version ✔ Maps multiple plugins ✔ Maps plugins with different data types ✔ Fails when plugins with invalid data types ✔ Maps when specific step appears twice ✔ Maps wp config constants ✔ Maps site options Json Mapper (unit\json_mapper\JsonMapper) ✔ Custom factory ✔ Maps to array object ✔ Sets public properties ✔ Sets private properties with setter ✔ Sets protected properties with setter ✔ Fails setting private property with no setter ✔ Fails setting protected property with no setter ✔ Maps to deep scalar array ✔ Maps to deep mixed array ✔ Fails when array wrong scalar type ✔ Fails when wrong scalar type ✔ Maps to array of arrays ✔ Maps to array Mkdir Step Runner (unit\steps\MkdirStepRunner) ✔ Create directory when using relative path ✔ Create directory when using absolute path ✔ Create directory recursively ✔ Create readable and writable directory ✔ Throw exception when creating directory and it already exists Property Parser (unit\json_mapper\PropertyParser) ✔ Parses properties with scalar types ✔ Parses properties with arrays of scalar types ✔ Parses properties with arrays ✔ Parses properties with no doc blocks ✔ Parses properties with public visibility ✔ Parses properties with protected visibility ✔ Parses properties with private visibility ✔ Parses properties with union types ✔ Parses properties with global namespace prefixed type ✔ Parses properties with null type Rm Step Runner (unit\steps\RmStepRunner) ✔ Remove directory when using absolute path ✔ Remove directory when using relative path ✔ Remove directory with subdirectory ✔ Remove directory with file ✔ Remove file ✔ Throw exception when removing nonexistent directory and using relative path ✔ Throw exception when removing nonexistent directory and using absolute path ✔ Throw exception when removing nonexistent file and using absolute path ✔ Throw exception when removing nonexistent file and using relative path Unzip Step Runner (unit\steps\UnzipStepRunner) ✔ Unzip file when using absolute path ✔ Unzip file when using relative path Zip Stream Writer ✔ Write file from path with data set #0 ✔ Write file from path with data set WordPress#1 ✔ Write file from string with data set #0 ✔ Write file from string with data set WordPress#1 OK (51 tests, 80 assertions) for running tests
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Blueprints should support at least the following runtimes:
Runtime-specific features
Caching the downloads
Blueprints shouldn't download the same 10MB WordPress.zip twice. Let's make sure we cache the downloads and invalidate the entries as new versions of Core and Plugins are released.
~/.wp/
. Ideally, this would take HTTP headers into consideration.fetch()
. In addition, we could cache at the service worker level.Network calls
libcurl
orfopen("https://")
fetch()
. We can't open raw TCP sockets sofopen("https://")
andlibcurl
cannot be easily used.fopen("https://")
, butlibcurl
isn't since Playground doesn't support it yet.Spawning child processes
Blueprint steps,
wp-cli
,phpunit
, and other tools will often spawn child processes.proc_open
Reporting progress
<div>
that needs to change itswidths
andinnerText
Filesystem interactions
I'd love to avoid abstract the filesystem and just use the regular PHP functions like
copy()
andfread()
Local mounts
It may useful to support mounting directories
Technical implementation
Dependency injection
Let's explore the dependency injection pattern. Pimple is a tiny service container we can use to plug-in runtime-specific implementations:
Other ideas
What are other viable solutions to this problem?
The text was updated successfully, but these errors were encountered: