Skip to content

Commit a3d264e

Browse files
committed
fix(project): Ensure deprecated githubRelease config is also remapped from command.publish namespace
Fixes #2177
1 parent 4f893d1 commit a3d264e

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

core/project/__tests__/project.test.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,31 @@ Object {
170170
`);
171171
});
172172

173+
it("updates command.publish.githubRelease to command.version.createRelease", async () => {
174+
const cwd = await initFixture("basic");
175+
176+
await fs.writeJSON(path.resolve(cwd, "lerna.json"), {
177+
command: {
178+
publish: {
179+
githubRelease: true,
180+
},
181+
},
182+
version: "1.0.0",
183+
});
184+
185+
const project = new Project(cwd);
186+
187+
expect(project.config).toEqual({
188+
command: {
189+
publish: {},
190+
version: {
191+
createRelease: "github",
192+
},
193+
},
194+
version: "1.0.0",
195+
});
196+
});
197+
173198
it("throws an error when extend target is unresolvable", async () => {
174199
const cwd = await initFixture("extends-unresolved");
175200

core/project/lib/deprecate-config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ const path = require("path");
77
module.exports = compose(
88
// add new predicates HERE
99
remap("command.version.githubRelease", "command.version.createRelease", {
10+
toValue: value => value && "github",
11+
}),
12+
remap("command.publish.githubRelease", "command.version.createRelease", {
1013
alsoRoot: true,
1114
toValue: value => value && "github",
1215
}),

0 commit comments

Comments
 (0)