Compare commits

...

2 Commits

Author SHA1 Message Date
6b13e46947 1.0.19 2020-10-02 14:39:47 +00:00
096c38de9e fix(core): update 2020-10-02 14:39:46 +00:00
4 changed files with 7051 additions and 1082 deletions

8102
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartnpm", "name": "@pushrocks/smartnpm",
"version": "1.0.18", "version": "1.0.19",
"private": false, "private": false,
"description": "interface with npm to retrieve package information", "description": "interface with npm to retrieve package information",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
@ -12,19 +12,19 @@
"build": "(tsbuild --web)" "build": "(tsbuild --web)"
}, },
"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.33", "@gitzone/tstest": "^1.0.52",
"@pushrocks/tapbundle": "^3.2.1", "@pushrocks/tapbundle": "^3.2.9",
"@types/node": "^14.0.14", "@types/node": "^14.11.2",
"tslint": "^6.1.2", "tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0" "tslint-config-prettier": "^1.18.0"
}, },
"dependencies": { "dependencies": {
"@pushrocks/consolecolor": "^2.0.1", "@pushrocks/consolecolor": "^2.0.1",
"@pushrocks/smartarchive": "^1.0.12", "@pushrocks/smartarchive": "^1.0.12",
"@pushrocks/smartfile": "^7.0.12", "@pushrocks/smartfile": "^8.0.4",
"@pushrocks/smartrequest": "^1.1.47", "@pushrocks/smartrequest": "^1.1.51",
"package-json": "^6.5.0" "package-json": "^6.5.0"
}, },
"files": [ "files": [

0
qenv.yml Normal file
View File

View File

@ -52,10 +52,10 @@ export class NpmRegistry {
/** /**
* gets a file from a package as Smartfile * gets a file from a package as Smartfile
*/ */
public async getFileFromPackage(packageName: string, filePath: string) { public async getFileFromPackage(packageNameArg: string, filePath: string) {
const baseDir = plugins.path.join(paths.nogitDir, packageName.replace('/', '__')); const baseDir = plugins.path.join(paths.nogitDir, packageNameArg.replace('/', '__'));
await plugins.smartfile.fs.ensureDir(baseDir); await plugins.smartfile.fs.ensureDir(baseDir);
await this.savePackageToDisk(packageName, baseDir); await this.savePackageToDisk(packageNameArg, baseDir);
const smartfile = await plugins.smartfile.Smartfile.fromFilePath( const smartfile = await plugins.smartfile.Smartfile.fromFilePath(
plugins.path.join(baseDir, 'package', filePath) plugins.path.join(baseDir, 'package', filePath)
); );
@ -63,6 +63,15 @@ export class NpmRegistry {
return smartfile; return smartfile;
} }
public async getPackageAsSmartfileVirtualDir(packageNameArg: string): Promise<plugins.smartfile.VirtualDirectory> {
const baseDir = plugins.path.join(paths.nogitDir, packageNameArg.replace('/', '__'));
await plugins.smartfile.fs.ensureDir(baseDir);
await this.savePackageToDisk(packageNameArg, baseDir);
const virtualDir = await plugins.smartfile.VirtualDirectory.fromFsDirPath(baseDir);
await plugins.smartfile.fs.remove(baseDir);
return virtualDir;
}
/** /**
* searches for a package on npm * searches for a package on npm
* @param searchObjectArg * @param searchObjectArg