Skip to main content

Upgrading to version 2

Here are the following instruction to upgrade from version 1 to version 2.

Installation​

npm install typefs-s3-driver@^2.0.0

High Impact Changes​

Issue 210​

In order to keep bundle sizes and memory requirements to a minimum, disk drivers will live in separate npm packages. This ensures that you only build the disk drivers you use, which is important for deploying to on demand compute functions.

Breaking change​

The S3 driver has been moved from the type-fs package to typefs-s3-driver.

Solution​

If you are using the S3 disk driver, you will need to run

npm install typefs-s3-driver

then you must register the driver with the Storage manager.

// index.ts
import { Storage } from 'typefs';
import { S3Factory } from 'typefs-s3-driver';

Storage.registerDriver('s3', S3Factory));

Storage.config: Configuration = {
default: 's3',
disks: [
s3: {
driver: 's3',
root: '/',
jail: true,
"bucket": process.env.S3_BUCKET || 'my-s3-bucket',
"endPoint": process.env.S3_ENDPOINT || 's3.amazonaws.com',
"accessKey": process.env.S3_ACCESS_KEY || 'minio-access-key',
"secretKey": process.env.S3_SECRET_KEY || 'minio-secret-key',
}
]
// ...
}

Reference​

TDiskDriver Removed​

TDiskDriver has been removed from storage.ts.

Solution​

use DiskDriver instead

import { DiskDriver } from 'typefs-registry';

Type Definitions​

Type definitions have been moved to typefs-registry package.

Solution​

Update your imports