-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add ava/babel
as a shortcut for including AVA's Babel presets
#1225
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
Comments
We have |
No, not |
Ah. I think we should wait and see how the new presets get used, especially as we improve our Babel support. |
Could you explain that more? I didn't get the point. |
See if and how people use |
Turns out a preset like this is suggested in RFC 001:
Though I suspect we may have to parse the options looking for that preset, and then replacing it with |
Always extend the project's Babel configuration, if any. Always apply the `@ava/stage-4` preset. Fixes #1488. Users can disable this preset by adding it to the AVA's Babel configuration with the `false` option: ``` "ava": { "babel": { "presets": [ ["ava/stage-4", false] ] } } And yes, `ava/stage-4` so now an alias for the preset, which means it can be used even if the preset is not installed as a top-level dependency. Fixes #1225. `@ava/transform-test-files` is applied as part of the test compilation, but cannot be overridden by users like `@ava/stage-4` can.
#1608 implements |
Always extend the project's Babel configuration, if any. Always apply the `@ava/stage-4` preset. Fixes #1488. Users can disable this preset by adding it to the AVA's Babel configuration with the `false` option: ``` "ava": { "babel": { "presets": [ ["ava/stage-4", false] ] } } And yes, `ava/stage-4` so now an alias for the preset, which means it can be used even if the preset is not installed as a top-level dependency. Fixes #1225. `@ava/transform-test-files` is applied as part of the test compilation, but cannot be overridden by users like `@ava/stage-4` can.
Fixes #1598. Switches AVA's Babel implementation to use Babel 7. This applies to test and helper file compilation. Adds a `compileEnhancements` option which can be set to `false` to disable Power Assert and our `t.throws()` helper. Changes the Babel configuration. If you had this before: ```json "ava": { "babel": { "plugins": [] } } ``` You'll now need: ```json "ava": { "babel": { "testOptions": { "plugins": [] } } } ``` `ava.babel.testOptions.babelrc` now defaults to `true`. You can disable our stage-4 preset by adding `["ava/stage-4", false]` to `ava.babel.testOptions.presets`. Set `ava.babel` to `false` to disable AVA's test file compilation, **whilst still compiling enhancements**. If `compileEnhancements` is *also* set to `false` then Babel is skipped completely. Fixes #1225, #1488 and #1556.
It seems to be a good convention across the community (glamor, next.js, more) to provide a shortcut for auto-including Babel settings. If user wants to customize presets, right now he has to include these presets manually. What I'm proposing:
It would also significantly simplify the creation of tools like ava-preact-init, ava-react-init, ava-inferno-init, etc. If we provide a simple entrypoint for these presets, we won't need to update each of these modules when we change something in our presets.
The text was updated successfully, but these errors were encountered: