chore: use `biome` instead of `rome`
authorEmanuele Stoppa <my.burning@gmail.com>
Fri, 8 Sep 2023 09:51:38 +0000 (10:51 +0100)
committerEmanuele Stoppa <my.burning@gmail.com>
Fri, 8 Sep 2023 10:01:21 +0000 (11:01 +0100)
.lintstagedrc.js
benchmarks/versus-external-pools/dynamic-worker-nodes.js
benchmarks/versus-external-pools/fixed-worker-nodes.js
biome.json [moved from rome.json with 90% similarity]
examples/typescript/http-client-pool/src/worker.ts
package.json
pnpm-lock.yaml
src/pools/thread/fixed.ts
src/pools/worker-node.ts
src/worker/abstract-worker.ts

index a9b248cd2ac2de2fbdad623b0d8fae757aa680c3..ed9df14abdca715893d9d825deb72938a006c897 100644 (file)
@@ -1,9 +1,9 @@
 module.exports = {
   '**/*.{ts,tsx,js,jsx,cjs,mjs}': [
-    'rome format --write',
+    'biome format --write --no-errors-on-unmatched',
     'ts-standard --fix',
     'eslint --cache --fix'
   ],
-  '!(.vscode/**)**/*.json': ['rome format --write'],
+  '!(.vscode/**)**/*.json': ['biome format --write --no-errors-on-unmatched'],
   '**/*.{md,yml,yaml}': ['prettier --cache --write']
 }
index 7a77d88278877f1acdcc037b8cd55717c76759ee..cdac7274ef993831e67d797edff731d09ae096af 100644 (file)
@@ -28,8 +28,7 @@ async function run () {
   // eslint-disable-next-line n/no-process-exit
   process.exit()
 }
