From 7921555d525ed72ccd10fbea5c41efeee8732aa9 Mon Sep 17 00:00:00 2001 From: Marika Marszalkowski Date: Fri, 13 Sep 2024 09:57:12 +0200 Subject: [PATCH] logs --- .../actions/changesets-fixed-version-bump/index.js | 12 ++++++++++++ build-packages/changesets-fixed-version-bump/util.ts | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/.github/actions/changesets-fixed-version-bump/index.js b/.github/actions/changesets-fixed-version-bump/index.js index f7e946c145..057ec271b2 100644 --- a/.github/actions/changesets-fixed-version-bump/index.js +++ b/.github/actions/changesets-fixed-version-bump/index.js @@ -16,6 +16,7 @@ exports.transformFile = transformFile; exports.getNextVersion = getNextVersion; const promises_1 = __nccwpck_require__(93977); const node_fs_1 = __nccwpck_require__(87561); +const node_console_1 = __nccwpck_require__(40027); const get_release_plan_1 = __importDefault(__nccwpck_require__(49180)); const semver_1 = __nccwpck_require__(77546); function getPackageVersion(pathToRootPackageJson) { @@ -31,11 +32,14 @@ async function transformFile(filePath, transformFn) { const bumpTypeOrder = ['major', 'minor', 'patch', 'none']; async function getNextVersion() { const currentVersion = getPackageVersion(); + (0, node_console_1.info)(`Current version: ${currentVersion}`); const releasePlan = await (0, get_release_plan_1.default)(process.cwd()); + (0, node_console_1.info)(`Release plan: ${JSON.stringify(releasePlan)}`); const versionIncreases = releasePlan.releases .map(({ type }) => bumpTypeOrder.indexOf(type)) .sort((a, b) => b - a); const bumpType = bumpTypeOrder[Math.min(...versionIncreases)]; + (0, node_console_1.info)(`Bump type: ${bumpType}`); if (bumpType === 'none' || !bumpType) { throw new Error(`No changesets to release`); } @@ -81859,6 +81863,14 @@ module.exports = require("net"); /***/ }), +/***/ 40027: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:console"); + +/***/ }), + /***/ 15673: /***/ ((module) => { diff --git a/build-packages/changesets-fixed-version-bump/util.ts b/build-packages/changesets-fixed-version-bump/util.ts index 05074cd51e..0eb466021f 100644 --- a/build-packages/changesets-fixed-version-bump/util.ts +++ b/build-packages/changesets-fixed-version-bump/util.ts @@ -2,6 +2,7 @@ import { readFile, writeFile } from 'node:fs/promises'; import { PathLike, readFileSync } from 'node:fs'; +import { info } from 'node:console'; import getReleasePlan from '@changesets/get-release-plan'; import { inc } from 'semver'; @@ -32,12 +33,16 @@ export async function getNextVersion(): Promise<{ bumpType: (typeof bumpTypeOrder)[number]; }> { const currentVersion = getPackageVersion(); + info(`Current version: ${currentVersion}`); const releasePlan = await getReleasePlan(process.cwd()); + info(`Release plan: ${JSON.stringify(releasePlan)}`); + const versionIncreases = releasePlan.releases .map(({ type }) => bumpTypeOrder.indexOf(type)) .sort((a, b) => b - a); const bumpType = bumpTypeOrder[Math.min(...versionIncreases)]; + info(`Bump type: ${bumpType}`); if (bumpType === 'none' || !bumpType) { throw new Error(`No changesets to release`);