From dbcfa49033b2fe03db9e59c009f7cd9434c7409b Mon Sep 17 00:00:00 2001 From: Christian Dinse Date: Thu, 15 Jan 2026 11:42:26 +0100 Subject: [PATCH] Add prepare script to run npm build after installing dependencies and when package is published --- .github/workflows/node.js.yml | 2 +- package.json | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 1df2a5b..33cb4b4 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -29,4 +29,4 @@ jobs: cache: 'npm' - run: npm ci - run: npm run test - - run: npm run coverage + - run: npm run test-coverage diff --git a/package.json b/package.json index 2bda62f..ceab45c 100644 --- a/package.json +++ b/package.json @@ -21,11 +21,12 @@ "homepage": "https://sap.github.io/cf-nodejs-logging-support/", "scripts": { "build": "npm run build-json-schema && tsc -p tsconfig.json", - "test": "npm run build-json-schema && tsc -p tsconfig.json && node build/main/index.js && mocha 'src/test/**/*.test.js'", + "build-json-schema": "typescript-json-schema 'src/lib/config/interfaces.ts' ConfigObject --noExtraProps --required --out 'src/lib/config/default/config-schema.json'", + "prepare": "npm run build", + "test": "npm run build && node build/main/index.js && mocha 'src/test/**/*.test.js'", "test-lint": "eslint src --ext .ts", "test-performance": "mocha 'src/performance-test/*.test.js'", - "build-json-schema": "typescript-json-schema 'src/lib/config/interfaces.ts' ConfigObject --noExtraProps --required --out 'src/lib/config/default/config-schema.json'", - "coverage": "nyc --reporter=lcov --reporter=text-summary npm run test" + "test-coverage": "nyc --reporter=lcov --reporter=text-summary npm run test" }, "engines": { "node": ">=14.14"