|
1 |
| -# @wpsocio/wpdev |
| 1 | +# @wpsocio/build-utils |
2 | 2 |
|
3 |
| -A CLI to manage WordPress projects in a monorepo or a standalone repo. |
4 |
| - |
5 |
| -## Requirements |
6 |
| - |
7 |
| -- [WP CLI](https://wp-cli.org/) - Required for i18n features. |
| 3 | +Build utilities CLI. |
8 | 4 |
|
9 | 5 | ## Installation
|
10 | 6 |
|
11 | 7 | ```sh
|
12 |
| -npm install --save-dev @wpsocio/wpdev |
| 8 | +npm install --save-dev @wpsocio/build-utils |
13 | 9 | ```
|
14 | 10 |
|
15 | 11 | ```sh
|
16 |
| -yarn add --dev @wpsocio/wpdev |
| 12 | +yarn add --dev @wpsocio/build-utils |
17 | 13 | ```
|
18 | 14 |
|
19 | 15 | ```sh
|
20 |
| -pnpm add -D @wpsocio/wpdev |
| 16 | +pnpm add -D @wpsocio/build-utils |
21 | 17 | ```
|
22 | 18 |
|
23 | 19 | ## Usage
|
24 | 20 |
|
25 | 21 | <!-- usage -->
|
| 22 | + |
26 | 23 | ```sh-session
|
27 |
| -$ npm install -g @wpsocio/wpdev |
28 |
| -$ wpdev COMMAND |
| 24 | +$ npm install -g @wpsocio/build-utils |
| 25 | +$ build-utils COMMAND |
29 | 26 | running command...
|
30 |
| -$ wpdev (--version) |
31 |
| -@wpsocio/wpdev/1.0.7 linux-x64 node-v20.15.0 |
32 |
| -$ wpdev --help [COMMAND] |
| 27 | +$ build-utils (--version) |
| 28 | +@wpsocio/build-utils/0.0.0 darwin-arm64 node-v18.19.0 |
| 29 | +$ build-utils --help [COMMAND] |
33 | 30 | USAGE
|
34 |
| - $ wpdev COMMAND |
| 31 | + $ build-utils COMMAND |
35 | 32 | ...
|
36 | 33 | ```
|
| 34 | + |
37 | 35 | <!-- usagestop -->
|
38 | 36 |
|
39 | 37 | ## Commands
|
40 | 38 |
|
41 | 39 | <!-- commands -->
|
42 |
| -* [`wpdev bundle [PROJECTS]`](#wpdev-bundle-projects) |
43 |
| -* [`wpdev clean [PATH]`](#wpdev-clean-path) |
44 |
| -* [`wpdev link [PROJECTS]`](#wpdev-link-projects) |
45 |
| -* [`wpdev project-info [PROJECTS]`](#wpdev-project-info-projects) |
46 |
| -* [`wpdev unlink [PROJECTS]`](#wpdev-unlink-projects) |
47 |
| - |
48 |
| -## `wpdev bundle [PROJECTS]` |
49 |
| - |
50 |
| -Prepares and bundles projects for distribution or deployment. |
51 |
| - |
52 |
| -``` |
53 |
| -USAGE |
54 |
| - $ wpdev bundle [PROJECTS] [-r <value>] [-m wp-monorepo|standalone] [--project-types plugins|themes] [-e |
55 |
| - <value>] [--all] [--from-changeset --changeset-json <value>] [-d <value>] [-p npm|yarn|pnpm|bun] [-c] [-v <value> | |
56 |
| - -t major|minor|patch|premajor|preminor|prepatch|prerelease] [--tasks <value>] |
57 |
| -
|
58 |
| -ARGUMENTS |
59 |
| - PROJECTS Project(s) to target. |
60 |
| -
|
61 |
| -FLAGS |
62 |
| - -c, --[no-]archive Create a compressed archive (zip) of the bundled project. |
63 |
| - -d, --out-dir=<value> [default: dist] Path to the output directory. Defaults to "dist". |
64 |
| - -e, --env-file=<value>... Environment file(s) to load |
65 |
| - -m, --operation-mode=<option> Operation mode. |
66 |
| - <options: wp-monorepo|standalone> |
67 |
| - -p, --package-manager=<option> [default: npm] Package manager to use. |
68 |
| - <options: npm|yarn|pnpm|bun> |
69 |
| - -r, --root-dir=<value> Root directory. Can be an absolute or a relative path. |
70 |
| - -t, --release-type=<option> Release type to update to. |
71 |
| - <options: major|minor|patch|premajor|preminor|prepatch|prerelease> |
72 |
| - -v, --version=<value> Version to update to. |
73 |
| - --all Target all projects in monorepo. |
74 |
| - --changeset-json=<value> Path to the changeset status JSON file. Pass the {filePath} given to `changeset |
75 |
| - status --output={filePath}` |
76 |
| - --from-changeset Target projects in monorepo from changesets. |
77 |
| - --project-types=<option>... Project types managed in the monorepo. Only used in wp-monorepo mode. |
78 |
| - <options: plugins|themes> |
79 |
| - --tasks=<value> Run only the specified tasks. Comma-separated list. |
80 |
| -
|
81 |
| -DESCRIPTION |
82 |
| - Prepares and bundles projects for distribution or deployment. |
83 |
| -
|
84 |
| -EXAMPLES |
85 |
| - $ wpdev bundle |
86 |
| -
|
87 |
| - $ wpdev bundle wptelegram test-theme |
88 |
| -
|
89 |
| - $ wpdev bundle --all |
90 |
| -``` |
91 |
| - |
92 |
| -_See code: [src/commands/bundle.ts ](https://github.com/wpsocio/wp-projects/blob/@wpsocio/[email protected]/tools/wpdev/src/commands/bundle.ts)_ |
93 |
| - |
94 |
| -## `wpdev clean [PATH]` |
95 |
| - |
96 |
| -Cleans up the given path(s) in this monorepo. |
97 |
| - |
98 |
| -``` |
99 |
| -USAGE |
100 |
| - $ wpdev clean [PATH] [-r <value>] [-m wp-monorepo|standalone] [--project-types plugins|themes] [-e |
101 |
| - <value>] [-i ignored|node_modules|composer.lock|vendor] [--all] |
102 |
| -
|
103 |
| -ARGUMENTS |
104 |
| - PATH Path to clean. Relative to root directory |
105 |
| -
|
106 |
| -FLAGS |
107 |
| - -e, --env-file=<value>... Environment file(s) to load |
108 |
| - -i, --include=<option>... Type of files to delete |
109 |
| - <options: ignored|node_modules|composer.lock|vendor> |
110 |
| - -m, --operation-mode=<option> Operation mode. |
111 |
| - <options: wp-monorepo|standalone> |
112 |
| - -r, --root-dir=<value> Root directory. Can be an absolute or a relative path. |
113 |
| - --all Clean everything |
114 |
| - --project-types=<option>... Project types managed in the monorepo. Only used in wp-monorepo mode. |
115 |
| - <options: plugins|themes> |
116 |
| -
|
117 |
| -DESCRIPTION |
118 |
| - Cleans up the given path(s) in this monorepo. |
119 |
| -
|
120 |
| -EXAMPLES |
121 |
| - $ wpdev clean plugins/wptelegram --include=ignored --include=node_modules |
122 |
| -
|
123 |
| - $ wpdev clean --all |
124 |
| -``` |
125 | 40 |
|
126 |
| -_See code: [src/commands/clean.ts](https://github.com/wpsocio/wp-projects/blob/@wpsocio/[email protected]/tools/wpdev/src/commands/clean.ts)_ |
| 41 | +- [`build-utils validate`](#build-utils-validate) |
127 | 42 |
|
128 |
| -## `wpdev link [PROJECTS]` |
| 43 | +## `build-utils validate` |
129 | 44 |
|
130 |
| -Creates symlinks in the given wp-content directory for the project(s) in this monorepo. |
| 45 | +Validates build output files. |
131 | 46 |
|
132 | 47 | ```
|
133 | 48 | USAGE
|
134 |
| - $ wpdev link [PROJECTS] [-r <value>] [-m wp-monorepo|standalone] [--project-types plugins|themes] [-e |
135 |
| - <value>] [--all] [--from-changeset --changeset-json <value>] [-d <value>] |
136 |
| -
|
137 |
| -ARGUMENTS |
138 |
| - PROJECTS Project(s) to target. |
139 |
| -
|
140 |
| -FLAGS |
141 |
| - -d, --wp-content-dir=<value> Path to the WordPress content directory. |
142 |
| - -e, --env-file=<value>... Environment file(s) to load |
143 |
| - -m, --operation-mode=<option> Operation mode. |
144 |
| - <options: wp-monorepo|standalone> |
145 |
| - -r, --root-dir=<value> Root directory. Can be an absolute or a relative path. |
146 |
| - --all Target all projects in monorepo. |
147 |
| - --changeset-json=<value> Path to the changeset status JSON file. Pass the {filePath} given to `changeset |
148 |
| - status --output={filePath}` |
149 |
| - --from-changeset Target projects in monorepo from changesets. |
150 |
| - --project-types=<option>... Project types managed in the monorepo. Only used in wp-monorepo mode. |
151 |
| - <options: plugins|themes> |
| 49 | + $ build-utils validate |
152 | 50 |
|
153 | 51 | DESCRIPTION
|
154 |
| - Creates symlinks in the given wp-content directory for the project(s) in this monorepo. |
155 |
| -
|
156 |
| -EXAMPLES |
157 |
| - $ wpdev link |
158 |
| -
|
159 |
| - $ wpdev link wptelegram test-theme |
160 |
| -
|
161 |
| - $ wpdev link --all |
162 |
| -``` |
163 |
| - |
164 |
| -_See code: [src/commands/link.ts ](https://github.com/wpsocio/wp-projects/blob/@wpsocio/[email protected]/tools/wpdev/src/commands/link.ts)_ |
165 |
| - |
166 |
| -## `wpdev project-info [PROJECTS]` |
167 |
| - |
168 |
| -Get the project info as JSON. |
169 |
| - |
170 |
| -``` |
171 |
| -USAGE |
172 |
| - $ wpdev project-info [PROJECTS] [-r <value>] [-m wp-monorepo|standalone] [--project-types plugins|themes] [-e |
173 |
| - <value>] [--all] [--from-changeset --changeset-json <value>] [--pretty] |
174 |
| -
|
175 |
| -ARGUMENTS |
176 |
| - PROJECTS Project(s) to target. |
177 |
| -
|
178 |
| -FLAGS |
179 |
| - -e, --env-file=<value>... Environment file(s) to load |
180 |
| - -m, --operation-mode=<option> Operation mode. |
181 |
| - <options: wp-monorepo|standalone> |
182 |
| - -r, --root-dir=<value> Root directory. Can be an absolute or a relative path. |
183 |
| - --all Target all projects in monorepo. |
184 |
| - --changeset-json=<value> Path to the changeset status JSON file. Pass the {filePath} given to `changeset |
185 |
| - status --output={filePath}` |
186 |
| - --from-changeset Target projects in monorepo from changesets. |
187 |
| - --pretty Pretty print the JSON output. |
188 |
| - --project-types=<option>... Project types managed in the monorepo. Only used in wp-monorepo mode. |
189 |
| - <options: plugins|themes> |
190 |
| -
|
191 |
| -DESCRIPTION |
192 |
| - Get the project info as JSON. |
193 |
| -
|
194 |
| -EXAMPLES |
195 |
| - $ wpdev project-info |
196 |
| -
|
197 |
| - $ wpdev project-info wptelegram test-theme |
198 |
| -
|
199 |
| - $ wpdev project-info --all |
| 52 | + Validates build output files. |
200 | 53 | ```
|
201 | 54 |
|
202 |
| -_See code: [src/commands/project-info.ts ](https://github.com/wpsocio/wp-projects/blob/@wpsocio/[email protected]/tools/wpdev/src/commands/project-info.ts)_ |
203 |
| - |
204 |
| -## `wpdev unlink [PROJECTS]` |
205 |
| - |
206 |
| -Removes symlinks in the given wp-content directory created for the project(s) in this monorepo. |
207 |
| - |
208 |
| -``` |
209 |
| -USAGE |
210 |
| - $ wpdev unlink [PROJECTS] [-r <value>] [-m wp-monorepo|standalone] [--project-types plugins|themes] [-e |
211 |
| - <value>] [--all] [--from-changeset --changeset-json <value>] [-d <value>] |
212 |
| -
|
213 |
| -ARGUMENTS |
214 |
| - PROJECTS Project(s) to target. |
215 |
| -
|
216 |
| -FLAGS |
217 |
| - -d, --wp-content-dir=<value> Path to the WordPress content directory. |
218 |
| - -e, --env-file=<value>... Environment file(s) to load |
219 |
| - -m, --operation-mode=<option> Operation mode. |
220 |
| - <options: wp-monorepo|standalone> |
221 |
| - -r, --root-dir=<value> Root directory. Can be an absolute or a relative path. |
222 |
| - --all Target all projects in monorepo. |
223 |
| - --changeset-json=<value> Path to the changeset status JSON file. Pass the {filePath} given to `changeset |
224 |
| - status --output={filePath}` |
225 |
| - --from-changeset Target projects in monorepo from changesets. |
226 |
| - --project-types=<option>... Project types managed in the monorepo. Only used in wp-monorepo mode. |
227 |
| - <options: plugins|themes> |
228 |
| -
|
229 |
| -DESCRIPTION |
230 |
| - Removes symlinks in the given wp-content directory created for the project(s) in this monorepo. |
231 |
| -
|
232 |
| -EXAMPLES |
233 |
| - $ wpdev unlink |
234 |
| -
|
235 |
| - $ wpdev unlink wptelegram test-theme |
236 |
| -
|
237 |
| - $ wpdev unlink --all |
238 |
| -``` |
| 55 | +_See code: [src/commands/validate.ts ](https://github.com/wpsocio/wp-projects/blob/@wpsocio/[email protected]/tools/build-utils/src/commands/validate.ts)_ |
239 | 56 |
|
240 |
| -_See code: [src/commands/unlink.ts ](https://github.com/wpsocio/wp-projects/blob/@wpsocio/[email protected]/tools/wpdev/src/commands/unlink.ts)_ |
241 | 57 | <!-- commandsstop -->
|
0 commit comments