@ideasonpurpose/build-tools-wordpress 2.10.9 → 2.10.11

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
@@ -1,6 +1,6 @@
1
1
  # @ideasonpurpose/build-tools-wordpress
2
2
 
3
- #### Version 2.10.9
3
+ #### Version 2.10.11
4
4
 
5
5
  [![NPM Version](https://img.shields.io/npm/v/%40ideasonpurpose%2Fbuild-tools-wordpress?logo=npm)](https://www.npmjs.com/package/@ideasonpurpose/build-tools-wordpress)
6
6
  [![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/ideasonpurpose/build-tools-wordpress/npm-publish.yml?logo=github&logoColor=white)](https://github.com/ideasonpurpose/build-tools-wordpress/actions/workflows/npm-publish.yml)
@@ -35,7 +35,7 @@ Typical host scripts (see [`boilerplate/package.json`](./boilerplate/package.jso
35
35
  "zip": "iop-build-zip-archive"
36
36
  },
37
37
  "devDependencies": {
38
- "@ideasonpurpose/build-tools-wordpress": "^2.10.6"
38
+ "@ideasonpurpose/build-tools-wordpress": "^2.10.11"
39
39
  },
40
40
  "prettier": "@ideasonpurpose/prettier-config",
41
41
  "stylelint": {
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env node
2
+ // @ts-check
3
+
4
+ import { readFile, writeFile } from "node:fs/promises";
5
+ import { dirname, resolve } from "node:path";
6
+ import { fileURLToPath } from "node:url";
7
+ import chalk from "chalk";
8
+
9
+ const WP_VERSION_URL =
10
+ "https://raw.githubusercontent.com/ideasonpurpose/docker-wordpress-dev/refs/heads/master/wp-version.json";
11
+
12
+ const IMAGE_RE = /^([ \t]*image:[ \t]*&wp_img[ \t]+)\S+/m;
13
+
14
+ const composePath = resolve(
15
+ dirname(fileURLToPath(import.meta.url)),
16
+ "../tooling/docker-compose.yml",
17
+ );
18
+
19
+ const res = await fetch(WP_VERSION_URL);
20
+ if (!res.ok) {
21
+ console.error(chalk.red(`Failed to fetch ${WP_VERSION_URL}: ${res.status}`));
22
+ process.exit(1);
23
+ }
24
+
25
+ const { wordpress } = await res.json();
26
+ if (!wordpress) {
27
+ console.error(chalk.red("wp-version.json is missing a wordpress version"));
28
+ process.exit(1);
29
+ }
30
+
31
+ const yaml = await readFile(composePath, "utf8");
32
+ if (!IMAGE_RE.test(yaml)) {
33
+ console.error(
34
+ chalk.red("Could not find image: &wp_img in tooling/docker-compose.yml"),
35
+ );
36
+ process.exit(1);
37
+ }
38
+
39
+ const image = `ideasonpurpose/wordpress:${wordpress}`;
40
+ await writeFile(composePath, yaml.replace(IMAGE_RE, `$1${image}`));
41
+ console.log(
42
+ "✅",
43
+ chalk.green(`docker-compose WordPress image updated to ${image}`),
44
+ );
@@ -63,7 +63,7 @@
63
63
  "extends": "@ideasonpurpose/stylelint-config"
64
64
  },
65
65
  "devDependencies": {
66
- "@ideasonpurpose/build-tools-wordpress": "^2.10.8"
66
+ "@ideasonpurpose/build-tools-wordpress": "^2.10.11"
67
67
  },
68
68
  "version-everything": {
69
69
  "files": [
@@ -71,4 +71,4 @@
71
71
  "wp-content/themes/iop-theme/style.css"
72
72
  ]
73
73
  }
74
- }
74
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ideasonpurpose/build-tools-wordpress",
3
- "version": "2.10.9",
3
+ "version": "2.10.11",
4
4
  "description": "Build scripts and dependencies for IOP's WordPress development environments.",
5
5
  "homepage": "https://github.com/ideasonpurpose/build-tools-wordpress#readme",
6
6
  "bugs": {
@@ -32,6 +32,7 @@
32
32
  },
33
33
  "scripts": {
34
34
  "test": "vitest",
35
+ "preversion": "node ./bin/update-wp-image.js",
35
36
  "version": "version-everything && git add -u"
36
37
  },
37
38
  "prettier": "@ideasonpurpose/prettier-config",
@@ -104,7 +105,11 @@
104
105
  },
105
106
  "version-everything": {
106
107
  "files": [
107
- "README.md"
108
+ "README.md",
109
+ "boilerplate/package.json"
110
+ ],
111
+ "prefixes": [
112
+ "@ideasonpurpose/build-tools-wordpress\": \"\\^"
108
113
  ]
109
114
  },
110
115
  "allowScripts": {
@@ -31,13 +31,13 @@ services:
31
31
  max-file: "3"
32
32
 
33
33
  # Ideas On Purpose's local WordPress development environment.
34
- # Update image version with `docker run ideasonpurpose/wordpress init`
34
+ # Update image version with `docker run ideasonpurpose/wordpress init`
35
35
  # Project info: https://github.com/ideasonpurpose/docker-wordpress-dev
36
36
  wordpress:
37
37
  depends_on:
38
38
  - db
39
39
  # image: &wp_img ideasonpurpose/wordpress:dev
40
- image: &wp_img ideasonpurpose/wordpress:7.0
40
+ image: &wp_img ideasonpurpose/wordpress:7.0.4
41
41
  restart: always
42
42
  volumes:
43
43
  - wp_data:/var/www/html
@@ -73,7 +73,7 @@ services:
73
73
  IOP_DEV_PLUGIN_6:
74
74
  IOP_DEV_PLUGIN_7:
75
75
  IOP_DEV_PLUGIN_8:
76
- WP_ENVIRONMENT_TYPE:
76
+ WP_ENVIRONMENT_TYPE:
77
77
 
78
78
  # Required for iptables port-mapping to work inside the Docker image
79
79
  # This is used to fix a PHP/WordPress issue where internal requests