Creating the Ideal Dev Environment
Ryan J. Salva, Microsoft
@ryanjsalva
DISCLAIMER
• There’s no such thing as an “ideal” dev environment.
• While I researched the tools used by surveying over 100
Cordova professionals, you may prefer something different.
• If you have a tip, preference or better tool, please share it!
Creating the Ideal Dev Environment
• Hardware
• Node Version Manager
• Globally Installed NPM Packages
• VS Code
• .bash_profile
• Android SDK
• Android Emulator
• Parallels
• Visual Studio
• Remote Build Agent
Hardware (Mac-based)
• 13-inch MacBook Pro with Retina display
• 3.1GHz Dual-core Intel Core i7, Turbo Boost up to 3.4GHz
• 16GB 1866MHz LPDDR3 SDRAM
• 1TB PCIe-based Flash Storage
• Intel Iris Graphics 6100
• OSX El Capitan
• Parallels or VM Ware Fusion Pro
Hardware (Windows-based)
• 13.5-inch Microsoft Surface Book
• 6th Gen Intel Core i7
• 1TB SSD
• 16GB RAM / dGPU
• Windows 10 Pro
• iOS Build Options
• PhoneGap Build
• MacInCloud
• Mac Mini
0.12.x 2.x all
>=4.0 2.x >=5.3.3
>=5.0 3.x >=5.4.1
6.x 3.X none
A Complicated Mess
sudo npm install -g cordova
...
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/ryanjsalva/npm-debug.log
npm ERR! not ok code 0
sudo npm install is a Bad Idea™
• npm install has the ability to run arbitrary scripts. If you
accidentally install malicious software with administrative
permissions, you’re giving away the keys to the kingdom
• Running sudo npm install (without -g) will create a local
directory that can only be altered by the root user.
• Even sudo npm install -g with a valid installation target can
mess things up for you and make it hard to use npm without
sudo. Admin will have directory permissions, making permission
errors with a local user likely in the future.
http://nvm.sh/
# install nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | bash
# confirm that nvm is installed
nvm --version
# install the latest stable release
nvm install v4.4.4
# make it the default
nvm alias default v4.4.4
# this is a Cordova dev environment, right?
npm install –g cordova
# UI framework
npm install –g cordova ionic
# live updates w/o re-submitting to the store
npm install –g cordova ionic code-push-cli
# future JS features today, req. by Ionic+Ng2
npm install –g cordova ionic code-push-cli
typescript
# simply build pipeline management
npm install –g cordova ionic code-push-cli
typescript gulp
# Xcode build from Windows
npm install –g cordova ionic code-push-cli
typescript gulp remotebuild
# Install and debug iOS apps w/o opening Xcode
npm install –g cordova ionic code-push-cli
typescript gulp remotebuild ios-deploy
# launch iOS simulator from CLI
npm install –g cordova ionic code-push-cli
typescript gulp remotebuild ios-deploy ios-sim
# enforce JavaScript code style guide
npm install –g cordova ionic code-push-cli
typescript gulp remotebuild ios-deploy ios-sim
eslint
# the baseline for our code style guide
npm install –g cordova ionic code-push-cli
typescript gulp remotebuild ios-deploy ios-sim
eslint eslint-plugin-standard
# enforce TypeScript code style guide
npm install –g cordova ionic code-push-cli
typescript gulp remotebuild ios-deploy ios-sim
eslint eslint-plugin-standard tslint
# framework agnostic livereload
npm install –g cordova ionic code-push-cli
typescript gulp remotebuild ios-deploy ios-sim
eslint eslint-plugin-standard tslint cdvlive
# That’s it! Install everything else locally
npm install –g cordova ionic code-push-cli
typescript gulp remotebuild ios-deploy ios-sim
eslint eslint-plugin-standard tslint cdvlive
.bash_profile
http://github.com/ryanjsalva/bash
Debug your code on any browser, emulator or device.
Increase speed & accuracy with Intellisense for plugins.
Invoke Cordova commands from the editor.
Visual Studio Code
VS Code Extensions
Cordova
cordova-tools
vscode-eslint
tslint
JS Native
vscode-react-native
nativescript
Google Emulators
Apple OSX
GenyMotion (requires VirtualBox)
Google SDK with HAX
Windows
Visual Studio Android Emulator
Building for Windows
• Visual Studio
• Tools for Apache Cordova
• Node 0.12 and NPM 2.2 (sandboxed)
• Android SDK
• Ant & Gradle
• Visual Studio Android Emulator

