@userfrosting/sprinkle-core 6.0.0-beta.2 → 6.0.0-beta.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.
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { parse as YamlParse } from 'yaml'
|
|
2
1
|
import {
|
|
3
2
|
withMessage,
|
|
4
3
|
required,
|
|
@@ -22,10 +21,7 @@ export function useRuleSchemaAdapter() {
|
|
|
22
21
|
* @param rawSchema The YAML schema string to parse.
|
|
23
22
|
* @returns RuleSchema The Regle schema object.
|
|
24
23
|
*/
|
|
25
|
-
function adapt(
|
|
26
|
-
// The YAML data parsed to a JavaScript object
|
|
27
|
-
const sourceSchema = parse(rawSchema)
|
|
28
|
-
|
|
24
|
+
function adapt(sourceSchema: Record<string, any>): Record<string, any> {
|
|
29
25
|
// The Regle schema object to be returned
|
|
30
26
|
const regleSchema: any = {}
|
|
31
27
|
|
|
@@ -51,16 +47,6 @@ export function useRuleSchemaAdapter() {
|
|
|
51
47
|
return regleSchema
|
|
52
48
|
}
|
|
53
49
|
|
|
54
|
-
/**
|
|
55
|
-
* Parse the YAML schema string into a JavaScript object.
|
|
56
|
-
*
|
|
57
|
-
* @param rawSchema The YAML schema string to parse.
|
|
58
|
-
* @returns The parsed YAML schema as a JavaScript object.
|
|
59
|
-
*/
|
|
60
|
-
function parse(rawSchema: string): Record<string, any> {
|
|
61
|
-
return YamlParse(rawSchema)
|
|
62
|
-
}
|
|
63
|
-
|
|
64
50
|
function translateMessage(fieldRulesMeta: { message?: string; [key: string]: any }): string {
|
|
65
51
|
const { translate } = useTranslator()
|
|
66
52
|
|
|
@@ -215,5 +201,5 @@ export function useRuleSchemaAdapter() {
|
|
|
215
201
|
}
|
|
216
202
|
}
|
|
217
203
|
|
|
218
|
-
return { adapt,
|
|
204
|
+
return { adapt, translateMessage }
|
|
219
205
|
}
|
|
@@ -16,14 +16,17 @@ describe('useRuleSchemaAdapter', () => {
|
|
|
16
16
|
})
|
|
17
17
|
|
|
18
18
|
test('should parse a basic schema', () => {
|
|
19
|
-
const yamlInput =
|
|
20
|
-
foo:
|
|
21
|
-
validators:
|
|
22
|
-
length:
|
|
23
|
-
min: 1
|
|
19
|
+
const yamlInput = {
|
|
20
|
+
foo: {
|
|
21
|
+
validators: {
|
|
22
|
+
length: {
|
|
23
|
+
min: 1,
|
|
24
24
|
max: 132
|
|
25
|
+
},
|
|
25
26
|
required: true
|
|
26
|
-
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
27
30
|
|
|
28
31
|
const { r$ } = useRegle(
|
|
29
32
|
{
|
|
@@ -39,20 +42,26 @@ describe('useRuleSchemaAdapter', () => {
|
|
|
39
42
|
})
|
|
40
43
|
|
|
41
44
|
test('should parse a schema with a custom message', () => {
|
|
42
|
-
const yamlInput =
|
|
43
|
-
name:
|
|
44
|
-
validators:
|
|
45
|
-
length:
|
|
46
|
-
min: 2
|
|
45
|
+
const yamlInput = {
|
|
46
|
+
name: {
|
|
47
|
+
validators: {
|
|
48
|
+
length: {
|
|
49
|
+
min: 2,
|
|
47
50
|
max: 20
|
|
51
|
+
},
|
|
48
52
|
required: true
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
email: {
|
|
56
|
+
validators: {
|
|
57
|
+
length: {
|
|
58
|
+
min: 1,
|
|
53
59
|
max: 30
|
|
60
|
+
},
|
|
54
61
|
email: true
|
|
55
|
-
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
56
65
|
|
|
57
66
|
const { r$ } = useRegle(
|
|
58
67
|
{
|
|
@@ -74,13 +83,15 @@ describe('useRuleSchemaAdapter', () => {
|
|
|
74
83
|
|
|
75
84
|
test('should parse a bad schema without errors', () => {
|
|
76
85
|
// N.B.: The schema is missing the 'validators' key
|
|
77
|
-
const yamlInput =
|
|
78
|
-
foo:
|
|
79
|
-
length:
|
|
80
|
-
min: 1
|
|
86
|
+
const yamlInput = {
|
|
87
|
+
foo: {
|
|
88
|
+
length: {
|
|
89
|
+
min: 1,
|
|
81
90
|
max: 132
|
|
91
|
+
},
|
|
82
92
|
required: true
|
|
83
|
-
|
|
93
|
+
}
|
|
94
|
+
}
|
|
84
95
|
|
|
85
96
|
const { r$ } = useRegle(
|
|
86
97
|
{
|
|
@@ -96,16 +107,21 @@ describe('useRuleSchemaAdapter', () => {
|
|
|
96
107
|
})
|
|
97
108
|
|
|
98
109
|
test('required rule', () => {
|
|
99
|
-
const yamlInput =
|
|
100
|
-
first_name:
|
|
101
|
-
validators:
|
|
102
|
-
required:
|
|
103
|
-
label:
|
|
104
|
-
message: VALIDATE.REQUIRED
|
|
105
|
-
|
|
106
|
-
|
|
110
|
+
const yamlInput = {
|
|
111
|
+
first_name: {
|
|
112
|
+
validators: {
|
|
113
|
+
required: {
|
|
114
|
+
label: '&FIRST_NAME',
|
|
115
|
+
message: 'VALIDATE.REQUIRED'
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
last_name: {
|
|
120
|
+
validators: {
|
|
107
121
|
required: true
|
|
108
|
-
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
109
125
|
|
|
110
126
|
const { r$ } = useRegle(
|
|
111
127
|
{
|
|
@@ -125,15 +141,20 @@ describe('useRuleSchemaAdapter', () => {
|
|
|
125
141
|
})
|
|
126
142
|
|
|
127
143
|
test('email rule', () => {
|
|
128
|
-
const yamlInput =
|
|
129
|
-
email:
|
|
130
|
-
validators:
|
|
131
|
-
email:
|
|
132
|
-
message: VALIDATE.INVALID_EMAIL
|
|
133
|
-
|
|
134
|
-
|
|
144
|
+
const yamlInput = {
|
|
145
|
+
email: {
|
|
146
|
+
validators: {
|
|
147
|
+
email: {
|
|
148
|
+
message: 'VALIDATE.INVALID_EMAIL'
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
email2: {
|
|
153
|
+
validators: {
|
|
135
154
|
email: true
|
|
136
|
-
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
137
158
|
|
|
138
159
|
const { r$ } = useRegle(
|
|
139
160
|
{
|
|
@@ -151,26 +172,38 @@ describe('useRuleSchemaAdapter', () => {
|
|
|
151
172
|
})
|
|
152
173
|
|
|
153
174
|
test('length rule', () => {
|
|
154
|
-
const yamlInput =
|
|
155
|
-
tooShort:
|
|
156
|
-
validators:
|
|
157
|
-
length:
|
|
158
|
-
min: 5
|
|
159
|
-
tooLong:
|
|
160
|
-
validators:
|
|
161
|
-
length:
|
|
162
|
-
max: 2
|
|
163
|
-
tooShortWithMessage:
|
|
164
|
-
validators:
|
|
165
|
-
length:
|
|
175
|
+
const yamlInput = {
|
|
176
|
+
tooShort: {
|
|
177
|
+
validators: {
|
|
178
|
+
length: {
|
|
166
179
|
min: 5
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
tooLong: {
|
|
184
|
+
validators: {
|
|
185
|
+
length: {
|
|
171
186
|
max: 2
|
|
172
|
-
|
|
173
|
-
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
tooShortWithMessage: {
|
|
191
|
+
validators: {
|
|
192
|
+
length: {
|
|
193
|
+
min: 5,
|
|
194
|
+
message: 'VALIDATE.LENGTH_RANGE'
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
tooLongWithMessage: {
|
|
199
|
+
validators: {
|
|
200
|
+
length: {
|
|
201
|
+
max: 2,
|
|
202
|
+
message: 'VALIDATE.LENGTH_RANGE'
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
174
207
|
|
|
175
208
|
const { r$ } = useRegle(
|
|
176
209
|
{
|
|
@@ -193,18 +226,25 @@ describe('useRuleSchemaAdapter', () => {
|
|
|
193
226
|
})
|
|
194
227
|
|
|
195
228
|
test('integer rule', () => {
|
|
196
|
-
const yamlInput =
|
|
197
|
-
foo:
|
|
198
|
-
validators:
|
|
229
|
+
const yamlInput = {
|
|
230
|
+
foo: {
|
|
231
|
+
validators: {
|
|
199
232
|
integer: true
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
bar: {
|
|
236
|
+
validators: {
|
|
237
|
+
integer: {
|
|
238
|
+
message: 'VALIDATE.INVALID_INTEGER'
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
foobar: {
|
|
243
|
+
validators: {
|
|
206
244
|
integer: true
|
|
207
|
-
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
208
248
|
|
|
209
249
|
const { r$ } = useRegle(
|
|
210
250
|
{
|
|
@@ -224,30 +264,30 @@ describe('useRuleSchemaAdapter', () => {
|
|
|
224
264
|
})
|
|
225
265
|
|
|
226
266
|
test('member_of rule', () => {
|
|
227
|
-
const yamlInput =
|
|
228
|
-
genus:
|
|
229
|
-
validators:
|
|
230
|
-
member_of:
|
|
231
|
-
values:
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
267
|
+
const yamlInput = {
|
|
268
|
+
genus: {
|
|
269
|
+
validators: {
|
|
270
|
+
member_of: {
|
|
271
|
+
values: ['Megascops', 'Bubo', 'Glaucidium', 'Tyto', 'Athene'],
|
|
272
|
+
message: 'Sorry, that is not one of the permitted genuses.'
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
owls: {
|
|
277
|
+
validators: {
|
|
278
|
+
member_of: {
|
|
279
|
+
values: ['Foo', 'Bar']
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
valid: {
|
|
284
|
+
validators: {
|
|
285
|
+
member_of: {
|
|
286
|
+
values: ['Foo', 'Bar']
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
251
291
|
|
|
252
292
|
const { r$ } = useRegle(
|
|
253
293
|
{
|
|
@@ -274,30 +314,30 @@ describe('useRuleSchemaAdapter', () => {
|
|
|
274
314
|
})
|
|
275
315
|
|
|
276
316
|
test('not_member_of rule', () => {
|
|
277
|
-
const yamlInput =
|
|
278
|
-
genus:
|
|
279
|
-
validators:
|
|
280
|
-
not_member_of:
|
|
281
|
-
values:
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
317
|
+
const yamlInput = {
|
|
318
|
+
genus: {
|
|
319
|
+
validators: {
|
|
320
|
+
not_member_of: {
|
|
321
|
+
values: ['Megascops', 'Bubo', 'Glaucidium', 'Tyto', 'Athene'],
|
|
322
|
+
message: 'VALIDATE.NOT_MEMBER_OF'
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
owls: {
|
|
327
|
+
validators: {
|
|
328
|
+
not_member_of: {
|
|
329
|
+
values: ['Foo', 'Bar']
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
valid: {
|
|
334
|
+
validators: {
|
|
335
|
+
not_member_of: {
|
|
336
|
+
values: ['Foo', 'Bar']
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
}
|
|
301
341
|
|
|
302
342
|
const { r$ } = useRegle(
|
|
303
343
|
{
|
|
@@ -319,19 +359,26 @@ describe('useRuleSchemaAdapter', () => {
|
|
|
319
359
|
})
|
|
320
360
|
|
|
321
361
|
test('no_leading_whitespace rule', () => {
|
|
322
|
-
const yamlInput =
|
|
323
|
-
withMessage:
|
|
324
|
-
validators:
|
|
325
|
-
no_leading_whitespace:
|
|
326
|
-
label:
|
|
327
|
-
message: VALIDATE.NO_LEAD_WS
|
|
328
|
-
|
|
329
|
-
|
|
362
|
+
const yamlInput = {
|
|
363
|
+
withMessage: {
|
|
364
|
+
validators: {
|
|
365
|
+
no_leading_whitespace: {
|
|
366
|
+
label: '&USERNAME',
|
|
367
|
+
message: 'VALIDATE.NO_LEAD_WS'
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
},
|
|
371
|
+
defaultMessage: {
|
|
372
|
+
validators: {
|
|
330
373
|
no_leading_whitespace: true
|
|
331
|
-
|
|
332
|
-
|
|
374
|
+
}
|
|
375
|
+
},
|
|
376
|
+
valid: {
|
|
377
|
+
validators: {
|
|
333
378
|
no_leading_whitespace: true
|
|
334
|
-
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
335
382
|
|
|
336
383
|
const { r$ } = useRegle(
|
|
337
384
|
{
|
|
@@ -355,19 +402,26 @@ describe('useRuleSchemaAdapter', () => {
|
|
|
355
402
|
})
|
|
356
403
|
|
|
357
404
|
test('no_trailing_whitespace rule', () => {
|
|
358
|
-
const yamlInput =
|
|
359
|
-
withMessage:
|
|
360
|
-
validators:
|
|
361
|
-
no_trailing_whitespace:
|
|
362
|
-
label:
|
|
363
|
-
message: VALIDATE.NO_TRAIL_WS
|
|
364
|
-
|
|
365
|
-
|
|
405
|
+
const yamlInput = {
|
|
406
|
+
withMessage: {
|
|
407
|
+
validators: {
|
|
408
|
+
no_trailing_whitespace: {
|
|
409
|
+
label: '&USERNAME',
|
|
410
|
+
message: 'VALIDATE.NO_TRAIL_WS'
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
defaultMessage: {
|
|
415
|
+
validators: {
|
|
366
416
|
no_trailing_whitespace: true
|
|
367
|
-
|
|
368
|
-
|
|
417
|
+
}
|
|
418
|
+
},
|
|
419
|
+
valid: {
|
|
420
|
+
validators: {
|
|
369
421
|
no_trailing_whitespace: true
|
|
370
|
-
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
371
425
|
|
|
372
426
|
const { r$ } = useRegle(
|
|
373
427
|
{
|
|
@@ -391,18 +445,25 @@ describe('useRuleSchemaAdapter', () => {
|
|
|
391
445
|
})
|
|
392
446
|
|
|
393
447
|
test('numeric rule', () => {
|
|
394
|
-
const yamlInput =
|
|
395
|
-
withMessage:
|
|
396
|
-
validators:
|
|
397
|
-
numeric:
|
|
398
|
-
message: VALIDATE.INVALID_NUMERIC
|
|
399
|
-
|
|
400
|
-
|
|
448
|
+
const yamlInput = {
|
|
449
|
+
withMessage: {
|
|
450
|
+
validators: {
|
|
451
|
+
numeric: {
|
|
452
|
+
message: 'VALIDATE.INVALID_NUMERIC'
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
},
|
|
456
|
+
defaultMessage: {
|
|
457
|
+
validators: {
|
|
401
458
|
numeric: true
|
|
402
|
-
|
|
403
|
-
|
|
459
|
+
}
|
|
460
|
+
},
|
|
461
|
+
valid: {
|
|
462
|
+
validators: {
|
|
404
463
|
numeric: true
|
|
405
|
-
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
}
|
|
406
467
|
|
|
407
468
|
const { r$ } = useRegle(
|
|
408
469
|
{
|
|
@@ -422,24 +483,33 @@ describe('useRuleSchemaAdapter', () => {
|
|
|
422
483
|
})
|
|
423
484
|
|
|
424
485
|
test('range rule', () => {
|
|
425
|
-
const yamlInput =
|
|
426
|
-
withMessage:
|
|
427
|
-
validators:
|
|
428
|
-
range:
|
|
429
|
-
min: 0
|
|
430
|
-
max: 10
|
|
431
|
-
message: VALIDATE.INVALID_RANGE
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
486
|
+
const yamlInput = {
|
|
487
|
+
withMessage: {
|
|
488
|
+
validators: {
|
|
489
|
+
range: {
|
|
490
|
+
min: 0,
|
|
491
|
+
max: 10,
|
|
492
|
+
message: 'VALIDATE.INVALID_RANGE'
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
defaultMessage: {
|
|
497
|
+
validators: {
|
|
498
|
+
range: {
|
|
499
|
+
min: 0,
|
|
436
500
|
max: 10
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
},
|
|
504
|
+
valid: {
|
|
505
|
+
validators: {
|
|
506
|
+
range: {
|
|
507
|
+
min: 0,
|
|
441
508
|
max: 10
|
|
442
|
-
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
}
|
|
443
513
|
|
|
444
514
|
const { r$ } = useRegle(
|
|
445
515
|
{
|
|
@@ -462,21 +532,30 @@ describe('useRuleSchemaAdapter', () => {
|
|
|
462
532
|
})
|
|
463
533
|
|
|
464
534
|
test('regex rule', () => {
|
|
465
|
-
const yamlInput =
|
|
466
|
-
withMessage:
|
|
467
|
-
validators:
|
|
468
|
-
regex:
|
|
469
|
-
regex: ^who(o*)$
|
|
470
|
-
message: VALIDATE.INVALID_VALUE
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
535
|
+
const yamlInput = {
|
|
536
|
+
withMessage: {
|
|
537
|
+
validators: {
|
|
538
|
+
regex: {
|
|
539
|
+
regex: '^who(o*)$',
|
|
540
|
+
message: 'VALIDATE.INVALID_VALUE'
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
},
|
|
544
|
+
defaultMessage: {
|
|
545
|
+
validators: {
|
|
546
|
+
regex: {
|
|
547
|
+
regex: '^who(o*)$'
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
},
|
|
551
|
+
valid: {
|
|
552
|
+
validators: {
|
|
553
|
+
regex: {
|
|
554
|
+
regex: '^who(o*)$'
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
}
|
|
480
559
|
|
|
481
560
|
const { r$ } = useRegle(
|
|
482
561
|
{
|
|
@@ -499,18 +578,25 @@ describe('useRuleSchemaAdapter', () => {
|
|
|
499
578
|
})
|
|
500
579
|
|
|
501
580
|
test('uri rule', () => {
|
|
502
|
-
const yamlInput =
|
|
503
|
-
withMessage:
|
|
504
|
-
validators:
|
|
505
|
-
uri:
|
|
506
|
-
message: VALIDATE.INVALID_URL
|
|
507
|
-
|
|
508
|
-
|
|
581
|
+
const yamlInput = {
|
|
582
|
+
withMessage: {
|
|
583
|
+
validators: {
|
|
584
|
+
uri: {
|
|
585
|
+
message: 'VALIDATE.INVALID_URL'
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
},
|
|
589
|
+
defaultMessage: {
|
|
590
|
+
validators: {
|
|
509
591
|
uri: true
|
|
510
|
-
|
|
511
|
-
|
|
592
|
+
}
|
|
593
|
+
},
|
|
594
|
+
valid: {
|
|
595
|
+
validators: {
|
|
512
596
|
uri: true
|
|
513
|
-
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
}
|
|
514
600
|
|
|
515
601
|
const { r$ } = useRegle(
|
|
516
602
|
{
|
|
@@ -530,18 +616,25 @@ describe('useRuleSchemaAdapter', () => {
|
|
|
530
616
|
})
|
|
531
617
|
|
|
532
618
|
test('username rule', () => {
|
|
533
|
-
const yamlInput =
|
|
534
|
-
withMessage:
|
|
535
|
-
validators:
|
|
536
|
-
username:
|
|
537
|
-
message: VALIDATE.INVALID_USERNAME
|
|
538
|
-
|
|
539
|
-
|
|
619
|
+
const yamlInput = {
|
|
620
|
+
withMessage: {
|
|
621
|
+
validators: {
|
|
622
|
+
username: {
|
|
623
|
+
message: 'VALIDATE.INVALID_USERNAME'
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
},
|
|
627
|
+
defaultMessage: {
|
|
628
|
+
validators: {
|
|
540
629
|
username: true
|
|
541
|
-
|
|
542
|
-
|
|
630
|
+
}
|
|
631
|
+
},
|
|
632
|
+
valid: {
|
|
633
|
+
validators: {
|
|
543
634
|
username: true
|
|
544
|
-
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
}
|
|
545
638
|
|
|
546
639
|
const { r$ } = useRegle(
|
|
547
640
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@userfrosting/sprinkle-core",
|
|
3
|
-
"version": "6.0.0-beta.
|
|
3
|
+
"version": "6.0.0-beta.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Core Sprinkle for UserFrosting",
|
|
6
6
|
"funding": "https://opencollective.com/userfrosting",
|
|
@@ -37,46 +37,12 @@
|
|
|
37
37
|
"@regle/core": "^1.6.0",
|
|
38
38
|
"@regle/rules": "^1.6.0",
|
|
39
39
|
"dot-prop": "^9.0.0",
|
|
40
|
-
"luxon": "^3.5.0"
|
|
41
|
-
"yaml": "^2.8.0"
|
|
40
|
+
"luxon": "^3.5.0"
|
|
42
41
|
},
|
|
43
42
|
"peerDependencies": {
|
|
44
43
|
"axios": "^1.5.0",
|
|
45
44
|
"pinia": "^2.1.6",
|
|
46
45
|
"pinia-plugin-persistedstate": "^3.2.0",
|
|
47
46
|
"vue": "^3.4.21"
|
|
48
|
-
},
|
|
49
|
-
"devDependencies": {
|
|
50
|
-
"@rushstack/eslint-patch": "^1.8.0",
|
|
51
|
-
"@tsconfig/node20": "^20.1.4",
|
|
52
|
-
"@types/luxon": "^3.4.2",
|
|
53
|
-
"@types/node": "^20.12.5",
|
|
54
|
-
"@vitejs/plugin-vue": "^5.0.4",
|
|
55
|
-
"@vitest/coverage-v8": "^3.1.1",
|
|
56
|
-
"@vue/eslint-config-prettier": "^9.0.0",
|
|
57
|
-
"@vue/eslint-config-typescript": "^13.0.0",
|
|
58
|
-
"@vue/test-utils": "^2.4.6",
|
|
59
|
-
"@vue/tsconfig": "^0.5.1",
|
|
60
|
-
"eslint": "^8.57.0",
|
|
61
|
-
"eslint-plugin-vue": "^9.23.0",
|
|
62
|
-
"happy-dom": "^15.11.6",
|
|
63
|
-
"less": "^4.2.0",
|
|
64
|
-
"npm-run-all2": "^6.1.2",
|
|
65
|
-
"prettier": "^3.6.2",
|
|
66
|
-
"vite": "^6.2",
|
|
67
|
-
"vite-plugin-dts": "^4.0.0",
|
|
68
|
-
"vitest": "^3.1.1",
|
|
69
|
-
"vue": "^3.4.21",
|
|
70
|
-
"vue-router": "^4.2.4",
|
|
71
|
-
"vue-tsc": "^2.0.11"
|
|
72
|
-
},
|
|
73
|
-
"scripts": {
|
|
74
|
-
"dev": "vite",
|
|
75
|
-
"typecheck": "vue-tsc --noEmit",
|
|
76
|
-
"build": "vue-tsc && vite build",
|
|
77
|
-
"lint": "eslint app/assets/ --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
|
78
|
-
"format": "prettier --write app/assets/",
|
|
79
|
-
"test": "vitest",
|
|
80
|
-
"coverage": "vitest run --coverage"
|
|
81
47
|
}
|
|
82
48
|
}
|