1
1
// @ts -check
2
2
3
3
const { 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' ) ;
5
5
const fs = require ( 'node:fs' ) ;
6
6
const path = require ( 'node:path' ) ;
7
7
@@ -69,12 +69,15 @@ async function runSetVersion() {
69
69
/**
70
70
* Custom afterAllProjectsVersioned hook for React Native macOS
71
71
* 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
74
74
* @returns {Promise<{changedFiles: string[], deletedFiles: string[]}> }
75
75
*/
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 ] ;
78
81
79
82
try {
80
83
// Create the .rnm-publish file to indicate versioning has occurred
@@ -83,7 +86,7 @@ const afterAllProjectsVersioned = async (_cwd, _opts) => {
83
86
// Update React Native artifacts
84
87
const versionedFiles = await runSetVersion ( ) ;
85
88
86
- // Return the versioned files so Nx can track them
89
+ // Add the versioned files to changed files
87
90
changedFiles . push ( ...versionedFiles ) ;
88
91
89
92
console . log ( '✅ Updated React Native artifacts' ) ;
@@ -96,7 +99,7 @@ const afterAllProjectsVersioned = async (_cwd, _opts) => {
96
99
97
100
return {
98
101
changedFiles,
99
- deletedFiles : [ ] ,
102
+ deletedFiles,
100
103
} ;
101
104
} ;
102
105
0 commit comments