Apply dependencies update (#485)
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 21 Aug 2021 19:08:24 +0000 (21:08 +0200)
committerGitHub <noreply@github.com>
Sat, 21 Aug 2021 19:08:24 +0000 (21:08 +0200)
* Apply dependencies update

And fix some token name.

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
* Silence linter warnings

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
* Fix GH actions run after repository move.

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
* Use sonarcloud GitHub action

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
.github/PULL_REQUEST_TEMPLATE.md
.github/workflows/ci.yml
.github/workflows/generate-typedoc.yml
.github/workflows/npmpublish.yml
package-lock.json
package.json
sonar-project.properties
src/pools/abstract-pool.ts
src/pools/selection-strategies.ts
src/worker/abstract-worker.ts

index c3b4f4f1bdfe4c4145115c52e98c3a126e9fb402..4beb6701fb137b5dd153789ebf65f43d3712d6fa 100644 (file)
@@ -1,6 +1,6 @@
 <!--
   Thanks for contributing to poolifier project.
-  Please be sure to read our [contributing guidelines](https://github.com/pioardi/poolifier/blob/pr-template/CONTRIBUTING.md).
+  Please be sure to read our [contributing guidelines](https://github.com/poolifier/poolifier/blob/pr-template/CONTRIBUTING.md).
 -->
 
 ## PR Checklist
index 8fd1920686e00e0dc458d732dcc7447effdb026e..4a560022108a12cf6bb86086987197b39ab25053 100644 (file)
@@ -47,9 +47,8 @@ jobs:
           CI: true
 
       - name: Sonar Code Analysis
-        if: "github.repository == 'pioardi/poolifier' && matrix.node-version == '14.x'"
-        run: |
-          npm run sonar
+        if: "github.repository == 'poolifier/poolifier' && matrix.node-version == '14.x'"
+        uses: SonarSource/sonarcloud-github-action@master
         env:
           GITHUB_TOKEN: ${{ secrets.USER_TOKEN }} # Needed to get PR information, if any
           SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
index bdca615fa36fe4386aa7285b2a4f3ca0cea11a83..842f466767741c4b0fd8adce9f4eb2846dc84895 100644 (file)
@@ -25,15 +25,15 @@ jobs:
           npm run typedoc
 
       - name: Commit files
-        if: "github.repository == 'pioardi/poolifier' && github.ref == 'refs/heads/master'"
+        if: "github.repository == 'poolifier/poolifier' && github.ref == 'refs/heads/master'"
         run: |
           git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
           git config --local user.name "github-actions[bot]"
           git commit -m "Generate TypeDoc" -a
 
       - name: Push changes
-        if: "github.repository == 'pioardi/poolifier' && github.ref == 'refs/heads/master'"
+        if: "github.repository == 'poolifier/poolifier' && github.ref == 'refs/heads/master'"
         uses: ad-m/github-push-action@master
         with:
-          github_token: ${{ secrets.GITHUB_TOKEN }}
+          github_token: ${{ secrets.USER_TOKEN }}
           branch: master
index a2f85f19362693f3ff290cf2266f1584703b35bf..99e81f18b20928f3d7bb0800e6abcc3c0c678baa 100644 (file)
@@ -58,10 +58,10 @@ jobs:
         if: ${{ contains(steps.package-version.outputs.version, '-') == false }}
         run: npm publish
         env:
-          NODE_AUTH_TOKEN: ${{secrets.npm_token}}
+          NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
 
       - name: Publish Beta
         if: ${{ contains(steps.package-version.outputs.version, 'beta') }}
         run: npm publish --tag beta
         env:
-          NODE_AUTH_TOKEN: ${{secrets.npm_token}}
+          NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
index 7eb19f9a46ba31c0312c9571bce6c8a3b914a533..5146d870b34445a07dcbf928a6bb950c6b7bdc02 100644 (file)
       "dev": true
     },
     "@types/node": {
-      "version": "14.17.10",
-      "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.10.tgz",
-      "integrity": "sha512-09x2d6kNBwjHgyh3jOUE2GE4DFoxDriDvWdu6mFhMP1ysynGYazt4ecZmJlL6/fe4Zi2vtYvTvtL7epjQQrBhA==",
+      "version": "14.17.11",
+      "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.11.tgz",
+      "integrity": "sha512-n2OQ+0Bz6WEsUjrvcHD1xZ8K+Kgo4cn9/w94s1bJS690QMUWfJPW/m7CCb7gPkA1fcYwL2UpjXP/rq/Eo41m6w==",
       "dev": true
     },
     "@types/parse-json": {
       "dev": true
     },
     "mocha": {
-      "version": "9.0.3",
-      "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.0.3.tgz",
-      "integrity": "sha512-hnYFrSefHxYS2XFGtN01x8un0EwNu2bzKvhpRFhgoybIvMaOkkL60IVPmkb5h6XDmUl4IMSB+rT5cIO4/4bJgg==",
+      "version": "9.1.0",
+      "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.1.0.tgz",
+      "integrity": "sha512-Kjg/XxYOFFUi0h/FwMOeb6RoroiZ+P1yOfya6NK7h3dNhahrJx1r2XIT3ge4ZQvJM86mdjNA+W5phqRQh7DwCg==",
       "dev": true,
       "requires": {
         "@ungap/promise-all-settled": "1.1.2",
         }
       }
     },
-    "sonar-scanner": {
-      "version": "3.1.0",
-      "resolved": "https://registry.npmjs.org/sonar-scanner/-/sonar-scanner-3.1.0.tgz",
-      "integrity": "sha1-UcHBEB9UuYq8XYVlIJsdkjKXk0M=",
-      "dev": true
-    },
     "source-map": {
       "version": "0.6.1",
       "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
index 2147090d33cd27fb5b28cb5b8cc7e1897e30c4b2..b3aee8e655e2326bff3865060b0b3f74b0894aac 100644 (file)
@@ -13,7 +13,6 @@
     "test": "npm run build && nyc mocha 'tests/**/*.test.js'",
     "test:debug": "npm run build && mocha --no-parallel --inspect 'tests/**/*.test.js'",
     "test:prod": "npm run build:prod && nyc mocha 'tests/**/*.test.js'",
-    "sonar": "sonar-scanner",
     "coverage": "nyc report --reporter=lcov",
     "coverage:html": "nyc report --reporter=html",
     "format": "prettier --loglevel silent --write .; prettierx --write .",
@@ -63,7 +62,7 @@
     "lib"
   ],
   "devDependencies": {
-    "@types/node": "^14.17.10",
+    "@types/node": "^14.17.11",
     "@typescript-eslint/eslint-plugin": "^4.29.2",
     "@typescript-eslint/parser": "^4.29.2",
     "benchmark": "^2.1.4",
@@ -78,7 +77,7 @@
     "eslint-plugin-spellcheck": "0.0.19",
     "expect": "^27.0.6",
     "microtime": "^3.0.0",
-    "mocha": "^9.0.3",
+    "mocha": "^9.1.0",
     "mochawesome": "^6.2.2",
     "nyc": "^15.1.0",
     "prettier": "^2.3.2",
@@ -91,7 +90,6 @@
     "rollup-plugin-istanbul": "^3.0.0",
     "rollup-plugin-terser": "^7.0.2",
     "rollup-plugin-typescript2": "^0.30.0",
-    "sonar-scanner": "^3.1.0",
     "source-map-support": "^0.5.19",
     "typedoc": "^0.21.6",
     "typescript": "^4.3.5"
index 4bd411a059030ac90e5dba334db47b4451ff5509..fbb18042522fbbccadf382c0d458d00d1c61b298 100644 (file)
@@ -6,6 +6,6 @@ sonar.projectVersion=2.0.0
 sonar.host.url=https://sonarcloud.io
 sonar.sources=src
 sonar.tests=tests
-# sonar.login=TOKEN #To use for local troubleshooting
+#sonar.login=TOKEN # To use for local troubleshooting
 sonar.verbose=false
 sonar.scm.exclusions.disabled=true
index a092dffde443b35d3c09fb8212b159ede3851c58..e0aa1810c4d839f39d29eee350ae010a6945ffab 100644 (file)
@@ -100,8 +100,7 @@ export abstract class AbstractPool<
   Worker extends IWorker,
   Data = unknown,
   Response = unknown
-> implements IPoolInternal<Worker, Data, Response>
-{
+> implements IPoolInternal<Worker, Data, Response> {
   /** @inheritdoc */
   public readonly workers: Worker[] = []
 
index 64ea7ee58509057d6cae4e235b07350f8f087e41..034b1612334abe6b83ad1943dd05857e7dad89b7 100644 (file)
@@ -41,8 +41,7 @@ interface IWorkerChoiceStrategy<Worker extends IWorker> {
  * @template Response Type of response of execution. This can only be serializable data.
  */
 class RoundRobinWorkerChoiceStrategy<Worker extends IWorker, Data, Response>
-  implements IWorkerChoiceStrategy<Worker>
-{
+  implements IWorkerChoiceStrategy<Worker> {
   /**
    * Index for the next worker.
    */
@@ -79,8 +78,7 @@ class LessRecentlyUsedWorkerChoiceStrategy<
   Worker extends IWorker,
   Data,
   Response
-> implements IWorkerChoiceStrategy<Worker>
-{
+> implements IWorkerChoiceStrategy<Worker> {
   /**
    * Constructs a worker choice strategy that selects based on less recently used.
    *
@@ -116,8 +114,7 @@ class LessRecentlyUsedWorkerChoiceStrategy<
  * @template Response Type of response of execution. This can only be serializable data.
  */
 class DynamicPoolWorkerChoiceStrategy<Worker extends IWorker, Data, Response>
-  implements IWorkerChoiceStrategy<Worker>
-{
+  implements IWorkerChoiceStrategy<Worker> {
   private workerChoiceStrategy: IWorkerChoiceStrategy<Worker>
 
   /**
@@ -132,11 +129,10 @@ class DynamicPoolWorkerChoiceStrategy<Worker extends IWorker, Data, Response>
     private createDynamicallyWorkerCallback: () => Worker,
     workerChoiceStrategy: WorkerChoiceStrategy = WorkerChoiceStrategies.ROUND_ROBIN
   ) {
-    this.workerChoiceStrategy =
-      SelectionStrategiesUtils.getWorkerChoiceStrategy(
-        this.pool,
-        workerChoiceStrategy
-      )
+    this.workerChoiceStrategy = SelectionStrategiesUtils.getWorkerChoiceStrategy(
+      this.pool,
+      workerChoiceStrategy
+    )
   }
 
   /** @inheritdoc */
@@ -215,8 +211,9 @@ export class WorkerChoiceStrategyContext<
   public setWorkerChoiceStrategy (
     workerChoiceStrategy: WorkerChoiceStrategy
   ): void {
-    this.workerChoiceStrategy =
-      this.getPoolWorkerChoiceStrategy(workerChoiceStrategy)
+    this.workerChoiceStrategy = this.getPoolWorkerChoiceStrategy(
+      workerChoiceStrategy
+    )
   }
 
   /**
index 9b76893b151beac1fb39cf239af7acd01c778a64..520be7cd0041ee29604a8f79ddf046b78677e702 100644 (file)
@@ -146,7 +146,7 @@ export abstract class AbstractWorker<
    * @returns Message of the error.
    */
   protected handleError (e: Error | string): string {
-    return e as unknown as string
+    return (e as unknown) as string
   }
 
   /**