Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(react): add release option for @nx/react:lib --publishable #29776

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
46 changes: 46 additions & 0 deletions e2e/release/src/publishable-libraries-release.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import {
cleanupProject,
newProject,
runCLI,
runCommandAsync,
uniq,
} from '@nx/e2e/utils';

describe('publishable libraries release', () => {
beforeAll(async () => {
newProject({
packages: ['@nx/js', '@nx/react'],
});
// Normalize git committer information so it is deterministic in snapshots
await runCommandAsync(`git config user.email "[email protected]"`);
await runCommandAsync(`git config user.name "Test"`);
// Create a baseline version tag
await runCommandAsync(`git tag v0.0.0`);

// We need a valid git origin to exist for the commit references to work (and later the test for createRelease)
await runCommandAsync(
`git remote add origin https://github.com/nrwl/fake-repo.git`
);
});
afterAll(() => cleanupProject());

it('should be able release js publishable libraries', async () => {
const jsLib = uniq('js-lib');
runCLI(
`generate @nx/js:lib ${jsLib} --publishable --importPath=@proj/${jsLib}`
);

runCLI(`release --first-release`);
const versionOutput = runCLI(`release patch`);
expect(versionOutput).toContain('Executing pre-version command');
});

it('should be able release react publishable libraries', async () => {
const reactLib = uniq('react-lib');
runCLI(
`generate @nx/react:lib ${reactLib} --publishable --importPath=@proj/${reactLib}`
);
const versionOutput = runCLI(`release patch`);
expect(versionOutput).toContain('Executing pre-version command');
});
});
Loading