fix(core): update

This commit is contained in:
Philipp Kunz 2020-03-13 20:22:56 +00:00
parent 141a1339c0
commit c72324997c
37 changed files with 1900 additions and 2340 deletions

20
.gitignore vendored
View File

@ -1,4 +1,22 @@
.nogit/
# artifacts
coverage/
node_modules/
public/
pages/
# installs
node_modules/
# caches
.yarn/
.cache/
.rpt2_cache
# builds
dist/
dist_web/
dist_serve/
dist_ts_web/
# custom

View File

@ -1,71 +1,126 @@
# gitzone standard
image: hosttoday/ht-docker-node:npmci
# gitzone ci_default
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
cache:
paths:
- .yarn/
key: "$CI_BUILD_STAGE"
- .npmci_cache/
key: '$CI_BUILD_STAGE'
stages:
- security
- test
- release
- trigger
- pages
- metadata
testLEGACY:
# ====================
# security stage
# ====================
mirror:
stage: security
script:
- npmci git mirror
tags:
- lossless
- docker
- notpriv
snyk:
image: registry.gitlab.com/hosttoday/ht-docker-node:snyk
stage: security
script:
- npmci npm prepare
- npmci command npm install --ignore-scripts
- npmci command snyk test
tags:
- lossless
- docker
- notpriv
# ====================
# test stage
# ====================
testStable:
stage: test
script:
- npmci test legacy
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- lossless
- docker
allow_failure: true
- priv
testLTS:
testBuild:
stage: test
script:
- npmci test lts
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
testSTABLE:
stage: test
script:
- npmci test stable
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- lossless
- docker
- notpriv
release:
stage: release
script:
- npmci publish
- npmci node install stable
- npmci npm publish
only:
- tags
tags:
- lossless
- docker
- notpriv
# ====================
# metadata stage
# ====================
codequality:
stage: metadata
allow_failure: true
script:
- npmci command npm install -g tslint typescript
- npmci npm prepare
- npmci npm install
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
tags:
- lossless
- docker
- priv
trigger:
stage: trigger
stage: metadata
script:
- npmci trigger
only:
- tags
tags:
- lossless
- docker
- notpriv
pages:
image: hosttoday/ht-docker-node:npmci
stage: pages
stage: metadata
script:
- npmci command yarn global add npmpage
- npmci command npmpage --publish gitlab
- npmci node install lts
- npmci command npm install -g @gitzone/tsdoc
- npmci npm prepare
- npmci npm install
- npmci command tsdoc
tags:
- lossless
- docker
- notpriv
only:
- tags
artifacts:
expire_in: 1 week
paths:
- public
allow_failure: true

29
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,29 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "current file",
"type": "node",
"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"
}
]
}

26
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,26 @@
{
"json.schemas": [
{
"fileMatch": ["/npmextra.json"],
"schema": {
"type": "object",
"properties": {
"npmci": {
"type": "object",
"description": "settings for npmci"
},
"gitzone": {
"type": "object",
"description": "settings for gitzone",
"properties": {
"projectType": {
"type": "string",
"enum": ["website", "element", "service", "npm"]
}
}
}
}
}
}
]
}

View File

