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
@@ -66,12 +66,15 @@ async function runSetVersion() {
6666/**
6767 * Custom afterAllProjectsVersioned hook for React Native macOS
6868 * Updates React Native artifacts after all projects have been versioned
69- * @param {string } _cwd - Current working directory (unused)
70- * @param {object } _opts - Options object containing versioning information (unused)
69+ * @param {string } cwd - Current working directory
70+ * @param {object } opts - Options object containing versioning information
7171 * @returns {Promise<{changedFiles: string[], deletedFiles: string[]}> }
7272 */
73- const afterAllProjectsVersioned = async ( _cwd , _opts ) => {
74- const changedFiles = [ ] ;
73+ const afterAllProjectsVersioned = async ( cwd , opts ) => {
74+ const baseResult = await baseAfterAllProjectsVersioned ( cwd , opts ) ;
75+
76+ const changedFiles = [ ...baseResult . changedFiles ] ;
77+ const deletedFiles = [ ...baseResult . deletedFiles ] ;
7578
7679 try {
7780 // Create the .rnm-publish file to indicate versioning has occurred
@@ -80,7 +83,7 @@ const afterAllProjectsVersioned = async (_cwd, _opts) => {
8083 // Update React Native artifacts
8184 const versionedFiles = await runSetVersion ( ) ;
8285
83- // Return the versioned files so Nx can track them
86+ // Add the versioned files to changed files
8487 changedFiles . push ( ...versionedFiles ) ;
8588
8689 console . log ( '✅ Updated React Native artifacts' ) ;
@@ -93,7 +96,7 @@ const afterAllProjectsVersioned = async (_cwd, _opts) => {
9396
9497 return {
9598 changedFiles,
96- deletedFiles : [ ] ,
99+ deletedFiles,
97100 } ;
98101} ;
99102
0 commit comments