@42wp/dev-env 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -186,6 +186,13 @@ api.wordpress.org, with a local fallback when offline), a `Dockerfile`, and a
186
186
  `wp core install`. The DB name is the project name with hyphens turned into
187
187
  underscores; a trailing `.suffix` (e.g. `.localhost`) is stripped.
188
188
 
189
+ The generated `wp-config.php` always defines `WP_ENVIRONMENT_TYPE` as `local`, so
190
+ `wp_get_environment_type()` reports `local` (not the WordPress default of
191
+ `production`) — code and plugins that branch on the environment behave as they
192
+ should in dev. The constant is set before mu-plugins load, so it holds even under
193
+ `--vip`. The config is regenerated every `start`, so to apply this to an
194
+ **existing** project, just re-run `42wp start <project>`.
195
+
189
196
  ## Configuration
190
197
 
191
198
  | Env var | Default | Description |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@42wp/dev-env",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "42WP — a CLI to spin up disposable WordPress dev environments with Docker (Traefik + MySQL + per-project containers).",
5
5
  "type": "module",
6
6
  "bin": {
@@ -15,6 +15,9 @@ define( 'WP_DEBUG_LOG', true );
15
15
  define( 'WP_DEBUG_DISPLAY', false );
16
16
  define( 'DISABLE_WP_CRON', true );
17
17
 
18
+ /* Dev environment: make wp_get_environment_type() report 'local'. */
19
+ define( 'WP_ENVIRONMENT_TYPE', 'local' );
20
+
18
21
  {{MULTISITE_CONFIG}}
19
22
  /* That's all, stop editing! Happy publishing. */
20
23