PhoneGap Day 2016 EU: Creating the Ideal Cordova Dev Environment

  • 1.
    Creating the IdealDev Environment Ryan J. Salva, Microsoft @ryanjsalva
  • 2.
    DISCLAIMER • There’s nosuch thing as an “ideal” dev environment. • While I researched the tools used by surveying over 100 Cordova professionals, you may prefer something different. • If you have a tip, preference or better tool, please share it!
  • 3.
    Creating the IdealDev Environment • Hardware • Node Version Manager • Globally Installed NPM Packages • VS Code • .bash_profile • Android SDK • Android Emulator • Parallels • Visual Studio • Remote Build Agent
  • 4.
    Hardware (Mac-based) • 13-inchMacBook Pro with Retina display • 3.1GHz Dual-core Intel Core i7, Turbo Boost up to 3.4GHz • 16GB 1866MHz LPDDR3 SDRAM • 1TB PCIe-based Flash Storage • Intel Iris Graphics 6100 • OSX El Capitan • Parallels or VM Ware Fusion Pro
  • 5.
    Hardware (Windows-based) • 13.5-inchMicrosoft Surface Book • 6th Gen Intel Core i7 • 1TB SSD • 16GB RAM / dGPU • Windows 10 Pro • iOS Build Options • PhoneGap Build • MacInCloud • Mac Mini
  • 6.
    0.12.x 2.x all >=4.02.x >=5.3.3 >=5.0 3.x >=5.4.1 6.x 3.X none A Complicated Mess
  • 7.
    sudo npm install-g cordova ... npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /Users/ryanjsalva/npm-debug.log npm ERR! not ok code 0
  • 8.
    sudo npm installis a Bad Idea™ • npm install has the ability to run arbitrary scripts. If you accidentally install malicious software with administrative permissions, you’re giving away the keys to the kingdom • Running sudo npm install (without -g) will create a local directory that can only be altered by the root user. • Even sudo npm install -g with a valid installation target can mess things up for you and make it hard to use npm without sudo. Admin will have directory permissions, making permission errors with a local user likely in the future. http://nvm.sh/
  • 9.
    # install nvm curl-o- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | bash # confirm that nvm is installed nvm --version # install the latest stable release nvm install v4.4.4 # make it the default nvm alias default v4.4.4
  • 10.
    # this isa Cordova dev environment, right? npm install –g cordova
  • 11.
    # UI framework npminstall –g cordova ionic
  • 12.
    # live updatesw/o re-submitting to the store npm install –g cordova ionic code-push-cli
  • 13.
    # future JSfeatures today, req. by Ionic+Ng2 npm install –g cordova ionic code-push-cli typescript
  • 14.
    # simply buildpipeline management npm install –g cordova ionic code-push-cli typescript gulp
  • 15.
    # Xcode buildfrom Windows npm install –g cordova ionic code-push-cli typescript gulp remotebuild
  • 16.
    # Install anddebug iOS apps w/o opening Xcode npm install –g cordova ionic code-push-cli typescript gulp remotebuild ios-deploy
  • 17.
    # launch iOSsimulator from CLI npm install –g cordova ionic code-push-cli typescript gulp remotebuild ios-deploy ios-sim
  • 18.
    # enforce JavaScriptcode style guide npm install –g cordova ionic code-push-cli typescript gulp remotebuild ios-deploy ios-sim eslint
  • 19.
    # the baselinefor our code style guide npm install –g cordova ionic code-push-cli typescript gulp remotebuild ios-deploy ios-sim eslint eslint-plugin-standard
  • 20.
    # enforce TypeScriptcode style guide npm install –g cordova ionic code-push-cli typescript gulp remotebuild ios-deploy ios-sim eslint eslint-plugin-standard tslint
  • 21.
    # framework agnosticlivereload npm install –g cordova ionic code-push-cli typescript gulp remotebuild ios-deploy ios-sim eslint eslint-plugin-standard tslint cdvlive
  • 22.
    # That’s it!Install everything else locally npm install –g cordova ionic code-push-cli typescript gulp remotebuild ios-deploy ios-sim eslint eslint-plugin-standard tslint cdvlive
  • 23.
  • 24.
    Debug your codeon any browser, emulator or device. Increase speed & accuracy with Intellisense for plugins. Invoke Cordova commands from the editor. Visual Studio Code
  • 25.
  • 26.
    Google Emulators Apple OSX GenyMotion(requires VirtualBox) Google SDK with HAX Windows Visual Studio Android Emulator
  • 27.
    Building for Windows •Visual Studio • Tools for Apache Cordova • Node 0.12 and NPM 2.2 (sandboxed) • Android SDK • Ant & Gradle • Visual Studio Android Emulator