From e69ca55a40525e819b8e27d10375d8f48ee71280 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Thu, 14 Apr 2022 10:38:14 +0200 Subject: [PATCH] fix(structure): format --- .gitlab-ci.yml | 3 +-- npmextra.json | 2 +- package.json | 2 +- test/plugins.ts | 4 +--- test/test.ts | 8 +++++--- ts/index.ts | 12 ++++++------ ts/paths.ts | 5 ++++- ts/smarts3.plugins.ts | 14 +++----------- 8 files changed, 22 insertions(+), 28 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a70f7eb..7b61eb3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 diff --git a/npmextra.json b/npmextra.json index a114460..257e2dd 100644 --- a/npmextra.json +++ b/npmextra.json @@ -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" diff --git a/package.json b/package.json index a5bf1a9..0eb2ca1 100644 --- a/package.json +++ b/package.json @@ -43,4 +43,4 @@ "@types/s3rver": "^3.7.0", "s3rver": "^3.7.1" } -} +} \ No newline at end of file diff --git a/test/plugins.ts b/test/plugins.ts index 98495ff..6044542 100644 --- a/test/plugins.ts +++ b/test/plugins.ts @@ -1,5 +1,3 @@ import * as smartbucket from '@pushrocks/smartbucket'; -export { - smartbucket -}; +export { smartbucket }; diff --git a/test/test.ts b/test/test.ts index a371b40..fe7d160 100644 --- a/test/test.ts +++ b/test/test.ts @@ -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(); diff --git a/ts/index.ts b/ts/index.ts index d0d6b98..a94e97a 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -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(); } -} \ No newline at end of file +} diff --git a/ts/paths.ts b/ts/paths.ts index 34f0bac..45dc911 100644 --- a/ts/paths.ts +++ b/ts/paths.ts @@ -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'); diff --git a/ts/smarts3.plugins.ts b/ts/smarts3.plugins.ts index 8e30153..ae578c5 100644 --- a/ts/smarts3.plugins.ts +++ b/ts/smarts3.plugins.ts @@ -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 -} \ No newline at end of file +export { s3rver };