Commit Graph

81 Commits

Author SHA1 Message Date
Mihovil Ilakovac
7a0f8b5d58
Replaces Create React App with Vite (#1019) 2023-03-01 17:14:14 +01:00
Shayne Czyzewski
8991043eed
Add Express app and http server to server setupFn (#1017) 2023-02-27 12:19:17 -05:00
Filip Sodić
32188075c6
Add docs for TypeScript support in Wasp (#1029) 2023-02-27 11:19:09 +01:00
Mihovil Ilakovac
19841401ac
Updates social auth button styles (#1018) 2023-02-22 21:50:07 +01:00
Mihovil Ilakovac
9665571c63
Moves root component inside of Router (#1016) 2023-02-21 11:52:14 +01:00
Mihovil Ilakovac
9b2c8ca0a5
Fixes user query cache invalidation (#1014) 2023-02-20 16:28:26 +01:00
Mihovil Ilakovac
c2a3e04283
Adds support for root component (#1009) 2023-02-20 11:15:54 +01:00
Filip Sodić
b79f694eef
Fix structural typing bug with operation types (#982)
* Support typing backend queries

* Implement types for actions and extract entities

* Add Prisma entities to the frontend

* Add frontend types to internal todoApp

* Undo moving for easier review

* Revert back to generating a query.js file

* Rename buildEntityData

* Fix structural typing bug

* Rename function for making entity json data

* Expand EntityMap to improve readability

* Remove leftover testing artifacts

* Remove wasp prefix from _entityName

* Remove solved todo in schema template

* Fix docs in method

* Adding uninstall command (#953)

* Adding uninstall command

* Updates docs and changelog related to the uninstall command

* Use StrongPath instead of FilePath

* Fix review feedback

* Move prisma client generation messages

* Generalize FileDraft functions

* Generate prisma clients using ENV

* Fix schema checksum check

* Small refactor in db generator

* Run prisma generate from server root dir

* Fix types for useAction

* Fix type error for useAction

* Fix schema generation in Dockerfile

* Refactor passing env vars to prisma schema

* Fix useAction types

* Replace Prelude readFile with SP readFile

* Add comment for prisma/client in web app

* Replace Prelude writeFile with SP writeFile

* Replace do and if with ifM

* Rename readProjectTelemetryFile

* Refactor readOrCreateUserSignatureFile

* Remove redundant comment

* Fix typo in variable name

* Simulate unions with a type class

* Further improve strongpath types

* Add expand types to types index

* Remove redundant comment

* Organize internal type modules

* Fix formatting

* Remove leftover code

* Generate prisma clients after migration

* Change ModuleRootDir to ComponentRootDir

* Remove solved todo

* Improve naming

* Remove redundant env variable

* Improve formatting

* Fix errors after merging

* Include input and output types

* Temporarily delete _types

* Restore _types index

* Add types to queries

* Rename WaspEntity to Entity

* Change local function name

Co-authored-by: Martin Šošić <Martinsos@users.noreply.github.com>

* Rename local function again

* Update changelog

* Fix error type in useQuery

* Rename Component to AppComponent

* Refactor DbGenerator

* Explain Abs paths in SP helpers

* Update e2e tests

* Fix formatting

* Change signature for doesFileExist

* Change signature for SP functions

* Remove redundant do block

* Fix formatting

* Reorder functions

* Rename module to appComponent in functions

* Rename module to component in functions

* Rename telemetry cache function

* Fix formatting

* Update changelog

* Remove redundant import

* Update e2e tests

---------

Co-authored-by: Mihovil Ilakovac <mihovil@ilakovac.com>
Co-authored-by: Martin Šošić <Martinsos@users.noreply.github.com>
2023-02-13 15:17:08 +01:00
Filip Sodić
c41f065ef4
Bring Prisma entities to the frontend (#962)
* Support typing backend queries

* Implement types for actions and extract entities

* Add Prisma entities to the frontend

* Add frontend types to internal todoApp

* Undo moving for easier review

* Revert back to generating a query.js file

* Rename buildEntityData

* Remove solved todo in schema template

* Fix docs in method

* Adding uninstall command (#953)

* Adding uninstall command

* Updates docs and changelog related to the uninstall command

* Use StrongPath instead of FilePath

* Fix review feedback

* Move prisma client generation messages

* Generalize FileDraft functions

* Generate prisma clients using ENV

* Fix schema checksum check

* Small refactor in db generator

* Run prisma generate from server root dir

* Fix types for useAction

* Fix type error for useAction

* Fix schema generation in Dockerfile

* Refactor passing env vars to prisma schema

* Fix useAction types

* Replace Prelude readFile with SP readFile

* Add comment for prisma/client in web app

* Replace Prelude writeFile with SP writeFile

* Replace do and if with ifM

* Rename readProjectTelemetryFile

* Refactor readOrCreateUserSignatureFile

* Remove redundant comment

* Fix typo in variable name

* Simulate unions with a type class

* Further improve strongpath types

* Generate prisma clients after migration

* Change ModuleRootDir to ComponentRootDir

* Remove solved todo

* Improve naming

* Remove redundant env variable

* Improve formatting

* Fix errors after merging

* Change local function name

Co-authored-by: Martin Šošić <Martinsos@users.noreply.github.com>

* Rename local function again

* Update changelog

* Fix error type in useQuery

* Rename Component to AppComponent

* Refactor DbGenerator

* Explain Abs paths in SP helpers

* Update e2e tests

* Fix formatting

* Change signature for doesFileExist

* Change signature for SP functions

* Remove redundant do block

* Fix formatting

* Reorder functions

* Rename module to appComponent in functions

* Rename module to component in functions

* Rename telemetry cache function

* Fix formatting

---------

Co-authored-by: Mihovil Ilakovac <mihovil@ilakovac.com>
Co-authored-by: Martin Šošić <Martinsos@users.noreply.github.com>
2023-02-13 14:31:49 +01:00
Bas Dirks
e4e29eec0b
Add Input type to operations (#989)
* feat: add type variable for operation input argument

* Pass where object by name.

* Change default type of operator input to `never`.

* Update e2e checksums.

* Rename operation Result type to Output, remove redundant default types.

---------

Co-authored-by: Bas Dirks <bas.dirks@bettyblocks.com>
2023-02-10 16:56:53 +01:00
Filip Sodić
71038c277d
Add automatic TypeScript support for operations (#952)
* Support typing backend queries

* Implement types for actions and extract entities

* Automatically generate specific operation types

* Eta reduce functions

* Add CR fixes

* Add type to imports and exports for entities

* Change query extensions back to .js

* Tidy up default arguments for operation types

* Don't throw syntax error when there are no entities

* Update e2e tests

* Fix formatting

* Address CR comments

* Fix typo in comment

* Add duplication comment

* Update e2e tests

* Fix duplication comments

* Update changelog and bump project version

* Update changelog

* Update e2e tests
2023-01-24 15:12:57 +01:00
Filip Sodić
81ffa6c27c
Add manual TypeScript support for Operations (#945)
* Support typing backend queries

* Implement types for actions and extract entities

* Add CR fixes

* Add type to imports and exports for entities

* Change query extensions back to .js

* Tidy up default arguments for operation types

* Don't throw syntax error when there are no entities

* Update e2e tests

* Fix formatting

* Fix typo in comment

* Update changelog and bump project version
2023-01-24 14:45:35 +01:00
Filip Sodić
68c7d03814
Make odoApp in waspc compatible with TypeScript (#960) 2023-01-19 15:19:11 +01:00
Shayne Czyzewski
d5488d4963
Update examples to 0.8.0 (#919) 2023-01-02 12:11:39 -05:00
Shayne Czyzewski
2182b9088d
Adds GitHub login and refactors Passport.js (#872) 2022-12-20 09:12:08 -05:00
Shayne Czyzewski
fc29a891dc
Update example versions (#836) 2022-11-26 10:02:25 -05:00
Filip Sodić
67eca7ecf6
Add peek and go to definition for JS files (#795)
* Separate ext code to client and server

* Use skeleton in createNewProject and refactor

* Refactor Lib.hs to use ExceptT

* Fix formatting

* Pop up returns

* Extract liftIO and add a do block

Co-authored-by: Shayne Czyzewski <523636+shayneczyzewski@users.noreply.github.com>

* Address some review comments

* Add skeleton comment

* Extract common CommandError message

* Separate skeleton comment into two rows

* Move server and client dirs into src

* Simplify maybeToEither

* Further refactor Lib.hs

* Further simplify skeleton comment

* Add shared code directory to project structure

* Update e2e test inputs

* Update e2e test outputs

* Fix formatting

* Fix bug in compile function

Co-authored-by: Martin Šošić <Martinsos@users.noreply.github.com>

* Change map to fmap in compile function

* Fix formatting

* Force git to include empty directories

* Remove extra empty line from .gitkeep files

* Add .jsconfig to enable go-to-definition

* Watch shared directory for changes

* Add final newline to jsconfigs

* Fix regular and e2e tests

* Update e2e tests

* Fix cli template packaging and update todoApp

* Add a shared function demo to todoApp

* Update waspc and e2e tests

* Fix compiler warnings and rename function

* Rename mkError to mkParserError

* Remove redundant empty line

* Fix test warnings

* Fix formatting

* Update waspc.cabal with jsconfigs

* Minimize jsconfig.json files

* Add jsconfigs to waspc todoApp

* Update e2e tests

* Update e2e tests

* Fix directory tree watching on wasp start

* Implement review feedback

Co-authored-by: Shayne Czyzewski <523636+shayneczyzewski@users.noreply.github.com>
Co-authored-by: Martin Šošić <Martinsos@users.noreply.github.com>
2022-11-11 17:38:38 +01:00
Filip Sodić
86e0893d6f
Separate user code into client, server, shared (#753)
* Separate ext code to client and server

* Use skeleton in createNewProject and refactor

* Refactor Lib.hs to use ExceptT

* Fix formatting

* Pop up returns

* Extract liftIO and add a do block

Co-authored-by: Shayne Czyzewski <523636+shayneczyzewski@users.noreply.github.com>

* Address some review comments

* Add skeleton comment

* Extract common CommandError message

* Separate skeleton comment into two rows

* Move server and client dirs into src

* Simplify maybeToEither

* Further refactor Lib.hs

* Further simplify skeleton comment

* Add shared code directory to project structure

* Update e2e test inputs

* Update e2e test outputs

* Fix formatting

* Fix bug in compile function

Co-authored-by: Martin Šošić <Martinsos@users.noreply.github.com>

* Change map to fmap in compile function

* Fix formatting

* Force git to include empty directories

* Remove extra empty line from .gitkeep files

* Watch shared directory for changes

* Fix regular and e2e tests

* Fix cli template packaging and update todoApp

* Add a shared function demo to todoApp

* Update waspc and e2e tests

* Fix compiler warnings and rename function

* Rename mkError to mkParserError

* Remove redundant empty line

* Fix test warnings

* Fix formatting

* Fix directory tree watching on wasp start

* Implement review feedback

Co-authored-by: Shayne Czyzewski <523636+shayneczyzewski@users.noreply.github.com>
Co-authored-by: Martin Šošić <Martinsos@users.noreply.github.com>
2022-11-11 17:20:49 +01:00
Shayne Czyzewski
fa9f487e2a
Adds opt-in support for Tailwind (#777) 2022-11-04 09:39:13 -04:00
Anthony Suárez
0cde880f24
Feat: Validate wasp version from spec (#786)
* Add wasp field to AppSpec.App

* Validate app.wasp.version in AppSpec.Valid

* Add app.wasp.version field on .wasp file generated by CreateNewProject

* Add app.wasp.version to .wasp files of e2e tests

* Add app.wasp.version to examples' .wasp files

* Add app.wasp.version to docs

* Change waspc version from 0.6.0.0 to 0.6.0

* Change app.wasp.version validation to use regular semver

* Format code

* Refactor app.wasp.version validation

* Refactor app.wasp.version validation

* Update supported app.wasp.version format in docs

* Add TODO to validateWaspVersion

* Refactor app.wasp.version using toEnum

* Create Wasp.Version module with waspVersion constant

* Fix parseWaspVersionRange regex

Fixed:
  - The regex wasn't checking the string *starts* with ^.
  - The . symbols were not escaped.
  - The $ token is not specified as supported in the regex-tdfa docs.
    \' is used instead.

* Add comment explaining wasp version validation restrictions

* Use Wasp.Version.waspVersion instead of Paths_wasp.version
2022-10-31 23:00:03 +01:00
Shayne Czyzewski
dc036f56cd
Updates CRA from v4 to v5 (#771) 2022-10-19 10:39:45 -04:00
Shayne Czyzewski
8fc6fd1836
Adds support for Dockerfile customization (#732) 2022-10-13 12:46:07 -04:00
Shayne Czyzewski
a84f3547fa
Fixes login issue for uppercase usernames (#751) 2022-10-13 12:04:45 -04:00
Peter Reshetin
3f63340fc1
feat: separate env vars for server and client (#683) 2022-10-06 12:51:28 +02:00
Filip Sodić
4a94c9851e
Implement optimistic updates
* Remove flickering fixes for optimistic updates

* Add optimistic updates to Task.js

* First round of code review feedback

* Remove react query's additional options from hook

* Futher review feedback and code docs

* Fix and document error handling for optimistic updates

* Further document optimistic update mechanisms

* Update optimistic update docs

* Improve comment for useAction

* Further improve comments in actions/index

* Heavily comment actions/index

* Fix capitalization in action/index

* Add types to actions/index

* Fix jsdoc types in actions/index

* Comment testing sleeps

* Comment sleep function in todoApp/ext/actions

* Properly handle type errors in actions/index

* Fix formatting in actions/index

* Move updateFn change to optimistic update instantiation

* Extract common functionality in actions/index

* Fix formatting in actions/index

* Add jsdoc types to actions/index

* Revise jsdoc in actions/index

* Address PR comments

* Update e2e tests

* Mention optimistic updates in cache invalidation
2022-09-21 17:40:06 +02:00
Shayne Czyzewski
6cd38b0f94
Adds Google as an authentication method (#669) 2022-09-06 14:35:59 -04:00
Shayne Czyzewski
bc92b024e1
Renames auth method EmailAndPassword to UsernameAndPassword (#696) 2022-08-24 10:32:46 -04:00
Shayne Czyzewski
d827d05d96
Jobs callback function updates (#676) 2022-08-17 13:53:05 -04:00
h4r1337
3c4f59692b
Updates examples/todoApp (#679)
* Update examples/todoApp - fix #678

* Changed HttpError from 403 to 401

* Updated HttpError from 401 to 404
2022-07-27 15:16:06 -04:00
Filip Sodić
d1bea1c513
Add task status toggling to task page in todo app (#664)
* Add task done toggling to task page

* Fix wrong condition in example todo app
2022-07-06 23:13:35 +02:00
Filip Sodić
5e5b264448
Make waspc/todoApp return tasks in consistent order (#632)
(cherry picked from commit 57606c74e4)
2022-06-16 14:50:02 +02:00
Filip Sodić
59c714111e
Support for the client setup function (#595)
* Add clientSetup support to analyzer and tidy up generator

* Add clientSetup support to generator

* Add tests for client setup function and tidy up

* Address PR comments for client setup function

* Clean up server and web app generators

* Document react query invalidation on logout

* Update e2e tests after query client cache clean

* Fix syntax error in exmaple app

* Remove leftover todos

* Fix formatting

* Fix formatting

* Fix tests for client setup function

* Update e2e test

* Fix todos in templates

* Add docs for client setup

* Fix docs typo

* Fix docs typo

* Fix docs typo

* Fix docs typo

* Update e2e test
2022-05-20 14:49:26 +02:00
Shayne Czyzewski
4de7d16331
Adds cron support to pg-boss Jobs and documentation (#586) 2022-05-13 12:30:55 -04:00
Shayne Czyzewski
f14be11fc3
Add pg-boss as a Job executor (#582)
Note: This does not provide cron support, that is coming in the next PR.
2022-05-03 14:34:25 -04:00
Filip Sodić
50d806daa6
Update React Query to v3 (#554)
* Apply minor syntax fixes to templates

* Fix Wasp react app warnings

* Fix small bug in waspc todo app

* Rearrange functions in RouterGenerator

* Migrate react-query to v3

* Collapse config in react query

* Update e2e tests after react-query migration

* Rename function in RouterGenerator

* Update job tests
2022-04-15 11:23:15 +02:00
Shayne Czyzewski
adcb15a41c
Adds a simple pass-through Jobs implementation. (#553) 2022-04-13 12:30:29 -04:00
Shayne Czyzewski
09a72a7e1a
Upgrade Prisma to version 3.9.1 (#452) 2022-02-11 17:55:41 -05:00
Shayne Czyzewski
c2f9eff3b8
fix: todo example error from missing entity (#446)
Co-authored-by: shayneczyzewski <shayne.czyzewski@gmail.com>
2022-02-02 19:38:47 +01:00
Martin Šošić
8d2c33ab28
Replace Wasp with AppSpec and Parser with Analyzer. (#423) 2022-01-20 11:45:14 +01:00
Giovanni Garufi
dcd1549211
auth: Add onAuthSucceededRedirectTo option (#350)
Allows a user to specify a redirect target in case of successful authentication.
This used to be hardcoded to /, and the current implementation will fallback to that if the property is not specified.

Change-type: minor
Signed-off-by: Giovanni Garufi <nazrhom@gmail.com>
2021-11-22 14:23:19 +01:00
Vinícius Andrade
dfd6773cc1
Fixed lint errors in Todo Tutorial (#349)
* Fixed lint errors in waspc Todo example

Signed-off-by: Vini Andrade <vini.andrade.dev@gmail.com>

* Fixed lint errors in example TodoApp

Signed-off-by: Vini Andrade <vini.andrade.dev@gmail.com>

* Fixed lint errors in todo app docs

Signed-off-by: Vini Andrade <vini.andrade.dev@gmail.com>
2021-11-08 14:19:15 +01: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
Saatvik Shah
d8bd9ce674 Add task counter to ToDo app 2021-07-20 21:37:35 +02:00
Martin Sosic
3bae54c3e8 Added new migration to examples/todoApp. 2021-07-05 17:47:28 +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
Craig McIlwrath
82ea947981
Add ext/.waspignore file (#196) 2021-03-03 09:35:27 +01:00
Matija Sosic
f07f8e199b
Using material-ui in waspc todo example. (#171) 2021-02-06 13:41:22 +01:00
Matija Sosic
316c727a8c
Implemented app.head property. (#170) 2021-02-04 11:42:01 +01:00