-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(build): do not inject missing generate targets as aliases (break…
…ing build)
- Loading branch information
Showing
11 changed files
with
146 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,7 @@ export default defineNuxtConfig({ | |
tailwindcss: { | ||
viewer: false, | ||
}, | ||
typescript: { | ||
includeWorkspace: true, | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { defineEventHandler, getQuery, isMethod, readBody } from 'h3' | ||
import { useEdgeDbQueries } from '#edgedb/server' | ||
import type { BlogPost } from '#edgedb/interfaces' | ||
|
||
export default defineEventHandler(async (req) => { | ||
const query = getQuery(req) | ||
const { insertBlogPost, allBlogPosts, deleteBlogPost, getBlogPost } = useEdgeDbQueries(req) | ||
|
||
if (isMethod(req, 'POST')) { | ||
const { | ||
title, | ||
description, | ||
content, | ||
} = await readBody(req) | ||
|
||
const blogPost = await insertBlogPost({ | ||
blogpost_title: title, | ||
blogpost_description: description, | ||
blogpost_content: content, | ||
}) | ||
|
||
return blogPost | ||
} | ||
|
||
if (isMethod(req, 'GET')) { | ||
if (query?.id) { | ||
const blogpost = await getBlogPost({ blogpost_id: query.id.toString() }) | ||
return blogpost as BlogPost | ||
} | ||
|
||
return await allBlogPosts() | ||
} | ||
|
||
if (isMethod(req, 'DELETE') && query?.id) { | ||
await deleteBlogPost({ blogpost_id: query.id.toString() }) | ||
return { deleted: query?.id } | ||
} | ||
}) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using extension auth; | ||
|
||
module default { | ||
global current_user := ( | ||
assert_single(( | ||
select User { id, name } | ||
filter .identity = global ext::auth::ClientTokenIdentity | ||
)) | ||
); | ||
|
||
type User { | ||
required name: str; | ||
required identity: ext::auth::Identity; | ||
multi link posts -> BlogPost { | ||
on source delete delete target; | ||
} | ||
} | ||
|
||
type BlogPost { | ||
property content: str { | ||
default := 'My super blog post.'; | ||
}; | ||
property description: str { | ||
default := 'My blog post description.'; | ||
}; | ||
property title: str { | ||
default := 'My blog super blog post title.'; | ||
}; | ||
required author: User { | ||
default := global current_user; | ||
}; | ||
access policy author_has_full_access | ||
allow all | ||
using (.author ?= global current_user); | ||
access policy others_read_only | ||
allow select; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module default { | ||
type BlogPost { | ||
property content: str { | ||
default := 'My super blog post.'; | ||
}; | ||
property description: str { | ||
default := 'My blog post description.'; | ||
}; | ||
property title: str { | ||
default := 'My blog super blog post title.'; | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
{ | ||
"extends": "./.nuxt/tsconfig.json" | ||
"extends": "./.nuxt/tsconfig.json", | ||
"references": [ | ||
{ | ||
"path": "./playground/.nuxt/tsconfig.server.json" | ||
} | ||
] | ||
} |