fix(structure): format

This commit is contained in:
Philipp Kunz 2022-04-14 10:38:14 +02:00
parent 5803ef597f
commit e69ca55a40
8 changed files with 22 additions and 28 deletions

View File

@ -100,10 +100,9 @@ codequality:
only:
- tags
script:
- npmci command npm install -g tslint typescript
- npmci command npm install -g typescript
- npmci npm prepare
- npmci npm install
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
tags:
- lossless
- docker

View File

@ -5,7 +5,7 @@
"githost": "gitlab.com",
"gitscope": "pushrocks",
"gitrepo": "smarts3",
"shortDescription": "create an s3 endpoint that maps to a local directory",
"description": "create an s3 endpoint that maps to a local directory",
"npmPackagename": "@pushrocks/smarts3",
"license": "MIT",
"projectDomain": "push.rocks"

View File

@ -43,4 +43,4 @@
"@types/s3rver": "^3.7.0",
"s3rver": "^3.7.1"
}
}
}

View File

@ -1,5 +1,3 @@
import * as smartbucket from '@pushrocks/smartbucket';
export {
smartbucket
};
export { smartbucket };

View File

@ -5,7 +5,7 @@ import * as smarts3 from '../ts/index.js';
let testSmarts3Instance: smarts3.Smarts3;
tap.test('should create a smarts3 instance and run it', async toolsArg => {
tap.test('should create a smarts3 instance and run it', async (toolsArg) => {
testSmarts3Instance = await smarts3.Smarts3.createAndStart({
port: 3000,
cleanSlate: true,
@ -15,7 +15,9 @@ tap.test('should create a smarts3 instance and run it', async toolsArg => {
});
tap.test('should be able to access buckets', async () => {
const smartbucketInstance = new plugins.smartbucket.SmartBucket(await testSmarts3Instance.getS3Descriptor());
const smartbucketInstance = new plugins.smartbucket.SmartBucket(
await testSmarts3Instance.getS3Descriptor()
);
const bucket = await smartbucketInstance.createBucket('testbucket');
const baseDirectory = await bucket.getBaseDirectory();
await baseDirectory.fastStore('subdir/hello.txt', 'hi there!');
@ -23,6 +25,6 @@ tap.test('should be able to access buckets', async () => {
tap.test('should stop the instance', async () => {
await testSmarts3Instance.stop();
})
});
tap.start();

View File

@ -22,8 +22,8 @@ export class Smarts3 {
this.options = optionsArg;
this.options = {
...this.options,
...optionsArg
}
...optionsArg,
};
}
public async start() {
@ -36,8 +36,8 @@ export class Smarts3 {
port: this.options.port || 3000,
address: '0.0.0.0',
silent: false,
directory: paths.bucketsDir
})
directory: paths.bucketsDir,
});
await this.s3Instance.run();
console.log('s3 server is running');
}
@ -49,7 +49,7 @@ export class Smarts3 {
endpoint: 'localhost',
port: this.options.port,
useSsl: false,
}
};
}
public async createBucket(bucketNameArg: string) {
@ -61,4 +61,4 @@ export class Smarts3 {
public async stop() {
await this.s3Instance.close();
}
}
}

View File

@ -1,6 +1,9 @@
import * as plugins from './smarts3.plugins.js';
export const packageDir = plugins.path.join(plugins.smartpath.get.dirnameFromImportMetaUrl(import.meta.url), '../');
export const packageDir = plugins.path.join(
plugins.smartpath.get.dirnameFromImportMetaUrl(import.meta.url),
'../'
);
export const nogitDir = plugins.path.join(packageDir, './.nogit');
export const bucketsDir = plugins.path.join(nogitDir, './bucketsDir');

View File

@ -1,24 +1,16 @@
// node native
import * as path from 'path';
export {
path
}
export { path };
// pushrocks scope
import * as smartbucket from '@pushrocks/smartbucket';
import * as smartfile from '@pushrocks/smartfile';
import * as smartpath from '@pushrocks/smartpath';
export {
smartbucket,
smartfile,
smartpath
}
export { smartbucket, smartfile, smartpath };
// thirdparty scope
import s3rver from 's3rver';
export {
s3rver
}
export { s3rver };