-
-
Notifications
You must be signed in to change notification settings - Fork 158
Conversation
test/index.js
Outdated
}); | ||
}); | ||
|
||
describe("getLowestFromSemverValue", () => { |
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.
Nit, but may want a test *
returns null?
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.
Good point! Need to cover *
as well. Thanks!
Oh, lock.file, always forget 😤. I think we must add it to |
cc @sindresorhus since you expressed this idea (although as more of a default) in babel/babel#3476 (comment) |
Update:
|
package.json
Outdated
@@ -7,6 +7,12 @@ | |||
"license": "MIT", | |||
"repository": "https://github.com/babel/babel-preset-env", | |||
"main": "lib/index.js", | |||
"engines" : { | |||
"node" : ">=0.12.0" |
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
package.json
Outdated
"node" : ">=0.12.0" | ||
}, | ||
"devEngines" : { | ||
"node" : ">= 4.x" |
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.
we can do 6 here (I dont remember)
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.
👍
@hzoo Great improvement, but as you already commented, I'd like to see it as the default. Having the |
.gitignore
Outdated
.vscode | ||
yarn.lock |
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.
Why do you ignore yarn.lock
?
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.
@abouthiroppy yarn support will be added with the separate PR.
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.
So, to prevent commiting it every time unless it will be added, let's place it to .gitignore.
@sindresorhus I guess the only issue is that the node version is different than browser version if you are using it for front-end code. I can build with node 6 but still support ie? Not sure how we could now to do it automatically since we don't know if it's a node project. However we could make a wrapper for this that assumes node? Could make it |
@hzoo Maybe consider engines if no |
# Conflicts: # .gitignore # package.json # src/index.js # src/utils.js # test/index.spec.js # yarn.lock
Hey guys, i've noticed you asked me for |
I'm currently finishing off a kind of wrapper API around this preset and the latest CoffeeScript [v2] (for easy/zero config, to hook up source maps properly and because I want it for a bunch of Atom packages…) and had started to impliment my own check for One thing to mention also, is that in the case of Atom packages, Also +1 for getting rid of |
I'm with @yavorsky, here — I think |
Hey, that's an awesome feature. 🎉 {
"presets": [
[ "env", {
"targets": {
"node": { "node" : ">=0.12" },
"browsers": [ "chrome 54" ]
}
}]
]
} That would allow people to get the information from another source and pass it directly to the preset. I think that wouldn't be too hard because we can basically reuse the current logic. |
@k15a We can avoid {
"presets": [
[ "env", {
"targets": {
"node": ">=0.12"
}
}]
]
} |
@yavorsky Does the node field also accept ranges? I thought it currently only accepts version numbers. |
@k15a Not yet. When we will merge this PR it would be easy to handle semver values. |
Thanks for the PR!
This repo will be made read-only, as all of the issues/labels have been moved over as well. Please report any bugs and open pull requests over on the main mono-repo (against master which is v7) |
Motivation:
In many cases, targets'
node
option is matching engines from project'spackage.json
. Devs have to duplicate this value. In cases with ranges like> 0.12
they must determine next node.js version and specify it in env-preset'stargets
."current"
ortrue
option is not fully covering preset's mission. We could have last node, but maintain older versions.So for ex:
babelrc
package.json
will use targets: