@stoker-platform/cli 0.5.109 → 0.5.111

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.
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoker-platform/cli",
3
- "version": "0.5.108",
3
+ "version": "0.5.110",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "main": "./lib/src/main.js",
@@ -18,7 +18,9 @@ export const generateFirestoreRules = async () => {
18
18
  body: JSON.stringify({ schema }),
19
19
  method: "POST",
20
20
  });
21
- let rules = await rulesResponse.text();
21
+ const result = await rulesResponse.json();
22
+ let { rules } = result;
23
+ const { message } = result;
22
24
  const customRules = readFileSync(resolve(__dirname, process.cwd(), "firebase-rules", "firestore.custom.rules"), "utf8");
23
25
  const trimLastTwoBraces = (input) => {
24
26
  let trimmed = input.trimEnd();
@@ -32,4 +34,5 @@ export const generateFirestoreRules = async () => {
32
34
  rules = trimLastTwoBraces(rules);
33
35
  rules = `${rules}\n\n // CUSTOM SECURITY RULES\n\n ${customRules.split("\n").join("\n ")}\n }\n}`;
34
36
  writeFileSync(resolve(__dirname, process.cwd(), "firebase-rules", "firestore.rules"), rules);
37
+ console.log(message);
35
38
  };
@@ -19,6 +19,8 @@ export const generateStorageRules = async () => {
19
19
  body: JSON.stringify({ schema, edition }),
20
20
  method: "POST",
21
21
  });
22
- const rules = await rulesResponse.text();
22
+ const result = await rulesResponse.json();
23
+ const { rules, message } = result;
23
24
  writeFileSync(resolve(__dirname, process.cwd(), "firebase-rules", "storage.rules"), rules);
25
+ console.log(message);
24
26
  };
@@ -1,6 +1,5 @@
1
1
  import { generateSchema } from "../deploy/schema/generateSchema.js";
2
2
  import { getAccessFields, getField, getDependencyIndexFields, isDependencyField, isRelationField, getRoleGroups, getFieldCustomization, } from "@stoker-platform/utils";
3
- import { statSync } from "node:fs";
4
3
  import { join } from "node:path";
5
4
  import { pathToFileURL } from "node:url";
6
5
  /* eslint-disable security/detect-object-injection */
@@ -200,19 +199,6 @@ export const securityReport = async () => {
200
199
  }
201
200
  }
202
201
  }
203
- const filePath = join(process.cwd(), "firebase-rules", "firestore.rules");
204
- const fileStats = statSync(filePath);
205
- const rulesetSize = fileStats.size / 1024;
206
- if (rulesetSize > 256) {
207
- console.error(`[ERROR] Size of ruleset: ${rulesetSize.toFixed(2)} KB - Exceeds Maximum of 256 KB.`);
208
- isError = true;
209
- }
210
- else if (rulesetSize > 200) {
211
- console.warn(`[WARN] Size of ruleset: ${rulesetSize.toFixed(2)} KB.`);
212
- }
213
- else {
214
- console.log(`Size of ruleset: ${rulesetSize.toFixed(2)} KB.`);
215
- }
216
202
  if (isError) {
217
203
  throw new Error("Security errors found in schema.");
218
204
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoker-platform/cli",
3
- "version": "0.5.109",
3
+ "version": "0.5.111",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "main": "./lib/src/main.js",
@@ -24,9 +24,9 @@
24
24
  "@google-cloud/secret-manager": "^6.1.2",
25
25
  "@google-cloud/storage": "^7.19.0",
26
26
  "@inquirer/prompts": "^8.5.2",
27
- "@stoker-platform/node-client": "0.5.69",
28
- "@stoker-platform/types": "0.5.48",
29
- "@stoker-platform/utils": "0.5.60",
27
+ "@stoker-platform/node-client": "0.5.70",
28
+ "@stoker-platform/types": "0.5.49",
29
+ "@stoker-platform/utils": "0.5.61",
30
30
  "algoliasearch": "^5.53.0",
31
31
  "commander": "^15.0.0",
32
32
  "cross-spawn": "^7.0.6",