@se-studio/contentful-cms 2.3.0 → 2.4.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 +14 -0
- package/INSTALL.md +1 -1
- package/README.md +11 -14
- package/dist/cli/program.d.ts.map +1 -1
- package/dist/cli/program.js +1 -3
- package/dist/cli/program.js.map +1 -1
- package/dist/commands/health.d.ts.map +1 -1
- package/dist/commands/health.js +2 -22
- package/dist/commands/health.js.map +1 -1
- package/dist/commands/preview.d.ts.map +1 -1
- package/dist/commands/preview.js +63 -16
- package/dist/commands/preview.js.map +1 -1
- package/dist/config/types.d.ts +3 -3
- package/dist/config/types.d.ts.map +1 -1
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.js +1 -1
- package/dist/mcp/tools/cms-edit.d.ts +1 -1
- package/dist/mcp/tools/cms-edit.d.ts.map +1 -1
- package/dist/mcp/tools/cms-edit.js +4 -0
- package/dist/mcp/tools/cms-edit.js.map +1 -1
- package/dist/preview/capture-urls.d.ts +12 -0
- package/dist/preview/capture-urls.d.ts.map +1 -0
- package/dist/preview/capture-urls.js +41 -0
- package/dist/preview/capture-urls.js.map +1 -0
- package/docs/FUNCTIONAL_SPEC.md +3 -3
- package/docs/help/index.md +2 -1
- package/package.json +1 -1
- package/skills/core/SKILL.md +13 -78
- package/dist/commands/screenshot.d.ts +0 -4
- package/dist/commands/screenshot.d.ts.map +0 -1
- package/dist/commands/screenshot.js +0 -275
- package/dist/commands/screenshot.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
# @se-studio/contentful-cms Changelog
|
|
2
2
|
|
|
3
|
+
## 2.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Remove `cms-edit screenshot` command and agent-browser from cms-edit install/health docs. Add `preview url` / `preview showcase` for preview URLs (open with browser MCP). Refactor `cms-capture-screenshots` to call `cms-edit preview showcase --json` and drive agent-browser directly (no npm dependency on contentful-cms).
|
|
8
|
+
|
|
9
|
+
**Breaking:** `cms-edit screenshot` is removed (no `@ref`, `--json-file`, `--live`, or viewport flags). Use `preview url` / `preview showcase` instead. Guidelines PNG capture stays on `cms-capture-screenshots` only.
|
|
10
|
+
|
|
3
11
|
## 2.3.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
6
14
|
|
|
7
15
|
- Add `cms-edit asset review` to audit visual assets (filename, alt text, dimensions, file size, GIF) from the Preview API index, plus the `contentful-cms-media-review` skill for spreadsheet workflows.
|
|
16
|
+
- Remove `cms-edit screenshot`. Use `cms-edit preview url` and `cms-edit preview showcase` for preview URLs (open with a browser MCP). Guidelines tooling (`cms-capture-screenshots`) shells out to `preview showcase`. Remove agent-browser from install scripts and `cms-edit health`.
|
|
17
|
+
|
|
18
|
+
### Breaking Changes
|
|
19
|
+
|
|
20
|
+
- **Removed:** `cms-edit screenshot` and the `contentful-cms-screenshots` skill. No PNG capture, `@ref` render-json URLs, `--json-file`, `--live`, or `--width`/`--height` via cms-edit.
|
|
21
|
+
- **Replacement:** `cms-edit preview url <slug>` for pages; `cms-edit preview showcase --component|--collection` for showcase mock URLs. CMS guidelines batch capture remains `cms-capture-screenshots` in `@se-studio/project-build` (requires agent-browser).
|
|
8
22
|
|
|
9
23
|
### Patch Changes
|
|
10
24
|
|
package/INSTALL.md
CHANGED
|
@@ -22,7 +22,7 @@ If SE sent you an **onboarding link** (e.g. `https://your-site.content.se.studio
|
|
|
22
22
|
### What you'll need
|
|
23
23
|
|
|
24
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
|
|
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
26
|
|
|
27
27
|
---
|
|
28
28
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @se-studio/contentful-cms
|
|
2
2
|
|
|
3
|
-
A CLI tool for AI agents to read and edit Contentful draft content across all SE Studio apps. Provides a `cms-edit` binary with a snapshot → ref → edit → save workflow
|
|
3
|
+
A CLI tool for AI agents to read and edit Contentful draft content across all SE Studio apps. Provides a `cms-edit` binary with a snapshot → ref → edit → save workflow.
|
|
4
4
|
|
|
5
5
|
**Key constraint:** This tool has NO ability to publish, unpublish, archive, or delete published entries. All writes create drafts that a human must review and publish in Contentful.
|
|
6
6
|
|
|
@@ -123,8 +123,8 @@ Token values use `${ENV_VAR}` syntax and are resolved from your `.env.local` at
|
|
|
123
123
|
|
|
124
124
|
### Deployment Protection Bypass
|
|
125
125
|
|
|
126
|
-
When your dev site is deployed behind Vercel deployment protection (or similar),
|
|
127
|
-
|
|
126
|
+
When your dev site is deployed behind Vercel deployment protection (or similar), commands that
|
|
127
|
+
build URLs from `devBaseUrl` (e.g. `preview url`, `preview showcase`) need to bypass the protection.
|
|
128
128
|
|
|
129
129
|
**Via query parameter** (Vercel protection bypass):
|
|
130
130
|
```json
|
|
@@ -140,7 +140,7 @@ The token is appended as a query parameter to every URL built from `devBaseUrl`.
|
|
|
140
140
|
"x-custom-header": "${CUSTOM_HEADER_VALUE}"
|
|
141
141
|
}
|
|
142
142
|
```
|
|
143
|
-
|
|
143
|
+
`requestHeaders` are read by `cms-capture-screenshots` when driving agent-browser (query bypass uses `requestParams` via `cms-edit preview showcase`).
|
|
144
144
|
|
|
145
145
|
Both `requestParams` and `requestHeaders` values support `${ENV_VAR}` token syntax.
|
|
146
146
|
Set the token values in `.env.local` — they are never committed to version control.
|
|
@@ -406,22 +406,19 @@ cms-edit types collection # lists collectionType values
|
|
|
406
406
|
cms-edit types externalComponent # lists externalComponentType values
|
|
407
407
|
```
|
|
408
408
|
|
|
409
|
-
###
|
|
409
|
+
### Preview URLs
|
|
410
410
|
|
|
411
|
-
|
|
411
|
+
Generate URLs for visual checks with a browser MCP (no capture built into cms-edit):
|
|
412
412
|
|
|
413
413
|
| Target | Command |
|
|
414
414
|
|--------|---------|
|
|
415
|
-
|
|
|
416
|
-
|
|
|
417
|
-
|
|
|
418
|
-
| Page | `cms-edit screenshot` (current page) or `cms-edit screenshot /pricing` |
|
|
415
|
+
| Page slug | `cms-edit preview url /pricing` (or `preview url` with an open session) |
|
|
416
|
+
| Component showcase | `cms-edit preview showcase --component HeroSimple` |
|
|
417
|
+
| Collection showcase | `cms-edit preview showcase --collection CardGrid --param backgroundColour=Navy` |
|
|
419
418
|
|
|
420
|
-
|
|
419
|
+
Requires `devBaseUrl` in `.contentful-cms.json`. Use `--json` for machine-readable output.
|
|
421
420
|
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
**Batch screenshots:** The `cms-capture-screenshots` script (same package) captures multiple variants to `<app-dir>/docs/cms-guidelines/screenshots/`. Run it from the **monorepo root** so the output path is correct: `node packages/contentful-cms/dist/bin/cms-capture-screenshots.js --variants /tmp/type-variants.json --app-dir apps/example-se2026`.
|
|
421
|
+
**CMS guidelines batch capture:** `@se-studio/project-build` ships `cms-capture-screenshots` for the guidelines pipeline only (requires agent-browser). Run from the monorepo root: `cms-capture-screenshots --variants /tmp/type-variants.json --app-dir apps/example-se2026`.
|
|
425
422
|
|
|
426
423
|
## Machine-readable Output (`--json`)
|
|
427
424
|
|
|
@@ -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;AA6DpC,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,
|
|
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;AA6DpC,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,CA8G7E"}
|
package/dist/cli/program.js
CHANGED
|
@@ -39,7 +39,6 @@ import { registerRtfCommand } from '../commands/rtf.js';
|
|
|
39
39
|
import { registerRunCommand } from '../commands/run.js';
|
|
40
40
|
import { registerSaveCommand } from '../commands/save.js';
|
|
41
41
|
import { registerSchemaCommand } from '../commands/schema.js';
|
|
42
|
-
import { registerScreenshotCommand } from '../commands/screenshot.js';
|
|
43
42
|
import { registerSetCommand } from '../commands/set.js';
|
|
44
43
|
import { registerSitemapCommand } from '../commands/sitemap.js';
|
|
45
44
|
import { registerSkillCommand } from '../commands/skill.js';
|
|
@@ -56,7 +55,7 @@ const LLM_INTRO = 'Opinionated CLI for editing Contentful draft content (pages,
|
|
|
56
55
|
'Single-shot page/article creation: cms-edit help create-from-json\n' +
|
|
57
56
|
'Taxonomy bootstrap: cms-edit help taxonomy-from-json\n' +
|
|
58
57
|
'Full README: cms-edit --docs. Install skills: cms-edit skill install.\n' +
|
|
59
|
-
'
|
|
58
|
+
'Visual checks: cms-edit preview url <slug> or cms-edit preview showcase --component <type> (use browser MCP to open the URL).';
|
|
60
59
|
export function createCmsEditProgram(hooks = {}) {
|
|
61
60
|
const program = new Command('cms-edit');
|
|
62
61
|
program
|
|
@@ -129,7 +128,6 @@ export function createCmsEditProgram(hooks = {}) {
|
|
|
129
128
|
registerIndexCommand(program);
|
|
130
129
|
registerResolveCommand(program);
|
|
131
130
|
registerPreviewCommand(program);
|
|
132
|
-
registerScreenshotCommand(program);
|
|
133
131
|
registerRunCommand(program);
|
|
134
132
|
registerSitemapCommand(program);
|
|
135
133
|
registerSkillCommand(program);
|
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,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM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ot":"","sources":["../../src/commands/health.ts"],"names":[],"mappings":"AAAA,uFAAuF;
|
|
1
|
+
{"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../src/commands/health.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAEvF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAczC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAiL5D"}
|
package/dist/commands/health.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/** biome-ignore-all lint/suspicious/noConsole: Console output is intentional in CLI */
|
|
2
|
-
import { spawnSync } from 'node:child_process';
|
|
3
2
|
import pc from 'picocolors';
|
|
4
3
|
import { loadConfig, resolveSpaceConfig } from '../config/load.js';
|
|
5
4
|
import { createSafeEnvironment } from '../contentful/client.js';
|
|
@@ -115,7 +114,7 @@ export function registerHealthCommand(program) {
|
|
|
115
114
|
}
|
|
116
115
|
}
|
|
117
116
|
}
|
|
118
|
-
// 6. devBaseUrl configured (optional — needed for
|
|
117
|
+
// 6. devBaseUrl configured (optional — needed for preview url / showcase)
|
|
119
118
|
if (spaceCfg) {
|
|
120
119
|
if (spaceCfg.devBaseUrl) {
|
|
121
120
|
results.push({
|
|
@@ -130,29 +129,10 @@ export function registerHealthCommand(program) {
|
|
|
130
129
|
name: 'devBaseUrl configured',
|
|
131
130
|
ok: false,
|
|
132
131
|
optional: true,
|
|
133
|
-
detail: 'Not set —
|
|
132
|
+
detail: 'Not set — preview url and preview showcase require devBaseUrl in config',
|
|
134
133
|
});
|
|
135
134
|
}
|
|
136
135
|
}
|
|
137
|
-
// 6. agent-browser on PATH (optional — needed for screenshots)
|
|
138
|
-
const ab = spawnSync('agent-browser', ['--version'], { stdio: 'pipe' });
|
|
139
|
-
if (!ab.error && ab.status === 0) {
|
|
140
|
-
const ver = ab.stdout?.toString().trim() ?? '';
|
|
141
|
-
results.push({
|
|
142
|
-
name: 'agent-browser on PATH',
|
|
143
|
-
ok: true,
|
|
144
|
-
optional: true,
|
|
145
|
-
detail: ver || 'OK',
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
else {
|
|
149
|
-
results.push({
|
|
150
|
-
name: 'agent-browser on PATH',
|
|
151
|
-
ok: false,
|
|
152
|
-
optional: true,
|
|
153
|
-
detail: 'Not found — install with: npm install -g agent-browser && agent-browser install',
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
136
|
// Output
|
|
157
137
|
const requiredFailed = results.filter((r) => !r.ok && !r.optional);
|
|
158
138
|
const overallOk = requiredFailed.length === 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"health.js","sourceRoot":"","sources":["../../src/commands/health.ts"],"names":[],"mappings":"AAAA,uFAAuF;
|
|
1
|
+
{"version":3,"file":"health.js","sourceRoot":"","sources":["../../src/commands/health.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAGvF,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAS9C,MAAM,UAAU,qBAAqB,CAAC,OAAgB;IACpD,OAAO;SACJ,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CACV,6EAA6E;QAC3E,qGAAqG,CACxG;SACA,MAAM,CAAC,KAAK,EAAE,KAA4B,EAAE,GAAY,EAAE,EAAE;QAC3D,MAAM,UAAU,GAAG,GAAG,CAAC,MAAM,EAAE,IAAI,EAAuC,IAAI,EAAE,CAAC;QACjF,IAAI,CAAC;YACH,MAAM,OAAO,GAAkB,EAAE,CAAC;YAElC,uBAAuB;YACvB,IAAI,MAA0D,CAAC;YAC/D,IAAI,CAAC;gBACH,MAAM,GAAG,UAAU,CA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
|
|
1
|
-
{"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../src/commands/preview.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAEvF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../src/commands/preview.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAEvF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkBzC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA4K7D"}
|
package/dist/commands/preview.js
CHANGED
|
@@ -2,19 +2,12 @@
|
|
|
2
2
|
import { loadConfig, resolveSpaceConfig } from '../config/load.js';
|
|
3
3
|
import { isJsonMode } from '../output/mode.js';
|
|
4
4
|
import { errorMsg } from '../output/print.js';
|
|
5
|
+
import { appendRequestParams, buildShowcaseUrl, parseParamOverrides, } from '../preview/capture-urls.js';
|
|
5
6
|
import { loadSession } from '../session/store.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return `${url}${separator}${new URLSearchParams(requestParams).toString()}`;
|
|
11
|
-
}
|
|
12
|
-
function expandEnvVars(params) {
|
|
13
|
-
const result = {};
|
|
14
|
-
for (const [key, raw] of Object.entries(params)) {
|
|
15
|
-
result[key] = raw.replace(/\$\{([^}]+)\}/g, (_, name) => process.env[name] ?? '');
|
|
16
|
-
}
|
|
17
|
-
return result;
|
|
7
|
+
/** Collect repeatable --param key=value into an array. */
|
|
8
|
+
function collectParam(value, prev) {
|
|
9
|
+
prev.push(value);
|
|
10
|
+
return prev;
|
|
18
11
|
}
|
|
19
12
|
export function registerPreviewCommand(program) {
|
|
20
13
|
const preview = program.command('preview').description('Generate preview URLs for content');
|
|
@@ -28,7 +21,6 @@ export function registerPreviewCommand(program) {
|
|
|
28
21
|
const parentOpts = cmd.parent?.parent?.opts() ?? {};
|
|
29
22
|
try {
|
|
30
23
|
const config = loadConfig(parentOpts.config);
|
|
31
|
-
// Resolve space: prefer explicit --space, then fall back to active session's spaceKey
|
|
32
24
|
let spaceKey = parentOpts.space;
|
|
33
25
|
let resolvedSlug = slug;
|
|
34
26
|
if (!spaceKey || !resolvedSlug) {
|
|
@@ -64,14 +56,69 @@ export function registerPreviewCommand(program) {
|
|
|
64
56
|
}
|
|
65
57
|
const normalizedSlug = resolvedSlug.startsWith('/') ? resolvedSlug : `/${resolvedSlug}`;
|
|
66
58
|
const rawUrl = `${space.devBaseUrl}${normalizedSlug}`;
|
|
67
|
-
const
|
|
68
|
-
const url = appendRequestParams(rawUrl, params);
|
|
59
|
+
const url = appendRequestParams(rawUrl, space.requestParams);
|
|
69
60
|
if (isJsonMode()) {
|
|
70
61
|
console.log(JSON.stringify({
|
|
71
62
|
url,
|
|
72
63
|
baseUrl: space.devBaseUrl,
|
|
73
64
|
slug: resolvedSlug,
|
|
74
|
-
params:
|
|
65
|
+
params: space.requestParams ?? {},
|
|
66
|
+
}, null, 2));
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
console.log(`\n${url}\n`);
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
errorMsg(err instanceof Error ? err.message : String(err));
|
|
73
|
+
process.exit(1);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
preview
|
|
77
|
+
.command('showcase')
|
|
78
|
+
.description('Generate a showcase preview URL for a component or collection type (mock data).\n' +
|
|
79
|
+
'Example: cms-edit preview showcase --component HeroSimple\n' +
|
|
80
|
+
'Example: cms-edit preview showcase --collection CardGrid --param backgroundColour=Navy')
|
|
81
|
+
.option('--component <type>', 'Component type name')
|
|
82
|
+
.option('--collection <type>', 'Collection type name')
|
|
83
|
+
.option('--embedded', 'Append embedded=true to suppress iframe height reporter')
|
|
84
|
+
.option('--clean', 'Use default showcase state only (no curated mock data)')
|
|
85
|
+
.option('--param <key=value>', 'Showcase override (repeatable). E.g. --param backgroundColour=Navy', collectParam, [])
|
|
86
|
+
.action(async (opts, cmd) => {
|
|
87
|
+
const parentOpts = cmd.parent?.parent?.opts() ?? {};
|
|
88
|
+
try {
|
|
89
|
+
if (!opts.component && !opts.collection) {
|
|
90
|
+
errorMsg('Pass --component <type> or --collection <type>.');
|
|
91
|
+
process.exit(1);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if (opts.component && opts.collection) {
|
|
95
|
+
errorMsg('Pass only one of --component or --collection.');
|
|
96
|
+
process.exit(1);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const config = loadConfig(parentOpts.config);
|
|
100
|
+
const { space } = resolveSpaceConfig(config, parentOpts.space);
|
|
101
|
+
if (!space.devBaseUrl) {
|
|
102
|
+
errorMsg(`No devBaseUrl configured for this space. ` +
|
|
103
|
+
`Add "devBaseUrl": "http://localhost:<port>" to your .contentful-cms.json.`);
|
|
104
|
+
process.exit(1);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const mode = opts.collection ? 'collection' : 'component';
|
|
108
|
+
const typeName = (opts.collection ?? opts.component);
|
|
109
|
+
const fields = parseParamOverrides(opts.param ?? []);
|
|
110
|
+
const url = buildShowcaseUrl(space.devBaseUrl, typeName, mode, fields, {
|
|
111
|
+
embedded: opts.embedded,
|
|
112
|
+
clean: opts.clean,
|
|
113
|
+
requestParams: space.requestParams,
|
|
114
|
+
});
|
|
115
|
+
if (isJsonMode()) {
|
|
116
|
+
console.log(JSON.stringify({
|
|
117
|
+
url,
|
|
118
|
+
baseUrl: space.devBaseUrl,
|
|
119
|
+
type: typeName,
|
|
120
|
+
mode,
|
|
121
|
+
params: fields,
|
|
75
122
|
}, null, 2));
|
|
76
123
|
return;
|
|
77
124
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview.js","sourceRoot":"","sources":["../../src/commands/preview.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAGvF,OAAO,EAAE,UAAU,EAAE,kBAAk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AM,EAAE;gBACrE,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,aAAa,EAAE,KAAK,CAAC,aAAa;aACnC,CAAC,CAAC;YAEH,IAAI,UAAU,EAAE,EAAE,CAAC;gBACjB,OAAO,CAAC,GAAG,CACT,IAAI,CAAC,SAAS,CACZ;oBACE,GAAG;oBACH,OAAO,EAAE,KAAK,CAAC,UAAU;oBACzB,IAAI,EAAE,QAAQ;oBACd,IAAI;oBACJ,MAAM,EAAE,MAAM;iBACf,EACD,IAAI,EACJ,CAAC,CACF,CACF,CAAC;gBACF,OAAO;YACT,CAAC;YAED,OAAO,CAAC,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;QAC5B,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"}
|
package/dist/config/types.d.ts
CHANGED
|
@@ -3,17 +3,17 @@ export interface SpaceConfig {
|
|
|
3
3
|
environment: string;
|
|
4
4
|
managementToken: string;
|
|
5
5
|
defaultLocale: string;
|
|
6
|
-
/** Base URL of the local dev server for this space
|
|
6
|
+
/** Base URL of the local dev server for this space (preview url, preview showcase). e.g. "http://localhost:3013" */
|
|
7
7
|
devBaseUrl?: string;
|
|
8
8
|
/**
|
|
9
|
-
* HTTP headers injected into
|
|
9
|
+
* HTTP headers injected into devBaseUrl requests (e.g. cms-capture-screenshots via agent-browser).
|
|
10
10
|
* Useful for deployment protection bypass that requires a header rather than a query param.
|
|
11
11
|
* Values support ${ENV_VAR} token syntax.
|
|
12
12
|
* Example: { "x-custom-header": "${CUSTOM_TOKEN}" }
|
|
13
13
|
*/
|
|
14
14
|
requestHeaders?: Record<string, string>;
|
|
15
15
|
/**
|
|
16
|
-
* Query parameters appended to
|
|
16
|
+
* Query parameters appended to devBaseUrl requests (preview url, preview showcase, cms-capture-screenshots).
|
|
17
17
|
* Useful for Vercel deployment protection bypass: { "x-vercel-protection-bypass": "${VERCEL_BYPASS_TOKEN}" }
|
|
18
18
|
* Values support ${ENV_VAR} token syntax.
|
|
19
19
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,oHAAoH;IACpH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,wEAAwE;IACxE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,gJAAgJ;IAChJ,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,aAAa;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;CACrC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
2
|
import type { RunCmsEditFn } from '../types.js';
|
|
3
|
-
export declare const TOOL_DESCRIPTION = "Run any cms-edit command. cms-edit edits Contentful draft content (no publishing).\n\nUse cms_edit_version (no args) to check the installed version.\nUse cms_edit_help to read the getting-started guide by topic.\nUse cms_edit_customer to read site-specific playbooks (articles, routing, blog-tag-matrix, etc.).\nIf Integrations only exposes cms_edit, use [\"customer\", \"index\"] or [\"customer\", \"resource=index\"] instead.\nRead the cms-edit://guide resource for the full guide.\n\nWorkflow: open \u2192 snapshot \u2192 read/set/rtf/add/remove \u2192 diff \u2192 save\nAll saves create drafts only \u2014 a human must publish in Contentful.\n\nCommon command sequences:\n [\"open\", \"--page-slug\", \"/\"] \u2014 homepage (CMS slug index; /index is equivalent)\n [\"open\", \"--page-slug\", \"/pricing\"] \u2014 load a page by slug\n [\"open\", \"--id\", \"<entry-id>\"] \u2014 load by Contentful entry ID\n [\"snapshot\"] \u2014 print content tree with @refs\n [\"read\", \"@c0\"] \u2014 read all fields of a component (requires open session)\n [\"read\", \"@c0\", \"heading\"] \u2014 read a specific field (requires open session)\n [\"read\", \"@root\"] \u2014 read root entry fields (requires open session)\n [\"read\", \"<entry-id>\", \"--id\"] \u2014 read entry by ID (no session)\n [\"read\", \"<entry-id>\", \"--id\", \"heading\"] \u2014 read one field by entry ID (no session)\n [\"peek\", \"--page-slug\", \"/pricing\"] \u2014 preview tree + root fields (no session)\n [\"peek\", \"--id\", \"<entry-id>\"] \u2014 preview by entry ID with rootFields in JSON\n [\"set\", \"@c0\", \"heading\", \"New heading\"] \u2014 set a scalar field\n [\"rtf\", \"@c0\", \"body\", \"--content\", \"# H1\\n\\nBody.\"] \u2014 set rich text (preferred for AI)\n [\"rtf\", \"@c0\", \"body\", \"--base64\", \"<encoded>\"] \u2014 set rich text via base64 (no filesystem)\n [\"diff\"] \u2014 show pending changes\n [\"save\"] \u2014 write drafts to Contentful\n [\"discard\"] \u2014 discard unsaved changes\n [\"links\", \"set\", \"@c0\", \"0\", \"variant\", \"link\"] \u2014 set scalar field on link at index 0\n [\"batch\", \"set\", \"<entry-id>:variant=link\"] \u2014 queue scalar edit by entry ID\n [\"batch\", \"diff\"] \u2014 show pending batch edits\n [\"batch\", \"save\"] \u2014 save all batch edits as drafts\n [\"health\"] \u2014 verify config and connectivity\n [\"diagnose\"] \u2014 session/MCP diagnostics (store, userId, active session)\n [\"version\"] \u2014 print installed cms-edit version\n [\"guide\"] \u2014 print getting-started guide\n [\"guide\", \"workflow\"] \u2014 print a guide section\n [\"customer\", \"index\"] \u2014 list site editor playbooks\n [\"customer\", \"articles\"] \u2014 read articles playbook\n [\"customer\", \"resource=index\"] \u2014 same as index (Integrations fallback)\n [\"list\", \"--type\", \"article\", \"--sort\", \"date\", \"-n\", \"10\"] \u2014 recent articles by publication date\n [\"sitemap\", \"--include\", \"article\", \"--status\", \"draft\"] \u2014 find draft articles\n [\"peek\", \"--article-slug\", \"<slug>\"] \u2014 preview draft or published article (CMA)\n\nDiscovery notes:\n peek/open/read --id load draft content via CMA \u2014 NOT published-only.\n Only list --published / resolve --published use the published-only Delivery API index.\n Articles: use --article-slug (not --page-slug). search --type article sorts by publication date.\n\nSessions persist between MCP calls (Redis on hosted, disk locally). MCP auto-uses session \"_mcp\" unless you pass --session.\nUse --session <name> before the subcommand to isolate concurrent workflows, e.g. [\"--session\", \"my-work\", \"open\", \"/\"].\nUse --space <name> to target a specific Contentful space (local MCP only \u2014 omit for hosted Integrations).\nStateless read (no open required): [\"read\", \"<entry-id>\", \"--id\"] or [\"read\", \"<entry-id>\", \"--id\", \"heading\"].\npeek is one-shot (no session): use [\"peek\", \"--page-slug\", \"<slug>\"] or [\"peek\", \"--id\", \"<entry-id>\"]. Includes rootFields in JSON \u2014 no follow-up read required.\nOutput is always JSON (CMS_EDIT_JSON=1 is forced by the MCP server).\n\nRich text tips:\n --content \"<markdown>\" preferred named flag for inline content (any length)\n --base64 \"<encoded>\" fully environment-agnostic, no filesystem needed\n --file \"<abs-path>\" platform-native absolute path required (C:\\\\Users\\\\... on Windows)\n stdin (\"-\") not supported via MCP";
|
|
3
|
+
export declare const TOOL_DESCRIPTION = "Run any cms-edit command. cms-edit edits Contentful draft content (no publishing).\n\nUse cms_edit_version (no args) to check the installed version.\nUse cms_edit_help to read the getting-started guide by topic.\nUse cms_edit_customer to read site-specific playbooks (articles, routing, blog-tag-matrix, etc.).\nIf Integrations only exposes cms_edit, use [\"customer\", \"index\"] or [\"customer\", \"resource=index\"] instead.\nRead the cms-edit://guide resource for the full guide.\n\nWorkflow: open \u2192 snapshot \u2192 read/set/rtf/add/remove \u2192 diff \u2192 save\nAll saves create drafts only \u2014 a human must publish in Contentful.\n\nCommon command sequences:\n [\"open\", \"--page-slug\", \"/\"] \u2014 homepage (CMS slug index; /index is equivalent)\n [\"open\", \"--page-slug\", \"/pricing\"] \u2014 load a page by slug\n [\"open\", \"--id\", \"<entry-id>\"] \u2014 load by Contentful entry ID\n [\"snapshot\"] \u2014 print content tree with @refs\n [\"read\", \"@c0\"] \u2014 read all fields of a component (requires open session)\n [\"read\", \"@c0\", \"heading\"] \u2014 read a specific field (requires open session)\n [\"read\", \"@root\"] \u2014 read root entry fields (requires open session)\n [\"read\", \"<entry-id>\", \"--id\"] \u2014 read entry by ID (no session)\n [\"read\", \"<entry-id>\", \"--id\", \"heading\"] \u2014 read one field by entry ID (no session)\n [\"peek\", \"--page-slug\", \"/pricing\"] \u2014 preview tree + root fields (no session)\n [\"peek\", \"--id\", \"<entry-id>\"] \u2014 preview by entry ID with rootFields in JSON\n [\"set\", \"@c0\", \"heading\", \"New heading\"] \u2014 set a scalar field\n [\"rtf\", \"@c0\", \"body\", \"--content\", \"# H1\\n\\nBody.\"] \u2014 set rich text (preferred for AI)\n [\"rtf\", \"@c0\", \"body\", \"--base64\", \"<encoded>\"] \u2014 set rich text via base64 (no filesystem)\n [\"diff\"] \u2014 show pending changes\n [\"save\"] \u2014 write drafts to Contentful\n [\"discard\"] \u2014 discard unsaved changes\n [\"links\", \"set\", \"@c0\", \"0\", \"variant\", \"link\"] \u2014 set scalar field on link at index 0\n [\"batch\", \"set\", \"<entry-id>:variant=link\"] \u2014 queue scalar edit by entry ID\n [\"batch\", \"diff\"] \u2014 show pending batch edits\n [\"batch\", \"save\"] \u2014 save all batch edits as drafts\n [\"health\"] \u2014 verify config and connectivity\n [\"diagnose\"] \u2014 session/MCP diagnostics (store, userId, active session)\n [\"version\"] \u2014 print installed cms-edit version\n [\"guide\"] \u2014 print getting-started guide\n [\"guide\", \"workflow\"] \u2014 print a guide section\n [\"customer\", \"index\"] \u2014 list site editor playbooks\n [\"customer\", \"articles\"] \u2014 read articles playbook\n [\"customer\", \"resource=index\"] \u2014 same as index (Integrations fallback)\n [\"list\", \"--type\", \"article\", \"--sort\", \"date\", \"-n\", \"10\"] \u2014 recent articles by publication date\n [\"sitemap\", \"--include\", \"article\", \"--status\", \"draft\"] \u2014 find draft articles\n [\"peek\", \"--article-slug\", \"<slug>\"] \u2014 preview draft or published article (CMA)\n [\"preview\", \"url\", \"/pricing\"] \u2014 page preview URL (open in browser MCP)\n [\"preview\", \"showcase\", \"--component\", \"HeroSimple\"] \u2014 component showcase URL (mock data)\n [\"preview\", \"showcase\", \"--collection\", \"CardGrid\", \"--param\", \"backgroundColour=Navy\"]\n\nDiscovery notes:\n Visual checks: use preview url / preview showcase, then open the returned URL with a browser MCP (cms-edit does not capture screenshots).\n peek/open/read --id load draft content via CMA \u2014 NOT published-only.\n Only list --published / resolve --published use the published-only Delivery API index.\n Articles: use --article-slug (not --page-slug). search --type article sorts by publication date.\n\nSessions persist between MCP calls (Redis on hosted, disk locally). MCP auto-uses session \"_mcp\" unless you pass --session.\nUse --session <name> before the subcommand to isolate concurrent workflows, e.g. [\"--session\", \"my-work\", \"open\", \"/\"].\nUse --space <name> to target a specific Contentful space (local MCP only \u2014 omit for hosted Integrations).\nStateless read (no open required): [\"read\", \"<entry-id>\", \"--id\"] or [\"read\", \"<entry-id>\", \"--id\", \"heading\"].\npeek is one-shot (no session): use [\"peek\", \"--page-slug\", \"<slug>\"] or [\"peek\", \"--id\", \"<entry-id>\"]. Includes rootFields in JSON \u2014 no follow-up read required.\nOutput is always JSON (CMS_EDIT_JSON=1 is forced by the MCP server).\n\nRich text tips:\n --content \"<markdown>\" preferred named flag for inline content (any length)\n --base64 \"<encoded>\" fully environment-agnostic, no filesystem needed\n --file \"<abs-path>\" platform-native absolute path required (C:\\\\Users\\\\... on Windows)\n stdin (\"-\") not supported via MCP";
|
|
4
4
|
export declare function registerCmsEditTools(server: McpServer, runCmsEdit: RunCmsEditFn): void;
|
|
5
5
|
export declare function getMcpServerInfo(): {
|
|
6
6
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cms-edit.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/cms-edit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"cms-edit.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/cms-edit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,eAAO,MAAM,gBAAgB,m1LAiEoB,CAAC;AAElD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,GAAG,IAAI,CA8BtF;AAED,wBAAgB,gBAAgB,IAAI;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAEpE"}
|
|
@@ -46,8 +46,12 @@ Common command sequences:
|
|
|
46
46
|
["list", "--type", "article", "--sort", "date", "-n", "10"] — recent articles by publication date
|
|
47
47
|
["sitemap", "--include", "article", "--status", "draft"] — find draft articles
|
|
48
48
|
["peek", "--article-slug", "<slug>"] — preview draft or published article (CMA)
|
|
49
|
+
["preview", "url", "/pricing"] — page preview URL (open in browser MCP)
|
|
50
|
+
["preview", "showcase", "--component", "HeroSimple"] — component showcase URL (mock data)
|
|
51
|
+
["preview", "showcase", "--collection", "CardGrid", "--param", "backgroundColour=Navy"]
|
|
49
52
|
|
|
50
53
|
Discovery notes:
|
|
54
|
+
Visual checks: use preview url / preview showcase, then open the returned URL with a browser MCP (cms-edit does not capture screenshots).
|
|
51
55
|
peek/open/read --id load draft content via CMA — NOT published-only.
|
|
52
56
|
Only list --published / resolve --published use the published-only Delivery API index.
|
|
53
57
|
Articles: use --article-slug (not --page-slug). search --type article sorts by publication date.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cms-edit.js","sourceRoot":"","sources":["../../../src/mcp/tools/cms-edit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,MAAM,CAAC,MAAM,gBAAgB,GAAG
|
|
1
|
+
{"version":3,"file":"cms-edit.js","sourceRoot":"","sources":["../../../src/mcp/tools/cms-edit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,kBAAk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zD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type ShowcaseMode = 'component' | 'collection';
|
|
2
|
+
export interface BuildShowcaseUrlOptions {
|
|
3
|
+
embedded?: boolean;
|
|
4
|
+
clean?: boolean;
|
|
5
|
+
requestParams?: Record<string, string>;
|
|
6
|
+
}
|
|
7
|
+
/** Parse --param key=value strings into a record for the showcase URL. */
|
|
8
|
+
export declare function parseParamOverrides(params: string[]): Record<string, string>;
|
|
9
|
+
export declare function buildShowcaseUrl(baseUrl: string, type: string, mode: ShowcaseMode, fields: Record<string, string>, options?: BuildShowcaseUrlOptions): string;
|
|
10
|
+
/** Appends requestParams as query parameters to an arbitrary URL. */
|
|
11
|
+
export declare function appendRequestParams(url: string, requestParams: Record<string, string> | undefined): string;
|
|
12
|
+
//# sourceMappingURL=capture-urls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capture-urls.d.ts","sourceRoot":"","sources":["../../src/preview/capture-urls.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,YAAY,CAAC;AAEtD,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC;AAED,0EAA0E;AAC1E,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAU5E;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,OAAO,GAAE,uBAA4B,GACpC,MAAM,CAiBR;AAED,qEAAqE;AACrE,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GAChD,MAAM,CAKR"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** Parse --param key=value strings into a record for the showcase URL. */
|
|
2
|
+
export function parseParamOverrides(params) {
|
|
3
|
+
const out = {};
|
|
4
|
+
for (const p of params) {
|
|
5
|
+
const eq = p.indexOf('=');
|
|
6
|
+
if (eq === -1)
|
|
7
|
+
continue;
|
|
8
|
+
const key = p.slice(0, eq).trim();
|
|
9
|
+
const value = p.slice(eq + 1).trim();
|
|
10
|
+
if (key)
|
|
11
|
+
out[key] = value;
|
|
12
|
+
}
|
|
13
|
+
return out;
|
|
14
|
+
}
|
|
15
|
+
export function buildShowcaseUrl(baseUrl, type, mode, fields, options = {}) {
|
|
16
|
+
const params = new URLSearchParams({ type, mode });
|
|
17
|
+
for (const [key, value] of Object.entries(fields)) {
|
|
18
|
+
params.set(key, value);
|
|
19
|
+
}
|
|
20
|
+
if (options.embedded) {
|
|
21
|
+
params.set('embedded', 'true');
|
|
22
|
+
}
|
|
23
|
+
if (options.clean) {
|
|
24
|
+
params.set('clean', 'true');
|
|
25
|
+
}
|
|
26
|
+
if (options.requestParams) {
|
|
27
|
+
for (const [key, value] of Object.entries(options.requestParams)) {
|
|
28
|
+
params.set(key, value);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return `${baseUrl}/cms/showcase/render?${params.toString()}`;
|
|
32
|
+
}
|
|
33
|
+
/** Appends requestParams as query parameters to an arbitrary URL. */
|
|
34
|
+
export function appendRequestParams(url, requestParams) {
|
|
35
|
+
if (!requestParams || Object.keys(requestParams).length === 0)
|
|
36
|
+
return url;
|
|
37
|
+
const separator = url.includes('?') ? '&' : '?';
|
|
38
|
+
const extra = new URLSearchParams(requestParams).toString();
|
|
39
|
+
return `${url}${separator}${extra}`;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=capture-urls.js.map
|
|
@@ -0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9B,CAAC;IACD,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;QAC1B,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC;YACjE,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACzB,CAAC;IACH,CAAC;IACD,OAAO,GAAG,OAAO,wBAAwB,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;AAC/D,CAAC;AAED,qEAAqE;AACrE,MAAM,UAAU,mBAAmB,CACjC,GAAW,EACX,aAAiD;IAEjD,IAAI,CAAC,aAAa,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,GAAG,CAAC;IAC1E,MAAM,SAAS,GAAG,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IAChD,MAAM,KAAK,GAAG,IAAI,eAAe,CAAC,aAAa,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC5D,OAAO,GAAG,GAAG,GAAG,SAAS,GAAG,KAAK,EAAE,CAAC;AACtC,CAAC"}
|
package/docs/FUNCTIONAL_SPEC.md
CHANGED
|
@@ -22,7 +22,7 @@ A project-level `.contentful-cms.json` file defines one or more Contentful space
|
|
|
22
22
|
- `environment` — Contentful environment name (e.g., `master`)
|
|
23
23
|
- `managementToken` — Contentful Management API token, expressed as an env var reference (e.g., `${CMS_EDIT_TOKEN_OM1}`)
|
|
24
24
|
- `defaultLocale` — locale string (e.g., `en-US`)
|
|
25
|
-
- `devBaseUrl` — local app URL
|
|
25
|
+
- `devBaseUrl` — local app URL for `preview url` and `preview showcase`
|
|
26
26
|
|
|
27
27
|
A `defaultSpace` key selects the active space when none is specified. The `--space` flag overrides per invocation.
|
|
28
28
|
|
|
@@ -281,9 +281,9 @@ This boundary is enforced at two levels: the tool exposes no publish/unpublish/a
|
|
|
281
281
|
|
|
282
282
|
---
|
|
283
283
|
|
|
284
|
-
## 12.
|
|
284
|
+
## 12. Preview URLs
|
|
285
285
|
|
|
286
|
-
When `devBaseUrl` is configured,
|
|
286
|
+
When `devBaseUrl` is configured, `preview url` and `preview showcase` build URLs for pages and showcase renders. Visual verification is done via a browser MCP (e.g. Chrome DevTools), not built into cms-edit. CMS guidelines batch capture uses `cms-capture-screenshots` from `@se-studio/project-build` (separate tool, requires agent-browser).
|
|
287
287
|
|
|
288
288
|
---
|
|
289
289
|
|
package/docs/help/index.md
CHANGED
|
@@ -126,7 +126,8 @@ cms-edit run --file patch.json
|
|
|
126
126
|
|---|---|
|
|
127
127
|
| `backup` | Snapshot Contentful state |
|
|
128
128
|
| `audit` | Audit content issues (images, alt-text, orphaned) |
|
|
129
|
-
| `
|
|
129
|
+
| `preview url` | Generate a page preview URL |
|
|
130
|
+
| `preview showcase` | Generate a component/collection showcase URL |
|
|
130
131
|
| `preview` | Generate preview URLs |
|
|
131
132
|
| `skill` | Manage installed skills |
|
|
132
133
|
| `setup` | Configure Claude Desktop with your credentials |
|
package/package.json
CHANGED
package/skills/core/SKILL.md
CHANGED
|
@@ -576,13 +576,12 @@ cms-edit move @c3 --after @c1 # move section 3 to position 2
|
|
|
576
576
|
cms-edit save
|
|
577
577
|
```
|
|
578
578
|
|
|
579
|
-
##
|
|
579
|
+
## Visual checks
|
|
580
580
|
|
|
581
|
-
|
|
581
|
+
cms-edit does not capture screenshots. Use preview URL commands, then open the URL with a browser MCP (e.g. Chrome DevTools) to verify layout after edits.
|
|
582
582
|
|
|
583
|
-
**
|
|
583
|
+
**Config:** Add `devBaseUrl` to the space in `.contentful-cms.json`:
|
|
584
584
|
|
|
585
|
-
**Config:** Add `devBaseUrl` to the space in `.contentful-cms.json` so the CLI knows where your dev server runs:
|
|
586
585
|
```json
|
|
587
586
|
{
|
|
588
587
|
"spaces": {
|
|
@@ -592,83 +591,19 @@ The `screenshot` command captures a PNG of a component, collection, external com
|
|
|
592
591
|
}
|
|
593
592
|
}
|
|
594
593
|
```
|
|
595
|
-
If omitted, defaults to `http://localhost:3000` with a warning.
|
|
596
|
-
|
|
597
|
-
### From session ref (full-fidelity)
|
|
598
|
-
|
|
599
|
-
`cms-edit screenshot @c0` uses the app's convert API and `/cms/preview/render-json` so **all** entry types render with real converted data: component, collection, externalComponent, person. No separate "mock vs live" for refs.
|
|
600
594
|
|
|
601
595
|
```bash
|
|
602
|
-
#
|
|
603
|
-
cms-edit
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
cms-edit screenshot @c0 --full
|
|
607
|
-
|
|
608
|
-
# Just print URL
|
|
609
|
-
cms-edit screenshot @c0 --url-only
|
|
610
|
-
```
|
|
611
|
-
|
|
612
|
-
### From JSON file (no Contentful)
|
|
613
|
-
|
|
614
|
-
Screenshot an IBase* JSON file (e.g. exported from `cms-edit read @c0 --json` or a fixture). App must be running.
|
|
615
|
-
|
|
616
|
-
```bash
|
|
617
|
-
cms-edit screenshot --json-file path/to/component.json
|
|
618
|
-
```
|
|
619
|
-
|
|
620
|
-
### By type (showcase mock, no session)
|
|
621
|
-
|
|
622
|
-
Uses `/cms/showcase/render` with mock data. Fast, no preview token.
|
|
623
|
-
|
|
624
|
-
```bash
|
|
625
|
-
cms-edit screenshot --component HeroSimple
|
|
626
|
-
cms-edit screenshot --collection CardGrid
|
|
627
|
-
cms-edit screenshot @c0 --embedded --full # when using ref with showcase-style capture
|
|
628
|
-
```
|
|
629
|
-
|
|
630
|
-
### Page screenshots
|
|
631
|
-
|
|
632
|
-
```bash
|
|
633
|
-
# Current open page (uses session root slug)
|
|
634
|
-
cms-edit screenshot
|
|
596
|
+
# Page (explicit slug or open session root)
|
|
597
|
+
cms-edit preview url /pricing
|
|
598
|
+
cms-edit open --page-slug /pricing
|
|
599
|
+
cms-edit preview url
|
|
635
600
|
|
|
636
|
-
#
|
|
637
|
-
cms-edit
|
|
638
|
-
cms-edit
|
|
601
|
+
# Component or collection showcase (mock data)
|
|
602
|
+
cms-edit preview showcase --component HeroSimple
|
|
603
|
+
cms-edit preview showcase --collection CardGrid --param backgroundColour=Navy
|
|
639
604
|
```
|
|
640
605
|
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
| Flag | Description |
|
|
644
|
-
|------|-------------|
|
|
645
|
-
| `--json-file <path>` | Read IBase* JSON from file and screenshot via render-json (no Contentful) |
|
|
646
|
-
| `--live` | Legacy: use `/cms/preview/render?id=...` for ref (optional; @ref is already full-fidelity) |
|
|
647
|
-
| `--out <path>` | Output file path (default: `./screenshot-<type>-<timestamp>.png`) |
|
|
648
|
-
| `--full` | Full-page capture (passed to `agent-browser screenshot --full`) |
|
|
649
|
-
| `--embedded` | Append `&embedded=true` to showcase URL (suppresses IframeHeightReporter) |
|
|
650
|
-
| `--wait <ms>` | Wait milliseconds after page load before capturing (default: 500) |
|
|
651
|
-
| `--url-only` | Print URL only, do not invoke agent-browser |
|
|
652
|
-
| `--json` | Output `{ ok, url, file }` as JSON |
|
|
653
|
-
|
|
654
|
-
### Visual diffing
|
|
655
|
-
|
|
656
|
-
Use `agent-browser diff screenshot` to compare before/after a content change:
|
|
657
|
-
|
|
658
|
-
```bash
|
|
659
|
-
# 1. Capture baseline before editing
|
|
660
|
-
cms-edit screenshot @c0 --out before.png
|
|
661
|
-
|
|
662
|
-
# 2. Edit content
|
|
663
|
-
cms-edit set @c0 heading "New heading"
|
|
664
|
-
cms-edit save
|
|
665
|
-
|
|
666
|
-
# 3. Capture after
|
|
667
|
-
cms-edit screenshot @c0 --out after.png
|
|
668
|
-
|
|
669
|
-
# 4. Diff
|
|
670
|
-
agent-browser diff screenshot --baseline before.png after.png
|
|
671
|
-
```
|
|
606
|
+
For CMS guidelines batch PNG capture, use `cms-capture-screenshots` from `@se-studio/project-build` (separate from cms-edit; requires agent-browser).
|
|
672
607
|
|
|
673
608
|
## Revert
|
|
674
609
|
|
|
@@ -687,7 +622,7 @@ Note: Entries created via `add` cannot be reverted — use `remove` instead.
|
|
|
687
622
|
Validate config and connectivity before running a workflow.
|
|
688
623
|
|
|
689
624
|
```bash
|
|
690
|
-
cms-edit health # Check config file, space config, Contentful connectivity
|
|
625
|
+
cms-edit health # Check config file, space config, Contentful connectivity
|
|
691
626
|
```
|
|
692
627
|
|
|
693
628
|
## Schema Inspection
|
|
@@ -906,4 +841,4 @@ cms-edit --session agent-2 open --article-slug /blog
|
|
|
906
841
|
|
|
907
842
|
## Related skills
|
|
908
843
|
|
|
909
|
-
For templates see the **templates** skill; for navigation see the **navigation** skill; for rich text and embeds see the **rich-text** skill
|
|
844
|
+
For templates see the **templates** skill; for navigation see the **navigation** skill; for rich text and embeds see the **rich-text** skill.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../../src/commands/screenshot.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAKvF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0DzC,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAyShE"}
|
|
@@ -1,275 +0,0 @@
|
|
|
1
|
-
/** biome-ignore-all lint/suspicious/noConsole: Console output is intentional in CLI */
|
|
2
|
-
import { spawnSync } from 'node:child_process';
|
|
3
|
-
import * as fs from 'node:fs';
|
|
4
|
-
import * as path from 'node:path';
|
|
5
|
-
import { loadConfig, resolveSpaceConfig } from '../config/load.js';
|
|
6
|
-
import { isJsonMode } from '../output/mode.js';
|
|
7
|
-
import { errorMsg, infoMsg, successMsg, warnMsg } from '../output/print.js';
|
|
8
|
-
import { resolveRef } from '../session/refs.js';
|
|
9
|
-
import { loadSession } from '../session/store.js';
|
|
10
|
-
const DEFAULT_WAIT_MS = 500;
|
|
11
|
-
/** Longer wait for showcase/render-json so URL params (e.g. backgroundColour) are applied before capture. */
|
|
12
|
-
const SHOWCASE_WAIT_MS = 1500;
|
|
13
|
-
const DEFAULT_VIEWPORT_WIDTH = 1280;
|
|
14
|
-
const DEFAULT_VIEWPORT_HEIGHT = 900;
|
|
15
|
-
const DEFAULT_BASE_URL = 'http://localhost:3000';
|
|
16
|
-
function isComponentOrCollectionUrl(url) {
|
|
17
|
-
return (url.includes('/cms/showcase/render') ||
|
|
18
|
-
url.includes('/cms/preview/render') ||
|
|
19
|
-
url.includes('/cms/preview/render-json'));
|
|
20
|
-
}
|
|
21
|
-
/** Collect repeatable --param key=value into an array. */
|
|
22
|
-
function collectParam(value, prev) {
|
|
23
|
-
prev.push(value);
|
|
24
|
-
return prev;
|
|
25
|
-
}
|
|
26
|
-
/** Parse --param key=value strings into a record for the showcase URL. */
|
|
27
|
-
function parseParamOverrides(params) {
|
|
28
|
-
const out = {};
|
|
29
|
-
for (const p of params) {
|
|
30
|
-
const eq = p.indexOf('=');
|
|
31
|
-
if (eq === -1)
|
|
32
|
-
continue;
|
|
33
|
-
const key = p.slice(0, eq).trim();
|
|
34
|
-
const value = p.slice(eq + 1).trim();
|
|
35
|
-
if (key)
|
|
36
|
-
out[key] = value;
|
|
37
|
-
}
|
|
38
|
-
return out;
|
|
39
|
-
}
|
|
40
|
-
export function registerScreenshotCommand(program) {
|
|
41
|
-
program
|
|
42
|
-
.command('screenshot [target]')
|
|
43
|
-
.description('Take a screenshot of a component, collection, or page. Requires agent-browser.\n\n' +
|
|
44
|
-
' <target> can be:\n' +
|
|
45
|
-
' @c0 — component/collection ref from current session\n' +
|
|
46
|
-
' /pricing — page by slug\n' +
|
|
47
|
-
' (omitted) — current open page (uses session root slug)\n\n' +
|
|
48
|
-
' Type-only (no session needed):\n' +
|
|
49
|
-
' --component HeroSimple\n' +
|
|
50
|
-
' --collection CardGrid')
|
|
51
|
-
.option('--component <type>', 'Showcase a component by type name (no session needed)')
|
|
52
|
-
.option('--collection <type>', 'Showcase a collection by type name (no session needed)')
|
|
53
|
-
.option('--live', 'Fetch real Contentful data via /cms/preview/render?id=... (requires preview token)')
|
|
54
|
-
.option('--out <path>', 'Output file path (default: ./screenshot-<type>-<timestamp>.png)')
|
|
55
|
-
.option('--full', 'Capture the full scrollable page (passed to agent-browser)')
|
|
56
|
-
.option('--embedded', 'Append &embedded=true to showcase URL (suppresses IframeHeightReporter)')
|
|
57
|
-
.option('--clean', 'Use default showcase state only (no curated mock data). Use with --component/--collection.')
|
|
58
|
-
.option('--wait <ms>', 'Milliseconds to wait after page load before capturing', String(DEFAULT_WAIT_MS))
|
|
59
|
-
.option('--url-only', 'Print the URL only, do not invoke agent-browser (useful when browser unavailable)')
|
|
60
|
-
.option('--json-file <path>', 'Read an IBase* JSON file and screenshot it directly (no Contentful needed)')
|
|
61
|
-
.option('--param <key=value>', 'Showcase override (repeatable). Use with --component/--collection. E.g. --param backgroundColour=Navy --param textColour="Off White"', collectParam, [])
|
|
62
|
-
.option('--width <px>', 'Viewport width in pixels (e.g. 375 mobile, 768 tablet, 1280 desktop). Requires agent-browser.', String)
|
|
63
|
-
.option('--height <px>', 'Viewport height in pixels (used with --width; default 900 if only --width given)', String)
|
|
64
|
-
.action(async (target, opts) => {
|
|
65
|
-
try {
|
|
66
|
-
// Preflight: ensure agent-browser is installed
|
|
67
|
-
const abCheck = spawnSync('agent-browser', ['--version'], { stdio: 'pipe' });
|
|
68
|
-
if (abCheck.error || abCheck.status !== 0) {
|
|
69
|
-
errorMsg('agent-browser is not installed or not on PATH.\n' +
|
|
70
|
-
'Install it with: npm install -g agent-browser && agent-browser install\n' +
|
|
71
|
-
'The screenshot command requires agent-browser to capture PNGs.');
|
|
72
|
-
process.exit(1);
|
|
73
|
-
}
|
|
74
|
-
const parentOpts = program.opts();
|
|
75
|
-
const spaceKey = parentOpts.space;
|
|
76
|
-
const configPath = parentOpts.config;
|
|
77
|
-
const config = loadConfig(configPath);
|
|
78
|
-
const { space } = resolveSpaceConfig(config, spaceKey);
|
|
79
|
-
const baseUrl = space.devBaseUrl ?? DEFAULT_BASE_URL;
|
|
80
|
-
if (!space.devBaseUrl) {
|
|
81
|
-
warnMsg(`No devBaseUrl set for this space. Defaulting to ${DEFAULT_BASE_URL}. ` +
|
|
82
|
-
'Add "devBaseUrl": "http://localhost:<port>" to your .contentful-cms.json.');
|
|
83
|
-
}
|
|
84
|
-
const { requestHeaders, requestParams } = space;
|
|
85
|
-
let url;
|
|
86
|
-
let displayType = 'page';
|
|
87
|
-
if (opts.jsonFile) {
|
|
88
|
-
// JSON file mode: read file, base64-encode, render-json URL (no Contentful)
|
|
89
|
-
const raw = fs.readFileSync(opts.jsonFile, 'utf-8');
|
|
90
|
-
const data = JSON.parse(raw);
|
|
91
|
-
const encoded = Buffer.from(raw, 'utf-8').toString('base64');
|
|
92
|
-
url = appendRequestParams(`${baseUrl}/cms/preview/render-json?data=${encoded}`, requestParams);
|
|
93
|
-
displayType = data?.type ?? 'json';
|
|
94
|
-
}
|
|
95
|
-
else if (opts.component || opts.collection) {
|
|
96
|
-
// Type-only mode: showcase render with defaults and optional --param overrides
|
|
97
|
-
const mode = opts.component ? 'component' : 'collection';
|
|
98
|
-
const typeValue = (opts.component ?? opts.collection);
|
|
99
|
-
displayType = typeValue;
|
|
100
|
-
const paramFields = parseParamOverrides(opts.param ?? []);
|
|
101
|
-
url = buildShowcaseUrl(baseUrl, typeValue, mode, paramFields, opts.embedded, opts.clean, requestParams);
|
|
102
|
-
}
|
|
103
|
-
else if (target?.startsWith('@')) {
|
|
104
|
-
// Ref mode: convert API → render-json (all entry types including person)
|
|
105
|
-
const session = await loadSession();
|
|
106
|
-
if (!session) {
|
|
107
|
-
throw new Error("No active session. Run 'cms-edit open --page-slug <slug>' or 'cms-edit open --id <id>' first. Or use --component / --collection for type-only mode.");
|
|
108
|
-
}
|
|
109
|
-
const entry = resolveRef(session, target);
|
|
110
|
-
const entryId = entry.sys.id;
|
|
111
|
-
const convertUrl = appendRequestParams(`${baseUrl}/api/cms-preview/convert?id=${entryId}`, requestParams);
|
|
112
|
-
const res = await fetch(convertUrl);
|
|
113
|
-
if (!res.ok) {
|
|
114
|
-
const text = await res.text();
|
|
115
|
-
throw new Error(`Convert API failed (${res.status}). Ensure the app is running and not in production. ${text.slice(0, 100)}`);
|
|
116
|
-
}
|
|
117
|
-
const { data } = (await res.json());
|
|
118
|
-
if (data === undefined || data === null) {
|
|
119
|
-
throw new Error('Convert API returned no data.');
|
|
120
|
-
}
|
|
121
|
-
const encoded = Buffer.from(JSON.stringify(data), 'utf-8').toString('base64');
|
|
122
|
-
url = appendRequestParams(`${baseUrl}/cms/preview/render-json?data=${encoded}`, requestParams);
|
|
123
|
-
displayType = data?.type ?? entryId;
|
|
124
|
-
}
|
|
125
|
-
else if (target?.startsWith('/') || target?.startsWith('http')) {
|
|
126
|
-
// Explicit slug or URL
|
|
127
|
-
const rawUrl = target.startsWith('http') ? target : `${baseUrl}${target}`;
|
|
128
|
-
url = appendRequestParams(rawUrl, requestParams);
|
|
129
|
-
displayType = target;
|
|
130
|
-
}
|
|
131
|
-
else if (!target) {
|
|
132
|
-
// No target — use session root slug
|
|
133
|
-
const session = await loadSession();
|
|
134
|
-
if (!session) {
|
|
135
|
-
throw new Error("No active session. Run 'cms-edit open --page-slug <slug>' or 'cms-edit open --id <id>' first. Or pass a slug, e.g. cms-edit screenshot /pricing");
|
|
136
|
-
}
|
|
137
|
-
const rootEntry = session.entries[session.rootEntryId];
|
|
138
|
-
const locale = session.defaultLocale;
|
|
139
|
-
const slug = rootEntry?.fields['slug']?.[locale] ??
|
|
140
|
-
rootEntry?.fields['slug']?.['en-US'];
|
|
141
|
-
if (!slug) {
|
|
142
|
-
throw new Error('Could not determine slug from current session root entry.');
|
|
143
|
-
}
|
|
144
|
-
const normalizedSlug = slug.startsWith('/') ? slug : `/${slug}`;
|
|
145
|
-
url = appendRequestParams(`${baseUrl}${normalizedSlug}`, requestParams);
|
|
146
|
-
displayType = normalizedSlug;
|
|
147
|
-
}
|
|
148
|
-
else {
|
|
149
|
-
throw new Error(`Unrecognised target "${target}". Use a @ref, a /slug, --component <type>, or --collection <type>.`);
|
|
150
|
-
}
|
|
151
|
-
const isShowcase = isComponentOrCollectionUrl(url);
|
|
152
|
-
const waitMs = opts.wait
|
|
153
|
-
? Number(opts.wait)
|
|
154
|
-
: isShowcase
|
|
155
|
-
? SHOWCASE_WAIT_MS
|
|
156
|
-
: DEFAULT_WAIT_MS;
|
|
157
|
-
if (opts.urlOnly || isJsonMode()) {
|
|
158
|
-
if (isJsonMode()) {
|
|
159
|
-
console.log(JSON.stringify({ ok: true, url, type: displayType }));
|
|
160
|
-
}
|
|
161
|
-
else {
|
|
162
|
-
console.log(url);
|
|
163
|
-
}
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
// Require agent-browser when actually taking a screenshot (skip when --url-only)
|
|
167
|
-
const agentBrowserCheck = spawnSync('agent-browser', ['--version'], {
|
|
168
|
-
encoding: 'utf-8',
|
|
169
|
-
stdio: 'ignore',
|
|
170
|
-
});
|
|
171
|
-
if (agentBrowserCheck.error || agentBrowserCheck.status !== 0) {
|
|
172
|
-
errorMsg('Screenshots require agent-browser. Install with: npm install -g agent-browser && agent-browser install. Then run this command again.');
|
|
173
|
-
process.exit(1);
|
|
174
|
-
}
|
|
175
|
-
// Resolve output path
|
|
176
|
-
const timestamp = Date.now();
|
|
177
|
-
const safeName = displayType.replace(/[^a-zA-Z0-9_-]/g, '-').replace(/-+/g, '-');
|
|
178
|
-
const outPath = opts.out ?? `./screenshot-${safeName}-${timestamp}.png`;
|
|
179
|
-
const resolvedOutPath = path.resolve(outPath);
|
|
180
|
-
infoMsg(`Navigating to ${url}`);
|
|
181
|
-
// Open URL — inject requestHeaders as --headers <json> if configured
|
|
182
|
-
const openArgs = ['open', url];
|
|
183
|
-
if (requestHeaders && Object.keys(requestHeaders).length > 0) {
|
|
184
|
-
openArgs.push('--headers', JSON.stringify(requestHeaders));
|
|
185
|
-
infoMsg(`Injecting ${Object.keys(requestHeaders).length} request header(s).`);
|
|
186
|
-
}
|
|
187
|
-
const openResult = spawnSync('agent-browser', openArgs, {
|
|
188
|
-
stdio: 'inherit',
|
|
189
|
-
shell: false,
|
|
190
|
-
});
|
|
191
|
-
if (openResult.status !== 0) {
|
|
192
|
-
throw new Error(`agent-browser failed to open URL: ${url}`);
|
|
193
|
-
}
|
|
194
|
-
// Set viewport: explicit --width, or default desktop for component/collection URLs
|
|
195
|
-
const widthPx = opts.width ? Number(opts.width) : Number.NaN;
|
|
196
|
-
const useExplicitWidth = Number.isFinite(widthPx) && widthPx > 0;
|
|
197
|
-
const useDefaultDesktopViewport = !opts.width && isShowcase;
|
|
198
|
-
if (useExplicitWidth || useDefaultDesktopViewport) {
|
|
199
|
-
const w = useExplicitWidth ? Math.round(widthPx) : DEFAULT_VIEWPORT_WIDTH;
|
|
200
|
-
const h = useExplicitWidth && opts.height && Number(opts.height) > 0
|
|
201
|
-
? Math.round(Number(opts.height))
|
|
202
|
-
: DEFAULT_VIEWPORT_HEIGHT;
|
|
203
|
-
const viewportResult = spawnSync('agent-browser', ['set', 'viewport', String(w), String(h)], {
|
|
204
|
-
stdio: 'inherit',
|
|
205
|
-
shell: false,
|
|
206
|
-
});
|
|
207
|
-
if (viewportResult.status !== 0) {
|
|
208
|
-
warnMsg('agent-browser set viewport failed, proceeding with default viewport.');
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
// Wait for page to settle
|
|
212
|
-
if (waitMs > 0) {
|
|
213
|
-
const waitResult = spawnSync('agent-browser', ['wait', String(waitMs)], {
|
|
214
|
-
stdio: 'inherit',
|
|
215
|
-
shell: false,
|
|
216
|
-
});
|
|
217
|
-
if (waitResult.status !== 0) {
|
|
218
|
-
warnMsg('agent-browser wait step failed, proceeding with screenshot anyway.');
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
// Take screenshot
|
|
222
|
-
const screenshotArgs = ['screenshot', resolvedOutPath];
|
|
223
|
-
if (opts.full ?? isShowcase) {
|
|
224
|
-
screenshotArgs.push('--full');
|
|
225
|
-
}
|
|
226
|
-
const screenshotResult = spawnSync('agent-browser', screenshotArgs, {
|
|
227
|
-
stdio: 'inherit',
|
|
228
|
-
shell: false,
|
|
229
|
-
});
|
|
230
|
-
if (screenshotResult.status !== 0) {
|
|
231
|
-
throw new Error('agent-browser screenshot step failed.');
|
|
232
|
-
}
|
|
233
|
-
// Close browser
|
|
234
|
-
spawnSync('agent-browser', ['close'], { stdio: 'inherit', shell: false });
|
|
235
|
-
if (opts.json || isJsonMode()) {
|
|
236
|
-
console.log(JSON.stringify({ ok: true, url, file: resolvedOutPath }));
|
|
237
|
-
}
|
|
238
|
-
else {
|
|
239
|
-
successMsg(`Screenshot saved: ${resolvedOutPath}`);
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
catch (err) {
|
|
243
|
-
errorMsg(err instanceof Error ? err.message : String(err));
|
|
244
|
-
process.exit(1);
|
|
245
|
-
}
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
function buildShowcaseUrl(baseUrl, type, mode, fields, embedded, clean, requestParams) {
|
|
249
|
-
const params = new URLSearchParams({ type, mode });
|
|
250
|
-
for (const [key, value] of Object.entries(fields)) {
|
|
251
|
-
params.set(key, value);
|
|
252
|
-
}
|
|
253
|
-
if (embedded) {
|
|
254
|
-
params.set('embedded', 'true');
|
|
255
|
-
}
|
|
256
|
-
if (clean) {
|
|
257
|
-
params.set('clean', 'true');
|
|
258
|
-
}
|
|
259
|
-
// Append deployment protection bypass or other request params
|
|
260
|
-
if (requestParams) {
|
|
261
|
-
for (const [key, value] of Object.entries(requestParams)) {
|
|
262
|
-
params.set(key, value);
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
return `${baseUrl}/cms/showcase/render?${params.toString()}`;
|
|
266
|
-
}
|
|
267
|
-
/** Appends requestParams as query parameters to an arbitrary URL. */
|
|
268
|
-
function appendRequestParams(url, requestParams) {
|
|
269
|
-
if (!requestParams || Object.keys(requestParams).length === 0)
|
|
270
|
-
return url;
|
|
271
|
-
const separator = url.includes('?') ? '&' : '?';
|
|
272
|
-
const extra = new URLSearchParams(requestParams).toString();
|
|
273
|
-
return `${url}${separator}${extra}`;
|
|
274
|
-
}
|
|
275
|
-
//# sourceMappingURL=screenshot.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"screenshot.js","sourceRoot":"","sources":["../../src/commands/screenshot.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAEvF,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,MAAM,eAAe,GAAG,GAAG,CAAC;AAC5B,6GAA6G;AAC7G,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAC9B,MAAM,sBAAsB,GAAG,IAAI,CAAC;AACpC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AACpC,MAAM,gBAAgB,GAAG,uBAAuB,CAAC;AAEjD,SAAS,0BAA0B,CAAC,GAAW;IAC7C,OAAO,CACL,GAAG,CAAC,QAAQ,CAAC,sBAAsB,CAAC;QACpC,GAAG,CAAC,QAAQ,CAAC,qBAAqB,CAAC;QACnC,GAAG,CAAC,QAAQ,CAAC,0BAA0B,CAAC,CACzC,CAAC;AACJ,CAAC;AAED,0DAA0D;AAC1D,SAAS,YAAY,CAAC,KAAa,EAAE,IAAc;IACjD,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACjB,OAAO,IAAI,CAAC;AACd,CAAC;AAED,0EA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