npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

shippr

v0.0.2

Published

Pull Request Review Apps for create-react-native-app / Expo

Downloads

3

Readme

shippr

npm version Build Status License

Automatically Deploy Commits for create-react-native-app and Expo


shippr builds and deploys pull requests in your create-react-native-app (and other Expo-based) projects, and replies with a link you can open directly on your device or emulator.

Etymology /ɛtɪˈmɒlədʒi/

shippr /ˈapə/

noun

  • shippr - Pull Request Review Apps for React Native
  • shippr - Portmanteaux of app and PR.
  • shippr - Throwback to Web 2.0, when everything was bettr

What are "Review Apps"?

Mature technical organizations peer-review their code. Reviewing code on GitHub is simple enough: for most well-crafted pull requests, you can review the code diff in your browser, and either shipprove the changes, or request further improvements.

Testing another developer's changes isn't quite as easy. Typically, you will have to stash any work in progress in your own workspace, pull down the remote branch, install dependencies, compile and start the application before you can verify that the changes work as intended.

Since it was launched, I've loved Heroku's GitHub-integrated Review Apps. As part of your branch build, Heroku will spin up a new review instance of your application, which you can then access with a direct link from your GitHub pull request. Netlify offers the same functionality for deploying static websites.

Unfortunately, a one-click workflow like this doesn't exist for mobile development. To add insult to injury, the ramp-up time to test mobile app changes on your local device can be much longer than for web applications.

Enter shippr. Built on Expo and inspired by Expo Sketch, shippr aims to make peer-reviewing React Native app code as easy as static websites

Getting started

Add shippr to your project:

	yarn add -D shippr

Or, using npm:

	npm install --save-dev shippr

Add the shippr task to the scripts section of your package.json:

	scripts: {
+   "shippr": "node node_modules/shippr/bin/shippr",
	...
	}

Next, configure one of the currently supported CI environments:

Contributions for other CI platforms welcome.

Limitations

There are a few limitations you should be aware of. shippr is currently not able to deploy:

  1. React Native apps started with something other than create-react-native-app or Expo.
  2. Ejected React Native apps containing custom native module dependencies.
  3. Pull Requests from forked repositories. This is due to Travis security policies (wisely) not exposing secure environment variables to forked builds.

Configuring Travis

Travis CI is free for open source projects, and offers paid plans for private repositories. To get started, create an account on Travis using your GitHub login.

Add .travis.yml to your project

Add the following to your .travis.yml: (replacing YOUR-APP-NAME-HERE)

language: node_js
cache: yarn
env:
	- SHIPPR_ENV=travis
	- SHIPPR_NOTIFY_SERVICE=github
	- SHIPPR_APP_SLUG=YOUR-APP-NAME-HERE
script:
	- 'yarn test'
after_success:
	- 'SHIPPR_EVENT="$TRAVIS_EVENT_TYPE" yarn shippr'
deploy:
	provider: script
	script: 'SHIPPR_EVENT=release yarn shippr'
	skip_cleanup: true
	on:
		branch: master

This will configure your Travis build to use the latest Node.js and Yarn, and ensure that the shippr build only runs on Pull Request builds.

(Optional) Running tests

If you're not already using Travis, it's advisable to run your unit tests before deploying review apps. You can do this by adding other steps in the script section, and always leaving the shippr step last: script:

+ - yarn ci-test-command
	- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then yarn shippr; fi'

Note that the default test command in create-react-native-app runs Jest in --watch mode, which will hang forever. You can either change the test script in your package.json, or, or override the test command as above.

Enable Travis

The final step is to enable Travis CI on your repository. Log into your Travis account, and turn on the build for your project in your Profile.

After enabled, you'll be taken to your project build page. Before triggering the first build, you'll need to add a few secure environment variables to your build under More options > Settings:

  • EXP_USERNAME - Exponent username, under which to publish the review apps. Use your main account, or create a new one for review apps. All review apps will be unlisted, so only you can see them in your app listings.
  • EXP_PASSWORD - Exponent password for the publish user.
  • GITHUB_USERNAME - A user account you want to use for posting the review app links. Use your own, or create a new "bot" account and grant them access to your repo.
  • GITHUB_TOKEN - A Personal API Token of the user with access to the repository. If the repository is private, the token needs to be granted the full repo scope. For public repositories, the public_repo scope is enough.

Test it

You should now be able to create a new branch, make changes, and open a pull request. If the stars are aligned, the Travis build should publish the app to Expo!