File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 26
26
uses : pnpm/action-setup@v2
27
27
with :
28
28
version : 8
29
+ - name : Get pnpm store directory
30
+ shell : bash
31
+ run : |
32
+ echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
33
+ - uses : actions/cache@v3
34
+ name : Setup pnpm cache
35
+ with :
36
+ path : ${{ env.STORE_PATH }}
37
+ key : ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
38
+ restore-keys : |
39
+ ${{ runner.os }}-pnpm-store-
40
+ - name : Install dependencies
41
+ run : " pnpm install"
29
42
- name : Build step
30
- run : " pnpm i && npx nuxt build --preset=deno_deploy"
43
+ run : " npx nuxt build --preset=deno_deploy"
31
44
env :
32
45
NUXT_UI_PRO_LICENSE : ${{ secrets.NUXT_UI_PRO_LICENSE }}
33
46
- name : Upload to Deno Deploy
Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ async function listTodos(kv: Kv, listId: string) {
5
5
const iter = await kv . list ( { prefix : [ 'list' , listId ] } , { consistency : 'strong' } )
6
6
const todos = [ ]
7
7
for await ( const todo of iter ) todos . push ( todo . value )
8
+
9
+ todos . sort ( ( a , b ) => new Date ( b . createdAt ) - new Date ( a . createdAt ) )
8
10
return todos
9
11
}
10
12
Original file line number Diff line number Diff line change @@ -7,4 +7,8 @@ export const useKv = async () => {
7
7
const { openKv } = await OpenKV ( )
8
8
return openKv ( 'kv.db' )
9
9
}
10
+ throw createError ( {
11
+ statusCode : 500 ,
12
+ message : 'Could not find a Deno KV for production, make sure to deploy on Deno Deploy.'
13
+ } )
10
14
}
You can’t perform that action at this time.
0 commit comments