Skip to content

Commit

Permalink
use tsup and create monorepo structure
Browse files Browse the repository at this point in the history
  • Loading branch information
erossignon committed Sep 2, 2023
1 parent accad9d commit baf82d9
Show file tree
Hide file tree
Showing 146 changed files with 8,394 additions and 7,270 deletions.
123 changes: 79 additions & 44 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: CI
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [master]
branches: [master]
pull_request:
branches: [master]

Expand All @@ -15,15 +15,37 @@ on:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build-new:
# The type of runner that the job will run on
build:
strategy:
matrix:
node-version: [20.x]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20.0.0
- run: npm install
- run: npm run build
- name: Cache dependencies
uses: actions/cache/save@v3
with:
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
path: node_modules
- name: Cache build artifacts
uses: actions/cache/save@v3
with:
key: dist-${{ hashFiles('**/dist/**') }}
path: dist

test-new:
needs: build
strategy:
matrix:
node-version: [19.x, 20.x]
os: [ubuntu-20.04, ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: checkout
Expand All @@ -34,25 +56,25 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: openssl
run: openssl version
- name: nodejs
run: node --version

# Runs a set of commands using the runners shell
- name: build
run: |
npm install typescript mocha ts-node @types/node@18 npm -g
npm install
npm run test
build:
# The type of runner that the job will run on
- name: Restore dependencies
uses: actions/cache/restore@v3
with:
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
path: node_modules
- name: Restore build artifacts
uses: actions/cache/restore@v3
with:
key: dist-${{ hashFiles('**/dist/**') }}
path: dist
- run: npm test

test:
needs: build
strategy:
matrix:
node-version: [ 16.x, 18.x]
node-version: [16.x, 18.x]
os: [ubuntu-20.04, ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: checkout
Expand All @@ -62,30 +84,36 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: openssl
run: openssl version
- name: nodejs
run: node --version

# Runs a set of commands using the runners shell
- name: build
run: |
npm install npm@9 -g
npm install typescript mocha ts-node @types/node@${{ matrix.node-version }} -g
npm install
npm run test
build-legacy:
# The type of runner that the job will run on
- name: Restore dependencies
uses: actions/cache/restore@v3
with:
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
path: node_modules
- name: Restore build artifacts
uses: actions/cache/restore@v3
with:
path: dist
key: dist-${{ hashFiles('**/dist/**') }}

- run: npm test

test-legacy:
needs: build
strategy:
matrix:
node-version: [ 14.x]
node-version: [14.x]
os: [
# ubuntu-18.04,
ubuntu-20.04, ubuntu-latest, macos-latest, windows-latest
]
# ubuntu-18.04,
ubuntu-20.04,
ubuntu-latest,
macos-latest,
windows-latest,
]
runs-on: ${{ matrix.os }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: checkout
Expand All @@ -96,14 +124,21 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: openssl
run: openssl version
- name: nodejs
run: node --version

# Runs a set of commands using the runners shell
- name: build
run: |
npm install typescript mocha ts-node @types/node@${{ matrix.node-version }} npm@8 -g
npm install
npm run test
- name: nodejs
run: node --version

- name: Restore dependencies
uses: actions/cache/restore@v3
with:
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
path: node_modules
- name: Restore build artifacts
uses: actions/cache/restore@v3
with:
path: dist
key: dist-${{ hashFiles('**/dist/**') }}

- run: npm test
7 changes: 0 additions & 7 deletions .mocharc.json

This file was deleted.

100 changes: 1 addition & 99 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,102 +18,4 @@ NodeOPCUA Crypto is a powerful JavaScript module for handling security and crypt
* compatible with TypeScript for robust, type-safe coding.
* implements advanced security standards for OPCUA.

## Getting Started

To use NodeOPCUA Crypto in your project, follow these steps:

#### Installation

``` bash
npm install nodeopcua-crypto
```

### Usage

``` bash

import { generatePrivateKey, privateKeyToPEM, CertificatePurpose, createSelfSignedCertificate } from "node-opcua-crypto";

async function demonstratePrivateKeyAndSelfSignedCertificateCreation() {

// create the Private Key
const privateKey = await generatePrivateKey();

// convert the private key to a PEM format
const { privPem } = await privateKeyToPEM(privateKey);

console.log(privPem);

// create a self-sign certificate
const { cert } = await createSelfSignedCertificate({
privateKey,
notAfter: new Date(2025, 1, 1),
notBefore: new Date(2019, 1, 1),
subject: "CN=Test",
dns: ["DNS1", "DNS2"],
ip: ["192.168.1.1"],
applicationUri: "urn:HOSTNAME:ServerDescription",
purpose: CertificatePurpose.ForApplication,
});
console.log(cert);
}
demonstratePrivateKeyAndSelfSignedCertificateCreation();


```
Please refer to the examples directory for more specific use cases and comprehensive samples.
## Support
For any inquiries or issues related to NodeOPCUA Crypto, you can contact us at contact@sterfive.com. Please note that priority support is available to NodeOPCUA Support Subscription members.
### Getting professional support
NodeOPCUA PKI is developed and maintained by sterfive.com.
To get professional support, consider subscribing to the node-opcua membership community:
[![Professional Support](https://img.shields.io/static/v1?style=for-the-badge&label=Professional&message=Support&labelColor=blue&color=green&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4PSIwcHgiIHk9IjBweCIgdmlld0JveD0iMCA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MsMjEuNDk4ICAgIGwxMTEuOTQ1LDExMS43ODVjMC4wNjEtMC4wNiwwLjExMS0wLjExMywwLjE3Mi0wLjE3NGM3LjIzOC03LjIyOCwxNS4zNTUtMTQuODg1LDIzLjI5MS0yMi4xNjcgICAgQzE5OC41MzQsMTA4LjcxMywxOTguNjg0LDEwMC44NjMsMTkzLjg1NCw5Ni4wNDF6Ii8+DQoJPC9nPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPC9zdmc+)](https://support.sterfive.com)
or contact [sterfive](https://www.sterfive.com) for dedicated consulting and more advanced support.
## Contributing
We appreciate contributions from the community. To contribute:
* Fork the repository.
* Create a new branch.
* Commit your changes.
* Submit a pull request.
* Sign the CLA (Contributor Licence Agreement) form
For more detailed instructions, refer to the CONTRIBUTING.md file.
## License
NodeOPCUA Crypto is MIT licensed. See the LICENSE file for full license details.
Copyright © 2023 Sterfive.com.
## Disclaimer
NodeOPCUA Crypto is provided as-is, and while we strive to ensure its quality and security, Sterfive.com cannot be held liable for any damage caused directly or indirectly by the usage of this module.
Please report any issues or vulnerabilities you find via the issue tracker.
Thank you for considering NodeOPCUA Crypto for your OPCUA cryptography needs. We look forward to seeing what you build with i
## :heart: Supporting the development effort - Sponsors & Backers</span>
If you like node-opcua-pki and if you are relying on it in one of your projects, please consider becoming a backer and [sponsoring us](https://github.com/sponsors/node-opcua), this will help us to maintain a high-quality stack and constant evolution of this module.
If your company would like to participate and influence the development of future versions of node-opcua please contact [sterfive](mailto:contact@sterfive.com).
<!--
https://app.fossa.com/reports/489947c3-2e83-48e5-8351-192f553ded57
https://linuxctl.com/2017/02/x509-certificate-manual-signature-verification/
-->
[more details](./packages/node-opcua-crypto/README.md)
2 changes: 0 additions & 2 deletions index.d.ts

This file was deleted.

4 changes: 0 additions & 4 deletions index.js

This file was deleted.

1 change: 0 additions & 1 deletion index_web.d.ts

This file was deleted.

Loading

0 comments on commit baf82d9

Please sign in to comment.