From 701f41c95b473ed3d04787e1d7083ba2f6c6ff0c Mon Sep 17 00:00:00 2001 From: hassansuhaib Date: Sat, 26 Aug 2023 10:17:56 +0500 Subject: [PATCH] Moved fs to src folder Registered azure fs driver Exported azure fs package --- packages/cli/src/fs.ts | 6 ++++++ packages/driver-azure/src/{driver => }/fs/index.ts | 2 +- packages/driver-azure/src/index.ts | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) rename packages/driver-azure/src/{driver => }/fs/index.ts (98%) diff --git a/packages/cli/src/fs.ts b/packages/cli/src/fs.ts index ec5a1d9a..dddefe2d 100644 --- a/packages/cli/src/fs.ts +++ b/packages/cli/src/fs.ts @@ -1,6 +1,7 @@ import { fsTypeFromUrl, localFsFromUrl } from '@preevy/core' import { googleCloudStorageFs } from '@preevy/driver-gce' import { s3fs } from '@preevy/driver-lightsail' +import { azureStorageBlobFs } from '@preevy/driver-azure' export const fsFromUrl = async (url: string, localBaseDir: string) => { const fsType = fsTypeFromUrl(url) @@ -17,5 +18,10 @@ export const fsFromUrl = async (url: string, localBaseDir: string) => { // eslint-disable-next-line @typescript-eslint/return-await return await googleCloudStorageFs(url) } + if (fsType === 'az') { + // eslint false positive here on case-sensitive filesystems due to unknown type + // eslint-disable-next-line @typescript-eslint/return-await + return await azureStorageBlobFs(url) + } throw new Error(`Unsupported URL type: ${fsType}`) } diff --git a/packages/driver-azure/src/driver/fs/index.ts b/packages/driver-azure/src/fs/index.ts similarity index 98% rename from packages/driver-azure/src/driver/fs/index.ts rename to packages/driver-azure/src/fs/index.ts index 360df3eb..947d6dfb 100644 --- a/packages/driver-azure/src/driver/fs/index.ts +++ b/packages/driver-azure/src/fs/index.ts @@ -3,7 +3,7 @@ import { VirtualFS } from '@preevy/core' export const defaultBucketName = ( { profileAlias, accountId }: { profileAlias: string; accountId: string }, -) => `preevy-${accountId}-${profileAlias}` +) => `preevy-${accountId}-${profileAlias}` const ensureBucketExists = async (blobServiceClient: BlobServiceClient, containerName: string) => { const containerClient: ContainerClient = blobServiceClient.getContainerClient(containerName) diff --git a/packages/driver-azure/src/index.ts b/packages/driver-azure/src/index.ts index 546c88ee..6802b160 100644 --- a/packages/driver-azure/src/index.ts +++ b/packages/driver-azure/src/index.ts @@ -1,3 +1,4 @@ import azure from './driver' export default azure +export { azureStorageBlobFs, defaultBucketName } from './fs'