From ff6a51eab7c1600a9c234706676a786862c55124 Mon Sep 17 00:00:00 2001 From: Shazron Abdullah Date: Mon, 8 Jan 2024 22:02:11 +0800 Subject: [PATCH] fix: update node engines to 18+, CI to test 18, 20, update eslint-config and eslint errors --- .github/workflows/node.js.yml | 2 +- .github/workflows/on-push-publish-to-npm.yml | 2 +- .github/workflows/prerelease.yml | 4 ++-- package.json | 22 +++++++++++--------- src/telemetry-lib.js | 10 ++++----- 5 files changed, 21 insertions(+), 19 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 45165aa..7efb816 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -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: diff --git a/.github/workflows/on-push-publish-to-npm.yml b/.github/workflows/on-push-publish-to-npm.yml index b0e9540..9f8de3d 100644 --- a/.github/workflows/on-push-publish-to-npm.yml +++ b/.github/workflows/on-push-publish-to-npm.yml @@ -13,7 +13,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 diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 177de55..7615a24 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -26,13 +26,13 @@ jobs: git config user.email github-actions@github.com - uses: actions/setup-node@v1 with: - node-version: 16 + node-version: 18 - run: | npm install npm test - name: Update your package.json with an npm pre-release version id: pre-release-version - uses: adobe/update-prerelease-npm-version@v1.0.0 + uses: adobe/update-prerelease-npm-version@v1.1.0 with: pre-release-tag: ${{ github.event.inputs.pre-release-tag }} dependencies-to-update: ${{ github.event.inputs.dependencies-to-update }} diff --git a/package.json b/package.json index 8b8df4a..33df8eb 100644 --- a/package.json +++ b/package.json @@ -15,27 +15,29 @@ "splunk-logging": "^0.11.1" }, "devDependencies": { - "@adobe/eslint-config-aio-lib-config": "^1.4.0", + "@adobe/eslint-config-aio-lib-config": "^2.0.2", "babel-runtime": "^6.26.0", - "eslint": "^7.32.0", + "eslint": "^8.56.0", "eslint-config-oclif": "^1", - "eslint-config-standard": "^16.0.3", - "eslint-plugin-import": "^2.25.4", - "eslint-plugin-jest": "^23.20.0", - "eslint-plugin-jsdoc": "^37.9.7", + "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": "^5.2.0", + "eslint-plugin-promise": "^6.1.1", "eslint-plugin-standard": "^4.0.1", "execa": "^4.0.2", - "jest": "^26.6.3", + "jest": "^29", "jest-fetch-mock": "^3.0.0", "jest-junit": "^13.0.0", "jest-plugin-fs": "^2.9.0", "oclif": "^3.2.0", - "stdout-stderr": "^0.1.9" + "stdout-stderr": "^0.1.9", + "typescript": "^5.3.3" }, "engines": { - "node": "^14.18 || ^16.13 || >=18" + "node": ">=18" }, "files": [ "/npm-shrinkwrap.json", diff --git a/src/telemetry-lib.js b/src/telemetry-lib.js index a09c31f..e17c1b5 100644 --- a/src/telemetry-lib.js +++ b/src/telemetry-lib.js @@ -72,18 +72,18 @@ async function trackEvent (eventType, eventData = '') { headers: fetchHeaders, body: JSON.stringify({ id: Math.floor(timestamp * Math.random()), - timestamp: timestamp, + timestamp, _adobeio: { - eventType: eventType, - eventData: eventData, + eventType, + eventData, cliVersion: rootCliVersion, - clientId: clientId, + clientId, command: prerunEvent.command, commandDuration: timestamp - prerunEvent.start, commandFlags: prerunEvent.flags.toString(), commandSuccess: eventType !== 'command-error', nodeVersion: process.version, - osNameVersion: osNameVersion + osNameVersion } }) }