10 Commits

Author SHA1 Message Date
a4c9679ccc 2.1.1 2022-07-30 15:50:38 +02:00
b16cfe0aac fix(core): remove tslint 2022-07-30 15:50:38 +02:00
976f9ba8ca 2.1.0 2022-07-30 15:49:46 +02:00
67c4f71a24 feat(fix bucket creation to be locally in the .nogit dir): update 2022-07-30 15:49:46 +02:00
dfadca9b80 2.0.2 2022-04-14 10:55:07 +02:00
a7579d2e12 fix(core): update 2022-04-14 10:55:07 +02:00
de4632d186 2.0.1 2022-04-14 10:38:14 +02:00
e69ca55a40 fix(structure): format 2022-04-14 10:38:14 +02:00
5803ef597f 2.0.0 2022-04-14 10:36:24 +02:00
0bb6bfbb37 BREAKING CHANGE(core): switch to esm 2022-04-14 10:36:24 +02:00
12 changed files with 5657 additions and 17661 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"

23200
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,24 +1,23 @@
{
"name": "@pushrocks/smarts3",
"version": "1.0.10",
"version": "2.1.1",
"private": false,
"description": "create an s3 endpoint that maps to a local directory",
"main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts",
"type": "module",
"author": "Lossless GmbH",
"license": "MIT",
"scripts": {
"test": "(tstest test/ --web)",
"build": "(tsbuild --web)"
"build": "(tsbuild --web --allowimplicitany)"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.1.25",
"@gitzone/tsbundle": "^1.0.78",
"@gitzone/tstest": "^1.0.44",
"@pushrocks/tapbundle": "^3.2.9",
"@types/node": "^17.0.0",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.15.0"
"@gitzone/tsbuild": "^2.1.63",
"@gitzone/tsbundle": "^2.0.6",
"@gitzone/tstest": "^1.0.72",
"@pushrocks/tapbundle": "^5.0.4",
"@types/node": "^18.6.2"
},
"browserslist": [
"last 1 chrome versions"
@ -36,8 +35,9 @@
"readme.md"
],
"dependencies": {
"@pushrocks/smartbucket": "^1.0.44",
"@pushrocks/smartfile": "^9.0.3",
"@pushrocks/smartbucket": "^2.0.2",
"@pushrocks/smartfile": "^10.0.4",
"@pushrocks/smartpath": "^5.0.5",
"@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

@ -1,11 +1,11 @@
import { expect, tap } from '@pushrocks/tapbundle';
import * as plugins from './plugins';
import * as plugins from './plugins.js';
import * as smarts3 from '../ts/index';
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();

8
ts/00_commitinfo_data.ts Normal file
View File

@ -0,0 +1,8 @@
/**
* autocreated commitinfo by @pushrocks/commitinfo
*/
export const commitinfo = {
name: '@pushrocks/smarts3',
version: '2.1.1',
description: 'create an s3 endpoint that maps to a local directory'
}

View File

@ -1,5 +1,5 @@
import * as plugins from './smarts3.plugins';
import * as paths from './paths';
import * as plugins from './smarts3.plugins.js';
import * as paths from './paths.js';
export interface ISmarts3ContructorOptions {
port?: number;
@ -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,11 @@
import * as plugins from './smarts3.plugins';
import * as plugins from './smarts3.plugins.js';
export const packageDir = plugins.path.join(__dirname, '../');
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');
export const cwd = process.cwd();
export const bucketsDir = plugins.path.join(cwd, '.nogit/bucketsDir');

View File

@ -1,22 +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,
}
export { smartbucket, smartfile, smartpath };
// thirdparty scope
import s3rver from 's3rver';
export {
s3rver
}
export { s3rver };

9
tsconfig.json Normal file
View File

@ -0,0 +1,9 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "nodenext"
}
}

View File

@ -1,17 +0,0 @@
{
"extends": ["tslint:latest", "tslint-config-prettier"],
"rules": {
"semicolon": [true, "always"],
"no-console": false,
"ordered-imports": false,
"object-literal-sort-keys": false,
"member-ordering": {
"options":{
"order": [
"static-method"
]
}
}
},
"defaultSeverity": "warning"
}