@regle/mcp-server 1.19.9-beta.1 → 1.19.9

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.
@@ -111,7 +111,7 @@ var docs_data_default = {
111
111
  "title": "Usage with Pinia",
112
112
  "category": "common-usage",
113
113
  "path": "common-usage/usage-with-pinia.md",
114
- "content": "# Usage with Pinia <span data-title='pinia'></span>\n\nSince Regle is headless, you can use it anywhere in your app — whether in a composable or a store.\n\nUsing a Pinia store is an excellent way to avoid prop drilling with multiple properties while maintaining type inference seamlessly across your components.\n\n## Using regle in a Pinia store\n\n::: code-group\n```ts [demo.store.ts] \nimport { required, minLength, email } from '@regle/rules';\nimport { defineStore } from 'pinia';\nimport { useRegle } from '@regle/core';\n\nexport const useDemoStore = defineStore('demo-store', () => {\n const { r$ } = useRegle({ email: '' }, {\n email: { required, minLength: minLength(4), email }\n })\n\n return {\n r$\n }\n})\n```\n\n``` vue [ComponentA.vue]\n<template>\n <input v-model='r$.$value.email' placeholder='Type your email'/>\n <button type=\"button\" @click=\"r$.$reset({toInitialState: true})\">Reset</button>\n</template>\n\n```\n\n``` vue [ComponentB.vue]\n<template>\n <ul>\n <li v-for=\"error of r$.$errors.email\" :key='error'>\n {{ error }}\n </li>\n </ul>\n</template>\n\n```\n\n:::\n\nComponent A:\n\nComponent B:\n\n## Avoid hydration issues\n\nIf you use `store.$dispose()` or Nuxt in SSR mode, you may encounter this error:\n\n```\nUncaught TypeError: 'set' on proxy: trap returned falsish for property 'xxx'\n```\n\nThis is because Pinia tries to hydrate the stateful property `r$`.\nTo avoid this, you can use [skipHydrate](https://pinia.vuejs.org/api/pinia/functions/skipHydrate.html#skipHydrate-)\n\n```ts [pinia.store.ts]\nimport { skipHydrate } from 'pinia';\n\nexport const usePiniaStore = defineStore('pinia-store', () => {\n const {r$} = useRegle(/** */)\n\n return { r$: skipHydrate(r$) };\n});\n```"
114
+ "content": "# Usage with Pinia <span data-title='pinia'></span>\n\nSince Regle is headless, you can use it anywhere in your app — whether in a composable or a store.\n\nUsing a Pinia store is an excellent way to avoid prop drilling with multiple properties while maintaining type inference seamlessly across your components.\n\n## Using regle in a Pinia store\n\n::: code-group\n```ts [demo.store.ts] \nimport { required, minLength, email } from '@regle/rules';\nimport { defineStore } from 'pinia';\nimport { useRegle } from '@regle/core';\n\nexport const useDemoStore = defineStore('demo-store', () => {\n const { r$ } = useRegle({ email: '' }, {\n email: { required, minLength: minLength(4), email }\n })\n\n return {\n r$\n }\n})\n```\n\n``` vue [ComponentA.vue]\n<template>\n <input v-model='r$.$value.email' placeholder='Type your email'/>\n <button type=\"button\" @click=\"r$.$reset({toInitialState: true})\">Reset</button>\n</template>\n\n```\n\n``` vue [ComponentB.vue]\n<template>\n <ul>\n <li v-for=\"error of r$.$errors.email\" :key='error'>\n {{ error }}\n </li>\n </ul>\n</template>\n\n```\n\n:::\n\nComponent A:\n\nComponent B:\n\n## Avoid hydration issues\n\nIf you use `store.$dispose()` or Nuxt in SSR mode, you may encounter this error:\n\n```\nUncaught TypeError: 'set' on proxy: trap returned falsish for property 'xxx'\n```\n\nThis is because Pinia tries to hydrate the stateful property `r$`.\nTo avoid this, you can use [skipHydrate](https://pinia.vuejs.org/api/pinia/functions/skipHydrate.html#skipHydrate-)\n\n```ts [pinia.store.ts]\nimport { skipHydrate } from 'pinia';\n\nexport const usePiniaStore = defineStore('pinia-store', () => {\n const {r$} = useRegle(/** */)\n\n return { r$: skipHydrate(r$) };\n});\n```\n\n:::info\nIf you are using Nuxt, you can use the `@regle/nuxt` module that will automatically skip the hydration of the `r$` property.\n:::"
115
115
  },
