Skip to content

Commit 19bf523

Browse files
authored
Remove mu-plugin as package type (#242)
1 parent 73798c3 commit 19bf523

11 files changed

Lines changed: 43 additions & 50 deletions

File tree

cli/command/completion/functions.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ func PackageTypes() cobra.CompletionFunc {
6969
return FromList(
7070
string(types.TypePlugin),
7171
string(types.TypeTheme),
72-
string(types.TypeMuPlugin),
7372
)
7473
}
7574

cli/command/init/init.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func NewInitCommand(wpmCli command.Cli) *cobra.Command {
8080
flags.StringVar(&opts.name, "name", "", "Package name")
8181
flags.StringVar(&opts.version, "version", "", "Semver-compliant version")
8282
flags.StringVar(&opts.license, "license", "", "Package license")
83-
flags.StringVar(&opts.packageType, "type", "", "Package type (plugin, theme, mu-plugin)")
83+
flags.StringVar(&opts.packageType, "type", "", "Package type (plugin, theme)")
8484

8585
_ = cmd.RegisterFlagCompletionFunc("type", completion.PackageTypes())
8686
_ = cmd.RegisterFlagCompletionFunc("license", completion.PackageLicenses())

docs/reference/cli/init.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ Initialize a new WordPress package or init wpm in existing project
66

77
### Options
88

9-
| Name | Type | Default | Description |
10-
|:--------------|:---------|:--------|:----------------------------------------|
11-
| `--existing` | `bool` | | Init wpm.json for an existing project |
12-
| `--license` | `string` | | Package license |
13-
| `--name` | `string` | | Package name |
14-
| `--type` | `string` | | Package type (plugin, theme, mu-plugin) |
15-
| `--version` | `string` | | Semver-compliant version |
16-
| `-y`, `--yes` | `bool` | | Skip prompts and use default values |
9+
| Name | Type | Default | Description |
10+
|:--------------|:---------|:--------|:--------------------------------------|
11+
| `--existing` | `bool` | | Init wpm.json for an existing project |
12+
| `--license` | `string` | | Package license |
13+
| `--name` | `string` | | Package name |
14+
| `--type` | `string` | | Package type (plugin, theme) |
15+
| `--version` | `string` | | Semver-compliant version |
16+
| `-y`, `--yes` | `bool` | | Skip prompts and use default values |
1717

1818

1919
<!---MARKER_GEN_END-->
@@ -69,7 +69,7 @@ automatically so the command can run without interaction.
6969
> When you run `wpm init -y` without `--type`, the `type` field is left
7070
> unset. Validation is skipped for that field in the `-y` path, so the command
7171
> succeeds, but you will need to set `type` manually before publishing. Prefer
72-
> `wpm init -y --type plugin` (or `theme`, `mu-plugin`) when scripting.
72+
> `wpm init -y --type plugin` (or `theme`) when scripting.
7373
7474
### Existing project mode (`--existing`)
7575

@@ -89,19 +89,19 @@ Detection rules:
8989

9090
Fields populated from the project sources:
9191

92-
| wpm.json field | Source |
93-
| :------------- | :--------------------------------------------------------- |
94-
| `name` | current directory name (override with `--name`) |
95-
| `type` | auto-detected (override with `--type`) |
96-
| `version` | plugin header `Version` or theme header `Version` |
97-
| `description` | header `Description`, falling back to `readme.txt` |
98-
| `license` | header `License`, falling back to `readme.txt` `License` |
99-
| `homepage` | header `Plugin URI` or `Theme URI` (must be http/https) |
100-
| `author` | plugin or theme header `Author` |
101-
| `tags` | `readme.txt` Tags, falling back to header `Tags` |
102-
| `requires.wp` | header `Requires at least` and `readme.txt` Requires |
103-
| `requires.php` | header `Requires PHP` and `readme.txt` Requires PHP |
104-
| `dependencies` | header `Requires Plugins` (each pinned to `*`) |
92+
| wpm.json field | Source |
93+
| :------------- | :------------------------------------------------------- |
94+
| `name` | current directory name (override with `--name`) |
95+
| `type` | auto-detected (override with `--type`) |
96+
| `version` | plugin header `Version` or theme header `Version` |
97+
| `description` | header `Description`, falling back to `readme.txt` |
98+
| `license` | header `License`, falling back to `readme.txt` `License` |
99+
| `homepage` | header `Plugin URI` or `Theme URI` (must be http/https) |
100+
| `author` | plugin or theme header `Author` |
101+
| `tags` | `readme.txt` Tags, falling back to header `Tags` |
102+
| `requires.wp` | header `Requires at least` and `readme.txt` Requires |
103+
| `requires.php` | header `Requires PHP` and `readme.txt` Requires PHP |
104+
| `dependencies` | header `Requires Plugins` (each pinned to `*`) |
105105

106106
If a `readme.txt` exists but no `readme.md`, wpm also converts the
107107
WordPress.org-flavored `readme.txt` into a Markdown `readme.md` next to it.
@@ -114,8 +114,8 @@ Constraints applied automatically:
114114
- `description` is trimmed to at most 512 characters, preferring to cut at a
115115
sentence boundary.
116116
- `license` is cleared if it falls outside 3 to 100 characters.
117-
- `dependencies` from `Requires Plugins` are capped at 16, and any self-reference
118-
is dropped.
117+
- `dependencies` from `Requires Plugins` are capped at 16, and any
118+
self-reference is dropped.
119119
- `requires.wp` becomes `>=X` (and `<=Y` when `Tested up to` is also present and
120120
different from `Requires`).
121121
- `requires.php` becomes `>=X`.

docs/reference/cli/install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ execution is not yet wired up.
198198
versions are rejected at validation time.
199199
- **Force a clean reinstall** when the tree is in a confusing state:
200200
```sh
201-
rm -rf wpm.lock wp-content/plugins wp-content/themes wp-content/mu-plugins
201+
rm -rf wpm.lock wp-content/plugins wp-content/themes
202202
wpm install
203203
```
204204
Review the new `wpm.lock` before committing.

docs/reference/cli/outdated.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@ akismet [plugin]
3434
└── latest: 5.4.0 (minor update)
3535
```
3636

37-
- The first line shows the package name, its `[type]` (`plugin`, `theme`,
38-
`mu-plugin`), and a faint `(dev)` marker when the package lives in
39-
`devDependencies`.
37+
- The first line shows the package name, its `[type]` (`plugin` or `theme`), and
38+
a faint `(dev)` marker when the package lives in `devDependencies`.
4039
- `current` is the version recorded in `wpm.lock`.
4140
- `latest` is what the registry returns for the `latest` tag.
4241

docs/reference/cli/wpm.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ Package Manager for WordPress ecosystem
2121

2222
### Options
2323

24-
| Name | Type | Default | Description |
25-
|:--------------------|:---------|:------------------|:------------------------------------------------------------------|
26-
| `--config` | `string` | `~/.wpm` | Location of client config files |
27-
| `-D`, `--debug` | `bool` | | Enable debug mode |
28-
| `-l`, `--log-level` | `string` | `info` | Set the logging level ("debug", "info", "warn", "error", "fatal") |
29-
| `--registry` | `string` | `registry.wpm.so` | Set specific registry to use |
24+
| Name | Type | Default | Description |
25+
|:--------------------|:---------|:-------------------------|:------------------------------------------------------------------|
26+
| `--config` | `string` | `~/.wpm` | Location of client config files |
27+
| `-D`, `--debug` | `bool` | | Enable debug mode |
28+
| `-l`, `--log-level` | `string` | `info` | Set the logging level ("debug", "info", "warn", "error", "fatal") |
29+
| `--registry` | `string` | `registry.wpm.so` | Set specific registry to use |
3030

3131

3232
<!---MARKER_GEN_END-->
@@ -40,9 +40,9 @@ Package Manager for WordPress ecosystem
4040
> breaking changes to CLI flags and to the `wpm.lock` format until 1.0.
4141
> Significant changes are called out in release notes.
4242
43-
`wpm` is a package manager for the WordPress ecosystem. It treats plugins,
44-
themes, and must-use plugins as versioned packages you can install, publish, and
45-
depend on. If you've used npm or Composer, the model will feel familiar.
43+
`wpm` is a package manager for the WordPress ecosystem. It treats plugins and
44+
themes as versioned packages you can install, publish, and depend on. If you've
45+
used npm or Composer, the model will feel familiar.
4646

4747
A wpm project is any directory that contains a `wpm.json` manifest. Most
4848
commands run against the current directory and produce or consume two files at
@@ -55,7 +55,7 @@ Installed packages land under `wp-content/` by default.
5555
| :------------------- | :-------------------------------------------------------------------------------------------- |
5656
| `wpm.json` | Your package's manifest. Declares name, version, type, dependencies, and runtime constraints. |
5757
| `wpm.lock` | A frozen snapshot of the resolved dependency tree. Commit this to version control. |
58-
| `wp-content/` | Where wpm extracts plugins, themes, and mu-plugins. Configurable via `config.content-dir`. |
58+
| `wp-content/` | Where wpm extracts plugins and themes. Configurable via `config.content-dir`. |
5959
| `.wpmignore` | Optional gitignore-style file that excludes paths from `wpm publish`. |
6060
| `~/.wpm/config.json` | Your client config, including the auth token after `wpm auth login`. |
6161

pkg/pm/installer/installer.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,6 @@ func (i *Installer) getTargetDir(pkgType types.PackageType, name string) (string
374374
switch pkgType {
375375
case types.TypeTheme:
376376
subDir = "themes"
377-
case types.TypeMuPlugin:
378-
subDir = "mu-plugins"
379377
case types.TypePlugin:
380378
subDir = "plugins"
381379
default:

pkg/pm/installer/plan.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ func subDirForType(t types.PackageType) (string, bool) {
9090
switch t {
9191
case types.TypeTheme:
9292
return "themes", true
93-
case types.TypeMuPlugin:
94-
return "mu-plugins", true
9593
case types.TypePlugin:
9694
return "plugins", true
9795
default:

pkg/pm/wpmjson/types/types.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ func (pt PackageType) String() string {
99

1010
func (pt PackageType) Valid() bool {
1111
switch pt {
12-
case TypeTheme, TypePlugin, TypeMuPlugin:
12+
case TypeTheme, TypePlugin:
1313
return true
1414
default:
1515
return false
@@ -33,9 +33,8 @@ func (pv PackageVisibility) Valid() bool {
3333
}
3434

3535
const (
36-
TypeTheme PackageType = "theme"
37-
TypePlugin PackageType = "plugin"
38-
TypeMuPlugin PackageType = "mu-plugin"
36+
TypeTheme PackageType = "theme"
37+
TypePlugin PackageType = "plugin"
3938

4039
VisibilityPublic PackageVisibility = "public"
4140
VisibilityPrivate PackageVisibility = "private"

pkg/pm/wpmjson/validator/validator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func IsValidDistTag(tag string) error {
5656
// IsValidPackageType checks if the package type is valid.
5757
func IsValidPackageType(t types.PackageType) error {
5858
if !t.Valid() {
59-
return errors.New("must be one of: theme, plugin, or mu-plugin")
59+
return errors.New("must be one of: theme or plugin")
6060
}
6161
return nil
6262
}

0 commit comments

Comments
 (0)