From 794bdd4384507b3e0459099967a2c0a63abdbd82 Mon Sep 17 00:00:00 2001 From: Jacob Kreyenbuehl Date: Fri, 21 Aug 2026 09:51:37 +0200 Subject: [PATCH 01/20] chore: copy vscode-logging packages into projects/vscode-logging Copy the logger, types and wrapper packages from SAP/vscode-logging@master into projects/vscode-logging/packages/ as the first (move-only) step of the monorepo consolidation. No source modifications yet; lint/format/compile fixes follow in subsequent commits. Per-package CONTRIBUTING.md dropped (root CONTRIBUTING.md covers the monorepo). The source repo's root package.json is intentionally NOT copied: app-studio- toolkit's top root already owns release/husky/commitlint/prettier, and pnpm's projects/* workspace glob would otherwise treat it as a live member. Signed-off-by: Jacob Kreyenbuehl --- pnpm-lock.yaml | 115 +++++- .../packages/logger/.mocharc.js | 9 + .../vscode-logging/packages/logger/.npmignore | 16 + .../packages/logger/CHANGELOG.md | 125 +++++++ .../vscode-logging/packages/logger/README.md | 146 ++++++++ .../vscode-logging/packages/logger/api.d.ts | 76 ++++ .../vscode-logging/packages/logger/lib/api.js | 100 +++++ .../packages/logger/lib/format.js | 30 ++ .../packages/logger/lib/levels.js | 21 ++ .../packages/logger/lib/logger.js | 201 ++++++++++ .../logger/lib/transports/console-output.js | 39 ++ .../logger/lib/transports/rolling-file.js | 75 ++++ .../lib/transports/vscode-out-channel.js | 48 +++ .../packages/logger/package.json | 56 +++ .../packages/logger/test/api-spec.js | 19 + .../packages/logger/test/child-logger-spec.js | 345 ++++++++++++++++++ .../logger/test/console-output-spec.js | 105 ++++++ .../packages/logger/test/levels-spec.js | 116 ++++++ .../logger/test/log-methods-apis-spec.js | 90 +++++ .../packages/logger/test/out-channel-spec.js | 97 +++++ .../logger/test/output-channel-spec.ts | 7 + .../packages/logger/test/rolling-file-spec.js | 76 ++++ .../logger/test/stubs/stream-roller-stub.js | 24 ++ .../packages/logger/test/stubs/vscode-stub.js | 21 ++ .../packages/logger/tsconfig.json | 9 + .../vscode-logging/packages/types/.npmignore | 5 + .../packages/types/CHANGELOG.md | 70 ++++ .../vscode-logging/packages/types/README.md | 49 +++ .../vscode-logging/packages/types/api.d.ts | 67 ++++ .../packages/types/package.json | 24 ++ .../packages/types/tsconfig.json | 7 + .../packages/wrapper/.npmignore | 13 + .../packages/wrapper/CHANGELOG.md | 88 +++++ .../vscode-logging/packages/wrapper/README.md | 34 ++ .../vscode-logging/packages/wrapper/api.d.ts | 53 +++ .../packages/wrapper/nyc.config.js | 22 ++ .../packages/wrapper/package.json | 48 +++ .../packages/wrapper/src/api.ts | 25 ++ .../packages/wrapper/src/configure-logger.ts | 69 ++++ .../packages/wrapper/src/helper-types.d.ts | 33 ++ .../packages/wrapper/src/noop-logger.ts | 19 + .../wrapper/src/settings-changes-handler.ts | 46 +++ .../packages/wrapper/src/settings.ts | 12 + .../wrapper/test/configure-logger-spec.ts | 81 ++++ .../packages/wrapper/test/noop-logger-spec.ts | 35 ++ .../test/settings-changes-handler-spec.ts | 158 ++++++++ .../packages/wrapper/test/settings-spec.ts | 51 +++ .../packages/wrapper/tsconfig.json | 16 + 48 files changed, 2989 insertions(+), 2 deletions(-) create mode 100644 projects/vscode-logging/packages/logger/.mocharc.js create mode 100644 projects/vscode-logging/packages/logger/.npmignore create mode 100644 projects/vscode-logging/packages/logger/CHANGELOG.md create mode 100644 projects/vscode-logging/packages/logger/README.md create mode 100644 projects/vscode-logging/packages/logger/api.d.ts create mode 100644 projects/vscode-logging/packages/logger/lib/api.js create mode 100644 projects/vscode-logging/packages/logger/lib/format.js create mode 100644 projects/vscode-logging/packages/logger/lib/levels.js create mode 100644 projects/vscode-logging/packages/logger/lib/logger.js create mode 100644 projects/vscode-logging/packages/logger/lib/transports/console-output.js create mode 100644 projects/vscode-logging/packages/logger/lib/transports/rolling-file.js create mode 100644 projects/vscode-logging/packages/logger/lib/transports/vscode-out-channel.js create mode 100644 projects/vscode-logging/packages/logger/package.json create mode 100644 projects/vscode-logging/packages/logger/test/api-spec.js create mode 100644 projects/vscode-logging/packages/logger/test/child-logger-spec.js create mode 100644 projects/vscode-logging/packages/logger/test/console-output-spec.js create mode 100644 projects/vscode-logging/packages/logger/test/levels-spec.js create mode 100644 projects/vscode-logging/packages/logger/test/log-methods-apis-spec.js create mode 100644 projects/vscode-logging/packages/logger/test/out-channel-spec.js create mode 100644 projects/vscode-logging/packages/logger/test/output-channel-spec.ts create mode 100644 projects/vscode-logging/packages/logger/test/rolling-file-spec.js create mode 100644 projects/vscode-logging/packages/logger/test/stubs/stream-roller-stub.js create mode 100644 projects/vscode-logging/packages/logger/test/stubs/vscode-stub.js create mode 100644 projects/vscode-logging/packages/logger/tsconfig.json create mode 100644 projects/vscode-logging/packages/types/.npmignore create mode 100644 projects/vscode-logging/packages/types/CHANGELOG.md create mode 100644 projects/vscode-logging/packages/types/README.md create mode 100644 projects/vscode-logging/packages/types/api.d.ts create mode 100644 projects/vscode-logging/packages/types/package.json create mode 100644 projects/vscode-logging/packages/types/tsconfig.json create mode 100644 projects/vscode-logging/packages/wrapper/.npmignore create mode 100644 projects/vscode-logging/packages/wrapper/CHANGELOG.md create mode 100644 projects/vscode-logging/packages/wrapper/README.md create mode 100644 projects/vscode-logging/packages/wrapper/api.d.ts create mode 100644 projects/vscode-logging/packages/wrapper/nyc.config.js create mode 100644 projects/vscode-logging/packages/wrapper/package.json create mode 100644 projects/vscode-logging/packages/wrapper/src/api.ts create mode 100644 projects/vscode-logging/packages/wrapper/src/configure-logger.ts create mode 100644 projects/vscode-logging/packages/wrapper/src/helper-types.d.ts create mode 100644 projects/vscode-logging/packages/wrapper/src/noop-logger.ts create mode 100644 projects/vscode-logging/packages/wrapper/src/settings-changes-handler.ts create mode 100644 projects/vscode-logging/packages/wrapper/src/settings.ts create mode 100644 projects/vscode-logging/packages/wrapper/test/configure-logger-spec.ts create mode 100644 projects/vscode-logging/packages/wrapper/test/noop-logger-spec.ts create mode 100644 projects/vscode-logging/packages/wrapper/test/settings-changes-handler-spec.ts create mode 100644 projects/vscode-logging/packages/wrapper/test/settings-spec.ts create mode 100644 projects/vscode-logging/packages/wrapper/tsconfig.json diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 555e4583..4bca9ea7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -570,6 +570,73 @@ importers: specifier: 27.5.1 version: 27.5.1(bufferutil@4.1.0)(ts-node@10.9.2(@types/node@25.9.1)(typescript@5.7.3))(utf-8-validate@5.0.10) + projects/vscode-logging/packages/logger: + dependencies: + '@vscode-logging/types': + specifier: workspace:^ + version: link:../types + fast-safe-stringify: + specifier: 2.1.1 + version: 2.1.1 + fs-extra: + specifier: 11.2.0 + version: 11.2.0 + lodash: + specifier: 4.18.1 + version: 4.18.1 + stacktrace-js: + specifier: 2.0.2 + version: 2.0.2 + streamroller: + specifier: 3.1.5 + version: 3.1.5 + triple-beam: + specifier: 1.4.1 + version: 1.4.1 + winston: + specifier: 3.11.0 + version: 3.11.0 + winston-transport: + specifier: 4.6.0 + version: 4.6.0 + devDependencies: + '@types/fs-extra': + specifier: 11.0.4 + version: 11.0.4 + '@types/vscode': + specifier: 1.51.0 + version: 1.51.0 + proxyquire: + specifier: 2.1.3 + version: 2.1.3 + sinon: + specifier: 17.0.1 + version: 17.0.1 + sinon-chai: + specifier: 3.7.0 + version: 3.7.0(chai@4.5.0)(sinon@17.0.1) + + projects/vscode-logging/packages/types: {} + + projects/vscode-logging/packages/wrapper: + dependencies: + '@vscode-logging/logger': + specifier: workspace:^ + version: link:../logger + '@vscode-logging/types': + specifier: workspace:^ + version: link:../types + devDependencies: + '@types/lodash': + specifier: 4.14.202 + version: 4.14.202 + '@types/vscode': + specifier: 1.52.0 + version: 1.52.0 + lodash: + specifier: 4.18.1 + version: 4.18.1 + projects/vscode-mta-tools: dependencies: '@sap/cf-tools': @@ -3435,6 +3502,12 @@ packages: '@types/vinyl@2.0.12': resolution: {integrity: sha512-Sr2fYMBUVGYq8kj3UthXFAu5UN6ZW+rYr4NACjZQJvHvj+c8lYv0CahmZ2P/r7iUkN44gGUBwqxZkrKXYPb7cw==} + '@types/vscode@1.51.0': + resolution: {integrity: sha512-C/jZ35OT5k/rsJyAK8mS1kM++vMcm89oSWegkzxRCvHllIq0cToZAkIDs6eCY4SKrvik3nrhELizyLcM0onbQA==} + + '@types/vscode@1.52.0': + resolution: {integrity: sha512-Kt3bvWzAvvF/WH9YEcrCICDp0Z7aHhJGhLJ1BxeyNP6yRjonWqWnAIh35/pXAjswAnWOABrYlF7SwXR9+1nnLA==} + '@types/vscode@1.75.0': resolution: {integrity: sha512-SAr0PoOhJS6FUq5LjNr8C/StBKALZwDVm3+U4pjF/3iYkt3GioJOPV/oB1Sf1l7lROe4TgrMyL5N1yaEgTWycw==} @@ -8538,6 +8611,9 @@ packages: nice-try@1.0.5: resolution: {integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==} + nise@5.1.9: + resolution: {integrity: sha512-qOnoujW4SV6e40dYxJOb3uvuoPHtmLzIk4TFo+j0jPJoC+5Z9xja5qH5JZobEPsa8+YYphMrOSwnrshEhG2qww==} + nise@6.0.0: resolution: {integrity: sha512-K8ePqo9BFvN31HXwEtTNGzgrPpmvgciDsFz8aztFjt4LqKO/JeFD8tBOeuDiCMXrIl/m1YvfH8auSpxfaD09wg==} @@ -10110,6 +10186,15 @@ packages: simple-git@3.36.0: resolution: {integrity: sha512-cGQjLjK8bxJw4QuYT7gxHw3/IouVESbhahSsHrX97MzCL1gu2u7oy38W6L2ZIGECEfIBG4BabsWDPjBxJENv9Q==} + sinon-chai@3.7.0: + resolution: {integrity: sha512-mf5NURdUaSdnatJx3uhoBOrY9dtL19fiOtAdT1Azxg3+lNJFiuN0uzaU3xX1LeAfL17kHQhTAJgpsfhbMJMY2g==} + peerDependencies: + chai: ^4.0.0 + sinon: '>=4.0.0' + + sinon@17.0.1: + resolution: {integrity: sha512-wmwE19Lie0MLT+ZYNpDymasPHUKTaZHUH/pKEubRXIzySv9Atnlw+BUMGCzWgV7b7wO+Hw6f1TEOr0IUnmU8/g==} + sinon@18.0.1: resolution: {integrity: sha512-a2N2TDY1uGviajJ6r4D1CyRAkzE9NNVlYOV1wX5xQDuAk0ONgzgRl0EjCQuRCPxOwp13ghsMwt9Gdldujs39qw==} @@ -15302,6 +15387,10 @@ snapshots: '@types/expect': 1.20.4 '@types/node': 22.15.35 + '@types/vscode@1.51.0': {} + + '@types/vscode@1.52.0': {} + '@types/vscode@1.75.0': {} '@types/webpack-env@1.18.8': {} @@ -21954,6 +22043,14 @@ snapshots: nice-try@1.0.5: {} + nise@5.1.9: + dependencies: + '@sinonjs/commons': 3.0.1 + '@sinonjs/fake-timers': 11.3.1 + '@sinonjs/text-encoding': 0.7.3 + just-extend: 6.2.0 + path-to-regexp: 6.2.2 + nise@6.0.0: dependencies: '@sinonjs/commons': 3.0.1 @@ -23844,6 +23941,20 @@ snapshots: transitivePeerDependencies: - supports-color + sinon-chai@3.7.0(chai@4.5.0)(sinon@17.0.1): + dependencies: + chai: 4.5.0 + sinon: 17.0.1 + + sinon@17.0.1: + dependencies: + '@sinonjs/commons': 3.0.1 + '@sinonjs/fake-timers': 11.3.1 + '@sinonjs/samsam': 8.0.0 + diff: 5.2.0 + nise: 5.1.9 + supports-color: 7.2.0 + sinon@18.0.1: dependencies: '@sinonjs/commons': 3.0.1 @@ -25513,7 +25624,7 @@ snapshots: safe-stable-stringify: 2.5.0 stack-trace: 0.0.10 triple-beam: 1.4.1 - winston-transport: 4.8.0 + winston-transport: 4.6.0 winston@3.15.0: dependencies: @@ -25539,7 +25650,7 @@ snapshots: readable-stream: 3.6.2 stack-trace: 0.0.10 triple-beam: 1.4.1 - winston-transport: 4.8.0 + winston-transport: 4.6.0 with-open-file@0.1.7: dependencies: diff --git a/projects/vscode-logging/packages/logger/.mocharc.js b/projects/vscode-logging/packages/logger/.mocharc.js new file mode 100644 index 00000000..7ed5916f --- /dev/null +++ b/projects/vscode-logging/packages/logger/.mocharc.js @@ -0,0 +1,9 @@ +const chai = require("chai"); +const chaiExclude = require("chai-exclude"); + +chai.use(chaiExclude); + +module.exports = { + // If coverage is enabled each test takes quite a while + timeout: 5000 +}; diff --git a/projects/vscode-logging/packages/logger/.npmignore b/projects/vscode-logging/packages/logger/.npmignore new file mode 100644 index 00000000..ce94c811 --- /dev/null +++ b/projects/vscode-logging/packages/logger/.npmignore @@ -0,0 +1,16 @@ +# Mocha +.mocharc.js + +# TypeScript +tsconfig.json + +# NYC +.nyc_output +nyc.config.js +coverage + +# tests +test + +# Dev Docs +CONTRIBUTING.md \ No newline at end of file diff --git a/projects/vscode-logging/packages/logger/CHANGELOG.md b/projects/vscode-logging/packages/logger/CHANGELOG.md new file mode 100644 index 00000000..5608544a --- /dev/null +++ b/projects/vscode-logging/packages/logger/CHANGELOG.md @@ -0,0 +1,125 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [2.0.9](https://github.com/SAP/vscode-logging/compare/v2.0.8...v2.0.9) (2026-04-16) + +**Note:** Version bump only for package @vscode-logging/logger + +## [2.0.8](https://github.com/SAP/vscode-logging/compare/v2.0.7...v2.0.8) (2026-02-18) + +### Bug Fixes + +- correct repository URL case (SAP instead of sap) for npm provenance ([00a91ca](https://github.com/SAP/vscode-logging/commit/00a91ca002ba88ed27278f756b7aca8865eee1ee)) + +## [2.0.7](https://github.com/sap/vscode-logging/compare/v2.0.6...v2.0.7) (2026-02-18) + +**Note:** Version bump only for package @vscode-logging/logger + +## [2.0.6](https://github.com/sap/vscode-logging/compare/v2.0.5...v2.0.6) (2026-02-18) + +**Note:** Version bump only for package @vscode-logging/logger + +## [2.0.5](https://github.com/sap/vscode-logging/compare/v2.0.4...v2.0.5) (2026-02-18) + +**Note:** Version bump only for package @vscode-logging/logger + +## [2.0.4](https://github.com/sap/vscode-logging/compare/v2.0.3...v2.0.4) (2026-02-18) + +**Note:** Version bump only for package @vscode-logging/logger + +## [2.0.3](https://github.com/sap/vscode-logging/compare/v2.0.2...v2.0.3) (2026-02-17) + +**Note:** Version bump only for package @vscode-logging/logger + +## [2.0.2](https://github.com/sap/vscode-logging/compare/v2.0.1...v2.0.2) (2026-02-17) + +**Note:** Version bump only for package @vscode-logging/logger + +## [2.0.1](https://github.com/sap/vscode-logging/compare/v2.0.0...v2.0.1) (2026-02-15) + +### Bug Fixes + +- upgrade lodash to version 4.17.23 ([#241](https://github.com/sap/vscode-logging/issues/241)) ([69fc2ce](https://github.com/sap/vscode-logging/commit/69fc2ce233e960219efca1118027638cc115874c)) +- workspace protocol ([#243](https://github.com/sap/vscode-logging/issues/243)) ([3091351](https://github.com/sap/vscode-logging/commit/30913512554b29590b16bce4ad2a1eb3890b5dc9)) + +# 2.0.0 (2024-01-05) + +### Bug Fixes + +- add .npmignore files to remove unneeded contents in published pkgs ([998b1f8](https://github.com/sap/vscode-logging/commit/998b1f8341352af2bba9a640f425c66c2d3a8a74)) +- convert timestamp format according to ISO-8601 ([b4ab3e4](https://github.com/sap/vscode-logging/commit/b4ab3e48829df42bd73c67de3f068385aabd1259)) +- **logger:** vscode-logging/types package should be a dependency ([e2ea6c7](https://github.com/sap/vscode-logging/commit/e2ea6c7d26efed219f2b983ad7e601eeb9f4704f)) +- source Location Tracking not affecting ChildLoggers ([72b151a](https://github.com/sap/vscode-logging/commit/72b151a773ba2707cb131d59799389a7cfe93c85)), closes [#15](https://github.com/sap/vscode-logging/issues/15) + +### Features + +- support console as log target ([#109](https://github.com/sap/vscode-logging/issues/109)) ([ea16211](https://github.com/sap/vscode-logging/commit/ea16211a5e2fbcdc86f4e96c8c60eaaf440d2431)) +- **logger:** a memory leak when creating 9 or more ChildLogger's ([#76](https://github.com/sap/vscode-logging/issues/76)) ([482c708](https://github.com/sap/vscode-logging/commit/482c708e9b8643849f6a14253c51650ffac70416)) +- aPI Fixes (dummy change to force minor version) ([0fb0fb6](https://github.com/sap/vscode-logging/commit/0fb0fb624def760bb1a1cf4a7b46b18133d85cf0)) +- initial Commit ([ee780af](https://github.com/sap/vscode-logging/commit/ee780afa90dc17cfac91a28cb2921728c1cc4489)) + +* Make OutputChannel optional. (#55) ([b7fa564](https://github.com/sap/vscode-logging/commit/b7fa56436693df9787f8ea720559beb3b0566612)), closes [#55](https://github.com/sap/vscode-logging/issues/55) [#55](https://github.com/sap/vscode-logging/issues/55) + +### BREAKING CHANGES + +- OutputChannel will not be created inside the logger as today. Alternatively, it + will be added as an optional parameter. The VS Code Extension will be able to create the + OutputChannel and send it to the logger as a parameter. + +## [1.2.3](https://github.com/sap/vscode-logging/compare/@vscode-logging/logger@1.2.2...@vscode-logging/logger@1.2.3) (2021-04-13) + +**Note:** Version bump only for package @vscode-logging/logger + +## [1.2.2](https://github.com/sap/vscode-logging/compare/@vscode-logging/logger@1.2.1...@vscode-logging/logger@1.2.2) (2020-12-10) + +**Note:** Version bump only for package @vscode-logging/logger + +## [1.2.1](https://github.com/sap/vscode-logging/compare/@vscode-logging/logger@1.2.0...@vscode-logging/logger@1.2.1) (2020-11-12) + +### Bug Fixes + +- convert timestamp format according to ISO-8601 ([b4ab3e4](https://github.com/sap/vscode-logging/commit/b4ab3e48829df42bd73c67de3f068385aabd1259)) + +# [1.2.0](https://github.com/sap/vscode-logging/compare/@vscode-logging/logger@1.1.0...@vscode-logging/logger@1.2.0) (2020-07-29) + +### Features + +- support console as log target ([#109](https://github.com/sap/vscode-logging/issues/109)) ([ea16211](https://github.com/sap/vscode-logging/commit/ea16211a5e2fbcdc86f4e96c8c60eaaf440d2431)) + +# [1.1.0](https://github.com/sap/vscode-logging/compare/@vscode-logging/logger@1.0.0...@vscode-logging/logger@1.1.0) (2020-05-21) + +### Features + +- **logger:** a memory leak when creating 9 or more ChildLogger's ([#76](https://github.com/sap/vscode-logging/issues/76)) ([482c708](https://github.com/sap/vscode-logging/commit/482c708e9b8643849f6a14253c51650ffac70416)) + +# [1.0.0](https://github.com/sap/vscode-logging/compare/@vscode-logging/logger@0.1.2...@vscode-logging/logger@1.0.0) (2020-04-16) + +- Make OutputChannel optional. (#55) ([b7fa564](https://github.com/sap/vscode-logging/commit/b7fa56436693df9787f8ea720559beb3b0566612)), closes [#55](https://github.com/sap/vscode-logging/issues/55) [#55](https://github.com/sap/vscode-logging/issues/55) + +### BREAKING CHANGES + +- OutputChannel will not be created inside the logger as today. Alternatively, it + will be added as an optional parameter. The VS Code Extension will be able to create the + OutputChannel and send it to the logger as a parameter. + +## [0.1.2](https://github.com/sap/vscode-logging/compare/@vscode-logging/logger@0.1.1...@vscode-logging/logger@0.1.2) (2020-02-19) + +### Bug Fixes + +- add .npmignore files to remove unneeded contents in published pkgs ([998b1f8](https://github.com/sap/vscode-logging/commit/998b1f8341352af2bba9a640f425c66c2d3a8a74)) +- **logger:** vscode-logging/types package should be a dependency ([e2ea6c7](https://github.com/sap/vscode-logging/commit/e2ea6c7d26efed219f2b983ad7e601eeb9f4704f)) + +## [0.1.1](https://github.com/sap/vscode-logging/compare/@vscode-logging/logger@0.1.0...@vscode-logging/logger@0.1.1) (2020-01-20) + +### Bug Fixes + +- source Location Tracking not affecting ChildLoggers ([72b151a](https://github.com/sap/vscode-logging/commit/72b151a773ba2707cb131d59799389a7cfe93c85)), closes [#15](https://github.com/sap/vscode-logging/issues/15) + +# 0.1.0 (2020-01-14) + +### Features + +- aPI Fixes (dummy change to force minor version) ([0fb0fb6](https://github.com/sap/vscode-logging/commit/0fb0fb624def760bb1a1cf4a7b46b18133d85cf0)) +- initial Commit ([ee780af](https://github.com/sap/vscode-logging/commit/ee780afa90dc17cfac91a28cb2921728c1cc4489)) diff --git a/projects/vscode-logging/packages/logger/README.md b/projects/vscode-logging/packages/logger/README.md new file mode 100644 index 00000000..c7922311 --- /dev/null +++ b/projects/vscode-logging/packages/logger/README.md @@ -0,0 +1,146 @@ +# @vscode-logging/logger + +A Logging Library for VSCode Extension which supports the following features: + +- JSON structure log entries output. +- Logging to a VSCode outputChannel. +- Logging to rolling file logs. +- [Source Location Tracking](#on-sourcelocationtracking). + +## Installation + +With npm: + +- `npm install @vscode-logging/logger --save` + +With Yarn: + +- `yarn add @vscode-logging/logger` + +## Usage + +Please see the [TypeScript Definitions](./api.d.ts) for full API details. + +Runnable and documented usage examples can be found in the [examples](../../examples) folder. +It is recommended to review these examples as integrating @vscode-logging/logger into a +VSCode Extension necessitates **multiple changes**, mainly around managing the configuration options +as user exposed settings. + +### Basic Usage + +The only function exposed (directly) by @vscode-logging/logger is `getExtensionLogger` which +should be invoked by a VSCode extension's `activate()` function. + +```javascript +const { getExtensionLogger } = require("@vscode-logging/logger"); + +function activate(context) { + const extLogger = getExtensionLogger({ + extName: "MyExtName", + level: "info", // See LogLevel type in @vscode-logging/types for possible logLevels + logPath: context.logPath, // The logPath is only available from the `vscode.ExtensionContext` + logOutputChannel: logOutputChannel, // OutputChannel for the logger + sourceLocationTracking: false, + logConsol: false // define if messages should be logged to the consol + }); + + extLogger.warn("Hello World"); + // Will Log The following entry to **both** + // - To outputChannel `logOutputChannel` + // - To log files in `logPath` + // { + // "label": "MyExtName", + // "level": "warn", + // "message": "Hello World", + // "time": "2020-01-10 15:29:52.038Z" + // } +} +``` + +### On ChildLoggers + +The `getChildLogger` API is available on the interface returned by `getExtensionLogger`. +This can be used to obtain sub logger which log to the same targets (outChannel/files) as +the root logger, but with a more specific label. + +```javascript +const { getExtensionLogger } = require("@vscode-logging/logger"); + +const extLogger = getExtensionLogger({ extName: "MyExtName" /* ... */ }); + +const childLogger = extLogger.getChildLogger({ label: "MyClass" }); +childLogger.warn("Hello World"); +// Will Log to the same targets as extLogger but with a suffix added to the `label` +// { +// "label": "MyExtName.MyClass", // Note the `.MyClass` suffix in the label +// "level": "warn", +// "message": "Hello World", +// "time": "2020-01-10 15:29:52.038Z" +// } + +const grandChildLogger = childLogger.getChildLogger({ label: "MyMethod" }); +grandChildLogger.warn("Hip Hip Hurray"); +// { +// "label": "MyExtName.MyClass.MyMethod", // Note the `.MyMethod` suffix in the label +// "level": "warn", +// "message": "Hello World", +// "time": "2020-01-10 15:30:52.038Z" +// } +``` + +Important notes on child loggers: + +- They share the same configuration (e.g logging level) as the root extension logger. +- Child Loggers cannot change their configuration, all configuration mutation must be done + via the root extension logger. +- Child Loggers can be created from other child loggers, the `label` property would simply + expend with the additional suffixes. +- Child Loggers are **cached** using their label as the key, so repeatedly calling `getChildLogger` + using the same `label` on the same Logger object would return the **same** childLogger object. + +### On `sourceLocationTracking` + +When enabled the `sourceLocationTracking` will augment the log entries with the function +name and location (file/line/column) where the log method was invoked, e.g: + +```json +{ + "label": "osem", + "level": "error", + "message": "Hip Hip Hurray, the Command was executed! counter: <1>", + "source": { + "function": "registerCalback", + "location": "c:\\workspace\\vscode-logging\\examples\\extension\\lib\\commands.js:21:19" + }, + "time": "2020-01-11 11:51:48.659Z" +} +``` + +Important things to note on `sourceLocationTracking` + +- This functionality is not guaranteed to always work. +- e.g anonymous functions have no name... + +- Obtaining the source location information is **very slow**. + + - This means that this feature should **not be used** in productive flows. + - Therefore A "Fatal" log entry will be logged each time this option is enabled. + +- Processes which manipulate the source code such as [bundling][vscode-bundling] or compilation (TypeScript/Babel) + may make the information produced less relevant due to the lack of sourceMaps support. + Therefore this feature may be more useful during development flows rather then productive flows. + +[vscode-bundling]: https://code.visualstudio.com/api/working-with-extensions/bundling-extension + +## Support + +Please open [issues](https://github.com/SAP/vscode-logging/issues) on github. + +## Contributing + +See [CONTRIBUTING.md](./CONTRIBUTING.md). + +## License + +Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. +This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the [LICENSE file](../../LICENSE). diff --git a/projects/vscode-logging/packages/logger/api.d.ts b/projects/vscode-logging/packages/logger/api.d.ts new file mode 100644 index 00000000..167b8a21 --- /dev/null +++ b/projects/vscode-logging/packages/logger/api.d.ts @@ -0,0 +1,76 @@ +/** + * Get A Root VSCode Extension Logger capable of Logging to: + * - Rolling Log File (optional) + * - VSCode OutputChannel + */ +import { IVSCodeExtLogger, LogLevel } from "@vscode-logging/types"; +export { + IVSCodeExtLogger, + IChildLogger, + LogLevel +} from "@vscode-logging/types"; + +/** + * This is a sub-type of VSCode.OutputChannel. + * We define it to avoid direct dependency to @vscode/types. + * In some edge cases having multiple versions of @vscode/types can cause compilation errors. + */ +export type BasicOutputChannel = { + appendLine(value: string): void; + show(): void; + dispose(): void; +}; + +export function getExtensionLogger( + opts: getExtensionLoggerOpts +): IVSCodeExtLogger; + +export type getExtensionLoggerOpts = { + /** + * This parameter will be used for two things: + * + * + * - Root Label used when creating log entries. + * This will also be used as the prefix label for any childLogger e.g: + * - "Root.child" + * - "Root.child.grandChild" + */ + extName: string; + /** + * The Initial Log Level to use. + * This should normally provided by a configuration setting exposed to the Extension's end-users. + * - See: https://github.com/SAP/vscode-logging/tree/master/examples/extension for a runnable example + * exposing logging configuration to the end user. + */ + level: LogLevel; + /** + * Optional directory where the rolling log files should be kept. + * If this is not passed no rolling File Logs will be used. + * + * If the directory does not exist it would be created. + * + * It is normally expected to send the `ExtensionContext.logPath` in the parameter, + * - https://code.visualstudio.com/api/references/vscode-api#ExtensionContext.logPath + * which means `getExtensionLogger` should be called from the Extension's main `activate` function. + * - https://code.visualstudio.com/api/references/activation-events#Start-up + */ + logPath?: string; + /** + * Flag for adding sourceLocation information to each logEntry. + * This is disabled by default and should only be enabled during debugging flows as it + * Will likely cause significant performance regressions in productive flows. + */ + sourceLocationTracking?: boolean; + /** + * Optional Output channel where the logs should be shown. + * If this is not passed no Output channel will be used. + */ + logOutputChannel?: BasicOutputChannel; + /** + * Optional Console output channel, if set to true the log message will be printed to the Console output stream (stdout/stderr in Linux) + * Error and Fatal messages are printed to the standard error console + * Warn, Info, Debug and Trace are printed to the standard output console + * Default = false + */ + logConsole?: boolean; +}; diff --git a/projects/vscode-logging/packages/logger/lib/api.js b/projects/vscode-logging/packages/logger/lib/api.js new file mode 100644 index 00000000..77bb8145 --- /dev/null +++ b/projects/vscode-logging/packages/logger/lib/api.js @@ -0,0 +1,100 @@ +const { has } = require("lodash"); +const { createLogger } = require("winston"); +/** + * Normally we would prefer to depend upon `vscode` and `streamroller` inside their respective transports. + * However, by depending on those here in `api.js` we are able to more easily mock/stub these + * using proxyQuire. + * + * This is the lesser evil as the other options of: + * - Using `@global` with proxyQuire. + * - Running fuller (much more copmlex) integration tests with a real VSCode and real files. + * + * Seem much worse. + */ +const { RollingFileStream } = require("streamroller"); + +const { buildLoggerFormat } = require("./format"); +const { VSCodeExtLogger } = require("./logger"); +const { + VscodeOutChannelTransport +} = require("./transports/vscode-out-channel"); +const { RollingFileTransport } = require("./transports/rolling-file"); +const { levelsConfig, isValidLogLevel, levels } = require("./levels"); +const { ConsoleTransport } = require("./transports/console-output"); + +/** + * @param {import("../api").getExtensionLoggerOpts} opts + * @return {import("@vscode-logging/types").IVSCodeExtLogger} + */ +function getExtensionLogger(opts) { + if (isValidLogLevel(opts.level) === false) { + throw Error(`Attempt to use unknown logging level: <${opts.level}>!`); + } + + if ( + !has(opts, "logOutputChannel") && + !has(opts, "logPath") && + !has(opts, "logConsole") + ) { + throw Error( + "Logger must have at least one logging target defined, it should includes one (or more) of these options: logOutputChannel, logPath and logConsole" + ); + } + + /** + * @type {any[]} + */ + const transports = []; + + if (opts.logConsole) { + transports.push(new ConsoleTransport()); + } + + if (opts.logOutputChannel) { + transports.push( + new VscodeOutChannelTransport({ + outChannel: opts.logOutputChannel + }) + ); + } + + if (opts.logPath) { + transports.push( + new RollingFileTransport({ + logPath: opts.logPath, + extName: opts.extName, + RollingFileStream: RollingFileStream + }) + ); + } + + const format = buildLoggerFormat(opts.extName); + const rootWinstonLogger = createLogger({ + levels: levelsConfig, + // We are handling the log levels ourselves, to avoid calling winston's re-configure method + // as it would require us to re-create the winston transports and may create race conditions + // - Winston does not have a minimal API to change **only** the level... + level: levels.trace, + format: format, + transports: transports + }); + + return new VSCodeExtLogger({ + label: opts.extName, + level: opts.level, + loggerImpel: rootWinstonLogger, + outChannel: opts.logOutputChannel, + sourceLocationTracking: opts.sourceLocationTracking, + consoleOutput: opts.logConsole + }); +} + +/** + * Ensure actual runtime API matches the declared public API + * @type {typeof import("../api")} + */ +const publicApi = { + getExtensionLogger: getExtensionLogger +}; + +module.exports = publicApi; diff --git a/projects/vscode-logging/packages/logger/lib/format.js b/projects/vscode-logging/packages/logger/lib/format.js new file mode 100644 index 00000000..c68088e3 --- /dev/null +++ b/projects/vscode-logging/packages/logger/lib/format.js @@ -0,0 +1,30 @@ +const { format } = require("winston"); +const { MESSAGE } = require("triple-beam"); +// @ts-ignore +const { stableStringify } = require("fast-safe-stringify"); + +const utcTimestampProp = format(info => { + // The timestamp format is according to ISO-8601 and the format is: YYYY-MM-DDTHH:mm:ss.sssZ + info.time = new Date().toISOString(); + + return info; +}); + +// TODO: stable json should be provided directly by winston / logForm (future versions). +const JSONStable = format(info => { + info[MESSAGE] = stableStringify(info, null, 2); + return info; +}); + +function buildLoggerFormat(label) { + const resultFormat = format.combine( + format.splat(), + utcTimestampProp(), + JSONStable() + ); + return resultFormat; +} + +module.exports = { + buildLoggerFormat: buildLoggerFormat +}; diff --git a/projects/vscode-logging/packages/logger/lib/levels.js b/projects/vscode-logging/packages/logger/lib/levels.js new file mode 100644 index 00000000..1be0fefc --- /dev/null +++ b/projects/vscode-logging/packages/logger/lib/levels.js @@ -0,0 +1,21 @@ +const { partial, mapValues, includes, keys } = require("lodash"); + +const levelsConfig = { + off: -1, + fatal: 0, + error: 1, + warn: 2, + info: 3, + debug: 4, + trace: 5 +}; + +const logLevelsKeys = mapValues(levelsConfig, (val, key) => key); + +const isValidLogLevel = partial(includes, keys(levelsConfig)); + +module.exports = { + levelsConfig: levelsConfig, + levels: logLevelsKeys, + isValidLogLevel: isValidLogLevel +}; diff --git a/projects/vscode-logging/packages/logger/lib/logger.js b/projects/vscode-logging/packages/logger/lib/logger.js new file mode 100644 index 00000000..4f8fd062 --- /dev/null +++ b/projects/vscode-logging/packages/logger/lib/logger.js @@ -0,0 +1,201 @@ +const { forEach, findKey } = require("lodash"); +const stacktrace = require("stacktrace-js"); +const { levelsConfig, isValidLogLevel } = require("./levels"); +const ADD_SOURCE_LOCATION_INFO = Symbol("addSourceLocationInfo"); +const CHANGE_LEVEL = Symbol("changeLevel"); +const CHANGE_SOURCE_LOCATION_TRACKING = Symbol("changeSourceLocationTracking"); + +const LABEL = Symbol("label"); +const LOGGER_IMPEL = Symbol("loggerImpel"); +const LEVEL_INT = Symbol("levelInt"); +const SOURCE_LOCATION_TRACKING = Symbol("sourceLocationTracking"); +const CONSOLE_OUTPUT = Symbol("consoleOutput"); +const CHILD_LOGGERS = Symbol("childLoggers"); +const OUT_CHANNEL = Symbol("outChannel"); +const WARN_IF_LOCATION_TRACKING_IS_ENABLED = Symbol( + "warnIfLocationTrackingIsEnabled" +); + +class BaseLogger { + /** + * @param {object} opts + * @param {string} opts.label + * @param {string} opts.level + * @param {boolean} [opts.sourceLocationTracking] + * @param {boolean} [opts.consoleOutput] + * @param {import("winston").Logger} opts.loggerImpel + */ + constructor(opts) { + this[LABEL] = opts.label; + this[LOGGER_IMPEL] = opts.loggerImpel; + this[LEVEL_INT] = levelsConfig[opts.level]; + // disabled by default as this may cause performance regressions + this[SOURCE_LOCATION_TRACKING] = opts.sourceLocationTracking || false; + this[CONSOLE_OUTPUT] = opts.consoleOutput || false; + // Possible memory leak if users forget to release their childLogger Resources + // Could have been resolved using WeakMap, however Weak Collections in JavaScript are not iterable (yet) + // So they are insufficient for our needs (see `getChildLogger` method). + // - https://github.com/tc39/proposal-weakrefs#iterable-weakmaps + this[CHILD_LOGGERS] = new Map([]); + } + + getChildLogger(opts) { + const newLabel = this[LABEL] + "." + opts.label; + + if (this[CHILD_LOGGERS].has(newLabel)) { + return this[CHILD_LOGGERS].get(newLabel); + } + + const newChildLoggerImpel = new BaseLogger({ + label: newLabel, + sourceLocationTracking: this[SOURCE_LOCATION_TRACKING], + consoleOutput: this[CONSOLE_OUTPUT], + level: findKey(levelsConfig, val => val === this[LEVEL_INT]), + loggerImpel: this[LOGGER_IMPEL] + }); + + this[CHILD_LOGGERS].set(newLabel, newChildLoggerImpel); + + return newChildLoggerImpel; + } + + fatal(msg, ...args) { + if (this[LEVEL_INT] >= levelsConfig.fatal) { + this[ADD_SOURCE_LOCATION_INFO](args); + args.push({ label: this[LABEL] }); + // @ts-ignore + this[LOGGER_IMPEL].fatal(msg, ...args); + } + } + + error(msg, ...args) { + if (this[LEVEL_INT] >= levelsConfig.error) { + this[ADD_SOURCE_LOCATION_INFO](args); + args.push({ label: this[LABEL] }); + this[LOGGER_IMPEL].error(msg, ...args); + } + } + + warn(msg, ...args) { + if (this[LEVEL_INT] >= levelsConfig.warn) { + this[ADD_SOURCE_LOCATION_INFO](args); + args.push({ label: this[LABEL] }); + this[LOGGER_IMPEL].warn(msg, ...args); + } + } + + info(msg, ...args) { + if (this[LEVEL_INT] >= levelsConfig.info) { + this[ADD_SOURCE_LOCATION_INFO](args); + args.push({ label: this[LABEL] }); + this[LOGGER_IMPEL].info(msg, ...args); + } + } + + debug(msg, ...args) { + if (this[LEVEL_INT] >= levelsConfig.debug) { + this[ADD_SOURCE_LOCATION_INFO](args); + args.push({ label: this[LABEL] }); + this[LOGGER_IMPEL].debug(msg, ...args); + } + } + + trace(msg, ...args) { + if (this[LEVEL_INT] >= levelsConfig.trace) { + this[ADD_SOURCE_LOCATION_INFO](args); + args.push({ label: this[LABEL] }); + // @ts-ignore + this[LOGGER_IMPEL].trace(msg, ...args); + } + } +} + +// private methods using Symbols to hide it, need to be added directly on the prototype +BaseLogger.prototype[CHANGE_LEVEL] = function(newLevel) { + this[LEVEL_INT] = levelsConfig[newLevel]; + // @ts-ignore + forEach([...this[CHILD_LOGGERS].values()], childLogger => { + // Recursive Call + childLogger[CHANGE_LEVEL](newLevel); + }); +}; + +// private methods using Symbols to hide it, need to be added directly on the prototype +BaseLogger.prototype[CHANGE_SOURCE_LOCATION_TRACKING] = function( + isSourceLocTrack +) { + this[SOURCE_LOCATION_TRACKING] = isSourceLocTrack; + // @ts-ignore + forEach([...this[CHILD_LOGGERS].values()], childLogger => { + // Recursive Call + childLogger[CHANGE_SOURCE_LOCATION_TRACKING](isSourceLocTrack); + }); +}; + +BaseLogger.prototype[ADD_SOURCE_LOCATION_INFO] = function(args) { + if (this[SOURCE_LOCATION_TRACKING] === true) { + const stack = stacktrace.getSync(); + // we need to go 2 levels up the stack to get to the end user's code + const userFrame = stack[2]; + const sourceLocMsg = `${userFrame.fileName}:${userFrame.lineNumber}:${userFrame.columnNumber}`; + // Balance between reducing number of properties and readability + args.push({ + source: { + function: userFrame.functionName, + location: sourceLocMsg + } + }); + } +}; + +class VSCodeExtLogger extends BaseLogger { + /** + * @param {object} opts + * @param {string} opts.label + * @param {string} opts.level + * @param {import("winston").Logger} opts.loggerImpel + * @param {import("../api").BasicOutputChannel} [opts.outChannel] + * @param {boolean} [opts.sourceLocationTracking] + * @param {boolean} [opts.consoleOutput] + */ + constructor(opts) { + super(opts); + + this[OUT_CHANNEL] = opts.outChannel || undefined; + this.changeLevel(opts.level); + this[WARN_IF_LOCATION_TRACKING_IS_ENABLED](); + } + + changeLevel(newLevel) { + if (isValidLogLevel(newLevel) === false) { + this.fatal( + `Attempt to use unknown logging level: <${newLevel}> has been ignored.` + ); + } else { + // A strange kind of `super.changeLevel` call + this[CHANGE_LEVEL](newLevel); + } + } + + changeSourceLocationTracking(newSourceLocation) { + this[CHANGE_SOURCE_LOCATION_TRACKING](newSourceLocation); + this[WARN_IF_LOCATION_TRACKING_IS_ENABLED](); + } +} + +// private method using Symbols to hide it, need to be added directly on the prototype +VSCodeExtLogger.prototype[WARN_IF_LOCATION_TRACKING_IS_ENABLED] = function() { + if (this[SOURCE_LOCATION_TRACKING] === true) { + this.fatal( + "SourceLocationTracking is Enabled, This must only be used during debugging flows as it causes performance regressions" + ); + + if (this[OUT_CHANNEL]) { + this[OUT_CHANNEL].show(); + } + } +}; + +module.exports = { + VSCodeExtLogger: VSCodeExtLogger +}; diff --git a/projects/vscode-logging/packages/logger/lib/transports/console-output.js b/projects/vscode-logging/packages/logger/lib/transports/console-output.js new file mode 100644 index 00000000..c808e0b3 --- /dev/null +++ b/projects/vscode-logging/packages/logger/lib/transports/console-output.js @@ -0,0 +1,39 @@ +const Transport = require("winston-transport"); +const { LEVEL, MESSAGE } = require("triple-beam"); + +class ConsoleTransport extends Transport { + constructor() { + super(); + } + + /** + * Core logging method exposed to Winston. + * @param {Object} info + * @param {Function} callback + */ + log(info, callback) { + setImmediate(() => this.emit("logged", info)); + + switch (info[LEVEL]) { + case "error": + case "fatal": + console.error(info[MESSAGE]); + break; + case "warn": + console.warn(info[MESSAGE]); + break; + default: + console.log(info[MESSAGE]); + } + /* istanbul ignore else - winston transports use guard conditions around the callbacks + * however I have no idea how to simulate the callback not existing... (winston internals...) + **/ + if (callback) { + callback(); // eslint-disable-line callback-return + } + } +} + +module.exports = { + ConsoleTransport: ConsoleTransport +}; diff --git a/projects/vscode-logging/packages/logger/lib/transports/rolling-file.js b/projects/vscode-logging/packages/logger/lib/transports/rolling-file.js new file mode 100644 index 00000000..0795a8ee --- /dev/null +++ b/projects/vscode-logging/packages/logger/lib/transports/rolling-file.js @@ -0,0 +1,75 @@ +const { EOL } = require("os"); +const Transport = require("winston-transport"); +const { MESSAGE } = require("triple-beam"); +const { ensureDirSync } = require("fs-extra"); +const { resolve } = require("path"); +const { defaults } = require("lodash"); + +class RollingFileTransport extends Transport { + /** + * @param {object} opts + * @param {*} opts.RollingFileStream + * @param {string} opts.logPath + * @param {string} opts.extName + * @param {string} [opts.maxFiles] - Maximum number of files to roll before overwriting previous logs. + * @param {string} [opts.maxFileSize] - In MegaByte, total max log size would be in Bytes. + */ + constructor(opts) { + super(); + + const actualOpts = defaults(opts, { + maxFiles: 10, + maxFileSize: 1024 * 1024 + }); + + // better safe then sorry + ensureDirSync(actualOpts.logPath); + + const logFilePath = resolve( + actualOpts.logPath, + `${actualOpts.extName}.log` + ); + + this.rollingFileStream = new opts.RollingFileStream( + logFilePath, + actualOpts.maxFileSize, + actualOpts.maxFiles + ); + } + + log(info, cb) { + setImmediate(() => { + this.emit("logged", info); + }); + + this.rollingFileStream.write(info[MESSAGE] + EOL); + + /* istanbul ignore else - winston transports use guard conditions around the callbacks + * however I have no idea how to simulate the callback not existing... (winston internals...) + **/ + if (cb) { + cb(); + } + } + + /* istanbul ignore next - Our flows never close a transport, this only happens on exist of VSCode + * Probably not worth the effort of mocking this or creating a proper integration test. + **/ + close(cb) { + if (this.rollingFileStream === undefined) { + return; + } + + this.rollingFileStream.end(() => { + if (cb) { + cb(); + } + this.emit("flush"); + this.emit("closed"); + }); + } +} + +module.exports = { + RollingFileTransport: RollingFileTransport +}; diff --git a/projects/vscode-logging/packages/logger/lib/transports/vscode-out-channel.js b/projects/vscode-logging/packages/logger/lib/transports/vscode-out-channel.js new file mode 100644 index 00000000..9a0b2e2a --- /dev/null +++ b/projects/vscode-logging/packages/logger/lib/transports/vscode-out-channel.js @@ -0,0 +1,48 @@ +const Transport = require("winston-transport"); +const { MESSAGE } = require("triple-beam"); + +class VscodeOutChannelTransport extends Transport { + /** + * @param {object} opts + * @param {import("../../api").BasicOutputChannel} opts.outChannel + */ + constructor(opts) { + super(); + + this.outChannel = opts.outChannel; + } + + log(info, cb) { + setImmediate(() => { + this.emit("logged", info); + }); + + this.outChannel.appendLine(info[MESSAGE]); + + /* istanbul ignore else - winston transports use guard conditions around the callbacks + * however I have no idea how to simulate the callback not existing... (winston internals...) + **/ + if (cb) { + cb(); + } + } + + /* istanbul ignore next - Our flows never close a transport, this only happens on exist of VSCode + * Probably not worth the effort of mocking this or creating a proper integration test. + **/ + close(cb) { + if (this.outChannel === undefined) { + return; + } + + this.outChannel.dispose(); + + if (cb) { + cb(); + } + } +} + +module.exports = { + VscodeOutChannelTransport: VscodeOutChannelTransport +}; diff --git a/projects/vscode-logging/packages/logger/package.json b/projects/vscode-logging/packages/logger/package.json new file mode 100644 index 00000000..2b143dfd --- /dev/null +++ b/projects/vscode-logging/packages/logger/package.json @@ -0,0 +1,56 @@ +{ + "name": "@vscode-logging/logger", + "version": "2.0.9", + "description": "Logger Library for VSCode Extensions", + "keywords": [ + "vscode", + "logger" + ], + "files": [ + ".reuse", + "LICENSES", + "lib", + "api.d.ts" + ], + "main": "lib/api.js", + "repository": "https://github.com/SAP/vscode-logging/", + "license": "Apache-2.0", + "typings": "./api.d.ts", + "dependencies": { + "@vscode-logging/types": "workspace:^", + "fast-safe-stringify": "2.1.1", + "fs-extra": "11.2.0", + "lodash": "4.18.1", + "stacktrace-js": "2.0.2", + "streamroller": "3.1.5", + "triple-beam": "1.4.1", + "winston": "3.11.0", + "winston-transport": "4.6.0" + }, + "devDependencies": { + "@types/fs-extra": "11.0.4", + "@types/vscode": "1.51.0", + "proxyquire": "2.1.3", + "sinon": "17.0.1", + "sinon-chai": "3.7.0" + }, + "scripts": { + "ci": "npm-run-all type-check coverage:*", + "test": "mocha \"./test/**/*spec.js\"", + "coverage:run": "nyc mocha \"./test/**/*spec.js\"", + "coverage:check": "nyc check-coverage --lines 100 --branches 100 --statements 100 --functions 100", + "type-check": "tsc" + }, + "publishConfig": { + "access": "public" + }, + "nyc": { + "include": [ + "lib/**/*.js" + ], + "reporter": [ + "text", + "lcov" + ] + } +} diff --git a/projects/vscode-logging/packages/logger/test/api-spec.js b/projects/vscode-logging/packages/logger/test/api-spec.js new file mode 100644 index 00000000..ab664ba1 --- /dev/null +++ b/projects/vscode-logging/packages/logger/test/api-spec.js @@ -0,0 +1,19 @@ +const { expect } = require("chai"); +const { getExtensionLogger } = require("../lib/api.js"); + +describe("VSCode Extension Logger", () => { + /** + * @type {typeof import("../api").getExtensionLogger} + */ + + context("when receiving no OutputChannel and no logPath", () => { + it("will throw on invalid/missing parameters", () => { + expect(() => { + getExtensionLogger({ + extName: "MyExtName", + level: "error" + }); + }).to.throw("logOutputChannel, logPath and logConsole"); + }); + }); +}); diff --git a/projects/vscode-logging/packages/logger/test/child-logger-spec.js b/projects/vscode-logging/packages/logger/test/child-logger-spec.js new file mode 100644 index 00000000..02fec053 --- /dev/null +++ b/projects/vscode-logging/packages/logger/test/child-logger-spec.js @@ -0,0 +1,345 @@ +const { map } = require("lodash"); +const { expect } = require("chai"); +const proxyquire = require("proxyquire").noCallThru(); + +const { VSCodeStub } = require("./stubs/vscode-stub"); +const { resolve } = require("path"); +const TESTS_LOG_PATH = resolve(__dirname, ".log-out"); + +describe("VSCode Extension Logger", () => { + context("childLogger capabilities", () => { + /** + * @type {typeof import("../api").getExtensionLogger} + */ + let getExtensionLogger; + let vsCodeStub; + beforeEach(() => { + // VSCode outChannel is optional but we still need a stub for it + // in order to test its functionality + vsCodeStub = new VSCodeStub(); + const mainModuleStubbed = proxyquire("../lib/api.js", { + vscode: vsCodeStub + }); + getExtensionLogger = mainModuleStubbed.getExtensionLogger; + }); + + it("will log to childLogger", () => { + const extLogger = getExtensionLogger({ + extName: "MyExtName", + logOutputChannel: vsCodeStub.OutputChannel, + level: "error" + }); + + const childLogger = extLogger.getChildLogger({ label: "myLibName" }); + childLogger.fatal("Oops I did it again!"); + + const logEntries = map(vsCodeStub.lines, JSON.parse); + expect(logEntries) + .excluding("time") + .to.deep.eql([ + { + label: "MyExtName.myLibName", + level: "fatal", + message: "Oops I did it again!" + } + ]); + }); + + it("will handle logging level at the root Logger of all childLoggers", () => { + const extLogger = getExtensionLogger({ + extName: "MyExtName", + logOutputChannel: vsCodeStub.OutputChannel, + level: "error" + }); + + const childLogger = extLogger.getChildLogger({ label: "myLibName" }); + childLogger.warn("Oops I did it again!"); + // nothing logged, warn < 'error' + expect(vsCodeStub.lines).to.be.empty; + + extLogger.changeLevel("info"); + + // Changes on the root affected the level of the child... + childLogger.warn("Oops I did it again!"); + const logEntries = map(vsCodeStub.lines, JSON.parse); + expect(logEntries) + .excluding("time") + .to.deep.eql([ + { + label: "MyExtName.myLibName", + level: "warn", + message: "Oops I did it again!" + } + ]); + }); + + it("will handle sourceLocationTracking option at the root Logger of all childLoggers", () => { + const extLogger = getExtensionLogger({ + extName: "MyExtName", + logOutputChannel: vsCodeStub.OutputChannel, + level: "info" + }); + + const childLogger = extLogger.getChildLogger({ label: "myLibName" }); + const grandChildLogger = childLogger.getChildLogger({ + label: "myClassName" + }); + + childLogger.warn("Oops I did it again!"); + grandChildLogger.warn("Oops I did it again!"); + const logEntriesBefore = map(vsCodeStub.lines, JSON.parse); + expect(logEntriesBefore[0]).to.not.have.property("source"); + expect(logEntriesBefore[1]).to.not.have.property("source"); + + // Change at the root Logger Source Location + extLogger.changeSourceLocationTracking(true); + vsCodeStub.lines = []; + childLogger.warn("Oops I did it again!"); + grandChildLogger.warn("Oops I did it again!"); + + const logEntriesAfter = map(vsCodeStub.lines, JSON.parse); + expect(logEntriesAfter[0]).to.have.property("source"); + expect(logEntriesAfter[1]).to.have.property("source"); + }); + + it("will cache and re-use the same childLogger for the same label", () => { + const extLogger = getExtensionLogger({ + extName: "MyExtName", + logOutputChannel: vsCodeStub.OutputChannel, + level: "error" + }); + + const childLogger = extLogger.getChildLogger({ label: "myLibName" }); + const childLoggerSameLabel = extLogger.getChildLogger({ + label: "myLibName" + }); + expect(childLogger).to.equal(childLoggerSameLabel); + }); + }); + + context("childLogger load", () => { + /** + * @type {typeof import("../api").getExtensionLogger} + */ + let getExtensionLogger; + let vsCodeStub; + beforeEach(() => { + const mainModuleStubbed = proxyquire("../lib/api.js", {}); + getExtensionLogger = mainModuleStubbed.getExtensionLogger; + }); + + function createExtLoggerWithNumberOfChildLoggers(childLoggersNumbers) { + const extLogger = getExtensionLogger({ + extName: "MainLoggerExtension", + logPath: TESTS_LOG_PATH, + level: "error" + }); + + for ( + let childLoggerNumber = 1; + childLoggerNumber <= childLoggersNumbers; + childLoggerNumber++ + ) { + extLogger.getChildLogger({ + label: "ChildLoggerClass" + childLoggerNumber + }); + } + } + + /** + * Issue #76 reproduction. + * + * The issue is reproducible + * when running "yarn ci" in the home directory vscode-logging + * with only on this it, context or describe; + * or when running "yarn test" in vscode-logging/packages/logger folder. + * + * The following errors appeared before fixing Issue #76 after the successful test result: + childLogger load + √ will create 9 childLoggers and write error message to stderr + (node:2280) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 unpipe listeners added to [RollingFileTransport]. Use emitter.setMaxListeners() to increase limit + (node:2280) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [RollingFileTransport]. Use emitter.setMaxListeners() to increase limit + */ + it("will create 9 childLoggers and write error message to stderr (before fixing Issue #76)", () => { + return createExtLoggerWithNumberOfChildLoggers(9); + }); + + /** + * Issue #76 doesn't happen when the number of ChildLogger's is less than 9. + * + * No errors appear after the successful test result: + childLogger load + √ will create 8 childLoggers and no error message to stderr + */ + it("will create 8 childLoggers and no error message to stderr (before fixing Issue #76)", () => { + return createExtLoggerWithNumberOfChildLoggers(8); + }); + }); + context( + "childLogger will log to childLogger log entry with correct label", + () => { + /** + * @type {typeof import("../api").getExtensionLogger} + */ + let getExtensionLogger; + let vsCodeStub; + beforeEach(() => { + // VSCode outChannel is optional but we still need a stub for it + // in order to test its functionality + vsCodeStub = new VSCodeStub(); + const mainModuleStubbed = proxyquire("../lib/api.js", { + vscode: vsCodeStub + }); + getExtensionLogger = mainModuleStubbed.getExtensionLogger; + }); + + it("in fatal log message for extension class", () => { + const extLogger = getExtensionLogger({ + extName: "MyExtName", + logOutputChannel: vsCodeStub.OutputChannel, + level: "trace" + }); + + const classLogger = extLogger.getChildLogger({ label: "myClassName" }); + classLogger.fatal("Oops I did it again!"); + + const logEntries = map(vsCodeStub.lines, JSON.parse); + expect(logEntries) + .excluding("time") + .to.deep.eql([ + { + label: "MyExtName.myClassName", + level: "fatal", + message: "Oops I did it again!" + } + ]); + }); + + it("in error log message for extension library class", () => { + const extLogger = getExtensionLogger({ + extName: "MyExtName", + logOutputChannel: vsCodeStub.OutputChannel, + level: "trace" + }); + + const libLogger = extLogger.getChildLogger({ label: "myLibName" }); + const classLogger = libLogger.getChildLogger({ label: "myClassName" }); + + classLogger.error("Oops I did it again!"); + + const logEntries = map(vsCodeStub.lines, JSON.parse); + expect(logEntries) + .excluding("time") + .to.deep.eql([ + { + label: "MyExtName.myLibName.myClassName", + level: "error", + message: "Oops I did it again!" + } + ]); + }); + + it("in warn log message for extension internal library class", () => { + const extLogger = getExtensionLogger({ + extName: "MyExtName", + logOutputChannel: vsCodeStub.OutputChannel, + level: "trace" + }); + + const lib1Logger = extLogger.getChildLogger({ label: "myLib1Name" }); + const lib2Logger = lib1Logger.getChildLogger({ label: "myLib2Name" }); + const classLogger = lib2Logger.getChildLogger({ label: "myClassName" }); + classLogger.warn("Oops I did it again!"); + + const logEntries = map(vsCodeStub.lines, JSON.parse); + expect(logEntries) + .excluding("time") + .to.deep.eql([ + { + label: "MyExtName.myLib1Name.myLib2Name.myClassName", + level: "warn", + message: "Oops I did it again!" + } + ]); + }); + + it("in info log message for extension internal library class", () => { + const extLogger = getExtensionLogger({ + extName: "MyExtName", + logOutputChannel: vsCodeStub.OutputChannel, + level: "trace" + }); + + const lib1Logger = extLogger.getChildLogger({ label: "myLib1Name" }); + const lib2Logger = lib1Logger.getChildLogger({ label: "myLib2Name" }); + const lib3Logger = lib2Logger.getChildLogger({ label: "myLib3Name" }); + const classLogger = lib3Logger.getChildLogger({ label: "myClassName" }); + classLogger.info("Oops I did it again!"); + + const logEntries = map(vsCodeStub.lines, JSON.parse); + expect(logEntries) + .excluding("time") + .to.deep.eql([ + { + label: "MyExtName.myLib1Name.myLib2Name.myLib3Name.myClassName", + level: "info", + message: "Oops I did it again!" + } + ]); + }); + it("in debug log message for extension internal library class", () => { + const extLogger = getExtensionLogger({ + extName: "MyExtName", + logOutputChannel: vsCodeStub.OutputChannel, + level: "trace" + }); + + const lib1Logger = extLogger.getChildLogger({ label: "myLib1Name" }); + const lib2Logger = lib1Logger.getChildLogger({ label: "myLib2Name" }); + const lib3Logger = lib2Logger.getChildLogger({ label: "myLib3Name" }); + const lib4Logger = lib3Logger.getChildLogger({ label: "myLib4Name" }); + const classLogger = lib4Logger.getChildLogger({ label: "myClassName" }); + classLogger.debug("Oops I did it again!"); + + const logEntries = map(vsCodeStub.lines, JSON.parse); + expect(logEntries) + .excluding("time") + .to.deep.eql([ + { + label: + "MyExtName.myLib1Name.myLib2Name.myLib3Name.myLib4Name.myClassName", + level: "debug", + message: "Oops I did it again!" + } + ]); + }); + it("in trace log message for extension internal library class", () => { + const extLogger = getExtensionLogger({ + extName: "MyExtName", + logOutputChannel: vsCodeStub.OutputChannel, + level: "trace" + }); + + const lib1Logger = extLogger.getChildLogger({ label: "myLib1Name" }); + const lib2Logger = lib1Logger.getChildLogger({ label: "myLib2Name" }); + const lib3Logger = lib2Logger.getChildLogger({ label: "myLib3Name" }); + const lib4Logger = lib3Logger.getChildLogger({ label: "myLib4Name" }); + const lib5Logger = lib4Logger.getChildLogger({ label: "myLib5Name" }); + const classLogger = lib5Logger.getChildLogger({ label: "myClassName" }); + classLogger.trace("Oops I did it again!"); + + const logEntries = map(vsCodeStub.lines, JSON.parse); + expect(logEntries) + .excluding("time") + .to.deep.eql([ + { + label: + "MyExtName.myLib1Name.myLib2Name.myLib3Name.myLib4Name.myLib5Name.myClassName", + level: "trace", + message: "Oops I did it again!" + } + ]); + }); + } + ); +}); diff --git a/projects/vscode-logging/packages/logger/test/console-output-spec.js b/projects/vscode-logging/packages/logger/test/console-output-spec.js new file mode 100644 index 00000000..f178eec0 --- /dev/null +++ b/projects/vscode-logging/packages/logger/test/console-output-spec.js @@ -0,0 +1,105 @@ +const proxyquire = require("proxyquire").noCallThru(); +const chai = require("chai"); +const sinonChai = require("sinon-chai"); +const sinon = require("sinon"); +const { StreamRollerStub } = require("./stubs/stream-roller-stub"); +const { resolve } = require("path"); + +chai.use(sinonChai); + +const expect = chai.expect; + +const TESTS_LOG_PATH = resolve(__dirname, ".log-out"); + +describe("VSCode Extension Logger", function() { + let vsCodeStub; + /** + * @type {typeof import("../api").getExtensionLogger} + */ + let getExtensionLogger; + let errSpy, warnSpy, logSpy; + let streamRollerStub; + beforeEach(() => { + streamRollerStub = new StreamRollerStub(); + const mainModuleStubbed = proxyquire("../lib/api.js", { + streamroller: streamRollerStub + }); + getExtensionLogger = mainModuleStubbed.getExtensionLogger; + errSpy = sinon.spy(console, "error"); + warnSpy = sinon.spy(console, "warn"); + logSpy = sinon.spy(console, "log"); + }); + + afterEach(function() { + console.error.restore(); + console.warn.restore(); + console.log.restore(); + }); + + describe("Console Logging - check that the output stream match the message type and log level - error/warn/info and stdout/stderr", function() { + it("should log to console in info level", function() { + const extLogger = getExtensionLogger({ + extName: "MyExtName", + level: "info", + logConsole: true + }); + extLogger.fatal("Oy Vey!"); + extLogger.error("Oh Dear..."); + extLogger.info("Oh Wow..."); + + sinon.assert.calledTwice(console.error); + sinon.assert.called(console.log); + sinon.assert.notCalled(console.warn); + expect(errSpy.args[0][0]).to.include("Oy Vey!"); + expect(errSpy.args[1][0]).to.include("Oh Dear..."); + expect(logSpy.args[0][0]).to.include("Oh Wow..."); + }); + + it("should log to console in error level", function() { + const extLogger = getExtensionLogger({ + extName: "MyExtName", + level: "error", + logConsole: true + }); + extLogger.fatal("Oy Vey!"); + extLogger.error("Oh Dear..."); + extLogger.info("Oh Wow..."); + + sinon.assert.calledTwice(console.error); + sinon.assert.notCalled(console.log); + sinon.assert.notCalled(console.warn); + expect(errSpy.args[0][0]).to.include("Oy Vey!"); + expect(errSpy.args[1][0]).to.include("Oh Dear..."); + }); + + it("should log to console in warn level", function() { + const extLogger = getExtensionLogger({ + extName: "MyExtName", + level: "warn", + logConsole: true + }); + extLogger.warn("Oy Might..."); + extLogger.error("Oh Dear..."); + extLogger.info("Oh Wow..."); + + sinon.assert.called(console.error); + sinon.assert.called(console.warn); + sinon.assert.notCalled(console.log); + expect(errSpy.args[0][0]).to.include("Oh Dear..."); + expect(warnSpy.args[0][0]).to.include("Oy Might..."); + }); + + it("should not log to console when consoleOutput is false", function() { + const extLogger = getExtensionLogger({ + extName: "MyExtName", + logPath: TESTS_LOG_PATH, + level: "info" + }); + extLogger.fatal("Oy Vey!"); + extLogger.info("Oy Wow!"); + sinon.assert.notCalled(console.error); + sinon.assert.notCalled(console.warn); + sinon.assert.notCalled(console.log); + }); + }); +}); diff --git a/projects/vscode-logging/packages/logger/test/levels-spec.js b/projects/vscode-logging/packages/logger/test/levels-spec.js new file mode 100644 index 00000000..34a2f10d --- /dev/null +++ b/projects/vscode-logging/packages/logger/test/levels-spec.js @@ -0,0 +1,116 @@ +const { map, forEach, pickBy, take } = require("lodash"); +const { expect } = require("chai"); +const proxyquire = require("proxyquire").noCallThru(); + +const { levels, levelsConfig } = require("../lib/levels"); +const { VSCodeStub } = require("./stubs/vscode-stub"); + +describe("VSCode Extension Logger", () => { + /** + * @type {typeof import("../api").getExtensionLogger} + */ + let getExtensionLogger; + let vsCodeStub; + beforeEach(() => { + // VSCode outChannel is optional but we still need a stub for it + // in order to test its functionality + vsCodeStub = new VSCodeStub(); + const mainModuleStubbed = proxyquire("../lib/api.js", { + vscode: vsCodeStub + }); + getExtensionLogger = mainModuleStubbed.getExtensionLogger; + }); + + context("when using an invalid level", () => { + it(`will throw on initial invalid level`, () => { + expect(() => { + getExtensionLogger({ + extName: "MyExtName", + logOutputChannel: vsCodeStub.OutputChannel, + level: "Emergency" // This is a sysLog severity + }); + }).to.throw("Attempt to use unknown logging level: !"); + }); + + it(`will warn and ignore on subsequent invalid level`, () => { + const extLogger = getExtensionLogger({ + extName: "MyExtName", + logOutputChannel: vsCodeStub.OutputChannel, + level: "fatal" + }); + + extLogger.changeLevel("Emergency"); + const logEntries = map(vsCodeStub.lines, JSON.parse); + expect(logEntries[0].message).to.eql( + "Attempt to use unknown logging level: has been ignored." + ); + + expect(vsCodeStub.lines).to.have.lengthOf(1); + extLogger.error( + "should not be logger as the logger should still be on fatal mode" + ); + expect(vsCodeStub.lines).to.have.lengthOf(1); + extLogger.fatal("should be logged"); + expect(vsCodeStub.lines).to.have.lengthOf(2); + }); + }); + + context("Specific logging Levels Support", () => { + const allLevelsExceptOff = pickBy(levels, levelKey => levelKey !== "off"); + + const fullExpectedLogEntries = [ + { + level: "fatal", + message: "fatal" + }, + { + level: "error", + message: "error" + }, + { + level: "warn", + message: "warn" + }, + { + level: "info", + message: "info" + }, + { + level: "debug", + message: "debug" + }, + { + level: "trace", + message: "trace" + } + ]; + + forEach(levels, currLevel => { + it(`will only log correct levels in '${currLevel}'`, () => { + const extLogger = getExtensionLogger({ + extName: "MyExtName", + logOutputChannel: vsCodeStub.OutputChannel, + level: currLevel + }); + + // try logging using all the possible levels + forEach(allLevelsExceptOff, level => { + extLogger[level](level); + }); + + const logEntries = map(vsCodeStub.lines, JSON.parse); + + // The higher the log level the more entries are expected to be logged. + const expectedLogEntries = take( + fullExpectedLogEntries, + // 0 based index necessitates '+1" + levelsConfig[currLevel] + 1 + ); + + expect(logEntries) + .excluding(["time", "label"]) + .to.deep.eql(expectedLogEntries); + }); + }); + }); +}); diff --git a/projects/vscode-logging/packages/logger/test/log-methods-apis-spec.js b/projects/vscode-logging/packages/logger/test/log-methods-apis-spec.js new file mode 100644 index 00000000..4e91cfd0 --- /dev/null +++ b/projects/vscode-logging/packages/logger/test/log-methods-apis-spec.js @@ -0,0 +1,90 @@ +const { map } = require("lodash"); +const { expect } = require("chai"); +const proxyquire = require("proxyquire").noCallThru(); + +const { VSCodeStub } = require("./stubs/vscode-stub"); + +describe("VSCode Extension extLogger", () => { + context("Log Methods APIs and Argument Types", () => { + /** + * @type {typeof import("../api").getExtensionLogger}output + */ + let getExtensionLogger; + let vsCodeStub; + beforeEach(() => { + // VSCode outChannel is optional but we still need a stub for it + // in order to test its functionality + vsCodeStub = new VSCodeStub(); + const mainModuleStubbed = proxyquire("../lib/api.js", { + vscode: vsCodeStub + }); + getExtensionLogger = mainModuleStubbed.getExtensionLogger; + }); + + it("supports splat arguments", () => { + const extLogger = getExtensionLogger({ + extName: "MyExtName", + logOutputChannel: vsCodeStub.OutputChannel, + level: "error" + }); + + extLogger.fatal("hello %s and 1 + %i equals 2", "world", 1); + const logEntries = map(vsCodeStub.lines, JSON.parse); + expect(logEntries[0].message).to.equal("hello world and 1 + 1 equals 2"); + }); + + it("supports metadata object arguments", () => { + const extLogger = getExtensionLogger({ + extName: "MyExtName", + logOutputChannel: vsCodeStub.OutputChannel, + level: "error" + }); + + extLogger.fatal("hello world", { a: 666, b: "oops" }, { c: 333 }); + const logEntries = map(vsCodeStub.lines, JSON.parse); + expect(logEntries[0].a).to.equal(666); + expect(logEntries[0].b).to.equal("oops"); + expect(logEntries[0].c).to.equal(333); + }); + + it("supports combining splat and object arguments", () => { + const extLogger = getExtensionLogger({ + logOutputChannel: vsCodeStub.OutputChannel, + level: "error" + }); + + extLogger.fatal("hello %s", "world", { a: 666, b: "oops" }, { c: 333 }); + const logEntries = map(vsCodeStub.lines, JSON.parse); + expect(logEntries[0].message).to.equal("hello world"); + expect(logEntries[0].a).to.equal(666); + expect(logEntries[0].b).to.equal("oops"); + expect(logEntries[0].c).to.equal(333); + }); + + it("overwrites label field", () => { + const extLogger = getExtensionLogger({ + extName: "MyExtName", + logOutputChannel: vsCodeStub.OutputChannel, + level: "error" + }); + + extLogger.fatal("hello world", { label: "kuku" }); + const logEntries = map(vsCodeStub.lines, JSON.parse); + expect(logEntries[0].label).to.equal("MyExtName"); + }); + + it("overwrites label field for ChildLogger", () => { + const extLogger = getExtensionLogger({ + extName: "MyExtName", + logOutputChannel: vsCodeStub.OutputChannel, + level: "error" + }); + const libLogger = extLogger.getChildLogger({ label: "MyLibName" }); + const classLogger = libLogger.getChildLogger({ label: "MyClassName" }); + + classLogger.fatal("hello world", { label: "kuku" }); + const logEntries = map(vsCodeStub.lines, JSON.parse); + expect(logEntries[0].label).to.equal("MyExtName.MyLibName.MyClassName"); + }); + }); +}); diff --git a/projects/vscode-logging/packages/logger/test/out-channel-spec.js b/projects/vscode-logging/packages/logger/test/out-channel-spec.js new file mode 100644 index 00000000..552ba87b --- /dev/null +++ b/projects/vscode-logging/packages/logger/test/out-channel-spec.js @@ -0,0 +1,97 @@ +const { VSCodeStub } = require("./stubs/vscode-stub"); +const { map } = require("lodash"); +const { basename } = require("path"); + +const { expect } = require("chai"); +const proxyquire = require("proxyquire").noCallThru(); + +describe("VSCode Extension Logger", () => { + context("OutChannel Logging", () => { + let vsCodeStub; + /** + * @type {typeof import("../api").getExtensionLogger} + */ + let getExtensionLogger; + + beforeEach(() => { + vsCodeStub = new VSCodeStub(); + const mainModuleStubbed = proxyquire("../lib/api.js", { + vscode: vsCodeStub + }); + getExtensionLogger = mainModuleStubbed.getExtensionLogger; + }); + + it("will Log in JSON Format", () => { + const extLogger = getExtensionLogger({ + extName: "MyExtName", + logOutputChannel: vsCodeStub.OutputChannel, + level: "error" + }); + extLogger.fatal("Oy Vey!"); + extLogger.error("Oh Dear..."); + + const logEntries = map(vsCodeStub.lines, JSON.parse); + expect(logEntries) + .excluding("time") + .to.deep.eql([ + { + label: "MyExtName", + level: "fatal", + message: "Oy Vey!" + }, + { + label: "MyExtName", + level: "error", + message: "Oh Dear..." + } + ]); + }); + + it("can add sourceLocation information", function myFuncName() { + const extLogger = getExtensionLogger({ + extName: "MyExtName", + sourceLocationTracking: true, + logOutputChannel: vsCodeStub.OutputChannel, + level: "error" + }); + extLogger.fatal("Oh dear"); + const logEntries = map(vsCodeStub.lines, JSON.parse); + // [0] contains the warning about using `sourceLocationTracking` + const logJsonEntry = logEntries[1]; + expect(logJsonEntry.label).to.eql("MyExtName"); + expect(logJsonEntry.level).to.eql("fatal"); + expect(logJsonEntry.message).to.eql("Oh dear"); + expect(logJsonEntry.source.function).to.eql("Context.myFuncName"); + const baseFileName = basename(__filename); + const fileNameAndLocRegExp = new RegExp(`.+${baseFileName}:\\d+:\\d+`); + // The location includes our own source file name! :) + expect(logJsonEntry.source.location).to.match(fileNameAndLocRegExp); + }); + + context( + "will **show** on the outChannel and log a warning when the sourceLocationTracking is enabled", + () => { + it("on initialization", () => { + getExtensionLogger({ + extName: "MyExtName", + sourceLocationTracking: true, + logOutputChannel: vsCodeStub.OutputChannel, + level: "warn" + }); + expect(vsCodeStub.shown).to.be.true; + }); + + it("on sourceLocationChange change", () => { + const extLogger = getExtensionLogger({ + extName: "MyExtName", + logOutputChannel: vsCodeStub.OutputChannel, + level: "error" + }); + expect(vsCodeStub.shown).to.be.false; + extLogger.changeSourceLocationTracking(true); + expect(vsCodeStub.shown).to.be.true; + }); + } + ); + }); +}); diff --git a/projects/vscode-logging/packages/logger/test/output-channel-spec.ts b/projects/vscode-logging/packages/logger/test/output-channel-spec.ts new file mode 100644 index 00000000..a279e433 --- /dev/null +++ b/projects/vscode-logging/packages/logger/test/output-channel-spec.ts @@ -0,0 +1,7 @@ +import { window, OutputChannel } from "vscode"; +import { BasicOutputChannel } from "../api"; + +// We check that vscodeOutputChannel is assignable to BasicOutputChannel. +// Checked in `type-check` npm script +const vscodeChannel: OutputChannel = window.createOutputChannel("test"); +const basicChannel: BasicOutputChannel = vscodeChannel; diff --git a/projects/vscode-logging/packages/logger/test/rolling-file-spec.js b/projects/vscode-logging/packages/logger/test/rolling-file-spec.js new file mode 100644 index 00000000..6d6f2cf7 --- /dev/null +++ b/projects/vscode-logging/packages/logger/test/rolling-file-spec.js @@ -0,0 +1,76 @@ +const { map } = require("lodash"); +const { expect } = require("chai"); +const proxyquire = require("proxyquire").noCallThru(); +const { basename, resolve } = require("path"); + +const { StreamRollerStub } = require("./stubs/stream-roller-stub"); + +const TESTS_LOG_PATH = resolve(__dirname, ".log-out"); + +describe("VSCode Extension Logger", () => { + /** + * We are not testing the behavior of the StreamRoller, that is not our responsibility... + * Rather we are only inspecting what gets written to the stream. + */ + context("Rolling File Logging", () => { + /** + * @type {typeof import("../api").getExtensionLogger} + */ + let getExtensionLogger; + let streamRollerStub; + beforeEach(() => { + streamRollerStub = new StreamRollerStub(); + const mainModuleStubbed = proxyquire("../lib/api.js", { + streamroller: streamRollerStub + }); + getExtensionLogger = mainModuleStubbed.getExtensionLogger; + }); + + it("will Log in JSON Format", () => { + const extLogger = getExtensionLogger({ + extName: "MyExtName", + logPath: TESTS_LOG_PATH, + level: "error" + }); + extLogger.fatal("Oy Vey!"); + extLogger.error("Oh Dear..."); + + const logEntries = map(streamRollerStub.lines, JSON.parse); + expect(logEntries) + .excluding("time") + .to.deep.eql([ + { + label: "MyExtName", + level: "fatal", + message: "Oy Vey!" + }, + { + label: "MyExtName", + level: "error", + message: "Oh Dear..." + } + ]); + }); + + it("can add sourceLocation information", function myFuncName() { + const extLogger = getExtensionLogger({ + extName: "MyExtName", + sourceLocationTracking: true, + logPath: TESTS_LOG_PATH, + level: "error" + }); + extLogger.fatal("Oy Vey!"); + const logEntries = map(streamRollerStub.lines, JSON.parse); + // [0] contains the warning about using `sourceLocationTracking` + const logJsonEntry = logEntries[1]; + expect(logJsonEntry.label).to.eql("MyExtName"); + expect(logJsonEntry.level).to.eql("fatal"); + expect(logJsonEntry.message).to.eql("Oy Vey!"); + expect(logJsonEntry.source.function).to.eql("Context.myFuncName"); + const baseFileName = basename(__filename); + const fileNameAndLocRegExp = new RegExp(`.+${baseFileName}:\\d+:\\d+`); + // The location includes our own source file name! :) + expect(logJsonEntry.source.location).to.match(fileNameAndLocRegExp); + }); + }); +}); diff --git a/projects/vscode-logging/packages/logger/test/stubs/stream-roller-stub.js b/projects/vscode-logging/packages/logger/test/stubs/stream-roller-stub.js new file mode 100644 index 00000000..d89d7615 --- /dev/null +++ b/projects/vscode-logging/packages/logger/test/stubs/stream-roller-stub.js @@ -0,0 +1,24 @@ +class StreamRollerStub { + constructor() { + this.lines = []; + const that = this; + + this.RollingFileStream = class RollingFileStreamStub { + constructor() { + that.lines = []; + } + + write(txt) { + that.lines.push(txt); + } + + end() { + // NOOP + } + }; + } +} + +module.exports = { + StreamRollerStub: StreamRollerStub +}; diff --git a/projects/vscode-logging/packages/logger/test/stubs/vscode-stub.js b/projects/vscode-logging/packages/logger/test/stubs/vscode-stub.js new file mode 100644 index 00000000..bcfc3e0a --- /dev/null +++ b/projects/vscode-logging/packages/logger/test/stubs/vscode-stub.js @@ -0,0 +1,21 @@ +class VSCodeStub { + constructor() { + this.lines = []; + this.shown = false; + + const that = this; + this.OutputChannel = { + dispose: () => {}, + show: () => { + that.shown = true; + }, + appendLine: txt => { + that.lines.push(txt); + } + }; + } +} + +module.exports = { + VSCodeStub: VSCodeStub +}; diff --git a/projects/vscode-logging/packages/logger/tsconfig.json b/projects/vscode-logging/packages/logger/tsconfig.json new file mode 100644 index 00000000..1c8d916d --- /dev/null +++ b/projects/vscode-logging/packages/logger/tsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "module": "commonjs", + "noEmit": true, + "checkJs": true, + "allowJs": true + }, + "include": ["./lib/**/*.js", "./api.d.ts", "./test/output-channel-spec.ts"] +} diff --git a/projects/vscode-logging/packages/types/.npmignore b/projects/vscode-logging/packages/types/.npmignore new file mode 100644 index 00000000..b5a7e13f --- /dev/null +++ b/projects/vscode-logging/packages/types/.npmignore @@ -0,0 +1,5 @@ +# TypeScript +tsconfig.json + +# Dev Docs +CONTRIBUTING.md \ No newline at end of file diff --git a/projects/vscode-logging/packages/types/CHANGELOG.md b/projects/vscode-logging/packages/types/CHANGELOG.md new file mode 100644 index 00000000..c0aa1b0c --- /dev/null +++ b/projects/vscode-logging/packages/types/CHANGELOG.md @@ -0,0 +1,70 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [2.0.8](https://github.com/SAP/vscode-logging/compare/v2.0.7...v2.0.8) (2026-02-18) + +### Bug Fixes + +- correct repository URL case (SAP instead of sap) for npm provenance ([00a91ca](https://github.com/SAP/vscode-logging/commit/00a91ca002ba88ed27278f756b7aca8865eee1ee)) + +## [2.0.7](https://github.com/sap/vscode-logging/compare/v2.0.6...v2.0.7) (2026-02-18) + +**Note:** Version bump only for package @vscode-logging/types + +## [2.0.6](https://github.com/sap/vscode-logging/compare/v2.0.5...v2.0.6) (2026-02-18) + +**Note:** Version bump only for package @vscode-logging/types + +## [2.0.5](https://github.com/sap/vscode-logging/compare/v2.0.4...v2.0.5) (2026-02-18) + +**Note:** Version bump only for package @vscode-logging/types + +## [2.0.4](https://github.com/sap/vscode-logging/compare/v2.0.3...v2.0.4) (2026-02-18) + +**Note:** Version bump only for package @vscode-logging/types + +## [2.0.3](https://github.com/sap/vscode-logging/compare/v2.0.2...v2.0.3) (2026-02-17) + +**Note:** Version bump only for package @vscode-logging/types + +## [2.0.2](https://github.com/sap/vscode-logging/compare/v2.0.1...v2.0.2) (2026-02-17) + +**Note:** Version bump only for package @vscode-logging/types + +# 2.0.0 (2024-01-05) + +### Bug Fixes + +- add .npmignore files to remove unneeded contents in published pkgs ([998b1f8](https://github.com/sap/vscode-logging/commit/998b1f8341352af2bba9a640f425c66c2d3a8a74)) + +### Features + +- aPI Fixes (dummy change to force minor version) ([0fb0fb6](https://github.com/sap/vscode-logging/commit/0fb0fb624def760bb1a1cf4a7b46b18133d85cf0)) +- initial Commit ([ee780af](https://github.com/sap/vscode-logging/commit/ee780afa90dc17cfac91a28cb2921728c1cc4489)) + +## [0.1.4](https://github.com/sap/vscode-logging/compare/@vscode-logging/types@0.1.3...@vscode-logging/types@0.1.4) (2021-04-13) + +**Note:** Version bump only for package @vscode-logging/types + +## [0.1.3](https://github.com/sap/vscode-logging/compare/@vscode-logging/types@0.1.2...@vscode-logging/types@0.1.3) (2020-11-12) + +**Note:** Version bump only for package @vscode-logging/types + +## [0.1.2](https://github.com/sap/vscode-logging/compare/@vscode-logging/types@0.1.1...@vscode-logging/types@0.1.2) (2020-02-19) + +### Bug Fixes + +- add .npmignore files to remove unneeded contents in published pkgs ([998b1f8](https://github.com/sap/vscode-logging/commit/998b1f8341352af2bba9a640f425c66c2d3a8a74)) + +## [0.1.1](https://github.com/sap/vscode-logging/compare/@vscode-logging/types@0.1.0...@vscode-logging/types@0.1.1) (2020-01-20) + +**Note:** Version bump only for package @vscode-logging/types + +# 0.1.0 (2020-01-14) + +### Features + +- aPI Fixes (dummy change to force minor version) ([0fb0fb6](https://github.com/sap/vscode-logging/commit/0fb0fb624def760bb1a1cf4a7b46b18133d85cf0)) +- initial Commit ([ee780af](https://github.com/sap/vscode-logging/commit/ee780afa90dc17cfac91a28cb2921728c1cc4489)) diff --git a/projects/vscode-logging/packages/types/README.md b/projects/vscode-logging/packages/types/README.md new file mode 100644 index 00000000..9131eb27 --- /dev/null +++ b/projects/vscode-logging/packages/types/README.md @@ -0,0 +1,49 @@ +# @vscode-logging/types + +Types used by @vscode-logging/logger extracted to a separate package to enable +in-direct dependents to type check against the correct interfaces. + +For example imagine a VSCode extension called `Foo` which uses an npm package called `Bar` +as a dependency and `Bar` APIs can accept an optional logger implementation: + +```typescript +// Code in `Bar` npm package +// ------------------------------------------------------- + +// By defining the `IChildLogger` interface` in `@vscode-logging/types` +// `Bar` only depends (dev dependency) on the interface **not** the implementation. +import { IChildLogger } from "@vscode-logging/types"; + +export function add(lhs: number, rhs: number, logger: IChildLogger): number { + logger.info("Entering function with params:", { lhs: lhs, rhs: rhs }); + return lhs + rhs; +} +``` + +## Installation + +With npm: + +- `npm install @vscode-logging/types --save-dev` + +With Yarn: + +- `yarn add @vscode-logging/types --dev` + +## Usage + +As shown above, simply import the `IChildLogger` interface and use it to define +the type of your injected logger implementation. + +## Support + +Please open [issues](https://github.com/SAP/vscode-logging/issues) on github. + +## Contributing + +See [CONTRIBUTING.md](./CONTRIBUTING.md). + +## License + +Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. +This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the [LICENSE file](../../LICENSE). diff --git a/projects/vscode-logging/packages/types/api.d.ts b/projects/vscode-logging/packages/types/api.d.ts new file mode 100644 index 00000000..923b3fa2 --- /dev/null +++ b/projects/vscode-logging/packages/types/api.d.ts @@ -0,0 +1,67 @@ +type LogLevel = "off" | "fatal" | "error" | "warn" | "info" | "debug" | "trace"; + +export interface IVSCodeExtLogger extends IChildLogger { + /** + * Modify the Logging Level. + * This will affect all child loggers as well. + * Note that the level "off" is used to 'disable' the Logger. + */ + changeLevel(newLevel: LogLevel): void; + + /** + * Modify the Log's sourceLocation tracking behavior. + */ + changeSourceLocationTracking(newSourceLocation: boolean): void; +} + +export interface IChildLogger { + /** + * @param msg - The Message to log, It may include format specifiers as defined in + * - https://nodejs.org/api/util.html#util_util_format_format_args + * @param [args] - Args can be either: + * - Optional Variable Argument List of values to "replace" the format specifiers: + * myLogger.fatal("Oy %s %d", "Vey", 123) // --> { message: "Oy Vey 123"} + * - Metadata Objects: + * myLogger.fatal("Exec Command", { p1: 666, p2: "foo" }) // --> { message: "Exec Command", p1: 666, p2: "foo"} + * Or a combination of both, however note that format specifier values should appear before + * any metadata objects. + * + */ + fatal(msg: string, ...args: any[]): void; + /** + * @see {IChildLogger.fatal} + */ + error(msg: string, ...args: any[]): void; + /** + * @see {IChildLogger.fatal} + */ + warn(msg: string, ...args: any[]): void; + /** + * @see {IChildLogger.fatal} + */ + info(msg: string, ...args: any[]): void; + /** + * @see {IChildLogger.fatal} + */ + debug(msg: string, ...args: any[]): void; + /** + * @see {IChildLogger.fatal} + */ + trace(msg: string, ...args: any[]): void; + + /** + * Will create an logger which uses the **same** log Targets (VSCode outputChannel / Rolling File(?)). + * With one difference: This "child-logger" will prefix its name to the log entries label property. + * This enables distinguishing between logging messages arriving from different sources, e.g: + * + * - Per Class Logger + * - Per Module Logger + * - Per Library Dependency Logger (via dependency injection) + * - ... + * + * Note that the childLoggers are cached using the label as the key, this means that + * One can safely request a (same label) childLogger **multiple times** and not worry about + * memory leaks due to the creation of many objects. + */ + getChildLogger(opts: { label: string }): IChildLogger; +} diff --git a/projects/vscode-logging/packages/types/package.json b/projects/vscode-logging/packages/types/package.json new file mode 100644 index 00000000..9604a150 --- /dev/null +++ b/projects/vscode-logging/packages/types/package.json @@ -0,0 +1,24 @@ +{ + "name": "@vscode-logging/types", + "version": "2.0.8", + "description": "Common Type Signatures for @vscode-logging/logger", + "keywords": [ + "vscode", + "logger" + ], + "files": [ + ".reuse", + "LICENSES", + "api.d.ts" + ], + "repository": "https://github.com/SAP/vscode-logging/", + "license": "Apache-2.0", + "typings": "./api.d.ts", + "scripts": { + "ci": "npm-run-all type-check", + "type-check": "tsc" + }, + "publishConfig": { + "access": "public" + } +} diff --git a/projects/vscode-logging/packages/types/tsconfig.json b/projects/vscode-logging/packages/types/tsconfig.json new file mode 100644 index 00000000..f56f3101 --- /dev/null +++ b/projects/vscode-logging/packages/types/tsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "noEmit": true, + "target": "ES2015" + }, + "include": ["./"] +} diff --git a/projects/vscode-logging/packages/wrapper/.npmignore b/projects/vscode-logging/packages/wrapper/.npmignore new file mode 100644 index 00000000..784afc43 --- /dev/null +++ b/projects/vscode-logging/packages/wrapper/.npmignore @@ -0,0 +1,13 @@ +# TypeScript +tsconfig.json + +# NYC +.nyc_output +nyc.config.js +coverage + +# tests +test + +# Dev Docs +CONTRIBUTING.md diff --git a/projects/vscode-logging/packages/wrapper/CHANGELOG.md b/projects/vscode-logging/packages/wrapper/CHANGELOG.md new file mode 100644 index 00000000..72c392bd --- /dev/null +++ b/projects/vscode-logging/packages/wrapper/CHANGELOG.md @@ -0,0 +1,88 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [2.0.9](https://github.com/SAP/vscode-logging/compare/v2.0.8...v2.0.9) (2026-04-16) + +**Note:** Version bump only for package @vscode-logging/wrapper + +## [2.0.8](https://github.com/SAP/vscode-logging/compare/v2.0.7...v2.0.8) (2026-02-18) + +### Bug Fixes + +- correct repository URL case (SAP instead of sap) for npm provenance ([00a91ca](https://github.com/SAP/vscode-logging/commit/00a91ca002ba88ed27278f756b7aca8865eee1ee)) + +## [2.0.7](https://github.com/sap/vscode-logging/compare/v2.0.6...v2.0.7) (2026-02-18) + +**Note:** Version bump only for package @vscode-logging/wrapper + +## [2.0.6](https://github.com/sap/vscode-logging/compare/v2.0.5...v2.0.6) (2026-02-18) + +**Note:** Version bump only for package @vscode-logging/wrapper + +## [2.0.5](https://github.com/sap/vscode-logging/compare/v2.0.4...v2.0.5) (2026-02-18) + +**Note:** Version bump only for package @vscode-logging/wrapper + +## [2.0.4](https://github.com/sap/vscode-logging/compare/v2.0.3...v2.0.4) (2026-02-18) + +**Note:** Version bump only for package @vscode-logging/wrapper + +## [2.0.3](https://github.com/sap/vscode-logging/compare/v2.0.2...v2.0.3) (2026-02-17) + +**Note:** Version bump only for package @vscode-logging/wrapper + +## [2.0.2](https://github.com/sap/vscode-logging/compare/v2.0.1...v2.0.2) (2026-02-17) + +**Note:** Version bump only for package @vscode-logging/wrapper + +## [2.0.1](https://github.com/sap/vscode-logging/compare/v2.0.0...v2.0.1) (2026-02-15) + +### Bug Fixes + +- upgrade lodash to version 4.17.23 ([#241](https://github.com/sap/vscode-logging/issues/241)) ([69fc2ce](https://github.com/sap/vscode-logging/commit/69fc2ce233e960219efca1118027638cc115874c)) +- workspace protocol ([#243](https://github.com/sap/vscode-logging/issues/243)) ([3091351](https://github.com/sap/vscode-logging/commit/30913512554b29590b16bce4ad2a1eb3890b5dc9)) + +# 2.0.0 (2024-01-05) + +### Bug Fixes + +- upgrade lodash version due to CVE-2021-23337 ([c514c16](https://github.com/sap/vscode-logging/commit/c514c169ae5941cea9ebd5ae0dcb4eef8fc431d8)) + +### Features + +- **wrapper:** remove dep to @types/vscode ([#167](https://github.com/sap/vscode-logging/issues/167)) ([b362e5c](https://github.com/sap/vscode-logging/commit/b362e5c3b11020ab09a5e705d7834fa53e8bd48e)) +- logger wrapper package ([#163](https://github.com/sap/vscode-logging/issues/163)) ([fc6abc5](https://github.com/sap/vscode-logging/commit/fc6abc5ea43403c3039edb8589c68a0a339e5ebc)) + +### BREAKING CHANGES + +- **wrapper:** `getConfigurations` and `onDidChangeConfiguration` properties + were removed from the `configureLogger` public API + +## [1.0.2](https://github.com/sap/vscode-logging/compare/@vscode-logging/wrapper@1.0.1...@vscode-logging/wrapper@1.0.2) (2021-09-12) + +### Bug Fixes + +- upgrade lodash version due to CVE-2021-23337 ([c514c16](https://github.com/sap/vscode-logging/commit/c514c169ae5941cea9ebd5ae0dcb4eef8fc431d8)) + +## [1.0.1](https://github.com/sap/vscode-logging/compare/@vscode-logging/wrapper@1.0.0...@vscode-logging/wrapper@1.0.1) (2021-04-13) + +**Note:** Version bump only for package @vscode-logging/wrapper + +# [1.0.0](https://github.com/sap/vscode-logging/compare/@vscode-logging/wrapper@0.2.0...@vscode-logging/wrapper@1.0.0) (2021-02-10) + +### Features + +- **wrapper:** remove dep to @types/vscode ([#167](https://github.com/sap/vscode-logging/issues/167)) ([b362e5c](https://github.com/sap/vscode-logging/commit/b362e5c3b11020ab09a5e705d7834fa53e8bd48e)) + +### BREAKING CHANGES + +- **wrapper:** `getConfigurations` and `onDidChangeConfiguration` properties + were removed from the `configureLogger` public API + +# 0.2.0 (2021-02-07) + +### Features + +- logger wrapper package ([#163](https://github.com/sap/vscode-logging/issues/163)) ([fc6abc5](https://github.com/sap/vscode-logging/commit/fc6abc5ea43403c3039edb8589c68a0a339e5ebc)) diff --git a/projects/vscode-logging/packages/wrapper/README.md b/projects/vscode-logging/packages/wrapper/README.md new file mode 100644 index 00000000..793770cd --- /dev/null +++ b/projects/vscode-logging/packages/wrapper/README.md @@ -0,0 +1,34 @@ +# @vscode-logging/wrapper + +A **optional** and **opinionated** wrapper utilities for @vscode-logging/logger. + +## Installation + +With npm: + +- `npm install @vscode-logging/wrapper --save` + +With Yarn: + +- `yarn add @vscode-logging/wrapper` + +## Usage + +Please see the [TypeScript Definitions](./api.d.ts) for full API details. + +## Example + +An example VSCode extension is available in the [examples' folder](https://github.com/SAP/vscode-logging/tree/master/examples/extension-wrapper). + +## Support + +Please open [issues](https://github.com/SAP/vscode-logging/issues) on github. + +## Contributing + +See [CONTRIBUTING.md](./CONTRIBUTING.md). + +## License + +Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. +This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the [LICENSE file](../../LICENSE). diff --git a/projects/vscode-logging/packages/wrapper/api.d.ts b/projects/vscode-logging/packages/wrapper/api.d.ts new file mode 100644 index 00000000..8eddf63f --- /dev/null +++ b/projects/vscode-logging/packages/wrapper/api.d.ts @@ -0,0 +1,53 @@ +import { IVSCodeExtLogger } from "@vscode-logging/types"; +import { BasicOutputChannel } from "@vscode-logging/logger"; + +/** + * An "empty" Logger implementation. + * This value should be used to initialize an extension's logger + * before the `activate` function has been called. + */ +export declare const NOOP_LOGGER: IVSCodeExtLogger; + +export interface ConfigureLoggerOpts { + /** + * @see {GetExtensionLoggerOpts.extName} in "@vscode-logging/logger" + */ + extName: string; + /** + * @see {GetExtensionLoggerOpts.logPath} in "@vscode-logging/logger" + */ + logPath: string; + loggingLevelProp: string; + sourceLocationProp: string; + /** + * @see {GetExtensionLoggerOpts.logOutputChannel} in "@vscode-logging/logger" + */ + logOutputChannel?: BasicOutputChannel; + /** + * @see {GetExtensionLoggerOpts.logConsole} in "@vscode-logging/logger" + */ + logConsole?: boolean; + /** + * The vscode extension's subscriptions + * This is normally available via the `activate` function's `context` + * parameter. + */ + subscriptions: { dispose(): any }[]; +} + +/** + * The main opinionated wrapper utility. + * This will do the following: + * + * 1. Initialize an @vscode-logging/logger instance. + * 2. Log the initial file `logPath` and `logLevel`. + * 3. Register a listener for VSCode workspace configuration changes + * for the `logLevel` and `sourceLocationTracking` + * + * - Note that this utility is slightly opinionated and has more more restrictive + * than the @vscode-logging/logger APIs, e.g: + * 1. `logPath` param is mandatory. + * 2. default logLevel (if none is found in the workspace configuration) is `error`. + * 3. ... + */ +export function configureLogger(opts: ConfigureLoggerOpts): IVSCodeExtLogger; diff --git a/projects/vscode-logging/packages/wrapper/nyc.config.js b/projects/vscode-logging/packages/wrapper/nyc.config.js new file mode 100644 index 00000000..0b04fd7a --- /dev/null +++ b/projects/vscode-logging/packages/wrapper/nyc.config.js @@ -0,0 +1,22 @@ +module.exports = { + reporter: ["text", "lcov"], + "check-coverage": false, + all: true, + include: ["dist/src/**/*.js"], + exclude: [ + // The `api.ts` is the only file which imports("vscode") + // We could still test it (e.g: with `proxyquire`) + // However the added value of such a test is smaller than + // the overhead cost of implementing such a test: + // - The api.ts only + // 1. Import needed params from `vscode` package. + // 2. merges user arguments with `vscode` params and calls an internal API. + // + // - These merges are partially "tested" at design time by TSC. + // - Implementing a test with proxyquire would not test real VSCode scenarios + // - The existing `configureLogger` tests are fairly complex and we are better off avoiding duplicating them. + // - See: `configure-logger-spec.ts`. + "dist/src/api.js" + ], + excludeAfterRemap: false +}; diff --git a/projects/vscode-logging/packages/wrapper/package.json b/projects/vscode-logging/packages/wrapper/package.json new file mode 100644 index 00000000..51aaa276 --- /dev/null +++ b/projects/vscode-logging/packages/wrapper/package.json @@ -0,0 +1,48 @@ +{ + "name": "@vscode-logging/wrapper", + "version": "2.0.9", + "description": "opinionated DI based wrapper for @vscode-logging/logger", + "keywords": [ + "vscode", + "logger" + ], + "files": [ + ".reuse", + "LICENSES", + "dist/src", + "api.d.ts" + ], + "main": "dist/src/api.js", + "repository": "https://github.com/SAP/vscode-logging/", + "license": "Apache-2.0", + "typings": "./api.d.ts", + "dependencies": { + "@vscode-logging/logger": "workspace:^", + "@vscode-logging/types": "workspace:^" + }, + "devDependencies": { + "@types/lodash": "4.14.202", + "@types/vscode": "1.52.0", + "lodash": "4.18.1" + }, + "scripts": { + "ci": "npm-run-all clean compile coverage:*", + "clean": "rimraf ./dist ./coverage", + "compile": "tsc", + "test": "mocha \"./dist/test/**/*spec.js\"", + "coverage:run": "nyc mocha \"./dist/test/**/*spec.js\"", + "coverage:check": "nyc check-coverage --lines 100 --branches 100 --statements 100 --functions 100" + }, + "publishConfig": { + "access": "public" + }, + "nyc": { + "include": [ + "dist/src/**/*.js" + ], + "reporter": [ + "text", + "lcov" + ] + } +} diff --git a/projects/vscode-logging/packages/wrapper/src/api.ts b/projects/vscode-logging/packages/wrapper/src/api.ts new file mode 100644 index 00000000..67cf0293 --- /dev/null +++ b/projects/vscode-logging/packages/wrapper/src/api.ts @@ -0,0 +1,25 @@ +/** + * This is the only file in the `src` folder we import("vscode") + * The rest of the code is implemented with Dependency Injection to + * the relevant VSCode APIs to enable easier testing. + */ +import { workspace } from "vscode"; +import { configureLoggerInternal } from "./configure-logger"; +import { BasicOutputChannel } from "@vscode-logging/logger"; +export { NOOP_LOGGER } from "./noop-logger"; + +export function configureLogger(opts: { + extName: string; + logPath: string; + loggingLevelProp: string; + sourceLocationProp: string; + logOutputChannel?: BasicOutputChannel; + logConsole?: boolean; + subscriptions: { dispose(): any }[]; +}) { + return configureLoggerInternal({ + ...opts, + getConfiguration: workspace.getConfiguration, + onDidChangeConfiguration: workspace.onDidChangeConfiguration + }); +} diff --git a/projects/vscode-logging/packages/wrapper/src/configure-logger.ts b/projects/vscode-logging/packages/wrapper/src/configure-logger.ts new file mode 100644 index 00000000..314e0438 --- /dev/null +++ b/projects/vscode-logging/packages/wrapper/src/configure-logger.ts @@ -0,0 +1,69 @@ +import { workspace } from "vscode"; +import { getExtensionLogger } from "@vscode-logging/logger"; +import { IVSCodeExtLogger } from "@vscode-logging/types"; +import { ConfigureLoggerOpts } from "../api"; +import { + getLoggingLevelSetting, + getSourceLocationTrackingSetting +} from "./settings"; +import { + listenToLogSettingsChanges, + logLoggerDetails +} from "./settings-changes-handler"; + +export type ConfigureLoggerDIOpts = { + /** + * The `vscode.workspace.getConfiguration` method. + * Note this is the method itself, not the returned value from executing it. + */ + getConfiguration: typeof workspace.getConfiguration; + /** + * The `vscode.workspace.onDidChangeConfiguration` method. + * Note this is the method itself, not the returned value from executing it. + */ + onDidChangeConfiguration: typeof workspace.onDidChangeConfiguration; +}; + +export type configureLoggerInternalOpts = ConfigureLoggerOpts & + ConfigureLoggerDIOpts; + +export function configureLoggerInternal( + opts: configureLoggerInternalOpts +): IVSCodeExtLogger { + const logLevelSetting = getLoggingLevelSetting({ + getConfiguration: opts.getConfiguration, + loggingLevelProp: opts.loggingLevelProp + }); + + const sourceLocationTrackingSettings = getSourceLocationTrackingSetting({ + getConfiguration: opts.getConfiguration, + sourceLocationProp: opts.sourceLocationProp + }); + + const extensionLogger = getExtensionLogger({ + extName: opts.extName, + level: logLevelSetting, + logPath: opts.logPath, + sourceLocationTracking: sourceLocationTrackingSettings, + logConsole: opts.logConsole, + logOutputChannel: opts.logOutputChannel + }); + + logLoggerDetails({ + logger: extensionLogger, + logPath: opts.logPath, + logLevel: logLevelSetting + }); + + listenToLogSettingsChanges({ + subscriptions: opts.subscriptions, + onDidChangeConfiguration: opts.onDidChangeConfiguration, + getConfiguration: opts.getConfiguration, + loggingLevelProp: opts.loggingLevelProp, + sourceLocationProp: opts.sourceLocationProp, + logger: extensionLogger, + logPath: opts.logPath + }); + + return extensionLogger; +} diff --git a/projects/vscode-logging/packages/wrapper/src/helper-types.d.ts b/projects/vscode-logging/packages/wrapper/src/helper-types.d.ts new file mode 100644 index 00000000..079b06fe --- /dev/null +++ b/projects/vscode-logging/packages/wrapper/src/helper-types.d.ts @@ -0,0 +1,33 @@ +import { + IChildLogger, + IVSCodeExtLogger, + LogLevel +} from "@vscode-logging/types"; +// importing "vscode" in a **d.ts** files avoids a actual runtime dependency to vscode. +import { ExtensionContext, workspace } from "vscode"; + +export interface GetLoggingLevelOpts { + getConfiguration: typeof workspace.getConfiguration; + loggingLevelProp: string; +} + +export interface GetSourceLocationOpts { + getConfiguration: typeof workspace.getConfiguration; + sourceLocationProp: string; +} + +export interface ListenToLogSettingsOpts { + subscriptions: ExtensionContext["subscriptions"]; + onDidChangeConfiguration: typeof workspace.onDidChangeConfiguration; + getConfiguration: typeof workspace.getConfiguration; + loggingLevelProp: string; + sourceLocationProp: string; + logger: IVSCodeExtLogger; + logPath: string; +} + +export interface LogLoggerDetailsOpts { + logger: IChildLogger; + logPath: string; + logLevel: LogLevel; +} diff --git a/projects/vscode-logging/packages/wrapper/src/noop-logger.ts b/projects/vscode-logging/packages/wrapper/src/noop-logger.ts new file mode 100644 index 00000000..b9e7cc33 --- /dev/null +++ b/projects/vscode-logging/packages/wrapper/src/noop-logger.ts @@ -0,0 +1,19 @@ +import { IVSCodeExtLogger, IChildLogger } from "@vscode-logging/types"; + +export function noop() {} + +export const NOOP_LOGGER: IVSCodeExtLogger = { + changeLevel: noop, + changeSourceLocationTracking: noop, + debug: noop, + error: noop, + fatal: noop, + getChildLogger(opts: { label: string }): IChildLogger { + return this; + }, + info: noop, + trace: noop, + warn: noop +}; + +Object.freeze(NOOP_LOGGER); diff --git a/projects/vscode-logging/packages/wrapper/src/settings-changes-handler.ts b/projects/vscode-logging/packages/wrapper/src/settings-changes-handler.ts new file mode 100644 index 00000000..035683d5 --- /dev/null +++ b/projects/vscode-logging/packages/wrapper/src/settings-changes-handler.ts @@ -0,0 +1,46 @@ +import { LogLevel } from "@vscode-logging/types"; +import { ListenToLogSettingsOpts, LogLoggerDetailsOpts } from "./helper-types"; +import { + getLoggingLevelSetting, + getSourceLocationTrackingSetting +} from "./settings"; + +export function logLoggerDetails(opts: LogLoggerDetailsOpts): void { + opts.logger.info(`Start Logging in Log Level: <${opts.logLevel}>`); + opts.logger.info(`Full Logs can be found in the <${opts.logPath}> folder.`); +} + +export function listenToLogSettingsChanges( + opts: ListenToLogSettingsOpts +): void { + opts.subscriptions.push( + opts.onDidChangeConfiguration(e => { + if (e.affectsConfiguration(opts.loggingLevelProp)) { + const logLevel: LogLevel = getLoggingLevelSetting({ + loggingLevelProp: opts.loggingLevelProp, + getConfiguration: opts.getConfiguration + }); + opts.logger.changeLevel(logLevel); + logLoggerDetails({ + logger: opts.logger, + logPath: opts.logPath, + logLevel + }); + } + }) + ); + + opts.subscriptions.push( + opts.onDidChangeConfiguration(e => { + if (e.affectsConfiguration(opts.sourceLocationProp)) { + const newSourceLocationTracking: boolean = getSourceLocationTrackingSetting( + { + sourceLocationProp: opts.sourceLocationProp, + getConfiguration: opts.getConfiguration + } + ); + opts.logger.changeSourceLocationTracking(newSourceLocationTracking); + } + }) + ); +} diff --git a/projects/vscode-logging/packages/wrapper/src/settings.ts b/projects/vscode-logging/packages/wrapper/src/settings.ts new file mode 100644 index 00000000..23496fed --- /dev/null +++ b/projects/vscode-logging/packages/wrapper/src/settings.ts @@ -0,0 +1,12 @@ +import { LogLevel } from "@vscode-logging/logger"; +import { GetLoggingLevelOpts, GetSourceLocationOpts } from "./helper-types"; + +export function getLoggingLevelSetting(opts: GetLoggingLevelOpts): LogLevel { + return opts.getConfiguration().get(opts.loggingLevelProp, "error"); +} + +export function getSourceLocationTrackingSetting( + opts: GetSourceLocationOpts +): boolean { + return opts.getConfiguration().get(opts.sourceLocationProp, false); +} diff --git a/projects/vscode-logging/packages/wrapper/test/configure-logger-spec.ts b/projects/vscode-logging/packages/wrapper/test/configure-logger-spec.ts new file mode 100644 index 00000000..a634def6 --- /dev/null +++ b/projects/vscode-logging/packages/wrapper/test/configure-logger-spec.ts @@ -0,0 +1,81 @@ +import { expect } from "chai"; +import { ExtensionContext, WorkspaceConfiguration } from "vscode"; +import { IChildLogger, LogLevel } from "@vscode-logging/types"; +import { BasicOutputChannel } from "@vscode-logging/logger"; +import { configureLoggerInternal } from "../src/configure-logger"; +import { configureLoggerInternalOpts } from "../src/configure-logger"; + +describe("The `configureLogger` main wrapper utility function", () => { + let outputChannelMock: BasicOutputChannel; + let subscriptions: ExtensionContext["subscriptions"]; + let onDidChangeConfiguration: configureLoggerInternalOpts["onDidChangeConfiguration"]; + let loggingLevelProp: string; + let sourceLocationProp: string; + let configLogLevel: LogLevel; + let getConfiguration: configureLoggerInternalOpts["getConfiguration"]; + let loggedLines: Record[]; + + beforeEach(() => { + loggedLines = []; + subscriptions = []; + }); + + before(() => { + outputChannelMock = { + appendLine(value: string): void { + loggedLines.push(JSON.parse(value)); + }, + dispose(): void {}, + show(): void {} + }; + + // we are not testing configuration changes in this spec, these will be tested + // in `settings-changes-handler-spec` + onDidChangeConfiguration = () => { + return { dispose() {} }; + }; + + loggingLevelProp = "my_vscode_ext.loggingLevel"; + sourceLocationProp = "my_vscode_ext.sourceLocationTracking"; + configLogLevel = "debug"; + const settingsMap = new Map([ + [loggingLevelProp, configLogLevel], + [sourceLocationProp, false] + ]); + // don't worry be happy (or unknown)... + getConfiguration = _ => (settingsMap as unknown) as WorkspaceConfiguration; + }); + + function configureLoggerHelper(): IChildLogger { + return configureLoggerInternal({ + extName: "my_vscode_ext", + // only logging "in memory" during our test. + logPath: (undefined as unknown) as string, + loggingLevelProp: "my_vscode_ext.loggingLevel", + sourceLocationProp: "my_vscode_ext.sourceLocationTracking", + logOutputChannel: outputChannelMock, + subscriptions, + getConfiguration, + onDidChangeConfiguration + }); + } + + it("will log initial details on configure", () => { + expect(loggedLines).to.be.empty; + configureLoggerHelper(); + expect(loggedLines).to.have.lengthOf(2); + const loggerDetailsEntry = loggedLines[0]; + expect(loggerDetailsEntry.message).to.include(configLogLevel); + }); + + it("will return a VSCodeExtLogger that can be used for 'regular logging' e.g log/info/debug", () => { + expect(loggedLines).to.be.empty; + const testLogger = configureLoggerHelper(); + loggedLines = []; + testLogger.debug("hello world", { param1: 666 }); + expect(loggedLines).to.have.lengthOf(1); + const loggerEntry = loggedLines[0]; + expect(loggerEntry.message).to.equal("hello world"); + expect(loggerEntry.param1).to.equal(666); + }); +}); diff --git a/projects/vscode-logging/packages/wrapper/test/noop-logger-spec.ts b/projects/vscode-logging/packages/wrapper/test/noop-logger-spec.ts new file mode 100644 index 00000000..f65df8a2 --- /dev/null +++ b/projects/vscode-logging/packages/wrapper/test/noop-logger-spec.ts @@ -0,0 +1,35 @@ +import { expect } from "chai"; +import { keys, difference, forEach } from "lodash"; +import { noop, NOOP_LOGGER } from "../src/noop-logger"; + +describe("The no-operation logger", () => { + const noopFuncProps = difference(keys(NOOP_LOGGER), ["getChildLogger"]); + + forEach(noopFuncProps, funcPropName => { + it(`exposes a no operation method for <${funcPropName}>`, () => { + // @ts-expect-error -- runtime reflection + expect(NOOP_LOGGER[funcPropName]).to.eql(noop); + }); + }); + + it("uses an **empty** method for the noop implementation", () => { + const noopSource = noop.toString(); + // + // The `cov_...` section in optional capturing group handles the case of execution under nyc wrapper + // - instrumented code, in which case `toString` would return something like: + // ``` + // function noop(){cov_1w547p8w8s().f[0]++;}' + // ``` + expect(noopSource).to.match( + /function\s*\w+\s*\(\s*\)\s*{\s*(cov_\w+\(\)\.f\[\d]\+\+;)?}/ + ); + }); + + it("will not throw when executing the NOOP function", () => { + expect(noop()).to.not.throw; + }); + + it("implements by returning 'itself'", () => { + expect(NOOP_LOGGER.getChildLogger({ label: "foo" })).to.equal(NOOP_LOGGER); + }); +}); diff --git a/projects/vscode-logging/packages/wrapper/test/settings-changes-handler-spec.ts b/projects/vscode-logging/packages/wrapper/test/settings-changes-handler-spec.ts new file mode 100644 index 00000000..597368c2 --- /dev/null +++ b/projects/vscode-logging/packages/wrapper/test/settings-changes-handler-spec.ts @@ -0,0 +1,158 @@ +import { expect } from "chai"; +import { + ConfigurationChangeEvent, + Disposable, + ExtensionContext, + WorkspaceConfiguration +} from "vscode"; +import { LogLevel } from "@vscode-logging/logger"; +import { IChildLogger, IVSCodeExtLogger } from "@vscode-logging/types"; +import { configureLoggerInternalOpts } from "../src/configure-logger"; +import { listenToLogSettingsChanges } from "../src/settings-changes-handler"; + +describe("The `listenToLogSettingsChanges` utility function", () => { + let logger: IVSCodeExtLogger; + let loggingLevelProp: string; + let sourceLocationProp: string; + let logPath: string; + let getConfiguration: configureLoggerInternalOpts["getConfiguration"]; + let onDidChangeConfiguration: configureLoggerInternalOpts["onDidChangeConfiguration"]; + let subscriptions: ExtensionContext["subscriptions"]; + let currentLogLevel: LogLevel; + let currentSourceLocationTracking: boolean; + + beforeEach(() => { + currentLogLevel = "error"; + currentSourceLocationTracking = false; + }); + + before(() => { + logPath = "c:\\logs"; + + logger = { + changeLevel(newLevel: LogLevel) { + currentLogLevel = newLevel; + }, + changeSourceLocationTracking(newSourceLocation: boolean) { + currentSourceLocationTracking = newSourceLocation; + }, + getChildLogger(): IChildLogger { + return this; + }, + fatal(): void {}, + error(): void {}, + warn(): void {}, + info(): void {}, + debug(): void {}, + trace(): void {} + }; + + loggingLevelProp = "my_vscode_ext.loggingLevel"; + sourceLocationProp = "my_vscode_ext.sourceLocationTracking"; + subscriptions = []; + }); + + context("affects Configuration", () => { + before(() => { + const settingsMap = new Map([ + [loggingLevelProp, "info"], + [sourceLocationProp, true] + ]); + // don't worry be happy (or unknown)... + getConfiguration = _ => + (settingsMap as unknown) as WorkspaceConfiguration; + + onDidChangeConfiguration = function( + cb: (e: ConfigurationChangeEvent) => void + ): Disposable { + const e: ConfigurationChangeEvent = { + affectsConfiguration(): boolean { + return true; + } + }; + cb(e); + return { dispose(): any {} }; + }; + }); + + it("will listen to `logLevel` changes", () => { + expect(currentLogLevel).to.equal("error"); + listenToLogSettingsChanges({ + sourceLocationProp, + loggingLevelProp, + getConfiguration, + logger, + logPath, + onDidChangeConfiguration, + subscriptions + }); + expect(currentLogLevel).to.equal("info"); + }); + + it("will listen to `sourceLocationTracking` changes", () => { + expect(currentSourceLocationTracking).to.be.false; + listenToLogSettingsChanges({ + sourceLocationProp, + loggingLevelProp, + getConfiguration, + logger, + logPath, + onDidChangeConfiguration, + subscriptions + }); + expect(currentSourceLocationTracking).to.be.true; + }); + }); + + context("does **not** affects Configuration", () => { + before(() => { + const settingsMap = new Map([ + ["someOtherProp", "blue"], + ["someOtherProp2", 666] + ]); + // don't worry be happy (or unknown)... + getConfiguration = _ => + (settingsMap as unknown) as WorkspaceConfiguration; + + onDidChangeConfiguration = function( + cb: (e: ConfigurationChangeEvent) => void + ): Disposable { + const e: ConfigurationChangeEvent = { + affectsConfiguration(): boolean { + return false; + } + }; + cb(e); + return { dispose(): any {} }; + }; + }); + + it("will **not** listen to unrelated configuration changes - logLevel", () => { + expect(currentLogLevel).to.equal("error"); + listenToLogSettingsChanges({ + sourceLocationProp, + loggingLevelProp, + getConfiguration, + logger, + logPath, + onDidChangeConfiguration, + subscriptions + }); + expect(currentLogLevel).to.equal("error"); + }); + + it("will **not** listen to unrelated configuration changes - sourceLocationTracking", () => { + expect(currentSourceLocationTracking).to.be.false; + listenToLogSettingsChanges({ + sourceLocationProp, + loggingLevelProp, + getConfiguration, + logger, + logPath, + onDidChangeConfiguration, + subscriptions + }); + expect(currentSourceLocationTracking).to.be.false; + }); + }); +}); diff --git a/projects/vscode-logging/packages/wrapper/test/settings-spec.ts b/projects/vscode-logging/packages/wrapper/test/settings-spec.ts new file mode 100644 index 00000000..35adc4dd --- /dev/null +++ b/projects/vscode-logging/packages/wrapper/test/settings-spec.ts @@ -0,0 +1,51 @@ +import { expect } from "chai"; +import { + getLoggingLevelSetting, + getSourceLocationTrackingSetting +} from "../src/settings"; +import { GetLoggingLevelOpts } from "../src/helper-types"; +import { WorkspaceConfiguration } from "vscode"; + +describe("The settings related utilities", () => { + describe("The function", () => { + let getConfiguration: GetLoggingLevelOpts["getConfiguration"]; + + before(() => { + const settingsMap = new Map([ + ["ext1.loggingLevel", "debug"], + ["otherExt.loggingLevel", "info"] + ]); + getConfiguration = _ => + (settingsMap as unknown) as WorkspaceConfiguration; + }); + + it("Can retrieve the logging level value from a configuration", () => { + const logLevel = getLoggingLevelSetting({ + getConfiguration, + loggingLevelProp: "ext1.loggingLevel" + }); + expect(logLevel).to.equal("debug"); + }); + }); + + describe("The function", () => { + let getConfiguration: GetLoggingLevelOpts["getConfiguration"]; + + before(() => { + const settingsMap = new Map([ + ["ext1.sourceLocationTracking", true], + ["otherExt.sourceLocationTracking", false] + ]); + getConfiguration = _ => + (settingsMap as unknown) as WorkspaceConfiguration; + }); + + it("Can retrieve the source location tracking value from a configuration", () => { + const sourceLocationEnabled = getSourceLocationTrackingSetting({ + getConfiguration, + sourceLocationProp: "otherExt.sourceLocationTracking" + }); + expect(sourceLocationEnabled).to.be.false; + }); + }); +}); diff --git a/projects/vscode-logging/packages/wrapper/tsconfig.json b/projects/vscode-logging/packages/wrapper/tsconfig.json new file mode 100644 index 00000000..9cfc6955 --- /dev/null +++ b/projects/vscode-logging/packages/wrapper/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compileOnSave": true, + "compilerOptions": { + "rootDir": ".", + "outDir": "dist", + "baseUrl": ".", + "module": "commonjs", + "lib": ["es7"], + "target": "es2017", + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "strict": true + }, + "include": ["./src/**/*.ts", "./test/**/*.ts", "./api.d.ts"] +} From 6a429c18d8f46839087ed2eca99677b4b12162ea Mon Sep 17 00:00:00 2001 From: Jacob Kreyenbuehl Date: Fri, 21 Aug 2026 10:10:12 +0200 Subject: [PATCH 02/20] chore: integrate vscode-logging into the monorepo Wire the copied vscode-logging packages into app-studio-toolkit's tooling: - .eslintrc.js: relax rules for projects/vscode-logging/** (eslint-comments/ require-description, no-unused-vars) and projects/vscode-logging/**/*.ts (no-explicit-any, no-unused-expressions, no-unused-vars, no-unsafe-argument), mirroring the yeoman-ui / vscode-mta-tools integration blocks. - tsconfig.json (logger, types, wrapper): add skipLibCheck (AST convention) to resolve @types/node vs DOM-lib clashes under the repo's TypeScript 5.7.3. - logger: add a local nyc.config.js (include lib/**/*.js, excludeAfterRemap: false) so coverage is measured against lib/ instead of the root nyc.config.js '**/src/**' pattern; removes the previously ignored package.json 'nyc' block. - package.json (logger, types, wrapper): repoint repository/bugs metadata from SAP/vscode-logging to SAP/app-studio-toolkit with the project directory. - CHANGELOG.md: preserve the pre-migration history with a historic-note header; future changes are tracked in the per-package changelogs. Signed-off-by: Jacob Kreyenbuehl --- .eslintrc.js | 24 +++++ projects/vscode-logging/CHANGELOG.md | 95 +++++++++++++++++++ .../packages/logger/nyc.config.js | 8 ++ .../packages/logger/package.json | 18 ++-- .../packages/logger/tsconfig.json | 3 +- .../packages/types/package.json | 9 +- .../packages/types/tsconfig.json | 3 +- .../packages/wrapper/package.json | 9 +- .../packages/wrapper/tsconfig.json | 3 +- 9 files changed, 157 insertions(+), 15 deletions(-) create mode 100644 projects/vscode-logging/CHANGELOG.md create mode 100644 projects/vscode-logging/packages/logger/nyc.config.js diff --git a/.eslintrc.js b/.eslintrc.js index c1f6afe9..94c29c20 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -85,6 +85,17 @@ module.exports = { "eslint-comments/require-description": "off", }, }, + { + // vscode-logging was integrated with these rules relaxed for the migrated code. + // TODO: clean up violations and tighten incrementally. + files: ["projects/vscode-logging/**"], + rules: { + "eslint-comments/require-description": "off", + // base rule for .js sources/tests (the @typescript-eslint variant is + // handled in the projects/vscode-logging/**/*.ts override below) + "no-unused-vars": "off", + }, + }, { // Use this package's tsconfig so type-aware linting sees its newer (@types/node) typings. files: ["packages/vsix-zst/**/*.ts"], @@ -178,6 +189,19 @@ module.exports = { "@typescript-eslint/no-misused-promises": "off", }, }, + { + // Additional TypeScript rules for vscode-logging packages. + // TODO: clean up violations and tighten incrementally. + files: ["projects/vscode-logging/**/*.ts"], + rules: { + // public API surface (api.d.ts) intentionally exposes `any` + "@typescript-eslint/no-explicit-any": "off", + // chai assertions (e.g. expect(x).to.be.true) read as unused expressions + "@typescript-eslint/no-unused-expressions": "off", + "@typescript-eslint/no-unused-vars": "off", + "@typescript-eslint/no-unsafe-argument": "off", + }, + }, { // For Vue frontend sub-packages. files: ["*.vue"], diff --git a/projects/vscode-logging/CHANGELOG.md b/projects/vscode-logging/CHANGELOG.md new file mode 100644 index 00000000..1d0bc455 --- /dev/null +++ b/projects/vscode-logging/CHANGELOG.md @@ -0,0 +1,95 @@ +# Change Log + +> **Note:** This is the historic changelog from before vscode-logging was integrated into the app-studio-toolkit monorepo. +> Going forward, changes are tracked in the individual package changelogs under [`packages/`](./packages/). + + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [2.0.9](https://github.com/SAP/vscode-logging/compare/v2.0.8...v2.0.9) (2026-04-16) + +**Note:** Version bump only for package root + +## [2.0.8](https://github.com/SAP/vscode-logging/compare/v2.0.7...v2.0.8) (2026-02-18) + +### Bug Fixes + +- correct repository URL case (SAP instead of sap) for npm provenance ([00a91ca](https://github.com/SAP/vscode-logging/commit/00a91ca002ba88ed27278f756b7aca8865eee1ee)) + +## [2.0.7](https://github.com/SAP/vscode-logging/compare/v2.0.6...v2.0.7) (2026-02-18) + +### Bug Fixes + +- upgrade lerna to 9.0.3 for better npm trusted publishers support ([396a9f1](https://github.com/SAP/vscode-logging/commit/396a9f1ebd27dbba01d41c6b299561d849d47a5b)) + +## [2.0.6](https://github.com/SAP/vscode-logging/compare/v2.0.5...v2.0.6) (2026-02-18) + +### Bug Fixes + +- add verbose logging to lerna publish ([7330c6e](https://github.com/SAP/vscode-logging/commit/7330c6e326446f867c22ba391e79077375190d11)) + +## [2.0.5](https://github.com/SAP/vscode-logging/compare/v2.0.4...v2.0.5) (2026-02-18) + +### Bug Fixes + +- add NPM_CONFIG_PROVENANCE for trusted publishers ([10d22fa](https://github.com/SAP/vscode-logging/commit/10d22faeef072af6fdb82f344d9496979b13279e)) + +## [2.0.4](https://github.com/SAP/vscode-logging/compare/v2.0.3...v2.0.4) (2026-02-18) + +### Bug Fixes + +- add registry-url for npm trusted publishers ([6937c19](https://github.com/SAP/vscode-logging/commit/6937c1902bfed6b02527c608fd011fab102818ee)) + +## [2.0.3](https://github.com/SAP/vscode-logging/compare/v2.0.2...v2.0.3) (2026-02-17) + +### Bug Fixes + +- pnpm.lock ([#245](https://github.com/SAP/vscode-logging/issues/245)) ([cba23f4](https://github.com/SAP/vscode-logging/commit/cba23f4c6169ac48f38ca1514b94210fc6fddf2e)) + +## [2.0.2](https://github.com/SAP/vscode-logging/compare/v2.0.1...v2.0.2) (2026-02-17) + +**Note:** Version bump only for package root + +## [2.0.1](https://github.com/SAP/vscode-logging/compare/v2.0.0...v2.0.1) (2026-02-15) + +### Bug Fixes + +- examples fix ([#242](https://github.com/SAP/vscode-logging/issues/242)) ([09afea5](https://github.com/SAP/vscode-logging/commit/09afea515f76238e2761c9cf5849bda589204794)) +- upgrade lodash to version 4.17.23 ([#241](https://github.com/SAP/vscode-logging/issues/241)) ([69fc2ce](https://github.com/SAP/vscode-logging/commit/69fc2ce233e960219efca1118027638cc115874c)) +- workspace protocol ([#243](https://github.com/SAP/vscode-logging/issues/243)) ([3091351](https://github.com/SAP/vscode-logging/commit/30913512554b29590b16bce4ad2a1eb3890b5dc9)) + +# 2.0.0 (2024-01-05) + +### Bug Fixes + +- add .npmignore files to remove unneeded contents in published pkgs ([998b1f8](https://github.com/SAP/vscode-logging/commit/998b1f8341352af2bba9a640f425c66c2d3a8a74)) +- convert timestamp format according to ISO-8601 ([b4ab3e4](https://github.com/SAP/vscode-logging/commit/b4ab3e48829df42bd73c67de3f068385aabd1259)) +- source Location Tracking not affecting ChildLoggers ([72b151a](https://github.com/SAP/vscode-logging/commit/72b151a773ba2707cb131d59799389a7cfe93c85)), closes [#15](https://github.com/SAP/vscode-logging/issues/15) +- typo in the logging.level configuration description ([#181](https://github.com/SAP/vscode-logging/issues/181)) ([c05b17d](https://github.com/SAP/vscode-logging/commit/c05b17d4348e89f27a3cb86f2e20bc190cdf1afb)) +- update yarn.lock ([#144](https://github.com/SAP/vscode-logging/issues/144)) ([33ec5ac](https://github.com/SAP/vscode-logging/commit/33ec5acfda275b9717a5986012667b8e854c6c5e)) +- upgrade lodash version due to CVE-2021-23337 ([c514c16](https://github.com/SAP/vscode-logging/commit/c514c169ae5941cea9ebd5ae0dcb4eef8fc431d8)) +- **logger:** vscode-logging/types package should be a dependency ([e2ea6c7](https://github.com/SAP/vscode-logging/commit/e2ea6c7d26efed219f2b983ad7e601eeb9f4704f)) + +### Features + +- **wrapper:** remove dep to @types/vscode ([#167](https://github.com/SAP/vscode-logging/issues/167)) ([b362e5c](https://github.com/SAP/vscode-logging/commit/b362e5c3b11020ab09a5e705d7834fa53e8bd48e)) +- logger wrapper package ([#163](https://github.com/SAP/vscode-logging/issues/163)) ([fc6abc5](https://github.com/SAP/vscode-logging/commit/fc6abc5ea43403c3039edb8589c68a0a339e5ebc)) +- support console as log target ([#109](https://github.com/SAP/vscode-logging/issues/109)) ([ea16211](https://github.com/SAP/vscode-logging/commit/ea16211a5e2fbcdc86f4e96c8c60eaaf440d2431)) +- **logger:** a memory leak when creating 9 or more ChildLogger's ([#76](https://github.com/SAP/vscode-logging/issues/76)) ([482c708](https://github.com/SAP/vscode-logging/commit/482c708e9b8643849f6a14253c51650ffac70416)) +- aPI Fixes (dummy change to force minor version) ([0fb0fb6](https://github.com/SAP/vscode-logging/commit/0fb0fb624def760bb1a1cf4a7b46b18133d85cf0)) +- initial Commit ([ee780af](https://github.com/SAP/vscode-logging/commit/ee780afa90dc17cfac91a28cb2921728c1cc4489)) + +### Reverts + +- Revert "chore: include release number in release commit" ([d9d9c68](https://github.com/SAP/vscode-logging/commit/d9d9c68471476be517a06b3dd8712d573d3f7fa6)) + +* Make OutputChannel optional. (#55) ([b7fa564](https://github.com/SAP/vscode-logging/commit/b7fa56436693df9787f8ea720559beb3b0566612)), closes [#55](https://github.com/SAP/vscode-logging/issues/55) [#55](https://github.com/SAP/vscode-logging/issues/55) + +### BREAKING CHANGES + +- **wrapper:** `getConfigurations` and `onDidChangeConfiguration` properties + were removed from the `configureLogger` public API +- OutputChannel will not be created inside the logger as today. Alternatively, it + will be added as an optional parameter. The VS Code Extension will be able to create the + OutputChannel and send it to the logger as a parameter. diff --git a/projects/vscode-logging/packages/logger/nyc.config.js b/projects/vscode-logging/packages/logger/nyc.config.js new file mode 100644 index 00000000..46814df8 --- /dev/null +++ b/projects/vscode-logging/packages/logger/nyc.config.js @@ -0,0 +1,8 @@ +module.exports = { + include: ["lib/**/*.js"], + reporter: ["text", "lcov"], + // logger's tests use proxyquire; without this nyc drops the remapped + // lib/ files after remap and reports 0% (a false-green against the 100% + // gate). Mirrors the wrapper package's nyc.config.js. + excludeAfterRemap: false, +}; diff --git a/projects/vscode-logging/packages/logger/package.json b/projects/vscode-logging/packages/logger/package.json index 2b143dfd..5b53dd2d 100644 --- a/projects/vscode-logging/packages/logger/package.json +++ b/projects/vscode-logging/packages/logger/package.json @@ -13,7 +13,14 @@ "api.d.ts" ], "main": "lib/api.js", - "repository": "https://github.com/SAP/vscode-logging/", + "repository": { + "type": "git", + "url": "https://github.com/SAP/app-studio-toolkit.git", + "directory": "projects/vscode-logging/packages/logger" + }, + "bugs": { + "url": "https://github.com/SAP/app-studio-toolkit/issues" + }, "license": "Apache-2.0", "typings": "./api.d.ts", "dependencies": { @@ -43,14 +50,5 @@ }, "publishConfig": { "access": "public" - }, - "nyc": { - "include": [ - "lib/**/*.js" - ], - "reporter": [ - "text", - "lcov" - ] } } diff --git a/projects/vscode-logging/packages/logger/tsconfig.json b/projects/vscode-logging/packages/logger/tsconfig.json index 1c8d916d..73664b24 100644 --- a/projects/vscode-logging/packages/logger/tsconfig.json +++ b/projects/vscode-logging/packages/logger/tsconfig.json @@ -3,7 +3,8 @@ "module": "commonjs", "noEmit": true, "checkJs": true, - "allowJs": true + "allowJs": true, + "skipLibCheck": true }, "include": ["./lib/**/*.js", "./api.d.ts", "./test/output-channel-spec.ts"] } diff --git a/projects/vscode-logging/packages/types/package.json b/projects/vscode-logging/packages/types/package.json index 9604a150..b0677d73 100644 --- a/projects/vscode-logging/packages/types/package.json +++ b/projects/vscode-logging/packages/types/package.json @@ -11,7 +11,14 @@ "LICENSES", "api.d.ts" ], - "repository": "https://github.com/SAP/vscode-logging/", + "repository": { + "type": "git", + "url": "https://github.com/SAP/app-studio-toolkit.git", + "directory": "projects/vscode-logging/packages/types" + }, + "bugs": { + "url": "https://github.com/SAP/app-studio-toolkit/issues" + }, "license": "Apache-2.0", "typings": "./api.d.ts", "scripts": { diff --git a/projects/vscode-logging/packages/types/tsconfig.json b/projects/vscode-logging/packages/types/tsconfig.json index f56f3101..d868fba7 100644 --- a/projects/vscode-logging/packages/types/tsconfig.json +++ b/projects/vscode-logging/packages/types/tsconfig.json @@ -1,7 +1,8 @@ { "compilerOptions": { "noEmit": true, - "target": "ES2015" + "target": "ES2015", + "skipLibCheck": true }, "include": ["./"] } diff --git a/projects/vscode-logging/packages/wrapper/package.json b/projects/vscode-logging/packages/wrapper/package.json index 51aaa276..939a6f8d 100644 --- a/projects/vscode-logging/packages/wrapper/package.json +++ b/projects/vscode-logging/packages/wrapper/package.json @@ -13,7 +13,14 @@ "api.d.ts" ], "main": "dist/src/api.js", - "repository": "https://github.com/SAP/vscode-logging/", + "repository": { + "type": "git", + "url": "https://github.com/SAP/app-studio-toolkit.git", + "directory": "projects/vscode-logging/packages/wrapper" + }, + "bugs": { + "url": "https://github.com/SAP/app-studio-toolkit/issues" + }, "license": "Apache-2.0", "typings": "./api.d.ts", "dependencies": { diff --git a/projects/vscode-logging/packages/wrapper/tsconfig.json b/projects/vscode-logging/packages/wrapper/tsconfig.json index 9cfc6955..96264523 100644 --- a/projects/vscode-logging/packages/wrapper/tsconfig.json +++ b/projects/vscode-logging/packages/wrapper/tsconfig.json @@ -10,7 +10,8 @@ "declaration": true, "sourceMap": true, "forceConsistentCasingInFileNames": true, - "strict": true + "strict": true, + "skipLibCheck": true }, "include": ["./src/**/*.ts", "./test/**/*.ts", "./api.d.ts"] } From bdde785cf762f74702e236f1dc2dc18f56384c9b Mon Sep 17 00:00:00 2001 From: Jacob Kreyenbuehl Date: Fri, 21 Aug 2026 10:10:52 +0200 Subject: [PATCH 03/20] chore: reformat vscode-logging with monorepo prettier Apply app-studio-toolkit's prettier (2.4.1) to the migrated sources. This is a formatting-only commit (isolated from the logic changes) and also normalises the source line endings from CRLF to LF. Signed-off-by: Jacob Kreyenbuehl --- projects/vscode-logging/CHANGELOG.md | 1 - .../packages/logger/.mocharc.js | 2 +- .../vscode-logging/packages/logger/README.md | 2 +- .../vscode-logging/packages/logger/api.d.ts | 2 +- .../vscode-logging/packages/logger/lib/api.js | 12 ++-- .../packages/logger/lib/format.js | 6 +- .../packages/logger/lib/levels.js | 4 +- .../packages/logger/lib/logger.js | 22 +++---- .../logger/lib/transports/console-output.js | 2 +- .../logger/lib/transports/rolling-file.js | 4 +- .../lib/transports/vscode-out-channel.js | 2 +- .../packages/logger/test/api-spec.js | 2 +- .../packages/logger/test/child-logger-spec.js | 64 +++++++++---------- .../logger/test/console-output-spec.js | 24 +++---- .../packages/logger/test/levels-spec.js | 28 ++++---- .../logger/test/log-methods-apis-spec.js | 12 ++-- .../packages/logger/test/out-channel-spec.js | 16 ++--- .../packages/logger/test/rolling-file-spec.js | 12 ++-- .../logger/test/stubs/stream-roller-stub.js | 2 +- .../packages/logger/test/stubs/vscode-stub.js | 6 +- .../packages/wrapper/nyc.config.js | 4 +- .../packages/wrapper/src/api.ts | 2 +- .../packages/wrapper/src/configure-logger.ts | 14 ++-- .../packages/wrapper/src/helper-types.d.ts | 2 +- .../packages/wrapper/src/noop-logger.ts | 2 +- .../wrapper/src/settings-changes-handler.ts | 19 +++--- .../wrapper/test/configure-logger-spec.ts | 10 +-- .../packages/wrapper/test/noop-logger-spec.ts | 2 +- .../test/settings-changes-handler-spec.ts | 32 +++++----- .../packages/wrapper/test/settings-spec.ts | 18 +++--- 30 files changed, 164 insertions(+), 166 deletions(-) diff --git a/projects/vscode-logging/CHANGELOG.md b/projects/vscode-logging/CHANGELOG.md index 1d0bc455..3e69ff1e 100644 --- a/projects/vscode-logging/CHANGELOG.md +++ b/projects/vscode-logging/CHANGELOG.md @@ -3,7 +3,6 @@ > **Note:** This is the historic changelog from before vscode-logging was integrated into the app-studio-toolkit monorepo. > Going forward, changes are tracked in the individual package changelogs under [`packages/`](./packages/). - All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. diff --git a/projects/vscode-logging/packages/logger/.mocharc.js b/projects/vscode-logging/packages/logger/.mocharc.js index 7ed5916f..d67fddbd 100644 --- a/projects/vscode-logging/packages/logger/.mocharc.js +++ b/projects/vscode-logging/packages/logger/.mocharc.js @@ -5,5 +5,5 @@ chai.use(chaiExclude); module.exports = { // If coverage is enabled each test takes quite a while - timeout: 5000 + timeout: 5000, }; diff --git a/projects/vscode-logging/packages/logger/README.md b/projects/vscode-logging/packages/logger/README.md index c7922311..3f9d9cb4 100644 --- a/projects/vscode-logging/packages/logger/README.md +++ b/projects/vscode-logging/packages/logger/README.md @@ -41,7 +41,7 @@ function activate(context) { logPath: context.logPath, // The logPath is only available from the `vscode.ExtensionContext` logOutputChannel: logOutputChannel, // OutputChannel for the logger sourceLocationTracking: false, - logConsol: false // define if messages should be logged to the consol + logConsol: false, // define if messages should be logged to the consol }); extLogger.warn("Hello World"); diff --git a/projects/vscode-logging/packages/logger/api.d.ts b/projects/vscode-logging/packages/logger/api.d.ts index 167b8a21..5b05741b 100644 --- a/projects/vscode-logging/packages/logger/api.d.ts +++ b/projects/vscode-logging/packages/logger/api.d.ts @@ -7,7 +7,7 @@ import { IVSCodeExtLogger, LogLevel } from "@vscode-logging/types"; export { IVSCodeExtLogger, IChildLogger, - LogLevel + LogLevel, } from "@vscode-logging/types"; /** diff --git a/projects/vscode-logging/packages/logger/lib/api.js b/projects/vscode-logging/packages/logger/lib/api.js index 77bb8145..4337b776 100644 --- a/projects/vscode-logging/packages/logger/lib/api.js +++ b/projects/vscode-logging/packages/logger/lib/api.js @@ -16,7 +16,7 @@ const { RollingFileStream } = require("streamroller"); const { buildLoggerFormat } = require("./format"); const { VSCodeExtLogger } = require("./logger"); const { - VscodeOutChannelTransport + VscodeOutChannelTransport, } = require("./transports/vscode-out-channel"); const { RollingFileTransport } = require("./transports/rolling-file"); const { levelsConfig, isValidLogLevel, levels } = require("./levels"); @@ -53,7 +53,7 @@ function getExtensionLogger(opts) { if (opts.logOutputChannel) { transports.push( new VscodeOutChannelTransport({ - outChannel: opts.logOutputChannel + outChannel: opts.logOutputChannel, }) ); } @@ -63,7 +63,7 @@ function getExtensionLogger(opts) { new RollingFileTransport({ logPath: opts.logPath, extName: opts.extName, - RollingFileStream: RollingFileStream + RollingFileStream: RollingFileStream, }) ); } @@ -76,7 +76,7 @@ function getExtensionLogger(opts) { // - Winston does not have a minimal API to change **only** the level... level: levels.trace, format: format, - transports: transports + transports: transports, }); return new VSCodeExtLogger({ @@ -85,7 +85,7 @@ function getExtensionLogger(opts) { loggerImpel: rootWinstonLogger, outChannel: opts.logOutputChannel, sourceLocationTracking: opts.sourceLocationTracking, - consoleOutput: opts.logConsole + consoleOutput: opts.logConsole, }); } @@ -94,7 +94,7 @@ function getExtensionLogger(opts) { * @type {typeof import("../api")} */ const publicApi = { - getExtensionLogger: getExtensionLogger + getExtensionLogger: getExtensionLogger, }; module.exports = publicApi; diff --git a/projects/vscode-logging/packages/logger/lib/format.js b/projects/vscode-logging/packages/logger/lib/format.js index c68088e3..364df03c 100644 --- a/projects/vscode-logging/packages/logger/lib/format.js +++ b/projects/vscode-logging/packages/logger/lib/format.js @@ -3,7 +3,7 @@ const { MESSAGE } = require("triple-beam"); // @ts-ignore const { stableStringify } = require("fast-safe-stringify"); -const utcTimestampProp = format(info => { +const utcTimestampProp = format((info) => { // The timestamp format is according to ISO-8601 and the format is: YYYY-MM-DDTHH:mm:ss.sssZ info.time = new Date().toISOString(); @@ -11,7 +11,7 @@ const utcTimestampProp = format(info => { }); // TODO: stable json should be provided directly by winston / logForm (future versions). -const JSONStable = format(info => { +const JSONStable = format((info) => { info[MESSAGE] = stableStringify(info, null, 2); return info; }); @@ -26,5 +26,5 @@ function buildLoggerFormat(label) { } module.exports = { - buildLoggerFormat: buildLoggerFormat + buildLoggerFormat: buildLoggerFormat, }; diff --git a/projects/vscode-logging/packages/logger/lib/levels.js b/projects/vscode-logging/packages/logger/lib/levels.js index 1be0fefc..2ce055b9 100644 --- a/projects/vscode-logging/packages/logger/lib/levels.js +++ b/projects/vscode-logging/packages/logger/lib/levels.js @@ -7,7 +7,7 @@ const levelsConfig = { warn: 2, info: 3, debug: 4, - trace: 5 + trace: 5, }; const logLevelsKeys = mapValues(levelsConfig, (val, key) => key); @@ -17,5 +17,5 @@ const isValidLogLevel = partial(includes, keys(levelsConfig)); module.exports = { levelsConfig: levelsConfig, levels: logLevelsKeys, - isValidLogLevel: isValidLogLevel + isValidLogLevel: isValidLogLevel, }; diff --git a/projects/vscode-logging/packages/logger/lib/logger.js b/projects/vscode-logging/packages/logger/lib/logger.js index 4f8fd062..f3738144 100644 --- a/projects/vscode-logging/packages/logger/lib/logger.js +++ b/projects/vscode-logging/packages/logger/lib/logger.js @@ -50,8 +50,8 @@ class BaseLogger { label: newLabel, sourceLocationTracking: this[SOURCE_LOCATION_TRACKING], consoleOutput: this[CONSOLE_OUTPUT], - level: findKey(levelsConfig, val => val === this[LEVEL_INT]), - loggerImpel: this[LOGGER_IMPEL] + level: findKey(levelsConfig, (val) => val === this[LEVEL_INT]), + loggerImpel: this[LOGGER_IMPEL], }); this[CHILD_LOGGERS].set(newLabel, newChildLoggerImpel); @@ -111,28 +111,28 @@ class BaseLogger { } // private methods using Symbols to hide it, need to be added directly on the prototype -BaseLogger.prototype[CHANGE_LEVEL] = function(newLevel) { +BaseLogger.prototype[CHANGE_LEVEL] = function (newLevel) { this[LEVEL_INT] = levelsConfig[newLevel]; // @ts-ignore - forEach([...this[CHILD_LOGGERS].values()], childLogger => { + forEach([...this[CHILD_LOGGERS].values()], (childLogger) => { // Recursive Call childLogger[CHANGE_LEVEL](newLevel); }); }; // private methods using Symbols to hide it, need to be added directly on the prototype -BaseLogger.prototype[CHANGE_SOURCE_LOCATION_TRACKING] = function( +BaseLogger.prototype[CHANGE_SOURCE_LOCATION_TRACKING] = function ( isSourceLocTrack ) { this[SOURCE_LOCATION_TRACKING] = isSourceLocTrack; // @ts-ignore - forEach([...this[CHILD_LOGGERS].values()], childLogger => { + forEach([...this[CHILD_LOGGERS].values()], (childLogger) => { // Recursive Call childLogger[CHANGE_SOURCE_LOCATION_TRACKING](isSourceLocTrack); }); }; -BaseLogger.prototype[ADD_SOURCE_LOCATION_INFO] = function(args) { +BaseLogger.prototype[ADD_SOURCE_LOCATION_INFO] = function (args) { if (this[SOURCE_LOCATION_TRACKING] === true) { const stack = stacktrace.getSync(); // we need to go 2 levels up the stack to get to the end user's code @@ -142,8 +142,8 @@ BaseLogger.prototype[ADD_SOURCE_LOCATION_INFO] = function(args) { args.push({ source: { function: userFrame.functionName, - location: sourceLocMsg - } + location: sourceLocMsg, + }, }); } }; @@ -184,7 +184,7 @@ class VSCodeExtLogger extends BaseLogger { } // private method using Symbols to hide it, need to be added directly on the prototype -VSCodeExtLogger.prototype[WARN_IF_LOCATION_TRACKING_IS_ENABLED] = function() { +VSCodeExtLogger.prototype[WARN_IF_LOCATION_TRACKING_IS_ENABLED] = function () { if (this[SOURCE_LOCATION_TRACKING] === true) { this.fatal( "SourceLocationTracking is Enabled, This must only be used during debugging flows as it causes performance regressions" @@ -197,5 +197,5 @@ VSCodeExtLogger.prototype[WARN_IF_LOCATION_TRACKING_IS_ENABLED] = function() { }; module.exports = { - VSCodeExtLogger: VSCodeExtLogger + VSCodeExtLogger: VSCodeExtLogger, }; diff --git a/projects/vscode-logging/packages/logger/lib/transports/console-output.js b/projects/vscode-logging/packages/logger/lib/transports/console-output.js index c808e0b3..b6230d3c 100644 --- a/projects/vscode-logging/packages/logger/lib/transports/console-output.js +++ b/projects/vscode-logging/packages/logger/lib/transports/console-output.js @@ -35,5 +35,5 @@ class ConsoleTransport extends Transport { } module.exports = { - ConsoleTransport: ConsoleTransport + ConsoleTransport: ConsoleTransport, }; diff --git a/projects/vscode-logging/packages/logger/lib/transports/rolling-file.js b/projects/vscode-logging/packages/logger/lib/transports/rolling-file.js index 0795a8ee..596f0790 100644 --- a/projects/vscode-logging/packages/logger/lib/transports/rolling-file.js +++ b/projects/vscode-logging/packages/logger/lib/transports/rolling-file.js @@ -19,7 +19,7 @@ class RollingFileTransport extends Transport { const actualOpts = defaults(opts, { maxFiles: 10, - maxFileSize: 1024 * 1024 + maxFileSize: 1024 * 1024, }); // better safe then sorry @@ -71,5 +71,5 @@ class RollingFileTransport extends Transport { } module.exports = { - RollingFileTransport: RollingFileTransport + RollingFileTransport: RollingFileTransport, }; diff --git a/projects/vscode-logging/packages/logger/lib/transports/vscode-out-channel.js b/projects/vscode-logging/packages/logger/lib/transports/vscode-out-channel.js index 9a0b2e2a..71bfbcd1 100644 --- a/projects/vscode-logging/packages/logger/lib/transports/vscode-out-channel.js +++ b/projects/vscode-logging/packages/logger/lib/transports/vscode-out-channel.js @@ -44,5 +44,5 @@ class VscodeOutChannelTransport extends Transport { } module.exports = { - VscodeOutChannelTransport: VscodeOutChannelTransport + VscodeOutChannelTransport: VscodeOutChannelTransport, }; diff --git a/projects/vscode-logging/packages/logger/test/api-spec.js b/projects/vscode-logging/packages/logger/test/api-spec.js index ab664ba1..cc35290c 100644 --- a/projects/vscode-logging/packages/logger/test/api-spec.js +++ b/projects/vscode-logging/packages/logger/test/api-spec.js @@ -11,7 +11,7 @@ describe("VSCode Extension Logger", () => { expect(() => { getExtensionLogger({ extName: "MyExtName", - level: "error" + level: "error", }); }).to.throw("logOutputChannel, logPath and logConsole"); }); diff --git a/projects/vscode-logging/packages/logger/test/child-logger-spec.js b/projects/vscode-logging/packages/logger/test/child-logger-spec.js index 02fec053..a6fcd79e 100644 --- a/projects/vscode-logging/packages/logger/test/child-logger-spec.js +++ b/projects/vscode-logging/packages/logger/test/child-logger-spec.js @@ -18,7 +18,7 @@ describe("VSCode Extension Logger", () => { // in order to test its functionality vsCodeStub = new VSCodeStub(); const mainModuleStubbed = proxyquire("../lib/api.js", { - vscode: vsCodeStub + vscode: vsCodeStub, }); getExtensionLogger = mainModuleStubbed.getExtensionLogger; }); @@ -27,7 +27,7 @@ describe("VSCode Extension Logger", () => { const extLogger = getExtensionLogger({ extName: "MyExtName", logOutputChannel: vsCodeStub.OutputChannel, - level: "error" + level: "error", }); const childLogger = extLogger.getChildLogger({ label: "myLibName" }); @@ -40,8 +40,8 @@ describe("VSCode Extension Logger", () => { { label: "MyExtName.myLibName", level: "fatal", - message: "Oops I did it again!" - } + message: "Oops I did it again!", + }, ]); }); @@ -49,7 +49,7 @@ describe("VSCode Extension Logger", () => { const extLogger = getExtensionLogger({ extName: "MyExtName", logOutputChannel: vsCodeStub.OutputChannel, - level: "error" + level: "error", }); const childLogger = extLogger.getChildLogger({ label: "myLibName" }); @@ -68,8 +68,8 @@ describe("VSCode Extension Logger", () => { { label: "MyExtName.myLibName", level: "warn", - message: "Oops I did it again!" - } + message: "Oops I did it again!", + }, ]); }); @@ -77,12 +77,12 @@ describe("VSCode Extension Logger", () => { const extLogger = getExtensionLogger({ extName: "MyExtName", logOutputChannel: vsCodeStub.OutputChannel, - level: "info" + level: "info", }); const childLogger = extLogger.getChildLogger({ label: "myLibName" }); const grandChildLogger = childLogger.getChildLogger({ - label: "myClassName" + label: "myClassName", }); childLogger.warn("Oops I did it again!"); @@ -106,12 +106,12 @@ describe("VSCode Extension Logger", () => { const extLogger = getExtensionLogger({ extName: "MyExtName", logOutputChannel: vsCodeStub.OutputChannel, - level: "error" + level: "error", }); const childLogger = extLogger.getChildLogger({ label: "myLibName" }); const childLoggerSameLabel = extLogger.getChildLogger({ - label: "myLibName" + label: "myLibName", }); expect(childLogger).to.equal(childLoggerSameLabel); }); @@ -132,7 +132,7 @@ describe("VSCode Extension Logger", () => { const extLogger = getExtensionLogger({ extName: "MainLoggerExtension", logPath: TESTS_LOG_PATH, - level: "error" + level: "error", }); for ( @@ -141,7 +141,7 @@ describe("VSCode Extension Logger", () => { childLoggerNumber++ ) { extLogger.getChildLogger({ - label: "ChildLoggerClass" + childLoggerNumber + label: "ChildLoggerClass" + childLoggerNumber, }); } } @@ -188,7 +188,7 @@ describe("VSCode Extension Logger", () => { // in order to test its functionality vsCodeStub = new VSCodeStub(); const mainModuleStubbed = proxyquire("../lib/api.js", { - vscode: vsCodeStub + vscode: vsCodeStub, }); getExtensionLogger = mainModuleStubbed.getExtensionLogger; }); @@ -197,7 +197,7 @@ describe("VSCode Extension Logger", () => { const extLogger = getExtensionLogger({ extName: "MyExtName", logOutputChannel: vsCodeStub.OutputChannel, - level: "trace" + level: "trace", }); const classLogger = extLogger.getChildLogger({ label: "myClassName" }); @@ -210,8 +210,8 @@ describe("VSCode Extension Logger", () => { { label: "MyExtName.myClassName", level: "fatal", - message: "Oops I did it again!" - } + message: "Oops I did it again!", + }, ]); }); @@ -219,7 +219,7 @@ describe("VSCode Extension Logger", () => { const extLogger = getExtensionLogger({ extName: "MyExtName", logOutputChannel: vsCodeStub.OutputChannel, - level: "trace" + level: "trace", }); const libLogger = extLogger.getChildLogger({ label: "myLibName" }); @@ -234,8 +234,8 @@ describe("VSCode Extension Logger", () => { { label: "MyExtName.myLibName.myClassName", level: "error", - message: "Oops I did it again!" - } + message: "Oops I did it again!", + }, ]); }); @@ -243,7 +243,7 @@ describe("VSCode Extension Logger", () => { const extLogger = getExtensionLogger({ extName: "MyExtName", logOutputChannel: vsCodeStub.OutputChannel, - level: "trace" + level: "trace", }); const lib1Logger = extLogger.getChildLogger({ label: "myLib1Name" }); @@ -258,8 +258,8 @@ describe("VSCode Extension Logger", () => { { label: "MyExtName.myLib1Name.myLib2Name.myClassName", level: "warn", - message: "Oops I did it again!" - } + message: "Oops I did it again!", + }, ]); }); @@ -267,7 +267,7 @@ describe("VSCode Extension Logger", () => { const extLogger = getExtensionLogger({ extName: "MyExtName", logOutputChannel: vsCodeStub.OutputChannel, - level: "trace" + level: "trace", }); const lib1Logger = extLogger.getChildLogger({ label: "myLib1Name" }); @@ -283,15 +283,15 @@ describe("VSCode Extension Logger", () => { { label: "MyExtName.myLib1Name.myLib2Name.myLib3Name.myClassName", level: "info", - message: "Oops I did it again!" - } + message: "Oops I did it again!", + }, ]); }); it("in debug log message for extension internal library class", () => { const extLogger = getExtensionLogger({ extName: "MyExtName", logOutputChannel: vsCodeStub.OutputChannel, - level: "trace" + level: "trace", }); const lib1Logger = extLogger.getChildLogger({ label: "myLib1Name" }); @@ -309,15 +309,15 @@ describe("VSCode Extension Logger", () => { label: "MyExtName.myLib1Name.myLib2Name.myLib3Name.myLib4Name.myClassName", level: "debug", - message: "Oops I did it again!" - } + message: "Oops I did it again!", + }, ]); }); it("in trace log message for extension internal library class", () => { const extLogger = getExtensionLogger({ extName: "MyExtName", logOutputChannel: vsCodeStub.OutputChannel, - level: "trace" + level: "trace", }); const lib1Logger = extLogger.getChildLogger({ label: "myLib1Name" }); @@ -336,8 +336,8 @@ describe("VSCode Extension Logger", () => { label: "MyExtName.myLib1Name.myLib2Name.myLib3Name.myLib4Name.myLib5Name.myClassName", level: "trace", - message: "Oops I did it again!" - } + message: "Oops I did it again!", + }, ]); }); } diff --git a/projects/vscode-logging/packages/logger/test/console-output-spec.js b/projects/vscode-logging/packages/logger/test/console-output-spec.js index f178eec0..3eeec18f 100644 --- a/projects/vscode-logging/packages/logger/test/console-output-spec.js +++ b/projects/vscode-logging/packages/logger/test/console-output-spec.js @@ -11,7 +11,7 @@ const expect = chai.expect; const TESTS_LOG_PATH = resolve(__dirname, ".log-out"); -describe("VSCode Extension Logger", function() { +describe("VSCode Extension Logger", function () { let vsCodeStub; /** * @type {typeof import("../api").getExtensionLogger} @@ -22,7 +22,7 @@ describe("VSCode Extension Logger", function() { beforeEach(() => { streamRollerStub = new StreamRollerStub(); const mainModuleStubbed = proxyquire("../lib/api.js", { - streamroller: streamRollerStub + streamroller: streamRollerStub, }); getExtensionLogger = mainModuleStubbed.getExtensionLogger; errSpy = sinon.spy(console, "error"); @@ -30,18 +30,18 @@ describe("VSCode Extension Logger", function() { logSpy = sinon.spy(console, "log"); }); - afterEach(function() { + afterEach(function () { console.error.restore(); console.warn.restore(); console.log.restore(); }); - describe("Console Logging - check that the output stream match the message type and log level - error/warn/info and stdout/stderr", function() { - it("should log to console in info level", function() { + describe("Console Logging - check that the output stream match the message type and log level - error/warn/info and stdout/stderr", function () { + it("should log to console in info level", function () { const extLogger = getExtensionLogger({ extName: "MyExtName", level: "info", - logConsole: true + logConsole: true, }); extLogger.fatal("Oy Vey!"); extLogger.error("Oh Dear..."); @@ -55,11 +55,11 @@ describe("VSCode Extension Logger", function() { expect(logSpy.args[0][0]).to.include("Oh Wow..."); }); - it("should log to console in error level", function() { + it("should log to console in error level", function () { const extLogger = getExtensionLogger({ extName: "MyExtName", level: "error", - logConsole: true + logConsole: true, }); extLogger.fatal("Oy Vey!"); extLogger.error("Oh Dear..."); @@ -72,11 +72,11 @@ describe("VSCode Extension Logger", function() { expect(errSpy.args[1][0]).to.include("Oh Dear..."); }); - it("should log to console in warn level", function() { + it("should log to console in warn level", function () { const extLogger = getExtensionLogger({ extName: "MyExtName", level: "warn", - logConsole: true + logConsole: true, }); extLogger.warn("Oy Might..."); extLogger.error("Oh Dear..."); @@ -89,11 +89,11 @@ describe("VSCode Extension Logger", function() { expect(warnSpy.args[0][0]).to.include("Oy Might..."); }); - it("should not log to console when consoleOutput is false", function() { + it("should not log to console when consoleOutput is false", function () { const extLogger = getExtensionLogger({ extName: "MyExtName", logPath: TESTS_LOG_PATH, - level: "info" + level: "info", }); extLogger.fatal("Oy Vey!"); extLogger.info("Oy Wow!"); diff --git a/projects/vscode-logging/packages/logger/test/levels-spec.js b/projects/vscode-logging/packages/logger/test/levels-spec.js index 34a2f10d..2e065140 100644 --- a/projects/vscode-logging/packages/logger/test/levels-spec.js +++ b/projects/vscode-logging/packages/logger/test/levels-spec.js @@ -16,7 +16,7 @@ describe("VSCode Extension Logger", () => { // in order to test its functionality vsCodeStub = new VSCodeStub(); const mainModuleStubbed = proxyquire("../lib/api.js", { - vscode: vsCodeStub + vscode: vsCodeStub, }); getExtensionLogger = mainModuleStubbed.getExtensionLogger; }); @@ -27,7 +27,7 @@ describe("VSCode Extension Logger", () => { getExtensionLogger({ extName: "MyExtName", logOutputChannel: vsCodeStub.OutputChannel, - level: "Emergency" // This is a sysLog severity + level: "Emergency", // This is a sysLog severity }); }).to.throw("Attempt to use unknown logging level: !"); }); @@ -36,7 +36,7 @@ describe("VSCode Extension Logger", () => { const extLogger = getExtensionLogger({ extName: "MyExtName", logOutputChannel: vsCodeStub.OutputChannel, - level: "fatal" + level: "fatal", }); extLogger.changeLevel("Emergency"); @@ -56,45 +56,45 @@ describe("VSCode Extension Logger", () => { }); context("Specific logging Levels Support", () => { - const allLevelsExceptOff = pickBy(levels, levelKey => levelKey !== "off"); + const allLevelsExceptOff = pickBy(levels, (levelKey) => levelKey !== "off"); const fullExpectedLogEntries = [ { level: "fatal", - message: "fatal" + message: "fatal", }, { level: "error", - message: "error" + message: "error", }, { level: "warn", - message: "warn" + message: "warn", }, { level: "info", - message: "info" + message: "info", }, { level: "debug", - message: "debug" + message: "debug", }, { level: "trace", - message: "trace" - } + message: "trace", + }, ]; - forEach(levels, currLevel => { + forEach(levels, (currLevel) => { it(`will only log correct levels in '${currLevel}'`, () => { const extLogger = getExtensionLogger({ extName: "MyExtName", logOutputChannel: vsCodeStub.OutputChannel, - level: currLevel + level: currLevel, }); // try logging using all the possible levels - forEach(allLevelsExceptOff, level => { + forEach(allLevelsExceptOff, (level) => { extLogger[level](level); }); diff --git a/projects/vscode-logging/packages/logger/test/log-methods-apis-spec.js b/projects/vscode-logging/packages/logger/test/log-methods-apis-spec.js index 4e91cfd0..c9493430 100644 --- a/projects/vscode-logging/packages/logger/test/log-methods-apis-spec.js +++ b/projects/vscode-logging/packages/logger/test/log-methods-apis-spec.js @@ -16,7 +16,7 @@ describe("VSCode Extension extLogger", () => { // in order to test its functionality vsCodeStub = new VSCodeStub(); const mainModuleStubbed = proxyquire("../lib/api.js", { - vscode: vsCodeStub + vscode: vsCodeStub, }); getExtensionLogger = mainModuleStubbed.getExtensionLogger; }); @@ -25,7 +25,7 @@ describe("VSCode Extension extLogger", () => { const extLogger = getExtensionLogger({ extName: "MyExtName", logOutputChannel: vsCodeStub.OutputChannel, - level: "error" + level: "error", }); extLogger.fatal("hello %s and 1 + %i equals 2", "world", 1); @@ -37,7 +37,7 @@ describe("VSCode Extension extLogger", () => { const extLogger = getExtensionLogger({ extName: "MyExtName", logOutputChannel: vsCodeStub.OutputChannel, - level: "error" + level: "error", }); extLogger.fatal("hello world", { a: 666, b: "oops" }, { c: 333 }); @@ -50,7 +50,7 @@ describe("VSCode Extension extLogger", () => { it("supports combining splat and object arguments", () => { const extLogger = getExtensionLogger({ logOutputChannel: vsCodeStub.OutputChannel, - level: "error" + level: "error", }); extLogger.fatal("hello %s", "world", { a: 666, b: "oops" }, { c: 333 }); @@ -65,7 +65,7 @@ describe("VSCode Extension extLogger", () => { const extLogger = getExtensionLogger({ extName: "MyExtName", logOutputChannel: vsCodeStub.OutputChannel, - level: "error" + level: "error", }); extLogger.fatal("hello world", { label: "kuku" }); @@ -77,7 +77,7 @@ describe("VSCode Extension extLogger", () => { const extLogger = getExtensionLogger({ extName: "MyExtName", logOutputChannel: vsCodeStub.OutputChannel, - level: "error" + level: "error", }); const libLogger = extLogger.getChildLogger({ label: "MyLibName" }); const classLogger = libLogger.getChildLogger({ label: "MyClassName" }); diff --git a/projects/vscode-logging/packages/logger/test/out-channel-spec.js b/projects/vscode-logging/packages/logger/test/out-channel-spec.js index 552ba87b..6b42548f 100644 --- a/projects/vscode-logging/packages/logger/test/out-channel-spec.js +++ b/projects/vscode-logging/packages/logger/test/out-channel-spec.js @@ -16,7 +16,7 @@ describe("VSCode Extension Logger", () => { beforeEach(() => { vsCodeStub = new VSCodeStub(); const mainModuleStubbed = proxyquire("../lib/api.js", { - vscode: vsCodeStub + vscode: vsCodeStub, }); getExtensionLogger = mainModuleStubbed.getExtensionLogger; }); @@ -25,7 +25,7 @@ describe("VSCode Extension Logger", () => { const extLogger = getExtensionLogger({ extName: "MyExtName", logOutputChannel: vsCodeStub.OutputChannel, - level: "error" + level: "error", }); extLogger.fatal("Oy Vey!"); extLogger.error("Oh Dear..."); @@ -37,13 +37,13 @@ describe("VSCode Extension Logger", () => { { label: "MyExtName", level: "fatal", - message: "Oy Vey!" + message: "Oy Vey!", }, { label: "MyExtName", level: "error", - message: "Oh Dear..." - } + message: "Oh Dear...", + }, ]); }); @@ -52,7 +52,7 @@ describe("VSCode Extension Logger", () => { extName: "MyExtName", sourceLocationTracking: true, logOutputChannel: vsCodeStub.OutputChannel, - level: "error" + level: "error", }); extLogger.fatal("Oh dear"); const logEntries = map(vsCodeStub.lines, JSON.parse); @@ -76,7 +76,7 @@ describe("VSCode Extension Logger", () => { extName: "MyExtName", sourceLocationTracking: true, logOutputChannel: vsCodeStub.OutputChannel, - level: "warn" + level: "warn", }); expect(vsCodeStub.shown).to.be.true; }); @@ -85,7 +85,7 @@ describe("VSCode Extension Logger", () => { const extLogger = getExtensionLogger({ extName: "MyExtName", logOutputChannel: vsCodeStub.OutputChannel, - level: "error" + level: "error", }); expect(vsCodeStub.shown).to.be.false; extLogger.changeSourceLocationTracking(true); diff --git a/projects/vscode-logging/packages/logger/test/rolling-file-spec.js b/projects/vscode-logging/packages/logger/test/rolling-file-spec.js index 6d6f2cf7..157da1b7 100644 --- a/projects/vscode-logging/packages/logger/test/rolling-file-spec.js +++ b/projects/vscode-logging/packages/logger/test/rolling-file-spec.js @@ -21,7 +21,7 @@ describe("VSCode Extension Logger", () => { beforeEach(() => { streamRollerStub = new StreamRollerStub(); const mainModuleStubbed = proxyquire("../lib/api.js", { - streamroller: streamRollerStub + streamroller: streamRollerStub, }); getExtensionLogger = mainModuleStubbed.getExtensionLogger; }); @@ -30,7 +30,7 @@ describe("VSCode Extension Logger", () => { const extLogger = getExtensionLogger({ extName: "MyExtName", logPath: TESTS_LOG_PATH, - level: "error" + level: "error", }); extLogger.fatal("Oy Vey!"); extLogger.error("Oh Dear..."); @@ -42,13 +42,13 @@ describe("VSCode Extension Logger", () => { { label: "MyExtName", level: "fatal", - message: "Oy Vey!" + message: "Oy Vey!", }, { label: "MyExtName", level: "error", - message: "Oh Dear..." - } + message: "Oh Dear...", + }, ]); }); @@ -57,7 +57,7 @@ describe("VSCode Extension Logger", () => { extName: "MyExtName", sourceLocationTracking: true, logPath: TESTS_LOG_PATH, - level: "error" + level: "error", }); extLogger.fatal("Oy Vey!"); const logEntries = map(streamRollerStub.lines, JSON.parse); diff --git a/projects/vscode-logging/packages/logger/test/stubs/stream-roller-stub.js b/projects/vscode-logging/packages/logger/test/stubs/stream-roller-stub.js index d89d7615..a0b50cfe 100644 --- a/projects/vscode-logging/packages/logger/test/stubs/stream-roller-stub.js +++ b/projects/vscode-logging/packages/logger/test/stubs/stream-roller-stub.js @@ -20,5 +20,5 @@ class StreamRollerStub { } module.exports = { - StreamRollerStub: StreamRollerStub + StreamRollerStub: StreamRollerStub, }; diff --git a/projects/vscode-logging/packages/logger/test/stubs/vscode-stub.js b/projects/vscode-logging/packages/logger/test/stubs/vscode-stub.js index bcfc3e0a..02ab1718 100644 --- a/projects/vscode-logging/packages/logger/test/stubs/vscode-stub.js +++ b/projects/vscode-logging/packages/logger/test/stubs/vscode-stub.js @@ -9,13 +9,13 @@ class VSCodeStub { show: () => { that.shown = true; }, - appendLine: txt => { + appendLine: (txt) => { that.lines.push(txt); - } + }, }; } } module.exports = { - VSCodeStub: VSCodeStub + VSCodeStub: VSCodeStub, }; diff --git a/projects/vscode-logging/packages/wrapper/nyc.config.js b/projects/vscode-logging/packages/wrapper/nyc.config.js index 0b04fd7a..de767902 100644 --- a/projects/vscode-logging/packages/wrapper/nyc.config.js +++ b/projects/vscode-logging/packages/wrapper/nyc.config.js @@ -16,7 +16,7 @@ module.exports = { // - Implementing a test with proxyquire would not test real VSCode scenarios // - The existing `configureLogger` tests are fairly complex and we are better off avoiding duplicating them. // - See: `configure-logger-spec.ts`. - "dist/src/api.js" + "dist/src/api.js", ], - excludeAfterRemap: false + excludeAfterRemap: false, }; diff --git a/projects/vscode-logging/packages/wrapper/src/api.ts b/projects/vscode-logging/packages/wrapper/src/api.ts index 67cf0293..1ad1df7b 100644 --- a/projects/vscode-logging/packages/wrapper/src/api.ts +++ b/projects/vscode-logging/packages/wrapper/src/api.ts @@ -20,6 +20,6 @@ export function configureLogger(opts: { return configureLoggerInternal({ ...opts, getConfiguration: workspace.getConfiguration, - onDidChangeConfiguration: workspace.onDidChangeConfiguration + onDidChangeConfiguration: workspace.onDidChangeConfiguration, }); } diff --git a/projects/vscode-logging/packages/wrapper/src/configure-logger.ts b/projects/vscode-logging/packages/wrapper/src/configure-logger.ts index 314e0438..3b78025c 100644 --- a/projects/vscode-logging/packages/wrapper/src/configure-logger.ts +++ b/projects/vscode-logging/packages/wrapper/src/configure-logger.ts @@ -4,11 +4,11 @@ import { IVSCodeExtLogger } from "@vscode-logging/types"; import { ConfigureLoggerOpts } from "../api"; import { getLoggingLevelSetting, - getSourceLocationTrackingSetting + getSourceLocationTrackingSetting, } from "./settings"; import { listenToLogSettingsChanges, - logLoggerDetails + logLoggerDetails, } from "./settings-changes-handler"; export type ConfigureLoggerDIOpts = { @@ -32,12 +32,12 @@ export function configureLoggerInternal( ): IVSCodeExtLogger { const logLevelSetting = getLoggingLevelSetting({ getConfiguration: opts.getConfiguration, - loggingLevelProp: opts.loggingLevelProp + loggingLevelProp: opts.loggingLevelProp, }); const sourceLocationTrackingSettings = getSourceLocationTrackingSetting({ getConfiguration: opts.getConfiguration, - sourceLocationProp: opts.sourceLocationProp + sourceLocationProp: opts.sourceLocationProp, }); const extensionLogger = getExtensionLogger({ @@ -46,13 +46,13 @@ export function configureLoggerInternal( logPath: opts.logPath, sourceLocationTracking: sourceLocationTrackingSettings, logConsole: opts.logConsole, - logOutputChannel: opts.logOutputChannel + logOutputChannel: opts.logOutputChannel, }); logLoggerDetails({ logger: extensionLogger, logPath: opts.logPath, - logLevel: logLevelSetting + logLevel: logLevelSetting, }); listenToLogSettingsChanges({ @@ -62,7 +62,7 @@ export function configureLoggerInternal( loggingLevelProp: opts.loggingLevelProp, sourceLocationProp: opts.sourceLocationProp, logger: extensionLogger, - logPath: opts.logPath + logPath: opts.logPath, }); return extensionLogger; diff --git a/projects/vscode-logging/packages/wrapper/src/helper-types.d.ts b/projects/vscode-logging/packages/wrapper/src/helper-types.d.ts index 079b06fe..794695c5 100644 --- a/projects/vscode-logging/packages/wrapper/src/helper-types.d.ts +++ b/projects/vscode-logging/packages/wrapper/src/helper-types.d.ts @@ -1,7 +1,7 @@ import { IChildLogger, IVSCodeExtLogger, - LogLevel + LogLevel, } from "@vscode-logging/types"; // importing "vscode" in a **d.ts** files avoids a actual runtime dependency to vscode. import { ExtensionContext, workspace } from "vscode"; diff --git a/projects/vscode-logging/packages/wrapper/src/noop-logger.ts b/projects/vscode-logging/packages/wrapper/src/noop-logger.ts index b9e7cc33..89e07958 100644 --- a/projects/vscode-logging/packages/wrapper/src/noop-logger.ts +++ b/projects/vscode-logging/packages/wrapper/src/noop-logger.ts @@ -13,7 +13,7 @@ export const NOOP_LOGGER: IVSCodeExtLogger = { }, info: noop, trace: noop, - warn: noop + warn: noop, }; Object.freeze(NOOP_LOGGER); diff --git a/projects/vscode-logging/packages/wrapper/src/settings-changes-handler.ts b/projects/vscode-logging/packages/wrapper/src/settings-changes-handler.ts index 035683d5..24071cc4 100644 --- a/projects/vscode-logging/packages/wrapper/src/settings-changes-handler.ts +++ b/projects/vscode-logging/packages/wrapper/src/settings-changes-handler.ts @@ -2,7 +2,7 @@ import { LogLevel } from "@vscode-logging/types"; import { ListenToLogSettingsOpts, LogLoggerDetailsOpts } from "./helper-types"; import { getLoggingLevelSetting, - getSourceLocationTrackingSetting + getSourceLocationTrackingSetting, } from "./settings"; export function logLoggerDetails(opts: LogLoggerDetailsOpts): void { @@ -14,31 +14,30 @@ export function listenToLogSettingsChanges( opts: ListenToLogSettingsOpts ): void { opts.subscriptions.push( - opts.onDidChangeConfiguration(e => { + opts.onDidChangeConfiguration((e) => { if (e.affectsConfiguration(opts.loggingLevelProp)) { const logLevel: LogLevel = getLoggingLevelSetting({ loggingLevelProp: opts.loggingLevelProp, - getConfiguration: opts.getConfiguration + getConfiguration: opts.getConfiguration, }); opts.logger.changeLevel(logLevel); logLoggerDetails({ logger: opts.logger, logPath: opts.logPath, - logLevel + logLevel, }); } }) ); opts.subscriptions.push( - opts.onDidChangeConfiguration(e => { + opts.onDidChangeConfiguration((e) => { if (e.affectsConfiguration(opts.sourceLocationProp)) { - const newSourceLocationTracking: boolean = getSourceLocationTrackingSetting( - { + const newSourceLocationTracking: boolean = + getSourceLocationTrackingSetting({ sourceLocationProp: opts.sourceLocationProp, - getConfiguration: opts.getConfiguration - } - ); + getConfiguration: opts.getConfiguration, + }); opts.logger.changeSourceLocationTracking(newSourceLocationTracking); } }) diff --git a/projects/vscode-logging/packages/wrapper/test/configure-logger-spec.ts b/projects/vscode-logging/packages/wrapper/test/configure-logger-spec.ts index a634def6..165a299d 100644 --- a/projects/vscode-logging/packages/wrapper/test/configure-logger-spec.ts +++ b/projects/vscode-logging/packages/wrapper/test/configure-logger-spec.ts @@ -26,7 +26,7 @@ describe("The `configureLogger` main wrapper utility function", () => { loggedLines.push(JSON.parse(value)); }, dispose(): void {}, - show(): void {} + show(): void {}, }; // we are not testing configuration changes in this spec, these will be tested @@ -40,23 +40,23 @@ describe("The `configureLogger` main wrapper utility function", () => { configLogLevel = "debug"; const settingsMap = new Map([ [loggingLevelProp, configLogLevel], - [sourceLocationProp, false] + [sourceLocationProp, false], ]); // don't worry be happy (or unknown)... - getConfiguration = _ => (settingsMap as unknown) as WorkspaceConfiguration; + getConfiguration = (_) => settingsMap as unknown as WorkspaceConfiguration; }); function configureLoggerHelper(): IChildLogger { return configureLoggerInternal({ extName: "my_vscode_ext", // only logging "in memory" during our test. - logPath: (undefined as unknown) as string, + logPath: undefined as unknown as string, loggingLevelProp: "my_vscode_ext.loggingLevel", sourceLocationProp: "my_vscode_ext.sourceLocationTracking", logOutputChannel: outputChannelMock, subscriptions, getConfiguration, - onDidChangeConfiguration + onDidChangeConfiguration, }); } diff --git a/projects/vscode-logging/packages/wrapper/test/noop-logger-spec.ts b/projects/vscode-logging/packages/wrapper/test/noop-logger-spec.ts index f65df8a2..0ed8a678 100644 --- a/projects/vscode-logging/packages/wrapper/test/noop-logger-spec.ts +++ b/projects/vscode-logging/packages/wrapper/test/noop-logger-spec.ts @@ -5,7 +5,7 @@ import { noop, NOOP_LOGGER } from "../src/noop-logger"; describe("The no-operation logger", () => { const noopFuncProps = difference(keys(NOOP_LOGGER), ["getChildLogger"]); - forEach(noopFuncProps, funcPropName => { + forEach(noopFuncProps, (funcPropName) => { it(`exposes a no operation method for <${funcPropName}>`, () => { // @ts-expect-error -- runtime reflection expect(NOOP_LOGGER[funcPropName]).to.eql(noop); diff --git a/projects/vscode-logging/packages/wrapper/test/settings-changes-handler-spec.ts b/projects/vscode-logging/packages/wrapper/test/settings-changes-handler-spec.ts index 597368c2..af798965 100644 --- a/projects/vscode-logging/packages/wrapper/test/settings-changes-handler-spec.ts +++ b/projects/vscode-logging/packages/wrapper/test/settings-changes-handler-spec.ts @@ -3,7 +3,7 @@ import { ConfigurationChangeEvent, Disposable, ExtensionContext, - WorkspaceConfiguration + WorkspaceConfiguration, } from "vscode"; import { LogLevel } from "@vscode-logging/logger"; import { IChildLogger, IVSCodeExtLogger } from "@vscode-logging/types"; @@ -44,7 +44,7 @@ describe("The `listenToLogSettingsChanges` utility function", () => { warn(): void {}, info(): void {}, debug(): void {}, - trace(): void {} + trace(): void {}, }; loggingLevelProp = "my_vscode_ext.loggingLevel"; @@ -56,19 +56,19 @@ describe("The `listenToLogSettingsChanges` utility function", () => { before(() => { const settingsMap = new Map([ [loggingLevelProp, "info"], - [sourceLocationProp, true] + [sourceLocationProp, true], ]); // don't worry be happy (or unknown)... - getConfiguration = _ => - (settingsMap as unknown) as WorkspaceConfiguration; + getConfiguration = (_) => + settingsMap as unknown as WorkspaceConfiguration; - onDidChangeConfiguration = function( + onDidChangeConfiguration = function ( cb: (e: ConfigurationChangeEvent) => void ): Disposable { const e: ConfigurationChangeEvent = { affectsConfiguration(): boolean { return true; - } + }, }; cb(e); return { dispose(): any {} }; @@ -84,7 +84,7 @@ describe("The `listenToLogSettingsChanges` utility function", () => { logger, logPath, onDidChangeConfiguration, - subscriptions + subscriptions, }); expect(currentLogLevel).to.equal("info"); }); @@ -98,7 +98,7 @@ describe("The `listenToLogSettingsChanges` utility function", () => { logger, logPath, onDidChangeConfiguration, - subscriptions + subscriptions, }); expect(currentSourceLocationTracking).to.be.true; }); @@ -108,19 +108,19 @@ describe("The `listenToLogSettingsChanges` utility function", () => { before(() => { const settingsMap = new Map([ ["someOtherProp", "blue"], - ["someOtherProp2", 666] + ["someOtherProp2", 666], ]); // don't worry be happy (or unknown)... - getConfiguration = _ => - (settingsMap as unknown) as WorkspaceConfiguration; + getConfiguration = (_) => + settingsMap as unknown as WorkspaceConfiguration; - onDidChangeConfiguration = function( + onDidChangeConfiguration = function ( cb: (e: ConfigurationChangeEvent) => void ): Disposable { const e: ConfigurationChangeEvent = { affectsConfiguration(): boolean { return false; - } + }, }; cb(e); return { dispose(): any {} }; @@ -136,7 +136,7 @@ describe("The `listenToLogSettingsChanges` utility function", () => { logger, logPath, onDidChangeConfiguration, - subscriptions + subscriptions, }); expect(currentLogLevel).to.equal("error"); }); @@ -150,7 +150,7 @@ describe("The `listenToLogSettingsChanges` utility function", () => { logger, logPath, onDidChangeConfiguration, - subscriptions + subscriptions, }); expect(currentSourceLocationTracking).to.be.false; }); diff --git a/projects/vscode-logging/packages/wrapper/test/settings-spec.ts b/projects/vscode-logging/packages/wrapper/test/settings-spec.ts index 35adc4dd..9f222a60 100644 --- a/projects/vscode-logging/packages/wrapper/test/settings-spec.ts +++ b/projects/vscode-logging/packages/wrapper/test/settings-spec.ts @@ -1,7 +1,7 @@ import { expect } from "chai"; import { getLoggingLevelSetting, - getSourceLocationTrackingSetting + getSourceLocationTrackingSetting, } from "../src/settings"; import { GetLoggingLevelOpts } from "../src/helper-types"; import { WorkspaceConfiguration } from "vscode"; @@ -13,16 +13,16 @@ describe("The settings related utilities", () => { before(() => { const settingsMap = new Map([ ["ext1.loggingLevel", "debug"], - ["otherExt.loggingLevel", "info"] + ["otherExt.loggingLevel", "info"], ]); - getConfiguration = _ => - (settingsMap as unknown) as WorkspaceConfiguration; + getConfiguration = (_) => + settingsMap as unknown as WorkspaceConfiguration; }); it("Can retrieve the logging level value from a configuration", () => { const logLevel = getLoggingLevelSetting({ getConfiguration, - loggingLevelProp: "ext1.loggingLevel" + loggingLevelProp: "ext1.loggingLevel", }); expect(logLevel).to.equal("debug"); }); @@ -34,16 +34,16 @@ describe("The settings related utilities", () => { before(() => { const settingsMap = new Map([ ["ext1.sourceLocationTracking", true], - ["otherExt.sourceLocationTracking", false] + ["otherExt.sourceLocationTracking", false], ]); - getConfiguration = _ => - (settingsMap as unknown) as WorkspaceConfiguration; + getConfiguration = (_) => + settingsMap as unknown as WorkspaceConfiguration; }); it("Can retrieve the source location tracking value from a configuration", () => { const sourceLocationEnabled = getSourceLocationTrackingSetting({ getConfiguration, - sourceLocationProp: "otherExt.sourceLocationTracking" + sourceLocationProp: "otherExt.sourceLocationTracking", }); expect(sourceLocationEnabled).to.be.false; }); From ea1d1d17723c9bb8bbbd25adbb6035882e4dd6af Mon Sep 17 00:00:00 2001 From: Jacob Kreyenbuehl Date: Fri, 21 Aug 2026 10:15:27 +0200 Subject: [PATCH 04/20] chore: include projects/* coverage in merge and ignore logger test logs - scripts/merge-coverage.js: also collect projects/*/packages/*/.nyc_output so nested-project coverage (vscode-logging, yeoman-ui, vscode-mta-tools) is included in the merged report; derive the merged file name from the package path to avoid collisions between same-named packages across projects. - .gitignore: ignore logger's test/.log-out output directory. Signed-off-by: Jacob Kreyenbuehl --- .gitignore | 3 +++ scripts/merge-coverage.js | 20 ++++++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index a67ac791..8c34a9f3 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,9 @@ coverage # nyc test coverage .nyc_output +# logger test log output +.log-out + # Dependency directories node_modules/ diff --git a/scripts/merge-coverage.js b/scripts/merge-coverage.js index 96ae648e..d4f680d2 100644 --- a/scripts/merge-coverage.js +++ b/scripts/merge-coverage.js @@ -3,7 +3,7 @@ * This report will can be found at the root `coverage` dir and will also be uploaded to coveralls.io * - based on https://github.com/istanbuljs/istanbuljs/blob/1fe490e51909607137ded25b1688581c9fd926cd/monorepo-merge-reports.js */ -const { dirname, basename, join, resolve } = require("path"); +const { dirname, join, resolve } = require("path"); const { spawnSync } = require("child_process"); const rimraf = require("rimraf"); @@ -14,16 +14,20 @@ process.chdir(resolve(__dirname, "..")); rimraf.sync(".nyc_output"); makeDir.sync(".nyc_output"); -// Merge coverage data from each package so we can generate a complete reports -glob.sync("packages/*/.nyc_output").forEach((nycOutput) => { +// Merge coverage data from each package so we can generate a complete reports. +// Includes both root-level packages and packages nested under projects/*. +const nycOutputs = [ + ...glob.sync("packages/*/.nyc_output"), + ...glob.sync("projects/*/packages/*/.nyc_output"), +]; +nycOutputs.forEach((nycOutput) => { const cwd = dirname(nycOutput); + // Use the package's path (not just its basename) for the merged file name so + // same-named packages across projects (e.g. */packages/types) do not collide. + const mergedName = cwd.replace(/[\\/]/g, "__") + ".json"; const { status, stderr } = spawnSync( resolve("node_modules", ".bin", "nyc"), - [ - "merge", - ".nyc_output", - join(__dirname, "..", ".nyc_output", basename(cwd) + ".json"), - ], + ["merge", ".nyc_output", join(__dirname, "..", ".nyc_output", mergedName)], { encoding: "utf8", shell: true, From 10fbbf8c12d875ddf7a0a090ff5687348085e889 Mon Sep 17 00:00:00 2001 From: Jacob Kreyenbuehl Date: Fri, 21 Aug 2026 10:17:14 +0200 Subject: [PATCH 05/20] chore: add vscode-logging examples Bring in the extension, extension-wrapper and library example packages. Adds a projects/*/examples/* lookup pattern to pnpm-workspace.yaml and the root package.json workspaces so nested example packages are picked up by the workspace (formatting normalised in the following commit). Signed-off-by: Jacob Kreyenbuehl --- package.json | 1 + pnpm-lock.yaml | 32 +++++ pnpm-workspace.yaml | 1 + projects/vscode-logging/examples/README.md | 8 ++ .../examples/extension-wrapper/.gitignore | 2 + .../extension-wrapper/.vscode/launch.json | 17 +++ .../extension-wrapper/.vscode/settings.json | 3 + .../extension-wrapper/.vscode/tasks.json | 20 ++++ .../examples/extension-wrapper/CHANGELOG.md | 86 ++++++++++++++ .../examples/extension-wrapper/README.md | 35 ++++++ .../examples/extension-wrapper/package.json | 62 ++++++++++ .../extension-wrapper/src/commands.ts | 20 ++++ .../extension-wrapper/src/extension.ts | 9 ++ .../examples/extension-wrapper/src/logger.ts | 54 +++++++++ .../examples/extension-wrapper/tsconfig.json | 16 +++ .../examples/extension/.gitignore | 2 + .../examples/extension/.vscode/launch.json | 28 +++++ .../examples/extension/.vscode/settings.json | 3 + .../examples/extension/.vscode/tasks.json | 20 ++++ .../examples/extension/CHANGELOG.md | 111 ++++++++++++++++++ .../examples/extension/README.md | 39 ++++++ .../examples/extension/lib/commands.js | 28 +++++ .../examples/extension/lib/extension.js | 70 +++++++++++ .../examples/extension/lib/logger-wrapper.js | 37 ++++++ .../lib/passing-logger-to-library.js | 22 ++++ .../extension/lib/settings-changes-handler.js | 45 +++++++ .../examples/extension/lib/settings.js | 28 +++++ .../examples/extension/package.json | 58 +++++++++ .../examples/library/CHANGELOG.md | 67 +++++++++++ .../vscode-logging/examples/library/README.md | 9 ++ .../vscode-logging/examples/library/index.js | 51 ++++++++ .../examples/library/package.json | 12 ++ 32 files changed, 996 insertions(+) create mode 100644 projects/vscode-logging/examples/README.md create mode 100644 projects/vscode-logging/examples/extension-wrapper/.gitignore create mode 100644 projects/vscode-logging/examples/extension-wrapper/.vscode/launch.json create mode 100644 projects/vscode-logging/examples/extension-wrapper/.vscode/settings.json create mode 100644 projects/vscode-logging/examples/extension-wrapper/.vscode/tasks.json create mode 100644 projects/vscode-logging/examples/extension-wrapper/CHANGELOG.md create mode 100644 projects/vscode-logging/examples/extension-wrapper/README.md create mode 100644 projects/vscode-logging/examples/extension-wrapper/package.json create mode 100644 projects/vscode-logging/examples/extension-wrapper/src/commands.ts create mode 100644 projects/vscode-logging/examples/extension-wrapper/src/extension.ts create mode 100644 projects/vscode-logging/examples/extension-wrapper/src/logger.ts create mode 100644 projects/vscode-logging/examples/extension-wrapper/tsconfig.json create mode 100644 projects/vscode-logging/examples/extension/.gitignore create mode 100644 projects/vscode-logging/examples/extension/.vscode/launch.json create mode 100644 projects/vscode-logging/examples/extension/.vscode/settings.json create mode 100644 projects/vscode-logging/examples/extension/.vscode/tasks.json create mode 100644 projects/vscode-logging/examples/extension/CHANGELOG.md create mode 100644 projects/vscode-logging/examples/extension/README.md create mode 100644 projects/vscode-logging/examples/extension/lib/commands.js create mode 100644 projects/vscode-logging/examples/extension/lib/extension.js create mode 100644 projects/vscode-logging/examples/extension/lib/logger-wrapper.js create mode 100644 projects/vscode-logging/examples/extension/lib/passing-logger-to-library.js create mode 100644 projects/vscode-logging/examples/extension/lib/settings-changes-handler.js create mode 100644 projects/vscode-logging/examples/extension/lib/settings.js create mode 100644 projects/vscode-logging/examples/extension/package.json create mode 100644 projects/vscode-logging/examples/library/CHANGELOG.md create mode 100644 projects/vscode-logging/examples/library/README.md create mode 100644 projects/vscode-logging/examples/library/index.js create mode 100644 projects/vscode-logging/examples/library/package.json diff --git a/package.json b/package.json index 39adc762..f0ebe102 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "packages/*", "projects/*/packages/*", "projects/*", + "projects/*/examples/*", "examples/*" ] }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4bca9ea7..d370010d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -570,6 +570,38 @@ importers: specifier: 27.5.1 version: 27.5.1(bufferutil@4.1.0)(ts-node@10.9.2(@types/node@25.9.1)(typescript@5.7.3))(utf-8-validate@5.0.10) + projects/vscode-logging/examples/extension: + dependencies: + '@vscode-logging/library-example': + specifier: workspace:* + version: link:../library + '@vscode-logging/logger': + specifier: workspace:^ + version: link:../../packages/logger + devDependencies: + '@types/vscode': + specifier: ^1.32.0 + version: 1.75.0 + + projects/vscode-logging/examples/extension-wrapper: + dependencies: + '@vscode-logging/wrapper': + specifier: workspace:^ + version: link:../../packages/wrapper + devDependencies: + '@types/vscode': + specifier: ^1.52.0 + version: 1.75.0 + '@vscode-logging/types': + specifier: workspace:^ + version: link:../../packages/types + + projects/vscode-logging/examples/library: + devDependencies: + '@vscode-logging/types': + specifier: workspace:^ + version: link:../../packages/types + projects/vscode-logging/packages/logger: dependencies: '@vscode-logging/types': diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 0f99124a..ee9eec33 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -2,6 +2,7 @@ packages: - 'packages/*' - 'projects/*/packages/*' - 'projects/*' + - 'projects/*/examples/*' - 'examples/*' overrides: 'mem-fs': '4.1.4' diff --git a/projects/vscode-logging/examples/README.md b/projects/vscode-logging/examples/README.md new file mode 100644 index 00000000..eca6d9c2 --- /dev/null +++ b/projects/vscode-logging/examples/README.md @@ -0,0 +1,8 @@ +# @vscode-logging/examples + +This directory contains examples of using @vscode-logging packages + +The Examples: + +- [Integration into a VSCode Extension Example](./extension) +- [Using a @vscode-logging/logger in a "regular" npm library consumed by a VSCode Extension](./library) diff --git a/projects/vscode-logging/examples/extension-wrapper/.gitignore b/projects/vscode-logging/examples/extension-wrapper/.gitignore new file mode 100644 index 00000000..aeee7322 --- /dev/null +++ b/projects/vscode-logging/examples/extension-wrapper/.gitignore @@ -0,0 +1,2 @@ +node_modules +*.vsix diff --git a/projects/vscode-logging/examples/extension-wrapper/.vscode/launch.json b/projects/vscode-logging/examples/extension-wrapper/.vscode/launch.json new file mode 100644 index 00000000..c3b3cbbc --- /dev/null +++ b/projects/vscode-logging/examples/extension-wrapper/.vscode/launch.json @@ -0,0 +1,17 @@ +// A launch configuration that compiles the extension and then opens it inside a new window +// Use IntelliSense to learn about possible attributes. +// Hover to view descriptions of existing attributes. +// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Run Extension", + "type": "extensionHost", + "request": "launch", + "runtimeExecutable": "${execPath}", + "args": ["--extensionDevelopmentPath=${workspaceFolder}"], + "outFiles": ["${workspaceFolder}/dist/src/**/*.js"] + } + ] +} diff --git a/projects/vscode-logging/examples/extension-wrapper/.vscode/settings.json b/projects/vscode-logging/examples/extension-wrapper/.vscode/settings.json new file mode 100644 index 00000000..194c9b6b --- /dev/null +++ b/projects/vscode-logging/examples/extension-wrapper/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "editor.insertSpaces": false +} diff --git a/projects/vscode-logging/examples/extension-wrapper/.vscode/tasks.json b/projects/vscode-logging/examples/extension-wrapper/.vscode/tasks.json new file mode 100644 index 00000000..078ff7e0 --- /dev/null +++ b/projects/vscode-logging/examples/extension-wrapper/.vscode/tasks.json @@ -0,0 +1,20 @@ +// See https://go.microsoft.com/fwlink/?LinkId=733558 +// for the documentation about the tasks.json format +{ + "version": "2.0.0", + "tasks": [ + { + "type": "npm", + "script": "watch", + "problemMatcher": "$tsc-watch", + "isBackground": true, + "presentation": { + "reveal": "never" + }, + "group": { + "kind": "build", + "isDefault": true + } + } + ] +} diff --git a/projects/vscode-logging/examples/extension-wrapper/CHANGELOG.md b/projects/vscode-logging/examples/extension-wrapper/CHANGELOG.md new file mode 100644 index 00000000..6651b6d9 --- /dev/null +++ b/projects/vscode-logging/examples/extension-wrapper/CHANGELOG.md @@ -0,0 +1,86 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [2.0.9](https://github.com/SAP/vscode-logging/compare/v2.0.8...v2.0.9) (2026-04-16) + +**Note:** Version bump only for package vscode-logging-extension-wrapper-example + +## [2.0.8](https://github.com/SAP/vscode-logging/compare/v2.0.7...v2.0.8) (2026-02-18) + +**Note:** Version bump only for package vscode-logging-extension-wrapper-example + +## [2.0.7](https://github.com/SAP/vscode-logging/compare/v2.0.6...v2.0.7) (2026-02-18) + +**Note:** Version bump only for package vscode-logging-extension-wrapper-example + +## [2.0.6](https://github.com/SAP/vscode-logging/compare/v2.0.5...v2.0.6) (2026-02-18) + +**Note:** Version bump only for package vscode-logging-extension-wrapper-example + +## [2.0.5](https://github.com/SAP/vscode-logging/compare/v2.0.4...v2.0.5) (2026-02-18) + +**Note:** Version bump only for package vscode-logging-extension-wrapper-example + +## [2.0.4](https://github.com/SAP/vscode-logging/compare/v2.0.3...v2.0.4) (2026-02-18) + +**Note:** Version bump only for package vscode-logging-extension-wrapper-example + +## [2.0.3](https://github.com/SAP/vscode-logging/compare/v2.0.2...v2.0.3) (2026-02-17) + +**Note:** Version bump only for package vscode-logging-extension-wrapper-example + +## [2.0.2](https://github.com/SAP/vscode-logging/compare/v2.0.1...v2.0.2) (2026-02-17) + +**Note:** Version bump only for package vscode-logging-extension-wrapper-example + +## [2.0.1](https://github.com/SAP/vscode-logging/compare/v2.0.0...v2.0.1) (2026-02-15) + +### Bug Fixes + +- examples fix ([#242](https://github.com/SAP/vscode-logging/issues/242)) ([09afea5](https://github.com/SAP/vscode-logging/commit/09afea515f76238e2761c9cf5849bda589204794)) +- workspace protocol ([#243](https://github.com/SAP/vscode-logging/issues/243)) ([3091351](https://github.com/SAP/vscode-logging/commit/30913512554b29590b16bce4ad2a1eb3890b5dc9)) + +# 2.0.0 (2024-01-05) + +### Bug Fixes + +- typo in the logging.level configuration description ([#181](https://github.com/SAP/vscode-logging/issues/181)) ([c05b17d](https://github.com/SAP/vscode-logging/commit/c05b17d4348e89f27a3cb86f2e20bc190cdf1afb)) + +### Features + +- **wrapper:** remove dep to @types/vscode ([#167](https://github.com/SAP/vscode-logging/issues/167)) ([b362e5c](https://github.com/SAP/vscode-logging/commit/b362e5c3b11020ab09a5e705d7834fa53e8bd48e)) +- logger wrapper package ([#163](https://github.com/SAP/vscode-logging/issues/163)) ([fc6abc5](https://github.com/SAP/vscode-logging/commit/fc6abc5ea43403c3039edb8589c68a0a339e5ebc)) + +### BREAKING CHANGES + +- **wrapper:** `getConfigurations` and `onDidChangeConfiguration` properties + were removed from the `configureLogger` public API + +## [1.0.2](https://github.com/SAP/vscode-logging/compare/vscode-logging-extension-wrapper-example@1.0.1...vscode-logging-extension-wrapper-example@1.0.2) (2021-09-12) + +**Note:** Version bump only for package vscode-logging-extension-wrapper-example + +## [1.0.1](https://github.com/SAP/vscode-logging/compare/vscode-logging-extension-wrapper-example@1.0.0...vscode-logging-extension-wrapper-example@1.0.1) (2021-04-13) + +### Bug Fixes + +- typo in the logging.level configuration description ([#181](https://github.com/SAP/vscode-logging/issues/181)) ([c05b17d](https://github.com/SAP/vscode-logging/commit/c05b17d4348e89f27a3cb86f2e20bc190cdf1afb)) + +# [1.0.0](https://github.com/SAP/vscode-logging/compare/vscode-logging-extension-wrapper-example@0.2.0...vscode-logging-extension-wrapper-example@1.0.0) (2021-02-10) + +### Features + +- **wrapper:** remove dep to @types/vscode ([#167](https://github.com/SAP/vscode-logging/issues/167)) ([b362e5c](https://github.com/SAP/vscode-logging/commit/b362e5c3b11020ab09a5e705d7834fa53e8bd48e)) + +### BREAKING CHANGES + +- **wrapper:** `getConfigurations` and `onDidChangeConfiguration` properties + were removed from the `configureLogger` public API + +# 0.2.0 (2021-02-07) + +### Features + +- logger wrapper package ([#163](https://github.com/SAP/vscode-logging/issues/163)) ([fc6abc5](https://github.com/SAP/vscode-logging/commit/fc6abc5ea43403c3039edb8589c68a0a339e5ebc)) diff --git a/projects/vscode-logging/examples/extension-wrapper/README.md b/projects/vscode-logging/examples/extension-wrapper/README.md new file mode 100644 index 00000000..c0f89ca6 --- /dev/null +++ b/projects/vscode-logging/examples/extension-wrapper/README.md @@ -0,0 +1,35 @@ +# @vscode-logging Extension-Wrapper Example + +This folder contains a sample VS code extension that demonstrates +how to integrate @vscode-logging/**wrapper** in a VSCode extension. + +## Running the Sample + +### Initial setup (once) + +- `yarn` in this repository's **root**. + +### Run/Debug the Example Extension in VSCode + +- Open this example folder in VSCode. +- Press F5 in VSCode to start the example Extension. + +### Basic logging flow + +- Activate the **Hello World Command**: `View Menu -> Command Palette -> Hello World` +- Open the **Output Panel**: `View Menu -> Output` +- Switch to the `logging-wrapper-example` output Channel using the dropdown. +- Inspect the output channel log and note that the location of the log **Files** was written. +- Inspect the contents of the log files using your favorite file system explorer. + +### Changing logging Configuration. + +- Open the **Settings Page**: `File -> Preferences -> Settings` +- Locate the **Example_Logging: Logging Level** configuration. +- Play with these settings and inspect how the logging output changes. + +## Points of Interest in this Example: + +- [extension.ts](./src/extension.ts) - `configureLogger` API invocation (inside `activate` function). +- [logger.ts](./src/logger.ts) - State management for the logger instance. +- [commands.ts](./src/commands.ts) - The implementation of the `Hello World` Command. diff --git a/projects/vscode-logging/examples/extension-wrapper/package.json b/projects/vscode-logging/examples/extension-wrapper/package.json new file mode 100644 index 00000000..9a33048b --- /dev/null +++ b/projects/vscode-logging/examples/extension-wrapper/package.json @@ -0,0 +1,62 @@ +{ + "name": "vscode-logging-extension-wrapper-example", + "private": true, + "displayName": "logging-wrapper-example", + "description": "Example using @vscode-logging/logger and @vscode-logging/wrapper in a VSCode Extension", + "version": "2.0.9", + "publisher": "SAP", + "engines": { + "vscode": "^1.52.0" + }, + "activationEvents": [ + "onCommand:extension.helloWorld" + ], + "main": "./dist/src/extension.js", + "scripts": { + "ci": "npm-run-all clean compile", + "clean": "rimraf dist", + "compile": "tsc" + }, + "contributes": { + "commands": [ + { + "command": "extension.helloWorld", + "title": "Hello World" + } + ], + "configuration": { + "type": "object", + "title": "Example_Logging", + "properties": { + "Example_Logging.loggingLevel": { + "type": "string", + "enum": [ + "off", + "fatal", + "error", + "warn", + "info", + "debug", + "trace" + ], + "default": "error", + "description": "The verbosity of logging. The Order is off < fatal < error < warn < info < debug < trace.", + "scope": "window" + }, + "Example_Logging.sourceLocationTracking": { + "type": "boolean", + "default": false, + "description": "Should Source Code Location Info be added to log entries, DANGER - May be very slow, only use in debugging scenarios", + "scope": "window" + } + } + } + }, + "dependencies": { + "@vscode-logging/wrapper": "workspace:^" + }, + "devDependencies": { + "@types/vscode": "^1.52.0", + "@vscode-logging/types": "workspace:^" + } +} diff --git a/projects/vscode-logging/examples/extension-wrapper/src/commands.ts b/projects/vscode-logging/examples/extension-wrapper/src/commands.ts new file mode 100644 index 00000000..475d67f8 --- /dev/null +++ b/projects/vscode-logging/examples/extension-wrapper/src/commands.ts @@ -0,0 +1,20 @@ +import { ExtensionContext, commands, window } from "vscode"; +import { getLogger } from "./logger"; + +export function registerCommands( + subscriptions: ExtensionContext["subscriptions"] +): void { + let logMessagesCounter = 1; + const commandSubscription = commands.registerCommand( + "extension.helloWorld", + // By providing a real function name rather than a `fat arrow` ( ()=>{} ) + // The `sourceLocationTracking` can provide a meaningful output. + function registerCallback() { + window.showInformationMessage("Hello Cruel World!"); + getLogger().error( + `Hip Hip Hurray, the Command was executed! counter: <${logMessagesCounter++}>` + ); + } + ); + subscriptions.push(commandSubscription); +} diff --git a/projects/vscode-logging/examples/extension-wrapper/src/extension.ts b/projects/vscode-logging/examples/extension-wrapper/src/extension.ts new file mode 100644 index 00000000..ea844f1b --- /dev/null +++ b/projects/vscode-logging/examples/extension-wrapper/src/extension.ts @@ -0,0 +1,9 @@ +import { ExtensionContext } from "vscode"; +import { getLogger, initLogger } from "./logger"; +import { registerCommands } from "./commands"; + +export async function activate(context: ExtensionContext): Promise { + await initLogger(context); + registerCommands(context.subscriptions); + getLogger().info("extension is active, hip hip hurray!"); +} diff --git a/projects/vscode-logging/examples/extension-wrapper/src/logger.ts b/projects/vscode-logging/examples/extension-wrapper/src/logger.ts new file mode 100644 index 00000000..30d44b85 --- /dev/null +++ b/projects/vscode-logging/examples/extension-wrapper/src/logger.ts @@ -0,0 +1,54 @@ +/** + * This file manages the logger's state. + */ +import { readFile as readFileCallback } from "fs"; +import { promisify } from "util"; +import { resolve } from "path"; +import { ok } from "assert"; +import { ExtensionContext, window } from "vscode"; +import { IChildLogger, IVSCodeExtLogger } from "@vscode-logging/types"; +import { configureLogger, NOOP_LOGGER } from "@vscode-logging/wrapper"; + +const readFile = promisify(readFileCallback); + +// On file load we initialize our logger to `NOOP_LOGGER` +// this is done because the "real" logger cannot be initialized during file load. +// only once the `activate` function has been called in extension.ts +// as the `ExtensionContext` argument to `activate` contains the required `logPath` +let loggerImpel: IVSCodeExtLogger = NOOP_LOGGER; + +export function getLogger(): IChildLogger { + return loggerImpel; +} + +function setLogger(newLogger: IVSCodeExtLogger): void { + loggerImpel = newLogger; +} + +const LOGGING_LEVEL_PROP = "Example_Logging.loggingLevel"; +const SOURCE_LOCATION_PROP = "Example_Logging.sourceLocationTracking"; + +export async function initLogger(context: ExtensionContext): Promise { + const meta = JSON.parse( + await readFile(resolve(context.extensionPath, "package.json"), "utf8") + ); + + // By asserting the existence of the properties in the package.json + // at runtime, we avoid many copy-pasta mistakes... + const configProps = meta?.contributes?.configuration?.properties; + ok(configProps?.[LOGGING_LEVEL_PROP]); + ok(configProps?.[SOURCE_LOCATION_PROP]); + + const extLogger = configureLogger({ + extName: meta.displayName, + logPath: context.logPath, + logOutputChannel: window.createOutputChannel(meta.displayName), + // set to `true` if you also want your VSCode extension to log to the console. + logConsole: false, + loggingLevelProp: LOGGING_LEVEL_PROP, + sourceLocationProp: SOURCE_LOCATION_PROP, + subscriptions: context.subscriptions + }); + + setLogger(extLogger); +} diff --git a/projects/vscode-logging/examples/extension-wrapper/tsconfig.json b/projects/vscode-logging/examples/extension-wrapper/tsconfig.json new file mode 100644 index 00000000..c26e2112 --- /dev/null +++ b/projects/vscode-logging/examples/extension-wrapper/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compileOnSave": true, + "compilerOptions": { + "rootDir": ".", + "outDir": "dist", + "baseUrl": ".", + "module": "commonjs", + "lib": ["es7"], + "target": "es2017", + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "strict": true + }, + "include": ["./src/**/*.ts", "./api.d.ts"] +} diff --git a/projects/vscode-logging/examples/extension/.gitignore b/projects/vscode-logging/examples/extension/.gitignore new file mode 100644 index 00000000..aeee7322 --- /dev/null +++ b/projects/vscode-logging/examples/extension/.gitignore @@ -0,0 +1,2 @@ +node_modules +*.vsix diff --git a/projects/vscode-logging/examples/extension/.vscode/launch.json b/projects/vscode-logging/examples/extension/.vscode/launch.json new file mode 100644 index 00000000..c475e619 --- /dev/null +++ b/projects/vscode-logging/examples/extension/.vscode/launch.json @@ -0,0 +1,28 @@ +// A launch configuration that compiles the extension and then opens it inside a new window +// Use IntelliSense to learn about possible attributes. +// Hover to view descriptions of existing attributes. +// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Run Extension", + "type": "extensionHost", + "request": "launch", + "runtimeExecutable": "${execPath}", + "args": ["--extensionDevelopmentPath=${workspaceFolder}"], + "outFiles": ["${workspaceFolder}/lib/**/*.js"] + }, + { + "name": "Run Extension Tests", + "type": "extensionHost", + "request": "launch", + "runtimeExecutable": "${execPath}", + "args": [ + "--extensionDevelopmentPath=${workspaceFolder}", + "--extensionTestsPath=${workspaceFolder}/test" + ], + "outFiles": ["${workspaceFolder}/test/**/*.js"] + } + ] +} diff --git a/projects/vscode-logging/examples/extension/.vscode/settings.json b/projects/vscode-logging/examples/extension/.vscode/settings.json new file mode 100644 index 00000000..194c9b6b --- /dev/null +++ b/projects/vscode-logging/examples/extension/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "editor.insertSpaces": false +} diff --git a/projects/vscode-logging/examples/extension/.vscode/tasks.json b/projects/vscode-logging/examples/extension/.vscode/tasks.json new file mode 100644 index 00000000..078ff7e0 --- /dev/null +++ b/projects/vscode-logging/examples/extension/.vscode/tasks.json @@ -0,0 +1,20 @@ +// See https://go.microsoft.com/fwlink/?LinkId=733558 +// for the documentation about the tasks.json format +{ + "version": "2.0.0", + "tasks": [ + { + "type": "npm", + "script": "watch", + "problemMatcher": "$tsc-watch", + "isBackground": true, + "presentation": { + "reveal": "never" + }, + "group": { + "kind": "build", + "isDefault": true + } + } + ] +} diff --git a/projects/vscode-logging/examples/extension/CHANGELOG.md b/projects/vscode-logging/examples/extension/CHANGELOG.md new file mode 100644 index 00000000..e909a226 --- /dev/null +++ b/projects/vscode-logging/examples/extension/CHANGELOG.md @@ -0,0 +1,111 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [2.0.9](https://github.com/SAP/vscode-logging/compare/v2.0.8...v2.0.9) (2026-04-16) + +**Note:** Version bump only for package vscode-logging-extension-example + +## [2.0.8](https://github.com/SAP/vscode-logging/compare/v2.0.7...v2.0.8) (2026-02-18) + +**Note:** Version bump only for package vscode-logging-extension-example + +## [2.0.7](https://github.com/SAP/vscode-logging/compare/v2.0.6...v2.0.7) (2026-02-18) + +**Note:** Version bump only for package vscode-logging-extension-example + +## [2.0.6](https://github.com/SAP/vscode-logging/compare/v2.0.5...v2.0.6) (2026-02-18) + +**Note:** Version bump only for package vscode-logging-extension-example + +## [2.0.5](https://github.com/SAP/vscode-logging/compare/v2.0.4...v2.0.5) (2026-02-18) + +**Note:** Version bump only for package vscode-logging-extension-example + +## [2.0.4](https://github.com/SAP/vscode-logging/compare/v2.0.3...v2.0.4) (2026-02-18) + +**Note:** Version bump only for package vscode-logging-extension-example + +## [2.0.3](https://github.com/SAP/vscode-logging/compare/v2.0.2...v2.0.3) (2026-02-17) + +**Note:** Version bump only for package vscode-logging-extension-example + +## [2.0.2](https://github.com/SAP/vscode-logging/compare/v2.0.1...v2.0.2) (2026-02-17) + +**Note:** Version bump only for package vscode-logging-extension-example + +## [2.0.1](https://github.com/SAP/vscode-logging/compare/v2.0.0...v2.0.1) (2026-02-15) + +### Bug Fixes + +- examples fix ([#242](https://github.com/SAP/vscode-logging/issues/242)) ([09afea5](https://github.com/SAP/vscode-logging/commit/09afea515f76238e2761c9cf5849bda589204794)) +- upgrade lodash to version 4.17.23 ([#241](https://github.com/SAP/vscode-logging/issues/241)) ([69fc2ce](https://github.com/SAP/vscode-logging/commit/69fc2ce233e960219efca1118027638cc115874c)) +- workspace protocol ([#243](https://github.com/SAP/vscode-logging/issues/243)) ([3091351](https://github.com/SAP/vscode-logging/commit/30913512554b29590b16bce4ad2a1eb3890b5dc9)) + +# 2.0.0 (2024-01-05) + +### Bug Fixes + +- typo in the logging.level configuration description ([#181](https://github.com/SAP/vscode-logging/issues/181)) ([c05b17d](https://github.com/SAP/vscode-logging/commit/c05b17d4348e89f27a3cb86f2e20bc190cdf1afb)) + +### Features + +- initial Commit ([ee780af](https://github.com/SAP/vscode-logging/commit/ee780afa90dc17cfac91a28cb2921728c1cc4489)) +- support console as log target ([#109](https://github.com/SAP/vscode-logging/issues/109)) ([ea16211](https://github.com/SAP/vscode-logging/commit/ea16211a5e2fbcdc86f4e96c8c60eaaf440d2431)) + +* Make OutputChannel optional. (#55) ([b7fa564](https://github.com/SAP/vscode-logging/commit/b7fa56436693df9787f8ea720559beb3b0566612)), closes [#55](https://github.com/SAP/vscode-logging/issues/55) [#55](https://github.com/SAP/vscode-logging/issues/55) + +### BREAKING CHANGES + +- OutputChannel will not be created inside the logger as today. Alternatively, it + will be added as an optional parameter. The VS Code Extension will be able to create the + OutputChannel and send it to the logger as a parameter. + +## [1.1.3](https://github.com/SAP/vscode-logging/compare/vscode-logging-extension-example@1.1.2...vscode-logging-extension-example@1.1.3) (2021-04-13) + +### Bug Fixes + +- typo in the logging.level configuration description ([#181](https://github.com/SAP/vscode-logging/issues/181)) ([c05b17d](https://github.com/SAP/vscode-logging/commit/c05b17d4348e89f27a3cb86f2e20bc190cdf1afb)) + +## [1.1.2](https://github.com/SAP/vscode-logging/compare/vscode-logging-extension-example@1.1.1...vscode-logging-extension-example@1.1.2) (2020-12-10) + +**Note:** Version bump only for package vscode-logging-extension-example + +## [1.1.1](https://github.com/SAP/vscode-logging/compare/vscode-logging-extension-example@1.1.0...vscode-logging-extension-example@1.1.1) (2020-11-12) + +**Note:** Version bump only for package vscode-logging-extension-example + +# [1.1.0](https://github.com/SAP/vscode-logging/compare/vscode-logging-extension-example@1.0.1...vscode-logging-extension-example@1.1.0) (2020-07-29) + +### Features + +- support console as log target ([#109](https://github.com/SAP/vscode-logging/issues/109)) ([ea16211](https://github.com/SAP/vscode-logging/commit/ea16211a5e2fbcdc86f4e96c8c60eaaf440d2431)) + +## [1.0.1](https://github.com/SAP/vscode-logging/compare/vscode-logging-extension-example@1.0.0...vscode-logging-extension-example@1.0.1) (2020-05-21) + +**Note:** Version bump only for package vscode-logging-extension-example + +# [1.0.0](https://github.com/SAP/vscode-logging/compare/vscode-logging-extension-example@0.1.2...vscode-logging-extension-example@1.0.0) (2020-04-16) + +- Make OutputChannel optional. (#55) ([b7fa564](https://github.com/SAP/vscode-logging/commit/b7fa56436693df9787f8ea720559beb3b0566612)), closes [#55](https://github.com/SAP/vscode-logging/issues/55) [#55](https://github.com/SAP/vscode-logging/issues/55) + +### BREAKING CHANGES + +- OutputChannel will not be created inside the logger as today. Alternatively, it + will be added as an optional parameter. The VS Code Extension will be able to create the + OutputChannel and send it to the logger as a parameter. + +## [0.1.2](https://github.com/SAP/vscode-logging/compare/vscode-logging-extension-example@0.1.1...vscode-logging-extension-example@0.1.2) (2020-02-19) + +**Note:** Version bump only for package vscode-logging-extension-example + +## [0.1.1](https://github.com/SAP/vscode-logging/compare/vscode-logging-extension-example@0.1.0...vscode-logging-extension-example@0.1.1) (2020-01-20) + +**Note:** Version bump only for package vscode-logging-extension-example + +# 0.1.0 (2020-01-14) + +### Features + +- initial Commit ([ee780af](https://github.com/SAP/vscode-logging/commit/ee780afa90dc17cfac91a28cb2921728c1cc4489)) diff --git a/projects/vscode-logging/examples/extension/README.md b/projects/vscode-logging/examples/extension/README.md new file mode 100644 index 00000000..09e659ac --- /dev/null +++ b/projects/vscode-logging/examples/extension/README.md @@ -0,0 +1,39 @@ +# @vscode-logging Extension Example + +This folder contains a sample VS code extension that demonstrates +how to integrate @vscode-logging/logger in a VSCode extension. + +## Running the Sample + +### Initial setup (once) + +- `yarn` in this repository's **root**. + +### Run/Debug the Example Extension in VSCode + +- Open this example folder in VSCode. +- Press F5 in VSCode to start the example Extension. + +### Basic logging flow + +- Activate the **Hello World Command**: `View Menu -> Command Palette -> Hello World` +- Open the **Output Panel**: `View Menu -> Output` +- Switch to the `vscode-logging-extension-example` output Channel using the dropdown. +- Inspect the output channel log and note that the location of the log **Files** was written. +- Inspect the contents of the log files using your favorite file system explorer. + +### Changing logging Configuration. + +- Open the **Settings Page**: `File -> Preferences -> Settings` +- Locate the **Example_Logging: Logging Level** configuration. +- Play with these settings and inspect how the logging output changes. + +## Points of Interest in this Example: + +- [extension.js](./lib/extension.js) - The main entry point and where the `activate()` method is implemented. +- [logger-wrapper.js](./lib/logger-wrapper.js) - Access point to the Logger for our VSCode Extension Files/Modules. +- [package.json -> configuration](./package.json) - Declaring end user configurable logging settings. +- [settings.js](./lib/settings.js) - Logic to read the logging configuration from the VSCode settings. +- [settings-changes-handler.js](./lib/settings-changes-handler.js) - Listening to VSCode settings changes and reacting by updating the Logger configuration. +- [passing-logger-to-library.js](./lib/passing-logger-to-library.js) - A simple Dependency Injection of the Logger to a consumed (external) library. +- [commands.js](./lib/commands.js) - The implementation of the `Hello World` Command. diff --git a/projects/vscode-logging/examples/extension/lib/commands.js b/projects/vscode-logging/examples/extension/lib/commands.js new file mode 100644 index 00000000..15f617c5 --- /dev/null +++ b/projects/vscode-logging/examples/extension/lib/commands.js @@ -0,0 +1,28 @@ +const vscode = require("vscode"); + +// Our modules consume the logger via the logger-wrapper module +const { getLogger } = require("./logger-wrapper"); + +/** + * + * @param {vscode.ExtensionContext} context + */ +function registerCommands(context) { + let logMessagesCounter = 1; + const commandSubscription = vscode.commands.registerCommand( + "extension.helloWorld", + // By providing a real function name rather then a `fat arrow` ( ()=>{} ) + // The `sourceLocationTracking` can provide a meaningful output. + function registerCallback() { + vscode.window.showInformationMessage("Hello Cruel World!"); + getLogger().error( + `Hip Hip Hurray, the Command was executed! counter: <${logMessagesCounter++}>` + ); + } + ); + context.subscriptions.push(commandSubscription); +} + +module.exports = { + registerCommands: registerCommands +}; diff --git a/projects/vscode-logging/examples/extension/lib/extension.js b/projects/vscode-logging/examples/extension/lib/extension.js new file mode 100644 index 00000000..6ca1f355 --- /dev/null +++ b/projects/vscode-logging/examples/extension/lib/extension.js @@ -0,0 +1,70 @@ +const { resolve } = require("path"); +const vscode = require("vscode"); +const { getExtensionLogger } = require("@vscode-logging/logger"); +const { + getLoggingLevelSetting, + getSourceLocationTrackingSetting +} = require("./settings"); +const { registerCommands } = require("./commands"); +const { listenToLogSettingsChanges } = require("./settings-changes-handler"); +const { callLibraryAndPassLogger } = require("./passing-logger-to-library"); +const { getLogger, initLogger } = require("./logger-wrapper"); + +/** + * Entry Point for a VSCode Extension. + * + * @param {vscode.ExtensionContext} context + */ +function activate(context) { + // The `logPath` is only available from the `ExtensionContext` + const logPath = context.logPath; + const logLevelSetting = getLoggingLevelSetting(); + const sourceLocationTrackingSettings = getSourceLocationTrackingSetting(); + const meta = require(resolve(__dirname, "..", "package.json")); + const logOutputChannel = vscode.window.createOutputChannel(meta.name); + + // The Logger must first be initialized before any logging commands may be invoked. + const extLogger = getExtensionLogger({ + extName: meta.name, + level: logLevelSetting, + logPath: logPath, + logOutputChannel: logOutputChannel, + sourceLocationTracking: sourceLocationTrackingSettings, + logConsole: true + }); + + // Update our logger-wrapper with a reference to the extLogger. + initLogger(extLogger); + + // Lets log some useful entries... + getLogger().info( + `Extension: <${meta.name}> version: <${meta.version}> has been activated` + ); + getLogger().info(`Rotating Log Files will be written to: <${logPath}>`); + + // Simple Dependency Injection example of using the VSCode Logger in a "consumed" npm library/package. + callLibraryAndPassLogger(); + + getLogger().info(`Testing logging info level`); + getLogger().warn(`Testing logging warn level`); + getLogger().error(`Testing logging error level`); + + registerCommands(context); + + // We must subscribe to settings changes, otherwise the Logger will always remain in its initial state. + listenToLogSettingsChanges(context); +} + +/** + * this method is called when your extension is deactivated + */ +function deactivate() { + getLogger().info( + "Sad Sad Panda: extension was deactivated, why oh why?" + ); +} + +module.exports = { + activate, + deactivate +}; diff --git a/projects/vscode-logging/examples/extension/lib/logger-wrapper.js b/projects/vscode-logging/examples/extension/lib/logger-wrapper.js new file mode 100644 index 00000000..4cc880d9 --- /dev/null +++ b/projects/vscode-logging/examples/extension/lib/logger-wrapper.js @@ -0,0 +1,37 @@ +/** + * A Simple Wrapper to hold the state of our "singleton" (per extension) IVSCodeExtLogger + * implementation. + */ + +/** + * @type {IVSCodeExtLogger} + */ +let _logger; +let isInitialized = false; + +/** + * Note the use of a getter function so the value would be lazy resolved on each use. + * This enables concise and simple consumption of the Logger throughout our Extension. + * + * @returns { IVSCodeExtLogger } + */ +function getLogger() { + if (!isInitialized) { + throw Error("Logger has not yet been initialized!"); + } + return _logger; +} + +/** + * This function should be invoked after the Logger has been initialized in the Extension's `activate` function. + * @param {IVSCodeExtLogger} newLogger + */ +function initLogger(newLogger) { + isInitialized = true; + _logger = newLogger; +} + +module.exports = { + getLogger, + initLogger +}; diff --git a/projects/vscode-logging/examples/extension/lib/passing-logger-to-library.js b/projects/vscode-logging/examples/extension/lib/passing-logger-to-library.js new file mode 100644 index 00000000..0221c7e6 --- /dev/null +++ b/projects/vscode-logging/examples/extension/lib/passing-logger-to-library.js @@ -0,0 +1,22 @@ +const { Calculator } = require("@vscode-logging/library-example"); + +// Our modules consume the logger via the logger-wrapper module +const { getLogger } = require("./logger-wrapper"); + +function callLibraryAndPassLogger() { + // Using a childLogger will add a suffix to the `label` information in each logEntry. + const calculatorChildLogger = getLogger().getChildLogger({ + label: "Calculator" + }); + + const calc = new Calculator(calculatorChildLogger); + + // These methods will now log the same log targets as our VSCode Extension Logger (OutChannel / Rolling File) + calc.add(1, 2); + calc.subtract(5, 3); + calc.multiply(2, 6); +} + +module.exports = { + callLibraryAndPassLogger +}; diff --git a/projects/vscode-logging/examples/extension/lib/settings-changes-handler.js b/projects/vscode-logging/examples/extension/lib/settings-changes-handler.js new file mode 100644 index 00000000..7ac98341 --- /dev/null +++ b/projects/vscode-logging/examples/extension/lib/settings-changes-handler.js @@ -0,0 +1,45 @@ +const vscode = require("vscode"); + +const { + LOGGING_LEVEL_CONFIG_PROP, + SOURCE_TRACKING_CONFIG_PROP +} = require("./settings"); + +// Our modules consume the logger via the logger-wrapper module +const { getLogger } = require("./logger-wrapper"); + +/** + * @param {vscode.ExtensionContext} context + */ +function listenToLogSettingsChanges(context) { + // To enable dynamic logging level we must listen to VSCode configuration changes + // on our `loggingLevelConfigProp` configuration setting. + context.subscriptions.push( + vscode.workspace.onDidChangeConfiguration(e => { + if (e.affectsConfiguration(LOGGING_LEVEL_CONFIG_PROP)) { + const logLevel = vscode.workspace + .getConfiguration() + .get(LOGGING_LEVEL_CONFIG_PROP); + + getLogger().changeLevel(logLevel); + } + }) + ); + + // Enable responding to changes in the sourceLocationTracking setting + context.subscriptions.push( + vscode.workspace.onDidChangeConfiguration(e => { + if (e.affectsConfiguration(SOURCE_TRACKING_CONFIG_PROP)) { + const newSourceLocationTracking = vscode.workspace + .getConfiguration() + .get(SOURCE_TRACKING_CONFIG_PROP); + + getLogger().changeSourceLocationTracking(newSourceLocationTracking); + } + }) + ); +} + +module.exports = { + listenToLogSettingsChanges +}; diff --git a/projects/vscode-logging/examples/extension/lib/settings.js b/projects/vscode-logging/examples/extension/lib/settings.js new file mode 100644 index 00000000..0e6064f2 --- /dev/null +++ b/projects/vscode-logging/examples/extension/lib/settings.js @@ -0,0 +1,28 @@ +const vscode = require("vscode"); + +/** + * Note that the values of these configuration properties must match those defined in the package.json + */ +const LOGGING_LEVEL_CONFIG_PROP = "Example_Logging.loggingLevel"; +const SOURCE_TRACKING_CONFIG_PROP = "Example_Logging.sourceLocationTracking"; + +/** + * @returns {LogLevel} + */ +function getLoggingLevelSetting() { + return vscode.workspace.getConfiguration().get(LOGGING_LEVEL_CONFIG_PROP); +} + +/** + * @returns {boolean} + */ +function getSourceLocationTrackingSetting() { + return vscode.workspace.getConfiguration().get(SOURCE_TRACKING_CONFIG_PROP); +} + +module.exports = { + LOGGING_LEVEL_CONFIG_PROP, + SOURCE_TRACKING_CONFIG_PROP, + getLoggingLevelSetting, + getSourceLocationTrackingSetting +}; diff --git a/projects/vscode-logging/examples/extension/package.json b/projects/vscode-logging/examples/extension/package.json new file mode 100644 index 00000000..73673b71 --- /dev/null +++ b/projects/vscode-logging/examples/extension/package.json @@ -0,0 +1,58 @@ +{ + "name": "vscode-logging-extension-example", + "private": true, + "displayName": "logging-example", + "description": "Example using @vscode-logging/logger in a VSCode Extension", + "version": "2.0.9", + "publisher": "SAP", + "engines": { + "vscode": "^1.32.0" + }, + "activationEvents": [ + "onCommand:extension.helloWorld" + ], + "main": "./lib/extension.js", + "contributes": { + "commands": [ + { + "command": "extension.helloWorld", + "title": "Hello World" + } + ], + "configuration": { + "type": "object", + "title": "Example_Logging", + "properties": { + "Example_Logging.loggingLevel": { + "type": "string", + "enum": [ + "off", + "fatal", + "error", + "warn", + "info", + "debug", + "trace" + ], + "default": "info", + "description": "The verbosity of logging. The Order is off < fatal < error < warn < info < debug < trace.", + "scope": "resource" + }, + "Example_Logging.sourceLocationTracking": { + "type": "boolean", + "default": false, + "description": "Should Source Code Location Info be added to log entries, DANGER - May be very slow, only use in debugging scenarios", + "scope": "resource" + } + } + } + }, + "scripts": {}, + "dependencies": { + "@vscode-logging/library-example": "workspace:*", + "@vscode-logging/logger": "workspace:^" + }, + "devDependencies": { + "@types/vscode": "^1.32.0" + } +} diff --git a/projects/vscode-logging/examples/library/CHANGELOG.md b/projects/vscode-logging/examples/library/CHANGELOG.md new file mode 100644 index 00000000..4ae8338b --- /dev/null +++ b/projects/vscode-logging/examples/library/CHANGELOG.md @@ -0,0 +1,67 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [2.0.8](https://github.com/sap/vscode-logging/compare/v2.0.7...v2.0.8) (2026-02-18) + +**Note:** Version bump only for package @vscode-logging/library-example + +## [2.0.7](https://github.com/sap/vscode-logging/compare/v2.0.6...v2.0.7) (2026-02-18) + +**Note:** Version bump only for package @vscode-logging/library-example + +## [2.0.6](https://github.com/sap/vscode-logging/compare/v2.0.5...v2.0.6) (2026-02-18) + +**Note:** Version bump only for package @vscode-logging/library-example + +## [2.0.5](https://github.com/sap/vscode-logging/compare/v2.0.4...v2.0.5) (2026-02-18) + +**Note:** Version bump only for package @vscode-logging/library-example + +## [2.0.4](https://github.com/sap/vscode-logging/compare/v2.0.3...v2.0.4) (2026-02-18) + +**Note:** Version bump only for package @vscode-logging/library-example + +## [2.0.3](https://github.com/sap/vscode-logging/compare/v2.0.2...v2.0.3) (2026-02-17) + +**Note:** Version bump only for package @vscode-logging/library-example + +## [2.0.2](https://github.com/sap/vscode-logging/compare/v2.0.1...v2.0.2) (2026-02-17) + +**Note:** Version bump only for package @vscode-logging/library-example + +## [2.0.1](https://github.com/sap/vscode-logging/compare/v2.0.0...v2.0.1) (2026-02-15) + +### Bug Fixes + +- examples fix ([#242](https://github.com/sap/vscode-logging/issues/242)) ([09afea5](https://github.com/sap/vscode-logging/commit/09afea515f76238e2761c9cf5849bda589204794)) +- workspace protocol ([#243](https://github.com/sap/vscode-logging/issues/243)) ([3091351](https://github.com/sap/vscode-logging/commit/30913512554b29590b16bce4ad2a1eb3890b5dc9)) + +# 2.0.0 (2024-01-05) + +### Features + +- initial Commit ([ee780af](https://github.com/sap/vscode-logging/commit/ee780afa90dc17cfac91a28cb2921728c1cc4489)) + +## [0.1.4](https://github.com/sap/vscode-logging/compare/@vscode-logging/library-example@0.1.3...@vscode-logging/library-example@0.1.4) (2021-04-13) + +**Note:** Version bump only for package @vscode-logging/library-example + +## [0.1.3](https://github.com/sap/vscode-logging/compare/@vscode-logging/library-example@0.1.2...@vscode-logging/library-example@0.1.3) (2020-11-12) + +**Note:** Version bump only for package @vscode-logging/library-example + +## [0.1.2](https://github.com/sap/vscode-logging/compare/@vscode-logging/library-example@0.1.1...@vscode-logging/library-example@0.1.2) (2020-02-19) + +**Note:** Version bump only for package @vscode-logging/library-example + +## [0.1.1](https://github.com/sap/vscode-logging/compare/@vscode-logging/library-example@0.1.0...@vscode-logging/library-example@0.1.1) (2020-01-20) + +**Note:** Version bump only for package @vscode-logging/library-example + +# 0.1.0 (2020-01-14) + +### Features + +- initial Commit ([ee780af](https://github.com/sap/vscode-logging/commit/ee780afa90dc17cfac91a28cb2921728c1cc4489)) diff --git a/projects/vscode-logging/examples/library/README.md b/projects/vscode-logging/examples/library/README.md new file mode 100644 index 00000000..9cfc9ca3 --- /dev/null +++ b/projects/vscode-logging/examples/library/README.md @@ -0,0 +1,9 @@ +# @vscode-logging Library DI Example + +This folder contains an npm package example which uses simple constructor argument +[Dependency Injection][di] in order to use the @vscode-logging/logger in an npm library called from a VSCode Extension. + +This "library" is consumed by the extension example's [passing-logger-to-library.js](../extension/lib/passing-logger-to-library.js), +file. + +[di]: https://en.wikipedia.org/wiki/Dependency_injection diff --git a/projects/vscode-logging/examples/library/index.js b/projects/vscode-logging/examples/library/index.js new file mode 100644 index 00000000..a0b530a9 --- /dev/null +++ b/projects/vscode-logging/examples/library/index.js @@ -0,0 +1,51 @@ +const NO_OPERATION = () => {}; + +/** + * Empty Implementation of the Logger in case none is provided via Dependency Injection. + * An alternative implementation could log to the console or provide another (real) implementation. + * + * @type {IChildLogger} + */ +const noopLogger = { + fatal: NO_OPERATION, + error: NO_OPERATION, + warn: NO_OPERATION, + info: NO_OPERATION, + debug: NO_OPERATION, + trace: NO_OPERATION, + getChildLogger: function(opts) { + return noopLogger; + } +}; + +class Calculator { + /** + * @param {IChildLogger} [logger] + */ + constructor(logger = noopLogger) { + this.logger = logger; + } + + subtract(lhs, rhs) { + // Adding Metadata Objects to the JSON structured log entry. + this.logger.info("Subtract called with arguments:", { lhs: lhs, rhs: rhs }); + return lhs - rhs; + } + + add(lhs, rhs) { + // Using ECMAScript Template Literals to construct the message (Recommended!) + // - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals + this.logger.warn(`add called with arguments: <${lhs}> + <${rhs}>`); + return lhs + rhs; + } + + multiply(lhs, rhs) { + // using splat style to construct the message + this.logger.error("multiple called with arguments: <%d> + <%d>", lhs, rhs); + return lhs * rhs; + } +} + +module.exports = { + Calculator: Calculator +}; diff --git a/projects/vscode-logging/examples/library/package.json b/projects/vscode-logging/examples/library/package.json new file mode 100644 index 00000000..f0c63123 --- /dev/null +++ b/projects/vscode-logging/examples/library/package.json @@ -0,0 +1,12 @@ +{ + "name": "@vscode-logging/library-example", + "version": "2.0.8", + "private": true, + "description": "Example node library using @vscode-logging/logger via Dependency Injection", + "main": "index.js", + "repository": "https://github.com/sap/vscode-logging/", + "license": "Apache-2.0", + "devDependencies": { + "@vscode-logging/types": "workspace:^" + } +} From ac665246cb2a74b8076ed6ccaea9c9fb95ff921c Mon Sep 17 00:00:00 2001 From: Jacob Kreyenbuehl Date: Fri, 21 Aug 2026 10:17:18 +0200 Subject: [PATCH 06/20] chore: reformat vscode-logging examples with monorepo prettier Signed-off-by: Jacob Kreyenbuehl --- .../examples/extension-wrapper/src/logger.ts | 2 +- .../vscode-logging/examples/extension/lib/commands.js | 2 +- .../vscode-logging/examples/extension/lib/extension.js | 6 +++--- .../examples/extension/lib/logger-wrapper.js | 2 +- .../examples/extension/lib/passing-logger-to-library.js | 4 ++-- .../examples/extension/lib/settings-changes-handler.js | 8 ++++---- .../vscode-logging/examples/extension/lib/settings.js | 2 +- projects/vscode-logging/examples/library/index.js | 6 +++--- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/projects/vscode-logging/examples/extension-wrapper/src/logger.ts b/projects/vscode-logging/examples/extension-wrapper/src/logger.ts index 30d44b85..928936ed 100644 --- a/projects/vscode-logging/examples/extension-wrapper/src/logger.ts +++ b/projects/vscode-logging/examples/extension-wrapper/src/logger.ts @@ -47,7 +47,7 @@ export async function initLogger(context: ExtensionContext): Promise { logConsole: false, loggingLevelProp: LOGGING_LEVEL_PROP, sourceLocationProp: SOURCE_LOCATION_PROP, - subscriptions: context.subscriptions + subscriptions: context.subscriptions, }); setLogger(extLogger); diff --git a/projects/vscode-logging/examples/extension/lib/commands.js b/projects/vscode-logging/examples/extension/lib/commands.js index 15f617c5..9202d412 100644 --- a/projects/vscode-logging/examples/extension/lib/commands.js +++ b/projects/vscode-logging/examples/extension/lib/commands.js @@ -24,5 +24,5 @@ function registerCommands(context) { } module.exports = { - registerCommands: registerCommands + registerCommands: registerCommands, }; diff --git a/projects/vscode-logging/examples/extension/lib/extension.js b/projects/vscode-logging/examples/extension/lib/extension.js index 6ca1f355..68f574c9 100644 --- a/projects/vscode-logging/examples/extension/lib/extension.js +++ b/projects/vscode-logging/examples/extension/lib/extension.js @@ -3,7 +3,7 @@ const vscode = require("vscode"); const { getExtensionLogger } = require("@vscode-logging/logger"); const { getLoggingLevelSetting, - getSourceLocationTrackingSetting + getSourceLocationTrackingSetting, } = require("./settings"); const { registerCommands } = require("./commands"); const { listenToLogSettingsChanges } = require("./settings-changes-handler"); @@ -30,7 +30,7 @@ function activate(context) { logPath: logPath, logOutputChannel: logOutputChannel, sourceLocationTracking: sourceLocationTrackingSettings, - logConsole: true + logConsole: true, }); // Update our logger-wrapper with a reference to the extLogger. @@ -66,5 +66,5 @@ function deactivate() { module.exports = { activate, - deactivate + deactivate, }; diff --git a/projects/vscode-logging/examples/extension/lib/logger-wrapper.js b/projects/vscode-logging/examples/extension/lib/logger-wrapper.js index 4cc880d9..6137e8d7 100644 --- a/projects/vscode-logging/examples/extension/lib/logger-wrapper.js +++ b/projects/vscode-logging/examples/extension/lib/logger-wrapper.js @@ -33,5 +33,5 @@ function initLogger(newLogger) { module.exports = { getLogger, - initLogger + initLogger, }; diff --git a/projects/vscode-logging/examples/extension/lib/passing-logger-to-library.js b/projects/vscode-logging/examples/extension/lib/passing-logger-to-library.js index 0221c7e6..85c71e1e 100644 --- a/projects/vscode-logging/examples/extension/lib/passing-logger-to-library.js +++ b/projects/vscode-logging/examples/extension/lib/passing-logger-to-library.js @@ -6,7 +6,7 @@ const { getLogger } = require("./logger-wrapper"); function callLibraryAndPassLogger() { // Using a childLogger will add a suffix to the `label` information in each logEntry. const calculatorChildLogger = getLogger().getChildLogger({ - label: "Calculator" + label: "Calculator", }); const calc = new Calculator(calculatorChildLogger); @@ -18,5 +18,5 @@ function callLibraryAndPassLogger() { } module.exports = { - callLibraryAndPassLogger + callLibraryAndPassLogger, }; diff --git a/projects/vscode-logging/examples/extension/lib/settings-changes-handler.js b/projects/vscode-logging/examples/extension/lib/settings-changes-handler.js index 7ac98341..b43009b1 100644 --- a/projects/vscode-logging/examples/extension/lib/settings-changes-handler.js +++ b/projects/vscode-logging/examples/extension/lib/settings-changes-handler.js @@ -2,7 +2,7 @@ const vscode = require("vscode"); const { LOGGING_LEVEL_CONFIG_PROP, - SOURCE_TRACKING_CONFIG_PROP + SOURCE_TRACKING_CONFIG_PROP, } = require("./settings"); // Our modules consume the logger via the logger-wrapper module @@ -15,7 +15,7 @@ function listenToLogSettingsChanges(context) { // To enable dynamic logging level we must listen to VSCode configuration changes // on our `loggingLevelConfigProp` configuration setting. context.subscriptions.push( - vscode.workspace.onDidChangeConfiguration(e => { + vscode.workspace.onDidChangeConfiguration((e) => { if (e.affectsConfiguration(LOGGING_LEVEL_CONFIG_PROP)) { const logLevel = vscode.workspace .getConfiguration() @@ -28,7 +28,7 @@ function listenToLogSettingsChanges(context) { // Enable responding to changes in the sourceLocationTracking setting context.subscriptions.push( - vscode.workspace.onDidChangeConfiguration(e => { + vscode.workspace.onDidChangeConfiguration((e) => { if (e.affectsConfiguration(SOURCE_TRACKING_CONFIG_PROP)) { const newSourceLocationTracking = vscode.workspace .getConfiguration() @@ -41,5 +41,5 @@ function listenToLogSettingsChanges(context) { } module.exports = { - listenToLogSettingsChanges + listenToLogSettingsChanges, }; diff --git a/projects/vscode-logging/examples/extension/lib/settings.js b/projects/vscode-logging/examples/extension/lib/settings.js index 0e6064f2..a320f0ff 100644 --- a/projects/vscode-logging/examples/extension/lib/settings.js +++ b/projects/vscode-logging/examples/extension/lib/settings.js @@ -24,5 +24,5 @@ module.exports = { LOGGING_LEVEL_CONFIG_PROP, SOURCE_TRACKING_CONFIG_PROP, getLoggingLevelSetting, - getSourceLocationTrackingSetting + getSourceLocationTrackingSetting, }; diff --git a/projects/vscode-logging/examples/library/index.js b/projects/vscode-logging/examples/library/index.js index a0b530a9..5c03466c 100644 --- a/projects/vscode-logging/examples/library/index.js +++ b/projects/vscode-logging/examples/library/index.js @@ -13,9 +13,9 @@ const noopLogger = { info: NO_OPERATION, debug: NO_OPERATION, trace: NO_OPERATION, - getChildLogger: function(opts) { + getChildLogger: function (opts) { return noopLogger; - } + }, }; class Calculator { @@ -47,5 +47,5 @@ class Calculator { } module.exports = { - Calculator: Calculator + Calculator: Calculator, }; From 4aaf7a0cfc5f1dd1ce67eefc43003d56ffb0648a Mon Sep 17 00:00:00 2001 From: Jacob Kreyenbuehl Date: Fri, 21 Aug 2026 11:02:56 +0200 Subject: [PATCH 07/20] chore: align vscode-mta-tools' @vscode-logging/logger to the current version vscode-mta-tools pinned @vscode-logging/logger@1.2.3. Once logger@2.0.9 is a package in this workspace, that stale range makes Changesets' dependents-graph check fail ('must depend on the current version'), which would break the release flow. Bump it to 2.0.9 to match the current version, consistent with how every other cross-project consumer in this repo pins @vscode-logging packages (e.g. yeoman-ui/backend -> logger 2.0.9; the app-studio-toolkit packages -> wrapper 2.0.9 / types 2.0.8). vscode-mta-tools' own ci (compile + 110 tests at 100% coverage + webpack bundle + vsix package) passes against logger 2.0.9. Signed-off-by: Jacob Kreyenbuehl --- pnpm-lock.yaml | 99 +------------------------- projects/vscode-mta-tools/package.json | 2 +- 2 files changed, 3 insertions(+), 98 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d370010d..8972987b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -681,8 +681,8 @@ importers: specifier: 1.2.15 version: 1.2.15 '@vscode-logging/logger': - specifier: 1.2.3 - version: 1.2.3 + specifier: 2.0.9 + version: 2.0.9 comment-json: specifier: 4.1.1 version: 4.1.1 @@ -3647,18 +3647,12 @@ packages: '@vscode-elements/elements@1.11.0': resolution: {integrity: sha512-vC1QDaelqERypHinavJbe4Bl4/g66CVJWKFWFXZyp1seBvTxkgscayDTiE//H95V8b75BgLPDAS1y3pbSIKXag==} - '@vscode-logging/logger@1.2.3': - resolution: {integrity: sha512-kQgRjbZmBBUktklaEat8YtTBuddCNRJezjJTk0Y+4VIs49KWjYkfF02GoyiCYASvCSMSqw9bBTQN3ijCO2aq+A==} - '@vscode-logging/logger@2.0.9': resolution: {integrity: sha512-Kq7dmziSHej+6yADxoHCZU8Tspf7ucJeNjH+QPMAQlRfT0uaXlh1q5DpWnzSgznWIBrMc7lX82meThDKBxL+oA==} '@vscode-logging/types@0.1.3': resolution: {integrity: sha512-1mV/aMVXpm50PyJ4XYD0qPUREv6QcmPwuDtzdMcKeiXN5Tt/WmnyEHfUxENQr1Aes8Hr+EVtNK4tvrUXXco/5A==} - '@vscode-logging/types@0.1.4': - resolution: {integrity: sha512-uxuHQfpX9RbkgSj5unJFmciXRczyFSaAI2aA829MYYkE8jxlhZLRLoiJLymTNiojNVdV7fFE3CILF5Q6M+EBsA==} - '@vscode-logging/types@2.0.8': resolution: {integrity: sha512-9mc5+Iob1BqJ00QExLwdz4+w0A1odSYjvzpKYfP0lVzr7Tdf4iWGspLADyTSC7DtJVQQ+tu411cBju+cYJxE/g==} @@ -4279,10 +4273,6 @@ packages: asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - at-least-node@1.0.0: - resolution: {integrity: sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==} - engines: {node: '>= 4.0.0'} - atob@2.1.2: resolution: {integrity: sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==} engines: {node: '>= 4.5.0'} @@ -5228,11 +5218,6 @@ packages: resolution: {integrity: sha512-y17kh32+I82G+ED9MNWFkZiP/Cq/vO1hN9+tSZsT9C9qn3NrvcBnh7crSepg0AQPge1hXx2Ca44s1FRdv0gFWA==} engines: {node: '>= 10'} - date-format@2.1.0: - resolution: {integrity: sha512-bYQuGLeFxhkxNOF3rcMtiZxvCBAquGzZm6oWA1oZ0g2THUzivaRhv8uOhdr19LmoobSOLoIAxeUK2RdbM8IFTA==} - engines: {node: '>=4.0'} - deprecated: 2.x is no longer supported. Please upgrade to 4.x or higher. - date-format@4.0.14: resolution: {integrity: sha512-39BOQLs9ZjKh0/patS9nrT8wc3ioX3/eA/zgbKNopnF2wCqJEoxywwwElATYvRsXdnOxA/OQeQoFZ3rFjVajhg==} engines: {node: '>=4.0'} @@ -6103,9 +6088,6 @@ packages: resolution: {integrity: sha512-FChq8hbz65WMj4rstcQsFB0O7Cy++nmbNfLYnD9cYv2cRn8EG6k/MGn9kO/tjO66t09DLDugj3yL+V2o6Qftrg==} engines: {node: '>=10.0'} - fast-safe-stringify@2.0.7: - resolution: {integrity: sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA==} - fast-safe-stringify@2.1.1: resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==} @@ -6358,10 +6340,6 @@ packages: resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==} engines: {node: '>=6 <7 || >=8'} - fs-extra@9.1.0: - resolution: {integrity: sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==} - engines: {node: '>=10'} - fs-minipass@2.1.0: resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} engines: {node: '>= 8'} @@ -10465,11 +10443,6 @@ packages: resolution: {integrity: sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==} engines: {node: '>= 0.4'} - streamroller@2.2.3: - resolution: {integrity: sha512-AegmvQsscTRhHVO46PhCDerjIpxi7E+d2GxgUDu+nzw/HuLnUdxHWr6WQ+mVn/4iJgMKKFFdiUwFcFRDvcjCtw==} - engines: {node: '>=8.0'} - deprecated: 2.x is no longer supported. Please upgrade to 3.x or higher. - streamroller@3.1.5: resolution: {integrity: sha512-KFxaM7XT+irxvdqSP1LGLgNWbYN7ay5owZ3r/8t77p+EtSUAfUgtl7be3xtqtOmGUl9K9YPO2ca8133RlTjvKw==} engines: {node: '>=8.0'} @@ -10862,9 +10835,6 @@ packages: resolution: {integrity: sha512-Nm4cF79FhSTzrLKGDMi3I4utBtFv8qKy4sq1enftf2gMdpqI8oVQTAfySkTz5r49giVzDj88SVZXP4CeYQwjaw==} engines: {node: '>=0.10.0'} - triple-beam@1.3.0: - resolution: {integrity: sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==} - triple-beam@1.4.1: resolution: {integrity: sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==} engines: {node: '>= 14.0.0'} @@ -11653,10 +11623,6 @@ packages: peerDependencies: winston: ^3 - winston-transport@4.3.0: - resolution: {integrity: sha512-B2wPuwUi3vhzn/51Uukcao4dIduEiPOcOt9HJ3QeaXgkJ5Z7UwpBzxS4ZGNHtrxrUvTwemsQiSys0ihOf8Mp1A==} - engines: {node: '>= 6.4.0'} - winston-transport@4.6.0: resolution: {integrity: sha512-wbBA9PbPAHxKiygo7ub7BYRiKxms0tpfU2ljtWzb3SjRjv5yl6Ozuy/TkXf00HTAt+Uylo3gSkNwzc4ME0wiIg==} engines: {node: '>= 12.0.0'} @@ -11673,10 +11639,6 @@ packages: resolution: {integrity: sha512-RhruH2Cj0bV0WgNL+lOfoUBI4DVfdUNjVnJGVovWZmrcKtrFTTRzgXYK2O9cymSGjrERCtaAeHwMNnUWXlwZow==} engines: {node: '>= 12.0.0'} - winston@3.3.3: - resolution: {integrity: sha512-oEXTISQnC8VlSAKf1KYSSd7J6IWuRPQqDdo8eoRNaYKLvwSb5+79Z3Yi1lrl6KDpU6/VWaxpakDAtb1oQ4n9aw==} - engines: {node: '>= 6.4.0'} - with-open-file@0.1.7: resolution: {integrity: sha512-ecJS2/oHtESJ1t3ZfMI3B7KIDKyfN0O16miWxdn30zdh66Yd3LsRFebXZXq6GU4xfxLf6nVxp9kIqElb5fqczA==} engines: {node: '>=6'} @@ -15590,20 +15552,6 @@ snapshots: dependencies: lit: 3.3.3 - '@vscode-logging/logger@1.2.3': - dependencies: - '@vscode-logging/types': 0.1.4 - fast-safe-stringify: 2.0.7 - fs-extra: 9.1.0 - lodash: 4.18.1 - stacktrace-js: 2.0.2 - streamroller: 2.2.3 - triple-beam: 1.3.0 - winston: 3.3.3 - winston-transport: 4.3.0 - transitivePeerDependencies: - - supports-color - '@vscode-logging/logger@2.0.9': dependencies: '@vscode-logging/types': 2.0.8 @@ -15620,8 +15568,6 @@ snapshots: '@vscode-logging/types@0.1.3': {} - '@vscode-logging/types@0.1.4': {} - '@vscode-logging/types@2.0.8': {} '@vscode-logging/wrapper@2.0.9': @@ -16352,8 +16298,6 @@ snapshots: asynckit@0.4.0: {} - at-least-node@1.0.0: {} - atob@2.1.2: {} available-typed-arrays@1.0.7: @@ -17518,8 +17462,6 @@ snapshots: image-size: 1.0.0 mimer: 2.0.2 - date-format@2.1.0: {} - date-format@4.0.14: {} dateformat@1.0.12: @@ -18581,8 +18523,6 @@ snapshots: dependencies: boolean: 3.2.0 - fast-safe-stringify@2.0.7: {} - fast-safe-stringify@2.1.1: {} fast-string-truncated-width@3.0.3: {} @@ -18868,13 +18808,6 @@ snapshots: jsonfile: 4.0.0 universalify: 0.1.2 - fs-extra@9.1.0: - dependencies: - at-least-node: 1.0.0 - graceful-fs: 4.2.11 - jsonfile: 6.1.0 - universalify: 2.0.0 - fs-minipass@2.1.0: dependencies: minipass: 3.3.6 @@ -24276,14 +24209,6 @@ snapshots: es-errors: 1.3.0 internal-slot: 1.1.0 - streamroller@2.2.3: - dependencies: - date-format: 2.1.0 - debug: 4.4.3 - fs-extra: 8.1.0 - transitivePeerDependencies: - - supports-color - streamroller@3.1.5: dependencies: date-format: 4.0.14 @@ -24707,8 +24632,6 @@ snapshots: trim-newlines@1.0.0: {} - triple-beam@1.3.0: {} - triple-beam@1.4.1: {} ts-api-utils@2.5.0(typescript@5.7.3): @@ -25626,12 +25549,6 @@ snapshots: winston: 3.15.0 winston-transport: 4.8.0 - winston-transport@4.3.0: - dependencies: - logform: 2.7.0 - readable-stream: 2.3.8 - triple-beam: 1.4.1 - winston-transport@4.6.0: dependencies: logform: 2.7.0 @@ -25672,18 +25589,6 @@ snapshots: triple-beam: 1.4.1 winston-transport: 4.8.0 - winston@3.3.3: - dependencies: - '@dabh/diagnostics': 2.0.8 - async: 3.2.6 - is-stream: 2.0.1 - logform: 2.7.0 - one-time: 1.0.0 - readable-stream: 3.6.2 - stack-trace: 0.0.10 - triple-beam: 1.4.1 - winston-transport: 4.6.0 - with-open-file@0.1.7: dependencies: p-finally: 1.0.0 diff --git a/projects/vscode-mta-tools/package.json b/projects/vscode-mta-tools/package.json index 1c58698e..8e06070e 100644 --- a/projects/vscode-mta-tools/package.json +++ b/projects/vscode-mta-tools/package.json @@ -215,7 +215,7 @@ "lodash": "4.17.21", "comment-json": "4.1.1", "fs-extra": "10.0.0", - "@vscode-logging/logger": "1.2.3", + "@vscode-logging/logger": "2.0.9", "@sap/swa-for-sapbas-vsx": "1.2.15", "@sap/mta-lib": "1.7.4", "@sap/cf-tools": "2.0.1", From 597d90b9c02cb436578758752ef3a2c3662ac3be Mon Sep 17 00:00:00 2001 From: Jacob Kreyenbuehl Date: Mon, 24 Aug 2026 14:52:22 +0200 Subject: [PATCH 08/20] fix: declare chai-exclude devDependency for logger logger's .mocharc.js does require('chai-exclude'), but that package was only declared in the source repo's root package.json (not migrated). A clean CI install therefore fails with 'Cannot find module chai-exclude'. It passed locally only because an earlier install had left it in node_modules. Declare chai-exclude (2.1.0, the source repo's version) in logger's own devDependencies. Verified green from a pristine checkout via 'CI=true pnpm install --frozen-lockfile && CI=true pnpm run ci'. Signed-off-by: Jacob Kreyenbuehl --- pnpm-lock.yaml | 18 ++++++++++++++++++ .../packages/logger/package.json | 1 + 2 files changed, 19 insertions(+) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8972987b..10c6ef1c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -638,6 +638,9 @@ importers: '@types/vscode': specifier: 1.51.0 version: 1.51.0 + chai-exclude: + specifier: 2.1.0 + version: 2.1.0(chai@4.5.0) proxyquire: specifier: 2.1.3 version: 2.1.3 @@ -4670,6 +4673,11 @@ packages: peerDependencies: chai: '>= 2.1.2 < 6' + chai-exclude@2.1.0: + resolution: {integrity: sha512-IBnm50Mvl3O1YhPpTgbU8MK0Gw7NHcb18WT2TxGdPKOMtdtZVKLHmQwdvOF7mTlHVQStbXuZKFwkevFtbHjpVg==} + peerDependencies: + chai: '>= 4.0.0 < 5' + chai-string@1.6.0: resolution: {integrity: sha512-sXV7whDmpax+8H++YaZelgin7aur1LGf9ZhjZa3ojETFJ0uPVuS4XEXuIagpZ/c8uVOtsSh4MwOjy5CBLjJSXA==} peerDependencies: @@ -6112,6 +6120,9 @@ packages: fb-watchman@2.0.2: resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==} + fclone@1.0.11: + resolution: {integrity: sha512-GDqVQezKzRABdeqflsgMr7ktzgF9CyS+p2oe0jJqUY6izSSbhPIQJDpoU4PtGcD7VPM9xh/dVrTu6z1nwgmEGw==} + fd-slicer@1.1.0: resolution: {integrity: sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==} @@ -16834,6 +16845,11 @@ snapshots: chai: 4.5.0 check-error: 1.0.3 + chai-exclude@2.1.0(chai@4.5.0): + dependencies: + chai: 4.5.0 + fclone: 1.0.11 + chai-string@1.6.0(chai@4.4.1): dependencies: chai: 4.4.1 @@ -18547,6 +18563,8 @@ snapshots: dependencies: bser: 2.1.1 + fclone@1.0.11: {} + fd-slicer@1.1.0: dependencies: pend: 1.2.0 diff --git a/projects/vscode-logging/packages/logger/package.json b/projects/vscode-logging/packages/logger/package.json index 5b53dd2d..4d612e92 100644 --- a/projects/vscode-logging/packages/logger/package.json +++ b/projects/vscode-logging/packages/logger/package.json @@ -37,6 +37,7 @@ "devDependencies": { "@types/fs-extra": "11.0.4", "@types/vscode": "1.51.0", + "chai-exclude": "2.1.0", "proxyquire": "2.1.3", "sinon": "17.0.1", "sinon-chai": "3.7.0" From 45b883fefd80abc2761d457c930911e443d01e7a Mon Sep 17 00:00:00 2001 From: Jacob Kreyenbuehl Date: Mon, 24 Aug 2026 16:54:08 +0200 Subject: [PATCH 09/20] chore: drop redundant per-example .gitignore files The root .gitignore already covers node_modules and *.vsix, and the examples do not produce a vsix, so the per-example .gitignore files were pure duplication. Addresses review feedback on PR #583. Signed-off-by: Jacob Kreyenbuehl --- projects/vscode-logging/examples/extension-wrapper/.gitignore | 2 -- projects/vscode-logging/examples/extension/.gitignore | 2 -- 2 files changed, 4 deletions(-) delete mode 100644 projects/vscode-logging/examples/extension-wrapper/.gitignore delete mode 100644 projects/vscode-logging/examples/extension/.gitignore diff --git a/projects/vscode-logging/examples/extension-wrapper/.gitignore b/projects/vscode-logging/examples/extension-wrapper/.gitignore deleted file mode 100644 index aeee7322..00000000 --- a/projects/vscode-logging/examples/extension-wrapper/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -*.vsix diff --git a/projects/vscode-logging/examples/extension/.gitignore b/projects/vscode-logging/examples/extension/.gitignore deleted file mode 100644 index aeee7322..00000000 --- a/projects/vscode-logging/examples/extension/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -*.vsix From 8ade58ec8b522bc5d2557205cc4c9aba782c01f7 Mon Sep 17 00:00:00 2001 From: Jacob Kreyenbuehl Date: Mon, 24 Aug 2026 16:54:12 +0200 Subject: [PATCH 10/20] chore: extend root tsconfig.base.json in vscode-logging emitting packages extension-wrapper (example) and the wrapper package now extend the root tsconfig.base.json and drop the duplicated compilerOptions, matching the repo convention (yeoman-ui / app-studio-toolkit packages). logger and types stay self-contained: they are type-check-only/checkJs and base's strict + composite options break them. Addresses review feedback on PR #583. Signed-off-by: Jacob Kreyenbuehl --- .../examples/extension-wrapper/tsconfig.json | 11 ++--------- .../vscode-logging/packages/wrapper/tsconfig.json | 9 +-------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/projects/vscode-logging/examples/extension-wrapper/tsconfig.json b/projects/vscode-logging/examples/extension-wrapper/tsconfig.json index c26e2112..19d941f9 100644 --- a/projects/vscode-logging/examples/extension-wrapper/tsconfig.json +++ b/projects/vscode-logging/examples/extension-wrapper/tsconfig.json @@ -1,16 +1,9 @@ { - "compileOnSave": true, + "extends": "../../../../tsconfig.base.json", "compilerOptions": { "rootDir": ".", "outDir": "dist", - "baseUrl": ".", - "module": "commonjs", - "lib": ["es7"], - "target": "es2017", - "declaration": true, - "sourceMap": true, - "forceConsistentCasingInFileNames": true, - "strict": true + "baseUrl": "." }, "include": ["./src/**/*.ts", "./api.d.ts"] } diff --git a/projects/vscode-logging/packages/wrapper/tsconfig.json b/projects/vscode-logging/packages/wrapper/tsconfig.json index 96264523..fe605b02 100644 --- a/projects/vscode-logging/packages/wrapper/tsconfig.json +++ b/projects/vscode-logging/packages/wrapper/tsconfig.json @@ -1,16 +1,9 @@ { - "compileOnSave": true, + "extends": "../../../../tsconfig.base.json", "compilerOptions": { "rootDir": ".", "outDir": "dist", "baseUrl": ".", - "module": "commonjs", - "lib": ["es7"], - "target": "es2017", - "declaration": true, - "sourceMap": true, - "forceConsistentCasingInFileNames": true, - "strict": true, "skipLibCheck": true }, "include": ["./src/**/*.ts", "./test/**/*.ts", "./api.d.ts"] From 69668d972aae01bf5e5892a30bcd645fd4b41bb5 Mon Sep 17 00:00:00 2001 From: Jacob Kreyenbuehl Date: Tue, 25 Aug 2026 10:36:05 +0200 Subject: [PATCH 11/20] chore: use workspace:* for vscode-mta-tools' @vscode-logging/logger dep Per review (bd82): intra-monorepo dependencies should use the workspace:* protocol, not an exact version pin, so they resolve to the in-repo package and stay consistent as versions change. Switch vscode-mta-tools' @vscode-logging/ logger dependency from 2.0.9 to workspace:*. Still clears the Changesets dependents-graph check; verified mta-tools builds/tests/bundles against the in-repo logger. Broader workspace:* conversion of other consumers to follow in a separate PR. Signed-off-by: Jacob Kreyenbuehl --- pnpm-lock.yaml | 4 ++-- projects/vscode-mta-tools/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 10c6ef1c..7e4498e0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -684,8 +684,8 @@ importers: specifier: 1.2.15 version: 1.2.15 '@vscode-logging/logger': - specifier: 2.0.9 - version: 2.0.9 + specifier: workspace:* + version: link:../vscode-logging/packages/logger comment-json: specifier: 4.1.1 version: 4.1.1 diff --git a/projects/vscode-mta-tools/package.json b/projects/vscode-mta-tools/package.json index 8e06070e..96b2fd99 100644 --- a/projects/vscode-mta-tools/package.json +++ b/projects/vscode-mta-tools/package.json @@ -215,7 +215,7 @@ "lodash": "4.17.21", "comment-json": "4.1.1", "fs-extra": "10.0.0", - "@vscode-logging/logger": "2.0.9", + "@vscode-logging/logger": "workspace:*", "@sap/swa-for-sapbas-vsx": "1.2.15", "@sap/mta-lib": "1.7.4", "@sap/cf-tools": "2.0.1", From b5bbf7c228b6eaa64c26ac2b3b34fb8a0a036538 Mon Sep 17 00:00:00 2001 From: Jacob Kreyenbuehl Date: Tue, 25 Aug 2026 10:39:19 +0200 Subject: [PATCH 12/20] chore: rename vscode-logging CHANGELOG.md to CHANGELOG.old.md Per review (Corentin + Shachar): use the CHANGELOG.old.md naming for the pre-migration history, matching the vscode-mta-tools pattern. Nothing references the file by name; the historic-note header is retained. Signed-off-by: Jacob Kreyenbuehl --- projects/vscode-logging/{CHANGELOG.md => CHANGELOG.old.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename projects/vscode-logging/{CHANGELOG.md => CHANGELOG.old.md} (100%) diff --git a/projects/vscode-logging/CHANGELOG.md b/projects/vscode-logging/CHANGELOG.old.md similarity index 100% rename from projects/vscode-logging/CHANGELOG.md rename to projects/vscode-logging/CHANGELOG.old.md From 9dbece3e6bfc1fbc9a8bcb0fd9f517470d61082b Mon Sep 17 00:00:00 2001 From: Jacob Kreyenbuehl Date: Tue, 25 Aug 2026 13:45:22 +0200 Subject: [PATCH 13/20] docs: explain the @types/vscode version pin in vscode-logging package.json Per review (Corentin): add a note key stating why @types/vscode is pinned per package to the minimum supported VS Code API version instead of the monorepo root version. Applied to the logger and wrapper packages and the two extension examples. Signed-off-by: Jacob Kreyenbuehl --- projects/vscode-logging/examples/extension-wrapper/package.json | 1 + projects/vscode-logging/examples/extension/package.json | 1 + projects/vscode-logging/packages/logger/package.json | 1 + projects/vscode-logging/packages/wrapper/package.json | 1 + 4 files changed, 4 insertions(+) diff --git a/projects/vscode-logging/examples/extension-wrapper/package.json b/projects/vscode-logging/examples/extension-wrapper/package.json index 9a33048b..90448e27 100644 --- a/projects/vscode-logging/examples/extension-wrapper/package.json +++ b/projects/vscode-logging/examples/extension-wrapper/package.json @@ -55,6 +55,7 @@ "dependencies": { "@vscode-logging/wrapper": "workspace:^" }, + "//@types/vscode": "Pinned to the minimum VS Code API version supported here (kept from the standalone vscode-logging repo). Intentionally not raised to the monorepo root version, which would allow newer APIs and break support for older VS Code.", "devDependencies": { "@types/vscode": "^1.52.0", "@vscode-logging/types": "workspace:^" diff --git a/projects/vscode-logging/examples/extension/package.json b/projects/vscode-logging/examples/extension/package.json index 73673b71..458dc944 100644 --- a/projects/vscode-logging/examples/extension/package.json +++ b/projects/vscode-logging/examples/extension/package.json @@ -52,6 +52,7 @@ "@vscode-logging/library-example": "workspace:*", "@vscode-logging/logger": "workspace:^" }, + "//@types/vscode": "Pinned to the minimum VS Code API version supported here (kept from the standalone vscode-logging repo). Intentionally not raised to the monorepo root version, which would allow newer APIs and break support for older VS Code.", "devDependencies": { "@types/vscode": "^1.32.0" } diff --git a/projects/vscode-logging/packages/logger/package.json b/projects/vscode-logging/packages/logger/package.json index 4d612e92..4a352c20 100644 --- a/projects/vscode-logging/packages/logger/package.json +++ b/projects/vscode-logging/packages/logger/package.json @@ -34,6 +34,7 @@ "winston": "3.11.0", "winston-transport": "4.6.0" }, + "//@types/vscode": "Pinned to the minimum VS Code API version supported here (kept from the standalone vscode-logging repo). Intentionally not raised to the monorepo root version, which would allow newer APIs and break support for older VS Code.", "devDependencies": { "@types/fs-extra": "11.0.4", "@types/vscode": "1.51.0", diff --git a/projects/vscode-logging/packages/wrapper/package.json b/projects/vscode-logging/packages/wrapper/package.json index 939a6f8d..32ea2e18 100644 --- a/projects/vscode-logging/packages/wrapper/package.json +++ b/projects/vscode-logging/packages/wrapper/package.json @@ -27,6 +27,7 @@ "@vscode-logging/logger": "workspace:^", "@vscode-logging/types": "workspace:^" }, + "//@types/vscode": "Pinned to the minimum VS Code API version supported here (kept from the standalone vscode-logging repo). Intentionally not raised to the monorepo root version, which would allow newer APIs and break support for older VS Code.", "devDependencies": { "@types/lodash": "4.14.202", "@types/vscode": "1.52.0", From f552c2eac6a0b91eb811b68ac66fb3258c91f736 Mon Sep 17 00:00:00 2001 From: Jacob Kreyenbuehl Date: Wed, 26 Aug 2026 09:08:22 +0200 Subject: [PATCH 14/20] chore: bump root @types/node to 22 and drop skipLibCheck in vscode-logging Per review (bd82): skipLibCheck is too heavy-handed; the real cause of the @types/node-vs-DOM clashes was the outdated root @types/node. Bump it to 22 (oldest still-supported Node) and remove skipLibCheck from the logger, types and wrapper tsconfigs (also drop a redundant target in types, ineffective under noEmit). The v22 typings change NodeJS.setInterval's return type, so annotate the two timers in app-studio-toolkit's landscape.ts as NodeJS.Timeout. Signed-off-by: Jacob Kreyenbuehl --- package.json | 2 +- .../devspace-manager/landscape/landscape.ts | 4 +- pnpm-lock.yaml | 671 ++++++------------ .../packages/logger/tsconfig.json | 3 +- .../packages/types/tsconfig.json | 4 +- .../packages/wrapper/tsconfig.json | 3 +- 6 files changed, 232 insertions(+), 455 deletions(-) diff --git a/package.json b/package.json index f0ebe102..a8a2e02d 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "@types/deep-equal-in-any-order": "1.0.4", "@types/lodash": "4.14.177", "@types/mocha": "10.0.7", - "@types/node": "16.11.10", + "@types/node": "22.20.1", "@types/sinon": "17.0.4", "@types/vscode": "1.75.0", "@typescript-eslint/eslint-plugin": "8.60.1", diff --git a/packages/app-studio-toolkit/src/devspace-manager/landscape/landscape.ts b/packages/app-studio-toolkit/src/devspace-manager/landscape/landscape.ts index 8ab46922..0a23f298 100644 --- a/packages/app-studio-toolkit/src/devspace-manager/landscape/landscape.ts +++ b/packages/app-studio-toolkit/src/devspace-manager/landscape/landscape.ts @@ -20,7 +20,7 @@ const LBL_ADD_LANDSCAPE = "Add another landscape"; const DEFAULT_REFRESH_RATE = 10 * 1000; // 10 sec default const DEFAULT_TIMEOUT = 2 * 60 * 1000; // 2 min default -const autoRefreshTimerArray: NodeJS.Timer[] = []; +const autoRefreshTimerArray: NodeJS.Timeout[] = []; export function clearAutoRefreshTimers(): void { autoRefreshTimerArray.forEach((interval) => { @@ -34,7 +34,7 @@ export function autoRefresh( timeOut = DEFAULT_TIMEOUT ): void { let refreshedTime = 0; - const refreshInterval: NodeJS.Timer = setInterval(() => { + const refreshInterval: NodeJS.Timeout = setInterval(() => { getLandscapes() .then((landscapes) => { if (refreshedTime < timeOut && !isEmpty(landscapes)) { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7e4498e0..2c20e8f5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,10 +16,10 @@ importers: devDependencies: '@changesets/cli': specifier: 2.31.1 - version: 2.31.1(@types/node@16.11.10) + version: 2.31.1(@types/node@22.20.1) '@commitlint/cli': specifier: 19.5.0 - version: 19.5.0(@types/node@16.11.10)(typescript@5.7.3) + version: 19.5.0(@types/node@22.20.1)(typescript@5.7.3) '@commitlint/config-conventional': specifier: 19.5.0 version: 19.5.0 @@ -42,8 +42,8 @@ importers: specifier: 10.0.7 version: 10.0.7 '@types/node': - specifier: 16.11.10 - version: 16.11.10 + specifier: 22.20.1 + version: 22.20.1 '@types/sinon': specifier: 17.0.4 version: 17.0.4 @@ -378,7 +378,7 @@ importers: version: 2.0.8 jest-mock-vscode: specifier: 0.1.6 - version: 0.1.6(jest@29.7.0(@types/node@25.9.1)(ts-node@10.9.2(@types/node@25.9.1)(typescript@5.7.3))) + version: 0.1.6(jest@29.7.0(@types/node@22.20.1)(ts-node@10.9.2(@types/node@22.20.1)(typescript@5.7.3))) proxyquire: specifier: 2.1.3 version: 2.1.3 @@ -568,7 +568,7 @@ importers: version: 2.25.3(@typescript-eslint/parser@8.60.1(eslint@8.57.1)(typescript@5.7.3))(eslint@8.57.1) jest: specifier: 27.5.1 - version: 27.5.1(bufferutil@4.1.0)(ts-node@10.9.2(@types/node@25.9.1)(typescript@5.7.3))(utf-8-validate@5.0.10) + version: 27.5.1(bufferutil@4.1.0)(ts-node@10.9.2(@types/node@22.20.1)(typescript@5.7.3))(utf-8-validate@5.0.10) projects/vscode-logging/examples/extension: dependencies: @@ -909,7 +909,7 @@ importers: version: 3.4.13(typescript@5.7.3) '@sap-devx/inquirer-gui-auto-complete-plugin': specifier: 3.4.13 - version: 3.4.13(typescript@5.7.3)(vite@4.5.11(@types/node@22.15.35)(sass@1.56.1)(terser@5.48.0)) + version: 3.4.13(typescript@5.7.3)(vite@4.5.11(@types/node@22.20.1)(sass@1.56.1)(terser@5.48.0)) '@sap-devx/inquirer-gui-file-browser-plugin': specifier: 3.4.13 version: 3.4.13(typescript@5.7.3) @@ -964,7 +964,7 @@ importers: version: 7.11.5(@babel/core@7.29.0) '@vitejs/plugin-vue': specifier: 4.5.2 - version: 4.5.2(vite@4.5.11(@types/node@22.15.35)(sass@1.56.1)(terser@5.48.0))(vue@3.5.34(typescript@5.7.3)) + version: 4.5.2(vite@4.5.11(@types/node@22.20.1)(sass@1.56.1)(terser@5.48.0))(vue@3.5.34(typescript@5.7.3)) '@vue/compiler-sfc': specifier: 3.3.4 version: 3.3.4 @@ -973,7 +973,7 @@ importers: version: 2.4.1(@vue/server-renderer@3.5.34(vue@3.5.34(typescript@5.7.3)))(vue@3.5.34(typescript@5.7.3)) '@vue/vue3-jest': specifier: 29.2.6 - version: 29.2.6(@babel/core@7.29.0)(babel-jest@29.7.0(@babel/core@7.29.0))(jest@29.7.0(@types/node@22.15.35)(ts-node@10.9.2(@types/node@22.15.35)(typescript@5.7.3)))(typescript@5.7.3)(vue@3.5.34(typescript@5.7.3)) + version: 29.2.6(@babel/core@7.29.0)(babel-jest@29.7.0(@babel/core@7.29.0))(jest@29.7.0(@types/node@22.20.1)(ts-node@10.9.2(@types/node@22.20.1)(typescript@5.7.3)))(typescript@5.7.3)(vue@3.5.34(typescript@5.7.3)) babel-jest: specifier: 29.7.0 version: 29.7.0(@babel/core@7.29.0) @@ -982,7 +982,7 @@ importers: version: 9.14.1(eslint@8.57.1) jest: specifier: 29.7.0 - version: 29.7.0(@types/node@22.15.35)(ts-node@10.9.2(@types/node@22.15.35)(typescript@5.7.3)) + version: 29.7.0(@types/node@22.20.1)(ts-node@10.9.2(@types/node@22.20.1)(typescript@5.7.3)) jest-environment-jsdom: specifier: ^29.7.0 version: 29.7.0(bufferutil@4.1.0)(utf-8-validate@5.0.10) @@ -1000,10 +1000,10 @@ importers: version: 1.56.1 ts-jest: specifier: ^29.1.1 - version: 29.4.11(@babel/core@7.29.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.29.0))(jest-util@29.7.0)(jest@29.7.0(@types/node@22.15.35)(ts-node@10.9.2(@types/node@22.15.35)(typescript@5.7.3)))(typescript@5.7.3) + version: 29.4.11(@babel/core@7.29.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.29.0))(jest-util@29.7.0)(jest@29.7.0(@types/node@22.20.1)(ts-node@10.9.2(@types/node@22.20.1)(typescript@5.7.3)))(typescript@5.7.3) vite: specifier: 4.5.11 - version: 4.5.11(@types/node@22.15.35)(sass@1.56.1)(terser@5.48.0) + version: 4.5.11(@types/node@22.20.1)(sass@1.56.1)(terser@5.48.0) projects/yeoman-ui/packages/generator-foodq: dependencies: @@ -1021,7 +1021,7 @@ importers: version: 7.3.3 yeoman-generator: specifier: ^4.12.0 - version: 4.13.0(@types/node@25.9.1)(encoding@0.1.13)(mem-fs@4.1.4) + version: 4.13.0(@types/node@22.20.1)(encoding@0.1.13)(mem-fs@4.1.4) projects/yeoman-ui/packages/types: devDependencies: @@ -1033,11 +1033,11 @@ importers: dependencies: yeoman-environment: specifier: 3.19.3 - version: 3.19.3(@types/node@22.15.35) + version: 3.19.3(@types/node@22.20.1) devDependencies: '@types/yeoman-environment': specifier: 2.10.11 - version: 2.10.11(@yeoman/types@1.11.1(@types/node@22.15.35)(@yeoman/adapter@4.0.2(@types/node@22.15.35))(mem-fs@4.1.4))(mem-fs@4.1.4) + version: 2.10.11(@yeoman/types@1.11.1(@types/node@22.20.1)(@yeoman/adapter@4.0.2(@types/node@22.20.1))(mem-fs@4.1.4))(mem-fs@4.1.4) packages: @@ -3414,24 +3414,15 @@ packages: '@types/node@15.14.9': resolution: {integrity: sha512-qjd88DrCxupx/kJD5yQgZdcYKZKSIGBVDIBE1/LTGcNm3d2Np/jxojkdePDdfnBHJc5W7vSMpbJ1aB7p/Py69A==} - '@types/node@16.11.10': - resolution: {integrity: sha512-3aRnHa1KlOEEhJ6+CvyHKK5vE9BcLGjtUpwvqYLRvYNQKMfabu3BwfJaA/SLW8dxe28LsNDjtHwePTuzn3gmOA==} - '@types/node@16.18.126': resolution: {integrity: sha512-OTcgaiwfGFBKacvfwuHzzn1KLxH/er8mluiy8/uM3sGXHaRe73RrSIj01jow9t4kJEW633Ov+cOexXeiApTyAw==} - '@types/node@22.15.35': - resolution: {integrity: sha512-stV91mHxlWpDksiUiivmFfQzjy2JLlb2NUTxKipiANEbxBZsdbDU9fSrT7SHY4uoCXAxYfJZVasn3x2/hqpd3g==} - '@types/node@22.19.1': resolution: {integrity: sha512-LCCV0HdSZZZb34qifBsyWlUmok6W7ouER+oQIGBScS8EsZsQbrtFTUrDX4hOl+CS6p7cnNC4td+qrSVGSCTUfQ==} '@types/node@22.20.1': resolution: {integrity: sha512-EANqOCF9QFyra+4pfxUcX9STKJpCLjMbObVzljIJomAWSnuSIEAvyzEU53GaajbXJEgdh0iEcPL+DGvpUd4k1Q==} - '@types/node@25.9.1': - resolution: {integrity: sha512-xfrlY7UD5rMJk3ZVJP8BNzS28J36YJg+xp+LPXV1TdWxr8uMH5A860QNxYDGQe/ylDSgjxE52Q9VnO7p75tJxg==} - '@types/normalize-package-data@2.4.4': resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} @@ -11083,9 +11074,6 @@ packages: undici-types@6.21.0: resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} - undici-types@7.24.6: - resolution: {integrity: sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==} - undici@6.27.0: resolution: {integrity: sha512-YmfV3YnEDzXRC5lZ2jWtWWHKGUm1zIt8AhesR1tens+HTNv+YZlN/dp6G727LOvMJ8xjP9Be7Y2Sdr96LDm+pg==} engines: {node: '>=18.17'} @@ -12815,7 +12803,7 @@ snapshots: dependencies: '@changesets/types': 6.1.0 - '@changesets/cli@2.31.1(@types/node@16.11.10)': + '@changesets/cli@2.31.1(@types/node@22.20.1)': dependencies: '@changesets/apply-release-plan': 7.1.1 '@changesets/assemble-release-plan': 6.0.10 @@ -12831,7 +12819,7 @@ snapshots: '@changesets/should-skip-package': 0.1.2 '@changesets/types': 6.1.0 '@changesets/write': 0.4.0 - '@inquirer/external-editor': 1.0.3(@types/node@16.11.10) + '@inquirer/external-editor': 1.0.3(@types/node@22.20.1) '@manypkg/get-packages': 1.1.3 ansi-colors: 4.1.3 enquirer: 2.4.1 @@ -12933,11 +12921,11 @@ snapshots: '@colors/colors@1.6.0': {} - '@commitlint/cli@19.5.0(@types/node@16.11.10)(typescript@5.7.3)': + '@commitlint/cli@19.5.0(@types/node@22.20.1)(typescript@5.7.3)': dependencies: '@commitlint/format': 19.5.0 '@commitlint/lint': 19.5.0 - '@commitlint/load': 19.5.0(@types/node@16.11.10)(typescript@5.7.3) + '@commitlint/load': 19.5.0(@types/node@22.20.1)(typescript@5.7.3) '@commitlint/read': 19.5.0 '@commitlint/types': 19.5.0 tinyexec: 0.3.1 @@ -12984,7 +12972,7 @@ snapshots: '@commitlint/rules': 19.5.0 '@commitlint/types': 19.5.0 - '@commitlint/load@19.5.0(@types/node@16.11.10)(typescript@5.7.3)': + '@commitlint/load@19.5.0(@types/node@22.20.1)(typescript@5.7.3)': dependencies: '@commitlint/config-validator': 19.5.0 '@commitlint/execute-rule': 19.5.0 @@ -12992,7 +12980,7 @@ snapshots: '@commitlint/types': 19.5.0 chalk: 5.6.2 cosmiconfig: 9.0.0(typescript@5.7.3) - cosmiconfig-typescript-loader: 5.0.0(@types/node@16.11.10)(cosmiconfig@9.0.0(typescript@5.7.3))(typescript@5.7.3) + cosmiconfig-typescript-loader: 5.0.0(@types/node@22.20.1)(cosmiconfig@9.0.0(typescript@5.7.3))(typescript@5.7.3) lodash.isplainobject: 4.0.6 lodash.merge: 4.6.2 lodash.uniq: 4.5.0 @@ -13270,14 +13258,14 @@ snapshots: optionalDependencies: '@types/node': 14.18.63 - '@inquirer/checkbox@5.2.1(@types/node@22.15.35)': + '@inquirer/checkbox@5.2.1(@types/node@22.20.1)': dependencies: '@inquirer/ansi': 2.0.7 - '@inquirer/core': 11.2.1(@types/node@22.15.35) + '@inquirer/core': 11.2.1(@types/node@22.20.1) '@inquirer/figures': 2.0.7 - '@inquirer/type': 4.0.7(@types/node@22.15.35) + '@inquirer/type': 4.0.7(@types/node@22.20.1) optionalDependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 optional: true '@inquirer/confirm@6.1.1(@types/node@14.18.63)': @@ -13287,12 +13275,12 @@ snapshots: optionalDependencies: '@types/node': 14.18.63 - '@inquirer/confirm@6.1.1(@types/node@22.15.35)': + '@inquirer/confirm@6.1.1(@types/node@22.20.1)': dependencies: - '@inquirer/core': 11.2.1(@types/node@22.15.35) - '@inquirer/type': 4.0.7(@types/node@22.15.35) + '@inquirer/core': 11.2.1(@types/node@22.20.1) + '@inquirer/type': 4.0.7(@types/node@22.20.1) optionalDependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 optional: true '@inquirer/core@11.2.1(@types/node@14.18.63)': @@ -13307,17 +13295,17 @@ snapshots: optionalDependencies: '@types/node': 14.18.63 - '@inquirer/core@11.2.1(@types/node@22.15.35)': + '@inquirer/core@11.2.1(@types/node@22.20.1)': dependencies: '@inquirer/ansi': 2.0.7 '@inquirer/figures': 2.0.7 - '@inquirer/type': 4.0.7(@types/node@22.15.35) + '@inquirer/type': 4.0.7(@types/node@22.20.1) cli-width: 4.1.0 fast-wrap-ansi: 0.2.2 mute-stream: 3.0.0 signal-exit: 4.1.0 optionalDependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 optional: true '@inquirer/editor@5.2.2(@types/node@14.18.63)': @@ -13328,13 +13316,13 @@ snapshots: optionalDependencies: '@types/node': 14.18.63 - '@inquirer/editor@5.2.2(@types/node@22.15.35)': + '@inquirer/editor@5.2.2(@types/node@22.20.1)': dependencies: - '@inquirer/core': 11.2.1(@types/node@22.15.35) - '@inquirer/external-editor': 3.0.3(@types/node@22.15.35) - '@inquirer/type': 4.0.7(@types/node@22.15.35) + '@inquirer/core': 11.2.1(@types/node@22.20.1) + '@inquirer/external-editor': 3.0.3(@types/node@22.20.1) + '@inquirer/type': 4.0.7(@types/node@22.20.1) optionalDependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 optional: true '@inquirer/expand@5.1.1(@types/node@14.18.63)': @@ -13344,27 +13332,20 @@ snapshots: optionalDependencies: '@types/node': 14.18.63 - '@inquirer/expand@5.1.1(@types/node@22.15.35)': + '@inquirer/expand@5.1.1(@types/node@22.20.1)': dependencies: - '@inquirer/core': 11.2.1(@types/node@22.15.35) - '@inquirer/type': 4.0.7(@types/node@22.15.35) + '@inquirer/core': 11.2.1(@types/node@22.20.1) + '@inquirer/type': 4.0.7(@types/node@22.20.1) optionalDependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 optional: true - '@inquirer/external-editor@1.0.3(@types/node@16.11.10)': + '@inquirer/external-editor@1.0.3(@types/node@22.20.1)': dependencies: chardet: 2.1.1 iconv-lite: 0.7.2 optionalDependencies: - '@types/node': 16.11.10 - - '@inquirer/external-editor@1.0.3(@types/node@22.15.35)': - dependencies: - chardet: 2.1.1 - iconv-lite: 0.7.2 - optionalDependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@inquirer/external-editor@3.0.3(@types/node@14.18.63)': dependencies: @@ -13373,12 +13354,12 @@ snapshots: optionalDependencies: '@types/node': 14.18.63 - '@inquirer/external-editor@3.0.3(@types/node@22.15.35)': + '@inquirer/external-editor@3.0.3(@types/node@22.20.1)': dependencies: chardet: 2.1.1 iconv-lite: 0.7.2 optionalDependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 optional: true '@inquirer/figures@2.0.7': {} @@ -13390,12 +13371,12 @@ snapshots: optionalDependencies: '@types/node': 14.18.63 - '@inquirer/input@5.1.2(@types/node@22.15.35)': + '@inquirer/input@5.1.2(@types/node@22.20.1)': dependencies: - '@inquirer/core': 11.2.1(@types/node@22.15.35) - '@inquirer/type': 4.0.7(@types/node@22.15.35) + '@inquirer/core': 11.2.1(@types/node@22.20.1) + '@inquirer/type': 4.0.7(@types/node@22.20.1) optionalDependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 optional: true '@inquirer/number@4.1.1(@types/node@14.18.63)': @@ -13405,12 +13386,12 @@ snapshots: optionalDependencies: '@types/node': 14.18.63 - '@inquirer/number@4.1.1(@types/node@22.15.35)': + '@inquirer/number@4.1.1(@types/node@22.20.1)': dependencies: - '@inquirer/core': 11.2.1(@types/node@22.15.35) - '@inquirer/type': 4.0.7(@types/node@22.15.35) + '@inquirer/core': 11.2.1(@types/node@22.20.1) + '@inquirer/type': 4.0.7(@types/node@22.20.1) optionalDependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 optional: true '@inquirer/password@5.1.1(@types/node@14.18.63)': @@ -13421,13 +13402,13 @@ snapshots: optionalDependencies: '@types/node': 14.18.63 - '@inquirer/password@5.1.1(@types/node@22.15.35)': + '@inquirer/password@5.1.1(@types/node@22.20.1)': dependencies: '@inquirer/ansi': 2.0.7 - '@inquirer/core': 11.2.1(@types/node@22.15.35) - '@inquirer/type': 4.0.7(@types/node@22.15.35) + '@inquirer/core': 11.2.1(@types/node@22.20.1) + '@inquirer/type': 4.0.7(@types/node@22.20.1) optionalDependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 optional: true '@inquirer/prompts@8.5.2(@types/node@14.18.63)': @@ -13445,20 +13426,20 @@ snapshots: optionalDependencies: '@types/node': 14.18.63 - '@inquirer/prompts@8.5.2(@types/node@22.15.35)': - dependencies: - '@inquirer/checkbox': 5.2.1(@types/node@22.15.35) - '@inquirer/confirm': 6.1.1(@types/node@22.15.35) - '@inquirer/editor': 5.2.2(@types/node@22.15.35) - '@inquirer/expand': 5.1.1(@types/node@22.15.35) - '@inquirer/input': 5.1.2(@types/node@22.15.35) - '@inquirer/number': 4.1.1(@types/node@22.15.35) - '@inquirer/password': 5.1.1(@types/node@22.15.35) - '@inquirer/rawlist': 5.3.1(@types/node@22.15.35) - '@inquirer/search': 4.2.1(@types/node@22.15.35) - '@inquirer/select': 5.2.1(@types/node@22.15.35) + '@inquirer/prompts@8.5.2(@types/node@22.20.1)': + dependencies: + '@inquirer/checkbox': 5.2.1(@types/node@22.20.1) + '@inquirer/confirm': 6.1.1(@types/node@22.20.1) + '@inquirer/editor': 5.2.2(@types/node@22.20.1) + '@inquirer/expand': 5.1.1(@types/node@22.20.1) + '@inquirer/input': 5.1.2(@types/node@22.20.1) + '@inquirer/number': 4.1.1(@types/node@22.20.1) + '@inquirer/password': 5.1.1(@types/node@22.20.1) + '@inquirer/rawlist': 5.3.1(@types/node@22.20.1) + '@inquirer/search': 4.2.1(@types/node@22.20.1) + '@inquirer/select': 5.2.1(@types/node@22.20.1) optionalDependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 optional: true '@inquirer/rawlist@5.3.1(@types/node@14.18.63)': @@ -13468,12 +13449,12 @@ snapshots: optionalDependencies: '@types/node': 14.18.63 - '@inquirer/rawlist@5.3.1(@types/node@22.15.35)': + '@inquirer/rawlist@5.3.1(@types/node@22.20.1)': dependencies: - '@inquirer/core': 11.2.1(@types/node@22.15.35) - '@inquirer/type': 4.0.7(@types/node@22.15.35) + '@inquirer/core': 11.2.1(@types/node@22.20.1) + '@inquirer/type': 4.0.7(@types/node@22.20.1) optionalDependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 optional: true '@inquirer/search@4.2.1(@types/node@14.18.63)': @@ -13484,13 +13465,13 @@ snapshots: optionalDependencies: '@types/node': 14.18.63 - '@inquirer/search@4.2.1(@types/node@22.15.35)': + '@inquirer/search@4.2.1(@types/node@22.20.1)': dependencies: - '@inquirer/core': 11.2.1(@types/node@22.15.35) + '@inquirer/core': 11.2.1(@types/node@22.20.1) '@inquirer/figures': 2.0.7 - '@inquirer/type': 4.0.7(@types/node@22.15.35) + '@inquirer/type': 4.0.7(@types/node@22.20.1) optionalDependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 optional: true '@inquirer/select@5.2.1(@types/node@14.18.63)': @@ -13502,23 +13483,23 @@ snapshots: optionalDependencies: '@types/node': 14.18.63 - '@inquirer/select@5.2.1(@types/node@22.15.35)': + '@inquirer/select@5.2.1(@types/node@22.20.1)': dependencies: '@inquirer/ansi': 2.0.7 - '@inquirer/core': 11.2.1(@types/node@22.15.35) + '@inquirer/core': 11.2.1(@types/node@22.20.1) '@inquirer/figures': 2.0.7 - '@inquirer/type': 4.0.7(@types/node@22.15.35) + '@inquirer/type': 4.0.7(@types/node@22.20.1) optionalDependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 optional: true '@inquirer/type@4.0.7(@types/node@14.18.63)': optionalDependencies: '@types/node': 14.18.63 - '@inquirer/type@4.0.7(@types/node@22.15.35)': + '@inquirer/type@4.0.7(@types/node@22.20.1)': optionalDependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 optional: true '@isaacs/cliui@8.0.2': @@ -13549,7 +13530,7 @@ snapshots: '@jest/console@27.5.1': dependencies: '@jest/types': 27.5.1 - '@types/node': 22.15.35 + '@types/node': 22.20.1 chalk: 4.1.2 jest-message-util: 27.5.1 jest-util: 27.5.1 @@ -13558,27 +13539,27 @@ snapshots: '@jest/console@29.7.0': dependencies: '@jest/types': 29.6.3 - '@types/node': 22.15.35 + '@types/node': 22.20.1 chalk: 4.1.2 jest-message-util: 29.7.0 jest-util: 29.7.0 slash: 3.0.0 - '@jest/core@27.5.1(bufferutil@4.1.0)(ts-node@10.9.2(@types/node@25.9.1)(typescript@5.7.3))(utf-8-validate@5.0.10)': + '@jest/core@27.5.1(bufferutil@4.1.0)(ts-node@10.9.2(@types/node@22.20.1)(typescript@5.7.3))(utf-8-validate@5.0.10)': dependencies: '@jest/console': 27.5.1 '@jest/reporters': 27.5.1 '@jest/test-result': 27.5.1 '@jest/transform': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 22.15.35 + '@types/node': 22.20.1 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.8.1 exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 27.5.1 - jest-config: 27.5.1(bufferutil@4.1.0)(ts-node@10.9.2(@types/node@25.9.1)(typescript@5.7.3))(utf-8-validate@5.0.10) + jest-config: 27.5.1(bufferutil@4.1.0)(ts-node@10.9.2(@types/node@22.20.1)(typescript@5.7.3))(utf-8-validate@5.0.10) jest-haste-map: 27.5.1 jest-message-util: 27.5.1 jest-regex-util: 27.5.1 @@ -13601,56 +13582,21 @@ snapshots: - ts-node - utf-8-validate - '@jest/core@29.7.0(ts-node@10.9.2(@types/node@22.15.35)(typescript@5.7.3))': - dependencies: - '@jest/console': 29.7.0 - '@jest/reporters': 29.7.0 - '@jest/test-result': 29.7.0 - '@jest/transform': 29.7.0 - '@jest/types': 29.6.3 - '@types/node': 22.15.35 - ansi-escapes: 4.3.2 - chalk: 4.1.2 - ci-info: 3.9.0 - exit: 0.1.2 - graceful-fs: 4.2.11 - jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@22.15.35)(ts-node@10.9.2(@types/node@22.15.35)(typescript@5.7.3)) - jest-haste-map: 29.7.0 - jest-message-util: 29.7.0 - jest-regex-util: 29.6.3 - jest-resolve: 29.7.0 - jest-resolve-dependencies: 29.7.0 - jest-runner: 29.7.0 - jest-runtime: 29.7.0 - jest-snapshot: 29.7.0 - jest-util: 29.7.0 - jest-validate: 29.7.0 - jest-watcher: 29.7.0 - micromatch: 4.0.8 - pretty-format: 29.7.0 - slash: 3.0.0 - strip-ansi: 6.0.0 - transitivePeerDependencies: - - babel-plugin-macros - - supports-color - - ts-node - - '@jest/core@29.7.0(ts-node@10.9.2(@types/node@25.9.1)(typescript@5.7.3))': + '@jest/core@29.7.0(ts-node@10.9.2(@types/node@22.20.1)(typescript@5.7.3))': dependencies: '@jest/console': 29.7.0 '@jest/reporters': 29.7.0 '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 22.15.35 + '@types/node': 22.20.1 ansi-escapes: 4.3.2 chalk: 4.1.2 ci-info: 3.9.0 exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@22.15.35)(ts-node@10.9.2(@types/node@25.9.1)(typescript@5.7.3)) + jest-config: 29.7.0(@types/node@22.20.1)(ts-node@10.9.2(@types/node@22.20.1)(typescript@5.7.3)) jest-haste-map: 29.7.0 jest-message-util: 29.7.0 jest-regex-util: 29.6.3 @@ -13675,14 +13621,14 @@ snapshots: dependencies: '@jest/fake-timers': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 22.15.35 + '@types/node': 22.20.1 jest-mock: 27.5.1 '@jest/environment@29.7.0': dependencies: '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 22.15.35 + '@types/node': 22.20.1 jest-mock: 29.7.0 '@jest/expect-utils@29.7.0': @@ -13700,7 +13646,7 @@ snapshots: dependencies: '@jest/types': 27.5.1 '@sinonjs/fake-timers': 8.1.0 - '@types/node': 22.15.35 + '@types/node': 22.20.1 jest-message-util: 27.5.1 jest-mock: 27.5.1 jest-util: 27.5.1 @@ -13709,7 +13655,7 @@ snapshots: dependencies: '@jest/types': 29.6.3 '@sinonjs/fake-timers': 10.3.0 - '@types/node': 22.15.35 + '@types/node': 22.20.1 jest-message-util: 29.7.0 jest-mock: 29.7.0 jest-util: 29.7.0 @@ -13736,7 +13682,7 @@ snapshots: '@jest/test-result': 27.5.1 '@jest/transform': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 22.15.35 + '@types/node': 22.20.1 chalk: 4.1.2 collect-v8-coverage: 1.0.3 exit: 0.1.2 @@ -13767,7 +13713,7 @@ snapshots: '@jest/transform': 29.7.0 '@jest/types': 29.6.3 '@jridgewell/trace-mapping': 0.3.31 - '@types/node': 22.15.35 + '@types/node': 22.20.1 chalk: 4.1.2 collect-v8-coverage: 1.0.3 exit: 0.1.2 @@ -13878,7 +13824,7 @@ snapshots: dependencies: '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/yargs': 16.0.11 chalk: 4.1.2 @@ -13887,7 +13833,7 @@ snapshots: '@jest/schemas': 29.6.3 '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/yargs': 17.0.35 chalk: 4.1.2 @@ -14631,10 +14577,10 @@ snapshots: dependencies: node-cache: 5.1.2 - '@sap-devx/inquirer-gui-auto-complete-plugin@3.4.13(typescript@5.7.3)(vite@4.5.11(@types/node@22.15.35)(sass@1.56.1)(terser@5.48.0))': + '@sap-devx/inquirer-gui-auto-complete-plugin@3.4.13(typescript@5.7.3)(vite@4.5.11(@types/node@22.20.1)(sass@1.56.1)(terser@5.48.0))': dependencies: strip-ansi: 6.0.0 - vite-plugin-css-injected-by-js: 3.5.2(vite@4.5.11(@types/node@22.15.35)(sass@1.56.1)(terser@5.48.0)) + vite-plugin-css-injected-by-js: 3.5.2(vite@4.5.11(@types/node@22.20.1)(sass@1.56.1)(terser@5.48.0)) vue: 3.5.34(typescript@5.7.3) transitivePeerDependencies: - typescript @@ -15087,7 +15033,7 @@ snapshots: '@types/body-parser@1.19.5': dependencies: '@types/connect': 3.4.35 - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/chai-as-promised@7.1.8': dependencies: @@ -15097,7 +15043,7 @@ snapshots: '@types/cheerio@0.22.35': dependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/comment-json@2.4.2': dependencies: @@ -15105,19 +15051,19 @@ snapshots: '@types/connect@3.4.35': dependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/conventional-commits-parser@5.0.0': dependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/cors@2.8.13': dependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/cors@2.8.19': dependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/debug@4.1.13': dependencies: @@ -15147,7 +15093,7 @@ snapshots: '@types/express-serve-static-core@4.17.35': dependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/qs': 6.9.7 '@types/range-parser': 1.2.4 '@types/send': 0.17.1 @@ -15162,34 +15108,34 @@ snapshots: '@types/fs-extra@11.0.4': dependencies: '@types/jsonfile': 6.1.4 - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/fs-extra@9.0.12': dependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/fs-extra@9.0.13': dependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/glob@7.2.0': dependencies: '@types/minimatch': 6.0.0 - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/graceful-fs@4.1.9': dependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/http-cache-semantics@4.2.0': {} '@types/http-proxy@1.17.17': dependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/http-terminator@2.0.5': dependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/inquirer@7.3.3': dependencies: @@ -15213,7 +15159,7 @@ snapshots: '@types/jsdom@20.0.1': dependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/tough-cookie': 4.0.5 parse5: 7.3.0 @@ -15225,11 +15171,11 @@ snapshots: '@types/jsonfile@6.1.4': dependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/keyv@3.1.4': dependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/lodash-es@4.17.12': dependencies: @@ -15262,7 +15208,7 @@ snapshots: '@types/node-fetch@2.6.13': dependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 form-data: 4.0.5 '@types/node@12.20.55': {} @@ -15271,14 +15217,8 @@ snapshots: '@types/node@15.14.9': {} - '@types/node@16.11.10': {} - '@types/node@16.18.126': {} - '@types/node@22.15.35': - dependencies: - undici-types: 6.21.0 - '@types/node@22.19.1': dependencies: undici-types: 6.21.0 @@ -15287,18 +15227,13 @@ snapshots: dependencies: undici-types: 6.21.0 - '@types/node@25.9.1': - dependencies: - undici-types: 7.24.6 - optional: true - '@types/normalize-package-data@2.4.4': {} '@types/npm-package-arg@6.1.4': {} '@types/npm-registry-fetch@8.0.9': dependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/node-fetch': 2.6.13 '@types/npm-package-arg': 6.1.4 '@types/npmlog': 7.0.0 @@ -15306,7 +15241,7 @@ snapshots: '@types/npmlog@7.0.0': dependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/object-hash@2.2.1': {} @@ -15324,12 +15259,12 @@ snapshots: '@types/responselike@1.0.3': dependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/rimraf@3.0.2': dependencies: '@types/glob': 7.2.0 - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/sarif@2.1.7': {} @@ -15340,12 +15275,12 @@ snapshots: '@types/send@0.17.1': dependencies: '@types/mime': 1.3.2 - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/serve-static@1.15.1': dependencies: '@types/mime': 3.0.1 - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/shimmer@1.2.0': {} @@ -15357,7 +15292,7 @@ snapshots: '@types/ssri@7.1.5': dependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/stack-utils@2.0.3': {} @@ -15367,13 +15302,13 @@ snapshots: '@types/tar-stream@3.1.4': dependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/text-table@0.2.5': {} '@types/through@0.0.33': dependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/tmp@0.2.6': {} @@ -15390,7 +15325,7 @@ snapshots: '@types/vinyl@2.0.12': dependencies: '@types/expect': 1.20.4 - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/vscode@1.51.0': {} @@ -15402,11 +15337,11 @@ snapshots: '@types/websocket@1.0.5': dependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/ws@8.18.1': dependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/yargs-parser@21.0.3': {} @@ -15420,17 +15355,17 @@ snapshots: '@types/yauzl@3.4.0': dependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 - '@types/yeoman-environment@2.10.11(@yeoman/types@1.11.1(@types/node@22.15.35)(@yeoman/adapter@4.0.2(@types/node@22.15.35))(mem-fs@4.1.4))(mem-fs@4.1.4)': + '@types/yeoman-environment@2.10.11(@yeoman/types@1.11.1(@types/node@22.20.1)(@yeoman/adapter@4.0.2(@types/node@22.20.1))(mem-fs@4.1.4))(mem-fs@4.1.4)': dependencies: '@types/diff': 8.0.0 '@types/inquirer': 8.2.13 '@types/mem-fs': 2.2.0 - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/text-table': 0.2.5 '@types/vinyl': 2.0.12 - '@types/yeoman-generator': 6.0.0(@types/node@22.15.35)(@yeoman/types@1.11.1(@types/node@22.15.35)(@yeoman/adapter@4.0.2(@types/node@22.15.35))(mem-fs@4.1.4))(mem-fs@4.1.4) + '@types/yeoman-generator': 6.0.0(@types/node@22.20.1)(@yeoman/types@1.11.1(@types/node@22.20.1)(@yeoman/adapter@4.0.2(@types/node@22.20.1))(mem-fs@4.1.4))(mem-fs@4.1.4) chalk: 4.1.2 commander: 9.5.0 execa: 5.1.1 @@ -15442,9 +15377,9 @@ snapshots: - react-native-b4a - supports-color - '@types/yeoman-generator@6.0.0(@types/node@22.15.35)(@yeoman/types@1.11.1(@types/node@22.15.35)(@yeoman/adapter@4.0.2(@types/node@22.15.35))(mem-fs@4.1.4))(mem-fs@4.1.4)': + '@types/yeoman-generator@6.0.0(@types/node@22.20.1)(@yeoman/types@1.11.1(@types/node@22.20.1)(@yeoman/adapter@4.0.2(@types/node@22.20.1))(mem-fs@4.1.4))(mem-fs@4.1.4)': dependencies: - yeoman-generator: 8.2.2(@types/node@22.15.35)(@yeoman/types@1.11.1(@types/node@22.15.35)(@yeoman/adapter@4.0.2(@types/node@22.15.35))(mem-fs@4.1.4))(mem-fs@4.1.4) + yeoman-generator: 8.2.2(@types/node@22.20.1)(@yeoman/types@1.11.1(@types/node@22.20.1)(@yeoman/adapter@4.0.2(@types/node@22.20.1))(mem-fs@4.1.4))(mem-fs@4.1.4) transitivePeerDependencies: - '@types/node' - '@yeoman/types' @@ -15554,9 +15489,9 @@ snapshots: '@ungap/structured-clone@1.3.1': {} - '@vitejs/plugin-vue@4.5.2(vite@4.5.11(@types/node@22.15.35)(sass@1.56.1)(terser@5.48.0))(vue@3.5.34(typescript@5.7.3))': + '@vitejs/plugin-vue@4.5.2(vite@4.5.11(@types/node@22.20.1)(sass@1.56.1)(terser@5.48.0))(vue@3.5.34(typescript@5.7.3))': dependencies: - vite: 4.5.11(@types/node@22.15.35)(sass@1.56.1)(terser@5.48.0) + vite: 4.5.11(@types/node@22.20.1)(sass@1.56.1)(terser@5.48.0) vue: 3.5.34(typescript@5.7.3) '@vscode-elements/elements@1.11.0': @@ -15790,7 +15725,7 @@ snapshots: optionalDependencies: '@vue/server-renderer': 3.5.34(vue@3.5.34(typescript@5.7.3)) - '@vue/vue3-jest@29.2.6(@babel/core@7.29.0)(babel-jest@29.7.0(@babel/core@7.29.0))(jest@29.7.0(@types/node@22.15.35)(ts-node@10.9.2(@types/node@22.15.35)(typescript@5.7.3)))(typescript@5.7.3)(vue@3.5.34(typescript@5.7.3))': + '@vue/vue3-jest@29.2.6(@babel/core@7.29.0)(babel-jest@29.7.0(@babel/core@7.29.0))(jest@29.7.0(@types/node@22.20.1)(ts-node@10.9.2(@types/node@22.20.1)(typescript@5.7.3)))(typescript@5.7.3)(vue@3.5.34(typescript@5.7.3))': dependencies: '@babel/core': 7.29.0 '@babel/plugin-transform-modules-commonjs': 7.28.6(@babel/core@7.29.0) @@ -15798,7 +15733,7 @@ snapshots: chalk: 2.4.2 convert-source-map: 1.8.0 css-tree: 2.3.1 - jest: 29.7.0(@types/node@22.15.35)(ts-node@10.9.2(@types/node@22.15.35)(typescript@5.7.3)) + jest: 29.7.0(@types/node@22.20.1)(ts-node@10.9.2(@types/node@22.20.1)(typescript@5.7.3)) source-map: 0.5.6 tsconfig: 7.0.0 vue: 3.5.34(typescript@5.7.3) @@ -15930,12 +15865,12 @@ snapshots: transitivePeerDependencies: - '@types/node' - '@yeoman/adapter@4.0.2(@types/node@22.15.35)': + '@yeoman/adapter@4.0.2(@types/node@22.20.1)': dependencies: - '@inquirer/core': 11.2.1(@types/node@22.15.35) - '@inquirer/prompts': 8.5.2(@types/node@22.15.35) + '@inquirer/core': 11.2.1(@types/node@22.20.1) + '@inquirer/prompts': 8.5.2(@types/node@22.20.1) chalk: 5.6.2 - inquirer: 13.4.3(@types/node@22.15.35) + inquirer: 13.4.3(@types/node@22.20.1) log-symbols: 7.0.1 ora: 9.4.1 p-queue: 9.3.1 @@ -15982,11 +15917,11 @@ snapshots: '@yeoman/adapter': 4.0.2(@types/node@14.18.63) mem-fs: 4.1.4 - '@yeoman/types@1.11.1(@types/node@22.15.35)(@yeoman/adapter@4.0.2(@types/node@22.15.35))(mem-fs@4.1.4)': + '@yeoman/types@1.11.1(@types/node@22.20.1)(@yeoman/adapter@4.0.2(@types/node@22.20.1))(mem-fs@4.1.4)': dependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 optionalDependencies: - '@yeoman/adapter': 4.0.2(@types/node@22.15.35) + '@yeoman/adapter': 4.0.2(@types/node@22.20.1) mem-fs: 4.1.4 JSONStream@1.3.5: @@ -17269,9 +17204,9 @@ snapshots: object-assign: 4.1.1 vary: 1.1.2 - cosmiconfig-typescript-loader@5.0.0(@types/node@16.11.10)(cosmiconfig@9.0.0(typescript@5.7.3))(typescript@5.7.3): + cosmiconfig-typescript-loader@5.0.0(@types/node@22.20.1)(cosmiconfig@9.0.0(typescript@5.7.3))(typescript@5.7.3): dependencies: - '@types/node': 16.11.10 + '@types/node': 22.20.1 cosmiconfig: 9.0.0(typescript@5.7.3) jiti: 1.21.6 typescript: 5.7.3 @@ -17305,28 +17240,13 @@ snapshots: dependencies: capture-stack-trace: 1.0.2 - create-jest@29.7.0(@types/node@22.15.35)(ts-node@10.9.2(@types/node@22.15.35)(typescript@5.7.3)): + create-jest@29.7.0(@types/node@22.20.1)(ts-node@10.9.2(@types/node@22.20.1)(typescript@5.7.3)): dependencies: '@jest/types': 29.6.3 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@22.15.35)(ts-node@10.9.2(@types/node@22.15.35)(typescript@5.7.3)) - jest-util: 29.7.0 - prompts: 2.4.2 - transitivePeerDependencies: - - '@types/node' - - babel-plugin-macros - - supports-color - - ts-node - - create-jest@29.7.0(@types/node@25.9.1)(ts-node@10.9.2(@types/node@25.9.1)(typescript@5.7.3)): - dependencies: - '@jest/types': 29.6.3 - chalk: 4.1.2 - exit: 0.1.2 - graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@25.9.1)(ts-node@10.9.2(@types/node@25.9.1)(typescript@5.7.3)) + jest-config: 29.7.0(@types/node@22.20.1)(ts-node@10.9.2(@types/node@22.20.1)(typescript@5.7.3)) jest-util: 29.7.0 prompts: 2.4.2 transitivePeerDependencies: @@ -17830,7 +17750,7 @@ snapshots: engine.io@6.6.7(bufferutil@4.1.0)(utf-8-validate@5.0.10): dependencies: '@types/cors': 2.8.13 - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/ws': 8.18.1 accepts: 1.3.8 base64id: 2.0.0 @@ -19570,17 +19490,17 @@ snapshots: optionalDependencies: '@types/node': 14.18.63 - inquirer@13.4.3(@types/node@22.15.35): + inquirer@13.4.3(@types/node@22.20.1): dependencies: '@inquirer/ansi': 2.0.7 - '@inquirer/core': 11.2.1(@types/node@22.15.35) - '@inquirer/prompts': 8.5.2(@types/node@22.15.35) - '@inquirer/type': 4.0.7(@types/node@22.15.35) + '@inquirer/core': 11.2.1(@types/node@22.20.1) + '@inquirer/prompts': 8.5.2(@types/node@22.20.1) + '@inquirer/type': 4.0.7(@types/node@22.20.1) mute-stream: 3.0.0 run-async: 4.0.6 rxjs: 7.8.2 optionalDependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 optional: true inquirer@7.3.3: @@ -19599,9 +19519,9 @@ snapshots: strip-ansi: 6.0.1 through: 2.3.8 - inquirer@8.2.7(@types/node@22.15.35): + inquirer@8.2.7(@types/node@22.20.1): dependencies: - '@inquirer/external-editor': 1.0.3(@types/node@22.15.35) + '@inquirer/external-editor': 1.0.3(@types/node@22.20.1) ansi-escapes: 4.3.2 chalk: 4.1.2 cli-cursor: 3.1.0 @@ -20041,7 +19961,7 @@ snapshots: '@jest/environment': 27.5.1 '@jest/test-result': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 22.15.35 + '@types/node': 22.20.1 chalk: 4.1.2 co: 4.6.0 dedent: 0.7.0 @@ -20066,7 +19986,7 @@ snapshots: '@jest/expect': 29.7.0 '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 22.15.35 + '@types/node': 22.20.1 chalk: 4.1.2 co: 4.6.0 dedent: 1.7.2 @@ -20086,16 +20006,16 @@ snapshots: - babel-plugin-macros - supports-color - jest-cli@27.5.1(bufferutil@4.1.0)(ts-node@10.9.2(@types/node@25.9.1)(typescript@5.7.3))(utf-8-validate@5.0.10): + jest-cli@27.5.1(bufferutil@4.1.0)(ts-node@10.9.2(@types/node@22.20.1)(typescript@5.7.3))(utf-8-validate@5.0.10): dependencies: - '@jest/core': 27.5.1(bufferutil@4.1.0)(ts-node@10.9.2(@types/node@25.9.1)(typescript@5.7.3))(utf-8-validate@5.0.10) + '@jest/core': 27.5.1(bufferutil@4.1.0)(ts-node@10.9.2(@types/node@22.20.1)(typescript@5.7.3))(utf-8-validate@5.0.10) '@jest/test-result': 27.5.1 '@jest/types': 27.5.1 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 import-local: 3.0.3 - jest-config: 27.5.1(bufferutil@4.1.0)(ts-node@10.9.2(@types/node@25.9.1)(typescript@5.7.3))(utf-8-validate@5.0.10) + jest-config: 27.5.1(bufferutil@4.1.0)(ts-node@10.9.2(@types/node@22.20.1)(typescript@5.7.3))(utf-8-validate@5.0.10) jest-util: 27.5.1 jest-validate: 27.5.1 prompts: 2.4.2 @@ -20107,35 +20027,16 @@ snapshots: - ts-node - utf-8-validate - jest-cli@29.7.0(@types/node@22.15.35)(ts-node@10.9.2(@types/node@22.15.35)(typescript@5.7.3)): - dependencies: - '@jest/core': 29.7.0(ts-node@10.9.2(@types/node@22.15.35)(typescript@5.7.3)) - '@jest/test-result': 29.7.0 - '@jest/types': 29.6.3 - chalk: 4.1.2 - create-jest: 29.7.0(@types/node@22.15.35)(ts-node@10.9.2(@types/node@22.15.35)(typescript@5.7.3)) - exit: 0.1.2 - import-local: 3.0.3 - jest-config: 29.7.0(@types/node@22.15.35)(ts-node@10.9.2(@types/node@22.15.35)(typescript@5.7.3)) - jest-util: 29.7.0 - jest-validate: 29.7.0 - yargs: 17.7.2 - transitivePeerDependencies: - - '@types/node' - - babel-plugin-macros - - supports-color - - ts-node - - jest-cli@29.7.0(@types/node@25.9.1)(ts-node@10.9.2(@types/node@25.9.1)(typescript@5.7.3)): + jest-cli@29.7.0(@types/node@22.20.1)(ts-node@10.9.2(@types/node@22.20.1)(typescript@5.7.3)): dependencies: - '@jest/core': 29.7.0(ts-node@10.9.2(@types/node@25.9.1)(typescript@5.7.3)) + '@jest/core': 29.7.0(ts-node@10.9.2(@types/node@22.20.1)(typescript@5.7.3)) '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 chalk: 4.1.2 - create-jest: 29.7.0(@types/node@25.9.1)(ts-node@10.9.2(@types/node@25.9.1)(typescript@5.7.3)) + create-jest: 29.7.0(@types/node@22.20.1)(ts-node@10.9.2(@types/node@22.20.1)(typescript@5.7.3)) exit: 0.1.2 import-local: 3.0.3 - jest-config: 29.7.0(@types/node@25.9.1)(ts-node@10.9.2(@types/node@25.9.1)(typescript@5.7.3)) + jest-config: 29.7.0(@types/node@22.20.1)(ts-node@10.9.2(@types/node@22.20.1)(typescript@5.7.3)) jest-util: 29.7.0 jest-validate: 29.7.0 yargs: 17.7.2 @@ -20145,7 +20046,7 @@ snapshots: - supports-color - ts-node - jest-config@27.5.1(bufferutil@4.1.0)(ts-node@10.9.2(@types/node@25.9.1)(typescript@5.7.3))(utf-8-validate@5.0.10): + jest-config@27.5.1(bufferutil@4.1.0)(ts-node@10.9.2(@types/node@22.20.1)(typescript@5.7.3))(utf-8-validate@5.0.10): dependencies: '@babel/core': 7.29.0 '@jest/test-sequencer': 27.5.1 @@ -20172,76 +20073,14 @@ snapshots: slash: 3.0.0 strip-json-comments: 3.1.1 optionalDependencies: - ts-node: 10.9.2(@types/node@25.9.1)(typescript@5.7.3) + ts-node: 10.9.2(@types/node@22.20.1)(typescript@5.7.3) transitivePeerDependencies: - bufferutil - canvas - supports-color - utf-8-validate - jest-config@29.7.0(@types/node@22.15.35)(ts-node@10.9.2(@types/node@22.15.35)(typescript@5.7.3)): - dependencies: - '@babel/core': 7.29.0 - '@jest/test-sequencer': 29.7.0 - '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.29.0) - chalk: 4.1.2 - ci-info: 3.9.0 - deepmerge: 4.3.1 - glob: 7.2.0 - graceful-fs: 4.2.11 - jest-circus: 29.7.0 - jest-environment-node: 29.7.0 - jest-get-type: 29.6.3 - jest-regex-util: 29.6.3 - jest-resolve: 29.7.0 - jest-runner: 29.7.0 - jest-util: 29.7.0 - jest-validate: 29.7.0 - micromatch: 4.0.8 - parse-json: 5.2.0 - pretty-format: 29.7.0 - slash: 3.0.0 - strip-json-comments: 3.1.1 - optionalDependencies: - '@types/node': 22.15.35 - ts-node: 10.9.2(@types/node@22.15.35)(typescript@5.7.3) - transitivePeerDependencies: - - babel-plugin-macros - - supports-color - - jest-config@29.7.0(@types/node@22.15.35)(ts-node@10.9.2(@types/node@25.9.1)(typescript@5.7.3)): - dependencies: - '@babel/core': 7.29.0 - '@jest/test-sequencer': 29.7.0 - '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.29.0) - chalk: 4.1.2 - ci-info: 3.9.0 - deepmerge: 4.3.1 - glob: 7.2.0 - graceful-fs: 4.2.11 - jest-circus: 29.7.0 - jest-environment-node: 29.7.0 - jest-get-type: 29.6.3 - jest-regex-util: 29.6.3 - jest-resolve: 29.7.0 - jest-runner: 29.7.0 - jest-util: 29.7.0 - jest-validate: 29.7.0 - micromatch: 4.0.8 - parse-json: 5.2.0 - pretty-format: 29.7.0 - slash: 3.0.0 - strip-json-comments: 3.1.1 - optionalDependencies: - '@types/node': 22.15.35 - ts-node: 10.9.2(@types/node@25.9.1)(typescript@5.7.3) - transitivePeerDependencies: - - babel-plugin-macros - - supports-color - - jest-config@29.7.0(@types/node@25.9.1)(ts-node@10.9.2(@types/node@25.9.1)(typescript@5.7.3)): + jest-config@29.7.0(@types/node@22.20.1)(ts-node@10.9.2(@types/node@22.20.1)(typescript@5.7.3)): dependencies: '@babel/core': 7.29.0 '@jest/test-sequencer': 29.7.0 @@ -20266,8 +20105,8 @@ snapshots: slash: 3.0.0 strip-json-comments: 3.1.1 optionalDependencies: - '@types/node': 25.9.1 - ts-node: 10.9.2(@types/node@25.9.1)(typescript@5.7.3) + '@types/node': 22.20.1 + ts-node: 10.9.2(@types/node@22.20.1)(typescript@5.7.3) transitivePeerDependencies: - babel-plugin-macros - supports-color @@ -20315,7 +20154,7 @@ snapshots: '@jest/environment': 27.5.1 '@jest/fake-timers': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 22.15.35 + '@types/node': 22.20.1 jest-mock: 27.5.1 jest-util: 27.5.1 jsdom: 16.7.0(bufferutil@4.1.0)(utf-8-validate@5.0.10) @@ -20331,7 +20170,7 @@ snapshots: '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 '@types/jsdom': 20.0.1 - '@types/node': 22.15.35 + '@types/node': 22.20.1 jest-mock: 29.7.0 jest-util: 29.7.0 jsdom: 20.0.3(bufferutil@4.1.0)(utf-8-validate@5.0.10) @@ -20345,7 +20184,7 @@ snapshots: '@jest/environment': 27.5.1 '@jest/fake-timers': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 22.15.35 + '@types/node': 22.20.1 jest-mock: 27.5.1 jest-util: 27.5.1 @@ -20354,7 +20193,7 @@ snapshots: '@jest/environment': 29.7.0 '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 22.15.35 + '@types/node': 22.20.1 jest-mock: 29.7.0 jest-util: 29.7.0 @@ -20366,7 +20205,7 @@ snapshots: dependencies: '@jest/types': 27.5.1 '@types/graceful-fs': 4.1.9 - '@types/node': 22.15.35 + '@types/node': 22.20.1 anymatch: 3.1.3 fb-watchman: 2.0.2 graceful-fs: 4.2.11 @@ -20383,7 +20222,7 @@ snapshots: dependencies: '@jest/types': 29.6.3 '@types/graceful-fs': 4.1.9 - '@types/node': 22.15.35 + '@types/node': 22.20.1 anymatch: 3.1.3 fb-watchman: 2.0.2 graceful-fs: 4.2.11 @@ -20401,7 +20240,7 @@ snapshots: '@jest/source-map': 27.5.1 '@jest/test-result': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 22.15.35 + '@types/node': 22.20.1 chalk: 4.1.2 co: 4.6.0 expect: 27.5.1 @@ -20465,20 +20304,20 @@ snapshots: slash: 3.0.0 stack-utils: 2.0.6 - jest-mock-vscode@0.1.6(jest@29.7.0(@types/node@25.9.1)(ts-node@10.9.2(@types/node@25.9.1)(typescript@5.7.3))): + jest-mock-vscode@0.1.6(jest@29.7.0(@types/node@22.20.1)(ts-node@10.9.2(@types/node@22.20.1)(typescript@5.7.3))): dependencies: - jest: 29.7.0(@types/node@25.9.1)(ts-node@10.9.2(@types/node@25.9.1)(typescript@5.7.3)) + jest: 29.7.0(@types/node@22.20.1)(ts-node@10.9.2(@types/node@22.20.1)(typescript@5.7.3)) vscode-uri: 3.0.3 jest-mock@27.5.1: dependencies: '@jest/types': 27.5.1 - '@types/node': 22.15.35 + '@types/node': 22.20.1 jest-mock@29.7.0: dependencies: '@jest/types': 29.6.3 - '@types/node': 22.15.35 + '@types/node': 22.20.1 jest-util: 29.7.0 jest-pnp-resolver@1.2.3(jest-resolve@27.5.1): @@ -20540,7 +20379,7 @@ snapshots: '@jest/test-result': 27.5.1 '@jest/transform': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 22.15.35 + '@types/node': 22.20.1 chalk: 4.1.2 emittery: 0.8.1 graceful-fs: 4.2.11 @@ -20569,7 +20408,7 @@ snapshots: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 22.15.35 + '@types/node': 22.20.1 chalk: 4.1.2 emittery: 0.13.1 graceful-fs: 4.2.11 @@ -20624,7 +20463,7 @@ snapshots: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 22.15.35 + '@types/node': 22.20.1 chalk: 4.1.2 cjs-module-lexer: 1.4.3 collect-v8-coverage: 1.0.3 @@ -20648,7 +20487,7 @@ snapshots: jest-serializer@27.5.1: dependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 graceful-fs: 4.2.11 jest-snapshot@27.5.1: @@ -20708,7 +20547,7 @@ snapshots: jest-util@27.5.1: dependencies: '@jest/types': 27.5.1 - '@types/node': 22.15.35 + '@types/node': 22.20.1 chalk: 4.1.2 ci-info: 3.9.0 graceful-fs: 4.2.11 @@ -20717,7 +20556,7 @@ snapshots: jest-util@29.7.0: dependencies: '@jest/types': 29.6.3 - '@types/node': 22.15.35 + '@types/node': 22.20.1 chalk: 4.1.2 ci-info: 3.9.0 graceful-fs: 4.2.11 @@ -20745,7 +20584,7 @@ snapshots: dependencies: '@jest/test-result': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 22.15.35 + '@types/node': 22.20.1 ansi-escapes: 4.3.2 chalk: 4.1.2 jest-util: 27.5.1 @@ -20755,7 +20594,7 @@ snapshots: dependencies: '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 22.15.35 + '@types/node': 22.20.1 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.13.1 @@ -20764,22 +20603,22 @@ snapshots: jest-worker@27.5.1: dependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 merge-stream: 2.0.0 supports-color: 8.1.1 jest-worker@29.7.0: dependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 jest-util: 29.7.0 merge-stream: 2.0.0 supports-color: 8.1.1 - jest@27.5.1(bufferutil@4.1.0)(ts-node@10.9.2(@types/node@25.9.1)(typescript@5.7.3))(utf-8-validate@5.0.10): + jest@27.5.1(bufferutil@4.1.0)(ts-node@10.9.2(@types/node@22.20.1)(typescript@5.7.3))(utf-8-validate@5.0.10): dependencies: - '@jest/core': 27.5.1(bufferutil@4.1.0)(ts-node@10.9.2(@types/node@25.9.1)(typescript@5.7.3))(utf-8-validate@5.0.10) + '@jest/core': 27.5.1(bufferutil@4.1.0)(ts-node@10.9.2(@types/node@22.20.1)(typescript@5.7.3))(utf-8-validate@5.0.10) import-local: 3.0.3 - jest-cli: 27.5.1(bufferutil@4.1.0)(ts-node@10.9.2(@types/node@25.9.1)(typescript@5.7.3))(utf-8-validate@5.0.10) + jest-cli: 27.5.1(bufferutil@4.1.0)(ts-node@10.9.2(@types/node@22.20.1)(typescript@5.7.3))(utf-8-validate@5.0.10) transitivePeerDependencies: - bufferutil - canvas @@ -20787,24 +20626,12 @@ snapshots: - ts-node - utf-8-validate - jest@29.7.0(@types/node@22.15.35)(ts-node@10.9.2(@types/node@22.15.35)(typescript@5.7.3)): - dependencies: - '@jest/core': 29.7.0(ts-node@10.9.2(@types/node@22.15.35)(typescript@5.7.3)) - '@jest/types': 29.6.3 - import-local: 3.0.3 - jest-cli: 29.7.0(@types/node@22.15.35)(ts-node@10.9.2(@types/node@22.15.35)(typescript@5.7.3)) - transitivePeerDependencies: - - '@types/node' - - babel-plugin-macros - - supports-color - - ts-node - - jest@29.7.0(@types/node@25.9.1)(ts-node@10.9.2(@types/node@25.9.1)(typescript@5.7.3)): + jest@29.7.0(@types/node@22.20.1)(ts-node@10.9.2(@types/node@22.20.1)(typescript@5.7.3)): dependencies: - '@jest/core': 29.7.0(ts-node@10.9.2(@types/node@25.9.1)(typescript@5.7.3)) + '@jest/core': 29.7.0(ts-node@10.9.2(@types/node@22.20.1)(typescript@5.7.3)) '@jest/types': 29.6.3 import-local: 3.0.3 - jest-cli: 29.7.0(@types/node@25.9.1)(ts-node@10.9.2(@types/node@25.9.1)(typescript@5.7.3)) + jest-cli: 29.7.0(@types/node@22.20.1)(ts-node@10.9.2(@types/node@22.20.1)(typescript@5.7.3)) transitivePeerDependencies: - '@types/node' - babel-plugin-macros @@ -21617,31 +21444,7 @@ snapshots: - react-native-b4a - supports-color - mem-fs-editor@12.0.4(@types/node@22.15.35)(mem-fs@4.1.4): - dependencies: - '@types/ejs': 3.1.5 - '@types/picomatch': 4.0.3 - binaryextensions: 6.11.0 - commondir: 1.0.1 - debug: 4.4.3 - deep-extend: 0.6.0 - ejs: 5.0.2 - isbinaryfile: 5.0.7 - mem-fs: 4.1.4 - minimatch: 10.2.5 - multimatch: 8.0.0 - normalize-path: 3.0.0 - textextensions: 6.11.0 - tinyglobby: 0.2.17 - vinyl: 3.0.1 - optionalDependencies: - '@types/node': 22.15.35 - transitivePeerDependencies: - - bare-abort-controller - - react-native-b4a - - supports-color - - mem-fs-editor@12.0.4(@types/node@25.9.1)(mem-fs@4.1.4): + mem-fs-editor@12.0.4(@types/node@22.20.1)(mem-fs@4.1.4): dependencies: '@types/ejs': 3.1.5 '@types/picomatch': 4.0.3 @@ -21659,7 +21462,7 @@ snapshots: tinyglobby: 0.2.17 vinyl: 3.0.1 optionalDependencies: - '@types/node': 25.9.1 + '@types/node': 22.20.1 transitivePeerDependencies: - bare-abort-controller - react-native-b4a @@ -21689,7 +21492,7 @@ snapshots: mem-fs@4.1.4: dependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 '@types/vinyl': 2.0.12 vinyl: 3.0.1 vinyl-file: 5.0.0 @@ -22675,7 +22478,7 @@ snapshots: p-transform@5.0.1: dependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 p-queue: 8.1.1 p-try@2.2.0: {} @@ -24662,12 +24465,12 @@ snapshots: optionalDependencies: typescript: 5.7.3 - ts-jest@29.4.11(@babel/core@7.29.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.29.0))(jest-util@29.7.0)(jest@29.7.0(@types/node@22.15.35)(ts-node@10.9.2(@types/node@22.15.35)(typescript@5.7.3)))(typescript@5.7.3): + ts-jest@29.4.11(@babel/core@7.29.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.29.0))(jest-util@29.7.0)(jest@29.7.0(@types/node@22.20.1)(ts-node@10.9.2(@types/node@22.20.1)(typescript@5.7.3)))(typescript@5.7.3): dependencies: bs-logger: 0.2.6 fast-json-stable-stringify: 2.1.0 handlebars: 4.7.9 - jest: 29.7.0(@types/node@22.15.35)(ts-node@10.9.2(@types/node@22.15.35)(typescript@5.7.3)) + jest: 29.7.0(@types/node@22.20.1)(ts-node@10.9.2(@types/node@22.20.1)(typescript@5.7.3)) json5: 2.2.3 lodash.memoize: 4.1.2 make-error: 1.3.6 @@ -24729,33 +24532,14 @@ snapshots: v8-compile-cache-lib: 3.0.1 yn: 3.1.1 - ts-node@10.9.2(@types/node@22.15.35)(typescript@5.7.3): + ts-node@10.9.2(@types/node@22.20.1)(typescript@5.7.3): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.12 '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 22.15.35 - acorn: 8.16.0 - acorn-walk: 8.3.5 - arg: 4.1.3 - create-require: 1.1.1 - diff: 4.0.4 - make-error: 1.3.6 - typescript: 5.7.3 - v8-compile-cache-lib: 3.0.1 - yn: 3.1.1 - optional: true - - ts-node@10.9.2(@types/node@25.9.1)(typescript@5.7.3): - dependencies: - '@cspotcode/source-map-support': 0.8.1 - '@tsconfig/node10': 1.0.12 - '@tsconfig/node12': 1.0.11 - '@tsconfig/node14': 1.0.3 - '@tsconfig/node16': 1.0.4 - '@types/node': 25.9.1 + '@types/node': 22.20.1 acorn: 8.16.0 acorn-walk: 8.3.5 arg: 4.1.3 @@ -24919,9 +24703,6 @@ snapshots: undici-types@6.21.0: {} - undici-types@7.24.6: - optional: true - undici@6.27.0: {} undici@7.25.0: {} @@ -25138,17 +24919,17 @@ snapshots: - bare-abort-controller - react-native-b4a - vite-plugin-css-injected-by-js@3.5.2(vite@4.5.11(@types/node@22.15.35)(sass@1.56.1)(terser@5.48.0)): + vite-plugin-css-injected-by-js@3.5.2(vite@4.5.11(@types/node@22.20.1)(sass@1.56.1)(terser@5.48.0)): dependencies: - vite: 4.5.11(@types/node@22.15.35)(sass@1.56.1)(terser@5.48.0) + vite: 4.5.11(@types/node@22.20.1)(sass@1.56.1)(terser@5.48.0) - vite@4.5.11(@types/node@22.15.35)(sass@1.56.1)(terser@5.48.0): + vite@4.5.11(@types/node@22.20.1)(sass@1.56.1)(terser@5.48.0): dependencies: esbuild: 0.18.20 postcss: 8.5.15 rollup: 3.30.0 optionalDependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 fsevents: 2.3.3 sass: 1.56.1 terser: 5.48.0 @@ -25807,7 +25588,7 @@ snapshots: - react-native-b4a - supports-color - yeoman-environment@2.10.3(@types/node@25.9.1)(encoding@0.1.13): + yeoman-environment@2.10.3(@types/node@22.20.1)(encoding@0.1.13): dependencies: chalk: 2.4.2 debug: 3.2.7 @@ -25821,13 +25602,13 @@ snapshots: lodash: 4.18.1 log-symbols: 2.2.0 mem-fs: 4.1.4 - mem-fs-editor: 12.0.4(@types/node@25.9.1)(mem-fs@4.1.4) + mem-fs-editor: 12.0.4(@types/node@22.20.1)(mem-fs@4.1.4) npm-api: 1.0.1(debug@3.2.7)(encoding@0.1.13) semver: 7.6.3 strip-ansi: 4.0.0 text-table: 0.2.0 untildify: 3.0.3 - yeoman-generator: 4.13.0(@types/node@25.9.1)(encoding@0.1.13)(mem-fs@4.1.4) + yeoman-generator: 4.13.0(@types/node@22.20.1)(encoding@0.1.13)(mem-fs@4.1.4) transitivePeerDependencies: - '@types/node' - bare-abort-controller @@ -25836,7 +25617,7 @@ snapshots: - supports-color optional: true - yeoman-environment@3.19.3(@types/node@22.15.35): + yeoman-environment@3.19.3(@types/node@22.20.1): dependencies: '@npmcli/arborist': 4.3.1 are-we-there-yet: 2.0.0 @@ -25854,7 +25635,7 @@ snapshots: find-up: 5.0.0 globby: 11.1.0 grouped-queue: 2.1.0 - inquirer: 8.2.7(@types/node@22.15.35) + inquirer: 8.2.7(@types/node@22.20.1) is-scoped: 2.1.0 isbinaryfile: 4.0.10 lodash: 4.18.1 @@ -25982,7 +25763,7 @@ snapshots: - react-native-b4a - supports-color - yeoman-generator@4.13.0(@types/node@25.9.1)(encoding@0.1.13)(mem-fs@4.1.4): + yeoman-generator@4.13.0(@types/node@22.20.1)(encoding@0.1.13)(mem-fs@4.1.4): dependencies: async: 2.6.4 chalk: 2.4.2 @@ -25998,7 +25779,7 @@ snapshots: istextorbinary: 2.6.0 lodash: 4.18.1 make-dir: 3.1.0 - mem-fs-editor: 12.0.4(@types/node@25.9.1)(mem-fs@4.1.4) + mem-fs-editor: 12.0.4(@types/node@22.20.1)(mem-fs@4.1.4) minimist: 1.2.8 pretty-bytes: 5.6.0 read-chunk: 3.2.0 @@ -26011,7 +25792,7 @@ snapshots: through2: 3.0.2 optionalDependencies: grouped-queue: 1.1.0 - yeoman-environment: 2.10.3(@types/node@25.9.1)(encoding@0.1.13) + yeoman-environment: 2.10.3(@types/node@22.20.1)(encoding@0.1.13) transitivePeerDependencies: - '@types/node' - bare-abort-controller @@ -26131,19 +25912,19 @@ snapshots: - react-native-b4a - supports-color - yeoman-generator@8.2.2(@types/node@22.15.35)(@yeoman/types@1.11.1(@types/node@22.15.35)(@yeoman/adapter@4.0.2(@types/node@22.15.35))(mem-fs@4.1.4))(mem-fs@4.1.4): + yeoman-generator@8.2.2(@types/node@22.20.1)(@yeoman/types@1.11.1(@types/node@22.20.1)(@yeoman/adapter@4.0.2(@types/node@22.20.1))(mem-fs@4.1.4))(mem-fs@4.1.4): dependencies: '@types/debug': 4.1.13 '@types/lodash-es': 4.17.12 '@yeoman/namespace': 2.1.0 - '@yeoman/types': 1.11.1(@types/node@22.15.35)(@yeoman/adapter@4.0.2(@types/node@22.15.35))(mem-fs@4.1.4) + '@yeoman/types': 1.11.1(@types/node@22.20.1)(@yeoman/adapter@4.0.2(@types/node@22.20.1))(mem-fs@4.1.4) chalk: 5.6.2 debug: 4.4.3 execa: 9.6.1 latest-version: 9.0.0 lodash-es: 4.18.1 mem-fs: 4.1.4 - mem-fs-editor: 12.0.4(@types/node@22.15.35)(mem-fs@4.1.4) + mem-fs-editor: 12.0.4(@types/node@22.20.1)(mem-fs@4.1.4) minimist: 1.2.8 read-package-up: 12.0.0 semver: 7.8.1 @@ -26152,7 +25933,7 @@ snapshots: text-table: 0.2.0 type-fest: 5.8.0 optionalDependencies: - '@types/node': 22.15.35 + '@types/node': 22.20.1 transitivePeerDependencies: - bare-abort-controller - react-native-b4a diff --git a/projects/vscode-logging/packages/logger/tsconfig.json b/projects/vscode-logging/packages/logger/tsconfig.json index 73664b24..1c8d916d 100644 --- a/projects/vscode-logging/packages/logger/tsconfig.json +++ b/projects/vscode-logging/packages/logger/tsconfig.json @@ -3,8 +3,7 @@ "module": "commonjs", "noEmit": true, "checkJs": true, - "allowJs": true, - "skipLibCheck": true + "allowJs": true }, "include": ["./lib/**/*.js", "./api.d.ts", "./test/output-channel-spec.ts"] } diff --git a/projects/vscode-logging/packages/types/tsconfig.json b/projects/vscode-logging/packages/types/tsconfig.json index d868fba7..0fe00695 100644 --- a/projects/vscode-logging/packages/types/tsconfig.json +++ b/projects/vscode-logging/packages/types/tsconfig.json @@ -1,8 +1,6 @@ { "compilerOptions": { - "noEmit": true, - "target": "ES2015", - "skipLibCheck": true + "noEmit": true }, "include": ["./"] } diff --git a/projects/vscode-logging/packages/wrapper/tsconfig.json b/projects/vscode-logging/packages/wrapper/tsconfig.json index fe605b02..3de9cb2a 100644 --- a/projects/vscode-logging/packages/wrapper/tsconfig.json +++ b/projects/vscode-logging/packages/wrapper/tsconfig.json @@ -3,8 +3,7 @@ "compilerOptions": { "rootDir": ".", "outDir": "dist", - "baseUrl": ".", - "skipLibCheck": true + "baseUrl": "." }, "include": ["./src/**/*.ts", "./test/**/*.ts", "./api.d.ts"] } From 056ad902024c8533500cbf556ca985fb0880370a Mon Sep 17 00:00:00 2001 From: Jacob Kreyenbuehl Date: Wed, 26 Aug 2026 09:17:30 +0200 Subject: [PATCH 15/20] chore: lock @vscode-logging packages as a fixed changeset group Per review (bd82): the source vscode-logging used lerna fixed/locked mode (all packages version together). Mirror that with a fixed group in the Changesets config so logger, types and wrapper always bump as one, avoiding multiple versions of sibling packages at runtime. Examples are excluded (unpublished; locking them would only add release-tag noise). Signed-off-by: Jacob Kreyenbuehl --- .changeset/config.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.changeset/config.json b/.changeset/config.json index 334610b5..ed771077 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -11,7 +11,12 @@ "sample-action-client", "vscode-using-workspace-api" ], - ["yeoman-ui", "yeoman-ui-frontend"] + ["yeoman-ui", "yeoman-ui-frontend"], + [ + "@vscode-logging/logger", + "@vscode-logging/types", + "@vscode-logging/wrapper" + ] ], "linked": [], "access": "restricted", From b8e2f53daddb2fd091d2e1c3868f3bc49eb18cd1 Mon Sep 17 00:00:00 2001 From: Jacob Kreyenbuehl Date: Wed, 26 Aug 2026 09:18:59 +0200 Subject: [PATCH 16/20] chore: rename per-package changelogs to CHANGELOG.old.md and drop example changelogs Per review (bd82): Changesets generates a fresh per-package CHANGELOG.md on release and mixing it with the old conventional-commits changelog breaks it (same reason the project-level file was renamed). Rename logger/types/wrapper CHANGELOG.md to CHANGELOG.old.md and add both to each package's files array so they ship in the npm artifact. Delete the example changelogs (unpublished, they only confuse Changesets). Signed-off-by: Jacob Kreyenbuehl --- .../examples/extension-wrapper/CHANGELOG.md | 86 -------------- .../examples/extension/CHANGELOG.md | 111 ------------------ .../examples/library/CHANGELOG.md | 67 ----------- .../logger/{CHANGELOG.md => CHANGELOG.old.md} | 0 .../packages/logger/package.json | 4 +- .../types/{CHANGELOG.md => CHANGELOG.old.md} | 0 .../packages/types/package.json | 4 +- .../{CHANGELOG.md => CHANGELOG.old.md} | 0 .../packages/wrapper/package.json | 4 +- 9 files changed, 9 insertions(+), 267 deletions(-) delete mode 100644 projects/vscode-logging/examples/extension-wrapper/CHANGELOG.md delete mode 100644 projects/vscode-logging/examples/extension/CHANGELOG.md delete mode 100644 projects/vscode-logging/examples/library/CHANGELOG.md rename projects/vscode-logging/packages/logger/{CHANGELOG.md => CHANGELOG.old.md} (100%) rename projects/vscode-logging/packages/types/{CHANGELOG.md => CHANGELOG.old.md} (100%) rename projects/vscode-logging/packages/wrapper/{CHANGELOG.md => CHANGELOG.old.md} (100%) diff --git a/projects/vscode-logging/examples/extension-wrapper/CHANGELOG.md b/projects/vscode-logging/examples/extension-wrapper/CHANGELOG.md deleted file mode 100644 index 6651b6d9..00000000 --- a/projects/vscode-logging/examples/extension-wrapper/CHANGELOG.md +++ /dev/null @@ -1,86 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## [2.0.9](https://github.com/SAP/vscode-logging/compare/v2.0.8...v2.0.9) (2026-04-16) - -**Note:** Version bump only for package vscode-logging-extension-wrapper-example - -## [2.0.8](https://github.com/SAP/vscode-logging/compare/v2.0.7...v2.0.8) (2026-02-18) - -**Note:** Version bump only for package vscode-logging-extension-wrapper-example - -## [2.0.7](https://github.com/SAP/vscode-logging/compare/v2.0.6...v2.0.7) (2026-02-18) - -**Note:** Version bump only for package vscode-logging-extension-wrapper-example - -## [2.0.6](https://github.com/SAP/vscode-logging/compare/v2.0.5...v2.0.6) (2026-02-18) - -**Note:** Version bump only for package vscode-logging-extension-wrapper-example - -## [2.0.5](https://github.com/SAP/vscode-logging/compare/v2.0.4...v2.0.5) (2026-02-18) - -**Note:** Version bump only for package vscode-logging-extension-wrapper-example - -## [2.0.4](https://github.com/SAP/vscode-logging/compare/v2.0.3...v2.0.4) (2026-02-18) - -**Note:** Version bump only for package vscode-logging-extension-wrapper-example - -## [2.0.3](https://github.com/SAP/vscode-logging/compare/v2.0.2...v2.0.3) (2026-02-17) - -**Note:** Version bump only for package vscode-logging-extension-wrapper-example - -## [2.0.2](https://github.com/SAP/vscode-logging/compare/v2.0.1...v2.0.2) (2026-02-17) - -**Note:** Version bump only for package vscode-logging-extension-wrapper-example - -## [2.0.1](https://github.com/SAP/vscode-logging/compare/v2.0.0...v2.0.1) (2026-02-15) - -### Bug Fixes - -- examples fix ([#242](https://github.com/SAP/vscode-logging/issues/242)) ([09afea5](https://github.com/SAP/vscode-logging/commit/09afea515f76238e2761c9cf5849bda589204794)) -- workspace protocol ([#243](https://github.com/SAP/vscode-logging/issues/243)) ([3091351](https://github.com/SAP/vscode-logging/commit/30913512554b29590b16bce4ad2a1eb3890b5dc9)) - -# 2.0.0 (2024-01-05) - -### Bug Fixes - -- typo in the logging.level configuration description ([#181](https://github.com/SAP/vscode-logging/issues/181)) ([c05b17d](https://github.com/SAP/vscode-logging/commit/c05b17d4348e89f27a3cb86f2e20bc190cdf1afb)) - -### Features - -- **wrapper:** remove dep to @types/vscode ([#167](https://github.com/SAP/vscode-logging/issues/167)) ([b362e5c](https://github.com/SAP/vscode-logging/commit/b362e5c3b11020ab09a5e705d7834fa53e8bd48e)) -- logger wrapper package ([#163](https://github.com/SAP/vscode-logging/issues/163)) ([fc6abc5](https://github.com/SAP/vscode-logging/commit/fc6abc5ea43403c3039edb8589c68a0a339e5ebc)) - -### BREAKING CHANGES - -- **wrapper:** `getConfigurations` and `onDidChangeConfiguration` properties - were removed from the `configureLogger` public API - -## [1.0.2](https://github.com/SAP/vscode-logging/compare/vscode-logging-extension-wrapper-example@1.0.1...vscode-logging-extension-wrapper-example@1.0.2) (2021-09-12) - -**Note:** Version bump only for package vscode-logging-extension-wrapper-example - -## [1.0.1](https://github.com/SAP/vscode-logging/compare/vscode-logging-extension-wrapper-example@1.0.0...vscode-logging-extension-wrapper-example@1.0.1) (2021-04-13) - -### Bug Fixes - -- typo in the logging.level configuration description ([#181](https://github.com/SAP/vscode-logging/issues/181)) ([c05b17d](https://github.com/SAP/vscode-logging/commit/c05b17d4348e89f27a3cb86f2e20bc190cdf1afb)) - -# [1.0.0](https://github.com/SAP/vscode-logging/compare/vscode-logging-extension-wrapper-example@0.2.0...vscode-logging-extension-wrapper-example@1.0.0) (2021-02-10) - -### Features - -- **wrapper:** remove dep to @types/vscode ([#167](https://github.com/SAP/vscode-logging/issues/167)) ([b362e5c](https://github.com/SAP/vscode-logging/commit/b362e5c3b11020ab09a5e705d7834fa53e8bd48e)) - -### BREAKING CHANGES - -- **wrapper:** `getConfigurations` and `onDidChangeConfiguration` properties - were removed from the `configureLogger` public API - -# 0.2.0 (2021-02-07) - -### Features - -- logger wrapper package ([#163](https://github.com/SAP/vscode-logging/issues/163)) ([fc6abc5](https://github.com/SAP/vscode-logging/commit/fc6abc5ea43403c3039edb8589c68a0a339e5ebc)) diff --git a/projects/vscode-logging/examples/extension/CHANGELOG.md b/projects/vscode-logging/examples/extension/CHANGELOG.md deleted file mode 100644 index e909a226..00000000 --- a/projects/vscode-logging/examples/extension/CHANGELOG.md +++ /dev/null @@ -1,111 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## [2.0.9](https://github.com/SAP/vscode-logging/compare/v2.0.8...v2.0.9) (2026-04-16) - -**Note:** Version bump only for package vscode-logging-extension-example - -## [2.0.8](https://github.com/SAP/vscode-logging/compare/v2.0.7...v2.0.8) (2026-02-18) - -**Note:** Version bump only for package vscode-logging-extension-example - -## [2.0.7](https://github.com/SAP/vscode-logging/compare/v2.0.6...v2.0.7) (2026-02-18) - -**Note:** Version bump only for package vscode-logging-extension-example - -## [2.0.6](https://github.com/SAP/vscode-logging/compare/v2.0.5...v2.0.6) (2026-02-18) - -**Note:** Version bump only for package vscode-logging-extension-example - -## [2.0.5](https://github.com/SAP/vscode-logging/compare/v2.0.4...v2.0.5) (2026-02-18) - -**Note:** Version bump only for package vscode-logging-extension-example - -## [2.0.4](https://github.com/SAP/vscode-logging/compare/v2.0.3...v2.0.4) (2026-02-18) - -**Note:** Version bump only for package vscode-logging-extension-example - -## [2.0.3](https://github.com/SAP/vscode-logging/compare/v2.0.2...v2.0.3) (2026-02-17) - -**Note:** Version bump only for package vscode-logging-extension-example - -## [2.0.2](https://github.com/SAP/vscode-logging/compare/v2.0.1...v2.0.2) (2026-02-17) - -**Note:** Version bump only for package vscode-logging-extension-example - -## [2.0.1](https://github.com/SAP/vscode-logging/compare/v2.0.0...v2.0.1) (2026-02-15) - -### Bug Fixes - -- examples fix ([#242](https://github.com/SAP/vscode-logging/issues/242)) ([09afea5](https://github.com/SAP/vscode-logging/commit/09afea515f76238e2761c9cf5849bda589204794)) -- upgrade lodash to version 4.17.23 ([#241](https://github.com/SAP/vscode-logging/issues/241)) ([69fc2ce](https://github.com/SAP/vscode-logging/commit/69fc2ce233e960219efca1118027638cc115874c)) -- workspace protocol ([#243](https://github.com/SAP/vscode-logging/issues/243)) ([3091351](https://github.com/SAP/vscode-logging/commit/30913512554b29590b16bce4ad2a1eb3890b5dc9)) - -# 2.0.0 (2024-01-05) - -### Bug Fixes - -- typo in the logging.level configuration description ([#181](https://github.com/SAP/vscode-logging/issues/181)) ([c05b17d](https://github.com/SAP/vscode-logging/commit/c05b17d4348e89f27a3cb86f2e20bc190cdf1afb)) - -### Features - -- initial Commit ([ee780af](https://github.com/SAP/vscode-logging/commit/ee780afa90dc17cfac91a28cb2921728c1cc4489)) -- support console as log target ([#109](https://github.com/SAP/vscode-logging/issues/109)) ([ea16211](https://github.com/SAP/vscode-logging/commit/ea16211a5e2fbcdc86f4e96c8c60eaaf440d2431)) - -* Make OutputChannel optional. (#55) ([b7fa564](https://github.com/SAP/vscode-logging/commit/b7fa56436693df9787f8ea720559beb3b0566612)), closes [#55](https://github.com/SAP/vscode-logging/issues/55) [#55](https://github.com/SAP/vscode-logging/issues/55) - -### BREAKING CHANGES - -- OutputChannel will not be created inside the logger as today. Alternatively, it - will be added as an optional parameter. The VS Code Extension will be able to create the - OutputChannel and send it to the logger as a parameter. - -## [1.1.3](https://github.com/SAP/vscode-logging/compare/vscode-logging-extension-example@1.1.2...vscode-logging-extension-example@1.1.3) (2021-04-13) - -### Bug Fixes - -- typo in the logging.level configuration description ([#181](https://github.com/SAP/vscode-logging/issues/181)) ([c05b17d](https://github.com/SAP/vscode-logging/commit/c05b17d4348e89f27a3cb86f2e20bc190cdf1afb)) - -## [1.1.2](https://github.com/SAP/vscode-logging/compare/vscode-logging-extension-example@1.1.1...vscode-logging-extension-example@1.1.2) (2020-12-10) - -**Note:** Version bump only for package vscode-logging-extension-example - -## [1.1.1](https://github.com/SAP/vscode-logging/compare/vscode-logging-extension-example@1.1.0...vscode-logging-extension-example@1.1.1) (2020-11-12) - -**Note:** Version bump only for package vscode-logging-extension-example - -# [1.1.0](https://github.com/SAP/vscode-logging/compare/vscode-logging-extension-example@1.0.1...vscode-logging-extension-example@1.1.0) (2020-07-29) - -### Features - -- support console as log target ([#109](https://github.com/SAP/vscode-logging/issues/109)) ([ea16211](https://github.com/SAP/vscode-logging/commit/ea16211a5e2fbcdc86f4e96c8c60eaaf440d2431)) - -## [1.0.1](https://github.com/SAP/vscode-logging/compare/vscode-logging-extension-example@1.0.0...vscode-logging-extension-example@1.0.1) (2020-05-21) - -**Note:** Version bump only for package vscode-logging-extension-example - -# [1.0.0](https://github.com/SAP/vscode-logging/compare/vscode-logging-extension-example@0.1.2...vscode-logging-extension-example@1.0.0) (2020-04-16) - -- Make OutputChannel optional. (#55) ([b7fa564](https://github.com/SAP/vscode-logging/commit/b7fa56436693df9787f8ea720559beb3b0566612)), closes [#55](https://github.com/SAP/vscode-logging/issues/55) [#55](https://github.com/SAP/vscode-logging/issues/55) - -### BREAKING CHANGES - -- OutputChannel will not be created inside the logger as today. Alternatively, it - will be added as an optional parameter. The VS Code Extension will be able to create the - OutputChannel and send it to the logger as a parameter. - -## [0.1.2](https://github.com/SAP/vscode-logging/compare/vscode-logging-extension-example@0.1.1...vscode-logging-extension-example@0.1.2) (2020-02-19) - -**Note:** Version bump only for package vscode-logging-extension-example - -## [0.1.1](https://github.com/SAP/vscode-logging/compare/vscode-logging-extension-example@0.1.0...vscode-logging-extension-example@0.1.1) (2020-01-20) - -**Note:** Version bump only for package vscode-logging-extension-example - -# 0.1.0 (2020-01-14) - -### Features - -- initial Commit ([ee780af](https://github.com/SAP/vscode-logging/commit/ee780afa90dc17cfac91a28cb2921728c1cc4489)) diff --git a/projects/vscode-logging/examples/library/CHANGELOG.md b/projects/vscode-logging/examples/library/CHANGELOG.md deleted file mode 100644 index 4ae8338b..00000000 --- a/projects/vscode-logging/examples/library/CHANGELOG.md +++ /dev/null @@ -1,67 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## [2.0.8](https://github.com/sap/vscode-logging/compare/v2.0.7...v2.0.8) (2026-02-18) - -**Note:** Version bump only for package @vscode-logging/library-example - -## [2.0.7](https://github.com/sap/vscode-logging/compare/v2.0.6...v2.0.7) (2026-02-18) - -**Note:** Version bump only for package @vscode-logging/library-example - -## [2.0.6](https://github.com/sap/vscode-logging/compare/v2.0.5...v2.0.6) (2026-02-18) - -**Note:** Version bump only for package @vscode-logging/library-example - -## [2.0.5](https://github.com/sap/vscode-logging/compare/v2.0.4...v2.0.5) (2026-02-18) - -**Note:** Version bump only for package @vscode-logging/library-example - -## [2.0.4](https://github.com/sap/vscode-logging/compare/v2.0.3...v2.0.4) (2026-02-18) - -**Note:** Version bump only for package @vscode-logging/library-example - -## [2.0.3](https://github.com/sap/vscode-logging/compare/v2.0.2...v2.0.3) (2026-02-17) - -**Note:** Version bump only for package @vscode-logging/library-example - -## [2.0.2](https://github.com/sap/vscode-logging/compare/v2.0.1...v2.0.2) (2026-02-17) - -**Note:** Version bump only for package @vscode-logging/library-example - -## [2.0.1](https://github.com/sap/vscode-logging/compare/v2.0.0...v2.0.1) (2026-02-15) - -### Bug Fixes - -- examples fix ([#242](https://github.com/sap/vscode-logging/issues/242)) ([09afea5](https://github.com/sap/vscode-logging/commit/09afea515f76238e2761c9cf5849bda589204794)) -- workspace protocol ([#243](https://github.com/sap/vscode-logging/issues/243)) ([3091351](https://github.com/sap/vscode-logging/commit/30913512554b29590b16bce4ad2a1eb3890b5dc9)) - -# 2.0.0 (2024-01-05) - -### Features - -- initial Commit ([ee780af](https://github.com/sap/vscode-logging/commit/ee780afa90dc17cfac91a28cb2921728c1cc4489)) - -## [0.1.4](https://github.com/sap/vscode-logging/compare/@vscode-logging/library-example@0.1.3...@vscode-logging/library-example@0.1.4) (2021-04-13) - -**Note:** Version bump only for package @vscode-logging/library-example - -## [0.1.3](https://github.com/sap/vscode-logging/compare/@vscode-logging/library-example@0.1.2...@vscode-logging/library-example@0.1.3) (2020-11-12) - -**Note:** Version bump only for package @vscode-logging/library-example - -## [0.1.2](https://github.com/sap/vscode-logging/compare/@vscode-logging/library-example@0.1.1...@vscode-logging/library-example@0.1.2) (2020-02-19) - -**Note:** Version bump only for package @vscode-logging/library-example - -## [0.1.1](https://github.com/sap/vscode-logging/compare/@vscode-logging/library-example@0.1.0...@vscode-logging/library-example@0.1.1) (2020-01-20) - -**Note:** Version bump only for package @vscode-logging/library-example - -# 0.1.0 (2020-01-14) - -### Features - -- initial Commit ([ee780af](https://github.com/sap/vscode-logging/commit/ee780afa90dc17cfac91a28cb2921728c1cc4489)) diff --git a/projects/vscode-logging/packages/logger/CHANGELOG.md b/projects/vscode-logging/packages/logger/CHANGELOG.old.md similarity index 100% rename from projects/vscode-logging/packages/logger/CHANGELOG.md rename to projects/vscode-logging/packages/logger/CHANGELOG.old.md diff --git a/projects/vscode-logging/packages/logger/package.json b/projects/vscode-logging/packages/logger/package.json index 4a352c20..85c44ef7 100644 --- a/projects/vscode-logging/packages/logger/package.json +++ b/projects/vscode-logging/packages/logger/package.json @@ -10,7 +10,9 @@ ".reuse", "LICENSES", "lib", - "api.d.ts" + "api.d.ts", + "CHANGELOG.md", + "CHANGELOG.old.md" ], "main": "lib/api.js", "repository": { diff --git a/projects/vscode-logging/packages/types/CHANGELOG.md b/projects/vscode-logging/packages/types/CHANGELOG.old.md similarity index 100% rename from projects/vscode-logging/packages/types/CHANGELOG.md rename to projects/vscode-logging/packages/types/CHANGELOG.old.md diff --git a/projects/vscode-logging/packages/types/package.json b/projects/vscode-logging/packages/types/package.json index b0677d73..88fd536b 100644 --- a/projects/vscode-logging/packages/types/package.json +++ b/projects/vscode-logging/packages/types/package.json @@ -9,7 +9,9 @@ "files": [ ".reuse", "LICENSES", - "api.d.ts" + "api.d.ts", + "CHANGELOG.md", + "CHANGELOG.old.md" ], "repository": { "type": "git", diff --git a/projects/vscode-logging/packages/wrapper/CHANGELOG.md b/projects/vscode-logging/packages/wrapper/CHANGELOG.old.md similarity index 100% rename from projects/vscode-logging/packages/wrapper/CHANGELOG.md rename to projects/vscode-logging/packages/wrapper/CHANGELOG.old.md diff --git a/projects/vscode-logging/packages/wrapper/package.json b/projects/vscode-logging/packages/wrapper/package.json index 32ea2e18..2c9974b7 100644 --- a/projects/vscode-logging/packages/wrapper/package.json +++ b/projects/vscode-logging/packages/wrapper/package.json @@ -10,7 +10,9 @@ ".reuse", "LICENSES", "dist/src", - "api.d.ts" + "api.d.ts", + "CHANGELOG.md", + "CHANGELOG.old.md" ], "main": "dist/src/api.js", "repository": { From c8c2df5471e94022652eca12181a49fcb3952954 Mon Sep 17 00:00:00 2001 From: Jacob Kreyenbuehl Date: Wed, 26 Aug 2026 09:19:19 +0200 Subject: [PATCH 17/20] chore: use workspace:* for all intra-repo deps in vscode-logging Per review (bd82): standardize every workspace dependency (packages and examples) to workspace:* instead of workspace:^, matching the locked shared release lifecycle of the three productive packages. Avoids the edge case of workspace:^ being copied into a productive package and resolving to an unexpected version. Signed-off-by: Jacob Kreyenbuehl --- pnpm-lock.yaml | 14 +++++++------- .../examples/extension-wrapper/package.json | 4 ++-- .../vscode-logging/examples/extension/package.json | 2 +- .../vscode-logging/examples/library/package.json | 2 +- .../vscode-logging/packages/logger/package.json | 2 +- .../vscode-logging/packages/wrapper/package.json | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2c20e8f5..12959a65 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -576,7 +576,7 @@ importers: specifier: workspace:* version: link:../library '@vscode-logging/logger': - specifier: workspace:^ + specifier: workspace:* version: link:../../packages/logger devDependencies: '@types/vscode': @@ -586,26 +586,26 @@ importers: projects/vscode-logging/examples/extension-wrapper: dependencies: '@vscode-logging/wrapper': - specifier: workspace:^ + specifier: workspace:* version: link:../../packages/wrapper devDependencies: '@types/vscode': specifier: ^1.52.0 version: 1.75.0 '@vscode-logging/types': - specifier: workspace:^ + specifier: workspace:* version: link:../../packages/types projects/vscode-logging/examples/library: devDependencies: '@vscode-logging/types': - specifier: workspace:^ + specifier: workspace:* version: link:../../packages/types projects/vscode-logging/packages/logger: dependencies: '@vscode-logging/types': - specifier: workspace:^ + specifier: workspace:* version: link:../types fast-safe-stringify: specifier: 2.1.1 @@ -656,10 +656,10 @@ importers: projects/vscode-logging/packages/wrapper: dependencies: '@vscode-logging/logger': - specifier: workspace:^ + specifier: workspace:* version: link:../logger '@vscode-logging/types': - specifier: workspace:^ + specifier: workspace:* version: link:../types devDependencies: '@types/lodash': diff --git a/projects/vscode-logging/examples/extension-wrapper/package.json b/projects/vscode-logging/examples/extension-wrapper/package.json index 90448e27..6eb02606 100644 --- a/projects/vscode-logging/examples/extension-wrapper/package.json +++ b/projects/vscode-logging/examples/extension-wrapper/package.json @@ -53,11 +53,11 @@ } }, "dependencies": { - "@vscode-logging/wrapper": "workspace:^" + "@vscode-logging/wrapper": "workspace:*" }, "//@types/vscode": "Pinned to the minimum VS Code API version supported here (kept from the standalone vscode-logging repo). Intentionally not raised to the monorepo root version, which would allow newer APIs and break support for older VS Code.", "devDependencies": { "@types/vscode": "^1.52.0", - "@vscode-logging/types": "workspace:^" + "@vscode-logging/types": "workspace:*" } } diff --git a/projects/vscode-logging/examples/extension/package.json b/projects/vscode-logging/examples/extension/package.json index 458dc944..83581221 100644 --- a/projects/vscode-logging/examples/extension/package.json +++ b/projects/vscode-logging/examples/extension/package.json @@ -50,7 +50,7 @@ "scripts": {}, "dependencies": { "@vscode-logging/library-example": "workspace:*", - "@vscode-logging/logger": "workspace:^" + "@vscode-logging/logger": "workspace:*" }, "//@types/vscode": "Pinned to the minimum VS Code API version supported here (kept from the standalone vscode-logging repo). Intentionally not raised to the monorepo root version, which would allow newer APIs and break support for older VS Code.", "devDependencies": { diff --git a/projects/vscode-logging/examples/library/package.json b/projects/vscode-logging/examples/library/package.json index f0c63123..52803334 100644 --- a/projects/vscode-logging/examples/library/package.json +++ b/projects/vscode-logging/examples/library/package.json @@ -7,6 +7,6 @@ "repository": "https://github.com/sap/vscode-logging/", "license": "Apache-2.0", "devDependencies": { - "@vscode-logging/types": "workspace:^" + "@vscode-logging/types": "workspace:*" } } diff --git a/projects/vscode-logging/packages/logger/package.json b/projects/vscode-logging/packages/logger/package.json index 85c44ef7..8e15663d 100644 --- a/projects/vscode-logging/packages/logger/package.json +++ b/projects/vscode-logging/packages/logger/package.json @@ -26,7 +26,7 @@ "license": "Apache-2.0", "typings": "./api.d.ts", "dependencies": { - "@vscode-logging/types": "workspace:^", + "@vscode-logging/types": "workspace:*", "fast-safe-stringify": "2.1.1", "fs-extra": "11.2.0", "lodash": "4.18.1", diff --git a/projects/vscode-logging/packages/wrapper/package.json b/projects/vscode-logging/packages/wrapper/package.json index 2c9974b7..33d876f9 100644 --- a/projects/vscode-logging/packages/wrapper/package.json +++ b/projects/vscode-logging/packages/wrapper/package.json @@ -26,8 +26,8 @@ "license": "Apache-2.0", "typings": "./api.d.ts", "dependencies": { - "@vscode-logging/logger": "workspace:^", - "@vscode-logging/types": "workspace:^" + "@vscode-logging/logger": "workspace:*", + "@vscode-logging/types": "workspace:*" }, "//@types/vscode": "Pinned to the minimum VS Code API version supported here (kept from the standalone vscode-logging repo). Intentionally not raised to the monorepo root version, which would allow newer APIs and break support for older VS Code.", "devDependencies": { From de9c18608637256cc494257f5dc6906fcba2028a Mon Sep 17 00:00:00 2001 From: Jacob Kreyenbuehl Date: Wed, 26 Aug 2026 09:20:13 +0200 Subject: [PATCH 18/20] docs: fix vscode-logging package READMEs for the monorepo Per review (bd82): point issue and CONTRIBUTING links at SAP/app-studio-toolkit (the old ones pointed at the standalone repo or a CONTRIBUTING.md that no longer travels with the package), and remove the hand-written License/copyright section since scripts/legal-copy.js injects licensing at build time (it was duplication). Mirrors the vscode-mta-tools README. Signed-off-by: Jacob Kreyenbuehl --- projects/vscode-logging/packages/logger/README.md | 8 ++------ projects/vscode-logging/packages/types/README.md | 8 ++------ projects/vscode-logging/packages/wrapper/README.md | 10 +++------- 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/projects/vscode-logging/packages/logger/README.md b/projects/vscode-logging/packages/logger/README.md index 3f9d9cb4..b2fbc786 100644 --- a/projects/vscode-logging/packages/logger/README.md +++ b/projects/vscode-logging/packages/logger/README.md @@ -134,13 +134,9 @@ Important things to note on `sourceLocationTracking` ## Support -Please open [issues](https://github.com/SAP/vscode-logging/issues) on github. +Please report issues [here](https://github.com/SAP/app-studio-toolkit/issues/new/choose) and label them with `project:vscode-logging`. ## Contributing -See [CONTRIBUTING.md](./CONTRIBUTING.md). - -## License - -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. +See [CONTRIBUTING.md](https://github.com/SAP/app-studio-toolkit/blob/main/CONTRIBUTING.md). This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the [LICENSE file](../../LICENSE). diff --git a/projects/vscode-logging/packages/types/README.md b/projects/vscode-logging/packages/types/README.md index 9131eb27..eab92a3b 100644 --- a/projects/vscode-logging/packages/types/README.md +++ b/projects/vscode-logging/packages/types/README.md @@ -37,13 +37,9 @@ the type of your injected logger implementation. ## Support -Please open [issues](https://github.com/SAP/vscode-logging/issues) on github. +Please report issues [here](https://github.com/SAP/app-studio-toolkit/issues/new/choose) and label them with `project:vscode-logging`. ## Contributing -See [CONTRIBUTING.md](./CONTRIBUTING.md). - -## License - -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. +See [CONTRIBUTING.md](https://github.com/SAP/app-studio-toolkit/blob/main/CONTRIBUTING.md). This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the [LICENSE file](../../LICENSE). diff --git a/projects/vscode-logging/packages/wrapper/README.md b/projects/vscode-logging/packages/wrapper/README.md index 793770cd..9fc4d84c 100644 --- a/projects/vscode-logging/packages/wrapper/README.md +++ b/projects/vscode-logging/packages/wrapper/README.md @@ -18,17 +18,13 @@ Please see the [TypeScript Definitions](./api.d.ts) for full API details. ## Example -An example VSCode extension is available in the [examples' folder](https://github.com/SAP/vscode-logging/tree/master/examples/extension-wrapper). +An example VSCode extension is available in the [examples' folder](https://github.com/SAP/app-studio-toolkit/tree/main/projects/vscode-logging/examples/extension-wrapper). ## Support -Please open [issues](https://github.com/SAP/vscode-logging/issues) on github. +Please report issues [here](https://github.com/SAP/app-studio-toolkit/issues/new/choose) and label them with `project:vscode-logging`. ## Contributing -See [CONTRIBUTING.md](./CONTRIBUTING.md). - -## License - -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. +See [CONTRIBUTING.md](https://github.com/SAP/app-studio-toolkit/blob/main/CONTRIBUTING.md). This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the [LICENSE file](../../LICENSE). From b99a080d04bb6630151a930151b8bc8bf47ec38c Mon Sep 17 00:00:00 2001 From: Jacob Kreyenbuehl Date: Wed, 26 Aug 2026 09:20:47 +0200 Subject: [PATCH 19/20] docs: add a vscode-logging project README Per review (bd82): keep a project-level README explaining what vscode-logging is and listing its packages, so the projects/ hierarchy is self-describing (mirrors projects/vscode-mta-tools). Adapted from the old standalone repo root README, with links pointing at the monorepo. Signed-off-by: Jacob Kreyenbuehl --- projects/vscode-logging/README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 projects/vscode-logging/README.md diff --git a/projects/vscode-logging/README.md b/projects/vscode-logging/README.md new file mode 100644 index 00000000..1fd758fd --- /dev/null +++ b/projects/vscode-logging/README.md @@ -0,0 +1,28 @@ +[![REUSE status](https://api.reuse.software/badge/github.com/SAP/app-studio-toolkit)](https://api.reuse.software/info/github.com/SAP/app-studio-toolkit) + +# VSCode-Logging + +VSCode-Logging is a set of libraries for implementing logging functionality in [VSCode Extensions](https://code.visualstudio.com/api/get-started/your-first-extension). + +It contains the following packages: + +- [![npm-vscode-logging-logger][npm-vscode-logging-logger-image]][npm-vscode-logging-logger-url] [@vscode-logging/logger](./packages/logger) A logging library for VSCode Extensions. +- [![npm-vscode-logging-types][npm-vscode-logging-types-image]][npm-vscode-logging-types-url] [@vscode-logging/types](./packages/types) Common Logger Type Signatures for [Dependency Injection](https://en.wikipedia.org/wiki/Dependency_injection) scenarios. +- [![npm-vscode-logging-wrapper][npm-vscode-logging-wrapper-image]][npm-vscode-logging-wrapper-url] [@vscode-logging/wrapper](./packages/wrapper) An optional wrapper and utilities to reduce boilerplate when consuming @vscode-logging/logger. + +Usage examples are available in the [examples](./examples) folder. + +[npm-vscode-logging-logger-image]: https://img.shields.io/npm/v/@vscode-logging/logger.svg +[npm-vscode-logging-logger-url]: https://www.npmjs.com/package/@vscode-logging/logger +[npm-vscode-logging-types-image]: https://img.shields.io/npm/v/@vscode-logging/types.svg +[npm-vscode-logging-types-url]: https://www.npmjs.com/package/@vscode-logging/types +[npm-vscode-logging-wrapper-image]: https://img.shields.io/npm/v/@vscode-logging/wrapper.svg +[npm-vscode-logging-wrapper-url]: https://www.npmjs.com/package/@vscode-logging/wrapper + +## Support + +Please report issues [here](https://github.com/SAP/app-studio-toolkit/issues/new/choose) and label them with `project:vscode-logging`. + +## Contributing + +See [CONTRIBUTING.md](https://github.com/SAP/app-studio-toolkit/blob/main/CONTRIBUTING.md). From cc1a6a7531f34e1dae85b31c22b5412cae17ee2a Mon Sep 17 00:00:00 2001 From: Jacob Kreyenbuehl Date: Wed, 26 Aug 2026 09:31:15 +0200 Subject: [PATCH 20/20] docs: remove leftover manual license note from vscode-logging READMEs Follow-up to the README cleanup: the trailing 'This file is licensed ...' line had a dead link (../../LICENSE resolves to a non-existent projects/vscode-logging/ LICENSE) and is the same manual license duplication legal-copy.js already handles. Removing it from logger, types and wrapper, consistent with the vscode-mta-tools and yeoman-ui READMEs which do not carry it. Signed-off-by: Jacob Kreyenbuehl --- projects/vscode-logging/packages/logger/README.md | 1 - projects/vscode-logging/packages/types/README.md | 1 - projects/vscode-logging/packages/wrapper/README.md | 1 - 3 files changed, 3 deletions(-) diff --git a/projects/vscode-logging/packages/logger/README.md b/projects/vscode-logging/packages/logger/README.md index b2fbc786..c093ab30 100644 --- a/projects/vscode-logging/packages/logger/README.md +++ b/projects/vscode-logging/packages/logger/README.md @@ -139,4 +139,3 @@ Please report issues [here](https://github.com/SAP/app-studio-toolkit/issues/new ## Contributing See [CONTRIBUTING.md](https://github.com/SAP/app-studio-toolkit/blob/main/CONTRIBUTING.md). -This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the [LICENSE file](../../LICENSE). diff --git a/projects/vscode-logging/packages/types/README.md b/projects/vscode-logging/packages/types/README.md index eab92a3b..a5bf0925 100644 --- a/projects/vscode-logging/packages/types/README.md +++ b/projects/vscode-logging/packages/types/README.md @@ -42,4 +42,3 @@ Please report issues [here](https://github.com/SAP/app-studio-toolkit/issues/new ## Contributing See [CONTRIBUTING.md](https://github.com/SAP/app-studio-toolkit/blob/main/CONTRIBUTING.md). -This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the [LICENSE file](../../LICENSE). diff --git a/projects/vscode-logging/packages/wrapper/README.md b/projects/vscode-logging/packages/wrapper/README.md index 9fc4d84c..fa3db1f1 100644 --- a/projects/vscode-logging/packages/wrapper/README.md +++ b/projects/vscode-logging/packages/wrapper/README.md @@ -27,4 +27,3 @@ Please report issues [here](https://github.com/SAP/app-studio-toolkit/issues/new ## Contributing See [CONTRIBUTING.md](https://github.com/SAP/app-studio-toolkit/blob/main/CONTRIBUTING.md). -This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the [LICENSE file](../../LICENSE).