Skip to content
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

Add resolvePlugin and resolvePreset methods to babel-core API #4729

Merged

Commits on Oct 16, 2016

  1. Extract resolvePlugin method to babel-core public API

    This encapsulates the logic for turning an acceptable plugin name into
    the absolute path for that plugin. It can be used to preprocess a
    plugins list to map each plugin to its absolute path, which is necessary
    if `babel.transform` is going to be executed on a file outside the
    directory subtree where the plugins are installed.
    
    This adds a getPossiblePluginNames helper encapsulating the logic for
    what plugin names we should try to resolve, and the resolvePlugin method
    just calls this helper and actually resolves them.
    rmacklin committed Oct 16, 2016
    Configuration menu
    Copy the full SHA
    f4389a1 View commit details
    Browse the repository at this point in the history
  2. Extract resolvePreset method to babel-core public API

    This encapsulates the logic for turning an acceptable preset name into
    the absolute path for that preset. It can be used to preprocess a
    presets list to map each preset to its absolute path, which is necessary
    if `babel.transform` is going to be executed on a file outside the
    directory subtree where the presets are installed.
    
    This adds a getPossiblePresetNames helper encapsulating the logic for
    what preset names we should try to resolve, and the resolvePreset method
    just calls this helper and actually resolves them.
    rmacklin committed Oct 16, 2016
    Configuration menu
    Copy the full SHA
    e24f07d View commit details
    Browse the repository at this point in the history
  3. Remove unneeded tests

    Previously these were testing the logic that is now encapsulated in
    getPossiblePresetNames and tested in a unit test
    rmacklin committed Oct 16, 2016
    Configuration menu
    Copy the full SHA
    4ea1007 View commit details
    Browse the repository at this point in the history
  4. Extract resolveFromPossibleNames to remove duplicated logic

    "DRY"s the duplicated algorithm in resolvePlugin and resolvePreset
    rmacklin committed Oct 16, 2016
    Configuration menu
    Copy the full SHA
    6ec93d7 View commit details
    Browse the repository at this point in the history