@wp-operations/wp-ops 0.7.0 → 0.7.2
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 +1 -1
- package/package.json +1 -1
- package/src/commands/setup.js +3 -2
- package/src/main.js +1 -1
package/README.md
CHANGED
|
@@ -33,7 +33,7 @@ wp-ops doctor
|
|
|
33
33
|
|
|
34
34
|
| Command | What it does |
|
|
35
35
|
|---|---|
|
|
36
|
-
| `init [dir]` | Asks for each section of the project's `platform.json` (name, author, website, languages and default language, content types and their fields, taxonomies, modules, brand color, app categories) and writes it. Start from the default content types or from empty. Then creates the platform theme in `wp-operations/`, `.github/platform.json`, the app manifests, `packages/`, the app folders, the workflows and `.gitignore`, and runs `git init`. `--yes` takes the default `platform.json`; `--template=empty` starts with no content types. Never overwrites a file. |
|
|
36
|
+
| `init [dir]` | Asks for each section of the project's `platform.json` (name, author, website, languages and default language, content types and their fields, taxonomies, modules, brand color, optional app categories) and writes it. Start from the default content types or from empty. Then creates the platform theme in `wp-operations/`, `.github/platform.json`, the app manifests, `packages/`, the app folders, the workflows and `.gitignore`, and runs `git init`. `--yes` takes the default `platform.json`; `--template=empty` starts with no content types. Never overwrites a file. |
|
|
37
37
|
| `github <owner/name>` | Creates the GitHub repository if it does not exist (private unless `--public`), sets it as `origin`, commits and pushes `main`. `init` asks for it at the end (or `--github=owner/name`). Uses `GITHUB_TOKEN`, or the token git already uses for github.com. |
|
|
38
38
|
| `start` | Runs the platform (`wp-operations/`) locally. Site data stays in `.local/` (gitignored). `wp-ops start <dir>` runs one app instead. |
|
|
39
39
|
| `update` | Replaces `wp-operations/` with the platform shipped in your wp-ops version. Update wp-ops first (`npm install -g @wp-operations/wp-ops`), then run it and commit. |
|
package/package.json
CHANGED
package/src/commands/setup.js
CHANGED
|
@@ -72,6 +72,7 @@ export function buildPlatformJson(base, answers = {}) {
|
|
|
72
72
|
|
|
73
73
|
if (a.template === 'empty') {
|
|
74
74
|
config.content = { ...config.content, placeholders: [], types: [], taxonomies: [] };
|
|
75
|
+
if (config.app?.apps) config.app.apps = { ...config.app.apps, categories: [] };
|
|
75
76
|
}
|
|
76
77
|
if (Array.isArray(a.types)) config.content.types.push(...a.types);
|
|
77
78
|
if (Array.isArray(a.taxonomies)) config.content.taxonomies.push(...a.taxonomies);
|
|
@@ -152,8 +153,8 @@ export async function askPlatform(base, { name: suggested = '' } = {}) {
|
|
|
152
153
|
|
|
153
154
|
p.log.step('app');
|
|
154
155
|
answers.brandColor = check(await p.text({ message: 'Brand color', initialValue: base.app?.theme?.colors?.brand || '#8b7cf6', validate: (v) => (/^#[0-9a-f]{3,8}$/i.test(v) ? undefined : 'Use a hex color, e.g. #8b7cf6') }));
|
|
155
|
-
const categories = check(await p.text({ message: 'App categories
|
|
156
|
-
answers.categories = categories.split(',').map((c) => c.trim()).filter(Boolean);
|
|
156
|
+
const categories = check(await p.text({ message: 'App categories, comma separated (optional, Enter to skip)', placeholder: 'e.g. Learning, Business', defaultValue: '' }));
|
|
157
|
+
answers.categories = String(categories || '').split(',').map((c) => c.trim()).filter(Boolean);
|
|
157
158
|
|
|
158
159
|
return answers;
|
|
159
160
|
} catch (error) {
|
package/src/main.js
CHANGED
|
@@ -23,7 +23,7 @@ Usage:
|
|
|
23
23
|
|
|
24
24
|
Platform repository:
|
|
25
25
|
wp-ops init [dir] create a platform repository: asks for each section of platform.json
|
|
26
|
-
(name, languages, content types, taxonomies, modules,
|
|
26
|
+
(name, languages, content types, taxonomies, modules, brand color), then
|
|
27
27
|
writes the platform (wp-operations/), layout, workflows and git
|
|
28
28
|
[--yes: default platform.json] [--template=empty] [--github=owner/name] [--public]
|
|
29
29
|
wp-ops github <owner/name> [--public]
|