Skip to content

Commit

Permalink
fix: update node engines to 18+, CI to test 18, 20, update eslint-con…
Browse files Browse the repository at this point in the history
…fig and eslint errors (#30)

* updated codecov
  • Loading branch information
shazron authored Jan 8, 2024
1 parent 1416fba commit 19b5cf5
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 34 deletions.
11 changes: 11 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"env": {
"node": true,
"es6": true,
"jest": true
},
"parserOptions": {
"ecmaVersion": 2018
},
"extends": "@adobe/eslint-config-aio-lib-config"
}
9 changes: 4 additions & 5 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [14.x, 16.x]
node-version: [18.x, 20.x]
os: [ubuntu-latest, windows-latest]

steps:
Expand All @@ -31,7 +31,6 @@ jobs:
- run: npm test
- name: upload coverage
if: success()
run: curl -s https://codecov.io/bash | bash
env:
CODECOV_NAME: ${{ runner.os }} node.js ${{ matrix.node-version }}
shell: bash
uses: codecov/[email protected]
with:
name: ${{ runner.os }} node.js ${{ matrix.node-version }}
2 changes: 1 addition & 1 deletion .github/workflows/on-push-publish-to-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16
node-version: 18
- run: npm install
- run: npm test
- uses: JS-DevTools/npm-publish@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
git config user.email [email protected]
- uses: actions/setup-node@v1
with:
node-version: 16
node-version: 18
- run: |
npm install
npm test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
ref: ${{ github.event.inputs.branch }}
- uses: actions/setup-node@v1
with:
node-version: 16
node-version: 18
- run: |
npm install
npm test
Expand Down
31 changes: 13 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,22 @@
"node-forge": "^1.3.0"
},
"devDependencies": {
"codecov": "^3.2.0",
"eslint": "^6.8.0",
"@adobe/eslint-config-aio-lib-config": "^2.0.2",
"eslint": "^8.56.0",
"eslint-config-oclif": "^4.0.0",
"eslint-config-standard": "^14.1.0",
"eslint-plugin-import": "^2.13.10",
"eslint-plugin-jest": "^23.6.0",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-promise": "^4.0.0",
"eslint-plugin-standard": "^4.0.0",
"jest": "^24.1.0",
"jest-junit": "^10.0.0",
"jest-resolve": "^26.0.0",
"oclif": "^3.2.0",
"stdout-stderr": "^0.1.9"
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jest": "^27.6.1",
"eslint-plugin-jsdoc": "^42.0.0",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^6.1.1",
"jest": "^29",
"stdout-stderr": "^0.1.9",
"typescript": "^5.3.3"
},
"engines": {
"node": "^14.18 || ^16.13 || >=18"
"node": ">=18"
},
"files": [
"/oclif.manifest.json",
Expand Down Expand Up @@ -62,10 +61,6 @@
"coveragePathIgnorePatterns": [
"<rootDir>/tests/fixtures/"
],
"reporters": [
"default",
"jest-junit"
],
"testEnvironment": "node",
"setupFilesAfterEnv": [
"./test/jest.setup.js"
Expand Down
16 changes: 8 additions & 8 deletions src/certificate.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,20 @@ function fingerprint (pemCert) {
-newkey rsa:bits generate a new RSA key of 'bits' in size
-keyout arg file to send the key to
-out arg output file
*/
*/

/**
* Generates a certificate and a private key pair
* Similar to openssl req -x509 -sha256 -nodes -days 365 -subj "/C=US/" -newkey rsa:2048
*
* @param {string} commonName
* @param {string} commonName the common name of the cert
* @param {number} days (integer)
* @param {object} [attributes={}] optional certificate attributes
* @param {string} [attributes.country]
* @param {string} [attributes.state]
* @param {string} [attributes.locality]
* @param {string} [attributes.organization]
* @param {string} [attributes.unit]
* @param {string} [attributes.country] the cert country
* @param {string} [attributes.state] the cert state
* @param {string} [attributes.locality] the cert locality
* @param {string} [attributes.organization] the cert organization
* @param {string} [attributes.unit] the cert unit (in the org)
* @returns {{privateKey: string, cert: string}} key pair
*/
function generate (commonName, days, /* istanbul ignore next */ attributes = {}) {
Expand Down Expand Up @@ -146,7 +146,7 @@ function generate (commonName, days, /* istanbul ignore next */ attributes = {})
* Verifies a valid pem certificate and returns information about its validity
* Throws if the input is not a valid pem certificate.
*
* @param {string|Buffer} pemCert
* @param {string|Buffer} pemCert the contents of the cert
* @returns {{verified: boolean, validUntil: Date, validSince: Date}} key pair
*/
function verify (pemCert) {
Expand Down

0 comments on commit 19b5cf5

Please sign in to comment.