@ -1,37 +0,0 @@
# smartarchive
work with archives
## Availabililty
[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smartarchive)
[![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/smartarchive)
[![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/smartarchive)
[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/smartarchive/)
## Status for master
[![build status](https://GitLab.com/pushrocks/smartarchive/badges/master/build.svg)](https://GitLab.com/pushrocks/smartarchive/commits/master)
[![coverage report](https://GitLab.com/pushrocks/smartarchive/badges/master/coverage.svg)](https://GitLab.com/pushrocks/smartarchive/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/smartarchive.svg)](https://www.npmjs.com/package/smartarchive)
[![Dependency Status](https://david-dm.org/pushrocks/smartarchive.svg)](https://david-dm.org/pushrocks/smartarchive)
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/smartarchive/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/smartarchive/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/pushrocks/smartarchive/badges/code.svg)](https://www.bithound.io/github/pushrocks/smartarchive)
[![TypeScript](https://img.shields.io/badge/TypeScript-2.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%206.x.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
## Usage
Use TypeScript for best in class instellisense.
```javascript
import * as smartarchive from 'smartarchive'
smartarchive.get({
from:"https://example.com/example.zip",
toPath:"/some/local/absolute/path",
}).then(/*...*/)
```
For further information read the linked docs at the top of this README.
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks)

1
dist/index.d.ts vendored
View File

@ -1 +0,0 @@
export * from './smartarchive.extract';

View File

@ -1,5 +0,0 @@
export declare let toFS: (options: {
from: string;
toPath: string;
cb?: any;
}) => void;

View File

@ -1 +0,0 @@
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRhcmNoaXZlLmV4dHJhY3QuaGVscGVycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0YXJjaGl2ZS5leHRyYWN0LmhlbHBlcnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9

View File

@ -1,28 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const plugins = require("./smartarchive.plugins");
exports.toFS = function (options) {
if (!plugins.path.isAbsolute(options.toPath)) {
plugins.beautylog.error('Please supply remotezip with an absolute path');
return;
}
;
plugins.gulp.task('remotezip', function () {
plugins.beautylog.log('Now trying to download and extract...');
let stream = plugins.g.remoteSrc(['master.zip'], {
base: 'https://github.com/UmbrellaZone/legaldocs/archive/'
})
.pipe(plugins.g.unzip())
.pipe(plugins.gulp.dest(options.toPath));
return stream;
});
plugins.gulp.task('default', ['remotezip'], function () {
plugins.beautylog.success('Download complete and archive extracted');
if (typeof options.cb === 'function') {
options.cb();
}
;
});
plugins.gulp.start.apply(plugins.gulp, ['default']);
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRhcmNoaXZlLmV4dHJhY3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydGFyY2hpdmUuZXh0cmFjdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLGtEQUFrRDtBQUN2QyxRQUFBLElBQUksR0FBRyxVQUFVLE9BQTZDO0lBRXZFLEVBQUUsQ0FBQyxDQUFDLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxVQUFVLENBQUMsT0FBTyxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQztRQUM3QyxPQUFPLENBQUMsU0FBUyxDQUFDLEtBQUssQ0FBQywrQ0FBK0MsQ0FBQyxDQUFBO1FBQ3hFLE1BQU0sQ0FBQTtJQUNSLENBQUM7SUFBQSxDQUFDO0lBQ0YsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsV0FBVyxFQUFFO1FBQzdCLE9BQU8sQ0FBQyxTQUFTLENBQUMsR0FBRyxDQUFDLHVDQUF1QyxDQUFDLENBQUE7UUFDOUQsSUFBSSxNQUFNLEdBQUcsT0FBTyxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUMsQ0FBRSxZQUFZLENBQUUsRUFBRTtZQUNqRCxJQUFJLEVBQUUsb0RBQW9EO1NBQzNELENBQUM7YUFDQyxJQUFJLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQyxLQUFLLEVBQUUsQ0FBQzthQUN2QixJQUFJLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUE7UUFDMUMsTUFBTSxDQUFDLE1BQU0sQ0FBQTtJQUNmLENBQUMsQ0FBQyxDQUFBO0lBRUYsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsU0FBUyxFQUFFLENBQUUsV0FBVyxDQUFFLEVBQUU7UUFDNUMsT0FBTyxDQUFDLFNBQVMsQ0FBQyxPQUFPLENBQUMseUNBQXlDLENBQUMsQ0FBQTtRQUNwRSxFQUFFLENBQUMsQ0FBQyxPQUFPLE9BQU8sQ0FBQyxFQUFFLEtBQUssVUFBVSxDQUFDLENBQUMsQ0FBQztZQUNyQyxPQUFPLENBQUMsRUFBRSxFQUFFLENBQUE7UUFDZCxDQUFDO1FBQUEsQ0FBQztJQUNKLENBQUMsQ0FBQyxDQUFBO0lBRUYsT0FBTyxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsS0FBSyxDQUFDLE9BQU8sQ0FBQyxJQUFJLEVBQUUsQ0FBRSxTQUFTLENBQUUsQ0FBQyxDQUFBO0FBQ3ZELENBQUMsQ0FBQSJ9

View File

@ -1,10 +0,0 @@
import 'typings-global';
export import beautylog = require('beautylog');
export declare let g: {
unzip: any;
remoteSrc: any;
};
export import gulp = require('gulp');
export import path = require('path');
export import smartfile = require('smartfile');
export import smartpath = require('smartpath');

View File

@ -1,13 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
require("typings-global");
exports.beautylog = require("beautylog");
exports.g = {
unzip: require('gulp-unzip'),
remoteSrc: require('gulp-remote-src')
};
exports.gulp = require("gulp");
exports.path = require("path");
exports.smartfile = require("smartfile");
exports.smartpath = require("smartpath");
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRhcmNoaXZlLnBsdWdpbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydGFyY2hpdmUucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLDBCQUF1QjtBQUN2Qix5Q0FBOEM7QUFDbkMsUUFBQSxDQUFDLEdBQUc7SUFDWCxLQUFLLEVBQUUsT0FBTyxDQUFDLFlBQVksQ0FBQztJQUM1QixTQUFTLEVBQUUsT0FBTyxDQUFDLGlCQUFpQixDQUFDO0NBQ3hDLENBQUE7QUFDRCwrQkFBb0M7QUFDcEMsK0JBQW9DO0FBQ3BDLHlDQUE4QztBQUM5Qyx5Q0FBOEMifQ==

1
dist_ts/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export * from './smartarchive.classes.smartarchive';

View File

@ -3,5 +3,5 @@ function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./smartarchive.extract"));
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLDRDQUFzQyJ9
__export(require("./smartarchive.classes.smartarchive"));
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLHlEQUFvRCJ9

View File

@ -0,0 +1,5 @@
export declare class SmartArchive {
archiveDirectory: string;
constructor();
extractArchiveFromFilePath(filePathArg: string, targetDir: string): void;
}

View File

@ -0,0 +1,21 @@
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const plugins = __importStar(require("./smartarchive.plugins"));
class SmartArchive {
constructor() { }
extractArchiveFromFilePath(filePathArg, targetDir) {
const parsedPath = plugins.path.parse(filePathArg);
switch (parsedPath.ext) {
}
}
;
}
exports.SmartArchive = SmartArchive;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRhcmNoaXZlLmNsYXNzZXMuc21hcnRhcmNoaXZlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRhcmNoaXZlLmNsYXNzZXMuc21hcnRhcmNoaXZlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7OztBQUFBLGdFQUFrRDtBQUVsRCxNQUFhLFlBQVk7SUFFdkIsZ0JBQWUsQ0FBQztJQUVULDBCQUEwQixDQUFDLFdBQW1CLEVBQUUsU0FBaUI7UUFDdEUsTUFBTSxVQUFVLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsV0FBVyxDQUFDLENBQUM7UUFDbkQsUUFBUSxVQUFVLENBQUMsR0FBRyxFQUFFO1NBRXZCO0lBQ0gsQ0FBQztJQUFBLENBQUM7Q0FDSDtBQVZELG9DQVVDIn0=

2
dist_ts/smartarchive.paths.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
export declare const packageDir: string;
export declare const nogitDir: string;

View File

@ -0,0 +1,13 @@
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const plugins = __importStar(require("./smartarchive.plugins"));
exports.packageDir = plugins.path.join(__dirname, '../');
exports.nogitDir = plugins.path.join(__dirname, './.nogit');
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRhcmNoaXZlLnBhdGhzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRhcmNoaXZlLnBhdGhzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7OztBQUFBLGdFQUFrRDtBQUVyQyxRQUFBLFVBQVUsR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxTQUFTLEVBQUUsS0FBSyxDQUFDLENBQUM7QUFDakQsUUFBQSxRQUFRLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsU0FBUyxFQUFFLFVBQVUsQ0FBQyxDQUFDIn0=

7
dist_ts/smartarchive.plugins.d.ts vendored Normal file
View File

@ -0,0 +1,7 @@
import path from 'path';
export { path };
import * as smartfile from '@pushrocks/smartfile';
import * as smartpath from '@pushrocks/smartpath';
export { smartfile, smartpath };
import tar from 'tar';
export { tar };

View File

@ -0,0 +1,24 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
// node native scope
const path_1 = __importDefault(require("path"));
exports.path = path_1.default;
// @pushrocks scope
const smartfile = __importStar(require("@pushrocks/smartfile"));
exports.smartfile = smartfile;
const smartpath = __importStar(require("@pushrocks/smartpath"));
exports.smartpath = smartpath;
// third party scope
const tar_1 = __importDefault(require("tar"));
exports.tar = tar_1.default;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRhcmNoaXZlLnBsdWdpbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydGFyY2hpdmUucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7QUFBQSxvQkFBb0I7QUFDcEIsZ0RBQXdCO0FBRWYsZUFGRixjQUFJLENBRUU7QUFFYixtQkFBbUI7QUFDbkIsZ0VBQWtEO0FBR3pDLDhCQUFTO0FBRmxCLGdFQUFrRDtBQUU5Qiw4QkFBUztBQUU3QixvQkFBb0I7QUFDcEIsOENBQXNCO0FBRWIsY0FGRixhQUFHLENBRUUifQ==

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2016 Push.Rocks
Copyright (c) 2016 Lossless GmbH
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,7 +1,16 @@
{
"npmci": {
"globalNpmTools": [
"npmts"
]
"npmGlobalTools": []
},
"gitzone": {
"projectType": "npm",
"module": {
"githost": "gitlab.com",
"gitscope": "pushrocks",
"gitrepo": "smartarchive",
"shortDescription": "work with archives",
"npmPackagename": "@pushrocks/smartarchive",
"license": "MIT"
}
}
}

1522
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -2,11 +2,11 @@
"name": "smartarchive",
"version": "1.0.4",
"description": "work with archives",
"main": "dist/index.js",
"main": "dist_ts/index.js",
"typings": "dist/index.d.ts",
"scripts": {
"test": "(npmts)",
"testm": "(npm test) && (node test.js)"
"test": "tstest test/",
"build": "tsbuild"
},
"repository": {
"type": "git",
@ -19,13 +19,29 @@
},
"homepage": "https://github.com/pushrocks/smartarchive#readme",
"dependencies": {
"@types/gulp": "^4.0.0",
"beautylog": "^6.1.5",
"gulp": "^3.9.1",
"gulp-remote-src": "^0.4.2",
"gulp-unzip": "^0.2.0",
"smartfile": "^4.1.8",
"smartpath": "^3.2.8"
"@pushrocks/smartfile": "^7.0.9",
"@pushrocks/smartpath": "^4.0.1",
"@types/tar": "^4.0.3",
"tar": "^6.0.1"
},
"devDependencies": {}
"devDependencies": {
"@gitzone/tsbuild": "^2.1.22",
"@gitzone/tstest": "^1.0.28",
"@pushrocks/smartrequest": "^1.1.47",
"@pushrocks/tapbundle": "^3.2.0",
"tslint": "^6.1.0",
"tslint-config-prettier": "^1.18.0"
},
"private": false,
"files": [
"ts/**/*",
"ts_web/**/*",
"dist/**/*",
"dist_web/**/*",
"dist_ts_web/**/*",
"assets/**/*",
"cli.js",
"npmextra.json",
"readme.md"
]
}

50
readme.md Normal file
View File

@ -0,0 +1,50 @@
# @pushrocks/smartarchive
work with archives
## Availabililty and Links
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartarchive)
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartarchive)
* [github.com (source mirror)](https://github.com/pushrocks/smartarchive)
* [docs (typedoc)](https://pushrocks.gitlab.io/smartarchive/)
## Status for master
[![pipeline status](https://gitlab.com/pushrocks/smartarchive/badges/master/pipeline.svg)](https://gitlab.com/pushrocks/smartarchive/commits/master)
[![coverage report](https://gitlab.com/pushrocks/smartarchive/badges/master/coverage.svg)](https://gitlab.com/pushrocks/smartarchive/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/@pushrocks/smartarchive.svg)](https://www.npmjs.com/package/@pushrocks/smartarchive)
[![Known Vulnerabilities](https://snyk.io/test/npm/@pushrocks/smartarchive/badge.svg)](https://snyk.io/test/npm/@pushrocks/smartarchive)
[![TypeScript](https://img.shields.io/badge/TypeScript->=%203.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-prettier-ff69b4.svg)](https://prettier.io/)
## Usage
Use TypeScript for best in class instellisense.
```javascript
import * as smartarchive from 'smartarchive';
smartarchive
.get({
from: 'https://example.com/example.zip',
toPath: '/some/local/absolute/path'
})
.then(/*...*/);
```
For further information read the linked docs at the top of this README.
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
> | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks)
## Contribution
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
For further information read the linked docs at the top of this readme.
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
[![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com)

0
test/test.d.ts vendored
View File

View File

@ -1 +0,0 @@
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9

View File

@ -1 +0,0 @@
{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,IAAI,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AACzC,IAAI,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAE3B,YAAY,CAAC,GAAG,CAAC;IACb,IAAI,EAAC,8DAA8D;IACnE,MAAM,EAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;IAC9B,EAAE,EAAE;QACA,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAA;IACrC,CAAC;CACJ,CAAC,CAAC"}

View File

@ -0,0 +1,11 @@
import { tap, expect } from '@pushrocks/tapbundle';
import * as smartrequest from '@pushrocks/smartrequest';
tap.test('should prepare downloads', async (tools) => {
const downLoadedFile: Buffer = (await smartrequest.getBinary('https://verdaccio.lossless.one/level/-/level-6.0.1.tgz')).body;
console.log(downLoadedFile);
});
tap.test('should extract files on disk', async () => {});
tap.start();

View File

@ -1 +1 @@
export * from './smartarchive.extract'
export * from './smartarchive.classes.smartarchive';

View File

@ -0,0 +1,13 @@
import * as plugins from './smartarchive.plugins';
export class SmartArchive {
public archiveDirectory: string;
constructor() {}
public extractArchiveFromFilePath(filePathArg: string, targetDir: string) {
const parsedPath = plugins.path.parse(filePathArg);
switch (parsedPath.ext) {
}
};
}

View File

@ -1,26 +0,0 @@
import plugins = require('./smartarchive.plugins')
export let toFS = function (options: { from: string, toPath: string, cb?}) {
if (!plugins.path.isAbsolute(options.toPath)) { // check wether supplied path is absolute
plugins.beautylog.error('Please supply remotezip with an absolute path')
return
};
plugins.gulp.task('remotezip', function () {
plugins.beautylog.log('Now trying to download and extract...')
let stream = plugins.g.remoteSrc([ 'master.zip' ], {
base: 'https://github.com/UmbrellaZone/legaldocs/archive/'
})
.pipe(plugins.g.unzip())
.pipe(plugins.gulp.dest(options.toPath))
return stream
})
plugins.gulp.task('default', [ 'remotezip' ], function () {
plugins.beautylog.success('Download complete and archive extracted')
if (typeof options.cb === 'function') {
options.cb()
};
})
plugins.gulp.start.apply(plugins.gulp, [ 'default' ])
}

4
ts/smartarchive.paths.ts Normal file
View File

@ -0,0 +1,4 @@
import * as plugins from './smartarchive.plugins';
export const packageDir = plugins.path.join(__dirname, '../');
export const nogitDir = plugins.path.join(__dirname, './.nogit');

View File

@ -1,10 +1,15 @@
import 'typings-global'
export import beautylog = require('beautylog')
export let g = {
unzip: require('gulp-unzip'),
remoteSrc: require('gulp-remote-src')
}
export import gulp = require('gulp')
export import path = require('path')
export import smartfile = require('smartfile')
export import smartpath = require('smartpath')
// node native scope
import path from 'path';
export { path };
// @pushrocks scope
import * as smartfile from '@pushrocks/smartfile';
import * as smartpath from '@pushrocks/smartpath';
export { smartfile, smartpath };
// third party scope
import tar from 'tar';
export { tar };

View File

@ -1,3 +1,17 @@
{
"extends": "tslint-config-standard"
"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"
}

2162
yarn.lock

File diff suppressed because it is too large Load Diff