@regle/core 1.1.1 → 1.1.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.
package/README.md CHANGED
@@ -15,14 +15,20 @@ It's heavily inspired by Vuelidate.
15
15
 
16
16
  ## 🎮 Play with it
17
17
 
18
- | Simple demo | Advanced Demo |
19
- | ------------- | ------------- |
20
- | [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/~/github.com/victorgarciaesgi/regle-examples/tree/main/examples/simple-example?file=examples/simple-example/src/App.vue&configPath=examples/simple-example) | [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/~/github.com/victorgarciaesgi/regle-examples/tree/main/examples/advanced-example?file=examples/advanced-example/src/App.vue&configPath=examples/advanced-example) |
18
+ | Playground | Simple demo | Advanced Demo |
19
+ | ------------- | ------------- | ------------- |
20
+ | <a target='_blank' href="https://play.reglejs.dev"><img width="180" src="https://raw.githubusercontent.com/victorgarciaesgi/regle/refs/heads/main/.github/images/regle-playground-button.svg" /></a> | [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/~/github.com/victorgarciaesgi/regle-examples/tree/main/examples/simple-example?file=examples/simple-example/src/App.vue&configPath=examples/simple-example) | [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/~/github.com/victorgarciaesgi/regle-examples/tree/main/examples/advanced-example?file=examples/advanced-example/src/App.vue&configPath=examples/advanced-example) |
21
21
 
22
22
  ## 🧰 Features
