Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
2e457f6011 | |||
e83c63fd2a | |||
c01006e365 | |||
a7adec8275 | |||
2eddbf5751 | |||
eca3e141d2 |
@ -26,16 +26,28 @@ mirror:
|
|||||||
- docker
|
- docker
|
||||||
- notpriv
|
- notpriv
|
||||||
|
|
||||||
audit:
|
auditProductionDependencies:
|
||||||
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
|
stage: security
|
||||||
|
script:
|
||||||
|
- npmci npm prepare
|
||||||
|
- npmci command npm install --production --ignore-scripts
|
||||||
|
- npmci command npm config set registry https://registry.npmjs.org
|
||||||
|
- npmci command npm audit --audit-level=high --only=prod --production
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
auditDevDependencies:
|
||||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
stage: security
|
stage: security
|
||||||
script:
|
script:
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
- npmci command npm install --ignore-scripts
|
- npmci command npm install --ignore-scripts
|
||||||
- npmci command npm config set registry https://registry.npmjs.org
|
- npmci command npm config set registry https://registry.npmjs.org
|
||||||
- npmci command npm audit --audit-level=high
|
- npmci command npm audit --audit-level=high --only=dev
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
allow_failure: true
|
||||||
|
|
||||||
# ====================
|
# ====================
|
||||||
# test stage
|
# test stage
|
||||||
|
1515
package-lock.json
generated
1515
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
12
package.json
12
package.json
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartfile",
|
"name": "@pushrocks/smartfile",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "8.0.0",
|
"version": "8.0.3",
|
||||||
"description": "offers smart ways to work with files in nodejs",
|
"description": "offers smart ways to work with files in nodejs",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
"typings": "dist_ts/index.d.ts",
|
"typings": "dist_ts/index.d.ts",
|
||||||
@ -28,18 +28,20 @@
|
|||||||
"@pushrocks/smartmime": "^1.0.3",
|
"@pushrocks/smartmime": "^1.0.3",
|
||||||
"@pushrocks/smartpath": "^4.0.3",
|
"@pushrocks/smartpath": "^4.0.3",
|
||||||
"@pushrocks/smartpromise": "^3.0.6",
|
"@pushrocks/smartpromise": "^3.0.6",
|
||||||
"@pushrocks/smartrequest": "^1.1.47",
|
"@pushrocks/smartrequest": "^1.1.51",
|
||||||
"@types/fs-extra": "^9.0.1",
|
"@types/fs-extra": "^9.0.1",
|
||||||
|
"@types/glob": "^7.1.3",
|
||||||
|
"@types/js-yaml": "^3.12.5",
|
||||||
"fs-extra": "^9.0.1",
|
"fs-extra": "^9.0.1",
|
||||||
"glob": "^7.1.6",
|
"glob": "^7.1.6",
|
||||||
"js-yaml": "^3.14.0"
|
"js-yaml": "^3.14.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.24",
|
"@gitzone/tsbuild": "^2.1.25",
|
||||||
"@gitzone/tsrun": "^1.2.12",
|
"@gitzone/tsrun": "^1.2.12",
|
||||||
"@gitzone/tstest": "^1.0.43",
|
"@gitzone/tstest": "^1.0.52",
|
||||||
"@pushrocks/tapbundle": "^3.2.9",
|
"@pushrocks/tapbundle": "^3.2.9",
|
||||||
"@types/node": "^14.0.27",
|
"@types/node": "^14.11.2",
|
||||||
"gulp-function": "^2.2.14",
|
"gulp-function": "^2.2.14",
|
||||||
"tslint": "^6.1.3",
|
"tslint": "^6.1.3",
|
||||||
"tslint-config-prettier": "^1.18.0"
|
"tslint-config-prettier": "^1.18.0"
|
||||||
|
@ -5,6 +5,7 @@ import * as SmartfileMemory from './smartfile.memory';
|
|||||||
import * as SmartfileRemote from './smartfile.remote';
|
import * as SmartfileRemote from './smartfile.remote';
|
||||||
|
|
||||||
export { Smartfile } from './smartfile.classes.smartfile';
|
export { Smartfile } from './smartfile.classes.smartfile';
|
||||||
|
export { VirtualDirectory } from './smartfile.classes.virtualdirectory';
|
||||||
|
|
||||||
export let fs = SmartfileFs;
|
export let fs = SmartfileFs;
|
||||||
export let interpreter = SmartfileInterpreter;
|
export let interpreter = SmartfileInterpreter;
|
||||||
|
31
ts/smartfile.classes.virtualdirectory.ts
Normal file
31
ts/smartfile.classes.virtualdirectory.ts
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
import { Smartfile } from './smartfile.classes.smartfile';
|
||||||
|
import * as plugins from './smartfile.plugins';
|
||||||
|
import * as fs from './smartfile.fs';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* a virtual directory exposes a fs api
|
||||||
|
*/
|
||||||
|
export class VirtualDirectory {
|
||||||
|
private fileArray: Smartfile[] = [];
|
||||||
|
public static async fromFsDirPath(pathArg: string) {
|
||||||
|
const newVirtualDir = new VirtualDirectory();
|
||||||
|
newVirtualDir.addSmartfiles(await fs.fileTreeToObject(pathArg, '**/*'));
|
||||||
|
}
|
||||||
|
|
||||||
|
constructor() {}
|
||||||
|
|
||||||
|
public addSmartfiles(smartfileArrayArg: Smartfile[]) {
|
||||||
|
this.fileArray = this.fileArray.concat(smartfileArrayArg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async getFileByPath(pathArg: string) {
|
||||||
|
for (const smartfile of this.fileArray) {
|
||||||
|
if (smartfile.path === pathArg) {
|
||||||
|
return smartfile;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO implement root shifting to get subdirectories as new virtual directories
|
||||||
|
// TODO implement root shifting to combine VirtualDirecotries in a parent virtual directory
|
||||||
|
}
|
Reference in New Issue
Block a user