Skip to content

Update documentation to use yarn build #1681

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 25 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ or [`N`](https://github.com/tj/n) to install and manage multiple node versions_

In addition to Node.js we use `yarn` to facilitate multi package development.

To install `yarn` follow the instructions listed on their website:
To install `yarn` follow the instructions listed on their website:
https://yarnpkg.com/en/docs/install

#### Java
Expand Down Expand Up @@ -70,6 +70,13 @@ by running the following at the root of the SDK:
$ yarn
```

Once you have installed all the dependencies, you can build the entire SDK by
running the following command the root of the SDK:

```bash
$ yarn build
```

## Testing the SDK

### Test Setup
Expand All @@ -85,23 +92,29 @@ them below.

#### Authentication Support

Visit the authentication config in your project and enable the `Anonymous`
Visit the authentication config in your project and enable the `Anonymous`
sign-in provider to complete your project config.

#### Automated Setup

The remainder of the test setup can be done by running the following command at
the root of the package:
The remainder of the test setup requires choosing a test project. You can
choose the project manually or specify the project directly at the root of
the package.

```bash
yarn test:setup
# Select a project manually when running setup
$ yarn test:setup

# Specify the specific project for setup
$ yarn test:setup --projectId=<your-test-project>
```

### Running the tests

Each of the directories in the `integration` directory as well as the `packages`
directory have their own test suites. These can be run altogether by running the
following command at the root of the package:
directory have their own test suites. You will need to build the SDK before
running tests. Test suites can be run all together by running the following
command at the root of the package:

```bash
$ yarn test
Expand All @@ -115,13 +128,13 @@ an individual package directory.
### Introduction

The Firebase JS SDK is built with a series of individual packages that are all
contained in this repository. Development is coordinated via [yarn
workspaces](https://yarnpkg.com/blog/2017/08/02/introducing-workspaces/) and
contained in this repository. Development is coordinated via [yarn
workspaces](https://yarnpkg.com/blog/2017/08/02/introducing-workspaces/) and
[Lerna](https://lernajs.io/) (a monorepo management tool).

Each package in the `packages` directory, constitute a piece of our
implementation. The SDK is built via a combination of all of these packages
which are published under the [`firebase`
which are published under the [`firebase`
scope](https://www.npmjs.com/search?q=scope%3Afirebase) on NPM.

### Helper Scripts
Expand All @@ -134,12 +147,12 @@ watch tasks as well as a sandbox server.
You can run the dev script by running the following at the root of the package:

```bash
yarn dev
$ yarn dev
```

### Prepush Hooks

As part of this repo, we use the NPM package [`husky`](https://npm.im/husky) to
As part of this repo, we use the NPM package [`husky`](https://npm.im/husky) to
implement git hooks. We leverage the prepush hook to do two things:

- Automated code styling (using [`prettier`](https://npm.im/prettier))
Expand Down
19 changes: 19 additions & 0 deletions packages/firestore/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,29 @@

See [Contributing](../../CONTRIBUTING.md) for general information on
contributing to the Firebase JavaScript SDK (including Cloud Firestore).
Follow instructions there to install dependencies, build the SDK, and set up
the testing environment.

## Setting up a project for testing

You will need a production project to test the Firestore SDK. You can create
a new project by visiting the
[Firebase Console](https://console.firebase.google.com/). Make sure that the
project has Cloud Firestore enabled in the database section of the console.

See
[Automated Setup](https://github.com/firebase/firebase-js-sdk#automated-setup)
for more details.


## Running Firestore Tests

All commands must be run from this `packages/firestore/` directory.

```
# Come up to date on dependencies after performing git pull
(cd ../../; yarn && yarn build)

# Run all tests once (browser and node)
yarn test

Expand Down