Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 16b16ee5d2 | |||
| eca1dfb8d1 | |||
| d34e9ab551 | |||
| e00eaca362 | |||
| a2dd2ab6f0 | |||
| bd3ae675b0 | |||
| 9b4b081d9a | |||
| 8c0efd532f |
20
.gitignore
vendored
20
.gitignore
vendored
@@ -1,2 +1,20 @@
|
|||||||
node_modules/
|
.nogit/
|
||||||
|
|
||||||
|
# artifacts
|
||||||
coverage/
|
coverage/
|
||||||
|
public/
|
||||||
|
pages/
|
||||||
|
|
||||||
|
# installs
|
||||||
|
node_modules/
|
||||||
|
|
||||||
|
# caches
|
||||||
|
.yarn/
|
||||||
|
.cache/
|
||||||
|
.rpt2_cache
|
||||||
|
|
||||||
|
# builds
|
||||||
|
dist/
|
||||||
|
dist_*/
|
||||||
|
|
||||||
|
# custom
|
||||||
150
.gitlab-ci.yml
150
.gitlab-ci.yml
@@ -1,150 +0,0 @@
|
|||||||
# gitzone standard
|
|
||||||
image: hosttoday/ht-docker-node:npmci
|
|
||||||
|
|
||||||
cache:
|
|
||||||
paths:
|
|
||||||
- .npmci_cache/
|
|
||||||
key: "$CI_BUILD_STAGE"
|
|
||||||
|
|
||||||
stages:
|
|
||||||
- security
|
|
||||||
- test
|
|
||||||
- release
|
|
||||||
- metadata
|
|
||||||
|
|
||||||
# ====================
|
|
||||||
# security stage
|
|
||||||
# ====================
|
|
||||||
mirror:
|
|
||||||
stage: security
|
|
||||||
script:
|
|
||||||
- npmci git mirror
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
- notpriv
|
|
||||||
|
|
||||||
snyk:
|
|
||||||
stage: security
|
|
||||||
script:
|
|
||||||
- npmci npm prepare
|
|
||||||
- npmci command npm install -g snyk
|
|
||||||
- npmci command npm install --ignore-scripts
|
|
||||||
- npmci command snyk test
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
- notpriv
|
|
||||||
|
|
||||||
sast:
|
|
||||||
stage: security
|
|
||||||
image: registry.gitlab.com/hosttoday/ht-docker-dbase:npmci
|
|
||||||
variables:
|
|
||||||
DOCKER_DRIVER: overlay2
|
|
||||||
allow_failure: true
|
|
||||||
services:
|
|
||||||
- docker:stable-dind
|
|
||||||
script:
|
|
||||||
- npmci npm prepare
|
|
||||||
- npmci npm install
|
|
||||||
- npmci command npm run build
|
|
||||||
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
|
|
||||||
- docker run
|
|
||||||
--env SAST_CONFIDENCE_LEVEL="${SAST_CONFIDENCE_LEVEL:-3}"
|
|
||||||
--volume "$PWD:/code"
|
|
||||||
--volume /var/run/docker.sock:/var/run/docker.sock
|
|
||||||
"registry.gitlab.com/gitlab-org/security-products/sast:$SP_VERSION" /app/bin/run /code
|
|
||||||
artifacts:
|
|
||||||
reports:
|
|
||||||
sast: gl-sast-report.json
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
- priv
|
|
||||||
|
|
||||||
# ====================
|
|
||||||
# test stage
|
|
||||||
# ====================
|
|
||||||
|
|
||||||
testLTS:
|
|
||||||
stage: test
|
|
||||||
script:
|
|
||||||
- npmci npm prepare
|
|
||||||
- npmci node install lts
|
|
||||||
- npmci npm install
|
|
||||||
- npmci npm test
|
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
- notpriv
|
|
||||||
|
|
||||||
testSTABLE:
|
|
||||||
stage: test
|
|
||||||
script:
|
|
||||||
- npmci npm prepare
|
|
||||||
- npmci node install stable
|
|
||||||
- npmci npm install
|
|
||||||
- npmci npm test
|
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
- notpriv
|
|
||||||
|
|
||||||
release:
|
|
||||||
stage: release
|
|
||||||
script:
|
|
||||||
- npmci node install stable
|
|
||||||
- npmci npm publish
|
|
||||||
only:
|
|
||||||
- tags
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
- notpriv
|
|
||||||
|
|
||||||
# ====================
|
|
||||||
# metadata stage
|
|
||||||
# ====================
|
|
||||||
codequality:
|
|
||||||
stage: metadata
|
|
||||||
image: docker:stable
|
|
||||||
allow_failure: true
|
|
||||||
services:
|
|
||||||
- docker:stable-dind
|
|
||||||
script:
|
|
||||||
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
|
|
||||||
- docker run
|
|
||||||
--env SOURCE_CODE="$PWD"
|
|
||||||
--volume "$PWD":/code
|
|
||||||
--volume /var/run/docker.sock:/var/run/docker.sock
|
|
||||||
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
|
|
||||||
artifacts:
|
|
||||||
paths: [codeclimate.json]
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
- priv
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
stage: metadata
|
|
||||||
script:
|
|
||||||
- npmci trigger
|
|
||||||
only:
|
|
||||||
- tags
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
- notpriv
|
|
||||||
|
|
||||||
pages:
|
|
||||||
image: hosttoday/ht-docker-node:npmci
|
|
||||||
stage: metadata
|
|
||||||
script:
|
|
||||||
- npmci command npm install -g typedoc typescript
|
|
||||||
- npmci npm prepare
|
|
||||||
- npmci npm install
|
|
||||||
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
- notpriv
|
|
||||||
only:
|
|
||||||
- tags
|
|
||||||
artifacts:
|
|
||||||
expire_in: 1 week
|
|
||||||
paths:
|
|
||||||
- public
|
|
||||||
allow_failure: true
|
|
||||||
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"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -4,12 +4,13 @@
|
|||||||
"npmAccessLevel": "public"
|
"npmAccessLevel": "public"
|
||||||
},
|
},
|
||||||
"gitzone": {
|
"gitzone": {
|
||||||
|
"projectType": "npm",
|
||||||
"module": {
|
"module": {
|
||||||
"githost": "gitlab.com",
|
"githost": "gitlab.com",
|
||||||
"gitscope": "pushrocks",
|
"gitscope": "push.rocks",
|
||||||
"gitrepo": "smartevent",
|
"gitrepo": "smartevent",
|
||||||
"shortDescription": "lightweight gulp replacement",
|
"description": "lightweight gulp replacement",
|
||||||
"npmPackagename": "@pushrocks/smartgulp",
|
"npmPackagename": "@push.rocks/smartgulp",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
1590
package-lock.json
generated
1590
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
51
package.json
51
package.json
@@ -1,13 +1,14 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartgulp",
|
"name": "@push.rocks/smartgulp",
|
||||||
"version": "2.0.2",
|
"version": "3.0.2",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "lightweight gulp replacement",
|
"description": "lightweight gulp replacement",
|
||||||
"main": "dist/index.js",
|
"main": "dist_ts/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist_ts/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(tstest test/)",
|
"test": "(tstest test/)",
|
||||||
"build": "(tsbuild)"
|
"build": "(tsbuild --web --allowimplicitany)",
|
||||||
|
"buildDocs": "tsdoc"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -23,19 +24,35 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://gitlab.com/pushrocks/smartgulp#README",
|
"homepage": "https://gitlab.com/pushrocks/smartgulp#README",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.8",
|
"@git.zone/tsbuild": "^2.1.66",
|
||||||
"@gitzone/tsrun": "^1.1.17",
|
"@git.zone/tsrun": "^1.2.44",
|
||||||
"@gitzone/tstest": "^1.0.18",
|
"@git.zone/tstest": "^1.0.77",
|
||||||
"@pushrocks/tapbundle": "^3.0.7",
|
"@push.rocks/tapbundle": "^5.0.8",
|
||||||
"@types/node": "^11.9.4",
|
"@types/node": "^20.10.0",
|
||||||
"gulp-function": "^2.2.14"
|
"gulp-function": "^2.2.14"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/smartevent": "^2.0.3",
|
"@push.rocks/smartevent": "^2.0.5",
|
||||||
"@pushrocks/smartfile": "^7.0.0",
|
"@push.rocks/smartfile": "^11.0.4",
|
||||||
"@pushrocks/smartpromise": "^2.0.5",
|
"@push.rocks/smartpromise": "^4.0.2",
|
||||||
"@pushrocks/smartstream": "^1.0.14",
|
"@push.rocks/smartstream": "^3.0.30",
|
||||||
"@types/through2": "^2.0.34",
|
"@types/through2": "^2.0.41",
|
||||||
"through2": "^3.0.0"
|
"through2": "^4.0.2"
|
||||||
}
|
},
|
||||||
|
"type": "module",
|
||||||
|
"browserslist": [
|
||||||
|
"last 1 chrome versions"
|
||||||
|
],
|
||||||
|
"files": [
|
||||||
|
"ts/**/*",
|
||||||
|
"ts_web/**/*",
|
||||||
|
"dist/**/*",
|
||||||
|
"dist_*/**/*",
|
||||||
|
"dist_ts/**/*",
|
||||||
|
"dist_ts_web/**/*",
|
||||||
|
"assets/**/*",
|
||||||
|
"cli.js",
|
||||||
|
"npmextra.json",
|
||||||
|
"readme.md"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
5638
pnpm-lock.yaml
generated
Normal file
5638
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
34
readme.md
34
readme.md
@@ -1,26 +1,38 @@
|
|||||||
# @pushrocks/smartevent
|
# @push.rocks/smartevent
|
||||||
lightweight gulp replacement
|
lightweight gulp replacement
|
||||||
|
|
||||||
## Availabililty and Links
|
## Availabililty and Links
|
||||||
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartgulp)
|
* [npmjs.org (npm package)](https://www.npmjs.com/package/@push.rocks/smartgulp)
|
||||||
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartevent)
|
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartevent)
|
||||||
* [github.com (source mirror)](https://github.com/pushrocks/smartevent)
|
* [github.com (source mirror)](https://github.com/pushrocks/smartevent)
|
||||||
* [docs (typedoc)](https://pushrocks.gitlab.io/smartevent/)
|
* [docs (typedoc)](https://pushrocks.gitlab.io/smartevent/)
|
||||||
|
|
||||||
## Status for master
|
## Status for master
|
||||||
[](https://gitlab.com/pushrocks/smartevent/commits/master)
|
|
||||||
[](https://gitlab.com/pushrocks/smartevent/commits/master)
|
Status Category | Status Badge
|
||||||
[](https://www.npmjs.com/package/@pushrocks/smartgulp)
|
-- | --
|
||||||
[](https://snyk.io/test/npm/@pushrocks/smartgulp)
|
GitLab Pipelines | [](https://lossless.cloud)
|
||||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
GitLab Pipline Test Coverage | [](https://lossless.cloud)
|
||||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
npm | [](https://lossless.cloud)
|
||||||
[](http://standardjs.com/)
|
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)
|
||||||
|
Platform support | [](https://lossless.cloud) [](https://lossless.cloud)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
|
||||||
|
## 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.
|
For further information read the linked docs at the top of this readme.
|
||||||
|
|
||||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||||
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
|
||||||
|
|
||||||
[](https://maintainedby.lossless.com)
|
[](https://maintainedby.lossless.com)
|
||||||
|
|||||||
20
test/test.ts
20
test/test.ts
@@ -1,16 +1,16 @@
|
|||||||
import { expect, tap } from '@pushrocks/tapbundle';
|
import { expect, tap } from '@push.rocks/tapbundle';
|
||||||
|
|
||||||
import * as smartgulp from '../ts/index';
|
import * as smartgulp from '../ts/index.js';
|
||||||
import * as smartstream from '@pushrocks/smartstream';
|
import * as smartstream from '@push.rocks/smartstream';
|
||||||
import * as gulpFunction from 'gulp-function';
|
import * as gulpFunction from 'gulp-function';
|
||||||
import * as smartq from 'smartq';
|
import * as smartpromise from '@push.rocks/smartpromise';
|
||||||
|
|
||||||
tap.test('smartgulp.src -> should read a directoy', async tools => {
|
tap.test('smartgulp.src -> should read a directoy', async (tools) => {
|
||||||
let done = smartq.defer();
|
let done = smartpromise.defer();
|
||||||
smartgulp
|
smartgulp
|
||||||
.src(['./test/testfiles/**/*.md'])
|
.src(['./test/testfiles/**/*.md'])
|
||||||
.pipe(
|
.pipe(
|
||||||
gulpFunction.forEach(async fileArg => {
|
gulpFunction.forEach(async (fileArg) => {
|
||||||
console.log(fileArg.path);
|
console.log(fileArg.path);
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
@@ -23,11 +23,11 @@ tap.test('smartgulp.src -> should read a directoy', async tools => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
tap.test('smartgulp shoould replace files', async () => {
|
tap.test('smartgulp shoould replace files', async () => {
|
||||||
let done = smartq.defer();
|
let done = smartpromise.defer();
|
||||||
smartgulp
|
smartgulp
|
||||||
.src(['./test/testfiles/**/*.md'])
|
.src(['./test/testfiles/**/*.md'])
|
||||||
.pipe(
|
.pipe(
|
||||||
gulpFunction.forEach(async fileArg => {
|
gulpFunction.forEach(async (fileArg) => {
|
||||||
console.log(fileArg.path);
|
console.log(fileArg.path);
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
@@ -40,4 +40,4 @@ tap.test('smartgulp shoould replace files', async () => {
|
|||||||
await done.promise;
|
await done.promise;
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.start();
|
await 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/smartgulp',
|
||||||
|
version: '3.0.2',
|
||||||
|
description: 'lightweight gulp replacement'
|
||||||
|
}
|
||||||
@@ -1 +1 @@
|
|||||||
export * from './smartgulp.gulpapi';
|
export * from './smartgulp.gulpapi.js';
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// this file contains the code to generate and handle the stream
|
// this file contains the code to generate and handle the stream
|
||||||
|
|
||||||
import * as plugins from './smartgulp.plugins';
|
import * as plugins from './smartgulp.plugins.js';
|
||||||
import { Smartfile } from '@pushrocks/smartfile';
|
import { SmartFile } from '@push.rocks/smartfile';
|
||||||
|
|
||||||
import { Transform } from 'stream';
|
import { Transform } from 'stream';
|
||||||
|
|
||||||
@@ -11,7 +11,7 @@ export class GulpStream {
|
|||||||
/**
|
/**
|
||||||
* allows you to pipe a SmartfileArray into the stream
|
* allows you to pipe a SmartfileArray into the stream
|
||||||
*/
|
*/
|
||||||
async pipeSmartfileArray(smartfileArray: Smartfile[]) {
|
async pipeSmartfileArray(smartfileArray: SmartFile[]) {
|
||||||
// ensure what we get is an array
|
// ensure what we get is an array
|
||||||
if (!Array.isArray(smartfileArray)) {
|
if (!Array.isArray(smartfileArray)) {
|
||||||
throw new Error('fileArg has unknown format');
|
throw new Error('fileArg has unknown format');
|
||||||
@@ -20,8 +20,6 @@ export class GulpStream {
|
|||||||
let hasWritten = this.stream.push(smartfile);
|
let hasWritten = this.stream.push(smartfile);
|
||||||
if (!hasWritten) {
|
if (!hasWritten) {
|
||||||
await plugins.smartevent.once(this.stream, 'drain');
|
await plugins.smartevent.once(this.stream, 'drain');
|
||||||
} else {
|
|
||||||
// iterate
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// signal end of stream;
|
// signal end of stream;
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
// this file contains the implementation of the standard gulp api
|
// this file contains the implementation of the standard gulp api
|
||||||
import * as plugins from './smartgulp.plugins';
|
import * as plugins from './smartgulp.plugins.js';
|
||||||
import { GulpStream } from './smartgulp.classes.gulpstream';
|
import { GulpStream } from './smartgulp.classes.gulpstream.js';
|
||||||
import { Transform } from 'stream';
|
import { Transform } from 'stream';
|
||||||
|
|
||||||
import { Smartfile } from '@pushrocks/smartfile';
|
import { SmartFile } from '@push.rocks/smartfile';
|
||||||
|
|
||||||
export let src = (minimatchPathArrayArg: string[]): Transform => {
|
export let src = (minimatchPathArrayArg: string[]): Transform => {
|
||||||
let gulpStream = new GulpStream();
|
let gulpStream = new GulpStream();
|
||||||
let handleFiles = async () => {
|
let handleFiles = async () => {
|
||||||
let smartfileArray: Smartfile[] = [];
|
let smartfileArray: SmartFile[] = [];
|
||||||
for (let minimatchPath of minimatchPathArrayArg) {
|
for (let minimatchPath of minimatchPathArrayArg) {
|
||||||
let localSmartfileArray = await plugins.smartfile.fs.fileTreeToObject(
|
let localSmartfileArray = await plugins.smartfile.fs.fileTreeToObject(
|
||||||
process.cwd(),
|
process.cwd(),
|
||||||
@@ -18,22 +18,31 @@ export let src = (minimatchPathArrayArg: string[]): Transform => {
|
|||||||
}
|
}
|
||||||
gulpStream.pipeSmartfileArray(smartfileArray);
|
gulpStream.pipeSmartfileArray(smartfileArray);
|
||||||
};
|
};
|
||||||
handleFiles().catch(err => {
|
handleFiles().catch((err) => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
});
|
});
|
||||||
return gulpStream.stream;
|
return gulpStream.stream;
|
||||||
};
|
};
|
||||||
|
|
||||||
export let dest = (dirArg: string) => {};
|
export let dest = (dirArg: string) => {
|
||||||
|
const stream = new plugins.smartstream.SmartDuplex({
|
||||||
|
objectMode: true,
|
||||||
|
writeFunction: async (fileArg: SmartFile) => {
|
||||||
|
const filePath = plugins.path.join(dirArg, fileArg.relative);
|
||||||
|
const dirPath = plugins.path.dirname(filePath);
|
||||||
|
await plugins.smartfile.fs.ensureDir(dirPath);
|
||||||
|
await plugins.smartfile.memory.toFs(fileArg.contentBuffer, filePath);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return stream;
|
||||||
|
};
|
||||||
|
|
||||||
export let replace = () => {
|
export let replace = () => {
|
||||||
return plugins.through2.obj(
|
const stream = new plugins.smartstream.SmartDuplex({
|
||||||
async (file: Smartfile, enc, cb) => {
|
objectMode: true,
|
||||||
await file.write();
|
writeFunction: async (fileArg: SmartFile) => {
|
||||||
cb(null, file);
|
await fileArg.write();
|
||||||
},
|
|
||||||
cb => {
|
|
||||||
cb();
|
|
||||||
}
|
}
|
||||||
);
|
});
|
||||||
|
return stream;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,14 @@
|
|||||||
import * as smartevent from '@pushrocks/smartevent';
|
// node native scope
|
||||||
import * as smartfile from '@pushrocks/smartfile';
|
import * as path from 'path';
|
||||||
import * as smartstream from '@pushrocks/smartstream';
|
|
||||||
|
export {
|
||||||
|
path
|
||||||
|
};
|
||||||
|
|
||||||
|
// @push.rocks scope
|
||||||
|
import * as smartevent from '@push.rocks/smartevent';
|
||||||
|
import * as smartfile from '@push.rocks/smartfile';
|
||||||
|
import * as smartstream from '@push.rocks/smartstream';
|
||||||
import * as through2 from 'through2';
|
import * as through2 from 'through2';
|
||||||
|
|
||||||
export { smartevent, smartfile, smartstream, through2 };
|
export { smartevent, smartfile, smartstream, through2 };
|
||||||
|
|||||||
17
tslint.json
17
tslint.json
@@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user