mcp-magento-cms 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -88
- package/package.json +8 -1
- package/src/index.js +0 -0
- package/.env.example +0 -11
- package/cursor-mcp.example.json +0 -15
- package/samples/figma-category.json +0 -966
- package/samples/figma-slider.json +0 -900
- package/samples/page-7.json +0 -17
- package/samples/page-8.json +0 -15
- package/scripts/create-demo-page.js +0 -237
- package/scripts/create-integration.php +0 -80
- package/scripts/create-melissa-home.js +0 -287
- package/scripts/health-check.js +0 -18
- package/scripts/smoke-e2e.js +0 -42
- package/scripts/test-compose.js +0 -18
package/scripts/smoke-e2e.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* End-to-end smoke test: creates a Page Builder CMS page via REST,
|
|
4
|
-
* reads it back, and prints the admin edit URL.
|
|
5
|
-
*
|
|
6
|
-
* NODE_EXTRA_CA_CERTS=~/.local/share/mkcert/rootCA.pem node scripts/smoke-e2e.js
|
|
7
|
-
*/
|
|
8
|
-
import { MagentoClient, loadDotEnv } from '../src/magentoClient.js';
|
|
9
|
-
import { composeFromFields, generateIdentifier, validatePageBuilderHtml } from '../src/pageBuilder.js';
|
|
10
|
-
|
|
11
|
-
loadDotEnv();
|
|
12
|
-
const client = MagentoClient.fromEnv();
|
|
13
|
-
|
|
14
|
-
const title = `MCP Smoke Test ${new Date().toISOString().slice(0, 16).replace('T', ' ')}`;
|
|
15
|
-
const content = composeFromFields({
|
|
16
|
-
headline: 'MCP Smoke Test',
|
|
17
|
-
subheadline: 'Created via mcp-magento-cms end-to-end test',
|
|
18
|
-
content: 'If you can see this page in Admin with Page Builder sections, the pipeline works.\nRow (contained) with a Text element.',
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
if (!validatePageBuilderHtml(content)) {
|
|
22
|
-
console.error('Composer output failed Page Builder validation');
|
|
23
|
-
process.exit(1);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const page = {
|
|
27
|
-
identifier: generateIdentifier(title),
|
|
28
|
-
title,
|
|
29
|
-
page_layout: '1column',
|
|
30
|
-
content_heading: '',
|
|
31
|
-
content,
|
|
32
|
-
active: true,
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
const created = await client.createPage(page);
|
|
36
|
-
console.log(`Created page id=${created.id} identifier=${created.identifier}`);
|
|
37
|
-
|
|
38
|
-
const readBack = await client.getPage(created.id);
|
|
39
|
-
const ok = validatePageBuilderHtml(readBack.content);
|
|
40
|
-
console.log(`Read-back content valid Page Builder HTML: ${ok}`);
|
|
41
|
-
console.log(`Admin edit URL: ${client.pageEditUrl(created.id)}`);
|
|
42
|
-
console.log(`Frontend URL: ${client.baseUrl}/${created.identifier}`);
|
package/scripts/test-compose.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { composeFromFields, validatePageBuilderHtml } from '../src/pageBuilder.js';
|
|
3
|
-
|
|
4
|
-
const html = composeFromFields({
|
|
5
|
-
content: 'Hello from MCP\nSecond line',
|
|
6
|
-
headline: 'Welcome',
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
if (!validatePageBuilderHtml(html)) {
|
|
10
|
-
console.error('FAIL: invalid PB HTML');
|
|
11
|
-
process.exit(1);
|
|
12
|
-
}
|
|
13
|
-
if (!html.includes('Welcome') || !html.includes('Hello from MCP')) {
|
|
14
|
-
console.error('FAIL: content missing');
|
|
15
|
-
process.exit(1);
|
|
16
|
-
}
|
|
17
|
-
console.log('OK: Page Builder Row → Text composition');
|
|
18
|
-
console.log(html.slice(0, 200) + '...');
|