Skip to content

Commit f7f52c4

Browse files
committed
Add command to export emulator data, import on start
1 parent 3c75576 commit f7f52c4

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

packages/catalog-server/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
/tsconfig.tsbuildinfo
66
*-debug.log
77

8+
/firebase-data/*
9+
!/firebase-data/.gitkeep
10+
811
index.js
912
index.js.map
1013
index.d.ts

packages/catalog-server/firebase-data/.gitkeep

Whitespace-only changes.

packages/catalog-server/package.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"test": "wireit",
2020
"test:manual": "wireit",
2121
"emulators:start": "wireit",
22+
"emulators:export": "wireit",
2223
"firebase": "firebase"
2324
},
2425
"wireit": {
@@ -64,13 +65,21 @@
6465
"output": []
6566
},
6667
"emulators:start": {
67-
"command": "firebase emulators:start --project wc-catalog",
68+
"command": "firebase emulators:start --project wc-catalog --import firebase-data",
6869
"service": true,
6970
"files": [
7071
"firebase.json",
7172
"firestore.indexes.json",
7273
"firestore.rules"
73-
]
74+
],
75+
"env": {
76+
"IMPORT": {
77+
"external": true
78+
}
79+
}
80+
},
81+
"emulators:export": {
82+
"command": "firebase emulators:export --project wc-catalog -f firebase-data"
7483
},
7584
"test:manual": {
7685
"command": "NODE_OPTIONS='--enable-source-maps' FIRESTORE_EMULATOR_HOST=localhost:7450 uvu test \"_test\\.js$\"",

0 commit comments

Comments
 (0)