Compare commits

...

9 Commits

Author SHA1 Message Date
fa76cec8b4 update description 2024-05-29 14:13:27 +02:00
a2406be478 update tsconfig 2024-04-14 17:39:50 +02:00
816ab19cb3 update npmextra.json: githost 2024-04-01 21:35:17 +02:00
46b7d69b10 update npmextra.json: githost 2024-04-01 19:58:22 +02:00
5926276c16 update npmextra.json: githost 2024-03-30 21:47:20 +01:00
1bc3bc3b95 3.0.4 2024-03-10 23:31:28 +01:00
6dee2638c2 fix(core): update 2024-03-10 23:31:27 +01:00
5580cb5e8f 3.0.3 2023-11-25 18:12:13 +01:00
bcb8fd0901 fix(core): update 2023-11-25 18:12:13 +01:00
9 changed files with 746 additions and 385 deletions

View 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

View 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 @git.zone/tsdoc
npmci command tsdoc
continue-on-error: true

View File

@ -6,12 +6,25 @@
"gitzone": {
"projectType": "npm",
"module": {
"githost": "gitlab.com",
"githost": "code.foss.global",
"gitscope": "push.rocks",
"gitrepo": "smartevent",
"description": "lightweight gulp replacement",
"description": "A lightweight replacement for gulp, featuring smart stream handling and file manipulation.",
"npmPackagename": "@push.rocks/smartgulp",
"license": "MIT"
"license": "MIT",
"keywords": [
"build tool",
"gulp replacement",
"stream manipulation",
"file manipulation",
"typescript",
"task runner",
"pipeline",
"development tool"
]
}
},
"tsdoc": {
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
}
}

View File

@ -1,8 +1,8 @@
{
"name": "@push.rocks/smartgulp",
"version": "3.0.2",
"version": "3.0.4",
"private": false,
"description": "lightweight gulp replacement",
"description": "A lightweight replacement for gulp, featuring smart stream handling and file manipulation.",
"main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts",
"scripts": {
@ -12,30 +12,37 @@
},
"repository": {
"type": "git",
"url": "git+ssh://git@gitlab.com/pushrocks/smartgulp.git"
"url": "https://code.foss.global/push.rocks/smartgulp.git"
},
"keywords": [
"gulp"
"build tool",
"gulp replacement",
"stream manipulation",
"file manipulation",
"typescript",
"task runner",
"pipeline",
"development tool"
],
"author": "Lossless GmbH",
"license": "MIT",
"bugs": {
"url": "https://gitlab.com/pushrocks/smartgulp/issues"
"url": "https://gitlab.com/push.rocks/smartevent/issues"
},
"homepage": "https://gitlab.com/pushrocks/smartgulp#README",
"homepage": "https://code.foss.global/push.rocks/smartgulp",
"devDependencies": {
"@git.zone/tsbuild": "^2.1.66",
"@git.zone/tsbuild": "^2.1.72",
"@git.zone/tsrun": "^1.2.44",
"@git.zone/tstest": "^1.0.77",
"@git.zone/tstest": "^1.0.88",
"@push.rocks/tapbundle": "^5.0.8",
"@types/node": "^20.10.0",
"gulp-function": "^2.2.14"
"@types/node": "^20.11.25",
"@push.rocks/gulp-function": "^2.2.14"
},
"dependencies": {
"@push.rocks/smartevent": "^2.0.5",
"@push.rocks/smartfile": "^11.0.4",
"@push.rocks/smartpromise": "^4.0.2",
"@push.rocks/smartstream": "^3.0.30",
"@push.rocks/smartstream": "^3.0.33",
"@types/through2": "^2.0.41",
"through2": "^4.0.2"
},
@ -55,4 +62,4 @@
"npmextra.json",
"readme.md"
]
}
}

757
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

1
readme.hints.md Normal file
View File

@ -0,0 +1 @@

117
readme.md
View File

