Skip to content

Commit

Permalink
Merge branch 'main' into miho-prisma-5
Browse files Browse the repository at this point in the history
  • Loading branch information
infomiho committed Aug 26, 2024
2 parents 7a7d17a + 0aabdda commit 6e219aa
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 7 deletions.
2 changes: 1 addition & 1 deletion mage/README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
4 changes: 2 additions & 2 deletions mage/src/client/components/Faq.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const faqs = [
answer: <p>
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.

<br/><br/>

Expand Down Expand Up @@ -76,7 +76,7 @@ const faqs = [
<br/><br/>

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).

<br/><br/>

Expand Down
3 changes: 1 addition & 2 deletions waspc/src/Wasp/Psl/Parser/Argument.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import Wasp.Psl.Parser.Common
( brackets,
colon,
commaSep,
commaSep1,
float,
identifier,
integer,
Expand Down Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions waspc/test/Psl/Common/ModelTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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])
|]
Expand Down Expand Up @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions waspc/test/Psl/Parser/ArgumentTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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) =
Expand Down
6 changes: 6 additions & 0 deletions waspc/test/Psl/Parser/AttributeTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ spec_parseAttributePslPart = do
]
)
]
),
( "@default([])",
Psl.Attribute.Attribute
"default"
[ Psl.Argument.ArgUnnamed $ Psl.Argument.ArrayExpr []
]
)
]
runTestsFor attribute tests
Expand Down
12 changes: 11 additions & 1 deletion waspc/test/Psl/Parser/SchemaTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ spec_parsePslSchema = do
user User @relation(fields: [userId], references: [id])
userId Int
votes TaskVote[]
someField String[] @default([])
}

model TaskVote {
Expand Down Expand Up @@ -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 $
Expand Down
2 changes: 1 addition & 1 deletion web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?

Expand Down

0 comments on commit 6e219aa

Please sign in to comment.