Skip to content

Commit

Permalink
add code to support node 8
Browse files Browse the repository at this point in the history
  • Loading branch information
Kelly Selden authored and kellyselden committed Apr 12, 2020
1 parent ba89e01 commit 13e645c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions src/get-start-and-end-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ const nodeModulesIgnore = `
/node_modules/
`;

// remove when node 8 is dropped
const lastNode8Version = '3.16';

module.exports = function getStartAndEndCommands({
packageJson: { name: projectName },
baseBlueprint,
Expand Down Expand Up @@ -48,7 +51,7 @@ module.exports = function getStartAndEndCommands({
// first version that supports blueprints with versions
// `-b foo@1.2.3`
// https://github.com/ember-cli/ember-cli/pull/8571
startRange = endRange = '>=3.11.0-beta.1';
startRange = endRange = `>=3.11.0-beta.1 <${lastNode8Version}`;
}

return {
Expand Down Expand Up @@ -173,7 +176,7 @@ function runEmberRemotely({
let isGlimmer = blueprint.packageName === glimmerPackageName && blueprint.name === glimmerPackageName;

if (isCustomBlueprint || isGlimmer) {
args = ['ember-cli', ...args];
args = [`ember-cli@${lastNode8Version}`, ...args];
// args = ['-p', 'github:ember-cli/ember-cli#cfb9780', 'ember', 'new', projectName, `-dir=${directoryName}, '-sg', -sn', '-b', `${blueprint.packageName}@${blueprint.version}`];
} else {
args = ['-p', `ember-cli@${blueprint.version}`, 'ember', ...args];
Expand Down
6 changes: 3 additions & 3 deletions test/unit/get-start-and-end-commands-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ describe(_getStartAndEndCommands, function() {
name: blueprint,
version: startVersion
},
packageRange: '>=3.11.0-beta.1'
packageRange: '>=3.11.0-beta.1 <3.16'
},
endOptions: {
baseBlueprint: {
Expand All @@ -265,7 +265,7 @@ describe(_getStartAndEndCommands, function() {
name: blueprint,
version: endVersion
},
packageRange: '>=3.11.0-beta.1'
packageRange: '>=3.11.0-beta.1 <3.16'
}
});
});
Expand Down Expand Up @@ -335,7 +335,7 @@ describe(_getStartAndEndCommands, function() {

expect(npxStub.args).to.deep.equal([[
[
packageName,
`${packageName}@3.16`,
'new',
projectName,
'-sg',
Expand Down

0 comments on commit 13e645c

Please sign in to comment.