@ -1,38 +1,103 @@
# @push.rocks/smartevent
# @push.rocks/smartgulp
lightweight gulp replacement
## Availabililty and Links
* [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/)
## Install
To install `@push.rocks/smartgulp`, use the following command in your terminal:
## Status for master
```bash
npm install @push.rocks/smartgulp --save-dev
```
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/@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/@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)
This will add `smartgulp` to your project's `devDependencies`. `smartgulp` is designed to be a lightweight replacement for `gulp`, thus assuming its role in development processes rather than in production environments.
## Usage
In this section, we'll dive into how to effectively utilize `@push.rocks/smartgulp` within your project. `smartgulp` aims to present a simplified interface for handling file streams and processing, similar to traditional `gulp` but with a modernized API and reduced complexity.
## Contribution
### Basic Stream Creation and File Manipulation
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). :)
First, let's demonstrate how to create a stream from source files and then manipulate these files, ultimately saving the transformed files to a desired directory.
For further information read the linked docs at the top of this readme.
```typescript
// Import smartgulp methods
import { src, dest } from '@push.rocks/smartgulp';
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
// Create a stream from source files using the `src` function
src(['src/**/*.ts']) // Specify the glob pattern
.pipe(
// Example transformation: Convert TypeScript to JavaScript
// Use your desired transformer here
ts() // Assuming `ts()` is a function returning a Transform stream
)
.pipe(
// Save the transformed files to the 'dist' directory
dest('dist')
);
```
[![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com)
In the example above, `src(['src/**/*.ts'])` creates a stream that reads all TypeScript files in the `src` directory. Each file is then transformed (for instance, compiled from TypeScript to JavaScript, though the actual transformation function `ts()` is illustrative) and finally written to the `dist` directory via `dest('dist')`.
### Advanced Usage: Custom Transformations
`smartgulp` can be extended with custom transformations, allowing you to perform virtually any file manipulation task. Heres how you can create and use custom transform streams:
```typescript
import { src, dest } from '@push.rocks/smartgulp';
import { Transform } from 'stream';
// Creating a custom transform to prefix file contents
const prefixTransform = new Transform({
objectMode: true,
transform(file, encoding, callback) {
const prefix = '/* Prefixed content */\n';
file.contents = Buffer.from(prefix + file.contents.toString());
callback(null, file); // Pass the modified file along the stream
}
});
// Usage in a pipeline
src(['src/**/*.js']) // Adjust glob pattern as needed
.pipe(prefixTransform) // Apply custom prefixing
.pipe(dest('dist')); // Output to 'dist' directory
```
In this scenario, `prefixTransform` is a custom transformation that prepends a comment to the contents of each `.js` file fetched through `src(['src/**/*.js'])`. After transformation, the files are written to the `dist` directory.
### Combining with Other Libraries
`@push.rocks/smartgulp` can be seamlessly integrated with other libraries, making it easy to enhance your build pipeline with additional functionality like linting, minification, and more.
```typescript
import { src, dest } from '@push.rocks/smartgulp';
import someOtherLib from 'some-other-lib';
src(['src/**/*.css']) // Example with CSS files
.pipe(
// Assuming `someOtherLib` provides a method for CSS minification
someOtherLib.minifyCSS()
)
.pipe(dest('dist'));
```
### Conclusion
`@push.rocks/smartgulp` offers a simplified, promise-based approach to stream processing and file manipulation. By leveraging its functionality along with custom and third-party transforms, you can create powerful and efficient build pipelines tailored to your project's needs. Whether you're compiling, bundling, minifying, or simply copying files, `smartgulp` provides a lightweight, flexible foundation for your automated workflows.
## License and Legal Information
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
### Trademarks
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
### Company Information
Task Venture Capital GmbH
Registered at District court Bremen HRB 35230 HB, Germany
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartgulp',
version: '3.0.2',
version: '3.0.4',
description: 'lightweight gulp replacement'
}

14
tsconfig.json Normal file
View File

@ -0,0 +1,14 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"verbatimModuleSyntax": true
},
"exclude": [
"dist_*/**/*.d.ts"
]
}