@maz-ui/nuxt 5.2.0-beta.0 → 5.3.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
@@ -210,7 +210,7 @@ export default defineNuxtConfig({
210
210
  vZoomImg: true,
211
211
  },
212
212
 
213
- // AI coding agents (default: { rules: false, mcp: true }, false to disable)
213
+ // AI coding agents (default: { rules: false, mcp: false }, true to enable everything)
214
214
  // In development, registers the maz-ui MCP server in the configs of the detected agents
215
215
  // (.mcp.json, .cursor/mcp.json, .vscode/mcp.json), rules: true also writes .claude/rules/maz-ui.md and an AGENTS.md section
216
216
  // In a monorepo, the files go to the root of the workspace (dir: '<folder>' to change it)
package/dist/module.d.mts CHANGED
@@ -307,15 +307,17 @@ interface MazUiNuxtOptions {
307
307
  * - `rules`: also writes the maz-ui rules in `.claude/rules/maz-ui.md` and in a delimited section of `AGENTS.md` (for agents without MCP).
308
308
  * - `targets`: agents to configure (`'claude'`, `'agents-md'`, `'cursor'`, `'vscode'`), default: the detected ones. Nothing is written when no agent is detected.
309
309
  * - `dir`: folder where the agent files are written, relative to the Nuxt root. Default: the workspace root (`workspaceDir`), so that in a monorepo the files land where the agents start
310
+ * - `paths`: globs (relative to `dir`) the Claude Code rule is scoped to, so that it is only loaded when Claude reads or edits a matching file. Default `'auto'`: the workspaces that depend on maz-ui. `'all'`: always loaded
310
311
  * - `true`: `{ mcp: true, rules: true }`, `false`: disabled
311
312
  * @example `agents: { rules: true }` or `agents: false`
312
- * @default { rules: false, mcp: true }
313
+ * @default { rules: false, mcp: false }
313
314
  */
314
315
  agents?: boolean | {
315
316
  targets?: AgentTarget[];
316
317
  rules?: boolean;
317
318
  mcp?: boolean;
318
319
  dir?: string;
320
+ paths?: 'auto' | 'all' | string[];
319
321
  };
320
322
  }
321
323
 
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.2.0-beta.0",
7
+ "version": "5.3.0",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.3",
10
10
  "unbuild": "unknown"
package/dist/module.mjs CHANGED
@@ -161,7 +161,7 @@ const defaults = {
161
161
  },
162
162
  agents: {
163
163
  rules: false,
164
- mcp: true
164
+ mcp: false
165
165
  }
166
166
  };
167
167
  function formatAgentsLog(applied, result, options) {
@@ -184,10 +184,9 @@ function syncAgents(agents, nuxt) {
184
184
  return;
185
185
  }
186
186
  const logger = useLogger("@maz-ui/mcp");
187
- const isExplicit = nuxt.options.mazUi?.agents !== void 0;
188
187
  try {
189
188
  const { rootDir, workspaceDir } = nuxt.options;
190
- const { targets: requestedTargets, rules = true, mcp = true, dir } = typeof agents === "object" ? agents : {};
189
+ const { targets: requestedTargets, rules = true, mcp = true, dir, paths } = typeof agents === "object" ? agents : {};
191
190
  const projectDir = dir ? resolve(rootDir, dir) : workspaceDir || rootDir;
192
191
  const targets = requestedTargets ?? detectAgentTargets(projectDir);
193
192
  if (targets.length === 0 || !rules && !mcp)
@@ -198,19 +197,18 @@ function syncAgents(agents, nuxt) {
198
197
  targets,
199
198
  rules,
200
199
  mcp,
200
+ paths,
201
201
  mcpVersion: installedMcpVersion(rootDir),
202
- ...mazUiDir ? { docsDir: join(mazUiDir, "docs") } : {}
202
+ ...mazUiDir ? {
203
+ docsDir: join(mazUiDir, "docs")
204
+ } : {}
203
205
  });
204
206
  const applied = result.changes.filter((change) => ["create", "update", "remove"].includes(change.action));
205
207
  if (applied.length > 0) {
206
208
  logger.info(formatAgentsLog(applied, result, { rules, mcp, requestedTargets }));
207
209
  }
208
210
  } catch (error) {
209
- const message = `Could not configure the AI agents for maz-ui: ${getErrorMessage(error)}`;
210
- if (isExplicit)
211
- logger.warn(message);
212
- else
213
- logger.debug(message);
211
+ logger.warn(`Could not configure the AI agents for maz-ui: ${getErrorMessage(error)}`);
214
212
  }
215
213
  }
