firebase / firebase-js-sdk
- пятница, 19 мая 2017 г. в 03:12:40
JavaScript
Firebase Javascript SDK
The Firebase JavaScript SDK implements the client-side libraries used by applications using Firebase services. This SDK is distributed via:
<script src="https://www.gstatic.com/firebasejs/4.0.0/firebase.js"></script>
)To get starting using Firebase, see Add Firebase to your JavaScript Project.
Before you can start working on the Firebase JS SDK, you need to have Node.js 6.0 or greater installed on your machine. After doing this, you must also install the dependencies for this package.
To download Node.js visit https://nodejs.org/en/download/.
Once you've verified that you are using version 6.0 or later (run node -v
to see your
current running version of Node.js), you can install the dependencies by running:
$ npm install
NOTE: This package also maintains a yarn.lock
so you can get faster installs by installing
dependencies with yarn
instead.
The Firebase JS SDK is built and tested through a gulp pipeline. You will need to
have the gulp
command available on your system to run the tasks yourself.
To install gulp
simply run:
$ npm install -g gulp-cli
NOTE: Installing gulp-cli
is optional as you can simply leverage the npm commands
for most interactions.
Most of the tasks for interacting with the SDK are defined through gulp. If you installed gulp globally, you can run the following to see all of the available gulp tasks:
gulp --tasks
To run all tests for the SDK simply run: npm test
at the root of this package.
There are several types of available tests:
gulp test:unit
)gulp test:integration
)NOTE: You can execute each of these tasks on their own (e.g. you can run
gulp test:unit
to run exclusively the smoke tests from your CLI)
The Javascript SDK is built through a gulp pipeline.
To build the project run npm run build
in your CLI.
This will generate all of the output assets in a /dist
folder available at the
root of this project.
Each of the different types of source files are explained more in detail below.
Our source files are all located in the /src
directory. This currently contains
a variety of different sources (typescript, prebuilt binaries, legacy). We handle
each of these cases in our gulp pipeline.
This is the planned source language for this repo. As we are able, all components will be migrated to typescript and processed in the following flow:
To allow firebase to build from Github we consume prebuilt binaries of our components until the source is migrated to this repo.
These files are processed in the following flow:
firebase.js
.These files are built in this repo but are being migrated to typescript as we are able. Once these files are migrated, the associated build process, will be removed.
See Contributing for more information on contributing to the Firebase JavaScript SDK.