Commit Graph

324 Commits

Author SHA1 Message Date
Craig McIlwrath
d37cfed9f9
Apply suggestions from code review
Co-authored-by: Martin Šošić <Martinsos@users.noreply.github.com>
2021-08-24 11:53:22 -04:00
zant
76acbfd52a
feat: Implement wasp info command (#295) 2021-08-23 18:13:04 +02:00
craigmc08
43450647c7 Fix some comments 2021-08-22 14:19:38 -04:00
craigmc08
9686eaf4dc Add test for Analyzer module 2021-08-22 13:33:44 -04:00
craigmc08
b294e42889 Refactor EvaluationError type 2021-08-22 13:18:12 -04:00
Martin Sosic
0a33598b7f fix: Fixed compiler thinking auth is enabled per operation when it is not. 2021-08-20 17:47:55 +02:00
craigmc08
923a9ad35a Refactoring 2021-08-07 09:22:52 -04:00
craigmc08
2507a71abe Add evaluation for import, json, psl 2021-08-05 15:22:21 -04:00
craigmc08
5f3f845416 More cleanup in TH 2021-08-05 14:34:46 -04:00
craigmc08
865a5196aa Refactor evaluator TH code and add more comments 2021-08-05 13:25:13 -04:00
craigmc08
4120bc53dc Add TH generation for IsDeclType, IsEnumType instances 2021-08-05 13:25:13 -04:00
craigmc08
d043548ecc Get evaluation working a bit
Code is probably not great, but passing tests for generating haskell
data structures exist!

Still have to hand write IsDeclType and IsEnumType instances, but it's cool
2021-08-05 13:25:13 -04:00
craigmc08
a65a964b76 Add TODO for tests in Util.Control.Monad 2021-08-05 13:17:49 -04:00
craigmc08
96450aa31d Suggestions from code review 2021-08-05 13:17:49 -04:00
craigmc08
6f178115dc Suggestions from code review 2021-08-05 13:17:49 -04:00
craigmc08
d335562263 Suggestions from code review 2021-08-05 13:17:49 -04:00
Craig McIlwrath
5d013fab6d Apply suggestions from code review
Co-authored-by: Martin Šošić <Martinsos@users.noreply.github.com>
2021-08-05 13:17:49 -04:00
craigmc08
e1e062479e Suggestions from code review 2021-08-05 13:17:49 -04:00
Craig McIlwrath
46206c3fb3 Apply suggestions from code review
Co-authored-by: Martin Šošić <Martinsos@users.noreply.github.com>
2021-08-05 13:17:49 -04:00
craigmc08
f25f206b91 Remove some useless comments 2021-08-05 13:17:49 -04:00
craigmc08
2f173bc8b7 Refactor TypeChecker unifyTypes
The dicttype case is more clear now
2021-08-05 13:17:49 -04:00
craigmc08
cf55594eda Refactor typechecker module
Move code into Analyzer.TypeChecker.Internal to clean up interface, change lots of
names to be more readable, add comments to explain the complex parts of typechecker
code.
2021-08-05 13:17:49 -04:00
craigmc08
5ab608b8f1 Refactor TypeError
Instead of just a string, now the possible errors are enumerated. Recursive
error structures are used for dictionary/list type errors. Tests are updated
to check behavior of the new type errors.
2021-08-05 13:17:49 -04:00
craigmc08
51b6cda07a Implement Decl, Enum type checking 2021-08-05 13:17:49 -04:00
craigmc08
0357921162 Implement type checking for lists and dictionaries
Currently fails to type check empty lists, because the requisite type
inference has not been added yet.
2021-08-05 13:17:49 -04:00
craigmc08
ce7ee253bd Implement type checking of literal expressions
Type checks literal expressions + variables. Tests are included for all of
these cases as well.
2021-08-05 13:17:49 -04:00
Martin Sosic
7d73f4969b fix: Improved error message when route points to non-existing page (#286). 2021-07-22 17:13:49 +02:00
Martin Šošić
d86b53cb24
Merge pull request #279 from saatvikshah/auth_opt_out
Allow operations to opt out of auth middleware
2021-07-21 16:28:18 +02:00
Martin Sosic
748dfb5725 feat: Wasp can now run custom setup code on server start (#199). 2021-07-21 16:14:38 +02:00
Martin Sosic
29fd18dbcc Formatted with ormolu. 2021-07-21 16:05:55 +02:00
Saatvik Shah
d8bd9ce674 Add task counter to ToDo app 2021-07-20 21:37:35 +02:00
Saatvik Shah
3791b0ee7c Merge remote-tracking branch 'upstream/master' into auth_opt_out 2021-07-18 18:46:18 +02:00
Craig McIlwrath
be03c2a153
feat(analyzer): add new Analyzer module and implement parser
Implements the parser for the new wasp Analyzer. Additionally fixes some ambiguities/inconsistencies in the wasplang document.

Closes #274
2021-07-16 09:34:12 -04:00
Saatvik Shah
d0c5114a52 Address review comments 2021-07-09 08:04:29 +02:00
Saatvik Shah
c71eb58ea9 Merge remote-tracking branch 'upstream/master' into auth_opt_out 2021-07-05 21:26:47 +02:00
Saatvik Shah
a85b408b60 Allow operations to opt out of auth middleware
This patch allows operations to individually specify whether they want
to use or opt out of auth middleware, via an additional `auth` argument
under the actions/queries sections. If left unspecified it is assumed to
be true.

This is addressed by removing the current global auth middleware
registration, and adding it instead to individual operation route
specification.
2021-07-05 21:20:56 +02:00
Martin Sosic
eae7b20938 Replaced couple of last usages of Path with StrongPath. 2021-07-05 17:47:28 +02:00
Martin Sosic
7c7eaa5409 Updated StrongPath to 1.0.0.0, from Hackage. 2021-07-05 17:47:28 +02:00
tolarianwiz
2d54d005e5
refactor: extract server npm dev dependencies
Now dev dependencies in package.json are no more hardcoded, instead they are generated (like dependencies) from ServerGenerator.hs and inserted as devDepsChunk.
2021-05-31 20:30:08 +02:00
Martin Sosic
dea6986d82 fix: 'wasp db migrate-dev' now works when interactivity is needed. Fixes #229 2021-05-20 14:35:46 +02:00
tolarianwiz
f363ed1c24 feat(cli): add 'wasp deps' command that lists dependencies used in the project by wasp (#238) 2021-05-20 14:15:36 +02:00
caz-gh
df619ff943 feat: add 'helmet' to node server dependencies 2021-05-19 16:40:56 +02:00
Martin Sosic
8d3e3830f4 fix: bumped Prisma version to 2.22.1. 2021-05-18 21:18:05 +02:00
tolarianwiz
79bb1c7a82
Improved error message when wasp build detects that SQLite is used (#226)
Improved error message when wasp build detects that SQLite is used.
2021-05-11 16:34:32 +02:00
Martin Sosic
1219a57bc9 Formatted whole codebase with ormolu. 2021-04-28 17:44:00 +02:00
Martin Sosic
21dcdb2e6b Small fixes in Haskell code, mostly haddock fixes. 2021-04-28 14:38:24 +02:00
Martin Šošić
f9e8f88b66
Upgraded to Prisma 2.21 (stable migrations) + postgre can be used in local dev.
- `wasp db migrate-save` and `wasp db migrate-up` got replaced with `wasp db migrate-dev`.
- Wasp now has a declarative way to express which db is used, postgresql or sqlite: `db { system: PostgreSQL }`.
- Prisma is now at the latest version, 2.21. PSL parser was upgraded to work with this.
- PostgreSQL can now be used for local development.
- We migrated examples/realworld to work with this new version of Wasp.
2021-04-21 14:06:25 +02:00
Martin Šošić
92937b5e65
Implemented support for dotenv file. (#208) 2021-04-16 12:43:57 +02:00
Martin Sosic
7c855f42df Bumped react-scripts version from 4.0.2 to 4.0.3. 2021-04-06 21:55:23 +02:00
Martin Sosic
300b4caafe Switched from Control.Exception to UnliftIO.Exception, that handles async exceptions by default. 2021-03-30 23:41:20 +02:00
Martin Šošić
779cff3745
Enabled input in proxied CLI commands + fixed encoding of proxied output. (#202)
Co-authored-by: Matija Sosic <matija.sosic@gmail.com>
2021-03-15 17:11:04 +01:00
Martin Šošić
ad3bdd32ae
Implemented PSL model parser, used it for Entity. (#201) 2021-03-15 17:10:01 +01:00
Craig McIlwrath
82ea947981
Add ext/.waspignore file (#196) 2021-03-03 09:35:27 +01:00
Trieu Vu
7eca9b37a3 generate userEntityLower for signup.js 2021-02-23 12:08:02 +01:00
Matija Sosic
3eb926ef22
Fixes #187 - copying files from ext that do not exist. (#189) 2021-02-22 16:09:17 +01:00
Martin Sosic
80d6278798 Updated axios version in web app (to fix security vulnerability. 2021-02-09 22:26:32 +01:00
Martin Sosic
118a50b060 Updated CRA from 4.0.0 to 4.0.2 . 2021-02-09 21:13:08 +01:00
Martin Sosic
80ab13d4e4 Improved error message when node is missing or too low version. 2021-02-09 15:49:48 +01:00
Matija Sosic
0207276a01
Added welcome page to the newly created app. (#178) 2021-02-09 13:13:51 +01:00
Martin Sosic
cd015d59e8 Fixed missing isAuthEnabled in ToJSON for RouterTemplateData. 2021-02-04 14:54:50 +01:00
Martin Sosic
ecd2fd36f2 Fixed places where auth stuff was used even when no auth. 2021-02-04 14:18:59 +01:00
Matija Sosic
316c727a8c
Implemented app.head property. (#170) 2021-02-04 11:42:01 +01:00
Martin Sosic
93b7ce3ea7 Fixed warnings in Haskell. 2021-02-03 19:38:10 +01:00
Martin Šošić
cfa6985abd
Added support for manual deployment of generated code (backend and frontend) (#167) 2021-02-03 19:26:14 +01:00
Matija Sosic
647814e920
Implemented "wasp build" cmd - generates different schema.prisma. (#166)
* Implemented "wasp build" cmd - generates different schema.prisma.

* PR fixes.
2021-02-01 17:37:42 +01:00
Matija Sosic
68155711e8
Implemented FE ACL & updated the examples. (#165)
* Implemented FE ACL & updated the examples.

* PR fixes, fixed tests.
2021-02-01 16:32:07 +01:00
Matija Sosic
242c51f6a8
Made auth more flexible - not generating pages & routes anymore, just the forms. (#161) 2021-01-25 19:39:50 +01:00
Martin Sosic
f52b719291 Fixed prisma version to 2.12.1 . 2020-12-10 15:54:17 +01:00
Matija Sosic
6527319581
Added password hashing middleware to Prisma instance - dev cannot change/update password without it being hashed. (#149) 2020-11-27 18:11:54 +01:00
Matija Sosic
4ac627e652
Generating simple login & signup pages when auth is enabled. (#145) 2020-11-23 16:51:46 +01:00
Matija Sosic
8e451dbe6c
Implemented simple signup function for Wasp developer to use out-of-the-box. (#142) 2020-11-19 16:28:42 +01:00
Martin Sosic
1c47a28e41 Small fixes 2020-11-05 11:04:05 +01:00
Martin Sosic
e90762f9d6 Stderr output from jobs is now marked as such. 2020-11-05 09:44:01 +01:00
Matija Sosic
46a1cbab32
Added wasp db studio command. (#120) 2020-11-04 15:26:35 +01:00
Martin Sosic
0c4ae72495 Fixed jobs to terminate if interrupted by exception. 2020-10-29 18:11:39 +01:00
Matija Sosic
821e5c02b0
Fix: api.js is now generated when no auth. (#107) 2020-10-28 23:53:02 +01:00
Matija Sosic
4ea507312c
Fixed #103: app crashes when no auth. (#106) 2020-10-28 18:12:27 +01:00
Martin Sosic
a64f4b8a77 Updated react-scripts to 4.0.0, fixes #84. 2020-10-26 16:55:22 +01:00
Martin Sosic
7aafa82a32 StrongPath: File can now be specific, same like Dir. 2020-10-24 22:44:27 +02:00
Martin Sosic
4cbd2a6240 Extracted internals into Internal (StrongPath). 2020-10-24 22:44:27 +02:00
Martin Sosic
4a7c911631 Added fromBaseTypeSystem functions to StrongPath. 2020-10-24 22:44:27 +02:00
Martin Sosic
87e05823cf Added tests and support for "../" prefix to StrongPath. 2020-10-24 22:44:27 +02:00
Martin Sosic
3ab248b584 Removed redundant old templates and code (redux). 2020-10-21 17:41:04 +02:00
Martin Sosic
cb217fde44 Renamed EntityPSL to Entity. 2020-10-21 17:41:04 +02:00
Martin Sosic
58d10ab305 Removed old Entity. 2020-10-21 17:41:04 +02:00
Martin Sosic
71273805db Enriched 'wasp new' message and refactored terminal coloring. 2020-10-19 14:56:43 +02:00
Matija Sosic
6a59804a46
Authentication generation (#74) 2020-10-19 14:45:54 +02:00
Matija Sosic
bbe6dae679
Implemented parser for Auth Wasp element. (#72) 2020-10-08 16:17:47 +02:00
Martin Sosic
6edad656c2 Queries are now auto-invalidated based on entities they use. 2020-10-07 15:56:23 +02:00
Martin Sosic
54b994bb0a Entities are now injected into operations (if declared in Wasp). 2020-10-07 15:29:21 +02:00
Martin Sosic
6e41c1dd84 Tiny naming fix. 2020-10-06 21:31:18 +02:00
Martin Sosic
a06410dad8 Fixed execution of processes/jobs -> stderr was not being forwarded. 2020-10-06 21:24:41 +02:00
Martin Sosic
ca039304f9 Wasper can now specify npm dependencies. 2020-09-29 13:46:48 +02:00
Martin Sosic
e115ece29a External code paths now again use StrongPath. 2020-09-23 15:44:32 +02:00
Martin Sosic
391a045164 StrongPath now specifies standard (posix/win) it uses. 2020-09-23 15:42:18 +02:00
Martin Sosic
5a0ddf71f5 Set node version of generated project to current LTS version. 2020-09-22 14:56:32 +02:00
Matija Sosic
338c3c909e Removed unused imports. 2020-09-18 16:45:20 +02:00
Matija Sosic
08f224d03d
Implemented migrate-save and migrate-up cli db commands. (#41) 2020-09-18 16:14:14 +02:00
Martin Sosic
2617bd5f66 Now AppVeyor CI builds Wasp on Windows and runs tests.
Also fixed path issues when running on Windows.
2020-09-18 15:22:58 +02:00
Martin Sosic
a4d56b41df Added check of node version when running node commands. 2020-09-17 13:04:19 +02:00
Matija Sosic
e95fae7f06
Implemented wasp db migrate cli cmd - runs only prisma migrate save for now. (#39) 2020-09-15 16:39:56 +02:00
Martin Sosic
f06c933182 wasp start now does setup and start while forwarding output.
fix
2020-09-11 17:33:10 +02:00
Martin Sosic
a70effa6db Implemented first version of CLI, with clean, new and start commands.
Start does not yet work properly.
2020-09-10 09:47:41 +02:00
Matija Sosic
ef5adc40ff Renamed prisma.schema to schema.prisma. 2020-09-09 15:56:39 +02:00
Matija Sosic
06bb7b97a8
Implemented generation of prisma.schema. (#33) 2020-09-07 16:33:47 +02:00
Martin Sosic
bc5caef944 Implemented new Action and removed old Action and Button. 2020-09-07 13:26:53 +02:00
Martin Sosic
69f45c40a7 Added HttpError on server, to be used in operations. 2020-09-04 15:14:06 +02:00
Matija Sosic
3b0b284bac
Implemented parser for new PSL-based entities. (#30) 2020-09-04 14:21:47 +02:00
Martin Sosic
faf34a7d26 Added react-query, implemented useQuery wrapper for it, refactored Todo
example app to use new queries, removed old Wasp code from it.
2020-09-03 17:52:34 +02:00
Martin Sosic
f5fe865193 Implemented simple Query generator on both FE and BE. 2020-09-01 16:58:34 +02:00
Martin Sosic
cf0208315f Added generation of external code in server. 2020-09-01 16:58:34 +02:00
Matija Sosic
bcfeb9b350 Page now accepts an external component instead of inline content. 2020-08-31 14:20:40 +02:00
Martin Sosic
ce6cf2bc5a Shortened Wasp.JsImport fields. 2020-08-25 15:55:37 +02:00
Martin Sosic
495ba96284 Implemented Query parser + tests. 2020-08-25 15:08:02 +02:00
Martin Sosic
3483582fc6 JsImport now distinguishes between default and named imports. 2020-08-25 12:06:46 +02:00
Martin Šošić
c825f8f811
JsImport now supports default import or single named import. (#25)
JsImport now supports default import or single named import.
2020-07-31 15:04:45 +02:00
Matija Sosic
25d7051c6d
Route is now a separate Wasp element. Implemented both parser and generator. (#24) 2020-07-31 14:26:10 +02:00
Martin Sosic
0c6c605798 Added .hlint.yaml. 2020-07-30 00:03:32 +02:00
Martin Sosic
839beb4142 Refactored codebase so it uses StrongPath instead of Path (on 99% of places). 2020-07-29 16:22:15 +02:00
Martin Sosic
8bec4c8e20 Implemented generation of simple node server. 2020-07-27 17:44:21 +02:00
Martin Sosic
8922d9eb53 Implement StrongPath -> data type representing path where relative dirs are named on type level. 2020-07-27 17:40:42 +02:00
Martin Sosic
e45d077f54 Added Button and Action<entity>, also updated Todo app to use them. 2020-03-10 16:24:41 +01:00
Matija Sosic
fd39e5b658 Added support for entity-list mutex filters. 2020-03-10 14:01:29 +01:00
Martin Sosic
aa1072b20f Moved all code into waspc directory. 2020-02-20 12:30:58 +01:00