-
-(async () => {
+;(async () => {
   try {
     await run()
   } catch (e) {
index d5b01353d2eb0a9c54272e9619080bec92d7bebb..9400840088e33e201d4526929606a9d3133a814d 100644 (file)
@@ -28,8 +28,7 @@ async function run () {
   // eslint-disable-next-line n/no-process-exit
   process.exit()
 }
-
-(async () => {
+;(async () => {
   try {
     await run()
   } catch (e) {
similarity index 90%
rename from rome.json
rename to biome.json
index 1c91a4d71d3cb58824e743c4b2dca65ddf410e8b..55a5f761d254a298a3dd1061e38a855f180d315a 100644 (file)
--- a/rome.json
@@ -1,5 +1,5 @@
 {
-  "$schema": "https://docs.rome.tools/schemas/12.1.3/schema.json",
+  "$schema": "https://biomejs.dev/schemas/1.1.2/schema.json",
   "organizeImports": {
     "enabled": false
   },
index b7c5962914cd0e0e8ab9604182232875c392c771..d9298e3fa6b8fc3a76fc0b291c92d1471e667b6d 100644 (file)
@@ -11,7 +11,7 @@ class HttpClientWorker extends ThreadWorker<WorkerData, WorkerResponse> {
     super({
       node_fetch: async (workerData?: WorkerData) => {
         const response = await nodeFetch(
-          (workerData as WorkerData).input as URL | NodeFetchRequestInfo,
+          (workerData as WorkerData).input,
           workerData?.init as NodeFetchRequestInit
         )
         // The response is not structured-cloneable, so we return the response text body instead.
index f008ac135853433f6f4d35d0d39f1db1a367a4dd..ae19024f74287448137f8a0a7ec1390d5e1d105b 100644 (file)
@@ -26,7 +26,7 @@
     "test:debug": "pnpm build && mocha --no-parallel --inspect 'tests/**/*.test.js'",
     "coverage": "c8 report --reporter=lcov",
     "coverage:html": "c8 report --reporter=html",
-    "format": "rome format . --write; ts-standard . --fix",
+    "format": "biome format . --write; ts-standard . --fix",
     "lint": "eslint . --cache",
     "lint:fix": "eslint . --cache --fix",
     "lint:report": "eslint . --cache --format json --output-file reports/eslint.json",
     }
   },
   "devDependencies": {
+    "@biomejs/biome": "1.1.2",
     "@commitlint/cli": "^17.7.1",
     "@commitlint/config-conventional": "^17.7.0",
     "@release-it/bumper": "^5.1.0",
     "rollup-plugin-command": "^1.1.3",
     "rollup-plugin-delete": "^2.0.0",
     "rollup-plugin-dts": "^6.0.1",
-    "rome": "^12.1.3",
     "sinon": "^15.2.0",
     "source-map-support": "^0.5.21",
     "ts-standard": "^12.0.2",
index 9f74e920717450aeade8d783261665bf7ed34a06..11c2bb200ad979fce126d2a2eab0b2fa1c3bde9c 100644 (file)
@@ -8,6 +8,9 @@ overrides:
   semver: ^7.5.3
 
 devDependencies:
+  '@biomejs/biome':
+    specifier: 1.1.2
+    version: 1.1.2
   '@commitlint/cli':
     specifier: ^17.7.1
     version: 17.7.1
@@ -113,9 +116,6 @@ devDependencies:
   rollup-plugin-dts:
     specifier: ^6.0.1
     version: 6.0.1(rollup@3.29.0)(typescript@5.2.2)
-  rome:
-    specifier: ^12.1.3
-    version: 12.1.3
   sinon:
     specifier: ^15.2.0
     version: 15.2.0
@@ -196,6 +196,74 @@ packages:
     resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==}
     dev: true
 
+  /@biomejs/biome@1.1.2:
+    resolution: {integrity: sha512-JEVWchqo0Xhl86IJgOh0xESWnNRUXBUDByCBR8TA4lIPzm/6U6Tv77+MblNkZ8MvwCtP6PlBNGdQcGKKabtuHA==}
+    engines: {node: '>=14.*'}
+    hasBin: true
+    requiresBuild: true
+    optionalDependencies:
+      '@biomejs/cli-darwin-arm64': 1.1.2
+      '@biomejs/cli-darwin-x64': 1.1.2
+      '@biomejs/cli-linux-arm64': 1.1.2
+      '@biomejs/cli-linux-x64': 1.1.2
+      '@biomejs/cli-win32-arm64': 1.1.2
+      '@biomejs/cli-win32-x64': 1.1.2
+    dev: true
+
+  /@biomejs/cli-darwin-arm64@1.1.2:
+    resolution: {integrity: sha512-YyqWeNZchPxlvxtdo2vMBkzrwllaNS3+DZ6j01mUCVIZE9kAzF/edMV2O38L2AEtnRLU1TI1f71Jai3ThILClg==}
+    engines: {node: '>=14.*'}
+    cpu: [arm64]
+    os: [darwin]
+    requiresBuild: true
+    dev: true
+    optional: true
+
+  /@biomejs/cli-darwin-x64@1.1.2:
+    resolution: {integrity: sha512-Sofxcu50AHJyQS6Xx3OF2egQQ7Un5YFVF5/umNFa+kSNrrCu/ucmzrk8FcGS2dOSs4L2LqD6ZDWjvbcikjzLYQ==}
+    engines: {node: '>=14.*'}
+    cpu: [x64]
+    os: [darwin]
+    requiresBuild: true
+    dev: true
+    optional: true
+
+  /@biomejs/cli-linux-arm64@1.1.2:
+    resolution: {integrity: sha512-wtaQgpoVMZEKf1GlDlFGAJP1j6gnh4L4kJN8PQPOBAdKIUZ/YSjqVp0z28vli5xCQ57xCn1gH4Xoqw2gVYu1tQ==}
+    engines: {node: '>=14.*'}
+    cpu: [arm64]
+    os: [linux]
+    requiresBuild: true
+    dev: true
+    optional: true
+
+  /@biomejs/cli-linux-x64@1.1.2:
+    resolution: {integrity: sha512-TYIUjCXbY+kxnJgv8GESplMagB1GdOcMV21JGRATqnhUI4BvG6sjs3gfi+sdjLBQdbHhsISXW3yfUlv07HKqhg==}
+    engines: {node: '>=14.*'}
+    cpu: [x64]
+    os: [linux]
+    requiresBuild: true
+    dev: true
+    optional: true
+
+  /@biomejs/cli-win32-arm64@1.1.2:
+    resolution: {integrity: sha512-yApn85KuJ+Ty5zxbqWnaifX4ONtZG+snu12RNKi8fxSVVCXzQ/k2PfsWQbsyvCG05qshSvNKtM54cuf+vhUIsw==}
+    engines: {node: '>=14.*'}
+    cpu: [arm64]
+    os: [win32]
+    requiresBuild: true
+    dev: true
+    optional: true
+
+  /@biomejs/cli-win32-x64@1.1.2:
+    resolution: {integrity: sha512-qebNvIrFj2TJ+K0JVGo1HkgV2y5jis6aOZDC1SWuk53GnqjSLdR+p1v86ZByOjYr1v+tjc67EXmEepk06VVvpA==}
+    engines: {node: '>=14.*'}
+    cpu: [x64]
+    os: [win32]
+    requiresBuild: true
+    dev: true
+    optional: true
+
   /@commitlint/cli@17.7.1:
     resolution: {integrity: sha512-BCm/AT06SNCQtvFv921iNhudOHuY16LswT0R3OeolVGLk8oP+Rk9TfQfgjH7QPMjhvp76bNqGFEcpKojxUNW1g==}
     engines: {node: '>=v14'}
@@ -776,54 +844,6 @@ packages:
       rollup: 3.29.0
     dev: true
 
-  /@rometools/cli-darwin-arm64@12.1.3:
-    resolution: {integrity: sha512-AmFTUDYjBuEGQp/Wwps+2cqUr+qhR7gyXAUnkL5psCuNCz3807TrUq/ecOoct5MIavGJTH6R4aaSL6+f+VlBEg==}
-    cpu: [arm64]
-    os: [darwin]
-    requiresBuild: true
-    dev: true
-    optional: true
-
-  /@rometools/cli-darwin-x64@12.1.3:
-    resolution: {integrity: sha512-k8MbWna8q4LRlb005N2X+JS1UQ+s3ZLBBvwk4fP8TBxlAJXUz17jLLu/Fi+7DTTEmMhM84TWj4FDKW+rNar28g==}
-    cpu: [x64]
-    os: [darwin]
-    requiresBuild: true
-    dev: true
-    optional: true
-
-  /@rometools/cli-linux-arm64@12.1.3:
-    resolution: {integrity: sha512-X/uLhJ2/FNA3nu5TiyeNPqiD3OZoFfNfRvw6a3ut0jEREPvEn72NI7WPijH/gxSz55znfQ7UQ6iM4DZumUknJg==}
-    cpu: [arm64]
-    os: [linux]
-    requiresBuild: true
-    dev: true
-    optional: true
-
-  /@rometools/cli-linux-x64@12.1.3:
-    resolution: {integrity: sha512-csP17q1eWiUXx9z6Jr/JJPibkplyKIwiWPYNzvPCGE8pHlKhwZj3YHRuu7Dm/4EOqx0XFIuqqWZUYm9bkIC8xg==}
-    cpu: [x64]
-    os: [linux]
-    requiresBuild: true
-    dev: true
-    optional: true
-
-  /@rometools/cli-win32-arm64@12.1.3:
-    resolution: {integrity: sha512-RymHWeod57EBOJY4P636CgUwYA6BQdkQjh56XKk4pLEHO6X1bFyMet2XL7KlHw5qOTalzuzf5jJqUs+vf3jdXQ==}
-    cpu: [arm64]
-    os: [win32]
-    requiresBuild: true
-    dev: true
-    optional: true
-
-  /@rometools/cli-win32-x64@12.1.3:
-    resolution: {integrity: sha512-yHSKYidqJMV9nADqg78GYA+cZ0hS1twANAjiFibQdXj9aGzD+s/IzIFEIi/U/OBLvWYg/SCw0QVozi2vTlKFDQ==}
-    cpu: [x64]
-    os: [win32]
-    requiresBuild: true
-    dev: true
-    optional: true
-
   /@sinclair/typebox@0.27.8:
     resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==}
     dev: true
@@ -5531,20 +5551,6 @@ packages:
       fsevents: 2.3.3
     dev: true
 
-  /rome@12.1.3:
-    resolution: {integrity: sha512-e+ff72hxDpe/t5/Us7YRBVw3PBET7SeczTQNn6tvrWdrCaAw3qOukQQ+tDCkyFtS4yGsnhjrJbm43ctNbz27Yg==}
-    engines: {node: '>=14.*'}
-    hasBin: true
-    requiresBuild: true
-    optionalDependencies:
-      '@rometools/cli-darwin-arm64': 12.1.3
-      '@rometools/cli-darwin-x64': 12.1.3
-      '@rometools/cli-linux-arm64': 12.1.3
-      '@rometools/cli-linux-x64': 12.1.3
-      '@rometools/cli-win32-arm64': 12.1.3
-      '@rometools/cli-win32-x64': 12.1.3
-    dev: true
-
   /run-applescript@5.0.0:
     resolution: {integrity: sha512-XcT5rBksx1QdIhlFOCtgZkB99ZEouFZ1E2Kc2LHqNW13U3/74YGdkQRmThTwxy4QIyookibDKYZOPqX//6BlAg==}
     engines: {node: '>=12'}
index d69055cf0909efa3b9cf45983163e0be6a35c513..9acfd6400ef59a12823b52899ca7f35e2ae96e56 100644 (file)
@@ -82,7 +82,7 @@ export class FixedThreadPool<
     message: MessageValue<Data>,
     transferList?: TransferListItem[]
   ): void {
-    (
+    ;(
       this.workerNodes[workerNodeKey].messageChannel as MessageChannel
     ).port1.postMessage(message, transferList)
   }
@@ -108,7 +108,7 @@ export class FixedThreadPool<
     workerNodeKey: number,
     listener: (message: MessageValue<Message>) => void
   ): void {
-    (
+    ;(
       this.workerNodes[workerNodeKey].messageChannel as MessageChannel
     ).port1.on('message', listener)
   }
index ca275dedab806b9a4cc2c9c6aee5d3cf550b99f5..dd116dfb2ca656d06188916cd7924193e57a8c16 100644 (file)
@@ -169,7 +169,7 @@ implements IWorkerNode<Worker, Data> {
       this.onEmptyQueueCount = 0
       return
     }
-    (this.onEmptyQueue as WorkerNodeEventCallback)(this.info.id as number)
+    ;(this.onEmptyQueue as WorkerNodeEventCallback)(this.info.id as number)
     ++this.onEmptyQueueCount
     await sleep(exponentialDelay(this.onEmptyQueueCount))
     await this.startOnEmptyQueue()
index ca14133f2dafa7b1d6692f84459bafabb431e935..a0d78dbd08f2023e38cd37dbff6dbc74064168fb 100644 (file)
@@ -351,7 +351,7 @@ export abstract class AbstractWorker<
   protected handleKillMessage (message: MessageValue<Data>): void {
     this.stopCheckActive()
     if (isAsyncFunction(this.opts.killHandler)) {
-      (this.opts.killHandler?.() as Promise<void>)
+      ;(this.opts.killHandler?.() as Promise<void>)
         .then(() => {
           this.sendToMainWorker({ kill: 'success', workerId: this.id })
           return null