Commit Graph

548 Commits

Author SHA1 Message Date
Dillon Kearns
70143e7149 Fix no contract violations check to handle new Route Modules naming convention. 2022-03-05 09:38:18 -08:00
Dillon Kearns
1e2f4981ed Comment out test case that's still in the design stage. 2022-03-04 09:39:33 -08:00
Dillon Kearns
a0c378a1df Move final test cases to glob end-to-end test suite. 2022-03-04 09:37:00 -08:00
Dillon Kearns
bb81c49d0e Move test case to end-to-end suite. 2022-03-04 09:32:21 -08:00
Dillon Kearns
088dc59ec3 Move another test case to end-to-end suite. 2022-03-04 09:30:00 -08:00
Dillon Kearns
a937049993 Move test case to end-to-end suite. 2022-03-04 09:27:32 -08:00
Dillon Kearns
bfffe9e43b Move test case to end-to-end suite. 2022-03-04 09:12:06 -08:00
Dillon Kearns
2639d1333d Move test case. 2022-03-04 09:09:43 -08:00
Dillon Kearns
509535304e Remove duplicate test case. 2022-03-04 09:07:31 -08:00
Dillon Kearns
be20a6c9ee Remove duplicate test case. 2022-03-04 09:06:58 -08:00
Dillon Kearns
fb7f5fa1e9 Remove duplicate test case. 2022-03-04 09:06:10 -08:00
Dillon Kearns
8adac30f30 Move test case. 2022-03-04 09:05:35 -08:00
Dillon Kearns
0688e579dd Move test case. 2022-03-04 09:03:59 -08:00
Dillon Kearns
c6ddc0872c Move some test cases from old glob unit tests to new end-to-end tests. 2022-03-04 09:01:34 -08:00
Dillon Kearns
4a2e3c552c Remove cache tests since it's no longer used. 2022-03-04 08:47:30 -08:00
Dillon Kearns
f3c636a45d Review fixes. 2022-02-27 08:50:43 -08:00
Dillon Kearns
68fe1c2539 Remove redundant map function from expectString. 2022-02-27 08:09:33 -08:00
Dillon Kearns
d11226df45 Fix test case. 2022-02-26 14:42:31 -08:00
Dillon Kearns
3d2ebc6965 Remove commented code. 2022-02-26 14:36:03 -08:00
Dillon Kearns
c48cec7cde Fix a test case. 2022-02-26 14:35:52 -08:00
Dillon Kearns
7afbd8188e Fix a test case. 2022-02-26 14:18:37 -08:00
Dillon Kearns
edfe401f30 Fix some test cases. 2022-02-26 14:10:31 -08:00
Dillon Kearns
c56052dd8b Update message in test assertion. 2022-02-26 13:32:34 -08:00
Dillon Kearns
c8a37ed3c5 Review fixes. 2022-02-26 09:48:36 -08:00
Dillon Kearns
f82212e222 Fix test cases. 2022-02-26 09:38:03 -08:00
Dillon Kearns
de74127a3d Fix some test cases. 2022-02-26 08:46:07 -08:00
Dillon Kearns
b54e14570d Fix test compilation errors. 2022-02-26 08:36:55 -08:00
Dillon Kearns
3ec317f031 Fix a test case. 2022-02-26 08:32:31 -08:00
Dillon Kearns
5924109f7c Fix a test case. 2022-02-26 07:44:16 -08:00
Dillon Kearns
00edf1cd6e Fix some test cases. 2022-02-25 17:30:21 -08:00
Dillon Kearns
fc4d470405 Fix some test errors. 2022-02-25 16:57:50 -08:00
Dillon Kearns
e793a8fe89 Ensure that fixes don't infinitely apply for Request.oneOf [] case. 2022-02-21 15:50:17 -08:00
Dillon Kearns
c47dfce740 Handle remaining dead-code elimination cases. 2022-02-13 13:52:31 -08:00
Dillon Kearns
88ca2f8a02 Remove DataSource code from bundle. 2022-02-13 12:42:31 -08:00
Dillon Kearns
8f4491adf0 Remove unused code. 2022-02-07 21:07:54 -08:00
Dillon Kearns
3e65d2fae1 Fix test errors. 2022-02-07 14:50:38 -08:00
Dillon Kearns
6d2ce4d542 Fix some test suite errors. 2022-02-07 14:27:05 -08:00
Dillon Kearns
a39c53de8b Fix ordering for ApiRoute matches. 2022-02-07 09:00:50 -08:00
Dillon Kearns
a7f2fa7eda Remove obsolete unoptimizedRequest function. 2022-01-28 09:42:52 -08:00
Dillon Kearns
406c0cafd8 Rename function. 2022-01-28 09:34:11 -08:00
Dillon Kearns
a81de386d9 Remove unused. 2022-01-27 20:57:48 -08:00
Dillon Kearns
5d35b2c04c Fix compiler errors. 2022-01-27 20:43:16 -08:00
Dillon Kearns
d29d975596 Fix compiler errors. 2022-01-27 20:41:54 -08:00
Dillon Kearns
0e3958a71c Review fixes. 2022-01-27 20:21:49 -08:00
Dillon Kearns
9619e3e199 Apply some elm-review fixes. 2022-01-27 16:03:42 -08:00
Dillon Kearns
0cd9a56675 Add quotes around field name in error message. 2022-01-24 19:09:46 -08:00
Dillon Kearns
2d22f73aa8 Fix tests. 2022-01-24 15:43:37 -08:00
Dillon Kearns
d477687f18 Add test case. 2022-01-24 15:43:05 -08:00
Dillon Kearns
ff44e2757b Allow formData in request tests. 2022-01-23 20:05:05 -08:00
Dillon Kearns
78cc936272 Fix tests. 2022-01-23 19:30:48 -08:00
Dillon Kearns
51aea3b539 Simplify Server.Response API by combining render repsonses and server responses into the same API. 2022-01-17 20:56:37 -08:00
Dillon Kearns
de3a740165 Add float input type, and handle validation errors for int and float inputs. 2022-01-17 10:32:08 -08:00
Dillon Kearns
80c85a1abe Run min/max validations against range input in pure Elm to ensure that UI isn't bypassed. 2022-01-17 09:56:20 -08:00
Dillon Kearns
22b3b54799 Use phantom types to reduce the number of cominations of functions for setting values with different types. 2022-01-16 15:29:06 -08:00
Dillon Kearns
d5478db009 Add time input. 2022-01-16 14:31:08 -08:00
Dillon Kearns
a769a3e569 Fix tests. 2022-01-15 19:29:30 -08:00
Dillon Kearns
6b7c4586c9 Run field-level errors and form-level errors independently to avoid duplicates but get them in real-time. 2022-01-15 09:06:19 -08:00
Dillon Kearns
9c922c8f40 Run field-level validations on field change. Preparing for change to store dependent validation results separately so they can be updated independently. 2022-01-14 15:28:17 -08:00
Dillon Kearns
84e7d9d157 Use user-defined errors instead of a set list of validation errors. 2022-01-14 08:46:35 -08:00
Dillon Kearns
b8e7a47e34 Give multiple errors for non-fatal validation errors. 2022-01-13 14:18:53 -08:00
Dillon Kearns
90d6bc821d Add ability to do dependent validations looking at entire form value. 2022-01-13 09:06:58 -08:00
Dillon Kearns
a875161a8a Fix tests. 2022-01-11 09:33:45 -08:00
Dillon Kearns
95eff70f02 Run validations on init. Make Int and Float ranges. 2022-01-10 18:35:46 -08:00
Dillon Kearns
7d5b999966 Fix tests. 2022-01-10 16:35:45 -08:00
Dillon Kearns
80171b84f8 Set default values in form dict on init. 2022-01-10 10:14:02 -08:00
Dillon Kearns
e042393830 Add function to include client-side validation. 2022-01-06 09:44:46 -08:00
Dillon Kearns
e22d688920 Wire up Err for client-side validations. 2022-01-06 08:25:14 -08:00
Dillon Kearns
c747893453 Add starting point for client-side validations. 2022-01-05 19:57:25 -08:00
Dillon Kearns
e93f127c2c Fix import. 2022-01-01 13:55:37 -08:00
Dillon Kearns
86142cb6d8 Remove obsolete server request code from initial prototype. 2021-12-31 11:52:37 -08:00
Dillon Kearns
d79311a5fa Fix tests. 2021-12-31 11:22:19 -08:00
Dillon Kearns
820fdba64d Update oneOf error ordering. 2021-12-30 20:22:26 -08:00
Dillon Kearns
bfbb5866f2 Capture multiple matching errors for server requests. 2021-12-30 19:55:45 -08:00
Dillon Kearns
68a4fc42c4 Add ServerRequest tests and remove obsolete expectFormField in favor of expectFormPost. 2021-12-30 11:43:10 -08:00
Dillon Kearns
e0ac48f77a Fix tests. 2021-12-30 10:30:58 -08:00
Dillon Kearns
3a56c0af9e Add remaining attribute to SetCookie API. 2021-12-23 20:14:15 -08:00
Dillon Kearns
1e25d7aea4 Add additional SetCookie options. 2021-12-23 20:04:49 -08:00
Dillon Kearns
1c746e4c2c Encode Set-Cookie values. 2021-12-23 19:44:52 -08:00
Dillon Kearns
99b35546cf Add starting point for SetCookie API. 2021-12-23 19:25:51 -08:00
Dillon Kearns
27fe73ba15 Remove ApiRoute.int. 2021-12-23 15:14:36 -08:00
Dillon Kearns
e3bab7392c Fix types in test. 2021-12-23 15:14:21 -08:00
Dillon Kearns
6dddcf96d0 Update ApiRoute naming for consistency with Page.elm. 2021-12-23 15:01:38 -08:00
Dillon Kearns
4fedf9ee19 Rename prerender -> preRender. 2021-12-23 13:34:19 -08:00
Dillon Kearns
a7bc4226e9 Add FormData API. 2021-12-22 21:28:39 -08:00
Dillon Kearns
6df0ce9987 Add cookie parser. 2021-12-22 14:42:35 -08:00
Dillon Kearns
fad924d28d Add another test case. 2021-12-21 10:02:01 -08:00
Dillon Kearns
7f2d47c6de Add serverless ApiRoute builder and some examples in pokedex app. 2021-12-21 07:47:47 -08:00
Dillon Kearns
c79d76f473 Include kind in API routes to tell the rendering mode. Generate redirects for serverless API routes. 2021-12-20 13:35:34 -08:00
Dillon Kearns
7eaa94a9e4 Include Pattern information for ApiRoutes. 2021-12-20 11:26:12 -08:00
Dillon Kearns
6327087998 Add symlink to Internal folder so unit tests can depend on copied internal code files in generated folder. 2021-12-11 12:20:08 -08:00
Dillon Kearns
c25f18610c Fix review errors. 2021-10-07 12:11:23 -07:00
Dillon Kearns
99da8d8ebe Delete temporary test harness. 2021-10-07 11:56:09 -07:00
Dillon Kearns
c91b01d5a4 Port over HTML to string helpers from elm-explorations/test. TODO - still need to port the escaping fixes I did to the elm-explorations/test implementation. 2021-10-07 11:34:08 -07:00
Dillon Kearns
0fd02b8b2c Fix tests. 2021-09-27 10:48:49 -07:00
Dillon Kearns
b3dbb7d4d6 Use more precise region for RouteParams rule errors. 2021-08-27 09:35:57 -07:00
Dillon Kearns
27c75fba9b Point unexposed error to more narrow exposing line. 2021-08-27 09:27:04 -07:00
Dillon Kearns
194470aaf4 Handle optional splats in rule. 2021-08-26 14:05:00 -07:00
Dillon Kearns
562a6e39fd Handle Required Splat route params in rule. 2021-08-26 13:52:51 -07:00
Dillon Kearns
81bc444ba0 Handle optional and required route params in rule. 2021-08-26 13:30:44 -07:00
Dillon Kearns
b3e1d7dc3a Don't run Page Module rules except on Page Modules. 2021-08-26 12:51:21 -07:00
Dillon Kearns
83e1aeddb0 Move review rule to Elm package. 2021-08-26 10:27:30 -07:00
Dillon Kearns
0c4f1c3a4d Pass in flag in test. 2021-08-09 19:52:56 -07:00
Dillon Kearns
e218a480a5 Fix test output. 2021-08-09 17:32:54 -07:00
Dillon Kearns
bbe33d4b52 Update examples and tests. 2021-08-01 10:25:38 -07:00
Dillon Kearns
b78f8c008b Rename types in ApiRoute module. 2021-07-30 15:35:11 -07:00
Dillon Kearns
9c1b1196b8 Fix reference in test. 2021-07-30 15:23:36 -07:00
Dillon Kearns
8575d56284 Rename internal module. 2021-07-30 15:13:32 -07:00
Dillon Kearns
2a2872e6fa Update docs and move HTTP body functions out of DataSource and into DataSource.Http. 2021-07-29 15:57:44 -07:00
Dillon Kearns
74bad44b7b Remove log in test case. 2021-07-29 12:37:32 -07:00
Dillon Kearns
820198bbc2 Address review errors. 2021-07-29 10:03:42 -07:00
Dillon Kearns
6261f79c9c Remove obsolete test case since HTTP errors are now sent from NodeJS, not Elm. 2021-07-29 09:40:18 -07:00
Dillon Kearns
e97dc19c77 Fix more tests. 2021-07-29 09:38:46 -07:00
Dillon Kearns
2e9a3b219a Add test helper for checking outgoing requests. 2021-07-29 09:32:51 -07:00
Dillon Kearns
dfe6330abf Use ports for HTTP requests in unit tests. 2021-07-29 09:17:36 -07:00
Dillon Kearns
8ece503f7f elm-review fix. 2021-07-28 09:45:45 -07:00
Dillon Kearns
8ad4444fac Use hashing for a test case. 2021-07-28 09:00:34 -07:00
Dillon Kearns
83128c5112 Update tests for single-item flow (not batched page build runs). 2021-07-28 08:06:05 -07:00
Dillon Kearns
f6afc894a3 Fix some compiler errors. 2021-07-27 10:41:18 -07:00
Dillon Kearns
7ce73cc3e3 elm-review fixes. 2021-07-27 09:39:06 -07:00
Dillon Kearns
1b77273cd9 Remove unused mode flag. 2021-07-07 21:28:58 -07:00
Dillon Kearns
e6c2031737 Rename Page builder functions. 2021-06-24 10:05:16 -07:00
Dillon Kearns
aa0381c13d Fix bug where dev server didn't perform some andThen http requests. 2021-06-23 08:22:14 -07:00
Dillon Kearns
35def235b8 Successfully merge two distilled values when they have the same key and same encoded JSON. 2021-06-18 09:00:54 -07:00
Dillon Kearns
fad00c6186 elm-review fixes. 2021-06-17 11:57:42 -07:00
Dillon Kearns
e63678c490 Send errors on non-unique distill keys. 2021-06-17 11:55:22 -07:00
Dillon Kearns
dd07e2ead1 Add distill function. 2021-06-17 10:06:13 -07:00
Dillon Kearns
b809af6e45 Add DataSource.validate. 2021-06-17 10:06:13 -07:00
Dillon Kearns
60eb206470 Fix test. 2021-06-08 15:17:56 -07:00
Dillon Kearns
4af54e4ad5 Fix test. 2021-06-08 10:36:05 -07:00
Dillon Kearns
7a6ca22ad1 Handle 404 pages for found routes but not prerendered, and don't resolve DataSource if it's not pre-rendered. 2021-06-08 09:54:10 -07:00
Dillon Kearns
4c0303d942 Add missing field in test. 2021-06-06 11:11:34 -07:00
Dillon Kearns
36d1039515 Separate out public and internal APIs for ApiRoute. 2021-06-03 18:45:11 -07:00
Dillon Kearns
605b353065 Review fixes. 2021-06-03 18:10:06 -07:00
Dillon Kearns
03f8ee359f Add new rule. 2021-06-03 17:59:58 -07:00
Dillon Kearns
819dd0d5e2 Add new rule. 2021-06-03 17:57:57 -07:00
Dillon Kearns
ee874f3ba0 Address review fixes. 2021-06-03 17:14:25 -07:00
Dillon Kearns
7ce56bcb1a Address review warnings. 2021-06-03 17:12:18 -07:00
Dillon Kearns
1c2629b77e Remove unused Tuple value in return type. 2021-06-03 11:00:48 -07:00
Dillon Kearns
13ee95ad84 Update error message. 2021-05-31 21:51:31 -07:00
Dillon Kearns
8b4144ef15 Handle merging stripped JSON data from multiple data sources. 2021-05-31 20:59:30 -07:00
Dillon Kearns
124846eeb9 Update docs. 2021-05-28 13:06:07 -07:00
Dillon Kearns
18d8d6cdfd Update glob docs. 2021-05-27 14:18:48 -07:00
Dillon Kearns
35045ed51e Move some logic to internals to remove low-level functions from public API. 2021-05-27 13:27:09 -07:00
Dillon Kearns
1f0092736d Update Glob docs and add captureFilePath. 2021-05-27 11:04:19 -07:00
Dillon Kearns
d520f734b3 Make sure that capture list is updated when running Glob.match (not just Glob.capture). 2021-05-26 14:57:16 -07:00
Dillon Kearns
99f00c1d85 Fix test. 2021-05-24 11:40:36 -07:00
Dillon Kearns
6b14125d20 Add andThen. 2021-05-24 09:27:08 -07:00
Dillon Kearns
54bb39f182 Add oneOf. 2021-05-24 09:16:20 -07:00
Dillon Kearns
4dd9f14b16 Add QueryParams API prototype. 2021-05-24 08:55:33 -07:00
Dillon Kearns
ab65e84eac Remove PagePath module. 2021-05-23 15:40:01 -07:00
Dillon Kearns
40fbf3a14f Fix test. 2021-05-23 10:53:43 -07:00
Dillon Kearns
5a88903f4e Fix test. 2021-05-23 10:44:39 -07:00
Dillon Kearns
b147d17a1d Add Path.fromString. 2021-05-23 10:07:39 -07:00
Dillon Kearns
8a982aa884 Add new Path API. 2021-05-23 10:03:21 -07:00
Dillon Kearns
526b93a086 Add a workaround for allowing **/* globs to use regex match that makes the / optional. Might revisit with an API-level change rather than a regex hack. 2021-05-21 09:20:54 -07:00
Dillon Kearns
61c246ed46 Update test with new recursiveWildcard list type. 2021-05-21 09:20:54 -07:00
Dillon Kearns
d2b2408d31 Rename Glob.ignore -> Glob.match. 2021-05-19 18:20:47 -07:00
Dillon Kearns
7bcc276929 Add missing argument in test. 2021-05-19 07:58:37 -07:00
Dillon Kearns
075a886adf Add missing argument in test. 2021-05-14 19:38:10 -07:00
Dillon Kearns
ffcaabca77 Remove Site.apiRoutes, since it now lives in Api.elm. 2021-05-07 10:09:04 -07:00
Dillon Kearns
881cc7ccbe Add integer matcher in api routes. 2021-05-06 07:34:51 -07:00
Dillon Kearns
6fab76ab96 Rename ApiHandler -> ApiRoute. 2021-05-06 07:26:21 -07:00
Dillon Kearns
b16f32c1fa Rename field. 2021-05-06 07:16:05 -07:00
Dillon Kearns
4d175558ce Remove obsolete generateFiles. 2021-05-06 07:14:49 -07:00
Dillon Kearns
16b15bf4a4 Wire in initial handling for api requests. 2021-05-04 10:37:37 -07:00
Dillon Kearns
2c695ce165 Rename functions. 2021-04-30 20:19:39 -07:00
Dillon Kearns
ccbab4f685 Inline two values in test. 2021-04-30 17:04:34 -07:00
Dillon Kearns
3973f982b2 Use list for test examples. 2021-04-30 17:03:57 -07:00
Dillon Kearns
429a8ae4c1 List of routes, not single route, for Api routes. 2021-04-30 17:02:15 -07:00
Dillon Kearns
6e6f09cabc Restore matcher tests. 2021-04-30 16:03:47 -07:00
Dillon Kearns
d95ccebc60 Handle variabl length params for api route codec. 2021-04-30 16:01:18 -07:00
Dillon Kearns
357e49548b New experiment for Api routes prototype. 2021-04-30 13:54:03 -07:00
Dillon Kearns
f6963d3087 Move API handler into a module. 2021-04-30 08:42:07 -07:00
Dillon Kearns
b97df0b6cc Inline value. 2021-04-29 20:25:01 -07:00
Dillon Kearns
f0d64e59f0 Restore route matching tests. 2021-04-29 16:42:13 -07:00
Dillon Kearns
e936ebc71d Change to list of api routes. 2021-04-29 16:40:58 -07:00
Dillon Kearns
ff03bbf075 Remove hardcoded value. 2021-04-29 16:36:05 -07:00
Dillon Kearns
bc1ac1fecd Got prototype working with reversible route. 2021-04-29 15:31:13 -07:00
Dillon Kearns
68af88cfeb Update prototype. 2021-04-29 14:21:38 -07:00
Dillon Kearns
4e258bc983 Prototype for two-way api route codec. 2021-04-29 13:31:40 -07:00
Dillon Kearns
f790eee0fe Add slash handler. 2021-04-29 11:19:43 -07:00
Dillon Kearns
e6050aec5c Add test case for api route with extension. 2021-04-29 11:15:28 -07:00
Dillon Kearns
76093b6d26 Add a starting prototype for an API router. 2021-04-29 11:00:25 -07:00
Dillon Kearns
17553550b4 Put Glob under DataSource namespace. 2021-04-28 14:05:08 -07:00
Dillon Kearns
ab87bc049a Handle precedence in routing example. 2021-04-27 10:14:03 -07:00
Dillon Kearns
9e1f3b7b73 Add test case for new router prototype. 2021-04-27 08:35:07 -07:00
Dillon Kearns
b245d7dc98 Remove obsolete captures list (now derived from running regex). 2021-04-25 20:38:48 -07:00
Dillon Kearns
954ebdec63 Remove experimental test. 2021-04-25 20:35:09 -07:00
Dillon Kearns
664cb77c78 Remove not functions from Glob API for now. 2021-04-25 20:34:56 -07:00
Dillon Kearns
cf589a407b Run Regex matching in Elm for Glob module. 2021-04-25 19:39:54 -07:00
Dillon Kearns
810010bd1a Parser-based implementation doesn't work because it's greedy (not possible to do lazy matching like regex). 2021-04-25 15:17:52 -07:00
Dillon Kearns
8791747ad7 Add starting point for new glob experiment. 2021-04-25 09:08:27 -07:00
Dillon Kearns
7f59d64151 Remove unused import. 2021-04-23 16:25:12 -07:00
Dillon Kearns
9c09b18812 Fix test failure. 2021-04-23 16:24:26 -07:00
Dillon Kearns
521c3c0cc7 Rename StaticData -> Data. 2021-04-23 16:22:23 -07:00
Dillon Kearns
20f37a4069 Remove obsolete sourceIcon. 2021-04-23 08:47:11 -07:00
Dillon Kearns
af55887d72 Fix test. 2021-04-22 11:33:06 -07:00
Dillon Kearns
f707815679 Fix test. 2021-04-21 07:52:56 -07:00
Dillon Kearns
1e1f16e23d Add missing field in test setup. 2021-04-20 20:54:18 -07:00
Dillon Kearns
7f14f6171a Apply review fixes. 2021-04-20 14:35:55 -07:00