23
- - ✅ 100% type inference
24
- - 📖 Model based validation
25
- - 🪗 Extensible
26
- - 🛒 Collection validation
27
- - 🦸‍♂️ [Zod](https://zod.dev/) support
28
- - 🤖 [Valibot](https://valibot.dev/) support
23
+
24
+ - ☁️ Headless
25
+ - Type safety
26
+ - 🧮 Model based
27
+ - 🧰 Modular
28
+ - 🔄 Async validation
29
+ - 🌐 Plug any i18n library
30
+ - 📗 Vuelidate like API
31
+ - Standard Schemas spec support
32
+ - 🦸‍♂️ [Zod](https://zod.dev/)
33
+ - 🤖 [Valibot](https://valibot.dev/)
34
+ - 🚢 [ArkType](https://arktype.io) 🚧
@@ -1742,7 +1742,7 @@ declare function flatErrors(errors: $InternalRegleErrors, options?: {
1742
1742
  includePath?: false;
1743
1743
  }): string[];
1744
1744
 
1745
- type InferRegleRoot<T extends (...args: any[]) => Regle<any, any, any, any>> = T extends (...args: any[]) => infer U ? U extends Regle<any, any, any, any> ? Prettify<U['r$']> : never : never;
1745
+ type InferRegleRoot<T extends (...args: any[]) => SuperCompatibleRegle> = T extends (...args: any[]) => infer U ? U extends SuperCompatibleRegle ? U['r$'] : never : never;
1746
1746
  type InferRegleRules<T extends useRegleFn<any, any>> = T extends useRegleFn<infer U, any> ? UnwrapRuleTree<Partial<U> & Partial<DefaultValidators>> : {};
1747
1747
  type InferRegleShortcuts<T extends useRegleFn<any, any>> = T extends useRegleFn<any, infer U> ? U : {};
1748
1748
  type RegleEnforceRequiredRules<TRules extends keyof DefaultValidators> = Omit<Partial<DefaultValidatorsTree>, TRules> & {
@@ -2384,6 +2384,9 @@ interface $InternalRegleCollectionStatus extends Omit<$InternalRegleStatus, '$fi
2384
2384
  $validate: () => Promise<$InternalRegleResult>;
2385
2385
  }
2386
2386
 
2387
+ interface SuperCompatibleRegle {
2388
+ r$: SuperCompatibleRegleRoot;
2389
+ }
2387
2390
  /** Supports both core Regle and schemas Regle for Zod/Valibot */
2388
2391
  type SuperCompatibleRegleRoot = SuperCompatibleRegleStatus & {
2389
2392
  $groups?: {
@@ -2637,4 +2640,4 @@ declare function variantToRef<TRoot extends RegleStatus<{}, any, any>, const TKe
2637
2640
  [K in TKey]: RegleFieldStatus<TValue, any, any>;
2638
2641
  }> | undefined>;
2639
2642
 
2640
- export { type $InternalRegleStatus, type AllRulesDeclarations, type CommonAlphaOptions, type CommonComparisonOptions, type DeepMaybeRef, type DeepReactiveState, type DefaultValidatorsTree, type FormRuleDeclaration, type InferRegleRoot, type InferRegleRule, type InferRegleRules, type InferRegleShortcuts, type InferRegleStatusType, type InferSafeOutput, type InlineRuleDeclaration, InternalRuleType, type JoinDiscriminatedUnions, type LocalRegleBehaviourOptions, type Maybe, type MaybeInput, type MaybeOutput, type MaybeVariantStatus, type MergedRegles, type NarrowVariant, type NoInferLegacy, type PrimitiveTypes, type Regle, type RegleBehaviourOptions, type RegleCollectionErrors, type RegleCollectionRuleDecl, type RegleCollectionRuleDefinition, type RegleCollectionStatus, type RegleCommonStatus, type RegleComputedRules, type RegleEnforceCustomRequiredRules, type RegleEnforceRequiredRules, type RegleErrorTree, type RegleExternalCollectionErrors, type RegleExternalErrorTree, type RegleFieldStatus, type RegleFormPropertyType, type RegleInternalRuleDefs, type ReglePartialRuleTree, type RegleResult, type RegleRoot, type RegleRuleCore, type RegleRuleDecl, type RegleRuleDefinition, type RegleRuleDefinitionProcessor, type RegleRuleDefinitionWithMetadataProcessor, type RegleRuleInit, type RegleRuleMetadataConsumer, type RegleRuleMetadataDefinition, type RegleRuleMetadataExtended, type RegleRuleRaw, type RegleRuleStatus, type RegleRuleTypeReturn, type RegleRuleWithParamsDefinition, type RegleShortcutDefinition, type RegleSingleField, type RegleStatus, type RegleUniversalParams, type RegleValidationErrors, type RegleValidationGroupEntry, type RegleValidationGroupOutput, type RegleRuleTree as RegleValidationTree, type ResolvedRegleBehaviourOptions, type ScopedInstancesRecord, type ScopedInstancesRecordLike, type SuperCompatibleRegleCollectionErrors, type SuperCompatibleRegleCollectionStatus, type SuperCompatibleRegleFieldStatus, type SuperCompatibleRegleResult, type SuperCompatibleRegleRoot, type SuperCompatibleRegleRuleStatus, type SuperCompatibleRegleStatus, type Unwrap, type UnwrapRegleUniversalParams, type UnwrapRuleWithParams, createRule, createScopedUseRegle, createVariant, defineRegleConfig, extendRegleConfig, flatErrors, inferRules, mergeRegles, narrowVariant, unwrapRuleParameters, useCollectScope, useRegle, useRootStorage, useScopedRegle, variantToRef };
2643
+ export { type $InternalRegleStatus, type AllRulesDeclarations, type CommonAlphaOptions, type CommonComparisonOptions, type DeepMaybeRef, type DeepReactiveState, type DefaultValidatorsTree, type FormRuleDeclaration, type InferRegleRoot, type InferRegleRule, type InferRegleRules, type InferRegleShortcuts, type InferRegleStatusType, type InferSafeOutput, type InlineRuleDeclaration, InternalRuleType, type JoinDiscriminatedUnions, type LocalRegleBehaviourOptions, type Maybe, type MaybeInput, type MaybeOutput, type MaybeVariantStatus, type MergedRegles, type NarrowVariant, type NoInferLegacy, type PrimitiveTypes, type Regle, type RegleBehaviourOptions, type RegleCollectionErrors, type RegleCollectionRuleDecl, type RegleCollectionRuleDefinition, type RegleCollectionStatus, type RegleCommonStatus, type RegleComputedRules, type RegleEnforceCustomRequiredRules, type RegleEnforceRequiredRules, type RegleErrorTree, type RegleExternalCollectionErrors, type RegleExternalErrorTree, type RegleFieldStatus, type RegleFormPropertyType, type RegleInternalRuleDefs, type ReglePartialRuleTree, type RegleResult, type RegleRoot, type RegleRuleCore, type RegleRuleDecl, type RegleRuleDefinition, type RegleRuleDefinitionProcessor, type RegleRuleDefinitionWithMetadataProcessor, type RegleRuleInit, type RegleRuleMetadataConsumer, type RegleRuleMetadataDefinition, type RegleRuleMetadataExtended, type RegleRuleRaw, type RegleRuleStatus, type RegleRuleTypeReturn, type RegleRuleWithParamsDefinition, type RegleShortcutDefinition, type RegleSingleField, type RegleStatus, type RegleUniversalParams, type RegleValidationErrors, type RegleValidationGroupEntry, type RegleValidationGroupOutput, type RegleRuleTree as RegleValidationTree, type ResolvedRegleBehaviourOptions, type ScopedInstancesRecord, type ScopedInstancesRecordLike, type SuperCompatibleRegle, type SuperCompatibleRegleCollectionErrors, type SuperCompatibleRegleCollectionStatus, type SuperCompatibleRegleFieldStatus, type SuperCompatibleRegleResult, type SuperCompatibleRegleRoot, type SuperCompatibleRegleRuleStatus, type SuperCompatibleRegleStatus, type Unwrap, type UnwrapRegleUniversalParams, type UnwrapRuleWithParams, createRule, createScopedUseRegle, createVariant, defineRegleConfig, extendRegleConfig, flatErrors, inferRules, mergeRegles, narrowVariant, unwrapRuleParameters, useCollectScope, useRegle, useRootStorage, useScopedRegle, variantToRef };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@regle/core",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "Headless form validation library for Vue 3",
5
5
  "peerDependencies": {
6
6
  "pinia": ">=2.2.5",