@maz-ui/nuxt 5.1.0 → 5.2.0-beta.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/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.4.0 <5.0.0"
6
6
  },
7
- "version": "5.1.0",
7
+ "version": "5.2.0-beta.0",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.3",
10
10
  "unbuild": "unknown"
package/dist/module.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { dirname, resolve, join } from 'node:path';
2
2
  import process from 'node:process';
3
3
  import { fileURLToPath } from 'node:url';
4
- import { detectAgentTargets, findProjectPackage, setupAgents } from '@maz-ui/node';
4
+ import { detectAgentTargets, findProjectPackage, setupAgents, readPackageVersion } from '@maz-ui/node';
5
5
  import { capitalize } from '@maz-ui/utils/helpers/capitalize';
6
6
  import { getErrorMessage } from '@maz-ui/utils/helpers/getErrorMessage';
7
7
  import { addCustomTab } from '@nuxt/devtools-kit';
@@ -164,11 +164,26 @@ const defaults = {
164
164
  mcp: true
165
165
  }
166
166
  };
167
+ function formatAgentsLog(applied, result, options) {
168
+ const files = applied.map((change) => [change.file, `(${change.action})`].join(" ")).join(", ");
169
+ const messages = [`AI agents configured for maz-ui: ${files}.`];
170
+ if (options.rules && !options.requestedTargets && !result.targets.includes("agents-md")) {
171
+ const suggestedTargets = [...result.targets, "agents-md"].map((target) => ["'", target, "'"].join("")).join(", ");
172
+ messages.push(`AGENTS.md not written: no agent that reads it was detected (Cursor, Copilot, Codex, Windsurf, Gemini CLI, Zed...). If your team uses one, set mazUi.agents.targets: [${suggestedTargets}].`);
173
+ }
174
+ if (options.mcp && !result.localMcpServer)
175
+ messages.push("The MCP server runs through npx: add @maz-ui/mcp to the devDependencies of the project root to start it in about a second, at the version of your lockfile.");
176
+ return messages.join(" ");
177
+ }
178
+ function installedMcpVersion(rootDir) {
179
+ const mcpDir = findProjectPackage(rootDir, "@maz-ui/mcp");
180
+ return mcpDir ? readPackageVersion(mcpDir) : void 0;
181
+ }
167
182
  function syncAgents(agents, nuxt) {
168
183
  if (!agents || !(nuxt.options.dev || nuxt.options._prepare) || process.env.CI || nuxt.options.test) {
169
184
  return;
170
185
  }
171
- const logger = useLogger("maz-ui");
186
+ const logger = useLogger("@maz-ui/mcp");
172
187
  const isExplicit = nuxt.options.mazUi?.agents !== void 0;
173
188
  try {
174
189
  const { rootDir, workspaceDir } = nuxt.options;
@@ -178,17 +193,17 @@ function syncAgents(agents, nuxt) {
178
193
  if (targets.length === 0 || !rules && !mcp)
179
194
  return;
180
195
  const mazUiDir = findProjectPackage(rootDir, "maz-ui");
181
- const { changes } = setupAgents({
196
+ const result = setupAgents({
182
197
  rootDir: projectDir,
183
198
  targets,
184
199
  rules,
185
200
  mcp,
201
+ mcpVersion: installedMcpVersion(rootDir),
186
202
  ...mazUiDir ? { docsDir: join(mazUiDir, "docs") } : {}
187
203
  });
188
- const applied = changes.filter((change) => ["create", "update", "remove"].includes(change.action));
204
+ const applied = result.changes.filter((change) => ["create", "update", "remove"].includes(change.action));
189
205
  if (applied.length > 0) {
190
- const files = applied.map((change) => [change.file, `(${change.action})`].join(" "));
191
- logger.info(`AI agents configured for maz-ui: ${files.join(", ")}`);
206
+ logger.info(formatAgentsLog(applied, result, { rules, mcp, requestedTargets }));
192
207
  }
193
208
  } catch (error) {
194
209
  const message = `Could not configure the AI agents for maz-ui: ${getErrorMessage(error)}`;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@maz-ui/nuxt",
3
3
  "type": "module",
4
- "version": "5.1.0",
4
+ "version": "5.2.0-beta.0",
5
5
  "description": "Nuxt module for Maz-UI",
6
6
  "author": "Louis Mazel <me@loicmazuel.com>",
7
7
  "license": "MIT",
@@ -51,22 +51,28 @@
51
51
  "nuxt": ">=3.4.0 <5.0.0"
52
52
  },
53
53
  "dependencies": {
54
- "@maz-ui/node": "5.1.0",
55
- "@maz-ui/themes": "5.0.0",
56
- "@maz-ui/translations": "5.0.0",
57
- "@maz-ui/utils": "5.0.0",
54
+ "@maz-ui/node": "^5.2.0-beta.0",
55
+ "@maz-ui/themes": "^5.2.0-beta.0",
56
+ "@maz-ui/translations": "^5.2.0-beta.0",
57
+ "@maz-ui/utils": "^5.2.0-beta.0",
58
58
  "@nuxt/devtools-kit": "^3.4.4",
59
59
  "@nuxt/kit": "^4.6.2",
60
60
  "defu": "^6.1.7",
61
- "maz-ui": "5.1.0"
61
+ "maz-ui": "^5.2.0-beta.0"
62
62
  },
63
63
  "devDependencies": {
64
- "@maz-ui/eslint-config": "5.0.0",
64
+ "@maz-ui/eslint-config": "^5.0.0",
65
65
  "@nuxt/devtools": "^3.4.4",
66
66
  "@nuxt/module-builder": "^1.0.3",
67
67
  "@nuxt/schema": "^4.6.2",
68
68
  "@nuxt/test-utils": "^4.3.4",
69
- "nuxt": "^4.6.2"
69
+ "@types/node": "^22.20.5",
70
+ "@vitest/coverage-v8": "^5.0.5",
71
+ "cross-env": "^10.1.0",
72
+ "eslint": "^10.13.0",
73
+ "nuxt": "^4.6.2",
74
+ "vitest": "5.0.5",
75
+ "vue": "^3.5.44"
70
76
  },
71
77
  "lint-staged": {
72
78
  "*.{js,ts,mjs,mts,cjs,md,yml,json}": "cross-env NODE_ENV=production eslint --fix"