Skip to content

Commit

Permalink
fix(react-native): remove upgrade command in migration (nrwl#27467)
Browse files Browse the repository at this point in the history
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes nrwl#27357
  • Loading branch information
xiongemi authored Aug 22, 2024
1 parent cc322eb commit c0ebc16
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { addProjectConfiguration, getProjects, Tree } from '@nx/devkit';
import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing';
import update from './add-upgrade-target';

describe('add-upgrade-target', () => {
let tree: Tree;

beforeEach(async () => {
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'product', {
root: 'apps/product',
sourceRoot: 'apps/product/src',
targets: {
start: {
executor: '@nx/react-native:start',
options: {},
},
serve: {
executor: 'nx:run-commands',
options: {
command: 'nx start product',
},
},
},
});
});

it(`should add upgrade target`, async () => {
await update(tree);

getProjects(tree).forEach((project) => {
expect(project.targets?.['upgrade']).toEqual({
executor: '@nx/react-native:upgrade',
options: {},
});
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export default async function update(tree: Tree) {
executor: '@nx/react-native:upgrade',
options: {},
};
await runCliUpgrade(workspaceRoot, config.root);
}
if (
config.targets?.['pod-install']?.executor ===
Expand Down

0 comments on commit c0ebc16

Please sign in to comment.