@se-studio/contentful-cms 2.4.0 → 2.5.0
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/CHANGELOG.md +26 -0
- package/HOSTED.md +2 -2
- package/INSTALL.md +14 -136
- package/README.md +16 -40
- package/dist/bin/contentful-cms.js +2 -12
- package/dist/bin/contentful-cms.js.map +1 -1
- package/dist/cli/program.d.ts.map +1 -1
- package/dist/cli/program.js +10 -8
- package/dist/cli/program.js.map +1 -1
- package/dist/commands/article-tags-from-json.d.ts +4 -0
- package/dist/commands/article-tags-from-json.d.ts.map +1 -0
- package/dist/commands/article-tags-from-json.js +54 -0
- package/dist/commands/article-tags-from-json.js.map +1 -0
- package/dist/commands/bulk-rtf-replace.d.ts +4 -0
- package/dist/commands/bulk-rtf-replace.d.ts.map +1 -0
- package/dist/commands/bulk-rtf-replace.js +103 -0
- package/dist/commands/bulk-rtf-replace.js.map +1 -0
- package/dist/commands/create-person-from-json.d.ts +4 -0
- package/dist/commands/create-person-from-json.d.ts.map +1 -0
- package/dist/commands/create-person-from-json.js +85 -0
- package/dist/commands/create-person-from-json.js.map +1 -0
- package/dist/commands/create-person.d.ts +4 -0
- package/dist/commands/create-person.d.ts.map +1 -0
- package/dist/commands/create-person.js +56 -0
- package/dist/commands/create-person.js.map +1 -0
- package/dist/commands/create-taxonomy-from-json.d.ts.map +1 -1
- package/dist/commands/create-taxonomy-from-json.js +47 -31
- package/dist/commands/create-taxonomy-from-json.js.map +1 -1
- package/dist/commands/create-taxonomy.d.ts +2 -0
- package/dist/commands/create-taxonomy.d.ts.map +1 -1
- package/dist/commands/create-taxonomy.js +7 -6
- package/dist/commands/create-taxonomy.js.map +1 -1
- package/dist/commands/ensure.d.ts.map +1 -1
- package/dist/commands/ensure.js +49 -0
- package/dist/commands/ensure.js.map +1 -1
- package/dist/commands/help.js +1 -1
- package/dist/commands/help.js.map +1 -1
- package/dist/commands/project.d.ts.map +1 -1
- package/dist/commands/project.js +35 -0
- package/dist/commands/project.js.map +1 -1
- package/dist/contentful/article-tags-from-json.d.ts +25 -0
- package/dist/contentful/article-tags-from-json.d.ts.map +1 -0
- package/dist/contentful/article-tags-from-json.js +121 -0
- package/dist/contentful/article-tags-from-json.js.map +1 -0
- package/dist/contentful/bulk-rtf-replace.d.ts +29 -0
- package/dist/contentful/bulk-rtf-replace.d.ts.map +1 -0
- package/dist/contentful/bulk-rtf-replace.js +119 -0
- package/dist/contentful/bulk-rtf-replace.js.map +1 -0
- package/dist/contentful/entry-fields.d.ts +1 -1
- package/dist/contentful/entry-fields.d.ts.map +1 -1
- package/dist/contentful/entry-fields.js +13 -0
- package/dist/contentful/entry-fields.js.map +1 -1
- package/dist/contentful/person-create.d.ts +31 -0
- package/dist/contentful/person-create.d.ts.map +1 -0
- package/dist/contentful/person-create.js +111 -0
- package/dist/contentful/person-create.js.map +1 -0
- package/dist/editor-pack/capabilities.d.ts +82 -0
- package/dist/editor-pack/capabilities.d.ts.map +1 -0
- package/dist/editor-pack/capabilities.js +350 -0
- package/dist/editor-pack/capabilities.js.map +1 -0
- package/dist/editor-pack/generate.d.ts.map +1 -1
- package/dist/editor-pack/generate.js +57 -15
- package/dist/editor-pack/generate.js.map +1 -1
- package/dist/generated/hosted-guide.d.ts +1 -1
- package/dist/generated/hosted-guide.d.ts.map +1 -1
- package/dist/generated/hosted-guide.js +1 -1
- package/dist/generated/hosted-guide.js.map +1 -1
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.js +1 -1
- package/dist/hosted/customer-playbooks.d.ts.map +1 -1
- package/dist/hosted/customer-playbooks.js +3 -16
- package/dist/hosted/customer-playbooks.js.map +1 -1
- package/dist/hosted/next/pages/CmsEditPage.d.ts.map +1 -1
- package/dist/hosted/next/pages/CmsEditPage.js +1 -1
- package/dist/hosted/next/pages/CmsEditPage.js.map +1 -1
- package/dist/hosted/next/pages/CustomerPlaybooksPage.d.ts.map +1 -1
- package/dist/hosted/next/pages/CustomerPlaybooksPage.js +12 -3
- package/dist/hosted/next/pages/CustomerPlaybooksPage.js.map +1 -1
- package/dist/hosted/next/pages/HomePage.d.ts.map +1 -1
- package/dist/hosted/next/pages/HomePage.js +1 -1
- package/dist/hosted/next/pages/HomePage.js.map +1 -1
- package/dist/mcp/guide.d.ts +2 -2
- package/dist/mcp/guide.d.ts.map +1 -1
- package/dist/mcp/guide.js +10 -5
- package/dist/mcp/guide.js.map +1 -1
- package/dist/mcp/prompts/onboarding.d.ts.map +1 -1
- package/dist/mcp/prompts/onboarding.js +116 -2
- package/dist/mcp/prompts/onboarding.js.map +1 -1
- package/dist/mcp/server.d.ts +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/project/doctor.d.ts +9 -0
- package/dist/project/doctor.d.ts.map +1 -0
- package/dist/project/doctor.js +136 -0
- package/dist/project/doctor.js.map +1 -0
- package/docs/FUNCTIONAL_SPEC.md +1 -1
- package/docs/MEDIA_INDEX_PLAN.md +1 -1
- package/docs/SKILLS.md +3 -3
- package/docs/help/article-tags-from-json.md +62 -0
- package/docs/help/bulk-rtf-replace.md +80 -0
- package/docs/help/index.md +16 -1
- package/docs/help/person-from-json.md +82 -0
- package/docs/mcp/hosted-guide.md +15 -4
- package/package.json +2 -5
- package/skills/README.md +1 -1
- package/skills/core/SKILL.md +7 -1
- package/skills/editor-tasks/SKILL.md +83 -0
- package/skills/manifest.json +2 -1
- package/skills/setup/SKILL.md +21 -87
- package/dist/bin/cms-edit-mcp.d.ts +0 -3
- package/dist/bin/cms-edit-mcp.d.ts.map +0 -1
- package/dist/bin/cms-edit-mcp.js +0 -15
- package/dist/bin/cms-edit-mcp.js.map +0 -1
- package/dist/bin/cms-edit-setup.d.ts +0 -3
- package/dist/bin/cms-edit-setup.d.ts.map +0 -1
- package/dist/bin/cms-edit-setup.js +0 -7
- package/dist/bin/cms-edit-setup.js.map +0 -1
- package/dist/setup/wizard.d.ts +0 -4
- package/dist/setup/wizard.d.ts.map +0 -1
- package/dist/setup/wizard.js +0 -260
- package/dist/setup/wizard.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @se-studio/contentful-cms Changelog
|
|
2
2
|
|
|
3
|
+
## 2.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- bc538fd: Editor-pack capabilities router (`capabilities.json`, `tasks-index`, task playbooks), batch commands (`article-tags-from-json`, `bulk-rtf-replace`, `create person` / `person-from-json`, `ensure person`), and `cms-edit project doctor`.
|
|
8
|
+
|
|
9
|
+
Hosted-first MCP: setup wizard, `cms-edit setup`, `cms-edit-setup` and `cms-edit-mcp` bins, and local install scripts removed. Editors connect via `/cms-edit` OAuth; developers use `cms-edit` CLI (`npx @se-studio/contentful-cms` aliases the CLI).
|
|
10
|
+
|
|
11
|
+
**Breaking:** Do not use local `mcpServers.cms-edit` or `cms-edit setup` — those entry points are removed.
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- bc538fd: chore: dependency updates (contentful-management, live-preview, hubspot api-client, js-yaml, biome js-api)
|
|
16
|
+
|
|
17
|
+
## Unreleased
|
|
18
|
+
|
|
19
|
+
### Minor Changes
|
|
20
|
+
|
|
21
|
+
- **Editor-pack capabilities router** — `capabilities.json`, `tasks-index.md`, `checklist.md`, and per-task playbooks generated with `editor-pack generate`; `cms-edit project doctor` validates example sites.
|
|
22
|
+
- **Batch commands** — `article-tags-from-json`, `bulk-rtf-replace`, `create person` / `person-from-json`, `ensure person`; taxonomy batch continues on per-item errors with aggregate JSON output.
|
|
23
|
+
- **Hosted-first MCP** — setup wizard, `cms-edit setup`, `cms-edit-setup` bin, and local stdio MCP (`cms-edit-mcp`) removed. Editors use `/cms-edit` OAuth; developers use `cms-edit` CLI. `npx @se-studio/contentful-cms` aliases the CLI.
|
|
24
|
+
|
|
25
|
+
### Breaking Changes
|
|
26
|
+
|
|
27
|
+
- **Removed:** `cms-edit setup`, `cms-edit-setup` bin, `cms-edit-mcp` bin, `install.sh` / `install.ps1` local MCP installers.
|
|
28
|
+
|
|
3
29
|
## 2.4.0
|
|
4
30
|
|
|
5
31
|
### Minor Changes
|
package/HOSTED.md
CHANGED
|
@@ -110,6 +110,6 @@ Older deployments used a Claude Desktop **extension** (`.mcpb`) with a manual Co
|
|
|
110
110
|
|
|
111
111
|
---
|
|
112
112
|
|
|
113
|
-
##
|
|
113
|
+
## Developers
|
|
114
114
|
|
|
115
|
-
|
|
115
|
+
Local stdio MCP is not supported. Use the hosted connector URL from `/cms-edit`, or run `cms-edit` CLI in a repo with `.contentful-cms.json`. See [INSTALL.md](./INSTALL.md).
|
package/INSTALL.md
CHANGED
|
@@ -1,151 +1,29 @@
|
|
|
1
|
-
# Installing the Contentful CMS Editor for Claude
|
|
1
|
+
# Installing the Contentful CMS Editor for Claude
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Editors connect Claude to Contentful through **hosted cms-edit MCP** — no Node.js, terminal, or personal access token required.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Hosted setup
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|------|-----|--------------|
|
|
9
|
-
| **Hosted** | Content editors on a client site | Claude Desktop Integrations + onboarding URL from SE — **no Node.js** |
|
|
10
|
-
| **Local** | Developers / multi-space workflows | Node.js + setup wizard |
|
|
7
|
+
If SE sent you an **onboarding link** (e.g. `https://your-site.content.se.studio/cms-edit`), follow [HOSTED.md](./HOSTED.md):
|
|
11
8
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
If SE sent you an **onboarding link** (e.g. `https://your-site.content.se.studio/cms-edit`), follow [HOSTED.md](./HOSTED.md). Connect via Claude Integrations and sign in with Contentful — no terminal, Node.js, or personal access token required.
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## Local setup (developers)
|
|
21
|
-
|
|
22
|
-
### What you'll need
|
|
23
|
-
|
|
24
|
-
- **Contentful Management Token** — a secret key that gives Claude permission to edit content (the setup wizard will discover your Space ID and environments automatically)
|
|
25
|
-
- **Node.js** — required to run the setup wizard and local MCP. Download the LTS version from [nodejs.org](https://nodejs.org) if you don't have it
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
### Step 1 — Get your Contentful Management Token
|
|
30
|
-
|
|
31
|
-
1. Log in to [contentful.com](https://app.contentful.com)
|
|
32
|
-
2. Click **Settings** in the top menu → **API keys**
|
|
33
|
-
3. Click the **Content management tokens** tab
|
|
34
|
-
4. Click **Generate personal token**
|
|
35
|
-
5. Give it a name (e.g. `Claude Desktop`) and click **Generate**
|
|
36
|
-
6. **Copy the token now** — you won't be able to see it again
|
|
9
|
+
1. Open the link and click **Connect to Claude**
|
|
10
|
+
2. Confirm the connector in Claude Desktop or claude.ai
|
|
11
|
+
3. Sign in with your Contentful account when prompted
|
|
12
|
+
4. Verify by asking Claude to read the cms-edit **tasks-index**
|
|
37
13
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
### Step 2 — Run the setup wizard
|
|
41
|
-
|
|
42
|
-
Open a terminal and run:
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
npx @se-studio/contentful-cms@latest setup
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
The wizard will:
|
|
49
|
-
1. Ask for your management token (input is hidden)
|
|
50
|
-
2. Automatically discover which Contentful spaces and environments your token has access to
|
|
51
|
-
3. Ask for a short project name and an optional staging URL
|
|
52
|
-
4. Write your config file and update Claude Desktop automatically
|
|
53
|
-
|
|
54
|
-
That's it — no need to find your Space ID manually.
|
|
14
|
+
**Reconnect:** use `/cms-edit` on your site or Claude → Settings → Integrations.
|
|
55
15
|
|
|
56
16
|
---
|
|
57
17
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
Fully quit Claude Desktop and reopen it.
|
|
61
|
-
|
|
62
|
-
- **Mac:** Right-click the Dock icon and choose **Quit** (just closing the window isn't enough)
|
|
63
|
-
- **Windows/Linux:** Close the window and reopen from the Start menu / app launcher
|
|
64
|
-
|
|
65
|
-
---
|
|
66
|
-
|
|
67
|
-
### Step 4 — Test it
|
|
68
|
-
|
|
69
|
-
In a new Claude conversation, type:
|
|
70
|
-
|
|
71
|
-
> What Contentful spaces do you have access to?
|
|
72
|
-
|
|
73
|
-
Claude should respond with the space name you chose. If it does, you're all set.
|
|
74
|
-
|
|
75
|
-
---
|
|
76
|
-
|
|
77
|
-
## Adding more spaces later
|
|
78
|
-
|
|
79
|
-
Run the wizard again for each additional space:
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
npx @se-studio/contentful-cms@latest setup
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
Each run merges a new space into your existing config — it won't overwrite spaces you've already set up.
|
|
86
|
-
|
|
87
|
-
---
|
|
88
|
-
|
|
89
|
-
## Manual setup (if you'd prefer not to use the wizard)
|
|
90
|
-
|
|
91
|
-
<details>
|
|
92
|
-
<summary>Click to expand manual instructions</summary>
|
|
93
|
-
|
|
94
|
-
### Create your config file
|
|
95
|
-
|
|
96
|
-
Create a file called `.contentful-cms.json` in your home folder:
|
|
97
|
-
- **Windows:** `C:\Users\YourName\.contentful-cms.json`
|
|
98
|
-
- **Mac/Linux:** `~/.contentful-cms.json`
|
|
99
|
-
|
|
100
|
-
```json
|
|
101
|
-
{
|
|
102
|
-
"defaultSpace": "my-project",
|
|
103
|
-
"spaces": {
|
|
104
|
-
"my-project": {
|
|
105
|
-
"spaceId": "YOUR_SPACE_ID",
|
|
106
|
-
"environment": "master",
|
|
107
|
-
"managementToken": "YOUR_MANAGEMENT_TOKEN",
|
|
108
|
-
"defaultLocale": "en-US"
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
Replace `my-project` (both places), `YOUR_SPACE_ID`, and `YOUR_MANAGEMENT_TOKEN` with your values.
|
|
115
|
-
|
|
116
|
-
Your Space ID is in Contentful under **Settings → General settings**.
|
|
117
|
-
|
|
118
|
-
**Windows tip:** In Notepad's Save dialog, set "Save as type" to **All Files** so it doesn't add `.txt`.
|
|
119
|
-
|
|
120
|
-
### Configure Claude Desktop
|
|
121
|
-
|
|
122
|
-
Edit the Claude Desktop config file:
|
|
123
|
-
- **Windows:** `C:\Users\YourName\AppData\Roaming\Claude\claude_desktop_config.json`
|
|
124
|
-
- **Mac:** `/Users/YourName/Library/Application Support/Claude/claude_desktop_config.json`
|
|
125
|
-
- **Linux:** `~/.config/Claude/claude_desktop_config.json`
|
|
126
|
-
|
|
127
|
-
Add (or merge) this into the file:
|
|
128
|
-
|
|
129
|
-
```json
|
|
130
|
-
{
|
|
131
|
-
"mcpServers": {
|
|
132
|
-
"cms-edit": {
|
|
133
|
-
"command": "npx",
|
|
134
|
-
"args": ["-y", "@se-studio/contentful-cms@latest"],
|
|
135
|
-
"cwd": "/Users/YourName"
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
Replace `/Users/YourName` with your actual home folder path.
|
|
18
|
+
## Developers
|
|
142
19
|
|
|
143
|
-
|
|
20
|
+
Local stdio MCP and the setup wizard are **not supported**.
|
|
144
21
|
|
|
145
|
-
|
|
22
|
+
- **Content editing via Claude:** use the hosted connector URL from your site's `/cms-edit` page (same as editors).
|
|
23
|
+
- **CLI / agents in a repo:** configure `.contentful-cms.json`, install skills (`npx skills add @se-studio/skills` or `cms-edit skill install`), and read the editor pack before editing. See [README.md](./README.md) and [docs/SKILLS.md](./docs/SKILLS.md).
|
|
146
24
|
|
|
147
25
|
---
|
|
148
26
|
|
|
149
27
|
## Something not working?
|
|
150
28
|
|
|
151
|
-
Get in touch and we'll sort it out together.
|
|
29
|
+
Get in touch and we'll sort it out together.
|
package/README.md
CHANGED
|
@@ -17,50 +17,19 @@ pnpm install
|
|
|
17
17
|
pnpm build
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
## MCP Setup (
|
|
20
|
+
## MCP Setup (hosted)
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
Editors connect Claude via **hosted cms-edit MCP** (OAuth) — no Node.js or local setup wizard.
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
1. Deploy a thin Next.js host (`cms-edit host scaffold`) or use an existing site host
|
|
25
|
+
2. Configure OAuth env vars (see [HOSTED.md](./HOSTED.md))
|
|
26
|
+
3. Send editors the `/cms-edit` onboarding URL
|
|
25
27
|
|
|
26
|
-
|
|
28
|
+
Shared route logic lives in `@se-studio/contentful-cms/hosted/next`. Editor walkthrough: [INSTALL.md](./INSTALL.md).
|
|
27
29
|
|
|
28
|
-
|
|
29
|
-
npx @se-studio/contentful-cms@latest setup
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
It discovers your Contentful spaces and environments automatically from your management token, writes `~/.contentful-cms.json`, and updates the Claude Desktop config. See [INSTALL.md](./INSTALL.md) for a full walkthrough.
|
|
33
|
-
|
|
34
|
-
**Hosted mode (no Node.js for editors):** deploy a thin Next.js host to Vercel (`cms-edit host scaffold`), configure OAuth env vars, and send editors your `/cms-edit` onboarding URL plus [HOSTED.md](./HOSTED.md). Shared route logic lives in `@se-studio/contentful-cms/hosted/next`.
|
|
35
|
-
|
|
36
|
-
**Manual config** — if you'd prefer to configure by hand, add this to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
|
|
37
|
-
|
|
38
|
-
```json
|
|
39
|
-
{
|
|
40
|
-
"mcpServers": {
|
|
41
|
-
"cms-edit": {
|
|
42
|
-
"command": "npx",
|
|
43
|
-
"args": ["-y", "@se-studio/contentful-cms@latest"],
|
|
44
|
-
"cwd": "/path/to/your/project"
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
- `cwd` must point to the directory containing your `.contentful-cms.json` (or omit `cwd` and place the file in your home directory — `~/.contentful-cms.json` on macOS/Linux, `C:\Users\<you>\.contentful-cms.json` on Windows).
|
|
51
|
-
- `npx -y @se-studio/contentful-cms` always pulls the latest published version — no global install needed.
|
|
52
|
-
|
|
53
|
-
If you have the package installed globally, you can use `"command": "cms-edit-mcp"` (no `args`) instead.
|
|
54
|
-
|
|
55
|
-
### Claude Code
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
claude mcp add cms-edit -- npx -y @se-studio/contentful-cms
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
Then set env vars in your project's `.env.local` (they are picked up automatically via the config's `${ENV_VAR}` syntax).
|
|
30
|
+
**Local stdio MCP is not supported** — do not register `mcpServers.cms-edit` in Claude Desktop. Developers use the hosted connector URL from the site's `/cms-edit` page, or run `cms-edit` (or `npx @se-studio/contentful-cms`) in a repo with `.contentful-cms.json`.
|
|
62
31
|
|
|
63
|
-
### What
|
|
32
|
+
### What hosted MCP exposes
|
|
64
33
|
|
|
65
34
|
A single `cms_edit` tool that accepts an `args` array matching any `cms-edit` CLI command:
|
|
66
35
|
|
|
@@ -257,9 +226,12 @@ For content types that follow the `${contentType}Type` naming convention (e.g. `
|
|
|
257
226
|
| `create from-json --file <path> --dry-run` | Preview the creation plan without writing to Contentful |
|
|
258
227
|
| `create from-json --file <path> --strict` | Fail on unknown JSON keys (also strict on `--dry-run`) |
|
|
259
228
|
| `create taxonomy-from-json --file <path> [--if-not-exists] [--dry-run]` | Batch-create tagType, articleType, and tag entries from JSON |
|
|
229
|
+
| `create person-from-json --file <path> [--if-not-exists] [--dry-run]` | Batch-create person/author entries from JSON |
|
|
230
|
+
| `create person --slug <slug> --name "X" [--job-title <t>] [--json-file <path>] [--if-not-exists] [--dry-run]` | Create a person entry (draft) |
|
|
231
|
+
| `create person … [--bio-markdown <md>]` or `[--bio-file <path>]` | Bio as Markdown (mutually exclusive paths) |
|
|
260
232
|
| `create tag-type --slug <slug> --name "X" [--json-file <path>] [--if-not-exists] [--dry-run]` | Create a tagType entry (draft) |
|
|
261
233
|
| `create article-type --slug <slug> --name "X" [--json-file <path>] [--if-not-exists] [--dry-run]` | Create an articleType entry (draft) |
|
|
262
|
-
| `create tag --slug <slug> --name "X" --tag-type <tagType-slug> [--tag-type-id <id>] [--description <desc>] [--featured-image <asset-id>] [--json-file <path>] [--if-not-exists]` | Create a tag entry (draft) |
|
|
234
|
+
| `create tag --slug <slug> --name "X" --tag-type <tagType-slug> [--tag-type-id <id>] [--description <desc>] [--featured-image <asset-id>] [--json-file <path>] [--if-not-exists] [--dry-run]` | Create a tag entry (draft) |
|
|
263
235
|
| `create template --label "X"` | Create a new template entry |
|
|
264
236
|
| `create media --asset-id <id> --name "X" [--position Left\|Middle\|Right] [--width <1–100>]` | Create a **Media** entry (draft); does not start a new cms-edit session; prints entry ID for `rtf embed` |
|
|
265
237
|
|
|
@@ -276,6 +248,10 @@ For content types that follow the `${contentType}Type` naming convention (e.g. `
|
|
|
276
248
|
| `ensure tag-type --slug <slug> --name "X" [--json-file <path>]` | Create tagType if missing; return existing ID when slug matches |
|
|
277
249
|
| `ensure article-type --slug <slug> --name "X" [--json-file <path>]` | Create articleType if missing |
|
|
278
250
|
| `ensure tag --slug <slug> --name "X" --tag-type <slug> [--description <desc>] [--featured-image <asset-id>] [--json-file <path>]` | Create tag if missing |
|
|
251
|
+
| `ensure person --slug <slug> --name "X" [--job-title <t>] [--json-file <path>]` | Create person if missing |
|
|
252
|
+
| `ensure person … [--bio-markdown <md>]` or `[--bio-file <path>]` | Bio as Markdown (mutually exclusive paths) |
|
|
253
|
+
| `article-tags-from-json --file <path> [--dry-run]` | Set tags on multiple articles from JSON |
|
|
254
|
+
| `bulk-rtf-replace --find <text> --replace-plain <text> [--include page,article] [--prefix <slug>] [--limit <n>] [--dry-run]` | Find-replace plain text in Rich Text across page/article trees |
|
|
279
255
|
|
|
280
256
|
Set `CMS_EDIT_JSON=1` for machine-readable output (`{ ok, id, slug, contentType, status }`).
|
|
281
257
|
|
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
//
|
|
3
|
-
|
|
4
|
-
if (process.argv[2] === 'setup') {
|
|
5
|
-
const { runSetupWizard } = await import('../setup/wizard.js');
|
|
6
|
-
await runSetupWizard().catch((err) => {
|
|
7
|
-
console.error(err instanceof Error ? err.message : String(err));
|
|
8
|
-
process.exit(1);
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
else {
|
|
12
|
-
await import('./cms-edit-mcp.js');
|
|
13
|
-
}
|
|
2
|
+
// Alias for `cms-edit` — `npx @se-studio/contentful-cms` runs the CLI (hosted MCP is via `/cms-edit` OAuth).
|
|
3
|
+
await import('./cms-edit.js');
|
|
14
4
|
export {};
|
|
15
5
|
//# sourceMappingURL=contentful-cms.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contentful-cms.js","sourceRoot":"","sources":["../../src/bin/contentful-cms.ts"],"names":[],"mappings":";AACA,
|
|
1
|
+
{"version":3,"file":"contentful-cms.js","sourceRoot":"","sources":["../../src/bin/contentful-cms.ts"],"names":[],"mappings":";AACA,6GAA6G;AAE7G,MAAM,MAAM,CAAC,eAAe,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../../src/cli/program.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAEvF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../../src/cli/program.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAEvF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkEpC,MAAM,WAAW,mBAAmB;IAClC,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7D,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;CAClC;AAED,wBAAgB,oBAAoB,CAAC,KAAK,GAAE,mBAAwB,GAAG,OAAO,CA2G7E"}
|
package/dist/cli/program.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
/** biome-ignore-all lint/suspicious/noConsole: Console output is intentional in CLI */
|
|
2
2
|
import { Command } from 'commander';
|
|
3
3
|
import { registerAddCommand } from '../commands/add.js';
|
|
4
|
+
import { registerArticleTagsFromJsonCommand } from '../commands/article-tags-from-json.js';
|
|
4
5
|
import { registerAssetCommand } from '../commands/asset.js';
|
|
5
6
|
import { registerAuditCommand } from '../commands/audit.js';
|
|
6
7
|
import { registerBackupCommand } from '../commands/backup.js';
|
|
7
8
|
import { registerBatchCommand } from '../commands/batch.js';
|
|
9
|
+
import { registerBulkRtfReplaceCommand } from '../commands/bulk-rtf-replace.js';
|
|
8
10
|
import { registerColoursCommand } from '../commands/colours.js';
|
|
9
11
|
import { registerCreateCommand } from '../commands/create.js';
|
|
10
12
|
import { registerCreateFromJsonCommand } from '../commands/create-from-json.js';
|
|
13
|
+
import { registerPersonCreateCommands } from '../commands/create-person.js';
|
|
14
|
+
import { registerPersonFromJsonCommand } from '../commands/create-person-from-json.js';
|
|
11
15
|
import { registerTaxonomyCreateCommands } from '../commands/create-taxonomy.js';
|
|
12
16
|
import { registerTaxonomyFromJsonCommand } from '../commands/create-taxonomy-from-json.js';
|
|
13
17
|
import { registerCustomerCommand } from '../commands/customer.js';
|
|
@@ -46,14 +50,14 @@ import { registerSnapshotCommand } from '../commands/snapshot.js';
|
|
|
46
50
|
import { registerTypesCommand } from '../commands/types.js';
|
|
47
51
|
import { registerVersionCommand } from '../commands/version.js';
|
|
48
52
|
import { setJsonMode } from '../output/mode.js';
|
|
49
|
-
import { runSetupWizard } from '../setup/wizard.js';
|
|
50
53
|
import { beginTelemetryCommand, recordTelemetryOutcome } from '../telemetry/index.js';
|
|
51
54
|
import { CMS_EDIT_VERSION } from '../version.js';
|
|
52
55
|
const LLM_INTRO = 'Opinionated CLI for editing Contentful draft content (pages, articles, templates, navigation). No publish — all saves create drafts.\n' +
|
|
53
56
|
'Workflow: open → snapshot → read/set/rtf/add/remove/move → diff → save. Use @refs from snapshot (e.g. @c0); re-snapshot after add/remove/move.\n' +
|
|
54
|
-
'Detailed help: cms-edit help <topic> Topics: workflow, create-from-json, taxonomy-from-json, run, fields, fields-page, fields-article, fields-component, fields-collection, fields-taxonomy\n' +
|
|
57
|
+
'Detailed help: cms-edit help <topic> Topics: workflow, create-from-json, taxonomy-from-json, person-from-json, article-tags-from-json, bulk-rtf-replace, run, fields, fields-page, fields-article, fields-component, fields-collection, fields-taxonomy\n' +
|
|
55
58
|
'Single-shot page/article creation: cms-edit help create-from-json\n' +
|
|
56
59
|
'Taxonomy bootstrap: cms-edit help taxonomy-from-json\n' +
|
|
60
|
+
'Author import: cms-edit help person-from-json\n' +
|
|
57
61
|
'Full README: cms-edit --docs. Install skills: cms-edit skill install.\n' +
|
|
58
62
|
'Visual checks: cms-edit preview url <slug> or cms-edit preview showcase --component <type> (use browser MCP to open the URL).';
|
|
59
63
|
export function createCmsEditProgram(hooks = {}) {
|
|
@@ -109,8 +113,12 @@ export function createCmsEditProgram(hooks = {}) {
|
|
|
109
113
|
registerRevertCommand(program);
|
|
110
114
|
const createCmd = registerCreateCommand(program);
|
|
111
115
|
registerTaxonomyCreateCommands(createCmd, program);
|
|
116
|
+
registerPersonCreateCommands(createCmd, program);
|
|
112
117
|
registerCreateFromJsonCommand(createCmd);
|
|
113
118
|
registerTaxonomyFromJsonCommand(createCmd, program);
|
|
119
|
+
registerPersonFromJsonCommand(createCmd, program);
|
|
120
|
+
registerArticleTagsFromJsonCommand(program);
|
|
121
|
+
registerBulkRtfReplaceCommand(program);
|
|
114
122
|
registerEnsureCommand(program);
|
|
115
123
|
registerNavCommand(program);
|
|
116
124
|
registerAssetCommand(program);
|
|
@@ -135,12 +143,6 @@ export function createCmsEditProgram(hooks = {}) {
|
|
|
135
143
|
registerEditorPackCommand(program);
|
|
136
144
|
registerHostCommand(program);
|
|
137
145
|
registerHelpCommand(program);
|
|
138
|
-
program
|
|
139
|
-
.command('setup')
|
|
140
|
-
.description('Interactive wizard to configure Claude Desktop with your Contentful credentials')
|
|
141
|
-
.action(async () => {
|
|
142
|
-
await runSetupWizard();
|
|
143
|
-
});
|
|
144
146
|
program.parseAsync = wrapParseAsync(program.parseAsync.bind(program), (err) => {
|
|
145
147
|
recordTelemetryOutcome('error', {
|
|
146
148
|
exitCode: 1,
|
package/dist/cli/program.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"program.js","sourceRoot":"","sources":["../../src/cli/program.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAEvF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,8BAA8B,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,EAAE,+BAA+B,EAAE,MAAM,0CAA0C,CAAC;AAC3F,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CA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AAsB,CAAC,OAAO,EAAE;YAC9B,QAAQ,EAAE,CAAC;YACX,SAAS,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc;SACxE,CAAC,CAAC;QACH,KAAK,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,cAAc,CACrB,QAA+B,EAC/B,OAA+B;IAE/B,OAAO,KAAK,EAAE,GAAG,IAAuC,EAAE,EAAE;QAC1D,IAAI,CAAC;YACH,OAAO,MAAM,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC;QACjC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,GAAG,CAAC,CAAC;YACb,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"article-tags-from-json.d.ts","sourceRoot":"","sources":["../../src/commands/article-tags-from-json.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAGvF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYzC,wBAAgB,kCAAkC,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAsDzE"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/** biome-ignore-all lint/suspicious/noConsole: Console output is intentional in CLI */
|
|
2
|
+
import { readFileSync } from 'node:fs';
|
|
3
|
+
import { runArticleTagsFromJson, } from '../contentful/article-tags-from-json.js';
|
|
4
|
+
import { isJsonMode } from '../output/mode.js';
|
|
5
|
+
import { errorMsg, infoMsg, warnMsg } from '../output/print.js';
|
|
6
|
+
export function registerArticleTagsFromJsonCommand(program) {
|
|
7
|
+
program
|
|
8
|
+
.command('article-tags-from-json')
|
|
9
|
+
.description('Set tags on one or more articles from a JSON file.\n' +
|
|
10
|
+
'Resolves tag slugs via the local index (run index sync first).\n' +
|
|
11
|
+
'Continues on per-item errors and reports successes and failures.')
|
|
12
|
+
.option('--file <path>', 'Path to article-tags JSON file (required)')
|
|
13
|
+
.option('--dry-run', 'Validate and preview without saving')
|
|
14
|
+
.action(async (opts) => {
|
|
15
|
+
const parentOpts = program.opts();
|
|
16
|
+
if (!opts.file) {
|
|
17
|
+
errorMsg('--file is required.');
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
|
20
|
+
let spec;
|
|
21
|
+
try {
|
|
22
|
+
spec = JSON.parse(readFileSync(opts.file, 'utf8'));
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
errorMsg(`Could not read or parse JSON file "${opts.file}".`);
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
const batch = await runArticleTagsFromJson({
|
|
29
|
+
items: spec.articles ?? [],
|
|
30
|
+
dryRun: opts.dryRun,
|
|
31
|
+
configPath: parentOpts.config,
|
|
32
|
+
spaceKey: parentOpts.space,
|
|
33
|
+
});
|
|
34
|
+
const { results } = batch;
|
|
35
|
+
const updated = results.filter((r) => r.status === 'updated').length;
|
|
36
|
+
const failed = results.filter((r) => r.status === 'failed');
|
|
37
|
+
if (isJsonMode()) {
|
|
38
|
+
console.log(JSON.stringify({ ok: batch.ok, articles: results }));
|
|
39
|
+
}
|
|
40
|
+
else if (!opts.dryRun) {
|
|
41
|
+
infoMsg(`Updated tags on ${String(updated)} article(s); ${String(results.length - updated - failed.length)} unchanged/skipped.`);
|
|
42
|
+
if (failed.length > 0) {
|
|
43
|
+
warnMsg(`${String(failed.length)} article(s) failed:`);
|
|
44
|
+
for (const row of failed) {
|
|
45
|
+
warnMsg(` ${row.articleSlug}: ${row.message ?? 'unknown error'}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (!batch.ok) {
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=article-tags-from-json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"article-tags-from-json.js","sourceRoot":"","sources":["../../src/commands/article-tags-from-json.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAEvF,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EAEL,sBAAsB,GACvB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAMhE,MAAM,UAAU,kCAAkC,CAAC,OAAgB;IACjE,OAAO;SACJ,OAAO,CAAC,wBAAwB,CAAC;SACjC,WAAW,CACV,sDAAsD;QACpD,kEAAkE;QAClE,kEAAkE,CACrE;SACA,MAAM,CAAC,eAAe,EAAE,2CAA2C,CAAC;SACpE,MAAM,CAAC,WAAW,EAAE,qCAAqC,CAAC;SAC1D,MAAM,CAAC,KAAK,EAAE,IAAyC,EAAE,EAAE;QAC1D,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,EAAuC,CAAC;QACvE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACf,QAAQ,CAAC,qBAAqB,CAAC,CAAC;YAChC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,IAAI,IAA0B,CAAC;QAC/B,IAAI,CAAC;YACH,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAyB,CAAC;QAC7E,CAAC;QAAC,MAAM,CAAC;YACP,QAAQ,CAAC,sCAAsC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC;YAC9D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,sB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E,EAAE,CAAC;YACd,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bulk-rtf-replace.d.ts","sourceRoot":"","sources":["../../src/commands/bulk-rtf-replace.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAEvF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAazC,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAuIpE"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/** biome-ignore-all lint/suspicious/noConsole: Console output is intentional in CLI */
|
|
2
|
+
import { loadConfig, resolveSpaceConfig } from '../config/load.js';
|
|
3
|
+
import { applyBulkRtfEntryChanges, dedupeBulkRtfChanges, fetchRootEntryIds, findRtfReplacementsInTree, } from '../contentful/bulk-rtf-replace.js';
|
|
4
|
+
import { createSafeEnvironment } from '../contentful/client.js';
|
|
5
|
+
import { fetchEntryTree } from '../contentful/fetch.js';
|
|
6
|
+
import { isJsonMode } from '../output/mode.js';
|
|
7
|
+
import { errorMsg, infoMsg, successMsg } from '../output/print.js';
|
|
8
|
+
export function registerBulkRtfReplaceCommand(program) {
|
|
9
|
+
program
|
|
10
|
+
.command('bulk-rtf-replace')
|
|
11
|
+
.description('Find and replace plain text across Rich Text fields in page/article entry trees.\n' +
|
|
12
|
+
'Scans each root entry and all linked child entries. All saves create drafts.')
|
|
13
|
+
.requiredOption('--find <text>', 'Plain text to find')
|
|
14
|
+
.requiredOption('--replace-plain <text>', 'Plain text replacement')
|
|
15
|
+
.option('--include <types>', 'Comma-separated root content types (default: page,article)', 'page,article')
|
|
16
|
+
.option('--prefix <slug>', 'Only roots whose slug starts with this prefix (e.g. /blog)')
|
|
17
|
+
.option('--limit <n>', 'Maximum root entries total across all --include types (default: 500)', '500')
|
|
18
|
+
.option('--dry-run', 'Validate and preview without saving')
|
|
19
|
+
.action(async (opts, cmd) => {
|
|
20
|
+
const parentOpts = cmd.parent?.opts() ?? {};
|
|
21
|
+
if (!opts.find) {
|
|
22
|
+
errorMsg('--find is required.');
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
const contentTypes = opts.include
|
|
26
|
+
.split(',')
|
|
27
|
+
.map((s) => s.trim())
|
|
28
|
+
.filter(Boolean);
|
|
29
|
+
if (contentTypes.length === 0) {
|
|
30
|
+
errorMsg('--include must list at least one content type.');
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
const maxRoots = Number.parseInt(opts.limit, 10) || 500;
|
|
34
|
+
try {
|
|
35
|
+
const config = loadConfig(parentOpts.config);
|
|
36
|
+
const { space } = resolveSpaceConfig(config, parentOpts.space);
|
|
37
|
+
const env = await createSafeEnvironment(space);
|
|
38
|
+
const locale = space.defaultLocale;
|
|
39
|
+
const roots = await fetchRootEntryIds(env, contentTypes, opts.prefix, locale, maxRoots);
|
|
40
|
+
if (roots.length === 0) {
|
|
41
|
+
infoMsg('No matching root entries found.');
|
|
42
|
+
if (isJsonMode()) {
|
|
43
|
+
console.log(JSON.stringify({ ok: true, roots: 0, entriesModified: 0, matches: 0 }));
|
|
44
|
+
}
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
infoMsg(`Scanning ${String(roots.length)} root ${roots.length === 1 ? 'entry' : 'entries'} for "${opts.find}"…`);
|
|
48
|
+
const allChanges = [];
|
|
49
|
+
let totalMatches = 0;
|
|
50
|
+
for (const root of roots) {
|
|
51
|
+
const tree = await fetchEntryTree(env, root.id);
|
|
52
|
+
const changes = await findRtfReplacementsInTree(env, space, locale, tree, {
|
|
53
|
+
find: opts.find,
|
|
54
|
+
replacePlain: opts.replacePlain,
|
|
55
|
+
dryRun: opts.dryRun,
|
|
56
|
+
});
|
|
57
|
+
for (const change of changes) {
|
|
58
|
+
for (const field of change.fields) {
|
|
59
|
+
totalMatches += field.matchCount;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (changes.length > 0) {
|
|
63
|
+
allChanges.push(...changes);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
const dedupedChanges = dedupeBulkRtfChanges(allChanges);
|
|
67
|
+
if (opts.dryRun) {
|
|
68
|
+
if (isJsonMode()) {
|
|
69
|
+
console.log(JSON.stringify({
|
|
70
|
+
ok: true,
|
|
71
|
+
dryRun: true,
|
|
72
|
+
roots: roots.length,
|
|
73
|
+
entriesWithMatches: dedupedChanges.length,
|
|
74
|
+
matches: totalMatches,
|
|
75
|
+
changes: dedupedChanges,
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
infoMsg(`[dry-run] ${String(dedupedChanges.length)} ${dedupedChanges.length === 1 ? 'entry' : 'entries'} would change (${String(totalMatches)} match(es)).`);
|
|
80
|
+
}
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const saved = await applyBulkRtfEntryChanges(env, locale, dedupedChanges);
|
|
84
|
+
if (isJsonMode()) {
|
|
85
|
+
console.log(JSON.stringify({
|
|
86
|
+
ok: true,
|
|
87
|
+
roots: roots.length,
|
|
88
|
+
entriesModified: saved.length,
|
|
89
|
+
matches: totalMatches,
|
|
90
|
+
savedEntryIds: saved,
|
|
91
|
+
}));
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
successMsg(`Updated ${String(saved.length)} ${saved.length === 1 ? 'entry' : 'entries'} (${String(totalMatches)} replacement(s)).`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
catch (err) {
|
|
98
|
+
errorMsg(err instanceof Error ? err.message : String(err));
|
|
99
|
+
process.exit(1);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=bulk-rtf-replace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bulk-rtf-replace.js","sourceRoot":"","sources":["../../src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CAAC;oBACN,OAAO,CACL,aAAa,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,kBAAkB,MAAM,CAAC,YAAY,CAAC,cAAc,CACpJ,CAAC;gBACJ,CAAC;gBACD,OAAO;YACT,CAAC;YAED,MAAM,KAAK,GAAG,MAAM,wBAAwB,CAAC,GAAG,EAAE,MAAM,EAAE,cAAc,CAAC,CAAC;YAE1E,IAAI,UAAU,EAAE,EAAE,CAAC;gBACjB,OAAO,CAAC,GAAG,CACT,IAAI,CAAC,SAAS,CAAC;oBACb,EAAE,EAAE,IAAI;oBACR,KAAK,EAAE,KAAK,CAAC,MAAM;oBACnB,eAAe,EAAE,KAAK,CAAC,MAAM;oBAC7B,OAAO,EAAE,YAAY;oBACrB,aAAa,EAAE,KAAK;iBACrB,CAAC,CACH,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,UAAU,CACR,WAAW,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,KAAK,MAAM,CAAC,YAAY,CAAC,mBAAmB,CACxH,CAAC;YACJ,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,QAAQ,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;YAC3D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CACF,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** biome-ignore-all lint/suspicious/noConsole: Console output is intentional in CLI */
|
|
2
|
+
import type { Command } from 'commander';
|
|
3
|
+
export declare function registerPersonFromJsonCommand(createCmd: Command, program: Command): void;
|
|
4
|
+
//# sourceMappingURL=create-person-from-json.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-person-from-json.d.ts","sourceRoot":"","sources":["../../src/commands/create-person-from-json.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAGvF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAyBzC,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAiFxF"}
|