Skip to content

Commit

Permalink
Fixed build
Browse files Browse the repository at this point in the history
  • Loading branch information
victorgarciaesgi committed Oct 6, 2023
1 parent 5769f43 commit 3a97da3
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 28 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
15 changes: 6 additions & 9 deletions packages/core/src/core/defaultValidators.ts
Original file line number Diff line number Diff line change
@@ -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<string, [count: number]>;
required: RegleRuleDefinition<unknown, []>;
requiredIf: RegleRuleWithParamsDefinition<unknown, [condition: boolean]>;
};
1 change: 1 addition & 0 deletions packages/core/src/core/useRegle/guards/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './ruleDef.guards';
export * from './rule.status.guards';
9 changes: 1 addition & 8 deletions packages/core/src/core/useRegle/useErrors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, RegleRuleStatus>): string[] {
return Object.entries(rules)
Expand Down
1 change: 1 addition & 0 deletions packages/core/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ export default defineConfig({
format: ['esm', 'cjs'],
dts: true,
clean: true,
external: ['vue'],
});
1 change: 1 addition & 0 deletions packages/validators/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ export default defineConfig({
format: ['esm', 'cjs'],
dts: true,
clean: true,
external: ['vue'],
});
3 changes: 2 additions & 1 deletion playground/vue3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
5 changes: 2 additions & 3 deletions playground/vue3/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@
</template>

<script setup lang="ts">
import { maxLength, required, requiredIf } from '@regle/core';
import { maxLength, required, requiredIf, withMessage } from '@regle/validators';
import { ref } from 'vue';
import { useRegle, asyncEmail, timeout } from './validations';
import { withAsync, withMessage } from '@regle/core/src/helpers';
import { useRegle, asyncEmail } from './validations';
type Form = {
email: string;
Expand Down
4 changes: 2 additions & 2 deletions playground/vue3/src/validations.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createRule, defineCustomValidators, maxLength } from '@regle/core';
import { isEmpty, withMessage } from '@regle/core/src/helpers';
import { createRule, defineCustomValidators } from '@regle/core';
import { isEmpty, withMessage, maxLength } from '@regle/validators';

export const not = createRule<unknown, [target: string]>({
type: 'not',
Expand Down
9 changes: 6 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3a97da3

Please sign in to comment.