-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: bump react peer dep and bunchee #1102
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
import * as S from "effect/Schema"; | ||
|
||
import type { Json } from "@uploadthing/shared"; | ||
import { ValidACLs, ValidContentDispositions } from "@uploadthing/shared"; | ||
|
||
export const ContentDispositionSchema = /** #__PURE__ */ S.Literal( | ||
...ValidContentDispositions, | ||
); | ||
export const ACLSchema = /** #__PURE__ */ S.Literal(...ValidACLs); | ||
|
||
/** | ||
* Valid options for the `?actionType` query param | ||
*/ | ||
export const ActionType = /** #__PURE__ */ S.Literal("upload"); | ||
|
||
/** | ||
* Valid options for the `uploadthing-hook` header | ||
* for requests coming from UT server | ||
*/ | ||
export const UploadThingHook = /** #__PURE__ */ S.Literal("callback", "error"); | ||
|
||
/** | ||
* ============================================================================= | ||
* =========================== Configuration =================================== | ||
* ============================================================================= | ||
*/ | ||
const DecodeString = /** #__PURE__ */ S.transform( | ||
S.Uint8ArrayFromSelf, | ||
S.String, | ||
{ | ||
decode: (data) => new TextDecoder().decode(data), | ||
encode: (data) => new TextEncoder().encode(data), | ||
}, | ||
); | ||
|
||
export const ParsedToken = /** #__PURE__ */ S.Struct({ | ||
apiKey: S.Redacted(S.String.pipe(S.startsWith("sk_"))), | ||
appId: S.String, | ||
regions: S.NonEmptyArray(S.String), | ||
ingestHost: S.String.pipe( | ||
S.optionalWith({ default: () => "ingest.uploadthing.com" }), | ||
), | ||
}); | ||
|
||
export const UploadThingToken = /** #__PURE__ */ S.Uint8ArrayFromBase64.pipe( | ||
S.compose(DecodeString), | ||
S.compose(S.parseJson(ParsedToken)), | ||
); | ||
|
||
/** | ||
* ============================================================================= | ||
* ======================== File Type Hierarchy =============================== | ||
* ============================================================================= | ||
*/ | ||
|
||
/** | ||
* Properties from the web File object, this is what the client sends when initiating an upload | ||
*/ | ||
export class FileUploadData | ||
extends /** #__PURE__ */ S.Class<FileUploadData>("FileUploadData")({ | ||
name: S.String, | ||
size: S.Number, | ||
type: S.String, | ||
lastModified: S.Number.pipe(S.optional), | ||
}) {} | ||
|
||
/** | ||
* `.middleware()` can add a customId to the incoming file data | ||
*/ | ||
export class FileUploadDataWithCustomId | ||
extends /** #__PURE__ */ FileUploadData.extend<FileUploadDataWithCustomId>( | ||
"FileUploadDataWithCustomId", | ||
)({ | ||
customId: S.NullOr(S.String), | ||
}) {} | ||
|
||
/** | ||
* When files are uploaded, we get back | ||
* - a key | ||
* - a direct URL for the file | ||
* - an app-specific URL for the file (useful for scoping eg. for optimization allowed origins) | ||
* - the hash (md5-hex) of the uploaded file's contents | ||
*/ | ||
export class UploadedFileData | ||
extends /** #__PURE__ */ FileUploadDataWithCustomId.extend<UploadedFileData>( | ||
"UploadedFileData", | ||
)({ | ||
key: S.String, | ||
url: S.String, | ||
appUrl: S.String, | ||
fileHash: S.String, | ||
}) {} | ||
|
||
/** | ||
* When the client has uploaded a file and polled for data returned by `.onUploadComplete()` | ||
*/ | ||
export interface ClientUploadedFileData<T> | ||
extends /** #__PURE__ */ UploadedFileData { | ||
/** | ||
* Matches what's returned from the serverside `onUploadComplete` callback | ||
*/ | ||
readonly serverData: T; | ||
} | ||
|
||
/** | ||
* ============================================================================= | ||
* ======================== Server Response Schemas ============================ | ||
* ============================================================================= | ||
*/ | ||
|
||
export class NewPresignedUrl | ||
extends /** #__PURE__ */ S.Class<NewPresignedUrl>("NewPresignedUrl")({ | ||
url: S.String, | ||
key: S.String, | ||
customId: S.NullOr(S.String), | ||
name: S.String, | ||
}) {} | ||
|
||
export class MetadataFetchStreamPart | ||
extends /** #__PURE__ */ S.Class<MetadataFetchStreamPart>( | ||
"MetadataFetchStreamPart", | ||
)({ | ||
payload: S.String, | ||
signature: S.String, | ||
hook: UploadThingHook, | ||
}) {} | ||
|
||
export class MetadataFetchResponse | ||
extends /** #__PURE__ */ S.Class<MetadataFetchResponse>( | ||
"MetadataFetchResponse", | ||
)({ | ||
ok: S.Boolean, | ||
}) {} | ||
|
||
export class CallbackResultResponse | ||
extends /** #__PURE__ */ S.Class<CallbackResultResponse>( | ||
"CallbackResultResponse", | ||
)({ | ||
ok: S.Boolean, | ||
}) {} | ||
|
||
/** | ||
* ============================================================================= | ||
* ======================== Client Action Payloads ============================ | ||
* ============================================================================= | ||
*/ | ||
|
||
export class UploadActionPayload | ||
extends /** #__PURE__ */ S.Class<UploadActionPayload>("UploadActionPayload")({ | ||
files: S.Array(FileUploadData), | ||
input: S.Unknown as S.Schema<Json>, | ||
}) {} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Keep the current version constraints for expo dependencies
Based on the codebase analysis, I recommend keeping the current version constraints instead of using "*" for the following reasons:
expo-constants
is imported inpackages/expo/src/index.ts
andexamples/minimal-expo/lib/trpc.tsx
expo-document-picker
is used inpackages/expo/src/document-picker.ts
expo-image-picker
is used inpackages/expo/src/image-picker.ts
The current version constraints in devDependencies are:
expo-constants
: ^15.4.5expo-document-picker
: ^12.0.1expo-image-picker
: ^15.0.4These provide a good balance between stability (minimum version) and flexibility (caret range for updates). Using "*" could lead to unexpected breaking changes as these packages have major version jumps (current latest versions are 17.0.3, 13.0.1, and 16.0.3 respectively).
🔗 Analysis chain
Consider maintaining version constraints for expo dependencies
Relaxing all expo peer dependencies to "*" removes version constraints which could lead to compatibility issues. Consider maintaining minimum version bounds while allowing flexibility for newer versions.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 689
Script:
Length of output: 13672