From 15fa192ef734c20b27ee79b05e6514265efd9218 Mon Sep 17 00:00:00 2001 From: Maxim Topciu Date: Mon, 25 Mar 2024 19:57:38 +0300 Subject: [PATCH] AG-30370 init logger library MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merge in ADGUARD-FILTERS/tsurlfilter from fix/AG-30370 to master Squashed commit of the following: commit 115b0275366a388c4430783a61dc627216a09295 Author: Maxim Topciu Date: Mon Mar 25 18:05:45 2024 +0200 AG-30370 update author name commit e6952e095824f234ad3c54d243608417314cc5a2 Author: Maxim Topciu Date: Mon Mar 25 17:00:21 2024 +0200 AG-30370 use pnpm cache commit 801daad7086f964e1120a3622445d6546c901c17 Author: Maxim Topciu Date: Mon Mar 25 16:53:33 2024 +0200 AG-30370 convert to pnpm commit 55b040203610563a5d8a520552fd45883cabfa93 Author: Maxim Topciu Date: Mon Mar 25 16:29:05 2024 +0200 AG-30370 use booleans without quotes commit d76f4f3a3e57c349e9fa9f99ca1c725313879cd0 Merge: e5d0574b 6091d39d Author: Maxim Topciu Date: Mon Mar 25 16:26:05 2024 +0200 Merge branch 'master' into fix/AG-30370 commit e5d0574b63a2b9fdff40b3ab6e681574da68e45f Author: Maxim Topciu Date: Wed Mar 20 16:12:07 2024 +0200 AG-30370 set version to 1.0.0 commit 5f1f36f4bb9a614c4e3b151c0ba39263614d1f16 Author: Maxim Topciu Date: Wed Mar 20 15:48:52 2024 +0200 AG-30370 update docker image for logger commit 1be1d1bce8fccf2e4882b0ae491f052a75e13c57 Merge: b79acae4 07742fc4 Author: Maxim Topciu Date: Wed Mar 20 15:29:39 2024 +0200 Merge branch 'fix/AG-30370' of ssh://bit.int.agrd.dev:7999/adguard-filters/tsurlfilter into fix/AG-30370 commit b79acae4a76a34f85377b776a11863ff1969ee2d Author: Maxim Topciu Date: Wed Mar 20 15:29:02 2024 +0200 AG-30370 setup CI commit 07742fc48f7fd7f014578e1f1d22ab0dc7189829 Author: Dávid Tóta Date: Wed Mar 20 16:06:11 2024 +0300 packages/logger/src/Logger.ts edited online with Bitbucket commit 9ec3aeaeabe37a69ed169045af6ac9feb36a7a16 Author: Maxim Topciu Date: Wed Mar 20 12:25:20 2024 +0200 AG-30370 remove files description commit ec1008e3e2a4ab016b13919e42dc08adafa02c0c Author: Maxim Topciu Date: Wed Mar 20 12:22:51 2024 +0200 AG-30370 fix review notes commit be0a47f5a3dc23142f76386342646f1fc0f24cc6 Author: Maxim Topciu Date: Tue Mar 19 20:32:02 2024 +0200 AG-30370 add author commit 987546d6d332c2b23abefe8c72eee95d01b4f443 Author: Maxim Topciu Date: Tue Mar 19 20:28:30 2024 +0200 AG-30370 add file description commit 2d0f60fbfd4ccd2efc1738e4fa9b944c5ee5178b Author: Maxim Topciu Date: Tue Mar 19 20:27:12 2024 +0200 AG-30370 add readme commit 7e5428aa070822367af61af54f00530d48b455fe Author: Maxim Topciu Date: Tue Mar 19 19:48:29 2024 +0200 add license commit 198f3f9464ad336fb0567ff785f8ceceb22f269b Author: Maxim Topciu Date: Tue Mar 19 18:18:54 2024 +0200 AG-30370 add smoke tests for typescript commit 6a34233041d1c2057c5ff7fbe9c4cd13fd068979 Author: Maxim Topciu Date: Tue Mar 19 17:45:06 2024 +0200 AG-30370 fix eslint warnings commit 04c18717cc23e08072954376862f1c6613229842 Author: Maxim Topciu Date: Tue Mar 19 17:43:14 2024 +0200 AG-30370 yarn add smoke tests commit 6d2bb5a0ac75ce277608ed60b5f0d849bb4c163a Author: Maxim Topciu Date: Tue Mar 19 16:15:56 2024 +0200 AG-30370 add linter ... and 1 more commit --- bamboo-specs/adguard-api-build.yaml | 6 +- bamboo-specs/adguard-api-increment.yaml | 4 +- bamboo-specs/agtree-build.yaml | 6 +- bamboo-specs/agtree-increment.yaml | 4 +- bamboo-specs/agtree-test.yaml | 4 +- bamboo-specs/bamboo.yaml | 15 + bamboo-specs/css-tokenizer-build.yaml | 6 +- bamboo-specs/css-tokenizer-increment.yaml | 4 +- bamboo-specs/css-tokenizer-test.yaml | 4 +- bamboo-specs/logger-build.yaml | 107 +++ bamboo-specs/logger-deploy.yaml | 47 ++ bamboo-specs/logger-increment.yaml | 65 ++ bamboo-specs/logger-permissions.yaml | 16 + bamboo-specs/logger-test.yaml | 94 +++ bamboo-specs/tsurlfilter-build.yaml | 6 +- bamboo-specs/tsurlfilter-increment.yaml | 4 +- bamboo-specs/tsurlfilter-tests.yaml | 4 +- bamboo-specs/tswebextension-build.yaml | 6 +- bamboo-specs/tswebextension-increment.yaml | 4 +- bamboo-specs/tswebextension-tests.yaml | 4 +- package.json | 2 +- packages/adguard-api/package.json | 2 +- packages/agtree/package.json | 2 +- packages/css-tokenizer/package.json | 2 +- packages/examples/adguard-api/package.json | 2 +- .../extension/manifest.chrome.json | 2 +- .../extension/manifest.firefox.json | 2 +- .../examples/tswebextension-mv2/package.json | 2 +- .../examples/tswebextension-mv3/package.json | 2 +- .../tswebextension-mv3/scripts/manifest.json | 2 +- packages/logger/.eslintrc.js | 91 +++ packages/logger/.gitignore | 11 + packages/logger/LICENSE | 21 + packages/logger/README.md | 84 +++ packages/logger/jest.config.ts | 4 + packages/logger/package.json | 67 ++ packages/logger/rollup.config.ts | 23 + packages/logger/scripts/build-txt.ts | 19 + packages/logger/src/Logger.ts | 207 ++++++ packages/logger/src/error.ts | 52 ++ packages/logger/src/format-time.ts | 28 + packages/logger/src/index.ts | 1 + packages/logger/tests/logger.test.ts | 79 +++ packages/logger/tests/smoke/cjs/index.js | 5 + packages/logger/tests/smoke/cjs/package.json | 11 + packages/logger/tests/smoke/cjs/test.sh | 28 + packages/logger/tests/smoke/esm/index.js | 5 + packages/logger/tests/smoke/esm/package.json | 12 + packages/logger/tests/smoke/esm/test.sh | 28 + .../logger/tests/smoke/typescript/index.ts | 5 + .../tests/smoke/typescript/package.json | 11 + .../logger/tests/smoke/typescript/test.sh | 27 + .../tests/smoke/typescript/tsconfig.json | 10 + packages/logger/tsconfig.base.json | 18 + packages/logger/tsconfig.json | 13 + packages/tsurlfilter/package.json | 2 +- .../test/builders/rollup-ts/test.sh | 2 +- packages/tswebextension/package.json | 2 +- .../test/builders/rollup-ts/test.sh | 2 +- pnpm-lock.yaml | 664 +++++++++++++++++- 60 files changed, 1887 insertions(+), 75 deletions(-) create mode 100644 bamboo-specs/logger-build.yaml create mode 100644 bamboo-specs/logger-deploy.yaml create mode 100644 bamboo-specs/logger-increment.yaml create mode 100644 bamboo-specs/logger-permissions.yaml create mode 100644 bamboo-specs/logger-test.yaml create mode 100644 packages/logger/.eslintrc.js create mode 100644 packages/logger/.gitignore create mode 100644 packages/logger/LICENSE create mode 100644 packages/logger/README.md create mode 100644 packages/logger/jest.config.ts create mode 100644 packages/logger/package.json create mode 100644 packages/logger/rollup.config.ts create mode 100644 packages/logger/scripts/build-txt.ts create mode 100644 packages/logger/src/Logger.ts create mode 100644 packages/logger/src/error.ts create mode 100644 packages/logger/src/format-time.ts create mode 100644 packages/logger/src/index.ts create mode 100644 packages/logger/tests/logger.test.ts create mode 100644 packages/logger/tests/smoke/cjs/index.js create mode 100644 packages/logger/tests/smoke/cjs/package.json create mode 100755 packages/logger/tests/smoke/cjs/test.sh create mode 100644 packages/logger/tests/smoke/esm/index.js create mode 100644 packages/logger/tests/smoke/esm/package.json create mode 100755 packages/logger/tests/smoke/esm/test.sh create mode 100644 packages/logger/tests/smoke/typescript/index.ts create mode 100644 packages/logger/tests/smoke/typescript/package.json create mode 100755 packages/logger/tests/smoke/typescript/test.sh create mode 100644 packages/logger/tests/smoke/typescript/tsconfig.json create mode 100644 packages/logger/tsconfig.base.json create mode 100644 packages/logger/tsconfig.json diff --git a/bamboo-specs/adguard-api-build.yaml b/bamboo-specs/adguard-api-build.yaml index 56266a28a..bf6c17928 100644 --- a/bamboo-specs/adguard-api-build.yaml +++ b/bamboo-specs/adguard-api-build.yaml @@ -9,8 +9,8 @@ variables: stages: - Build: - manual: 'false' - final: 'false' + manual: false + final: false jobs: - Build @@ -46,7 +46,7 @@ Build: pnpm --filter @adguard/api build cd packages/adguard-api - pnpm pack && mv $(ls adguard-api-*.tgz) adguard-api.tgz + pnpm pack && mv adguard-api-*.tgz adguard-api.tgz - inject-variables: file: ./packages/adguard-api/dist/build.txt scope: RESULT diff --git a/bamboo-specs/adguard-api-increment.yaml b/bamboo-specs/adguard-api-increment.yaml index 74df655fc..e229c377a 100644 --- a/bamboo-specs/adguard-api-increment.yaml +++ b/bamboo-specs/adguard-api-increment.yaml @@ -9,8 +9,8 @@ variables: stages: - Increment: - manual: 'true' - final: 'false' + manual: true + final: false jobs: - Increment diff --git a/bamboo-specs/agtree-build.yaml b/bamboo-specs/agtree-build.yaml index d5f1d64c3..19b58b630 100644 --- a/bamboo-specs/agtree-build.yaml +++ b/bamboo-specs/agtree-build.yaml @@ -9,8 +9,8 @@ variables: stages: - Build: - manual: 'false' - final: 'false' + manual: false + final: false jobs: - Build @@ -46,7 +46,7 @@ Build: # Pack the AGTree package into a tarball cd packages/agtree - pnpm pack && mv $(ls adguard-agtree-*.tgz) agtree.tgz + pnpm pack && mv adguard-agtree-*.tgz agtree.tgz - inject-variables: file: ./packages/agtree/dist/build.txt scope: RESULT diff --git a/bamboo-specs/agtree-increment.yaml b/bamboo-specs/agtree-increment.yaml index 209d5de04..50ba467eb 100644 --- a/bamboo-specs/agtree-increment.yaml +++ b/bamboo-specs/agtree-increment.yaml @@ -9,8 +9,8 @@ variables: stages: - Increment: - manual: 'true' - final: 'false' + manual: true + final: false jobs: - Increment diff --git a/bamboo-specs/agtree-test.yaml b/bamboo-specs/agtree-test.yaml index b360a2bb7..62209ca56 100644 --- a/bamboo-specs/agtree-test.yaml +++ b/bamboo-specs/agtree-test.yaml @@ -9,8 +9,8 @@ variables: stages: - Test: - manual: 'false' - final: 'false' + manual: false + final: false jobs: - Test diff --git a/bamboo-specs/bamboo.yaml b/bamboo-specs/bamboo.yaml index d9a257d11..5e63dbda0 100644 --- a/bamboo-specs/bamboo.yaml +++ b/bamboo-specs/bamboo.yaml @@ -69,3 +69,18 @@ --- !include 'css-tokenizer-permissions.yaml' + +--- +!include 'logger-build.yaml' + +--- +!include 'logger-deploy.yaml' + +--- +!include 'logger-increment.yaml' + +--- +!include 'logger-permissions.yaml' + +--- +!include 'logger-test.yaml' diff --git a/bamboo-specs/css-tokenizer-build.yaml b/bamboo-specs/css-tokenizer-build.yaml index 0101b0748..e7b669523 100644 --- a/bamboo-specs/css-tokenizer-build.yaml +++ b/bamboo-specs/css-tokenizer-build.yaml @@ -9,8 +9,8 @@ variables: stages: - Build: - manual: 'false' - final: 'false' + manual: false + final: false jobs: - Build @@ -48,7 +48,7 @@ Build: cd packages/css-tokenizer # Pack - pnpm pack && mv $(ls adguard-css-tokenizer-*.tgz) css-tokenizer.tgz + pnpm pack && mv adguard-css-tokenizer-*.tgz css-tokenizer.tgz - inject-variables: file: ./packages/css-tokenizer/dist/build.txt scope: RESULT diff --git a/bamboo-specs/css-tokenizer-increment.yaml b/bamboo-specs/css-tokenizer-increment.yaml index afe8f87d7..df9c5f26c 100644 --- a/bamboo-specs/css-tokenizer-increment.yaml +++ b/bamboo-specs/css-tokenizer-increment.yaml @@ -9,8 +9,8 @@ variables: stages: - Increment: - manual: 'true' - final: 'false' + manual: true + final: false jobs: - Increment diff --git a/bamboo-specs/css-tokenizer-test.yaml b/bamboo-specs/css-tokenizer-test.yaml index a31a4ba77..08654d724 100644 --- a/bamboo-specs/css-tokenizer-test.yaml +++ b/bamboo-specs/css-tokenizer-test.yaml @@ -9,8 +9,8 @@ variables: stages: - Test: - manual: 'false' - final: 'false' + manual: false + final: false jobs: - Test diff --git a/bamboo-specs/logger-build.yaml b/bamboo-specs/logger-build.yaml new file mode 100644 index 000000000..5c2b08f58 --- /dev/null +++ b/bamboo-specs/logger-build.yaml @@ -0,0 +1,107 @@ +--- +version: 2 +plan: + project-key: AJL + key: LOGGERBUILD + name: logger - build +variables: + dockerContainer: adguard/node-ssh:18.19--0 + +stages: + - Build: + manual: false + final: false + jobs: + - Build + +Build: + key: BUILD + other: + clean-working-dir: true + docker: + image: "${bamboo.dockerContainer}" + volumes: + ${system.PNPM_DIR}: "${bamboo.cachePnpm}" + tasks: + - checkout: + force-clean-build: 'true' + - script: + interpreter: SHELL + scripts: + - |- + set -e + set -x + + # Fix mixed logs + exec 2>&1 + + ls -alt + + # Set cache directory + pnpm config set store-dir ${bamboo.cachePnpm} + + # Install dependencies + pnpm install + + # Build + npx lerna run --scope @adguard/logger build + + # Pack the logger package into a tarball + cd packages/logger/ + pnpm pack && mv adguard-logger-*.tgz logger.tgz + - inject-variables: + file: ./packages/logger/dist/build.txt + scope: RESULT + namespace: inject + - any-task: + plugin-key: com.atlassian.bamboo.plugins.vcs:task.vcs.tagging + configuration: + selectedRepository: defaultRepository + tagName: logger-v${bamboo.inject.version} + final-tasks: + - script: + interpreter: SHELL + scripts: + - |- + set -x + set -e + + # Fix mixed logs + exec 2>&1 + + ls -la + + echo "Size before cleanup:" && du -h | tail -n 1 + + pnpm clean + + echo "Size after cleanup:" && du -h | tail -n 1 + # Store the logger package tarball as an artifact + artifacts: + - name: logger.tgz + location: packages/logger/ + pattern: logger.tgz + shared: true + required: true + requirements: + - adg-docker: 'true' + +triggers: [] + +branches: + create: manually + delete: never + link-to-jira: 'true' + +notifications: + - events: + - plan-status-changed + recipients: + - webhook: + name: Build webhook + url: http://prod.jirahub.service.eu.consul/v1/webhook/bamboo + +labels: [] + +other: + concurrent-build-plugin: system-default diff --git a/bamboo-specs/logger-deploy.yaml b/bamboo-specs/logger-deploy.yaml new file mode 100644 index 000000000..2282f6db7 --- /dev/null +++ b/bamboo-specs/logger-deploy.yaml @@ -0,0 +1,47 @@ +--- +version: 2 +deployment: + name: logger - deploy + source-plan: AJL-LOGGERBUILD +release-naming: ${bamboo.inject.version} +environments: + - npmjs + +npmjs: + docker: + image: adguard/node-ssh:18.19--0 + volumes: + ${system.PNPM_DIR}: "${bamboo.cachePnpm}" + triggers: [ ] + tasks: + - checkout: + force-clean-build: 'true' + # Download previously built tarball from Bamboo artifacts + - artifact-download: + artifacts: + - name: logger.tgz + - script: + interpreter: SHELL + scripts: + - |- + set -e + set -x + + # Fix mixed logs + exec 2>&1 + + ls -alt + + # Publish tarball to NPM package registry + export NPM_TOKEN=${bamboo.npmSecretToken} + echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc + npm publish logger.tgz --access public + requirements: + - adg-docker: 'true' + notifications: + - events: + - deployment-started-and-finished + recipients: + - webhook: + name: Deploy webhook + url: http://prod.jirahub.service.eu.consul/v1/webhook/bamboo diff --git a/bamboo-specs/logger-increment.yaml b/bamboo-specs/logger-increment.yaml new file mode 100644 index 000000000..0aeb05fdc --- /dev/null +++ b/bamboo-specs/logger-increment.yaml @@ -0,0 +1,65 @@ +--- +version: 2 +plan: + project-key: AJL + key: LOGGERINCR + name: logger - increment +variables: + dockerContainer: adguard/node-ssh:18.19--0 + +stages: + - Increment: + manual: true + final: false + jobs: + - Increment + +Increment: + key: INCRLOGGER + docker: + image: "${bamboo.dockerContainer}" + volumes: + ${system.PNPM_DIR}: "${bamboo.cachePnpm}" + tasks: + - checkout: + force-clean-build: 'true' + - script: + interpreter: SHELL + scripts: + - |- + branch="${bamboo.planRepository.branchName}" + + # Throw error if current branch is not "master", + # because we do not deploy changes from other branches + if [ $branch != "master" ] + then + echo "increment is not supported on branch ${branch}" + exit 1; + fi + + set -e + set -x + + # Fix mixed logs + exec 2>&1 + + ls -alt + + pnpm --filter @adguard/logger increment + - any-task: + plugin-key: com.atlassian.bamboo.plugins.vcs:task.vcs.commit + configuration: + commitMessage: 'skipci: Automatic increment build number' + selectedRepository: defaultRepository + requirements: + - adg-docker: 'true' + +branches: + create: manually + delete: never + link-to-jira: 'true' + +labels: [ ] + +other: + concurrent-build-plugin: system-default diff --git a/bamboo-specs/logger-permissions.yaml b/bamboo-specs/logger-permissions.yaml new file mode 100644 index 000000000..ec5445420 --- /dev/null +++ b/bamboo-specs/logger-permissions.yaml @@ -0,0 +1,16 @@ +--- +version: 2 +deployment: + name: logger - deploy +deployment-permissions: + - groups: + - extensions-developers + permissions: + - view +environment-permissions: + - npmjs: + - groups: + - extensions-developers + permissions: + - view + - deploy diff --git a/bamboo-specs/logger-test.yaml b/bamboo-specs/logger-test.yaml new file mode 100644 index 000000000..f06eb81d0 --- /dev/null +++ b/bamboo-specs/logger-test.yaml @@ -0,0 +1,94 @@ +--- +version: 2 +plan: + project-key: AJL + key: LOGGERTEST + name: logger - tests +variables: + dockerContainer: adguard/node-ssh:18.19--0 + +stages: + - Test: + manual: false + final: false + jobs: + - Test + +Test: + key: TEST + docker: + image: "${bamboo.dockerContainer}" + volumes: + ${system.PNPM_DIR}: "${bamboo.cachePnpm}" + tasks: + - checkout: + force-clean-build: 'true' + - script: + interpreter: SHELL + scripts: + - |- + set -e + set -x + + # Fix mixed logs + exec 2>&1 + + ls -alt + + # Set cache directory + pnpm config set store-dir ${bamboo.cachePnpm} + + # Install deps for project + pnpm install + + # Build the package + pnpm --filter @adguard/logger build + + # Lint code + pnpm --filter @adguard/logger lint + + # Run tests + pnpm --filter @adguard/logger test + + # Run smoke tests + pnpm --filter @adguard/logger test:smoke + final-tasks: + - script: + interpreter: SHELL + scripts: + - |- + set -x + set -e + + # Fix mixed logs + exec 2>&1 + + ls -la + + echo "Size before cleanup:" && du -h | tail -n 1 + + pnpm clean + + echo "Size after cleanup:" && du -h | tail -n 1 + requirements: + - adg-docker: 'true' + +branches: + create: for-pull-request + delete: + after-deleted-days: '1' + after-inactive-days: '5' + link-to-jira: 'true' + +notifications: + - events: + - plan-status-changed + recipients: + - webhook: + name: Build webhook + url: http://prod.jirahub.service.eu.consul/v1/webhook/bamboo + +labels: [ ] + +other: + concurrent-build-plugin: system-default diff --git a/bamboo-specs/tsurlfilter-build.yaml b/bamboo-specs/tsurlfilter-build.yaml index 25486f10d..cfd7e783a 100644 --- a/bamboo-specs/tsurlfilter-build.yaml +++ b/bamboo-specs/tsurlfilter-build.yaml @@ -9,8 +9,8 @@ variables: stages: - Build: - manual: 'false' - final: 'false' + manual: false + final: false jobs: - Build @@ -43,7 +43,7 @@ Build: pnpm --filter @adguard/tsurlfilter build cd packages/tsurlfilter - pnpm pack && mv $(ls adguard-tsurlfilter-*.tgz) tsurlfilter.tgz + pnpm pack && mv adguard-tsurlfilter-*.tgz tsurlfilter.tgz - inject-variables: file: ./packages/tsurlfilter/dist/build.txt scope: RESULT diff --git a/bamboo-specs/tsurlfilter-increment.yaml b/bamboo-specs/tsurlfilter-increment.yaml index e54498670..d03d82997 100644 --- a/bamboo-specs/tsurlfilter-increment.yaml +++ b/bamboo-specs/tsurlfilter-increment.yaml @@ -9,8 +9,8 @@ variables: stages: - Increment: - manual: 'true' - final: 'false' + manual: true + final: false jobs: - Increment diff --git a/bamboo-specs/tsurlfilter-tests.yaml b/bamboo-specs/tsurlfilter-tests.yaml index 83ba66bdf..1e253fc5e 100644 --- a/bamboo-specs/tsurlfilter-tests.yaml +++ b/bamboo-specs/tsurlfilter-tests.yaml @@ -9,8 +9,8 @@ variables: stages: - Test: - manual: 'false' - final: 'false' + manual: false + final: false jobs: - Test diff --git a/bamboo-specs/tswebextension-build.yaml b/bamboo-specs/tswebextension-build.yaml index 1e1a4fce7..2da398277 100644 --- a/bamboo-specs/tswebextension-build.yaml +++ b/bamboo-specs/tswebextension-build.yaml @@ -9,8 +9,8 @@ variables: stages: - Build: - manual: 'false' - final: 'false' + manual: false + final: false jobs: - Build @@ -44,7 +44,7 @@ Build: pnpm --filter @adguard/tswebextension build cd packages/tswebextension - pnpm pack && mv $(ls adguard-tswebextension-*.tgz) tswebextension.tgz + pnpm pack && mv adguard-tswebextension-*.tgz tswebextension.tgz - inject-variables: file: ./packages/tswebextension/dist/build.txt scope: RESULT diff --git a/bamboo-specs/tswebextension-increment.yaml b/bamboo-specs/tswebextension-increment.yaml index 351e70ff2..ab68eba76 100644 --- a/bamboo-specs/tswebextension-increment.yaml +++ b/bamboo-specs/tswebextension-increment.yaml @@ -9,8 +9,8 @@ variables: stages: - Increment: - manual: 'true' - final: 'false' + manual: true + final: false jobs: - Increment diff --git a/bamboo-specs/tswebextension-tests.yaml b/bamboo-specs/tswebextension-tests.yaml index 182993b3f..d5f40b5cd 100644 --- a/bamboo-specs/tswebextension-tests.yaml +++ b/bamboo-specs/tswebextension-tests.yaml @@ -9,8 +9,8 @@ variables: stages: - Test: - manual: 'false' - final: 'false' + manual: false + final: false jobs: - Test diff --git a/package.json b/package.json index 91ef0be6e..70e49e115 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@adguard/extensions", "version": "1.0.0", "description": "This is a monorepo with packages developed by the extensions developers at AdGuard", - "author": "AdGuard", + "author": "Adguard Software Ltd.", "repository": { "type": "git", "url": "git+https://github.com/AdguardTeam/tsurlfilter.git" diff --git a/packages/adguard-api/package.json b/packages/adguard-api/package.json index dd6f25157..ed19637a0 100644 --- a/packages/adguard-api/package.json +++ b/packages/adguard-api/package.json @@ -32,7 +32,7 @@ "check-types": "tsc --project tsconfig.build.json --noemit", "increment": "pnpm version patch --no-git-tag-version" }, - "author": "AdGuard", + "author": "Adguard Software Ltd.", "license": "GPL-3.0-only", "dependencies": { "@adguard/assistant": "^4.3.70", diff --git a/packages/agtree/package.json b/packages/agtree/package.json index c4e28d28a..f0114c745 100644 --- a/packages/agtree/package.json +++ b/packages/agtree/package.json @@ -9,7 +9,7 @@ "parser", "ast" ], - "author": "AdGuard Software Ltd.", + "author": "Adguard Software Ltd.", "license": "MIT", "repository": { "type": "git", diff --git a/packages/css-tokenizer/package.json b/packages/css-tokenizer/package.json index b64a019c2..95bc2c763 100644 --- a/packages/css-tokenizer/package.json +++ b/packages/css-tokenizer/package.json @@ -6,7 +6,7 @@ "css", "tokenizer" ], - "author": "AdGuard Software Ltd.", + "author": "Adguard Software Ltd.", "license": "MIT", "repository": { "type": "git", diff --git a/packages/examples/adguard-api/package.json b/packages/examples/adguard-api/package.json index 292edaad3..1aef93b64 100644 --- a/packages/examples/adguard-api/package.json +++ b/packages/examples/adguard-api/package.json @@ -2,7 +2,7 @@ "name": "adguard-api-example", "version": "0.0.1", "description": "Sample extension based on @adguard/api", - "author": "adguard@adguard.com", + "author": "Adguard Software Ltd.", "license": "GPL-3.0", "scripts": { "build": "node -r @swc-node/register ./scripts/build/index.ts", diff --git a/packages/examples/tswebextension-mv2/extension/manifest.chrome.json b/packages/examples/tswebextension-mv2/extension/manifest.chrome.json index 981796850..1b57838c0 100644 --- a/packages/examples/tswebextension-mv2/extension/manifest.chrome.json +++ b/packages/examples/tswebextension-mv2/extension/manifest.chrome.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "TSWebExtension on Manifest-v2", - "author": "AdGuard Software Ltd.", + "author": "Adguard Software Ltd.", "version": "0.0.1", "description": "An example of extension built with TSUrlFilter on Manifest-v2", "permissions": [ diff --git a/packages/examples/tswebextension-mv2/extension/manifest.firefox.json b/packages/examples/tswebextension-mv2/extension/manifest.firefox.json index 0cb0e1bad..964ad2d24 100644 --- a/packages/examples/tswebextension-mv2/extension/manifest.firefox.json +++ b/packages/examples/tswebextension-mv2/extension/manifest.firefox.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "TSWebExtension on Manifest-v2", - "author": "AdGuard Software Ltd.", + "author": "Adguard Software Ltd.", "version": "0.0.1", "description": "An example of extension built with TSUrlFilter on Manifest-v2", "applications": { diff --git a/packages/examples/tswebextension-mv2/package.json b/packages/examples/tswebextension-mv2/package.json index a9247724a..91ceb24f0 100644 --- a/packages/examples/tswebextension-mv2/package.json +++ b/packages/examples/tswebextension-mv2/package.json @@ -2,7 +2,7 @@ "name": "tswebextension-mv2", "version": "0.0.1", "description": "Sample manifest v2 extension with tswebextension", - "author": "adguard@adguard.com", + "author": "Adguard Software Ltd.", "license": "GPL-3.0", "scripts": { "build": "pnpm build:chrome", diff --git a/packages/examples/tswebextension-mv3/package.json b/packages/examples/tswebextension-mv3/package.json index e98bcebe7..eb0a57d76 100644 --- a/packages/examples/tswebextension-mv3/package.json +++ b/packages/examples/tswebextension-mv3/package.json @@ -2,7 +2,7 @@ "name": "tswebextension-mv3", "version": "0.0.1", "description": "Sample extension with tswebextension on manifest V3", - "author": "adguard@adguard.com", + "author": "Adguard Software Ltd.", "license": "GPL-3.0", "scripts": { "build": "pnpm lint && pnpm build:precompile-rules && pnpm build:extension", diff --git a/packages/examples/tswebextension-mv3/scripts/manifest.json b/packages/examples/tswebextension-mv3/scripts/manifest.json index 1152a5915..091c20c7b 100644 --- a/packages/examples/tswebextension-mv3/scripts/manifest.json +++ b/packages/examples/tswebextension-mv3/scripts/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "TSWebExtension on Manifest-v3", - "author": "AdGuard Software Ltd.", + "author": "Adguard Software Ltd.", "version": "0.0.1", "description": "An example of extension built with TSUrlFilter on Manifest-v3", "permissions": [ diff --git a/packages/logger/.eslintrc.js b/packages/logger/.eslintrc.js new file mode 100644 index 000000000..0a6083328 --- /dev/null +++ b/packages/logger/.eslintrc.js @@ -0,0 +1,91 @@ +const path = require('path'); + +module.exports = { + root: true, + parser: '@typescript-eslint/parser', + parserOptions: { + tsconfigRootDir: path.join(__dirname), + project: 'tsconfig.json', + }, + plugins: [ + 'import', + '@typescript-eslint', + ], + extends: [ + 'airbnb-base', + 'airbnb-typescript/base', + 'plugin:jsdoc/recommended', + ], + ignorePatterns: [ + 'dist', + 'coverage', + 'tests/smoke', + ], + rules: { + indent: 'off', + 'arrow-body-style': 'off', + 'max-len': ['error', { code: 120, ignoreUrls: true }], + 'no-new': 'off', + 'no-continue': 'off', + 'no-restricted-syntax': ['error', 'LabeledStatement', 'WithStatement'], + 'no-constant-condition': ['error', { checkLoops: false }], + 'no-param-reassign': 'off', + + 'import/prefer-default-export': 'off', + 'import/no-extraneous-dependencies': ['error', { devDependencies: true }], + 'import/no-cycle': 'off', + 'import/export': 'off', + + '@typescript-eslint/indent': ['error', 4, { + SwitchCase: 1, + ignoredNodes: ['TSTypeParameterInstantiation'], + }], + '@typescript-eslint/no-non-null-assertion': 'off', + '@typescript-eslint/interface-name-prefix': 'off', + '@typescript-eslint/explicit-function-return-type': 'error', + + // types described in ts + 'jsdoc/require-param-type': 'off', + 'jsdoc/no-undefined-types': 'off', + 'jsdoc/require-returns-type': 'off', + 'jsdoc/tag-lines': 'off', + 'jsdoc/require-throws': 'error', + 'jsdoc/check-tag-names': ['error', { definedTags: ['jest-environment'] }], + 'jsdoc/require-jsdoc': [ + 'error', + { + contexts: [ + 'ClassDeclaration', + 'ClassProperty', + 'FunctionDeclaration', + 'MethodDefinition', + ], + }, + ], + 'jsdoc/require-description': [ + 'error', + { + contexts: [ + 'ClassDeclaration', + 'ClassProperty', + 'FunctionDeclaration', + 'MethodDefinition', + ], + }, + ], + 'jsdoc/require-description-complete-sentence': ['error'], + 'jsdoc/require-returns': ['error'], + '@typescript-eslint/consistent-type-imports': [ + 'error', + { + fixStyle: 'inline-type-imports', + }, + ], + '@typescript-eslint/consistent-type-exports': [ + 'error', + { + fixMixedExportsWithInlineTypeSpecifier: true, + }, + ], + }, +}; diff --git a/packages/logger/.gitignore b/packages/logger/.gitignore new file mode 100644 index 000000000..99f0937f4 --- /dev/null +++ b/packages/logger/.gitignore @@ -0,0 +1,11 @@ +*.log +.DS_Store +.swc +.vscode +coverage +dist +node_modules +.eslintcache + +# Release file for npm +*.tgz diff --git a/packages/logger/LICENSE b/packages/logger/LICENSE new file mode 100644 index 000000000..4b4c23777 --- /dev/null +++ b/packages/logger/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Adguard Software Ltd. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/logger/README.md b/packages/logger/README.md new file mode 100644 index 000000000..ebac83ca4 --- /dev/null +++ b/packages/logger/README.md @@ -0,0 +1,84 @@ +# AdGuard Logger + +AdGuard Logger is a simple tool designed for logging from AdGuard extensions. + +## Usage + +### Installation +```bash +yarn add @adguard/logger +``` + +### Basic Usage + +The package supports both CommonJS and ES Module import styles. +```javascript +const { Logger } = require('@adguard/logger'); +// or +import { Logger } from '@adguard/logger'; + +const logger = new Logger(); +logger.info('This is an info message'); +``` + +The default log level is set to `info`, meaning that messages at the `debug` level won't be logged. You can adjust this by setting the log level: + +```typescript +import { Logger, LogLevel } from './Logger'; + +const logger = new Logger(); +logger.currentLevel = LogLevel.Debug; +console.log(logger.currentLevel); // Outputs 'debug' +logger.debug('This is a debug message'); +``` + +Additionally, you can customize your logging solution by providing your own log writer, rather than relying solely on the default `console` logger: +```typescript +import { Logger, LogLevel } from './Logger'; + +const writeToFile = (...args: any[]) => { +// Implement file writing logic here +}; +const writer = { + log: (...args: any[]): void => { + writeToFile(...args); + console.log(...args); + }, + error: (...args: any[]): void => { + writeToFile(...args); + console.error(...args); + }, + info: (...args: any[]): void => { + writeToFile(...args); + console.info(...args); + }, +}; +const logger = new Logger(writer); +``` + +## Development + +To contribute to the development of AdGuard Logger, follow these steps: + +### Install dependencies +```bash +pnpm install +``` + +### Run tests +```bash +pnpm test +``` + +### Build +```bash +pnpm build +``` + +### Lint +```bash +pnpm lint +``` + +## Limitations +Development of this library was tested only on macOS, so some scripts may not work on Windows. diff --git a/packages/logger/jest.config.ts b/packages/logger/jest.config.ts new file mode 100644 index 000000000..6d6062b31 --- /dev/null +++ b/packages/logger/jest.config.ts @@ -0,0 +1,4 @@ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'node', +}; diff --git a/packages/logger/package.json b/packages/logger/package.json new file mode 100644 index 000000000..ac39cfeec --- /dev/null +++ b/packages/logger/package.json @@ -0,0 +1,67 @@ +{ + "name": "@adguard/logger", + "version": "1.0.0", + "scripts": { + "prebuild": "rimraf dist", + "build": "pnpm prebuild && rollup -c rollup.config.ts --configPlugin typescript && pnpm build:types && pnpm build:txt", + "build:txt": "ts-node scripts/build-txt", + "build:types": "tsc --project tsconfig.base.json --declaration --emitDeclarationOnly --outdir dist/types", + "test": "jest", + "lint": "eslint --cache . && tsc --noEmit", + "test:smoke": "(cd tests/smoke/esm && pnpm test) && (cd tests/smoke/cjs && pnpm test) && (cd tests/smoke/typescript && pnpm test)", + "increment": "pnpm version patch --no-git-tag-version" + }, + "engines": { + "node": ">=18.19.0" + }, + "main": "./dist/index.js", + "module": "./dist/es/index.mjs", + "types": "./dist/types/index.d.ts", + "files": [ + "dist", + "src" + ], + "exports": { + ".": { + "require": "./dist/index.js", + "import": "./dist/es/index.mjs", + "types": "./dist/types/index.d.ts" + } + }, + "license": "MIT", + "author": "Adguard Software Ltd.", + "repository": { + "type": "git", + "url": "git+https://github.com/AdguardTeam/tsurlfilter.git", + "directory": "packages/logger" + }, + "bugs": { + "url": "https://github.com/AdguardTeam/tsurlfilter/issues" + }, + "homepage": "https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/logger#readme", + "keywords": [ + "log", + "logger" + ], + "devDependencies": { + "@rollup/plugin-commonjs": "^25.0.7", + "@rollup/plugin-node-resolve": "^15.2.3", + "@rollup/plugin-typescript": "^11.1.6", + "@types/jest": "^29.5.12", + "@types/node": "^20.11.30", + "@typescript-eslint/eslint-plugin": "^7.0.0", + "@typescript-eslint/parser": "^7.0.0", + "eslint": "^8.56.0", + "eslint-config-airbnb-base": "15.0.0", + "eslint-config-airbnb-typescript": "18.0.0", + "eslint-plugin-import": "^2.25.2", + "eslint-plugin-jsdoc": "^48.2.1", + "jest": "^29.7.0", + "rimraf": "^5.0.5", + "rollup": "^4.13.0", + "ts-jest": "^29.1.2", + "ts-node": "^10.9.2", + "tslib": "^2.6.2", + "typescript": "^5.4.2" + } +} diff --git a/packages/logger/rollup.config.ts b/packages/logger/rollup.config.ts new file mode 100644 index 000000000..59c005c82 --- /dev/null +++ b/packages/logger/rollup.config.ts @@ -0,0 +1,23 @@ +import typescript from '@rollup/plugin-typescript'; +import resolve from '@rollup/plugin-node-resolve'; +import commonjs from '@rollup/plugin-commonjs'; + +export default { + input: 'src/index.ts', + output: [ + { + dir: 'dist', + format: 'cjs', + }, + { + dir: 'dist/es', + format: 'es', + entryFileNames: '[name].mjs', + }, + ], + plugins: [ + resolve(), + commonjs(), + typescript(), + ], +}; diff --git a/packages/logger/scripts/build-txt.ts b/packages/logger/scripts/build-txt.ts new file mode 100644 index 000000000..85b5ffd7f --- /dev/null +++ b/packages/logger/scripts/build-txt.ts @@ -0,0 +1,19 @@ +const fs = require('fs'); +const path = require('path'); +const { version } = require('../package.json'); + +const PATH = '../dist'; +const FILENAME = 'build.txt'; + +const main = (): void => { + const content = `version=${version}`; + const dir = path.resolve(__dirname, PATH); + + if (!fs.existsSync(dir)) { + fs.mkdirSync(dir); + } + + fs.writeFileSync(path.resolve(__dirname, PATH, FILENAME), content); +}; + +main(); diff --git a/packages/logger/src/Logger.ts b/packages/logger/src/Logger.ts new file mode 100644 index 000000000..1b286752a --- /dev/null +++ b/packages/logger/src/Logger.ts @@ -0,0 +1,207 @@ +import { getErrorMessage } from './error'; +import { formatTime } from './format-time'; + +/** + * Number presentation of log levels. Order is important. Higher number, more messages to be visible. + */ +export const enum LogLevelNumeric { + Error = 1, + Warn, + Info, + Debug, +} + +/** + * String presentation of log levels, for convenient users usage. + */ +export enum LogLevel { + Error = 'error', + Warn = 'warn', + Info = 'info', + Debug = 'debug', +} + +/** + * Log levels map, which maps number level to string level. + */ +const levelMapNumToString = { + [LogLevelNumeric.Error]: LogLevel.Error, + [LogLevelNumeric.Warn]: LogLevel.Warn, + [LogLevelNumeric.Info]: LogLevel.Info, + [LogLevelNumeric.Debug]: LogLevel.Debug, +}; + +/** + * Log levels map, which maps string level to number level. + */ +const levelMapStringToNum: Record = Object.entries(levelMapNumToString) + .reduce((acc, [key, value]) => { + // Here, key is originally a string since Object.entries() returns [string, string][]. + // We need to cast the key to LogLevelNumeric correctly without causing type mismatches. + const numericKey = Number(key) as LogLevelNumeric; + if (!Number.isNaN(numericKey)) { + acc[value] = numericKey; + } + return acc; + }, {} as Record); + +/** + * Methods supported by console. Used to manage levels. + */ +export const enum LogMethod { + Log = 'log', + Info = 'info', + Error = 'error', +} + +/** + * Writer interface. + */ +export interface Writer { + /** + * Log method. + * @param args + */ + log: (...args: any[]) => void; + /** + * Info method. + * @param args + */ + info: (...args: any[]) => void; + /** + * Error method. + * @param args + */ + error: (...args: any[]) => void; + // We do not print error, since in the extensions warn is counted as error. + // warn: (...args: any[]) => void; +} + +/** + * Simple logger with log levels. + */ +export class Logger { + private currentLevelValue = LogLevelNumeric.Info; + + private readonly writer: Writer; + + /** + * Constructor. + * @param writer Writer object. + */ + constructor(writer: Writer = console) { + this.writer = writer; + } + + /** + * Print debug messages. Usually used for technical information. + * + * @param args Printed arguments. + */ + public debug(...args: unknown[]): void { + this.print(LogLevelNumeric.Debug, LogMethod.Log, args); + } + + /** + * Print messages you want to disclose to users. + * + * @param args Printed arguments. + */ + public info(...args: unknown[]): void { + this.print(LogLevelNumeric.Info, LogMethod.Info, args); + } + + /** + * Print warn messages. + * + * @param args Printed arguments. + */ + public warn(...args: unknown[]): void { + this.print(LogLevelNumeric.Warn, LogMethod.Info, args); + } + + /** + * Print error messages. + * + * @param args Printed arguments. + */ + public error(...args: unknown[]): void { + this.print(LogLevelNumeric.Error, LogMethod.Error, args); + } + + /** + * Getter for log level. + * @returns Logger level. + */ + public get currentLevel(): LogLevel { + return levelMapNumToString[this.currentLevelValue]; + } + + /** + * Setter for log level. With this method log level can be updated dynamically. + * + * @param logLevel Logger level. + * @throws Error if log level is not supported. + */ + public set currentLevel(logLevel: LogLevel) { + const level = levelMapStringToNum[logLevel]; + if (level === undefined) { + throw new Error(`Logger supports only the following levels: ${[Object.values(LogLevel).join(', ')]}`); + } + this.currentLevelValue = level; + } + + /** + * Converts error to string, and adds stack trace. + * + * @param error Error to print. + * @private + * @returns Error message. + */ + private static errorToString(error: Error): string { + const message = getErrorMessage(error); + return `${message}\nStack trace:\n${error.stack}`; + } + + /** + * Wrapper over log methods. + * + * @param level Logger level. + * @param method Logger method. + * @param args Printed arguments. + * @private + */ + private print( + level: LogLevelNumeric, + method: LogMethod, + args: any[], + ): void { + // skip writing if the basic conditions are not met + if (this.currentLevelValue < level) { + return; + } + if (!args || args.length === 0 || !args[0]) { + return; + } + + const formattedArgs = args.map((value) => { + if (value instanceof Error) { + return Logger.errorToString(value); + } + + if (typeof value.message === 'string') { + return value.message; + } + + if (typeof value === 'object') { + return JSON.stringify(value); + } + + return String(value); + }); + + const formattedTime = `${formatTime(new Date())}:`; + + this.writer[method](formattedTime, ...formattedArgs); + } +} diff --git a/packages/logger/src/error.ts b/packages/logger/src/error.ts new file mode 100644 index 000000000..2bb9e563d --- /dev/null +++ b/packages/logger/src/error.ts @@ -0,0 +1,52 @@ +/** + * Error with a message. + */ +type ErrorWithMessage = { + message: string +}; + +/** + * Checks if error has message. + * + * @param error Error object. + * @returns True if error has message. + */ +function isErrorWithMessage(error: unknown): error is ErrorWithMessage { + return ( + typeof error === 'object' + && error !== null + && 'message' in error + && typeof (error as Record).message === 'string' + ); +} + +/** + * Converts error to the error with a message. + * + * @param maybeError Possible error. + * @returns Error with a message. + */ +function toErrorWithMessage(maybeError: unknown): ErrorWithMessage { + if (isErrorWithMessage(maybeError)) { + return maybeError; + } + + try { + return new Error(JSON.stringify(maybeError)); + } catch { + // fallback in case there's an error stringifying the maybeError + // like with circular references, for example. + return new Error(String(maybeError)); + } +} + +/** + * Converts an error object to an error with a message. This method might be helpful to handle thrown errors. + * + * @param error Error object. + * + * @returns Message of the error. + */ +export function getErrorMessage(error: unknown): string { + return toErrorWithMessage(error).message; +} diff --git a/packages/logger/src/format-time.ts b/packages/logger/src/format-time.ts new file mode 100644 index 000000000..6ad19fec8 --- /dev/null +++ b/packages/logger/src/format-time.ts @@ -0,0 +1,28 @@ +/** + * Pads a number with leading zeros. + * @param num The number to pad. + * @param size The number of digits to pad to. + * @returns The padded number. + */ +const pad = (num: number, size = 2): string => { + return num.toString().padStart(size, '0'); +}; + +/** + * Formats a date into an ISO 8601-like string with milliseconds. + * + * @param {Date|number} date The date object or timestamp to format. + * @returns {string} The formatted date string. + */ +export const formatTime = (date: Date | number): string => { + const d = (date instanceof Date) ? date : new Date(date); + const year = d.getFullYear(); + const month = pad(d.getMonth() + 1); // Months are 0-based + const day = pad(d.getDate()); + const hour = pad(d.getHours()); + const minute = pad(d.getMinutes()); + const second = pad(d.getSeconds()); + const millisecond = pad(d.getMilliseconds(), 3); // Milliseconds are 3 digits + + return `${year}-${month}-${day}T${hour}:${minute}:${second}:${millisecond}`; +}; diff --git a/packages/logger/src/index.ts b/packages/logger/src/index.ts new file mode 100644 index 000000000..68aea8669 --- /dev/null +++ b/packages/logger/src/index.ts @@ -0,0 +1 @@ +export { Logger, LogLevel } from './Logger'; diff --git a/packages/logger/tests/logger.test.ts b/packages/logger/tests/logger.test.ts new file mode 100644 index 000000000..85f6e39ce --- /dev/null +++ b/packages/logger/tests/logger.test.ts @@ -0,0 +1,79 @@ +import { Logger, LogLevel } from '../src'; +import { type Writer } from '../src/Logger'; + +describe('works', () => { + const writer: Writer = { + log: jest.fn(), + info: jest.fn(), + error: jest.fn(), + }; + + afterEach(() => { + jest.clearAllMocks(); + }); + + describe('calls expected method of writer', () => { + it('info calls info', () => { + const logger = new Logger(writer); + const message = 'some message'; + logger.info(message); + expect(writer.info).toHaveBeenCalledWith(expect.any(String), message); + }); + + it('debug calls log', () => { + const logger = new Logger(writer); + logger.currentLevel = LogLevel.Debug; + const message = 'some message'; + logger.debug(message); + expect(writer.log).toHaveBeenCalledWith(expect.any(String), message); + }); + + it('error calls error', () => { + const logger = new Logger(writer); + const message = 'some message'; + logger.error(message); + expect(writer.error).toHaveBeenCalledWith(expect.any(String), message); + }); + + it('warn calls warn', () => { + const logger = new Logger(writer); + const message = 'some message'; + logger.warn(message); + expect(writer.info).toHaveBeenCalledWith(expect.any(String), message); + }); + }); + + describe('log level', () => { + it('by default has info log level', () => { + const logger = new Logger(writer); + expect(logger.currentLevel).toBe(LogLevel.Info); + }); + it('switches log levels', () => { + const logger = new Logger(writer); + logger.currentLevel = LogLevel.Debug; + expect(logger.currentLevel).toBe(LogLevel.Debug); + logger.currentLevel = LogLevel.Info; + expect(logger.currentLevel).toBe(LogLevel.Info); + logger.currentLevel = LogLevel.Error; + expect(logger.currentLevel).toBe(LogLevel.Error); + }); + it('does not print message if debug is printed and info is selected', () => { + const logger = new Logger(writer); + const message = 'some message'; + expect(logger.currentLevel).toBe(LogLevel.Info); + logger.debug(message); + expect(writer.info).not.toHaveBeenCalled(); + expect(writer.log).not.toHaveBeenCalled(); + expect(writer.error).not.toHaveBeenCalled(); + }); + it('prints message if debug method is called and debug level is selected', () => { + const logger = new Logger(writer); + const message = 'some message'; + logger.currentLevel = LogLevel.Debug; + logger.debug(message); + expect(writer.info).not.toHaveBeenCalled(); + expect(writer.log).toHaveBeenCalled(); + expect(writer.error).not.toHaveBeenCalled(); + }); + }); +}); diff --git a/packages/logger/tests/smoke/cjs/index.js b/packages/logger/tests/smoke/cjs/index.js new file mode 100644 index 000000000..4ce1e06dc --- /dev/null +++ b/packages/logger/tests/smoke/cjs/index.js @@ -0,0 +1,5 @@ +const { Logger } = require('@adguard/logger'); + +const logger = new Logger(); + +logger.info('I am a log message from a cjs module.'); diff --git a/packages/logger/tests/smoke/cjs/package.json b/packages/logger/tests/smoke/cjs/package.json new file mode 100644 index 000000000..a59623d5c --- /dev/null +++ b/packages/logger/tests/smoke/cjs/package.json @@ -0,0 +1,11 @@ +{ + "name": "cjs", + "version": "1.0.0", + "main": "index.js", + "license": "MIT", + "author": "Adguard Software Ltd.", + "scripts": { + "start": "node index.js", + "test": "./test.sh" + } +} diff --git a/packages/logger/tests/smoke/cjs/test.sh b/packages/logger/tests/smoke/cjs/test.sh new file mode 100755 index 000000000..e149bb8c5 --- /dev/null +++ b/packages/logger/tests/smoke/cjs/test.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +set -e # Exit on error + +# pack @adguard/logger +curr_path="tests/smoke/cjs" +logger="logger.tgz" +nm_path="node_modules" + +# Define cleanup function +cleanup() { + echo "Cleaning up..." + rm -f $logger && rm -rf $nm_path + echo "Cleanup complete" +} + +# Set trap to execute the cleanup function on script exit +trap cleanup EXIT + +(cd ../../.. && pnpm pack && mv adguard-logger-*.tgz "$curr_path/$logger") + +# unzip to @adguard/tsurlfilter to node_modules +logger_node_modules=$nm_path"/@adguard/logger" +mkdir -p $logger_node_modules +tar -xzf $logger --strip-components=1 -C $logger_node_modules + +pnpm start +echo "Test successfully built." diff --git a/packages/logger/tests/smoke/esm/index.js b/packages/logger/tests/smoke/esm/index.js new file mode 100644 index 000000000..842fa6479 --- /dev/null +++ b/packages/logger/tests/smoke/esm/index.js @@ -0,0 +1,5 @@ +import { Logger } from '@adguard/logger'; + +const logger = new Logger(); + +logger.info('I am a log message from a esm module.'); diff --git a/packages/logger/tests/smoke/esm/package.json b/packages/logger/tests/smoke/esm/package.json new file mode 100644 index 000000000..b68791870 --- /dev/null +++ b/packages/logger/tests/smoke/esm/package.json @@ -0,0 +1,12 @@ +{ + "name": "esm", + "version": "1.0.0", + "main": "index.js", + "license": "MIT", + "author": "Adguard Software Ltd.", + "type": "module", + "scripts": { + "start": "node index.js", + "test": "./test.sh" + } +} diff --git a/packages/logger/tests/smoke/esm/test.sh b/packages/logger/tests/smoke/esm/test.sh new file mode 100755 index 000000000..b11d14b3d --- /dev/null +++ b/packages/logger/tests/smoke/esm/test.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +set -e # Exit on error + +# pack @adguard/logger +curr_path="tests/smoke/esm" +logger="logger.tgz" +nm_path="node_modules" + +# Define cleanup function +cleanup() { + echo "Cleaning up..." + rm -f $logger && rm -rf $nm_path + echo "Cleanup complete" +} + +# Set trap to execute the cleanup function on script exit +trap cleanup EXIT + +(cd ../../.. && pnpm pack && mv adguard-logger-*.tgz "$curr_path/$logger") + +# unzip to @adguard/tsurlfilter to node_modules +logger_node_modules=$nm_path"/@adguard/logger" +mkdir -p $logger_node_modules +tar -xzf $logger --strip-components=1 -C $logger_node_modules + +pnpm start +echo "Test successfully built." diff --git a/packages/logger/tests/smoke/typescript/index.ts b/packages/logger/tests/smoke/typescript/index.ts new file mode 100644 index 000000000..842fa6479 --- /dev/null +++ b/packages/logger/tests/smoke/typescript/index.ts @@ -0,0 +1,5 @@ +import { Logger } from '@adguard/logger'; + +const logger = new Logger(); + +logger.info('I am a log message from a esm module.'); diff --git a/packages/logger/tests/smoke/typescript/package.json b/packages/logger/tests/smoke/typescript/package.json new file mode 100644 index 000000000..325b1cdff --- /dev/null +++ b/packages/logger/tests/smoke/typescript/package.json @@ -0,0 +1,11 @@ +{ + "name": "typescript", + "version": "1.0.0", + "main": "index.js", + "license": "MIT", + "author": "Adguard Software Ltd.", + "scripts": { + "start": "tsc --noEmit", + "test": "./test.sh" + } +} diff --git a/packages/logger/tests/smoke/typescript/test.sh b/packages/logger/tests/smoke/typescript/test.sh new file mode 100755 index 000000000..d7ea546d5 --- /dev/null +++ b/packages/logger/tests/smoke/typescript/test.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +set -e # Exit on error + +curr_path="tests/smoke/typescript" +logger="logger.tgz" +nm_path="node_modules" + +# Define cleanup function +cleanup() { + echo "Performing cleanup..." + rm -f $logger && rm -rf $nm_path + echo "Cleanup complete" +} + +# Set trap to execute the cleanup function on script exit +trap cleanup EXIT + +(cd ../../.. && pnpm pack && mv adguard-logger-*.tgz "$curr_path/$logger") + +# unzip to @adguard/tsurlfilter to node_modules +logger_node_modules=$nm_path"/@adguard/logger" +mkdir -p $logger_node_modules +tar -xzf $logger --strip-components=1 -C $logger_node_modules + +pnpm start +echo "Test successfully built." diff --git a/packages/logger/tests/smoke/typescript/tsconfig.json b/packages/logger/tests/smoke/typescript/tsconfig.json new file mode 100644 index 000000000..18a6bedec --- /dev/null +++ b/packages/logger/tests/smoke/typescript/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "target": "es2016", + "module": "commonjs", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true + } +} diff --git a/packages/logger/tsconfig.base.json b/packages/logger/tsconfig.base.json new file mode 100644 index 000000000..082dca149 --- /dev/null +++ b/packages/logger/tsconfig.base.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "moduleResolution": "node", + "target": "ESNext", + "module":"ESNext", + "lib": ["esnext", "dom"], + "strict": true, + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + "resolveJsonModule": true, + }, + "typeRoots": [ + "node_modules/@types", + ], + "include": [ + "src", + ] +} diff --git a/packages/logger/tsconfig.json b/packages/logger/tsconfig.json new file mode 100644 index 000000000..c282b34e1 --- /dev/null +++ b/packages/logger/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "./tsconfig.base.json", + "include": [ + "tests", + "scripts", + "rollup.config.ts", + ".eslintrc.js", + "jest.config.ts", + ], + "exclude": [ + "tests/smoke/typescript" + ] +} diff --git a/packages/tsurlfilter/package.json b/packages/tsurlfilter/package.json index 741a4af08..03aac20db 100644 --- a/packages/tsurlfilter/package.json +++ b/packages/tsurlfilter/package.json @@ -48,7 +48,7 @@ "bin": { "tsurlfilter": "dist/cli.js" }, - "author": "AdGuard", + "author": "Adguard Software Ltd.", "repository": { "type": "git", "url": "git+https://github.com/AdguardTeam/tsurlfilter.git", diff --git a/packages/tsurlfilter/test/builders/rollup-ts/test.sh b/packages/tsurlfilter/test/builders/rollup-ts/test.sh index df11e2b54..92d019592 100755 --- a/packages/tsurlfilter/test/builders/rollup-ts/test.sh +++ b/packages/tsurlfilter/test/builders/rollup-ts/test.sh @@ -9,7 +9,7 @@ pnpm install curr_path="test/builders/rollup-ts" tsurlfilter="tsurlfilter.tgz" -(cd ../../.. && pnpm pack && mv $(ls adguard-tsurlfilter-*.tgz) $curr_path/$tsurlfilter) +(cd ../../.. && pnpm pack && mv adguard-tsurlfilter-*.tgz "$curr_path/$tsurlfilter") # unzip to @adguard/tsurlfilter to node_modules tsurlfilter_nm="node_modules/@adguard/tsurlfilter" diff --git a/packages/tswebextension/package.json b/packages/tswebextension/package.json index 5812f53ab..7ee099f82 100644 --- a/packages/tswebextension/package.json +++ b/packages/tswebextension/package.json @@ -46,7 +46,7 @@ "dist", "src" ], - "author": "AdGuard", + "author": "Adguard Software Ltd.", "repository": { "type": "git", "url": "git+https://github.com/AdguardTeam/tsurlfilter.git", diff --git a/packages/tswebextension/test/builders/rollup-ts/test.sh b/packages/tswebextension/test/builders/rollup-ts/test.sh index da67c2da5..de226f137 100755 --- a/packages/tswebextension/test/builders/rollup-ts/test.sh +++ b/packages/tswebextension/test/builders/rollup-ts/test.sh @@ -9,7 +9,7 @@ pnpm install curr_path="test/builders/rollup-ts" tswebextension="tswebextension.tgz" -(cd ../../.. && pnpm pack && mv $(ls adguard-tswebextension-*.tgz) $curr_path/$tswebextension) +(cd ../../.. && pnpm pack && mv adguard-tswebextension-*.tgz "$curr_path/$tswebextension") # unzip to @adguard/tswebextension to node_modules tswebextension_nm="node_modules/@adguard/tswebextension" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3865011e4..c0a9f86d4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -641,6 +641,66 @@ importers: specifier: ^5.64.2 version: 5.90.3(@swc/core@1.4.8) + packages/logger: + devDependencies: + '@rollup/plugin-commonjs': + specifier: ^25.0.7 + version: 25.0.7(rollup@4.13.0) + '@rollup/plugin-node-resolve': + specifier: ^15.2.3 + version: 15.2.3(rollup@4.13.0) + '@rollup/plugin-typescript': + specifier: ^11.1.6 + version: 11.1.6(rollup@4.13.0)(tslib@2.6.2)(typescript@5.4.2) + '@types/jest': + specifier: ^29.5.12 + version: 29.5.12 + '@types/node': + specifier: ^20.11.30 + version: 20.11.30 + '@typescript-eslint/eslint-plugin': + specifier: ^7.0.0 + version: 7.3.1(@typescript-eslint/parser@7.3.1)(eslint@8.57.0)(typescript@5.4.2) + '@typescript-eslint/parser': + specifier: ^7.0.0 + version: 7.3.1(eslint@8.57.0)(typescript@5.4.2) + eslint: + specifier: ^8.56.0 + version: 8.57.0 + eslint-config-airbnb-base: + specifier: 15.0.0 + version: 15.0.0(eslint-plugin-import@2.29.1)(eslint@8.57.0) + eslint-config-airbnb-typescript: + specifier: 18.0.0 + version: 18.0.0(@typescript-eslint/eslint-plugin@7.3.1)(@typescript-eslint/parser@7.3.1)(eslint-plugin-import@2.29.1)(eslint@8.57.0) + eslint-plugin-import: + specifier: ^2.25.2 + version: 2.29.1(@typescript-eslint/parser@7.3.1)(eslint@8.57.0) + eslint-plugin-jsdoc: + specifier: ^48.2.1 + version: 48.2.1(eslint@8.57.0) + jest: + specifier: ^29.7.0 + version: 29.7.0(@types/node@20.11.30)(ts-node@10.9.2) + rimraf: + specifier: ^5.0.5 + version: 5.0.5 + rollup: + specifier: ^4.13.0 + version: 4.13.0 + ts-jest: + specifier: ^29.1.2 + version: 29.1.2(@babel/core@7.24.3)(jest@29.7.0)(typescript@5.4.2) + ts-node: + specifier: ^10.9.2 + version: 10.9.2(@swc/core@1.4.8)(@types/node@20.11.30)(typescript@5.4.2) + tslib: + specifier: ^2.6.2 + version: 2.6.2 + typescript: + specifier: ^5.4.2 + version: 5.4.2 + packages/tsurlfilter: dependencies: '@adguard/scriptlets': @@ -1036,6 +1096,29 @@ packages: engines: {node: '>=6.9.0'} dev: true + /@babel/core@7.24.1: + resolution: {integrity: sha512-F82udohVyIgGAY2VVj/g34TpFUG606rumIHjTfVbssPg2zTR7PuuEpZcX8JA6sgBfIYmJrFtWgPvHQuJamVqZQ==} + engines: {node: '>=6.9.0'} + dependencies: + '@ampproject/remapping': 2.3.0 + '@babel/code-frame': 7.24.2 + '@babel/generator': 7.24.1 + '@babel/helper-compilation-targets': 7.23.6 + '@babel/helper-module-transforms': 7.23.3(@babel/core@7.24.1) + '@babel/helpers': 7.24.1 + '@babel/parser': 7.24.1 + '@babel/template': 7.24.0 + '@babel/traverse': 7.24.1 + '@babel/types': 7.24.0 + convert-source-map: 2.0.0 + debug: 4.3.4 + gensync: 1.0.0-beta.2 + json5: 2.2.3 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + dev: true + /@babel/core@7.24.3: resolution: {integrity: sha512-5FcvN1JHw2sHJChotgx8Ek0lyuh4kCKelgMTTqhYJJtloNvUfpAFMeNQUtdlIaktwrSV9LtCdqwk48wL2wBacQ==} engines: {node: '>=6.9.0'} @@ -1173,6 +1256,20 @@ packages: '@babel/types': 7.24.0 dev: true + /@babel/helper-module-transforms@7.23.3(@babel/core@7.24.1): + resolution: {integrity: sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.24.1 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-module-imports': 7.24.3 + '@babel/helper-simple-access': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + '@babel/helper-validator-identifier': 7.22.20 + dev: true + /@babel/helper-module-transforms@7.23.3(@babel/core@7.24.3): resolution: {integrity: sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==} engines: {node: '>=6.9.0'} @@ -1339,6 +1436,15 @@ packages: '@babel/core': 7.24.3 dev: true + /@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.24.1): + resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.24.1 + '@babel/helper-plugin-utils': 7.24.0 + dev: true + /@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.24.3): resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} peerDependencies: @@ -1348,6 +1454,15 @@ packages: '@babel/helper-plugin-utils': 7.24.0 dev: true + /@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.24.1): + resolution: {integrity: sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.24.1 + '@babel/helper-plugin-utils': 7.24.0 + dev: true + /@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.24.3): resolution: {integrity: sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==} peerDependencies: @@ -1357,6 +1472,15 @@ packages: '@babel/helper-plugin-utils': 7.24.0 dev: true + /@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.24.1): + resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.24.1 + '@babel/helper-plugin-utils': 7.24.0 + dev: true + /@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.24.3): resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==} peerDependencies: @@ -1414,6 +1538,15 @@ packages: '@babel/helper-plugin-utils': 7.24.0 dev: true + /@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.24.1): + resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.24.1 + '@babel/helper-plugin-utils': 7.24.0 + dev: true + /@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.24.3): resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} peerDependencies: @@ -1423,6 +1556,15 @@ packages: '@babel/helper-plugin-utils': 7.24.0 dev: true + /@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.24.1): + resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.24.1 + '@babel/helper-plugin-utils': 7.24.0 + dev: true + /@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.24.3): resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} peerDependencies: @@ -1432,13 +1574,22 @@ packages: '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-syntax-jsx@7.24.1(@babel/core@7.24.3): + /@babel/plugin-syntax-jsx@7.24.1(@babel/core@7.24.1): resolution: {integrity: sha512-2eCtxZXf+kbkMIsXS4poTvT4Yu5rXiRa+9xGVT56raghjmBTKMpFNc9R4IDiB4emao9eO22Ox7CxuJG7BgExqA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.24.3 + '@babel/core': 7.24.1 + '@babel/helper-plugin-utils': 7.24.0 + dev: true + + /@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.24.1): + resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.24.1 '@babel/helper-plugin-utils': 7.24.0 dev: true @@ -1451,6 +1602,15 @@ packages: '@babel/helper-plugin-utils': 7.24.0 dev: true + /@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.24.1): + resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.24.1 + '@babel/helper-plugin-utils': 7.24.0 + dev: true + /@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.24.3): resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} peerDependencies: @@ -1460,6 +1620,15 @@ packages: '@babel/helper-plugin-utils': 7.24.0 dev: true + /@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.24.1): + resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.24.1 + '@babel/helper-plugin-utils': 7.24.0 + dev: true + /@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.24.3): resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} peerDependencies: @@ -1469,6 +1638,15 @@ packages: '@babel/helper-plugin-utils': 7.24.0 dev: true + /@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.24.1): + resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.24.1 + '@babel/helper-plugin-utils': 7.24.0 + dev: true + /@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.24.3): resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} peerDependencies: @@ -1478,6 +1656,15 @@ packages: '@babel/helper-plugin-utils': 7.24.0 dev: true + /@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.24.1): + resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.24.1 + '@babel/helper-plugin-utils': 7.24.0 + dev: true + /@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.24.3): resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} peerDependencies: @@ -1487,6 +1674,15 @@ packages: '@babel/helper-plugin-utils': 7.24.0 dev: true + /@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.24.1): + resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.24.1 + '@babel/helper-plugin-utils': 7.24.0 + dev: true + /@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.24.3): resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} peerDependencies: @@ -1506,6 +1702,16 @@ packages: '@babel/helper-plugin-utils': 7.24.0 dev: true + /@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.24.1): + resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.24.1 + '@babel/helper-plugin-utils': 7.24.0 + dev: true + /@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.24.3): resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} engines: {node: '>=6.9.0'} @@ -1516,13 +1722,13 @@ packages: '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-syntax-typescript@7.24.1(@babel/core@7.24.3): + /@babel/plugin-syntax-typescript@7.24.1(@babel/core@7.24.1): resolution: {integrity: sha512-Yhnmvy5HZEnHUty6i++gcfH1/l68AHnItFHnaCv6hn9dNh0hQvvQJsxpi4BMBFN5DLeHBuucT/0DgzXif/OyRw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.24.3 + '@babel/core': 7.24.1 '@babel/helper-plugin-utils': 7.24.0 dev: true @@ -2306,6 +2512,15 @@ packages: jsdoc-type-pratt-parser: 4.0.0 dev: true + /@es-joy/jsdoccomment@0.42.0: + resolution: {integrity: sha512-R1w57YlVA6+YE01wch3GPYn6bCsrOV3YW/5oGGE2tmX6JcL9Nr+b5IikrjMPF+v9CV3ay+obImEdsDhovhJrzw==} + engines: {node: '>=16'} + dependencies: + comment-parser: 1.4.1 + esquery: 1.5.0 + jsdoc-type-pratt-parser: 4.0.0 + dev: true + /@esbuild/aix-ppc64@0.19.12: resolution: {integrity: sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==} engines: {node: '>=12'} @@ -2543,6 +2758,16 @@ packages: eslint-visitor-keys: 3.4.3 dev: true + /@eslint-community/eslint-utils@4.4.0(eslint@8.57.0): + resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + dependencies: + eslint: 8.57.0 + eslint-visitor-keys: 3.4.3 + dev: true + /@eslint-community/regexpp@4.10.0: resolution: {integrity: sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} @@ -2592,6 +2817,11 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true + /@eslint/js@8.57.0: + resolution: {integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: true + /@humanwhocodes/config-array@0.10.7: resolution: {integrity: sha512-MDl6D6sBsaV452/QSdX+4CXIjZhIcI0PELsxUjk4U828yd58vk3bTIvk/6w5FY+4hIy9sLW0sfrV7K7Kc++j/w==} engines: {node: '>=10.10.0'} @@ -2872,7 +3102,7 @@ packages: resolution: {integrity: sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@babel/core': 7.24.3 + '@babel/core': 7.24.1 '@jest/types': 29.6.3 '@jridgewell/trace-mapping': 0.3.25 babel-plugin-istanbul: 6.1.1 @@ -3151,7 +3381,7 @@ packages: hasBin: true dependencies: nx: 18.1.2 - tslib: 2.5.3 + tslib: 2.6.2 transitivePeerDependencies: - '@swc-node/register' - '@swc/core' @@ -3170,7 +3400,7 @@ packages: nx: 18.1.2 semver: 7.6.0 tmp: 0.2.3 - tslib: 2.5.3 + tslib: 2.6.2 yargs-parser: 21.1.1 dev: true @@ -3719,6 +3949,26 @@ packages: typescript: 5.4.2 dev: true + /@rollup/plugin-typescript@11.1.6(rollup@4.13.0)(tslib@2.6.2)(typescript@5.4.2): + resolution: {integrity: sha512-R92yOmIACgYdJ7dJ97p4K69I8gg6IEHt8M7dUBxN3W6nrO8uUxX5ixl0yU/N3aZTi8WhPuICvOHXQvF6FaykAA==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^2.14.0||^3.0.0||^4.0.0 + tslib: '*' + typescript: '>=3.7.0' + peerDependenciesMeta: + rollup: + optional: true + tslib: + optional: true + dependencies: + '@rollup/pluginutils': 5.1.0(rollup@4.13.0) + resolve: 1.22.8 + rollup: 4.13.0 + tslib: 2.6.2 + typescript: 5.4.2 + dev: true + /@rollup/plugin-typescript@8.3.4(rollup@2.77.3)(tslib@2.4.0)(typescript@4.7.4): resolution: {integrity: sha512-wt7JnYE9antX6BOXtsxGoeVSu4dZfw0dU3xykfOQ4hC3EddxRbVG/K0xiY1Wup7QOHJcjLYXWAn0Kx9Z1SBHHg==} engines: {node: '>=8.0.0'} @@ -4822,6 +5072,35 @@ packages: - supports-color dev: true + /@typescript-eslint/eslint-plugin@7.3.1(@typescript-eslint/parser@7.3.1)(eslint@8.57.0)(typescript@5.4.2): + resolution: {integrity: sha512-STEDMVQGww5lhCuNXVSQfbfuNII5E08QWkvAw5Qwf+bj2WT+JkG1uc+5/vXA3AOYMDHVOSpL+9rcbEUiHIm2dw==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + '@typescript-eslint/parser': ^7.0.0 + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@eslint-community/regexpp': 4.10.0 + '@typescript-eslint/parser': 7.3.1(eslint@8.57.0)(typescript@5.4.2) + '@typescript-eslint/scope-manager': 7.3.1 + '@typescript-eslint/type-utils': 7.3.1(eslint@8.57.0)(typescript@5.4.2) + '@typescript-eslint/utils': 7.3.1(eslint@8.57.0)(typescript@5.4.2) + '@typescript-eslint/visitor-keys': 7.3.1 + debug: 4.3.4 + eslint: 8.57.0 + graphemer: 1.4.0 + ignore: 5.3.1 + natural-compare: 1.4.0 + semver: 7.6.0 + ts-api-utils: 1.3.0(typescript@5.4.2) + typescript: 5.4.2 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/parser@5.33.0(eslint@8.21.0)(typescript@4.7.4): resolution: {integrity: sha512-cgM5cJrWmrDV2KpvlcSkelTBASAs1mgqq+IUGKJvFxWrapHpaRy5EXPQz9YaKF3nZ8KY18ILTiVpUtbIac86/w==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -4924,6 +5203,27 @@ packages: - supports-color dev: true + /@typescript-eslint/parser@7.3.1(eslint@8.57.0)(typescript@5.4.2): + resolution: {integrity: sha512-Rq49+pq7viTRCH48XAbTA+wdLRrB/3sRq4Lpk0oGDm0VmnjBrAOVXH/Laalmwsv2VpekiEfVFwJYVk6/e8uvQw==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/scope-manager': 7.3.1 + '@typescript-eslint/types': 7.3.1 + '@typescript-eslint/typescript-estree': 7.3.1(typescript@5.4.2) + '@typescript-eslint/visitor-keys': 7.3.1 + debug: 4.3.4 + eslint: 8.57.0 + typescript: 5.4.2 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/scope-manager@5.33.0: resolution: {integrity: sha512-/Jta8yMNpXYpRDl8EwF/M8It2A9sFJTubDo0ATZefGXmOqlaBffEw0ZbkbQ7TNDK6q55NPHFshGBPAZvZkE8Pw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -4964,6 +5264,14 @@ packages: '@typescript-eslint/visitor-keys': 6.21.0 dev: true + /@typescript-eslint/scope-manager@7.3.1: + resolution: {integrity: sha512-fVS6fPxldsKY2nFvyT7IP78UO1/I2huG+AYu5AMjCT9wtl6JFiDnsv4uad4jQ0GTFzcUV5HShVeN96/17bTBag==} + engines: {node: ^18.18.0 || >=20.0.0} + dependencies: + '@typescript-eslint/types': 7.3.1 + '@typescript-eslint/visitor-keys': 7.3.1 + dev: true + /@typescript-eslint/type-utils@5.33.0(eslint@8.21.0)(typescript@4.7.4): resolution: {integrity: sha512-2zB8uEn7hEH2pBeyk3NpzX1p3lF9dKrEbnXq1F7YkpZ6hlyqb2yZujqgRGqXgRBTHWIUG3NGx/WeZk224UKlIA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -5063,6 +5371,26 @@ packages: - supports-color dev: true + /@typescript-eslint/type-utils@7.3.1(eslint@8.57.0)(typescript@5.4.2): + resolution: {integrity: sha512-iFhaysxFsMDQlzJn+vr3OrxN8NmdQkHks4WaqD4QBnt5hsq234wcYdyQ9uquzJJIDAj5W4wQne3yEsYA6OmXGw==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/typescript-estree': 7.3.1(typescript@5.4.2) + '@typescript-eslint/utils': 7.3.1(eslint@8.57.0)(typescript@5.4.2) + debug: 4.3.4 + eslint: 8.57.0 + ts-api-utils: 1.3.0(typescript@5.4.2) + typescript: 5.4.2 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/types@5.33.0: resolution: {integrity: sha512-nIMt96JngB4MYFYXpZ/3ZNU4GWPNdBbcB5w2rDOCpXOVUkhtNlG2mmm8uXhubhidRZdwMaMBap7Uk8SZMU/ppw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -5088,6 +5416,11 @@ packages: engines: {node: ^16.0.0 || >=18.0.0} dev: true + /@typescript-eslint/types@7.3.1: + resolution: {integrity: sha512-2tUf3uWggBDl4S4183nivWQ2HqceOZh1U4hhu4p1tPiIJoRRXrab7Y+Y0p+dozYwZVvLPRI6r5wKe9kToF9FIw==} + engines: {node: ^18.18.0 || >=20.0.0} + dev: true + /@typescript-eslint/typescript-estree@5.33.0(typescript@4.7.4): resolution: {integrity: sha512-tqq3MRLlggkJKJUrzM6wltk8NckKyyorCSGMq4eVkyL5sDYzJJcMgZATqmF8fLdsWrW7OjjIZ1m9v81vKcaqwQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -5237,6 +5570,28 @@ packages: - supports-color dev: true + /@typescript-eslint/typescript-estree@7.3.1(typescript@5.4.2): + resolution: {integrity: sha512-tLpuqM46LVkduWP7JO7yVoWshpJuJzxDOPYIVWUUZbW+4dBpgGeUdl/fQkhuV0A8eGnphYw3pp8d2EnvPOfxmQ==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 7.3.1 + '@typescript-eslint/visitor-keys': 7.3.1 + debug: 4.3.4 + globby: 11.1.0 + is-glob: 4.0.3 + minimatch: 9.0.3 + semver: 7.6.0 + ts-api-utils: 1.3.0(typescript@5.4.2) + typescript: 5.4.2 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/utils@5.33.0(eslint@8.21.0)(typescript@4.7.4): resolution: {integrity: sha512-JxOAnXt9oZjXLIiXb5ZIcZXiwVHCkqZgof0O8KPgz7C7y0HS42gi75PdPlqh1Tf109M0fyUw45Ao6JLo7S5AHw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -5333,6 +5688,25 @@ packages: - typescript dev: true + /@typescript-eslint/utils@7.3.1(eslint@8.57.0)(typescript@5.4.2): + resolution: {integrity: sha512-jIERm/6bYQ9HkynYlNZvXpzmXWZGhMbrOvq3jJzOSOlKXsVjrrolzWBjDW6/TvT5Q3WqaN4EkmcfdQwi9tDjBQ==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) + '@types/json-schema': 7.0.15 + '@types/semver': 7.5.8 + '@typescript-eslint/scope-manager': 7.3.1 + '@typescript-eslint/types': 7.3.1 + '@typescript-eslint/typescript-estree': 7.3.1(typescript@5.4.2) + eslint: 8.57.0 + semver: 7.6.0 + transitivePeerDependencies: + - supports-color + - typescript + dev: true + /@typescript-eslint/visitor-keys@5.33.0: resolution: {integrity: sha512-/XsqCzD4t+Y9p5wd9HZiptuGKBlaZO5showwqODii5C0nZawxWLF+Q6k5wYHBrQv96h6GYKyqqMHCSTqta8Kiw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -5373,6 +5747,14 @@ packages: eslint-visitor-keys: 3.4.3 dev: true + /@typescript-eslint/visitor-keys@7.3.1: + resolution: {integrity: sha512-9RMXwQF8knsZvfv9tdi+4D/j7dMG28X/wMJ8Jj6eOHyHWwDW4ngQJcqEczSsqIKKjFiLFr40Mnr7a5ulDD3vmw==} + engines: {node: ^18.18.0 || >=20.0.0} + dependencies: + '@typescript-eslint/types': 7.3.1 + eslint-visitor-keys: 3.4.3 + dev: true + /@ungap/structured-clone@1.2.0: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} dev: true @@ -5500,7 +5882,7 @@ packages: engines: {node: '>=14.15.0'} dependencies: js-yaml: 3.14.1 - tslib: 2.5.3 + tslib: 2.6.2 dev: true /@zkochan/js-yaml@0.0.6: @@ -5934,6 +6316,17 @@ packages: es-shim-unscopables: 1.0.2 dev: true + /array.prototype.findlastindex@1.2.4: + resolution: {integrity: sha512-hzvSHUshSpCflDR1QMUBLHGHP1VIEBegT4pix9H/Z92Xw3ySoy6c2qh7lJWTJnRJ8JCZ9bJNCgTyYaJGcJu6xQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.23.2 + es-errors: 1.3.0 + es-shim-unscopables: 1.0.2 + dev: true + /array.prototype.findlastindex@1.2.5: resolution: {integrity: sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==} engines: {node: '>= 0.4'} @@ -5992,7 +6385,7 @@ packages: array-buffer-byte-length: 1.0.1 call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.5 + es-abstract: 1.23.2 es-errors: 1.3.0 get-intrinsic: 1.2.4 is-array-buffer: 3.0.4 @@ -6173,6 +6566,26 @@ packages: - supports-color dev: true + /babel-preset-current-node-syntax@1.0.1(@babel/core@7.24.1): + resolution: {integrity: sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.24.1 + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.24.1) + '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.24.1) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.24.1) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.24.1) + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.24.1) + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.24.1) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.24.1) + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.24.1) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.24.1) + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.24.1) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.24.1) + '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.24.1) + dev: true + /babel-preset-current-node-syntax@1.0.1(@babel/core@7.24.3): resolution: {integrity: sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==} peerDependencies: @@ -6495,7 +6908,7 @@ packages: resolution: {integrity: sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==} dependencies: pascal-case: 3.1.2 - tslib: 2.5.3 + tslib: 2.6.2 dev: true /camelcase-keys@6.2.2: @@ -6596,7 +7009,7 @@ packages: htmlparser2: 6.1.0 parse5: 6.0.1 parse5-htmlparser2-tree-adapter: 6.0.1 - tslib: 2.5.3 + tslib: 2.6.2 dev: true /chownr@2.0.0: @@ -7637,7 +8050,7 @@ packages: resolution: {integrity: sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==} dependencies: no-case: 3.0.4 - tslib: 2.5.3 + tslib: 2.6.2 dev: true /dot-prop@5.3.0: @@ -8137,6 +8550,21 @@ packages: semver: 6.3.1 dev: true + /eslint-config-airbnb-base@15.0.0(eslint-plugin-import@2.29.1)(eslint@8.57.0): + resolution: {integrity: sha512-xaX3z4ZZIcFLvh2oUNvcX5oEofXda7giYmuplVxoOg5A7EXJMrUyqRgR+mhDhPK8LZ4PttFOBvCYDbX3sUoUig==} + engines: {node: ^10.12.0 || >=12.0.0} + peerDependencies: + eslint: ^7.32.0 || ^8.2.0 + eslint-plugin-import: ^2.25.2 + dependencies: + confusing-browser-globals: 1.0.11 + eslint: 8.57.0 + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.3.1)(eslint@8.57.0) + object.assign: 4.1.5 + object.entries: 1.1.8 + semver: 6.3.1 + dev: true + /eslint-config-airbnb-typescript@16.2.0(@typescript-eslint/eslint-plugin@5.62.0)(@typescript-eslint/parser@5.62.0)(eslint-plugin-import@2.29.1)(eslint@8.54.0): resolution: {integrity: sha512-OUaMPZpTOZGKd5tXOjJ9PRU4iYNW/Z5DoHIynjsVK/FpkWdiY5+nxQW6TiJAlLwVI1l53xUOrnlZWtVBVQzuWA==} peerDependencies: @@ -8227,6 +8655,21 @@ packages: eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.13.1)(eslint@8.54.0) dev: true + /eslint-config-airbnb-typescript@18.0.0(@typescript-eslint/eslint-plugin@7.3.1)(@typescript-eslint/parser@7.3.1)(eslint-plugin-import@2.29.1)(eslint@8.57.0): + resolution: {integrity: sha512-oc+Lxzgzsu8FQyFVa4QFaVKiitTYiiW3frB9KYW5OWdPrqFc7FzxgB20hP4cHMlr+MBzGcLl3jnCOVOydL9mIg==} + peerDependencies: + '@typescript-eslint/eslint-plugin': ^7.0.0 + '@typescript-eslint/parser': ^7.0.0 + eslint: ^8.56.0 + dependencies: + '@typescript-eslint/eslint-plugin': 7.3.1(@typescript-eslint/parser@7.3.1)(eslint@8.57.0)(typescript@5.4.2) + '@typescript-eslint/parser': 7.3.1(eslint@8.57.0)(typescript@5.4.2) + eslint: 8.57.0 + eslint-config-airbnb-base: 15.0.0(eslint-plugin-import@2.29.1)(eslint@8.57.0) + transitivePeerDependencies: + - eslint-plugin-import + dev: true + /eslint-config-prettier@8.10.0(eslint@8.54.0): resolution: {integrity: sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==} hasBin: true @@ -8400,6 +8843,35 @@ packages: - supports-color dev: true + /eslint-module-utils@2.8.1(@typescript-eslint/parser@7.3.1)(eslint-import-resolver-node@0.3.9)(eslint@8.57.0): + resolution: {integrity: sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==} + engines: {node: '>=4'} + peerDependencies: + '@typescript-eslint/parser': '*' + eslint: '*' + eslint-import-resolver-node: '*' + eslint-import-resolver-typescript: '*' + eslint-import-resolver-webpack: '*' + peerDependenciesMeta: + '@typescript-eslint/parser': + optional: true + eslint: + optional: true + eslint-import-resolver-node: + optional: true + eslint-import-resolver-typescript: + optional: true + eslint-import-resolver-webpack: + optional: true + dependencies: + '@typescript-eslint/parser': 7.3.1(eslint@8.57.0)(typescript@5.4.2) + debug: 3.2.7 + eslint: 8.57.0 + eslint-import-resolver-node: 0.3.9 + transitivePeerDependencies: + - supports-color + dev: true + /eslint-plugin-import-newlines@1.2.3(eslint@8.21.0): resolution: {integrity: sha512-UQBhG7dcIoBjaPjbcudqqcKYQVhYXnu9NBB7d8pBnDFZP4GTNPdszpeUbvSxcp/JyBE4TsUZt5u/UtEVioxh9g==} engines: {node: '>=10.0.0'} @@ -8599,6 +9071,41 @@ packages: - supports-color dev: true + /eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.3.1)(eslint@8.57.0): + resolution: {integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==} + engines: {node: '>=4'} + peerDependencies: + '@typescript-eslint/parser': '*' + eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 + peerDependenciesMeta: + '@typescript-eslint/parser': + optional: true + dependencies: + '@typescript-eslint/parser': 7.3.1(eslint@8.57.0)(typescript@5.4.2) + array-includes: 3.1.7 + array.prototype.findlastindex: 1.2.4 + array.prototype.flat: 1.3.2 + array.prototype.flatmap: 1.3.2 + debug: 3.2.7 + doctrine: 2.1.0 + eslint: 8.57.0 + eslint-import-resolver-node: 0.3.9 + eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.3.1)(eslint-import-resolver-node@0.3.9)(eslint@8.57.0) + hasown: 2.0.2 + is-core-module: 2.13.1 + is-glob: 4.0.3 + minimatch: 3.1.2 + object.fromentries: 2.0.8 + object.groupby: 1.0.3 + object.values: 1.2.0 + semver: 6.3.1 + tsconfig-paths: 3.15.0 + transitivePeerDependencies: + - eslint-import-resolver-typescript + - eslint-import-resolver-webpack + - supports-color + dev: true + /eslint-plugin-jsdoc@39.3.6(eslint@8.21.0): resolution: {integrity: sha512-R6dZ4t83qPdMhIOGr7g2QII2pwCjYyKP+z0tPOfO1bbAbQyKC20Y2Rd6z1te86Lq3T7uM8bNo+VD9YFpE8HU/g==} engines: {node: ^14 || ^16 || ^17 || ^18} @@ -8675,6 +9182,26 @@ packages: - supports-color dev: true + /eslint-plugin-jsdoc@48.2.1(eslint@8.57.0): + resolution: {integrity: sha512-iUvbcyDZSO/9xSuRv2HQBw++8VkV/pt3UWtX9cpPH0l7GKPq78QC/6+PmyQHHvNZaTjAce6QVciEbnc6J/zH5g==} + engines: {node: '>=18'} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 || ^9.0.0 + dependencies: + '@es-joy/jsdoccomment': 0.42.0 + are-docs-informative: 0.0.2 + comment-parser: 1.4.1 + debug: 4.3.4 + escape-string-regexp: 4.0.0 + eslint: 8.57.0 + esquery: 1.5.0 + is-builtin-module: 3.2.1 + semver: 7.6.0 + spdx-expression-parse: 4.0.0 + transitivePeerDependencies: + - supports-color + dev: true + /eslint-plugin-no-unsanitized@4.0.1(eslint@8.11.0): resolution: {integrity: sha512-y/lAMWnPPC7RYuUdxlEL/XiCL8FehN9h9s3Kjqbp/Kv0i9NZs+IXSC2kS546Fa4Bumwy31HlVS/OdWX0Kxb5Xg==} peerDependencies: @@ -8840,8 +9367,8 @@ packages: escape-string-regexp: 4.0.0 eslint-scope: 7.2.2 eslint-utils: 3.0.0(eslint@8.11.0) - eslint-visitor-keys: 3.3.0 - espree: 9.3.1 + eslint-visitor-keys: 3.4.3 + espree: 9.6.1 esquery: 1.5.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 @@ -9059,13 +9586,60 @@ packages: - supports-color dev: true + /eslint@8.57.0: + resolution: {integrity: sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + hasBin: true + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) + '@eslint-community/regexpp': 4.10.0 + '@eslint/eslintrc': 2.1.4 + '@eslint/js': 8.57.0 + '@humanwhocodes/config-array': 0.11.14 + '@humanwhocodes/module-importer': 1.0.1 + '@nodelib/fs.walk': 1.2.8 + '@ungap/structured-clone': 1.2.0 + ajv: 6.12.6 + chalk: 4.1.2 + cross-spawn: 7.0.3 + debug: 4.3.4 + doctrine: 3.0.0 + escape-string-regexp: 4.0.0 + eslint-scope: 7.2.2 + eslint-visitor-keys: 3.4.3 + espree: 9.6.1 + esquery: 1.5.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 6.0.1 + find-up: 5.0.0 + glob-parent: 6.0.2 + globals: 13.24.0 + graphemer: 1.4.0 + ignore: 5.3.1 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + is-path-inside: 3.0.3 + js-yaml: 4.1.0 + json-stable-stringify-without-jsonify: 1.0.1 + levn: 0.4.1 + lodash.merge: 4.6.2 + minimatch: 3.1.2 + natural-compare: 1.4.0 + optionator: 0.9.3 + strip-ansi: 6.0.1 + text-table: 0.2.0 + transitivePeerDependencies: + - supports-color + dev: true + /espree@9.3.1: resolution: {integrity: sha512-bvdyLmJMfwkV3NCRl5ZhJf22zBFo1y8bYh3VYb+bfzqNB4Je68P2sSuXyuFquzWLebHpNd2/d5uv7yoP9ISnGQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: acorn: 8.11.3 acorn-jsx: 5.3.2(acorn@8.11.3) - eslint-visitor-keys: 3.3.0 + eslint-visitor-keys: 3.4.3 dev: true /espree@9.6.1: @@ -9684,7 +10258,7 @@ packages: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.5 + es-abstract: 1.23.2 functions-have-names: 1.2.3 dev: true @@ -11039,7 +11613,7 @@ packages: resolution: {integrity: sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==} engines: {node: '>=8'} dependencies: - '@babel/core': 7.24.3 + '@babel/core': 7.24.1 '@babel/parser': 7.24.1 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.2 @@ -11541,15 +12115,15 @@ packages: resolution: {integrity: sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@babel/core': 7.24.3 + '@babel/core': 7.24.1 '@babel/generator': 7.24.1 - '@babel/plugin-syntax-jsx': 7.24.1(@babel/core@7.24.3) - '@babel/plugin-syntax-typescript': 7.24.1(@babel/core@7.24.3) + '@babel/plugin-syntax-jsx': 7.24.1(@babel/core@7.24.1) + '@babel/plugin-syntax-typescript': 7.24.1(@babel/core@7.24.1) '@babel/types': 7.24.0 '@jest/expect-utils': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - babel-preset-current-node-syntax: 1.0.1(@babel/core@7.24.3) + babel-preset-current-node-syntax: 1.0.1(@babel/core@7.24.1) chalk: 4.1.2 expect: 29.7.0 graceful-fs: 4.2.11 @@ -12440,7 +13014,7 @@ packages: /lower-case@2.0.2: resolution: {integrity: sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==} dependencies: - tslib: 2.5.3 + tslib: 2.6.2 dev: true /lowercase-keys@1.0.0: @@ -13085,7 +13659,7 @@ packages: resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==} dependencies: lower-case: 2.0.2 - tslib: 2.5.3 + tslib: 2.6.2 dev: true /node-fetch@2.6.7: @@ -13419,7 +13993,7 @@ packages: tar-stream: 2.2.0 tmp: 0.2.3 tsconfig-paths: 4.2.0 - tslib: 2.5.3 + tslib: 2.6.2 yargs: 17.7.2 yargs-parser: 21.1.1 optionalDependencies: @@ -13823,7 +14397,7 @@ packages: resolution: {integrity: sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==} dependencies: dot-case: 3.0.4 - tslib: 2.5.3 + tslib: 2.6.2 dev: true /parent-module@1.0.1: @@ -13892,7 +14466,7 @@ packages: resolution: {integrity: sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==} dependencies: no-case: 3.0.4 - tslib: 2.5.3 + tslib: 2.6.2 dev: true /path-exists@3.0.0: @@ -14985,7 +15559,7 @@ packages: /rxjs@7.8.1: resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} dependencies: - tslib: 2.5.3 + tslib: 2.6.2 dev: true /safe-array-concat@1.1.2: @@ -15679,7 +16253,7 @@ packages: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.5 + es-abstract: 1.23.2 dev: true /string_decoder@1.1.1: @@ -16165,6 +16739,40 @@ packages: yargs-parser: 21.1.1 dev: true + /ts-jest@29.1.2(@babel/core@7.24.3)(jest@29.7.0)(typescript@5.4.2): + resolution: {integrity: sha512-br6GJoH/WUX4pu7FbZXuWGKGNDuU7b8Uj77g/Sp7puZV6EXzuByl6JrECvm0MzVzSTkSHWTihsXt+5XYER5b+g==} + engines: {node: ^16.10.0 || ^18.0.0 || >=20.0.0} + hasBin: true + peerDependencies: + '@babel/core': '>=7.0.0-beta.0 <8' + '@jest/types': ^29.0.0 + babel-jest: ^29.0.0 + esbuild: '*' + jest: ^29.0.0 + typescript: '>=4.3 <6' + peerDependenciesMeta: + '@babel/core': + optional: true + '@jest/types': + optional: true + babel-jest: + optional: true + esbuild: + optional: true + dependencies: + '@babel/core': 7.24.3 + bs-logger: 0.2.6 + fast-json-stable-stringify: 2.1.0 + jest: 29.7.0(@types/node@20.11.30)(ts-node@10.9.2) + jest-util: 29.7.0 + json5: 2.2.3 + lodash.memoize: 4.1.2 + make-error: 1.3.6 + semver: 7.6.0 + typescript: 5.4.2 + yargs-parser: 21.1.1 + dev: true + /ts-node@10.9.2(@swc/core@1.4.8)(@types/node@18.7.1)(typescript@4.7.4): resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} hasBin: true