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

@dreamwalk-os/react-native-apollo-template

v1.3.0

Published

DreamWalk React Native Apollo Template

Downloads

482

Readme

DreamWalk React-Native Template

Getting started

Initialise a project with the command

npx react-native init ProjectName --template @dreamwalk-os/react-native-apollo-template

This template is configured to use yarn. Once project has been initialised from template, run yarn; npx pod-install

Build Environments

Dev

  • Attached to dev backend, used for local development and pushing to DreamWalk Beta platform for internal builds
  • Reads from .env.development env file

UAT

  • Attached to UAT backend, used for pushing to DreamWalk Beta platform
  • Reads from .env.uat env file

Production

  • Attached to Production backend, used for pushing to App Store/Play Store.
  • Using clients Apple Developer account/Google Play production keystore
  • Reads from .env.production env file

Configure app icons

The template is configured to use differenet app icons for dev, UAT, and production environments.

For iOS: In Images asset catalog there is placeholder for each variants app icon which you must populate:

AppIcon Dev
AppIcon UAT
AppIcon

For Android: You must create image assets within all of the android/app/src/main/res/mipmap-XXX directories for the following:

ic_launcher
ic_launcher_round
ic_launcher_dev
ic_launcher_dev_round
ic_launcher_uat
ic_launcher_uat_round

This is easily achieved by creating a new Image Asset from within Android Studio and naming appropriately.

See the Android Studio docs for more information

Configure splash screen

This template uses react-native-bootsplash for handling splash screen. A default DreamWalk logo has been used but can be overridden. Generate a high res asset to be used as the splash image and run:

yarn react-native generate-bootsplash <logoPath>

Generate a launch screen using an original logo file (PNG or SVG)

Options:
  --background <color>  color used as launch screen background (in hexadecimal format) (default: "#fff")
  --logo-width <width>        logo width at @1x (in dp - we recommend approximately ~100) (default: 100)
  --assets-output [path]        path to your static assets directory (useful to require the logo file in JS)
  --flavor <flavor>           [android only] flavor build variant (outputs in an android resource directory other than "main")
  --platforms <platforms>     platforms to generate assets for (comma separated) (default: "android,ios")
  -h, --help                  output usage information

Full command usage example

yarn react-native generate-bootsplash assets/bootsplash_logo_original.png \
  --background=F5FCFF \
  --logo-width=100 \
  --assets-output=assets \
  --flavor=main \
  --platforms=android,ios

See the react-native-bootplash docs for more information

Configure Instabug

This template is configured to use Instabug for bug reporting in release variants of dev and UAT builds.

You'll need to create dev and UAT apps under DreamWalks Instabug account and put token into the instabug.init() call found in App.tsx

GraphQL

Setup

Configure the schema under src/graphql/codegen.yml to point to the GraphQL endpoint for the project.

  • Store queries and mutations under the following paths for them to be picked up by codegen: ['src/features/*/graphql/*.graphql', 'src/graphql/**/*.graphql', 'src/graphql/*.graphql']

Generating GraphQL

This application uses GraphQL CodeGen to automatically generate hooks and typescript typings for all our GraphQL queries and mutations.

Running yarn codegen will generate typescript Apollo hooks for any .graphql files in the the src/graphql/ directory or in the graphql subdirectory of a feature.

Versioning

Use one of the following bump scripts to increment versions. This will apply new version and build numbers across all iOS targets and Android.

npx bump
npx bump:major
npx bump:minor
npx bump:patch

These can be combined with the following flags:

Options:
  --type [major|minor|patch]           SemVer release type, optional if --skip-semver-for all is passed
  --skip-semver-for [android|ios|all]  Skips bump SemVer for specified platform
  --skip-code-for [android|ios|all]    Skips bump version codes for specified platform
  --semver                             Pass release version if known. Overwrites calculated SemVer. Optional.
  -h, --help                           output usage information

See the react-native-cli-bump-version docs for more information

Troubleshooting

Script stuck downloading

If you're install script is stuck endlessly downloading and/or stuck with last log:

idealTree: timing arborist:ctor Completed in 1ms

Verify you have yarn installed and re-run the init script. Yarn is required for this template

Permission denied (publickey)# DreamWalk React-Native Template

Getting started

Initialise a project with the command

npx react-native init ProjectName --template @dreamwalk-os/react-native-apollo-template

This template is configured to use yarn. Once project has been initialised from template, run yarn; npx pod-install

Configure splash screen

This template uses react-native-bootsplash for handling splash screen. A default DreamWalk logo has been used but can be overridden. Generate a high res asset to be used as the splash image and run:

yarn react-native generate-bootsplash <logoPath>

Generate a launch screen using an original logo file (PNG or SVG)

Options:
  --background-color <color>  color used as launch screen background (in hexadecimal format) (default: "#fff")
  --logo-width <width>        logo width at @1x (in dp - we recommend approximately ~100) (default: 100)
  --assets-path [path]        path to your static assets directory (useful to require the logo file in JS)
  --flavor <flavor>           [android only] flavor build variant (outputs in an android resource directory other than "main")
  --platforms <platforms>     platforms to generate assets for (comma separated) (default: "android,ios")
  -h, --help                  output usage information

Full command usage example

yarn react-native generate-bootsplash assets/bootsplash_logo_original.png \
  --background-color=F5FCFF \
  --logo-width=100 \
  --assets-path=assets \
  --flavor=main \
  --platforms=android,ios

See the react-native-bootplash docs for more information

Build Environments

Dev

  • Attached to dev backend, used for local development and pushing to DreamWalk Beta platform for internal builds
  • Reads from .env.development env file

UAT

  • Attached to UAT backend, used for pushing to DreamWalk Beta platform
  • Reads from .env.uat env file

Production

  • Attached to Production backend, used for pushing to App Store/Play Store.
  • Using clients Apple Developer account/Google Play production keystore
  • Reads from .env.production env file

GraphQL

Setup

Configure the schema under src/graphql/codegen.yml to point to the GraphQL endpoint for the project.

  • Store queries and mutations under the following paths for them to be picked up by codegen: ['src/features/*/graphql/*.graphql', 'src/graphql/**/*.graphql', 'src/graphql/*.graphql']

Generating GraphQL

This application uses GraphQL CodeGen to automatically generate hooks and typescript typings for all our GraphQL queries and mutations.

Running yarn codegen will generate typescript Apollo hooks for any .graphql files in the the src/graphql/ directory or in the graphql subdirectory of a feature.

Versioning

Use one of the following bump scripts to increment versions. This will apply new version and build numbers across all iOS targets and Android.

npx bump
npx bump:major
npx bump:minor
npx bump:patch

These can be combined with the following flags:

Options:
  --type [major|minor|patch]           SemVer release type, optional if --skip-semver-for all is passed
  --skip-semver-for [android|ios|all]  Skips bump SemVer for specified platform
  --skip-code-for [android|ios|all]    Skips bump version codes for specified platform
  --semver                             Pass release version if known. Overwrites calculated SemVer. Optional.
  -h, --help                           output usage information

See the react-native-cli-bump-version docs for more information

Troubleshooting

Script stuck downloading

If you're install script is stuck endlessly downloading and/or stuck with last log:

idealTree: timing arborist:ctor Completed in 1ms

Verify you have yarn installed and re-run the init script. Yarn is required for this template

Permission denied (publickey)

ins

[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Verify you have your ssh key added to keychain with

ssh-add --apple-use-keychain ~/.ssh/id_rsa

then re-run the init script

[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Verify you have your ssh key added to keychain with

ssh-add --apple-use-keychain ~/.ssh/id_rsa

then re-run the init script