From 73dc5c514b73d2a1a19562d21a3d264ec9103f65 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Thu, 31 Jul 2025 21:17:30 -0700 Subject: [PATCH] fix nx-release-version --- packages/nx-release-version/index.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/nx-release-version/index.js b/packages/nx-release-version/index.js index ca13686b3d00..c5b3cbbbfe83 100644 --- a/packages/nx-release-version/index.js +++ b/packages/nx-release-version/index.js @@ -1,7 +1,7 @@ // @ts-check const {REPO_ROOT} = require('../../scripts/consts'); -const JsVersionActions = require('@nx/js/src/release/version-actions').default; +const {default: JsVersionActions, afterAllProjectsVersioned: baseAfterAllProjectsVersioned} = require('@nx/js/src/release/version-actions'); const fs = require('node:fs'); const path = require('node:path'); @@ -69,12 +69,15 @@ async function runSetVersion() { /** * Custom afterAllProjectsVersioned hook for React Native macOS * Updates React Native artifacts after all projects have been versioned - * @param {string} _cwd - Current working directory (unused) - * @param {object} _opts - Options object containing versioning information (unused) + * @param {string} cwd - Current working directory + * @param {object} opts - Options object containing versioning information * @returns {Promise<{changedFiles: string[], deletedFiles: string[]}>} */ -const afterAllProjectsVersioned = async (_cwd, _opts) => { - const changedFiles = []; +const afterAllProjectsVersioned = async (cwd, opts) => { + const baseResult = await baseAfterAllProjectsVersioned(cwd, opts); + + const changedFiles = [...baseResult.changedFiles]; + const deletedFiles = [...baseResult.deletedFiles]; try { // Create the .rnm-publish file to indicate versioning has occurred @@ -83,7 +86,7 @@ const afterAllProjectsVersioned = async (_cwd, _opts) => { // Update React Native artifacts const versionedFiles = await runSetVersion(); - // Return the versioned files so Nx can track them + // Add the versioned files to changed files changedFiles.push(...versionedFiles); console.log('✅ Updated React Native artifacts'); @@ -96,7 +99,7 @@ const afterAllProjectsVersioned = async (_cwd, _opts) => { return { changedFiles, - deletedFiles: [], + deletedFiles, }; };