@stoker-platform/cli 0.5.21 → 0.5.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,4 @@
1
+ {
2
+ "indexes": [],
3
+ "fieldOverrides": []
4
+ }
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoker-platform/cli",
3
- "version": "0.5.20",
3
+ "version": "0.5.22",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "main": "./lib/src/main.js",
@@ -24,7 +24,7 @@
24
24
  "@google-cloud/secret-manager": "^6.1.1",
25
25
  "@google-cloud/storage": "^7.18.0",
26
26
  "@inquirer/prompts": "^8.1.0",
27
- "@stoker-platform/node-client": "0.5.13",
27
+ "@stoker-platform/node-client": "0.5.14",
28
28
  "@stoker-platform/types": "0.5.5",
29
29
  "@stoker-platform/utils": "0.5.8",
30
30
  "algoliasearch": "^5.46.2",
@@ -2,7 +2,7 @@ import { generateSchema } from "../schema/generateSchema.js";
2
2
  import { lintSchema } from "../../lint/lintSchema.js";
3
3
  import { fileURLToPath } from "url";
4
4
  import { dirname, resolve } from "path";
5
- import { writeFileSync } from "fs";
5
+ import { existsSync, readFileSync, writeFileSync } from "fs";
6
6
  export const generateFirestoreIndexes = async () => {
7
7
  if (!process.env.URL_FIRESTORE_INDEXES) {
8
8
  throw new Error("STOKER_FIRESTORE_INDEXES_URL is not set");
@@ -19,5 +19,12 @@ export const generateFirestoreIndexes = async () => {
19
19
  method: "POST",
20
20
  });
21
21
  const indexes = await indexesResponse.json();
22
+ const customIndexesPath = resolve(__dirname, process.cwd(), "firebase-rules", "firestore.custom.indexes.json");
23
+ if (existsSync(customIndexesPath)) {
24
+ const customIndexesString = readFileSync(resolve(__dirname, process.cwd(), "firebase-rules", "firestore.custom.indexes.json"), "utf8");
25
+ const customIndexes = JSON.parse(customIndexesString);
26
+ indexes.indexes = [...indexes.indexes, ...customIndexes.indexes];
27
+ indexes.fieldOverrides = [...indexes.fieldOverrides, ...customIndexes.fieldOverrides];
28
+ }
22
29
  writeFileSync(resolve(__dirname, process.cwd(), "firebase-rules", "firestore.indexes.json"), JSON.stringify(indexes, null, 4));
23
30
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoker-platform/cli",
3
- "version": "0.5.21",
3
+ "version": "0.5.22",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "main": "./lib/src/main.js",