diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1261273fb..c686ad3bd 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -26,6 +26,48 @@ jobs: - run: cd gax; npm test env: MOCHA_THROW_DEPRECATION: false + test-logging-utils: + runs-on: ubuntu-latest + strategy: + matrix: + node: [14, 16] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + - run: node --version + # The first installation step ensures that all of our production + # dependencies work on the given Node.js version, this helps us find + # dependencies that don't match our engines field: + - run: cd logging-utils; npm install --production --engine-strict --ignore-scripts --no-package-lock + # Clean up the production install, before installing dev/production: + - run: cd logging-utils; rm -rf node_modules + - run: cd logging-utils; npm install + - run: cd logging-utils; npm test + env: + MOCHA_THROW_DEPRECATION: false + test-logging-utils-samples: + runs-on: ubuntu-latest + strategy: + matrix: + node: [14, 16] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + - run: node --version + # The first installation step ensures that all of our production + # dependencies work on the given Node.js version, this helps us find + # dependencies that don't match our engines field: + - run: cd logging-utils; npm install --production --engine-strict --ignore-scripts --no-package-lock + # Clean up the production install, before installing dev/production: + - run: cd logging-utils; rm -rf node_modules + - run: cd logging-utils; npm install + - run: cd logging-utils; npm run samples-test + env: + MOCHA_THROW_DEPRECATION: false test-tools: runs-on: ubuntu-latest strategy: @@ -69,6 +111,17 @@ jobs: - run: cd tools; npm test env: MOCHA_THROW_DEPRECATION: false + windows-logging-utils: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 14 + - run: cd logging-utils; npm install + - run: cd logging-utils; npm test + env: + MOCHA_THROW_DEPRECATION: false lint-gax: runs-on: ubuntu-latest steps: @@ -87,6 +140,15 @@ jobs: node-version: 14 - run: cd tools; npm install - run: cd tools; npm run lint + lint-logging-utils: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 14 + - run: cd logging-utils; npm install + - run: cd logging-utils; npm run lint docs: runs-on: ubuntu-latest steps: diff --git a/logging-utils/.eslintignore b/logging-utils/.eslintignore index ea5b04aeb..5c7dc7164 100644 --- a/logging-utils/.eslintignore +++ b/logging-utils/.eslintignore @@ -5,3 +5,5 @@ build/ docs/ protos/ samples/generated/ +samples/typescript/** +samples/system-test/** \ No newline at end of file diff --git a/logging-utils/package.json b/logging-utils/package.json index 6934e2095..765238c60 100644 --- a/logging-utils/package.json +++ b/logging-utils/package.json @@ -11,11 +11,11 @@ "test": "c8 mocha build/test", "lint": "gts check test src samples", "clean": "gts clean", - "compile": "tsc -p . && cp -r test/fixtures build/test", + "compile": "tsc -p .", "fix": "gts fix", "prepare": "npm run compile", "precompile": "gts clean", - "samples-test": "echo no samples 🙀", + "samples-test": "cd samples/ && npm install && npm test && cd ../", "system-test": "echo no system tests 🙀" }, "author": "Google API Authors", @@ -29,7 +29,7 @@ "@types/mocha": "^10.0.10", "@types/node": "^22.9.1", "c8": "^9.0.0", - "gts": "^5.0.0", + "gts": "^5.3.1", "mocha": "^9.0.0", "typescript": "^5.1.6" }, diff --git a/logging-utils/samples/javascript/quickstart.js b/logging-utils/samples/javascript/quickstart.js index e158d9461..c9f66094c 100644 --- a/logging-utils/samples/javascript/quickstart.js +++ b/logging-utils/samples/javascript/quickstart.js @@ -22,6 +22,7 @@ // usage: node quickstart.js // [!START logging_utils_quickstart] +// eslint-disable-next-line n/no-missing-require const {log} = require('google-logging-utils'); function main() { diff --git a/logging-utils/samples/package.json b/logging-utils/samples/package.json index 1083faa2d..5715d4fe6 100644 --- a/logging-utils/samples/package.json +++ b/logging-utils/samples/package.json @@ -27,7 +27,7 @@ "node": ">=14" }, "dependencies": { - "google-logging-utils": "^1.0.0" + "google-logging-utils": "0.0.2" }, "devDependencies": { "@google-cloud/typeless-sample-bot": "^2.1.0", diff --git a/logging-utils/src/logging-utils.ts b/logging-utils/src/logging-utils.ts index b36d36203..60e98dc19 100644 --- a/logging-utils/src/logging-utils.ts +++ b/logging-utils/src/logging-utils.ts @@ -359,6 +359,7 @@ export function getNodeBackend(): DebugLogBackend { // // Note: using the proper types here introduces an extra dependency // we don't want, so for the moment, they'll be notational only. +// eslint-disable-next-line @typescript-eslint/no-explicit-any type DebugPackage = any; // debug.Debug class DebugBackend extends DebugLogBackendBase { debugPkg: DebugPackage;