@regle/mcp-server 1.28.1 → 1.28.3

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.
@@ -12,7 +12,7 @@ const rawData = {
12
12
  "title": "Extend properties",
13
13
  "category": "advanced-usage",
14
14
  "path": "advanced-usage/extend-properties.md",
15
- "content": "# Extend properties\n\nRegle offers a way to extend the default validation properties with `defineRegleConfig`.\n\nFor more information about global config [check here](/advanced-usage/global-config)\n\n## Extending field properties\n\n```ts twoslash\nimport { required } from '@regle/rules';\n\n// ---cut---\nimport { defineRegleConfig } from '@regle/core';\n\nconst { useRegle } = defineRegleConfig({\n shortcuts: {\n fields: {\n $isRequired: (field) => field.$rules.required?.$active ?? false;\n }\n }\n});\n\nconst { r$ } = useRegle({ name: '' }, {\n name: {\n required\n }\n})\n\nr$.name.$isRe\n\n```\n\n## Extending nested object properties\n\n```ts twoslash\nimport { required } from '@regle/rules';\n\n// ---cut---\nimport { defineRegleConfig } from '@regle/core';\n\nconst { useRegle } = defineRegleConfig({\n shortcuts: {\n nested: {\n $isEmpty: (nest) => Object.keys(nest.$fields).length === 0;\n }\n }\n});\n\nconst { r$ } = useRegle({ user: {} } as { user: { firstName?: string, lastName?: string } }, {\n user: {\n firstName: {required}\n }\n})\n\nr$.user.$is\n\n```\n\n## Extending collections properties\n\n```ts twoslash\nimport { required } from '@regle/rules';\n\n// ---cut---\nimport { defineRegleConfig } from '@regle/core';\n\nconst { useRegle } = defineRegleConfig({\n shortcuts: {\n collections: {\n $isArrayEmpty: (collection) => collection.$each.length === 0;\n }\n }\n});\n\nconst { r$ } = useRegle({ projects: [{ name: '' }] }, {\n projects: {\n $each: {\n name: { required }\n }\n }\n})\n\nr$.projects.$is\n\n```\n\n## Typing shortcuts in component props <span data-title='*.ts'></span>\n\nWhen defining shortcuts, it can be hard to type props in common Input components.\nFor this Regle provides a type helper that can ease the declaration of these props.\n\n:::code-group\n\n```ts twoslash include config [config.ts]\n\n// ---cut---\nimport { defineRegleConfig } from '@regle/core';\nexport const { useRegle: useCustomRegle } = defineRegleConfig({\n shortcuts: {\n fields: {\n $test: () => true,\n },\n },\n});\n```\n\n```vue twoslash [myInput.vue]\n<script lang='ts' setup>\nimport { defineRegleConfig } from '@regle/core';\n\n// ---cut---\n\nimport type { RegleCustomFieldStatus } from '@regle/core';\nimport {useCustomRegle} from './config'\n\nconst props = defineProps<{\n field: RegleCustomFieldStatus<typeof useCustomRegle, string, 'required'>;\n placeholder: string;\n}>();\n\nprops.field.$test\n<\/script>\n```\n\n:::"
15
+ "content": "# Extend properties\n\nRegle offers a way to extend the default validation properties with `defineRegleConfig`.\n\nFor more information about global config [check here](/advanced-usage/global-config)\n\n## Extending field properties\n\n```ts twoslash\nimport { required } from '@regle/rules';\n\n// ---cut---\nimport { defineRegleConfig } from '@regle/core';\n\nconst { useRegle } = defineRegleConfig({\n shortcuts: {\n fields: {\n $isRequired: (field) => field.$rules.required?.$active ?? false;\n }\n }\n});\n\nconst { r$ } = useRegle({ name: '' }, {\n name: {\n required\n }\n})\n\nr$.name.$isRe\n\n```\n\n## Extending nested object properties\n\n```ts twoslash\nimport { required } from '@regle/rules';\n\n// ---cut---\nimport { defineRegleConfig } from '@regle/core';\n\nconst { useRegle } = defineRegleConfig({\n shortcuts: {\n nested: {\n $isEmpty: (nest) => Object.keys(nest.$fields).length === 0;\n }\n }\n});\n\nconst { r$ } = useRegle({ user: {} } as { user: { firstName?: string, lastName?: string } }, {\n user: {\n firstName: {required}\n }\n})\n\nr$.user.$is\n\n```\n\n## Extending collections properties\n\n```ts twoslash\nimport { required } from '@regle/rules';\n\n// ---cut---\nimport { defineRegleConfig } from '@regle/core';\n\nconst { useRegle } = defineRegleConfig({\n shortcuts: {\n collections: {\n $isArrayEmpty: (collection) => collection.$each.length === 0;\n }\n }\n});\n\nconst { r$ } = useRegle({ projects: [{ name: '' }] }, {\n projects: {\n $each: {\n name: { required }\n }\n }\n})\n\nr$.projects.$is\n\n```\n\n## Typing shortcuts in component props <span data-title='*.ts'></span>\n\nWhen defining shortcuts, it can be hard to type props in common Input components.\nFor this Regle provides a type helper that can ease the declaration of these props.\n\n:::code-group\n\n```ts twoslash include config [config.ts]\n\n// ---cut---\nimport { defineRegleConfig } from '@regle/core';\nexport const { useRegle: useCustomRegle } = defineRegleConfig({\n shortcuts: {\n fields: {\n $test: () => true,\n },\n },\n});\n```\n\n```vue twoslash [myInput.vue]\n\n```\n\n:::"
16
16
  },
17
17
  {
18
18
  "id": "advanced-usage-global-config",
@@ -2002,7 +2002,7 @@ function searchApi(query) {
2002
2002
  });
2003
2003
  return results;
2004
2004
  }
2005
- var version = "1.28.1";
2005
+ var version = "1.28.3";
2006
2006
  let posthogClient = null;
2007
2007
  posthogClient = new PostHog("phc_kqgJoylCpKkGkkRGxb4MyN2mViehoQcUFEGwVkk4l8E", {
2008
2008
  host: "https://eu.i.posthog.com",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@regle/mcp-server",
3
- "version": "1.28.1",
3
+ "version": "1.28.3",
4
4
  "description": "MCP Server for Regle",
5
5
  "keywords": [
6
6
  "ai",