Skip to content
Snippets Groups Projects

Use yarn instead of npm in Makefile

Merged Robert Speicher requested to merge rs-yarn into master
All threads resolved!

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Maintainer

    I think we should also update the GDK documentation to include instructions to install yarn and an appropriate version of nodejs? /cc: @mikegreiling

  • Thanks @rspeicher. This has been on my todo list for a while.

    @stanhu yes we should, and if possible it would be nice to just have the GDK script check that node and yarn are both installed and at the correct minimum version (v4.3.0 for node, and v0.17.0 for yarn). It could show a helpful warning message if they are not, similar to our rake yarn:available task.

  • My main concern was merging something like this and then having gdk update break for everybody who doesn't have yarn installed, without a helpful indicator that they need to install a new dependency.

  • Robert Speicher marked as a Work In Progress

    marked as a Work In Progress

  • Ok. Figuring out/documenting how to get yarn installed on every supported platform is probably not something I'm going to take on right away, if ever, though.

    Edited by Robert Speicher
  • It may also be useful to run yarn check prior to spinning up the dev server in the procfile. That way gdk run db will fail with a more useful message if a yarn install is necessary (similar to how gdk run app gets preempted when bundler detects that a gem is missing. (This could be a separate MR though)

  • Well the commands needed for this are already in our omnibus build images, so it may be a simple matter of copy/paste from there, or just pointing the user to https://yarnpkg.com/en/docs/install and letting them figure it out

  • see: https://gitlab.com/gitlab-org/gitlab-omnibus-builder/merge_requests/30/diffs for the commands we use to build with yarn on our supported platforms

  • So apparently the proper fix isn't as simple as this, so I'm not sure I'll have time to finish it properly. Are you able to take over @mikegreiling?

  • yeah, I can take over @rspeicher

  • username-removed-636429 resolved all discussions

    resolved all discussions

  • I've added minimum version info and links to official installation guides for nodejs and yarn to the "requirements for all platforms" section of the prepare.md doc. I don't know if it would be worth the time to research installation instructions for every individual linux distribution (we haven't even done this for nodejs yet). I think this catch-all paragraph at the top should be good enough.

    I've also added a helpful error message for cases where yarn is not available while running gdk install or gdk update.

    $ brew unlink yarn
    $ gdk update
    
    ...
    
    Error: Yarn executable was not detected in the system.
    Download Yarn at https://yarnpkg.com/en/docs/install
    make: *** [yarn] Error 1

    I think this is enough sign-posting to prevent mass confusion when this MR goes in.

  • added 36 commits

    • c0693f82...8e123b62 - 31 commits from branch master
    • b3f1b703 - Use yarn instead of npm in Makefile
    • 83371d07 - add --pure-lockfile flag to ensure yarn does not modify yarn.lock when installing
    • 18c15cb5 - check that yarn is installed and print a useful error message if not
    • 01e5c762 - use yarn to run webpack-dev-server in Procfile
    • d9fe0935 - add installation requirements for node and yarn to documentation

    Compare with previous version

  • username-removed-636429 unmarked as a Work In Progress

    unmarked as a Work In Progress

  • Stan Hu mentioned in merge request !290 (merged)

    mentioned in merge request !290 (merged)

  • @mikegreiling Looks good to me!

  • Grzegorz Bizon mentioned in commit f241da3e

    mentioned in commit f241da3e

  • Please register or sign in to reply
    Loading