diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9a4467e..a70f7eb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,6 +12,9 @@ stages: - release - metadata +before_script: + - npm install -g @shipzone/npmci + # ==================== # security stage # ==================== @@ -36,6 +39,7 @@ auditProductionDependencies: - npmci command npm audit --audit-level=high --only=prod --production tags: - docker + allow_failure: true auditDevDependencies: image: registry.gitlab.com/hosttoday/ht-docker-node:npmci diff --git a/.vscode/launch.json b/.vscode/launch.json index 112db52..26e9f92 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -2,28 +2,10 @@ "version": "0.2.0", "configurations": [ { - "name": "current file", - "type": "node", + "command": "npm test", + "name": "Run npm test", "request": "launch", - "args": [ - "${relativeFile}" - ], - "runtimeArgs": ["-r", "@gitzone/tsrun"], - "cwd": "${workspaceRoot}", - "protocol": "inspector", - "internalConsoleOptions": "openOnSessionStart" - }, - { - "name": "test.ts", - "type": "node", - "request": "launch", - "args": [ - "test/test.ts" - ], - "runtimeArgs": ["-r", "@gitzone/tsrun"], - "cwd": "${workspaceRoot}", - "protocol": "inspector", - "internalConsoleOptions": "openOnSessionStart" + "type": "node-terminal" } ] } diff --git a/npmextra.json b/npmextra.json index d28b958..5ba0f76 100644 --- a/npmextra.json +++ b/npmextra.json @@ -14,7 +14,7 @@ "githost": "gitlab.com", "gitscope": "pushrocks", "gitrepo": "smartfile", - "shortDescription": "smart ways to work with files in nodejs", + "description": "smart ways to work with files in nodejs", "npmPackagename": "@pushrocks/smartfile", "license": "MIT" } diff --git a/package.json b/package.json index 68a9dd4..bfebe39 100644 --- a/package.json +++ b/package.json @@ -65,4 +65,4 @@ "browserslist": [ "last 1 chrome versions" ] -} +} \ No newline at end of file diff --git a/test/test.ts b/test/test.ts index 5d127a9..151aecf 100644 --- a/test/test.ts +++ b/test/test.ts @@ -214,7 +214,7 @@ tap.test('should create, store and retrieve valid smartfiles', async () => { }); tap.test('should wait for file to be ready', async () => { - await smartfile.fs.waitForFileToBeReady('./test/testassets/mytest.json') -}) + await smartfile.fs.waitForFileToBeReady('./test/testassets/mytest.json'); +}); tap.start(); diff --git a/test/test.virtualdirectory.ts b/test/test.virtualdirectory.ts index ad32974..815bae1 100644 --- a/test/test.virtualdirectory.ts +++ b/test/test.virtualdirectory.ts @@ -12,4 +12,4 @@ tap.test('should write to a directory', async () => { virtualDir.saveToDisk('./test/testassets/test'); }); -tap.start(); \ No newline at end of file +tap.start(); diff --git a/ts/index.ts b/ts/index.ts index 4db01f6..833cc07 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -6,7 +6,6 @@ import * as memoryMod from './smartfile.memory'; export { Smartfile, ISmartfileConstructorOptions } from './smartfile.classes.smartfile'; export { VirtualDirectory } from './smartfile.classes.virtualdirectory'; - export let fs = fsMod; export let interpreter = interpreterMod; export let memory = memoryMod; diff --git a/ts/smartfile.classes.smartfile.ts b/ts/smartfile.classes.smartfile.ts index 9e9253e..fe970e2 100644 --- a/ts/smartfile.classes.smartfile.ts +++ b/ts/smartfile.classes.smartfile.ts @@ -77,10 +77,10 @@ export class Smartfile extends plugins.smartjson.Smartjson { /** * a parsed path */ - public get parsedPath (): plugins.path.ParsedPath { + public get parsedPath(): plugins.path.ParsedPath { return plugins.path.parse(this.path); - }; - public get absolutePath () { + } + public get absolutePath() { return plugins.path.join(this.base, this.path); } diff --git a/ts/smartfile.classes.virtualdirectory.ts b/ts/smartfile.classes.virtualdirectory.ts index ae1dc15..06b6f69 100644 --- a/ts/smartfile.classes.virtualdirectory.ts +++ b/ts/smartfile.classes.virtualdirectory.ts @@ -42,7 +42,7 @@ export class VirtualDirectory { public async toVirtualDirTransferableObject(): Promise { return { - files: this.smartfileArray.map(smartfileArg => smartfileArg.foldToJson()) + files: this.smartfileArray.map((smartfileArg) => smartfileArg.foldToJson()), }; } diff --git a/ts/smartfile.fs.ts b/ts/smartfile.fs.ts index 602fb57..428ea7c 100644 --- a/ts/smartfile.fs.ts +++ b/ts/smartfile.fs.ts @@ -388,7 +388,10 @@ export const waitForFileToBeReady = async (filePathArg: string): Promise = limitedArray.addOne(stats.size); if ( limitedArray.array.length < 3 || - !(limitedArray.array[0] === limitedArray.array[1] && limitedArray.array[1] === limitedArray.array[2]) + !( + limitedArray.array[0] === limitedArray.array[1] && + limitedArray.array[1] === limitedArray.array[2] + ) ) { await plugins.smartdelay.delayFor(5000); } else { diff --git a/ts/smartfile.plugins.ts b/ts/smartfile.plugins.ts index f88763a..b1816ea 100644 --- a/ts/smartfile.plugins.ts +++ b/ts/smartfile.plugins.ts @@ -15,7 +15,17 @@ import * as smartpath from '@pushrocks/smartpath'; import * as smartpromise from '@pushrocks/smartpromise'; import * as smartrequest from '@pushrocks/smartrequest'; -export { lik, smartfileInterfaces, smartdelay, smarthash, smartjson, smartmime, smartpath, smartpromise, smartrequest }; +export { + lik, + smartfileInterfaces, + smartdelay, + smarthash, + smartjson, + smartmime, + smartpath, + smartpromise, + smartrequest, +}; // third party scope import * as fsExtra from 'fs-extra';