11// @ts -check
22
33const { REPO_ROOT } = require ( '../../scripts/consts' ) ;
4- const JsVersionActions = require ( '@nx/js/src/release/version-actions' ) . default ;
4+ const { default : JsVersionActions , afterAllProjectsVersioned : baseAfterAllProjectsVersioned } = require ( '@nx/js/src/release/version-actions' ) ;
55const fs = require ( 'node:fs' ) ;
66const path = require ( 'node:path' ) ;
77
@@ -69,12 +69,15 @@ async function runSetVersion() {
6969/**
7070 * Custom afterAllProjectsVersioned hook for React Native macOS
7171 * Updates React Native artifacts after all projects have been versioned
72- * @param {string } _cwd - Current working directory (unused)
73- * @param {object } _opts - Options object containing versioning information (unused)
72+ * @param {string } cwd - Current working directory
73+ * @param {object } opts - Options object containing versioning information
7474 * @returns {Promise<{changedFiles: string[], deletedFiles: string[]}> }
7575 */
76- const afterAllProjectsVersioned = async ( _cwd , _opts ) => {
77- const changedFiles = [ ] ;
76+ const afterAllProjectsVersioned = async ( cwd , opts ) => {
77+ const baseResult = await baseAfterAllProjectsVersioned ( cwd , opts ) ;
78+
79+ const changedFiles = [ ...baseResult . changedFiles ] ;
80+ const deletedFiles = [ ...baseResult . deletedFiles ] ;
7881
7982 try {
8083 // Create the .rnm-publish file to indicate versioning has occurred
@@ -83,7 +86,7 @@ const afterAllProjectsVersioned = async (_cwd, _opts) => {
8386 // Update React Native artifacts
8487 const versionedFiles = await runSetVersion ( ) ;
8588
86- // Return the versioned files so Nx can track them
89+ // Add the versioned files to changed files
8790 changedFiles . push ( ...versionedFiles ) ;
8891
8992 console . log ( '✅ Updated React Native artifacts' ) ;
@@ -96,7 +99,7 @@ const afterAllProjectsVersioned = async (_cwd, _opts) => {
9699
97100 return {
98101 changedFiles,
99- deletedFiles : [ ] ,
102+ deletedFiles,
100103 } ;
101104} ;
102105
0 commit comments