@sealcode/sealgen 0.17.28 → 0.17.29
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/.xunit +60 -58
- package/@types/src/forms/controls/array.d.ts +1 -1
- package/@types/src/forms/controls/derived-frame.d.ts +1 -1
- package/@types/src/forms/controls/form-control.d.ts +1 -1
- package/@types/src/forms/controls/multiple-files.d.ts +1 -1
- package/@types/src/forms/controls/table.d.ts +1 -1
- package/@types/src/forms/form.d.ts +1 -1
- package/@types/src/forms/multiform.d.ts +1 -1
- package/@types/src/mount.d.ts +1 -1
- package/@types/src/page/mountable.d.ts +1 -1
- package/@types/src/page/page.d.ts +1 -1
- package/@types/src/page/stateful-page.d.ts +1 -1
- package/@types/src/test_utils/test-on-real-app.d.ts +1 -1
- package/README.md +12 -0
- package/lib/get-fonts.js +51 -4
- package/lib/templates/route-test.js +11 -20
- package/package.json +2 -1
- package/src/get-fonts.ts +64 -4
- package/src/templates/route-test.ts +11 -20
package/.xunit
CHANGED
|
@@ -1,68 +1,70 @@
|
|
|
1
|
-
<testsuite name="Mocha Tests" tests="
|
|
2
|
-
<testcase classname="single-reference.test" name="creates an item list page with working partial string search for text fields" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/add-list-route.test.js" time="
|
|
3
|
-
<testcase classname="add route test" name="creates minimal sealious app and adds a simple route that works" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/add-route.test.js" time="
|
|
1
|
+
<testsuite name="Mocha Tests" tests="68" failures="0" errors="0" skipped="0" timestamp="Sat, 05 Apr 2025 13:32:59 GMT" time="104.165">
|
|
2
|
+
<testcase classname="single-reference.test" name="creates an item list page with working partial string search for text fields" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/add-list-route.test.js" time="19.013"/>
|
|
3
|
+
<testcase classname="add route test" name="creates minimal sealious app and adds a simple route that works" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/add-route.test.js" time="21.951"/>
|
|
4
4
|
<testcase classname="empty test" name="empty test" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/example.test.js" time="0"/>
|
|
5
|
-
<testcase classname="checkboxed-list basic tests" name="sends the values" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/controls/checkboxed-list-input.test.js" time="0.
|
|
6
|
-
<testcase classname="checkboxed-list basic tests" name="renders the label" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/controls/checkboxed-list-input.test.js" time="0.
|
|
7
|
-
<testcase classname="checkboxed-list basic tests
|
|
8
|
-
<testcase classname="checkboxed-list basic tests behavior with (non)required" name="
|
|
9
|
-
<testcase classname="checkboxed-list basic tests behavior with (non)required" name="
|
|
10
|
-
<testcase classname="
|
|
11
|
-
<testcase classname="
|
|
12
|
-
<testcase classname="photo-control basic tests" name="
|
|
13
|
-
<testcase classname="
|
|
5
|
+
<testcase classname="checkboxed-list basic tests" name="sends the values" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/controls/checkboxed-list-input.test.js" time="0.686"/>
|
|
6
|
+
<testcase classname="checkboxed-list basic tests" name="renders the label" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/controls/checkboxed-list-input.test.js" time="0.614"/>
|
|
7
|
+
<testcase classname="checkboxed-list basic tests" name="groups checkboxes based on the value of the 'group' attribute" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/controls/checkboxed-list-input.test.js" time="0.752"/>
|
|
8
|
+
<testcase classname="checkboxed-list basic tests behavior with (non)required" name="allows to send a form when no value is selected and fiels is not required" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/controls/checkboxed-list-input.test.js" time="0.584"/>
|
|
9
|
+
<testcase classname="checkboxed-list basic tests behavior with (non)required" name="does not allow to send a form when no value is selected and field IS required" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/controls/checkboxed-list-input.test.js" time="0.745"/>
|
|
10
|
+
<testcase classname="checkboxed-list basic tests behavior with (non)required" name="allows to send a form when no value is selected and field IS required" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/controls/checkboxed-list-input.test.js" time="0.699"/>
|
|
11
|
+
<testcase classname="file-control basic tests" name="doesn't require image input if it already has old-value" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/controls/file.test.js" time="0.63"/>
|
|
12
|
+
<testcase classname="photo-control basic tests" name="sends the old photo if it wasn't changed and it has an initial value" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/controls/photo.test.js" time="0.566"/>
|
|
13
|
+
<testcase classname="photo-control basic tests" name="doesn't require image input if it already has old-value" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/controls/photo.test.js" time="0.55"/>
|
|
14
|
+
<testcase classname="single-reference.test" name="creates minimal sealious app and adds form using single-reference field that works" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/controls/single-reference.test.js" time="17.656"/>
|
|
14
15
|
<testcase classname="boolean field" name="validation logic" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/fields/boolean.test.js" time="0.001"/>
|
|
15
16
|
<testcase classname="boolean field" name="parse function" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/fields/boolean.test.js" time="0"/>
|
|
16
17
|
<testcase classname="email field" name="validation logic" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/fields/email.test.js" time="0.001"/>
|
|
17
18
|
<testcase classname="email field" name="parse function" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/fields/email.test.js" time="0"/>
|
|
18
|
-
<testcase classname="enum-multiple field" name="validation logic" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/fields/enum-multiple.test.js" time="0"/>
|
|
19
|
-
<testcase classname="enum-multiple field" name="parse function" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/fields/enum-multiple.test.js" time="0
|
|
20
|
-
<testcase classname="enum field" name="validation logic" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/fields/enum.test.js" time="0"/>
|
|
19
|
+
<testcase classname="enum-multiple field" name="validation logic" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/fields/enum-multiple.test.js" time="0.001"/>
|
|
20
|
+
<testcase classname="enum-multiple field" name="parse function" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/fields/enum-multiple.test.js" time="0"/>
|
|
21
|
+
<testcase classname="enum field" name="validation logic" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/fields/enum.test.js" time="0.001"/>
|
|
21
22
|
<testcase classname="enum field" name="parse function" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/fields/enum.test.js" time="0"/>
|
|
22
|
-
<testcase classname="basic field basic tests" name="sends the values" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/fields/field.test.js" time="0.
|
|
23
|
-
<testcase classname="basic field basic tests" name="Doesn't call `isValueValid` and `parse` if the value is empty" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/fields/field.test.js" time="0.
|
|
24
|
-
<testcase classname="basic field basic tests" name="Accepts a form where non-required values are empty" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/fields/field.test.js" time="0.
|
|
25
|
-
<testcase classname="file field" name="should handle as imple upload scenario" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/fields/file.test.js" time="0.
|
|
26
|
-
<testcase classname="number field" name="validation logic" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/fields/number.test.js" time="0"/>
|
|
27
|
-
<testcase classname="number field" name="parse function" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/fields/number.test.js" time="0"/>
|
|
23
|
+
<testcase classname="basic field basic tests" name="sends the values" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/fields/field.test.js" time="0.338"/>
|
|
24
|
+
<testcase classname="basic field basic tests" name="Doesn't call `isValueValid` and `parse` if the value is empty" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/fields/field.test.js" time="0.534"/>
|
|
25
|
+
<testcase classname="basic field basic tests" name="Accepts a form where non-required values are empty" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/fields/field.test.js" time="0.653"/>
|
|
26
|
+
<testcase classname="file field" name="should handle as imple upload scenario" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/fields/file.test.js" time="0.628"/>
|
|
27
|
+
<testcase classname="number field" name="validation logic" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/fields/number.test.js" time="0.001"/>
|
|
28
|
+
<testcase classname="number field" name="parse function" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/fields/number.test.js" time="0.001"/>
|
|
28
29
|
<testcase classname="pick-from-list field" name="validation logic" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/fields/pick-from-list.test.js" time="0"/>
|
|
29
|
-
<testcase classname="regexp field" name="validation logic" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/fields/regexp.test.js" time="0"/>
|
|
30
|
+
<testcase classname="regexp field" name="validation logic" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/fields/regexp.test.js" time="0.001"/>
|
|
30
31
|
<testcase classname="regexp field" name="parse function" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/fields/regexp.test.js" time="0"/>
|
|
31
|
-
<testcase classname="form test basic tests" name="does not allow to submit an empty form when there's a required field" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/form.test.js" time="0.
|
|
32
|
-
<testcase classname="form test basic tests" name="allows to submit a form when all required fields have a value" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/form.test.js" time="0.
|
|
33
|
-
<testcase classname="form test basic tests" name="does not allow submitting an empty form by circumventing HTML-based validation" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/form.test.js" time="0.
|
|
34
|
-
<testcase classname="form test canAccess tests" name="allows visit when configured when canAccess returns true" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/form.test.js" time="0.
|
|
35
|
-
<testcase classname="form test canAccess tests" name="passes the context to canAccess (false case)" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/form.test.js" time="0.
|
|
36
|
-
<testcase classname="form test canAccess tests" name="passes the context to canAccess (true case)" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/form.test.js" time="0.
|
|
37
|
-
<testcase classname="form test canAccess tests declines access when canAccess returns false" name="prevents the form from rendering" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/form.test.js" time="0.
|
|
38
|
-
<testcase classname="form test canAccess tests declines access when canAccess returns false" name="does not allow submitting of the form through axios" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/form.test.js" time="0.
|
|
39
|
-
<testcase classname="form test validation e2e validation message" name="shows up when incorrect input is given" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/form.test.js" time="0.
|
|
40
|
-
<testcase classname="form test validation e2e validation message" name="doesn't show when correct input is given" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/form.test.js" time="0.
|
|
41
|
-
<testcase classname="form test validation e2e field specific validation message" name="shows up when incorrect input is given" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/form.test.js" time="0.
|
|
42
|
-
<testcase classname="form test validation e2e field specific validation message" name="doesn't show up when correct input is given" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/form.test.js" time="0.
|
|
43
|
-
<testcase classname="form test getInitialValues tests" name="fills the form with values from getInitialValues" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/form.test.js" time="0.
|
|
44
|
-
<testcase classname="multiform test basic tests turbolinks + js enabled" name="checking whether only one submit handler is run" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="0.
|
|
45
|
-
<testcase classname="multiform test basic tests turbolinks + js enabled" name="checking whether the input in the not submitted form prevails" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="0.
|
|
46
|
-
<testcase classname="multiform test basic tests turbolinks + js disabled" name="checking whether only one submit handler is run" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="0.
|
|
47
|
-
<testcase classname="multiform test basic tests turbolinks + js disabled" name="checking whether the input in the not submitted form prevails" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="0.
|
|
48
|
-
<testcase classname="multiform test canAccess allow access to both forms when both canAccess return true" name="check wether it renders" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="0.
|
|
49
|
-
<testcase classname="multiform test canAccess allow access to both forms when both canAccess return true" name="check wether you can submit through http (axios)" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="0.
|
|
50
|
-
<testcase classname="multiform test canAccess deny access to both forms" name="check wether forms didnt render" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="0.
|
|
51
|
-
<testcase classname="multiform test canAccess deny access to both forms" name="check wether it's possible to submit through http" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="0.
|
|
52
|
-
<testcase classname="multiform test canAccess allow access to one form, deny to the other" name="check wether form1 renders" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="0.
|
|
53
|
-
<testcase classname="multiform test canAccess allow access to one form, deny to the other" name="check wether it's possible to submit to form1 through http" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="0.
|
|
54
|
-
<testcase classname="multiform test canAccess allow access to one form, deny to the other" name="check wether form2 does not render" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="0.
|
|
55
|
-
<testcase classname="multiform test canAccess allow access to one form, deny to the other" name="check wether it's possible to submit to form2 through http" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="0.
|
|
56
|
-
<testcase classname="multiform test validation e2e basic tests" name="js enabled" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="1.
|
|
57
|
-
<testcase classname="multiform test validation e2e basic tests" name="js disabled" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="
|
|
58
|
-
<testcase classname="multiform test validation e2e field specific validation js enabled" name="validation message shows when incorrect input is given" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="0.
|
|
59
|
-
<testcase classname="multiform test validation e2e field specific validation js enabled" name="validation message doesn't show when correct input is given" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="0.
|
|
60
|
-
<testcase classname="multiform test validation e2e field specific validation js disabled" name="validation message shows when incorrect input is given" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="0.
|
|
61
|
-
<testcase classname="multiform test validation e2e field specific validation js disabled" name="validation message doesn't show when correct input is given" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="0.
|
|
62
|
-
<testcase classname="generate routes" name="handles a url with params" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/generate-routes.test.js" time="0.
|
|
32
|
+
<testcase classname="form test basic tests" name="does not allow to submit an empty form when there's a required field" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/form.test.js" time="0.638"/>
|
|
33
|
+
<testcase classname="form test basic tests" name="allows to submit a form when all required fields have a value" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/form.test.js" time="0.279"/>
|
|
34
|
+
<testcase classname="form test basic tests" name="does not allow submitting an empty form by circumventing HTML-based validation" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/form.test.js" time="0.029"/>
|
|
35
|
+
<testcase classname="form test canAccess tests" name="allows visit when configured when canAccess returns true" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/form.test.js" time="0.033"/>
|
|
36
|
+
<testcase classname="form test canAccess tests" name="passes the context to canAccess (false case)" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/form.test.js" time="0.045"/>
|
|
37
|
+
<testcase classname="form test canAccess tests" name="passes the context to canAccess (true case)" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/form.test.js" time="0.039"/>
|
|
38
|
+
<testcase classname="form test canAccess tests declines access when canAccess returns false" name="prevents the form from rendering" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/form.test.js" time="0.04"/>
|
|
39
|
+
<testcase classname="form test canAccess tests declines access when canAccess returns false" name="does not allow submitting of the form through axios" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/form.test.js" time="0.006"/>
|
|
40
|
+
<testcase classname="form test validation e2e validation message" name="shows up when incorrect input is given" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/form.test.js" time="0.329"/>
|
|
41
|
+
<testcase classname="form test validation e2e validation message" name="doesn't show when correct input is given" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/form.test.js" time="0.689"/>
|
|
42
|
+
<testcase classname="form test validation e2e field specific validation message" name="shows up when incorrect input is given" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/form.test.js" time="0.34"/>
|
|
43
|
+
<testcase classname="form test validation e2e field specific validation message" name="doesn't show up when correct input is given" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/form.test.js" time="0.2"/>
|
|
44
|
+
<testcase classname="form test getInitialValues tests" name="fills the form with values from getInitialValues" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/form.test.js" time="0.119"/>
|
|
45
|
+
<testcase classname="multiform test basic tests turbolinks + js enabled" name="checking whether only one submit handler is run" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="0.592"/>
|
|
46
|
+
<testcase classname="multiform test basic tests turbolinks + js enabled" name="checking whether the input in the not submitted form prevails" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="0.01"/>
|
|
47
|
+
<testcase classname="multiform test basic tests turbolinks + js disabled" name="checking whether only one submit handler is run" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="0.6"/>
|
|
48
|
+
<testcase classname="multiform test basic tests turbolinks + js disabled" name="checking whether the input in the not submitted form prevails" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="0.01"/>
|
|
49
|
+
<testcase classname="multiform test canAccess allow access to both forms when both canAccess return true" name="check wether it renders" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="0.467"/>
|
|
50
|
+
<testcase classname="multiform test canAccess allow access to both forms when both canAccess return true" name="check wether you can submit through http (axios)" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="0.009"/>
|
|
51
|
+
<testcase classname="multiform test canAccess deny access to both forms" name="check wether forms didnt render" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="0.571"/>
|
|
52
|
+
<testcase classname="multiform test canAccess deny access to both forms" name="check wether it's possible to submit through http" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="0.007"/>
|
|
53
|
+
<testcase classname="multiform test canAccess allow access to one form, deny to the other" name="check wether form1 renders" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="0.397"/>
|
|
54
|
+
<testcase classname="multiform test canAccess allow access to one form, deny to the other" name="check wether it's possible to submit to form1 through http" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="0.007"/>
|
|
55
|
+
<testcase classname="multiform test canAccess allow access to one form, deny to the other" name="check wether form2 does not render" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="0.378"/>
|
|
56
|
+
<testcase classname="multiform test canAccess allow access to one form, deny to the other" name="check wether it's possible to submit to form2 through http" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="0.005"/>
|
|
57
|
+
<testcase classname="multiform test validation e2e basic tests" name="js enabled" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="1.515"/>
|
|
58
|
+
<testcase classname="multiform test validation e2e basic tests" name="js disabled" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="1.347"/>
|
|
59
|
+
<testcase classname="multiform test validation e2e field specific validation js enabled" name="validation message shows when incorrect input is given" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="0.354"/>
|
|
60
|
+
<testcase classname="multiform test validation e2e field specific validation js enabled" name="validation message doesn't show when correct input is given" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="0.152"/>
|
|
61
|
+
<testcase classname="multiform test validation e2e field specific validation js disabled" name="validation message shows when incorrect input is given" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="0.415"/>
|
|
62
|
+
<testcase classname="multiform test validation e2e field specific validation js disabled" name="validation message doesn't show when correct input is given" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/forms/multiform.test.js" time="0.181"/>
|
|
63
|
+
<testcase classname="generate routes" name="handles a url with params" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/generate-routes.test.js" time="0.023"/>
|
|
63
64
|
<testcase classname="generate routes" name="handles polish characters in the url" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/generate-routes.test.js" time="0"/>
|
|
64
|
-
<testcase classname="generate routes" name="handles a url with params and diacritics" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/generate-routes.test.js" time="0.
|
|
65
|
-
<testcase classname="mountable-with-fields" name="properly types the getParsedValues method and respects required status" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/page/mountable-with-fields.test.js" time="0"/>
|
|
66
|
-
<testcase classname="sealious-list test" name="creates minimal sealious app and adds a simple route that works" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/page/sealious-list.test.js" time="
|
|
67
|
-
<testcase classname="stateful page" name="
|
|
65
|
+
<testcase classname="generate routes" name="handles a url with params and diacritics" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/generate-routes.test.js" time="0.017"/>
|
|
66
|
+
<testcase classname="mountable-with-fields" name="properly types the getParsedValues method and respects required status" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/page/mountable-with-fields.test.js" time="0.001"/>
|
|
67
|
+
<testcase classname="sealious-list test" name="creates minimal sealious app and adds a simple route that works" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/page/sealious-list.test.js" time="21.659"/>
|
|
68
|
+
<testcase classname="stateful page" name="has types that allow for extracting action argument types" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/page/stateful-page.test.js" time="0"/>
|
|
69
|
+
<testcase classname="stateful page" name="handles a basic case with action buttons" file="/home/kuba/projects/sealcode/sealgen/lib-instrumented/page/stateful-page.test.js" time="0.001"/>
|
|
68
70
|
</testsuite>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="koa__router" />
|
|
2
|
+
/// <reference types="koa__router" resolution-mode="require"/>
|
|
3
3
|
import Router from "@koa/router";
|
|
4
4
|
import { Context } from "koa";
|
|
5
5
|
import { Field, FieldsetOutput } from "sealious";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="koa__router" />
|
|
2
|
+
/// <reference types="koa__router" resolution-mode="require"/>
|
|
3
3
|
import Router from "@koa/router";
|
|
4
4
|
import { Context } from "koa";
|
|
5
5
|
import { ParsedUrlQuery } from "querystring";
|
package/@types/src/mount.d.ts
CHANGED
package/README.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
In order to add Font Squirrel fonts with get-fonts command you need to create fonts.json file with the following structure:
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
{
|
|
5
|
+
"fontSquirrel": {
|
|
6
|
+
"source-sans-pro": [],
|
|
7
|
+
"fira-sans": ["hair", "medium"]
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
where you put an empty brackets for a regular style font or a list of desired font styles.
|
package/lib/get-fonts.js
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
|
-
import { readFile, writeFile } from "fs/promises";
|
|
1
|
+
import { mkdir, readFile, writeFile, unlink, rmdir } from "fs/promises";
|
|
2
2
|
import { constructURL, download } from "google-fonts-helper";
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
4
|
import { target_locreq } from "./target-locreq.js";
|
|
5
|
+
import { exec } from "child_process";
|
|
6
|
+
import { is, predicates } from "@sealcode/ts-predicates";
|
|
7
|
+
import { promisify } from "util";
|
|
8
|
+
import _locreq from "locreq";
|
|
9
|
+
const locreq = _locreq(import.meta.dirname);
|
|
10
|
+
const path_to_fonsta = locreq.resolve("node_modules/fonsta/bin/fonsta");
|
|
5
11
|
import JSON5 from "json5";
|
|
6
12
|
const FONTS_CONFIG_PATH = "src/fonts.json";
|
|
13
|
+
const execPromise = promisify(exec);
|
|
7
14
|
async function getFonts(_ = {}) {
|
|
8
15
|
const fonts_config_path = target_locreq.resolve(FONTS_CONFIG_PATH);
|
|
9
16
|
const fonts_config = JSON5.parse(await readFile(fonts_config_path, "utf8"));
|
|
10
|
-
const
|
|
11
|
-
if (!
|
|
17
|
+
const google_fonts = constructURL(fonts_config.googleFonts);
|
|
18
|
+
if (!google_fonts) {
|
|
12
19
|
throw new Error("Invalid font config");
|
|
13
20
|
}
|
|
14
|
-
const downloader = download(
|
|
21
|
+
const downloader = download(google_fonts, {
|
|
15
22
|
base64: false,
|
|
16
23
|
overwriting: false,
|
|
17
24
|
outputDir: target_locreq.resolve("public/dist/fonts"),
|
|
@@ -20,6 +27,43 @@ async function getFonts(_ = {}) {
|
|
|
20
27
|
fontsPath: "/dist/fonts"
|
|
21
28
|
});
|
|
22
29
|
await downloader.execute();
|
|
30
|
+
console.log("Downloaded new fonts pack from google fonts");
|
|
31
|
+
const squirrel_fonts = fonts_config.fontSquirrel;
|
|
32
|
+
if (!is(
|
|
33
|
+
squirrel_fonts,
|
|
34
|
+
predicates.record(
|
|
35
|
+
predicates.string,
|
|
36
|
+
predicates.array(predicates.string)
|
|
37
|
+
)
|
|
38
|
+
)) {
|
|
39
|
+
throw new Error("Inocorrect squirrelfonts file");
|
|
40
|
+
}
|
|
41
|
+
await mkdir(target_locreq.resolve("public/dist/fontsquirrel/"), {
|
|
42
|
+
recursive: true
|
|
43
|
+
});
|
|
44
|
+
const config_file = `{
|
|
45
|
+
"tmpDir": "/tmp/fonts",
|
|
46
|
+
"fontsDir": "/dist/fontsquirrel/fonts",
|
|
47
|
+
"cssDir": "/dist/fontsquirrel/css",
|
|
48
|
+
"cssFile": "fonts.css"
|
|
49
|
+
}`;
|
|
50
|
+
await writeFile("public/fonsta.config.json", config_file);
|
|
51
|
+
await Promise.all(
|
|
52
|
+
Object.keys(squirrel_fonts).map((font) => {
|
|
53
|
+
if (squirrel_fonts[font].length) {
|
|
54
|
+
return execPromise(
|
|
55
|
+
`node ${path_to_fonsta} install ${font}:${squirrel_fonts[font].join(",")}`,
|
|
56
|
+
{
|
|
57
|
+
cwd: target_locreq.resolve("public")
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
} else {
|
|
61
|
+
return execPromise(`node ${path_to_fonsta} install ${font}`, {
|
|
62
|
+
cwd: target_locreq.resolve("public")
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
})
|
|
66
|
+
);
|
|
23
67
|
const fonts_css_file_path = resolve(
|
|
24
68
|
target_locreq.resolve("public/dist/fonts"),
|
|
25
69
|
"fonts.css"
|
|
@@ -29,6 +73,9 @@ async function getFonts(_ = {}) {
|
|
|
29
73
|
fonts_css_file_path,
|
|
30
74
|
content.replace(/@font-face {/g, "@font-face {\nfont-display: swap;")
|
|
31
75
|
);
|
|
76
|
+
await unlink("public/fonsta.config.json");
|
|
77
|
+
await rmdir("public/tmp");
|
|
78
|
+
console.log("Downloaded new fonts pack from Font Squirrel");
|
|
32
79
|
console.log("Downloaded new fonts pack");
|
|
33
80
|
}
|
|
34
81
|
export {
|
|
@@ -5,30 +5,12 @@ async function testTemplate(action_name, new_file_fullpath) {
|
|
|
5
5
|
const content = `import { withProdApp } from "${rel(
|
|
6
6
|
"src/back/test_utils/with-prod-app.js"
|
|
7
7
|
)}";
|
|
8
|
-
import { VERY_LONG_TEST_TIMEOUT, webhintURL } from "${rel(
|
|
9
|
-
"src/back/test_utils/webhint.js"
|
|
10
|
-
)}";
|
|
11
8
|
import { ${action_name}URL } from "${rel("src/back/routes/urls.js")}";
|
|
12
9
|
import { getBrowser } from "${rel("src/back/test_utils/browser-creator.js")}";
|
|
13
10
|
import type { Browser, BrowserContext, Page } from "@playwright/test";
|
|
14
11
|
|
|
15
|
-
describe("${action_name} webhint", () => {
|
|
16
|
-
it(
|
|
17
|
-
"doesn't crash",
|
|
18
|
-
async function () {
|
|
19
|
-
return withProdApp(async ({ base_url, rest_api }) => {
|
|
20
|
-
await rest_api.get(${action_name}URL);
|
|
21
|
-
await webhintURL(base_url + ${action_name}URL);
|
|
22
|
-
// alternatively you can use webhintHTML for faster but less precise scans
|
|
23
|
-
// or for scanning responses of requests that use some form of authorization:
|
|
24
|
-
// const response = await rest_api.get(${action_name}URL);
|
|
25
|
-
// await webhintHTML(response);
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
).timeout(VERY_LONG_TEST_TIMEOUT);
|
|
29
|
-
});
|
|
30
|
-
|
|
31
12
|
describe("${action_name}", () => {
|
|
13
|
+
|
|
32
14
|
let page: Page;
|
|
33
15
|
let browser: Browser;
|
|
34
16
|
let context: BrowserContext;
|
|
@@ -43,6 +25,15 @@ describe("${action_name}", () => {
|
|
|
43
25
|
await context.close();
|
|
44
26
|
});
|
|
45
27
|
|
|
28
|
+
it(
|
|
29
|
+
"doesn't crash",
|
|
30
|
+
async function () {
|
|
31
|
+
return withProdApp(async ({ rest_api }) => {
|
|
32
|
+
await rest_api.get(${action_name}URL);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
|
|
46
37
|
it(
|
|
47
38
|
"works as expected",
|
|
48
39
|
async function () {
|
|
@@ -50,7 +41,7 @@ describe("${action_name}", () => {
|
|
|
50
41
|
await page.goto(base_url + ${action_name}URL);
|
|
51
42
|
});
|
|
52
43
|
}
|
|
53
|
-
)
|
|
44
|
+
)
|
|
54
45
|
});
|
|
55
46
|
`;
|
|
56
47
|
return formatWithPrettier(content);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sealcode/sealgen",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.29",
|
|
4
4
|
"description": "Module to automate adding routes and collections to a sealious application",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
"deepmerge": "^4.3.1",
|
|
68
68
|
"esbuild": "^0.20.0",
|
|
69
69
|
"escape-goat": "^4.0.0",
|
|
70
|
+
"fonsta": "^1.1.1",
|
|
70
71
|
"google-fonts-helper": "^3.4.1",
|
|
71
72
|
"husky": "^9.1.7",
|
|
72
73
|
"is-what": "^4.1.16",
|
package/src/get-fonts.ts
CHANGED
|
@@ -1,22 +1,30 @@
|
|
|
1
|
-
import { readFile, writeFile } from "fs/promises";
|
|
1
|
+
import { mkdir, readFile, writeFile, unlink, rmdir } from "fs/promises";
|
|
2
2
|
import { constructURL, download } from "google-fonts-helper";
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
4
|
import { target_locreq } from "./target-locreq.js";
|
|
5
|
+
import { exec } from "child_process";
|
|
6
|
+
import { is, predicates } from "@sealcode/ts-predicates";
|
|
7
|
+
import { promisify } from "util";
|
|
8
|
+
import _locreq from "locreq";
|
|
9
|
+
const locreq = _locreq(import.meta.dirname);
|
|
10
|
+
const path_to_fonsta = locreq.resolve("node_modules/fonsta/bin/fonsta");
|
|
5
11
|
import JSON5 from "json5";
|
|
6
12
|
|
|
7
13
|
export const FONTS_CONFIG_PATH = "src/fonts.json";
|
|
8
14
|
|
|
15
|
+
const execPromise = promisify(exec);
|
|
16
|
+
|
|
9
17
|
export async function getFonts(_: Record<string, string | boolean> = {}) {
|
|
10
18
|
const fonts_config_path = target_locreq.resolve(FONTS_CONFIG_PATH);
|
|
11
19
|
|
|
12
20
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
13
21
|
const fonts_config = JSON5.parse(await readFile(fonts_config_path, "utf8"));
|
|
14
22
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
|
|
15
|
-
const
|
|
16
|
-
if (!
|
|
23
|
+
const google_fonts = constructURL(fonts_config.googleFonts);
|
|
24
|
+
if (!google_fonts) {
|
|
17
25
|
throw new Error("Invalid font config");
|
|
18
26
|
}
|
|
19
|
-
const downloader = download(
|
|
27
|
+
const downloader = download(google_fonts, {
|
|
20
28
|
base64: false,
|
|
21
29
|
overwriting: false,
|
|
22
30
|
outputDir: target_locreq.resolve("public/dist/fonts"),
|
|
@@ -25,15 +33,67 @@ export async function getFonts(_: Record<string, string | boolean> = {}) {
|
|
|
25
33
|
fontsPath: "/dist/fonts",
|
|
26
34
|
});
|
|
27
35
|
await downloader.execute();
|
|
36
|
+
|
|
37
|
+
console.log("Downloaded new fonts pack from google fonts");
|
|
38
|
+
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment
|
|
40
|
+
const squirrel_fonts = fonts_config.fontSquirrel;
|
|
41
|
+
if (
|
|
42
|
+
!is(
|
|
43
|
+
squirrel_fonts,
|
|
44
|
+
predicates.record(
|
|
45
|
+
predicates.string,
|
|
46
|
+
predicates.array(predicates.string)
|
|
47
|
+
)
|
|
48
|
+
)
|
|
49
|
+
) {
|
|
50
|
+
throw new Error("Inocorrect squirrelfonts file");
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
await mkdir(target_locreq.resolve("public/dist/fontsquirrel/"), {
|
|
54
|
+
recursive: true,
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const config_file = `{
|
|
58
|
+
"tmpDir": "/tmp/fonts",
|
|
59
|
+
"fontsDir": "/dist/fontsquirrel/fonts",
|
|
60
|
+
"cssDir": "/dist/fontsquirrel/css",
|
|
61
|
+
"cssFile": "fonts.css"
|
|
62
|
+
}`;
|
|
63
|
+
await writeFile("public/fonsta.config.json", config_file);
|
|
64
|
+
|
|
65
|
+
await Promise.all(
|
|
66
|
+
Object.keys(squirrel_fonts).map((font) => {
|
|
67
|
+
if (squirrel_fonts[font].length) {
|
|
68
|
+
return execPromise(
|
|
69
|
+
`node ${path_to_fonsta} install ${font}:${squirrel_fonts[
|
|
70
|
+
font
|
|
71
|
+
].join(",")}`,
|
|
72
|
+
{
|
|
73
|
+
cwd: target_locreq.resolve("public"),
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
} else {
|
|
77
|
+
return execPromise(`node ${path_to_fonsta} install ${font}`, {
|
|
78
|
+
cwd: target_locreq.resolve("public"),
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
})
|
|
82
|
+
);
|
|
28
83
|
const fonts_css_file_path = resolve(
|
|
29
84
|
target_locreq.resolve("public/dist/fonts"),
|
|
30
85
|
"fonts.css"
|
|
31
86
|
);
|
|
87
|
+
|
|
32
88
|
const content = await readFile(fonts_css_file_path, "utf-8");
|
|
33
89
|
await writeFile(
|
|
34
90
|
fonts_css_file_path,
|
|
35
91
|
content.replace(/@font-face {/g, "@font-face {\nfont-display: swap;")
|
|
36
92
|
);
|
|
37
93
|
|
|
94
|
+
await unlink("public/fonsta.config.json");
|
|
95
|
+
await rmdir("public/tmp");
|
|
96
|
+
console.log("Downloaded new fonts pack from Font Squirrel");
|
|
97
|
+
|
|
38
98
|
console.log("Downloaded new fonts pack");
|
|
39
99
|
}
|
|
@@ -9,30 +9,12 @@ export async function testTemplate(
|
|
|
9
9
|
const content = `import { withProdApp } from "${rel(
|
|
10
10
|
"src/back/test_utils/with-prod-app.js"
|
|
11
11
|
)}";
|
|
12
|
-
import { VERY_LONG_TEST_TIMEOUT, webhintURL } from "${rel(
|
|
13
|
-
"src/back/test_utils/webhint.js"
|
|
14
|
-
)}";
|
|
15
12
|
import { ${action_name}URL } from "${rel("src/back/routes/urls.js")}";
|
|
16
13
|
import { getBrowser } from "${rel("src/back/test_utils/browser-creator.js")}";
|
|
17
14
|
import type { Browser, BrowserContext, Page } from "@playwright/test";
|
|
18
15
|
|
|
19
|
-
describe("${action_name} webhint", () => {
|
|
20
|
-
it(
|
|
21
|
-
"doesn't crash",
|
|
22
|
-
async function () {
|
|
23
|
-
return withProdApp(async ({ base_url, rest_api }) => {
|
|
24
|
-
await rest_api.get(${action_name}URL);
|
|
25
|
-
await webhintURL(base_url + ${action_name}URL);
|
|
26
|
-
// alternatively you can use webhintHTML for faster but less precise scans
|
|
27
|
-
// or for scanning responses of requests that use some form of authorization:
|
|
28
|
-
// const response = await rest_api.get(${action_name}URL);
|
|
29
|
-
// await webhintHTML(response);
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
).timeout(VERY_LONG_TEST_TIMEOUT);
|
|
33
|
-
});
|
|
34
|
-
|
|
35
16
|
describe("${action_name}", () => {
|
|
17
|
+
|
|
36
18
|
let page: Page;
|
|
37
19
|
let browser: Browser;
|
|
38
20
|
let context: BrowserContext;
|
|
@@ -47,6 +29,15 @@ describe("${action_name}", () => {
|
|
|
47
29
|
await context.close();
|
|
48
30
|
});
|
|
49
31
|
|
|
32
|
+
it(
|
|
33
|
+
"doesn't crash",
|
|
34
|
+
async function () {
|
|
35
|
+
return withProdApp(async ({ rest_api }) => {
|
|
36
|
+
await rest_api.get(${action_name}URL);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
|
|
50
41
|
it(
|
|
51
42
|
"works as expected",
|
|
52
43
|
async function () {
|
|
@@ -54,7 +45,7 @@ describe("${action_name}", () => {
|
|
|
54
45
|
await page.goto(base_url + ${action_name}URL);
|
|
55
46
|
});
|
|
56
47
|
}
|
|
57
|
-
)
|
|
48
|
+
)
|
|
58
49
|
});
|
|
59
50
|
`;
|
|
60
51
|
|