Upgrade to Pro — share decks privately, control downloads, hide ads and more …

End your development environment nightmares 😱 w...

End your development environment nightmares 😱 with envinfo and Solidarity

Make developing for React Native easier by locking down your development environment using envinfo and Solidarity.

Avatar for Trevor Brindle

Trevor Brindle

July 11, 2019

More Decks by Trevor Brindle

Other Decks in Technology

Transcript

  1. The Problems • command not found • works on my

    computer • what version do you have? • what version do I need? • every issue template ever…
  2. THE WORST QUIZ EVER • What version of Bash was

    Globstar (**) added? • When was async/await added to Node? • When did Ruby add safe navigation (&.) ? • When did `npm install` start updating package-lock.json? • When was overflowchanged removed from Chrome?
  3. Story Time •cmd -v until you (╯°□°)╯︵ ┻━┻ •Read the

    whole story my blog •envinfo: An OSS Story •$ `react-native info`
  4. System: OS: Linux 4.9 Debian GNU/Linux 8 (jessie) CPU: x64

    Intel(R) Core(TM) i7-4870HQ [email protected] Memory: 327.91 MB / 1.991 GB Container: Yes Shell: 4.3.30 - /bin/bash Binaries: Node: 9.7.1 - /usr/local/bin/node Yarn: 1.5.1 - /usr/local/bin/yarn npm: 5.6.0 - /usr/local/bin/npm Languages: Bash: 4.3.30 - /bin/bash Python: 2.7.9 - /usr/bin/python
  5. npx envinfo@latest npm install -g envinfo && envinfo (pre npm

    5.2) ./envinfo-macos (look ma, no node dependency!) curl -L getenv.info | bash yarn add -D envinfo
  6. import { helpers } from 'envinfo'; const os = await

    helpers.getOSInfo(); const docker = await helpers.getDockerInfo(); console.log({ os, docker });
  7. So?

  8. !15

  9. { // I’m JSON5 - comment me! $schema: “http://json.schemastore.org/solidaritySchema", requirements:

    { Yarn: [ { rule: "cli", binary: "yarn", semver: "~1.5.1", error: "Yarn: You have {{installedVersion}}, and need {{wantedVersion}}. Update with `npm install -g yarn@{{wantedVersion}}` or `curl -o- -L https://yarnpkg.com/install.sh | bash -s -- -- version {{wantedVersion}}`" } ] } }
  10. Neat Tricks •npm “pre” hooks •unterminated escape codes •git config

    user.email •inject versions in error output •update snapshot on ci