-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): switch
nx release changelog
to offline first with CHANG…
…ELOG.md files (#19327)
- Loading branch information
1 parent
d97a8d2
commit 2d70eb0
Showing
12 changed files
with
908 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
import { NxJsonConfiguration } from '@nx/devkit'; | ||
import { | ||
cleanupProject, | ||
createFile, | ||
exists, | ||
killProcessAndPorts, | ||
newProject, | ||
readFile, | ||
runCLI, | ||
runCommandAsync, | ||
runCommandUntil, | ||
uniq, | ||
updateJson, | ||
|
@@ -66,6 +70,18 @@ describe('nx release', () => { | |
afterAll(() => cleanupProject()); | ||
|
||
it('should version and publish multiple related npm packages with zero config', async () => { | ||
// 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`); | ||
|
||
// Add an example feature so that we can generate a CHANGELOG.md for it | ||
createFile('an-awesome-new-thing.js', 'console.log("Hello world!");'); | ||
await runCommandAsync( | ||
`git add --all && git commit -m "feat: an awesome new feature"` | ||
); | ||
|
||
const versionOutput = runCLI(`release version 999.9.9`); | ||
|
||
/** | ||
|
@@ -100,6 +116,42 @@ describe('nx release', () => { | |
).length | ||
).toEqual(1); | ||
|
||
// Generate a changelog for the new version | ||
expect(exists('CHANGELOG.md')).toEqual(false); | ||
|
||
const changelogOutput = runCLI(`release changelog 999.9.9`); | ||
expect(changelogOutput).toMatchInlineSnapshot(` | ||
> NX Generating a CHANGELOG.md entry for v999.9.9 | ||
+ ## v999.9.9 | ||
+ | ||
+ | ||
+ ### 🚀 Features | ||
+ | ||
+ - an awesome new feature | ||
+ | ||
+ ### ❤️ Thank You | ||
+ | ||
+ - Test | ||
`); | ||
|
||
expect(readFile('CHANGELOG.md')).toMatchInlineSnapshot(` | ||
## v999.9.9 | ||
### 🚀 Features | ||
- an awesome new feature | ||
### ❤️ Thank You | ||
- Test | ||
`); | ||
|
||
// This is the verdaccio instance that the e2e tests themselves are working from | ||
const e2eRegistryUrl = execSync('npm config get registry') | ||
.toString() | ||
|
Oops, something went wrong.
2d70eb0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
nx-dev – ./
nx-dev-git-master-nrwl.vercel.app
nx.dev
nx-five.vercel.app
nx-dev-nrwl.vercel.app