Skip to content

Commit

Permalink
fix(project): Ensure deprecated githubRelease config is also remapp…
Browse files Browse the repository at this point in the history
…ed from `command.publish` namespace

Fixes #2177
  • Loading branch information
evocateur committed Jul 16, 2019
1 parent 4f893d1 commit a3d264e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
25 changes: 25 additions & 0 deletions core/project/__tests__/project.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,31 @@ Object {
`);
});

it("updates command.publish.githubRelease to command.version.createRelease", async () => {
const cwd = await initFixture("basic");

await fs.writeJSON(path.resolve(cwd, "lerna.json"), {
command: {
publish: {
githubRelease: true,
},
},
version: "1.0.0",
});

const project = new Project(cwd);

expect(project.config).toEqual({
command: {
publish: {},
version: {
createRelease: "github",
},
},
version: "1.0.0",
});
});

it("throws an error when extend target is unresolvable", async () => {
const cwd = await initFixture("extends-unresolved");

Expand Down
3 changes: 3 additions & 0 deletions core/project/lib/deprecate-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const path = require("path");
module.exports = compose(
// add new predicates HERE
remap("command.version.githubRelease", "command.version.createRelease", {
toValue: value => value && "github",
}),
remap("command.publish.githubRelease", "command.version.createRelease", {
alsoRoot: true,
toValue: value => value && "github",
}),
Expand Down

0 comments on commit a3d264e

Please sign in to comment.