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

dev-client-mac-tools

v0.1.9

Published

Expo Config Plugin to add a Dev Tools Menu on the Mac

Downloads

79

Readme

Run your iOS expo dev client on your Mac

With testflight-dev-deploy developers can run expo dev client apps on their phones but also on their Macs. This makes it possible to develop expo apps on an Mac that hasn't installed Xcode at all: all you need are your javascript dev tools, an editor and the dev client app downloaded from TestFlight.

While this works it's not perfect: reloading the app, connecting to the debugger or opening the dev menu are possible but complicated.

mac-dev-tools fixes these issues. It provides a Dev menu on your Mac with some handy tools:

Commands

Toggle between dark and light mode

Reload the app

Show the Expo Dev Menu

Resize to preview common iPhone sizes

Custom Commands

To add your own commands to the dev menu you need to call the setCustomDevMenuItems function. You should wrap the call in a useEffect hook to make sure it doesn't run on every render.

You can easily add shortcut keys or submenus.

Here is an example where it's wrapped in its own hook:

import { setCustomDevMenuItems } from "dev-client-mac-tools";

const useGenerateDevMenu = () => {
  React.useEffect(() => {
    setCustomDevMenuItems([
      {
        title: "Say Hello",
        shortcut: "command-ctrl-alt-S",
        action: () => {
          console.log("Hello!");
        },
      },
      {
        title: "Menu with submenus",
        subitems: [
          {
            title: "Entry 1",
            action: () => {},
          },
          {
            title: "Entry 2",
            action: () => {},
          },
        ],
      },
    ]);
  }, []);
};

In production builds this javascript code is still included but it doesn't do anything.

Adding dev-client-mac-tools to your expo project

In order to use this plugin you need to configure your app in a way that allows in to be signed to run on your Mac first. I highly recommend using testflight-dev-deploy to do this is the easiest and most future proof way.

Next add dev-client-mac-tools using the expo cli.

expo install dev-client-mac-tools

The code injects itself into the debug build of the app so there is nothing you need to do. Just rebuild the app and run it on your Mac and you should see the menu.

By default the menu is only included in debug builds. In production builds the native code will automatically be compiled out.

(If you want to have tighter control when the menu is included and when not you can control it using the KDR_ENABLED preprocessor macro.)

Installing the Dev Client App from TestFlight on your developers Mac

Installation of the Dev Client App takes seconds and is extremly simple. No Xcode install, no build, no Simulator runtime download.

Updating the Dev Client App from TestFlight

Updating the Dev Client App is just one click or can even run automatically in the background.