wasp/waspc/test/Parser/valid.wasp

77 lines
1.5 KiB
JavaScript
Raw Normal View History

2019-04-19 16:22:14 +03:00
// Test .wasp file.
import something from "@ext/some/file"
// App definition.
2019-04-19 16:22:14 +03:00
app test_app {
// Title of the app.
title: "Hello World!"
}
route "/" -> page Landing
page Landing {
component: import Landing from "@ext/pages/Landing"
2019-05-31 20:35:50 +03:00
}
route "/test" -> page TestPage
2019-05-31 20:35:50 +03:00
page TestPage {
component: import Test from "@ext/pages/Test"
}
2019-05-09 23:05:59 +03:00
entityPSL Task {=psl
id Int @id @default(autoincrement())
description String
isDone Boolean @default(false)
psl=}
// TODO(matija): old Entity stuff, to be removed.
2019-05-09 23:05:59 +03:00
entity Task {
description :: string,
isDone :: boolean
}
// NOTE(matija): this is only being parsed for now, no code is generated yet.
// Entity form definition.
entity-form<Task> CreateTaskForm {
fields: {
description: {
show: true,
defaultValue: "doable task",
label: none,
placeholder: "What will you do?"
},
isDone: {
show: false,
defaultValue: false // Although not shown, this field will be set to "false".
}
},
submit: {
onEnter: false,
button: {
show: true
}
}
}
entity-list<Task> TaskList {
showHeader: false,
fields: {
description: {
render: {=js
task => task.description
js=}
}
},
mutuallyExclusiveFilters: {
completed: {=js task => task.isDone js=},
active: {=js task => !task.isDone js=}
}
}
2020-08-25 16:08:02 +03:00
2020-08-25 16:08:02 +03:00
query myQuery {
fn: import { myJsQuery } from "@ext/some/path"
}