Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tobiastengler/create-relay-app

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tobiastengler/create-relay-app

Easy configuration of Relay for existing projects

  • 0.0.0-experimental-e6e505b7a
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
39
increased by143.75%
Maintainers
1
Weekly downloads
 
Created
Source

create-relay-app

Easy configuration of Relay.js for existing projects

Latest version published to npm npm downloads per month Project license

Motivation

Setting up Relay can be quite time consuming. The goal of this project is to automate all of the manual setup steps involved, to give you a fast and consistent configuration experience across the most popular React toolchains.

Supported toolchains

create-relay-app supports:

Usage

Once you have scaffolded a project using your preferred toolchain of choice, simply execute the @tobiastengler/create-relay-app script in the directory of your project:

npx @tobiastengler/create-relay-app

Note: We are working on getting the create-relay-app name!

This will prompt you for a bunch of questions around your project setup. If you do not want to specify these options interactively, you can also specify them through the CLI arguments. Passing -y will infer all settings based on your project.

CLI arguments

npx @tobiastengler/create-relay-app [options]

-y, --yes

Skips any prompts and chooses default values for options that weren't supplied as CLI arguments.

-t, --toolchain <toolchain>

The toolchain, e.g. bundler and configuration, your project was setup with.

Possible values

Example

--toolchain vite

--typescript

If specified, we assume your project is built with Typescript.

-s, --schema-file <path>

Specifies the location of the GraphQL schema file inside of your project directory.

Possible values

A path relative to the root directory of your project and ending in the .graphql extension.

Example

--schema-file ./src/schema.graphql

-p, --package-manager <manager>

Specify the Node.js package manager to use when packages need to be installed.

Possible values

  • npm
  • yarn
  • pnpm

Example

--package-manager yarn

--ignore-git-changes

If specified, the script will not exit, if it's run in a directory with un-commited Git changes.

-v, --version

Displays the current version of the script.

-h, --help

Displays information about all of the available options.

Default values

If certain options are not specified as CLI arguments, we try to infer most of them from the directory you ran the script from.

--toolchain

If there is a next.config.js file in the root directory of your project, we assume it's a Next.js project, unless specified otherwise.

If there is a vite.config.js or vite.config.ts file in the root directory of your project, we assume it's a Vite.js project, unless specified otherwise.

If none of the files above are matched, we assume it's a Create React App project, unless specified otherwise.

--typescript

If the typescript package is installed or there is a tsconfig.json file in the root directory of your project, we assume you are using Typescript, unless specified otherwise.

--package-manager

If you run the script using yarn or pnpm, we use them as the default.

If we can't determine which package manger has run the script, we choose:

  • yarn, if yarn is installed and a yarn.lock file exists at the root of the project.
  • pnpm, if pnpm is installed and a pnpm-lock.yml file exists at the root of the project.
  • npm in all other cases.

--schema-file

./schema.graphql, unless specified otherwise.

--yes

false, unless specified.

--ignore-git-changes

false, unless specified.

FAQs

Package last updated on 13 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc