Skip to content

Commit 077b88b

Browse files
author
Brian Chen
authored
Update documentation to use yarn build (#1681)
* Add option to specify projectId in `yarn test:setup`. * Test set up details added to CONTRIBUTING.md in `firestore` package.
1 parent c2b6eb8 commit 077b88b

File tree

2 files changed

+44
-12
lines changed

2 files changed

+44
-12
lines changed

README.md

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ or [`N`](https://github.com/tj/n) to install and manage multiple node versions_
3636

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

39-
To install `yarn` follow the instructions listed on their website:
39+
To install `yarn` follow the instructions listed on their website:
4040
https://yarnpkg.com/en/docs/install
4141

4242
#### Java
@@ -70,6 +70,13 @@ by running the following at the root of the SDK:
7070
$ yarn
7171
```
7272

73+
Once you have installed all the dependencies, you can build the entire SDK by
74+
running the following command the root of the SDK:
75+
76+
```bash
77+
$ yarn build
78+
```
79+
7380
## Testing the SDK
7481

7582
### Test Setup
@@ -85,23 +92,29 @@ them below.
8592

8693
#### Authentication Support
8794

88-
Visit the authentication config in your project and enable the `Anonymous`
95+
Visit the authentication config in your project and enable the `Anonymous`
8996
sign-in provider to complete your project config.
9097

9198
#### Automated Setup
9299

93-
The remainder of the test setup can be done by running the following command at
94-
the root of the package:
100+
The remainder of the test setup requires choosing a test project. You can
101+
choose the project manually or specify the project directly at the root of
102+
the package.
95103

96104
```bash
97-
yarn test:setup
105+
# Select a project manually when running setup
106+
$ yarn test:setup
107+
108+
# Specify the specific project for setup
109+
$ yarn test:setup --projectId=<your-test-project>
98110
```
99111

100112
### Running the tests
101113

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

106119
```bash
107120
$ yarn test
@@ -115,13 +128,13 @@ an individual package directory.
115128
### Introduction
116129

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

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

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

136149
```bash
137-
yarn dev
150+
$ yarn dev
138151
```
139152

140153
### Prepush Hooks
141154

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

145158
- Automated code styling (using [`prettier`](https://npm.im/prettier))

packages/firestore/CONTRIBUTING.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,29 @@
22

33
See [Contributing](../../CONTRIBUTING.md) for general information on
44
contributing to the Firebase JavaScript SDK (including Cloud Firestore).
5+
Follow instructions there to install dependencies, build the SDK, and set up
6+
the testing environment.
7+
8+
## Setting up a project for testing
9+
10+
You will need a production project to test the Firestore SDK. You can create
11+
a new project by visiting the
12+
[Firebase Console](https://console.firebase.google.com/). Make sure that the
13+
project has Cloud Firestore enabled in the database section of the console.
14+
15+
See
16+
[Automated Setup](https://github.com/firebase/firebase-js-sdk#automated-setup)
17+
for more details.
18+
519

620
## Running Firestore Tests
21+
722
All commands must be run from this `packages/firestore/` directory.
23+
824
```
25+
# Come up to date on dependencies after performing git pull
26+
(cd ../../; yarn && yarn build)
27+
928
# Run all tests once (browser and node)
1029
yarn test
1130

0 commit comments

Comments
 (0)