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 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-native-yarn-workspaces

v1.1.2

Published

Enables to work with react-native and yarn workspaces easily

Readme

RNW

This package offers an all-in-one solution to work with react-native toghether with yarn workspaces.

As symlinks don't work with react-native, rnw wraps wml and configures it in an easy way for you to use.

Example app

Here's a working example of this package.

UNIVERSE

Prerequisite (skip if your workspaces are already setup)

Let's assume that you have a project structure similar to this. But of course yours can be different. The only thing that matters is just to have separate packages handled by yarn workspaces.

- myproject/
-- package.json (defines workspaces and could use lerna)

-- app-mobile/
--- package.json

-- app-web/
--- package.json

-- packages/
--- core/
---- package.json

myproject/package.json

This will define your yarn workspaces. You can include your apps in the workspaces like so.

"name": "myproject",
"private": true,
"workspaces": {
    "packages": [
        "packages/*",
        "app-*"
    ]
},
"scripts": {
    "bootstrap": "lerna bootstrap"
}

app-mobile/package.json

This is your react-native app. Never hoist react-native-yarn-workspaces.

{
  "name": "app-mobile",
  "private": true,
  "scripts": {
    "postinstall": "rnw link ../packages",
    "watch": "rnw watch",
    "flush": "watchman watch-del-all",
    "start": "expo start"
  },
  "workspaces": {
    "nohoist": [
      "expo",
      "expo/**",
      "react",
      "react/**",
      "react-native",
      "react-native/**",
      "react-native-yarn-workspaces",
      "react-native-yarn-workspaces/**"
    ]
  },
  "dependencies": {
    "@mypackages/core": "1.0.0",
    "expo": "^35.0.0",
    "react": "16.8.3",
    "react-dom": "16.8.3",
    "react-native": "https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz"
  },
  "devDependencies": {
    "react-native-yarn-workspaces": "1.1.0",
    "babel-preset-expo": "^7.0.0"
  }
}

app-web/package.json

{
  "name": "app-web",
  "dependencies": {
    "@mypackages/core": "1.0.0"
  }
}

packages/core/package.json

These are the modules that app-web and app-mobile share. There's nothing particular to mention here. Just that react, react-dom and react-native are peerDependencies.

How to use

In your mobile app: Add react-native-yarn-workspaces to your mobile app dependencies.

yarn add -D react-native-yarn-workspaces

Your local packages should be specified in dependencies or devDependencies. Never hoist this package.

"name": "app-mobile",
"private": true,
"scripts": {
    "postinstall": "rnw link ../packages",
    "watch": "rnw watch"
},
"workspaces": {
    "nohoist": [
      ...
      "react-native-yarn-workspaces",
      "react-native-yarn-workspaces/**"
    ]
  },
"dependencies": {
    "@mypackages/core": "1.0.0"
}

In your mobile app: Link your local packages manually Or skip and install all your deps with yarn or lerna bootstrap from one level up.

yarn postinstall

In your mobile app: Watch for the changes that happen in packages/core by running this in your mobile app.

yarn watch

Of course, in order to have changes actually happening, you may be "watch building" in your packages as well, for instance with babel src -d dist --watch in packages/core.

If you need to flush one day

watchman watch-del-all

Recommended

This bin creates a .watchmanconfig in each of your local packages, for instance packages/core/.watchmanconfig. I recommend to also ignore src if you're building that package wit babel/webpack/rollup.

// .watchmanconfig
{
  "ignore_dirs": [
    "node_modules",
    "src"
  ]
}