116
116
  {
117
117
  "id": "core-concepts-displaying-errors",
@@ -314,7 +314,7 @@ var docs_data_default = {
314
314
  "title": "Reactivity caveats",
315
315
  "category": "troubleshooting",
316
316
  "path": "troubleshooting/reactivity.md",
317
- "content": "# Reactivity caveats\n\n## Tracking Dependencies\n\nWhen using `useRegle` with a getter function or a computed property, Regle automatically tracks dependencies. However, sometimes dependencies cannot be tracked automatically. In such cases, you can either use the `withParams` wrapper to manually define dependencies or use the `createRule` function which automatically tracks dependencies for you.\n\nTo illustrate the issue, consider the following example:\n\n```ts\nimport { ref, computed } from 'vue';\nimport { withMessage } from '@regle/rules';\nimport { type Maybe, type RegleComputedRules } from '@regle/core';\n\nconst condition = ref(false)\n\nconst weight = (greeting: string) => {\n return withMessage((value: Maybe<number>) => {\n return !!value && value > 1 && condition.value === true\n }, `Weight must be greater than 1, ${greeting}`)\n}\n\nconst rules = computed(() => {\n return {\n items: {\n $each: (item) => ({\n weight: {\n weight: weight('Hello World')\n }\n })\n }\n } satisfies RegleComputedRules<typeof form>\n})\n```\n\nIn the above example, the `weight` rule depends on the `condition` ref, which is not tracked by Regle because it is inside a function and Vue cannot collect the reference. To fix this, you can either use the `withParams` wrapper or use the `createRule` function which automatically tracks dependencies for you.\n\n```ts\nimport { ref } from 'vue';\nimport { withParams, withMessage } from '@regle/rules';\nimport { createRule, type Maybe } from '@regle/core';\n\nconst condition = ref(false)\n\n// Usage with `withParams`\nconst weight1 = (greeting: string) => {\n return withMessage(\n withParams((value: Maybe<number>) => {\n return !!value && value > 1 && condition.value === true\n }, [condition]),\n `Weight must be greater than 1, ${greeting}`\n )\n}\n\n// Usage with `createRule`\nconst weight2 = createRule({\n validator(value: Maybe<number>, greeting: string, condition: boolean) {\n return !!value && value > 1 && condition === true\n },\n\n message: ({ $params: [greeting] }) => {\n return `Weight must be greater than 1, ${greeting}`\n }\n})\n```\n\nNow the `condition` ref is tracked by Regle and the rule will be re-evaluated whenever the `condition` ref changes.\n\n## Pinia hydration issues\n\nIf you use `store.$dispose()` or Nuxt in SSR mode, you may encounter this error:\n\n```\nUncaught TypeError: 'set' on proxy: trap returned falsish for property 'xxx'\n```\n\nThis is because Pinia tries to hydrate the stateful property `r$`.\nTo avoid this, you can use [skipHydrate](https://pinia.vuejs.org/api/pinia/functions/skipHydrate.html#skipHydrate-)\n\n```ts [pinia.store.ts]\nimport { skipHydrate } from 'pinia';\n\nexport const usePiniaStore = defineStore('pinia-store', () => {\n const {r$} = useRegle(/** */)\n\n return { r$: skipHydrate(r$) };\n});\n```"
317
+ "content": "# Reactivity caveats\n\n## Tracking Dependencies\n\nWhen using `useRegle` with a getter function or a computed property, Regle automatically tracks dependencies. However, sometimes dependencies cannot be tracked automatically. In such cases, you can either use the `withParams` wrapper to manually define dependencies or use the `createRule` function which automatically tracks dependencies for you.\n\nTo illustrate the issue, consider the following example:\n\n```ts\nimport { ref, computed } from 'vue';\nimport { withMessage } from '@regle/rules';\nimport { type Maybe, type RegleComputedRules } from '@regle/core';\n\nconst condition = ref(false)\n\nconst weight = (greeting: string) => {\n return withMessage((value: Maybe<number>) => {\n return !!value && value > 1 && condition.value === true\n }, `Weight must be greater than 1, ${greeting}`)\n}\n\nconst rules = computed(() => {\n return {\n items: {\n $each: (item) => ({\n weight: {\n weight: weight('Hello World')\n }\n })\n }\n } satisfies RegleComputedRules<typeof form>\n})\n```\n\nIn the above example, the `weight` rule depends on the `condition` ref, which is not tracked by Regle because it is inside a function and Vue cannot collect the reference. To fix this, you can either use the `withParams` wrapper or use the `createRule` function which automatically tracks dependencies for you.\n\n```ts\nimport { ref } from 'vue';\nimport { withParams, withMessage } from '@regle/rules';\nimport { createRule, type Maybe } from '@regle/core';\n\nconst condition = ref(false)\n\n// Usage with `withParams`\nconst weight1 = (greeting: string) => {\n return withMessage(\n withParams((value: Maybe<number>) => {\n return !!value && value > 1 && condition.value === true\n }, [condition]),\n `Weight must be greater than 1, ${greeting}`\n )\n}\n\n// Usage with `createRule`\nconst weight2 = createRule({\n validator(value: Maybe<number>, greeting: string, condition: boolean) {\n return !!value && value > 1 && condition === true\n },\n\n message: ({ $params: [greeting] }) => {\n return `Weight must be greater than 1, ${greeting}`\n }\n})\n```\n\nNow the `condition` ref is tracked by Regle and the rule will be re-evaluated whenever the `condition` ref changes.\n\n## Pinia hydration issues\n\nIf you use `store.$dispose()` or Nuxt in SSR mode, you may encounter this error:\n\n```\nUncaught TypeError: 'set' on proxy: trap returned falsish for property 'xxx'\n```\n\nThis is because Pinia tries to hydrate the stateful property `r$`.\nTo avoid this, you can use [skipHydrate](https://pinia.vuejs.org/api/pinia/functions/skipHydrate.html#skipHydrate-)\n\n```ts [pinia.store.ts]\nimport { skipHydrate } from 'pinia';\n\nexport const usePiniaStore = defineStore('pinia-store', () => {\n const {r$} = useRegle(/** */)\n\n return { r$: skipHydrate(r$) };\n});\n```\n\n:::info\nIf you are using Nuxt, you can use the `@regle/nuxt` module that will automatically skip the hydration of the `r$` property.\n:::"
318
318
  },
319
319
  {
320
320
  "id": "typescript-type-safe-output",
@@ -1969,7 +1969,7 @@ function searchApi(query) {
1969
1969
  return results;
1970
1970
  }
1971
1971
 
1972
- var version = "1.19.9-beta.1";
1972
+ var version = "1.19.9";
1973
1973
 
1974
1974
  let posthogClient = null;
1975
1975
  posthogClient = new PostHog("phc_kqgJoylCpKkGkkRGxb4MyN2mViehoQcUFEGwVkk4l8E", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@regle/mcp-server",
3
- "version": "1.19.9-beta.1",
3
+ "version": "1.19.9",
4
4
  "description": "MCP Server for Regle",
5
5
  "keywords": [
6
6
  "ai",