Skip to content

Commit

Permalink
chore: Recreate StorageAccessLevel type and remove amplify/core peerD…
Browse files Browse the repository at this point in the history
…ep from… (#5867)
  • Loading branch information
esauerbo authored Oct 7, 2024
1 parent 0d86485 commit bbe4ca0
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changeset/shiny-chairs-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@aws-amplify/ui-react-storage": patch
---

chore: Manually recreate `StorageAccessLevel` type and remove `@aws-amplify/core` peerDep from ui-react-storage package.
1 change: 0 additions & 1 deletion packages/react-storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"tslib": "^2.5.2"
},
"peerDependencies": {
"@aws-amplify/core": "*",
"aws-amplify": "^6.6.0",
"react": "^16.14.0 || ^17.0 || ^18.0",
"react-dom": "^16.14.0 || ^17.0 || ^18.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/react-storage/src/components/FileUploader/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import * as React from 'react';

import type { StorageAccessLevel } from '@aws-amplify/core';

import {
ContainerProps,
DropZoneProps,
Expand Down Expand Up @@ -52,6 +50,8 @@ export interface FileUploaderHandle {
clearFiles: () => void;
}

export type StorageAccessLevel = 'guest' | 'protected' | 'private';

export interface FileUploaderProps {
/**
* List of accepted File types, values of `['*']` or undefined allow any files
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { fetchAuthSession } from 'aws-amplify/auth';
import { StorageAccessLevel } from '@aws-amplify/core';
import { UploadDataWithPathInput, UploadDataInput } from 'aws-amplify/storage';

import { isString, isFunction } from '@aws-amplify/ui';

import { ProcessFile } from '../types';
import { ProcessFile, StorageAccessLevel } from '../types';
import { resolveFile } from './resolveFile';
import { PathCallback, PathInput } from './uploadFile';

Expand Down
3 changes: 2 additions & 1 deletion packages/react-storage/src/components/StorageImage/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { StorageAccessLevel } from '@aws-amplify/core';
import { ImageProps } from '@aws-amplify/ui-react';

type StorageAccessLevel = 'guest' | 'protected' | 'private';

export interface StorageImageProps extends Omit<ImageProps, 'src'> {
// Use imgKey instead of key because key is a reserved keyword
// and cannot be accessed via props in React components
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import * as React from 'react';

import type { StorageAccessLevel } from '@aws-amplify/core';

import { FileStatus } from '../FileUploader/types';
import { FileStatus, StorageAccessLevel } from '../FileUploader/types';
import {
FileUploaderDisplayText as StorageManagerDisplayText,
PathCallback,
Expand Down

0 comments on commit bbe4ca0

Please sign in to comment.