Skip to content

Commit e7dd1b8

Browse files
Merge #199
199: Add source directory r=curquiza a=Strift ## why Trying to fix the extension deployment and finally fix - #178 - #158 ## how Adding `sourceDirectory` in `extension.yaml` allowed me to deploy in local with: ```sh firebase ext:dev:upload meilisearch/firestore-meilisearch --local ``` I'm hoping it will also work with the non-local, allowing me to deploy the updated version. NB: running `npm run build` updated the `lib/*` file Co-authored-by: Strift <lau.cazanove@gmail.com>
2 parents 8e31e4b + c4e2f72 commit e7dd1b8

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

extension.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ license: Apache-2.0 # https://spdx.org/licenses/
3333
# Public URL for the source code of your extension
3434
sourceUrl: https://github.com/meilisearch/firestore-meilisearch
3535

36+
sourceDirectory: functions
37+
3638
releaseNotesUrl: https://github.com/meilisearch/firestore-meilisearch/releases
3739

3840
author:

functions/lib/import/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* limitations under the License.
1717
*/
1818
Object.defineProperty(exports, "__esModule", { value: true });
19-
const admin = require("firebase-admin");
19+
const firebase_admin_1 = require("firebase-admin");
2020
const config_1 = require("./config");
2121
const logs = require("../logs");
2222
const meilisearch_adapter_1 = require("../meilisearch-adapter");
@@ -25,11 +25,11 @@ const run = async () => {
2525
// Retrieve all arguments from the commande line.
2626
const config = await (0, config_1.parseConfig)();
2727
// Initialize Firebase using the Google Credentials in the GOOGLE_APPLICATION_CREDENTIALS environment variable.
28-
admin.initializeApp({
29-
credential: admin.credential.applicationDefault(),
28+
(0, firebase_admin_1.initializeApp)({
29+
credential: firebase_admin_1.credential.applicationDefault(),
3030
databaseURL: `https://${config.projectId}.firebaseio.com`,
3131
});
32-
const database = admin.firestore();
32+
const database = (0, firebase_admin_1.firestore)();
3333
// Initialize Meilisearch index.
3434
const index = (0, create_index_1.initMeilisearchIndex)(config.meilisearch);
3535
await retrieveCollectionFromFirestore(database, config, index);

0 commit comments

Comments
 (0)