216
214
  function addMazUiComposableImport({
@@ -252,7 +250,13 @@ const module$1 = defineNuxtModule({
252
250
  const postcssPlugins = nuxt.options.postcss.plugins;
253
251
  if (postcssPlugins.cssnano !== false) {
254
252
  const current = typeof postcssPlugins.cssnano === "object" && postcssPlugins.cssnano !== null ? postcssPlugins.cssnano : {};
255
- postcssPlugins.cssnano = { ...current, preset: ["default", { calc: false }] };
253
+ postcssPlugins.cssnano = {
254
+ ...current,
255
+ preset: [
256
+ "default",
257
+ { calc: false }
258
+ ]
259
+ };
256
260
  }
257
261
  addPlugin(resolve2(_dirname, "./runtime/plugins/theme"));
258
262
  addPlugin(resolve2(_dirname, "./runtime/plugins/translations"));
@@ -2,7 +2,10 @@ import { defineNuxtPlugin, useRouter } from "nuxt/app";
2
2
  export default defineNuxtPlugin(async ({ $config, vueApp }) => {
3
3
  const { AosHandler, AosPlugin } = await import("maz-ui/plugins/aos");
4
4
  const aosOptions = $config.public.mazUi?.plugins?.aos;
5
- const options = typeof aosOptions === "object" ? { ...aosOptions, router: aosOptions.router ? useRouter() : void 0 } : {};
5
+ const options = typeof aosOptions === "object" ? {
6
+ ...aosOptions,
7
+ router: aosOptions.router ? useRouter() : void 0
8
+ } : {};
6
9
  vueApp.use(AosPlugin, options);
7
10
  return {
8
11
  provide: {
@@ -8,6 +8,11 @@ export default defineNuxtPlugin(() => {
8
8
  if (content == null)
9
9
  return;
10
10
  useHead({
11
- meta: [{ name: "viewport", content: addViewportMaximumScale(content) }]
11
+ meta: [
12
+ {
13
+ name: "viewport",
14
+ content: addViewportMaximumScale(content)
15
+ }
16
+ ]
12
17
  });
13
18
  });
@@ -50,10 +50,12 @@ function injectThemeCSS(config) {
50
50
  lightClass: config.lightClass
51
51
  });
52
52
  useHead({
53
- style: [{
54
- innerHTML: css,
55
- id: CSS_ID
56
- }]
53
+ style: [
54
+ {
55
+ innerHTML: css,
56
+ id: CSS_ID
57
+ }
58
+ ]
57
59
  });
58
60
  }
59
61
  function parseSavedPreset(raw) {
@@ -126,16 +128,26 @@ export default defineNuxtPlugin(async ({ vueApp, $config }) => {
126
128
  }
127
129
  injectThemeCSS(config);
128
130
  useHead({
129
- meta: [{
130
- name: "color-scheme",
131
- content: resolveColorSchemeContent(config.mode, config.colorMode),
132
- id: "maz-color-scheme"
133
- }]
131
+ meta: [
132
+ {
133
+ name: "color-scheme",
134
+ content: resolveColorSchemeContent(config.mode, config.colorMode),
135
+ id: "maz-color-scheme"
136
+ }
137
+ ]
134
138
  });
135
139
  if (config.colorMode === "auto" && config.mode === "both" && config.darkModeStrategy === "class") {
136
140
  useHead({
137
- script: [{ innerHTML: getColorModeBlockingScript(config), tagPosition: "head", id: "maz-color-mode-blocking" }],
138
- meta: [{ "http-equiv": "Accept-CH", "content": "Sec-CH-Prefers-Color-Scheme", "id": "maz-color-http-accept-ch" }]
141
+ script: [
142
+ {
143
+ innerHTML: getColorModeBlockingScript(config),
144
+ tagPosition: "head",
145
+ id: "maz-color-mode-blocking"
146
+ }
147
+ ],
148
+ meta: [
149
+ { "http-equiv": "Accept-CH", "content": "Sec-CH-Prefers-Color-Scheme", "id": "maz-color-http-accept-ch" }
150
+ ]
139
151
  });
140
152
  }
141
153
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@maz-ui/nuxt",
3
3
  "type": "module",
4
- "version": "5.2.0-beta.0",
4
+ "version": "5.3.0",
5
5
  "description": "Nuxt module for Maz-UI",
6
6
  "author": "Louis Mazel <me@loicmazuel.com>",
7
7
  "license": "MIT",
@@ -45,33 +45,33 @@
45
45
  "dist"
46
46
  ],
47
47
  "engines": {
48
- "node": ">=22.12.0"
48
+ "node": "^22.23.4 || ^24.22.1 || >=26.12.1"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "nuxt": ">=3.4.0 <5.0.0"
52
52
  },
53
53
  "dependencies": {
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",
54
+ "@maz-ui/node": "^5.3.0",
55
+ "@maz-ui/themes": "^5.3.0",
56
+ "@maz-ui/translations": "^5.3.0",
57
+ "@maz-ui/utils": "^5.3.0",
58
58
  "@nuxt/devtools-kit": "^3.4.4",
59
- "@nuxt/kit": "^4.6.2",
59
+ "@nuxt/kit": "^4.6.4",
60
60
  "defu": "^6.1.7",
61
- "maz-ui": "^5.2.0-beta.0"
61
+ "maz-ui": "^5.3.0"
62
62
  },
63
63
  "devDependencies": {
64
- "@maz-ui/eslint-config": "^5.0.0",
64
+ "@maz-ui/eslint-config": "^5.3.0",
65
65
  "@nuxt/devtools": "^3.4.4",
66
66
  "@nuxt/module-builder": "^1.0.3",
67
- "@nuxt/schema": "^4.6.2",
67
+ "@nuxt/schema": "^4.6.4",
68
68
  "@nuxt/test-utils": "^4.3.4",
69
- "@types/node": "^22.20.5",
70
- "@vitest/coverage-v8": "^5.0.5",
69
+ "@types/node": "^26.6.6",
70
+ "@vitest/coverage-v8": "^5.1.0",
71
71
  "cross-env": "^10.1.0",
72
- "eslint": "^10.13.0",
73
- "nuxt": "^4.6.2",
74
- "vitest": "5.0.5",
72
+ "eslint": "^10.14.0",
73
+ "nuxt": "^4.6.4",
74
+ "vitest": "5.1.0",
75
75
  "vue": "^3.5.44"
76
76
  },
77
77
  "lint-staged": {