@justanarthur/payload-www 1.2.2 → 1.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/README.md CHANGED
@@ -318,8 +318,8 @@ the matching component from the host's `importMap`.
318
318
  ```ts
319
319
  import { imageHashPlugin } from '@justanarthur/payload-www/imagehash'
320
320
  import { translator } from '@justanarthur/payload-www/translator'
321
+ import { mcpPlugin } from '@justanarthur/payload-www/mcp'
321
322
  import { seoPlugin } from '@justanarthur/payload-plugin-seo' // no re-export here, import directly
322
- import { mcpPlugin } from '@payloadcms/plugin-mcp' // no re-export here, import directly
323
323
  ```
324
324
 
325
325
  Use these if you want to compose the default plugin set manually outside `createWWWConfig`. Full
@@ -347,6 +347,7 @@ The package's `package.json#exports` map:
347
347
  | `@justanarthur/payload-www/utils` | `generateImportName`, `getFromImportMap` |
348
348
  | `@justanarthur/payload-www/imagehash` | `imageHashPlugin`, `BlurhashPluginOptions` (re-export of `@justanarthur/payload-imagehash-plugin`) |
349
349
  | `@justanarthur/payload-www/translator` | `translator` (re-export of `@justanarthur/payload-plugin-translator`) |
350
+ | `@justanarthur/payload-www/mcp` | `mcpPlugin`, `MCPPluginConfig` (re-export of `@payloadcms/plugin-mcp`) |
350
351
  | `@justanarthur/payload-www/import-map-provider` | `setImportMapProvider`, `getImportMap` (stubs in the current build — reserved for future use) |
351
352
 
352
353
  There is **no root import** (`.`) and **no `/server`, `/with-www-config`, `/globals`, `/hooks`,
package/dist/config.js CHANGED
@@ -346,6 +346,7 @@ var createHeaderGlobal = () => createWWWCollectionGlobal([
346
346
  import { seoPlugin } from "@justanarthur/payload-plugin-seo";
347
347
  import { imageHashPlugin } from "@justanarthur/payload-imagehash-plugin";
348
348
  import { translator } from "@justanarthur/payload-plugin-translator";
349
+ import { mcpPlugin } from "@payloadcms/plugin-mcp";
349
350
  function createWWWConfig() {
350
351
  function withWWWConfig(input) {
351
352
  const { defaultPluginsConfigs, ...config } = input;
@@ -380,7 +381,17 @@ function createWWWConfig() {
380
381
  model: "gpt-5.4-mini"
381
382
  })
382
383
  ]
383
- }, defaultPluginsConfigs?.translator))
384
+ }, defaultPluginsConfigs?.translator)),
385
+ mcpPlugin(mergeOrOverride({
386
+ collections: Object.fromEntries(collections.map(({ slug, admin }) => [slug, {
387
+ enabled: { find: true, create: true, update: true, delete: true },
388
+ description: typeof admin?.description === "string" ? admin.description : undefined
389
+ }])),
390
+ globals: Object.fromEntries(globals.map(({ slug, admin }) => [slug, {
391
+ enabled: { find: true, update: true },
392
+ description: typeof admin?.description === "string" ? admin.description : undefined
393
+ }]))
394
+ }, defaultPluginsConfigs?.mcp))
384
395
  ];
385
396
  const plugins = mergeOrOverride(defaultPlugins, config.plugins);
386
397
  return {
package/dist/mcp.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { mcpPlugin } from "@payloadcms/plugin-mcp";
2
+ import { MCPPluginConfig } from "@payloadcms/plugin-mcp";
3
+ export { mcpPlugin, mcpPlugin as default, MCPPluginConfig };
package/dist/mcp.js ADDED
@@ -0,0 +1,9 @@
1
+
2
+
3
+ // src/exports/mcp.ts
4
+ import { mcpPlugin } from "@payloadcms/plugin-mcp";
5
+ var mcp_default = mcpPlugin;
6
+ export {
7
+ mcpPlugin,
8
+ mcp_default as default
9
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@justanarthur/payload-www",
3
3
  "description": "Reusable Payload CMS website template — config builder, collections, globals, blocks, fields, access, hooks, metadata (JSON-LD, hreflang), page renderers, and test helpers.",
4
- "version": "1.2.2",
4
+ "version": "1.4.0",
5
5
  "type": "module",
6
6
  "private": false,
7
7
  "files": [
@@ -42,6 +42,12 @@
42
42
  "default": "./dist/imagehash.js"
43
43
  }
44
44
  },
45
+ "./mcp": {
46
+ "import": {
47
+ "types": "./dist/mcp.d.ts",
48
+ "default": "./dist/mcp.js"
49
+ }
50
+ },
45
51
  "./blocks": {
46
52
  "import": {
47
53
  "types": "./dist/blocks.d.ts",