Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions packages/nx-release-version/index.js
Original file line number Diff line number Diff line change
@@ -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');

Expand Down Expand Up @@ -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
Expand All @@ -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');
Expand All @@ -96,7 +99,7 @@ const afterAllProjectsVersioned = async (_cwd, _opts) => {

return {
changedFiles,
deletedFiles: [],
deletedFiles,
};
};

Expand Down
Loading