Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/db/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"dependencies": {
"@init/env": "workspace:*",
"@init/observability": "workspace:*",
"@init/storage": "workspace:*",
"@init/utils": "workspace:*",
"drizzle-orm": "0.45.1",
"drizzle-zod": "0.8.3"
Expand Down
3 changes: 2 additions & 1 deletion packages/db/src/schema.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { MimeType, StorageBucket } from "@init/utils/constants"
import type { StorageBucket } from "@init/storage/buckets"
import type { MimeType } from "@init/storage/helpers"
import type { ConstrainedString } from "@init/utils/type"
import { createIdGenerator } from "@init/utils/id"
import * as z from "@init/utils/schema"
Expand Down
3 changes: 2 additions & 1 deletion packages/storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"type": "module",
"exports": {
"./client": "./src/client.ts",
"./helpers": "./src/helpers.ts"
"./helpers": "./src/helpers.ts",
"./buckets": "./src/buckets.ts"
},
"scripts": {
"clean": "git clean -xdf .cache .turbo dist node_modules",
Expand Down
7 changes: 7 additions & 0 deletions packages/storage/src/buckets.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const StorageBucket = {
MAIN: "init-main",
TEMP: "init-temp",
} as const

export const STORAGE_BUCKETS = Object.values(StorageBucket)
export type StorageBucket = (typeof STORAGE_BUCKETS)[number]
2 changes: 1 addition & 1 deletion packages/storage/src/client.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { StorageBucket } from "@init/utils/constants"
import type { StorageBucket } from "@init/storage/buckets"
import { s3 as s3Env } from "@init/env/presets"
import { S3Client, type S3Options } from "bun"

Expand Down
6 changes: 5 additions & 1 deletion packages/storage/src/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import type { MimeType, MimeTypeExtension, MimeTypeExtensions } from "@init/utils/constants"
import type standardTypes from "mime/types/standard.js"
import mime from "mime/lite"

export type MimeType = keyof typeof standardTypes
export type MimeTypeExtension<T extends MimeType> = (typeof standardTypes)[T][0]
export type MimeTypeExtensions<T extends MimeType> = (typeof standardTypes)[T][number]

export function getMimeType(filename: string): MimeType {
return mime.getType(filename) as MimeType
}
Expand Down
13 changes: 0 additions & 13 deletions packages/utils/src/constants/asset.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/utils/src/constants/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from "#constants/app.ts"
export * from "#constants/asset.ts"