From eb5f6703fce68af849adbf35d558f8157cc11b0d Mon Sep 17 00:00:00 2001 From: rubyisrust Date: Mon, 26 Aug 2024 16:54:58 +0800 Subject: [PATCH 1/2] Fix some typos (#2235) --- mage/README.md | 2 +- mage/src/client/components/Faq.jsx | 4 ++-- web/README.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mage/README.md b/mage/README.md index 15ab11a402..2f76b658f2 100644 --- a/mage/README.md +++ b/mage/README.md @@ -1,6 +1,6 @@ # Mage -This directory contains the source code of Mage (aka "GPT Web App Generator" aka "Wasp AI"): a Wasp app (so a full-stack web app) that allows you to create a new Wasp app (inception :)!) from just a short description. It uses ChatGPT in a smart way to accomplish this (so it would be clasified as an AI code agent). +This directory contains the source code of Mage (aka "GPT Web App Generator" aka "Wasp AI"): a Wasp app (so a full-stack web app) that allows you to create a new Wasp app (inception :)!) from just a short description. It uses ChatGPT in a smart way to accomplish this (so it would be classified as an AI code agent). Mage is hosted at https://usemage.ai and you can use it there for free. diff --git a/mage/src/client/components/Faq.jsx b/mage/src/client/components/Faq.jsx index f91d2b24d7..b472e668e5 100644 --- a/mage/src/client/components/Faq.jsx +++ b/mage/src/client/components/Faq.jsx @@ -42,7 +42,7 @@ const faqs = [ answer:

Due to GPT being non-deterministic, it sometimes introduces (small) mistakes, especially for more complex apps, but altogether it works better than we expected! The code it generates is often very reasonable, and for very simple apps, it can even produce a working app out of the box, while for a bit more complex apps - it currently serves more like a super-intelligent starter that needs a couple of tweeks to get it going. + it currently serves more like a super-intelligent starter that needs a couple of tweaks to get it going.

@@ -76,7 +76,7 @@ const faqs = [

We use GPT4 during the planning phase, since that is the most critical step, and then use GPT3.5 for the rest of the steps. - Although using GPT4 exclusively does give better results, we use a mix to keep the costs, generation time, and bandwith acceptable (due to pricing and rate limits of GPT4). + Although using GPT4 exclusively does give better results, we use a mix to keep the costs, generation time, and bandwidth acceptable (due to pricing and rate limits of GPT4).

diff --git a/web/README.md b/web/README.md index 9b4dba2e90..58cb8ee577 100644 --- a/web/README.md +++ b/web/README.md @@ -75,7 +75,7 @@ Since we don't want our users to read `docs/next` ("current" docs), we don't pub When releasing new version of Wasp, what we do is run `npm run docusaurus docs:version {version}` to create new versioned docs from the current docs. We do this on every new Wasp release. This command does everything for us, and since we use Docusaurus' default settings for versions, -there is nothing else we need to do, it will be picked up as the lastest version by default. +there is nothing else we need to do, it will be picked up as the latest version by default. #### Which version of docs should I be editing? From 0aabddaa75203f0fbc2dd023f49592d95cc2776d Mon Sep 17 00:00:00 2001 From: Mihovil Ilakovac Date: Mon, 26 Aug 2024 14:03:40 +0200 Subject: [PATCH 2/2] Fixes Prisma array expr for empty arrays (#2249) --- waspc/src/Wasp/Psl/Parser/Argument.hs | 3 +-- waspc/test/Psl/Common/ModelTest.hs | 15 +++++++++++++++ waspc/test/Psl/Parser/ArgumentTest.hs | 3 +++ waspc/test/Psl/Parser/AttributeTest.hs | 6 ++++++ waspc/test/Psl/Parser/SchemaTest.hs | 12 +++++++++++- 5 files changed, 36 insertions(+), 3 deletions(-) diff --git a/waspc/src/Wasp/Psl/Parser/Argument.hs b/waspc/src/Wasp/Psl/Parser/Argument.hs index bcd0e25a6a..e60956bf3a 100644 --- a/waspc/src/Wasp/Psl/Parser/Argument.hs +++ b/waspc/src/Wasp/Psl/Parser/Argument.hs @@ -18,7 +18,6 @@ import Wasp.Psl.Parser.Common ( brackets, colon, commaSep, - commaSep1, float, identifier, integer, @@ -69,7 +68,7 @@ funcCallExpr = arrayExpr :: Parser Psl.Argument.Expression arrayExpr = Psl.Argument.ArrayExpr - <$> brackets (commaSep1 expression) + <$> brackets (commaSep expression) -- NOTE: For now we are not supporting negative numbers. -- I couldn't figure out from Prisma docs if there could be the case diff --git a/waspc/test/Psl/Common/ModelTest.hs b/waspc/test/Psl/Common/ModelTest.hs index bca5ca8411..75d6500623 100644 --- a/waspc/test/Psl/Common/ModelTest.hs +++ b/waspc/test/Psl/Common/ModelTest.hs @@ -15,6 +15,7 @@ sampleBodySchema = posts Post[] @relation("UserPosts", references: [id]) @customattr weirdType Unsupported("weird") anotherId String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid + someField String[] @default([]) @@someattr([id, username], [posts]) |] @@ -114,6 +115,20 @@ sampleBodyAst = ] } ), + Psl.Model.ElementField + ( Psl.Model.Field + { Psl.Model._name = "someField", + Psl.Model._type = Psl.Model.String, + Psl.Model._typeModifiers = [Psl.Model.List], + Psl.Model._attrs = + [ Psl.Attribute.Attribute + { Psl.Attribute._attrName = "default", + Psl.Attribute._attrArgs = + [Psl.Argument.ArgUnnamed (Psl.Argument.ArrayExpr [])] + } + ] + } + ), Psl.Model.ElementBlockAttribute ( Psl.Attribute.Attribute { Psl.Attribute._attrName = "someattr", diff --git a/waspc/test/Psl/Parser/ArgumentTest.hs b/waspc/test/Psl/Parser/ArgumentTest.hs index 57de8fd28e..07567ccbf0 100644 --- a/waspc/test/Psl/Parser/ArgumentTest.hs +++ b/waspc/test/Psl/Parser/ArgumentTest.hs @@ -36,6 +36,9 @@ spec_parseArgumentPslPart = do Psl.Argument.IdentifierExpr "pg_trgm", Psl.Argument.FuncExpr "postgis" [Psl.Argument.ArgNamed "version" (Psl.Argument.StringExpr "2.1")] ] + ), + ( "[]", + Psl.Argument.ArgUnnamed (Psl.Argument.ArrayExpr []) ) ] let runTest (psl, expected) = diff --git a/waspc/test/Psl/Parser/AttributeTest.hs b/waspc/test/Psl/Parser/AttributeTest.hs index 35e5994bab..9a72b0fd70 100644 --- a/waspc/test/Psl/Parser/AttributeTest.hs +++ b/waspc/test/Psl/Parser/AttributeTest.hs @@ -53,6 +53,12 @@ spec_parseAttributePslPart = do ] ) ] + ), + ( "@default([])", + Psl.Attribute.Attribute + "default" + [ Psl.Argument.ArgUnnamed $ Psl.Argument.ArrayExpr [] + ] ) ] runTestsFor attribute tests diff --git a/waspc/test/Psl/Parser/SchemaTest.hs b/waspc/test/Psl/Parser/SchemaTest.hs index ab61f9f4e0..882bde80bc 100644 --- a/waspc/test/Psl/Parser/SchemaTest.hs +++ b/waspc/test/Psl/Parser/SchemaTest.hs @@ -63,6 +63,7 @@ spec_parsePslSchema = do user User @relation(fields: [userId], references: [id]) userId Int votes TaskVote[] + someField String[] @default([]) } model TaskVote { @@ -230,7 +231,16 @@ spec_parsePslSchema = do "votes" (Psl.Model.UserType "TaskVote") [Psl.Model.List] - [] + [], + Psl.Model.ElementField $ + Psl.Model.Field + "someField" + Psl.Model.String + [Psl.Model.List] + [ Psl.Attribute.Attribute + "default" + [Psl.Argument.ArgUnnamed $ Psl.Argument.ArrayExpr []] + ] ] ), Psl.Schema.ModelBlock $