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

feat!: remove deprecated --resolve-conflicts #1193

Open
wants to merge 1 commit 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ This will update your app or addon to the latest Ember CLI version. It does this

This is different from the existing `ember init` command. That command tries to reset your project back to a brand new project. It removes all your changes and additions.

You will probably encounter merge conflicts, in which the default behavior is to let you resolve conflicts on your own. You can supply the `--resolve-conflicts` option to run your system's git merge tool if any conflicts are found.
You will probably encounter merge conflicts, in which the default behavior is to let you resolve conflicts on your own. If any conflicts are found, you can run your system's git merge tool via `git mergetool`.

This tool can also run codemods for you. The option `--run-codemods` will figure out what codemods apply to your current version of Ember.js, and download and run them for you.

Expand Down
14 changes: 0 additions & 14 deletions bin/commands/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,10 @@ module.exports.handler = async function handler(argv) {
result = await emberCliUpdate(argv);
}

let ps = result.resolveConflictsProcess;
if (ps) {
process.stdin.pipe(ps.stdin);
ps.stdout.pipe(process.stdout);
ps.stderr.pipe(process.stderr);
}

let message = await result.promise;
if (message) {
console.log(message);
}

// since we are piping, not inheriting, the child process
// doesn't have the power to close its parent
if (ps) {
// eslint-disable-next-line no-process-exit
process.exit();
}
} catch (err) {
console.error(err);
}
Expand Down
15 changes: 0 additions & 15 deletions bin/commands/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ module.exports.describe = 'initialize a blueprint';
module.exports.builder = {
blueprint: args['blueprint'],
to: args['to'],
resolveConflicts: args['resolve-conflicts'],
outputRepo: args['output-repo'],
codemodsSource: args['codemods-source']
};
Expand All @@ -22,24 +21,10 @@ module.exports.handler = async function handler(argv) {
blueprintOptions: argv._.slice(1)
});

let ps = result.resolveConflictsProcess;
if (ps) {
process.stdin.pipe(ps.stdin);
ps.stdout.pipe(process.stdout);
ps.stderr.pipe(process.stderr);
}

let message = await result.promise;
if (message) {
console.log(message);
}

// since we are piping, not inheriting, the child process
// doesn't have the power to close its parent
if (ps) {
// eslint-disable-next-line no-process-exit
process.exit();
}
} catch (err) {
console.error(err);
}
Expand Down
14 changes: 0 additions & 14 deletions bin/commands/reset.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,10 @@ module.exports.handler = async function handler(argv) {
try {
let result = await reset(argv);

let ps = result.resolveConflictsProcess;
if (ps) {
process.stdin.pipe(ps.stdin);
ps.stdout.pipe(process.stdout);
ps.stderr.pipe(process.stderr);
}

let message = await result.promise;
if (message) {
console.log(message);
}

// since we are piping, not inheriting, the child process
// doesn't have the power to close its parent
if (ps) {
// eslint-disable-next-line no-process-exit
process.exit();
}
} catch (err) {
console.error(err);
}
Expand Down
5 changes: 0 additions & 5 deletions src/args.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ module.exports = {
type: 'string',
description: 'Update to a version that isn\'t latest ("2.14.1", "~2.15", "latest", "beta")'
},
'resolve-conflicts': {
type: 'boolean',
default: false,
description: 'Automatically run git mergetool if conflicts found'
},
'run-codemods': {
type: 'boolean',
default: false,
Expand Down
13 changes: 0 additions & 13 deletions src/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ module.exports = {
type: String,
default: args['to'].default
},
{
name: 'resolve-conflicts',
description: args['resolve-conflicts'].description,
type: Boolean,
default: args['resolve-conflicts'].default
},
{
name: 'run-codemods',
description: args['run-codemods'].description,
Expand Down Expand Up @@ -105,13 +99,6 @@ module.exports = {
result = await emberCliUpdate(options);
}

let ps = result.resolveConflictsProcess;
if (ps) {
process.stdin.pipe(ps.stdin);
ps.stdout.pipe(process.stdout);
ps.stderr.pipe(process.stderr);
}

await result.promise;
}
};
15 changes: 3 additions & 12 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ module.exports = async function emberCliUpdate({
packageName,
blueprint: _blueprint,
from,
to,
resolveConflicts
to
} = {}) {
// A custom config location in package.json may be reset/init away,
// so we can no longer look it up on the fly after the run.
Expand Down Expand Up @@ -177,16 +176,10 @@ module.exports = async function emberCliUpdate({
to = defaultTo;
}

if (resolveConflicts) {
// eslint-disable-next-line no-console
console.warn('`--resolve-conflicts` is deprecated. Please run `git mergetool` manually.');
}

let endBlueprint;

let {
promise,
resolveConflictsProcess
promise
} = await boilerplateUpdate({
cwd,
projectOptions: ({ packageJson }) => getProjectOptions(packageJson, blueprint),
Expand Down Expand Up @@ -223,7 +216,6 @@ module.exports = async function emberCliUpdate({
customDiffOptions
};
},
resolveConflicts,
createCustomDiff: true,
ignoredFiles: [await getBlueprintRelativeFilePath(cwd)]
});
Expand All @@ -243,7 +235,6 @@ module.exports = async function emberCliUpdate({
});

return result;
})(),
resolveConflictsProcess
})()
};
};
13 changes: 2 additions & 11 deletions src/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ module.exports = async function init({
packageName,
blueprint: _blueprint,
to = defaultTo,
resolveConflicts,
outputRepo,
codemodsSource,
blueprintOptions = []
Expand Down Expand Up @@ -127,18 +126,11 @@ module.exports = async function init({
init = true;
}

if (resolveConflicts) {
// eslint-disable-next-line no-console
console.warn('`--resolve-conflicts` is deprecated. Please run `git mergetool` manually.');
}

let {
promise,
resolveConflictsProcess
promise
} = await boilerplateUpdate({
cwd,
endVersion: blueprint.version,
resolveConflicts,
init,
createCustomDiff: true,
customDiffOptions: ({
Expand Down Expand Up @@ -168,7 +160,6 @@ module.exports = async function init({
}

return result;
})(),
resolveConflictsProcess
})()
};
};
6 changes: 2 additions & 4 deletions src/reset.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ module.exports = async function reset({
}

let {
promise,
resolveConflictsProcess
promise
} = await boilerplateUpdate({
cwd,
endVersion: blueprint.version,
Expand All @@ -115,8 +114,7 @@ module.exports = async function reset({
});

return result;
})(),
resolveConflictsProcess
})()
};
} catch (err) {
return { promise: Promise.reject(err) };
Expand Down
3 changes: 1 addition & 2 deletions test/acceptance/ember-addon-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ describe(function() {
bin: 'ember',
args: [
'update',
`--to=${to}`,
'--resolve-conflicts'
`--to=${to}`
],
cwd: tmpPath,
commitMessage,
Expand Down
3 changes: 1 addition & 2 deletions test/acceptance/ember-cli-update-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ describe(function() {
await beforeMerge();

let args = [
...to ? [`--to=${to}`] : [],
'--resolve-conflicts'
...to ? [`--to=${to}`] : []
];
if (listCodemods || runCodemods) {
args = [
Expand Down