refactor: move storage types from utils to storage package#95
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
packages/storage/src/helpers.ts
Outdated
| import type standardTypes from "mime/types/standard.js" | ||
|
|
||
| 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] | ||
| import mime from "mime/lite" |
There was a problem hiding this comment.
import placed after type definitions
| import type standardTypes from "mime/types/standard.js" | |
| 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] | |
| import mime from "mime/lite" | |
| 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] |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/storage/src/helpers.ts
Line: 1-6
Comment:
import placed after type definitions
```suggestion
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]
```
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.ef7ac57 to
7507d4a
Compare
fda02a8 to
351fcfe
Compare
packages/storage/src/helpers.ts
Outdated
| import type standardTypes from "mime/types/standard.js" | ||
|
|
||
| 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] | ||
| import mime from "mime/lite" |
There was a problem hiding this comment.
import statement placed after type definitions
| import type standardTypes from "mime/types/standard.js" | |
| 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] | |
| import mime from "mime/lite" | |
| 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] |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/storage/src/helpers.ts
Line: 1-6
Comment:
import statement placed after type definitions
```suggestion
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]
```
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.7507d4a to
b8577bc
Compare
351fcfe to
4e09225
Compare
b8577bc to
3f35747
Compare
4e09225 to
1593a41
Compare
packages/storage/src/helpers.ts
Outdated
| 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] | ||
| import mime from "mime/lite" |
There was a problem hiding this comment.
Import statement should be placed before type definitions
| import mime from "mime/lite" | |
| 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] |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/storage/src/helpers.ts
Line: 6
Comment:
Import statement should be placed before type definitions
```suggestion
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]
```
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.3f35747 to
194a280
Compare
1593a41 to
eb6f009
Compare
packages/storage/src/helpers.ts
Outdated
| 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] | ||
| import mime from "mime/lite" |
There was a problem hiding this comment.
import should be at the top of the file, before type definitions
| import mime from "mime/lite" | |
| 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] |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/storage/src/helpers.ts
Line: 6
Comment:
import should be at the top of the file, before type definitions
```suggestion
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]
```
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.194a280 to
82e83d3
Compare
194a280 to
39ff9b8
Compare
cbaf5a1 to
c8a3d5d
Compare
39ff9b8 to
ae5df0e
Compare
c8a3d5d to
025d97b
Compare
ae5df0e to
562f8f7
Compare
025d97b to
407dc33
Compare
407dc33 to
100bcd4
Compare
packages/storage/src/helpers.ts
Outdated
| 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] | ||
| import mime from "mime/lite" |
There was a problem hiding this comment.
import should be moved to the top before type definitions
| import mime from "mime/lite" | |
| 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] |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/storage/src/helpers.ts
Line: 6
Comment:
import should be moved to the top before type definitions
```suggestion
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]
```
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.100bcd4 to
68bf454
Compare

Greptile Summary
Moved storage-related type definitions (
StorageBucket,MimeType, and related types) from@init/utils/constantsto@init/storagepackage for better modularity and separation of concerns.packages/storage/src/buckets.tswithStorageBucketconstant and typeMimeTypetypes topackages/storage/src/helpers.ts@init/dband@init/storagepackages to reference new locationspackages/utils/src/constants/asset.tsfile@init/storagedependency to@init/dbpackageThis refactoring improves package organization by placing storage-specific types closer to their usage context.
Confidence Score: 5/5
Important Files Changed
StorageBucketconstant and type definitions moved from utils packageMimeTypetype definitions moved from utils package, imports are correctly placed@init/utils/constantsto@init/storage/bucketsStorageBucketandMimeTypeFlowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[utils/constants/asset.ts] -->|Deleted| B[Storage Types Moved] B --> C[storage/buckets.ts] B --> D[storage/helpers.ts] C -->|exports StorageBucket| E[storage/client.ts] C -->|exports StorageBucket| F[db/schema.ts] D -->|exports MimeType| F G[db/package.json] -->|adds dependency| H[storage package] I[storage/package.json] -->|adds export| CLast reviewed commit: 68bf454