This repository has been archived by the owner on May 11, 2018. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 158
[WIP] Add node's "engines" option #114
Closed
Closed
Changes from 9 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
2d51bba
Parse engines node’s version from package.json.
yavorsky 3f60aeb
Remove logs, move some staff to utils.
yavorsky 3036ac5
Fix linting.
yavorsky 0f1b25f
Fix indentation.
yavorsky 3134576
Add engines option to package.json.
yavorsky b88e5f8
Use options for isPluginRequired.
yavorsky 67f9c15
Add node-engines to fixtures.
yavorsky 7a5da94
Add engines and getLowestFromSemverValue tests.
yavorsky b97d48b
Fix lint warns.
yavorsky 568e0dc
Remove yarn.lock
yavorsky 899b906
Add yarn.lock to gitignore.
yavorsky f1e3efd
Consider devEngines.
yavorsky 29f7b6a
devEngines gt 4.x.
yavorsky f71eac9
Add BABEL_ENV production/development cases.
yavorsky 2d22e03
Cover ‘*’ and wrong semver format.
yavorsky 0696ea9
Fix indentation.
yavorsky ef95087
Use chrome is a number in node-engines fixtures.
yavorsky 1838b68
Update engines and devEngines.
yavorsky b20ff6c
Merge branch 'master' into node-engines
yavorsky be36460
Refactor config parsing. Add annotations.
yavorsky f6cafdc
Update tests
yavorsky f4c75bc
Concat root path with process.cwd()
yavorsky 9048897
Add engines/devEngines fixtures.
yavorsky 1667ab7
Update yarn.lock
yavorsky 419b3bc
Update yarn.lock.
yavorsky 4db8341
Remove yarn.lock from gitignore
yavorsky 8d0c085
Merge branch '2.0' into node-engines
yavorsky 20153f0
After merge fixes.
yavorsky a42a0a8
Fix environment
yavorsky ac38247
Fix all supported versions list
yavorsky 9268e16
Remove unused vars
yavorsky f16683e
Find package.json recursively.
yavorsky d8a97f0
Fix package path.
yavorsky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
export const _extends = Object.assign || function (target) { | ||
for (let i = 1; i < arguments.length; i++) { | ||
const source = arguments[i]; | ||
for (let key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
|
||
export const desemverify = (version) => { | ||
return parseFloat(version); | ||
}; | ||
|
||
export const semverify = (version) => { | ||
const isInt = version % 1 === 0; | ||
const stringified = version.toString(); | ||
const strEnd = isInt ? ".0.0" : ".0"; | ||
return stringified + strEnd; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
const a = "1"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
"use strict"; | ||
|
||
var a = "1"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"presets": [ | ||
["../../../../lib", { | ||
"targets": { | ||
"node": "engines", | ||
"chrome": "55" | ||
} | ||
}] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,22 @@ describe("babel-preset-env", () => { | |
}), { | ||
node: parseFloat(process.versions.node) | ||
}); | ||
|
||
}); | ||
|
||
it("should return the current node version with option 'engines'", function() { | ||
assert.deepEqual(babelPresetEnv.getTargets({ | ||
node: "engines" | ||
}), { | ||
node: 0.12 | ||
}); | ||
}); | ||
}); | ||
|
||
describe("getLowestFromSemverValue", () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit, but may want a test There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point! Need to cover |
||
it("should return the lowest supported version from semver value", function() { | ||
const lowestNodeVersion = babelPresetEnv.getLowestFromSemverValue(">=0.12", [4, 5, 6]); | ||
assert.equal(lowestNodeVersion, 4); | ||
}); | ||
}); | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0.10 here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, updated