Feature Description
Following #618 (comment), we now have an initial path forward for unbundling the Performance Lab plugin and creating standalone plugins from modules. While it is still being discussed whether we will publish all modules as standalone plugins or just a subset of them, we can definitely start working on the infrastructure changes needed.
For the purpose of this issue, let's simply start with one module, images/webp-uploads. This is just so that we can get started with one plugin. database/sqlite would be the other big priority to publish as standalone plugin, but that one is already available through the separate repo, so it's not a good idea to cover it here. In fact, it should be handle in a separate issue as bringing the codebase back into this monorepo will have its own little quirks to consider.
Requirements
- Add a config file (e.g. something like
plugins.json) which contains a map of module directories and their associated standalone plugin configuration (for now probably just the WordPress.org plugin repository slug and intended version). The file should for now only contain the image/webp-uploads module. For example:
{
"images/webp-uploads": {
"slug": "webp-uploads",
"version": "1.0.0"
}
}
- Implement a new Node CLI command
build-plugins in bin/commands that does the following:
- Copy over all module directories based on the above config file (i.e. for now only
image/webp-uploads) into a (git-ignored) build directory.
- After copying over, replace each
load.php file's module header with a corresponding plugin header:
Plugin Name and Plugin Description should use the module name and description respectively.
Plugin URI should point to the module's directory in this GitHub repository.
Text Domain should match the target plugin's slug.
Version should use the target version from the config file.
- All other fields (requirements, author, license, ...) should match what is in the Performance Lab plugin's own plugin header.
- Replace all usages of the
'performance-lab' text domain with the correct text domain for the individual plugin based on its slug (see above).
Feature Description
Following #618 (comment), we now have an initial path forward for unbundling the Performance Lab plugin and creating standalone plugins from modules. While it is still being discussed whether we will publish all modules as standalone plugins or just a subset of them, we can definitely start working on the infrastructure changes needed.
For the purpose of this issue, let's simply start with one module,
images/webp-uploads. This is just so that we can get started with one plugin.database/sqlitewould be the other big priority to publish as standalone plugin, but that one is already available through the separate repo, so it's not a good idea to cover it here. In fact, it should be handle in a separate issue as bringing the codebase back into this monorepo will have its own little quirks to consider.Requirements
plugins.json) which contains a map of module directories and their associated standalone plugin configuration (for now probably just the WordPress.org plugin repository slug and intended version). The file should for now only contain theimage/webp-uploadsmodule. For example:{ "images/webp-uploads": { "slug": "webp-uploads", "version": "1.0.0" } }build-pluginsinbin/commandsthat does the following:image/webp-uploads) into a (git-ignored) build directory.load.phpfile's module header with a corresponding plugin header:Plugin NameandPlugin Descriptionshould use the module name and description respectively.Plugin URIshould point to the module's directory in this GitHub repository.Text Domainshould match the target plugin's slug.Versionshould use the target version from the config file.'performance-lab'text domain with the correct text domain for the individual plugin based on its slug (see above).