8 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
11 changed files with 4621 additions and 9326 deletions

View File

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

View File

@@ -5,7 +5,7 @@
"githost": "gitlab.com", "githost": "gitlab.com",
"gitscope": "pushrocks", "gitscope": "pushrocks",
"gitrepo": "smarts3", "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", "npmPackagename": "@pushrocks/smarts3",
"license": "MIT", "license": "MIT",
"projectDomain": "push.rocks" "projectDomain": "push.rocks"

13840
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smarts3", "name": "@pushrocks/smarts3",
"version": "2.0.0", "version": "2.1.1",
"private": false, "private": false,
"description": "create an s3 endpoint that maps to a local directory", "description": "create an s3 endpoint that maps to a local directory",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
@@ -10,16 +10,14 @@
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"test": "(tstest test/ --web)", "test": "(tstest test/ --web)",
"build": "(tsbuild --web)" "build": "(tsbuild --web --allowimplicitany)"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.61", "@gitzone/tsbuild": "^2.1.63",
"@gitzone/tsbundle": "^1.0.102", "@gitzone/tsbundle": "^2.0.6",
"@gitzone/tstest": "^1.0.70", "@gitzone/tstest": "^1.0.72",
"@pushrocks/tapbundle": "^5.0.3", "@pushrocks/tapbundle": "^5.0.4",
"@types/node": "^17.0.24", "@types/node": "^18.6.2"
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.15.0"
}, },
"browserslist": [ "browserslist": [
"last 1 chrome versions" "last 1 chrome versions"
@@ -37,8 +35,8 @@
"readme.md" "readme.md"
], ],
"dependencies": { "dependencies": {
"@pushrocks/smartbucket": "^2.0.1", "@pushrocks/smartbucket": "^2.0.2",
"@pushrocks/smartfile": "^9.0.6", "@pushrocks/smartfile": "^10.0.4",
"@pushrocks/smartpath": "^5.0.5", "@pushrocks/smartpath": "^5.0.5",
"@types/s3rver": "^3.7.0", "@types/s3rver": "^3.7.0",
"s3rver": "^3.7.1" "s3rver": "^3.7.1"

View File

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

View File

@@ -5,7 +5,7 @@ import * as smarts3 from '../ts/index.js';
let testSmarts3Instance: smarts3.Smarts3; 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({ testSmarts3Instance = await smarts3.Smarts3.createAndStart({
port: 3000, port: 3000,
cleanSlate: true, 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 () => { 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 bucket = await smartbucketInstance.createBucket('testbucket');
const baseDirectory = await bucket.getBaseDirectory(); const baseDirectory = await bucket.getBaseDirectory();
await baseDirectory.fastStore('subdir/hello.txt', 'hi there!'); 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 () => { tap.test('should stop the instance', async () => {
await testSmarts3Instance.stop(); await testSmarts3Instance.stop();
}) });
tap.start(); 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

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

View File

@@ -1,6 +1,11 @@
import * as plugins from './smarts3.plugins.js'; 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 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,24 +1,16 @@
// node native // node native
import * as path from 'path'; import * as path from 'path';
export { export { path };
path
}
// pushrocks scope // pushrocks scope
import * as smartbucket from '@pushrocks/smartbucket'; import * as smartbucket from '@pushrocks/smartbucket';
import * as smartfile from '@pushrocks/smartfile'; import * as smartfile from '@pushrocks/smartfile';
import * as smartpath from '@pushrocks/smartpath'; import * as smartpath from '@pushrocks/smartpath';
export { export { smartbucket, smartfile, smartpath };
smartbucket,
smartfile,
smartpath
}
// thirdparty scope // thirdparty scope
import s3rver from 's3rver'; import s3rver from 's3rver';
export { export { s3rver };
s3rver
}

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"
}