fix(structure): format
This commit is contained in:
		| @@ -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 | ||||
|   | ||||
| @@ -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" | ||||
|   | ||||
| @@ -43,4 +43,4 @@ | ||||
|     "@types/s3rver": "^3.7.0", | ||||
|     "s3rver": "^3.7.1" | ||||
|   } | ||||
| } | ||||
| } | ||||
| @@ -1,5 +1,3 @@ | ||||
| import * as smartbucket from '@pushrocks/smartbucket'; | ||||
|  | ||||
| export { | ||||
|   smartbucket | ||||
| }; | ||||
| export { smartbucket }; | ||||
|   | ||||
| @@ -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(); | ||||
|   | ||||
							
								
								
									
										12
									
								
								ts/index.ts
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								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(); | ||||
|   } | ||||
| } | ||||
| } | ||||
|   | ||||
| @@ -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'); | ||||
|   | ||||
| @@ -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 }; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user