Skip to content

refactor: move storage types from utils to storage package#95

Merged
adelrodriguez merged 1 commit intomainfrom
02-18-refactor_move_storage_types_from_utils_to_storage_package
Feb 19, 2026
Merged

refactor: move storage types from utils to storage package#95
adelrodriguez merged 1 commit intomainfrom
02-18-refactor_move_storage_types_from_utils_to_storage_package

Conversation

@adelrodriguez
Copy link
Collaborator

@adelrodriguez adelrodriguez commented Feb 19, 2026

Greptile Summary

Moved storage-related type definitions (StorageBucket, MimeType, and related types) from @init/utils/constants to @init/storage package for better modularity and separation of concerns.

  • Created new packages/storage/src/buckets.ts with StorageBucket constant and type
  • Moved MimeType types to packages/storage/src/helpers.ts
  • Updated imports in @init/db and @init/storage packages to reference new locations
  • Removed packages/utils/src/constants/asset.ts file
  • Added @init/storage dependency to @init/db package

This refactoring improves package organization by placing storage-specific types closer to their usage context.

Confidence Score: 5/5

  • This PR is safe to merge with no concerns
  • Clean refactoring that moves types to more appropriate package locations, all imports updated correctly, no remaining references to old paths, and no circular dependencies introduced
  • No files require special attention

Important Files Changed

Filename Overview
packages/storage/src/buckets.ts New file created with StorageBucket constant and type definitions moved from utils package
packages/storage/src/helpers.ts Added MimeType type definitions moved from utils package, imports are correctly placed
packages/storage/src/client.ts Updated import path from @init/utils/constants to @init/storage/buckets
packages/db/src/schema.ts Updated imports to use new storage package paths for StorageBucket and MimeType

Flowchart

%%{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| C
Loading

Last reviewed commit: 68bf454

@coderabbitai
Copy link

coderabbitai bot commented Feb 19, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 02-18-refactor_move_storage_types_from_utils_to_storage_package

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines 1 to 6
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"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import placed after type definitions

Suggested change
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.

@adelrodriguez adelrodriguez force-pushed the 02-18-refactor_replace_better-result_with_faultier_for_error_handling branch from ef7ac57 to 7507d4a Compare February 19, 2026 03:25
@adelrodriguez adelrodriguez force-pushed the 02-18-refactor_move_storage_types_from_utils_to_storage_package branch from fda02a8 to 351fcfe Compare February 19, 2026 03:26
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines 1 to 6
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"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import statement placed after type definitions

Suggested change
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.

@adelrodriguez adelrodriguez force-pushed the 02-18-refactor_replace_better-result_with_faultier_for_error_handling branch from 7507d4a to b8577bc Compare February 19, 2026 03:29
@adelrodriguez adelrodriguez force-pushed the 02-18-refactor_move_storage_types_from_utils_to_storage_package branch from 351fcfe to 4e09225 Compare February 19, 2026 03:29
@adelrodriguez adelrodriguez force-pushed the 02-18-refactor_replace_better-result_with_faultier_for_error_handling branch from b8577bc to 3f35747 Compare February 19, 2026 03:33
@adelrodriguez adelrodriguez force-pushed the 02-18-refactor_move_storage_types_from_utils_to_storage_package branch from 4e09225 to 1593a41 Compare February 19, 2026 03:33
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

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"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import statement should be placed before type definitions

Suggested change
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.

@adelrodriguez adelrodriguez force-pushed the 02-18-refactor_replace_better-result_with_faultier_for_error_handling branch from 3f35747 to 194a280 Compare February 19, 2026 03:38
@adelrodriguez adelrodriguez force-pushed the 02-18-refactor_move_storage_types_from_utils_to_storage_package branch from 1593a41 to eb6f009 Compare February 19, 2026 03:38
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

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"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import should be at the top of the file, before type definitions

Suggested change
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.

@adelrodriguez adelrodriguez force-pushed the 02-18-refactor_replace_better-result_with_faultier_for_error_handling branch from 194a280 to 82e83d3 Compare February 19, 2026 03:52
@adelrodriguez adelrodriguez changed the base branch from 02-18-refactor_replace_better-result_with_faultier_for_error_handling to graphite-base/95 February 19, 2026 03:53
@adelrodriguez adelrodriguez force-pushed the 02-18-refactor_move_storage_types_from_utils_to_storage_package branch 2 times, most recently from cbaf5a1 to c8a3d5d Compare February 19, 2026 03:53
@graphite-app graphite-app bot changed the base branch from graphite-base/95 to 02-18-refactor_replace_better-result_with_faultier_for_error_handling February 19, 2026 03:53
@adelrodriguez adelrodriguez changed the base branch from 02-18-refactor_replace_better-result_with_faultier_for_error_handling to graphite-base/95 February 19, 2026 03:58
@adelrodriguez adelrodriguez force-pushed the 02-18-refactor_move_storage_types_from_utils_to_storage_package branch from c8a3d5d to 025d97b Compare February 19, 2026 03:59
@adelrodriguez adelrodriguez force-pushed the 02-18-refactor_move_storage_types_from_utils_to_storage_package branch from 025d97b to 407dc33 Compare February 19, 2026 03:59
@adelrodriguez adelrodriguez changed the base branch from graphite-base/95 to main February 19, 2026 03:59
@adelrodriguez adelrodriguez force-pushed the 02-18-refactor_move_storage_types_from_utils_to_storage_package branch from 407dc33 to 100bcd4 Compare February 19, 2026 03:59
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

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"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import should be moved to the top before type definitions

Suggested change
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.

@adelrodriguez adelrodriguez force-pushed the 02-18-refactor_move_storage_types_from_utils_to_storage_package branch from 100bcd4 to 68bf454 Compare February 19, 2026 04:07
@adelrodriguez adelrodriguez merged commit 2f9f03c into main Feb 19, 2026
8 checks passed
@adelrodriguez adelrodriguez deleted the 02-18-refactor_move_storage_types_from_utils_to_storage_package branch February 19, 2026 04:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments