From f243ea8f8b903288a0f3659437d461825f0dfa98 Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Thu, 17 Oct 2024 14:33:13 +1100 Subject: [PATCH] add maxFileSize to examples --- examples/assets-local/keystone.ts | 4 ++++ examples/assets-local/package.json | 4 +++- examples/assets-s3/keystone.ts | 4 ++++ examples/assets-s3/package.json | 2 ++ pnpm-lock.yaml | 12 ++++++++++++ 5 files changed, 25 insertions(+), 1 deletion(-) diff --git a/examples/assets-local/keystone.ts b/examples/assets-local/keystone.ts index b23e6ef3915..de4cfc66bac 100644 --- a/examples/assets-local/keystone.ts +++ b/examples/assets-local/keystone.ts @@ -1,5 +1,6 @@ import { config } from '@keystone-6/core' import { lists } from './schema' +import bytes from 'bytes' export default config({ db: { @@ -10,6 +11,9 @@ export default config({ prismaClientPath: 'node_modules/myprisma', }, lists, + server: { + maxFileSize: bytes('40Mb') + }, storage: { my_images: { kind: 'local', diff --git a/examples/assets-local/package.json b/examples/assets-local/package.json index 7cec9e5c6b9..c16353c3f0b 100644 --- a/examples/assets-local/package.json +++ b/examples/assets-local/package.json @@ -11,9 +11,11 @@ }, "dependencies": { "@keystone-6/core": "^6.3.0", - "@prisma/client": "5.19.0" + "@prisma/client": "5.19.0", + "bytes": "^3.1.1" }, "devDependencies": { + "@types/bytes": "^3.1.1", "prisma": "5.19.0", "typescript": "^5.5.0" } diff --git a/examples/assets-s3/keystone.ts b/examples/assets-s3/keystone.ts index 08cacb24914..c317b20e4e5 100644 --- a/examples/assets-s3/keystone.ts +++ b/examples/assets-s3/keystone.ts @@ -1,6 +1,7 @@ import 'dotenv/config' import { config } from '@keystone-6/core' import { lists } from './schema' +import bytes from 'bytes' const { S3_BUCKET_NAME: bucketName = 'keystone-test', @@ -18,6 +19,9 @@ export default config({ prismaClientPath: 'node_modules/myprisma', }, lists, + server: { + maxFileSize: bytes('8Mb') + }, storage: { my_images: { kind: 's3', diff --git a/examples/assets-s3/package.json b/examples/assets-s3/package.json index 1ac5de3e87f..1f416c994d6 100644 --- a/examples/assets-s3/package.json +++ b/examples/assets-s3/package.json @@ -12,9 +12,11 @@ "dependencies": { "@keystone-6/core": "^6.3.0", "@prisma/client": "5.19.0", + "bytes": "^3.1.1", "dotenv": "^16.0.0" }, "devDependencies": { + "@types/bytes": "^3.1.1", "prisma": "5.19.0", "typescript": "^5.5.0" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 66744925e68..4ca794775ca 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -602,7 +602,13 @@ importers: '@prisma/client': specifier: 5.19.0 version: 5.19.0(prisma@5.19.0) + bytes: + specifier: ^3.1.1 + version: 3.1.2 devDependencies: + '@types/bytes': + specifier: ^3.1.1 + version: 3.1.4 prisma: specifier: 5.19.0 version: 5.19.0 @@ -618,10 +624,16 @@ importers: '@prisma/client': specifier: 5.19.0 version: 5.19.0(prisma@5.19.0) + bytes: + specifier: ^3.1.1 + version: 3.1.2 dotenv: specifier: ^16.0.0 version: 16.4.5 devDependencies: + '@types/bytes': + specifier: ^3.1.1 + version: 3.1.4 prisma: specifier: 5.19.0 version: 5.19.0