fix(core): update
This commit is contained in:
parent
a2dd2ab6f0
commit
e00eaca362
139
.gitlab-ci.yml
139
.gitlab-ci.yml
@ -1,139 +0,0 @@
|
||||
# gitzone ci_default
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
|
||||
cache:
|
||||
paths:
|
||||
- .npmci_cache/
|
||||
key: '$CI_BUILD_STAGE'
|
||||
|
||||
stages:
|
||||
- security
|
||||
- test
|
||||
- release
|
||||
- metadata
|
||||
|
||||
before_script:
|
||||
- npm install -g @shipzone/npmci
|
||||
|
||||
# ====================
|
||||
# security stage
|
||||
# ====================
|
||||
mirror:
|
||||
stage: security
|
||||
script:
|
||||
- npmci git mirror
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
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
|
||||
allow_failure: true
|
||||
|
||||
auditDevDependencies:
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
stage: security
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci command npm install --ignore-scripts
|
||||
- npmci command npm config set registry https://registry.npmjs.org
|
||||
- npmci command npm audit --audit-level=high --only=dev
|
||||
tags:
|
||||
- docker
|
||||
allow_failure: true
|
||||
|
||||
# ====================
|
||||
# test stage
|
||||
# ====================
|
||||
|
||||
testStable:
|
||||
stage: test
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
|
||||
testBuild:
|
||||
stage: test
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci command npm run build
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
|
||||
release:
|
||||
stage: release
|
||||
script:
|
||||
- npmci node install stable
|
||||
- npmci npm publish
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
# ====================
|
||||
# metadata stage
|
||||
# ====================
|
||||
codequality:
|
||||
stage: metadata
|
||||
allow_failure: true
|
||||
only:
|
||||
- tags
|
||||
script:
|
||||
- npmci command npm install -g typescript
|
||||
- npmci npm prepare
|
||||
- npmci npm install
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- priv
|
||||
|
||||
trigger:
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci trigger
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
pages:
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci node install stable
|
||||
- npmci npm prepare
|
||||
- npmci npm install
|
||||
- npmci command npm run buildDocs
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
only:
|
||||
- tags
|
||||
artifacts:
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- public
|
||||
allow_failure: true
|
11307
package-lock.json
generated
11307
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
20
package.json
20
package.json
@ -24,19 +24,19 @@
|
||||
},
|
||||
"homepage": "https://gitlab.com/pushrocks/smartgulp#README",
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.63",
|
||||
"@gitzone/tsrun": "^1.2.35",
|
||||
"@gitzone/tstest": "^1.0.71",
|
||||
"@pushrocks/tapbundle": "^5.0.3",
|
||||
"@types/node": "^17.0.41",
|
||||
"@git.zone/tsbuild": "^2.1.66",
|
||||
"@git.zone/tsrun": "^1.2.44",
|
||||
"@git.zone/tstest": "^1.0.77",
|
||||
"@push.rocks/tapbundle": "^5.0.8",
|
||||
"@types/node": "^20.10.0",
|
||||
"gulp-function": "^2.2.14"
|
||||
},
|
||||
"dependencies": {
|
||||
"@pushrocks/smartevent": "^2.0.5",
|
||||
"@pushrocks/smartfile": "^10.0.2",
|
||||
"@pushrocks/smartpromise": "^3.1.7",
|
||||
"@pushrocks/smartstream": "^2.0.3",
|
||||
"@types/through2": "^2.0.34",
|
||||
"@push.rocks/smartevent": "^2.0.5",
|
||||
"@push.rocks/smartfile": "^11.0.4",
|
||||
"@push.rocks/smartpromise": "^4.0.2",
|
||||
"@push.rocks/smartstream": "^3.0.30",
|
||||
"@types/through2": "^2.0.41",
|
||||
"through2": "^4.0.2"
|
||||
},
|
||||
"type": "module",
|
||||
|
3757
pnpm-lock.yaml
3757
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
12
readme.md
12
readme.md
@ -1,8 +1,8 @@
|
||||
# @pushrocks/smartevent
|
||||
# @push.rocks/smartevent
|
||||
lightweight gulp replacement
|
||||
|
||||
## 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)
|
||||
* [github.com (source mirror)](https://github.com/pushrocks/smartevent)
|
||||
* [docs (typedoc)](https://pushrocks.gitlab.io/smartevent/)
|
||||
@ -13,14 +13,14 @@ Status Category | Status Badge
|
||||
-- | --
|
||||
GitLab Pipelines | [![pipeline status](https://gitlab.com/pushrocks/smartevent/badges/master/pipeline.svg)](https://lossless.cloud)
|
||||
GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/pushrocks/smartevent/badges/master/coverage.svg)](https://lossless.cloud)
|
||||
npm | [![npm downloads per month](https://badgen.net/npm/dy/@pushrocks/smartgulp)](https://lossless.cloud)
|
||||
npm | [![npm downloads per month](https://badgen.net/npm/dy/@push.rocks/smartgulp)](https://lossless.cloud)
|
||||
Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/pushrocks/smartevent)](https://lossless.cloud)
|
||||
TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud)
|
||||
node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud)
|
||||
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@pushrocks/smartgulp)](https://lossless.cloud)
|
||||
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@pushrocks/smartgulp)](https://lossless.cloud)
|
||||
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@pushrocks/smartgulp)](https://lossless.cloud)
|
||||
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@push.rocks/smartgulp)](https://lossless.cloud)
|
||||
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@push.rocks/smartgulp)](https://lossless.cloud)
|
||||
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@push.rocks/smartgulp)](https://lossless.cloud)
|
||||
Platform support | [![Supports Windows 10](https://badgen.net/badge/supports%20Windows%2010/yes/green?icon=windows)](https://lossless.cloud) [![Supports Mac OS X](https://badgen.net/badge/supports%20Mac%20OS%20X/yes/green?icon=apple)](https://lossless.cloud)
|
||||
|
||||
## Usage
|
||||
|
12
test/test.ts
12
test/test.ts
@ -1,12 +1,12 @@
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import { expect, tap } from '@push.rocks/tapbundle';
|
||||
|
||||
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 smartq from 'smartq';
|
||||
import * as smartpromise from '@push.rocks/smartpromise';
|
||||
|
||||
tap.test('smartgulp.src -> should read a directoy', async (tools) => {
|
||||
let done = smartq.defer();
|
||||
let done = smartpromise.defer();
|
||||
smartgulp
|
||||
.src(['./test/testfiles/**/*.md'])
|
||||
.pipe(
|
||||
@ -23,7 +23,7 @@ tap.test('smartgulp.src -> should read a directoy', async (tools) => {
|
||||
});
|
||||
|
||||
tap.test('smartgulp shoould replace files', async () => {
|
||||
let done = smartq.defer();
|
||||
let done = smartpromise.defer();
|
||||
smartgulp
|
||||
.src(['./test/testfiles/**/*.md'])
|
||||
.pipe(
|
||||
@ -40,4 +40,4 @@ tap.test('smartgulp shoould replace files', async () => {
|
||||
await done.promise;
|
||||
});
|
||||
|
||||
tap.start();
|
||||
await tap.start();
|
||||
|
@ -2,7 +2,7 @@
|
||||
* autocreated commitinfo by @pushrocks/commitinfo
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@pushrocks/smartgulp',
|
||||
version: '3.0.0',
|
||||
name: '@push.rocks/smartgulp',
|
||||
version: '3.0.1',
|
||||
description: 'lightweight gulp replacement'
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
// this file contains the code to generate and handle the stream
|
||||
|
||||
import * as plugins from './smartgulp.plugins.js';
|
||||
import { Smartfile } from '@pushrocks/smartfile';
|
||||
import { SmartFile } from '@push.rocks/smartfile';
|
||||
|
||||
import { Transform } from 'stream';
|
||||
|
||||
@ -11,7 +11,7 @@ export class GulpStream {
|
||||
/**
|
||||
* allows you to pipe a SmartfileArray into the stream
|
||||
*/
|
||||
async pipeSmartfileArray(smartfileArray: Smartfile[]) {
|
||||
async pipeSmartfileArray(smartfileArray: SmartFile[]) {
|
||||
// ensure what we get is an array
|
||||
if (!Array.isArray(smartfileArray)) {
|
||||
throw new Error('fileArg has unknown format');
|
||||
@ -20,8 +20,6 @@ export class GulpStream {
|
||||
let hasWritten = this.stream.push(smartfile);
|
||||
if (!hasWritten) {
|
||||
await plugins.smartevent.once(this.stream, 'drain');
|
||||
} else {
|
||||
// iterate
|
||||
}
|
||||
}
|
||||
// signal end of stream;
|
||||
|
@ -3,12 +3,12 @@ import * as plugins from './smartgulp.plugins.js';
|
||||
import { GulpStream } from './smartgulp.classes.gulpstream.js';
|
||||
import { Transform } from 'stream';
|
||||
|
||||
import { Smartfile } from '@pushrocks/smartfile';
|
||||
import { SmartFile } from '@push.rocks/smartfile';
|
||||
|
||||
export let src = (minimatchPathArrayArg: string[]): Transform => {
|
||||
let gulpStream = new GulpStream();
|
||||
let handleFiles = async () => {
|
||||
let smartfileArray: Smartfile[] = [];
|
||||
let smartfileArray: SmartFile[] = [];
|
||||
for (let minimatchPath of minimatchPathArrayArg) {
|
||||
let localSmartfileArray = await plugins.smartfile.fs.fileTreeToObject(
|
||||
process.cwd(),
|
||||
@ -24,16 +24,25 @@ export let src = (minimatchPathArrayArg: string[]): Transform => {
|
||||
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 = () => {
|
||||
return plugins.through2.obj(
|
||||
async (file: Smartfile, enc, cb) => {
|
||||
await file.write();
|
||||
cb(null, file);
|
||||
},
|
||||
(cb) => {
|
||||
cb();
|
||||
const stream = new plugins.smartstream.SmartDuplex({
|
||||
objectMode: true,
|
||||
writeFunction: async (fileArg: SmartFile) => {
|
||||
await fileArg.write();
|
||||
}
|
||||
);
|
||||
});
|
||||
return stream;
|
||||
};
|
||||
|
@ -1,6 +1,14 @@
|
||||
import * as smartevent from '@pushrocks/smartevent';
|
||||
import * as smartfile from '@pushrocks/smartfile';
|
||||
import * as smartstream from '@pushrocks/smartstream';
|
||||
// node native scope
|
||||
import * as path from 'path';
|
||||
|
||||
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';
|
||||
|
||||
export { smartevent, smartfile, smartstream, through2 };
|
||||
|
Loading…
Reference in New Issue
Block a user