From 6fbd09fedcf2271feda13a10fe6994d4d7fdfb76 Mon Sep 17 00:00:00 2001 From: Katie Gengler Date: Sun, 29 Sep 2019 20:25:58 -0400 Subject: [PATCH] Deprecate bower support in ember-try --- lib/utils/result-summary.js | 10 ++++++++++ test/tasks/try-each-test.js | 2 ++ test/utils/config-test.js | 4 ++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/utils/result-summary.js b/lib/utils/result-summary.js index 1c3c2d44..49875e74 100644 --- a/lib/utils/result-summary.js +++ b/lib/utils/result-summary.js @@ -35,6 +35,7 @@ module.exports = CoreObject.extend({ task.ui.writeLine(`with env: ${JSON.stringify(scenario.envState, null, 2)}`); } task._printDependencyTable(scenario.dependencyState); + task._deprecateBowerSupport(scenario.dependencyState); }); task.ui.writeLine(''); @@ -69,6 +70,15 @@ module.exports = CoreObject.extend({ task.ui.writeLine(table); task.ui.writeLine(''); }, + _deprecateBowerSupport(dependencyStatus) { + if (!dependencyStatus.length) { return; } + let anyBower = dependencyStatus.some(function(element) { + return element.packageManager === 'bower'; + }); + if (anyBower) { + this.ui.writeLine(chalk.yellow('DEPRECATION: The next major version of `ember-try` (v2.0) will drop support for installing dependencies with `bower`.')); + } + }, _printResultsSummary(countFailed, countPassed, allowedFailCount, total) { let task = this; if (countFailed) { diff --git a/test/tasks/try-each-test.js b/test/tasks/try-each-test.js index 9874d033..e2c7d163 100644 --- a/test/tasks/try-each-test.js +++ b/test/tasks/try-each-test.js @@ -155,6 +155,8 @@ describe('tryEach', () => { expect(output).to.include('Scenario second: SUCCESS'); expect(output).to.include('Scenario with-bower-resolutions: SUCCESS'); + expect(output).to.include('DEPRECATION: The next major version of `ember-try` (v2.0) will drop support for installing dependencies with `bower`.'); + let tables = output.filter((line) => { return typeof line === "object"; }); diff --git a/test/utils/config-test.js b/test/utils/config-test.js index efbb9892..456633cf 100644 --- a/test/utils/config-test.js +++ b/test/utils/config-test.js @@ -37,7 +37,7 @@ describe('utils/config', () => { } describe('addImplicitBowerToScenarios', () => { - it('adds an npm with a bower dev depencency for scenarios that have only bower', () => { + it('adds an npm with a bower dev dependency for scenarios that have only bower', () => { expect(addImplicitBowerToScenarios({ scenarios: [{ name: 'bower-only', @@ -52,7 +52,7 @@ describe('utils/config', () => { }); }); - it('adds a bower dev dependency for scnearios that have bower and npm', () => { + it('adds a bower dev dependency for scenarios that have bower and npm', () => { expect(addImplicitBowerToScenarios({ scenarios: [{ name: 'bower-and-npm',