From 3a97da37ffdac4609d994799ab7d8452e2c586b5 Mon Sep 17 00:00:00 2001 From: Victor Garcia Date: Fri, 6 Oct 2023 18:25:06 +0200 Subject: [PATCH] Fixed build --- package.json | 4 ++-- packages/core/src/core/defaultValidators.ts | 15 ++++++--------- packages/core/src/core/useRegle/guards/index.ts | 1 + packages/core/src/core/useRegle/useErrors.ts | 9 +-------- packages/core/tsup.config.ts | 1 + packages/validators/tsup.config.ts | 1 + playground/vue3/package.json | 3 ++- playground/vue3/src/App.vue | 5 ++--- playground/vue3/src/validations.ts | 4 ++-- pnpm-lock.yaml | 9 ++++++--- 10 files changed, 24 insertions(+), 28 deletions(-) diff --git a/package.json b/package.json index 73e7bab..5f3ac9f 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,8 @@ "description": "Vue form validator", "scripts": { "lint": "eslint --ext .ts --ext .vue .", - "typecheck": "vue-tsc --noEmit", - "build": "pnpm run -r --parallel build", + "typecheck": "tsc --noEmit", + "build": "pnpm run -r build", "release": "bumpp -r && pnpm run -r --parallel release && git push --follow-tags" }, "devDependencies": { diff --git a/packages/core/src/core/defaultValidators.ts b/packages/core/src/core/defaultValidators.ts index 2d4ef5d..4ba9b27 100644 --- a/packages/core/src/core/defaultValidators.ts +++ b/packages/core/src/core/defaultValidators.ts @@ -1,10 +1,7 @@ -import { CustomRulesDeclarationTree } from '../types'; -// import { maxLength, required, requiredIf } from '@regle/validators'; +import { RegleRuleDefinition, RegleRuleWithParamsDefinition } from '../types'; -export const defaultValidators = { - // maxLength, - // required, - // requiredIf, -} satisfies CustomRulesDeclarationTree; - -export type DefaultValidators = typeof defaultValidators; +export type DefaultValidators = { + maxLength: RegleRuleWithParamsDefinition; + required: RegleRuleDefinition; + requiredIf: RegleRuleWithParamsDefinition; +}; diff --git a/packages/core/src/core/useRegle/guards/index.ts b/packages/core/src/core/useRegle/guards/index.ts index d513869..c4b4ed8 100644 --- a/packages/core/src/core/useRegle/guards/index.ts +++ b/packages/core/src/core/useRegle/guards/index.ts @@ -1 +1,2 @@ export * from './ruleDef.guards'; +export * from './rule.status.guards'; diff --git a/packages/core/src/core/useRegle/useErrors.ts b/packages/core/src/core/useRegle/useErrors.ts index 4a7155a..3c20b3a 100644 --- a/packages/core/src/core/useRegle/useErrors.ts +++ b/packages/core/src/core/useRegle/useErrors.ts @@ -2,18 +2,11 @@ import { Ref, computed } from 'vue'; import { PossibleRegleErrors, PossibleRegleStatus, - RegleCollectionErrors, RegleCollectionStatus, - RegleErrorTree, RegleRuleStatus, RegleStatus, } from '../../types'; -import { - isCollectionRulesStatus, - isFieldStatus, - isNestedRulesStatus, - isRuleStatus, -} from './guards/rule.status.guards'; +import { isCollectionRulesStatus, isFieldStatus, isNestedRulesStatus } from './guards'; function extractRulesErrors(rules: Record): string[] { return Object.entries(rules) diff --git a/packages/core/tsup.config.ts b/packages/core/tsup.config.ts index 63ea1a0..ce53708 100644 --- a/packages/core/tsup.config.ts +++ b/packages/core/tsup.config.ts @@ -5,4 +5,5 @@ export default defineConfig({ format: ['esm', 'cjs'], dts: true, clean: true, + external: ['vue'], }); diff --git a/packages/validators/tsup.config.ts b/packages/validators/tsup.config.ts index 63ea1a0..ce53708 100644 --- a/packages/validators/tsup.config.ts +++ b/packages/validators/tsup.config.ts @@ -5,4 +5,5 @@ export default defineConfig({ format: ['esm', 'cjs'], dts: true, clean: true, + external: ['vue'], }); diff --git a/playground/vue3/package.json b/playground/vue3/package.json index 0e0e53c..46e0842 100644 --- a/playground/vue3/package.json +++ b/playground/vue3/package.json @@ -10,7 +10,8 @@ "format": "prettier --write src/" }, "dependencies": { - "regle": "workspace:*", + "@regle/core": "workspace:*", + "@regle/validators": "workspace:*", "pinia": "^2.1.6", "vue": "^3.3.4" }, diff --git a/playground/vue3/src/App.vue b/playground/vue3/src/App.vue index 9295fc0..4e0e1c4 100644 --- a/playground/vue3/src/App.vue +++ b/playground/vue3/src/App.vue @@ -26,10 +26,9 @@