Compare commits
62 Commits
Author | SHA1 | Date | |
---|---|---|---|
35f66736f0 | |||
99ac52b3d4 | |||
1d25d4e21b | |||
fbdb75d673 | |||
d90e833270 | |||
4cb3232317 | |||
0d50cdafbf | |||
4b3c9c9269 | |||
447a02b4c0 | |||
9e14d881ba | |||
277a3fff41 | |||
fc107509ff | |||
08d5461602 | |||
0b93067783 | |||
f70177001b | |||
232bb80bcb | |||
55e9287468 | |||
a71fdf805d | |||
69cf63c80a | |||
14e823fbfd | |||
abe1299203 | |||
99ce99795a | |||
f6a54ead5d | |||
cb48cfa948 | |||
36a5c2480f | |||
70a08fd92b | |||
02a0646a49 | |||
17eda1e56a | |||
ea6c514a40 | |||
ca3975abea | |||
c405a83689 | |||
f6ed45af97 | |||
02e5a4abe1 | |||
5f70072f4e | |||
e2550aaf78 | |||
3d30f41f84 | |||
9abe66c830 | |||
61dbf9680b | |||
a45fcf016e | |||
4e04843e0e | |||
e4586658aa | |||
7ae1657bfc | |||
6854a7cab1 | |||
9241056909 | |||
a85cf3d7a2 | |||
c1b1cbfd64 | |||
39b718fc41 | |||
c72324997c | |||
141a1339c0 | |||
00bfb6535a | |||
3fe1a78bd9 | |||
a602c68d8b | |||
13c82ce689 | |||
fad9848fef | |||
889ef2d31c | |||
2f4f325a86 | |||
7a00a44a70 | |||
f5f12c6fa1 | |||
eb2b068870 | |||
666e615b5a | |||
7e8081d7b1 | |||
11464d2eee |
66
.gitea/workflows/default_nottags.yaml
Normal file
66
.gitea/workflows/default_nottags.yaml
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
name: Default (not tags)
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags-ignore:
|
||||||
|
- '**'
|
||||||
|
|
||||||
|
env:
|
||||||
|
IMAGE: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
|
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@gitea.lossless.digital/${{gitea.repository}}.git
|
||||||
|
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
|
||||||
|
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
|
||||||
|
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
|
||||||
|
NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
security:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
continue-on-error: true
|
||||||
|
container:
|
||||||
|
image: ${{ env.IMAGE }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Install pnpm and npmci
|
||||||
|
run: |
|
||||||
|
pnpm install -g pnpm
|
||||||
|
pnpm install -g @shipzone/npmci
|
||||||
|
|
||||||
|
- name: Run npm prepare
|
||||||
|
run: npmci npm prepare
|
||||||
|
|
||||||
|
- name: Audit production dependencies
|
||||||
|
run: |
|
||||||
|
npmci command npm config set registry https://registry.npmjs.org
|
||||||
|
npmci command pnpm audit --audit-level=high --prod
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
|
- name: Audit development dependencies
|
||||||
|
run: |
|
||||||
|
npmci command npm config set registry https://registry.npmjs.org
|
||||||
|
npmci command pnpm audit --audit-level=high --dev
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
|
test:
|
||||||
|
if: ${{ always() }}
|
||||||
|
needs: security
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: ${{ env.IMAGE }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Test stable
|
||||||
|
run: |
|
||||||
|
npmci node install stable
|
||||||
|
npmci npm install
|
||||||
|
npmci npm test
|
||||||
|
|
||||||
|
- name: Test build
|
||||||
|
run: |
|
||||||
|
npmci node install stable
|
||||||
|
npmci npm install
|
||||||
|
npmci npm build
|
124
.gitea/workflows/default_tags.yaml
Normal file
124
.gitea/workflows/default_tags.yaml
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
name: Default (tags)
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
env:
|
||||||
|
IMAGE: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
|
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@gitea.lossless.digital/${{gitea.repository}}.git
|
||||||
|
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
|
||||||
|
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
|
||||||
|
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
|
||||||
|
NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
security:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
continue-on-error: true
|
||||||
|
container:
|
||||||
|
image: ${{ env.IMAGE }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Prepare
|
||||||
|
run: |
|
||||||
|
pnpm install -g pnpm
|
||||||
|
pnpm install -g @shipzone/npmci
|
||||||
|
npmci npm prepare
|
||||||
|
|
||||||
|
- name: Audit production dependencies
|
||||||
|
run: |
|
||||||
|
npmci command npm config set registry https://registry.npmjs.org
|
||||||
|
npmci command pnpm audit --audit-level=high --prod
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
|
- name: Audit development dependencies
|
||||||
|
run: |
|
||||||
|
npmci command npm config set registry https://registry.npmjs.org
|
||||||
|
npmci command pnpm audit --audit-level=high --dev
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
|
test:
|
||||||
|
if: ${{ always() }}
|
||||||
|
needs: security
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: ${{ env.IMAGE }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Prepare
|
||||||
|
run: |
|
||||||
|
pnpm install -g pnpm
|
||||||
|
pnpm install -g @shipzone/npmci
|
||||||
|
npmci npm prepare
|
||||||
|
|
||||||
|
- name: Test stable
|
||||||
|
run: |
|
||||||
|
npmci node install stable
|
||||||
|
npmci npm install
|
||||||
|
npmci npm test
|
||||||
|
|
||||||
|
- name: Test build
|
||||||
|
run: |
|
||||||
|
npmci node install stable
|
||||||
|
npmci npm install
|
||||||
|
npmci npm build
|
||||||
|
|
||||||
|
release:
|
||||||
|
needs: test
|
||||||
|
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: ${{ env.IMAGE }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Prepare
|
||||||
|
run: |
|
||||||
|
pnpm install -g pnpm
|
||||||
|
pnpm install -g @shipzone/npmci
|
||||||
|
npmci npm prepare
|
||||||
|
|
||||||
|
- name: Release
|
||||||
|
run: |
|
||||||
|
npmci node install stable
|
||||||
|
npmci npm publish
|
||||||
|
|
||||||
|
metadata:
|
||||||
|
needs: test
|
||||||
|
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: ${{ env.IMAGE }}
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Prepare
|
||||||
|
run: |
|
||||||
|
pnpm install -g pnpm
|
||||||
|
pnpm install -g @shipzone/npmci
|
||||||
|
npmci npm prepare
|
||||||
|
|
||||||
|
- name: Code quality
|
||||||
|
run: |
|
||||||
|
npmci command npm install -g typescript
|
||||||
|
npmci npm install
|
||||||
|
|
||||||
|
- name: Trigger
|
||||||
|
run: npmci trigger
|
||||||
|
|
||||||
|
- name: Build docs and upload artifacts
|
||||||
|
run: |
|
||||||
|
npmci node install stable
|
||||||
|
npmci npm install
|
||||||
|
pnpm install -g @gitzone/tsdoc
|
||||||
|
npmci command tsdoc
|
||||||
|
continue-on-error: true
|
25
.gitignore
vendored
25
.gitignore
vendored
@ -1,5 +1,20 @@
|
|||||||
.idea/
|
.nogit/
|
||||||
ts/*.js
|
|
||||||
ts/*.js.map
|
# artifacts
|
||||||
node_modules
|
coverage/
|
||||||
test/
|
public/
|
||||||
|
pages/
|
||||||
|
|
||||||
|
# installs
|
||||||
|
node_modules/
|
||||||
|
|
||||||
|
# caches
|
||||||
|
.yarn/
|
||||||
|
.cache/
|
||||||
|
.rpt2_cache
|
||||||
|
|
||||||
|
# builds
|
||||||
|
dist/
|
||||||
|
dist_*/
|
||||||
|
|
||||||
|
# custom
|
@ -1,5 +0,0 @@
|
|||||||
.idea/
|
|
||||||
ts/*.js
|
|
||||||
ts/*.js.map
|
|
||||||
node_modules
|
|
||||||
test/
|
|
11
.travis.yml
11
.travis.yml
@ -1,11 +0,0 @@
|
|||||||
language: node_js
|
|
||||||
node_js:
|
|
||||||
- 4.2.4
|
|
||||||
deploy:
|
|
||||||
provider: npm
|
|
||||||
email: npm@lossless.digital
|
|
||||||
api_key:
|
|
||||||
secure: JNfCkELIH8XfYpK6KMwT3p8lT6LWWzpFwTdD1CY6KYKYBL5F3JtaNrVA/5qtXR3QtxQ71pMDuMMTpAUWkcK4/faZn/ZIavsi5b1bXGSwqSez6p70d5Ob4prxvFnjAGUZ0zbfIxhmpMCfFiYLoAYyNAcnlqqKaNI+ARrTFApVuihrpaJj6DyChVY5VbzqIoErDiMYO+BxqPvqzfqabtanCJo2LVgCdZ2RuNMSEUqkn/J9fJoy6+MpgMrNIm/S6e+sCt9VVqVqfxy89SYBc2rmTVaaMlhy6AMbRPVhLqLBn/u4303/5MZlPsAWcyL03GNv3UC1WPaNbA/FNcK3Hxp++p+2hTu/BPes7WWD6/GLilbjt12dRaRlSojlU8BpNd/IzSEnnwFvl68XFoOjaF97lHqoh4W9eeF5Yjd1IcKk2A5ZMS8G/MTblPHDU5AoEKAjTZgf9ntC9iWfEEZYbVuwHcHUONkGfYuTe/nCxRaiCbnUyyEG3I5Gf2+bUyEQSl69pnlhCEDPmD0c+KOz9UPlW833iJ3dQboTcF3TF05nW/YFtLFF5IVgXss+QsBAtuDVj4OJ56b4WJyrFCjr5GgGPI4GjCpDVt8MU1yWRpRycJssKtxAdH5o4WdVPLqIIhf1NJP9xemTaXIQ6EzymxzXKyh9ynp58k+ojUUYb722i7Q=
|
|
||||||
on:
|
|
||||||
tags: true
|
|
||||||
repo: pushrocks/remotezip
|
|
11
.vscode/launch.json
vendored
Normal file
11
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"command": "npm test",
|
||||||
|
"name": "Run npm test",
|
||||||
|
"request": "launch",
|
||||||
|
"type": "node-terminal"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
26
.vscode/settings.json
vendored
Normal file
26
.vscode/settings.json
vendored
Normal 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", "wcc"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
1
dist_ts/index.d.ts
vendored
Normal file
1
dist_ts/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export * from './smartarchive.classes.smartarchive.js';
|
2
dist_ts/index.js
Normal file
2
dist_ts/index.js
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
export * from './smartarchive.classes.smartarchive.js';
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLHdDQUF3QyxDQUFDIn0=
|
34
dist_ts/smartarchive.classes.smartarchive.d.ts
vendored
Normal file
34
dist_ts/smartarchive.classes.smartarchive.d.ts
vendored
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
/// <reference types="node" resolution-mode="require"/>
|
||||||
|
import * as plugins from './smartarchive.plugins.js';
|
||||||
|
export declare class SmartArchive {
|
||||||
|
constructor();
|
||||||
|
/**
|
||||||
|
* extracts an archive from a given url
|
||||||
|
*/
|
||||||
|
extractArchiveFromUrlToFs(urlArg: string, targetDir: string): Promise<void>;
|
||||||
|
/**
|
||||||
|
* extracts an archive from a given filePath on disk
|
||||||
|
* @param filePathArg
|
||||||
|
* @param targetDirArg
|
||||||
|
*/
|
||||||
|
extractArchiveFromFilePathToFs(filePathArg: string, targetDirArg: string): Promise<void>;
|
||||||
|
/**
|
||||||
|
* extracts to Observable
|
||||||
|
* where the Observable is emitting smartfiles
|
||||||
|
*/
|
||||||
|
extractArchiveFromBufferToObservable(bufferArg: Buffer): Promise<plugins.smartrx.rxjs.ReplaySubject<plugins.smartfile.Smartfile>>;
|
||||||
|
extractArchiveWithIntakeAndReplaySubject(): {
|
||||||
|
intake: plugins.smartstream.StreamIntake<Buffer>;
|
||||||
|
replaySubject: plugins.smartrx.rxjs.ReplaySubject<plugins.smartfile.Smartfile>;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* extracts to Observable
|
||||||
|
*/
|
||||||
|
extractArchiveFromUrlToObservable(urlArg: string): Promise<plugins.smartrx.rxjs.ReplaySubject<plugins.smartfile.Smartfile>>;
|
||||||
|
extractArchiveFromUrlToStream(): Promise<void>;
|
||||||
|
extractArchiveFromFilePathToStream(): Promise<void>;
|
||||||
|
extractArchiveFromStreamToStream(): Promise<void>;
|
||||||
|
packFromStreamToStream(): Promise<void>;
|
||||||
|
packFromDirPathToStream(): Promise<void>;
|
||||||
|
packFromDirPathToFs(): Promise<void>;
|
||||||
|
}
|
116
dist_ts/smartarchive.classes.smartarchive.js
Normal file
116
dist_ts/smartarchive.classes.smartarchive.js
Normal file
File diff suppressed because one or more lines are too long
2
dist_ts/smartarchive.paths.d.ts
vendored
Normal file
2
dist_ts/smartarchive.paths.d.ts
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
export declare const packageDir: string;
|
||||||
|
export declare const nogitDir: string;
|
4
dist_ts/smartarchive.paths.js
Normal file
4
dist_ts/smartarchive.paths.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
import * as plugins from './smartarchive.plugins.js';
|
||||||
|
export const packageDir = plugins.path.join(plugins.smartpath.get.dirnameFromImportMetaUrl(import.meta.url), '../');
|
||||||
|
export const nogitDir = plugins.path.join(packageDir, './.nogit');
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRhcmNoaXZlLnBhdGhzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRhcmNoaXZlLnBhdGhzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxPQUFPLE1BQU0sMkJBQTJCLENBQUM7QUFFckQsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUN6QyxPQUFPLENBQUMsU0FBUyxDQUFDLEdBQUcsQ0FBQyx3QkFBd0IsQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUMvRCxLQUFLLENBQ04sQ0FBQztBQUNGLE1BQU0sQ0FBQyxNQUFNLFFBQVEsR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxVQUFVLEVBQUUsVUFBVSxDQUFDLENBQUMifQ==
|
14
dist_ts/smartarchive.plugins.d.ts
vendored
Normal file
14
dist_ts/smartarchive.plugins.d.ts
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import * as path from 'path';
|
||||||
|
export { path };
|
||||||
|
import * as smartfile from '@push.rocks/smartfile';
|
||||||
|
import * as smartpath from '@push.rocks/smartpath';
|
||||||
|
import * as smartpromise from '@push.rocks/smartpromise';
|
||||||
|
import * as smartrequest from '@push.rocks/smartrequest';
|
||||||
|
import * as smartunique from '@push.rocks/smartunique';
|
||||||
|
import * as smartstream from '@push.rocks/smartstream';
|
||||||
|
import * as smartrx from '@push.rocks/smartrx';
|
||||||
|
export { smartfile, smartpath, smartpromise, smartrequest, smartunique, smartstream, smartrx };
|
||||||
|
import gunzipMaybe from 'gunzip-maybe';
|
||||||
|
import tar from 'tar';
|
||||||
|
import tarStream from 'tar-stream';
|
||||||
|
export { gunzipMaybe, tar, tarStream };
|
19
dist_ts/smartarchive.plugins.js
Normal file
19
dist_ts/smartarchive.plugins.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// node native scope
|
||||||
|
import * as path from 'path';
|
||||||
|
export { path };
|
||||||
|
// @pushrocks scope
|
||||||
|
import * as smartfile from '@push.rocks/smartfile';
|
||||||
|
import * as smartpath from '@push.rocks/smartpath';
|
||||||
|
import * as smartpromise from '@push.rocks/smartpromise';
|
||||||
|
import * as smartrequest from '@push.rocks/smartrequest';
|
||||||
|
import * as smartunique from '@push.rocks/smartunique';
|
||||||
|
import * as smartstream from '@push.rocks/smartstream';
|
||||||
|
import * as smartrx from '@push.rocks/smartrx';
|
||||||
|
export { smartfile, smartpath, smartpromise, smartrequest, smartunique, smartstream, smartrx };
|
||||||
|
// third party scope
|
||||||
|
import gunzipMaybe from 'gunzip-maybe';
|
||||||
|
// @ts-ignore
|
||||||
|
import tar from 'tar';
|
||||||
|
import tarStream from 'tar-stream';
|
||||||
|
export { gunzipMaybe, tar, tarStream };
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRhcmNoaXZlLnBsdWdpbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydGFyY2hpdmUucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxvQkFBb0I7QUFDcEIsT0FBTyxLQUFLLElBQUksTUFBTSxNQUFNLENBQUM7QUFFN0IsT0FBTyxFQUFFLElBQUksRUFBRSxDQUFDO0FBRWhCLG1CQUFtQjtBQUNuQixPQUFPLEtBQUssU0FBUyxNQUFNLHVCQUF1QixDQUFDO0FBQ25ELE9BQU8sS0FBSyxTQUFTLE1BQU0sdUJBQXVCLENBQUM7QUFDbkQsT0FBTyxLQUFLLFlBQVksTUFBTSwwQkFBMEIsQ0FBQztBQUN6RCxPQUFPLEtBQUssWUFBWSxNQUFNLDBCQUEwQixDQUFDO0FBQ3pELE9BQU8sS0FBSyxXQUFXLE1BQU0seUJBQXlCLENBQUM7QUFDdkQsT0FBTyxLQUFLLFdBQVcsTUFBTSx5QkFBeUIsQ0FBQztBQUN2RCxPQUFPLEtBQUssT0FBTyxNQUFNLHFCQUFxQixDQUFDO0FBRS9DLE9BQU8sRUFBRSxTQUFTLEVBQUUsU0FBUyxFQUFFLFlBQVksRUFBRSxZQUFZLEVBQUUsV0FBVyxFQUFFLFdBQVcsRUFBRSxPQUFPLEVBQUUsQ0FBQztBQUUvRixvQkFBb0I7QUFDcEIsT0FBTyxXQUFXLE1BQU0sY0FBYyxDQUFDO0FBRXZDLGFBQWE7QUFDYixPQUFPLEdBQUcsTUFBTSxLQUFLLENBQUM7QUFDdEIsT0FBTyxTQUFTLE1BQU0sWUFBWSxDQUFDO0FBRW5DLE9BQU8sRUFBRSxXQUFXLEVBQUUsR0FBRyxFQUFFLFNBQVMsRUFBRSxDQUFDIn0=
|
6
index.d.ts
vendored
6
index.d.ts
vendored
@ -1,6 +0,0 @@
|
|||||||
/// <reference path="ts/typings/tsd.d.ts" />
|
|
||||||
declare module RemotezipPlugins {
|
|
||||||
var init: () => {
|
|
||||||
remotefile: any;
|
|
||||||
};
|
|
||||||
}
|
|
14
index.js
14
index.js
@ -1,14 +0,0 @@
|
|||||||
#!/usr/bin/env node
|
|
||||||
|
|
||||||
/// <reference path="./index.ts" />
|
|
||||||
var RemotezipPlugins;
|
|
||||||
(function (RemotezipPlugins) {
|
|
||||||
RemotezipPlugins.init = function () {
|
|
||||||
var plugins = {
|
|
||||||
remotefile: require("remotefile")
|
|
||||||
};
|
|
||||||
return plugins;
|
|
||||||
};
|
|
||||||
})(RemotezipPlugins || (RemotezipPlugins = {}));
|
|
||||||
/// <reference path="./typings/tsd.d.ts" />
|
|
||||||
/// <reference path="./remotezip.plugins.ts" />
|
|
@ -1,6 +1,6 @@
|
|||||||
The MIT License (MIT)
|
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
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
17
npmextra.json
Normal file
17
npmextra.json
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"npmci": {
|
||||||
|
"npmGlobalTools": [],
|
||||||
|
"npmAccessLevel": "public"
|
||||||
|
},
|
||||||
|
"gitzone": {
|
||||||
|
"projectType": "npm",
|
||||||
|
"module": {
|
||||||
|
"githost": "gitlab.com",
|
||||||
|
"gitscope": "push.rocks",
|
||||||
|
"gitrepo": "smartarchive",
|
||||||
|
"description": "work with archives",
|
||||||
|
"npmPackagename": "@push.rocks/smartarchive",
|
||||||
|
"license": "MIT"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
58
package.json
58
package.json
@ -1,25 +1,59 @@
|
|||||||
{
|
{
|
||||||
"name": "remotezip",
|
"name": "@push.rocks/smartarchive",
|
||||||
"version": "0.0.1",
|
"version": "3.0.8",
|
||||||
"description": "work with remote zip files",
|
"description": "work with archives",
|
||||||
"main": "index.js",
|
"main": "dist_ts/index.js",
|
||||||
|
"typings": "dist_ts/index.d.ts",
|
||||||
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(npmts)"
|
"test": "(tstest test/ --web)",
|
||||||
|
"build": "tsbuild --web --allowimplicitany",
|
||||||
|
"buildDocs": "tsdoc"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/pushrocks/remotezip.git"
|
"url": "git+https://github.com/pushrocks/smartarchive.git"
|
||||||
},
|
},
|
||||||
"author": "Lossless Digital UG (haftungsbeschraenkt)",
|
"author": "Lossless GmbH",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/pushrocks/remotezip/issues"
|
"url": "https://github.com/pushrocks/smartarchive/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/pushrocks/remotezip#readme",
|
"homepage": "https://github.com/pushrocks/smartarchive#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"remotefile": "0.0.13"
|
"@push.rocks/smartfile": "^10.0.28",
|
||||||
|
"@push.rocks/smartpath": "^5.0.11",
|
||||||
|
"@push.rocks/smartpromise": "^4.0.3",
|
||||||
|
"@push.rocks/smartrequest": "^2.0.18",
|
||||||
|
"@push.rocks/smartrx": "^3.0.6",
|
||||||
|
"@push.rocks/smartstream": "^2.0.4",
|
||||||
|
"@push.rocks/smartunique": "^3.0.3",
|
||||||
|
"@types/gunzip-maybe": "^1.4.0",
|
||||||
|
"@types/tar-stream": "^2.2.2",
|
||||||
|
"gunzip-maybe": "^1.4.2",
|
||||||
|
"tar": "^6.1.15",
|
||||||
|
"tar-stream": "^3.1.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"npmts": "1.0.9"
|
"@gitzone/tsbuild": "^2.1.66",
|
||||||
}
|
"@gitzone/tsrun": "^1.2.44",
|
||||||
|
"@gitzone/tstest": "^1.0.77",
|
||||||
|
"@push.rocks/tapbundle": "^5.0.12"
|
||||||
|
},
|
||||||
|
"private": false,
|
||||||
|
"files": [
|
||||||
|
"ts/**/*",
|
||||||
|
"ts_web/**/*",
|
||||||
|
"dist/**/*",
|
||||||
|
"dist_*/**/*",
|
||||||
|
"dist_ts/**/*",
|
||||||
|
"dist_ts_web/**/*",
|
||||||
|
"assets/**/*",
|
||||||
|
"cli.js",
|
||||||
|
"npmextra.json",
|
||||||
|
"readme.md"
|
||||||
|
],
|
||||||
|
"browserslist": [
|
||||||
|
"last 1 chrome versions"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
4971
pnpm-lock.yaml
generated
Normal file
4971
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
54
readme.md
Normal file
54
readme.md
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
# @push.rocks/smartarchive
|
||||||
|
work with archives
|
||||||
|
|
||||||
|
## Availabililty and Links
|
||||||
|
* [npmjs.org (npm package)](https://www.npmjs.com/package/@push.rocks/smartarchive)
|
||||||
|
* [gitlab.com (source)](https://gitlab.com/push.rocks/smartarchive)
|
||||||
|
* [github.com (source mirror)](https://github.com/push.rocks/smartarchive)
|
||||||
|
* [docs (typedoc)](https://push.rocks.gitlab.io/smartarchive/)
|
||||||
|
|
||||||
|
## Status for master
|
||||||
|
|
||||||
|
Status Category | Status Badge
|
||||||
|
-- | --
|
||||||
|
GitLab Pipelines | [](https://lossless.cloud)
|
||||||
|
GitLab Pipline Test Coverage | [](https://lossless.cloud)
|
||||||
|
npm | [](https://lossless.cloud)
|
||||||
|
Snyk | [](https://lossless.cloud)
|
||||||
|
TypeScript Support | [](https://lossless.cloud)
|
||||||
|
node Support | [](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
|
Code Style | [](https://lossless.cloud)
|
||||||
|
PackagePhobia (total standalone install weight) | [](https://lossless.cloud)
|
||||||
|
PackagePhobia (package size on registry) | [](https://lossless.cloud)
|
||||||
|
BundlePhobia (total size when bundled) | [](https://lossless.cloud)
|
||||||
|
|
||||||
|
## 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)
|
||||||
|
|
||||||
|
[](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.
|
||||||
|
|
||||||
|
## Legal
|
||||||
|
> MIT licensed | **©** [Task Venture Capital GmbH](https://task.vc)
|
||||||
|
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
|
10
test.js
Normal file
10
test.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
/// <reference path="./typings/tsd.d.ts" />
|
||||||
|
var remotezip = require("./index.js");
|
||||||
|
var path = require("path");
|
||||||
|
remotezip.get({
|
||||||
|
from: "https://github.com/UmbrellaZone/legaldocs/archive/master.zip",
|
||||||
|
toPath: path.resolve("./test/"),
|
||||||
|
cb: function () {
|
||||||
|
console.log("This is a callback");
|
||||||
|
}
|
||||||
|
});
|
104
test/test.ts
Normal file
104
test/test.ts
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
import { tap, expect } from '@push.rocks/tapbundle';
|
||||||
|
|
||||||
|
import * as path from 'path';
|
||||||
|
import * as smartpath from '@push.rocks/smartpath';
|
||||||
|
import * as smartfile from '@push.rocks/smartfile';
|
||||||
|
import * as smartrequest from '@push.rocks/smartrequest';
|
||||||
|
|
||||||
|
const testPlugins = {
|
||||||
|
path,
|
||||||
|
smartfile,
|
||||||
|
smartrequest,
|
||||||
|
};
|
||||||
|
|
||||||
|
const testPaths = {
|
||||||
|
nogitDir: testPlugins.path.join(
|
||||||
|
smartpath.get.dirnameFromImportMetaUrl(import.meta.url),
|
||||||
|
'../.nogit/'
|
||||||
|
),
|
||||||
|
remoteDir: testPlugins.path.join(
|
||||||
|
smartpath.get.dirnameFromImportMetaUrl(import.meta.url),
|
||||||
|
'../.nogit/remote'
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
import * as smartarchive from '../ts/index.js';
|
||||||
|
|
||||||
|
tap.preTask('should prepare .nogit dir', async () => {
|
||||||
|
await testPlugins.smartfile.fs.ensureDir(testPaths.remoteDir);
|
||||||
|
});
|
||||||
|
|
||||||
|
tap.preTask('should prepare downloads', async (tools) => {
|
||||||
|
const downloadedFile: Buffer = (
|
||||||
|
await testPlugins.smartrequest.getBinary(
|
||||||
|
'https://verdaccio.lossless.digital/@pushrocks%2fwebsetup/-/websetup-2.0.14.tgz'
|
||||||
|
)
|
||||||
|
).body;
|
||||||
|
await testPlugins.smartfile.memory.toFs(
|
||||||
|
downloadedFile,
|
||||||
|
testPlugins.path.join(testPaths.nogitDir, 'test.tgz')
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
tap.test('should extract existing files on disk', async () => {
|
||||||
|
const testSmartarchive = new smartarchive.SmartArchive();
|
||||||
|
await testSmartarchive.extractArchiveFromFilePathToFs(
|
||||||
|
testPlugins.path.join(testPaths.nogitDir, 'test.tgz'),
|
||||||
|
testPlugins.path.join(testPaths.nogitDir)
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
tap.test('should download a package from the registry', async () => {
|
||||||
|
const testSmartarchive = new smartarchive.SmartArchive();
|
||||||
|
await testSmartarchive.extractArchiveFromUrlToFs(
|
||||||
|
'https://verdaccio.lossless.digital/@pushrocks%2fsmartfile/-/smartfile-7.0.11.tgz',
|
||||||
|
testPaths.remoteDir
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
tap.test('should extract a package using tarStream', async (tools) => {
|
||||||
|
const done = tools.defer();
|
||||||
|
const testSmartarchive = new smartarchive.SmartArchive();
|
||||||
|
const testTgzBuffer = (
|
||||||
|
await testPlugins.smartfile.Smartfile.fromFilePath(
|
||||||
|
testPlugins.path.join(testPaths.nogitDir, 'test.tgz')
|
||||||
|
)
|
||||||
|
).contentBuffer;
|
||||||
|
const extractionFileObservable = await testSmartarchive.extractArchiveFromBufferToObservable(
|
||||||
|
testTgzBuffer
|
||||||
|
);
|
||||||
|
const subscription = extractionFileObservable.subscribe(
|
||||||
|
(file) => {
|
||||||
|
console.log(file.path);
|
||||||
|
},
|
||||||
|
(err) => {
|
||||||
|
console.log(err);
|
||||||
|
},
|
||||||
|
() => {
|
||||||
|
done.resolve();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
await done.promise;
|
||||||
|
});
|
||||||
|
|
||||||
|
tap.test('should extract a file from url to replaySubject', async (tools) => {
|
||||||
|
const done = tools.defer();
|
||||||
|
const testSmartarchive = new smartarchive.SmartArchive();
|
||||||
|
const extractionFileObservable = await testSmartarchive.extractArchiveFromUrlToObservable(
|
||||||
|
'https://verdaccio.lossless.digital/@pushrocks%2fwebsetup/-/websetup-2.0.14.tgz'
|
||||||
|
);
|
||||||
|
const subscription = extractionFileObservable.subscribe(
|
||||||
|
(file) => {
|
||||||
|
console.log(file.path);
|
||||||
|
},
|
||||||
|
(err) => {
|
||||||
|
console.log(err);
|
||||||
|
},
|
||||||
|
() => {
|
||||||
|
done.resolve();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
await done.promise;
|
||||||
|
});
|
||||||
|
|
||||||
|
tap.start();
|
8
ts/00_commitinfo_data.ts
Normal file
8
ts/00_commitinfo_data.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
/**
|
||||||
|
* autocreated commitinfo by @pushrocks/commitinfo
|
||||||
|
*/
|
||||||
|
export const commitinfo = {
|
||||||
|
name: '@push.rocks/smartarchive',
|
||||||
|
version: '3.0.8',
|
||||||
|
description: 'work with archives'
|
||||||
|
}
|
@ -1,2 +1 @@
|
|||||||
/// <reference path="./typings/tsd.d.ts" />
|
export * from './smartarchive.classes.smartarchive.js';
|
||||||
/// <reference path="./remotezip.plugins.ts" />
|
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
/// <reference path="./index.ts" />
|
|
||||||
module RemotezipPlugins {
|
|
||||||
export var init = function() {
|
|
||||||
var plugins = {
|
|
||||||
remotefile: require("remotefile")
|
|
||||||
};
|
|
||||||
return plugins;
|
|
||||||
}
|
|
||||||
}
|
|
133
ts/smartarchive.classes.smartarchive.ts
Normal file
133
ts/smartarchive.classes.smartarchive.ts
Normal file
@ -0,0 +1,133 @@
|
|||||||
|
import * as plugins from './smartarchive.plugins.js';
|
||||||
|
import * as paths from './smartarchive.paths.js';
|
||||||
|
|
||||||
|
export class SmartArchive {
|
||||||
|
constructor() {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* extracts an archive from a given url
|
||||||
|
*/
|
||||||
|
public async extractArchiveFromUrlToFs(urlArg: string, targetDir: string) {
|
||||||
|
const parsedPath = plugins.path.parse(urlArg);
|
||||||
|
const uniqueFileName = plugins.smartunique.uni() + parsedPath.ext;
|
||||||
|
plugins.smartfile.fs.ensureDir(paths.nogitDir); // TODO: totally remove caching needs
|
||||||
|
const downloadPath = plugins.path.join(paths.nogitDir, uniqueFileName);
|
||||||
|
const downloadedArchive = (await plugins.smartrequest.getBinary(urlArg)).body;
|
||||||
|
await plugins.smartfile.memory.toFs(downloadedArchive, downloadPath);
|
||||||
|
await this.extractArchiveFromFilePathToFs(downloadPath, targetDir);
|
||||||
|
await plugins.smartfile.fs.remove(downloadPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* extracts an archive from a given filePath on disk
|
||||||
|
* @param filePathArg
|
||||||
|
* @param targetDirArg
|
||||||
|
*/
|
||||||
|
public async extractArchiveFromFilePathToFs(filePathArg: string, targetDirArg: string) {
|
||||||
|
console.log(`extracting ${filePathArg}`);
|
||||||
|
const done = plugins.smartpromise.defer();
|
||||||
|
filePathArg = plugins.smartpath.transform.makeAbsolute(filePathArg);
|
||||||
|
targetDirArg = plugins.smartpath.transform.makeAbsolute(targetDirArg);
|
||||||
|
const readableStream = plugins.smartfile.fsStream.createReadStream(filePathArg);
|
||||||
|
const extractPipeStop = plugins.tarStream.extract();
|
||||||
|
extractPipeStop.on('entry', async (header, stream, next) => {
|
||||||
|
const targetFilePath = plugins.path.join(targetDirArg, header.name);
|
||||||
|
const parsedPath = plugins.path.parse(targetFilePath);
|
||||||
|
await plugins.smartfile.fs.ensureDir(parsedPath.dir);
|
||||||
|
const writeStream = plugins.smartfile.fsStream.createWriteStream(targetFilePath);
|
||||||
|
stream.pipe(writeStream);
|
||||||
|
stream.on('end', () => {
|
||||||
|
console.log(`extracted ${header.name}`);
|
||||||
|
next();
|
||||||
|
});
|
||||||
|
stream.resume();
|
||||||
|
});
|
||||||
|
extractPipeStop.on('finish', () => {
|
||||||
|
console.log(`Sucessfully extracted ${filePathArg}!`);
|
||||||
|
done.resolve();
|
||||||
|
});
|
||||||
|
|
||||||
|
// lets run the stream
|
||||||
|
readableStream.pipe(plugins.gunzipMaybe()).pipe(extractPipeStop);
|
||||||
|
await done.promise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* extracts to Observable
|
||||||
|
* where the Observable is emitting smartfiles
|
||||||
|
*/
|
||||||
|
public async extractArchiveFromBufferToObservable(
|
||||||
|
bufferArg: Buffer
|
||||||
|
): Promise<plugins.smartrx.rxjs.ReplaySubject<plugins.smartfile.Smartfile>> {
|
||||||
|
const { intake, replaySubject } = this.extractArchiveWithIntakeAndReplaySubject();
|
||||||
|
intake.pushData(bufferArg);
|
||||||
|
intake.signalEnd();
|
||||||
|
return replaySubject;
|
||||||
|
}
|
||||||
|
|
||||||
|
extractArchiveWithIntakeAndReplaySubject() {
|
||||||
|
const intake = new plugins.smartstream.StreamIntake<Buffer>();
|
||||||
|
const replaySubject = new plugins.smartrx.rxjs.ReplaySubject<plugins.smartfile.Smartfile>();
|
||||||
|
const readableStream = intake.getReadableStream();
|
||||||
|
const extractPipeStop = plugins.tarStream.extract();
|
||||||
|
extractPipeStop.on('entry', (header, stream, next) => {
|
||||||
|
let fileBuffer: Buffer;
|
||||||
|
stream.on('data', (chunkArg) => {
|
||||||
|
if (!fileBuffer) {
|
||||||
|
fileBuffer = chunkArg;
|
||||||
|
} else {
|
||||||
|
fileBuffer = Buffer.concat([fileBuffer, chunkArg]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
stream.on('end', () => {
|
||||||
|
replaySubject.next(
|
||||||
|
new plugins.smartfile.Smartfile({
|
||||||
|
base: null, // no working directory for this one
|
||||||
|
contentBuffer: fileBuffer,
|
||||||
|
path: `${header.name}`,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
next();
|
||||||
|
});
|
||||||
|
stream.resume();
|
||||||
|
});
|
||||||
|
extractPipeStop.on('finish', () => {
|
||||||
|
replaySubject.complete();
|
||||||
|
});
|
||||||
|
// lets run the stream
|
||||||
|
readableStream.pipe(plugins.gunzipMaybe()).pipe(extractPipeStop);
|
||||||
|
return {
|
||||||
|
intake,
|
||||||
|
replaySubject,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* extracts to Observable
|
||||||
|
*/
|
||||||
|
public async extractArchiveFromUrlToObservable(
|
||||||
|
urlArg: string
|
||||||
|
): Promise<plugins.smartrx.rxjs.ReplaySubject<plugins.smartfile.Smartfile>> {
|
||||||
|
const response = await plugins.smartrequest.getBinary(urlArg);
|
||||||
|
const replaySubject = this.extractArchiveFromBufferToObservable(response.body);
|
||||||
|
return replaySubject;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
public async extractArchiveFromUrlToStream() {}
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
public async extractArchiveFromFilePathToStream() {}
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
public async extractArchiveFromStreamToStream() {}
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
public async packFromStreamToStream() {}
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
public async packFromDirPathToStream() {}
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
public async packFromDirPathToFs() {}
|
||||||
|
}
|
7
ts/smartarchive.paths.ts
Normal file
7
ts/smartarchive.paths.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import * as plugins from './smartarchive.plugins.js';
|
||||||
|
|
||||||
|
export const packageDir = plugins.path.join(
|
||||||
|
plugins.smartpath.get.dirnameFromImportMetaUrl(import.meta.url),
|
||||||
|
'../'
|
||||||
|
);
|
||||||
|
export const nogitDir = plugins.path.join(packageDir, './.nogit');
|
24
ts/smartarchive.plugins.ts
Normal file
24
ts/smartarchive.plugins.ts
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
// node native scope
|
||||||
|
import * as path from 'path';
|
||||||
|
|
||||||
|
export { path };
|
||||||
|
|
||||||
|
// @pushrocks scope
|
||||||
|
import * as smartfile from '@push.rocks/smartfile';
|
||||||
|
import * as smartpath from '@push.rocks/smartpath';
|
||||||
|
import * as smartpromise from '@push.rocks/smartpromise';
|
||||||
|
import * as smartrequest from '@push.rocks/smartrequest';
|
||||||
|
import * as smartunique from '@push.rocks/smartunique';
|
||||||
|
import * as smartstream from '@push.rocks/smartstream';
|
||||||
|
import * as smartrx from '@push.rocks/smartrx';
|
||||||
|
|
||||||
|
export { smartfile, smartpath, smartpromise, smartrequest, smartunique, smartstream, smartrx };
|
||||||
|
|
||||||
|
// third party scope
|
||||||
|
import gunzipMaybe from 'gunzip-maybe';
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
import tar from 'tar';
|
||||||
|
import tarStream from 'tar-stream';
|
||||||
|
|
||||||
|
export { gunzipMaybe, tar, tarStream };
|
12
ts/tsd.json
12
ts/tsd.json
@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "v4",
|
|
||||||
"repo": "borisyankov/DefinitelyTyped",
|
|
||||||
"ref": "master",
|
|
||||||
"path": "typings",
|
|
||||||
"bundle": "typings/tsd.d.ts",
|
|
||||||
"installed": {
|
|
||||||
"node/node.d.ts": {
|
|
||||||
"commit": "efa0c1196d7280640e624ac1e7fa604502e7bd63"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
2079
ts/typings/node/node.d.ts
vendored
2079
ts/typings/node/node.d.ts
vendored
File diff suppressed because it is too large
Load Diff
1
ts/typings/tsd.d.ts
vendored
1
ts/typings/tsd.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
/// <reference path="node/node.d.ts" />
|
|
9
tsconfig.json
Normal file
9
tsconfig.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"useDefineForClassFields": false,
|
||||||
|
"target": "ES2022",
|
||||||
|
"module": "ES2022",
|
||||||
|
"moduleResolution": "nodenext"
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user