Skip to content

Commit 0fffbaf

Browse files
authored
Begin snippets for JS SDK vNext (firebase#32)
1 parent 9dc0d43 commit 0fffbaf

File tree

103 files changed

+3164
-17
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+3164
-17
lines changed

.github/workflows/test.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,16 @@ jobs:
2626
path: ~/.npm
2727
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
2828

29-
- run: npm install
29+
- name: Install dependencies
30+
run: |
31+
npm install
32+
npm run lerna-bootstrap
33+
34+
- name: Compile snippets
35+
run: npm run lerna-compile
36+
37+
- name: Check generated snippets
38+
run: |
39+
npm run snippets
40+
./scripts/checkdirty.sh
3041
31-
- name: "Lint and Test"
32-
run: ./scripts/test.sh

firestore-next/emulator-suite.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// [SNIPPETS_SEPARATION enabled]
2+
function onDocumentReady(firebaseApp) {
3+
// [START fs_emulator_connect]
4+
const { initializeFirestore } = require("firebase/firestore");
5+
6+
let settings = {};
7+
if (location.hostname === "localhost") {
8+
settings = {
9+
host: "localhost:8080",
10+
ssl: false
11+
};
12+
}
13+
14+
// firebaseApps previously initialized using initializeApp()
15+
const db = initializeFirestore(firebaseApp, settings);
16+
// [END fs_emulator_connect]
17+
}

firestore-next/package.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "firestore-next",
3+
"version": "1.0.0",
4+
"scripts": {
5+
"compile": "cp ../tsconfig.json.template ./tsconfig.json && tsc"
6+
},
7+
"license": "Apache-2.0",
8+
"dependencies": {
9+
"firebase": "^0.800.7"
10+
},
11+
"devDependencies": {
12+
"@types/chai": "^4.2.12",
13+
"@types/mocha": "^8.0.3",
14+
"chai": "^4.2.0",
15+
"mocha": "^8.1.3"
16+
}
17+
}

0 commit comments

Comments
 (0)