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

Recommend a different command for missing loaders based on the presence of yarn/npm lock files #291

Merged
merged 1 commit into from
Apr 12, 2018

Conversation

Lyrkan
Copy link
Collaborator

@Lyrkan Lyrkan commented Mar 30, 2018

This PR implements #288 by checking which kind of lock files are in the current directory before recommending the user a command to add missing loaders, for instance:

  • No lock file: yarn add <packages> --dev
  • yarn.lock: yarn add <packages> --dev
  • package-lock.json: npm install <packages> --save-dev
  • yarn.lock and packages-lock.json: yarn add <packages> --dev

Note that it doesn't fix #57 since that error message is currently only handled by friendly-errors-webpack-plugin.

Copy link
Member

@weaverryan weaverryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. Even as a yarn user, this always bothered me. About #57, I wonder if it's possible to not use any of the default handlers from friendly-errors-webpack-plugin and instead implement that one ourself.

@stof
Copy link
Member

stof commented Apr 3, 2018

AFAICT, it is not possible to disable core formatters in the plugin. So I suggest contributing to the plugin instead (there is already an issue discussing this in the plugin repo, and this is actually where I took the idea of checking lock files to perform the detection, but no PR is opened yet)

@weaverryan
Copy link
Member

Thank you @Lyrkan!

@weaverryan weaverryan merged commit f65bffa into symfony:master Apr 12, 2018
weaverryan added a commit that referenced this pull request Apr 12, 2018
…on the presence of yarn/npm lock files (Lyrkan)

This PR was merged into the master branch.

Discussion
----------

Recommend a different command for missing loaders based on the presence of yarn/npm lock files

This PR implements #288 by checking which kind of lock files are in the current directory before recommending the user a command to add missing loaders, for instance:

* No lock file: `yarn add <packages> --dev`
* yarn.lock: `yarn add <packages> --dev`
* package-lock.json: `npm install <packages> --save-dev`
* yarn.lock and packages-lock.json: `yarn add <packages> --dev`

Note that it doesn't fix #57 since that error message is currently only handled by `friendly-errors-webpack-plugin`.

Commits
-------

f65bffa Recommend a different command for missing packages based on the presence of yarn/npm lock files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

friendly-errors-webpack-plugin suggests npm install
3 participants