Compare commits

..

No commits in common. "master" and "v1.0.26" have entirely different histories.

6 changed files with 176 additions and 109 deletions

137
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,137 @@
# 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
# ====================
# 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
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 tslint typescript
- npmci npm prepare
- npmci npm install
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
tags:
- lossless
- docker
- priv
trigger:
stage: metadata
script:
- npmci trigger
only:
- tags
tags:
- lossless
- docker
- notpriv
pages:
stage: metadata
script:
- npmci node install lts
- npmci command npm install -g @git.zone/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

View File

@ -6,22 +6,12 @@
"gitzone": {
"projectType": "npm",
"module": {
"githost": "code.foss.global",
"githost": "gitlab.com",
"gitscope": "push.rocks",
"gitrepo": "smartlegal",
"description": "A module for handling legal aspects of software projects programmatically, including license checking.",
"description": "go legal programmatically",
"npmPackagename": "@push.rocks/smartlegal",
"license": "MIT",
"keywords": [
"legal",
"license checking",
"programmatic compliance",
"software licensing",
"dependency management"
]
"license": "MIT"
}
},
"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/smartlegal",
"version": "1.0.27",
"version": "1.0.26",
"private": false,
"description": "A module for handling legal aspects of software projects programmatically, including license checking.",
"description": "go legal programmatically",
"main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts",
"scripts": {
@ -12,21 +12,20 @@
},
"repository": {
"type": "git",
"url": "https://code.foss.global/push.rocks/smartlegal.git"
"url": "git+ssh://git@gitlab.com/push.rocks/smartlegal.git"
},
"keywords": [
"legal",
"license checking",
"programmatic compliance",
"software licensing",
"dependency management"
"docs",
"privacy",
"policy"
],
"author": "Lossless GmbH",
"license": "MIT",
"bugs": {
"url": "https://gitlab.com/push.rocks/smartlegal/issues"
},
"homepage": "https://code.foss.global/push.rocks/smartlegal",
"homepage": "https://gitlab.com/push.rocks/smartlegal#README",
"dependencies": {
"@push.rocks/smartmarkdown": "^3.0.1",
"@push.rocks/smartmustache": "^3.0.2",
@ -58,4 +57,4 @@
"last 1 chrome versions"
],
"type": "module"
}
}

View File

@ -1 +0,0 @@

112
readme.md
View File

@ -1,99 +1,41 @@
# @push.rocks/smartlegal
go legal programmatically
## Install
## Availabililty and Links
* [npmjs.org (npm package)](https://www.npmjs.com/package/@push.rocks/smartlegal)
* [gitlab.com (source)](https://gitlab.com/push.rocks/smartlegal)
* [github.com (source mirror)](https://github.com/push.rocks/smartlegal)
* [docs (typedoc)](https://push.rocks.gitlab.io/smartlegal/)
You can install `@push.rocks/smartlegal` using npm:
## Status for master
```bash
npm install @push.rocks/smartlegal --save
```
Or using Yarn:
```bash
yarn add @push.rocks/smartlegal
```
Ensure you have TypeScript and the necessary TypeScript types installed for optimal development experience:
```bash
npm install typescript @types/node --save-dev
```
Status Category | Status Badge
-- | --
GitLab Pipelines | [![pipeline status](https://gitlab.com/push.rocks/smartlegal/badges/master/pipeline.svg)](https://lossless.cloud)
GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/push.rocks/smartlegal/badges/master/coverage.svg)](https://lossless.cloud)
npm | [![npm downloads per month](https://badgen.net/npm/dy/@push.rocks/smartlegal)](https://lossless.cloud)
Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/push.rocks/smartlegal)](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/smartlegal)](https://lossless.cloud)
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@push.rocks/smartlegal)](https://lossless.cloud)
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@push.rocks/smartlegal)](https://lossless.cloud)
## Usage
`@push.rocks/smartlegal` offers a streamlined approach to handling legal operations programmatically. It is designed with ease-of-use in mind, allowing developers to integrate legal checks into their workflow. The primary feature as showcased in the current version is a license checker, which is invaluable for projects that need to ensure compliance with legal requirements regarding dependencies' licenses.
Use TypeScript for best in class instellisense.
smartlegal implements
### Getting Started
- a license checker for checking dependency trees against a set of licenses
To use `@push.rocks/smartlegal`, first import the module in your TypeScript project:
## Contribution
```typescript
import { createLicenseChecker } from '@push.rocks/smartlegal';
```
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). :)
### Checking Licenses
For further information read the linked docs at the top of this readme.
The module provides functions to either include or exclude specific licenses within your project's dependencies, making it easier to manage legal compliance.
#### Excluding Specific Licenses
If you want to exclude specific licenses, you may use the `excludeLicenseWithinPath` function. This function checks all dependencies and lists those not compliant with the specified licenses.
```typescript
(async () => {
const licenseChecker = await createLicenseChecker();
const checkResult = await licenseChecker.excludeLicenseWithinPath('./', ['MIT']);
console.log('Passing modules (compliant):', checkResult.passingModules);
console.log('Failing modules (non-compliant):', checkResult.failingModules);
})();
```
#### Including Specific Licenses
Conversely, to ensure only dependencies with certain licenses are used, employ the `includeLicencesWithinPath` function.
```typescript
(async () => {
const licenseChecker = await createLicenseChecker();
const checkResult = await licenseChecker.includeLicencesWithinPath('./', ['MIT']);
console.log('Passing modules (compliant):', checkResult.passingModules);
console.log('Failing modules (non-compliant):', checkResult.failingModules);
})();
```
### Understanding the Results
Both `excludeLicenseWithinPath` and `includeLicencesWithinPath` methods return a `CheckResult` object containing two arrays: `passingModules` and `failingModules`.
- `passingModules` includes all dependencies that meet your specified criteria (either included or excluded licenses).
- `failingModules` lists those dependencies that do not meet the criteria, aiding in identifying potential legal compliance issues quickly.
### Integration into CI/CD Pipelines
`@push.rocks/smartlegal` is designed to be easily integrated into CI/CD pipelines, enabling automated checks for license compliance. By incorporating the above examples into your build or deployment scripts, you can halt the pipeline if non-compliant dependencies are detected, ensuring legal compliance at each stage of development.
## Conclusion
`@push.rocks/smartlegal` provides an essential tool for managing the legal aspects of your project's dependencies. By leveraging its functionality, developers can ensure compliance with legal requirements, minimizing risks associated with software licenses. As projects evolve and dependencies change, `@push.rocks/smartlegal` simplifies the ongoing maintenance of legal compliance, making it an invaluable addition to any project.
## 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.
## 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)

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartlegal',
version: '1.0.27',
version: '1.0.26',
description: 'go legal programmatically'
}